Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
monorepo
/
venus
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 76a879d4
authored
Sep 12, 2024
by
Vben
Committed by
GitHub
Sep 12, 2024
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix: fixed some style issues (#4379)
1 parent
537a4b0e
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
160 additions
and
66 deletions
apps/web-antd/src/router/index.ts
apps/web-ele/src/router/index.ts
apps/web-naive/src/router/index.ts
docs/src/en/guide/essentials/development.md
docs/src/en/guide/introduction/thin.md
docs/src/guide/essentials/development.md
docs/src/guide/introduction/thin.md
package.json
packages/@core/base/shared/src/utils/merge.ts
packages/@core/ui-kit/form-ui/src/form-api.ts
packages/@core/ui-kit/form-ui/src/form-render/expandable.ts
packages/@core/ui-kit/popup-ui/src/drawer/drawer-api.ts
packages/@core/ui-kit/popup-ui/src/drawer/drawer.ts
packages/@core/ui-kit/popup-ui/src/drawer/drawer.vue
packages/@core/ui-kit/popup-ui/src/modal/modal-api.ts
packages/@core/ui-kit/popup-ui/src/modal/modal.ts
packages/@core/ui-kit/popup-ui/src/modal/modal.vue
packages/@core/ui-kit/shadcn-ui/src/components/index.ts
packages/@core/ui-kit/shadcn-ui/src/components/spine-text/index.ts
packages/@core/ui-kit/shadcn-ui/src/components/spine-text/spine-text.vue
packages/effects/common-ui/src/ui/authentication/code-login.vue
packages/effects/common-ui/src/ui/authentication/forget-password.vue
packages/effects/common-ui/src/ui/authentication/login.vue
packages/effects/common-ui/src/ui/authentication/register.vue
playground/src/router/index.ts
playground/src/views/examples/form/custom.vue
playground/src/views/examples/form/dynamic.vue
apps/web-antd/src/router/index.ts
View file @
76a879d
...
@@ -19,7 +19,12 @@ const router = createRouter({
...
@@ -19,7 +19,12 @@ const router = createRouter({
:
createWebHistory
(
import
.
meta
.
env
.
VITE_BASE
),
:
createWebHistory
(
import
.
meta
.
env
.
VITE_BASE
),
// 应该添加到路由的初始路由列表。
// 应该添加到路由的初始路由列表。
routes
,
routes
,
scrollBehavior
:
()
=>
({
left
:
0
,
top
:
0
}),
scrollBehavior
:
(
to
,
_from
,
savedPosition
)
=>
{
if
(
savedPosition
)
{
return
savedPosition
;
}
return
to
.
hash
?
{
behavior
:
'smooth'
,
el
:
to
.
hash
}
:
{
left
:
0
,
top
:
0
};
},
// 是否应该禁止尾部斜杠。
// 是否应该禁止尾部斜杠。
// strict: true,
// strict: true,
});
});
...
...
apps/web-ele/src/router/index.ts
View file @
76a879d
...
@@ -19,7 +19,12 @@ const router = createRouter({
...
@@ -19,7 +19,12 @@ const router = createRouter({
:
createWebHistory
(
import
.
meta
.
env
.
VITE_BASE
),
:
createWebHistory
(
import
.
meta
.
env
.
VITE_BASE
),
// 应该添加到路由的初始路由列表。
// 应该添加到路由的初始路由列表。
routes
,
routes
,
scrollBehavior
:
()
=>
({
left
:
0
,
top
:
0
}),
scrollBehavior
:
(
to
,
_from
,
savedPosition
)
=>
{
if
(
savedPosition
)
{
return
savedPosition
;
}
return
to
.
hash
?
{
behavior
:
'smooth'
,
el
:
to
.
hash
}
:
{
left
:
0
,
top
:
0
};
},
// 是否应该禁止尾部斜杠。
// 是否应该禁止尾部斜杠。
// strict: true,
// strict: true,
});
});
...
...
apps/web-naive/src/router/index.ts
View file @
76a879d
...
@@ -19,7 +19,12 @@ const router = createRouter({
...
@@ -19,7 +19,12 @@ const router = createRouter({
:
createWebHistory
(
import
.
meta
.
env
.
VITE_BASE
),
:
createWebHistory
(
import
.
meta
.
env
.
VITE_BASE
),
// 应该添加到路由的初始路由列表。
// 应该添加到路由的初始路由列表。
routes
,
routes
,
scrollBehavior
:
()
=>
({
left
:
0
,
top
:
0
}),
scrollBehavior
:
(
to
,
_from
,
savedPosition
)
=>
{
if
(
savedPosition
)
{
return
savedPosition
;
}
return
to
.
hash
?
{
behavior
:
'smooth'
,
el
:
to
.
hash
}
:
{
left
:
0
,
top
:
0
};
},
// 是否应该禁止尾部斜杠。
// 是否应该禁止尾部斜杠。
// strict: true,
// strict: true,
});
});
...
...
docs/src/en/guide/essentials/development.md
View file @
76a879d
...
@@ -55,15 +55,15 @@ The execution command is: `pnpm run [script]` or `npm run [script]`.
...
@@ -55,15 +55,15 @@ The execution command is: `pnpm run [script]` or `npm run [script]`.
//
Build
a
local
Docker
image
//
Build
a
local
Docker
image
"build:docker"
:
"./build-local-docker-image.sh"
,
"build:docker"
:
"./build-local-docker-image.sh"
,
//
Build
the
web-antd
application
separately
//
Build
the
web-antd
application
separately
"build:antd"
:
"pnpm
run build --filter=@vben/web-ant
d"
,
"build:antd"
:
"pnpm
-F @vben/web-antd run buil
d"
,
//
Build
the
documentation
separately
//
Build
the
documentation
separately
"build:docs"
:
"pnpm
run build --filter=@vben/docs
"
,
"build:docs"
:
"pnpm
-F @vben/docs run build
"
,
//
Build
the
web-ele
application
separately
//
Build
the
web-ele
application
separately
"build:ele"
:
"pnpm
run build --filter=@vben/web-ele
"
,
"build:ele"
:
"pnpm
-F @vben/web-ele run build
"
,
//
Build
the
web-naive
application
separately
//
Build
the
web-naive
application
separately
"build:naive"
:
"pnpm
run build --filter=@vben/naive
"
,
"build:naive"
:
"pnpm
-F @vben/web-naive run build
"
,
//
Build
the
playground
application
separately
//
Build
the
playground
application
separately
"build:play"
:
"pnpm
run build --filter=@vben/playgroun
d"
,
"build:play"
:
"pnpm
-F @vben/playground run buil
d"
,
//
Changeset
version
management
//
Changeset
version
management
"changeset"
:
"pnpm exec changeset"
,
"changeset"
:
"pnpm exec changeset"
,
//
Check
for
various
issues
in
the
project
//
Check
for
various
issues
in
the
project
...
...
docs/src/en/guide/introduction/thin.md
View file @
76a879d
...
@@ -52,11 +52,11 @@ After slimming down, you may need to adjust commands according to your project.
...
@@ -52,11 +52,11 @@ After slimming down, you may need to adjust commands according to your project.
```
json
```
json
{
{
"scripts"
:
{
"scripts"
:
{
"build:antd"
:
"pnpm
run build --filter=@vben/web-ant
d"
,
"build:antd"
:
"pnpm
-F @vben/web-antd run buil
d"
,
"build:docs"
:
"pnpm
run build --filter=@vben/docs
"
,
"build:docs"
:
"pnpm
-F @vben/docs run build
"
,
"build:ele"
:
"pnpm
run build --filter=@vben/web-ele
"
,
"build:ele"
:
"pnpm
-F @vben/web-ele run build
"
,
"build:naive"
:
"pnpm
run build --filter=@vben/web-naive
"
,
"build:naive"
:
"pnpm
-F @vben/web-naive run build
"
,
"build:play"
:
"pnpm
run build --filter=@vben/playgroun
d"
,
"build:play"
:
"pnpm
-F @vben/playground run buil
d"
,
"dev:antd"
:
"pnpm -F @vben/web-antd run dev"
,
"dev:antd"
:
"pnpm -F @vben/web-antd run dev"
,
"dev:docs"
:
"pnpm -F @vben/docs run dev"
,
"dev:docs"
:
"pnpm -F @vben/docs run dev"
,
"dev:ele"
:
"pnpm -F @vben/web-ele run dev"
,
"dev:ele"
:
"pnpm -F @vben/web-ele run dev"
,
...
...
docs/src/guide/essentials/development.md
View file @
76a879d
...
@@ -55,15 +55,15 @@ npm 脚本是项目常见的配置,用于执行一些常见的任务,比如
...
@@ -55,15 +55,15 @@ npm 脚本是项目常见的配置,用于执行一些常见的任务,比如
//
构建本地
docker
镜像
//
构建本地
docker
镜像
"build:docker"
:
"./build-local-docker-image.sh"
,
"build:docker"
:
"./build-local-docker-image.sh"
,
//
单独构建
web-antd
应用
//
单独构建
web-antd
应用
"build:antd"
:
"pnpm
run build --filter=@vben/web-ant
d"
,
"build:antd"
:
"pnpm
-F @vben/web-antd run buil
d"
,
//
单独构建文档
//
单独构建文档
"build:docs"
:
"pnpm
run build --filter=@vben/docs
"
,
"build:docs"
:
"pnpm
-F @vben/docs run build
"
,
//
单独构建
web-ele
应用
//
单独构建
web-ele
应用
"build:ele"
:
"pnpm
run build --filter=@vben/web-ele
"
,
"build:ele"
:
"pnpm
-F @vben/web-ele run build
"
,
//
单独构建
web-naive
应用
//
单独构建
web-naive
应用
"build:naive"
:
"pnpm
run build --filter=@vben/naive
"
,
"build:naive"
:
"pnpm
-F @vben/web-naive run build
"
,
//
单独构建
playground
应用
//
单独构建
playground
应用
"build:play"
:
"pnpm
run build --filter=@vben/playgroun
d"
,
"build:play"
:
"pnpm
-F @vben/playground run buil
d"
,
//
changeset
版本管理
//
changeset
版本管理
"changeset"
:
"pnpm exec changeset"
,
"changeset"
:
"pnpm exec changeset"
,
//
检查项目各种问题
//
检查项目各种问题
...
...
docs/src/guide/introduction/thin.md
View file @
76a879d
...
@@ -52,11 +52,11 @@ pnpm install
...
@@ -52,11 +52,11 @@ pnpm install
```
json
```
json
{
{
"scripts"
:
{
"scripts"
:
{
"build:antd"
:
"pnpm
run build --filter=@vben/web-ant
d"
,
"build:antd"
:
"pnpm
-F @vben/web-antd run buil
d"
,
"build:docs"
:
"pnpm
run build --filter=@vben/docs
"
,
"build:docs"
:
"pnpm
-F @vben/docs run build
"
,
"build:ele"
:
"pnpm
run build --filter=@vben/web-ele
"
,
"build:ele"
:
"pnpm
-F @vben/web-ele run build
"
,
"build:naive"
:
"pnpm
run build --filter=@vben/web-naive
"
,
"build:naive"
:
"pnpm
-F @vben/web-naive run build
"
,
"build:play"
:
"pnpm
run build --filter=@vben/playgroun
d"
,
"build:play"
:
"pnpm
-F @vben/playground run buil
d"
,
"dev:antd"
:
"pnpm -F @vben/web-antd run dev"
,
"dev:antd"
:
"pnpm -F @vben/web-antd run dev"
,
"dev:docs"
:
"pnpm -F @vben/docs run dev"
,
"dev:docs"
:
"pnpm -F @vben/docs run dev"
,
"dev:ele"
:
"pnpm -F @vben/web-ele run dev"
,
"dev:ele"
:
"pnpm -F @vben/web-ele run dev"
,
...
...
package.json
View file @
76a879d
...
@@ -29,11 +29,11 @@
...
@@ -29,11 +29,11 @@
"build"
:
"cross-env NODE_OPTIONS=--max-old-space-size=8192 turbo build"
,
"build"
:
"cross-env NODE_OPTIONS=--max-old-space-size=8192 turbo build"
,
"build:analyze"
:
"turbo build:analyze"
,
"build:analyze"
:
"turbo build:analyze"
,
"build:docker"
:
"./build-local-docker-image.sh"
,
"build:docker"
:
"./build-local-docker-image.sh"
,
"build:antd"
:
"pnpm
run build --filter=@vben/web-ant
d"
,
"build:antd"
:
"pnpm
-F @vben/web-antd run buil
d"
,
"build:docs"
:
"pnpm
run build --filter=@vben/docs
"
,
"build:docs"
:
"pnpm
-F @vben/docs run build
"
,
"build:ele"
:
"pnpm
run build --filter=@vben/web-ele
"
,
"build:ele"
:
"pnpm
-F @vben/web-ele run build
"
,
"build:naive"
:
"pnpm
run build --filter=@vben/web-naive
"
,
"build:naive"
:
"pnpm
-F @vben/web-naive run build
"
,
"build:play"
:
"pnpm
run build --filter=@vben/playgroun
d"
,
"build:play"
:
"pnpm
-F @vben/playground run buil
d"
,
"changeset"
:
"pnpm exec changeset"
,
"changeset"
:
"pnpm exec changeset"
,
"check"
:
"pnpm run check:circular && pnpm run check:dep && pnpm run check:type && pnpm check:cspell"
,
"check"
:
"pnpm run check:circular && pnpm run check:dep && pnpm run check:type && pnpm check:cspell"
,
"check:circular"
:
"vsh check-circular"
,
"check:circular"
:
"vsh check-circular"
,
...
...
packages/@core/base/shared/src/utils/merge.ts
View file @
76a879d
export
{
defu
as
merge
}
from
'defu'
;
export
{
createDefu
as
createMerge
,
defu
as
merge
}
from
'defu'
;
packages/@core/ui-kit/form-ui/src/form-api.ts
View file @
76a879d
...
@@ -10,7 +10,19 @@ import type { FormActions, VbenFormProps } from './types';
...
@@ -10,7 +10,19 @@ import type { FormActions, VbenFormProps } from './types';
import
{
toRaw
}
from
'vue'
;
import
{
toRaw
}
from
'vue'
;
import
{
Store
}
from
'@vben-core/shared/store'
;
import
{
Store
}
from
'@vben-core/shared/store'
;
import
{
bindMethods
,
isFunction
,
StateHandler
}
from
'@vben-core/shared/utils'
;
import
{
bindMethods
,
createMerge
,
isFunction
,
StateHandler
,
}
from
'@vben-core/shared/utils'
;
const
merge
=
createMerge
((
originObj
,
key
,
updates
)
=>
{
if
(
Array
.
isArray
(
originObj
[
key
])
&&
Array
.
isArray
(
updates
))
{
originObj
[
key
]
=
updates
;
return
true
;
}
});
function
getDefaultState
():
VbenFormProps
{
function
getDefaultState
():
VbenFormProps
{
return
{
return
{
...
@@ -138,9 +150,11 @@ export class FormApi {
...
@@ -138,9 +150,11 @@ export class FormApi {
|
Partial
<
VbenFormProps
>
,
|
Partial
<
VbenFormProps
>
,
)
{
)
{
if
(
isFunction
(
stateOrFn
))
{
if
(
isFunction
(
stateOrFn
))
{
this
.
store
.
setState
(
stateOrFn
as
(
prev
:
VbenFormProps
)
=>
VbenFormProps
);
this
.
store
.
setState
((
prev
)
=>
{
return
merge
(
stateOrFn
(
prev
),
prev
);
});
}
else
{
}
else
{
this
.
store
.
setState
((
prev
)
=>
({
...
prev
,
...
stateOrFn
}
));
this
.
store
.
setState
((
prev
)
=>
merge
(
stateOrFn
,
prev
));
}
}
}
}
...
...
packages/@core/ui-kit/form-ui/src/form-render/expandable.ts
View file @
76a879d
...
@@ -22,7 +22,7 @@ export function useExpandable(props: FormRenderProps) {
...
@@ -22,7 +22,7 @@ export function useExpandable(props: FormRenderProps) {
for
(
let
index
=
1
;
index
<=
rows
;
index
++
)
{
for
(
let
index
=
1
;
index
<=
rows
;
index
++
)
{
maxItem
+=
mapping
?.[
index
]
??
0
;
maxItem
+=
mapping
?.[
index
]
??
0
;
}
}
return
maxItem
-
1
;
return
maxItem
-
1
||
1
;
});
});
watch
(
watch
(
...
@@ -50,11 +50,11 @@ export function useExpandable(props: FormRenderProps) {
...
@@ -50,11 +50,11 @@ export function useExpandable(props: FormRenderProps) {
return
;
return
;
}
}
// 小屏幕不计算
// 小屏幕不计算
if
(
breakpoints
.
smaller
(
'sm'
).
value
)
{
//
if (breakpoints.smaller('sm').value) {
// 保持一行
//
// 保持一行
rowMapping
.
value
=
{
1
:
2
};
//
rowMapping.value = { 1: 2 };
return
;
//
return;
}
//
}
const
formItems
=
[...
wrapperRef
.
value
.
children
];
const
formItems
=
[...
wrapperRef
.
value
.
children
];
...
...
packages/@core/ui-kit/popup-ui/src/drawer/drawer-api.ts
View file @
76a879d
...
@@ -29,10 +29,12 @@ export class DrawerApi {
...
@@ -29,10 +29,12 @@ export class DrawerApi {
}
=
options
;
}
=
options
;
const
defaultState
:
DrawerState
=
{
const
defaultState
:
DrawerState
=
{
class
:
''
,
closable
:
true
,
closable
:
true
,
closeOnClickModal
:
true
,
closeOnClickModal
:
true
,
closeOnPressEscape
:
true
,
closeOnPressEscape
:
true
,
confirmLoading
:
false
,
confirmLoading
:
false
,
contentClass
:
''
,
footer
:
true
,
footer
:
true
,
isOpen
:
false
,
isOpen
:
false
,
loading
:
false
,
loading
:
false
,
...
...
packages/@core/ui-kit/popup-ui/src/drawer/drawer.ts
View file @
76a879d
...
@@ -7,6 +7,7 @@ export interface DrawerProps {
...
@@ -7,6 +7,7 @@ export interface DrawerProps {
* 取消按钮文字
* 取消按钮文字
*/
*/
cancelText
?:
string
;
cancelText
?:
string
;
class
?:
string
;
/**
/**
* 是否显示右上角的关闭按钮
* 是否显示右上角的关闭按钮
* @default true
* @default true
...
@@ -31,6 +32,7 @@ export interface DrawerProps {
...
@@ -31,6 +32,7 @@ export interface DrawerProps {
* 确定按钮文字
* 确定按钮文字
*/
*/
confirmText
?:
string
;
confirmText
?:
string
;
contentClass
?:
string
;
/**
/**
* 弹窗描述
* 弹窗描述
*/
*/
...
...
packages/@core/ui-kit/popup-ui/src/drawer/drawer.vue
View file @
76a879d
...
@@ -26,14 +26,10 @@ import {
...
@@ -26,14 +26,10 @@ import {
import
{
cn
}
from
'@vben-core/shared/utils'
;
import
{
cn
}
from
'@vben-core/shared/utils'
;
interface
Props
extends
DrawerProps
{
interface
Props
extends
DrawerProps
{
class
?:
string
;
contentClass
?:
string
;
drawerApi
?:
ExtendedDrawerApi
;
drawerApi
?:
ExtendedDrawerApi
;
}
}
const
props
=
withDefaults
(
defineProps
<
Props
>
(),
{
const
props
=
withDefaults
(
defineProps
<
Props
>
(),
{
class
:
''
,
contentClass
:
''
,
drawerApi
:
undefined
,
drawerApi
:
undefined
,
});
});
...
@@ -44,11 +40,13 @@ const state = props.drawerApi?.useStore?.();
...
@@ -44,11 +40,13 @@ const state = props.drawerApi?.useStore?.();
const
{
const
{
cancelText
,
cancelText
,
class
:
drawerClass
,
closable
,
closable
,
closeOnClickModal
,
closeOnClickModal
,
closeOnPressEscape
,
closeOnPressEscape
,
confirmLoading
,
confirmLoading
,
confirmText
,
confirmText
,
contentClass
,
description
,
description
,
footer
:
showFooter
,
footer
:
showFooter
,
loading
:
showLoading
,
loading
:
showLoading
,
...
@@ -98,7 +96,7 @@ function pointerDownOutside(e: Event) {
...
@@ -98,7 +96,7 @@ function pointerDownOutside(e: Event) {
>
>
<SheetContent
<SheetContent
:class=
"
:class=
"
cn('flex w-[520px] flex-col',
props.c
lass,
{
cn('flex w-[520px] flex-col',
drawerC
lass,
{
'!w-full': isMobile,
'!w-full': isMobile,
})
})
"
"
...
...
packages/@core/ui-kit/popup-ui/src/modal/modal-api.ts
View file @
76a879d
...
@@ -30,14 +30,18 @@ export class ModalApi {
...
@@ -30,14 +30,18 @@ export class ModalApi {
const
defaultState
:
ModalState
=
{
const
defaultState
:
ModalState
=
{
centered
:
false
,
centered
:
false
,
class
:
''
,
closeOnClickModal
:
true
,
closeOnClickModal
:
true
,
closeOnPressEscape
:
true
,
closeOnPressEscape
:
true
,
confirmLoading
:
false
,
confirmLoading
:
false
,
contentClass
:
''
,
draggable
:
false
,
draggable
:
false
,
footer
:
true
,
footer
:
true
,
footerClass
:
''
,
fullscreen
:
false
,
fullscreen
:
false
,
fullscreenButton
:
true
,
fullscreenButton
:
true
,
header
:
true
,
header
:
true
,
headerClass
:
''
,
isOpen
:
false
,
isOpen
:
false
,
loading
:
false
,
loading
:
false
,
modal
:
true
,
modal
:
true
,
...
...
packages/@core/ui-kit/popup-ui/src/modal/modal.ts
View file @
76a879d
...
@@ -12,6 +12,7 @@ export interface ModalProps {
...
@@ -12,6 +12,7 @@ export interface ModalProps {
* @default false
* @default false
*/
*/
centered
?:
boolean
;
centered
?:
boolean
;
class
?:
string
;
/**
/**
* 是否显示右上角的关闭按钮
* 是否显示右上角的关闭按钮
* @default true
* @default true
...
@@ -36,6 +37,7 @@ export interface ModalProps {
...
@@ -36,6 +37,7 @@ export interface ModalProps {
* 确定按钮文字
* 确定按钮文字
*/
*/
confirmText
?:
string
;
confirmText
?:
string
;
contentClass
?:
string
;
/**
/**
* 弹窗描述
* 弹窗描述
*/
*/
...
@@ -50,6 +52,7 @@ export interface ModalProps {
...
@@ -50,6 +52,7 @@ export interface ModalProps {
* @default true
* @default true
*/
*/
footer
?:
boolean
;
footer
?:
boolean
;
footerClass
?:
string
;
/**
/**
* 是否全屏
* 是否全屏
* @default false
* @default false
...
@@ -65,6 +68,7 @@ export interface ModalProps {
...
@@ -65,6 +68,7 @@ export interface ModalProps {
* @default true
* @default true
*/
*/
header
?:
boolean
;
header
?:
boolean
;
headerClass
?:
string
;
/**
/**
* 弹窗是否显示
* 弹窗是否显示
* @default false
* @default false
...
...
packages/@core/ui-kit/popup-ui/src/modal/modal.vue
View file @
76a879d
...
@@ -27,18 +27,10 @@ import { cn } from '@vben-core/shared/utils';
...
@@ -27,18 +27,10 @@ import { cn } from '@vben-core/shared/utils';
import
{
useModalDraggable
}
from
'./use-modal-draggable'
;
import
{
useModalDraggable
}
from
'./use-modal-draggable'
;
interface
Props
extends
ModalProps
{
interface
Props
extends
ModalProps
{
class
?:
string
;
contentClass
?:
string
;
footerClass
?:
string
;
headerClass
?:
string
;
modalApi
?:
ExtendedModalApi
;
modalApi
?:
ExtendedModalApi
;
}
}
const
props
=
withDefaults
(
defineProps
<
Props
>
(),
{
const
props
=
withDefaults
(
defineProps
<
Props
>
(),
{
class
:
''
,
contentClass
:
''
,
footerClass
:
''
,
headerClass
:
''
,
modalApi
:
undefined
,
modalApi
:
undefined
,
});
});
...
@@ -55,17 +47,21 @@ const state = props.modalApi?.useStore?.();
...
@@ -55,17 +47,21 @@ const state = props.modalApi?.useStore?.();
const
{
const
{
cancelText
,
cancelText
,
centered
,
centered
,
class
:
modalClass
,
closable
,
closable
,
closeOnClickModal
,
closeOnClickModal
,
closeOnPressEscape
,
closeOnPressEscape
,
confirmLoading
,
confirmLoading
,
confirmText
,
confirmText
,
contentClass
,
description
,
description
,
draggable
,
draggable
,
footer
:
showFooter
,
footer
:
showFooter
,
footerClass
,
fullscreen
,
fullscreen
,
fullscreenButton
,
fullscreenButton
,
header
,
header
,
headerClass
,
loading
:
showLoading
,
loading
:
showLoading
,
modal
,
modal
,
openAutoFocus
,
openAutoFocus
,
...
@@ -161,7 +157,7 @@ function pointerDownOutside(e: Event) {
...
@@ -161,7 +157,7 @@ function pointerDownOutside(e: Event) {
:class=
"
:class=
"
cn(
cn(
'border-border left-0 right-0 top-[10vh] mx-auto flex max-h-[80%] w-[520px] flex-col border p-0',
'border-border left-0 right-0 top-[10vh] mx-auto flex max-h-[80%] w-[520px] flex-col border p-0',
props.c
lass,
modalC
lass,
{
{
'left-0 top-0 size-full max-h-full !translate-x-0 !translate-y-0':
'left-0 top-0 size-full max-h-full !translate-x-0 !translate-y-0':
shouldFullscreen,
shouldFullscreen,
...
@@ -186,7 +182,7 @@ function pointerDownOutside(e: Event) {
...
@@ -186,7 +182,7 @@ function pointerDownOutside(e: Event) {
hidden: !header,
hidden: !header,
'cursor-move select-none': shouldDraggable,
'cursor-move select-none': shouldDraggable,
},
},
props.
headerClass,
headerClass,
)
)
"
"
>
>
...
@@ -240,10 +236,7 @@ function pointerDownOutside(e: Event) {
...
@@ -240,10 +236,7 @@ function pointerDownOutside(e: Event) {
v-if=
"showFooter"
v-if=
"showFooter"
ref=
"footerRef"
ref=
"footerRef"
:class=
"
:class=
"
cn(
cn('flex-row items-center justify-end border-t p-2', footerClass)
'flex-row items-center justify-end border-t p-2',
props.footerClass,
)
"
"
>
>
<slot
name=
"prepend-footer"
></slot>
<slot
name=
"prepend-footer"
></slot>
...
...
packages/@core/ui-kit/shadcn-ui/src/components/index.ts
View file @
76a879d
...
@@ -20,6 +20,7 @@ export * from './render-content';
...
@@ -20,6 +20,7 @@ export * from './render-content';
export
*
from
'./scrollbar'
;
export
*
from
'./scrollbar'
;
export
*
from
'./segmented'
;
export
*
from
'./segmented'
;
export
*
from
'./select'
;
export
*
from
'./select'
;
export
*
from
'./spine-text'
;
export
*
from
'./spinner'
;
export
*
from
'./spinner'
;
export
*
from
'./swap'
;
export
*
from
'./swap'
;
export
*
from
'./tooltip'
;
export
*
from
'./tooltip'
;
...
...
packages/@core/ui-kit/shadcn-ui/src/components/spine-text/index.ts
0 → 100644
View file @
76a879d
export
{
default
as
VbenSpineText
}
from
'./spine-text.vue'
;
packages/@core/ui-kit/shadcn-ui/src/components/spine-text/spine-text.vue
0 → 100644
View file @
76a879d
<
template
>
<div
class=
"vben-spine-text !bg-clip-text text-transparent"
>
<slot></slot>
</div>
</
template
>
<
style
>
.vben-spine-text
{
background
:
radial-gradient
(
circle
at
center
,
rgb
(
255
255
255
/
80%
),
#f000
)
-200%
50%
/
200%
100%
no-repeat
,
#000
;
animation
:
shine
3s
linear
infinite
;
}
.dark
.vben-spine-text
{
background
:
radial-gradient
(
circle
at
center
,
rgb
(
24
24
26
/
80%
),
transparent
)
-200%
50%
/
200%
100%
no-repeat
,
#f4f4f4
;
}
@keyframes
shine
{
0
%
{
background-position
:
200%
0%
;
}
100
%
{
background-position
:
-200%
0%
;
}
}
</
style
>
packages/effects/common-ui/src/ui/authentication/code-login.vue
View file @
76a879d
...
@@ -96,7 +96,14 @@ function goToLogin() {
...
@@ -96,7 +96,14 @@ function goToLogin() {
</
template
>
</
template
>
</Title>
</Title>
<Form
/>
<Form
/>
<VbenButton
:loading=
"loading"
class=
"w-full"
@
click=
"handleSubmit"
>
<VbenButton
:class=
"{
'cursor-wait': loading,
}"
:loading=
"loading"
class=
"w-full"
@
click=
"handleSubmit"
>
<slot
name=
"submitButtonText"
>
<slot
name=
"submitButtonText"
>
{{ submitButtonText || $t('common.login') }}
{{ submitButtonText || $t('common.login') }}
</slot>
</slot>
...
...
packages/effects/common-ui/src/ui/authentication/forget-password.vue
View file @
76a879d
...
@@ -91,7 +91,13 @@ function goToLogin() {
...
@@ -91,7 +91,13 @@ function goToLogin() {
<Form
/>
<Form
/>
<div>
<div>
<VbenButton
class=
"mt-2 w-full"
@
click=
"handleSubmit"
>
<VbenButton
:class=
"{
'cursor-wait': loading,
}"
class=
"mt-2 w-full"
@
click=
"handleSubmit"
>
<slot
name=
"submitButtonText"
>
<slot
name=
"submitButtonText"
>
{{ submitButtonText || $t('authentication.sendResetLink') }}
{{ submitButtonText || $t('authentication.sendResetLink') }}
</slot>
</slot>
...
...
packages/effects/common-ui/src/ui/authentication/login.vue
View file @
76a879d
...
@@ -124,7 +124,14 @@ onMounted(() => {
...
@@ -124,7 +124,14 @@ onMounted(() => {
{{
$t
(
'authentication.forgetPassword'
)
}}
{{
$t
(
'authentication.forgetPassword'
)
}}
<
/span
>
<
/span
>
<
/div
>
<
/div
>
<
VbenButton
:
loading
=
"loading"
class
=
"w-full"
@
click
=
"handleSubmit"
>
<
VbenButton
:
class
=
"
{
'cursor-wait'
:
loading
,
}
"
:loading="
loading
"
class="
w
-
full
"
@click="
handleSubmit
"
>
{{
submitButtonText
||
$t
(
'common.login'
)
}}
{{
submitButtonText
||
$t
(
'common.login'
)
}}
<
/VbenButton
>
<
/VbenButton
>
...
...
packages/effects/common-ui/src/ui/authentication/register.vue
View file @
76a879d
...
@@ -92,7 +92,14 @@ function goToLogin() {
...
@@ -92,7 +92,14 @@ function goToLogin() {
</Title>
</Title>
<Form
/>
<Form
/>
<VbenButton
:loading=
"loading"
class=
"mt-2 w-full"
@
click=
"handleSubmit"
>
<VbenButton
:class=
"{
'cursor-wait': loading,
}"
:loading=
"loading"
class=
"mt-2 w-full"
@
click=
"handleSubmit"
>
<slot
name=
"submitButtonText"
>
<slot
name=
"submitButtonText"
>
{{ submitButtonText || $t('authentication.signUp') }}
{{ submitButtonText || $t('authentication.signUp') }}
</slot>
</slot>
...
...
playground/src/router/index.ts
View file @
76a879d
...
@@ -19,7 +19,12 @@ const router = createRouter({
...
@@ -19,7 +19,12 @@ const router = createRouter({
:
createWebHistory
(
import
.
meta
.
env
.
VITE_BASE
),
:
createWebHistory
(
import
.
meta
.
env
.
VITE_BASE
),
// 应该添加到路由的初始路由列表。
// 应该添加到路由的初始路由列表。
routes
,
routes
,
scrollBehavior
:
()
=>
({
left
:
0
,
top
:
0
}),
scrollBehavior
:
(
to
,
_from
,
savedPosition
)
=>
{
if
(
savedPosition
)
{
return
savedPosition
;
}
return
to
.
hash
?
{
behavior
:
'smooth'
,
el
:
to
.
hash
}
:
{
left
:
0
,
top
:
0
};
},
// 是否应该禁止尾部斜杠。
// 是否应该禁止尾部斜杠。
// strict: true,
// strict: true,
});
});
...
...
playground/src/views/examples/form/custom.vue
View file @
76a879d
...
@@ -14,7 +14,7 @@ const [BaseForm] = useVbenForm({
...
@@ -14,7 +14,7 @@ const [BaseForm] = useVbenForm({
componentProps
:
{
componentProps
:
{
class
:
'w-full'
,
class
:
'w-full'
,
},
},
label
Width
:
200
,
label
Class
:
'w-2/6'
,
},
},
// 使用 tailwindcss grid布局
// 使用 tailwindcss grid布局
// 提交函数
// 提交函数
...
...
playground/src/views/examples/form/dynamic.vue
View file @
76a879d
...
@@ -210,7 +210,6 @@ function onSubmit(values: Record<string, any>) {
...
@@ -210,7 +210,6 @@ function onSubmit(values: Record<string, any>) {
function
handleDelete
()
{
function
handleDelete
()
{
formApi
.
setState
((
prev
)
=>
{
formApi
.
setState
((
prev
)
=>
{
return
{
return
{
...
prev
,
schema
:
prev
.
schema
?.
filter
((
item
)
=>
item
.
fieldName
!==
'field7'
),
schema
:
prev
.
schema
?.
filter
((
item
)
=>
item
.
fieldName
!==
'field7'
),
};
};
});
});
...
@@ -219,7 +218,6 @@ function handleDelete() {
...
@@ -219,7 +218,6 @@ function handleDelete() {
function
handleAdd
()
{
function
handleAdd
()
{
formApi
.
setState
((
prev
)
=>
{
formApi
.
setState
((
prev
)
=>
{
return
{
return
{
...
prev
,
schema
:
[
schema
:
[
...(
prev
?.
schema
??
[]),
...(
prev
?.
schema
??
[]),
{
{
...
@@ -235,7 +233,6 @@ function handleAdd() {
...
@@ -235,7 +233,6 @@ function handleAdd() {
function
handleUpdate
()
{
function
handleUpdate
()
{
formApi
.
setState
((
prev
)
=>
{
formApi
.
setState
((
prev
)
=>
{
return
{
return
{
...
prev
,
schema
:
prev
.
schema
?.
map
((
item
)
=>
{
schema
:
prev
.
schema
?.
map
((
item
)
=>
{
if
(
item
.
fieldName
===
'field3'
)
{
if
(
item
.
fieldName
===
'field3'
)
{
return
{
return
{
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment