File tree Expand file tree Collapse file tree 3 files changed +33
-29
lines changed Expand file tree Collapse file tree 3 files changed +33
-29
lines changed Original file line number Diff line number Diff line change
1
+ import { PaginationProps } from './types' ;
1
2
import { usePagination } from './use-pagination' ;
2
- import type { PropFunction } from '@builder.io/qwik' ;
3
3
import { component$ , Slot } from '@builder.io/qwik' ;
4
4
5
- type ArrowLabels = {
6
- previous : string ;
7
- next : string ;
8
- } ;
9
-
10
- export interface PaginationProps {
11
- selectedPage : number ;
12
- totalPages : number ;
13
- onPageChange$ : PropFunction < ( page : number ) => void > ;
14
-
15
- // configuration
16
- siblingCount ?: number ;
17
- boundaryCount ?: number ;
18
- hidePrevButton ?: boolean ;
19
- hideNextButton ?: boolean ;
20
- disabled ?: boolean ;
21
- customArrowTexts ?: ArrowLabels ;
22
-
23
- // styling
24
- class ?: string ;
25
- gap ?: string ;
26
- defaultClass ?: string ;
27
- selectedClass ?: string ;
28
- dividerClass ?: string ;
29
- }
30
-
31
5
export const Pagination = component$ < PaginationProps > ( ( props ) => {
32
6
const {
33
7
selectedPage,
34
8
totalPages,
35
9
onPageChange$,
36
- // configuration
37
10
siblingCount,
38
11
boundaryCount,
39
12
hidePrevButton = false ,
@@ -43,7 +16,6 @@ export const Pagination = component$<PaginationProps>((props) => {
43
16
previous : previousButtonLabel = 'PREV' ,
44
17
next : nextButtonLabel = 'NEXT' ,
45
18
} = { } ,
46
- // styling
47
19
class : _class ,
48
20
gap = '10px' ,
49
21
defaultClass,
Original file line number Diff line number Diff line change
1
+ export * from './pagination-api' ;
Original file line number Diff line number Diff line change
1
+ import { PropFunction } from '@builder.io/qwik' ;
2
+
3
+ export interface PaginationCoreProps {
4
+ selectedPage : number ;
5
+ totalPages : number ;
6
+ onPageChange$ : PropFunction < ( page : number ) => void > ;
7
+ }
8
+
9
+ export type PaginationStyling = {
10
+ class ?: string ;
11
+ gap ?: string ;
12
+ defaultClass ?: string ;
13
+ selectedClass ?: string ;
14
+ dividerClass ?: string ;
15
+ } ;
16
+
17
+ export type PaginationConfig = {
18
+ siblingCount ?: number ;
19
+ boundaryCount ?: number ;
20
+ hidePrevButton ?: boolean ;
21
+ hideNextButton ?: boolean ;
22
+ disabled ?: boolean ;
23
+ customArrowTexts ?: ArrowLabels ;
24
+ } ;
25
+
26
+ type ArrowLabels = {
27
+ previous : string ;
28
+ next : string ;
29
+ } ;
30
+
31
+ export type PaginationProps = PaginationCoreProps & PaginationStyling & PaginationConfig ;
You can’t perform that action at this time.
0 commit comments