cabloy 5.1.108 → 5.1.109

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.
Files changed (39) hide show
  1. package/.cabloy-version +1 -1
  2. package/CHANGELOG.md +17 -0
  3. package/cabloy-docs/frontend/table-resource-crud-cookbook.md +33 -1
  4. package/package.json +1 -1
  5. package/vona/pnpm-lock.yaml +16 -16
  6. package/vona/src/suite/a-training/modules/training-student/src/config/locale/en-us.ts +2 -0
  7. package/vona/src/suite/a-training/modules/training-student/src/config/locale/zh-cn.ts +2 -0
  8. package/vona/src/suite/a-training/modules/training-student/src/dto/studentCreate.tsx +50 -1
  9. package/vona/src/suite/a-training/modules/training-student/src/dto/studentSelectResItem.tsx +21 -1
  10. package/vona/src/suite/a-training/modules/training-student/src/dto/studentUpdate.tsx +47 -1
  11. package/vona/src/suite/a-training/modules/training-student/src/dto/studentView.tsx +47 -1
  12. package/vona/src/suite/a-training/modules/training-student/test/student.test.ts +60 -2
  13. package/zova/packages-zova/zova/package.json +2 -2
  14. package/zova/pnpm-lock.yaml +27 -2
  15. package/zova/src/suite/cabloy-basic/modules/basic-form/src/.metadata/component/blockFormLayout.ts +31 -0
  16. package/zova/src/suite/cabloy-basic/modules/basic-form/src/.metadata/index.ts +13 -0
  17. package/zova/src/suite/cabloy-basic/modules/basic-form/src/component/blockFormLayout/controller.tsx +165 -0
  18. package/zova/src/suite/cabloy-basic/modules/basic-page/src/.metadata/component/blockFilterActions.ts +31 -0
  19. package/zova/src/suite/cabloy-basic/modules/basic-page/src/.metadata/index.ts +13 -0
  20. package/zova/src/suite/cabloy-basic/modules/basic-page/src/component/blockFilter/controller.tsx +61 -31
  21. package/zova/src/suite/cabloy-basic/modules/basic-page/src/component/blockFilterActions/controller.tsx +51 -0
  22. package/zova/src/suite/cabloy-basic/modules/basic-page/src/types/page.ts +10 -0
  23. package/zova/src/suite/cabloy-basic/modules/basic-pageentry/src/component/blockForm/controller.tsx +9 -2
  24. package/zova/src/suite-vendor/a-zova/modules/a-form/package.json +5 -3
  25. package/zova/src/suite-vendor/a-zova/modules/a-form/src/component/form/controller.tsx +44 -3
  26. package/zova/src/suite-vendor/a-zova/modules/a-form/src/component/form/render.tsx +22 -4
  27. package/zova/src/suite-vendor/a-zova/modules/a-form/src/component/formField/controller.tsx +3 -2
  28. package/zova/src/suite-vendor/a-zova/modules/a-form/src/lib/formLayout.ts +203 -0
  29. package/zova/src/suite-vendor/a-zova/modules/a-form/src/lib/index.ts +1 -0
  30. package/zova/src/suite-vendor/a-zova/modules/a-form/src/types/formField.ts +7 -4
  31. package/zova/src/suite-vendor/a-zova/modules/a-form/src/types/formLayout.ts +59 -0
  32. package/zova/src/suite-vendor/a-zova/modules/a-form/src/types/index.ts +1 -0
  33. package/zova/src/suite-vendor/a-zova/modules/a-openapi/package.json +1 -1
  34. package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/action.ts +1 -1
  35. package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/resource/formLayout.ts +53 -0
  36. package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/resource/index.ts +1 -0
  37. package/zova/src/suite-vendor/a-zova/modules/a-ssr/package.json +1 -1
  38. package/zova/src/suite-vendor/a-zova/modules/a-ssr/src/lib/ssr.ts +1 -1
  39. package/zova/src/suite-vendor/a-zova/package.json +4 -4
package/.cabloy-version CHANGED
@@ -1 +1 @@
1
- 5.1.108
1
+ 5.1.109
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.1.109
4
+
5
+ ### Features
6
+
7
+ - Add DTO-driven form layouts.
8
+ - Add configurable filter form layouts.
9
+ - Add a student view form layout.
10
+ - Display form error counts on layout tabs.
11
+ - Allow form layout IDs to be optional.
12
+
13
+ ### Improvements
14
+
15
+ - Upgrade TanStack Vue Form.
16
+ - Replace the deprecated TanStack Form store hook.
17
+ - Localize form layout tab state.
18
+ - Clarify DTO render field typing boundaries in the documentation.
19
+
3
20
  ## 5.1.108
