Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(pagination): styles #501

Merged
merged 3 commits into from
Nov 29, 2024
Merged

Conversation

marcjulian
Copy link
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

Which package are you modifying?

  • accordion
  • alert
  • alert-dialog
  • aspect-ratio
  • avatar
  • badge
  • button
  • calendar
  • card
  • checkbox
  • collapsible
  • combobox
  • command
  • context-menu
  • data-table
  • date-picker
  • dialog
  • dropdown-menu
  • hover-card
  • icon
  • input
  • label
  • menubar
  • navigation-menu
  • pagination
  • popover
  • progress
  • radio-group
  • scroll-area
  • select
  • separator
  • sheet
  • skeleton
  • slider
  • sonner
  • spinner
  • switch
  • table
  • tabs
  • textarea
  • toast
  • toggle
  • tooltip
  • typography

What is the current behavior?

Pagination previous had the wrong pr-2.5 style applied.
Advanced Pagination hover styles showed the cursor text by default, because RouterLink is used as hostDirective for hlmPaginationLink and it does not receive a link.

What is the new behavior?

Update pagination previous styles to pl-2.5.
Add cursor-pointer to advanced pagination to hlmPaginationLink and previous/next buttons.

Does this PR introduce a breaking change?

  • Yes
  • No

Breaking change because styles change and need to copied over

Other information

@marcjulian marcjulian changed the title Fix/pagination styles fix(pagination): styles Nov 28, 2024
@@ -53,7 +58,7 @@ import { HlmPaginationDirective } from './hlm-pagination.directive';

@if (showEdges() && !isLastPageActive()) {
<li hlmPaginationItem (click)="goToNext()">
<hlm-pagination-next />
<hlm-pagination-next class="cursor-pointer" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: What do you think about adding this class conditionally based on link().trim().length === 0 (disabled) state of hlm-pagination-next / hlm-pagination-previous?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats an even better idea! I will see if I can even add it to hlm-pagination-link.

@@ -47,6 +47,7 @@ export class HlmPaginationLinkDirective {
protected readonly _computedClass = computed(() =>
hlm(
paginationLinkVariants(),
this.link() === undefined ? 'cursor-pointer' : '',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ajitzero I apply the cursor-pointer in the pagination link. This also applies the style to pagination next/previous as they use the pagination link directive as well.

The routerLink type can be string | any[] | UrlTree | null | undefined, maybe its sufficient to only apply the styles when no link is applied === undefined. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that makes sense! Thanks!

@goetzrobin goetzrobin merged commit be50818 into spartan-ng:main Nov 29, 2024
6 of 7 checks passed
@marcjulian marcjulian deleted the fix/pagination-styles branch November 29, 2024 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants