@json-editor/json-editor 2.11.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/.env +1 -1
- package/CHANGELOG.md +19 -0
- package/README.md +90 -6
- 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 +417 -227
- 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 +66 -14
- package/docs/meta_schema.json +16 -1
- package/docs/radio.html +1 -1
- package/docs/scripts/ajv-validator.js +8695 -0
- 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 +19 -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/button.js +8 -2
- 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/simplemde.js +2 -1
- package/src/editors/string.js +4 -0
- package/src/editors/table.js +17 -14
- package/src/resolvers.js +13 -6
- 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/codecept.json +1 -1
- package/tests/codeceptjs/constrains/contains_test.js +3 -2
- package/tests/codeceptjs/constrains/dependentRequired_test.js +33 -0
- package/tests/codeceptjs/constrains/dependentSchemas_test.js +1 -0
- package/tests/codeceptjs/core_test.js +14 -4
- package/tests/codeceptjs/editors/advanced_test.js +1 -1
- package/tests/codeceptjs/editors/array_test.js +59 -0
- package/tests/codeceptjs/editors/autocomplete_test.js +3 -1
- package/tests/codeceptjs/editors/object_test.js +20 -0
- package/tests/codeceptjs/editors/tabs_test.js +1 -1
- 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/codeceptjs/issues/issue-gh-1431_test.js +12 -0
- package/tests/codeceptjs/issues/issue-gh-1439_test.js +12 -0
- package/tests/docker-compose-local.yml +4 -0
- package/tests/pages/array-header-template.html +59 -0
- package/tests/pages/array-selectize-create.html +62 -0
- package/tests/pages/array-table-responsive.html +65 -0
- package/tests/pages/button-icons.html +1 -1
- 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/issues/issue-gh-1431.html +49 -0
- package/tests/pages/issues/issue-gh-1439.html +69 -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 +16 -2
- 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
|
@@ -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.
|
|
6
|
+
* * @version "2.13.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
|
|
@@ -502,7 +502,9 @@ var options = {
|
|
|
502
502
|
use_name_attributes: true,
|
|
503
503
|
prompt_before_delete: true,
|
|
504
504
|
use_default_values: true,
|
|
505
|
-
max_depth: 0
|
|
505
|
+
max_depth: 0,
|
|
506
|
+
button_state_mode: 1,
|
|
507
|
+
case_sensitive_property_search: true
|
|
506
508
|
};
|
|
507
509
|
|
|
508
510
|
/* This assignment was previously in index.js but makes more sense here */
|
|
@@ -567,39 +569,41 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
567
569
|
/* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_13__);
|
|
568
570
|
/* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.array.includes.js */ "./node_modules/core-js/modules/es.array.includes.js");
|
|
569
571
|
/* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_14__);
|
|
570
|
-
/* harmony import */ var
|
|
571
|
-
/* harmony import */ var
|
|
572
|
-
/* harmony import */ var
|
|
573
|
-
/* harmony import */ var
|
|
574
|
-
/* harmony import */ var
|
|
575
|
-
/* harmony import */ var
|
|
576
|
-
/* harmony import */ var
|
|
577
|
-
/* harmony import */ var
|
|
578
|
-
/* harmony import */ var
|
|
579
|
-
/* harmony import */ var
|
|
580
|
-
/* harmony import */ var
|
|
581
|
-
/* harmony import */ var
|
|
582
|
-
/* harmony import */ var
|
|
583
|
-
/* harmony import */ var
|
|
584
|
-
/* harmony import */ var
|
|
585
|
-
/* harmony import */ var
|
|
586
|
-
/* harmony import */ var
|
|
587
|
-
/* harmony import */ var
|
|
588
|
-
/* harmony import */ var
|
|
589
|
-
/* harmony import */ var
|
|
590
|
-
/* harmony import */ var
|
|
591
|
-
/* harmony import */ var
|
|
592
|
-
/* harmony import */ var
|
|
593
|
-
/* harmony import */ var
|
|
594
|
-
/* harmony import */ var
|
|
595
|
-
/* harmony import */ var
|
|
596
|
-
/* harmony import */ var
|
|
597
|
-
/* harmony import */ var
|
|
598
|
-
/* harmony import */ var
|
|
599
|
-
/* harmony import */ var
|
|
600
|
-
/* harmony import */ var
|
|
601
|
-
/* harmony import */ var
|
|
602
|
-
/* harmony import */ var
|
|
572
|
+
/* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! core-js/modules/es.array.index-of.js */ "./node_modules/core-js/modules/es.array.index-of.js");
|
|
573
|
+
/* harmony import */ var core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_index_of_js__WEBPACK_IMPORTED_MODULE_15__);
|
|
574
|
+
/* harmony import */ var core_js_modules_es_object_values_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! core-js/modules/es.object.values.js */ "./node_modules/core-js/modules/es.object.values.js");
|
|
575
|
+
/* harmony import */ var core_js_modules_es_object_values_js__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_values_js__WEBPACK_IMPORTED_MODULE_16__);
|
|
576
|
+
/* harmony import */ var core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! core-js/modules/es.string.includes.js */ "./node_modules/core-js/modules/es.string.includes.js");
|
|
577
|
+
/* harmony import */ var core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_17__);
|
|
578
|
+
/* harmony import */ var core_js_modules_es_date_to_string_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! core-js/modules/es.date.to-string.js */ "./node_modules/core-js/modules/es.date.to-string.js");
|
|
579
|
+
/* harmony import */ var core_js_modules_es_date_to_string_js__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_date_to_string_js__WEBPACK_IMPORTED_MODULE_18__);
|
|
580
|
+
/* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ "./node_modules/core-js/modules/es.regexp.to-string.js");
|
|
581
|
+
/* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_19__);
|
|
582
|
+
/* harmony import */ var core_js_modules_es_object_entries_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! core-js/modules/es.object.entries.js */ "./node_modules/core-js/modules/es.object.entries.js");
|
|
583
|
+
/* harmony import */ var core_js_modules_es_object_entries_js__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_entries_js__WEBPACK_IMPORTED_MODULE_20__);
|
|
584
|
+
/* harmony import */ var core_js_modules_es_function_bind_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! core-js/modules/es.function.bind.js */ "./node_modules/core-js/modules/es.function.bind.js");
|
|
585
|
+
/* harmony import */ var core_js_modules_es_function_bind_js__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_function_bind_js__WEBPACK_IMPORTED_MODULE_21__);
|
|
586
|
+
/* harmony import */ var core_js_modules_es_symbol_to_primitive_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ "./node_modules/core-js/modules/es.symbol.to-primitive.js");
|
|
587
|
+
/* harmony import */ var core_js_modules_es_symbol_to_primitive_js__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_to_primitive_js__WEBPACK_IMPORTED_MODULE_22__);
|
|
588
|
+
/* harmony import */ var core_js_modules_es_date_to_primitive_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ "./node_modules/core-js/modules/es.date.to-primitive.js");
|
|
589
|
+
/* harmony import */ var core_js_modules_es_date_to_primitive_js__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_date_to_primitive_js__WEBPACK_IMPORTED_MODULE_23__);
|
|
590
|
+
/* harmony import */ var core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! core-js/modules/es.number.constructor.js */ "./node_modules/core-js/modules/es.number.constructor.js");
|
|
591
|
+
/* harmony import */ var core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_24__);
|
|
592
|
+
/* harmony import */ var core_js_modules_es_object_define_property_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! core-js/modules/es.object.define-property.js */ "./node_modules/core-js/modules/es.object.define-property.js");
|
|
593
|
+
/* harmony import */ var core_js_modules_es_object_define_property_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_define_property_js__WEBPACK_IMPORTED_MODULE_25__);
|
|
594
|
+
/* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js");
|
|
595
|
+
/* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_26__);
|
|
596
|
+
/* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js");
|
|
597
|
+
/* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_27__);
|
|
598
|
+
/* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js");
|
|
599
|
+
/* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_28___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_28__);
|
|
600
|
+
/* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js");
|
|
601
|
+
/* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_29___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_29__);
|
|
602
|
+
/* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js");
|
|
603
|
+
/* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_30___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_30__);
|
|
604
|
+
/* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js");
|
|
605
|
+
/* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_31___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_31__);
|
|
606
|
+
/* harmony import */ var _utilities_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./utilities.js */ "./src/utilities.js");
|
|
603
607
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
604
608
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
605
609
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -636,6 +640,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
636
640
|
|
|
637
641
|
|
|
638
642
|
|
|
643
|
+
|
|
639
644
|
|
|
640
645
|
|
|
641
646
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -661,7 +666,7 @@ var AbstractEditor = /*#__PURE__*/function () {
|
|
|
661
666
|
this.original_schema = options.schema;
|
|
662
667
|
this.schema = this.jsoneditor.expandSchema(this.original_schema);
|
|
663
668
|
this.active = true;
|
|
664
|
-
this.options = (0,
|
|
669
|
+
this.options = (0,_utilities_js__WEBPACK_IMPORTED_MODULE_32__.extend)({}, this.options || {}, this.schema.options || {}, options.schema.options || {}, options);
|
|
665
670
|
this.formname = this.jsoneditor.options.form_name_root || 'root';
|
|
666
671
|
if (!options.path && !this.schema.id) this.schema.id = this.formname;
|
|
667
672
|
this.path = options.path || this.formname;
|
|
@@ -824,10 +829,10 @@ var AbstractEditor = /*#__PURE__*/function () {
|
|
|
824
829
|
this.dependenciesFulfilled = choices === value;
|
|
825
830
|
} else {
|
|
826
831
|
Object.keys(choices).some(function (key) {
|
|
827
|
-
if (!(0,
|
|
832
|
+
if (!(0,_utilities_js__WEBPACK_IMPORTED_MODULE_32__.hasOwnProperty)(choices, key)) {
|
|
828
833
|
return false;
|
|
829
834
|
}
|
|
830
|
-
if (!(0,
|
|
835
|
+
if (!(0,_utilities_js__WEBPACK_IMPORTED_MODULE_32__.hasOwnProperty)(value, key) || choices[key] !== value[key]) {
|
|
831
836
|
_this3.dependenciesFulfilled = false;
|
|
832
837
|
return true;
|
|
833
838
|
}
|
|
@@ -894,9 +899,9 @@ var AbstractEditor = /*#__PURE__*/function () {
|
|
|
894
899
|
value: function postBuild() {
|
|
895
900
|
this.setupWatchListeners();
|
|
896
901
|
this.addLinks();
|
|
902
|
+
this.register();
|
|
897
903
|
this.setValue(this.getDefault(), true);
|
|
898
904
|
this.updateHeaderText();
|
|
899
|
-
this.register();
|
|
900
905
|
this.onWatchedFieldChange();
|
|
901
906
|
}
|
|
902
907
|
}, {
|
|
@@ -912,7 +917,7 @@ var AbstractEditor = /*#__PURE__*/function () {
|
|
|
912
917
|
_this5.onWatchedFieldChange();
|
|
913
918
|
}
|
|
914
919
|
};
|
|
915
|
-
if ((0,
|
|
920
|
+
if ((0,_utilities_js__WEBPACK_IMPORTED_MODULE_32__.hasOwnProperty)(this.schema, 'watch')) {
|
|
916
921
|
var path;
|
|
917
922
|
var pathParts;
|
|
918
923
|
var first;
|
|
@@ -1148,15 +1153,31 @@ var AbstractEditor = /*#__PURE__*/function () {
|
|
|
1148
1153
|
}, {
|
|
1149
1154
|
key: "onWatchedFieldChange",
|
|
1150
1155
|
value: function onWatchedFieldChange() {
|
|
1156
|
+
var _this7 = this;
|
|
1151
1157
|
var vars;
|
|
1152
1158
|
if (this.header_template) {
|
|
1153
|
-
vars = (0,
|
|
1159
|
+
vars = (0,_utilities_js__WEBPACK_IMPORTED_MODULE_32__.extend)(this.getWatchedFieldValues(), {
|
|
1154
1160
|
key: this.key,
|
|
1155
1161
|
i: this.key,
|
|
1156
1162
|
i0: this.key * 1,
|
|
1157
1163
|
i1: this.key * 1 + 1,
|
|
1158
1164
|
title: this.getTitle()
|
|
1159
1165
|
});
|
|
1166
|
+
|
|
1167
|
+
// object properties
|
|
1168
|
+
if (Object.keys(this.editors).length) {
|
|
1169
|
+
Object.keys(this.editors).forEach(function (key) {
|
|
1170
|
+
var editor = _this7.editors[key];
|
|
1171
|
+
if (editor.schema && editor.schema["enum"] && editor.schema.options && editor.schema.options.enum_titles) {
|
|
1172
|
+
var enumIndex = editor.schema["enum"].indexOf(editor.value);
|
|
1173
|
+
var enumTitle = editor.options.enum_titles[enumIndex];
|
|
1174
|
+
vars.properties = {};
|
|
1175
|
+
vars.properties[key] = {
|
|
1176
|
+
enumTitle: enumTitle
|
|
1177
|
+
};
|
|
1178
|
+
}
|
|
1179
|
+
});
|
|
1180
|
+
}
|
|
1160
1181
|
var headerText = this.header_template(vars);
|
|
1161
1182
|
if (headerText !== this.header_text) {
|
|
1162
1183
|
this.header_text = headerText;
|
|
@@ -1197,11 +1218,11 @@ var AbstractEditor = /*#__PURE__*/function () {
|
|
|
1197
1218
|
}, {
|
|
1198
1219
|
key: "destroy",
|
|
1199
1220
|
value: function destroy() {
|
|
1200
|
-
var
|
|
1221
|
+
var _this8 = this;
|
|
1201
1222
|
this.unregister(this);
|
|
1202
1223
|
if (this.watched) {
|
|
1203
1224
|
Object.values(this.watched).forEach(function (adjustedPath) {
|
|
1204
|
-
return
|
|
1225
|
+
return _this8.jsoneditor.unwatch(adjustedPath, _this8.watch_listener);
|
|
1205
1226
|
});
|
|
1206
1227
|
}
|
|
1207
1228
|
this.watched = null;
|
|
@@ -1329,13 +1350,13 @@ var AbstractEditor = /*#__PURE__*/function () {
|
|
|
1329
1350
|
}, {
|
|
1330
1351
|
key: "setInputAttributes",
|
|
1331
1352
|
value: function setInputAttributes(inputAttribute) {
|
|
1332
|
-
var
|
|
1353
|
+
var _this9 = this;
|
|
1333
1354
|
if (this.schema.options && this.schema.options.inputAttributes) {
|
|
1334
1355
|
var inputAttributes = this.schema.options.inputAttributes;
|
|
1335
1356
|
var protectedAttributes = ['name', 'type'].concat(inputAttribute);
|
|
1336
1357
|
Object.keys(inputAttributes).forEach(function (key) {
|
|
1337
1358
|
if (!protectedAttributes.includes(key.toLowerCase())) {
|
|
1338
|
-
|
|
1359
|
+
_this9.input.setAttribute(key, inputAttributes[key]);
|
|
1339
1360
|
}
|
|
1340
1361
|
});
|
|
1341
1362
|
}
|
|
@@ -1343,13 +1364,13 @@ var AbstractEditor = /*#__PURE__*/function () {
|
|
|
1343
1364
|
}, {
|
|
1344
1365
|
key: "setContainerAttributes",
|
|
1345
1366
|
value: function setContainerAttributes() {
|
|
1346
|
-
var
|
|
1367
|
+
var _this10 = this;
|
|
1347
1368
|
if (this.schema.options && this.schema.options.containerAttributes) {
|
|
1348
1369
|
var containerAttributes = this.schema.options.containerAttributes;
|
|
1349
1370
|
var protectedAttributes = ['data-schemapath', 'data-schematype', 'data-schemaid'];
|
|
1350
1371
|
Object.keys(containerAttributes).forEach(function (key) {
|
|
1351
1372
|
if (!protectedAttributes.includes(key.toLowerCase())) {
|
|
1352
|
-
|
|
1373
|
+
_this10.container.setAttribute(key, containerAttributes[key]);
|
|
1353
1374
|
}
|
|
1354
1375
|
});
|
|
1355
1376
|
}
|
|
@@ -1357,16 +1378,16 @@ var AbstractEditor = /*#__PURE__*/function () {
|
|
|
1357
1378
|
}, {
|
|
1358
1379
|
key: "expandCallbacks",
|
|
1359
1380
|
value: function expandCallbacks(scope, options) {
|
|
1360
|
-
var
|
|
1381
|
+
var _this11 = this;
|
|
1361
1382
|
var callback = this.defaults.callbacks[scope];
|
|
1362
1383
|
Object.entries(options).forEach(function (_ref) {
|
|
1363
1384
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
1364
1385
|
key = _ref2[0],
|
|
1365
1386
|
value = _ref2[1];
|
|
1366
1387
|
if (value === Object(value)) {
|
|
1367
|
-
options[key] =
|
|
1388
|
+
options[key] = _this11.expandCallbacks(scope, value);
|
|
1368
1389
|
} else if (typeof value === 'string' && _typeof(callback) === 'object' && typeof callback[value] === 'function') {
|
|
1369
|
-
options[key] = callback[value].bind(null,
|
|
1390
|
+
options[key] = callback[value].bind(null, _this11);
|
|
1370
1391
|
}
|
|
1371
1392
|
});
|
|
1372
1393
|
return options;
|
|
@@ -2098,36 +2119,46 @@ var ArrayEditor = /*#__PURE__*/function (_AbstractEditor) {
|
|
|
2098
2119
|
/* TODO: sortable */
|
|
2099
2120
|
}
|
|
2100
2121
|
}, {
|
|
2101
|
-
key: "
|
|
2102
|
-
value: function
|
|
2103
|
-
|
|
2122
|
+
key: "setButtonState",
|
|
2123
|
+
value: function setButtonState(element, display) {
|
|
2124
|
+
var buttonStateMode = this.options.button_state_mode || this.jsoneditor.options.button_state_mode;
|
|
2125
|
+
switch (buttonStateMode) {
|
|
2126
|
+
case 1:
|
|
2127
|
+
element.style.display = display ? '' : 'none';
|
|
2128
|
+
break;
|
|
2129
|
+
case 2:
|
|
2130
|
+
element.disabled = !display;
|
|
2131
|
+
break;
|
|
2132
|
+
default:
|
|
2133
|
+
element.style.display = display ? '' : 'none';
|
|
2134
|
+
}
|
|
2104
2135
|
}
|
|
2105
2136
|
}, {
|
|
2106
2137
|
key: "setupButtons",
|
|
2107
2138
|
value: function setupButtons(minItems) {
|
|
2108
2139
|
var controlsNeeded = [];
|
|
2109
2140
|
if (!this.value.length) {
|
|
2110
|
-
this.delete_last_row_button
|
|
2111
|
-
this.remove_all_rows_button
|
|
2141
|
+
this.setButtonState(this.delete_last_row_button, false);
|
|
2142
|
+
this.setButtonState(this.remove_all_rows_button, false);
|
|
2112
2143
|
} else if (this.value.length === 1) {
|
|
2113
|
-
this.remove_all_rows_button
|
|
2144
|
+
this.setButtonState(this.remove_all_rows_button, false);
|
|
2114
2145
|
|
|
2115
2146
|
/* If there are minItems items in the array, or configured to hide the delete_last_row button, hide the delete button beneath the rows */
|
|
2116
2147
|
var _display = !(minItems || this.hide_delete_last_row_buttons);
|
|
2117
|
-
this.
|
|
2148
|
+
this.setButtonState(this.delete_last_row_button, _display);
|
|
2118
2149
|
controlsNeeded.push(_display);
|
|
2119
2150
|
} else {
|
|
2120
2151
|
var display1 = !(minItems || this.hide_delete_last_row_buttons);
|
|
2121
|
-
this.
|
|
2152
|
+
this.setButtonState(this.delete_last_row_button, display1);
|
|
2122
2153
|
controlsNeeded.push(display1);
|
|
2123
2154
|
var display2 = !(minItems || this.hide_delete_all_rows_buttons);
|
|
2124
|
-
this.
|
|
2155
|
+
this.setButtonState(this.remove_all_rows_button, display2);
|
|
2125
2156
|
controlsNeeded.push(display2);
|
|
2126
2157
|
}
|
|
2127
2158
|
|
|
2128
2159
|
/* If there are maxItems in the array, hide the add button beneath the rows */
|
|
2129
2160
|
var display = !(this.getMax() && this.getMax() <= this.rows.length || this.hide_add_button);
|
|
2130
|
-
this.
|
|
2161
|
+
this.setButtonState(this.add_row_button, display);
|
|
2131
2162
|
controlsNeeded.push(display);
|
|
2132
2163
|
return controlsNeeded.some(function (e) {
|
|
2133
2164
|
return e;
|
|
@@ -2149,12 +2180,12 @@ var ArrayEditor = /*#__PURE__*/function (_AbstractEditor) {
|
|
|
2149
2180
|
/* Hide the move down button for the last row */
|
|
2150
2181
|
if (editor.movedown_button) {
|
|
2151
2182
|
var display = i !== _this6.rows.length - 1;
|
|
2152
|
-
_this6.
|
|
2183
|
+
_this6.setButtonState(editor.movedown_button, display);
|
|
2153
2184
|
}
|
|
2154
2185
|
|
|
2155
2186
|
/* Hide the delete button if we have minItems items */
|
|
2156
2187
|
if (editor.delete_button) {
|
|
2157
|
-
_this6.
|
|
2188
|
+
_this6.setButtonState(editor.delete_button, !minItems);
|
|
2158
2189
|
}
|
|
2159
2190
|
|
|
2160
2191
|
/* Get the value for this editor */
|
|
@@ -2381,8 +2412,8 @@ var ArrayEditor = /*#__PURE__*/function (_AbstractEditor) {
|
|
|
2381
2412
|
button.addEventListener('click', function (e) {
|
|
2382
2413
|
e.preventDefault();
|
|
2383
2414
|
e.stopPropagation();
|
|
2384
|
-
if (_this12.panel) _this12.
|
|
2385
|
-
if (_this12.tabs_holder) _this12.
|
|
2415
|
+
if (_this12.panel) _this12.setButtonState(_this12.panel, _this12.collapsed);
|
|
2416
|
+
if (_this12.tabs_holder) _this12.setButtonState(_this12.tabs_holder, _this12.collapsed);
|
|
2386
2417
|
if (_this12.collapsed) {
|
|
2387
2418
|
_this12.collapsed = false;
|
|
2388
2419
|
_this12.row_holder.style.display = rowHolderDisplay;
|
|
@@ -3111,8 +3142,6 @@ var ArraySelectizeEditor = /*#__PURE__*/function (_MultiSelectEditor) {
|
|
|
3111
3142
|
this.option_keys.push("".concat(value));
|
|
3112
3143
|
this.option_titles.push("".concat(value));
|
|
3113
3144
|
this.select_values["".concat(value)] = value;
|
|
3114
|
-
/* Update Schema enum to prevent triggering "Value must be one of the enumerated values" */
|
|
3115
|
-
this.schema.items["enum"].push(value);
|
|
3116
3145
|
/* Add new value and label to selectize */
|
|
3117
3146
|
this.selectize_instance.addOption({
|
|
3118
3147
|
text: value,
|
|
@@ -3460,6 +3489,7 @@ var Base64Editor = /*#__PURE__*/function (_AbstractEditor) {
|
|
|
3460
3489
|
|
|
3461
3490
|
/* File uploader */
|
|
3462
3491
|
this.uploader = this.theme.getFormInputField('file');
|
|
3492
|
+
this.uploader.style.display = 'none';
|
|
3463
3493
|
|
|
3464
3494
|
/* Set attribute of file input field to 'multiple' if: */
|
|
3465
3495
|
/* 'multiple' key has been set to 'true' in the schema */
|
|
@@ -3506,6 +3536,11 @@ var Base64Editor = /*#__PURE__*/function (_AbstractEditor) {
|
|
|
3506
3536
|
this.container.appendChild(this.preview);
|
|
3507
3537
|
this.control = this.theme.getFormControl(this.label, this.uploader || this.input, this.preview, this.infoButton);
|
|
3508
3538
|
this.container.appendChild(this.control);
|
|
3539
|
+
var uploadButton = this.getButton('button_upload', 'upload', 'button_upload');
|
|
3540
|
+
uploadButton.addEventListener('click', function () {
|
|
3541
|
+
_this2.uploader.click();
|
|
3542
|
+
});
|
|
3543
|
+
this.control.appendChild(uploadButton);
|
|
3509
3544
|
}
|
|
3510
3545
|
}, {
|
|
3511
3546
|
key: "refreshPreview",
|
|
@@ -3693,7 +3728,6 @@ var ButtonEditor = /*#__PURE__*/function (_AbstractEditor) {
|
|
|
3693
3728
|
|
|
3694
3729
|
/* Get options, either global options from "this.defaults.options.button" or */
|
|
3695
3730
|
/* single property options from schema "options.button" */
|
|
3696
|
-
var title = this.translateProperty(this.schema.title) || this.key;
|
|
3697
3731
|
var options = this.expandCallbacks('button', (0,_utilities_js__WEBPACK_IMPORTED_MODULE_22__.extend)({}, {
|
|
3698
3732
|
icon: '',
|
|
3699
3733
|
validated: false,
|
|
@@ -3702,8 +3736,13 @@ var ButtonEditor = /*#__PURE__*/function (_AbstractEditor) {
|
|
|
3702
3736
|
window.alert("No button action defined for \"".concat(jseditor.path, "\""));
|
|
3703
3737
|
}
|
|
3704
3738
|
}, this.defaults.options.button || {}, this.options.button || {}));
|
|
3739
|
+
var title = this.translateProperty(options.text || this.schema.title) || this.key;
|
|
3705
3740
|
this.input = this.getButton(title, options.icon, title);
|
|
3706
|
-
|
|
3741
|
+
if (typeof options.action !== 'function') {
|
|
3742
|
+
window.alert("No button action defined for \"".concat(this.path, "\""));
|
|
3743
|
+
} else {
|
|
3744
|
+
this.input.addEventListener('click', options.action, false);
|
|
3745
|
+
}
|
|
3707
3746
|
if (this.schema.readOnly || this.schema.readonly || this.schema.template) {
|
|
3708
3747
|
this.disable(true);
|
|
3709
3748
|
this.input.setAttribute('readonly', 'true');
|
|
@@ -5732,8 +5771,9 @@ var IntegerEditor = /*#__PURE__*/function (_NumberEditor) {
|
|
|
5732
5771
|
return undefined;
|
|
5733
5772
|
}
|
|
5734
5773
|
if (!this.schema["default"] && !this.jsoneditor.options.use_default_values && this.value === '') {
|
|
5735
|
-
this.
|
|
5736
|
-
|
|
5774
|
+
if (this.shouldBeUnset()) {
|
|
5775
|
+
return undefined;
|
|
5776
|
+
}
|
|
5737
5777
|
} else {
|
|
5738
5778
|
return (0,_utilities_js__WEBPACK_IMPORTED_MODULE_18__.isInteger)(this.value) ? parseInt(this.value) : this.value;
|
|
5739
5779
|
}
|
|
@@ -6420,6 +6460,9 @@ var MultipleEditor = /*#__PURE__*/function (_AbstractEditor) {
|
|
|
6420
6460
|
}, {
|
|
6421
6461
|
key: "refreshValue",
|
|
6422
6462
|
value: function refreshValue() {
|
|
6463
|
+
if (!this.editors[this.type]) {
|
|
6464
|
+
return;
|
|
6465
|
+
}
|
|
6423
6466
|
this.value = this.editors[this.type].getValue();
|
|
6424
6467
|
}
|
|
6425
6468
|
}, {
|
|
@@ -7182,8 +7225,10 @@ var NumberEditor = /*#__PURE__*/function (_StringEditor) {
|
|
|
7182
7225
|
return undefined;
|
|
7183
7226
|
}
|
|
7184
7227
|
if (!this.schema["default"] && !this.jsoneditor.options.use_default_values && this.value === '') {
|
|
7185
|
-
this.
|
|
7186
|
-
|
|
7228
|
+
if (this.shouldBeUnset()) {
|
|
7229
|
+
this.input.value = '';
|
|
7230
|
+
return undefined;
|
|
7231
|
+
}
|
|
7187
7232
|
} else {
|
|
7188
7233
|
return (0,_utilities__WEBPACK_IMPORTED_MODULE_20__.isNumber)(this.value) ? parseFloat(this.value) : this.value;
|
|
7189
7234
|
}
|
|
@@ -8000,7 +8045,14 @@ var ObjectEditor = /*#__PURE__*/function (_AbstractEditor) {
|
|
|
8000
8045
|
});
|
|
8001
8046
|
this.addproperty_input.addEventListener('input', function (e) {
|
|
8002
8047
|
e.target.previousSibling.childNodes.forEach(function (value) {
|
|
8003
|
-
|
|
8048
|
+
var searchTerm = value.innerText;
|
|
8049
|
+
var propertyTitle = e.target.value;
|
|
8050
|
+
var caseSensitivePropertySearch = _this7.options.case_sensitive_property_search || _this7.jsoneditor.options.case_sensitive_property_search;
|
|
8051
|
+
if (!caseSensitivePropertySearch) {
|
|
8052
|
+
searchTerm = searchTerm.toLowerCase();
|
|
8053
|
+
propertyTitle = propertyTitle.toLowerCase();
|
|
8054
|
+
}
|
|
8055
|
+
if (searchTerm.includes(propertyTitle)) {
|
|
8004
8056
|
value.style.display = '';
|
|
8005
8057
|
} else {
|
|
8006
8058
|
value.style.display = 'none';
|
|
@@ -8424,10 +8476,30 @@ var ObjectEditor = /*#__PURE__*/function (_AbstractEditor) {
|
|
|
8424
8476
|
}, {
|
|
8425
8477
|
key: "canHaveAdditionalProperties",
|
|
8426
8478
|
value: function canHaveAdditionalProperties() {
|
|
8479
|
+
// schemas have priority over options
|
|
8480
|
+
// local options have priority over global options
|
|
8481
|
+
// lastly global options are evaluated
|
|
8482
|
+
|
|
8483
|
+
// If the schema additionalProperties keyword is a boolean let the keyword decide
|
|
8427
8484
|
if (typeof this.schema.additionalProperties === 'boolean') {
|
|
8428
8485
|
return this.schema.additionalProperties;
|
|
8429
8486
|
}
|
|
8430
|
-
|
|
8487
|
+
|
|
8488
|
+
// If the schema additionalProperties keyword is a schema then additional properties are allowed and limited by such schema
|
|
8489
|
+
if (_typeof(this.schema.additionalProperties) === 'object' && this.schema.additionalProperties !== null) {
|
|
8490
|
+
return true;
|
|
8491
|
+
}
|
|
8492
|
+
|
|
8493
|
+
// If the schema options no_additional_properties is a boolean let the option decide
|
|
8494
|
+
if (typeof this.options.no_additional_properties === 'boolean') {
|
|
8495
|
+
return !this.options.no_additional_properties;
|
|
8496
|
+
}
|
|
8497
|
+
|
|
8498
|
+
// If the global options no_additional_properties is a boolean let the option decide
|
|
8499
|
+
if (typeof this.jsoneditor.options.no_additional_properties === 'boolean') {
|
|
8500
|
+
return !this.jsoneditor.options.no_additional_properties;
|
|
8501
|
+
}
|
|
8502
|
+
return true;
|
|
8431
8503
|
}
|
|
8432
8504
|
}, {
|
|
8433
8505
|
key: "destroy",
|
|
@@ -8474,15 +8546,53 @@ var ObjectEditor = /*#__PURE__*/function (_AbstractEditor) {
|
|
|
8474
8546
|
}
|
|
8475
8547
|
Object.keys(this.editors).forEach(function (i) {
|
|
8476
8548
|
if (_this10.editors[i].isActive()) {
|
|
8549
|
+
_this10.editors[i].refreshValue();
|
|
8477
8550
|
_this10.value[i] = _this10.editors[i].getValue();
|
|
8478
8551
|
}
|
|
8479
8552
|
});
|
|
8480
|
-
|
|
8553
|
+
Object.keys(this.editors).forEach(function (i) {
|
|
8554
|
+
if (_this10.editors[i].isActive()) {
|
|
8555
|
+
_this10.activateDependentRequired(_this10.editors[i].key);
|
|
8556
|
+
}
|
|
8557
|
+
});
|
|
8558
|
+
if (this.adding_property) {
|
|
8559
|
+
this.refreshAddProperties();
|
|
8560
|
+
}
|
|
8561
|
+
}
|
|
8562
|
+
}, {
|
|
8563
|
+
key: "activateDependentRequired",
|
|
8564
|
+
value: function activateDependentRequired(key) {
|
|
8565
|
+
var _this11 = this;
|
|
8566
|
+
var dependentRequired = this.getDependentRequired(key);
|
|
8567
|
+
dependentRequired.forEach(function (requiredProperty) {
|
|
8568
|
+
var dependentRequiredEditor;
|
|
8569
|
+
Object.entries(_this11.cached_editors).forEach(function (_ref7) {
|
|
8570
|
+
var _ref8 = _slicedToArray(_ref7, 2),
|
|
8571
|
+
i = _ref8[0],
|
|
8572
|
+
cachedEditor = _ref8[1];
|
|
8573
|
+
if (cachedEditor.key === requiredProperty) {
|
|
8574
|
+
dependentRequiredEditor = cachedEditor;
|
|
8575
|
+
}
|
|
8576
|
+
});
|
|
8577
|
+
if (dependentRequiredEditor && !dependentRequiredEditor.isActive()) {
|
|
8578
|
+
dependentRequiredEditor.activate();
|
|
8579
|
+
}
|
|
8580
|
+
});
|
|
8581
|
+
}
|
|
8582
|
+
}, {
|
|
8583
|
+
key: "getDependentRequired",
|
|
8584
|
+
value: function getDependentRequired(property) {
|
|
8585
|
+
if (this.schema.dependentRequired) {
|
|
8586
|
+
if ((0,_utilities_js__WEBPACK_IMPORTED_MODULE_40__.hasOwnProperty)(this.schema.dependentRequired, property)) {
|
|
8587
|
+
return this.schema.dependentRequired[property];
|
|
8588
|
+
}
|
|
8589
|
+
}
|
|
8590
|
+
return [];
|
|
8481
8591
|
}
|
|
8482
8592
|
}, {
|
|
8483
8593
|
key: "refreshAddProperties",
|
|
8484
8594
|
value: function refreshAddProperties() {
|
|
8485
|
-
var
|
|
8595
|
+
var _this12 = this;
|
|
8486
8596
|
if (this.options.disable_properties || this.options.disable_properties !== false && this.jsoneditor.options.disable_properties) {
|
|
8487
8597
|
this.addproperty_button.style.display = 'none';
|
|
8488
8598
|
return;
|
|
@@ -8505,18 +8615,18 @@ var ObjectEditor = /*#__PURE__*/function (_AbstractEditor) {
|
|
|
8505
8615
|
|
|
8506
8616
|
/* Check for which editors can't be removed or added back */
|
|
8507
8617
|
Object.keys(this.cached_editors).forEach(function (i) {
|
|
8508
|
-
|
|
8509
|
-
if (
|
|
8510
|
-
|
|
8511
|
-
}
|
|
8512
|
-
if (typeof
|
|
8513
|
-
|
|
8514
|
-
if (!
|
|
8515
|
-
} else if (!(i in
|
|
8516
|
-
if (!canAdd && !(0,_utilities_js__WEBPACK_IMPORTED_MODULE_40__.hasOwnProperty)(
|
|
8517
|
-
|
|
8618
|
+
_this12.addPropertyCheckbox(i);
|
|
8619
|
+
if (_this12.isRequiredObject(_this12.cached_editors[i]) && i in _this12.editors) {
|
|
8620
|
+
_this12.addproperty_checkboxes[i].disabled = true;
|
|
8621
|
+
}
|
|
8622
|
+
if (typeof _this12.schema.minProperties !== 'undefined' && numProps <= _this12.schema.minProperties) {
|
|
8623
|
+
_this12.addproperty_checkboxes[i].disabled = _this12.addproperty_checkboxes[i].checked;
|
|
8624
|
+
if (!_this12.addproperty_checkboxes[i].checked) showModal = true;
|
|
8625
|
+
} else if (!(i in _this12.editors)) {
|
|
8626
|
+
if (!canAdd && !(0,_utilities_js__WEBPACK_IMPORTED_MODULE_40__.hasOwnProperty)(_this12.schema.properties, i)) {
|
|
8627
|
+
_this12.addproperty_checkboxes[i].disabled = true;
|
|
8518
8628
|
} else {
|
|
8519
|
-
|
|
8629
|
+
_this12.addproperty_checkboxes[i].disabled = false;
|
|
8520
8630
|
showModal = true;
|
|
8521
8631
|
}
|
|
8522
8632
|
} else {
|
|
@@ -8529,9 +8639,9 @@ var ObjectEditor = /*#__PURE__*/function (_AbstractEditor) {
|
|
|
8529
8639
|
|
|
8530
8640
|
/* Additional addproperty checkboxes not tied to a current editor */
|
|
8531
8641
|
Object.keys(this.schema.properties).forEach(function (i) {
|
|
8532
|
-
if (
|
|
8642
|
+
if (_this12.cached_editors[i]) return;
|
|
8533
8643
|
showModal = true;
|
|
8534
|
-
|
|
8644
|
+
_this12.addPropertyCheckbox(i);
|
|
8535
8645
|
});
|
|
8536
8646
|
|
|
8537
8647
|
/* If no editors can be added or removed, hide the modal button */
|
|
@@ -8562,39 +8672,39 @@ var ObjectEditor = /*#__PURE__*/function (_AbstractEditor) {
|
|
|
8562
8672
|
}, {
|
|
8563
8673
|
key: "setValue",
|
|
8564
8674
|
value: function setValue(value, initial) {
|
|
8565
|
-
var
|
|
8675
|
+
var _this13 = this;
|
|
8566
8676
|
value = value || {};
|
|
8567
8677
|
if (_typeof(value) !== 'object' || Array.isArray(value)) value = {};
|
|
8568
8678
|
|
|
8569
8679
|
/* First, set the values for all of the defined properties */
|
|
8570
|
-
Object.entries(this.cached_editors).forEach(function (
|
|
8571
|
-
var
|
|
8572
|
-
i =
|
|
8573
|
-
editor =
|
|
8680
|
+
Object.entries(this.cached_editors).forEach(function (_ref9) {
|
|
8681
|
+
var _ref10 = _slicedToArray(_ref9, 2),
|
|
8682
|
+
i = _ref10[0],
|
|
8683
|
+
editor = _ref10[1];
|
|
8574
8684
|
/* Value explicitly set */
|
|
8575
8685
|
if (typeof value[i] !== 'undefined') {
|
|
8576
|
-
|
|
8686
|
+
_this13.addObjectProperty(i);
|
|
8577
8687
|
editor.setValue(value[i], initial);
|
|
8578
8688
|
editor.activate();
|
|
8579
8689
|
/* Otherwise, remove value unless this is the initial set or it's required */
|
|
8580
|
-
} else if (!initial && !
|
|
8581
|
-
if (
|
|
8690
|
+
} else if (!initial && !_this13.isRequiredObject(editor)) {
|
|
8691
|
+
if (_this13.jsoneditor.options.show_opt_in || _this13.options.show_opt_in) {
|
|
8582
8692
|
editor.deactivate();
|
|
8583
8693
|
} else {
|
|
8584
|
-
|
|
8694
|
+
_this13.removeObjectProperty(i);
|
|
8585
8695
|
}
|
|
8586
8696
|
/* Otherwise, set the value to the default */
|
|
8587
8697
|
} else {
|
|
8588
8698
|
editor.setValue(editor.getDefault(), initial);
|
|
8589
8699
|
}
|
|
8590
8700
|
});
|
|
8591
|
-
Object.entries(value).forEach(function (
|
|
8592
|
-
var
|
|
8593
|
-
i =
|
|
8594
|
-
val =
|
|
8595
|
-
if (!
|
|
8596
|
-
|
|
8597
|
-
if (
|
|
8701
|
+
Object.entries(value).forEach(function (_ref11) {
|
|
8702
|
+
var _ref12 = _slicedToArray(_ref11, 2),
|
|
8703
|
+
i = _ref12[0],
|
|
8704
|
+
val = _ref12[1];
|
|
8705
|
+
if (!_this13.cached_editors[i]) {
|
|
8706
|
+
_this13.addObjectProperty(i);
|
|
8707
|
+
if (_this13.editors[i]) _this13.editors[i].setValue(val, initial, !!_this13.editors[i].template);
|
|
8598
8708
|
}
|
|
8599
8709
|
});
|
|
8600
8710
|
this.refreshValue();
|
|
@@ -8604,12 +8714,12 @@ var ObjectEditor = /*#__PURE__*/function (_AbstractEditor) {
|
|
|
8604
8714
|
}, {
|
|
8605
8715
|
key: "showValidationErrors",
|
|
8606
8716
|
value: function showValidationErrors(errors) {
|
|
8607
|
-
var
|
|
8717
|
+
var _this14 = this;
|
|
8608
8718
|
/* Get all the errors that pertain to this editor */
|
|
8609
8719
|
var myErrors = [];
|
|
8610
8720
|
var otherErrors = [];
|
|
8611
8721
|
errors.forEach(function (error) {
|
|
8612
|
-
if (error.path ===
|
|
8722
|
+
if (error.path === _this14.path) {
|
|
8613
8723
|
myErrors.push(error);
|
|
8614
8724
|
} else {
|
|
8615
8725
|
otherErrors.push(error);
|
|
@@ -8623,7 +8733,7 @@ var ObjectEditor = /*#__PURE__*/function (_AbstractEditor) {
|
|
|
8623
8733
|
this.error_holder.style.display = '';
|
|
8624
8734
|
myErrors.forEach(function (error) {
|
|
8625
8735
|
if (error.errorcount && error.errorcount > 1) error.message += " (".concat(error.errorcount, " errors)");
|
|
8626
|
-
|
|
8736
|
+
_this14.error_holder.appendChild(_this14.theme.getErrorMessage(error.message));
|
|
8627
8737
|
});
|
|
8628
8738
|
/* Hide error area */
|
|
8629
8739
|
} else {
|
|
@@ -10076,21 +10186,20 @@ var SignatureEditor = /*#__PURE__*/function (_StringEditor) {
|
|
|
10076
10186
|
}
|
|
10077
10187
|
canvas.classList.add('signature');
|
|
10078
10188
|
signatureContainer.appendChild(canvas);
|
|
10079
|
-
this.signaturePad = new window.SignaturePad(canvas
|
|
10080
|
-
|
|
10081
|
-
|
|
10082
|
-
|
|
10083
|
-
|
|
10084
|
-
|
|
10085
|
-
|
|
10086
|
-
}
|
|
10087
|
-
this.is_dirty = true;
|
|
10088
|
-
this.refreshValue();
|
|
10089
|
-
this.watch_listener();
|
|
10090
|
-
this.jsoneditor.notifyWatchers(this.path);
|
|
10091
|
-
if (this.parent) this.parent.onChildEditorChange(this);else this.jsoneditor.onChange();
|
|
10189
|
+
this.signaturePad = new window.SignaturePad(canvas);
|
|
10190
|
+
this.signaturePad.onEnd = function () {
|
|
10191
|
+
/* check if the signature is not empty before setting a value */
|
|
10192
|
+
if (!_this.signaturePad.isEmpty()) {
|
|
10193
|
+
_this.input.value = _this.signaturePad.toDataURL();
|
|
10194
|
+
} else {
|
|
10195
|
+
_this.input.value = '';
|
|
10092
10196
|
}
|
|
10093
|
-
|
|
10197
|
+
_this.is_dirty = true;
|
|
10198
|
+
_this.refreshValue();
|
|
10199
|
+
_this.watch_listener();
|
|
10200
|
+
_this.jsoneditor.notifyWatchers(_this.path);
|
|
10201
|
+
if (_this.parent) _this.parent.onChildEditorChange(_this);else _this.jsoneditor.onChange();
|
|
10202
|
+
};
|
|
10094
10203
|
|
|
10095
10204
|
/* create button containers and add clear signature button */
|
|
10096
10205
|
var buttons = document.createElement('div');
|
|
@@ -10283,7 +10392,8 @@ var SimplemdeEditor = /*#__PURE__*/function (_StringEditor) {
|
|
|
10283
10392
|
options = this.expandCallbacks('simplemde', (0,_utilities_js__WEBPACK_IMPORTED_MODULE_20__.extend)({}, {
|
|
10284
10393
|
height: 300
|
|
10285
10394
|
}, this.defaults.options.simplemde || {}, this.options.simplemde || {}, {
|
|
10286
|
-
element: this.input
|
|
10395
|
+
element: this.input,
|
|
10396
|
+
forceSync: true
|
|
10287
10397
|
}));
|
|
10288
10398
|
this.simplemde_instance = new window.SimpleMDE(options);
|
|
10289
10399
|
if (this.schema.readOnly || this.schema.readonly || this.schema.template) {
|
|
@@ -11179,6 +11289,9 @@ var StringEditor = /*#__PURE__*/function (_AbstractEditor) {
|
|
|
11179
11289
|
}, {
|
|
11180
11290
|
key: "refreshValue",
|
|
11181
11291
|
value: function refreshValue() {
|
|
11292
|
+
if (!this.input) {
|
|
11293
|
+
return;
|
|
11294
|
+
}
|
|
11182
11295
|
this.value = this.input.value;
|
|
11183
11296
|
if (typeof this.value !== 'string' && !this.shouldBeUnset()) this.value = '';
|
|
11184
11297
|
this.serialized = this.value;
|
|
@@ -11401,8 +11514,10 @@ var TableEditor = /*#__PURE__*/function (_ArrayEditor) {
|
|
|
11401
11514
|
}, {
|
|
11402
11515
|
key: "build",
|
|
11403
11516
|
value: function build() {
|
|
11517
|
+
this.tableContainer = this.theme.getTableContainer();
|
|
11404
11518
|
this.table = this.theme.getTable();
|
|
11405
|
-
this.
|
|
11519
|
+
this.tableContainer.appendChild(this.table);
|
|
11520
|
+
this.container.appendChild(this.tableContainer);
|
|
11406
11521
|
this.thead = this.theme.getTableHead();
|
|
11407
11522
|
this.table.appendChild(this.thead);
|
|
11408
11523
|
this.header_row = this.theme.getTableRow();
|
|
@@ -11437,7 +11552,7 @@ var TableEditor = /*#__PURE__*/function (_ArrayEditor) {
|
|
|
11437
11552
|
this.panel = document.createElement('div');
|
|
11438
11553
|
this.container.appendChild(this.panel);
|
|
11439
11554
|
}
|
|
11440
|
-
this.panel.appendChild(this.
|
|
11555
|
+
this.panel.appendChild(this.tableContainer);
|
|
11441
11556
|
this.controls = this.theme.getButtonHolder();
|
|
11442
11557
|
if (this.array_controls_top) {
|
|
11443
11558
|
this.title.appendChild(this.controls);
|
|
@@ -11593,25 +11708,25 @@ var TableEditor = /*#__PURE__*/function (_ArrayEditor) {
|
|
|
11593
11708
|
if (editor.delete_button) {
|
|
11594
11709
|
/* Hide the delete button if we have minItems items */
|
|
11595
11710
|
var display = !minItems;
|
|
11596
|
-
_this2.
|
|
11711
|
+
_this2.setButtonState(editor.delete_button, display);
|
|
11597
11712
|
needRowButtons.push(display);
|
|
11598
11713
|
}
|
|
11599
11714
|
if (editor.copy_button) {
|
|
11600
11715
|
/* Hide the copy button if we have maxItems items */
|
|
11601
11716
|
var _display = !maxItems;
|
|
11602
|
-
_this2.
|
|
11717
|
+
_this2.setButtonState(editor.copy_button, _display);
|
|
11603
11718
|
needRowButtons.push(_display);
|
|
11604
11719
|
}
|
|
11605
11720
|
if (editor.moveup_button) {
|
|
11606
11721
|
/* Hide the moveup button for the first row */
|
|
11607
11722
|
var _display2 = i !== 0;
|
|
11608
|
-
_this2.
|
|
11723
|
+
_this2.setButtonState(editor.moveup_button, _display2);
|
|
11609
11724
|
needRowButtons.push(_display2);
|
|
11610
11725
|
}
|
|
11611
11726
|
if (editor.movedown_button) {
|
|
11612
11727
|
/* Hide the movedown button for the last row */
|
|
11613
11728
|
var _display3 = i !== _this2.rows.length - 1;
|
|
11614
|
-
_this2.
|
|
11729
|
+
_this2.setButtonState(editor.movedown_button, _display3);
|
|
11615
11730
|
needRowButtons.push(_display3);
|
|
11616
11731
|
}
|
|
11617
11732
|
});
|
|
@@ -11620,24 +11735,24 @@ var TableEditor = /*#__PURE__*/function (_ArrayEditor) {
|
|
|
11620
11735
|
});
|
|
11621
11736
|
/* Show/hide controls column in table */
|
|
11622
11737
|
this.rows.forEach(function (editor) {
|
|
11623
|
-
return _this2.
|
|
11738
|
+
return _this2.setButtonState(editor.controls_cell, need);
|
|
11624
11739
|
});
|
|
11625
|
-
this.
|
|
11626
|
-
this.
|
|
11740
|
+
this.setButtonState(this.controls_header_cell, need);
|
|
11741
|
+
this.setButtonState(this.table, this.value.length);
|
|
11627
11742
|
|
|
11628
11743
|
/* If there are maxItems items in the array, or configured to hide the add_row_button button, hide the button beneath the rows */
|
|
11629
11744
|
var display1 = !(maxItems || this.hide_add_button);
|
|
11630
|
-
this.
|
|
11745
|
+
this.setButtonState(this.add_row_button, display1);
|
|
11631
11746
|
|
|
11632
11747
|
/* If there are minItems items in the array, or configured to hide the delete_last_row button, hide the button beneath the rows */
|
|
11633
11748
|
var display2 = !(!this.value.length || minItems || this.hide_delete_last_row_buttons);
|
|
11634
|
-
this.
|
|
11749
|
+
this.setButtonState(this.delete_last_row_button, display2);
|
|
11635
11750
|
|
|
11636
11751
|
/* If there are minItems items in the array, or configured to hide the remove_all_rows_button button, hide the button beneath the rows */
|
|
11637
11752
|
var display3 = !(this.value.length <= 1 || minItems || this.hide_delete_all_rows_buttons);
|
|
11638
|
-
this.
|
|
11753
|
+
this.setButtonState(this.remove_all_rows_button, display3);
|
|
11639
11754
|
var controlsNeeded = display1 || display2 || display3;
|
|
11640
|
-
this.
|
|
11755
|
+
this.setButtonState(this.controls, controlsNeeded);
|
|
11641
11756
|
}
|
|
11642
11757
|
}, {
|
|
11643
11758
|
key: "refreshValue",
|
|
@@ -11788,7 +11903,7 @@ var TableEditor = /*#__PURE__*/function (_ArrayEditor) {
|
|
|
11788
11903
|
this.toggle_button.addEventListener('click', function (e) {
|
|
11789
11904
|
e.preventDefault();
|
|
11790
11905
|
e.stopPropagation();
|
|
11791
|
-
_this8.
|
|
11906
|
+
_this8.setButtonState(_this8.panel, _this8.collapsed);
|
|
11792
11907
|
if (_this8.collapsed) {
|
|
11793
11908
|
_this8.collapsed = false;
|
|
11794
11909
|
_this8.setButtonText(e.currentTarget, '', 'collapse', 'button_collapse');
|
|
@@ -13505,25 +13620,30 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
13505
13620
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
13506
13621
|
/* harmony export */ "resolvers": () => (/* binding */ resolvers)
|
|
13507
13622
|
/* harmony export */ });
|
|
13508
|
-
/* harmony import */ var
|
|
13509
|
-
/* harmony import */ var
|
|
13510
|
-
/* harmony import */ var
|
|
13511
|
-
/* harmony import */ var
|
|
13623
|
+
/* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.includes.js */ "./node_modules/core-js/modules/es.array.includes.js");
|
|
13624
|
+
/* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_0__);
|
|
13625
|
+
/* harmony import */ var core_js_modules_es_array_is_array_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.array.is-array.js */ "./node_modules/core-js/modules/es.array.is-array.js");
|
|
13626
|
+
/* harmony import */ var core_js_modules_es_array_is_array_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_is_array_js__WEBPACK_IMPORTED_MODULE_1__);
|
|
13512
13627
|
|
|
13513
13628
|
|
|
13514
|
-
/* Use "multiple" as a
|
|
13629
|
+
/* Use "multiple" as a fallback for everything */
|
|
13515
13630
|
var defaultResolver = function defaultResolver(schema) {
|
|
13516
13631
|
return typeof schema.type !== 'string' && 'multiple';
|
|
13517
13632
|
};
|
|
13518
13633
|
|
|
13634
|
+
/* If the type is a script type, then presume the Editor's type is "string" until later resolvers decide otherwise */
|
|
13635
|
+
var defaultResolverString = function defaultResolverString(schema) {
|
|
13636
|
+
return typeof schema.type === 'string' && 'string';
|
|
13637
|
+
};
|
|
13638
|
+
|
|
13519
13639
|
/* If the type is not set but properties are defined, we can infer the type is actually object */
|
|
13520
13640
|
var object = function object(schema) {
|
|
13521
13641
|
return !schema.type && schema.properties && 'object';
|
|
13522
13642
|
};
|
|
13523
13643
|
|
|
13524
|
-
/* If
|
|
13644
|
+
/* If type is set, and it's a basic JSON type, use the primitive editor */
|
|
13525
13645
|
var primitive = function primitive(schema) {
|
|
13526
|
-
return typeof schema.type === 'string' && schema.type;
|
|
13646
|
+
return typeof schema.type === 'string' && ['string', 'number', 'integer', 'boolean', 'null', 'array', 'object'].includes(schema.type) && schema.type;
|
|
13527
13647
|
};
|
|
13528
13648
|
|
|
13529
13649
|
/* Use specialized editor for signatures */
|
|
@@ -13590,7 +13710,10 @@ var enumeratedProperties = function enumeratedProperties(schema) {
|
|
|
13590
13710
|
};
|
|
13591
13711
|
|
|
13592
13712
|
/* Specialized editors for arrays of strings */
|
|
13593
|
-
var arraysOfStrings = function arraysOfStrings(schema) {
|
|
13713
|
+
var arraysOfStrings = function arraysOfStrings(schema, je) {
|
|
13714
|
+
if (schema.items) {
|
|
13715
|
+
schema.items = je.expandSchema(schema.items);
|
|
13716
|
+
}
|
|
13594
13717
|
if (schema.type === 'array' && schema.items && !Array.isArray(schema.items) && ['string', 'number', 'integer'].includes(schema.items.type)) {
|
|
13595
13718
|
if (schema.format === 'choices') return 'arrayChoices';
|
|
13596
13719
|
if (schema.uniqueItems) {
|
|
@@ -13662,7 +13785,7 @@ var xhtml = function xhtml(schema) {
|
|
|
13662
13785
|
};
|
|
13663
13786
|
|
|
13664
13787
|
/* Use the ace editor for schemas with format equals any of ace editor modes */
|
|
13665
|
-
var aceModes = ['actionscript', 'batchfile', 'c', 'c++', 'cpp', 'coffee', 'csharp', 'css', 'dart', 'django', 'ejs', 'erlang', 'golang', 'groovy', 'handlebars', 'haskell', 'haxe', 'html', 'ini', 'jade', 'java', 'javascript', 'json', 'less', 'lisp', 'lua', 'makefile', 'matlab', 'mysql', 'objectivec', 'pascal', 'perl', 'pgsql', 'php', 'python', 'r', 'ruby', 'sass', 'scala', 'scss', 'sh', 'smarty', 'sql', 'sqlserver', 'stylus', 'svg', 'twig', 'vbscript', 'xml', 'yaml'];
|
|
13788
|
+
var aceModes = ['actionscript', 'batchfile', 'c', 'c++', 'cpp', 'coffee', 'csharp', 'css', 'dart', 'django', 'ejs', 'erlang', 'golang', 'groovy', 'handlebars', 'haskell', 'haxe', 'html', 'ini', 'jade', 'java', 'javascript', 'json', 'less', 'lisp', 'lua', 'makefile', 'matlab', 'mysql', 'objectivec', 'pascal', 'perl', 'pgsql', 'php', 'python', 'prql', 'r', 'ruby', 'rust', 'sass', 'scala', 'scss', 'sh', 'smarty', 'sql', 'sqlserver', 'stylus', 'svg', 'typescript', 'twig', 'vbscript', 'xml', 'yaml', 'zig'];
|
|
13666
13789
|
var ace = function ace(schema) {
|
|
13667
13790
|
return schema.type === 'string' && aceModes.includes(schema.format) && 'ace';
|
|
13668
13791
|
};
|
|
@@ -13674,7 +13797,7 @@ var colorPicker = function colorPicker(schema) {
|
|
|
13674
13797
|
};
|
|
13675
13798
|
|
|
13676
13799
|
/* Export resolvers in order of discovery, first to last */
|
|
13677
|
-
var resolvers = [colorPicker, ip, ace, xhtml, markdown, jodit, autoComplete, uuid, info, button, stepper, describeBy, starratings, date, oneOf, ifThenElse, arraysOfStrings, enumeratedProperties, enumSource, table, upload, base64, any, _boolean, signature, primitive, object, defaultResolver];
|
|
13800
|
+
var resolvers = [colorPicker, ip, ace, xhtml, markdown, jodit, autoComplete, uuid, info, button, stepper, describeBy, starratings, date, oneOf, ifThenElse, arraysOfStrings, enumeratedProperties, enumSource, table, upload, base64, any, _boolean, signature, primitive, object, defaultResolver, defaultResolverString];
|
|
13678
13801
|
|
|
13679
13802
|
/***/ }),
|
|
13680
13803
|
|
|
@@ -14351,7 +14474,7 @@ var SchemaLoader = /*#__PURE__*/function () {
|
|
|
14351
14474
|
}
|
|
14352
14475
|
}
|
|
14353
14476
|
if (externalSchema) {
|
|
14354
|
-
_context2.next =
|
|
14477
|
+
_context2.next = 61;
|
|
14355
14478
|
break;
|
|
14356
14479
|
}
|
|
14357
14480
|
_context2.next = 48;
|
|
@@ -14378,37 +14501,41 @@ var SchemaLoader = /*#__PURE__*/function () {
|
|
|
14378
14501
|
case 51:
|
|
14379
14502
|
_context2.prev = 51;
|
|
14380
14503
|
externalSchema = JSON.parse(_response.responseText);
|
|
14504
|
+
_this10.onSchemaLoaded({
|
|
14505
|
+
schema: externalSchema,
|
|
14506
|
+
schemaUrl: url
|
|
14507
|
+
});
|
|
14381
14508
|
if (_this10.options.ajax_cache_responses) {
|
|
14382
14509
|
_this10.cacheSet(url, externalSchema);
|
|
14383
14510
|
}
|
|
14384
|
-
_context2.next =
|
|
14511
|
+
_context2.next = 61;
|
|
14385
14512
|
break;
|
|
14386
|
-
case
|
|
14387
|
-
_context2.prev =
|
|
14513
|
+
case 57:
|
|
14514
|
+
_context2.prev = 57;
|
|
14388
14515
|
_context2.t2 = _context2["catch"](51);
|
|
14389
14516
|
// eslint-disable-next-line no-console
|
|
14390
14517
|
console.log(_context2.t2);
|
|
14391
14518
|
throw new Error("Failed to parse external ref ".concat(url));
|
|
14392
|
-
case
|
|
14519
|
+
case 61:
|
|
14393
14520
|
if (!(!(typeof externalSchema === 'boolean' || _typeof(externalSchema) === 'object') || externalSchema === null || Array.isArray(externalSchema))) {
|
|
14394
|
-
_context2.next =
|
|
14521
|
+
_context2.next = 63;
|
|
14395
14522
|
break;
|
|
14396
14523
|
}
|
|
14397
14524
|
throw new Error("External ref does not contain a valid schema - ".concat(url));
|
|
14398
|
-
case
|
|
14525
|
+
case 63:
|
|
14399
14526
|
_this10.refs[uri] = externalSchema;
|
|
14400
14527
|
newfileBase = _this10._getFileBaseFromFileLocation(url); // Add leading slash.
|
|
14401
14528
|
if (url !== uri) {
|
|
14402
14529
|
pathItems = url.split('/');
|
|
14403
14530
|
url = (uri.substr(0, 1) === '/' ? '/' : '') + pathItems.pop();
|
|
14404
14531
|
}
|
|
14405
|
-
_context2.next =
|
|
14532
|
+
_context2.next = 68;
|
|
14406
14533
|
return _this10._asyncloadExternalRefs(externalSchema, url, newfileBase);
|
|
14407
|
-
case
|
|
14534
|
+
case 68:
|
|
14408
14535
|
case "end":
|
|
14409
14536
|
return _context2.stop();
|
|
14410
14537
|
}
|
|
14411
|
-
}, _loop, null, [[14, 33], [18, 22], [51,
|
|
14538
|
+
}, _loop, null, [[14, 33], [18, 22], [51, 57]]);
|
|
14412
14539
|
});
|
|
14413
14540
|
_i2 = 0, _Object$keys = Object.keys(refs);
|
|
14414
14541
|
case 5:
|
|
@@ -14435,6 +14562,8 @@ var SchemaLoader = /*#__PURE__*/function () {
|
|
|
14435
14562
|
}
|
|
14436
14563
|
return _context3.abrupt("return", true);
|
|
14437
14564
|
case 15:
|
|
14565
|
+
this.onAllSchemasLoaded();
|
|
14566
|
+
case 16:
|
|
14438
14567
|
case "end":
|
|
14439
14568
|
return _context3.stop();
|
|
14440
14569
|
}
|
|
@@ -14445,6 +14574,12 @@ var SchemaLoader = /*#__PURE__*/function () {
|
|
|
14445
14574
|
}
|
|
14446
14575
|
return _asyncloadExternalRefs;
|
|
14447
14576
|
}()
|
|
14577
|
+
}, {
|
|
14578
|
+
key: "onSchemaLoaded",
|
|
14579
|
+
value: function onSchemaLoaded(payload) {}
|
|
14580
|
+
}, {
|
|
14581
|
+
key: "onAllSchemasLoaded",
|
|
14582
|
+
value: function onAllSchemasLoaded() {}
|
|
14448
14583
|
}, {
|
|
14449
14584
|
key: "extendSchemas",
|
|
14450
14585
|
value: function extendSchemas(obj1, obj2) {
|
|
@@ -15479,6 +15614,11 @@ var AbstractTheme = /*#__PURE__*/function () {
|
|
|
15479
15614
|
}
|
|
15480
15615
|
if (title) button.setAttribute('title', title);
|
|
15481
15616
|
}
|
|
15617
|
+
}, {
|
|
15618
|
+
key: "getTableContainer",
|
|
15619
|
+
value: function getTableContainer() {
|
|
15620
|
+
return document.createElement('div');
|
|
15621
|
+
}
|
|
15482
15622
|
|
|
15483
15623
|
/* Table functions */
|
|
15484
15624
|
}, {
|
|
@@ -16150,6 +16290,13 @@ var bootstrap3Theme = /*#__PURE__*/function (_AbstractTheme) {
|
|
|
16150
16290
|
el.classList.add('btn', 'btn-default');
|
|
16151
16291
|
return el;
|
|
16152
16292
|
}
|
|
16293
|
+
}, {
|
|
16294
|
+
key: "getTableContainer",
|
|
16295
|
+
value: function getTableContainer() {
|
|
16296
|
+
var el = _get(_getPrototypeOf(bootstrap3Theme.prototype), "getTableContainer", this).call(this);
|
|
16297
|
+
el.classList.add('table-responsive');
|
|
16298
|
+
return el;
|
|
16299
|
+
}
|
|
16153
16300
|
}, {
|
|
16154
16301
|
key: "getTable",
|
|
16155
16302
|
value: function getTable() {
|
|
@@ -16903,6 +17050,13 @@ var bootstrap4Theme = /*#__PURE__*/function (_AbstractTheme) {
|
|
|
16903
17050
|
el.classList.add('btn', 'btn-secondary', 'btn-sm');
|
|
16904
17051
|
return el;
|
|
16905
17052
|
}
|
|
17053
|
+
}, {
|
|
17054
|
+
key: "getTableContainer",
|
|
17055
|
+
value: function getTableContainer() {
|
|
17056
|
+
var el = _get(_getPrototypeOf(bootstrap4Theme.prototype), "getTableContainer", this).call(this);
|
|
17057
|
+
el.classList.add('table-responsive');
|
|
17058
|
+
return el;
|
|
17059
|
+
}
|
|
16906
17060
|
}, {
|
|
16907
17061
|
key: "getTable",
|
|
16908
17062
|
value: function getTable() {
|
|
@@ -17660,6 +17814,13 @@ var bootstrap5Theme = /*#__PURE__*/function (_AbstractTheme) {
|
|
|
17660
17814
|
el.classList.add('btn', 'btn-secondary', 'btn-sm');
|
|
17661
17815
|
return el;
|
|
17662
17816
|
}
|
|
17817
|
+
}, {
|
|
17818
|
+
key: "getTableContainer",
|
|
17819
|
+
value: function getTableContainer() {
|
|
17820
|
+
var el = _get(_getPrototypeOf(bootstrap5Theme.prototype), "getTableContainer", this).call(this);
|
|
17821
|
+
el.classList.add('table-responsive');
|
|
17822
|
+
return el;
|
|
17823
|
+
}
|
|
17663
17824
|
}, {
|
|
17664
17825
|
key: "getTable",
|
|
17665
17826
|
value: function getTable() {
|
|
@@ -19956,64 +20117,64 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
19956
20117
|
/* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_2__);
|
|
19957
20118
|
/* harmony import */ var core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.object.keys.js */ "./node_modules/core-js/modules/es.object.keys.js");
|
|
19958
20119
|
/* harmony import */ var core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_3__);
|
|
19959
|
-
/* harmony import */ var
|
|
19960
|
-
/* harmony import */ var
|
|
19961
|
-
/* harmony import */ var
|
|
19962
|
-
/* harmony import */ var
|
|
19963
|
-
/* harmony import */ var
|
|
19964
|
-
/* harmony import */ var
|
|
19965
|
-
/* harmony import */ var
|
|
19966
|
-
/* harmony import */ var
|
|
19967
|
-
/* harmony import */ var
|
|
19968
|
-
/* harmony import */ var
|
|
19969
|
-
/* harmony import */ var
|
|
19970
|
-
/* harmony import */ var
|
|
19971
|
-
/* harmony import */ var
|
|
19972
|
-
/* harmony import */ var
|
|
19973
|
-
/* harmony import */ var
|
|
19974
|
-
/* harmony import */ var
|
|
19975
|
-
/* harmony import */ var
|
|
19976
|
-
/* harmony import */ var
|
|
19977
|
-
/* harmony import */ var
|
|
19978
|
-
/* harmony import */ var
|
|
19979
|
-
/* harmony import */ var
|
|
19980
|
-
/* harmony import */ var
|
|
19981
|
-
/* harmony import */ var
|
|
19982
|
-
/* harmony import */ var
|
|
19983
|
-
/* harmony import */ var
|
|
19984
|
-
/* harmony import */ var
|
|
19985
|
-
/* harmony import */ var
|
|
19986
|
-
/* harmony import */ var
|
|
19987
|
-
/* harmony import */ var
|
|
19988
|
-
/* harmony import */ var
|
|
19989
|
-
/* harmony import */ var
|
|
19990
|
-
/* harmony import */ var
|
|
19991
|
-
/* harmony import */ var
|
|
19992
|
-
/* harmony import */ var
|
|
19993
|
-
/* harmony import */ var
|
|
19994
|
-
/* harmony import */ var
|
|
19995
|
-
/* harmony import */ var
|
|
19996
|
-
/* harmony import */ var
|
|
19997
|
-
/* harmony import */ var
|
|
19998
|
-
/* harmony import */ var
|
|
19999
|
-
/* harmony import */ var
|
|
20000
|
-
/* harmony import */ var
|
|
20001
|
-
/* harmony import */ var
|
|
20002
|
-
/* harmony import */ var
|
|
20003
|
-
/* harmony import */ var
|
|
20004
|
-
/* harmony import */ var
|
|
20005
|
-
/* harmony import */ var
|
|
20006
|
-
/* harmony import */ var
|
|
20007
|
-
/* harmony import */ var
|
|
20008
|
-
/* harmony import */ var
|
|
20009
|
-
/* harmony import */ var
|
|
20010
|
-
/* harmony import */ var
|
|
20011
|
-
/* harmony import */ var
|
|
20012
|
-
/* harmony import */ var
|
|
20013
|
-
/* harmony import */ var
|
|
20014
|
-
/* harmony import */ var
|
|
20015
|
-
/* harmony import */ var
|
|
20016
|
-
/* harmony import */ var
|
|
20120
|
+
/* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.array.filter.js */ "./node_modules/core-js/modules/es.array.filter.js");
|
|
20121
|
+
/* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_4__);
|
|
20122
|
+
/* harmony import */ var core_js_modules_es_array_join_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.array.join.js */ "./node_modules/core-js/modules/es.array.join.js");
|
|
20123
|
+
/* harmony import */ var core_js_modules_es_array_join_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_join_js__WEBPACK_IMPORTED_MODULE_5__);
|
|
20124
|
+
/* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ "./node_modules/core-js/modules/es.array.concat.js");
|
|
20125
|
+
/* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_6__);
|
|
20126
|
+
/* harmony import */ var core_js_modules_es_array_is_array_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.array.is-array.js */ "./node_modules/core-js/modules/es.array.is-array.js");
|
|
20127
|
+
/* harmony import */ var core_js_modules_es_array_is_array_js__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_is_array_js__WEBPACK_IMPORTED_MODULE_7__);
|
|
20128
|
+
/* harmony import */ var core_js_modules_es_array_some_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/es.array.some.js */ "./node_modules/core-js/modules/es.array.some.js");
|
|
20129
|
+
/* harmony import */ var core_js_modules_es_array_some_js__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_some_js__WEBPACK_IMPORTED_MODULE_8__);
|
|
20130
|
+
/* harmony import */ var core_js_modules_es_array_reduce_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! core-js/modules/es.array.reduce.js */ "./node_modules/core-js/modules/es.array.reduce.js");
|
|
20131
|
+
/* harmony import */ var core_js_modules_es_array_reduce_js__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_reduce_js__WEBPACK_IMPORTED_MODULE_9__);
|
|
20132
|
+
/* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! core-js/modules/es.array.includes.js */ "./node_modules/core-js/modules/es.array.includes.js");
|
|
20133
|
+
/* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_10__);
|
|
20134
|
+
/* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! core-js/modules/es.regexp.exec.js */ "./node_modules/core-js/modules/es.regexp.exec.js");
|
|
20135
|
+
/* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_11__);
|
|
20136
|
+
/* harmony import */ var core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! core-js/modules/es.regexp.constructor.js */ "./node_modules/core-js/modules/es.regexp.constructor.js");
|
|
20137
|
+
/* harmony import */ var core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_12__);
|
|
20138
|
+
/* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ "./node_modules/core-js/modules/es.regexp.to-string.js");
|
|
20139
|
+
/* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_13__);
|
|
20140
|
+
/* harmony import */ var core_js_modules_es_object_entries_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! core-js/modules/es.object.entries.js */ "./node_modules/core-js/modules/es.object.entries.js");
|
|
20141
|
+
/* harmony import */ var core_js_modules_es_object_entries_js__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_entries_js__WEBPACK_IMPORTED_MODULE_14__);
|
|
20142
|
+
/* harmony import */ var core_js_modules_es_array_every_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! core-js/modules/es.array.every.js */ "./node_modules/core-js/modules/es.array.every.js");
|
|
20143
|
+
/* harmony import */ var core_js_modules_es_array_every_js__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_every_js__WEBPACK_IMPORTED_MODULE_15__);
|
|
20144
|
+
/* harmony import */ var core_js_modules_es_string_match_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! core-js/modules/es.string.match.js */ "./node_modules/core-js/modules/es.string.match.js");
|
|
20145
|
+
/* harmony import */ var core_js_modules_es_string_match_js__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_match_js__WEBPACK_IMPORTED_MODULE_16__);
|
|
20146
|
+
/* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js");
|
|
20147
|
+
/* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_17__);
|
|
20148
|
+
/* harmony import */ var core_js_modules_es_parse_int_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! core-js/modules/es.parse-int.js */ "./node_modules/core-js/modules/es.parse-int.js");
|
|
20149
|
+
/* harmony import */ var core_js_modules_es_parse_int_js__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_parse_int_js__WEBPACK_IMPORTED_MODULE_18__);
|
|
20150
|
+
/* harmony import */ var core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! core-js/modules/es.string.replace.js */ "./node_modules/core-js/modules/es.string.replace.js");
|
|
20151
|
+
/* harmony import */ var core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_19__);
|
|
20152
|
+
/* harmony import */ var core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! core-js/modules/es.array.map.js */ "./node_modules/core-js/modules/es.array.map.js");
|
|
20153
|
+
/* harmony import */ var core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_20__);
|
|
20154
|
+
/* harmony import */ var core_js_modules_es_symbol_to_primitive_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ "./node_modules/core-js/modules/es.symbol.to-primitive.js");
|
|
20155
|
+
/* harmony import */ var core_js_modules_es_symbol_to_primitive_js__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_to_primitive_js__WEBPACK_IMPORTED_MODULE_21__);
|
|
20156
|
+
/* harmony import */ var core_js_modules_es_date_to_primitive_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ "./node_modules/core-js/modules/es.date.to-primitive.js");
|
|
20157
|
+
/* harmony import */ var core_js_modules_es_date_to_primitive_js__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_date_to_primitive_js__WEBPACK_IMPORTED_MODULE_22__);
|
|
20158
|
+
/* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js");
|
|
20159
|
+
/* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_23__);
|
|
20160
|
+
/* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js");
|
|
20161
|
+
/* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_24__);
|
|
20162
|
+
/* harmony import */ var core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! core-js/modules/es.number.constructor.js */ "./node_modules/core-js/modules/es.number.constructor.js");
|
|
20163
|
+
/* harmony import */ var core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_number_constructor_js__WEBPACK_IMPORTED_MODULE_25__);
|
|
20164
|
+
/* harmony import */ var core_js_modules_es_object_define_property_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! core-js/modules/es.object.define-property.js */ "./node_modules/core-js/modules/es.object.define-property.js");
|
|
20165
|
+
/* harmony import */ var core_js_modules_es_object_define_property_js__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_define_property_js__WEBPACK_IMPORTED_MODULE_26__);
|
|
20166
|
+
/* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js");
|
|
20167
|
+
/* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_27__);
|
|
20168
|
+
/* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js");
|
|
20169
|
+
/* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_28___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_28__);
|
|
20170
|
+
/* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js");
|
|
20171
|
+
/* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_29___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_29__);
|
|
20172
|
+
/* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js");
|
|
20173
|
+
/* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_30___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_30__);
|
|
20174
|
+
/* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js");
|
|
20175
|
+
/* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_31___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_31__);
|
|
20176
|
+
/* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js");
|
|
20177
|
+
/* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_32___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_32__);
|
|
20017
20178
|
/* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptor.js");
|
|
20018
20179
|
/* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_33___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_33__);
|
|
20019
20180
|
/* harmony import */ var core_js_modules_es_object_get_own_property_descriptors_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ "./node_modules/core-js/modules/es.object.get-own-property-descriptors.js");
|
|
@@ -20090,6 +20251,28 @@ var Validator = /*#__PURE__*/function () {
|
|
|
20090
20251
|
this.translateProperty = this.jsoneditor.translateProperty || defaults.translateProperty;
|
|
20091
20252
|
this.defaults = defaults;
|
|
20092
20253
|
this._validateSubSchema = {
|
|
20254
|
+
dependentRequired: function dependentRequired(schema, value, path) {
|
|
20255
|
+
var errors = [];
|
|
20256
|
+
if (typeof schema.dependentRequired !== 'undefined') {
|
|
20257
|
+
var missingProperties = [];
|
|
20258
|
+
Object.keys(schema.dependentRequired).forEach(function (key) {
|
|
20259
|
+
if (typeof value[key] !== 'undefined') {
|
|
20260
|
+
var requiredProperties = schema.dependentRequired[key];
|
|
20261
|
+
missingProperties = requiredProperties.filter(function (property) {
|
|
20262
|
+
return !(0,_utilities_js__WEBPACK_IMPORTED_MODULE_37__.hasOwnProperty)(value, property);
|
|
20263
|
+
});
|
|
20264
|
+
}
|
|
20265
|
+
});
|
|
20266
|
+
var invalid = missingProperties.length > 0;
|
|
20267
|
+
if (invalid) {
|
|
20268
|
+
errors.push({
|
|
20269
|
+
message: 'Must have the required properties: ' + missingProperties.join(', '),
|
|
20270
|
+
path: path
|
|
20271
|
+
});
|
|
20272
|
+
}
|
|
20273
|
+
}
|
|
20274
|
+
return errors;
|
|
20275
|
+
},
|
|
20093
20276
|
dependentSchemas: function dependentSchemas(schema, value, path) {
|
|
20094
20277
|
var _this = this;
|
|
20095
20278
|
var errors = [];
|
|
@@ -30050,6 +30233,12 @@ var JSONEditor = /*#__PURE__*/function () {
|
|
|
30050
30233
|
case 0:
|
|
30051
30234
|
fetchUrl = document.location.origin + document.location.pathname.toString();
|
|
30052
30235
|
loader = new _schemaloader_js__WEBPACK_IMPORTED_MODULE_37__.SchemaLoader(this.options);
|
|
30236
|
+
loader.onSchemaLoaded = function (payload) {
|
|
30237
|
+
_this2.trigger('schemaLoaded', payload);
|
|
30238
|
+
};
|
|
30239
|
+
loader.onAllSchemasLoaded = function () {
|
|
30240
|
+
_this2.trigger('allSchemasLoaded');
|
|
30241
|
+
};
|
|
30053
30242
|
this.expandSchema = function (schema) {
|
|
30054
30243
|
return loader.expandSchema(schema);
|
|
30055
30244
|
};
|
|
@@ -30057,9 +30246,9 @@ var JSONEditor = /*#__PURE__*/function () {
|
|
|
30057
30246
|
return loader.expandRefs(schema, fileBase);
|
|
30058
30247
|
};
|
|
30059
30248
|
location = document.location.toString();
|
|
30060
|
-
_context.next =
|
|
30249
|
+
_context.next = 9;
|
|
30061
30250
|
return loader.load(this.schema, fetchUrl, location);
|
|
30062
|
-
case
|
|
30251
|
+
case 9:
|
|
30063
30252
|
schema = _context.sent;
|
|
30064
30253
|
validatorOptions = this.options.custom_validators ? {
|
|
30065
30254
|
custom_validators: this.options.custom_validators
|
|
@@ -30092,7 +30281,7 @@ var JSONEditor = /*#__PURE__*/function () {
|
|
|
30092
30281
|
_this2.trigger('ready');
|
|
30093
30282
|
_this2.trigger('change');
|
|
30094
30283
|
});
|
|
30095
|
-
case
|
|
30284
|
+
case 24:
|
|
30096
30285
|
case "end":
|
|
30097
30286
|
return _context.stop();
|
|
30098
30287
|
}
|
|
@@ -30214,10 +30403,11 @@ var JSONEditor = /*#__PURE__*/function () {
|
|
|
30214
30403
|
}, {
|
|
30215
30404
|
key: "getEditorClass",
|
|
30216
30405
|
value: function getEditorClass(schema) {
|
|
30406
|
+
var _this3 = this;
|
|
30217
30407
|
var classname;
|
|
30218
30408
|
schema = this.expandSchema(schema);
|
|
30219
30409
|
JSONEditor.defaults.resolvers.find(function (resolver) {
|
|
30220
|
-
classname = resolver(schema);
|
|
30410
|
+
classname = resolver(schema, _this3);
|
|
30221
30411
|
return classname && JSONEditor.defaults.editors[classname];
|
|
30222
30412
|
});
|
|
30223
30413
|
if (!classname) throw new Error("Unknown editor for schema ".concat(JSON.stringify(schema)));
|
|
@@ -30235,24 +30425,24 @@ var JSONEditor = /*#__PURE__*/function () {
|
|
|
30235
30425
|
}, {
|
|
30236
30426
|
key: "onChange",
|
|
30237
30427
|
value: function onChange() {
|
|
30238
|
-
var
|
|
30428
|
+
var _this4 = this;
|
|
30239
30429
|
if (!this.ready) return;
|
|
30240
30430
|
if (this.firing_change) return;
|
|
30241
30431
|
this.firing_change = true;
|
|
30242
30432
|
window.requestAnimationFrame(function () {
|
|
30243
|
-
|
|
30244
|
-
if (!
|
|
30433
|
+
_this4.firing_change = false;
|
|
30434
|
+
if (!_this4.ready) return;
|
|
30245
30435
|
|
|
30246
30436
|
/* Validate and cache results */
|
|
30247
|
-
|
|
30248
|
-
if (
|
|
30249
|
-
|
|
30437
|
+
_this4.validation_results = _this4.validator.validate(_this4.root.getValue());
|
|
30438
|
+
if (_this4.options.show_errors !== 'never') {
|
|
30439
|
+
_this4.root.showValidationErrors(_this4.validation_results);
|
|
30250
30440
|
} else {
|
|
30251
|
-
|
|
30441
|
+
_this4.root.showValidationErrors([]);
|
|
30252
30442
|
}
|
|
30253
30443
|
|
|
30254
30444
|
/* Fire change event */
|
|
30255
|
-
|
|
30445
|
+
_this4.trigger('change');
|
|
30256
30446
|
});
|
|
30257
30447
|
return this;
|
|
30258
30448
|
}
|