@wibetter/json-editor 5.0.6 → 5.0.7
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.js +13730 -7551
- package/package.json +1 -1
- package/sdk/index.css +2 -2
- package/sdk/index.js +12 -5
package/package.json
CHANGED
package/sdk/index.css
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @wibetter/json-editor v5.0.
|
|
2
|
+
* @wibetter/json-editor v5.0.7
|
|
3
3
|
* author: wibetter
|
|
4
4
|
* build tool: AKFun
|
|
5
|
-
* build time:
|
|
5
|
+
* build time: Mon Dec 23 2024 18:08:06 GMT+0800 (中国标准时间)
|
|
6
6
|
* build tool info: https://github.com/wibetter/akfun
|
|
7
7
|
*/
|
|
8
8
|
/*!*********************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
package/sdk/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @wibetter/json-editor v5.0.
|
|
2
|
+
* @wibetter/json-editor v5.0.7
|
|
3
3
|
* author: wibetter
|
|
4
4
|
* build tool: AKFun
|
|
5
|
-
* build time:
|
|
5
|
+
* build time: Mon Dec 23 2024 18:08:06 GMT+0800 (中国标准时间)
|
|
6
6
|
* build tool info: https://github.com/wibetter/akfun
|
|
7
7
|
*/
|
|
8
8
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
@@ -68879,8 +68879,15 @@ var JSONSchemaStore = (_dec = mobx__WEBPACK_IMPORTED_MODULE_4__.action.bound, _d
|
|
|
68879
68879
|
this.jsonSchema = newJSONSchema;
|
|
68880
68880
|
}
|
|
68881
68881
|
var curJsonData = this.state.rootJSONStore.JSONEditorStore.jsonData;
|
|
68882
|
+
var newJsonData = {};
|
|
68882
68883
|
/** 根据jsonSchema生成对应的最新jsonData */
|
|
68883
|
-
|
|
68884
|
+
if (this.jsonSchema.reset) {
|
|
68885
|
+
// schema 变动不保留旧版 jsonData 数据
|
|
68886
|
+
newJsonData = (0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_5__.schema2json)(this.jsonSchema, {});
|
|
68887
|
+
} else {
|
|
68888
|
+
// 默认保留旧版jsonData数据
|
|
68889
|
+
newJsonData = (0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_5__.schema2json)(this.jsonSchema, curJsonData);
|
|
68890
|
+
}
|
|
68884
68891
|
/** 更新当前的jsonData */
|
|
68885
68892
|
this.state.rootJSONStore.JSONEditorStore.jsonData = newJsonData;
|
|
68886
68893
|
this.state.rootJSONStore.JSONEditorStore.initJsonData = (0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_5__.objClone)(curJsonData); // 备份此前的数据对象
|
|
@@ -262154,7 +262161,7 @@ function baseSchema2JsonData(jsonSchema, jsonData) {
|
|
|
262154
262161
|
curJsonData = hasProperties(curValue) ? curValue : false;
|
|
262155
262162
|
break;
|
|
262156
262163
|
case 'number':
|
|
262157
|
-
curJsonData = hasProperties(curValue) ? curValue :
|
|
262164
|
+
curJsonData = hasProperties(curValue) ? curValue : undefined;
|
|
262158
262165
|
break;
|
|
262159
262166
|
case 'json':
|
|
262160
262167
|
/* 转成json类型进行特殊处理,需要保证json类型的数值是json对象 */
|
|
@@ -262184,7 +262191,7 @@ function baseSchema2JsonData(jsonSchema, jsonData) {
|
|
|
262184
262191
|
// 兼容处理:解决box-style默认值丢失问题
|
|
262185
262192
|
curJsonData = curValue ? curValue : jsonSchema.default;
|
|
262186
262193
|
} else {
|
|
262187
|
-
curJsonData = hasProperties(curValue) ? curValue :
|
|
262194
|
+
curJsonData = hasProperties(curValue) ? curValue : undefined;
|
|
262188
262195
|
}
|
|
262189
262196
|
}
|
|
262190
262197
|
return curJsonData;
|