@json-editor/json-editor 2.13.2 → 2.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +2 -1
  3. package/dist/jsoneditor.js +1 -1
  4. package/dist/jsoneditor.js.LICENSE.txt +1 -1
  5. package/dist/nonmin/jsoneditor.js +369 -195
  6. package/dist/nonmin/jsoneditor.js.map +1 -1
  7. package/docs/imask.html +1 -1
  8. package/docs/meta_schema.json +3 -0
  9. package/package.json +1 -1
  10. package/src/defaults.js +5 -1
  11. package/src/editor.js +14 -1
  12. package/src/editors/array/selectize.js +13 -0
  13. package/src/editors/array.js +9 -1
  14. package/src/editors/info.js +1 -1
  15. package/src/editors/multiple.js +6 -1
  16. package/src/editors/multiselect.js +3 -2
  17. package/src/editors/object.js +20 -3
  18. package/src/editors/select.js +1 -1
  19. package/src/editors/starrating.js +5 -1
  20. package/src/editors/string.js +2 -2
  21. package/src/editors/table.js +3 -2
  22. package/src/theme.js +56 -4
  23. package/src/themes/barebones.js +1 -0
  24. package/src/themes/bootstrap3.js +49 -3
  25. package/src/themes/bootstrap4.js +38 -13
  26. package/src/themes/bootstrap5.js +37 -7
  27. package/src/themes/html.js +1 -0
  28. package/src/themes/spectre.js +15 -7
  29. package/src/validator.js +4 -3
  30. package/tests/codeceptjs/core_test.js +11 -0
  31. package/tests/codeceptjs/editors/array_test.js +7 -0
  32. package/tests/codeceptjs/editors/button_test.js +1 -1
  33. package/tests/codeceptjs/editors/checkbox_test.js +1 -1
  34. package/tests/codeceptjs/editors/integer_test.js +1 -1
  35. package/tests/codeceptjs/editors/multiselect_test.js +1 -1
  36. package/tests/codeceptjs/editors/number_test.js +1 -1
  37. package/tests/codeceptjs/editors/object_test.js +7 -0
  38. package/tests/codeceptjs/editors/radio_test.js +1 -2
  39. package/tests/codeceptjs/editors/rating_test.js +1 -2
  40. package/tests/codeceptjs/editors/select_test.js +1 -1
  41. package/tests/codeceptjs/editors/string_test.js +1 -1
  42. package/tests/codeceptjs/issues/issue-gh-1471_test.js +17 -0
  43. package/tests/codeceptjs/issues/issue-gh-812_test.js +2 -2
  44. package/tests/codeceptjs/meta-schema_test.js +1 -1
  45. package/tests/codeceptjs/schemaloader_test.js +1 -1
  46. package/tests/pages/advanced.html +1 -1
  47. package/tests/pages/anyof-2.html +1 -0
  48. package/tests/pages/anyof.html +4 -2
  49. package/tests/pages/array-anyof.html +5 -2
  50. package/tests/pages/array-checkboxes-infotext.html +5 -2
  51. package/tests/pages/array-checkboxes.html +5 -2
  52. package/tests/pages/array-choices.html +5 -2
  53. package/tests/pages/array-events-table.html +5 -2
  54. package/tests/pages/array-events.html +7 -3
  55. package/tests/pages/array-header-template.html +1 -0
  56. package/tests/pages/array-integers.html +5 -2
  57. package/tests/pages/array-multiselects.html +5 -2
  58. package/tests/pages/array-nested-arrays.html +5 -2
  59. package/tests/pages/array-numbers.html +5 -2
  60. package/tests/pages/array-objects.html +5 -2
  61. package/tests/pages/array-ratings.html +5 -2
  62. package/tests/pages/array-selectize-create.html +1 -0
  63. package/tests/pages/array-selectize.html +5 -2
  64. package/tests/pages/array-selects.html +5 -2
  65. package/tests/pages/array-strings.html +5 -2
  66. package/tests/pages/array-table-responsive.html +1 -0
  67. package/tests/pages/array-unique-items-sort.html +5 -2
  68. package/tests/pages/array.html +5 -2
  69. package/tests/pages/autocomplete.html +3 -1
  70. package/tests/pages/button-callbacks.html +4 -2
  71. package/tests/pages/button-icons.html +2 -1
  72. package/tests/pages/button_state_mode_1.html +1 -0
  73. package/tests/pages/button_state_mode_2.html +1 -0
  74. package/tests/pages/checkbox-labels.html +4 -2
  75. package/tests/pages/colorpicker-no-3rd-party.html +4 -2
  76. package/tests/pages/colorpicker-use-vanilla-picker.html +4 -2
  77. package/tests/pages/container-attributes.html +1 -0
  78. package/tests/pages/contains.html +1 -0
  79. package/tests/pages/core.html +5 -3
  80. package/tests/pages/datetime.html +2 -0
  81. package/tests/pages/dependentRequired.html +1 -0
  82. package/tests/pages/dependentSchemas.html +1 -0
  83. package/tests/pages/disable-button-in-object-editors.html +1 -0
  84. package/tests/pages/error-messages.html +1 -0
  85. package/tests/pages/form-name.html +4 -1
  86. package/tests/pages/grid-strict.html +3 -2
  87. package/tests/pages/grid.html +3 -2
  88. package/tests/pages/if-else.html +1 -0
  89. package/tests/pages/if-then-else-allOf.html +1 -0
  90. package/tests/pages/if-then-else-disable-fields.html +1 -0
  91. package/tests/pages/if-then-else.html +1 -0
  92. package/tests/pages/if-then.html +1 -0
  93. package/tests/pages/inheritance.html +6 -2
  94. package/tests/pages/integer.html +4 -2
  95. package/tests/pages/issues/_template.html +1 -1
  96. package/tests/pages/issues/issue-gh-1158-2.html +1 -1
  97. package/tests/pages/issues/issue-gh-1158.html +1 -1
  98. package/tests/pages/issues/issue-gh-1364.html +1 -1
  99. package/tests/pages/issues/issue-gh-1367.html +1 -1
  100. package/tests/pages/issues/issue-gh-1471.html +49 -0
  101. package/tests/pages/issues/issue-gh-812.html +3 -2
  102. package/tests/pages/issues/issue-gh-823-meta-schema.html +1 -1
  103. package/tests/pages/issues/issue-gh-848.html +1 -1
  104. package/tests/pages/keep_only_existing_values.html +1 -0
  105. package/tests/pages/load-events.html +1 -0
  106. package/tests/pages/maxContains.html +1 -0
  107. package/tests/pages/meta-schema.html +4 -0
  108. package/tests/pages/meta_schema.json +3 -0
  109. package/tests/pages/minContains.html +1 -0
  110. package/tests/pages/number.html +4 -2
  111. package/tests/pages/object-case-sensitive-property-search-false.html +2 -1
  112. package/tests/pages/object-case-sensitive-property-search-true.html +2 -1
  113. package/tests/pages/object-no-additional-properties.html +5 -2
  114. package/tests/pages/object-no-duplicated-id.html +2 -0
  115. package/tests/pages/object-required-properties.html +5 -3
  116. package/tests/pages/object-show-opt-in.html +3 -2
  117. package/tests/pages/object-with-dependencies-array.html +4 -2
  118. package/tests/pages/object-with-dependencies.html +2 -0
  119. package/tests/pages/object.html +5 -3
  120. package/tests/pages/oneof-2.html +1 -0
  121. package/tests/pages/oneof.html +4 -2
  122. package/tests/pages/option-dependencies.html +1 -0
  123. package/tests/pages/option-no_default_values.html +4 -2
  124. package/tests/pages/per-editor-options.html +1 -1
  125. package/tests/pages/programmatic-changes.html +4 -3
  126. package/tests/pages/range.html +4 -2
  127. package/tests/pages/read-only.html +36 -5
  128. package/tests/pages/ready.html +2 -1
  129. package/tests/pages/references.html +1 -1
  130. package/tests/pages/select.html +4 -3
  131. package/tests/pages/stepper-manual.html +4 -2
  132. package/tests/pages/stepper.html +4 -2
  133. package/tests/pages/string-ace-editor.html +4 -2
  134. package/tests/pages/string-cleave.html +4 -2
  135. package/tests/pages/string-custom-attributes.html +4 -2
  136. package/tests/pages/string-formats.html +4 -2
  137. package/tests/pages/string-formats2.html +4 -2
  138. package/tests/pages/string-jodit-editor.html +4 -2
  139. package/tests/pages/string-sceditor.html +4 -2
  140. package/tests/pages/string-simplemde-editor.html +4 -2
  141. package/tests/pages/table.html +4 -2
  142. package/tests/pages/tabs.html +1 -1
  143. package/tests/pages/themes.html +38 -52
  144. package/tests/pages/title-hidden.html +75 -0
  145. package/tests/pages/translate-property.html +2 -1
  146. package/tests/pages/urn.html +4 -2
  147. package/tests/pages/use-name-attributes.html +2 -1
  148. package/tests/pages/uuid.html +2 -0
  149. package/tests/pages/validation.html +2 -1
