@json-editor/json-editor 2.7.0 → 2.8.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.
@@ -3,7 +3,7 @@
3
3
  * * @name JSON Editor
4
4
  * * @description JSON Schema Based Editor
5
5
  * * This library is the continuation of jdorn's great work (see also https://github.com/jdorn/json-editor/issues/800)
6
- * * @version "2.7.0"
6
+ * * @version "2.8.0"
7
7
  * * @author Jeremy Dorn
8
8
  * * @see https://github.com/jdorn/json-editor/
9
9
  * * @see https://github.com/json-editor/json-editor
@@ -8723,6 +8723,7 @@ function translateProperty(text, variables) {
8723
8723
 
8724
8724
  var options = {
8725
8725
  upload: upload,
8726
+ use_name_attributes: true,
8726
8727
  prompt_before_delete: true,
8727
8728
  use_default_values: true,
8728
8729
  max_depth: 0
@@ -12453,7 +12454,10 @@ var CheckboxEditor = /*#__PURE__*/function (_AbstractEditor) {
12453
12454
  _get(_getPrototypeOf(CheckboxEditor.prototype), "register", this).call(this);
12454
12455
 
12455
12456
  if (!this.input) return;
12456
- this.input.setAttribute('name', this.formname);
12457
+
12458
+ if (this.jsoneditor.options.use_name_attributes) {
12459
+ this.input.setAttribute('name', this.formname);
12460
+ }
12457
12461
  }
12458
12462
  }, {
12459
12463
  key: "unregister",
@@ -13970,7 +13974,10 @@ var HiddenEditor = /*#__PURE__*/function (_AbstractEditor) {
13970
13974
  _get(_getPrototypeOf(HiddenEditor.prototype), "register", this).call(this);
13971
13975
 
13972
13976
  if (!this.input) return;
13973
- this.input.setAttribute('name', this.formname);
13977
+
13978
+ if (this.jsoneditor.options.use_name_attributes) {
13979
+ this.input.setAttribute('name', this.formname);
13980
+ }
13974
13981
  }
13975
13982
  }, {
13976
13983
  key: "unregister",
@@ -15437,7 +15444,10 @@ var MultiSelectEditor = /*#__PURE__*/function (_AbstractEditor) {
15437
15444
  _get(_getPrototypeOf(MultiSelectEditor.prototype), "register", this).call(this);
15438
15445
 
15439
15446
  if (!this.input) return;
15440
- this.input.setAttribute('name', this.formname);
15447
+
15448
+ if (this.jsoneditor.options.use_name_attributes) {
15449
+ this.input.setAttribute('name', this.formname);
15450
+ }
15441
15451
  }
15442
15452
  }, {
15443
15453
  key: "unregister",
@@ -17649,31 +17659,33 @@ __webpack_require__.r(__webpack_exports__);
17649
17659
  /* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_1__);
17650
17660
  /* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ "./node_modules/core-js/modules/es.array.concat.js");
17651
17661
  /* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_2__);
17652
- /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js");
17653
- /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_3__);
17654
- /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js");
17655
- /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_4__);
17656
- /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js");
17657
- /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_5__);
17658
- /* harmony import */ var core_js_modules_es_object_create_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.object.create.js */ "./node_modules/core-js/modules/es.object.create.js");
17659
- /* harmony import */ var core_js_modules_es_object_create_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_create_js__WEBPACK_IMPORTED_MODULE_6__);
17660
- /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js");
17661
- /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_7__);
17662
- /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js");
17663
- /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_8__);
17664
- /* harmony import */ var core_js_modules_es_object_define_property_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.object.define-property.js */ "./node_modules/core-js/modules/es.object.define-property.js");
17665
- /* harmony import */ var core_js_modules_es_object_define_property_js__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_define_property_js__WEBPACK_IMPORTED_MODULE_9__);
17666
- /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js");
17667
- /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_10__);
17668
- /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js");
17669
- /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_11__);
17670
- /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js");
17671
- /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_12__);
17672
- /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js");
17673
- /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_13__);
17674
- /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js");
17675
- /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_14__);
17676
- /* harmony import */ var _select_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./select.js */ "./src/editors/select.js");
17662
+ /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js");
17663
+ /* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_3__);
17664
+ /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.object.set-prototype-of.js */ "./node_modules/core-js/modules/es.object.set-prototype-of.js");
17665
+ /* harmony import */ var core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_set_prototype_of_js__WEBPACK_IMPORTED_MODULE_4__);
17666
+ /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.object.get-prototype-of.js */ "./node_modules/core-js/modules/es.object.get-prototype-of.js");
17667
+ /* harmony import */ var core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_get_prototype_of_js__WEBPACK_IMPORTED_MODULE_5__);
17668
+ /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.reflect.construct.js */ "./node_modules/core-js/modules/es.reflect.construct.js");
17669
+ /* harmony import */ var core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_reflect_construct_js__WEBPACK_IMPORTED_MODULE_6__);
17670
+ /* harmony import */ var core_js_modules_es_object_create_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.object.create.js */ "./node_modules/core-js/modules/es.object.create.js");
17671
+ /* harmony import */ var core_js_modules_es_object_create_js__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_create_js__WEBPACK_IMPORTED_MODULE_7__);
17672
+ /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.reflect.get.js */ "./node_modules/core-js/modules/es.reflect.get.js");
17673
+ /* harmony import */ var core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_reflect_get_js__WEBPACK_IMPORTED_MODULE_8__);
17674
+ /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js");
17675
+ /* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_9__);
17676
+ /* harmony import */ var core_js_modules_es_object_define_property_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.object.define-property.js */ "./node_modules/core-js/modules/es.object.define-property.js");
17677
+ /* harmony import */ var core_js_modules_es_object_define_property_js__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_define_property_js__WEBPACK_IMPORTED_MODULE_10__);
17678
+ /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js");
17679
+ /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_11__);
17680
+ /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js");
17681
+ /* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_12__);
17682
+ /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js");
17683
+ /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_13__);
17684
+ /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js");
17685
+ /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_14__);
17686
+ /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js");
17687
+ /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_15__);
17688
+ /* harmony import */ var _select_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./select.js */ "./src/editors/select.js");
17677
17689
  function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