4
21
 
5
22
  ### Features
@@ -162,8 +162,8 @@ This block uses `ZForm` with:
162
162
 
163
163
  - `schema={$$page.schemaFilter}`
164
164
  - `schemaScene="filter"`
165
- - inline layout
166
165
  - page-owned filter data
166
+ - field-level `formFieldLayout.inline: true` by default
167
167
 
168
168
  Its job is not to duplicate the list query logic.
169
169
 
@@ -178,6 +178,38 @@ A practical rule is:
178
178
  - if you need to refine which filter fields exist, start from backend filter-side metadata and schema
179
179
  - if you need to refine how filter submission affects the list, inspect `blockFilter` and `blockPage.onFilter(...)`
180
180
 
181
+ ### Use blocks for a structural filter layout
182
+
183
+ A bare `basic-page:blockFilter` keeps the default schema field rendering and adds Search/Reset controls automatically. For a structured filter, compose the existing form layout block with the filter-specific action block:
184
+
185
+ ```tsx
186
+ ZovaRender.block('basic-page:blockFilter', {
187
+ formFieldLayout: { inline: false },
188
+ blocks: [
189
+ ZovaRender.block('basic-form:blockFormLayout', {
190
+ formLayout: {
191
+ children: [
192
+ {
193
+ type: 'section',
194
+ columns: { default: 1, md: 2 },
195
+ children: [
196
+ { type: 'field', name: 'name' },
197
+ { type: 'field', name: 'level' },
198
+ { type: 'field', name: 'createdAt', span: { default: 1, md: 2 } },
199
+ ],
200
+ },
201
+ ],
202
+ },
203
+ }),
204
+ ZovaRender.block('basic-page:blockFilterActions'),
205
+ ],
206
+ });
207
+ ```
208
+
209
+ `basic-form:blockFormLayout` only places schema fields. `basic-page:blockFilterActions` owns Search/Reset placement and invokes the filter command surface supplied through the form scope, so it preserves filter normalization and page-query behavior. A nonempty `blocks` list replaces the automatic body and footer; include the action block explicitly to make the filter operable.
210
+
211
+ `ZForm.inline` is no longer a form API. Use `formFieldLayout.inline` for field-level compact layout, or use blocks plus `basic-form:blockFormLayout` for structural layout.
212
+
181
213
  ## Step 5: Let `blockToolbarBulk` own bulk-action display
182
214
 
183
215
  The standard bulk toolbar block is:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cabloy",
3
- "version": "5.1.108",
3
+ "version": "5.1.109",
4
4
  "gitHead": "2c5c19284bab738e492856189acb6fad74b8a7b7",
5
5
  "description": "A Node.js fullstack framework",
