Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
18761f3
feat(pagination): implement basics based on flowbite (wip)
bence444 Dec 11, 2024
e6482df
feat(pagination): implement basics based on flowbite (wip)
bence444 Dec 11, 2024
cc20b83
feat(pagination): move button design to its own directive
bence444 Dec 12, 2024
6d48101
Merge branch 'pagination' of https://github.com/bence444/flowbite-ang…
bence444 Dec 12, 2024
9f2ca65
feat(pagination): implement basics based on flowbite (wip)
bence444 Dec 11, 2024
1bd73bd
feat(pagination): move button design to its own directive
bence444 Dec 12, 2024
6a77a41
feat(pagination): implement basics based on flowbite (wip)
bence444 Dec 11, 2024
b2c05d5
Merge branch 'pagination' of https://github.com/bence444/flowbite-ang…
bence444 Dec 19, 2024
a43f5cb
fix: merge conflict
bence444 Dec 19, 2024
1aa9da0
feat(pagination): add icons, style active button, jsdoc comments
bence444 Dec 19, 2024
cbaf247
docs(pagination): add NgDoc documentation
bence444 Dec 19, 2024
620f320
fix(pagination): remove duplicated provider registrations
bence444 Dec 19, 2024
2c083bf
fix(pagination): remove unused pageChange output
bence444 Dec 19, 2024
ea541d2
fix(pagination): fix demo component selector
bence444 Dec 19, 2024
a47e774
fix(pagination): correct first visible page
bence444 Dec 20, 2024
1ceabbe
feat(utils): add double chevron icon from `https://flowbite.com/icons/`
bence444 Dec 20, 2024
c92b724
feat(paginator): add customizable icons, size variables
bence444 Dec 20, 2024
15376cb
feat(pagination): add property providers
bence444 Dec 20, 2024
523363e
Merge branch 'main' into pagination
MGREMY Dec 28, 2024
3edf1c4
feat(pagination): remove directive & use flowbite-button
MGREMY Dec 29, 2024
e524102
Merge pull request #1 from MGREMY/pagination
bence444 Dec 30, 2024
cb31e76
chore(pagination): code style updates
bence444 Dec 30, 2024
338e5f3
chore(pagination): use `model` instead of `input`
bence444 Dec 30, 2024
970b79d
refactor(pagination): remove `nav` element, use root and rootClass
bence444 Dec 30, 2024
b914355
chore(pagination): code style
bence444 Dec 30, 2024
c983fca
feat(utils): add left/double left chevron icon
bence444 Dec 30, 2024
434bfa4
feat(pagination): use left sided icons instead of `rotate-180`
bence444 Dec 30, 2024
783c3ed
Merge branch 'main' into pagination
bence444 Dec 30, 2024
0ec0dfa
fix(pagination): place label before icon in next/last button
bence444 Dec 30, 2024
87b1887
refactor(pagination): update post update post comment
MGREMY Dec 30, 2024
021058b
refactor(pagination): fix doc attribute
MGREMY Dec 30, 2024
3947513
Merge pull request #2 from MGREMY/pagination
bence444 Dec 31, 2024
bd238c4
feat(pagination): possibility to use `totalPages` or `totalItems`
bence444 Dec 31, 2024
e8860f1
refactor(pagination): use `Array.from` instead of for loop
bence444 Dec 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions apps/docs/docs/components/pagination/_both.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<flowbite-pagination
[totalItems]="100"
[navigationMode]="'both'" />
10 changes: 10 additions & 0 deletions apps/docs/docs/components/pagination/_both.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { PaginationComponent } from 'flowbite-angular/pagination';

import { Component } from '@angular/core';

@Component({
selector: 'flowbite-demo-pagination-both',
imports: [PaginationComponent],
templateUrl: './_both.component.html',
})
export class FlowbiteBothComponent {}
9 changes: 9 additions & 0 deletions apps/docs/docs/components/pagination/_custom.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<flowbite-pagination
[currentPage]="20"
[totalItems]="100000"
[pageSize]="50"
[hasFirstLast]="false"
[ariaLabel]="'Custom pagination'"
[customStyle]="{
root: { base: 'flex gap-2' },
}" />
10 changes: 10 additions & 0 deletions apps/docs/docs/components/pagination/_custom.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { PaginationComponent } from 'flowbite-angular/pagination';

import { Component } from '@angular/core';

@Component({
selector: 'flowbite-demo-pagination-custom',
imports: [PaginationComponent],
templateUrl: './_custom.component.html',
})
export class FlowbiteCustomComponent {}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<flowbite-pagination [totalItems]="1000" />
10 changes: 10 additions & 0 deletions apps/docs/docs/components/pagination/_default.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { PaginationComponent } from 'flowbite-angular/pagination';

import { Component } from '@angular/core';

