2023-10-02 10:46:09 +00:00
|
|
|
import BaseStyle from 'primevue/base/style';
|
|
|
|
|
2024-05-01 08:26:48 +00:00
|
|
|
const theme = ({ dt }) => `
|
|
|
|
.p-paginator {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
background: ${dt('paginator.background')};
|
|
|
|
color: ${dt('paginator.color')};
|
2024-05-15 08:42:09 +00:00
|
|
|
padding: ${dt('paginator.padding')};
|
|
|
|
border-radius: ${dt('paginator.border.radius')};
|
|
|
|
gap: ${dt('paginator.gap')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-paginator-content-start {
|
|
|
|
margin-right: auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-paginator-content-end {
|
|
|
|
margin-left: auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-paginator-page,
|
|
|
|
.p-paginator-next,
|
|
|
|
.p-paginator-last,
|
|
|
|
.p-paginator-first,
|
|
|
|
.p-paginator-prev {
|
|
|
|
cursor: pointer;
|
|
|
|
display: inline-flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
line-height: 1;
|
|
|
|
user-select: none;
|
|
|
|
overflow: hidden;
|
|
|
|
position: relative;
|
|
|
|
background: transparent;
|
|
|
|
border: 0 none;
|
2024-05-04 21:57:50 +00:00
|
|
|
color: ${dt('paginator.nav.button.color')};
|
2024-05-15 08:42:09 +00:00
|
|
|
min-width: ${dt('paginator.nav.button.width')};
|
|
|
|
height: ${dt('paginator.nav.button.height')};
|
2024-05-25 08:18:55 +00:00
|
|
|
transition: background ${dt('paginator.transition.duration')}, color ${dt('paginator.transition.duration')}, outline-color ${dt('paginator.transition.duration')}, box-shadow ${dt('paginator.transition.duration')};
|
2024-05-15 08:42:09 +00:00
|
|
|
border-radius: ${dt('paginator.nav.button.border.radius')};
|
2024-05-01 08:26:48 +00:00
|
|
|
padding: 0;
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
|
2024-05-03 06:41:04 +00:00
|
|
|
.p-paginator-page:focus-visible,
|
|
|
|
.p-paginator-next:focus-visible,
|
|
|
|
.p-paginator-last:focus-visible,
|
|
|
|
.p-paginator-first:focus-visible,
|
|
|
|
.p-paginator-prev:focus-visible {
|
2024-05-15 08:42:09 +00:00
|
|
|
box-shadow: ${dt('paginator.nav.button.focus.ring.shadow')};
|
|
|
|
outline: ${dt('paginator.nav.button.focus.ring.width')} ${dt('paginator.nav.button.focus.ring.style')} ${dt('paginator.nav.button.focus.ring.color')};
|
|
|
|
outline-offset: ${dt('paginator.nav.button.focus.ring.offset')};
|
2024-05-03 06:41:04 +00:00
|
|
|
}
|
|
|
|
|
2024-05-01 08:26:48 +00:00
|
|
|
.p-paginator-page:not(.p-disabled):not(.p-paginator-page-active):hover,
|
|
|
|
.p-paginator-first:not(.p-disabled):hover,
|
|
|
|
.p-paginator-prev:not(.p-disabled):hover,
|
|
|
|
.p-paginator-next:not(.p-disabled):hover,
|
|
|
|
.p-paginator-last:not(.p-disabled):hover {
|
2024-05-04 21:57:50 +00:00
|
|
|
background: ${dt('paginator.nav.button.hover.background')};
|
|
|
|
color: ${dt('paginator.nav.button.hover.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-paginator-current {
|
|
|
|
color: ${dt('paginator.current.page.report.color')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-paginator-pages {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
2024-05-15 08:42:09 +00:00
|
|
|
gap: ${dt('paginator.gap')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-paginator-page.p-paginator-page-active {
|
|
|
|
background: ${dt('highlight.background')};
|
|
|
|
color: ${dt('highlight.color')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-paginator-jtp-input .p-inputtext {
|
|
|
|
max-width: 2.5rem;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2023-10-02 10:46:09 +00:00
|
|
|
const classes = {
|
|
|
|
paginator: ({ instance, key }) => [
|
|
|
|
'p-paginator p-component',
|
|
|
|
{
|
|
|
|
'p-paginator-default': !instance.hasBreakpoints(),
|
|
|
|
[`p-paginator-${key}`]: instance.hasBreakpoints()
|
|
|
|
}
|
|
|
|
],
|
2024-05-02 06:27:51 +00:00
|
|
|
contentStart: 'p-paginator-content-start',
|
|
|
|
contentEnd: 'p-paginator-content-end',
|
|
|
|
first: ({ instance }) => [
|
2024-04-26 08:07:08 +00:00
|
|
|
'p-paginator-first',
|
2023-10-02 10:46:09 +00:00
|
|
|
{
|
|
|
|
'p-disabled': instance.$attrs.disabled
|
|
|
|
}
|
|
|
|
],
|
2024-05-02 06:27:51 +00:00
|
|
|
firstIcon: 'p-paginator-first-icon',
|
|
|
|
prev: ({ instance }) => [
|
2024-04-26 08:07:08 +00:00
|
|
|
'p-paginator-prev',
|
2023-10-02 10:46:09 +00:00
|
|
|
{
|
|
|
|
'p-disabled': instance.$attrs.disabled
|
|
|
|
}
|
|
|
|
],
|
2024-05-02 06:27:51 +00:00
|
|
|
prevIcon: 'p-paginator-prev-icon',
|
|
|
|
next: ({ instance }) => [
|
2024-04-26 08:07:08 +00:00
|
|
|
'p-paginator-next',
|
2023-10-02 10:46:09 +00:00
|
|
|
{
|
|
|
|
'p-disabled': instance.$attrs.disabled
|
|
|
|
}
|
|
|
|
],
|
2024-05-02 06:27:51 +00:00
|
|
|
nextIcon: 'p-paginator-next-icon',
|
|
|
|
last: ({ instance }) => [
|
2024-04-26 08:07:08 +00:00
|
|
|
'p-paginator-last',
|
2023-10-02 10:46:09 +00:00
|
|
|
{
|
|
|
|
'p-disabled': instance.$attrs.disabled
|
|
|
|
}
|
|
|
|
],
|
2024-05-02 06:27:51 +00:00
|
|
|
lastIcon: 'p-paginator-last-icon',
|
2023-10-02 10:46:09 +00:00
|
|
|
pages: 'p-paginator-pages',
|
2024-05-02 06:27:51 +00:00
|
|
|
page: ({ props, pageLink }) => [
|
2024-04-26 08:07:08 +00:00
|
|
|
'p-paginator-page',
|
2023-10-02 10:46:09 +00:00
|
|
|
{
|
2024-04-26 08:07:08 +00:00
|
|
|
'p-paginator-page-active': pageLink - 1 === props.page
|
2023-10-02 10:46:09 +00:00
|
|
|
}
|
|
|
|
],
|
|
|
|
current: 'p-paginator-current',
|
2024-05-06 15:23:01 +00:00
|
|
|
pcRowPerPageDropdown: 'p-paginator-rpp-dropdown',
|
|
|
|
pcJumpToPageDropdown: 'p-paginator-jtp-dropdown',
|
|
|
|
pcJumpToPageInput: 'p-paginator-jtp-input'
|
2023-10-02 10:46:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'paginator',
|
2024-05-01 08:26:48 +00:00
|
|
|
theme,
|
2023-10-02 10:46:09 +00:00
|
|
|
classes
|
|
|
|
});
|