6
6
  "keywords": [
@@ -501,8 +501,8 @@ importers:
501
501
  specifier: npm:@cabloy/zod@4.3.8
502
502
  version: '@cabloy/zod@4.3.8'
503
503
  zova:
504
- specifier: ^5.1.135
505
- version: 5.1.135(typescript@5.9.3)(vue@3.5.39(typescript@5.9.3))
504
+ specifier: ^5.1.136
505
+ version: 5.1.136(typescript@5.9.3)(vue@3.5.39(typescript@5.9.3))
506
506
  zova-jsx:
507
507
  specifier: ^1.1.78
508
508
  version: 1.1.78(typescript@5.9.3)
@@ -573,8 +573,8 @@ importers:
573
573
  specifier: npm:@cabloy/zod@4.3.8
574
574
  version: '@cabloy/zod@4.3.8'
575
575
  zova:
576
- specifier: ^5.1.135
577
- version: 5.1.135(typescript@5.9.3)(vue@3.5.39(typescript@5.9.3))
576
+ specifier: ^5.1.136
577
+ version: 5.1.136(typescript@5.9.3)(vue@3.5.39(typescript@5.9.3))
578
578
  zova-jsx:
579
579
  specifier: ^1.1.78
580
580
  version: 1.1.78(typescript@5.9.3)
@@ -1625,7 +1625,7 @@ importers:
1625
1625
  src/suite-vendor/a-test:
1626
1626
  dependencies:
1627
1627
  vona-module-test-file:
1628
- specifier: ^5.0.5
1628
+ specifier: ^5.0.6
1629
1629
  version: link:modules/test-file
1630
1630
 
1631
1631
  src/suite-vendor/a-test/modules/test-auth:
@@ -8014,8 +8014,8 @@ packages:
8014
8014
  zova-module-a-ssrhmr@5.1.22:
8015
8015
  resolution: {integrity: sha512-K9D0DqCPuABvESyuAY8tQ7RukMpMEaMol0SV08ixVyed7Zd/b+Ugh49WEC2b5Y5iZCJliW9JJekvzS9Y0DilTA==}
8016
8016
 
8017
- zova-module-a-ssrserver@5.1.22:
8018
- resolution: {integrity: sha512-hQcsT94Aa9cn7TEkQM+Do2MNLnpGt4rGaRqxsnUB8Gr1T3knhWWdyYNrroq2kNI10hN81uOKrm/FxnFQRq1phQ==}
8017
+ zova-module-a-ssrserver@5.1.23:
8018
+ resolution: {integrity: sha512-+hpTTRfJP9mVCOueXYlAtt4W82ihQbQDRjJ7TjGVN/pIV3oL9Ca3I491wkd6I3Avq9dT7rjB/iKWs29F6ic3lA==}
8019
8019
 
8020
8020
  zova-module-a-style@5.1.32:
8021
8021
  resolution: {integrity: sha512-2D7XKTWdqY0/Z7jPJQ31Fikl2wNxifF5R/RexfemeJtrJBYap46mpA++BhxgawfOgMDQ8mpT5iQfS5Ep9TILlw==}
@@ -8032,11 +8032,11 @@ packages:
8032
8032
  zova-module-rest-resource@5.1.41:
8033
8033
  resolution: {integrity: sha512-7Y8rLmHdw0pynlWqsyHPWuCWFLwr/0HsNvfef64cPw91LRujf/7OlulVWqH8ZoFNioZZUpfumB+t/+mICoYfFg==}
8034
8034
 
8035
- zova-suite-a-zova@5.1.134:
8036
- resolution: {integrity: sha512-XwmEGAM6po9GjzGLryGVCKhkVjtI3MXNY85AhQVxxMUOU6S+3dBtF399LzzDdhlKYXbvfwuHB/yDQiS1PbfS5w==}
8035
+ zova-suite-a-zova@5.1.135:
8036
+ resolution: {integrity: sha512-Fa3U2NegdnFR+NkHeY4V5ejicUK0Th5dKs9Anx20jfpao/p91mCuu3kni88rB9j4U3ztUyqZ/q6k683Y1vATcg==}
8037
8037
 
8038
- zova@5.1.135:
8039
- resolution: {integrity: sha512-Avk0YcjocSYpdRUO4A58/yQmeGUoo+bgzbtKZNLCNDit7PSEGMBJZi9p47ct7SNc6LDybhBm7xPf/xioL0Ozdg==}
8038
+ zova@5.1.136:
8039
+ resolution: {integrity: sha512-Xf9ze/weAFo/kHTXjeJgB21RH1kjQC28F3pSBuKtGtzu87oxkdiG2meGKDWyP/n3cCvPs+BzOgRUSgQlsXZnXw==}
8040
8040
 
8041
8041
  zwitch@1.0.5:
8042
8042
  resolution: {integrity: sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw==}
@@ -13969,7 +13969,7 @@ snapshots:
13969
13969
  '@cabloy/socket': link:packages-utils/socket
13970
13970
  debounce: 3.0.0
13971
13971
 
13972
- zova-module-a-ssrserver@5.1.22:
13972
+ zova-module-a-ssrserver@5.1.23:
13973
13973
  dependencies:
13974
13974
  ms: 2.1.3
13975
13975
 
@@ -14010,7 +14010,7 @@ snapshots:
14010
14010
 
14011
14011
  zova-module-rest-resource@5.1.41: {}
14012
14012
 
14013
- zova-suite-a-zova@5.1.134(typescript@5.9.3)(vue@3.5.39(typescript@5.9.3)):
14013
+ zova-suite-a-zova@5.1.135(typescript@5.9.3)(vue@3.5.39(typescript@5.9.3)):
14014
14014
  dependencies:
14015
14015
  zova-module-a-api: 5.1.21
14016
14016
  zova-module-a-app: 5.1.24
@@ -14032,7 +14032,7 @@ snapshots:
14032
14032
  zova-module-a-routertabs: 5.1.33
14033
14033
  zova-module-a-ssr: 5.1.29
14034
14034
  zova-module-a-ssrhmr: 5.1.22
14035
- zova-module-a-ssrserver: 5.1.22
14035
+ zova-module-a-ssrserver: 5.1.23
14036
14036
  zova-module-a-style: 5.1.32
14037
14037
  zova-module-a-table: 5.1.37(vue@3.5.39(typescript@5.9.3))
14038
14038
  zova-module-a-zod: 5.1.36
@@ -14044,10 +14044,10 @@ snapshots:
14044
14044
  - typescript
14045
14045
  - vue
14046
14046
 
14047
- zova@5.1.135(typescript@5.9.3)(vue@3.5.39(typescript@5.9.3)):
14047
+ zova@5.1.136(typescript@5.9.3)(vue@3.5.39(typescript@5.9.3)):
14048
14048
  dependencies:
14049
14049
  zova-core: 5.1.78(patch_hash=ff659aa5f659be32501f56841b72f148c24acf1546f79cce551586e27fcde2ce)(typescript@5.9.3)
14050
- zova-suite-a-zova: 5.1.134(typescript@5.9.3)(vue@3.5.39(typescript@5.9.3))
14050
+ zova-suite-a-zova: 5.1.135(typescript@5.9.3)(vue@3.5.39(typescript@5.9.3))
14051
14051
  transitivePeerDependencies:
14052
14052
  - '@vue/composition-api'
14053
14053
  - debug
@@ -1,6 +1,8 @@
1
1
  export default {
2
2
  Description: 'Description',
3
3
  Level: 'Training Stage',
4
+ BasicInformation: 'Basic Information',
5
+ StudentProfile: 'Student Profile',
4
6
  LevelAdvanced: 'Advanced Workshop',
5
7
  LevelBeginner: 'Foundation Track',
6
8
  LevelIntermediate: 'Progress Track',
@@ -1,6 +1,8 @@
1
1
  export default {
2
2
  Description: '描述',
3
3
  Level: '培训阶段',
4
+ BasicInformation: '基本信息',
5
+ StudentProfile: '学生资料',
4
6
  LevelAdvanced: '高级研修班',
5
7
  LevelBeginner: '基础班',
6
8
  LevelIntermediate: '提升班',
@@ -16,7 +16,56 @@ export interface IDtoOptionsStudentCreate extends IDecoratorDtoOptions {}
16
16
  blocks: [
17
17
  ZovaRender.block('basic-pageentry:blockPageEntry', {
18
18
  blocks: [
19
- ZovaRender.block('basic-pageentry:blockForm'),
19
+ ZovaRender.block('basic-pageentry:blockForm', {
20
+ blocks: [
21
+ ZovaRender.block('basic-form:blockFormLayout', {
22
+ formLayout: {
23
+ children: [
24
+ {
25
+ type: 'tabs',
26
+ children: [
27
+ {
28
+ type: 'tab',
29
+ title: $locale('BasicInformation'),
30
+ children: [
31
+ {
32
+ type: 'group',
33
+ title: $locale('StudentProfile'),
34
+ children: [
35
+ {
36
+ type: 'section',
37
+ columns: { default: 1, md: 2 },
38
+ children: [
39
+ { type: 'field', name: 'name' },
40
+ { type: 'field', name: 'mobile' },
41
+ { type: 'field', name: 'imageId' },
42
+ ],
43
+ },
44
+ ],
45
+ },
46
+ ],
47
+ },
48
+ {
49
+ type: 'tab',
50
+ title: $locale('TrainingRecords'),
51
+ children: [
52
+ { type: 'field', name: 'level' },
53
+ {
54
+ type: 'section',
55
+ children: [{ type: 'field', name: 'trainingRecords' }],
56
+ },
57
+ ],
58
+ },
59
+ ],
60
+ },
61
+ ],
62
+ },
63
+ }),
64
+ ],
65
+ // blocks: [
66
+ // ZovaRender.block('')
67
+ // ],
68
+ }),
20
69
  ZovaRender.block('basic-pageentry:blockToolbarRow', {
21
70
  actions: [
22
71
  ZovaRender.formActionRow('basic-form:actionSubmit', {
@@ -15,7 +15,27 @@ export interface IDtoOptionsStudentSelectResItem extends IDecoratorDtoOptions {}
15
15
  blocks: [
16
16
  ZovaRender.block('basic-page:blockPage', {
17
17
  blocks: [
18
- ZovaRender.block('basic-page:blockFilter'),
18
+ ZovaRender.block('basic-page:blockFilter', {
19
+ formFieldLayout: { inline: false },
20
+ blocks: [
21
+ ZovaRender.block('basic-form:blockFormLayout', {
22
+ formLayout: {
23
+ children: [
24
+ {
25
+ type: 'section',
26
+ columns: { default: 1, md: 2 },
27
+ children: [
28
+ { type: 'field', name: 'name' },
29
+ { type: 'field', name: 'level' },
30
+ { type: 'field', name: 'createdAt', span: { default: 1, md: 2 } },
31
+ ],
32
+ },
33
+ ],
34
+ },
35
+ }),
36
+ ZovaRender.block('basic-page:blockFilterActions'),
37
+ ],
38
+ }),
19
39
  ZovaRender.block('basic-page:blockToolbarBulk', {
20
40
  actions: [ZovaRender.tableActionBulk('basic-table:actionCreate')],
21
41
  }),
@@ -16,7 +16,53 @@ export interface IDtoOptionsStudentUpdate extends IDecoratorDtoOptions {}
16
16
  blocks: [
17
17
  ZovaRender.block('basic-pageentry:blockPageEntry', {
18
18
  blocks: [
19
- ZovaRender.block('basic-pageentry:blockForm'),
19
+ ZovaRender.block('basic-pageentry:blockForm', {
20
+ blocks: [
21
+ ZovaRender.block('basic-form:blockFormLayout', {
22
+ formLayout: {
23
+ children: [
24
+ {
25
+ type: 'tabs',
26
+ children: [
27
+ {
28
+ type: 'tab',
29
+ title: $locale('BasicInformation'),
30
+ children: [
31
+ {
32
+ type: 'group',
33
+ title: $locale('StudentProfile'),
34
+ children: [
35
+ {
36
+ type: 'section',
37
+ columns: { default: 1, md: 2 },
38
+ children: [
39
+ { type: 'field', name: 'name' },
40
+ { type: 'field', name: 'mobile' },
41
+ { type: 'field', name: 'imageId' },
42
+ ],
43
+ },
44
+ ],
45
+ },
46
+ ],
47
+ },
48
+ {
49
+ type: 'tab',
50
+ title: $locale('TrainingRecords'),
51
+ children: [
52
+ { type: 'field', name: 'level' },
53
+ {
54
+ type: 'section',
55
+ children: [{ type: 'field', name: 'trainingRecords' }],
56
+ },
57
+ ],
58
+ },
59
+ ],
60
+ },
61
+ ],
62
+ },
63
+ }),
64
+ ],
65
+ }),
20
66
  ZovaRender.block('basic-pageentry:blockToolbarRow', {
21
67
  actions: [
22
68
  ZovaRender.formActionRow('basic-form:actionSubmit', {
@@ -17,7 +17,53 @@ export interface IDtoOptionsStudentView extends IDecoratorDtoOptions {}
17
17
  blocks: [
18
18
  ZovaRender.block('basic-pageentry:blockPageEntry', {
19
19
  blocks: [
20
- ZovaRender.block('basic-pageentry:blockForm'),
20
+ ZovaRender.block('basic-pageentry:blockForm', {
21
+ blocks: [
22
+ ZovaRender.block('basic-form:blockFormLayout', {
23
+ formLayout: {
24
+ children: [
25
+ {
26
+ type: 'tabs',
27
+ children: [
28
+ {
29
+ type: 'tab',
30
+ title: $locale('BasicInformation'),
31
+ children: [
32
+ {
33
+ type: 'group',
34
+ title: $locale('StudentProfile'),
35
+ children: [
36
+ {
37
+ type: 'section',
38
+ columns: { default: 1, md: 2 },
39
+ children: [
40
+ { type: 'field', name: 'name' },
41
+ { type: 'field', name: 'mobile' },
42
+ { type: 'field', name: 'imageId' },
43
+ ],
44
+ },
45
+ ],
46
+ },
47
+ ],
48
+ },
49
+ {
50
+ type: 'tab',
51
+ title: $locale('TrainingRecords'),
52
+ children: [
53
+ { type: 'field', name: 'level' },
54
+ {
55
+ type: 'section',
56
+ children: [{ type: 'field', name: 'trainingRecords' }],
57
+ },
58
+ ],
59
+ },
60
+ ],
61
+ },
62
+ ],
63
+ },
64
+ }),
65
+ ],
66
+ }),
21
67
  ZovaRender.block('basic-pageentry:blockToolbarRow', {
22
68
  actions: [
23
69
  ZovaRender.formActionRow('basic-form:actionBack', { permission: { public: true } }),
@@ -1,16 +1,74 @@
1
1
  import type {
2
- DtoStudentCreate,
3
2
  DtoStudentSelectRes,
4
3
  DtoStudentSummary,
5
- DtoStudentUpdate,
6
4
  EntityStudent,
7
5
  } from 'vona-module-training-student';
8
6
 
9
7
  import assert from 'node:assert';
10
8
  import { describe, it } from 'node:test';
11
9
  import { app } from 'vona-mock';
10
+ import {
11
+ DtoStudentCreate,
12
+ DtoStudentSelectResItem,
13
+ DtoStudentUpdate,
14
+ DtoStudentView,
15
+ } from 'vona-module-training-student';
12
16
 
13
17
  describe('student.test.ts', () => {
18
+ it('action:student:formLayoutMetadata', async () => {
19
+ await app.bean.executor.mockCtx(async () => {
20
+ for (const DtoClass of [DtoStudentCreate, DtoStudentUpdate, DtoStudentView]) {
21
+ const apiJson = await app.bean.openapi.generateJsonOfClass(DtoClass);
22
+ const component = Object.values(apiJson.components!.schemas as any).find(item => {
23
+ return (item as any).properties?.trainingRecords;
24
+ });
25
+ const blocks = (component as any)?.rest?.blocks;
26
+ const formLayout =
27
+ blocks?.[0]?.options?.blocks?.[0]?.options?.blocks?.[0]?.options?.formLayout;
28
+ const tabs = formLayout?.children[0];
29
+ const profileSection = tabs?.children[0]?.children[0]?.children[0];
30
+ const trainingRecordsSection = tabs?.children[1]?.children[1];
31
+ assert.equal(tabs?.type, 'tabs');
32
+ assert.equal(tabs?.id, undefined);
33
+ assert.equal(tabs?.children[1]?.type, 'tab');
34
+ assert.equal(tabs?.children[1]?.id, undefined);
35
+ assert.deepEqual(profileSection?.columns, { default: 1, md: 2 });
36
+ assert.deepEqual(
37
+ profileSection?.children.map(item => item.name),
38
+ ['name', 'mobile', 'imageId'],
39
+ );
40
+ assert.equal(tabs?.children[1]?.children[0]?.name, 'level');
41
+ assert.deepEqual(
42
+ trainingRecordsSection?.children.map(item => item.name),
43
+ ['trainingRecords'],
44
+ );
45
+ }
46
+ });
47
+ });
48
+
49
+ it('action:student:filterFormLayoutMetadata', async () => {
50
+ await app.bean.executor.mockCtx(async () => {
51
+ const apiJson = await app.bean.openapi.generateJsonOfClass(DtoStudentSelectResItem);
52
+ const component = Object.values(apiJson.components!.schemas as any).find(item => {
53
+ return (item as any).properties?._operationsRow;
54
+ });
55
+ const filterBlock = (component as any)?.rest?.blocks?.[0]?.options?.blocks?.[0];
56
+ assert.equal(filterBlock?.render, 'basic-page:blockFilter');
57
+ assert.equal(filterBlock?.options?.formFieldLayout?.inline, false);
58
+ assert.deepEqual(
59
+ filterBlock?.options?.blocks?.map(item => item.render),
60
+ ['basic-form:blockFormLayout', 'basic-page:blockFilterActions'],
61
+ );
62
+ const formLayout = filterBlock?.options?.blocks?.[0]?.options?.formLayout;
63
+ assert.deepEqual(formLayout?.children[0]?.columns, { default: 1, md: 2 });
64
+ assert.deepEqual(
65
+ formLayout?.children[0]?.children.map(item => item.name),
66
+ ['name', 'level', 'createdAt'],
67
+ );
68
+ assert.deepEqual(formLayout?.children[0]?.children[2]?.span, { default: 1, md: 2 });
69
+ });
70
+ });
71
+
14
72
  it('action:student', async () => {
15
73
  await app.bean.executor.mockCtx(async () => {
16
74
  // data
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zova",
3
- "version": "5.1.136",
3
+ "version": "5.1.137",
4
4
  "gitHead": "2c5c19284bab738e492856189acb6fad74b8a7b7",
5
5
  "description": "A vue3 framework with ioc",
6
6
  "keywords": [
@@ -46,7 +46,7 @@
46
46
  },
47
47
  "dependencies": {
48
48
  "zova-core": "^5.1.78",
49
- "zova-suite-a-zova": "^5.1.135"
49
+ "zova-suite-a-zova": "^5.1.136"
50
50
  },
51
51
  "devDependencies": {
52
52
  "clean-package": "^2.2.0",
@@ -1093,8 +1093,11 @@ importers:
1093
1093
  src/suite-vendor/a-zova/modules/a-form:
1094
1094
  dependencies:
1095
1095
  '@tanstack/vue-form':
1096
- specifier: ^1.32.0
1097
- version: 1.33.0(vue@3.5.38(typescript@5.9.3))
1096
+ specifier: ^1.33.2
1097
+ version: 1.33.2(vue@3.5.38(typescript@5.9.3))
1098
+ '@tanstack/vue-store':
1099
+ specifier: ^0.11.0
1100
+ version: 0.11.0(vue@3.5.38(typescript@5.9.3))
1098
1101
  devDependencies:
1099
1102
  clean-package:
1100
1103
  specifier: ^2.2.0
@@ -3931,6 +3934,9 @@ packages:
3931
3934
  '@tanstack/form-core@1.33.0':
3932
3935
  resolution: {integrity: sha512-AV4Pw9Dk4orFsuPBcDssfWMJFs+yMYBae7zZ4oTqrCf4ftNGQKxvrQRZeqKHG6A4TkiLeSvf2kzIjcVkrW7E6w==}
3933
3936
 
3937
+ '@tanstack/form-core@1.33.2':
3938
+ resolution: {integrity: sha512-F60zJd15bGrXKonc1kpRYnNRNfiES7F+hgvrPMrsZznPLqZtO2DIg76OU6R25kCYkqYQY5xvuKteuWcUsc587A==}
3939
+
3934
3940
  '@tanstack/match-sorter-utils@8.19.4':
3935
3941
  resolution: {integrity: sha512-Wo1iKt2b9OT7d+YGhvEPD3DXvPv2etTusIMhMUoG7fbhmxcXCtIjJDEygy91Y2JFlwGyjqiBPRozme7UD8hoqg==}
3936
3942
  engines: {node: '>=12'}
@@ -3957,6 +3963,11 @@ packages:
3957
3963
  peerDependencies:
3958
3964
  vue: ^3.4.0
3959
3965
 
3966
+ '@tanstack/vue-form@1.33.2':
3967
+ resolution: {integrity: sha512-yolxEs4XSQu2RhBpM48YgqmmpftR4v28XniH5UjGg9/Z3WOJAv+COSmWwC64ozs2OZIKF+j5ufu1ki62jtP6nA==}
3968
+ peerDependencies:
3969
+ vue: ^3.4.0
3970
+
3960
3971
  '@tanstack/vue-query@5.101.1':
3961
3972
  resolution: {integrity: sha512-w36v/HlCF2xRpdDCz7cygk99AwBWhZaT5No1dJOwqIZ1AR8q7tiovRyPFID/49gkjXG7KgXs/nHfRg+eCydH4Q==}
3962
3973
  peerDependencies:
@@ -9729,6 +9740,12 @@ snapshots:
9729
9740
  '@tanstack/pacer-lite': 0.1.1
9730
9741
  '@tanstack/store': 0.11.0
9731
9742
 
9743
+ '@tanstack/form-core@1.33.2':
9744
+ dependencies:
9745
+ '@tanstack/devtools-event-client': 0.4.4
9746
+ '@tanstack/pacer-lite': 0.1.1
9747
+ '@tanstack/store': 0.11.0
9748
+
9732
9749
  '@tanstack/match-sorter-utils@8.19.4':
9733
9750
  dependencies:
9734
9751
  remove-accents: 0.5.0
@@ -9753,6 +9770,14 @@ snapshots:
9753
9770
  transitivePeerDependencies:
9754
9771
  - '@vue/composition-api'
9755
9772
 
9773
+ '@tanstack/vue-form@1.33.2(vue@3.5.38(typescript@5.9.3))':
9774
+ dependencies:
9775
+ '@tanstack/form-core': 1.33.2
9776
+ '@tanstack/vue-store': 0.11.0(vue@3.5.38(typescript@5.9.3))
9777
+ vue: 3.5.38(typescript@5.9.3)
9778
+ transitivePeerDependencies:
9779
+ - '@vue/composition-api'
9780
+
9756
9781
  '@tanstack/vue-query@5.101.1(vue@3.5.38(typescript@5.9.3))':
9757
9782
  dependencies:
9758
9783
  '@tanstack/match-sorter-utils': 8.19.4
@@ -0,0 +1,31 @@
1
+ import type { TypeControllerInnerProps } from 'zova';
2
+
3
+ import { defineComponent } from 'vue';
4
+ import { prepareComponentOptions, useController } from 'zova';
5
+
6
+ import type { ControllerBlockFormLayoutProps } from '../../component/blockFormLayout/controller.jsx';
7
+
8
+ import { ControllerBlockFormLayout } from '../../component/blockFormLayout/controller.jsx';
9
+ export type ZBlockFormLayoutProps = {
10
+ controllerRef?: (ref: ControllerBlockFormLayout) => void;
11
+ } & ControllerBlockFormLayoutProps;
12
+
13
+ type ControllerInnerProps = TypeControllerInnerProps<
14
+ ControllerBlockFormLayoutProps,
15
+ keyof typeof ControllerBlockFormLayout.$propsDefault
16
+ >;
17
+ declare module 'zova-module-basic-form' {
18
+ export interface ControllerBlockFormLayout {
19
+ $props: ControllerInnerProps;
20
+ }
21
+ }
22
+
23
+ export const ZBlockFormLayout = defineComponent((_props: ZBlockFormLayoutProps) => {
24
+ useController(ControllerBlockFormLayout, undefined, undefined);
25
+ return () => {};
26
+ }, prepareComponentOptions(ControllerBlockFormLayout.$componentOptions));
27
+ declare module 'zova-module-a-bean' {
28
+ export interface IVonaComponentRecord {
29
+ 'basic-form:blockFormLayout': ControllerBlockFormLayoutProps;
30
+ }
31
+ }
@@ -2,6 +2,7 @@
2
2
  /** controller: begin */
3
3
  export * from '../component/actionBack/controller.jsx';
4
4
  export * from '../component/actionSubmit/controller.jsx';
5
+ export * from '../component/blockFormLayout/controller.jsx';
5
6
 
6
7
  import 'zova';
7
8
  declare module 'zova' {
@@ -18,17 +19,24 @@ declare module 'zova-module-basic-form' {
18
19
  export interface ControllerActionSubmit {
19
20
  /** @internal */
20
21
  get scope(): ScopeModuleBasicForm;
22
+ }
23
+
24
+ export interface ControllerBlockFormLayout {
25
+ /** @internal */
26
+ get scope(): ScopeModuleBasicForm;
21
27
  }
22
28
  }
23
29
  /** controller: end */
24
30
  /** controller: begin */
25
31
  import { ControllerActionBack } from '../component/actionBack/controller.jsx';
26
32
  import { ControllerActionSubmit } from '../component/actionSubmit/controller.jsx';
33
+ import { ControllerBlockFormLayout } from '../component/blockFormLayout/controller.jsx';
27
34
  import 'zova';
28
35
  declare module 'zova' {
29
36
  export interface IBeanRecordLocal {
30
37
  'basic-form.controller.actionBack': ControllerActionBack;
31
38
  'basic-form.controller.actionSubmit': ControllerActionSubmit;
39
+ 'basic-form.controller.blockFormLayout': ControllerBlockFormLayout;
32
40
  }
33
41
  }
34
42
  /** controller: end */
@@ -38,19 +46,24 @@ export * from './component/actionBack.js';
38
46
  import { ZActionBack } from './component/actionBack.js';
39
47
  export * from './component/actionSubmit.js';
40
48
  import { ZActionSubmit } from './component/actionSubmit.js';
49
+ export * from './component/blockFormLayout.js';
50
+ import { ZBlockFormLayout } from './component/blockFormLayout.js';
41
51
  export const components = {
42
52
  'actionBack': ZActionBack,
43
53
  'actionSubmit': ZActionSubmit,
54
+ 'blockFormLayout': ZBlockFormLayout,
44
55
  };
45
56
  import 'zova';
46
57
  declare module 'zova' {
47
58
  export interface IComponentRecord {
48
59
  'basic-form:actionBack': ControllerActionBack;
49
60
  'basic-form:actionSubmit': ControllerActionSubmit;
61
+ 'basic-form:blockFormLayout': ControllerBlockFormLayout;
50
62
  }
51
63
  export interface IZovaComponentRecord {
52
64
  'basic-form:actionBack': typeof ZActionBack;
53
65
  'basic-form:actionSubmit': typeof ZActionSubmit;
66
+ 'basic-form:blockFormLayout': typeof ZBlockFormLayout;
54
67
  }
55
68
  }
56
69
  /** components: end */