Skip to content

Commit 14f199c

Browse files
committed
Make table formatting consistent
- remove attempts to align the tables and just use one space around pipes - add pipes to the front and end of each line
1 parent 93c3009 commit 14f199c

File tree

1 file changed

+77
-78
lines changed

1 file changed

+77
-78
lines changed

README.md

Lines changed: 77 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -221,15 +221,15 @@ function render (selectProps) {
221221

222222
##### Creatable properties
223223

224-
Property | Type | Description
224+
| Property | Type | Description
225225
:---|:---|:---
226-
`children` | function | Child function responsible for creating the inner Select component. This component can be used to compose HOCs (eg Creatable and Async). Expected signature: `(props: Object): PropTypes.element` |
227-
`isOptionUnique` | function | Searches for any matching option within the set of options. This function prevents duplicate options from being created. By default this is a basic, case-sensitive comparison of label and value. Expected signature: `({ option: Object, options: Array, labelKey: string, valueKey: string }): boolean` |
228-
`isValidNewOption` | function | Determines if the current input text represents a valid option. By default any non-empty string will be considered valid. Expected signature: `({ label: string }): boolean` |
229-
`newOptionCreator` | function | Factory to create new option. Expected signature: `({ label: string, labelKey: string, valueKey: string }): Object` |
230-
`onNewOptionClick` | function | new option click handler, it calls when new option has been selected. `function(option) {}` |
231-
`shouldKeyDownEventCreateNewOption` | function | Decides if a keyDown event (eg its `keyCode`) should result in the creation of a new option. ENTER, TAB and comma keys create new options by default. Expected signature: `({ keyCode: number }): boolean` |
232-
`promptTextCreator` | function | Factory for overriding default option creator prompt label. By default it will read 'Create option "{label}"'. Expected signature: `(label: String): String` |
226+
| `children` | function | Child function responsible for creating the inner Select component. This component can be used to compose HOCs (eg Creatable and Async). Expected signature: `(props: Object): PropTypes.element` |
227+
| `isOptionUnique` | function | Searches for any matching option within the set of options. This function prevents duplicate options from being created. By default this is a basic, case-sensitive comparison of label and value. Expected signature: `({ option: Object, options: Array, labelKey: string, valueKey: string }): boolean` |
228+
| `isValidNewOption` | function | Determines if the current input text represents a valid option. By default any non-empty string will be considered valid. Expected signature: `({ label: string }): boolean` |
229+
| `newOptionCreator` | function | Factory to create new option. Expected signature: `({ label: string, labelKey: string, valueKey: string }): Object` |
230+
| `onNewOptionClick` | function | new option click handler, it calls when new option has been selected. `function(option) {}` |
231+
| `shouldKeyDownEventCreateNewOption` | function | Decides if a keyDown event (eg its `keyCode`) should result in the creation of a new option. ENTER, TAB and comma keys create new options by default. Expected signature: `({ keyCode: number }): boolean` |
232+
| `promptTextCreator` | function | Factory for overriding default option creator prompt label. By default it will read 'Create option "{label}"'. Expected signature: `(label: String): String` |
233233

234234
### Combining Async and Creatable
235235

@@ -324,84 +324,83 @@ You can extend or override this behavior by providing a `onInputKeyDown` callbac
324324

325325
```js
326326
function onInputKeyDown(event) {
327-
switch (event.keyCode) {
328-
case 9: // TAB
329-
// Extend default TAB behavior by doing something here
330-
break;
331-
case 13: // ENTER
332-
// Override default ENTER behavior by doing stuff here and then preventing default
333-
event.preventDefault();
334-
break;
335-
}
327+
switch (event.keyCode) {
328+
case 9: // TAB
329+
// Extend default TAB behavior by doing something here
330+
break;
331+
case 13: // ENTER
332+
// Override default ENTER behavior by doing stuff here and then preventing default
333+
event.preventDefault();
334+
break;
335+
}
336336
}
337337

338338
<Select
339-
{...otherProps}
340-
onInputKeyDown={onInputKeyDown}
339+
{...otherProps}
340+
onInputKeyDown={onInputKeyDown}
341341
/>
342342
```
343343

344344
### Further options
345345

346-
347-
Property | Type | Default | Description
348-
:-----------------------|:--------------|:--------------|:--------------------------------
349-
addLabelText | string | 'Add "{label}"?' | text to display when `allowCreate` is true
350-
arrowRenderer | func | undefined | Renders a custom drop-down arrow to be shown in the right-hand side of the select: `arrowRenderer({ onMouseDown, isOpen })`
351-
autoBlur | bool | false | Blurs the input element after a selection has been made. Handy for lowering the keyboard on mobile devices
352-
autofocus | bool | undefined | autofocus the component on mount
353-
autoload | bool | true | whether to auto-load the default async options set
354-
autosize | bool | true | If enabled, the input will expand as the length of its value increases
355-
backspaceRemoves | bool | true | whether pressing backspace removes the last item when there is no input value
356-
backspaceToRemoveMessage | string | 'Press backspace to remove {last label}' | prompt shown in input when at least one option in a multiselect is shown, set to '' to clear
357-
cache | bool | true | enables the options cache for `asyncOptions` (default: `true`)
358-
className | string | undefined | className for the outer element
359-
clearable | bool | true | should it be possible to reset value
360-
clearAllText | string | 'Clear all' | title for the "clear" control when `multi` is true
361-
clearRenderer | func | undefined | Renders a custom clear to be shown in the right-hand side of the select when clearable true: `clearRenderer()`
362-
clearValueText | string | 'Clear value' | title for the "clear" control
363-
resetValue | any | null | value to use when you clear the control
364-
deleteRemoves | bool | true | whether pressing delete key removes the last item when there is no input value
365-
delimiter | string | ',' | delimiter to use to join multiple values
366-
disabled | bool | false | whether the Select is disabled or not
367-
filterOption | func | undefined | method to filter a single option: `function(option, filterString)`
368-
filterOptions | func | undefined | method to filter the options array: `function([options], filterString, [values])`
369-
ignoreAccents | bool | true | whether to strip accents when filtering
370-
ignoreCase | bool | true | whether to perform case-insensitive filtering
371-
inputProps | object | {} | custom attributes for the Input (in the Select-control) e.g: `{'data-foo': 'bar'}`
372-
isLoading | bool | false | whether the Select is loading externally or not (such as options being loaded)
373-
joinValues | bool | false | join multiple values into a single hidden input using the `delimiter`
374-
labelKey | string | 'label' | the option property to use for the label
375-
loadOptions | func | undefined | function that returns a promise or calls a callback with the options: `function(input, [callback])`
376-
matchPos | string | 'any' | (any, start) match the start or entire string when filtering
377-
matchProp | string | 'any' | (any, label, value) which option property to filter on
378-
menuBuffer | number | 0 | buffer of px between the base of the dropdown and the viewport to shift if menu doesnt fit in viewport
379-
menuRenderer | func | undefined | Renders a custom menu with options; accepts the following named parameters: `menuRenderer({ focusedOption, focusOption, options, selectValue, valueArray })`
380-
multi | bool | undefined | multi-value input
381-
name | string | undefined | field name, for hidden `<input />` tag
382-
noResultsText | string | 'No results found' | placeholder displayed when there are no matching search results or a falsy value to hide it (can also be a react component)
383-
onBlur | func | undefined | onBlur handler: `function(event) {}`
384-
onBlurResetsInput | bool | true | whether to clear input on blur or not
385-
onChange | func | undefined | onChange handler: `function(newValue) {}`
386-
onClose | func | undefined | handler for when the menu closes: `function () {}`
387-
onCloseResetsInput | bool | true | whether to clear input when closing the menu through the arrow
388-
onFocus | func | undefined | onFocus handler: `function(event) {}`
389-
onInputChange | func | undefined | onInputChange handler: `function(inputValue) {}`
390-
onInputKeyDown | func | undefined | input keyDown handler; call `event.preventDefault()` to override default `Select` behavior: `function(event) {}`
391-
onOpen | func | undefined | handler for when the menu opens: `function () {}`
392-
onValueClick | func | undefined | onClick handler for value labels: `function (value, event) {}`
393-
openOnFocus | bool | false | open the options menu when the input gets focus (requires searchable = true)
394-
optionRenderer | func | undefined | function which returns a custom way to render the options in the menu
395-
options | array | undefined | array of options
396-
placeholder | string\|node | 'Select ...' | field placeholder, displayed when there's no value
397-
scrollMenuIntoView | bool | true | whether the viewport will shift to display the entire menu when engaged
398-
searchable | bool | true | whether to enable searching feature or not
399-
searchPromptText | string\|node | 'Type to search' | label to prompt for search input
400-
loadingPlaceholder | string\|node | 'Loading...' | label to prompt for loading search result
401-
tabSelectsValue | bool | true | whether to select the currently focused value when the `[tab]` key is pressed
402-
value | any | undefined | initial field value
403-
valueKey | string | 'value' | the option property to use for the value
404-
valueRenderer | func | undefined | function which returns a custom way to render the value selected `function (option) {}`
346+
| Property | Type | Default | Description |
347+
|:---|:---|:---|:---|
348+
| addLabelText | string | 'Add "{label}"?' | text to display when `allowCreate` is true |
349+
arrowRenderer | func | undefined | Renders a custom drop-down arrow to be shown in the right-hand side of the select: `arrowRenderer({ onMouseDown, isOpen })` |
350+
| autoBlur | bool | false | Blurs the input element after a selection has been made. Handy for lowering the keyboard on mobile devices |
351+
| autofocus | bool | undefined | autofocus the component on mount |
352+
| autoload | bool | true | whether to auto-load the default async options set |
353+
| autosize | bool | true | If enabled, the input will expand as the length of its value increases |
354+
| backspaceRemoves | bool | true | whether pressing backspace removes the last item when there is no input value |
355+
| backspaceToRemoveMessage | string | 'Press backspace to remove {last label}' | prompt shown in input when at least one option in a multiselect is shown, set to '' to clear |
356+
| cache | bool | true | enables the options cache for `asyncOptions` (default: `true`) |
357+
| className | string | undefined | className for the outer element |
358+
| clearable | bool | true | should it be possible to reset value |
359+
| clearAllText | string | 'Clear all' | title for the "clear" control when `multi` is true |
360+
| clearRenderer | func | undefined | Renders a custom clear to be shown in the right-hand side of the select when clearable true: `clearRenderer()` |
361+
| clearValueText | string | 'Clear value' | title for the "clear" control |
362+
| resetValue | any | null | value to use when you clear the control |
363+
| deleteRemoves | bool | true | whether pressing delete key removes the last item when there is no input value |
364+
| delimiter | string | ',' | delimiter to use to join multiple values |
365+
| disabled | bool | false | whether the Select is disabled or not |
366+
| filterOption | func | undefined | method to filter a single option: `function(option, filterString)` |
367+
| filterOptions | func | undefined | method to filter the options array: `function([options], filterString, [values])` |
368+
| ignoreAccents | bool | true | whether to strip accents when filtering |
369+
| ignoreCase | bool | true | whether to perform case-insensitive filtering |
370+
| inputProps | object | {} | custom attributes for the Input (in the Select-control) e.g: `{'data-foo': 'bar'}` |
371+
| isLoading | bool | false | whether the Select is loading externally or not (such as options being loaded) |
372+
| joinValues | bool | false | join multiple values into a single hidden input using the `delimiter` |
373+
| labelKey | string | 'label' | the option property to use for the label |
374+
| loadOptions | func | undefined | function that returns a promise or calls a callback with the options: `function(input, [callback])` |
375+
| matchPos | string | 'any' | (any, start) match the start or entire string when filtering |
376+
| matchProp | string | 'any' | (any, label, value) which option property to filter on |
377+
| menuBuffer | number | 0 | buffer of px between the base of the dropdown and the viewport to shift if menu doesnt fit in viewport |
378+
| menuRenderer | func | undefined | Renders a custom menu with options; accepts the following named parameters: `menuRenderer({ focusedOption, focusOption, options, selectValue, valueArray })` |
379+
| multi | bool | undefined | multi-value input |
380+
| name | string | undefined | field name, for hidden `<input />` tag |
381+
| noResultsText | string | 'No results found' | placeholder displayed when there are no matching search results or a falsy value to hide it (can also be a react component) |
382+
| onBlur | func | undefined | onBlur handler: `function(event) {}` |
383+
| onBlurResetsInput | bool | true | whether to clear input on blur or not |
384+
| onChange | func | undefined | onChange handler: `function(newValue) {}` |
385+
| onClose | func | undefined | handler for when the menu closes: `function () {}` |
386+
| onCloseResetsInput | bool | true | whether to clear input when closing the menu through the arrow |
387+
| onFocus | func | undefined | onFocus handler: `function(event) {}` |
388+
| onInputChange | func | undefined | onInputChange handler: `function(inputValue) {}` |
389+
| onInputKeyDown | func | undefined | input keyDown handler; call `event.preventDefault()` to override default `Select` behavior: `function(event) {}` |
390+
| onOpen | func | undefined | handler for when the menu opens: `function () {}` |
391+
| onValueClick | func | undefined | onClick handler for value labels: `function (value, event) {}` |
392+
| openOnFocus | bool | false | open the options menu when the input gets focus (requires searchable = true) |
393+
| optionRenderer | func | undefined | function which returns a custom way to render the options in the menu |
394+
| options | array | undefined | array of options |
395+
| placeholder | string\|node | 'Select ...' | field placeholder, displayed when there's no value |
396+
| scrollMenuIntoView | bool | true | whether the viewport will shift to display the entire menu when engaged |
397+
| searchable | bool | true | whether to enable searching feature or not |
398+
| searchPromptText | string\|node | 'Type to search' | label to prompt for search input |
399+
| loadingPlaceholder | string\|node | 'Loading...' | label to prompt for loading search result |
400+
| tabSelectsValue | bool | true | whether to select the currently focused value when the `[tab]` key is pressed |
401+
| value | any | undefined | initial field value |
402+
| valueKey | string | 'value' | the option property to use for the value |
403+
| valueRenderer | func | undefined | function which returns a custom way to render the value selected `function (option) {}` |
405404

406405
### Methods
407406

0 commit comments

Comments
 (0)