STSMACOM-492: ControlledVocab documentation#1501
Conversation
| Name | Type | Default | Description | ||
| --- | --- | --- | --- | ||
| actionProps | Object | `{ delete: (item) => {return { disabled: item.item.inUse } } }` | Object containing properties of list action names: 'delete', 'edit' and values of sentinel functions that return objects to destructure onto the action button props | ||
| actionSupressor | Object | `{edit: item: => item.readOnly, delete: item, => item.readOnly}` | Object containing properties of list action names: `delete`, `edit` and values of sentinel functions that return booleans based on object properties | ||
| actuatorType | String | `'rest'` | Either `rest` or `refdata`. If manually set to `refdata`, sets actuators to PUT only | ||
| baseUrl | String | | A string to customize the path which should be used. Required | ||
| canCreate | Boolean | `true` | As for [`<EditableList>`](https://github.com/folio-org/stripes-smart-components/edit/master/lib/EditableList/readme.md) | ||
| columnMapping | Object | `{name : ..., lastUpdated: ..., numberOfObjects: ...}` | As for [`<EditableList>`](https://github.com/folio-org/stripes-smart-components/edit/master/lib/EditableList/readme.md) | ||
| editable | Boolean | `true` | Allows custom content/components to be displayed in the grid | ||
| formatter | Object | | As for [`<EditableList>`](https://github.com/folio-org/stripes-smart-components/edit/master/lib/EditableList/readme.md) | ||
| hiddenFields | Array of Strings | | A list of the fields present in the table not wanted in the UI | ||
| hideCreateButton | Boolean | `false` | Hides create button | ||
| id | String | `controlled-vocab-` | Used as a basic suffix for id attributes throughout the component. | ||
| itemTemplate | Object | | Object where each key's value is the default value for that field: `{ resourceType: 'book' }` | ||
| label | ReactNode | | The text for the H3 tag in the header of the component. Required | ||
| limitParam | String | | Limit parameter for the GET url | ||
| listFormLabel | ReactNode | | If provided, it will be used instead of what is provided in the `label` prop | ||
| listSupressor | Function | | Allows for the supression of the resulting list | ||
| listSupressorText | ReactNode | | If list is suppressed, this message will show instead | ||
| nameKey | String | `undefined` | The key that uniquely names listed objects: defaults to 'name' | ||
| objectLabel | ReactNode | | Labels the objects present in the `numberOfObjects` column | ||
| parseRow | Function | | Allows to parse the tables rows according to user implemented function. | ||
| readOnlyFields | Array of Strings | | Array of non-editable columns - good for displaying meta information within the row. | ||
| rowFilter | Element | | An optional React element placed above the list to present the filter parameters | ||
| rowFilterFunction | Function | | Allows for specific filtering of resulting rows | ||
| sortBy | String | `name` | Field of which to sort table | ||
| translations | Object | | Object of strings used to display different messages to the user | ||
| validate | Function | | Allows for custom field validation. The function is called for each record (row) and should return an empty object for no errors, or an object where the keys are the field names and the values are the error message components/strings to display |
There was a problem hiding this comment.
Please format the table so that it can be read in Markdown. Your editor should be able to do this automatically, feel free to reach out to me if you need help setting that up.
For example:
| Name | Type | Default | Description |
| ----------------- | -------- | ------- | ----------------------------------------------- |
| rowFilterFunction | Function | | Allows for specific filtering of resulting rows |
| sortBy | String | `name` | Field of which to sort table |
...
BigTest Unit Test Statistics 1 files ±0 1 suites ±0 16s ⏱️ +2s For more details on these failures, see this check. Results for commit 641e25e. ± Comparison against base commit 4e1a4e9. ♻️ This comment has been updated with latest results. |
ncovercash
left a comment
There was a problem hiding this comment.
If you're doing documentation for these props, it'd be greatly appreciate if you'd also add TypeScript typings over in stripes-types! Let me know if you have any questions about that repository and how to add to it
Created documentation for the ControlledVocab component