@Component({
selector: 'flowbite-demo-pagination-default',
imports: [PaginationComponent],
templateUrl: './_default.component.html',
})
export class FlowbiteDefaultComponent {}
3 changes: 3 additions & 0 deletions apps/docs/docs/components/pagination/_text.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<flowbite-pagination
[totalItems]="100"
[navigationMode]="'text'" />
10 changes: 10 additions & 0 deletions apps/docs/docs/components/pagination/_text.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { PaginationComponent } from 'flowbite-angular/pagination';

import { Component } from '@angular/core';

@Component({
selector: 'flowbite-demo-pagination-text',
imports: [PaginationComponent],
templateUrl: './_text.component.html',
})
export class FlowbiteTextComponent {}
Comment on lines +1 to +10
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add a dedicated property and event emitter for page changes.
This example references the pagination component but does not display how to handle page changes. To make the documentation more instructive, you might add a property like “page: number = 1” and subscribe to the (pageChange) event for demonstration.

51 changes: 51 additions & 0 deletions apps/docs/docs/components/pagination/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
keyword: PaginationPage
---

## Default pagination

{{ NgDocActions.demo('flowbiteDefaultComponent', {container: false}) }}

```angular-html file="./_default.component.html" group="default" name="html"

```

```angular-ts file="./_default.component.ts" group="default" name="typescript"

```

## Pagination with text

{{ NgDocActions.demo('flowbiteTextComponent', {container: false}) }}

```angular-html file="./_text.component.html" group="text" name="html"

```

```angular-ts file="./_text.component.ts"#L1 group="text" name="typescript"

```

## Pagination with text and icon

{{ NgDocActions.demo('flowbiteBothComponent', {container: false}) }}

```angular-html file="./_both.component.html" group="both" name="html"

```

```angular-ts file="./_both.component.ts"#L1 group="both" name="typescript"

```

## Customized pagination

{{ NgDocActions.demo('flowbiteCustomComponent', {container: false}) }}

```angular-html file="./_custom.component.html" group="custom" name="html"

```

```angular-ts file="./_custom.component.ts"#L1 group="custom" name="typescript"

```
Comment on lines +1 to +51
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Documentation needs additional sections for pending features

Based on the PR objectives, the documentation is missing several key sections:

  1. Customization of button labels
  2. Internationalization support
  3. Size variants
  4. Icon customization for first/last and previous/next buttons

Consider adding these sections to align with the planned features:

## Button Labels Customization

Demonstrate how to customize navigation button labels.

## Internationalization

Show how to implement i18n support for pagination labels.

## Size Variants

Examples of different pagination sizes (sm, md, lg).

## Icon Customization

How to customize icons for navigation buttons.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~29-~29: The grammatical number of this noun doesn’t look right. Consider replacing it.
Context: ...ript" ``` ## Pagination with text and icon {{ NgDocActions.demo('flowbiteBothComp...

(AI_EN_LECTOR_REPLACEMENT_NOUN_NUMBER)

27 changes: 27 additions & 0 deletions apps/docs/docs/components/pagination/ng-doc.page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import ComponentCategory from '../ng-doc.category';
import { FlowbiteBothComponent } from './_both.component';
import { FlowbiteCustomComponent } from './_custom.component';
import { FlowbiteDefaultComponent } from './_default.component';
import { FlowbiteTextComponent } from './_text.component';

import type { NgDocPage } from '@ng-doc/core';

/**
* Use the pagination component to show a list of buttons to navigate in your tables
*
* @status:info NEW
*/
const pagination: NgDocPage = {
title: 'Pagination',
mdFile: './index.md',
category: ComponentCategory,
order: 10,
demos: {
flowbiteDefaultComponent: FlowbiteDefaultComponent,
flowbiteTextComponent: FlowbiteTextComponent,
flowbiteBothComponent: FlowbiteBothComponent,
flowbiteCustomComponent: FlowbiteCustomComponent,
},
};

