@json-editor/json-editor 2.9.0 → 2.10.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 (106) hide show
  1. package/.github/workflows/build.yml +2 -0
  2. package/CHANGELOG.md +29 -7
  3. package/README.md +47 -1
  4. package/config/codeceptjs_helpers.js +4 -8
  5. package/config/karma.conf.js +0 -4
  6. package/config/webpack.common.js +1 -1
  7. package/config/webpack.dev.js +1 -1
  8. package/config/webpack.nonmin.js +1 -1
  9. package/config/webpack.prod.js +0 -1
  10. package/dist/dev/jsoneditor.js +3687 -0
  11. package/dist/jsoneditor.js +2 -14
  12. package/dist/jsoneditor.js.LICENSE.txt +1 -1
  13. package/dist/jsoneditor.js.map +1 -1
  14. package/dist/nonmin/jsoneditor.js +25744 -26450
  15. package/dist/nonmin/jsoneditor.js.map +1 -1
  16. package/docs/css_integration.html +17 -15
  17. package/docs/custom-editor.html +92 -0
  18. package/docs/datetime.html +37 -2
  19. package/docs/index.html +4 -1
  20. package/docs/meta_schema.json +426 -398
  21. package/package.json +26 -24
  22. package/src/defaults.js +15 -1
  23. package/src/editor.js +23 -6
  24. package/src/editors/integer.js +5 -3
  25. package/src/editors/multiple.js +67 -8
  26. package/src/editors/number.js +5 -3
  27. package/src/editors/object.js +0 -1
  28. package/src/editors/radio.js +4 -6
  29. package/src/editors/select.js +0 -6
  30. package/src/iconlibs/bootstrap.js +28 -0
  31. package/src/iconlibs/index.js +2 -0
  32. package/src/resolvers.js +5 -2
  33. package/src/schemaloader.js +3 -1
  34. package/src/themes/bootstrap3.js +1 -1
  35. package/src/utilities.js +22 -0
  36. package/src/validator.js +93 -0
  37. package/tests/codeceptjs/constrains/contains_test.js +36 -0
  38. package/tests/codeceptjs/constrains/dependentSchemas_test.js +15 -0
  39. package/tests/codeceptjs/constrains/if-then-else_test.js +143 -0
  40. package/tests/codeceptjs/core_test.js +46 -46
  41. package/tests/codeceptjs/editors/advanced_test.js +12 -11
  42. package/tests/codeceptjs/editors/array_any_of_test.js +37 -37
  43. package/tests/codeceptjs/editors/array_test.js +784 -794
  44. package/tests/codeceptjs/editors/autocomplete_test.js +4 -6
  45. package/tests/codeceptjs/editors/button_test.js +30 -29
  46. package/tests/codeceptjs/editors/checkbox_test.js +19 -18
  47. package/tests/codeceptjs/editors/colorpicker_test.js +20 -18
  48. package/tests/codeceptjs/editors/datetime_test.js +11 -11
  49. package/tests/codeceptjs/editors/inheritance_test.js +8 -9
  50. package/tests/codeceptjs/editors/integer_test.js +77 -78
  51. package/tests/codeceptjs/editors/jodit_test.js +18 -19
  52. package/tests/codeceptjs/editors/multiselect_test.js +6 -6
  53. package/tests/codeceptjs/editors/number_test.js +72 -71
  54. package/tests/codeceptjs/editors/object_test.js +52 -26
  55. package/tests/codeceptjs/editors/option-no_default_values_test.js +6 -6
  56. package/tests/codeceptjs/editors/programmatic-changes_test.js +4 -5
  57. package/tests/codeceptjs/editors/radio_test.js +1 -1
  58. package/tests/codeceptjs/editors/range_test.js +2 -4
  59. package/tests/codeceptjs/editors/rating_test.js +1 -1
  60. package/tests/codeceptjs/editors/select_test.js +5 -7
  61. package/tests/codeceptjs/editors/stepper_test.js +8 -10
  62. package/tests/codeceptjs/editors/string_test.js +16 -16
  63. package/tests/codeceptjs/editors/table-confirm-delete_test.js +11 -13
  64. package/tests/codeceptjs/editors/tabs_test.js +1 -1
  65. package/tests/codeceptjs/editors/uuid_test.js +15 -15
  66. package/tests/codeceptjs/editors/validation_test.js +2 -2
  67. package/tests/codeceptjs/issues/issue-gh-1133_test.js +9 -0
  68. package/tests/codeceptjs/issues/issue-gh-1158-2_test.js +10 -0
  69. package/tests/codeceptjs/{editors/issues → issues}/issue-gh-1158_test.js +1 -3
  70. package/tests/codeceptjs/issues/issue-gh-1164_test.js +10 -0
  71. package/tests/codeceptjs/issues/issue-gh-1211_test.js +17 -0
  72. package/tests/codeceptjs/{editors/issues → issues}/issue-gh-1257_test.js +3 -5
  73. package/tests/codeceptjs/issues/issue-gh-1338_test.js +16 -0
  74. package/tests/codeceptjs/issues/issue-gh-1347_test.js +8 -0
  75. package/tests/codeceptjs/issues/issue-gh-795_test.js +13 -0
  76. package/tests/codeceptjs/issues/issue-gh-810_test.js +52 -0
  77. package/tests/codeceptjs/issues/issue-gh-812_test.js +25 -0
  78. package/tests/codeceptjs/meta-schema_test.js +12 -12
  79. package/tests/codeceptjs/schemaloader_test.js +8 -8
  80. package/tests/codeceptjs/themes_test.js +40 -9
  81. package/tests/pages/autocomplete.html +1 -0
  82. package/tests/pages/contains.html +38 -0
  83. package/tests/pages/dependentSchemas.html +52 -0
  84. package/tests/pages/if-else.html +57 -0
  85. package/tests/pages/if-then-else-allOf.html +117 -0
  86. package/tests/pages/if-then-else.html +64 -0
  87. package/tests/pages/if-then.html +57 -0
  88. package/tests/pages/issues/issue-gh-1133.html +64 -0
  89. package/tests/pages/issues/issue-gh-1158-2.html +189 -0
  90. package/tests/pages/issues/issue-gh-1164.html +71 -0
  91. package/tests/pages/issues/issue-gh-1165.html +63 -0
  92. package/tests/pages/issues/issue-gh-1165.json +8 -0
  93. package/tests/pages/issues/issue-gh-1211.html +1022 -0
  94. package/tests/pages/issues/issue-gh-1338.html +74 -0
  95. package/tests/pages/issues/issue-gh-1347.html +142 -0
  96. package/tests/pages/issues/issue-gh-795.html +58 -0
  97. package/tests/pages/issues/issue-gh-810.html +149 -0
  98. package/tests/pages/maxContains.html +39 -0
  99. package/tests/pages/meta-schema.html +28 -0
  100. package/tests/pages/meta_schema.json +426 -398
  101. package/tests/pages/minContains.html +39 -0
  102. package/tests/pages/number.html +18 -0
  103. package/tests/pages/option-dependencies.html +106 -0
  104. package/tests/pages/themes.html +3 -1
  105. package/tests/unit/core.spec.js +8 -10
  106. package/tests/codeceptjs/editors/issues/issue-gh-812_test.js +0 -32
