You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`options` will be an array of objects: `[{ label, value }, { label, value }]`. `label` and `value` will always be strings.
41
+
42
+
`value` will be the currently selected value, always a string to match the `value` in the `options` object.
43
+
44
+
`onChange` will be a function that should be called when an option is selected. the function takes a single argument with the value of the selected option
45
+
46
+
The following additional props may be passed in the `props` argument:
47
+
-`placeholder`: placeholder value that can be displayed if the field has no value
|`json` | object or string | `{}` | the json object you want to edit. if you pass a string, the editor will attempt to parse it with `JSON.parse()`.
54
+
|`onChange` | function | `noop` | called whenever a change occurs: `function(updatedJson) {}`
55
+
|`dropdownFactory` | function | | factory to render a custom dropdown element for selecting the field type and value if type is boolean: `function(options = [], value, props={}) {}`
27
56
28
57
## Development
29
58
30
-
### Building
59
+
####Building
31
60
`npm run build` will run the js through babel and the scss through node-sass and output into `dist/`.
32
61
33
-
The `dist` folder should be committed to the repo.
62
+
The `dist` folder should be committed to the repo for now.
34
63
35
-
### Linting
64
+
####Linting
36
65
`npm run lint` - please lint before committing any code
37
66
38
67
## Known Issues
39
68
- Typing a decimal as the last character in a number field doesn't work because of the way we coerce the type - if the field is a number type, we try to `parseFloat()` it, which parses a value like `1.` to `1`. Adding the decimal anywhere but the last character will work, so a workaround to trying to type `1.1` would be to type `11`, then insert the decimal between the `1`s.
40
69
41
70
## TODO
42
71
- Remove react-bootstrap dependency (used for tooltips/popovers)
43
-
-Remove react-select dependency (used for dropdown)
44
-
-Allow passing input & select factories instead of using bootstrap/react-select components
72
+
-Allow passing an input factory or custom classname instead of using bootstrap components
0 commit comments