@banmao/blocks 0.0.1-alpha.8 → 0.0.1
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/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +132 -115
- package/package.json +15 -15
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const e=require("vue"),i=require("naive-ui"),w=["finish","error","captcha","wechatFinish"],I={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}},U={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}},m=e.defineComponent({name:"LoginForm",props:U,emits:w,setup(r,{emit:d,slots:a}){const{actions:g,title:x,subTitle:t,signUpUrl:v,forgotUrl:n,shadow:c,radius:f}=r,u=e.reactive({username:"",password:""}),N=e.ref(!1),V={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"}]},p=e.ref(null),h=()=>{var o;(o=p.value)==null||o.validate(l=>{l?(console.error(l),d("error",l)):d("finish",e.toRaw(u))})},y=()=>{console.error("Weixin login is not supported yet."),d("wechatFinish")};return()=>e.createVNode("div",{class:["login-form",{"login-form-shadow":c}],style:[{borderRadius:f?`${f}px`:"none"}]},[e.createVNode("div",{class:"title"},[x]),e.createVNode("div",{class:"sub-title"},[t]),a.default?a.default():e.createVNode(i.NForm,{ref:p,model:u,rules:V,size:"large","show-require-mark":!1},{default:()=>[e.createVNode(i.NFormItem,{label:"用户名",path:"username"},{default:()=>[e.createVNode(i.NInput,{value:u.username,"onUpdate:value":o=>u.username=o,placeholder:"请输入用户名"},null)]}),e.createVNode(i.NFormItem,{label:"密码",path:"password"},{default:()=>[e.createVNode(i.NInput,{value:u.password,"onUpdate:value":o=>u.password=o,placeholder:"请输入密码",type:"password"},null)]}),e.createVNode("div",{class:"password-forgot"},[e.createVNode(i.NCheckbox,{checked:N.value,"onUpdate:checked":o=>N.value=o,label:"记住密码"},null),n&&e.createVNode("a",{href:n},[e.createTextVNode("忘记密码?")])]),e.createVNode(i.NFormItem,{showLabel:!1},{default:()=>[e.createVNode(i.NButton,{"attr-type":"button",type:"primary",block:!0,onClick:()=>h()},{default:()=>[e.createTextVNode("登录")]})]}),g&&e.createVNode(i.NFormItem,{showLabel:!1},{default:()=>[e.createVNode(i.NButton,{color:"#02E16E",ghost:!0,block:!0,onClick:()=>y()},{default:()=>[e.createTextVNode("微信登录")]})]})]}),v&&e.createVNode("div",{class:"signUp"},[e.createTextVNode("还没有账号?"),e.createVNode("a",{href:v},[e.createTextVNode("立即注册")])])])}});function F(r){return typeof r=="function"||Object.prototype.toString.call(r)==="[object Object]"&&!e.isVNode(r)}const S=e.defineComponent({name:"LoginPage",props:I,emits:w,setup(r,{emit:d,slots:a}){const{layout:g,bg:x,bgImageUrl:t,imagePosition:v,...n}=r,c=e.computed(()=>v==="right");return()=>{var f,u,N,V,p,h,y,o;if(a.default){let l;if(g==="column"){let s;return e.createVNode("div",{class:["container","column"]},[e.createVNode("div",{class:"column-item",style:{order:c.value?1:2}},[c.value&&e.createVNode("div",{class:"logo"},[(f=a.logo)==null?void 0:f.call(a)]),e.createVNode(m,e.mergeProps(n,{shadow:!1,radius:!1,onFinish:b=>d("finish",b)}),F(s=a.default())?s:{default:()=>[s]})]),e.createVNode("div",{class:"column-muted",style:{order:c.value?2:1}},[!c.value&&e.createVNode("div",{class:"logo"},[(u=a.logo)==null?void 0:u.call(a)]),r.bgImageUrl&&e.createVNode("img",{src:r.bgImageUrl,alt:"Image",class:"column-muted-image"},null)])])}if(g==="card"){let s;return e.createVNode("div",{class:["container","flex-center","card-login-wrapper"],style:{backgroundImage:t?`url(${t})`:"transparent"}},[e.createVNode("div",{class:"logo"},[(N=a.logo)==null?void 0:N.call(a)]),e.createVNode("div",{class:"card-img-cover"},null),e.createVNode("div",{class:"card",style:{flexDirection:c.value?"row":"row-reverse"}},[e.createVNode("div",{class:["card-column-item","flex-1"]},[e.createVNode(m,e.mergeProps(n,{shadow:!1,radius:!1,onFinish:b=>d("finish",b)}),F(s=a.default())?s:{default:()=>[s]})]),e.createVNode("div",{class:["card-column-muted","flex-1"],style:{width:"350px"}},[t&&e.createVNode("img",{src:t,alt:"Image",class:"column-muted-image"},null)])])])}return e.createVNode("div",{class:["container","flex-center"],style:{backgroundImage:`url(${t})`,backgroundSize:"cover"}},[e.createVNode("div",{class:["flex-col","space-y-4"]},[(V=a.logo)==null?void 0:V.call(a),e.createVNode(m,e.mergeProps(n,{onFinish:s=>d("finish",s)}),F(l=a.default())?l:{default:()=>[l]})])])}else return g==="column"?e.createVNode("div",{class:["container","column",{"column-reverse":r.imagePosition==="left"}]},[e.createVNode("div",{class:"column-item"},[c.value&&e.createVNode("div",{class:"logo"},[(p=a.logo)==null?void 0:p.call(a)]),e.createVNode(m,e.mergeProps(n,{shadow:!1,radius:!1,onFinish:l=>d("finish",l)}),null)]),e.createVNode("div",{class:"column-muted"},[!c.value&&e.createVNode("div",{class:"logo"},[(h=a.logo)==null?void 0:h.call(a)]),r.bgImageUrl&&e.createVNode("img",{src:r.bgImageUrl,alt:"Image",class:"column-muted-image"},null)])]):g==="card"?e.createVNode("div",{class:["container","flex-center","card-login-wrapper"],style:{backgroundImage:t?`url(${t})`:"transparent",backgroundSize:"cover"}},[e.createVNode("div",{class:"logo"},[(y=a.logo)==null?void 0:y.call(a)]),e.createVNode("div",{class:"card-img-cover"},null),e.createVNode("div",{class:"card",style:{flexDirection:c.value?"row":"row-reverse"}},[e.createVNode("div",{class:["card-column-item","flex-1"]},[e.createVNode(m,e.mergeProps(n,{shadow:!1,radius:!1,onFinish:l=>d("finish",l)}),null)]),e.createVNode("div",{class:["card-column-muted","flex-1"],style:{width:"350px"}},[t&&e.createVNode("img",{src:t,alt:"Image",class:"column-muted-image"},null)])])]):e.createVNode("div",{class:["container","flex-center"],style:{backgroundImage:`url(${t})`,backgroundSize:"cover"}},[e.createVNode("div",{class:["flex-col","space-y-4"]},[(o=a.logo)==null?void 0:o.call(a),e.createVNode(m,n,null)])])}}});exports.Login=S;exports.loginEmits=w;exports.loginFormProps=U;exports.loginProps=I;
|
package/dist/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--color-link:
|
|
1
|
+
:root{--color-link: hsl(221 100% 58%);--color-text: hsl(240 5% 20%);--color-text-dark: hsl(240 5% 96%);--color-section-text: hsl(240 6% 30%);--color-section-text-dark: hsl(240 6% 90%);--img-cover-color: oklch(1 0 none / .6);--img-cover-color-dark: oklch(.3 0 none / .6);--bg-color: oklch(1 0 none / .8);--bg-color-dark: oklch(.25 0 none / .8);--login-shadow: oklch(0 0 none / .2);--bg-muted: oklch(.25 .003 24)}.container{position:relative;width:100%;height:100svh}.flex-center{display:flex;align-items:center;justify-content:center}.flex-col{display:flex;flex-direction:column;justify-content:center;align-items:center}.space-y-4{gap:16px}.login-form{padding:32px 32px 24px;min-width:350px;background:var(--bg-color);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);box-sizing:border-box}.card .login-form{width:100%}.column .login-form,.dark .column .login-form{background:transparent}.login-form-shadow{box-shadow:0 2px 12px 0 var(--login-shadow)}.title{font-size:20px;font-weight:700;color:var(--color-text)}.sub-title{font-size:16px;color:var(--color-section-text);margin-bottom:32px}.signUp{text-align:center;color:var(--color-text)}.signUp a,.link{color:var(--color-link);text-decoration:none}.password-forgot{width:100%;display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}.password-forgot a{color:var(--color-link);text-decoration:none}.column,.grid{display:grid}.column-reverse{direction:rtl}.column-reverse>*{direction:ltr}.card{width:100%;max-width:48rem;display:flex;box-sizing:border-box;box-shadow:0 2px 12px 0 var(--login-shadow);border-radius:.5rem;overflow:hidden}.card-column-item{display:flex;flex-direction:column;justify-content:center;align-items:center}.card-column-muted{width:100%;position:relative;display:none;background-color:var(--bg-muted)}.flex-1{flex:1}.logo{position:absolute;top:20px;left:20px;z-index:9;height:64px;min-width:64px}.column-item{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:1rem}.column-muted{width:100%;position:relative;display:none;background-color:var(--bg-muted)}.column-muted-image{position:absolute;top:0;right:0;bottom:0;left:0;height:100%;width:100%;object-fit:cover}@media screen and (max-width: 1199px){.column-item{padding:40px}}@media screen and (max-width: 1200){.card{max-width:24rem}}@media screen and (min-width: 1200px){.column{grid-template-columns:repeat(2,minmax(0,1fr))}.column-muted,.card-column-muted{display:block}}.dark .column-muted-image{filter:brightness(.2)}.dark .column-muted-image{filter:grayscale(40%)}.dark .login-form{background-color:var(--bg-color-dark)}.dark .title{color:var(--color-text-dark)}.dark .sub-title{color:var(--color-section-text-dark)}@media (prefers-color-scheme: light){:root{--color-text: #333;--color-section-text: #4f4f4f}.login-form{background:var(--bg-color)}.sub-title{color:var(--color-section-text)}}.card-login-wrapper{background-size:cover}.card-img-cover{position:absolute;top:0;width:100%;height:100%;background:var(--img-cover-color);z-index:0;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.dark .card-img-cover{background:var(--img-cover-color-dark)}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { NForm as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as L, reactive as P, ref as S, createVNode as e, createTextVNode as v, toRaw as D, computed as E, mergeProps as h, isVNode as A } from "vue";
|
|
2
|
+
import { NForm as W, NFormItem as x, NInput as B, NCheckbox as $, NButton as C } from "naive-ui";
|
|
3
|
+
import './index.css';const N = ["finish", "error", "captcha", "wechatFinish"], z = {
|
|
4
4
|
title: {
|
|
5
5
|
type: String,
|
|
6
6
|
default: "Welcome back"
|
|
@@ -39,7 +39,7 @@ const L = ["finish", "error", "captcha", "wechatFinish"], R = {
|
|
|
39
39
|
actions: {
|
|
40
40
|
type: Array
|
|
41
41
|
}
|
|
42
|
-
},
|
|
42
|
+
}, R = {
|
|
43
43
|
title: {
|
|
44
44
|
type: String,
|
|
45
45
|
default: "Welcome back"
|
|
@@ -67,26 +67,26 @@ const L = ["finish", "error", "captcha", "wechatFinish"], R = {
|
|
|
67
67
|
actions: {
|
|
68
68
|
type: Array
|
|
69
69
|
}
|
|
70
|
-
}, g = /* @__PURE__ */
|
|
70
|
+
}, g = /* @__PURE__ */ L({
|
|
71
71
|
name: "LoginForm",
|
|
72
|
-
props:
|
|
73
|
-
emits:
|
|
74
|
-
setup(
|
|
72
|
+
props: R,
|
|
73
|
+
emits: N,
|
|
74
|
+
setup(l, {
|
|
75
75
|
emit: t,
|
|
76
76
|
slots: a
|
|
77
77
|
}) {
|
|
78
78
|
const {
|
|
79
|
-
actions:
|
|
79
|
+
actions: s,
|
|
80
80
|
title: I,
|
|
81
|
-
subTitle:
|
|
82
|
-
signUpUrl:
|
|
83
|
-
forgotUrl:
|
|
84
|
-
shadow:
|
|
85
|
-
radius:
|
|
86
|
-
} =
|
|
81
|
+
subTitle: r,
|
|
82
|
+
signUpUrl: y,
|
|
83
|
+
forgotUrl: o,
|
|
84
|
+
shadow: n,
|
|
85
|
+
radius: m
|
|
86
|
+
} = l, c = P({
|
|
87
87
|
username: "",
|
|
88
88
|
password: ""
|
|
89
|
-
}),
|
|
89
|
+
}), f = S(!1), b = {
|
|
90
90
|
username: [{
|
|
91
91
|
required: !0,
|
|
92
92
|
message: "请输入用户名",
|
|
@@ -107,164 +107,172 @@ const L = ["finish", "error", "captcha", "wechatFinish"], R = {
|
|
|
107
107
|
message: "长度在 6 到 20 个字符",
|
|
108
108
|
trigger: "blur"
|
|
109
109
|
}]
|
|
110
|
-
},
|
|
111
|
-
var
|
|
112
|
-
(
|
|
113
|
-
|
|
110
|
+
}, p = S(null), F = () => {
|
|
111
|
+
var i;
|
|
112
|
+
(i = p.value) == null || i.validate((u) => {
|
|
113
|
+
u ? (console.error(u), t("error", u)) : t("finish", D(c));
|
|
114
114
|
});
|
|
115
|
-
},
|
|
115
|
+
}, w = () => {
|
|
116
116
|
console.error("Weixin login is not supported yet."), t("wechatFinish");
|
|
117
117
|
};
|
|
118
118
|
return () => e("div", {
|
|
119
119
|
class: ["login-form", {
|
|
120
|
-
"login-form-shadow":
|
|
120
|
+
"login-form-shadow": n
|
|
121
121
|
}],
|
|
122
122
|
style: [{
|
|
123
|
-
borderRadius:
|
|
123
|
+
borderRadius: m ? `${m}px` : "none"
|
|
124
124
|
}]
|
|
125
125
|
}, [e("div", {
|
|
126
126
|
class: "title"
|
|
127
127
|
}, [I]), e("div", {
|
|
128
128
|
class: "sub-title"
|
|
129
|
-
}, [
|
|
130
|
-
ref:
|
|
131
|
-
model:
|
|
129
|
+
}, [r]), a.default ? a.default() : e(W, {
|
|
130
|
+
ref: p,
|
|
131
|
+
model: c,
|
|
132
132
|
rules: b,
|
|
133
133
|
size: "large",
|
|
134
134
|
"show-require-mark": !1
|
|
135
135
|
}, {
|
|
136
|
-
default: () => [e(
|
|
136
|
+
default: () => [e(x, {
|
|
137
137
|
label: "用户名",
|
|
138
138
|
path: "username"
|
|
139
139
|
}, {
|
|
140
|
-
default: () => [e(
|
|
141
|
-
value:
|
|
142
|
-
"onUpdate:value": (
|
|
140
|
+
default: () => [e(B, {
|
|
141
|
+
value: c.username,
|
|
142
|
+
"onUpdate:value": (i) => c.username = i,
|
|
143
143
|
placeholder: "请输入用户名"
|
|
144
144
|
}, null)]
|
|
145
|
-
}), e(
|
|
145
|
+
}), e(x, {
|
|
146
146
|
label: "密码",
|
|
147
147
|
path: "password"
|
|
148
148
|
}, {
|
|
149
|
-
default: () => [e(
|
|
150
|
-
value:
|
|
151
|
-
"onUpdate:value": (
|
|
149
|
+
default: () => [e(B, {
|
|
150
|
+
value: c.password,
|
|
151
|
+
"onUpdate:value": (i) => c.password = i,
|
|
152
152
|
placeholder: "请输入密码",
|
|
153
153
|
type: "password"
|
|
154
154
|
}, null)]
|
|
155
155
|
}), e("div", {
|
|
156
156
|
class: "password-forgot"
|
|
157
|
-
}, [e(
|
|
158
|
-
checked:
|
|
159
|
-
"onUpdate:checked": (
|
|
157
|
+
}, [e($, {
|
|
158
|
+
checked: f.value,
|
|
159
|
+
"onUpdate:checked": (i) => f.value = i,
|
|
160
160
|
label: "记住密码"
|
|
161
|
-
}, null),
|
|
162
|
-
href:
|
|
163
|
-
}, [
|
|
161
|
+
}, null), o && e("a", {
|
|
162
|
+
href: o
|
|
163
|
+
}, [v("忘记密码?")])]), e(x, {
|
|
164
164
|
showLabel: !1
|
|
165
165
|
}, {
|
|
166
|
-
default: () => [e(
|
|
166
|
+
default: () => [e(C, {
|
|
167
167
|
"attr-type": "button",
|
|
168
168
|
type: "primary",
|
|
169
169
|
block: !0,
|
|
170
|
-
onClick: () =>
|
|
170
|
+
onClick: () => F()
|
|
171
171
|
}, {
|
|
172
|
-
default: () => [
|
|
172
|
+
default: () => [v("登录")]
|
|
173
173
|
})]
|
|
174
|
-
}),
|
|
174
|
+
}), s && e(x, {
|
|
175
175
|
showLabel: !1
|
|
176
176
|
}, {
|
|
177
|
-
default: () => [e(
|
|
177
|
+
default: () => [e(C, {
|
|
178
178
|
color: "#02E16E",
|
|
179
179
|
ghost: !0,
|
|
180
180
|
block: !0,
|
|
181
|
-
onClick: () =>
|
|
181
|
+
onClick: () => w()
|
|
182
182
|
}, {
|
|
183
|
-
default: () => [
|
|
183
|
+
default: () => [v("微信登录")]
|
|
184
184
|
})]
|
|
185
185
|
})]
|
|
186
|
-
}),
|
|
186
|
+
}), y && e("div", {
|
|
187
187
|
class: "signUp"
|
|
188
|
-
}, [
|
|
189
|
-
href:
|
|
190
|
-
}, [
|
|
188
|
+
}, [v("还没有账号?"), e("a", {
|
|
189
|
+
href: y
|
|
190
|
+
}, [v("立即注册")])])]);
|
|
191
191
|
}
|
|
192
192
|
});
|
|
193
|
-
function
|
|
194
|
-
return typeof
|
|
193
|
+
function k(l) {
|
|
194
|
+
return typeof l == "function" || Object.prototype.toString.call(l) === "[object Object]" && !A(l);
|
|
195
195
|
}
|
|
196
|
-
const j = /* @__PURE__ */
|
|
196
|
+
const j = /* @__PURE__ */ L({
|
|
197
197
|
name: "LoginPage",
|
|
198
|
-
props:
|
|
199
|
-
emits:
|
|
200
|
-
setup(
|
|
198
|
+
props: z,
|
|
199
|
+
emits: N,
|
|
200
|
+
setup(l, {
|
|
201
201
|
emit: t,
|
|
202
202
|
slots: a
|
|
203
203
|
}) {
|
|
204
204
|
const {
|
|
205
|
-
layout:
|
|
205
|
+
layout: s,
|
|
206
206
|
bg: I,
|
|
207
|
-
bgImageUrl:
|
|
208
|
-
|
|
209
|
-
|
|
207
|
+
bgImageUrl: r,
|
|
208
|
+
imagePosition: y,
|
|
209
|
+
...o
|
|
210
|
+
} = l, n = E(() => y === "right");
|
|
210
211
|
return () => {
|
|
211
|
-
var
|
|
212
|
+
var m, c, f, b, p, F, w, i;
|
|
212
213
|
if (a.default) {
|
|
213
|
-
let
|
|
214
|
-
if (
|
|
215
|
-
let
|
|
214
|
+
let u;
|
|
215
|
+
if (s === "column") {
|
|
216
|
+
let d;
|
|
216
217
|
return e("div", {
|
|
217
|
-
class: ["container", "column"
|
|
218
|
-
"order-1": r.imagePosition === "left"
|
|
219
|
-
}]
|
|
218
|
+
class: ["container", "column"]
|
|
220
219
|
}, [e("div", {
|
|
221
|
-
class: "column-item"
|
|
222
|
-
|
|
220
|
+
class: "column-item",
|
|
221
|
+
style: {
|
|
222
|
+
order: n.value ? 1 : 2
|
|
223
|
+
}
|
|
224
|
+
}, [n.value && e("div", {
|
|
223
225
|
class: "logo"
|
|
224
|
-
}, [(
|
|
226
|
+
}, [(m = a.logo) == null ? void 0 : m.call(a)]), e(g, h(o, {
|
|
225
227
|
shadow: !1,
|
|
226
228
|
radius: !1,
|
|
227
|
-
onFinish: (
|
|
228
|
-
}),
|
|
229
|
-
default: () => [
|
|
229
|
+
onFinish: (U) => t("finish", U)
|
|
230
|
+
}), k(d = a.default()) ? d : {
|
|
231
|
+
default: () => [d]
|
|
230
232
|
})]), e("div", {
|
|
231
|
-
class: "column-muted"
|
|
232
|
-
|
|
233
|
+
class: "column-muted",
|
|
234
|
+
style: {
|
|
235
|
+
order: n.value ? 2 : 1
|
|
236
|
+
}
|
|
237
|
+
}, [!n.value && e("div", {
|
|
233
238
|
class: "logo"
|
|
234
|
-
}, [(
|
|
235
|
-
src:
|
|
239
|
+
}, [(c = a.logo) == null ? void 0 : c.call(a)]), l.bgImageUrl && e("img", {
|
|
240
|
+
src: l.bgImageUrl,
|
|
236
241
|
alt: "Image",
|
|
237
242
|
class: "column-muted-image"
|
|
238
243
|
}, null)])]);
|
|
239
244
|
}
|
|
240
|
-
if (
|
|
241
|
-
let
|
|
245
|
+
if (s === "card") {
|
|
246
|
+
let d;
|
|
242
247
|
return e("div", {
|
|
243
248
|
class: ["container", "flex-center", "card-login-wrapper"],
|
|
244
249
|
style: {
|
|
245
|
-
backgroundImage:
|
|
250
|
+
backgroundImage: r ? `url(${r})` : "transparent"
|
|
246
251
|
}
|
|
247
252
|
}, [e("div", {
|
|
248
253
|
class: "logo"
|
|
249
|
-
}, [(
|
|
254
|
+
}, [(f = a.logo) == null ? void 0 : f.call(a)]), e("div", {
|
|
250
255
|
class: "card-img-cover"
|
|
251
256
|
}, null), e("div", {
|
|
252
|
-
class: "card"
|
|
257
|
+
class: "card",
|
|
258
|
+
style: {
|
|
259
|
+
flexDirection: n.value ? "row" : "row-reverse"
|
|
260
|
+
}
|
|
253
261
|
}, [e("div", {
|
|
254
262
|
class: ["card-column-item", "flex-1"]
|
|
255
|
-
}, [e(g,
|
|
263
|
+
}, [e(g, h(o, {
|
|
256
264
|
shadow: !1,
|
|
257
265
|
radius: !1,
|
|
258
|
-
onFinish: (
|
|
259
|
-
}),
|
|
260
|
-
default: () => [
|
|
266
|
+
onFinish: (U) => t("finish", U)
|
|
267
|
+
}), k(d = a.default()) ? d : {
|
|
268
|
+
default: () => [d]
|
|
261
269
|
})]), e("div", {
|
|
262
270
|
class: ["card-column-muted", "flex-1"],
|
|
263
271
|
style: {
|
|
264
272
|
width: "350px"
|
|
265
273
|
}
|
|
266
|
-
}, [
|
|
267
|
-
src:
|
|
274
|
+
}, [r && e("img", {
|
|
275
|
+
src: r,
|
|
268
276
|
alt: "Image",
|
|
269
277
|
class: "column-muted-image"
|
|
270
278
|
}, null)])])]);
|
|
@@ -272,73 +280,82 @@ const j = /* @__PURE__ */ C({
|
|
|
272
280
|
return e("div", {
|
|
273
281
|
class: ["container", "flex-center"],
|
|
274
282
|
style: {
|
|
275
|
-
backgroundImage: `url(${
|
|
283
|
+
backgroundImage: `url(${r})`,
|
|
276
284
|
backgroundSize: "cover"
|
|
277
285
|
}
|
|
278
286
|
}, [e("div", {
|
|
279
287
|
class: ["flex-col", "space-y-4"]
|
|
280
|
-
}, [(
|
|
281
|
-
onFinish: (
|
|
282
|
-
}),
|
|
283
|
-
default: () => [
|
|
288
|
+
}, [(b = a.logo) == null ? void 0 : b.call(a), e(g, h(o, {
|
|
289
|
+
onFinish: (d) => t("finish", d)
|
|
290
|
+
}), k(u = a.default()) ? u : {
|
|
291
|
+
default: () => [u]
|
|
284
292
|
})])]);
|
|
285
293
|
} else
|
|
286
|
-
return
|
|
294
|
+
return s === "column" ? e("div", {
|
|
287
295
|
class: ["container", "column", {
|
|
288
|
-
"column-reverse":
|
|
296
|
+
"column-reverse": l.imagePosition === "left"
|
|
289
297
|
}]
|
|
290
298
|
}, [e("div", {
|
|
291
299
|
class: "column-item"
|
|
292
|
-
}, [
|
|
300
|
+
}, [n.value && e("div", {
|
|
293
301
|
class: "logo"
|
|
294
|
-
}, [(
|
|
302
|
+
}, [(p = a.logo) == null ? void 0 : p.call(a)]), e(g, h(o, {
|
|
295
303
|
shadow: !1,
|
|
296
304
|
radius: !1,
|
|
297
|
-
onFinish: (
|
|
305
|
+
onFinish: (u) => t("finish", u)
|
|
298
306
|
}), null)]), e("div", {
|
|
299
307
|
class: "column-muted"
|
|
300
|
-
}, [!
|
|
308
|
+
}, [!n.value && e("div", {
|
|
301
309
|
class: "logo"
|
|
302
|
-
}, [(
|
|
303
|
-
src:
|
|
310
|
+
}, [(F = a.logo) == null ? void 0 : F.call(a)]), l.bgImageUrl && e("img", {
|
|
311
|
+
src: l.bgImageUrl,
|
|
304
312
|
alt: "Image",
|
|
305
313
|
class: "column-muted-image"
|
|
306
|
-
}, null)])]) :
|
|
307
|
-
class: ["container", "flex-center"]
|
|
314
|
+
}, null)])]) : s === "card" ? e("div", {
|
|
315
|
+
class: ["container", "flex-center", "card-login-wrapper"],
|
|
316
|
+
style: {
|
|
317
|
+
backgroundImage: r ? `url(${r})` : "transparent",
|
|
318
|
+
backgroundSize: "cover"
|
|
319
|
+
}
|
|
308
320
|
}, [e("div", {
|
|
309
321
|
class: "logo"
|
|
310
|
-
}, [(
|
|
311
|
-
class: "card"
|
|
322
|
+
}, [(w = a.logo) == null ? void 0 : w.call(a)]), e("div", {
|
|
323
|
+
class: "card-img-cover"
|
|
324
|
+
}, null), e("div", {
|
|
325
|
+
class: "card",
|
|
326
|
+
style: {
|
|
327
|
+
flexDirection: n.value ? "row" : "row-reverse"
|
|
328
|
+
}
|
|
312
329
|
}, [e("div", {
|
|
313
330
|
class: ["card-column-item", "flex-1"]
|
|
314
|
-
}, [e(g,
|
|
331
|
+
}, [e(g, h(o, {
|
|
315
332
|
shadow: !1,
|
|
316
333
|
radius: !1,
|
|
317
|
-
onFinish: (
|
|
334
|
+
onFinish: (u) => t("finish", u)
|
|
318
335
|
}), null)]), e("div", {
|
|
319
336
|
class: ["card-column-muted", "flex-1"],
|
|
320
337
|
style: {
|
|
321
338
|
width: "350px"
|
|
322
339
|
}
|
|
323
|
-
}, [
|
|
324
|
-
src:
|
|
340
|
+
}, [r && e("img", {
|
|
341
|
+
src: r,
|
|
325
342
|
alt: "Image",
|
|
326
343
|
class: "column-muted-image"
|
|
327
344
|
}, null)])])]) : e("div", {
|
|
328
345
|
class: ["container", "flex-center"],
|
|
329
346
|
style: {
|
|
330
|
-
backgroundImage: `url(${
|
|
347
|
+
backgroundImage: `url(${r})`,
|
|
331
348
|
backgroundSize: "cover"
|
|
332
349
|
}
|
|
333
350
|
}, [e("div", {
|
|
334
351
|
class: ["flex-col", "space-y-4"]
|
|
335
|
-
}, [(
|
|
352
|
+
}, [(i = a.logo) == null ? void 0 : i.call(a), e(g, o, null)])]);
|
|
336
353
|
};
|
|
337
354
|
}
|
|
338
355
|
});
|
|
339
356
|
export {
|
|
340
357
|
j as Login,
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
358
|
+
N as loginEmits,
|
|
359
|
+
R as loginFormProps,
|
|
360
|
+
z as loginProps
|
|
344
361
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@banmao/blocks",
|
|
3
|
-
"version": "0.0.1
|
|
3
|
+
"version": "0.0.1",
|
|
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": "3.1.4",
|
|
21
|
+
"@vitest/ui": "3.1.4",
|
|
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": "^17.4.7",
|
|
26
26
|
"naive-ui": "^2.41.0",
|
|
27
|
-
"typescript": "
|
|
28
|
-
"unplugin-auto-import": "^
|
|
29
|
-
"unplugin-icons": "^22.
|
|
30
|
-
"unplugin-vue-components": "^
|
|
31
|
-
"vite": "^6.
|
|
27
|
+
"typescript": "^5.7.3",
|
|
28
|
+
"unplugin-auto-import": "^19.2.0",
|
|
29
|
+
"unplugin-icons": "^22.1.0",
|
|
30
|
+
"unplugin-vue-components": "^28.5.0",
|
|
31
|
+
"vite": "^6.3.5",
|
|
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
|
},
|