@wibetter/json-editor 5.1.9 → 5.1.11

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.1.9
2
+ * @wibetter/json-editor v5.1.11
3
3
  * author: wibetter
4
4
  * build tool: AKFun
5
- * build time: Mon Jan 13 2025 19:32:30 GMT+0800 (中国标准时间)
5
+ * build time: Thu Jan 16 2025 17:05:08 GMT+0800 (中国标准时间)
6
6
  * build tool info: https://github.com/wibetter/akfun
7
7
  */
8
8
  /*!*********************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
@@ -1176,6 +1176,9 @@
1176
1176
  .select-box .ant-select-single {
1177
1177
  min-width: 150px;
1178
1178
  }
1179
+ .select-box .ant-select-selection-item {
1180
+ max-width: 120px;
1181
+ }
1179
1182
  .select-box .ant-select-selection-item-content {
1180
1183
  max-width: 100px;
1181
1184
  }
package/lib/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /*!
2
- * @wibetter/json-editor v5.1.9
2
+ * @wibetter/json-editor v5.1.11
3
3
  * author: wibetter
4
4
  * build tool: AKFun
5
- * build time: Mon Jan 13 2025 19:32:30 GMT+0800 (中国标准时间)
5
+ * build time: Thu Jan 16 2025 17:05:08 GMT+0800 (中国标准时间)
6
6
  * build tool info: https://github.com/wibetter/akfun
7
7
  */
8
8
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -478,7 +478,7 @@ var MappingRender = function MappingRender(props) {
478
478
  var parentKeyRoute = (0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_2__.getParentKeyRoute)(keyRoute);
479
479
  var parentData = parentKeyRoute ? getJSONDataByKeyRoute(parentKeyRoute) || {} : {}; // 获取当前父级数据域
480
480
  var curData = Object.assign({}, JSONEditorObj, parentData);
481
- if ((0,$utils_index__WEBPACK_IMPORTED_MODULE_3__.hasProperties)(targetJsonSchema.onShow) && targetJsonSchema.onShow !== '' && ((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))) {
481
+ if ((0,$utils_index__WEBPACK_IMPORTED_MODULE_3__.hasProperties)(targetJsonSchema.onShow) && targetJsonSchema.onShow !== '' && (targetJsonSchema.onShow === 'false' || (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))) {
482
482
  return;
483
483
  }
484
484
  var curType = targetJsonSchema.typeOn ? (0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_2__.evalExpression)(targetJsonSchema.typeOn, curData) : targetJsonSchema.type;
@@ -503,6 +503,8 @@ var MappingRender = function MappingRender(props) {
503
503
  key: curNodeKey
504
504
  }));
505
505
  case 'dynamic-config':
506
+ case 'dynamic-object':
507
+ case 'dynamic-array':
506
508
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement($renderers_DynamicConfigSchema_index__WEBPACK_IMPORTED_MODULE_29__["default"], _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, newProps, {
507
509
  key: curNodeKey
508
510
  }));
