|
25 | 25 | "title": "string (StringEditor)",
|
26 | 26 | "type": "string",
|
27 | 27 | "const": "Alice",
|
28 |
| - // "options": { "enforce_const": false } |
29 | 28 | },
|
30 | 29 | "integer": {
|
31 | 30 | "title": "integer (IntegerEditor)",
|
32 | 31 | "type": "integer",
|
33 | 32 | "const": 5,
|
34 |
| - // "options": { "enforce_const": false } |
35 | 33 | },
|
36 | 34 | "number": {
|
37 | 35 | "title": "number (NumberEditor)",
|
38 | 36 | "type": "number",
|
39 | 37 | "const": 5.5,
|
40 |
| - // "options": { "enforce_const": false } |
41 | 38 | },
|
42 | 39 | "string-enum": {
|
43 | 40 | "title": "string-enum (SelectEditor)",
|
|
48 | 45 | "Bob",
|
49 | 46 | "Carl"
|
50 | 47 | ],
|
51 |
| - // "options": { "enforce_const": false } |
52 | 48 | },
|
53 | 49 | "boolean": {
|
54 | 50 | "title": "boolean (SelectEditor)",
|
55 | 51 | "type": "boolean",
|
56 | 52 | "const": true,
|
57 |
| - // "options": { "enforce_const": false } |
58 | 53 | },
|
59 | 54 | "boolean-checkbox": {
|
60 | 55 | "title": "boolean-checkbox (CheckboxEditor)",
|
61 | 56 | "type": "boolean",
|
62 | 57 | "format": "checkbox",
|
63 | 58 | "const": true,
|
64 |
| - // "options": { "enforce_const": false } |
65 | 59 | },
|
66 | 60 | "boolean-choices": {
|
67 | 61 | "title": "boolean-choices (ChoicesEditor)",
|
68 | 62 | "type": "boolean",
|
69 | 63 | "format": "choices",
|
70 | 64 | "const": true,
|
71 |
| - // "options": { "enforce_const": false } |
72 | 65 | },
|
73 | 66 | "object": {
|
74 | 67 | "title": "object (ObjectEditor)",
|
75 | 68 | "type": "object",
|
76 | 69 | "const": {"name": "Alice"},
|
77 |
| - // "options": { "enforce_const": false }, |
78 | 70 | "properties": {
|
79 | 71 | "name": {
|
80 | 72 | "type": "string"
|
81 | 73 | }
|
82 | 74 | }
|
83 | 75 | },
|
84 | 76 | "array": {
|
85 |
| - "title": "array (TableEditor)", |
| 77 | + "title": "array", |
86 | 78 | "type": "array",
|
87 | 79 | "const": [{"name": "Alice"}, {"name": "Bob"}],
|
88 |
| - // "options": { "enforce_const": false }, |
89 | 80 | "items": {
|
90 | 81 | "title": "object",
|
91 | 82 | "type": "object",
|
|
104 | 95 | "items": {
|
105 | 96 | "title": "object",
|
106 | 97 | "type": "object",
|
107 |
| - "const": {"name": "Alice"}, |
108 | 98 | "properties": {
|
109 | 99 | "name": {
|
110 | 100 | "type": "string"
|
111 | 101 | }
|
112 | 102 | }
|
113 | 103 | },
|
114 |
| - // "options": { "enforce_const": false } |
115 | 104 | },
|
116 | 105 | "array-tabs": {
|
117 |
| - "title": "array (TableEditor)", |
| 106 | + "title": "array (TabsEditor)", |
118 | 107 | "type": "array",
|
119 | 108 | "format": "tabs",
|
120 | 109 | "const": [{"name": "Alice"}, {"name": "Bob"}],
|
121 | 110 | "items": {
|
122 | 111 | "title": "object",
|
123 | 112 | "type": "object",
|
124 |
| - "const": {"name": "Alice"}, |
125 | 113 | "properties": {
|
126 | 114 | "name": {
|
127 | 115 | "type": "string"
|
128 | 116 | }
|
129 | 117 | }
|
130 | 118 | },
|
131 |
| - // "options": { "enforce_const": false } |
132 | 119 | },
|
133 | 120 | "array-of-strings": {
|
134 | 121 | "title": "array (MultiselectEditor)",
|
|
140 | 127 | "enum": ["Alice", "Bob"]
|
141 | 128 | },
|
142 | 129 | "const": ["Alice", "Bob"],
|
143 |
| - // "options": { "enforce_const": false } |
144 | 130 | },
|
145 | 131 | "array-enum": {
|
146 | 132 | "title": "array (EnumEditor)",
|
147 | 133 | "type": "array",
|
148 | 134 | "enum": [["Alice", "Bob"], ["Carl", "Dennis"]],
|
149 | 135 | "const": ["Carl", "Dennis"],
|
150 |
| - // "options": { "enforce_const": false } |
151 | 136 | },
|
152 | 137 | "object-enum": {
|
153 | 138 | "title": "object (EnumEditor)",
|
154 | 139 | "type": "object",
|
155 | 140 | "enum": [{"name": "Alice"}, {"name": "Bob"}],
|
156 | 141 | "const": {"name": "Bob"},
|
157 |
| - // "options": { "enforce_const": false } |
158 | 142 | }
|
159 | 143 | }
|
160 | 144 | }
|
|
170 | 154 | editor.on('change', function () {
|
171 | 155 | value.value = JSON.stringify(editor.getValue())
|
172 | 156 | })
|
| 157 | + |
| 158 | + editor.on('ready', function () { |
| 159 | + editor.getEditor('root.string').setValue('Bob') |
| 160 | + editor.getEditor('root.integer').setValue(10) |
| 161 | + editor.getEditor('root.number').setValue(10) |
| 162 | + editor.getEditor('root.array').setValue([]) |
| 163 | + editor.getEditor('root.object').setValue({}) |
| 164 | + }) |
173 | 165 | </script>
|
174 | 166 |
|
175 | 167 | </body>
|
|
0 commit comments