Normalize API method names and row modesl, add expandAll functionality including prop getter

This commit is contained in:
Tanner Linsley
2020-02-15 12:43:09 -07:00
parent 2bf99aaea0
commit 083e81dc81
26 changed files with 386 additions and 204 deletions
+8 -1
View File
@@ -41,6 +41,13 @@ The following properties are available on the table instance returned from `useT
- `rows: Array<Row>`
- An array of **expanded** rows.
- `toggleRowExpanded: Function(rowId, isExpanded?)`
- A function to toggle whether a row is expanded or not. The `isExpanded` boolean is optional, otherwise it will be a true toggle action
- `toggleAllRowsExpanded: Function(isExpanded?)`
- A function to toggle whether all of the rows in the table are expanded or not. The `isExpanded` boolean is optional, otherwise it will be a true toggle action
- `isAllRowsExpanded`
- `getToggleAllRowsExpandedProps: Function(userProps) => props`
- A prop getter function that returns all necessary props for an element to be clicked and toggle all of the rows expanded or not.
### Row Properties
@@ -48,7 +55,7 @@ The following additional properties are available on every `row` object returned
- `isExpanded: Bool`
- If `true`, this row is in an expanded state.
- `toggleExpanded: Function(?isExpanded: Bool) => void`
- `toggleRowExpanded: Function(?isExpanded: Bool) => void`
- This function will toggle the expanded state of a row between `true` and `false` or, if an `isExpanded` boolean is passed to the function, it will be set as the new `isExpanded` value.
- Rows with a hard-coded `manualExpandedKey` (defaults to `expanded`) set to `true` are not affected by this function or the internal expanded state.
-5
View File
@@ -93,11 +93,6 @@ The following options are supported on any column object you can pass to `column
- Receives the table instance and cell model as props
- Must return valid JSX
- This function (or component) is primarily used for formatting the column value, eg. If your column accessor returns a date object, you can use a `Cell` function to format that date to a readable format.
- `show: Bool`
- Optional
- Defaults to `undefined`
- If set to `true`, will take priority over any state in `hiddenColumns` and force this column to be visible at all times.
- If set to `false` will take priority over any state in `hiddenColumns` and force this column to be hidden at all times.
- `width: Int`
- Optional
- Defaults to `150`