@@ -8,43 +8,34 @@
8
8
  <link rel='stylesheet' id='iconlib_stylesheet'>
9
9
  </head>
10
10
  <body>
11
- <div>
12
- <label>theme</label>
13
- <select id='theme_switcher' name="theme" class='form-control browser-default'>
14
- <option value=''></option>
15
- <option value='barebones'>Barebones</option>
16
- <option value='bootstrap2'>Bootstrap 2</option>
17
- <option value='bootstrap3'>Bootstrap 3</option>
18
- <option value='bootstrap4'>Bootstrap 4</option>
19
- <option value='bootstrap5'>Bootstrap 5</option>
20
- <option value='foundation3'>Foundation 3</option>
21
- <option value='foundation4'>Foundation 4</option>
22
- <option value='foundation5'>Foundation 5</option>
23
- <option value='foundation6'>Foundation 6</option>
24
- <option value='html'>HTML</option>
25
- <option value='jqueryui'>jQuery UI</option>
26
- <option value='materialize'>Materialize</option>
27
- <option value='spectre'>Spectre</option>
28
- </select>
29
- </div>
30
- <div>
31
- <label>iconlib</label>
32
- <select id='iconlib_switcher' name="iconlib" class='form-control browser-default'>
33
- <option value=''></option>
34
- <option value='bootstrap2'>Bootstrap 2</option>
35
- <option value='bootstrap3'>Bootstrap 3</option>
36
- <option value='fontawesome3'>fontawesome 3</option>
37
- <option value='fontawesome4'>fontawesome 4</option>
38
- <option value='fontawesome5'>fontawesome 5</option>
39
- <option value='foundation3'>Foundation 3</option>
40
- <option value='jqueryui'>jQuery UI</option>
41
- <option value='materialicons'>Material icons</option>
42
- <option value='openiconic'>Open Iconic</option>
43
- <option value='spectre'>Spectre</option>
44
- <option value='bootstrap'>Bootstrap Icons</option>
45
- </select>
46
- </div>
47
11
  <div class="container">
