cabloy 5.1.120 → 5.1.122
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/.cabloy-version +1 -1
- package/CHANGELOG.md +17 -0
- package/cabloy-docs/frontend/form-layout-guide.md +51 -20
- package/cabloy-docs/frontend/table-resource-crud-cookbook.md +31 -4
- package/cabloy-docs/frontend/zova-form-source-reading-map.md +7 -5
- package/cabloy-docs/frontend/zova-form-under-the-hood.md +5 -2
- package/cabloy-docs/fullstack/backend-metadata-to-frontend-table-actions.md +2 -2
- package/e2e/specs/cabloy-basic/basic.spec.ts +9 -0
- package/package.json +1 -1
- package/vona/packages-cli/cli/package.json +1 -1
- package/vona/packages-cli/cli-set-api/cli/templates/tools/crudBasic/boilerplate/src/dto/{{resourceName}}SelectResItem.tsx_ +27 -2
- package/vona/packages-cli/cli-set-api/cli/templates/tools/crudStart/boilerplate/src/dto/{{resourceName}}SelectResItem.tsx_ +27 -2
- package/vona/packages-cli/cli-set-api/package.json +1 -1
- package/vona/pnpm-lock.yaml +39 -39
- package/vona/src/suite/a-commerce/modules/commerce-catalog/src/dto/categorySelectResItem.tsx +23 -1
- package/vona/src/suite/a-commerce/modules/commerce-catalog/src/dto/productSelectResItem.tsx +23 -1
- package/vona/src/suite/a-commerce/modules/commerce-catalog/src/dto/skuSelectResItem.tsx +23 -1
- package/vona/src/suite/a-commerce/modules/commerce-member/src/dto/addressSelectResItem.tsx +24 -1
- package/vona/src/suite/a-commerce/modules/commerce-promotion/src/dto/couponTemplateSelectResItem.tsx +23 -1
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/dto/orderSelectResItem.tsx +23 -1
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/dto/stockAuditSelectResItem.tsx +23 -1
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/dto/stockBalanceSelectResItem.tsx +23 -1
- package/vona/src/suite/a-commerce/modules/commerce-trade/src/service/order.ts +6 -1
- package/vona/src/suite/a-commerce/modules/commerce-trade/test/shipmentRefundRace.test.ts +377 -24
- package/vona/src/suite/a-training/modules/training-record/src/dto/recordSelectResItem.tsx +24 -1
- package/vona/src/suite/a-training/modules/training-student/src/dto/studentSelectResItem.tsx +4 -1
- package/vona/src/suite/a-training/modules/training-student/test/student.test.ts +10 -3
- package/zova/packages-zova/zova/package.json +2 -2
- package/zova/pnpm-lock.yaml +3 -3
- package/zova/src/suite/cabloy-basic/modules/basic-form/src/component/blockFormLayout/controller.tsx +25 -4
- package/zova/src/suite-vendor/a-zova/modules/a-form/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-form/src/component/form/controller.tsx +1 -0
- package/zova/src/suite-vendor/a-zova/modules/a-form/src/lib/formLayout.ts +21 -4
- package/zova/src/suite-vendor/a-zova/modules/a-form/src/types/formLayout.ts +13 -4
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/resource/formLayout.ts +14 -4
- package/zova/src/suite-vendor/a-zova/package.json +3 -3
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
IFormLayout,
|
|
3
3
|
IFormLayoutField,
|
|
4
|
+
IFormLayoutLeaf,
|
|
4
5
|
IFormLayoutNode,
|
|
5
6
|
IFormLayoutTab,
|
|
6
7
|
IFormLayoutTabs,
|
|
@@ -11,6 +12,7 @@ import type {
|
|
|
11
12
|
IFormLayoutDiagnostic,
|
|
12
13
|
IResolvedFormLayout,
|
|
13
14
|
IResolvedFormLayoutField,
|
|
15
|
+
IResolvedFormLayoutLeaf,
|
|
14
16
|
IResolvedFormLayoutGroup,
|
|
15
17
|
IResolvedFormLayoutNode,
|
|
16
18
|
IResolvedFormLayoutSection,
|
|
@@ -68,6 +70,9 @@ function resolveNode(
|
|
|
68
70
|
if (node.type === 'field') {
|
|
69
71
|
return resolveField(node, tabPath, propertyNames, fieldNames, diagnostics, fieldTabPaths);
|
|
70
72
|
}
|
|
73
|
+
if (node.type === 'block') {
|
|
74
|
+
return node;
|
|
75
|
+
}
|
|
71
76
|
if (node.type === 'tabs') {
|
|
72
77
|
return resolveTabs(
|
|
73
78
|
node,
|
|
@@ -84,9 +89,9 @@ function resolveNode(
|
|
|
84
89
|
if (node.type === 'section') {
|
|
85
90
|
const children = node.children
|
|
86
91
|
.map(item =>
|
|
87
|
-
|
|
92
|
+
resolveLeaf(item, tabPath, propertyNames, fieldNames, diagnostics, fieldTabPaths),
|
|
88
93
|
)
|
|
89
|
-
.filter(Boolean) as
|
|
94
|
+
.filter(Boolean) as IResolvedFormLayoutLeaf[];
|
|
90
95
|
return children.length ? { ...node, id, children } : undefined;
|
|
91
96
|
}
|
|
92
97
|
const children = node.children
|
|
@@ -103,11 +108,23 @@ function resolveNode(
|
|
|
103
108
|
),
|
|
104
109
|
)
|
|
105
110
|
.filter(Boolean) as Array<
|
|
106
|
-
|
|
111
|
+
IResolvedFormLayoutLeaf | IResolvedFormLayoutGroup | IResolvedFormLayoutSection
|
|
107
112
|
>;
|
|
108
113
|
return children.length ? { ...node, id, children } : undefined;
|
|
109
114
|
}
|
|
110
115
|
|
|
116
|
+
function resolveLeaf(
|
|
117
|
+
node: IFormLayoutLeaf,
|
|
118
|
+
tabPath: IResolvedFormLayout['fieldTabPaths'][string],
|
|
119
|
+
propertyNames: Set<string>,
|
|
120
|
+
fieldNames: Set<string>,
|
|
121
|
+
diagnostics: IFormLayoutDiagnostic[],
|
|
122
|
+
fieldTabPaths: IResolvedFormLayout['fieldTabPaths'],
|
|
123
|
+
): IResolvedFormLayoutLeaf | undefined {
|
|
124
|
+
if (node.type === 'block') return node;
|
|
125
|
+
return resolveField(node, tabPath, propertyNames, fieldNames, diagnostics, fieldTabPaths);
|
|
126
|
+
}
|
|
127
|
+
|
|
111
128
|
function resolveTabs(
|
|
112
129
|
node: IFormLayoutTabs,
|
|
113
130
|
indexPath: number[],
|
|
@@ -163,7 +180,7 @@ function resolveTab(
|
|
|
163
180
|
),
|
|
164
181
|
)
|
|
165
182
|
.filter(Boolean) as Array<
|
|
166
|
-
|
|
183
|
+
IResolvedFormLayoutLeaf | IResolvedFormLayoutGroup | IResolvedFormLayoutSection
|
|
167
184
|
>;
|
|
168
185
|
return children.length ? { ...node, id, children } : undefined;
|
|
169
186
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
IFormLayoutResponsiveColumns,
|
|
3
|
+
IResourceRenderBlockOptionsBlock,
|
|
3
4
|
TypeFormLayoutSectionLayout,
|
|
4
5
|
} from 'zova-module-a-openapi';
|
|
5
6
|
|
|
@@ -15,12 +16,20 @@ export interface IResolvedFormLayoutField {
|
|
|
15
16
|
span?: IFormLayoutResponsiveColumns;
|
|
16
17
|
}
|
|
17
18
|
|
|
19
|
+
export interface IResolvedFormLayoutBlock {
|
|
20
|
+
type: 'block';
|
|
21
|
+
block: IResourceRenderBlockOptionsBlock;
|
|
22
|
+
span?: IFormLayoutResponsiveColumns;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type IResolvedFormLayoutLeaf = IResolvedFormLayoutField | IResolvedFormLayoutBlock;
|
|
26
|
+
|
|
18
27
|
export interface IResolvedFormLayoutGroup {
|
|
19
28
|
type: 'group';
|
|
20
29
|
id: string;
|
|
21
30
|
title?: string;
|
|
22
31
|
description?: string;
|
|
23
|
-
children: Array<
|
|
32
|
+
children: Array<IResolvedFormLayoutLeaf | IResolvedFormLayoutGroup | IResolvedFormLayoutSection>;
|
|
24
33
|
}
|
|
25
34
|
|
|
26
35
|
export interface IResolvedFormLayoutSection {
|
|
@@ -30,7 +39,7 @@ export interface IResolvedFormLayoutSection {
|
|
|
30
39
|
description?: string;
|
|
31
40
|
layout?: TypeFormLayoutSectionLayout;
|
|
32
41
|
columns?: IFormLayoutResponsiveColumns;
|
|
33
|
-
children:
|
|
42
|
+
children: IResolvedFormLayoutLeaf[];
|
|
34
43
|
}
|
|
35
44
|
|
|
36
45
|
export interface IResolvedFormLayoutTabs {
|
|
@@ -43,7 +52,7 @@ export interface IResolvedFormLayoutTab {
|
|
|
43
52
|
type: 'tab';
|
|
44
53
|
id: string;
|
|
45
54
|
title: string;
|
|
46
|
-
children: Array<
|
|
55
|
+
children: Array<IResolvedFormLayoutLeaf | IResolvedFormLayoutGroup | IResolvedFormLayoutSection>;
|
|
47
56
|
}
|
|
48
57
|
|
|
49
58
|
export interface IResolvedFormLayoutTabRef {
|
|
@@ -52,7 +61,7 @@ export interface IResolvedFormLayoutTabRef {
|
|
|
52
61
|
}
|
|
53
62
|
|
|
54
63
|
export type IResolvedFormLayoutNode =
|
|
55
|
-
|
|
|
64
|
+
| IResolvedFormLayoutLeaf
|
|
56
65
|
| IResolvedFormLayoutGroup
|
|
57
66
|
| IResolvedFormLayoutSection
|
|
58
67
|
| IResolvedFormLayoutTabs;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { IResourceRenderBlockOptionsBlock } from './block.js';
|
|
2
|
+
|
|
1
3
|
export interface IFormLayout {
|
|
2
4
|
children: IFormLayoutNode[];
|
|
3
5
|
}
|
|
@@ -18,12 +20,20 @@ export interface IFormLayoutField {
|
|
|
18
20
|
span?: IFormLayoutResponsiveColumns;
|
|
19
21
|
}
|
|
20
22
|
|
|
23
|
+
export interface IFormLayoutBlock {
|
|
24
|
+
type: 'block';
|
|
25
|
+
block: IResourceRenderBlockOptionsBlock;
|
|
26
|
+
span?: IFormLayoutResponsiveColumns;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type IFormLayoutLeaf = IFormLayoutField | IFormLayoutBlock;
|
|
30
|
+
|
|
21
31
|
export interface IFormLayoutGroup {
|
|
22
32
|
type: 'group';
|
|
23
33
|
id?: string;
|
|
24
34
|
title?: string;
|
|
25
35
|
description?: string;
|
|
26
|
-
children: Array<
|
|
36
|
+
children: Array<IFormLayoutLeaf | IFormLayoutGroup | IFormLayoutSection>;
|
|
27
37
|
}
|
|
28
38
|
|
|
29
39
|
export interface IFormLayoutSection {
|
|
@@ -33,7 +43,7 @@ export interface IFormLayoutSection {
|
|
|
33
43
|
description?: string;
|
|
34
44
|
layout?: TypeFormLayoutSectionLayout;
|
|
35
45
|
columns?: IFormLayoutResponsiveColumns;
|
|
36
|
-
children:
|
|
46
|
+
children: IFormLayoutLeaf[];
|
|
37
47
|
}
|
|
38
48
|
|
|
39
49
|
export interface IFormLayoutTabs {
|
|
@@ -46,11 +56,11 @@ export interface IFormLayoutTab {
|
|
|
46
56
|
type: 'tab';
|
|
47
57
|
id?: string;
|
|
48
58
|
title: string;
|
|
49
|
-
children: Array<
|
|
59
|
+
children: Array<IFormLayoutLeaf | IFormLayoutGroup | IFormLayoutSection>;
|
|
50
60
|
}
|
|
51
61
|
|
|
52
62
|
export type IFormLayoutNode =
|
|
53
|
-
|
|
|
63
|
+
| IFormLayoutLeaf
|
|
54
64
|
| IFormLayoutGroup
|
|
55
65
|
| IFormLayoutSection
|
|
56
66
|
| IFormLayoutTabs;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-suite-a-zova",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.141",
|
|
4
4
|
"gitHead": "2c5c19284bab738e492856189acb6fad74b8a7b7",
|
|
5
5
|
"description": "zova",
|
|
6
6
|
"license": "MIT",
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
"zova-module-a-boundary": "^5.1.21",
|
|
17
17
|
"zova-module-a-command": "^5.1.33",
|
|
18
18
|
"zova-module-a-fetch": "^5.1.24",
|
|
19
|
-
"zova-module-a-form": "^5.1.
|
|
19
|
+
"zova-module-a-form": "^5.1.46",
|
|
20
20
|
"zova-module-a-icon": "^5.1.26",
|
|
21
21
|
"zova-module-a-interceptor": "^5.1.29",
|
|
22
22
|
"zova-module-a-logger": "^5.1.26",
|
|
23
23
|
"zova-module-a-meta": "^5.1.21",
|
|
24
24
|
"zova-module-a-model": "^5.1.33",
|
|
25
|
-
"zova-module-a-openapi": "^5.1.
|
|
25
|
+
"zova-module-a-openapi": "^5.1.47",
|
|
26
26
|
"zova-module-a-router": "^5.1.31",
|
|
27
27
|
"zova-module-a-routerstack": "^5.1.26",
|
|
28
28
|
"zova-module-a-routertabs": "^5.1.33",
|