-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(design): convert paginator component to standalone (#3054)
- Loading branch information
1 parent
7ca68fd
commit 8caa5e1
Showing
8 changed files
with
95 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,52 @@ | ||
# Paginator | ||
Paginator is used to break up large amounts of content into multiple pages, enabling users to easily navigate between pages of content. | ||
|
||
## Default Paginator | ||
<design-land-example-viewer-container example="basic-paginator"></design-land-example-viewer-container> | ||
|
||
## Usage | ||
|
||
### Within a standalone component | ||
To use paginator in a standalone component, import `DAFF_PAGINATOR_COMPONENTS` directly into your custom component: | ||
|
||
```ts | ||
@Component({ | ||
selector: 'custom-component', | ||
templateUrl: './custom-component.component.html', | ||
standalone: true, | ||
imports: [ | ||
DAFF_PAGINATOR_COMPONENTS, | ||
], | ||
}) | ||
export class CustomComponent {} | ||
``` | ||
|
||
### Within a module (deprecated) | ||
To use paginator in a module, import `DaffPaginatorModule` into your custom module: | ||
|
||
```ts | ||
import { NgModule } from '@angular/core'; | ||
|
||
import { DaffPaginatorModule } from '@daffodil/design/paginator'; | ||
|
||
@NgModule({ | ||
declarations: [ | ||
CustomComponent, | ||
], | ||
exports: [ | ||
CustomComponent, | ||
], | ||
imports: [ | ||
DaffPaginatorModule, | ||
], | ||
}) | ||
export class CustomComponentModule { } | ||
``` | ||
|
||
> This method is deprecated. It's recommended to update all custom components to standalone. | ||
## Truncation | ||
An ellipsis is used to truncate pages when the number of pages exceed the maximum display limit. Double truncation appears when the current page is separated by more than three pages from both the first and last page. | ||
|
||
## Accessibility | ||
Use `aria-label` or `aria-labelledby` to give a meaningful label to `daff-paginator` that describes the content controlled by the paginator. If more than one paginator component is used on a page, each will need a unique `aria-label`. | ||
|
||
## Usage | ||
<design-land-example-viewer-container example="basic-paginator"></design-land-example-viewer-container> | ||
Use `aria-label` or `aria-labelledby` to give a meaningful label to `daff-paginator` that describes the content controlled by the paginator. If more than one paginator component is used on a page, each will need a unique `aria-label`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { DaffPaginatorComponent } from './paginator/paginator.component'; | ||
|
||
export const DAFF_PAGINATOR_COMPONENTS = <const> [ | ||
DaffPaginatorComponent, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export { DaffPaginatorModule } from './paginator.module'; | ||
export { DaffPaginatorComponent } from './paginator/paginator.component'; | ||
export { DAFF_PAGINATOR_COMPONENTS } from './paginator'; |