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
Copy file name to clipboardExpand all lines: README.md
+2-1
Original file line number
Diff line number
Diff line change
@@ -148,6 +148,7 @@ The only *required* property is `data` (although you will need to provide a `set
148
148
|`restrictAdd`|`boolean\|FilterFunction`|`false`| As with `restrictEdit` but for adding new properties |
149
149
|`restrictTypeSelection`|`boolean\|DataType[]\|TypeFilterFunction`|`false`| For restricting the data types the user can select. Can be a list of data types (e.g. `[ 'string', 'number', 'boolean', 'array', 'object', 'null' ]`), a boolean. or a function — see [TypeFilterFunction](#typefilterfunction)|
150
150
|`restrictDrag`|`boolean\|FilterFunction`|`true`| Set to `false` to enable drag and drop functionality — see [Drag-n-drop](#drag-n-drop)|
151
+
|`viewOnly`|`boolean`|| A shorthand if you just want the component to be a viewer, with no editing. Overrides any values of the above edit restrictions. |
151
152
152
153
### Look and Feel / UI
153
154
@@ -329,7 +330,7 @@ For restricting data types, the (Type) filter function is slightly more sophisti
329
330
-`"object"`
330
331
-`"array"`
331
332
332
-
There is no specific restriction function for editing object key names, but they must return `true` for *both*`restrictEdit` and `restrictDelete` (and `restrictAdd` for collections), since changing a key name is equivalent to deleting a property and adding a new one.
333
+
There is no specific restriction function for editing object key names, but they must return `false` for *both*`restrictEdit` and `restrictDelete` (and `restrictAdd` for collections), since changing a key name is equivalent to deleting a property and adding a new one.
333
334
334
335
You can also set a dynamic default value by passing a filter function to the `defaultValue` prop -- the input is the same as the above, but also takes the new `key` value as its second parameter, so the new value can depend on the new key added.
0 commit comments