@json-editor/json-editor 2.12.0 → 2.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +13 -5
- package/dist/jsoneditor.js +1 -1
- package/dist/jsoneditor.js.LICENSE.txt +1 -1
- package/dist/nonmin/jsoneditor.js +88 -59
- package/dist/nonmin/jsoneditor.js.map +1 -1
- package/docs/index.html +62 -12
- package/docs/meta_schema.json +11 -0
- package/docs/scripts/ajv-validator.js +8695 -0
- package/package.json +1 -1
- package/src/editor.js +18 -0
- package/src/editors/button.js +8 -2
- package/src/editors/simplemde.js +2 -1
- package/src/resolvers.js +7 -4
- package/tests/codeceptjs/codecept.json +1 -1
- package/tests/codeceptjs/constrains/contains_test.js +3 -2
- package/tests/codeceptjs/constrains/dependentSchemas_test.js +1 -0
- package/tests/codeceptjs/core_test.js +4 -4
- package/tests/codeceptjs/editors/advanced_test.js +1 -1
- package/tests/codeceptjs/editors/array_test.js +7 -0
- package/tests/codeceptjs/editors/autocomplete_test.js +3 -1
- package/tests/codeceptjs/editors/tabs_test.js +1 -1
- package/tests/codeceptjs/issues/issue-gh-1338_test.js +2 -2
- package/tests/codeceptjs/issues/issue-gh-1431_test.js +12 -0
- package/tests/codeceptjs/issues/issue-gh-1439_test.js +12 -0
- package/tests/pages/array-header-template.html +59 -0
- package/tests/pages/button-icons.html +1 -1
- package/tests/pages/issues/issue-gh-1431.html +49 -0
- package/tests/pages/issues/issue-gh-1439.html +69 -0
- package/tests/pages/meta-schema.html +11 -1
|
@@ -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
|
|
@@ -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
|
|
@@ -569,39 +569,41 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
569
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__);
|
|
570
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");
|
|
571
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__);
|
|
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
|
|
603
|
-
/* harmony import */ var
|
|
604
|
-
/* 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");
|
|
605
607
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
606
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."); }
|
|
607
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); }
|
|
@@ -638,6 +640,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
638
640
|
|
|
639
641
|
|
|
640
642
|
|
|
643
|
+
|
|
641
644
|
|
|
642
645
|
|
|
643
646
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -663,7 +666,7 @@ var AbstractEditor = /*#__PURE__*/function () {
|
|
|
663
666
|
this.original_schema = options.schema;
|
|
664
667
|
this.schema = this.jsoneditor.expandSchema(this.original_schema);
|
|
665
668
|
this.active = true;
|
|
666
|
-
this.options = (0,
|
|
669
|
+
this.options = (0,_utilities_js__WEBPACK_IMPORTED_MODULE_32__.extend)({}, this.options || {}, this.schema.options || {}, options.schema.options || {}, options);
|
|
667
670
|
this.formname = this.jsoneditor.options.form_name_root || 'root';
|
|
668
671
|
if (!options.path && !this.schema.id) this.schema.id = this.formname;
|
|
669
672
|
this.path = options.path || this.formname;
|
|
@@ -826,10 +829,10 @@ var AbstractEditor = /*#__PURE__*/function () {
|
|
|
826
829
|
this.dependenciesFulfilled = choices === value;
|
|
827
830
|
} else {
|
|
828
831
|
Object.keys(choices).some(function (key) {
|
|
829
|
-
if (!(0,
|
|
832
|
+
if (!(0,_utilities_js__WEBPACK_IMPORTED_MODULE_32__.hasOwnProperty)(choices, key)) {
|
|
830
833
|
return false;
|
|
831
834
|
}
|
|
832
|
-
if (!(0,
|
|
835
|
+
if (!(0,_utilities_js__WEBPACK_IMPORTED_MODULE_32__.hasOwnProperty)(value, key) || choices[key] !== value[key]) {
|
|
833
836
|
_this3.dependenciesFulfilled = false;
|
|
834
837
|
return true;
|
|
835
838
|
}
|
|
@@ -914,7 +917,7 @@ var AbstractEditor = /*#__PURE__*/function () {
|
|
|
914
917
|
_this5.onWatchedFieldChange();
|
|
915
918
|
}
|
|
916
919
|
};
|
|
917
|
-
if ((0,
|
|
920
|
+
if ((0,_utilities_js__WEBPACK_IMPORTED_MODULE_32__.hasOwnProperty)(this.schema, 'watch')) {
|
|
918
921
|
var path;
|
|
919
922
|
var pathParts;
|
|
920
923
|
var first;
|
|
@@ -1150,15 +1153,31 @@ var AbstractEditor = /*#__PURE__*/function () {
|
|
|
1150
1153
|
}, {
|
|
1151
1154
|
key: "onWatchedFieldChange",
|
|
1152
1155
|
value: function onWatchedFieldChange() {
|
|
1156
|
+
var _this7 = this;
|
|
1153
1157
|
var vars;
|
|
1154
1158
|
if (this.header_template) {
|
|
1155
|
-
vars = (0,
|
|
1159
|
+
vars = (0,_utilities_js__WEBPACK_IMPORTED_MODULE_32__.extend)(this.getWatchedFieldValues(), {
|
|
1156
1160
|
key: this.key,
|
|
1157
1161
|
i: this.key,
|
|
1158
1162
|
i0: this.key * 1,
|
|
1159
1163
|
i1: this.key * 1 + 1,
|
|
1160
1164
|
title: this.getTitle()
|
|
1161
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
|
+
}
|
|
1162
1181
|
var headerText = this.header_template(vars);
|
|
1163
1182
|
if (headerText !== this.header_text) {
|
|
1164
1183
|
this.header_text = headerText;
|
|
@@ -1199,11 +1218,11 @@ var AbstractEditor = /*#__PURE__*/function () {
|
|
|
1199
1218
|
}, {
|
|
1200
1219
|
key: "destroy",
|
|
1201
1220
|
value: function destroy() {
|
|
1202
|
-
var
|
|
1221
|
+
var _this8 = this;
|
|
1203
1222
|
this.unregister(this);
|
|
1204
1223
|
if (this.watched) {
|
|
1205
1224
|
Object.values(this.watched).forEach(function (adjustedPath) {
|
|
1206
|
-
return
|
|
1225
|
+
return _this8.jsoneditor.unwatch(adjustedPath, _this8.watch_listener);
|
|
1207
1226
|
});
|
|
1208
1227
|
}
|
|
1209
1228
|
this.watched = null;
|
|
@@ -1331,13 +1350,13 @@ var AbstractEditor = /*#__PURE__*/function () {
|
|
|
1331
1350
|
}, {
|
|
1332
1351
|
key: "setInputAttributes",
|
|
1333
1352
|
value: function setInputAttributes(inputAttribute) {
|
|
1334
|
-
var
|
|
1353
|
+
var _this9 = this;
|
|
1335
1354
|
if (this.schema.options && this.schema.options.inputAttributes) {
|
|
1336
1355
|
var inputAttributes = this.schema.options.inputAttributes;
|
|
1337
1356
|
var protectedAttributes = ['name', 'type'].concat(inputAttribute);
|
|
1338
1357
|
Object.keys(inputAttributes).forEach(function (key) {
|
|
1339
1358
|
if (!protectedAttributes.includes(key.toLowerCase())) {
|
|
1340
|
-
|
|
1359
|
+
_this9.input.setAttribute(key, inputAttributes[key]);
|
|
1341
1360
|
}
|
|
1342
1361
|
});
|
|
1343
1362
|
}
|
|
@@ -1345,13 +1364,13 @@ var AbstractEditor = /*#__PURE__*/function () {
|
|
|
1345
1364
|
}, {
|
|
1346
1365
|
key: "setContainerAttributes",
|
|
1347
1366
|
value: function setContainerAttributes() {
|
|
1348
|
-
var
|
|
1367
|
+
var _this10 = this;
|
|
1349
1368
|
if (this.schema.options && this.schema.options.containerAttributes) {
|
|
1350
1369
|
var containerAttributes = this.schema.options.containerAttributes;
|
|
1351
1370
|
var protectedAttributes = ['data-schemapath', 'data-schematype', 'data-schemaid'];
|
|
1352
1371
|
Object.keys(containerAttributes).forEach(function (key) {
|
|
1353
1372
|
if (!protectedAttributes.includes(key.toLowerCase())) {
|
|
1354
|
-
|
|
1373
|
+
_this10.container.setAttribute(key, containerAttributes[key]);
|
|
1355
1374
|
}
|
|
1356
1375
|
});
|
|
1357
1376
|
}
|
|
@@ -1359,16 +1378,16 @@ var AbstractEditor = /*#__PURE__*/function () {
|
|
|
1359
1378
|
}, {
|
|
1360
1379
|
key: "expandCallbacks",
|
|
1361
1380
|
value: function expandCallbacks(scope, options) {
|
|
1362
|
-
var
|
|
1381
|
+
var _this11 = this;
|
|
1363
1382
|
var callback = this.defaults.callbacks[scope];
|
|
1364
1383
|
Object.entries(options).forEach(function (_ref) {
|
|
1365
1384
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
1366
1385
|
key = _ref2[0],
|
|
1367
1386
|
value = _ref2[1];
|
|
1368
1387
|
if (value === Object(value)) {
|
|
1369
|
-
options[key] =
|
|
1388
|
+
options[key] = _this11.expandCallbacks(scope, value);
|
|
1370
1389
|
} else if (typeof value === 'string' && _typeof(callback) === 'object' && typeof callback[value] === 'function') {
|
|
1371
|
-
options[key] = callback[value].bind(null,
|
|
1390
|
+
options[key] = callback[value].bind(null, _this11);
|
|
1372
1391
|
}
|
|
1373
1392
|
});
|
|
1374
1393
|
return options;
|
|
@@ -3709,7 +3728,6 @@ var ButtonEditor = /*#__PURE__*/function (_AbstractEditor) {
|
|
|
3709
3728
|
|
|
3710
3729
|
/* Get options, either global options from "this.defaults.options.button" or */
|
|
3711
3730
|
/* single property options from schema "options.button" */
|
|
3712
|
-
var title = this.translateProperty(this.schema.title) || this.key;
|
|
3713
3731
|
var options = this.expandCallbacks('button', (0,_utilities_js__WEBPACK_IMPORTED_MODULE_22__.extend)({}, {
|
|
3714
3732
|
icon: '',
|
|
3715
3733
|
validated: false,
|
|
@@ -3718,8 +3736,13 @@ var ButtonEditor = /*#__PURE__*/function (_AbstractEditor) {
|
|
|
3718
3736
|
window.alert("No button action defined for \"".concat(jseditor.path, "\""));
|
|
3719
3737
|
}
|
|
3720
3738
|
}, this.defaults.options.button || {}, this.options.button || {}));
|
|
3739
|
+
var title = this.translateProperty(options.text || this.schema.title) || this.key;
|
|
3721
3740
|
this.input = this.getButton(title, options.icon, title);
|
|
3722
|
-
|
|
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
|
+
}
|
|
3723
3746
|
if (this.schema.readOnly || this.schema.readonly || this.schema.template) {
|
|
3724
3747
|
this.disable(true);
|
|
3725
3748
|
this.input.setAttribute('readonly', 'true');
|
|
@@ -10369,7 +10392,8 @@ var SimplemdeEditor = /*#__PURE__*/function (_StringEditor) {
|
|
|
10369
10392
|
options = this.expandCallbacks('simplemde', (0,_utilities_js__WEBPACK_IMPORTED_MODULE_20__.extend)({}, {
|
|
10370
10393
|
height: 300
|
|
10371
10394
|
}, this.defaults.options.simplemde || {}, this.options.simplemde || {}, {
|
|
10372
|
-
element: this.input
|
|
10395
|
+
element: this.input,
|
|
10396
|
+
forceSync: true
|
|
10373
10397
|
}));
|
|
10374
10398
|
this.simplemde_instance = new window.SimpleMDE(options);
|
|
10375
10399
|
if (this.schema.readOnly || this.schema.readonly || this.schema.template) {
|
|
@@ -13596,25 +13620,30 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
13596
13620
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
13597
13621
|
/* harmony export */ "resolvers": () => (/* binding */ resolvers)
|
|
13598
13622
|
/* harmony export */ });
|
|
13599
|
-
/* harmony import */ var
|
|
13600
|
-
/* harmony import */ var
|
|
13601
|
-
/* harmony import */ var
|
|
13602
|
-
/* 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__);
|
|
13603
13627
|
|
|
13604
13628
|
|
|
13605
|
-
/* Use "multiple" as a
|
|
13629
|
+
/* Use "multiple" as a fallback for everything */
|
|
13606
13630
|
var defaultResolver = function defaultResolver(schema) {
|
|
13607
13631
|
return typeof schema.type !== 'string' && 'multiple';
|
|
13608
13632
|
};
|
|
13609
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
|
+
|
|
13610
13639
|
/* If the type is not set but properties are defined, we can infer the type is actually object */
|
|
13611
13640
|
var object = function object(schema) {
|
|
13612
13641
|
return !schema.type && schema.properties && 'object';
|
|
13613
13642
|
};
|
|
13614
13643
|
|
|
13615
|
-
/* If
|
|
13644
|
+
/* If type is set, and it's a basic JSON type, use the primitive editor */
|
|
13616
13645
|
var primitive = function primitive(schema) {
|
|
13617
|
-
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;
|
|
13618
13647
|
};
|
|
13619
13648
|
|
|
13620
13649
|
/* Use specialized editor for signatures */
|
|
@@ -13768,7 +13797,7 @@ var colorPicker = function colorPicker(schema) {
|
|
|
13768
13797
|
};
|
|
13769
13798
|
|
|
13770
13799
|
/* Export resolvers in order of discovery, first to last */
|
|
13771
|
-
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];
|
|
13772
13801
|
|
|
13773
13802
|
/***/ }),
|
|
13774
13803
|
|