Skip to content

Commit

Permalink
add canFilter and canSort to tables
Browse files Browse the repository at this point in the history
  • Loading branch information
danphilibin committed Dec 22, 2022
1 parent 612c7ae commit 2159eee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/examples/basic/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ export const no_pagination: IntervalActionHandler = async io => {
await io.display.table('Display users', {
data,
defaultPageSize: 50,
canFilter: false,
canSort: false,
})
}

Expand Down
4 changes: 4 additions & 0 deletions src/ioSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,8 @@ const DISPLAY_SCHEMA = {
data: z.array(internalTableRow),
orientation: z.enum(['vertical', 'horizontal']).default('horizontal'),
defaultPageSize: z.number().optional(),
canSort: z.boolean().default(true),
canFilter: z.boolean().default(true),
//== private props
// added in v0.28, optional until required by all active versions
totalRecords: z.optional(z.number().int()),
Expand Down Expand Up @@ -655,6 +657,8 @@ const INPUT_SCHEMA = {
minSelections: z.optional(z.number().int().min(0)),
maxSelections: z.optional(z.number().positive().int()),
disabled: z.optional(z.boolean().default(false)),
canSort: z.optional(z.boolean().default(true)),
canFilter: z.optional(z.boolean().default(true)),
//== private props
// added in v0.28, optional until required by all active versions
totalRecords: z.optional(z.number().int()),
Expand Down

0 comments on commit 2159eee

Please sign in to comment.