@banmao/blocks 0.0.1-alpha.9 → 0.0.2
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/components/Login/src/components/LoginForm.d.ts +1 -1
- package/dist/components/Login/src/index.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +273 -341
- package/package.json +15 -15
|
@@ -26,7 +26,7 @@ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropType
|
|
|
26
26
|
actions: {
|
|
27
27
|
type: PropType<LoginProps["actions"]>;
|
|
28
28
|
};
|
|
29
|
-
}>, () => import(
|
|
29
|
+
}>, () => import('vue/jsx-runtime').JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, (keyof globalThis.LoginEmits)[], keyof globalThis.LoginEmits, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
30
30
|
title: {
|
|
31
31
|
type: PropType<LoginProps["title"]>;
|
|
32
32
|
default: string;
|
|
@@ -37,7 +37,7 @@ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropType
|
|
|
37
37
|
actions: {
|
|
38
38
|
type: PropType<LoginProps["actions"]>;
|
|
39
39
|
};
|
|
40
|
-
}>, () => import(
|
|
40
|
+
}>, () => import('vue/jsx-runtime').JSX.Element, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, (keyof globalThis.LoginEmits)[], keyof globalThis.LoginEmits, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
41
41
|
title: {
|
|
42
42
|
type: PropType<LoginProps["title"]>;
|
|
43
43
|
default: string;
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});require('./index.css');let e=require("vue"),t=require("naive-ui");var n=[`finish`,`error`,`captcha`,`wechatFinish`],r={title:{type:String,default:`Welcome back`},subTitle:{type:String,default:`Login to your account`},layout:{type:String,default:`simple`},bg:{type:String,default:``},forgotUrl:{type:String,default:``},signUpUrl:{type:String,default:``},bgImageUrl:{type:String,default:``},logo:{type:Function},imagePosition:{type:String,default:`right`},actions:{type:Array}},i={title:{type:String,default:`Welcome back`},subTitle:{type:String,default:`Login to your account`},forgotUrl:{type:String,default:``},signUpUrl:{type:String,default:``},radius:{type:[Number,Boolean],default:8},shadow:{type:Boolean,default:!0},actions:{type:Array}},a=(0,e.defineComponent)({name:`LoginForm`,props:i,emits:n,setup(n,{emit:r,slots:i}){let{actions:a,title:o,subTitle:s,signUpUrl:c,forgotUrl:l,shadow:u,radius:d}=n,f=(0,e.reactive)({username:``,password:``}),p=(0,e.ref)(!1),m={username:[{required:!0,message:`请输入用户名`,trigger:`blur`},{min:3,max:10,message:`长度在 3 到 10 个字符`,trigger:`blur`}],password:[{required:!0,message:`请输入密码`,trigger:`blur`},{min:6,max:20,message:`长度在 6 到 20 个字符`,trigger:`blur`}]},h=(0,e.ref)(null),g=()=>{h.value?.validate(t=>{t?(console.error(t),r(`error`,t)):r(`finish`,(0,e.toRaw)(f))})},_=()=>{console.error(`Weixin login is not supported yet.`),r(`wechatFinish`)};return()=>(0,e.createVNode)(`div`,{class:[`bm-login-form`,{"bm-login-form-shadow":u}],style:[{borderRadius:d?`${d}px`:`none`}]},[(0,e.createVNode)(`div`,{class:`bm-login-title`},[o]),(0,e.createVNode)(`div`,{class:`bm-login-sub-title`},[s]),i.default?i.default():(0,e.createVNode)(t.NForm,{ref:h,model:f,rules:m,size:`large`,"show-require-mark":!1},{default:()=>[(0,e.createVNode)(t.NFormItem,{label:`用户名`,path:`username`},{default:()=>[(0,e.createVNode)(t.NInput,{value:f.username,"onUpdate:value":e=>f.username=e,placeholder:`请输入用户名`},null)]}),(0,e.createVNode)(t.NFormItem,{label:`密码`,path:`password`},{default:()=>[(0,e.createVNode)(t.NInput,{value:f.password,"onUpdate:value":e=>f.password=e,placeholder:`请输入密码`,type:`password`},null)]}),(0,e.createVNode)(`div`,{class:`bm-login-password-forgot`},[(0,e.createVNode)(t.NCheckbox,{checked:p.value,"onUpdate:checked":e=>p.value=e,label:`记住密码`},null),l&&(0,e.createVNode)(`a`,{href:l},[(0,e.createTextVNode)(`忘记密码?`)])]),(0,e.createVNode)(t.NFormItem,{showLabel:!1},{default:()=>[(0,e.createVNode)(t.NButton,{"attr-type":`button`,type:`primary`,block:!0,onClick:()=>g()},{default:()=>[(0,e.createTextVNode)(`登录`)]})]}),a&&(0,e.createVNode)(t.NFormItem,{showLabel:!1},{default:()=>[(0,e.createVNode)(t.NButton,{color:`#02E16E`,ghost:!0,block:!0,onClick:()=>_()},{default:()=>[(0,e.createTextVNode)(`微信登录`)]})]})]}),c&&(0,e.createVNode)(`div`,{class:`bm-login-sign-up`},[(0,e.createTextVNode)(`还没有账号?`),(0,e.createVNode)(`a`,{href:c},[(0,e.createTextVNode)(`立即注册`)])])])}});function o(t){return typeof t==`function`||Object.prototype.toString.call(t)===`[object Object]`&&!(0,e.isVNode)(t)}var s=(0,e.defineComponent)({name:`LoginPage`,props:r,emits:n,setup(t,{emit:n,slots:r}){let{layout:i,bg:s,bgImageUrl:c,imagePosition:l,...u}=t,d=(0,e.computed)(()=>l===`right`);return()=>{if(r.default){let s;if(i===`column`){let i;return(0,e.createVNode)(`div`,{class:[`bm-login-container`,`bm-login-column`]},[(0,e.createVNode)(`div`,{class:`bm-login-column-item`,style:{order:d.value?1:2}},[d.value&&(0,e.createVNode)(`div`,{class:`bm-login-logo`},[r.logo?.()]),(0,e.createVNode)(a,(0,e.mergeProps)(u,{shadow:!1,radius:!1,onFinish:e=>n(`finish`,e)}),o(i=r.default())?i:{default:()=>[i]})]),(0,e.createVNode)(`div`,{class:`bm-login-column-muted`,style:{order:d.value?2:1}},[!d.value&&(0,e.createVNode)(`div`,{class:`bm-login-logo`},[r.logo?.()]),t.bgImageUrl&&(0,e.createVNode)(`img`,{src:t.bgImageUrl,alt:`Image`,class:`bm-login-column-muted-image`},null)])])}if(i===`card`){let t;return(0,e.createVNode)(`div`,{class:[`bm-login-container`,`bm-login-flex-center`,`bm-login-card-wrapper`],style:{backgroundImage:c?`url(${c})`:`transparent`}},[(0,e.createVNode)(`div`,{class:`bm-login-logo`},[r.logo?.()]),(0,e.createVNode)(`div`,{class:`bm-login-card-img-cover`},null),(0,e.createVNode)(`div`,{class:`bm-login-card`,style:{flexDirection:d.value?`row`:`row-reverse`}},[(0,e.createVNode)(`div`,{class:[`bm-login-card-column-item`]},[(0,e.createVNode)(a,(0,e.mergeProps)(u,{shadow:!1,radius:!1,onFinish:e=>n(`finish`,e)}),o(t=r.default())?t:{default:()=>[t]})]),(0,e.createVNode)(`div`,{class:[`bm-login-card-column-muted`],style:{width:`350px`}},[c&&(0,e.createVNode)(`img`,{src:c,alt:`Image`,class:`bm-login-column-muted-image`},null)])])])}return(0,e.createVNode)(`div`,{class:[`bm-login-container`,`bm-login-flex-center`],style:{backgroundImage:`url(${c})`,backgroundSize:`cover`}},[(0,e.createVNode)(`div`,{class:[`bm-login-content-stack`]},[r.logo?.(),(0,e.createVNode)(a,(0,e.mergeProps)(u,{onFinish:e=>n(`finish`,e)}),o(s=r.default())?s:{default:()=>[s]})])])}return i===`column`?(0,e.createVNode)(`div`,{class:[`bm-login-container`,`bm-login-column`,{"bm-login-column-reverse":t.imagePosition===`left`}]},[(0,e.createVNode)(`div`,{class:`bm-login-column-item`},[d.value&&(0,e.createVNode)(`div`,{class:`bm-login-logo`},[r.logo?.()]),(0,e.createVNode)(a,(0,e.mergeProps)(u,{shadow:!1,radius:!1,onFinish:e=>n(`finish`,e)}),null)]),(0,e.createVNode)(`div`,{class:`bm-login-column-muted`},[!d.value&&(0,e.createVNode)(`div`,{class:`bm-login-logo`},[r.logo?.()]),t.bgImageUrl&&(0,e.createVNode)(`img`,{src:t.bgImageUrl,alt:`Image`,class:`bm-login-column-muted-image`},null)])]):i===`card`?(0,e.createVNode)(`div`,{class:[`bm-login-container`,`bm-login-flex-center`,`bm-login-card-wrapper`],style:{backgroundImage:c?`url(${c})`:`transparent`,backgroundSize:`cover`}},[(0,e.createVNode)(`div`,{class:`bm-login-logo`},[r.logo?.()]),(0,e.createVNode)(`div`,{class:`bm-login-card-img-cover`},null),(0,e.createVNode)(`div`,{class:`bm-login-card`,style:{flexDirection:d.value?`row`:`row-reverse`}},[(0,e.createVNode)(`div`,{class:[`bm-login-card-column-item`]},[(0,e.createVNode)(a,(0,e.mergeProps)(u,{shadow:!1,radius:!1,onFinish:e=>n(`finish`,e)}),null)]),(0,e.createVNode)(`div`,{class:[`bm-login-card-column-muted`],style:{width:`350px`}},[c&&(0,e.createVNode)(`img`,{src:c,alt:`Image`,class:`bm-login-column-muted-image`},null)])])]):(0,e.createVNode)(`div`,{class:[`bm-login-container`,`bm-login-flex-center`],style:{backgroundImage:`url(${c})`,backgroundSize:`cover`}},[(0,e.createVNode)(`div`,{class:[`bm-login-content-stack`]},[r.logo?.(),(0,e.createVNode)(a,u,null)])])}}});exports.Login=s,exports.loginEmits=n,exports.loginFormProps=i,exports.loginProps=r;
|
package/dist/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
.bm-login-container{--bm-login-color-link:#296dff;--bm-login-color-text:#303036;--bm-login-color-text-dark:#f4f4f5;--bm-login-color-section-text:#484851;--bm-login-color-section-text-dark:#e4e4e7;--bm-login-img-cover-color:oklch(100% 0 none/.6);--bm-login-img-cover-color-dark:oklch(30% 0 none/.6);--bm-login-bg:oklch(100% 0 none/.8);--bm-login-bg-dark:oklch(25% 0 none/.8);--bm-login-shadow:oklch(0% 0 none/.2);--bm-login-bg-muted:oklch(25% .003 24);width:100%;height:100svh;position:relative}.bm-login-flex-center{justify-content:center;align-items:center;display:flex}.bm-login-content-stack{flex-direction:column;justify-content:center;align-items:center;gap:16px;display:flex}.bm-login-form{background:var(--bm-login-bg);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);box-sizing:border-box;min-width:350px;padding:32px 32px 24px}.bm-login-card .bm-login-form{width:100%}.bm-login-column .bm-login-form{background:0 0}.bm-login-form-shadow{box-shadow:0 2px 12px 0 var(--bm-login-shadow)}.bm-login-title{color:var(--bm-login-color-text);font-size:20px;font-weight:700}.bm-login-sub-title{color:var(--bm-login-color-section-text);margin-bottom:32px;font-size:16px}.bm-login-sign-up{text-align:center;color:var(--bm-login-color-text)}.bm-login-sign-up a,.bm-login-link{color:var(--bm-login-color-link);text-decoration:none}.bm-login-password-forgot{justify-content:space-between;align-items:center;width:100%;margin-bottom:16px;display:flex}.bm-login-password-forgot a{color:var(--bm-login-color-link);text-decoration:none}.bm-login-column{display:grid}.bm-login-column-reverse{direction:rtl}.bm-login-column-reverse>*{direction:ltr}.bm-login-card{box-sizing:border-box;width:100%;max-width:48rem;box-shadow:0 2px 12px 0 var(--bm-login-shadow);border-radius:.5rem;display:flex;overflow:hidden}.bm-login-card-column-item{flex-direction:column;flex:1;justify-content:center;align-items:center;display:flex}.bm-login-card-column-muted{background-color:var(--bm-login-bg-muted);flex:1;width:100%;display:none;position:relative}.bm-login-logo{z-index:9;min-width:64px;height:64px;position:absolute;top:20px;left:20px}.bm-login-column-item{flex-direction:column;justify-content:center;align-items:center;gap:1rem;display:flex;position:relative}.bm-login-column-muted{background-color:var(--bm-login-bg-muted);width:100%;display:none;position:relative}.bm-login-column-muted-image{object-fit:cover;width:100%;height:100%;position:absolute;inset:0}@media screen and (width<=1199px){.bm-login-column-item{padding:40px}}@media screen and (width<=1200px){.bm-login-card{max-width:24rem}}@media screen and (width>=1200px){.bm-login-column{grid-template-columns:repeat(2,minmax(0,1fr))}.bm-login-column-muted,.bm-login-card-column-muted{display:block}}.dark .bm-login-column-muted-image{filter:grayscale(40%)}.dark .bm-login-form{background-color:var(--bm-login-bg-dark)}.dark .bm-login-title{color:var(--bm-login-color-text-dark)}.dark .bm-login-sub-title{color:var(--bm-login-color-section-text-dark)}@media (prefers-color-scheme:light){.bm-login-container{--bm-login-color-text:#333;--bm-login-color-section-text:#4f4f4f}.bm-login-form{background:var(--bm-login-bg)}.bm-login-sub-title{color:var(--bm-login-color-section-text)}}.bm-login-card-wrapper{background-size:cover}.bm-login-card-img-cover{background:var(--bm-login-img-cover-color);z-index:0;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);width:100%;height:100%;position:absolute;top:0}.dark .bm-login-card-img-cover{background:var(--bm-login-img-cover-color-dark)}
|
package/dist/index.js
CHANGED
|
@@ -1,344 +1,276 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
}, [e(W, {
|
|
158
|
-
checked: m.value,
|
|
159
|
-
"onUpdate:checked": (l) => m.value = l,
|
|
160
|
-
label: "记住密码"
|
|
161
|
-
}, null), c && e("a", {
|
|
162
|
-
href: c
|
|
163
|
-
}, [p("忘记密码?")])]), e(w, {
|
|
164
|
-
showLabel: !1
|
|
165
|
-
}, {
|
|
166
|
-
default: () => [e(B, {
|
|
167
|
-
"attr-type": "button",
|
|
168
|
-
type: "primary",
|
|
169
|
-
block: !0,
|
|
170
|
-
onClick: () => y()
|
|
171
|
-
}, {
|
|
172
|
-
default: () => [p("登录")]
|
|
173
|
-
})]
|
|
174
|
-
}), d && e(w, {
|
|
175
|
-
showLabel: !1
|
|
176
|
-
}, {
|
|
177
|
-
default: () => [e(B, {
|
|
178
|
-
color: "#02E16E",
|
|
179
|
-
ghost: !0,
|
|
180
|
-
block: !0,
|
|
181
|
-
onClick: () => F()
|
|
182
|
-
}, {
|
|
183
|
-
default: () => [p("微信登录")]
|
|
184
|
-
})]
|
|
185
|
-
})]
|
|
186
|
-
}), u && e("div", {
|
|
187
|
-
class: "signUp"
|
|
188
|
-
}, [p("还没有账号?"), e("a", {
|
|
189
|
-
href: u
|
|
190
|
-
}, [p("立即注册")])])]);
|
|
191
|
-
}
|
|
1
|
+
import { computed as e, createTextVNode as t, createVNode as n, defineComponent as r, isVNode as i, mergeProps as a, reactive as o, ref as s, toRaw as c } from "vue";
|
|
2
|
+
import { NButton as l, NCheckbox as u, NForm as d, NFormItem as f, NInput as p } from "naive-ui";
|
|
3
|
+
import './index.css';// src/components/Login/src/types.ts
|
|
4
|
+
var m = [
|
|
5
|
+
"finish",
|
|
6
|
+
"error",
|
|
7
|
+
"captcha",
|
|
8
|
+
"wechatFinish"
|
|
9
|
+
], h = {
|
|
10
|
+
title: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: "Welcome back"
|
|
13
|
+
},
|
|
14
|
+
subTitle: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: "Login to your account"
|
|
17
|
+
},
|
|
18
|
+
layout: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: "simple"
|
|
21
|
+
},
|
|
22
|
+
bg: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: ""
|
|
25
|
+
},
|
|
26
|
+
forgotUrl: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: ""
|
|
29
|
+
},
|
|
30
|
+
signUpUrl: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: ""
|
|
33
|
+
},
|
|
34
|
+
bgImageUrl: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: ""
|
|
37
|
+
},
|
|
38
|
+
logo: { type: Function },
|
|
39
|
+
imagePosition: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: "right"
|
|
42
|
+
},
|
|
43
|
+
actions: { type: Array }
|
|
44
|
+
}, g = {
|
|
45
|
+
title: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: "Welcome back"
|
|
48
|
+
},
|
|
49
|
+
subTitle: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: "Login to your account"
|
|
52
|
+
},
|
|
53
|
+
forgotUrl: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: ""
|
|
56
|
+
},
|
|
57
|
+
signUpUrl: {
|
|
58
|
+
type: String,
|
|
59
|
+
default: ""
|
|
60
|
+
},
|
|
61
|
+
radius: {
|
|
62
|
+
type: [Number, Boolean],
|
|
63
|
+
default: 8
|
|
64
|
+
},
|
|
65
|
+
shadow: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: !0
|
|
68
|
+
},
|
|
69
|
+
actions: { type: Array }
|
|
70
|
+
}, _ = /* @__PURE__ */ r({
|
|
71
|
+
name: "LoginForm",
|
|
72
|
+
props: g,
|
|
73
|
+
emits: m,
|
|
74
|
+
setup(e, { emit: r, slots: i }) {
|
|
75
|
+
let { actions: a, title: m, subTitle: h, signUpUrl: g, forgotUrl: _, shadow: v, radius: y } = e, b = o({
|
|
76
|
+
username: "",
|
|
77
|
+
password: ""
|
|
78
|
+
}), x = s(!1), S = {
|
|
79
|
+
username: [{
|
|
80
|
+
required: !0,
|
|
81
|
+
message: "请输入用户名",
|
|
82
|
+
trigger: "blur"
|
|
83
|
+
}, {
|
|
84
|
+
min: 3,
|
|
85
|
+
max: 10,
|
|
86
|
+
message: "长度在 3 到 10 个字符",
|
|
87
|
+
trigger: "blur"
|
|
88
|
+
}],
|
|
89
|
+
password: [{
|
|
90
|
+
required: !0,
|
|
91
|
+
message: "请输入密码",
|
|
92
|
+
trigger: "blur"
|
|
93
|
+
}, {
|
|
94
|
+
min: 6,
|
|
95
|
+
max: 20,
|
|
96
|
+
message: "长度在 6 到 20 个字符",
|
|
97
|
+
trigger: "blur"
|
|
98
|
+
}]
|
|
99
|
+
}, C = s(null), w = () => {
|
|
100
|
+
C.value?.validate((e) => {
|
|
101
|
+
e ? (console.error(e), r("error", e)) : r("finish", c(b));
|
|
102
|
+
});
|
|
103
|
+
}, T = () => {
|
|
104
|
+
console.error("Weixin login is not supported yet."), r("wechatFinish");
|
|
105
|
+
};
|
|
106
|
+
return () => n("div", {
|
|
107
|
+
class: ["bm-login-form", { "bm-login-form-shadow": v }],
|
|
108
|
+
style: [{ borderRadius: y ? `${y}px` : "none" }]
|
|
109
|
+
}, [
|
|
110
|
+
n("div", { class: "bm-login-title" }, [m]),
|
|
111
|
+
n("div", { class: "bm-login-sub-title" }, [h]),
|
|
112
|
+
i.default ? i.default() : n(d, {
|
|
113
|
+
ref: C,
|
|
114
|
+
model: b,
|
|
115
|
+
rules: S,
|
|
116
|
+
size: "large",
|
|
117
|
+
"show-require-mark": !1
|
|
118
|
+
}, { default: () => [
|
|
119
|
+
n(f, {
|
|
120
|
+
label: "用户名",
|
|
121
|
+
path: "username"
|
|
122
|
+
}, { default: () => [n(p, {
|
|
123
|
+
value: b.username,
|
|
124
|
+
"onUpdate:value": (e) => b.username = e,
|
|
125
|
+
placeholder: "请输入用户名"
|
|
126
|
+
}, null)] }),
|
|
127
|
+
n(f, {
|
|
128
|
+
label: "密码",
|
|
129
|
+
path: "password"
|
|
130
|
+
}, { default: () => [n(p, {
|
|
131
|
+
value: b.password,
|
|
132
|
+
"onUpdate:value": (e) => b.password = e,
|
|
133
|
+
placeholder: "请输入密码",
|
|
134
|
+
type: "password"
|
|
135
|
+
}, null)] }),
|
|
136
|
+
n("div", { class: "bm-login-password-forgot" }, [n(u, {
|
|
137
|
+
checked: x.value,
|
|
138
|
+
"onUpdate:checked": (e) => x.value = e,
|
|
139
|
+
label: "记住密码"
|
|
140
|
+
}, null), _ && n("a", { href: _ }, [t("忘记密码?")])]),
|
|
141
|
+
n(f, { showLabel: !1 }, { default: () => [n(l, {
|
|
142
|
+
"attr-type": "button",
|
|
143
|
+
type: "primary",
|
|
144
|
+
block: !0,
|
|
145
|
+
onClick: () => w()
|
|
146
|
+
}, { default: () => [t("登录")] })] }),
|
|
147
|
+
a && n(f, { showLabel: !1 }, { default: () => [n(l, {
|
|
148
|
+
color: "#02E16E",
|
|
149
|
+
ghost: !0,
|
|
150
|
+
block: !0,
|
|
151
|
+
onClick: () => T()
|
|
152
|
+
}, { default: () => [t("微信登录")] })] })
|
|
153
|
+
] }),
|
|
154
|
+
g && n("div", { class: "bm-login-sign-up" }, [t("还没有账号?"), n("a", { href: g }, [t("立即注册")])])
|
|
155
|
+
]);
|
|
156
|
+
}
|
|
192
157
|
});
|
|
193
|
-
|
|
194
|
-
|
|
158
|
+
// src/components/Login/src/index.tsx
|
|
159
|
+
function v(e) {
|
|
160
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !i(e);
|
|
195
161
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
class: "logo"
|
|
310
|
-
}, [(y = a.logo) == null ? void 0 : y.call(a)]), e("div", {
|
|
311
|
-
class: "card"
|
|
312
|
-
}, [e("div", {
|
|
313
|
-
class: ["card-column-item", "flex-1"]
|
|
314
|
-
}, [e(g, v(u, {
|
|
315
|
-
shadow: !1,
|
|
316
|
-
radius: !1,
|
|
317
|
-
onFinish: (l) => t("finish", l)
|
|
318
|
-
}), null)]), e("div", {
|
|
319
|
-
class: ["card-column-muted", "flex-1"],
|
|
320
|
-
style: {
|
|
321
|
-
width: "350px"
|
|
322
|
-
}
|
|
323
|
-
}, [n && e("img", {
|
|
324
|
-
src: n,
|
|
325
|
-
alt: "Image",
|
|
326
|
-
class: "column-muted-image"
|
|
327
|
-
}, null)])])]) : e("div", {
|
|
328
|
-
class: ["container", "flex-center"],
|
|
329
|
-
style: {
|
|
330
|
-
backgroundImage: `url(${n})`,
|
|
331
|
-
backgroundSize: "cover"
|
|
332
|
-
}
|
|
333
|
-
}, [e("div", {
|
|
334
|
-
class: ["flex-col", "space-y-4"]
|
|
335
|
-
}, [(F = a.logo) == null ? void 0 : F.call(a), e(g, u, null)])]);
|
|
336
|
-
};
|
|
337
|
-
}
|
|
162
|
+
var y = /* @__PURE__ */ r({
|
|
163
|
+
name: "LoginPage",
|
|
164
|
+
props: h,
|
|
165
|
+
emits: m,
|
|
166
|
+
setup(t, { emit: r, slots: i }) {
|
|
167
|
+
let { layout: o, bg: s, bgImageUrl: c, imagePosition: l, ...u } = t, d = e(() => l === "right");
|
|
168
|
+
return () => {
|
|
169
|
+
if (i.default) {
|
|
170
|
+
let e;
|
|
171
|
+
if (o === "column") {
|
|
172
|
+
let e;
|
|
173
|
+
return n("div", { class: ["bm-login-container", "bm-login-column"] }, [n("div", {
|
|
174
|
+
class: "bm-login-column-item",
|
|
175
|
+
style: { order: d.value ? 1 : 2 }
|
|
176
|
+
}, [d.value && n("div", { class: "bm-login-logo" }, [i.logo?.()]), n(_, a(u, {
|
|
177
|
+
shadow: !1,
|
|
178
|
+
radius: !1,
|
|
179
|
+
onFinish: (e) => r("finish", e)
|
|
180
|
+
}), v(e = i.default()) ? e : { default: () => [e] })]), n("div", {
|
|
181
|
+
class: "bm-login-column-muted",
|
|
182
|
+
style: { order: d.value ? 2 : 1 }
|
|
183
|
+
}, [!d.value && n("div", { class: "bm-login-logo" }, [i.logo?.()]), t.bgImageUrl && n("img", {
|
|
184
|
+
src: t.bgImageUrl,
|
|
185
|
+
alt: "Image",
|
|
186
|
+
class: "bm-login-column-muted-image"
|
|
187
|
+
}, null)])]);
|
|
188
|
+
}
|
|
189
|
+
if (o === "card") {
|
|
190
|
+
let e;
|
|
191
|
+
return n("div", {
|
|
192
|
+
class: [
|
|
193
|
+
"bm-login-container",
|
|
194
|
+
"bm-login-flex-center",
|
|
195
|
+
"bm-login-card-wrapper"
|
|
196
|
+
],
|
|
197
|
+
style: { backgroundImage: c ? `url(${c})` : "transparent" }
|
|
198
|
+
}, [
|
|
199
|
+
n("div", { class: "bm-login-logo" }, [i.logo?.()]),
|
|
200
|
+
n("div", { class: "bm-login-card-img-cover" }, null),
|
|
201
|
+
n("div", {
|
|
202
|
+
class: "bm-login-card",
|
|
203
|
+
style: { flexDirection: d.value ? "row" : "row-reverse" }
|
|
204
|
+
}, [n("div", { class: ["bm-login-card-column-item"] }, [n(_, a(u, {
|
|
205
|
+
shadow: !1,
|
|
206
|
+
radius: !1,
|
|
207
|
+
onFinish: (e) => r("finish", e)
|
|
208
|
+
}), v(e = i.default()) ? e : { default: () => [e] })]), n("div", {
|
|
209
|
+
class: ["bm-login-card-column-muted"],
|
|
210
|
+
style: { width: "350px" }
|
|
211
|
+
}, [c && n("img", {
|
|
212
|
+
src: c,
|
|
213
|
+
alt: "Image",
|
|
214
|
+
class: "bm-login-column-muted-image"
|
|
215
|
+
}, null)])])
|
|
216
|
+
]);
|
|
217
|
+
}
|
|
218
|
+
return n("div", {
|
|
219
|
+
class: ["bm-login-container", "bm-login-flex-center"],
|
|
220
|
+
style: {
|
|
221
|
+
backgroundImage: `url(${c})`,
|
|
222
|
+
backgroundSize: "cover"
|
|
223
|
+
}
|
|
224
|
+
}, [n("div", { class: ["bm-login-content-stack"] }, [i.logo?.(), n(_, a(u, { onFinish: (e) => r("finish", e) }), v(e = i.default()) ? e : { default: () => [e] })])]);
|
|
225
|
+
}
|
|
226
|
+
return o === "column" ? n("div", { class: [
|
|
227
|
+
"bm-login-container",
|
|
228
|
+
"bm-login-column",
|
|
229
|
+
{ "bm-login-column-reverse": t.imagePosition === "left" }
|
|
230
|
+
] }, [n("div", { class: "bm-login-column-item" }, [d.value && n("div", { class: "bm-login-logo" }, [i.logo?.()]), n(_, a(u, {
|
|
231
|
+
shadow: !1,
|
|
232
|
+
radius: !1,
|
|
233
|
+
onFinish: (e) => r("finish", e)
|
|
234
|
+
}), null)]), n("div", { class: "bm-login-column-muted" }, [!d.value && n("div", { class: "bm-login-logo" }, [i.logo?.()]), t.bgImageUrl && n("img", {
|
|
235
|
+
src: t.bgImageUrl,
|
|
236
|
+
alt: "Image",
|
|
237
|
+
class: "bm-login-column-muted-image"
|
|
238
|
+
}, null)])]) : o === "card" ? n("div", {
|
|
239
|
+
class: [
|
|
240
|
+
"bm-login-container",
|
|
241
|
+
"bm-login-flex-center",
|
|
242
|
+
"bm-login-card-wrapper"
|
|
243
|
+
],
|
|
244
|
+
style: {
|
|
245
|
+
backgroundImage: c ? `url(${c})` : "transparent",
|
|
246
|
+
backgroundSize: "cover"
|
|
247
|
+
}
|
|
248
|
+
}, [
|
|
249
|
+
n("div", { class: "bm-login-logo" }, [i.logo?.()]),
|
|
250
|
+
n("div", { class: "bm-login-card-img-cover" }, null),
|
|
251
|
+
n("div", {
|
|
252
|
+
class: "bm-login-card",
|
|
253
|
+
style: { flexDirection: d.value ? "row" : "row-reverse" }
|
|
254
|
+
}, [n("div", { class: ["bm-login-card-column-item"] }, [n(_, a(u, {
|
|
255
|
+
shadow: !1,
|
|
256
|
+
radius: !1,
|
|
257
|
+
onFinish: (e) => r("finish", e)
|
|
258
|
+
}), null)]), n("div", {
|
|
259
|
+
class: ["bm-login-card-column-muted"],
|
|
260
|
+
style: { width: "350px" }
|
|
261
|
+
}, [c && n("img", {
|
|
262
|
+
src: c,
|
|
263
|
+
alt: "Image",
|
|
264
|
+
class: "bm-login-column-muted-image"
|
|
265
|
+
}, null)])])
|
|
266
|
+
]) : n("div", {
|
|
267
|
+
class: ["bm-login-container", "bm-login-flex-center"],
|
|
268
|
+
style: {
|
|
269
|
+
backgroundImage: `url(${c})`,
|
|
270
|
+
backgroundSize: "cover"
|
|
271
|
+
}
|
|
272
|
+
}, [n("div", { class: ["bm-login-content-stack"] }, [i.logo?.(), n(_, u, null)])]);
|
|
273
|
+
};
|
|
274
|
+
}
|
|
338
275
|
});
|
|
339
|
-
export {
|
|
340
|
-
j as Login,
|
|
341
|
-
L as loginEmits,
|
|
342
|
-
T as loginFormProps,
|
|
343
|
-
R as loginProps
|
|
344
|
-
};
|
|
276
|
+
export { y as Login, m as loginEmits, g as loginFormProps, h as loginProps };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@banmao/blocks",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -17,33 +17,33 @@
|
|
|
17
17
|
],
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@types/lodash-es": "^4.17.12",
|
|
20
|
-
"@vitest/coverage-v8": "
|
|
21
|
-
"@vitest/ui": "
|
|
20
|
+
"@vitest/coverage-v8": "5.1.1",
|
|
21
|
+
"@vitest/ui": "5.1.1",
|
|
22
22
|
"@vue/test-utils": "^2.4.6",
|
|
23
23
|
"@vue/tsconfig": "^0.7.0",
|
|
24
|
-
"glob": "^11.0.
|
|
25
|
-
"happy-dom": "^
|
|
24
|
+
"glob": "^11.0.2",
|
|
25
|
+
"happy-dom": "^21.0.4",
|
|
26
26
|
"naive-ui": "^2.41.0",
|
|
27
|
-
"typescript": "
|
|
28
|
-
"unplugin-auto-import": "^
|
|
29
|
-
"unplugin-icons": "^
|
|
30
|
-
"unplugin-vue-components": "^
|
|
31
|
-
"vite": "^
|
|
27
|
+
"typescript": "^5.7.3",
|
|
28
|
+
"unplugin-auto-import": "^21.1.0",
|
|
29
|
+
"unplugin-icons": "^24.0.0",
|
|
30
|
+
"unplugin-vue-components": "^32.1.0",
|
|
31
|
+
"vite": "^8.3.8",
|
|
32
32
|
"vite-plugin-compression": "^0.5.1",
|
|
33
33
|
"vite-plugin-svg-icons": "^2.0.1",
|
|
34
|
-
"vue": "^3.5.
|
|
35
|
-
"vue-tsc": "^2.2.
|
|
34
|
+
"vue": "^3.5.14",
|
|
35
|
+
"vue-tsc": "^2.2.10"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"naive-ui": "^2.41.0",
|
|
39
|
-
"vue": "^3.5.
|
|
39
|
+
"vue": "^3.5.14"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@iconify/vue": "^4.3.0",
|
|
43
|
-
"@vueuse/core": "^
|
|
43
|
+
"@vueuse/core": "^13.2.0",
|
|
44
44
|
"lodash-es": "^4.17.21",
|
|
45
45
|
"vue-draggable-next": "^2.2.1",
|
|
46
|
-
"vue-router": "^4.5.
|
|
46
|
+
"vue-router": "^4.5.1",
|
|
47
47
|
"vue3-text-clamp": "^0.1.2",
|
|
48
48
|
"@banmao/draw": "^0.0.4"
|
|
49
49
|
},
|