@@ -90,6 +90,7 @@ export const demoData: Record<string, DemoData> = {
90
90
</ Box >
91
91
</ Flex >
92
92
) ,
93
+ rootName : 'data' ,
93
94
collapse : 2 ,
94
95
data : data . intro ,
95
96
customNodeDefinitions : [ dateNodeDefinition ] ,
@@ -123,6 +124,7 @@ export const demoData: Record<string, DemoData> = {
123
124
</ Text >
124
125
</ Flex >
125
126
) ,
127
+ rootName : 'Star Wars data' ,
126
128
restrictEdit : ( { value } ) => typeof value === 'object' && value !== null ,
127
129
restrictDelete : ( { value } ) => typeof value === 'object' && value !== null ,
128
130
restrictAdd : ( { value } ) => ! Array . isArray ( value ) ,
@@ -149,7 +151,7 @@ export const demoData: Record<string, DemoData> = {
149
151
< span className = "code" > restrictEdit</ span > function
150
152
</ Link > { ' ' }
151
153
has been included which targets the < span className = "code" > id</ span > field specifically.
152
- You also can't add additional fields to the main "Person" objects.
154
+ You also can't add or delete fields to the main "Person" objects.
153
155
</ Text >
154
156
< Text >
155
157
Also, notice that when you add a new item in the top level array, a correctly structured{ ' ' }
@@ -176,9 +178,10 @@ export const demoData: Record<string, DemoData> = {
176
178
</ Text >
177
179
</ Flex >
178
180
) ,
181
+ rootName : 'Clients' ,
179
182
restrictEdit : ( { key, level } ) => key === 'id' || level === 0 || level === 1 ,
180
183
restrictAdd : ( { level } ) => level === 1 ,
181
- restrictDelete : ( { key } ) => key === 'id' ,
184
+ restrictDelete : ( { level } ) => level !== 1 ,
182
185
collapse : 2 ,
183
186
searchFilter : ( { path, fullData } , searchText ) => {
184
187
if ( path ?. length >= 2 ) {
@@ -248,6 +251,7 @@ export const demoData: Record<string, DemoData> = {
248
251
</ Text >
249
252
</ Flex >
250
253
) ,
254
+ rootName : 'settings' ,
251
255
collapse : 2 ,
252
256
data : data . vsCode ,
253
257
onUpdate : ( { newValue } ) => {
0 commit comments