@json-editor/json-editor 2.15.0 → 2.15.2

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 (68) hide show
  1. package/.env +0 -4
  2. package/.github/workflows/build.yml +5 -5
  3. package/CHANGELOG.md +19 -0
  4. package/README.md +16 -0
  5. package/config/codeceptjs_helpers.js +11 -0
  6. package/dist/jsoneditor.js +1 -1
  7. package/dist/jsoneditor.js.LICENSE.txt +1 -1
  8. package/dist/nonmin/jsoneditor.js +502 -152
  9. package/dist/nonmin/jsoneditor.js.map +1 -1
  10. package/package.json +1 -1
  11. package/src/core.js +11 -0
  12. package/src/defaults.js +2 -1
  13. package/src/editor.js +26 -15
  14. package/src/editors/ace.js +1 -0
  15. package/src/editors/array/choices.js +1 -0
  16. package/src/editors/array/select2.js +2 -0
  17. package/src/editors/array/selectize.js +2 -0
  18. package/src/editors/array.js +81 -0
  19. package/src/editors/base64.js +2 -0
  20. package/src/editors/checkbox.js +13 -1
  21. package/src/editors/choices.js +2 -0
  22. package/src/editors/colorpicker.js +2 -0
  23. package/src/editors/datetime.js +2 -0
  24. package/src/editors/describedby.js +2 -0
  25. package/src/editors/enum.js +3 -1
  26. package/src/editors/hidden.js +2 -0
  27. package/src/editors/jodit.js +2 -0
  28. package/src/editors/multiple.js +2 -0
  29. package/src/editors/multiselect.js +2 -0
  30. package/src/editors/object.js +10 -3
  31. package/src/editors/radio.js +2 -0
  32. package/src/editors/sceditor.js +2 -0
  33. package/src/editors/select.js +9 -4
  34. package/src/editors/select2.js +2 -0
  35. package/src/editors/selectize.js +2 -0
  36. package/src/editors/signature.js +2 -0
  37. package/src/editors/simplemde.js +3 -1
  38. package/src/editors/starrating.js +2 -0
  39. package/src/editors/string.js +2 -0
  40. package/src/editors/table.js +19 -2
  41. package/src/editors/upload.js +2 -0
  42. package/src/editors/uuid.js +2 -0
  43. package/src/resolvers.js +1 -1
  44. package/src/theme.js +23 -0
  45. package/src/themes/bootstrap3.css +53 -0
  46. package/src/themes/bootstrap3.css.js +1 -1
  47. package/src/themes/bootstrap3.js +30 -0
  48. package/src/themes/bootstrap4.js +27 -0
  49. package/src/themes/bootstrap5.js +28 -0
  50. package/src/themes/spectre.js +28 -0
  51. package/src/themes/tailwind.css +54 -0
  52. package/src/themes/tailwind.css.js +1 -1
  53. package/src/themes/tailwind.js +26 -0
  54. package/tests/codeceptjs/core_test.js +28 -0
  55. package/tests/codeceptjs/editors/integer_test.js +3 -1
  56. package/tests/codeceptjs/editors/multiple_test.js +27 -0
  57. package/tests/codeceptjs/editors/select_test.js +12 -0
  58. package/tests/codeceptjs/issues/issue-gh-1562_test.js +12 -0
  59. package/tests/codeceptjs/issues/issue-gh-1586_test.js +15 -0
  60. package/tests/docker-compose-local.yml +2 -1
  61. package/tests/pages/editor-show-validation-errors.html +54 -0
  62. package/tests/pages/enforce-const.html +10 -18
  63. package/tests/pages/integer.html +9 -10
  64. package/tests/pages/issues/issue-gh-1562.html +170 -0
  65. package/tests/pages/issues/issue-gh-1586.html +48 -0
  66. package/tests/pages/opt-in-widget.html +134 -0
  67. package/tests/pages/select-values.html +91 -0
  68. package/tests/pages/switcher-option.html +69 -0
@@ -0,0 +1,69 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8"/>
5
+ <title>switcher-option</title>
6
+ <script src="../../dist/jsoneditor.js"></script>
7
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css">
8
+ <link rel="stylesheet" id="iconlib-link" href="https://use.fontawesome.com/releases/v5.6.1/css/all.css">
9
+ </head>
10
+ <body>
11
+
12
+ <div class="container">
13
+ <div id='editor-container'></div>
14
+ <div class="form-group">
15
+ <label for="textarea-value">Value</label>
16
+ <textarea class="form-control" id="textarea-value" cols="30" rows="30"></textarea>
17
+ </div>
18
+ </div>
19
+
20
+ <script>
21
+ const editorContainer = document.querySelector('#editor-container')
22
+ const schema = {
23
+ "title": "Register",
24
+ "type": "object",
25
+ "properties": {
26
+ "name": {
27
+ "title": "Name",
28
+ "type": "string",
29
+ "options": {
30
+ "switcher": false,
31
+ "error_messages": {
32
+ "en": {
33
+ "error_oneOf": "If provided, value must be at least 4 and at most 10",
34
+ "error_anyOf": "If provided, value must be at least 4 and at most 10"
35
+ }
36
+ }
37
+ },
38
+ "anyOf": [
39
+ {
40
+ "const": ""
41
+ },
42
+ {
43
+ "minLength": 4,
44
+ "maxLength": 10
45
+ }
46
+ ]
47
+ }
48
+ }
49
+ }
50
+
51
+ const editor = new JSONEditor(editorContainer, {
52
+ schema: schema,
53
+ theme: 'bootstrap4',
54
+ iconlib: 'fontawesome',
55
+ show_errors: 'always',
56
+ disable_collapse: true,
57
+ disable_edit_json: true,
58
+ disable_properties: true
59
+ })
60
+
61
+ const textareaValue = document.querySelector('#textarea-value')
62
+
63
+ editor.on('change', function () {
64
+ textareaValue.value = JSON.stringify(editor.getValue(), null, 2)
65
+ })
66
+ </script>
67
+
68
+ </body>
69
+ </html>