12
+ <h1>Themes</h1>
13
+ <div>
14
+ <label for="theme_switcher">theme</label>
15
+ <select id="theme_switcher" name="theme" class="form-control browser-default">
16
+ <option value=''></option>
17
+ <option value='barebones'>Barebones</option>
18
+ <option value='bootstrap3'>Bootstrap 3</option>
19
+ <option value='bootstrap4'>Bootstrap 4</option>
20
+ <option value='bootstrap5'>Bootstrap 5</option>
21
+ <option value='html'>HTML</option>
22
+ <option value='spectre'>Spectre</option>
23
+ </select>
24
+ </div>
25
+ <div>
26
+ <label for="iconlib_switcher">iconlib</label>
27
+ <select id="iconlib_switcher" name="iconlib" class="form-control browser-default">
28
+ <option value=''></option>
29
+ <option value='bootstrap3'>Bootstrap 3</option>
30
+ <option value='fontawesome3'>fontawesome 3</option>
31
+ <option value='fontawesome4'>fontawesome 4</option>
32
+ <option value='fontawesome5'>fontawesome 5</option>
33
+ <option value='jqueryui'>jQuery UI</option>
34
+ <option value='openiconic'>Open Iconic</option>
35
+ <option value='spectre'>Spectre</option>
36
+ <option value='bootstrap'>Bootstrap Icons</option>
37
+ </select>
38
+ </div>
48
39
  <div id="json-editor-form"></div>
49
40
  </div>
50
41
  <script>
@@ -53,7 +44,7 @@
53
44
  "title": "Themes Test Page",
