@banmao/blocks 0.0.1-alpha.0 → 0.0.1-alpha.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/index.cjs CHANGED
@@ -1 +1 @@
1
- require('./index.css');"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("naive-ui"),F="_container_17dip_1",x="_title_17dip_26",w="_description_17dip_31",U="_signUp_17dip_36",k="_link_17dip_41",C="_column_17dip_59",S="_grid_17dip_59",I="_card_17dip_71",B="_logo_17dip_84",P="_dark_17dip_138",t={container:F,"flex-center":"_flex-center_17dip_7","flex-col":"_flex-col_17dip_13","space-y-4":"_space-y-4_17dip_20",title:x,description:w,signUp:U,link:k,"password-forgot":"_password-forgot_17dip_46",column:C,grid:S,"column-reverse":"_column-reverse_17dip_63",card:I,"flex-1":"_flex-1_17dip_80",logo:B,"column-item":"_column-item_17dip_93","column-muted":"_column-muted_17dip_103","column-muted-image":"_column-muted-image_17dip_110",dark:P},y=["finish","error","captcha","wechatFinish"],v={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}},b={title:{type:String,default:"Welcome back"},subTitle:{type:String,default:"Login to your account"},forgotUrl:{type:String,default:""},signUpUrl:{type:String,default:""},shadow:{type:Boolean,default:!0},actions:{type:Array}},L=e.defineComponent({name:"CardTitle",props:{title:{type:String,default:"Welcome back"},description:{type:String,default:"Login to your account"}},setup(a){const{title:l,description:o}=a;return()=>e.createVNode("div",null,[e.createVNode("div",{class:t.title},[l]),e.createVNode("div",{class:t.description},[o])])}}),V=e.defineComponent({name:"LoginForm",props:b,emits:y,setup(a,{emit:l}){const{actions:o,title:m,subTitle:h,signUpUrl:c,forgotUrl:_,shadow:d}=a,i=e.reactive({username:"",password:""}),u=e.ref(!1),p={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"}]},s=e.ref(null),f=()=>{var n;(n=s.value)==null||n.validate(N=>{N?(console.error(N),l("error",N)):l("finish",e.toRaw(i))})},g=()=>{console.error("Weixin login is not supported yet."),l("wechatFinish")};return()=>e.createVNode(r.NCard,{title:()=>e.createVNode(L,{title:m,description:h},null),style:[{width:"350px"},d&&"box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);"],bordered:!1,hoverable:d},{default:()=>[e.createVNode(r.NForm,{ref:s,model:i,rules:p,size:"large","show-require-mark":!1},{default:()=>[e.createVNode(r.NFormItem,{label:"用户名",path:"username"},{default:()=>[e.createVNode(r.NInput,{value:i.username,"onUpdate:value":n=>i.username=n,placeholder:"请输入用户名"},null)]}),e.createVNode(r.NFormItem,{label:"密码",path:"password"},{default:()=>[e.createVNode(r.NInput,{value:i.password,"onUpdate:value":n=>i.password=n,placeholder:"请输入密码",type:"password"},null)]}),e.createVNode("div",{class:t["password-forgot"]},[e.createVNode(r.NCheckbox,{checked:u.value,"onUpdate:checked":n=>u.value=n,label:"记住密码"},null),_&&e.createVNode("a",{href:_},[e.createTextVNode("忘记密码?")])]),e.createVNode(r.NFormItem,{showLabel:!1},{default:()=>[e.createVNode(r.NButton,{"attr-type":"button",type:"primary",block:!0,onClick:()=>f()},{default:()=>[e.createTextVNode("登录")]})]}),o&&e.createVNode(r.NFormItem,{showLabel:!1},{default:()=>[e.createVNode(r.NButton,{color:"#02E16E",ghost:!0,block:!0,onClick:()=>g()},{default:()=>[e.createTextVNode("微信登录")]})]})]}),c&&e.createVNode("div",{class:t.signUp},[e.createTextVNode("还没有账号?"),e.createVNode("a",{href:c},[e.createTextVNode("立即注册")])])]})}}),T=e.defineComponent({name:"LoginPage",props:v,emits:y,setup(a,{emit:l,slots:o}){const{layout:m,bg:h,bgImageUrl:c,logo:_,...d}=a,i=e.computed(()=>a.imagePosition==="right");return()=>{var u,p,s,f;return m==="column"?e.createVNode("div",{class:[t.container,t.column,{[t["column-reverse"]]:a.imagePosition==="left"}]},[e.createVNode("div",{class:t["column-item"]},[i.value&&e.createVNode("div",{class:t.logo},[(u=o.logo)==null?void 0:u.call(o)]),e.createVNode(V,e.mergeProps(d,{shadow:!1,onFinish:g=>l("finish",g)}),null)]),e.createVNode("div",{class:t["column-muted"]},[!i.value&&e.createVNode("div",{class:t.logo},[(p=o.logo)==null?void 0:p.call(o)]),a.bgImageUrl&&e.createVNode(r.NImage,{src:a.bgImageUrl,alt:"Image",objectFit:"cover",class:t["column-muted-image"]},null)])]):m==="card"?e.createVNode("div",{class:[t.container,t["flex-center"]]},[e.createVNode("div",{class:t.logo},[(s=o.logo)==null?void 0:s.call(o)]),e.createVNode("div",{class:[t.card]},[e.createVNode("div",{class:[t["column-item"],t["flex-1"]]},[e.createVNode(V,e.mergeProps(d,{shadow:!1,onFinish:g=>l("finish",g)}),null)]),e.createVNode("div",{class:[t["column-muted"],t["flex-1"]],style:{}},[c&&e.createVNode(r.NImage,{src:c,alt:"Image",objectFit:"cover",class:t["column-muted-image"]},null)])])]):e.createVNode("div",{class:[t.container,t["flex-center"]],style:{backgroundImage:`url(${c})`,backgroundSize:"cover"}},[e.createVNode("div",{class:[t["flex-col"],t["space-y-4"]]},[(f=o.logo)==null?void 0:f.call(o),e.createVNode(V,d,null)])])}}});exports.Login=T;exports.loginEmits=y;exports.loginFormProps=b;exports.loginProps=v;
1
+ require('./index.css');"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("naive-ui"),h=["finish","error","captcha","wechatFinish"],v={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}},b={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}},V=e.defineComponent({name:"LoginForm",props:b,emits:h,setup(l,{emit:i}){const{actions:t,title:m,subTitle:y,signUpUrl:n,forgotUrl:p,shadow:u,radius:c}=l,r=e.reactive({username:"",password:""}),d=e.ref(!1),f={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"}]},s=e.ref(null),g=()=>{var o;(o=s.value)==null||o.validate(N=>{N?(console.error(N),i("error",N)):i("finish",e.toRaw(r))})},F=()=>{console.error("Weixin login is not supported yet."),i("wechatFinish")};return()=>e.createVNode("div",{class:["login-form",{"login-form-shadow":u}],style:[{borderRadius:c?`${c}px`:"none"}]},[e.createVNode("div",{class:"title"},[m]),e.createVNode("div",{class:"sub-title"},[y]),e.createVNode(a.NForm,{ref:s,model:r,rules:f,size:"large","show-require-mark":!1},{default:()=>[e.createVNode(a.NFormItem,{label:"用户名",path:"username"},{default:()=>[e.createVNode(a.NInput,{value:r.username,"onUpdate:value":o=>r.username=o,placeholder:"请输入用户名"},null)]}),e.createVNode(a.NFormItem,{label:"密码",path:"password"},{default:()=>[e.createVNode(a.NInput,{value:r.password,"onUpdate:value":o=>r.password=o,placeholder:"请输入密码",type:"password"},null)]}),e.createVNode("div",{class:"password-forgot"},[e.createVNode(a.NCheckbox,{checked:d.value,"onUpdate:checked":o=>d.value=o,label:"记住密码"},null),p&&e.createVNode("a",{href:p},[e.createTextVNode("忘记密码?")])]),e.createVNode(a.NFormItem,{showLabel:!1},{default:()=>[e.createVNode(a.NButton,{"attr-type":"button",type:"primary",block:!0,onClick:()=>g()},{default:()=>[e.createTextVNode("登录")]})]}),t&&e.createVNode(a.NFormItem,{showLabel:!1},{default:()=>[e.createVNode(a.NButton,{color:"#02E16E",ghost:!0,block:!0,onClick:()=>F()},{default:()=>[e.createTextVNode("微信登录")]})]})]}),n&&e.createVNode("div",{class:"signUp"},[e.createTextVNode("还没有账号?"),e.createVNode("a",{href:n},[e.createTextVNode("立即注册")])])])}}),w=e.defineComponent({name:"LoginPage",props:v,emits:h,setup(l,{emit:i,slots:t}){const{layout:m,bg:y,bgImageUrl:n,logo:p,...u}=l,c=e.computed(()=>l.imagePosition==="right");return()=>{var r,d,f,s;return m==="column"?e.createVNode("div",{class:["container","column",{"column-reverse":l.imagePosition==="left"}]},[e.createVNode("div",{class:"column-item"},[c.value&&e.createVNode("div",{class:["logo"]},[(r=t.logo)==null?void 0:r.call(t)]),e.createVNode(V,e.mergeProps(u,{shadow:!1,radius:!1,onFinish:g=>i("finish",g)}),null)]),e.createVNode("div",{class:["column-muted"]},[!c.value&&e.createVNode("div",{class:["logo"]},[(d=t.logo)==null?void 0:d.call(t)]),l.bgImageUrl&&e.createVNode("img",{src:l.bgImageUrl,alt:"Image",class:["column-muted-image"]},null)])]):m==="card"?e.createVNode("div",{class:["container","flex-center"]},[e.createVNode("div",{class:["logo"]},[(f=t.logo)==null?void 0:f.call(t)]),e.createVNode("div",{class:"card"},[e.createVNode("div",{class:["card-column-item","flex-1"]},[e.createVNode(V,e.mergeProps(u,{shadow:!1,radius:!1,onFinish:g=>i("finish",g)}),null)]),e.createVNode("div",{class:["card-column-muted","flex-1"],style:{width:"350px"}},[n&&e.createVNode("img",{src:n,alt:"Image",class:["column-muted-image"]},null)])])]):e.createVNode("div",{class:["container","flex-center"],style:{backgroundImage:`url(${n})`,backgroundSize:"cover"}},[e.createVNode("div",{class:["flex-col","space-y-4"]},[(s=t.logo)==null?void 0:s.call(t),e.createVNode(V,u,null)])])}}});exports.Login=w;exports.loginEmits=h;exports.loginFormProps=b;exports.loginProps=v;
package/dist/index.css CHANGED
@@ -1 +1 @@
1
- ._container_17dip_1{position:relative;width:100%;height:100svh}._flex-center_17dip_7{display:flex;align-items:center;justify-content:center}._flex-col_17dip_13{display:flex;flex-direction:column;justify-content:center;align-items:center}._space-y-4_17dip_20{gap:16px}._title_17dip_26{font-size:20px;font-weight:700}._description_17dip_31{font-size:16px;color:#71717a}._signUp_17dip_36{text-align:center}._signUp_17dip_36 a,._link_17dip_41{color:#3b82f6;text-decoration:none}._password-forgot_17dip_46{width:100%;display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}._password-forgot_17dip_46 a{color:#3b82f6;text-decoration:none}._column_17dip_59,._grid_17dip_59{display:grid}._column-reverse_17dip_63{direction:rtl}._column-reverse_17dip_63>*{direction:ltr}._card_17dip_71{width:100%;max-width:48rem;display:flex;box-sizing:border-box;box-shadow:0 2px 12px #0000001a;border-radius:.5rem;overflow:hidden}._flex-1_17dip_80{flex:1}._logo_17dip_84{position:absolute;top:20px;left:20px;z-index:inherit;height:64px;min-width:64px}._column-item_17dip_93{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:16px}._column-muted_17dip_103{width:100%;position:relative;display:none;background-color:#27272a}._column-muted-image_17dip_110{position:absolute;top:0;right:0;bottom:0;left:0;height:100%;width:100%}@media screen and (max-width: 1199px){._column-item_17dip_93{padding:40px}}@media screen and (max-width: 1200){._card_17dip_71{max-width:24rem}}@media screen and (min-width: 1200px){._column_17dip_59{grid-template-columns:repeat(2,minmax(0,1fr))}._column-muted_17dip_103{display:block}}._dark_17dip_138 ._column-muted-image_17dip_110{filter:brightness(.2)}._dark_17dip_138 ._column-muted-image_17dip_110{filter:grayscale(100%)}
1
+ .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:#fffc;-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}:root{--color-link: #2563eb;--color-text: #3f3f46;--color-section-text: #71717a}.login-form-shadow{box-shadow:0 2px 12px #0000001a}.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 #0000001a;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:#27272a}.flex-1{flex:1}.logo{position:absolute;top:20px;left:20px;z-index:inherit;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:#27272a}.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:#0006}@media (prefers-color-scheme: light){:root{--color-text: #333;--color-section-text: #4f4f4f}.login-form{background:#fffc}.sub-title{color:var(--color-section-text)}}
package/dist/index.js CHANGED
@@ -1,26 +1,6 @@
1
- import './index.css';import { defineComponent as b, reactive as B, ref as x, createVNode as e, createTextVNode as g, toRaw as I, computed as L, mergeProps as w } from "vue";
2
- import { NCard as N, NForm as P, NFormItem as _, NInput as U, NCheckbox as E, NButton as k, NImage as C } from "naive-ui";
3
- const T = "_container_17dip_1", W = "_title_17dip_26", A = "_description_17dip_31", D = "_signUp_17dip_36", q = "_link_17dip_41", R = "_column_17dip_59", j = "_grid_17dip_59", z = "_card_17dip_71", V = "_logo_17dip_84", $ = "_dark_17dip_138", t = {
4
- container: T,
5
- "flex-center": "_flex-center_17dip_7",
6
- "flex-col": "_flex-col_17dip_13",
7
- "space-y-4": "_space-y-4_17dip_20",
8
- title: W,
9
- description: A,
10
- signUp: D,
11
- link: q,
12
- "password-forgot": "_password-forgot_17dip_46",
13
- column: R,
14
- grid: j,
15
- "column-reverse": "_column-reverse_17dip_63",
16
- card: z,
17
- "flex-1": "_flex-1_17dip_80",
18
- logo: V,
19
- "column-item": "_column-item_17dip_93",
20
- "column-muted": "_column-muted_17dip_103",
21
- "column-muted-image": "_column-muted-image_17dip_110",
22
- dark: $
23
- }, S = ["finish", "error", "captcha", "wechatFinish"], G = {
1
+ import './index.css';import { defineComponent as B, reactive as C, ref as F, createVNode as e, createTextVNode as g, toRaw as I, computed as L, mergeProps as w } from "vue";
2
+ import { NForm as N, NFormItem as p, NInput as U, NCheckbox as P, NButton as x } from "naive-ui";
3
+ const S = ["finish", "error", "captcha", "wechatFinish"], E = {
24
4
  title: {
25
5
  type: String,
26
6
  default: "Welcome back"
@@ -59,7 +39,7 @@ const T = "_container_17dip_1", W = "_title_17dip_26", A = "_description_17dip_3
59
39
  actions: {
60
40
  type: Array
61
41
  }
62
- }, H = {
42
+ }, A = {
63
43
  title: {
64
44
  type: String,
65
45
  default: "Welcome back"
@@ -76,6 +56,10 @@ const T = "_container_17dip_1", W = "_title_17dip_26", A = "_description_17dip_3
76
56
  type: String,
77
57
  default: ""
78
58
  },
59
+ radius: {
60
+ type: [Number, Boolean],
61
+ default: 8
62
+ },
79
63
  shadow: {
80
64
  type: Boolean,
81
65
  default: !0
@@ -83,47 +67,25 @@ const T = "_container_17dip_1", W = "_title_17dip_26", A = "_description_17dip_3
83
67
  actions: {
84
68
  type: Array
85
69
  }
86
- }, J = /* @__PURE__ */ b({
87
- name: "CardTitle",
88
- props: {
89
- title: {
90
- type: String,
91
- default: "Welcome back"
92
- },
93
- description: {
94
- type: String,
95
- default: "Login to your account"
96
- }
97
- },
98
- setup(l) {
99
- const {
100
- title: r,
101
- description: o
102
- } = l;
103
- return () => e("div", null, [e("div", {
104
- class: t.title
105
- }, [r]), e("div", {
106
- class: t.description
107
- }, [o])]);
108
- }
109
- }), v = /* @__PURE__ */ b({
70
+ }, b = /* @__PURE__ */ B({
110
71
  name: "LoginForm",
111
- props: H,
72
+ props: A,
112
73
  emits: S,
113
- setup(l, {
114
- emit: r
74
+ setup(r, {
75
+ emit: o
115
76
  }) {
116
77
  const {
117
- actions: o,
118
- title: p,
119
- subTitle: F,
120
- signUpUrl: a,
78
+ actions: a,
79
+ title: m,
80
+ subTitle: v,
81
+ signUpUrl: u,
121
82
  forgotUrl: h,
122
- shadow: u
123
- } = l, i = B({
83
+ shadow: i,
84
+ radius: n
85
+ } = r, l = C({
124
86
  username: "",
125
87
  password: ""
126
- }), c = x(!1), m = {
88
+ }), s = F(!1), f = {
127
89
  username: [{
128
90
  required: !0,
129
91
  message: "请输入用户名",
@@ -144,160 +106,161 @@ const T = "_container_17dip_1", W = "_title_17dip_26", A = "_description_17dip_3
144
106
  message: "长度在 6 到 20 个字符",
145
107
  trigger: "blur"
146
108
  }]
147
- }, s = x(null), f = () => {
148
- var n;
149
- (n = s.value) == null || n.validate((y) => {
150
- y ? (console.error(y), r("error", y)) : r("finish", I(i));
109
+ }, c = F(null), d = () => {
110
+ var t;
111
+ (t = c.value) == null || t.validate((y) => {
112
+ y ? (console.error(y), o("error", y)) : o("finish", I(l));
151
113
  });
152
- }, d = () => {
153
- console.error("Weixin login is not supported yet."), r("wechatFinish");
114
+ }, k = () => {
115
+ console.error("Weixin login is not supported yet."), o("wechatFinish");
154
116
  };
155
- return () => e(N, {
156
- title: () => e(J, {
157
- title: p,
158
- description: F
159
- }, null),
117
+ return () => e("div", {
118
+ class: ["login-form", {
119
+ "login-form-shadow": i
120
+ }],
160
121
  style: [{
161
- width: "350px"
162
- }, u && "box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);"],
163
- bordered: !1,
164
- hoverable: u
122
+ borderRadius: n ? `${n}px` : "none"
123
+ }]
124
+ }, [e("div", {
125
+ class: "title"
126
+ }, [m]), e("div", {
127
+ class: "sub-title"
128
+ }, [v]), e(N, {
129
+ ref: c,
130
+ model: l,
131
+ rules: f,
132
+ size: "large",
133
+ "show-require-mark": !1
165
134
  }, {
166
- default: () => [e(P, {
167
- ref: s,
168
- model: i,
169
- rules: m,
170
- size: "large",
171
- "show-require-mark": !1
135
+ default: () => [e(p, {
136
+ label: "用户名",
137
+ path: "username"
172
138
  }, {
173
- default: () => [e(_, {
174
- label: "用户名",
175
- path: "username"
176
- }, {
177
- default: () => [e(U, {
178
- value: i.username,
179
- "onUpdate:value": (n) => i.username = n,
180
- placeholder: "请输入用户名"
181
- }, null)]
182
- }), e(_, {
183
- label: "密码",
184
- path: "password"
185
- }, {
186
- default: () => [e(U, {
187
- value: i.password,
188
- "onUpdate:value": (n) => i.password = n,
189
- placeholder: "请输入密码",
190
- type: "password"
191
- }, null)]
192
- }), e("div", {
193
- class: t["password-forgot"]
194
- }, [e(E, {
195
- checked: c.value,
196
- "onUpdate:checked": (n) => c.value = n,
197
- label: "记住密码"
198
- }, null), h && e("a", {
199
- href: h
200
- }, [g("忘记密码?")])]), e(_, {
201
- showLabel: !1
139
+ default: () => [e(U, {
140
+ value: l.username,
141
+ "onUpdate:value": (t) => l.username = t,
142
+ placeholder: "请输入用户名"
143
+ }, null)]
144
+ }), e(p, {
145
+ label: "密码",
146
+ path: "password"
147
+ }, {
148
+ default: () => [e(U, {
149
+ value: l.password,
150
+ "onUpdate:value": (t) => l.password = t,
151
+ placeholder: "请输入密码",
152
+ type: "password"
153
+ }, null)]
154
+ }), e("div", {
155
+ class: "password-forgot"
156
+ }, [e(P, {
157
+ checked: s.value,
158
+ "onUpdate:checked": (t) => s.value = t,
159
+ label: "记住密码"
160
+ }, null), h && e("a", {
161
+ href: h
162
+ }, [g("忘记密码?")])]), e(p, {
163
+ showLabel: !1
164
+ }, {
165
+ default: () => [e(x, {
166
+ "attr-type": "button",
167
+ type: "primary",
168
+ block: !0,
169
+ onClick: () => d()
202
170
  }, {
203
- default: () => [e(k, {
204
- "attr-type": "button",
205
- type: "primary",
206
- block: !0,
207
- onClick: () => f()
208
- }, {
209
- default: () => [g("登录")]
210
- })]
211
- }), o && e(_, {
212
- showLabel: !1
171
+ default: () => [g("登录")]
172
+ })]
173
+ }), a && e(p, {
174
+ showLabel: !1
175
+ }, {
176
+ default: () => [e(x, {
177
+ color: "#02E16E",
178
+ ghost: !0,
179
+ block: !0,
180
+ onClick: () => k()
213
181
  }, {
214
- default: () => [e(k, {
215
- color: "#02E16E",
216
- ghost: !0,
217
- block: !0,
218
- onClick: () => d()
219
- }, {
220
- default: () => [g("微信登录")]
221
- })]
182
+ default: () => [g("微信登录")]
222
183
  })]
223
- }), a && e("div", {
224
- class: t.signUp
225
- }, [g("还没有账号?"), e("a", {
226
- href: a
227
- }, [g("立即注册")])])]
228
- });
184
+ })]
185
+ }), u && e("div", {
186
+ class: "signUp"
187
+ }, [g("还没有账号?"), e("a", {
188
+ href: u
189
+ }, [g("立即注册")])])]);
229
190
  }
230
- }), O = /* @__PURE__ */ b({
191
+ }), R = /* @__PURE__ */ B({
231
192
  name: "LoginPage",
232
- props: G,
193
+ props: E,
233
194
  emits: S,
234
- setup(l, {
235
- emit: r,
236
- slots: o
195
+ setup(r, {
196
+ emit: o,
197
+ slots: a
237
198
  }) {
238
199
  const {
239
- layout: p,
240
- bg: F,
241
- bgImageUrl: a,
200
+ layout: m,
201
+ bg: v,
202
+ bgImageUrl: u,
242
203
  logo: h,
243
- ...u
244
- } = l, i = L(() => l.imagePosition === "right");
204
+ ...i
205
+ } = r, n = L(() => r.imagePosition === "right");
245
206
  return () => {
246
- var c, m, s, f;
247
- return p === "column" ? e("div", {
248
- class: [t.container, t.column, {
249
- [t["column-reverse"]]: l.imagePosition === "left"
207
+ var l, s, f, c;
208
+ return m === "column" ? e("div", {
209
+ class: ["container", "column", {
210
+ "column-reverse": r.imagePosition === "left"
250
211
  }]
251
212
  }, [e("div", {
252
- class: t["column-item"]
253
- }, [i.value && e("div", {
254
- class: t.logo
255
- }, [(c = o.logo) == null ? void 0 : c.call(o)]), e(v, w(u, {
213
+ class: "column-item"
214
+ }, [n.value && e("div", {
215
+ class: ["logo"]
216
+ }, [(l = a.logo) == null ? void 0 : l.call(a)]), e(b, w(i, {
256
217
  shadow: !1,
257
- onFinish: (d) => r("finish", d)
218
+ radius: !1,
219
+ onFinish: (d) => o("finish", d)
258
220
  }), null)]), e("div", {
259
- class: t["column-muted"]
260
- }, [!i.value && e("div", {
261
- class: t.logo
262
- }, [(m = o.logo) == null ? void 0 : m.call(o)]), l.bgImageUrl && e(C, {
263
- src: l.bgImageUrl,
221
+ class: ["column-muted"]
222
+ }, [!n.value && e("div", {
223
+ class: ["logo"]
224
+ }, [(s = a.logo) == null ? void 0 : s.call(a)]), r.bgImageUrl && e("img", {
225
+ src: r.bgImageUrl,
264
226
  alt: "Image",
265
- objectFit: "cover",
266
- class: t["column-muted-image"]
267
- }, null)])]) : p === "card" ? e("div", {
268
- class: [t.container, t["flex-center"]]
227
+ class: ["column-muted-image"]
228
+ }, null)])]) : m === "card" ? e("div", {
229
+ class: ["container", "flex-center"]
269
230
  }, [e("div", {
270
- class: t.logo
271
- }, [(s = o.logo) == null ? void 0 : s.call(o)]), e("div", {
272
- class: [t.card]
231
+ class: ["logo"]
232
+ }, [(f = a.logo) == null ? void 0 : f.call(a)]), e("div", {
233
+ class: "card"
273
234
  }, [e("div", {
274
- class: [t["column-item"], t["flex-1"]]
275
- }, [e(v, w(u, {
235
+ class: ["card-column-item", "flex-1"]
236
+ }, [e(b, w(i, {
276
237
  shadow: !1,
277
- onFinish: (d) => r("finish", d)
238
+ radius: !1,
239
+ onFinish: (d) => o("finish", d)
278
240
  }), null)]), e("div", {
279
- class: [t["column-muted"], t["flex-1"]],
280
- style: {}
281
- }, [a && e(C, {
282
- src: a,
241
+ class: ["card-column-muted", "flex-1"],
242
+ style: {
243
+ width: "350px"
244
+ }
245
+ }, [u && e("img", {
246
+ src: u,
283
247
  alt: "Image",
284
- objectFit: "cover",
285
- class: t["column-muted-image"]
248
+ class: ["column-muted-image"]
286
249
  }, null)])])]) : e("div", {
287
- class: [t.container, t["flex-center"]],
250
+ class: ["container", "flex-center"],
288
251
  style: {
289
- backgroundImage: `url(${a})`,
252
+ backgroundImage: `url(${u})`,
290
253
  backgroundSize: "cover"
291
254
  }
292
255
  }, [e("div", {
293
- class: [t["flex-col"], t["space-y-4"]]
294
- }, [(f = o.logo) == null ? void 0 : f.call(o), e(v, u, null)])]);
256
+ class: ["flex-col", "space-y-4"]
257
+ }, [(c = a.logo) == null ? void 0 : c.call(a), e(b, i, null)])]);
295
258
  };
296
259
  }
297
260
  });
298
261
  export {
299
- O as Login,
262
+ R as Login,
300
263
  S as loginEmits,
301
- H as loginFormProps,
302
- G as loginProps
264
+ A as loginFormProps,
265
+ E as loginProps
303
266
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@banmao/blocks",
3
- "version": "0.0.1-alpha.0",
3
+ "version": "0.0.1-alpha.2",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {