@json-editor/json-editor 2.14.0 → 2.15.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.
- package/.env +4 -0
- package/.eslintrc +4 -1
- package/.github/workflows/build.yml +5 -4
- package/CHANGELOG.md +31 -0
- package/README.md +32 -1
- package/config/webpack.common.js +2 -6
- package/dist/jsoneditor.js +1 -1
- package/dist/jsoneditor.js.LICENSE.txt +1 -1
- package/dist/nonmin/jsoneditor.js +4152 -3955
- package/dist/nonmin/jsoneditor.js.map +1 -1
- package/docs/meta-schema.html +793 -0
- package/package.json +13 -13
- package/src/core.js +5 -1
- package/src/defaults.js +9 -2
- package/src/editor.js +34 -15
- package/src/editors/array.js +10 -7
- package/src/editors/base64.js +3 -0
- package/src/editors/describedby.js +2 -2
- package/src/editors/enum.js +9 -1
- package/src/editors/info.js +8 -0
- package/src/editors/multiple.js +16 -3
- package/src/editors/object.js +26 -7
- package/src/editors/radio.js +9 -2
- package/src/editors/select.js +19 -8
- package/src/editors/select2.js +1 -1
- package/src/editors/starrating.js +5 -4
- package/src/editors/string.js +17 -1
- package/src/editors/table.js +2 -2
- package/src/iconlib.js +0 -1
- package/src/schemaloader.js +2 -2
- package/src/style.css +4 -0
- package/src/style.css.js +1 -1
- package/src/templates/default.js +2 -2
- package/src/theme.js +13 -3
- package/src/themes/bootstrap3.js +0 -9
- package/src/themes/index.js +0 -1
- package/src/validator.js +4 -4
- package/tests/Dockerfile +1 -1
- package/tests/codeceptjs/core_test.js +8 -2
- package/tests/codeceptjs/editors/array_test.js +11 -6
- package/tests/codeceptjs/editors/autocomplete_test.js +0 -1
- package/tests/codeceptjs/editors/integer_test.js +0 -4
- package/tests/codeceptjs/editors/object_test.js +8 -0
- package/tests/codeceptjs/editors/rating_test.js +1 -1
- package/tests/codeceptjs/editors/select_test.js +18 -0
- package/tests/codeceptjs/editors/starrating_test.js +15 -0
- package/tests/codeceptjs/editors/string_test.js +7 -0
- package/tests/codeceptjs/issues/issue-gh-1158_test.js +1 -1
- package/tests/codeceptjs/issues/issue-gh-1164_test.js +0 -1
- package/tests/codeceptjs/issues/issue-gh-1171_test.js +11 -0
- package/tests/codeceptjs/issues/issue-gh-1272_test.js +21 -0
- package/tests/codeceptjs/issues/issue-gh-1383_test.js +1 -1
- package/tests/codeceptjs/issues/issue-gh-1452_test.js +10 -0
- package/tests/codeceptjs/issues/issue-gh-1485_test.js +13 -0
- package/tests/codeceptjs/issues/issue-gh-1491_test.js +9 -0
- package/tests/codeceptjs/issues/issue-gh-1525_test.js +9 -0
- package/tests/codeceptjs/issues/issue-gh-1536_test.js +12 -0
- package/tests/codeceptjs/issues/issue-gh-1538_test.js +10 -0
- package/tests/codeceptjs/issues/issue-gh-1541_test.js +8 -0
- package/tests/docker-compose-local.yml +1 -2
- package/tests/docker-compose.yml +0 -1
- package/tests/pages/array-events-table.html +39 -31
- package/tests/pages/array-events.html +39 -31
- package/tests/pages/assets/autocomplete.css +1 -0
- package/tests/pages/assets/autocomplete.min.js +1 -0
- package/tests/pages/autocomplete.html +4 -4
- package/tests/pages/enforce-const.html +176 -0
- package/tests/pages/issues/issue-gh-1171.html +39 -0
- package/tests/pages/issues/issue-gh-1272.html +167 -0
- package/tests/pages/issues/issue-gh-1452.html +98 -0
- package/tests/pages/issues/issue-gh-1466.html +63 -0
- package/tests/pages/issues/issue-gh-1485.html +59 -0
- package/tests/pages/issues/issue-gh-1491.html +59 -0
- package/tests/pages/issues/issue-gh-1525.html +62 -0
- package/tests/pages/issues/issue-gh-1536.html +55 -0
- package/tests/pages/issues/issue-gh-1538.html +56 -0
- package/tests/pages/issues/issue-gh-1541.html +51 -0
- package/tests/pages/issues/issue-gh-1541.json +9 -0
- package/tests/pages/placeholder-options.html +57 -0
- package/tests/pages/prompt-paste-max-length-reached.html +51 -0
- package/tests/pages/remove-false-properties.html +85 -0
- package/tests/pages/starrating.html +86 -0
- package/tests/unit/editor.spec.js +1 -1
package/.env
CHANGED
package/.eslintrc
CHANGED
|
@@ -53,17 +53,18 @@ jobs:
|
|
|
53
53
|
run: docker-compose run -T --rm node npm run ${BUILD_ENV}
|
|
54
54
|
- name: Test
|
|
55
55
|
run: |
|
|
56
|
-
docker-compose exec -T node codeceptjs -c /repo/tests/codeceptjs/codecept.json
|
|
56
|
+
docker-compose exec -T node codeceptjs run-multiple -c /repo/tests/codeceptjs/codecept.json basic:${SELENIUM_BROWSER} --invert --grep '@optional'
|
|
57
57
|
pwd
|
|
58
58
|
ls -la codeceptjs/output
|
|
59
59
|
- name: Test Artifacts
|
|
60
60
|
if: always()
|
|
61
|
-
uses: actions/upload-artifact@
|
|
61
|
+
uses: actions/upload-artifact@v4
|
|
62
62
|
with:
|
|
63
|
-
name: codeceptjs-output
|
|
63
|
+
name: codeceptjs-output-${{ matrix.selenium-browser }}-${{ matrix.build-env }}
|
|
64
64
|
path: tests/codeceptjs/output
|
|
65
65
|
retention-days: 30
|
|
66
|
+
merge-multiple: true
|
|
66
67
|
- name: Test (optional)
|
|
67
68
|
continue-on-error: true
|
|
68
|
-
run: docker-compose exec -T node codeceptjs -c /repo/tests/codeceptjs/codecept.json
|
|
69
|
+
run: docker-compose exec -T node codeceptjs run-multiple -c /repo/tests/codeceptjs/codecept.json basic:${SELENIUM_BROWSER} --grep '@optional'
|
|
69
70
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
### Unreleased
|
|
2
2
|
|
|
3
|
+
### 2.15.0
|
|
4
|
+
|
|
5
|
+
- Added option enforce_const
|
|
6
|
+
- Fixed #1525 select2 setValue append new item
|
|
7
|
+
- Added remove_false_properties object option
|
|
8
|
+
- Updated GitHub workflows
|
|
9
|
+
- Added prompt_paste_max_length_reached option
|
|
10
|
+
- Fixed #1512 "dependencies" autocomplete inside array tables cropping
|
|
11
|
+
- Allow for Base64 custom input attributes
|
|
12
|
+
- Added 'add' and 'switch' events
|
|
13
|
+
- Fixed "dependencies" issues
|
|
14
|
+
- Fixed npm audits and packages upgrades
|
|
15
|
+
- Fixed issue #1541 Failure to parse schema with "default"
|
|
16
|
+
- Fixed rating "undefined" value when type of integer
|
|
17
|
+
- Added meta-schema example to the readme
|
|
18
|
+
- Fixed issue #1514 Cannot use more than one class in "class" option for links
|
|
19
|
+
- Fixed info disable/enable
|
|
20
|
+
- Added options: "has_placeholder_option" and "placeholder_option_text"
|
|
21
|
+
- Fixed issue #1498 Dependant fields not created after JSON update at change of the controlling field
|
|
22
|
+
- Added 'copyRow' event
|
|
23
|
+
|
|
24
|
+
### 2.14.1
|
|
25
|
+
|
|
26
|
+
- Fixed issue #1272 Multiple editor incorrect dependency inheritance
|
|
27
|
+
- Improved Multiple editor accessibility
|
|
28
|
+
- Fixed issue #1485 Infinite loop due to template rendering bug
|
|
29
|
+
- Fixed issue #1171 Radio inputs without names having multiple checking marks
|
|
30
|
+
- Fixed issue #1491 Wrong error messages displayed in some edge scenarios
|
|
31
|
+
- Fixed issue #1466 memory leak in array editor
|
|
32
|
+
|
|
3
33
|
### 2.14.0
|
|
4
34
|
|
|
5
35
|
- Added new editor option "titleHidden"
|
|
@@ -16,6 +46,7 @@
|
|
|
16
46
|
- Fixed issue format buttons disable state
|
|
17
47
|
- Fixed issue #1453 setup buttons in array editor correctly if editor is initially collapsed
|
|
18
48
|
- Fixed issue #1461 setup buttons in array editor correctly if there exists another enum-typed property for which the default value does not equal to the first value
|
|
49
|
+
- Fixed issue #1466 memory leak in array editor
|
|
19
50
|
|
|
20
51
|
### 2.13.1
|
|
21
52
|
|
package/README.md
CHANGED
|
@@ -85,6 +85,7 @@ If you learn best by example, check these out:
|
|
|
85
85
|
* Star Rating Editor Example - https://json-editor.github.io/json-editor/starrating.html
|
|
86
86
|
* Upload Editor Example - https://json-editor.github.io/json-editor/upload.html
|
|
87
87
|
* WYSIWYG Editor Example - https://json-editor.github.io/json-editor/wysiwyg.html
|
|
88
|
+
* Meta schema (schema builder) Example - https://json-editor.github.io/json-editor/meta-schema.html
|
|
88
89
|
|
|
89
90
|
More examples can be found at the [JSON-Editor Interactive Playground](https://pmk65.github.io/jedemov2/dist/demo.html)
|
|
90
91
|
|
|
@@ -325,6 +326,16 @@ Here are all the available options:
|
|
|
325
326
|
<td>This property controls whether property searches in an object editor are case-sensitive</td>
|
|
326
327
|
<td><code>true</code></td>
|
|
327
328
|
</tr>
|
|
329
|
+
<tr>
|
|
330
|
+
<td>prompt_paste_max_length_reached</td>
|
|
331
|
+
<td>If <code>true</code>, an alert will be displayed when pasting a value in an input that exceeded maxLength</td>
|
|
332
|
+
<td><code>false</code></td>
|
|
333
|
+
</tr>
|
|
334
|
+
<tr>
|
|
335
|
+
<td>enforce_const</td>
|
|
336
|
+
<td>When set to <code>true</code>, the schema <code>const</code> will serve as the default value, and the editor will prevent any changes to it.</td>
|
|
337
|
+
<td><code>false</code></td>
|
|
338
|
+
</tr>
|
|
328
339
|
</tbody>
|
|
329
340
|
</table>
|
|
330
341
|
|
|
@@ -434,6 +445,23 @@ for (let key in editor.editors) {
|
|
|
434
445
|
}
|
|
435
446
|
```
|
|
436
447
|
|
|
448
|
+
There are also `add` and `switch` events to track changes.
|
|
449
|
+
The `add` event fires when a new object property has just been added.
|
|
450
|
+
|
|
451
|
+
```javascript
|
|
452
|
+
editor.on('add',(property) => {
|
|
453
|
+
// Do something
|
|
454
|
+
});
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
The `switch` event fires when the type of one of the object's properties is changed by a type switch on the form.
|
|
458
|
+
|
|
459
|
+
```javascript
|
|
460
|
+
editor.on('switch',(property) => {
|
|
461
|
+
// Do something
|
|
462
|
+
});
|
|
463
|
+
```
|
|
464
|
+
|
|
437
465
|
### Enable and Disable the Editor
|
|
438
466
|
|
|
439
467
|
This lets you disable editing for the entire form or part of the form.
|
|
@@ -1214,7 +1242,10 @@ Editors can accept options which alter the behavior in some way.
|
|
|
1214
1242
|
* `hidden` - If set to true, the editor will not appear in the UI (works for all types)
|
|
1215
1243
|
* `input_height` - Explicitly set the height of the input element. Should be a valid CSS width string (e.g. "100px"). Works best with textareas.
|
|
1216
1244
|
* `input_width` - Explicitly set the width of the input element. Should be a valid CSS width string (e.g. "100px"). Works for string, number, and integer data types.
|
|
1217
|
-
* `remove_empty_properties` - If set to true for an object, empty object properties (i.e. those with falsy values) will not be returned by getValue().
|
|
1245
|
+
* `remove_empty_properties` - If set to `true` for an object, empty object properties (i.e. those with falsy values) will not be returned by getValue().
|
|
1246
|
+
* `remove_false_properties` - If set to `true` for an object, object properties with value `false` will not be returned by getValue().
|
|
1247
|
+
* `has_placeholder_option` - If set to true, a placeholder option will be added to the select editor input.
|
|
1248
|
+
* `placeholder_option_text` - Text displayed in select placeholder option.
|
|
1218
1249
|
|
|
1219
1250
|
```json
|
|
1220
1251
|
{
|
package/config/webpack.common.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const webpack = require('webpack')
|
|
2
2
|
const helpers = require('./helpers')
|
|
3
3
|
const CssToJSON = require('../build/CssToJson')
|
|
4
|
+
const ESLintPlugin = require('eslint-webpack-plugin');
|
|
4
5
|
|
|
5
6
|
const bannerText = `/**
|
|
6
7
|
* @name JSON Editor
|
|
@@ -22,12 +23,6 @@ module.exports = {
|
|
|
22
23
|
},
|
|
23
24
|
module: {
|
|
24
25
|
rules: [
|
|
25
|
-
{
|
|
26
|
-
enforce: 'pre',
|
|
27
|
-
test: /\.js$/,
|
|
28
|
-
exclude: /node_modules/,
|
|
29
|
-
loader: 'eslint-loader'
|
|
30
|
-
},
|
|
31
26
|
{
|
|
32
27
|
test: /\.js|\.css.js$/,
|
|
33
28
|
exclude: /node_modules/,
|
|
@@ -54,6 +49,7 @@ module.exports = {
|
|
|
54
49
|
]
|
|
55
50
|
},
|
|
56
51
|
plugins: [
|
|
52
|
+
new ESLintPlugin(),
|
|
57
53
|
new webpack.BannerPlugin(
|
|
58
54
|
bannerText.replace(
|
|
59
55
|
'{{ VERSION }}',
|