@wibetter/json-editor 5.0.10 → 5.0.16

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/lib/index.css CHANGED
@@ -1,8 +1,8 @@
1
1
  /*!
2
- * @wibetter/json-editor v5.0.10
2
+ * @wibetter/json-editor v5.0.16
3
3
  * author: wibetter
4
4
  * build tool: AKFun
5
- * build time: Thu Dec 26 2024 15:58:45 GMT+0800 (中国标准时间)
5
+ * build time: Sun Dec 29 2024 02:47:09 GMT+0800 (中国标准时间)
6
6
  * build tool info: https://github.com/wibetter/akfun
7
7
  */
8
8
  /*!*********************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
package/lib/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /*!
2
- * @wibetter/json-editor v5.0.10
2
+ * @wibetter/json-editor v5.0.16
3
3
  * author: wibetter
4
4
  * build tool: AKFun
5
- * build time: Thu Dec 26 2024 15:58:45 GMT+0800 (中国标准时间)
5
+ * build time: Sun Dec 29 2024 02:47:09 GMT+0800 (中国标准时间)
6
6
  * build tool info: https://github.com/wibetter/akfun
7
7
  */
8
8
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -463,20 +463,22 @@ var MappingRender = function MappingRender(props) {
463
463
  var _ref = props.schemaStore || {},
464
464
  getSchemaByKeyRoute = _ref.getSchemaByKeyRoute;
465
465
  var _ref2 = props.jsonStore || {},
466
- getJSONDataByKeyRoute = _ref2.getJSONDataByKeyRoute;
466
+ getJSONDataByKeyRoute = _ref2.getJSONDataByKeyRoute,
467
+ JSONEditorObj = _ref2.JSONEditorObj;
467
468
  var nodeKey = props.nodeKey,
468
469
  jsonKey = props.jsonKey,
469
470
  keyRoute = props.keyRoute,
470
471
  targetJsonSchema = props.targetJsonSchema;
471
- var curType = targetJsonSchema.type;
472
- var curNodeKey = nodeKey;
473
472
 
474
473
  // 支持显隐属性表达式
475
474
  var parentKeyRoute = (0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_2__.getParentKeyRoute)(keyRoute);
476
- var parentData = getJSONDataByKeyRoute(parentKeyRoute) || {}; // 获取当前父级数据域
477
- if ((0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_2__.isBoolean)(targetJsonSchema.onShow) && !targetJsonSchema.onShow || (0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_2__.isString)(targetJsonSchema.onShow) && !(0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_2__.expressionOn)(targetJsonSchema.onShow, parentData)) {
475
+ var parentData = parentKeyRoute ? getJSONDataByKeyRoute(parentKeyRoute) || {} : {}; // 获取当前父级数据域
476
+ var curData = Object.assign({}, JSONEditorObj, parentData);
477
+ if ((0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_2__.isBoolean)(targetJsonSchema.onShow) && !targetJsonSchema.onShow || (0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_2__.isString)(targetJsonSchema.onShow) && !(0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_2__.evalExpression)(targetJsonSchema.onShow, curData)) {
478
478
  return;
479
479
  }
480
+ var curType = targetJsonSchema.typeOn ? (0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_2__.evalExpression)(targetJsonSchema.typeOn, curData) : targetJsonSchema.type;
481
+ var curNodeKey = nodeKey;
480
482
 
481
483
  // 收集当前所有条件子字段
482
484
  /*
@@ -738,6 +740,7 @@ var ArraySchema = /*#__PURE__*/function (_React$PureComponent) {
738
740
  _this.elemHoverEnterEvent = _this.elemHoverEnterEvent.bind(_this);
739
741
  _this.elemHoverLeaveEvent = _this.elemHoverLeaveEvent.bind(_this);
740
742
  _this.collapseChange = _this.collapseChange.bind(_this);
743
+ _this.arrayCollapseChange = _this.arrayCollapseChange.bind(_this);
741
744
  return _this;
742
745
  }
743
746
  _babel_runtime_helpers_inheritsLoose__WEBPACK_IMPORTED_MODULE_0___default()(ArraySchema, _React$PureComponent);
@@ -6718,6 +6721,7 @@ var RootJSONStore = function RootJSONStore() {
6718
6721
  __webpack_require__.r(__webpack_exports__);
6719
6722
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
6720
6723
  /* harmony export */ deleteWebCacheData: function() { return /* binding */ deleteWebCacheData; },
6724
+ /* harmony export */ getExprProperties: function() { return /* binding */ getExprProperties; },
6721
6725
  /* harmony export */ getParams: function() { return /* binding */ getParams; },
6722
6726
  /* harmony export */ getURLParam: function() { return /* binding */ getURLParam; },
6723
6727
  /* harmony export */ getWebCacheData: function() { return /* binding */ getWebCacheData; },
@@ -6868,6 +6872,31 @@ function deleteWebCacheData(valueKey) {
6868
6872
  (0,_webCache_js__WEBPACK_IMPORTED_MODULE_1__.deleteJSONEditorCache)(valueKey, 'json-editor-formData');
6869
6873
  }
6870
6874
 
6875
+ /**
6876
+ * 处理 Props 数据,所有以 On 或者 Expr 结尾的 prop 都进行一次计算
6877
+ *
6878
+ * xxxOn
6879
+ * xxxExpr
6880
+ */
6881
+ function getExprProperties(schema, data, ignoreList) {
6882
+ if (ignoreList === void 0) {
6883
+ ignoreList = ['name'];
6884
+ }
6885
+ Object.getOwnPropertyNames(schema).forEach(function (key) {
6886
+ if (ignoreList && ~ignoreList.indexOf(key)) {
6887
+ return;
6888
+ }
6889
+ var parts = /^(.*)(On|Expr)$/.exec(key) || [];
6890
+ var type = parts[2];
6891
+ var value = schema[key];
6892
+ if (value && typeof value === 'string' && parts[1] && (type === 'On' || type === 'Expr')) {
6893
+ key = parts[1];
6894
+ schema[key] = (0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_0__.evalExpression)(value, data || {});
6895
+ }
6896
+ });
6897
+ return schema;
6898
+ }
6899
+
6871
6900
  /***/ }),
6872
6901
 
6873
6902
  /***/ "./src/utils/typeof.js":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wibetter/json-editor",
3
- "version": "5.0.10",
3
+ "version": "5.0.16",
4
4
  "description": "JSON数据可视化/JSONEditor, 可视化界面编辑json数据",
5
5
  "keywords": [
6
6
  "json",
package/sdk/index.css CHANGED
@@ -1,8 +1,8 @@
1
1
  /*!
2
- * @wibetter/json-editor v5.0.10
2
+ * @wibetter/json-editor v5.0.16
3
3
  * author: wibetter
4
4
  * build tool: AKFun
5
- * build time: Thu Dec 26 2024 15:59:10 GMT+0800 (中国标准时间)
5
+ * build time: Sun Dec 29 2024 02:44:57 GMT+0800 (中国标准时间)
6
6
  * build tool info: https://github.com/wibetter/akfun
7
7
  */
8
8
  /*!*********************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\