@@ -787,7 +789,7 @@ var ArraySchema = /*#__PURE__*/function (_React$PureComponent) {
787
789
  for (var index = 0, size = arrItemKeys.length; index < size; index++) {
788
790
  var itemVal = arrItem[arrItemKeys[index]];
789
791
  // 只有不为空时才赋值(忽略URL类型数值)
790
- if (itemVal && ((0,$utils_typeof__WEBPACK_IMPORTED_MODULE_11__.isNumber)(itemVal) || (0,$utils_typeof__WEBPACK_IMPORTED_MODULE_11__.isString)(itemVal) && !(0,$utils_typeof__WEBPACK_IMPORTED_MODULE_11__.isURL)(itemVal) && !(0,$utils_typeof__WEBPACK_IMPORTED_MODULE_11__.isColor)(itemVal))) {
792
+ if (itemVal && (0,$utils_typeof__WEBPACK_IMPORTED_MODULE_11__.isString)(itemVal) && !(0,$utils_typeof__WEBPACK_IMPORTED_MODULE_11__.isURL)(itemVal) && !(0,$utils_typeof__WEBPACK_IMPORTED_MODULE_11__.isColor)(itemVal)) {
791
793
  return itemVal;
792
794
  }
793
795
  }
@@ -880,7 +882,7 @@ var ArraySchema = /*#__PURE__*/function (_React$PureComponent) {
880
882
  var showCodeViewBtn = (_targetJsonSchema$sho = targetJsonSchema.showCodeViewBtn) != null ? _targetJsonSchema$sho : true;
881
883
  // 从jsonData中获取对应的数值
882
884
  var curJsonData = getJSONDataByKeyRoute(keyRoute); // json内容数据
883
- if (!curJsonData || curJsonData.length === 0) {
885
+ if (!curJsonData || curJsonData.length === 0 || !(0,$utils_typeof__WEBPACK_IMPORTED_MODULE_11__.isArray)(curJsonData)) {
884
886
  // 添加一个默认的数组数据
885
887
  curJsonData = [{}];
886
888
  }
@@ -5932,7 +5934,7 @@ var SelectSchema = /*#__PURE__*/function (_React$PureComponent) {
5932
5934
  }
5933
5935
  };
5934
5936
  _proto.render = function render() {
5935
- var _targetJsonSchema$sho, _targetJsonSchema$all;
5937
+ var _targetJsonSchema$sho, _targetJsonSchema$def, _targetJsonSchema$all;
5936
5938
  var _this$props2 = this.props,
5937
5939
  schemaStore = _this$props2.schemaStore,
5938
5940
  jsonStore = _this$props2.jsonStore;
@@ -6002,6 +6004,8 @@ var SelectSchema = /*#__PURE__*/function (_React$PureComponent) {
6002
6004
  }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement(antd__WEBPACK_IMPORTED_MODULE_6__.Select, {
6003
6005
  showSearch: (_targetJsonSchema$sho = targetJsonSchema.showSearch) != null ? _targetJsonSchema$sho : true,
6004
6006
  mode: targetJsonSchema.multiple ? 'multiple' : undefined,
6007
+ defaultActiveFirstOption: (_targetJsonSchema$def = targetJsonSchema.defaultActiveFirstOption) != null ? _targetJsonSchema$def : false // 默认不选中第一条
6008
+ ,
6005
6009
  style: {
6006
6010
  display: 'inline-block',
6007
6011
  minWidth: '120px'
@@ -7533,6 +7537,11 @@ var JSONEditorStore = (_dec = mobx__WEBPACK_IMPORTED_MODULE_4__.action.bound, _d
7533
7537
  _proto.addArrayItem = function addArrayItem(keyRoute, curArrIndex) {
7534
7538
  // 1. 获取数组数据对象
7535
7539
  var arrJsonData = (0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_6__.getJsonDataByKeyRoute)(keyRoute, this.jsonData);
7540
+ /*
7541
+ if (!isArray(arrJsonData)) {
7542
+ arrJsonData = [];
7543
+ }
7544
+ */
7536
7545
  // const _arrJsonData = toJS(arrJsonData);
7537
7546
  if ((0,$utils_typeof__WEBPACK_IMPORTED_MODULE_8__.isArray)(arrJsonData)) {
7538
7547
  // 2. 获取数组的第一个数据项
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wibetter/json-editor",
3
- "version": "5.1.9",
3
+ "version": "5.1.11",
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.1.9
2
+ * @wibetter/json-editor v5.1.11
3
3
  * author: wibetter
4
4
  * build tool: AKFun
5
- * build time: Mon Jan 13 2025 19:32:50 GMT+0800 (中国标准时间)
5
+ * build time: Thu Jan 16 2025 17:05:40 GMT+0800 (中国标准时间)
6
6
  * build tool info: https://github.com/wibetter/akfun
7
7
  */
8
8
  /*!*********************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
@@ -1188,6 +1188,9 @@
1188
1188
  .select-box .ant-select-single {
1189
1189
  min-width: 150px;
1190
1190
  }
1191
+ .select-box .ant-select-selection-item {
1192
+ max-width: 120px;
1193
+ }
1191
1194
  .select-box .ant-select-selection-item-content {
1192
1195
  max-width: 100px;
1193
1196
  }