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: docs/pages/apis.mdx
+7-3
Original file line number
Diff line number
Diff line change
@@ -10,12 +10,16 @@
10
10
|`sx`|`SxProps`| - |[The `sx` prop](https://mui.com/system/getting-started/the-sx-prop/) lets you style elements inline, using values from the theme. |
11
11
|`indentWidth`|`number`| 3 | Indent width for nested objects |
12
12
|`keyRenderer`|`{when: (props) => boolean}`| - | Customize a key, if `keyRenderer.when` returns `true`. |
13
-
|`valueTypes`|`ValueTypes`| - | Customize the definition of data types. See [Defining Data Types](/how-to/data-types)|
13
+
|`valueTypes`|`ValueTypes`| - | Customize the definition of data types. See [Defining Data Types](/how-to/data-types)|
14
+
|`enableAdd`|`boolean`\|<br />`(path, currentValue) => boolean`|`false`| Whether enable add feature. Provide a function to customize this behavior by returning a boolean based on the value and path. |
15
+
|`enableDelete`|`boolean`\|<br />`(path, currentValue) => boolean`|`false`| Whether enable delete feature. Provide a function to customize this behavior by returning a boolean based on the value and path. |
|`editable`|`boolean`\|<br />`(path, currentValue) => boolean`|`false`| Whether enable edit feature. Provide a function to customize this behavior by returning a boolean based on the value and path. |
14
18
|`onChange`|`(path, oldVal, newVal) => void`| - | Callback when value changed. |
15
19
|`onCopy`|`(path, value) => void`| - | Callback when value copied, you can use it to customize the copy behavior.<br />\*Note: you will have to write the data to the clipboard by yourself. |
16
20
|`onSelect`|`(path, value) => void`| - | Callback when value selected. |
|`editable`|`boolean`\|<br />`(path, currentValue) => boolean`|`false`| Whether enable edit feature. Provide a function to customize this behavior by returning a boolean based on the value and path.|
21
+
|`onAdd`|`(path) => void`|- | Callback when the add button is clicked. This is the function which implements the add feature. Please see the [DEMO](/full) for more details.|
22
+
|`onDelete`|`(path) => void`| -| Callback when the delete button is clicked. This is the function which implements the delete feature. Please see the [DEMO](/full) for more details.|
19
23
|`defaultInspectDepth`|`number`| 5 | Default inspect depth for nested objects.<br /><br />_\* If the number is set too large, it could result in performance issues._|
20
24
|`defaultInspectControl`|`(path, currentValue) => boolean`| - | Whether expand or collapse a field by default. Using this will override `defaultInspectDepth`. |
21
25
|`maxDisplayLength`|`number`| 30 | Hide items after reaching the count.<br />`Array` and `Object` will be affected.<br /><br />_\* If the number is set too large, it could result in performance issues._|
Copy file name to clipboardExpand all lines: docs/pages/how-to/data-types.mdx
+1
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,7 @@ The `is` function takes a value and a path and returns true if the value belongs
25
25
26
26
The `Component` prop is a React component that renders the value of the data type. It receives a `DataItemProps` object as a `prop`, which includes the following:
27
27
28
+
-`props.path` - The path to the value.
28
29
-`props.value` - The value to render.
29
30
-`props.inspect` - A Boolean flag indicating whether the value is being inspected (expanded).
30
31
-`props.setInspect` - A function that can be used to toggle the inspect state.
constCircularArrows='M 12 2 C 10.615 1.998 9.214625 2.2867656 7.890625 2.8847656 L 8.9003906 4.6328125 C 9.9043906 4.2098125 10.957 3.998 12 4 C 15.080783 4 17.738521 5.7633175 19.074219 8.3222656 L 17.125 9 L 21.25 11 L 22.875 7 L 20.998047 7.6523438 C 19.377701 4.3110398 15.95585 2 12 2 z M 6.5097656 4.4882812 L 2.2324219 5.0820312 L 3.734375 6.3808594 C 1.6515335 9.4550558 1.3615962 13.574578 3.3398438 17 C 4.0308437 18.201 4.9801562 19.268234 6.1601562 20.115234 L 7.1699219 18.367188 C 6.3019219 17.710187 5.5922656 16.904 5.0722656 16 C 3.5320014 13.332354 3.729203 10.148679 5.2773438 7.7128906 L 6.8398438 9.0625 L 6.5097656 4.4882812 z M 19.929688 13 C 19.794687 14.08 19.450734 15.098 18.927734 16 C 17.386985 18.668487 14.531361 20.090637 11.646484 19.966797 L 12.035156 17.9375 L 8.2402344 20.511719 L 10.892578 23.917969 L 11.265625 21.966797 C 14.968963 22.233766 18.681899 20.426323 20.660156 17 C 21.355156 15.801 21.805219 14.445 21.949219 13 L 19.929688 13 z'
0 commit comments