@banmao/blocks 0.0.1-alpha.3 → 0.0.1-alpha.5

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # @banmao/procomponent
1
+ # @banmao/blocks
2
2
 
3
- 基于 Naive UI 封装的高级组件库,旨在帮助开发者快速搭建企业级中后台应用。
3
+ 基于 Naive UI 封装的登录组件。
4
4
 
5
5
  ## 特性
6
6
 
@@ -12,52 +12,31 @@
12
12
  ## 安装
13
13
 
14
14
  ```bash
15
- # 安装 naive-ui
16
- pnpm add naive-ui
17
-
18
- # 安装 @banmao/procomponent
19
- pnpm add @banmao/procomponent
15
+ # 安装 @banmao/blocks
16
+ pnpm add @banmao/blocks
20
17
  ```
21
18
 
22
19
  ## 使用
23
20
 
24
- ```ts
25
- import { createApp } from 'vue'
26
- import {
27
- ProLayout,
28
- ProTable,
29
- ProForm,
30
- DrawerForm,
31
- ModalForm
32
- } from '@banmao/procomponent'
33
-
34
- const app = createApp()
35
-
36
- // 注册需要使用的组件
37
- app.use(ProLayout)
38
- app.use(ProTable)
39
- app.use(ProForm)
40
- app.use(DrawerForm)
41
- app.use(ModalForm)
21
+ ```vue
22
+ <script setup lang="ts">
23
+ import { Login } from '@banmao/blocks'
24
+
25
+ </script>
26
+
27
+ <template>
28
+ <Login />
29
+ </template>
42
30
  ```
43
31
 
44
32
  ## 组件列表
45
33
 
46
- - DrawerForm - 抽屉表单组件
47
- - ModalForm - 弹窗表单组件
48
- - ProForm - 表单组件
49
- - ProLayout - 布局组件
50
- - ProTable - 表格组件
51
- - ProText - 文本组件
52
- - ProDescriptions - 描述列表组件
53
- - ProList - 列表组件
54
- - Tour - 漫游式引导组件
55
- - Watermark - 水印组件
34
+ - Login - 登录表单组件
56
35
 
57
36
  ## 文档
58
37
 
59
- 访问 [ProComponent 文档](https://procomponent.banmao.cc/) 了解更多使用细节。
38
+ 访问 [ProComponent 文档](https://procomponent.banmao.cc/blocks) 了解更多使用细节。
60
39
 
61
40
  ## License
62
41
 
63
- [MIT](./LICENSE)
42
+ [MIT](./LICENSE)
@@ -16,7 +16,7 @@ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropType
16
16
  default: string;
17
17
  };
18
18
  radius: {
19
- type: (NumberConstructor | BooleanConstructor)[];
19
+ type: (BooleanConstructor | NumberConstructor)[];
20
20
  default: number;
21
21
  };
22
22
  shadow: {
@@ -44,7 +44,7 @@ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropType
44
44
  default: string;
45
45
  };
46
46
  radius: {
47
- type: (NumberConstructor | BooleanConstructor)[];
47
+ type: (BooleanConstructor | NumberConstructor)[];
48
48
  default: number;
49
49
  };
50
50
  shadow: {
@@ -97,7 +97,7 @@ export declare const loginFormProps: {
97
97
  default: string;
98
98
  };
99
99
  radius: {
100
- type: (NumberConstructor | BooleanConstructor)[];
100
+ type: (BooleanConstructor | NumberConstructor)[];
101
101
  default: number;
102
102
  };
103
103
  shadow: {
package/dist/index.cjs CHANGED
@@ -1 +1 @@
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;
1
+ require('./index.css');"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=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}},S={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}},f=e.defineComponent({name:"LoginForm",props:S,emits:w,setup(r,{emit:l,slots:a}){const{actions:g,title:U,subTitle:d,signUpUrl:y,forgotUrl:c,shadow:s,radius:N}=r,i=e.reactive({username:"",password:""}),p=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"}]},V=e.ref(null),h=()=>{var t;(t=V.value)==null||t.validate(m=>{m?(console.error(m),l("error",m)):l("finish",e.toRaw(i))})},b=()=>{console.error("Weixin login is not supported yet."),l("wechatFinish")};return()=>e.createVNode("div",{class:["login-form",{"login-form-shadow":s}],style:[{borderRadius:N?`${N}px`:"none"}]},[e.createVNode("div",{class:"title"},[U]),e.createVNode("div",{class:"sub-title"},[d]),a.default?a.default():e.createVNode(o.NForm,{ref:V,model:i,rules:v,size:"large","show-require-mark":!1},{default:()=>[e.createVNode(o.NFormItem,{label:"用户名",path:"username"},{default:()=>[e.createVNode(o.NInput,{value:i.username,"onUpdate:value":t=>i.username=t,placeholder:"请输入用户名"},null)]}),e.createVNode(o.NFormItem,{label:"密码",path:"password"},{default:()=>[e.createVNode(o.NInput,{value:i.password,"onUpdate:value":t=>i.password=t,placeholder:"请输入密码",type:"password"},null)]}),e.createVNode("div",{class:"password-forgot"},[e.createVNode(o.NCheckbox,{checked:p.value,"onUpdate:checked":t=>p.value=t,label:"记住密码"},null),c&&e.createVNode("a",{href:c},[e.createTextVNode("忘记密码?")])]),e.createVNode(o.NFormItem,{showLabel:!1},{default:()=>[e.createVNode(o.NButton,{"attr-type":"button",type:"primary",block:!0,onClick:()=>h()},{default:()=>[e.createTextVNode("登录")]})]}),g&&e.createVNode(o.NFormItem,{showLabel:!1},{default:()=>[e.createVNode(o.NButton,{color:"#02E16E",ghost:!0,block:!0,onClick:()=>b()},{default:()=>[e.createTextVNode("微信登录")]})]})]}),y&&e.createVNode("div",{class:"signUp"},[e.createTextVNode("还没有账号?"),e.createVNode("a",{href:y},[e.createTextVNode("立即注册")])])])}});function x(r){return typeof r=="function"||Object.prototype.toString.call(r)==="[object Object]"&&!e.isVNode(r)}const P=e.defineComponent({name:"LoginPage",props:I,emits:w,setup(r,{emit:l,slots:a}){const{layout:g,bg:U,bgImageUrl:d,logo:y,...c}=r,s=e.computed(()=>r.imagePosition==="right");return()=>{var N,i,p,v,V,h,b,t,m;if((N=a.default)!=null&&N.call(a),console.log(a.default),a.default){let u;if(g==="column"){let n;return e.createVNode("div",{class:["container","column",{"column-reverse":r.imagePosition==="left"}]},[e.createVNode("div",{class:"column-item"},[s.value&&e.createVNode("div",{class:"logo"},[(i=a.logo)==null?void 0:i.call(a)]),e.createVNode(f,e.mergeProps(c,{shadow:!1,radius:!1,onFinish:F=>l("finish",F)}),x(n=a.default())?n:{default:()=>[n]})]),e.createVNode("div",{class:"column-muted"},[!s.value&&e.createVNode("div",{class:"logo"},[(p=a.logo)==null?void 0:p.call(a)]),r.bgImageUrl&&e.createVNode("img",{src:r.bgImageUrl,alt:"Image",class:"column-muted-image"},null)])])}if(g==="card"){let n;return e.createVNode("div",{class:["container","flex-center"]},[e.createVNode("div",{class:"logo"},[(v=a.logo)==null?void 0:v.call(a)]),e.createVNode("div",{class:"card"},[e.createVNode("div",{class:["card-column-item","flex-1"]},[e.createVNode(f,e.mergeProps(c,{shadow:!1,radius:!1,onFinish:F=>l("finish",F)}),x(n=a.default())?n:{default:()=>[n]})]),e.createVNode("div",{class:["card-column-muted","flex-1"],style:{width:"350px"}},[d&&e.createVNode("img",{src:d,alt:"Image",class:"column-muted-image"},null)])])])}return e.createVNode("div",{class:["container","flex-center"],style:{backgroundImage:`url(${d})`,backgroundSize:"cover"}},[e.createVNode("div",{class:["flex-col","space-y-4"]},[(V=a.logo)==null?void 0:V.call(a),e.createVNode(f,e.mergeProps(c,{onFinish:n=>l("finish",n)}),x(u=a.default())?u:{default:()=>[u]})])])}else return g==="column"?e.createVNode("div",{class:["container","column",{"column-reverse":r.imagePosition==="left"}]},[e.createVNode("div",{class:"column-item"},[s.value&&e.createVNode("div",{class:"logo"},[(h=a.logo)==null?void 0:h.call(a)]),e.createVNode(f,e.mergeProps(c,{shadow:!1,radius:!1,onFinish:u=>l("finish",u)}),null)]),e.createVNode("div",{class:"column-muted"},[!s.value&&e.createVNode("div",{class:"logo"},[(b=a.logo)==null?void 0:b.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"]},[e.createVNode("div",{class:"logo"},[(t=a.logo)==null?void 0:t.call(a)]),e.createVNode("div",{class:"card"},[e.createVNode("div",{class:["card-column-item","flex-1"]},[e.createVNode(f,e.mergeProps(c,{shadow:!1,radius:!1,onFinish:u=>l("finish",u)}),null)]),e.createVNode("div",{class:["card-column-muted","flex-1"],style:{width:"350px"}},[d&&e.createVNode("img",{src:d,alt:"Image",class:"column-muted-image"},null)])])]):e.createVNode("div",{class:["container","flex-center"],style:{backgroundImage:`url(${d})`,backgroundSize:"cover"}},[e.createVNode("div",{class:["flex-col","space-y-4"]},[(m=a.logo)==null?void 0:m.call(a),e.createVNode(f,c,null)])])}}});exports.Login=P;exports.loginEmits=w;exports.loginFormProps=S;exports.loginProps=I;
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
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 = {
1
+ import './index.css';import { defineComponent as N, reactive as E, ref as B, createVNode as e, createTextVNode as v, toRaw as A, computed as D, mergeProps as b, isVNode as W } from "vue";
2
+ import { NForm as R, NFormItem as x, NInput as C, NCheckbox as T, NButton as L } from "naive-ui";
3
+ const P = ["finish", "error", "captcha", "wechatFinish"], _ = {
4
4
  title: {
5
5
  type: String,
6
6
  default: "Welcome back"
@@ -39,7 +39,7 @@ const S = ["finish", "error", "captcha", "wechatFinish"], E = {
39
39
  actions: {
40
40
  type: Array
41
41
  }
42
- }, A = {
42
+ }, j = {
43
43
  title: {
44
44
  type: String,
45
45
  default: "Welcome back"
@@ -67,25 +67,26 @@ const S = ["finish", "error", "captcha", "wechatFinish"], E = {
67
67
  actions: {
68
68
  type: Array
69
69
  }
70
- }, b = /* @__PURE__ */ B({
70
+ }, m = /* @__PURE__ */ N({
71
71
  name: "LoginForm",
72
- props: A,
73
- emits: S,
74
- setup(r, {
75
- emit: o
72
+ props: j,
73
+ emits: P,
74
+ setup(l, {
75
+ emit: r,
76
+ slots: a
76
77
  }) {
77
78
  const {
78
- actions: a,
79
- title: m,
80
- subTitle: v,
81
- signUpUrl: u,
82
- forgotUrl: h,
83
- shadow: i,
84
- radius: n
85
- } = r, l = C({
79
+ actions: d,
80
+ title: k,
81
+ subTitle: o,
82
+ signUpUrl: U,
83
+ forgotUrl: u,
84
+ shadow: g,
85
+ radius: f
86
+ } = l, n = E({
86
87
  username: "",
87
88
  password: ""
88
- }), s = F(!1), f = {
89
+ }), p = B(!1), y = {
89
90
  username: [{
90
91
  required: !0,
91
92
  message: "请输入用户名",
@@ -106,161 +107,234 @@ const S = ["finish", "error", "captcha", "wechatFinish"], E = {
106
107
  message: "长度在 6 到 20 个字符",
107
108
  trigger: "blur"
108
109
  }]
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));
110
+ }, h = B(null), F = () => {
111
+ var i;
112
+ (i = h.value) == null || i.validate((s) => {
113
+ s ? (console.error(s), r("error", s)) : r("finish", A(n));
113
114
  });
114
- }, k = () => {
115
- console.error("Weixin login is not supported yet."), o("wechatFinish");
115
+ }, w = () => {
116
+ console.error("Weixin login is not supported yet."), r("wechatFinish");
116
117
  };
117
118
  return () => e("div", {
118
119
  class: ["login-form", {
119
- "login-form-shadow": i
120
+ "login-form-shadow": g
120
121
  }],
121
122
  style: [{
122
- borderRadius: n ? `${n}px` : "none"
123
+ borderRadius: f ? `${f}px` : "none"
123
124
  }]
124
125
  }, [e("div", {
125
126
  class: "title"
126
- }, [m]), e("div", {
127
+ }, [k]), e("div", {
127
128
  class: "sub-title"
128
- }, [v]), e(N, {
129
- ref: c,
130
- model: l,
131
- rules: f,
129
+ }, [o]), a.default ? a.default() : e(R, {
130
+ ref: h,
131
+ model: n,
132
+ rules: y,
132
133
  size: "large",
133
134
  "show-require-mark": !1
134
135
  }, {
135
- default: () => [e(p, {
136
+ default: () => [e(x, {
136
137
  label: "用户名",
137
138
  path: "username"
138
139
  }, {
139
- default: () => [e(U, {
140
- value: l.username,
141
- "onUpdate:value": (t) => l.username = t,
140
+ default: () => [e(C, {
141
+ value: n.username,
142
+ "onUpdate:value": (i) => n.username = i,
142
143
  placeholder: "请输入用户名"
143
144
  }, null)]
144
- }), e(p, {
145
+ }), e(x, {
145
146
  label: "密码",
146
147
  path: "password"
147
148
  }, {
148
- default: () => [e(U, {
149
- value: l.password,
150
- "onUpdate:value": (t) => l.password = t,
149
+ default: () => [e(C, {
150
+ value: n.password,
151
+ "onUpdate:value": (i) => n.password = i,
151
152
  placeholder: "请输入密码",
152
153
  type: "password"
153
154
  }, null)]
154
155
  }), e("div", {
155
156
  class: "password-forgot"
156
- }, [e(P, {
157
- checked: s.value,
158
- "onUpdate:checked": (t) => s.value = t,
157
+ }, [e(T, {
158
+ checked: p.value,
159
+ "onUpdate:checked": (i) => p.value = i,
159
160
  label: "记住密码"
160
- }, null), h && e("a", {
161
- href: h
162
- }, [g("忘记密码?")])]), e(p, {
161
+ }, null), u && e("a", {
162
+ href: u
163
+ }, [v("忘记密码?")])]), e(x, {
163
164
  showLabel: !1
164
165
  }, {
165
- default: () => [e(x, {
166
+ default: () => [e(L, {
166
167
  "attr-type": "button",
167
168
  type: "primary",
168
169
  block: !0,
169
- onClick: () => d()
170
+ onClick: () => F()
170
171
  }, {
171
- default: () => [g("登录")]
172
+ default: () => [v("登录")]
172
173
  })]
173
- }), a && e(p, {
174
+ }), d && e(x, {
174
175
  showLabel: !1
175
176
  }, {
176
- default: () => [e(x, {
177
+ default: () => [e(L, {
177
178
  color: "#02E16E",
178
179
  ghost: !0,
179
180
  block: !0,
180
- onClick: () => k()
181
+ onClick: () => w()
181
182
  }, {
182
- default: () => [g("微信登录")]
183
+ default: () => [v("微信登录")]
183
184
  })]
184
185
  })]
185
- }), u && e("div", {
186
+ }), U && e("div", {
186
187
  class: "signUp"
187
- }, [g("还没有账号?"), e("a", {
188
- href: u
189
- }, [g("立即注册")])])]);
188
+ }, [v("还没有账号?"), e("a", {
189
+ href: U
190
+ }, [v("立即注册")])])]);
190
191
  }
191
- }), R = /* @__PURE__ */ B({
192
+ });
193
+ function I(l) {
194
+ return typeof l == "function" || Object.prototype.toString.call(l) === "[object Object]" && !W(l);
195
+ }
196
+ const V = /* @__PURE__ */ N({
192
197
  name: "LoginPage",
193
- props: E,
194
- emits: S,
195
- setup(r, {
196
- emit: o,
198
+ props: _,
199
+ emits: P,
200
+ setup(l, {
201
+ emit: r,
197
202
  slots: a
198
203
  }) {
199
204
  const {
200
- layout: m,
201
- bg: v,
202
- bgImageUrl: u,
203
- logo: h,
204
- ...i
205
- } = r, n = L(() => r.imagePosition === "right");
205
+ layout: d,
206
+ bg: k,
207
+ bgImageUrl: o,
208
+ logo: U,
209
+ ...u
210
+ } = l, g = D(() => l.imagePosition === "right");
206
211
  return () => {
207
- var l, s, f, c;
208
- return m === "column" ? e("div", {
209
- class: ["container", "column", {
210
- "column-reverse": r.imagePosition === "left"
211
- }]
212
- }, [e("div", {
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, {
217
- shadow: !1,
218
- radius: !1,
219
- onFinish: (d) => o("finish", d)
220
- }), null)]), e("div", {
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,
226
- alt: "Image",
227
- class: "column-muted-image"
228
- }, null)])]) : m === "card" ? e("div", {
229
- class: ["container", "flex-center"]
230
- }, [e("div", {
231
- class: "logo"
232
- }, [(f = a.logo) == null ? void 0 : f.call(a)]), e("div", {
233
- class: "card"
234
- }, [e("div", {
235
- class: ["card-column-item", "flex-1"]
236
- }, [e(b, w(i, {
237
- shadow: !1,
238
- radius: !1,
239
- onFinish: (d) => o("finish", d)
240
- }), null)]), e("div", {
241
- class: ["card-column-muted", "flex-1"],
242
- style: {
243
- width: "350px"
212
+ var f, n, p, y, h, F, w, i, s;
213
+ if ((f = a.default) != null && f.call(a), console.log(a.default), a.default) {
214
+ let c;
215
+ if (d === "column") {
216
+ let t;
217
+ return e("div", {
218
+ class: ["container", "column", {
219
+ "column-reverse": l.imagePosition === "left"
220
+ }]
221
+ }, [e("div", {
222
+ class: "column-item"
223
+ }, [g.value && e("div", {
224
+ class: "logo"
225
+ }, [(n = a.logo) == null ? void 0 : n.call(a)]), e(m, b(u, {
226
+ shadow: !1,
227
+ radius: !1,
228
+ onFinish: (S) => r("finish", S)
229
+ }), I(t = a.default()) ? t : {
230
+ default: () => [t]
231
+ })]), e("div", {
232
+ class: "column-muted"
233
+ }, [!g.value && e("div", {
234
+ class: "logo"
235
+ }, [(p = a.logo) == null ? void 0 : p.call(a)]), l.bgImageUrl && e("img", {
236
+ src: l.bgImageUrl,
237
+ alt: "Image",
238
+ class: "column-muted-image"
239
+ }, null)])]);
244
240
  }
245
- }, [u && e("img", {
246
- src: u,
247
- alt: "Image",
248
- class: "column-muted-image"
249
- }, null)])])]) : e("div", {
250
- class: ["container", "flex-center"],
251
- style: {
252
- backgroundImage: `url(${u})`,
253
- backgroundSize: "cover"
241
+ if (d === "card") {
242
+ let t;
243
+ return e("div", {
244
+ class: ["container", "flex-center"]
245
+ }, [e("div", {
246
+ class: "logo"
247
+ }, [(y = a.logo) == null ? void 0 : y.call(a)]), e("div", {
248
+ class: "card"
249
+ }, [e("div", {
250
+ class: ["card-column-item", "flex-1"]
251
+ }, [e(m, b(u, {
252
+ shadow: !1,
253
+ radius: !1,
254
+ onFinish: (S) => r("finish", S)
255
+ }), I(t = a.default()) ? t : {
256
+ default: () => [t]
257
+ })]), e("div", {
258
+ class: ["card-column-muted", "flex-1"],
259
+ style: {
260
+ width: "350px"
261
+ }
262
+ }, [o && e("img", {
263
+ src: o,
264
+ alt: "Image",
265
+ class: "column-muted-image"
266
+ }, null)])])]);
254
267
  }
255
- }, [e("div", {
256
- class: ["flex-col", "space-y-4"]
257
- }, [(c = a.logo) == null ? void 0 : c.call(a), e(b, i, null)])]);
268
+ return e("div", {
269
+ class: ["container", "flex-center"],
270
+ style: {
271
+ backgroundImage: `url(${o})`,
272
+ backgroundSize: "cover"
273
+ }
274
+ }, [e("div", {
275
+ class: ["flex-col", "space-y-4"]
276
+ }, [(h = a.logo) == null ? void 0 : h.call(a), e(m, b(u, {
277
+ onFinish: (t) => r("finish", t)
278
+ }), I(c = a.default()) ? c : {
279
+ default: () => [c]
280
+ })])]);
281
+ } else
282
+ return d === "column" ? e("div", {
283
+ class: ["container", "column", {
284
+ "column-reverse": l.imagePosition === "left"
285
+ }]
286
+ }, [e("div", {
287
+ class: "column-item"
288
+ }, [g.value && e("div", {
289
+ class: "logo"
290
+ }, [(F = a.logo) == null ? void 0 : F.call(a)]), e(m, b(u, {
291
+ shadow: !1,
292
+ radius: !1,
293
+ onFinish: (c) => r("finish", c)
294
+ }), null)]), e("div", {
295
+ class: "column-muted"
296
+ }, [!g.value && e("div", {
297
+ class: "logo"
298
+ }, [(w = a.logo) == null ? void 0 : w.call(a)]), l.bgImageUrl && e("img", {
299
+ src: l.bgImageUrl,
300
+ alt: "Image",
301
+ class: "column-muted-image"
302
+ }, null)])]) : d === "card" ? e("div", {
303
+ class: ["container", "flex-center"]
304
+ }, [e("div", {
305
+ class: "logo"
306
+ }, [(i = a.logo) == null ? void 0 : i.call(a)]), e("div", {
307
+ class: "card"
308
+ }, [e("div", {
309
+ class: ["card-column-item", "flex-1"]
310
+ }, [e(m, b(u, {
311
+ shadow: !1,
312
+ radius: !1,
313
+ onFinish: (c) => r("finish", c)
314
+ }), null)]), e("div", {
315
+ class: ["card-column-muted", "flex-1"],
316
+ style: {
317
+ width: "350px"
318
+ }
319
+ }, [o && e("img", {
320
+ src: o,
321
+ alt: "Image",
322
+ class: "column-muted-image"
323
+ }, null)])])]) : e("div", {
324
+ class: ["container", "flex-center"],
325
+ style: {
326
+ backgroundImage: `url(${o})`,
327
+ backgroundSize: "cover"
328
+ }
329
+ }, [e("div", {
330
+ class: ["flex-col", "space-y-4"]
331
+ }, [(s = a.logo) == null ? void 0 : s.call(a), e(m, u, null)])]);
258
332
  };
259
333
  }
260
334
  });
261
335
  export {
262
- R as Login,
263
- S as loginEmits,
264
- A as loginFormProps,
265
- E as loginProps
336
+ V as Login,
337
+ P as loginEmits,
338
+ j as loginFormProps,
339
+ _ as loginProps
266
340
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@banmao/blocks",
3
- "version": "0.0.1-alpha.3",
3
+ "version": "0.0.1-alpha.5",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {