@json-editor/json-editor 2.11.0 → 2.12.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 +1 -1
- package/CHANGELOG.md +11 -0
- package/README.md +77 -1
- package/README_ADDON.md +5 -1
- package/dist/jsoneditor.js +1 -1
- package/dist/jsoneditor.js.LICENSE.txt +1 -1
- package/dist/nonmin/jsoneditor.js +330 -169
- package/dist/nonmin/jsoneditor.js.map +1 -1
- package/docs/cleave.html +1 -1
- package/docs/datetime.html +1 -1
- package/docs/describedby.html +1 -1
- package/docs/index.html +5 -3
- package/docs/meta_schema.json +5 -1
- package/docs/radio.html +1 -1
- package/docs/select2.html +1 -1
- package/docs/selectize.html +2 -5
- package/docs/signature.html +12 -11
- package/docs/wysiwyg.html +1 -1
- package/package.json +1 -1
- package/src/core.js +10 -1
- package/src/defaults.js +3 -1
- package/src/editor.js +1 -1
- package/src/editors/array/selectize.js +0 -2
- package/src/editors/array.js +24 -13
- package/src/editors/base64.js +9 -0
- package/src/editors/integer.js +3 -2
- package/src/editors/multiple.js +3 -0
- package/src/editors/number.js +4 -2
- package/src/editors/object.js +71 -3
- package/src/editors/signature.js +16 -16
- package/src/editors/string.js +4 -0
- package/src/editors/table.js +17 -14
- package/src/resolvers.js +6 -2
- package/src/schemaloader.js +13 -0
- package/src/theme.js +4 -0
- package/src/themes/bootstrap3.js +6 -0
- package/src/themes/bootstrap4.js +6 -0
- package/src/themes/bootstrap5.js +6 -0
- package/src/validator.js +28 -0
- package/tests/codeceptjs/constrains/dependentRequired_test.js +33 -0
- package/tests/codeceptjs/core_test.js +10 -0
- package/tests/codeceptjs/editors/array_test.js +52 -0
- package/tests/codeceptjs/editors/object_test.js +20 -0
- package/tests/codeceptjs/issues/issue-gh-1330_test.js +8 -0
- package/tests/codeceptjs/issues/issue-gh-1338_test.js +2 -0
- package/tests/codeceptjs/issues/issue-gh-1364_test.js +13 -0
- package/tests/codeceptjs/issues/issue-gh-1367_test.js +11 -0
- package/tests/codeceptjs/issues/issue-gh-1383_test.js +9 -0
- package/tests/codeceptjs/issues/issue-gh-1384_test.js +9 -0
- package/tests/codeceptjs/issues/issue-gh-1410_test.js +13 -0
- package/tests/codeceptjs/issues/issue-gh-1422_test.js +9 -0
- package/tests/docker-compose-local.yml +4 -0
- package/tests/pages/array-selectize-create.html +62 -0
- package/tests/pages/array-table-responsive.html +65 -0
- package/tests/pages/button_state_mode_1.html +34 -0
- package/tests/pages/button_state_mode_2.html +35 -0
- package/tests/pages/dependentRequired.html +71 -0
- package/tests/pages/issues/issue-gh-1330.html +52 -0
- package/tests/pages/issues/issue-gh-1364.html +64 -0
- package/tests/pages/issues/issue-gh-1367.html +49 -0
- package/tests/pages/issues/issue-gh-1383.html +31 -0
- package/tests/pages/issues/issue-gh-1383.json +14 -0
- package/tests/pages/issues/issue-gh-1384.html +31 -0
- package/tests/pages/issues/issue-gh-1384.json +36 -0
- package/tests/pages/issues/issue-gh-1410.html +57 -0
- package/tests/pages/issues/issue-gh-1422.html +68 -0
- package/tests/pages/keep_only_existing_values.html +1 -1
- package/tests/pages/load-events.html +60 -0
- package/tests/pages/meta-schema.html +5 -1
- package/tests/pages/meta_schema.json +5 -1
- package/tests/pages/object-case-sensitive-property-search-false.html +41 -0
- package/tests/pages/object-case-sensitive-property-search-true.html +41 -0
- package/dist/dev/jsoneditor.js +0 -3687
- package/dist/jsoneditor.js.map +0 -1
package/.env
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
COMPOSE_PROJECT_NAME=json-editor
|
|
2
|
-
COMPOSE_FILE=./tests/docker-compose.yml
|
|
2
|
+
COMPOSE_FILE=./tests/docker-compose.yml:./tests/docker-compose-local.yml
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
### Unreleased
|
|
2
2
|
|
|
3
|
+
### 2.12.0
|
|
4
|
+
|
|
5
|
+
- Fixed issue #1422: use_default_values: false deletes valid values while true sets invalid default values
|
|
6
|
+
- Added feature: load-events
|
|
7
|
+
- Fixed issue #1410: Schema for "additionalProperties" does not override "no_additional_properties: true"
|
|
8
|
+
- Added feature: table-responsive
|
|
9
|
+
- Fixed readme-broken-link
|
|
10
|
+
- Updated integrity checks in example pages
|
|
11
|
+
|
|
3
12
|
### 2.11.0
|
|
4
13
|
|
|
5
14
|
- Fixed issue #746 and #645: Selectize with create = true should add items
|
|
@@ -11,6 +20,8 @@
|
|
|
11
20
|
- Updated playground ace editor config
|
|
12
21
|
- Added button_state_mode options
|
|
13
22
|
- Added support for case-insensitive properties search
|
|
23
|
+
- Fixed issue #746 and #645 Selectize with create = true should add Items
|
|
24
|
+
- Added support for case insensitive properties search
|
|
14
25
|
- Added support for dependentRequired constrains
|
|
15
26
|
- Fixed issue #1367: Signature editor not returning base64 data
|
|
16
27
|
- Fixed issue #1237: more coherent ui for Base64 editor
|
package/README.md
CHANGED
|
@@ -315,6 +315,16 @@ Here are all the available options:
|
|
|
315
315
|
<td>If <code>true</code>, control inputs <code>name</code> attributes will be set.</td>
|
|
316
316
|
<td><code>true</code></td>
|
|
317
317
|
</tr>
|
|
318
|
+
<tr>
|
|
319
|
+
<td>button_state_mode</td>
|
|
320
|
+
<td>If <code>1</code>, inactive buttons are hidden. If <code>2</code>, inactive buttons are disabled.</td>
|
|
321
|
+
<td><code>1</code></td>
|
|
322
|
+
</tr>
|
|
323
|
+
<tr>
|
|
324
|
+
<td>case_sensitive_property_search</td>
|
|
325
|
+
<td>This property controls whether property searches in an object editor are case-sensitive</td>
|
|
326
|
+
<td><code>true</code></td>
|
|
327
|
+
</tr>
|
|
318
328
|
</tbody>
|
|
319
329
|
</table>
|
|
320
330
|
|
|
@@ -540,7 +550,7 @@ Some of The [hyper-schema][hyper] specification is supported as well.
|
|
|
540
550
|
|
|
541
551
|
[core]: http://json-schema.org/latest/json-schema-core.html
|
|
542
552
|
[validation]: http://json-schema.org/latest/json-schema-validation.html
|
|
543
|
-
[hyper]:
|
|
553
|
+
[hyper]: https://json-schema.org/draft-07/json-hyper-schema-release-notes
|
|
544
554
|
|
|
545
555
|
### $ref and definitions
|
|
546
556
|
|
|
@@ -636,6 +646,52 @@ Show a video preview (using HTML5 video)
|
|
|
636
646
|
The `href` property is a template that gets re-evaluated every time the value changes.
|
|
637
647
|
The variable `self` is always available. Look at the __Dependencies__ section below for how to include other fields or use a custom template engine.
|
|
638
648
|
|
|
649
|
+
### if-then-else
|
|
650
|
+
The if-then-else keywords are used to express conditional validation logic based on the evaluation of a specified condition. The if keyword defines a condition, and depending on whether it evaluates to true or false, the schema specified under either the then or else keywords will be applied.
|
|
651
|
+
|
|
652
|
+
```json
|
|
653
|
+
{
|
|
654
|
+
"type": "object",
|
|
655
|
+
"properties": {
|
|
656
|
+
"street_address": {
|
|
657
|
+
"type": "string"
|
|
658
|
+
},
|
|
659
|
+
"country": {
|
|
660
|
+
"type": "string",
|
|
661
|
+
"default": "United States of America",
|
|
662
|
+
"enum": [
|
|
663
|
+
"United States of America",
|
|
664
|
+
"Canada"
|
|
665
|
+
]
|
|
666
|
+
},
|
|
667
|
+
"postal_code": {
|
|
668
|
+
"type": "string"
|
|
669
|
+
}
|
|
670
|
+
},
|
|
671
|
+
"if": {
|
|
672
|
+
"properties": {
|
|
673
|
+
"country": {
|
|
674
|
+
"const": "United States of America"
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
},
|
|
678
|
+
"then": {
|
|
679
|
+
"properties": {
|
|
680
|
+
"postal_code": {
|
|
681
|
+
"pattern": "[0-9]{5}(-[0-9]{4})?"
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
},
|
|
685
|
+
"else": {
|
|
686
|
+
"properties": {
|
|
687
|
+
"postal_code": {
|
|
688
|
+
"pattern": "[A-Z][0-9][A-Z] [0-9][A-Z][0-9]"
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
```
|
|
694
|
+
|
|
639
695
|
### Property Ordering
|
|
640
696
|
|
|
641
697
|
There is no way to specify property ordering in JSON Schema (although this may change in v5 of the spec).
|
|
@@ -848,8 +904,10 @@ __Ace Editor__ is a syntax highlighting source code editor. You can use it by se
|
|
|
848
904
|
* pgsql
|
|
849
905
|
* php
|
|
850
906
|
* python
|
|
907
|
+
* prql
|
|
851
908
|
* r
|
|
852
909
|
* ruby
|
|
910
|
+
* rust
|
|
853
911
|
* sass
|
|
854
912
|
* scala
|
|
855
913
|
* scss
|
|
@@ -857,10 +915,12 @@ __Ace Editor__ is a syntax highlighting source code editor. You can use it by se
|
|
|
857
915
|
* sql
|
|
858
916
|
* stylus
|
|
859
917
|
* svg
|
|
918
|
+
* typescript
|
|
860
919
|
* twig
|
|
861
920
|
* vbscript
|
|
862
921
|
* xml
|
|
863
922
|
* yaml
|
|
923
|
+
* zig
|
|
864
924
|
|
|
865
925
|
```json
|
|
866
926
|
{
|
|
@@ -1038,6 +1098,22 @@ editor.on('deleteAllRows', deletedValues => {
|
|
|
1038
1098
|
});
|
|
1039
1099
|
```
|
|
1040
1100
|
|
|
1101
|
+
#### Schema loader events
|
|
1102
|
+
|
|
1103
|
+
When schemas are loaded via a request, the `schemaLoaded` event is triggered individually for each schema after its loading.
|
|
1104
|
+
Once the loading of all schemas is completed, the `allSchemasLoaded` event is triggered.
|
|
1105
|
+
|
|
1106
|
+
```javascript
|
|
1107
|
+
editor.on('schemaLoaded', (payload) => {
|
|
1108
|
+
console.log('schemasLoaded', payload.schemaUrl)
|
|
1109
|
+
console.log('schemasLoaded', payload.schema)
|
|
1110
|
+
})
|
|
1111
|
+
|
|
1112
|
+
editor.on('allSchemasLoaded', () => {
|
|
1113
|
+
console.log('allSchemasLoaded')
|
|
1114
|
+
})
|
|
1115
|
+
```
|
|
1116
|
+
|
|
1041
1117
|
|
|
1042
1118
|
#### Objects
|
|
1043
1119
|
|
package/README_ADDON.md
CHANGED
|
@@ -95,8 +95,10 @@ For configuration options, see the [ACE homepage](https://ace.c9.io/://).
|
|
|
95
95
|
``"format": "pgsql"``<br>
|
|
96
96
|
``"format": "php"``<br>
|
|
97
97
|
``"format": "python"``<br>
|
|
98
|
+
``"format": "prql"``<br>
|
|
98
99
|
``"format": "r"``<br>
|
|
99
100
|
``"format": "ruby"``<br>
|
|
101
|
+
``"format": "rust"``<br>
|
|
100
102
|
``"format": "sass"``<br>
|
|
101
103
|
``"format": "scala"``<br>
|
|
102
104
|
``"format": "scss"``<br>
|
|
@@ -105,10 +107,12 @@ For configuration options, see the [ACE homepage](https://ace.c9.io/://).
|
|
|
105
107
|
``"format": "sqlserver"``<br>
|
|
106
108
|
``"format": "stylus"``<br>
|
|
107
109
|
``"format": "svg"``<br>
|
|
110
|
+
``"format": "typescript"``<br>
|
|
108
111
|
``"format": "twig"``<br>
|
|
109
112
|
``"format": "vbscript"``<br>
|
|
110
113
|
``"format": "xml"``<br>
|
|
111
|
-
``"format": "yaml"
|
|
114
|
+
``"format": "yaml"``<br>
|
|
115
|
+
``"format": "zig"
|
|
112
116
|
</details>
|
|
113
117
|
|
|
114
118
|
**Supported Types:** string<br>
|