@wibetter/json-utils 7.0.0 → 7.0.1
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/dist/index.esm.js +753 -355
- package/dist/index.esm.min.js +1469 -1
- package/dist/index.js +1659 -1
- package/dist/index.js.LICENSE.txt +2 -2
- package/dist/types/data/TypeDataList.d.ts +112 -112
- package/dist/types/data/initSchemaEntity/Api.d.ts +38 -38
- package/dist/types/data/initSchemaEntity/Array.d.ts +11 -11
- package/dist/types/data/initSchemaEntity/Boolean.d.ts +4 -4
- package/dist/types/data/initSchemaEntity/BoxStyle.d.ts +20 -20
- package/dist/types/data/initSchemaEntity/Cascader.d.ts +15 -15
- package/dist/types/data/initSchemaEntity/Checkbox.d.ts +8 -8
- package/dist/types/data/initSchemaEntity/CodeArea.d.ts +5 -5
- package/dist/types/data/initSchemaEntity/Color.d.ts +4 -4
- package/dist/types/data/initSchemaEntity/DataSource.d.ts +58 -58
- package/dist/types/data/initSchemaEntity/Date.d.ts +5 -5
- package/dist/types/data/initSchemaEntity/DateTime.d.ts +5 -5
- package/dist/types/data/initSchemaEntity/DynamicData.d.ts +86 -86
- package/dist/types/data/initSchemaEntity/EmptyArray.d.ts +7 -7
- package/dist/types/data/initSchemaEntity/EmptyObject.d.ts +4 -4
- package/dist/types/data/initSchemaEntity/Event.d.ts +74 -74
- package/dist/types/data/initSchemaEntity/FuncBody.d.ts +5 -5
- package/dist/types/data/initSchemaEntity/HtmlArea.d.ts +5 -5
- package/dist/types/data/initSchemaEntity/IMG.d.ts +7 -7
- package/dist/types/data/initSchemaEntity/Input.d.ts +5 -5
- package/dist/types/data/initSchemaEntity/InputImage.d.ts +5 -5
- package/dist/types/data/initSchemaEntity/JSONSchema.d.ts +45 -45
- package/dist/types/data/initSchemaEntity/Json.d.ts +4 -4
- package/dist/types/data/initSchemaEntity/Number.d.ts +6 -6
- package/dist/types/data/initSchemaEntity/Object.d.ts +12 -12
- package/dist/types/data/initSchemaEntity/PaddingMargin.d.ts +26 -26
- package/dist/types/data/initSchemaEntity/Quantity.d.ts +22 -22
- package/dist/types/data/initSchemaEntity/Radio.d.ts +7 -7
- package/dist/types/data/initSchemaEntity/Select.d.ts +7 -7
- package/dist/types/data/initSchemaEntity/TextEditor.d.ts +5 -5
- package/dist/types/data/initSchemaEntity/Textarea.d.ts +5 -5
- package/dist/types/data/initSchemaEntity/Time.d.ts +5 -5
- package/dist/types/data/initSchemaEntity/URL.d.ts +5 -5
- package/dist/types/function/getJsonDataByKeyRoute.d.ts +5 -1
- package/dist/types/function/getSchemaByIndexRoute.d.ts +5 -1
- package/dist/types/function/getSchemaByKeyRoute.d.ts +5 -1
- package/dist/types/function/indexRoute2keyRoute.d.ts +4 -1
- package/dist/types/function/json2treeData.d.ts +8 -2
- package/dist/types/function/keyRoute2indexRoute.d.ts +4 -1
- package/dist/types/function/metaElemAnalyzer.d.ts +4 -1
- package/dist/types/function/schema2conditionValue.d.ts +4 -1
- package/dist/types/utils/index.d.ts +8 -2
- package/dist/types/utils/jsonData.d.ts +3 -1
- package/dist/types/utils/jsonSchema.d.ts +21 -6
- package/package.json +1 -1
|
@@ -8,27 +8,27 @@
|
|
|
8
8
|
* propertyOrder:按序存放所有子字段的key值(排序功能)
|
|
9
9
|
* */
|
|
10
10
|
export declare const initQuantityData: {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
quantity: {
|
|
24
|
-
type: string;
|
|
25
|
-
default: string;
|
|
26
|
-
options: {
|
|
27
|
-
label: string;
|
|
28
|
-
value: string;
|
|
29
|
-
}[];
|
|
30
|
-
title: string;
|
|
31
|
-
};
|
|
11
|
+
type: string;
|
|
12
|
+
title: string;
|
|
13
|
+
isContainer: boolean;
|
|
14
|
+
properties: {
|
|
15
|
+
unit: {
|
|
16
|
+
type: string;
|
|
17
|
+
title: string;
|
|
18
|
+
default: number;
|
|
19
|
+
minimum: number;
|
|
20
|
+
maximum: number;
|
|
21
|
+
description: string;
|
|
32
22
|
};
|
|
33
|
-
|
|
23
|
+
quantity: {
|
|
24
|
+
type: string;
|
|
25
|
+
default: string;
|
|
26
|
+
options: {
|
|
27
|
+
label: string;
|
|
28
|
+
value: string;
|
|
29
|
+
}[];
|
|
30
|
+
title: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
propertyOrder: string[];
|
|
34
34
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export declare const initRadioData: {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
type: string;
|
|
3
|
+
title: string;
|
|
4
|
+
options: {
|
|
5
|
+
label: string;
|
|
6
|
+
value: string;
|
|
7
|
+
}[];
|
|
8
|
+
description: string;
|
|
9
9
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export declare const initSelectData: {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
type: string;
|
|
3
|
+
title: string;
|
|
4
|
+
options: {
|
|
5
|
+
label: string;
|
|
6
|
+
value: string;
|
|
7
|
+
}[];
|
|
8
|
+
description: string;
|
|
9
9
|
};
|
|
@@ -5,4 +5,8 @@
|
|
|
5
5
|
* targetJsonDataObj: json数据对象
|
|
6
6
|
* useObjClone: 是否进行深拷贝,避免影响原有数据。(默认不进行深拷贝)
|
|
7
7
|
*/
|
|
8
|
-
export declare function getJsonDataByKeyRoute(
|
|
8
|
+
export declare function getJsonDataByKeyRoute(
|
|
9
|
+
keyRoute: string,
|
|
10
|
+
targetJsonDataObj: any,
|
|
11
|
+
useObjClone?: boolean,
|
|
12
|
+
): any;
|
|
@@ -5,4 +5,8 @@
|
|
|
5
5
|
* targetJsonSchemaObj: schema数据对象
|
|
6
6
|
* useObjClone: 是否进行深拷贝,避免影响原有数据。(默认不进行深拷贝)
|
|
7
7
|
*/
|
|
8
|
-
export declare function getSchemaByIndexRoute(
|
|
8
|
+
export declare function getSchemaByIndexRoute(
|
|
9
|
+
indexRoute: string | number,
|
|
10
|
+
targetJsonSchemaObj: any,
|
|
11
|
+
useObjClone?: boolean,
|
|
12
|
+
): any;
|
|
@@ -5,4 +5,8 @@
|
|
|
5
5
|
* targetJsonSchemaObj: schema数据对象
|
|
6
6
|
* useObjClone: 是否进行深拷贝,避免影响原有数据。(默认不进行深拷贝)
|
|
7
7
|
*/
|
|
8
|
-
export declare function getSchemaByKeyRoute(
|
|
8
|
+
export declare function getSchemaByKeyRoute(
|
|
9
|
+
keyRoute: string,
|
|
10
|
+
targetJsonSchemaObj: any,
|
|
11
|
+
useObjClone?: boolean,
|
|
12
|
+
): any;
|
|
@@ -4,4 +4,7 @@
|
|
|
4
4
|
* indexRoute: index索引路径
|
|
5
5
|
* targetJsonSchemaObj: schema数据对象
|
|
6
6
|
* */
|
|
7
|
-
export declare function indexRoute2keyRoute(
|
|
7
|
+
export declare function indexRoute2keyRoute(
|
|
8
|
+
indexRoute: string | number,
|
|
9
|
+
targetJsonSchemaObj: any,
|
|
10
|
+
): string;
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* DataRoute转真实数据路径
|
|
3
3
|
* */
|
|
4
|
-
export declare function dataRoute2dataPath(
|
|
4
|
+
export declare function dataRoute2dataPath(
|
|
5
|
+
dataRoute: string,
|
|
6
|
+
baseDataPath: string,
|
|
7
|
+
): string;
|
|
5
8
|
/**
|
|
6
9
|
* mockData转treeData(供antd的TreeSelect使用)
|
|
7
10
|
* */
|
|
8
|
-
export declare function json2treeData(
|
|
11
|
+
export declare function json2treeData(
|
|
12
|
+
mockData: any,
|
|
13
|
+
parentDataRoute: string,
|
|
14
|
+
): any[];
|
|
@@ -4,4 +4,7 @@
|
|
|
4
4
|
* keyRoute: key值路径
|
|
5
5
|
* targetJsonSchemaObj: schema数据对象
|
|
6
6
|
* */
|
|
7
|
-
export declare function keyRoute2indexRoute(
|
|
7
|
+
export declare function keyRoute2indexRoute(
|
|
8
|
+
keyRoute: string,
|
|
9
|
+
targetJsonSchemaObj: any,
|
|
10
|
+
): string;
|
|
@@ -13,7 +13,10 @@ export declare function urlStringify(urlParams: any): string;
|
|
|
13
13
|
export declare function objClone(targetObj: any): any;
|
|
14
14
|
/** 对比两个json数据是否相等 */
|
|
15
15
|
export declare function isEqual(targetObj: any, nextTargetObj: any): boolean;
|
|
16
|
-
export declare function isEqualByIdT(
|
|
16
|
+
export declare function isEqualByIdT(
|
|
17
|
+
targetObj: any,
|
|
18
|
+
nextTargetObj: any,
|
|
19
|
+
): boolean;
|
|
17
20
|
/** 判断当前属性是否存在
|
|
18
21
|
* 备注:要识别boolean类型的数值 */
|
|
19
22
|
export declare function hasProperties(targetProperties: any): boolean;
|
|
@@ -21,4 +24,7 @@ export declare function truncate(str: string, paramConfig: any): string;
|
|
|
21
24
|
/**
|
|
22
25
|
* 支持属性表达式
|
|
23
26
|
*/
|
|
24
|
-
export declare function evalExpression(
|
|
27
|
+
export declare function evalExpression(
|
|
28
|
+
expressionStr: string,
|
|
29
|
+
data: any,
|
|
30
|
+
): string | false;
|
|
@@ -5,4 +5,6 @@ export declare function getParentKeyRoute(curKeyRoute: string): string;
|
|
|
5
5
|
/**
|
|
6
6
|
* 获取父元素的key路径值和当前key
|
|
7
7
|
*/
|
|
8
|
-
export declare function getParentKeyRoute_CurKey(
|
|
8
|
+
export declare function getParentKeyRoute_CurKey(
|
|
9
|
+
curKeyRoute: string,
|
|
10
|
+
): [string, string];
|
|
@@ -24,23 +24,35 @@ export declare function isStructuredSchema(jsonSchema: any): boolean;
|
|
|
24
24
|
* 判断是否是同一个父元素
|
|
25
25
|
* 备注:用于判断两个元素是否在同一个父级容器中
|
|
26
26
|
*/
|
|
27
|
-
export declare function isSameParent(
|
|
27
|
+
export declare function isSameParent(
|
|
28
|
+
curIndex: string,
|
|
29
|
+
targetIndex: string,
|
|
30
|
+
): boolean;
|
|
28
31
|
/**
|
|
29
32
|
* 判断当前元素在目标元素的位置 前 or 后(根据当前元素的位置和目标元素的位置)
|
|
30
33
|
*/
|
|
31
|
-
export declare function getCurPosition(
|
|
34
|
+
export declare function getCurPosition(
|
|
35
|
+
curIndex: string,
|
|
36
|
+
targetIndex: string,
|
|
37
|
+
): string;
|
|
32
38
|
/**
|
|
33
39
|
* 获取父元素的路径值
|
|
34
40
|
*/
|
|
35
|
-
export declare function getParentIndexRoute(
|
|
41
|
+
export declare function getParentIndexRoute(
|
|
42
|
+
curIndexRoute: string | number,
|
|
43
|
+
): string;
|
|
36
44
|
/**
|
|
37
45
|
* 获取下一个兄弟元素的路径值
|
|
38
46
|
*/
|
|
39
|
-
export declare function getNextIndexRoute(
|
|
47
|
+
export declare function getNextIndexRoute(
|
|
48
|
+
curIndexRoute: string | number,
|
|
49
|
+
): string;
|
|
40
50
|
/**
|
|
41
51
|
* 获取父元素的路径值和当前index
|
|
42
52
|
*/
|
|
43
|
-
export declare function getParentIndexRoute_CurIndex(
|
|
53
|
+
export declare function getParentIndexRoute_CurIndex(
|
|
54
|
+
curIndexRoute: string | number,
|
|
55
|
+
): string[];
|
|
44
56
|
/**
|
|
45
57
|
* 将当前路径值向前移动一位
|
|
46
58
|
*/
|
|
@@ -52,4 +64,7 @@ export declare function moveBackward(curIndexRoute: string | number): any;
|
|
|
52
64
|
/**
|
|
53
65
|
* 获取第一个选项值
|
|
54
66
|
*/
|
|
55
|
-
export declare function getDefaultOptionVal(
|
|
67
|
+
export declare function getDefaultOptionVal(
|
|
68
|
+
jsonSchema: any,
|
|
69
|
+
multiple?: boolean,
|
|
70
|
+
): any;
|