Skip to content

Commit

Permalink
Merge pull request #1018 from interval/can-filter
Browse files Browse the repository at this point in the history
Add `isFilterable` and `isSortable` to tables
  • Loading branch information
jacobmischka authored Dec 22, 2022
2 parents 5d1bc66 + 811f450 commit 4faf3ad
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,
isFilterable: false,
isSortable: false,
})
}

Expand Down
4 changes: 4 additions & 0 deletions src/ioSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,8 @@ const DISPLAY_SCHEMA = {
data: z.array(internalTableRow),
orientation: z.enum(['vertical', 'horizontal']).default('horizontal'),
defaultPageSize: z.number().optional(),
isSortable: z.boolean().default(true),
isFilterable: 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 @@ -699,6 +701,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)),
isSortable: z.optional(z.boolean().default(true)),
isFilterable: 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 4faf3ad

Please sign in to comment.