export default pagination;
2 changes: 1 addition & 1 deletion apps/docs/docs/getting-started/quickstart/ng-doc.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { NgDocPage } from '@ng-doc/core';
/**
* Get started with flowbite-angular by including it into your project using NPM
*
* @status:alert UPDATES
* @status:success UPDATES
*/
const Quickstart: NgDocPage = {
title: 'Quickstart',
Expand Down
2 changes: 2 additions & 0 deletions apps/docs/docs/getting-started/versioning/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ keyword: VersioningPage

| Flowbite-angular version | Angular version | TailwindCSS version |
| ------------------------ | --------------- | ------------------- |
| 1.4.0 | >=18.0.0 | ^3.0.0 |
| 1.3.0 | >=18.0.0 | ^3.0.0 |
| 1.2.0 | >=18.0.0 | ^3.0.0 |
| 1.1.1 | 18.0.0 | ^3.0.24 |
| 1.0.0 | 18.0.0 | ^3.0.24 |
2 changes: 1 addition & 1 deletion apps/docs/docs/getting-started/versioning/ng-doc.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { NgDocPage } from '@ng-doc/core';
* Here is a reference table that matches versions of flowbite-angular with its Angular version. It
* also shows the TailwindCSS version used.
*
* @status:alert NEW
* @status:info NEW
*/
const Versioning: NgDocPage = {
title: 'Versioning',
Expand Down
1 change: 1 addition & 0 deletions apps/docs/docs/ng-doc.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const api: NgDocApi = {
'libs/flowbite-angular/indicator/index.ts',
'libs/flowbite-angular/modal/index.ts',
'libs/flowbite-angular/navbar/index.ts',
'libs/flowbite-angular/pagination/index.ts',
'libs/flowbite-angular/scroll-top/index.ts',
'libs/flowbite-angular/sidebar/index.ts',
'libs/flowbite-angular/theme/index.ts',
Expand Down
15 changes: 15 additions & 0 deletions libs/flowbite-angular/core/flowbite.theme.init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ import {
navbarToggleTheme,
NavbarToggleThemeService,
} from 'flowbite-angular/navbar';
import {
FLOWBITE_PAGINATION_THEME_TOKEN,
paginationDefaultValueProvider,
paginationTheme,
PaginationThemeService,
} from 'flowbite-angular/pagination';
import {
FLOWBITE_SCROLL_TOP_THEME_TOKEN,
scrollTopDefaultValueProvider,
Expand Down Expand Up @@ -263,6 +269,10 @@ export function initFlowbite(): EnvironmentProviders {
provide: NavbarThemeService,
useClass: NavbarThemeService,
},
{
provide: PaginationThemeService,
useClass: PaginationThemeService,
},
{
provide: ScrollTopThemeService,
useClass: ScrollTopThemeService,
Expand Down Expand Up @@ -391,6 +401,10 @@ export function initFlowbite(): EnvironmentProviders {
provide: FLOWBITE_NAVBAR_THEME_TOKEN,
useValue: navbarTheme,
},
{
provide: FLOWBITE_PAGINATION_THEME_TOKEN,
useValue: paginationTheme,
},
{
provide: FLOWBITE_SCROLL_TOP_THEME_TOKEN,
useValue: scrollTopTheme,
Expand Down Expand Up @@ -447,6 +461,7 @@ export function initFlowbite(): EnvironmentProviders {
navbarIconButtonDefaultValueProvider,
navbarContentDefaultValueProvider,
navbarBrandDefaultThemeProvider,
paginationDefaultValueProvider,
scrollTopDefaultValueProvider,
sidebarDefaultValueProvider,
sidebarToggleDefaultValueProvider,
Expand Down
4 changes: 4 additions & 0 deletions libs/flowbite-angular/pagination/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# flowbite-angular/pagination

Secondary entry point of `flowbite-angular`. It can be used by importing from
`flowbite-angular/pagination`.
23 changes: 23 additions & 0 deletions libs/flowbite-angular/pagination/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export {
PaginationComponent,
paginationDefaultValueProvider,
FLOWBITE_PAGINATION_CURRENT_PAGE_DEFAULT_VALUE,
FLOWBITE_PAGINATION_BUTTON_PROPERTIES_DEFAULT_VALUE,
FLOWBITE_PAGINATION_CUSTOM_STYLE_DEFAULT_VALUE,
FLOWBITE_PAGINATION_PREVIOUS_ICON_DEFAULT_VALUE,
FLOWBITE_PAGINATION_NEXT_ICON_DEFAULT_VALUE,
FLOWBITE_PAGINATION_FIRST_ICON_DEFAULT_VALUE,
FLOWBITE_PAGINATION_LAST_ICON_DEFAULT_VALUE,
FLOWBITE_PAGINATION_TABS_DEFAULT_VALUE,
FLOWBITE_PAGINATION_PAGE_SIZE_DEFAULT_VALUE,
FLOWBITE_PAGINATION_HAS_FIRST_LAST_DEFAULT_VALUE,
FLOWBITE_PAGINATION_HAS_PREV_NEXT_DEFAULT_VALUE,
FLOWBITE_PAGINATION_NAVIGATION_MODE_DEFAULT_VALUE,
FLOWBITE_PAGINATION_SIZE_DEFAULT_VALUE,
} from './pagination.component';
export type { PaginationProperties, PaginationClass, PaginationTheme } from './pagination.theme';
export { paginationTheme } from './pagination.theme';
export {
PaginationThemeService,
FLOWBITE_PAGINATION_THEME_TOKEN,
} from './pagination.theme.service';
5 changes: 5 additions & 0 deletions libs/flowbite-angular/pagination/ng-package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"lib": {
"entryFile": "./index.ts"
}
}
Loading
Loading