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 4005023f
authored
Nov 09, 2024
by
Vben
Committed by
GitHub
Nov 09, 2024
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix: drawer component header does not take effect (#4844)
1 parent
8617d3dd
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
42 additions
and
41 deletions
packages/@core/base/icons/build.config.ts
packages/@core/base/icons/src/index.ts
packages/@core/base/icons/src/lucide.ts
packages/@core/ui-kit/popup-ui/src/drawer/drawer.vue
packages/effects/common-ui/src/components/icon-picker/icon-picker.vue
packages/effects/hooks/src/use-pagination.ts
packages/@core/base/icons/src/components/empty.vue → packages/icons/src/icons/empty-icon.vue
packages/icons/src/index.ts
packages/@core/base/icons/build.config.ts
View file @
4005023
...
@@ -3,19 +3,5 @@ import { defineBuildConfig } from 'unbuild';
...
@@ -3,19 +3,5 @@ import { defineBuildConfig } from 'unbuild';
export
default
defineBuildConfig
({
export
default
defineBuildConfig
({
clean
:
true
,
clean
:
true
,
declaration
:
true
,
declaration
:
true
,
entries
:
[
entries
:
[
'src/index'
],
{
builder
:
'mkdist'
,
input
:
'./src'
,
loaders
:
[
'vue'
],
pattern
:
[
'**/*.vue'
],
},
{
builder
:
'mkdist'
,
format
:
'esm'
,
input
:
'./src'
,
loaders
:
[
'js'
],
pattern
:
[
'**/*.ts'
],
},
],
});
});
packages/@core/base/icons/src/index.ts
View file @
4005023
export
{
default
as
EmptyIcon
}
from
'./components/empty.vue'
;
export
*
from
'./create-icon'
;
export
*
from
'./create-icon'
;
export
*
from
'./lucide'
;
export
*
from
'./lucide'
;
...
...
packages/@core/base/icons/src/lucide.ts
View file @
4005023
...
@@ -41,7 +41,6 @@ export {
...
@@ -41,7 +41,6 @@ export {
Minimize
,
Minimize
,
Minimize2
,
Minimize2
,
MoonStar
,
MoonStar
,
Package2
,
Palette
,
Palette
,
PanelLeft
,
PanelLeft
,
PanelRight
,
PanelRight
,
...
...
packages/@core/ui-kit/popup-ui/src/drawer/drawer.vue
View file @
4005023
...
@@ -132,7 +132,7 @@ function handleFocusOutside(e: Event) {
...
@@ -132,7 +132,7 @@ function handleFocusOutside(e: Event) {
@pointer-down-outside="pointerDownOutside"
@pointer-down-outside="pointerDownOutside"
>
>
<SheetHeader
<SheetHeader
v-
show
=
"showHeader"
v-
if
=
"showHeader"
:class=
"
:class=
"
cn(
cn(
'!flex flex-row items-center justify-between border-b px-6 py-5',
'!flex flex-row items-center justify-between border-b px-6 py-5',
...
@@ -179,6 +179,12 @@ function handleFocusOutside(e: Event) {
...
@@ -179,6 +179,12 @@ function handleFocusOutside(e: Event) {
</div>
</div>
</SheetHeader>
</SheetHeader>
<template
v-else
>
<VisuallyHidden>
<SheetTitle
/>
<SheetDescription
/>
</VisuallyHidden>
</
template
>
<div
<div
ref=
"wrapperRef"
ref=
"wrapperRef"
:class=
"
:class=
"
...
...
packages/effects/common-ui/src/components/icon-picker/icon-picker.vue
View file @
4005023
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
ref
,
watch
,
watchEffect
}
from
'vue'
;
import
{
ref
,
useTemplateRef
,
watch
,
watchEffect
}
from
'vue'
;
import
{
usePagination
}
from
'@vben/hooks'
;
import
{
usePagination
}
from
'@vben/hooks'
;
import
{
Grip
,
Package2
}
from
'@vben/icons'
;
import
{
EmptyIcon
,
Grip
}
from
'@vben/icons'
;
import
{
import
{
Button
,
Button
,
Pagination
,
Pagination
,
...
@@ -38,9 +38,9 @@ const emit = defineEmits<{
...
@@ -38,9 +38,9 @@ const emit = defineEmits<{
'update:value'
:
[
string
];
'update:value'
:
[
string
];
}
>
();
}
>
();
const
refTrigger
=
useTemplateRef
<
HTMLElement
>
(
'refTrigger'
);
const
currentSelect
=
ref
(
''
);
const
currentSelect
=
ref
(
''
);
const
currentList
=
ref
(
props
.
icons
);
const
currentList
=
ref
(
props
.
icons
);
const
refTrigger
=
ref
<
HTMLDivElement
>
();
watch
(
watch
(
()
=>
props
.
icons
,
()
=>
props
.
icons
,
...
@@ -50,7 +50,7 @@ watch(
...
@@ -50,7 +50,7 @@ watch(
{
immediate
:
true
},
{
immediate
:
true
},
);
);
const
{
getPaginationList
,
getT
otal
,
setCurrentPage
}
=
usePagination
(
const
{
paginationList
,
t
otal
,
setCurrentPage
}
=
usePagination
(
currentList
,
currentList
,
props
.
pageSize
,
props
.
pageSize
,
);
);
...
@@ -75,47 +75,57 @@ const handlePageChange = (page: number) => {
...
@@ -75,47 +75,57 @@ const handlePageChange = (page: number) => {
setCurrentPage
(
page
);
setCurrentPage
(
page
);
};
};
const
changeOpenState
=
()
=>
{
function
changeOpenState
()
{
if
(
refTrigger
.
value
)
{
refTrigger
.
value
?.
click
?.();
refTrigger
.
value
.
click
();
}
}
};
defineExpose
({
changeOpenState
});
defineExpose
({
changeOpenState
});
</
script
>
</
script
>
<
template
>
<
template
>
<VbenPopover
<VbenPopover
:content-props=
"
{ align: 'end', alignOffset: -11, sideOffset: 8 }"
:content-props=
"
{ align: 'end', alignOffset: -11, sideOffset: 8 }"
content-class="p-0 p
y-4
"
content-class="p-0 p
t-3
"
>
>
<template
#
trigger
>
<template
#
trigger
>
<div
ref=
"refTrigger"
>
<div
ref=
"refTrigger"
>
<VbenIcon
:icon=
"currentSelect || Grip"
class=
"size-
6
"
/>
<VbenIcon
:icon=
"currentSelect || Grip"
class=
"size-
5
"
/>
</div>
</div>
</
template
>
</
template
>
<
div
v-if=
"getP
aginationList.length > 0"
>
<
template
v-if=
"p
aginationList.length > 0"
>
<div
class=
"grid max-h-[360px] w-full grid-cols-6 justify-items-center"
>
<div
class=
"grid max-h-[360px] w-full grid-cols-6 justify-items-center"
>
<VbenIconButton
<VbenIconButton
v-for=
"(item, index) in
getP
aginationList"
v-for=
"(item, index) in
p
aginationList"
:key=
"index"
:key=
"index"
:tooltip=
"item"
:tooltip=
"item"
tooltip-side=
"top"
tooltip-side=
"top"
@
click=
"handleClick(item)"
@
click=
"handleClick(item)"
>
>
<VbenIcon
:icon=
"item"
/>
<VbenIcon
:class=
"
{
'text-primary transition-all': currentSelect === item,
}"
:icon="item"
/>
</VbenIconButton>
</VbenIconButton>
</div>
</div>
<div
v-if=
"getTotal >= pageSize"
class=
"flex-center pt-1"
>
<div
v-if=
"total >= pageSize"
class=
"flex-center flex justify-end overflow-hidden border-t py-2 pr-3"
>
<Pagination
<Pagination
v-slot=
"
{ page }"
v-slot=
"
{ page }"
:items-per-page="36"
:items-per-page="36"
:sibling-count="1"
:sibling-count="1"
:total=
"
getT
otal"
:total="
t
otal"
show-edges
show-edges
size="small"
@update:page="handlePageChange"
@update:page="handlePageChange"
>
>
<PaginationList
v-slot=
"{ items }"
class=
"flex items-center gap-1"
>
<PaginationList
v-slot=
"
{ items }"
class="flex w-full items-center gap-1"
>
<PaginationFirst
class=
"size-5"
/>
<PaginationFirst
class=
"size-5"
/>
<PaginationPrev
class=
"size-5"
/>
<PaginationPrev
class=
"size-5"
/>
<template
v-for=
"(item, index) in items"
>
<template
v-for=
"(item, index) in items"
>
...
@@ -144,12 +154,12 @@ defineExpose({ changeOpenState });
...
@@ -144,12 +154,12 @@ defineExpose({ changeOpenState });
</PaginationList>
</PaginationList>
</Pagination>
</Pagination>
</div>
</div>
</
div
>
</
template
>
<
template
v-else
>
<
template
v-else
>
<div
class=
"flex-col-center text-muted-foreground min-h-[150px] w-full"
>
<div
class=
"flex-col-center text-muted-foreground min-h-[150px] w-full"
>
<
Package2
/>
<
EmptyIcon
class=
"size-10"
/>
<div>
{{
$t
(
'common.noData'
)
}}
</div>
<div
class=
"mt-1 text-sm"
>
{{
$t
(
'common.noData'
)
}}
</div>
</div>
</div>
</
template
>
</
template
>
</VbenPopover>
</VbenPopover>
...
...
packages/effects/hooks/src/use-pagination.ts
View file @
4005023
...
@@ -29,11 +29,11 @@ export function usePagination<T = any>(list: Ref<T[]>, pageSize: number) {
...
@@ -29,11 +29,11 @@ export function usePagination<T = any>(list: Ref<T[]>, pageSize: number) {
Math
.
ceil
(
unref
(
list
).
length
/
unref
(
pageSizeRef
)),
Math
.
ceil
(
unref
(
list
).
length
/
unref
(
pageSizeRef
)),
);
);
const
getP
aginationList
=
computed
(()
=>
{
const
p
aginationList
=
computed
(()
=>
{
return
pagination
(
unref
(
list
),
unref
(
currentPage
),
unref
(
pageSizeRef
));
return
pagination
(
unref
(
list
),
unref
(
currentPage
),
unref
(
pageSizeRef
));
});
});
const
getT
otal
=
computed
(()
=>
{
const
t
otal
=
computed
(()
=>
{
return
unref
(
list
).
length
;
return
unref
(
list
).
length
;
});
});
...
@@ -53,5 +53,5 @@ export function usePagination<T = any>(list: Ref<T[]>, pageSize: number) {
...
@@ -53,5 +53,5 @@ export function usePagination<T = any>(list: Ref<T[]>, pageSize: number) {
currentPage
.
value
=
1
;
currentPage
.
value
=
1
;
}
}
return
{
setCurrentPage
,
getTotal
,
setPageSize
,
getP
aginationList
};
return
{
setCurrentPage
,
total
,
setPageSize
,
p
aginationList
};
}
}
packages/
@core/base/icons/src/components/empty
.vue
→
packages/
icons/src/icons/empty-icon
.vue
View file @
4005023
File moved
packages/icons/src/index.ts
View file @
4005023
export
*
from
'./iconify/index.js'
;
export
*
from
'./iconify/index.js'
;
export
{
default
as
EmptyIcon
}
from
'./icons/empty-icon.vue'
;
export
*
from
'./svg/index.js'
;
export
*
from
'./svg/index.js'
;
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