@wibetter/json-editor 5.1.27 → 5.1.28
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 +1 -1
- package/lib/index.js +32 -31
- package/package.json +1 -1
- package/sdk/index.css +2 -2
- package/sdk/index.js +1699 -2988
package/lib/index.css
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @wibetter/json-editor v5.1.27
|
|
3
3
|
* author: wibetter
|
|
4
4
|
* build tool: AKFun
|
|
5
|
-
* build time: Fri
|
|
5
|
+
* build time: Fri Feb 14 2025 21:37:10 GMT+0800 (中国标准时间)
|
|
6
6
|
* build tool info: https://github.com/wibetter/akfun
|
|
7
7
|
*/
|
|
8
8
|
/*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
package/lib/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @wibetter/json-editor v5.1.27
|
|
3
3
|
* author: wibetter
|
|
4
4
|
* build tool: AKFun
|
|
5
|
-
* build time: Fri
|
|
5
|
+
* build time: Fri Feb 14 2025 21:37:10 GMT+0800 (中国标准时间)
|
|
6
6
|
* build tool info: https://github.com/wibetter/akfun
|
|
7
7
|
*/
|
|
8
8
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
@@ -7453,6 +7453,7 @@ var JSONEditorStore = (_dec = mobx__WEBPACK_IMPORTED_MODULE_4__.action.bound, _d
|
|
|
7453
7453
|
this.updateLastTime();
|
|
7454
7454
|
}
|
|
7455
7455
|
}
|
|
7456
|
+
console.info('[json-editor]initJSONData:', this.jsonData);
|
|
7456
7457
|
}
|
|
7457
7458
|
|
|
7458
7459
|
/** 初始化jsonData */;
|
|
@@ -7808,41 +7809,41 @@ var JSONSchemaStore = (_dec = mobx__WEBPACK_IMPORTED_MODULE_4__.action.bound, _d
|
|
|
7808
7809
|
this.jsonSchema = newJSONSchema;
|
|
7809
7810
|
}
|
|
7810
7811
|
}
|
|
7812
|
+
console.info('[json-editor]initJSONSchemaData:', this.jsonSchema);
|
|
7811
7813
|
}
|
|
7812
7814
|
|
|
7813
7815
|
/** 根据索引路径获取对应的json数据[非联动式数据获取] */;
|
|
7814
7816
|
_proto.JSONSchemaChange = function JSONSchemaChange(jsonSchemaData) {
|
|
7815
|
-
if (!
|
|
7816
|
-
|
|
7817
|
-
|
|
7818
|
-
|
|
7819
|
-
|
|
7820
|
-
|
|
7821
|
-
|
|
7822
|
-
|
|
7823
|
-
|
|
7824
|
-
|
|
7825
|
-
this.jsonSchema = newJSONSchema;
|
|
7826
|
-
}
|
|
7827
|
-
var JSONEditorStore = this.state.rootJSONStore.JSONEditorStore;
|
|
7828
|
-
var curJsonData = JSONEditorStore.jsonData;
|
|
7829
|
-
var newJsonData = {};
|
|
7830
|
-
/** 根据jsonSchema生成对应的最新jsonData */
|
|
7831
|
-
if (this.jsonSchema.reset) {
|
|
7832
|
-
// schema 变动不保留旧版 jsonData 数据
|
|
7833
|
-
newJsonData = (0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_5__.schema2json)(this.jsonSchema, {});
|
|
7834
|
-
} else {
|
|
7835
|
-
// 默认保留旧版jsonData数据
|
|
7836
|
-
newJsonData = (0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_5__.schema2json)(this.jsonSchema, curJsonData);
|
|
7837
|
-
}
|
|
7838
|
-
/** 更新当前的jsonData */
|
|
7839
|
-
this.state.rootJSONStore.JSONEditorStore.jsonData = newJsonData;
|
|
7840
|
-
this.state.rootJSONStore.JSONEditorStore.initJsonData = (0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_5__.objClone)(curJsonData); // 备份此前的数据对象
|
|
7841
|
-
/** jsonSchema变动的时候触发一次jsonDataChange
|
|
7842
|
-
* jsonSchema变动意味着jsonData也需要进行对应的结构更新
|
|
7843
|
-
* */
|
|
7844
|
-
// this.state.rootJSONStore.JSONEditorStore.jsonDataChange();
|
|
7817
|
+
if (!jsonSchemaData || JSON.stringify(jsonSchemaData) === '{}') {
|
|
7818
|
+
// 使用默认的jsonschema数据进行初始化
|
|
7819
|
+
this.jsonSchema = (0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_5__.objClone)(_initJSONSchemaData);
|
|
7820
|
+
} else if (jsonSchemaData && (0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_5__.isNewSchemaData)(jsonSchemaData)) {
|
|
7821
|
+
/** 如果有lastUpdateTime则说明是新版jsonSchema数据,无需转换直接进行赋值 */
|
|
7822
|
+
this.jsonSchema = jsonSchemaData;
|
|
7823
|
+
} else {
|
|
7824
|
+
// 进行一次转换,以便兼容旧版数据
|
|
7825
|
+
var newJSONSchema = (0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_5__.oldSchemaToNewSchema)(jsonSchemaData);
|
|
7826
|
+
this.jsonSchema = newJSONSchema;
|
|
7845
7827
|
}
|
|
7828
|
+
var JSONEditorStore = this.state.rootJSONStore.JSONEditorStore;
|
|
7829
|
+
var curJsonData = JSONEditorStore.jsonData;
|
|
7830
|
+
var newJsonData = {};
|
|
7831
|
+
/** 根据jsonSchema生成对应的最新jsonData */
|
|
7832
|
+
if (this.jsonSchema.reset) {
|
|
7833
|
+
// schema 变动不保留旧版 jsonData 数据
|
|
7834
|
+
newJsonData = (0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_5__.schema2json)(this.jsonSchema, {});
|
|
7835
|
+
} else {
|
|
7836
|
+
// 默认保留旧版jsonData数据
|
|
7837
|
+
newJsonData = (0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_5__.schema2json)(this.jsonSchema, curJsonData);
|
|
7838
|
+
}
|
|
7839
|
+
/** 更新当前的jsonData */
|
|
7840
|
+
this.state.rootJSONStore.JSONEditorStore.jsonData = newJsonData;
|
|
7841
|
+
this.state.rootJSONStore.JSONEditorStore.initJsonData = (0,_wibetter_json_utils__WEBPACK_IMPORTED_MODULE_5__.objClone)(curJsonData); // 备份此前的数据对象
|
|
7842
|
+
/** jsonSchema变动的时候触发一次jsonDataChange
|
|
7843
|
+
* jsonSchema变动意味着jsonData也需要进行对应的结构更新
|
|
7844
|
+
* */
|
|
7845
|
+
// this.state.rootJSONStore.JSONEditorStore.jsonDataChange();
|
|
7846
|
+
console.info('[json-editor]JSONSchemaChange:', this.jsonSchema);
|
|
7846
7847
|
};
|
|
7847
7848
|
/** 根据索引路径获取对应的key值路径 */
|
|
7848
7849
|
_proto.indexRoute2keyRoute = function indexRoute2keyRoute(indexRoute) {
|
package/package.json
CHANGED
package/sdk/index.css
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @wibetter/json-editor v5.1.
|
|
2
|
+
* @wibetter/json-editor v5.1.27
|
|
3
3
|
* author: wibetter
|
|
4
4
|
* build tool: AKFun
|
|
5
|
-
* build time: Fri
|
|
5
|
+
* build time: Fri Feb 14 2025 21:38:33 GMT+0800 (中国标准时间)
|
|
6
6
|
* build tool info: https://github.com/wibetter/akfun
|
|
7
7
|
*/
|
|
8
8
|
/*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|