@json-editor/json-editor 2.15.2 → 2.15.3

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.
@@ -24,7 +24,7 @@
24
24
  Try yourself, submit the form and look in the network tab of the developer tool.
25
25
  </p>
26
26
  <div class="form-group"></div>
27
- <form action="/docs/form-submission.html" method="get">
27
+ <form method="get">
28
28
  <input id="input" type="hidden" name="json">
29
29
  <div id='editor-container'></div>
30
30
  <input id="submit" class="btn btn-primary" width="100" type="submit">
package/docs/index.html CHANGED
@@ -10,9 +10,27 @@
10
10
  <script src="./scripts/ajv-validator.js"></script>
11
11
  <link rel='stylesheet' id='theme-link'>
12
12
  <link rel='stylesheet' id='iconlib-link'>
13
+ <style>
14
+ .maintenance-notice {
15
+ background-color: #fff3cd;
16
+ border: 1px solid #ffeaa7;
17
+ border-radius: 4px;
18
+ padding: 12px 16px;
19
+ margin-bottom: 20px;
20
+ color: #856404;
21
+ }
22
+ .maintenance-notice a {
23
+ color: #533102;
24
+ text-decoration: underline;
25
+ }
26
+ </style>
13
27
  </head>
14
28
  <body>
15
29
  <div class="container grid-xl" style="padding-top: 15px; padding-bottom: 30px;">
30
+ <div class="maintenance-notice">
31
+ <strong>Maintenance Mode:</strong> This library is in maintenance mode.
32
+ For active development, consider <a href="https://github.com/germanbisurgi/jedison" target="_blank">Jedison</a>.
33
+ </div>
16
34
  <div class="row columns md:flex">
17
35
  <div class='col-7 col-md-7 w-7/12'>
18
36
  <h1>Editor</h1>
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@json-editor/json-editor",
3
3
  "title": "JSONEditor",
4
4
  "description": "JSON Schema based editor",
5
- "version": "2.15.2",
5
+ "version": "2.15.3",
6
6
  "main": "dist/jsoneditor.js",
7
7
  "author": {
8
8
  "name": "Jeremy Dorn",
package/src/editor.js CHANGED
@@ -176,7 +176,7 @@ export class AbstractEditor {
176
176
  const editor = this.jsoneditor.getEditor(path)
177
177
  const value = editor ? editor.getValue() : undefined
178
178
 
179
- if (!editor || !editor.dependenciesFulfilled || !value) {
179
+ if (!editor || !editor.dependenciesFulfilled || value === undefined || value === null) {
180
180
  this.dependenciesFulfilled = false
181
181
  } else if (Array.isArray(choices)) {
182
182
  this.dependenciesFulfilled = choices.some(choice => {
@@ -0,0 +1,15 @@
1
+ /* global Feature Scenario */
2
+
3
+ Feature('issues')
4
+
5
+ Scenario('GitHub issue 1559 should remain fixed @issue-1559', async ({ I }) => {
6
+ I.amOnPage('issues/issue-gh-1559.html')
7
+ I.waitForElement('.je-ready')
8
+ I.dontSeeElement('[data-schemapath="root.dependent_on_false"]')
9
+ I.click('[data-schemapath="root.dependent_on_true"] input')
10
+ I.waitForElement('[data-schemapath="root.dependent_on_false"]', 2)
11
+ I.seeElement('[data-schemapath="root.dependent_on_false"]')
12
+ I.click('[data-schemapath="root.dependent_on_true"] input')
13
+ I.waitForInvisible('[data-schemapath="root.dependent_on_false"]', 2)
14
+ I.dontSeeElement('[data-schemapath="root.dependent_on_false"]')
15
+ })
@@ -0,0 +1,68 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8"/>
5
+ <title>GitHub Issue 1559 - Dependencies with false values not fulfilled</title>
6
+ <script src="../../../dist/jsoneditor.js"></script>
7
+ <link rel="stylesheet" id="theme-link" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/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
+ <h1>Test - Dependencies with false values not fulfilled</h1>
14
+ <p>When <code>dependent_on_true</code> is unchecked (false), the <code>dependent_on_false</code> field should appear. This tests GitHub issue #1559 - dependencies with false values not being fulfilled.</p>
15
+ <div id='editor-container'></div>
16
+ </div>
17
+
18
+ <script>
19
+ var editorContainer = document.querySelector('#editor-container')
20
+ var schema = {
21
+ "type": "object",
22
+ "title": "Test configuration",
23
+ "description": "Test configuration for dependencies with false values (GitHub issue #1559)",
24
+ "properties": {
25
+ "master_field": {
26
+ "type": "boolean",
27
+ "title": "Master field",
28
+ "format": "checkbox",
29
+ "description": "Master toggle field.",
30
+ "default": true
31
+ },
32
+ "dependent_on_true": {
33
+ "type": "boolean",
34
+ "format": "checkbox",
35
+ "title": "Dependent on true",
36
+ "description": "This field depends on master_field being true.",
37
+ "default": true,
38
+ "options": {
39
+ "dependencies": {
40
+ "master_field": true
41
+ }
42
+ }
43
+ },
44
+ "dependent_on_false": {
45
+ "type": "string",
46
+ "format": "password",
47
+ "title": "Dependent on false",
48
+ "description": "This field depends on dependent_on_true being false.",
49
+ "minLength": 1,
50
+ "options": {
51
+ "dependencies": {
52
+ "dependent_on_true": false
53
+ }
54
+ }
55
+ }
56
+ }
57
+ }
58
+
59
+ var editor = new JSONEditor(editorContainer, {
60
+ schema: schema,
61
+ theme: 'bootstrap4',
62
+ iconlib: 'fontawesome',
63
+ show_errors: 'always'
64
+ })
65
+ </script>
66
+
67
+ </body>
68
+ </html>
@@ -1,4 +0,0 @@
1
- version: '3'
2
- services:
3
- chrome:
4
- image: seleniarm/standalone-chromium:114.0