17678
17690
 
17679
17691
 
@@ -17692,6 +17704,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
17692
17704
 
17693
17705
 
17694
17706
 
17707
+
17695
17708
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
17696
17709
 
17697
17710
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
@@ -17760,11 +17773,16 @@ var RadioEditor = /*#__PURE__*/function (_SelectEditor) {
17760
17773
 
17761
17774
  for (var i = 0; i < this.enum_values.length; i++) {
17762
17775
  /* form radio elements */
17763
- this.input = this.theme.getFormRadio({
17764
- name: this.formname,
17776
+ var attributes = {
17765
17777
  id: "".concat(this.formname, "[").concat(i, "]"),
17766
17778
  value: this.enum_values[i]
17767
- });
17779
+ };
17780
+
17781
+ if (this.jsoneditor.options.use_name_attributes) {
17782
+ attributes.name = this.formname;
17783
+ }
17784
+
17785
+ this.input = this.theme.getFormRadio(attributes);
17768
17786
  /* Set custom attributes on input element. Parameter is array of protected keys. Empty array if none. */
17769
17787
 
17770
17788
  this.setInputAttributes(['id', 'value', 'name']);
@@ -17855,7 +17873,7 @@ var RadioEditor = /*#__PURE__*/function (_SelectEditor) {
17855
17873
  }]);
17856
17874
 
17857
17875
  return RadioEditor;
17858
- }(_select_js__WEBPACK_IMPORTED_MODULE_15__["SelectEditor"]);
17876
+ }(_select_js__WEBPACK_IMPORTED_MODULE_16__["SelectEditor"]);
17859
17877
 
17860
17878
  /***/ }),
17861
17879
 
@@ -18211,7 +18229,10 @@ var SelectEditor = /*#__PURE__*/function (_AbstractEditor) {
18211
18229
  _get(_getPrototypeOf(SelectEditor.prototype), "register", this).call(this);
18212
18230
 
18213
18231
  if (!this.input) return;
18214
- this.input.setAttribute('name', this.formname);
18232
+
18233
+ if (this.jsoneditor.options.use_name_attributes) {
18234
+ this.input.setAttribute('name', this.formname);
18235
+ }
18215
18236
  }
18216
18237
  }, {
18217
18238
  key: "unregister",
@@ -19200,7 +19221,11 @@ var SignatureEditor = /*#__PURE__*/function (_StringEditor) {
19200
19221
  /* Create canvas for signature pad */
19201
19222
 
19202
19223
  var canvas = document.createElement('canvas');
19203
- canvas.setAttribute('name', formname);
19224
+
19225
+ if (this.jsoneditor.options.use_name_attributes) {
19226
+ canvas.setAttribute('name', formname);
19227
+ }
19228
+
19204
19229
  canvas.classList.add('signature');
19205
19230
  signatureContainer.appendChild(canvas);
19206
19231
  this.signaturePad = new window.SignaturePad(canvas, {
@@ -20084,7 +20109,11 @@ var StringEditor = /*#__PURE__*/function (_AbstractEditor) {
20084
20109
  _get(_getPrototypeOf(StringEditor.prototype), "register", this).call(this);
20085
20110
 
20086
20111
  if (!this.input) return;
20087
- this.input.setAttribute('name', this.formname);
20112
+
20113
+ if (this.jsoneditor.options.use_name_attributes) {
20114
+ this.input.setAttribute('name', this.formname);
20115
+ }
20116
+
20088
20117
  this.input.setAttribute('aria-label', this.formname);
20089
20118
  }
20090
20119
  }, {