-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(kottiPagination): add prop types, zod schema and add to expo…
…rted kotti types
- Loading branch information
Showing
4 changed files
with
34 additions
and
16 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
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,21 @@ | ||
import { z } from 'zod' | ||
|
||
export namespace KottiPagination { | ||
export enum PagingStyle { | ||
DEFAULT = 'default', | ||
FLEX = 'flex', | ||
FRACTION = 'fraction', | ||
} | ||
|
||
export const propsSchema = z.object({ | ||
adjacentAmount: z.number().nullable().default(null), | ||
fixedWidth: z.boolean().nullable().default(null), | ||
page: z.number().nullable().default(null), | ||
pageSize: z.number().nullable().default(null), | ||
pagingStyle: z.nativeEnum(PagingStyle).nullable().default(null), | ||
total: z.number(), | ||
}) | ||
|
||
export type PropsInternal = z.output<typeof propsSchema> | ||
export type Props = z.input<typeof propsSchema> | ||
} |
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