@json-editor/json-editor 2.12.0 → 2.13.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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  ### Unreleased
2
2
 
3
+ ### 2.13.0
4
+
5
+ - Added feature #1448 enumTitle for headerTemplates
6
+ - Fixed issue #1442 tpe button editors
7
+ - Fixed issue #1433 simplemde editor data sync
8
+ - Added schema validation in playground
9
+ - Fixed tests timing issues
10
+
3
11
  ### 2.12.0
4
12
 
5
13
  - 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
- "type": "button",
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
  }