@json-editor/json-editor 2.12.0 → 2.13.1
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/CHANGELOG.md +12 -0
- package/README.md +13 -5
- package/dist/jsoneditor.js +1 -1
- package/dist/jsoneditor.js.LICENSE.txt +1 -1
- package/dist/nonmin/jsoneditor.js +88 -59
- package/dist/nonmin/jsoneditor.js.map +1 -1
- package/docs/index.html +62 -12
- package/docs/meta_schema.json +11 -0
- package/docs/scripts/ajv-validator.js +8695 -0
- package/package.json +1 -1
- package/src/editor.js +19 -0
- package/src/editors/button.js +8 -2
- package/src/editors/simplemde.js +2 -1
- package/src/resolvers.js +7 -4
- package/tests/codeceptjs/codecept.json +1 -1
- package/tests/codeceptjs/constrains/contains_test.js +3 -2
- package/tests/codeceptjs/constrains/dependentSchemas_test.js +1 -0
- package/tests/codeceptjs/core_test.js +4 -4
- package/tests/codeceptjs/editors/advanced_test.js +1 -1
- package/tests/codeceptjs/editors/array_test.js +7 -0
- package/tests/codeceptjs/editors/autocomplete_test.js +3 -1
- package/tests/codeceptjs/editors/tabs_test.js +1 -1
- package/tests/codeceptjs/issues/issue-gh-1338_test.js +2 -2
- package/tests/codeceptjs/issues/issue-gh-1431_test.js +12 -0
- package/tests/codeceptjs/issues/issue-gh-1439_test.js +12 -0
- package/tests/pages/array-header-template.html +59 -0
- package/tests/pages/button-icons.html +1 -1
- package/tests/pages/issues/issue-gh-1431.html +49 -0
- package/tests/pages/issues/issue-gh-1439.html +69 -0
- package/tests/pages/meta-schema.html +11 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
### Unreleased
|
|
2
2
|
|
|
3
|
+
### 2.13.1
|
|
4
|
+
|
|
5
|
+
- Fixed bug in enumTitle for headerTemplates
|
|
6
|
+
|
|
7
|
+
### 2.13.0
|
|
8
|
+
|
|
9
|
+
- Added feature #1448 enumTitle for headerTemplates
|
|
10
|
+
- Fixed issue #1442 tpe button editors
|
|
11
|
+
- Fixed issue #1433 simplemde editor data sync
|
|
12
|
+
- Added schema validation in playground
|
|
13
|
+
- Fixed tests timing issues
|
|
14
|
+
|
|
3
15
|
### 2.12.0
|
|
4
16
|
|
|
5
17
|
- Fixed issue #1422: use_default_values: false deletes valid values while true sets invalid default values
|
package/README.md
CHANGED
|
@@ -985,10 +985,10 @@ Creates a button whose click callback can be defined in `JSONEditor.defaults.cal
|
|
|
985
985
|
|
|
986
986
|
```json
|
|
987
987
|
{
|
|
988
|
-
"
|
|
989
|
-
"title": "Search",
|
|
988
|
+
"format": "button",
|
|
990
989
|
"options": {
|
|
991
990
|
"button": {
|
|
991
|
+
"text": "Search",
|
|
992
992
|
"icon": "search",
|
|
993
993
|
"action": "myAction",
|
|
994
994
|
"validated": true
|
|
@@ -1716,7 +1716,7 @@ The `title` keyword of a schema is used to add user friendly headers to the edit
|
|
|
1716
1716
|
Consider the example of an array of children. Without dynamic headers, the UI for the array elements would show `Child 1`, `Child 2`, etc..
|
|
1717
1717
|
It would be much nicer if the headers could be dynamic and incorporate information about the children, such as `1 - John (age 9)`, `2 - Sarah (age 11)`.
|
|
1718
1718
|
|
|
1719
|
-
To accomplish this, use the `headerTemplate` property. All of the watched variables are passed into this template, along with the static title `title` (e.g. "Child"), the 0-based index `i0` (e.g. "0" and "1"), the 1-based index `i1`, and the field's value `self` (e.g. `{"name": "John", "age": 9}`).
|
|
1719
|
+
To accomplish this, use the `headerTemplate` property. All of the watched variables are passed into this template, along with the static title `title` (e.g. "Child"), the 0-based index `i0` (e.g. "0" and "1"), the 1-based index `i1`, extra child variable `properties.${PROPERTY_NAME}.enumTitle` and the field's value `self` (e.g. `{"name": "John", "age": 9}`).
|
|
1720
1720
|
|
|
1721
1721
|
```js+jinja
|
|
1722
1722
|
{
|
|
@@ -1725,10 +1725,18 @@ To accomplish this, use the `headerTemplate` property. All of the watched varia
|
|
|
1725
1725
|
"items": {
|
|
1726
1726
|
"type": "object",
|
|
1727
1727
|
"title": "Child",
|
|
1728
|
-
"headerTemplate": "{{ i1 }} - {{ self.name }} (age {{ self.age }})",
|
|
1728
|
+
"headerTemplate": "{{ i1 }} - {{ self.name }} (age {{ self.age }}) has a {{ properties.pet.enumTitle }}",
|
|
1729
1729
|
"properties": {
|
|
1730
1730
|
"name": { "type": "string" },
|
|
1731
|
-
"age": { "type": "integer" }
|
|
1731
|
+
"age": { "type": "integer" },
|
|
1732
|
+
"pet": {
|
|
1733
|
+
"title": "Pet",
|
|
1734
|
+
"type": "string",
|
|
1735
|
+
"enum": [ "pet_1", "pet_2" ],
|
|
1736
|
+
"options": {
|
|
1737
|
+
"enum_titles": [ "Dog", "Cat" ]
|
|
1738
|
+
}
|
|
1739
|
+
}
|
|
1732
1740
|
}
|
|
1733
1741
|
}
|
|
1734
1742
|
}
|