@@ -0,0 +1,9 @@
1
+ /* global Feature Scenario */
2
+
3
+ Feature('GitHub issue 1133')
4
+
5
+ Scenario('GitHub issue 1133 should remain fixed @issue-1133', async ({ I }) => {
6
+ I.amOnPage('issues/issue-gh-1133.html')
7
+ I.waitForElement('.je-ready')
8
+ I.waitForValue('#value', '{"SaveDataMask":"DP"}')
9
+ })
@@ -0,0 +1,10 @@
1
+ /* global Feature Scenario */
2
+
3
+ Feature('issues')
4
+
5
+ Scenario('GitHub issue 1165 should remain fixed @issue-1165 @schemaloader', async ({ I }) => {
6
+ I.amOnPage('issues/issue-gh-1165.html')
7
+ I.waitForText('Add item')
8
+ I.click('Add item')
9
+ I.waitForText('external-schema')
10
+ })
@@ -1,10 +1,8 @@
1
1
  /* global Feature Scenario */
2
2
 
3
- const assert = require('assert')
4
-
5
3
  Feature('issues')
6
4
 
7
- Scenario('GitHub issue 1158 should remain fixed @issue-1158 @optional', async (I) => {
5
+ Scenario('GitHub issue 1158 should remain fixed @issue-1158 @optional', async ({ I }) => {
8
6
  I.amOnPage('issues/issue-gh-1158.html')
9
7
  I.seeElement('[name="root[name]"]')
10
8
  })
@@ -0,0 +1,10 @@
1
+ /* global Feature Scenario */
2
+
3
+ Feature('GitHub issue 1164')
4
+
5
+ Scenario('GitHub issue 1164 should remain fixed @issue-1164', ({ I }) => {
6
+ I.amOnPage('issues/issue-gh-1164.html')
7
+ I.waitForElement('.je-ready')
8
+ I.waitForInvisible('option[value="undefined"]')
9
+ I.waitForValue('#value', '{"arrayEnumSelect":["one"],"stringEnumRadio":"one","numberEnumRadio":1.1,"integerEnumRadio":1}')
10
+ })
@@ -0,0 +1,17 @@
1
+ /* global Feature Scenario */
2
+
3
+ Feature('issues')
4
+
5
+ Scenario('GitHub issue 1211 should remain fixed @issue-1211 @schemaloader', async ({ I }) => {
6
+ I.amOnPage('issues/issue-gh-1211.html')
7
+ I.waitForText('Rule collection')
8
+ I.waitForText('SSID & MAC Groups')
9
+ I.waitForText('Certificate Extensions')
10
+ I.click('Rule')
11
+ I.waitForText('Generic Allow Rule')
12
+ I.click('Group')
13
+ I.waitForText('Group 1')
14
+ I.click('Extension')
15
+ I.waitForText('OID')
16
+ I.waitForValue('#value', '{"rules":[{"type":"any","name":"","description":"","enabled":false}],"groups":[{"type":"ssid-group","ssid-group":[],"name":"","description":""}],"certificate-extensions":[{"name":"","oid":""}],"trustedroots":[],"intuneids":[]}')
17
+ })
@@ -1,13 +1,11 @@
1
1
  /* global Feature Scenario */
2
2
 
3
- const assert = require('assert')
4
-
5
3
  Feature('GitHub issue 1257')
6
4
 
7
- Scenario('GitHub issue 1257 should remain fixed @issue-1257', async (I) => {
5
+ Scenario('GitHub issue 1257 should remain fixed @issue-1257', async ({ I }) => {
8
6
  I.amOnPage('issues/issue-gh-1257.html')
9
7
  I.waitForElement('.je-ready')
10
8
  I.click('[data-schemapath="root.colors"] .json-editor-btntype-add')
11
- assert.equal(await I.grabValueFrom('#value'), '{"colors":[{"text":"X","color":"#fefaac"}],"color":"#fefaac"}')
12
- assert.equal(await I.grabValueFrom('[name="root[colors][0][color]"]'), '#fefaac')
9
+ I.waitForValue('#value', '{"colors":[{"text":"X","color":"#fefaac"}],"color":"#fefaac"}')
10
+ I.waitForValue('[name="root[colors][0][color]"]', '#fefaac')
13
11
  })
@@ -0,0 +1,16 @@
1
+ /* global Feature Scenario */
2
+
3
+ Feature('issues')
4
+
5
+ Scenario('GitHub issue 1338 should remain fixed @issue-1338', async ({ I }) => {
6
+ I.amOnPage('issues/issue-gh-1338.html')
7
+ I.waitForText('Value required')
8
+ I.fillField('[id="root[field_a]"]', 'test')
9
+ I.pressKey('Tab')
10
+ I.dontSee('Value required')
11
+ I.refreshPage()
12
+ I.waitForText('Value required')
13
+ I.fillField('[id="root[field_b]"]', 'test')
14
+ I.pressKey('Tab')
15
+ I.dontSee('Value required')
16
+ })
@@ -0,0 +1,8 @@
1
+ /* global Feature Scenario */
2
+
3
+ Feature('issues')
4
+
5
+ Scenario('GitHub issue 1347 should remain fixed @issue-1347', async ({ I }) => {
6
+ I.amOnPage('issues/issue-gh-1347.html')
7
+ I.waitForValue('#value', '{"caplzsone":[{"dateField1":"","amountField1":"","amountField2":"","amountField3":"","amountField4":""}],"caplzszero":[{"dateField1":"","amountField1":"9999","amountField2":"2222","amountField3":"3333","amountField4":"4444"},{"dateField1":"","amountField1":"6666","amountField2":"7777","amountField3":"8888","amountField4":"9999"}]}')
8
+ })
@@ -0,0 +1,13 @@
1
+ /* global Feature Scenario */
2
+
3
+ Feature('issues')
4
+
5
+ Scenario('GitHub issue 795 should remain fixed @issue-795 @schemaloader', async ({ I }) => {
6
+ I.amOnPage('issues/issue-gh-795.html')
7
+ I.waitForText('Add item')
8
+ I.click('Add item')
9
+ I.waitForText('box')
10
+ I.fillField('#value', JSON.stringify([[{}], {}]))
11
+ I.click('Set Value')
12
+ I.waitForValue('#value', '[[{}],{}]')
13
+ })
@@ -0,0 +1,52 @@
1
+ /* global Feature Scenario */
2
+
3
+ Feature('issues')
4
+
5
+ Scenario('GitHub issue 810 should remain fixed @issue-810', async ({ I }) => {
6
+ I.amOnPage('issues/issue-gh-810.html')
7
+ I.waitForText('I changed 1 times')
8
+ I.fillField('#value', JSON.stringify({
9
+ name: 'Jeremy Dorn',
10
+ age: 25,
11
+ favorite_color: '#ffa500',
12
+ gender: 'male',
13
+ date: '',
14
+ location: {
15
+ city: 'San Francisco',
16
+ state: 'CA',
17
+ citystate: 'San Francisco, CA'
18
+ },
19
+ pets: [
20
+ {
21
+ type: 'dog',
22
+ name: 'Walter'
23
+ },
24
+ {
25
+ type: 'dog',
26
+ name: 'Walter2'
27
+ }
28
+ ]
29
+ }))
30
+ I.click('#set-value')
31
+ I.waitForText('I changed 2 times')
32
+ I.fillField('#value', JSON.stringify({
33
+ name: 'Jeremy Dorn',
34
+ age: 25,
35
+ favorite_color: '#ffa500',
36
+ gender: 'male',
37
+ date: '',
38
+ location: {
39
+ city: 'San Francisco',
40
+ state: 'CA',
41
+ citystate: 'San Francisco, CA'
42
+ },
43
+ pets: [
44
+ {
45
+ type: 'dog',
46
+ name: 'Walter'
47
+ }
48
+ ]
49
+ }))
50
+ I.click('#set-value')
51
+ I.waitForText('I changed 3 times')
52
+ })
@@ -0,0 +1,25 @@
1
+ /* global Feature Scenario */
2
+
3
+ Feature('issues')
4
+
5
+ Scenario('GitHub issue 812 should remain fixed @issue-812', async ({ I }) => {
6
+ I.amOnPage('issues/issue-gh-812.html')
7
+ I.click('.get-value')
8
+ I.waitForValue('.debug', '{"students":[{"name":"AAA","sessions":[{"student_name":"AAA","minutes":15},{"student_name":"AAA","minutes":15}]},{"name":"BBB","sessions":[{"student_name":"BBB","minutes":20}]},{"name":"CCC","sessions":[{"student_name":"CCC","minutes":10}]}]}')
9
+
10
+ I.amAcceptingPopups()
11
+ I.click('//*[@id="root.students.0"]/span[2]/button[contains(@class, "json-editor-btn-delete") and @data-i="0"]')
12
+ I.retry({ retries: 5, minTimeout: 500 }).seeInPopup('Are you sure you want to remove this item?')
13
+ I.acceptPopup()
14
+
15
+ I.click('.get-value')
16
+ I.waitForValue('.debug', '{"students":[{"name":"BBB","sessions":[{"student_name":"BBB","minutes":20}]},{"name":"CCC","sessions":[{"student_name":"CCC","minutes":10}]}]}')
17
+
18
+ I.amAcceptingPopups()
19
+ I.click('//*[@id="root.students.0"]/span[2]/button[contains(@class, "json-editor-btn-delete") and @data-i="0"]')
20
+ I.retry({ retries: 5, minTimeout: 500 }).seeInPopup('Are you sure you want to remove this item?')
21
+ I.acceptPopup()
22
+
23
+ I.click('.get-value')
24
+ I.waitForValue('.debug', '{"students":[{"name":"CCC","sessions":[{"student_name":"CCC","minutes":10}]}]}')
25
+ })
@@ -1,15 +1,15 @@
1
1
  /* global Feature Scenario */
2
+
2
3
  const { DEFAULT_WAIT_TIME } = require('./test-config')
3
- var assert = require('assert')
4
4
 
5
5
  Feature('meta-schema')
6
6
 
7
- Scenario('work with json-schema meta-schema @meta-schema-core', async (I) => {
7
+ Scenario('work with json-schema meta-schema @meta-schema-core', async ({ I }) => {
8
8
  I.amOnPage('meta-schema.html')
9
9
  I.waitForElement('.je-ready')
10
10
 
11
11
  I.selectOption('.je-switcher', 'Object')
12
- assert.equal(await I.grabValueFrom('#value'), '{"properties":{},"title":"","type":"object"}')
12
+ I.waitForValue('#value', '{"properties":{},"title":"","type":"object"}')
13
13
  I.click('.json-editor-btn-edit_properties')
14
14
  I.waitForText('type', '.property-selector')
15
15
  I.waitForText('title', '.property-selector')
@@ -37,26 +37,26 @@ Scenario('work with json-schema meta-schema @meta-schema-core', async (I) => {
37
37
  I.waitForText('format', '.property-selector')
38
38
 
39
39
  I.selectOption('.je-switcher', 'Array')
40
- assert.equal(await I.grabValueFrom('#value'), '{"items":{"properties":{},"title":"","type":"object"},"title":"","type":"array"}')
40
+ I.waitForValue('#value', '{"items":{"properties":{},"title":"","type":"object"},"title":"","type":"array"}')
41
41
 
42
42
  I.selectOption('.je-switcher', 'String')
43
- assert.equal(await I.grabValueFrom('#value'), '{"title":"","type":"string"}')
43
+ I.waitForValue('#value', '{"title":"","type":"string"}')
44
44
 
45
45
  I.selectOption('.je-switcher', 'Number')
46
- assert.equal(await I.grabValueFrom('#value'), '{"title":"","type":"number"}')
46
+ I.waitForValue('#value', '{"title":"","type":"number"}')
47
47
 
48
48
  I.selectOption('.je-switcher', 'Integer')
49
- assert.equal(await I.grabValueFrom('#value'), '{"title":"","type":"integer"}')
49
+ I.waitForValue('#value', '{"title":"","type":"integer"}')
50
50
 
51
51
  I.selectOption('.je-switcher', 'Boolean')
52
- assert.equal(await I.grabValueFrom('#value'), '{"title":"","type":"boolean"}')
52
+ I.waitForValue('#value', '{"title":"","type":"boolean"}')
53
53
 
54
54
  I.selectOption('.je-switcher', 'Null')
55
- assert.equal(await I.grabValueFrom('#value'), '{"title":"","type":"null"}')
55
+ I.waitForValue('#value', '{"title":"","type":"null"}')
56
56
  })
57
57
 
58
58
  // https://github.com/json-editor/json-editor/issues/823
59
- Scenario('work with json-schema meta-schema @meta-schema', async (I) => {
59
+ Scenario('work with json-schema meta-schema @meta-schema', async ({ I }) => {
60
60
  I.amOnPage('issues/issue-gh-823-meta-schema.html')
61
61
  I.waitForElement('[data-schemapath="root"] h3', DEFAULT_WAIT_TIME)
62
62
  I.click('Object Properties')
@@ -71,14 +71,14 @@ Scenario('work with json-schema meta-schema @meta-schema', async (I) => {
71
71
  })
72
72
 
73
73
  // https://github.com/json-editor/json-editor/issues/1233
74
- Scenario('passing meta-schema example @meta-schema', async (I) => {
74
+ Scenario('passing meta-schema example @meta-schema @schemaloader', async ({ I }) => {
75
75
  I.amOnPage('issues/issue-gh-1233-passing.html')
76
76
  I.waitForElement('.je-ready', DEFAULT_WAIT_TIME)
77
77
  I.waitForElement('[name="root[name]"]', DEFAULT_WAIT_TIME)
78
78
  })
79
79
 
80
80
  // https://github.com/json-editor/json-editor/issues/1233
81
- Scenario('failing meta-schema example @meta-schema @optional', async (I) => {
81
+ Scenario('failing meta-schema example @meta-schema @schemaloader', async ({ I }) => {
82
82
  I.amOnPage('issues/issue-gh-1233-failing.html')
83
83
  I.waitForElement('.je-ready', DEFAULT_WAIT_TIME)
84
84
  I.waitForElement('[name="root[name]"]', DEFAULT_WAIT_TIME)
@@ -1,14 +1,14 @@
1
- var assert = require('assert');
1
+ /* global Feature Scenario */
2
+
2
3
  const { DEFAULT_WAIT_TIME } = require('./test-config')
3
4
 
4
- Feature('schemaloader');
5
+ Feature('schemaloader')
5
6
 
6
- Scenario('resolving nested external URNs', async (I) => {
7
- I.amOnPage('urn.html');
8
- I.waitForElement('[data-schemapath="root"] h3', DEFAULT_WAIT_TIME);
7
+ Scenario('resolving nested external URNs', async ({ I }) => {
8
+ I.amOnPage('urn.html')
9
+ I.waitForElement('[data-schemapath="root"] h3', DEFAULT_WAIT_TIME)
9
10
  I.seeElementInDOM('[data-schemapath="root.fname"]')
10
11
  I.seeElementInDOM('[data-schemapath="root.lname"]')
11
-
12
12
  I.click('.get-value')
13
- assert.equal(await I.grabValueFrom('.value'), '{"fname":"John","lname":"Doe"}');
14
- });
13
+ I.waitForValue('.value', '{"fname":"John","lname":"Doe"}')
14
+ })
@@ -4,7 +4,7 @@ Feature('themes')
4
4
 
5
5
  // nothing
6
6
 
7
- Scenario('It should display button Labels: null | null', async (I) => {
7
+ Scenario('It should display button Labels: null | null', async ({ I }) => {
8
8
  I.amOnPage('themes.html')
9
9
  I.waitForText('Themes Test Page')
10
10
  I.waitForText('Collapse')
@@ -19,7 +19,7 @@ Scenario('It should display button Labels: null | null', async (I) => {
19
19
 
20
20
  // only themes
21
21
 
22
- Scenario('It should display button Labels: barebones | null', async (I) => {
22
+ Scenario('It should display button Labels: barebones | null', async ({ I }) => {
23
23
  I.amOnPage('themes.html')
24
24
  I.waitForText('Themes Test Page')
25
25
  I.waitForText('Collapse')
@@ -32,7 +32,7 @@ Scenario('It should display button Labels: barebones | null', async (I) => {
32
32
  I.waitForText('Move up')
33
33
  })
34
34
 
35
- Scenario('It should display button Labels: spectre | null', async (I) => {
35
+ Scenario('It should display button Labels: spectre | null', async ({ I }) => {
36
36
  I.amOnPage('themes.html')
37
37
  I.selectOption('theme', 'Spectre')
38
38
  I.waitForText('Themes Test Page')
@@ -138,7 +138,7 @@ Scenario('It should display button Labels: foundation3 | null', async (I) => {
138
138
  })
139
139
  */
140
140
 
141
- Scenario('It should display button Labels: bootstrap5 | null', async (I) => {
141
+ Scenario('It should display button Labels: bootstrap5 | null', async ({ I }) => {
142
142
  I.amOnPage('themes.html')
143
143
  I.selectOption('theme', 'Bootstrap 5')
144
144
  I.waitForText('Themes Test Page')
@@ -152,7 +152,7 @@ Scenario('It should display button Labels: bootstrap5 | null', async (I) => {
152
152
  I.waitForText('Move up')
153
153
  })
154
154
 
155
- Scenario('It should display button Labels: bootstrap4 | null', async (I) => {
155
+ Scenario('It should display button Labels: bootstrap4 | null', async ({ I }) => {
156
156
  I.amOnPage('themes.html')
157
157
  I.selectOption('theme', 'Bootstrap 4')
158
158
  I.waitForText('Themes Test Page')
@@ -166,7 +166,7 @@ Scenario('It should display button Labels: bootstrap4 | null', async (I) => {
166
166
  I.waitForText('Move up')
167
167
  })
168
168
 
169
- Scenario('It should display button Labels: bootstrap3 | null', async (I) => {
169
+ Scenario('It should display button Labels: bootstrap3 | null', async ({ I }) => {
170
170
  I.amOnPage('themes.html')
171
171
  I.selectOption('theme', 'Bootstrap 3')
172
172
  I.waitForText('Themes Test Page')
@@ -227,7 +227,7 @@ Scenario('It should display button Labels: bootstrap2 | null', async (I) => {
227
227
  I.seeElementInDOM('i.icon-list')
228
228
  })
229
229
  */
230
- Scenario('It should hide button Labels: null | bootstrap3', async (I) => {
230
+ Scenario('It should hide button Labels: null | bootstrap3', async ({ I }) => {
231
231
  I.amOnPage('themes.html')
232
232
  I.selectOption('iconlib', 'Bootstrap 3')
233
233
  I.waitForText('Themes Test Page')
@@ -256,6 +256,37 @@ Scenario('It should hide button Labels: null | bootstrap3', async (I) => {
256
256
  I.seeElementInDOM('i.glyphicon.glyphicon-copy')
257
257
  I.seeElementInDOM('i.glyphicon.glyphicon-list')
258
258
  })
259
+
260
+ Scenario('It should hide button Labels: null | bootstrap icons @themes @iconlib', async ({ I }) => {
261
+ I.amOnPage('themes.html')
262
+ I.selectOption('iconlib', 'bootstrap')
263
+ I.waitForText('Themes Test Page')
264
+ I.dontSee('Collapse')
265
+ I.dontSee('Edit JSON')
266
+ I.dontSee('Object Properties')
267
+ I.dontSee('Delete item')
268
+ I.dontSee('Delete Last item')
269
+ I.dontSee('Delete All')
270
+ I.dontSee('Move down')
271
+ I.dontSee('Move up')
272
+
273
+ I.click('Collapse')
274
+ I.seeElementInDOM('i.bi.bi-chevron-down')
275
+ I.seeElementInDOM('i.bi.bi-chevron-right')
276
+ I.seeElementInDOM('i.bi.bi-trash')
277
+ I.seeElementInDOM('i.bi.bi-pencil')
278
+ I.seeElementInDOM('i.bi.bi-plus')
279
+ I.seeElementInDOM('i.bi.bi-dash')
280
+ I.seeElementInDOM('i.bi.bi-x-circle')
281
+ I.seeElementInDOM('i.bi.bi-save')
282
+ I.seeElementInDOM('i.bi.bi-arrow-up')
283
+ I.seeElementInDOM('i.bi.bi-arrow-right')
284
+ I.seeElementInDOM('i.bi.bi-arrow-down')
285
+ I.seeElementInDOM('i.bi.bi-arrow-left')
286
+ I.seeElementInDOM('i.bi.bi-clipboard')
287
+ I.seeElementInDOM('i.bi.bi-list-ul')
288
+ })
289
+
259
290
  /*
260
291
  Scenario('It should hide button Labels: null | fontawesome3', async (I) => {
261
292
  I.amOnPage('themes.html')
@@ -469,7 +500,7 @@ Scenario('It should hide button Labels: null | openiconic', async (I) => {
469
500
  I.seeElementInDOM('i.oi-icon.oi-icon-list')
470
501
  })
471
502
  */
472
- Scenario('It should hide button Labels: null | spectre', async (I) => {
503
+ Scenario('It should hide button Labels: null | spectre', async ({ I }) => {
473
504
  I.amOnPage('themes.html')
474
505
  I.selectOption('iconlib', 'Spectre')
475
506
  I.waitForText('Themes Test Page')
@@ -501,7 +532,7 @@ Scenario('It should hide button Labels: null | spectre', async (I) => {
501
532
 
502
533
  // icons + themes
503
534
 
504
- Scenario('It should hide button Labels: spectre | spectre', async (I) => {
535
+ Scenario('It should hide button Labels: spectre | spectre', async ({ I }) => {
505
536
  I.amOnPage('themes.html')
506
537
  I.selectOption('theme', 'Spectre')
507
538
  I.selectOption('iconlib', 'Spectre')
@@ -5,6 +5,7 @@
5
5
  <title>Autocomplete</title>
6
6
  <link rel="stylesheet" id="theme-link" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
7
7
  <link rel="stylesheet" id="iconlib-link" href="https://use.fontawesome.com/releases/v5.6.1/css/all.css">
8
+ <link rel="stylesheet" href="https://unpkg.com/@trevoreyre/autocomplete-js/dist/style.css"/>
8
9
  <script src="https://unpkg.com/@trevoreyre/autocomplete-js"></script>
9
10
  <script src="../../dist/jsoneditor.js"></script>
10
11
  </head>
@@ -0,0 +1,38 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8"/>
5
+ <title>contains</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
+ <div id='editor-container'></div>
14
+ </div>
15
+
16
+ <script>
17
+ var editorContainer = document.querySelector('#editor-container')
18
+ var schema = {
19
+ 'title': 'contains',
20
+ "type": "array",
21
+ "contains": {
22
+ "type": "number"
23
+ },
24
+ "items": {
25
+ "type": "number"
26
+ }
27
+ }
28
+
29
+ var editor = new JSONEditor(editorContainer, {
30
+ schema: schema,
31
+ theme: 'bootstrap4',
32
+ iconlib: 'fontawesome',
33
+ show_errors: 'always'
34
+ })
35
+ </script>
36
+
37
+ </body>
38
+ </html>
@@ -0,0 +1,52 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8"/>
5
+ <title>dependentSchemas</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
+ <div id='editor-container'></div>
14
+ </div>
15
+
16
+ <script>
17
+ var editorContainer = document.querySelector('#editor-container')
18
+ var schema = {
19
+ "type": "object",
20
+ "properties": {
21
+ "credit_card": {
22
+ "type": "number"
23
+ },
24
+ "billing_address": {
25
+ "type": "string"
26
+ }
27
+ },
28
+ "dependentSchemas": {
29
+ "credit_card": {
30
+ "properties": {
31
+ "billing_address": {
32
+ "type": "string"
33
+ }
34
+ },
35
+ "required": [
36
+ "billing_address"
37
+ ]
38
+ }
39
+ }
40
+ }
41
+
42
+ var editor = new JSONEditor(editorContainer, {
43
+ schema: schema,
44
+ theme: 'bootstrap4',
45
+ iconlib: 'fontawesome',
46
+ show_errors: 'always',
47
+ show_opt_in: true
48
+ })
49
+ </script>
50
+
51
+ </body>
52
+ </html>
@@ -0,0 +1,57 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8"/>
5
+ <title>If-Else</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
+ <div id='editor-container'></div>
14
+ </div>
15
+
16
+ <script>
17
+ var editorContainer = document.querySelector('#editor-container')
18
+ var schema = {
19
+ 'type': 'object',
20
+ 'properties': {
21
+ 'country': {
22
+ 'type': 'string',
23
+ 'default': 'America',
24
+ 'enum': [
25
+ 'America',
26
+ 'Canada'
27
+ ]
28
+ },
29
+ 'postal_code': {
30
+ 'type': 'string'
31
+ }
32
+ },
33
+ 'if': {
34
+ 'properties': {
35
+ 'country': {
36
+ 'const': 'America'
37
+ }
38
+ }
39
+ },
40
+ 'else': {
41
+ 'properties': {
42
+ 'postal_code': {
43
+ 'pattern': '[A-Z][0-9][A-Z] [0-9][A-Z][0-9]'
44
+ }
45
+ }
46
+ }
47
+ }
48
+
49
+ var editor = new JSONEditor(editorContainer, {
50
+ schema: schema,
51
+ theme: 'bootstrap4',
52
+ iconlib: 'fontawesome'
53
+ })
54
+ </script>
55
+
56
+ </body>
57
+ </html>