54
45
  "properties": {
55
46
  "caseinfo": {
56
- "type": "info",
47
+ "format": "info",
57
48
  "title": "Layout test cases",
58
49
  "description": "This test case was made to help create or update themes for JSON-Editor 2.x version. It shows the available standard elements with all displayable options enabled, such as description and infoText. The buttons/select at the top of the form shows how to toggle various theme specific options.<br><br>Note: If you use this with the 1.x version, some of the fields might not be displayed correctly."
59
50
  },
@@ -104,7 +95,7 @@
104
95
  "properties": {
105
96
  "stringinput": {
106
97
  "type": "string",
107
- "title": "String input field with description and infoText",
98
+ "title": "String",
108
99
  "description": "String input field with description and infoText.",
109
100
  "options": {
110
101
  "infoText": "This field is generated by src/editors/string.js",
@@ -116,7 +107,7 @@
116
107
  },
117
108
  "numberinput": {
118
109
  "type": "number",
119
- "title": "Number input field with description and infoText",
110
+ "title": "Number",
120
111
  "description": "Number input field with description and infoText.",
121
112
  "options": {
122
113
  "infoText": "This field is generated by src/editors/number.js",
@@ -128,7 +119,7 @@
128
119
  },
129
120
  "integerinput": {
130
121
  "type": "integer",
131
- "title": "Integer input field with description and infoText",
122
+ "title": "Integer",
132
123
  "description": "Text input field with description and infoText.",
133
124
  "options": {
134
125
  "infoText": "This field is generated by src/editors/integer.js",
@@ -141,7 +132,7 @@
141
132
  "rangeinput": {
142
133
  "type": "integer",
143
134
  "format": "range",
144
- "title": "Range input field with description and infoText (Integer)",
135
+ "title": "Range (Integer)",
145
136
  "description": "Range input field with description and infoText. (Integer)",
146
137
  "options": {
147
138
  "infoText": "This field is generated by src/editors/integer.js",
@@ -151,7 +142,7 @@
151
142
  "textareainput": {
152
143
  "type": "string",
153
144
  "format": "textarea",
154
- "title": "Textarea input field with description and infoText",
145
+ "title": "Textarea",
155
146
  "description": "Textarea input field with description and infoText.",
156
147
  "options": {
157
148
  "infoText": "This field is generated by src/editors/string.js",
@@ -164,7 +155,7 @@
164
155
  "booleancheckbox": {
165
156
  "type": "boolean",
166
157
  "format": "checkbox",
167
- "title": "Boolean checkbox input field with description and infoText",
158
+ "title": "Boolean checkbox",
168
159
  "description": "Boolean checkbox input field with description and infoText.",
169
160
  "default": true,
170
161
  "options": {
@@ -174,7 +165,7 @@
174
165
  },
175
166
  "select": {
176
167
  "type": "string",
177
- "title": "Select input field with description and infoText",
168
+ "title": "Select",
178
169
  "description": "Select input field with description and infoText.",
179
170
  "enum": [
180
171
  "1",
@@ -194,7 +185,7 @@
194
185
  "radio": {
195
186
  "type": "string",
196
187
  "format": "radio",
197
- "title": "Radio input field with description and infoText",
188
+ "title": "Radio",
198
189
  "description": "Radio input field with description and infoText",
199
190
  "enum": [
200
191
  "Red",
@@ -210,7 +201,7 @@
210
201
  "type": "array",
211
202
  "format": "select",
212
203
  "uniqueItems": true,
213
- "title": "Multiselect input field with description and infoText - format: select",
204
+ "title": "Multiselect - format: select",
214
205
  "description": "Multiselect input field with description and infoText. - format: select",
215
206
  "items": {
216
207
  "type": "string",
@@ -229,7 +220,7 @@
229
220
  "type": "array",
230
221
  "format": "checkbox",
231
222
  "uniqueItems": true,
232
- "title": "Multiselect input field with description and infoText - format: checkbox",
223
+ "title": "Multiselect - format: checkbox",
233
224
  "description": "Multiselect input field with description and infoText. - format: checkbox",
234
225
  "items": {
235
226
  "type": "string",
@@ -463,12 +454,9 @@
463
454
  const initJsoneditor = (theme, iconlib) => {
464
455
 
465
456
  if (jsoneditor) {
466
- console.log('...destroy jsoneditor')
467
457
  jsoneditor.destroy();
468
458
  }
469
459
 
470
- console.log('...init jsoneditor', theme, iconlib)
471
-
472
460
  jsoneditor = new window.JSONEditor(document.querySelector("#json-editor-form"), {
473
461
  schema: schema,
474
462
  remove_button_labels: true,
@@ -523,9 +511,7 @@
523
511
  initJsoneditor(theme, iconlib)
524
512
  });
525
513
 
526
-
527
514
  initJsoneditor()
528
-
529
515
  </script>
530
516
  </body>
531
517
  </html>
@@ -0,0 +1,75 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8"/>
5
+ <title>Ready</title>
6
+ <link rel="stylesheet" id="theme-link" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
7
+ <link rel="stylesheet" id="iconlib-link" href="https://use.fontawesome.com/releases/v5.6.1/css/all.css">
8
+ <script src="../../dist/jsoneditor.js"></script>
9
+ </head>
10
+ <body>
11
+
12
+ <div class="container">
13
+ <h1>Test</h1>
14
+ <div class='json-editor-container'></div>
15
+ </div>
16
+
17
+ <script>
18
+ var jsonEditorContainer = document.querySelector('.json-editor-container');
19
+
20
+ var schema = {
21
+ "type": "object",
22
+ "options": {
23
+ "titleHidden": true
24
+ },
25
+ "properties": {
26
+ "boolean": {
27
+ "title": "boolean",
28
+ "type": "boolean",
29
+ "options": {
30
+ "titleHidden": true
31
+ }
32
+ },
33
+ "integer": {
34
+ "title": "integer",
35
+ "type": "integer",
36
+ "options": {
37
+ "titleHidden": true
38
+ }
39
+ },
40
+ "number": {
41
+ "title": "number",
42
+ "type": "number",
43
+ "options": {
44
+ "titleHidden": true
45
+ }
46
+ },
47
+ "string": {
48
+ "title": "string",
49
+ "type": "string",
50
+ "options": {
51
+ "titleHidden": true
52
+ }
53
+ },
54
+ "array": {
55
+ "title": "array",
56
+ "type": "array",
57
+ "options": {
58
+ "titleHidden": true
59
+ }
60
+ }
61
+ }
62
+ }
63
+
64
+ var editor = new JSONEditor(jsonEditorContainer, {
65
+ schema: schema,
66
+ theme: 'bootstrap4',
67
+ disable_collapse: true,
68
+ disable_edit_json: true,
69
+ disable_properties: true
70
+ });
71
+
72
+ </script>
73
+
74
+ </body>
75
+ </html>
@@ -1,5 +1,5 @@
1
1
  <!DOCTYPE html>
2
- <html>
2
+ <html lang="en">
3
3
  <head>
4
4
  <meta charset="utf-8"/>
5
5
  <title>translate property</title>
@@ -10,6 +10,7 @@
10
10
  <body>
11
11
 
12
12
  <div class="container">
13
+ <h1>Test</h1>
13
14
  <div class='json-editor-container'></div>
14
15
  </div>
15
16
 
@@ -1,5 +1,5 @@
1
1
  <!DOCTYPE html>
2
- <html>
2
+ <html lang="en">
3
3
  <head>
4
4
  <meta charset="utf-8"/>
5
5
  <title>URN</title>
@@ -10,7 +10,9 @@
10
10
  </head>
11
11
  <body>
12
12
 
13
- <textarea class="value" cols="30" rows="10"></textarea>
13
+ <h1>Test</h1>
14
+ <label for="value">Value</label>
15
+ <textarea id="value" class="value" cols="30" rows="10"></textarea>
14
16
  <button class='get-value'>Get Value</button>
15
17
  <button class='set-value'>Set Value</button>
16
18
  <div class='json-editor-container'></div>
@@ -1,11 +1,12 @@
1
1
  <!DOCTYPE html>
2
- <html>
2
+ <html lang="en">
3
3
  <head>
4
4
  <meta charset="utf-8"/>
5
5
  <title>Use name attributes</title>
6
6
  <script src="../../dist/jsoneditor.js"></script>
7
7
  </head>
8
8
  <body>
9
+ <h1>Test</h1>
9
10
  <div class='container'></div>
10
11
  <script>
11
12
  var schema = {
@@ -11,7 +11,9 @@
11
11
  <body>
12
12
 
13
13
  <div class="container">
14
+ <h1>Test</h1>
14
15
  <div class="form-group">
16
+ <label for="value">Value</label>
15
17
  <textarea id="value" class="form-control" rows="10"></textarea>
16
18
  </div>
17
19
  <button id="get-value" class='btn btn-secondary'>get value</button>
@@ -1,5 +1,5 @@
1
1
  <!DOCTYPE html>
2
- <html>
2
+ <html lang="en">
3
3
  <head>
4
4
  <meta charset="utf-8" />
5
5
  <title>JSON Editor Validation Example</title>
@@ -9,6 +9,7 @@
9
9
  </head>
10
10
 
11
11
  <body>
12
+ <h1>Test</h1>
12
13
  <div id='output'></div>
13
14
  <script>
14
15
  var validate = function (tests) {