cabloy 5.1.61 → 5.1.62
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/.claude/skills/cabloy-backend-scaffold/SKILL.md +2 -0
- package/.claude/skills/cabloy-backend-scaffold/references/follow-up-checklist.md +1 -1
- package/.claude/skills/cabloy-domain-planning/SKILL.md +212 -0
- package/.claude/skills/cabloy-frontend-scaffold/SKILL.md +2 -0
- package/CHANGELOG.md +42 -0
- package/CLAUDE.md +1 -0
- package/cabloy-docs/.vitepress/config.mjs +158 -12
- package/cabloy-docs/ai/docs-skills-rules-mapping.md +8 -0
- package/cabloy-docs/ai/future-skill-roadmap.md +2 -0
- package/cabloy-docs/ai/skills.md +1 -0
- package/cabloy-docs/backend/backend-contract-emission-output-inspection.md +189 -0
- package/cabloy-docs/backend/backend-contract-emission-source-reading-map.md +160 -0
- package/cabloy-docs/backend/backend-contract-emission-specimen.md +170 -0
- package/cabloy-docs/backend/backend-resource-module-contract-chain.md +323 -0
- package/cabloy-docs/backend/backend-source-reading-debug-checklist.md +173 -0
- package/cabloy-docs/backend/backend-source-reading-roadmap.md +129 -0
- package/cabloy-docs/backend/backend-source-reading-verify-playbook.md +166 -0
- package/cabloy-docs/backend/bean-scene-authoring.md +4 -4
- package/cabloy-docs/backend/broadcast-guide.md +3 -3
- package/cabloy-docs/backend/cli.md +20 -11
- package/cabloy-docs/backend/config-guide.md +4 -4
- package/cabloy-docs/backend/controller-aop-guide.md +10 -10
- package/cabloy-docs/backend/controller-guide.md +12 -2
- package/cabloy-docs/backend/crud-workflow.md +7 -3
- package/cabloy-docs/backend/dto-guide.md +12 -2
- package/cabloy-docs/backend/dto-infer-generation.md +201 -25
- package/cabloy-docs/backend/election-guide.md +2 -2
- package/cabloy-docs/backend/entity-guide.md +12 -3
- package/cabloy-docs/backend/error-guide.md +3 -3
- package/cabloy-docs/backend/event-guide.md +4 -4
- package/cabloy-docs/backend/external-aop-guide.md +2 -2
- package/cabloy-docs/backend/field-indexes.md +9 -3
- package/cabloy-docs/backend/foundation.md +8 -8
- package/cabloy-docs/backend/i18n-guide.md +6 -6
- package/cabloy-docs/backend/internal-aop-guide.md +2 -2
- package/cabloy-docs/backend/introduction.md +13 -0
- package/cabloy-docs/backend/migration-and-changes.md +3 -3
- package/cabloy-docs/backend/model-guide.md +16 -6
- package/cabloy-docs/backend/openapi-guide.md +3 -0
- package/cabloy-docs/backend/queue-guide.md +3 -3
- package/cabloy-docs/backend/redlock-guide.md +2 -2
- package/cabloy-docs/backend/schedule-guide.md +2 -2
- package/cabloy-docs/backend/scripts.md +8 -0
- package/cabloy-docs/backend/serialization-guide.md +2 -2
- package/cabloy-docs/backend/service-guide.md +18 -9
- package/cabloy-docs/backend/startup-guide.md +5 -5
- package/cabloy-docs/backend/status-guide.md +7 -7
- package/cabloy-docs/backend/unit-testing.md +3 -3
- package/cabloy-docs/backend/vona-source-reading-map.md +157 -0
- package/cabloy-docs/backend/websocket-protocol-guide.md +5 -5
- package/cabloy-docs/backend/websocket-usage-guide.md +15 -8
- package/cabloy-docs/frontend/a-model-under-the-hood.md +281 -0
- package/cabloy-docs/frontend/a-openapi-under-the-hood.md +248 -0
- package/cabloy-docs/frontend/a-router-guide.md +307 -0
- package/cabloy-docs/frontend/api-guide.md +4 -4
- package/cabloy-docs/frontend/api-schema-guide.md +1 -0
- package/cabloy-docs/frontend/app-startup-guide.md +7 -4
- package/cabloy-docs/frontend/bean-scene-authoring.md +1 -1
- package/cabloy-docs/frontend/behavior-guide.md +16 -16
- package/cabloy-docs/frontend/cli.md +5 -5
- package/cabloy-docs/frontend/command-scene-authoring.md +17 -8
- package/cabloy-docs/frontend/component-guide.md +5 -5
- package/cabloy-docs/frontend/component-props-guide.md +1 -1
- package/cabloy-docs/frontend/component-v-model-guide.md +2 -2
- package/cabloy-docs/frontend/filter-query-select-data-flow-guide.md +260 -0
- package/cabloy-docs/frontend/form-guide.md +19 -28
- package/cabloy-docs/frontend/form-scene-to-page-meta-guide.md +303 -0
- package/cabloy-docs/frontend/foundation.md +10 -6
- package/cabloy-docs/frontend/frontend-source-reading-roadmap.md +249 -0
- package/cabloy-docs/frontend/generated-contract-consumption-debug-checklist.md +190 -0
- package/cabloy-docs/frontend/generated-contract-consumption-entry-branch.md +205 -0
- package/cabloy-docs/frontend/generated-contract-consumption-list-branch.md +157 -0
- package/cabloy-docs/frontend/generated-contract-consumption-specimen.md +203 -0
- package/cabloy-docs/frontend/generated-contract-consumption-verify-playbook.md +189 -0
- package/cabloy-docs/frontend/generic-component-guide.md +1 -1
- package/cabloy-docs/frontend/introduction.md +29 -7
- package/cabloy-docs/frontend/model-architecture.md +38 -2
- package/cabloy-docs/frontend/model-resource-cookbook.md +11 -8
- package/cabloy-docs/frontend/model-resource-internals-deep-dive.md +238 -0
- package/cabloy-docs/frontend/model-resource-owner-pattern.md +22 -2
- package/cabloy-docs/frontend/model-resource-usage-guide.md +22 -6
- package/cabloy-docs/frontend/model-state-guide.md +12 -9
- package/cabloy-docs/frontend/module-scope.md +8 -8
- package/cabloy-docs/frontend/modules-and-suites.md +2 -1
- package/cabloy-docs/frontend/navigation-guards-guide.md +7 -0
- package/cabloy-docs/frontend/openapi-sdk-guide.md +12 -4
- package/cabloy-docs/frontend/page-guide.md +9 -9
- package/cabloy-docs/frontend/page-meta-guide.md +466 -0
- package/cabloy-docs/frontend/page-params-guide.md +3 -3
- package/cabloy-docs/frontend/page-query-guide.md +2 -2
- package/cabloy-docs/frontend/page-route-guide.md +6 -0
- package/cabloy-docs/frontend/permission-formscene-action-visibility-guide.md +263 -0
- package/cabloy-docs/frontend/quickstart.md +14 -2
- package/cabloy-docs/frontend/resource-entry-page-deep-dive.md +271 -0
- package/cabloy-docs/frontend/resource-list-page-deep-dive.md +279 -0
- package/cabloy-docs/frontend/rest-resource-source-reading-map.md +522 -0
- package/cabloy-docs/frontend/rest-resource-under-the-hood.md +622 -0
- package/cabloy-docs/frontend/root-behaviors-guide.md +282 -0
- package/cabloy-docs/frontend/route-alias-guide.md +6 -0
- package/cabloy-docs/frontend/router-stack-guide.md +229 -0
- package/cabloy-docs/frontend/router-tabs-introduction.md +26 -3
- package/cabloy-docs/frontend/router-tabs-layout-integration.md +367 -0
- package/cabloy-docs/frontend/router-tabs-mechanism.md +6 -0
- package/cabloy-docs/frontend/router-tabs-route-meta-cookbook.md +7 -0
- package/cabloy-docs/frontend/router-tabs-vs-stack.md +167 -0
- package/cabloy-docs/frontend/router-view-hosts-guide.md +450 -0
- package/cabloy-docs/frontend/server-data.md +2 -1
- package/cabloy-docs/frontend/system-startup-guide.md +2 -2
- package/cabloy-docs/frontend/table-action-visibility-permission-flow-guide.md +263 -0
- package/cabloy-docs/frontend/table-cell-cookbook.md +568 -0
- package/cabloy-docs/frontend/table-guide.md +373 -0
- package/cabloy-docs/frontend/table-resource-crud-cookbook.md +496 -0
- package/cabloy-docs/frontend/zova-app-guide.md +251 -0
- package/cabloy-docs/frontend/zova-form-source-reading-map.md +7 -9
- package/cabloy-docs/frontend/zova-form-under-the-hood.md +5 -0
- package/cabloy-docs/frontend/zova-router-under-the-hood.md +561 -0
- package/cabloy-docs/frontend/zova-source-reading-map.md +101 -7
- package/cabloy-docs/frontend/zova-table-controller-render-supplement.md +225 -0
- package/cabloy-docs/frontend/zova-table-source-reading-map.md +317 -0
- package/cabloy-docs/frontend/zova-table-under-the-hood.md +532 -0
- package/cabloy-docs/fullstack/backend-metadata-to-frontend-table-actions-debug-checklist.md +245 -0
- package/cabloy-docs/fullstack/backend-metadata-to-frontend-table-actions-source-reading-map.md +139 -0
- package/cabloy-docs/fullstack/backend-metadata-to-frontend-table-actions-verify-playbook.md +248 -0
- package/cabloy-docs/fullstack/backend-metadata-to-frontend-table-actions.md +511 -0
- package/cabloy-docs/fullstack/contract-loop-playbook.md +8 -2
- package/cabloy-docs/fullstack/edition-collaboration-differences.md +6 -0
- package/cabloy-docs/fullstack/frontend-metadata-to-backend.md +181 -48
- package/cabloy-docs/fullstack/introduction.md +3 -0
- package/cabloy-docs/fullstack/openapi-to-sdk.md +116 -2
- package/cabloy-docs/fullstack/suites-and-modules.md +333 -0
- package/cabloy-docs/fullstack/tutorial-1-first-module.md +3 -0
- package/cabloy-docs/fullstack/tutorial-2-first-crud.md +4 -0
- package/cabloy-docs/fullstack/tutorial-3-frontend-metadata-sharing.md +4 -0
- package/cabloy-docs/fullstack/tutorial-4-custom-level-renderers.md +31 -19
- package/cabloy-docs/fullstack/tutorial-5-backend-contract-sharing.md +5 -0
- package/cabloy-docs/fullstack/tutorial-6-one-contract-four-uses.md +4 -0
- package/cabloy-docs/fullstack/tutorials-overview.md +1 -1
- package/cabloy-docs/reference/bean-scene-boilerplates.md +13 -13
- package/cabloy-docs/reference/package-map.md +4 -3
- package/package.json +1 -1
- package/vona/pnpm-lock.yaml +22 -258
- package/vona/src/suite/a-training/modules/training-student/package.json +53 -0
- package/vona/src/suite/a-training/modules/training-student/src/.metadata/index.ts +400 -0
- package/vona/src/suite/a-training/modules/training-student/src/.metadata/locales.ts +18 -0
- package/vona/src/suite/a-training/modules/training-student/src/.metadata/this.ts +2 -0
- package/vona/src/suite/a-training/modules/training-student/src/bean/meta.index.ts +12 -0
- package/vona/src/suite/a-training/modules/training-student/src/bean/meta.version.ts +21 -0
- package/vona/src/suite/a-training/modules/training-student/src/bean/ssrMenu.student.ts +29 -0
- package/vona/src/suite/a-training/modules/training-student/src/config/locale/en-us.ts +15 -0
- package/vona/src/suite/a-training/modules/training-student/src/config/locale/zh-cn.ts +15 -0
- package/vona/src/suite/a-training/modules/training-student/src/controller/student.ts +74 -0
- package/vona/src/suite/a-training/modules/training-student/src/dto/studentCreate.tsx +28 -0
- package/vona/src/suite/a-training/modules/training-student/src/dto/studentSelectReq.tsx +44 -0
- package/vona/src/suite/a-training/modules/training-student/src/dto/studentSelectRes.tsx +11 -0
- package/vona/src/suite/a-training/modules/training-student/src/dto/studentSelectResItem.tsx +45 -0
- package/vona/src/suite/a-training/modules/training-student/src/dto/studentSummary.tsx +42 -0
- package/vona/src/suite/a-training/modules/training-student/src/dto/studentUpdate.tsx +28 -0
- package/vona/src/suite/a-training/modules/training-student/src/dto/studentView.tsx +25 -0
- package/vona/src/suite/a-training/modules/training-student/src/entity/student.tsx +84 -0
- package/vona/src/suite/a-training/modules/training-student/src/index.ts +2 -0
- package/vona/src/suite/a-training/modules/training-student/src/model/student.ts +10 -0
- package/vona/src/suite/a-training/modules/training-student/src/service/student.ts +57 -0
- package/vona/src/suite/a-training/modules/training-student/test/student.test.ts +173 -0
- package/vona/src/suite/a-training/modules/training-student/tsconfig.build.json +11 -0
- package/vona/src/suite/a-training/modules/training-student/tsconfig.json +7 -0
- package/vona/src/suite/a-training/package.json +12 -0
- package/vona/src/suite/a-training/tsconfig.base.json +4 -0
- package/vona/src/suite/a-training/tsconfig.json +10 -0
- package/zova/packages-zova/zova/package.json +2 -2
- package/zova/pnpm-lock.yaml +406 -680
- package/zova/src/suite/a-training/modules/training-student/cli/openapi.config.ts +9 -0
- package/zova/src/suite/a-training/modules/training-student/package.json +52 -0
- package/zova/src/suite/a-training/modules/training-student/src/.metadata/component/formFieldLevel.ts +31 -0
- package/zova/src/suite/a-training/modules/training-student/src/.metadata/index.ts +258 -0
- package/zova/src/suite/a-training/modules/training-student/src/.metadata/locales.ts +7 -0
- package/zova/src/suite/a-training/modules/training-student/src/.metadata/this.ts +2 -0
- package/zova/src/suite/a-training/modules/training-student/src/api/openapi/baseURL.ts +5 -0
- package/zova/src/suite/a-training/modules/training-student/src/api/openapi/index.ts +3 -0
- package/zova/src/suite/a-training/modules/training-student/src/api/openapi/schemas.ts +196 -0
- package/zova/src/suite/a-training/modules/training-student/src/api/openapi/types.ts +4146 -0
- package/zova/src/suite/a-training/modules/training-student/src/api/trainingStudent.ts +151 -0
- package/zova/src/suite/a-training/modules/training-student/src/apiSchema/trainingStudent.ts +43 -0
- package/zova/src/suite/a-training/modules/training-student/src/bean/tableCell.actionDeleteForce.tsx +51 -0
- package/zova/src/suite/a-training/modules/training-student/src/bean/tableCell.actionSummary.tsx +56 -0
- package/zova/src/suite/a-training/modules/training-student/src/bean/tableCell.level.tsx +63 -0
- package/zova/src/suite/a-training/modules/training-student/src/component/formFieldLevel/controller.tsx +117 -0
- package/zova/src/suite/a-training/modules/training-student/src/config/locale/en-us.ts +9 -0
- package/zova/src/suite/a-training/modules/training-student/src/config/locale/zh-cn.ts +9 -0
- package/zova/src/suite/a-training/modules/training-student/src/index.ts +2 -0
- package/zova/src/suite/a-training/modules/training-student/src/model/student.ts +42 -0
- package/zova/src/suite/a-training/modules/training-student/tsconfig.build.json +13 -0
- package/zova/src/suite/a-training/modules/training-student/tsconfig.json +5 -0
- package/zova/src/suite/a-training/package.json +12 -0
- package/zova/src/suite/a-training/tsconfig.base.json +4 -0
- package/zova/src/suite/a-training/tsconfig.json +4 -0
- package/zova/src/suite/cabloy-basic/modules/basic-select/src/component/formFieldSelect/controller.tsx +29 -7
- package/zova/src/suite/cabloy-basic/modules/basic-select/src/component/select/controller.tsx +34 -11
- package/zova/src/suite-vendor/a-zova/modules/a-table/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-table/src/component/table/controller.tsx +3 -3
- package/zova/src/suite-vendor/a-zova/modules/a-table/src/lib/tableCell.ts +1 -1
- package/zova/src/suite-vendor/a-zova/package.json +2 -2
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
# Table Guide
|
|
2
|
+
|
|
3
|
+
This guide explains how to build tables in Zova with a practical path from the public authoring surface to the most common extension points.
|
|
4
|
+
|
|
5
|
+
Zova Table is not only a thin JSX wrapper around TanStack Table. It is a Zova-native table layer built around:
|
|
6
|
+
|
|
7
|
+
- controller-oriented frontend architecture
|
|
8
|
+
- schema-driven column metadata
|
|
9
|
+
- TanStack Table as the row-model engine under a controller-owned runtime
|
|
10
|
+
- `tableCell` bean-scene render resources
|
|
11
|
+
- resource-page integration through `basic-page:blockPage` and `basic-page:blockTable`
|
|
12
|
+
|
|
13
|
+
Use this page together with:
|
|
14
|
+
|
|
15
|
+
- [Component Guide](/frontend/component-guide)
|
|
16
|
+
- [API Schema Guide](/frontend/api-schema-guide)
|
|
17
|
+
- [Bean Scene Authoring](/frontend/bean-scene-authoring)
|
|
18
|
+
- [Model Resource Owner Pattern](/frontend/model-resource-owner-pattern)
|
|
19
|
+
- [TableCell Authoring Cookbook](/frontend/table-cell-cookbook)
|
|
20
|
+
- [Table + Resource CRUD Cookbook](/frontend/table-resource-crud-cookbook)
|
|
21
|
+
- [Zova Table Under the Hood](/frontend/zova-table-under-the-hood)
|
|
22
|
+
- [Zova Table Source Reading Map](/frontend/zova-table-source-reading-map)
|
|
23
|
+
|
|
24
|
+
> [!TIP]
|
|
25
|
+
> **Zova Table docs path**
|
|
26
|
+
>
|
|
27
|
+
> 1. **[Table Guide](/frontend/table-guide)** — learn the public authoring surface
|
|
28
|
+
> 2. **[Zova Table Under the Hood](/frontend/zova-table-under-the-hood)** — learn how the runtime pieces cooperate
|
|
29
|
+
> 3. **[Zova Table Source Reading Map](/frontend/zova-table-source-reading-map)** — learn which files to read next
|
|
30
|
+
>
|
|
31
|
+
> **Companion cookbooks**
|
|
32
|
+
>
|
|
33
|
+
> - **[TableCell Authoring Cookbook](/frontend/table-cell-cookbook)** — concrete custom-cell and row-action patterns
|
|
34
|
+
> - **[Table + Resource CRUD Cookbook](/frontend/table-resource-crud-cookbook)** — standard resource-page integration for filter, bulk actions, table, and pager
|
|
35
|
+
>
|
|
36
|
+
> **You are here:** step 1.
|
|
37
|
+
> **Next recommended page:** [Zova Table Under the Hood](/frontend/zova-table-under-the-hood).
|
|
38
|
+
|
|
39
|
+
If your next question is how these public APIs cooperate internally at runtime, continue with [Zova Table Under the Hood](/frontend/zova-table-under-the-hood).
|
|
40
|
+
|
|
41
|
+
## What you should learn first
|
|
42
|
+
|
|
43
|
+
If you only remember one idea, remember this one:
|
|
44
|
+
|
|
45
|
+
> In Zova, a table is centered on a table controller bean, while schema metadata and `tableCell` render resources decide which columns exist, which cells are visible, and how each cell is rendered.
|
|
46
|
+
|
|
47
|
+
That leads to three common authoring surfaces:
|
|
48
|
+
|
|
49
|
+
- `ZTable` — the root table component
|
|
50
|
+
- schema `rest.table` metadata — the default source of visibility, order, and render decisions
|
|
51
|
+
- `tableCell` beans — the main extension surface for reusable cell rendering
|
|
52
|
+
|
|
53
|
+
## One running example through this guide: Student list page
|
|
54
|
+
|
|
55
|
+
To keep the guide concrete, the examples below all use the same teaching resource:
|
|
56
|
+
|
|
57
|
+
- resource: `training-student:student`
|
|
58
|
+
- representative columns: `name`, `level`, `mobile`, and row operations
|
|
59
|
+
- common page shape: resource page with filter, table, and pager blocks
|
|
60
|
+
|
|
61
|
+
That Student thread is a good specimen because it grows through the same path most real business tables follow:
|
|
62
|
+
|
|
63
|
+
1. resource-driven list page
|
|
64
|
+
2. schema-driven default columns
|
|
65
|
+
3. field metadata pointing to built-in table-cell renderers
|
|
66
|
+
4. custom row-actions or business-specific cell beans only where needed
|
|
67
|
+
|
|
68
|
+
## Step 1: Choose the right table style
|
|
69
|
+
|
|
70
|
+
Before writing code, choose which of these three styles matches your page.
|
|
71
|
+
|
|
72
|
+
### Style A: schema-driven table
|
|
73
|
+
|
|
74
|
+
Use this when:
|
|
75
|
+
|
|
76
|
+
- the backend row schema already describes the list page well
|
|
77
|
+
- you want visible columns, order, and render metadata to come from schema-driven truth
|
|
78
|
+
- you want the shortest path to a working resource list page
|
|
79
|
+
|
|
80
|
+
### Style B: mixed table with custom columns
|
|
81
|
+
|
|
82
|
+
Use this when:
|
|
83
|
+
|
|
84
|
+
- most columns can come from schema metadata
|
|
85
|
+
- one or two columns need page-local structure such as operations or combined display
|
|
86
|
+
- you want to keep the built-in table runtime but customize the column list through `getColumns(...)`
|
|
87
|
+
|
|
88
|
+
### Style C: resource-driven page blocks
|
|
89
|
+
|
|
90
|
+
Use this when:
|
|
91
|
+
|
|
92
|
+
- the page is a standard resource list page
|
|
93
|
+
- filter, table, bulk toolbar, and pager should cooperate through the existing `basic-page` runtime
|
|
94
|
+
- permissions and schema refresh should be owned by the resource-page layer
|
|
95
|
+
|
|
96
|
+
A practical rule is:
|
|
97
|
+
|
|
98
|
+
- start with **resource-driven** for standard CRUD list pages
|
|
99
|
+
- use **schema-driven** when you want the smallest direct `ZTable` usage
|
|
100
|
+
- use **mixed** when one page needs custom columns without abandoning the built-in table runtime
|
|
101
|
+
|
|
102
|
+
## Step 2: Start with the smallest useful table
|
|
103
|
+
|
|
104
|
+
The smallest useful Zova table is usually a direct `ZTable` with row data and a row schema:
|
|
105
|
+
|
|
106
|
+
```tsx
|
|
107
|
+
<ZTable data={this.students} schema={this.schemaRow}></ZTable>
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
That already gives you the default runtime shape:
|
|
111
|
+
|
|
112
|
+
- the wrapper creates a table controller bean
|
|
113
|
+
- the controller loads table-scene schema properties
|
|
114
|
+
- the controller converts those properties into TanStack columns
|
|
115
|
+
- each visible column renders through either text fallback or a `tableCell` render resource
|
|
116
|
+
|
|
117
|
+
A practical reading takeaway is:
|
|
118
|
+
|
|
119
|
+
- **the visible wrapper component is thin**
|
|
120
|
+
- **the controller bean is the real runtime owner**
|
|
121
|
+
|
|
122
|
+
## Step 3: Let schema metadata drive the default columns
|
|
123
|
+
|
|
124
|
+
In the default path, `ZTable` reads table-scene metadata from the row schema.
|
|
125
|
+
|
|
126
|
+
The key table-facing metadata surface is the schema field `rest.table`, especially values such as:
|
|
127
|
+
|
|
128
|
+
- `order`
|
|
129
|
+
- `visible`
|
|
130
|
+
- `render`
|
|
131
|
+
- `columnProps`
|
|
132
|
+
|
|
133
|
+
A simplified mental model is:
|
|
134
|
+
|
|
135
|
+
```text
|
|
136
|
+
schema row -> load table properties -> sort by order -> filter by visible -> build columns -> render cells
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
That means the default list-page question becomes less:
|
|
140
|
+
|
|
141
|
+
- “which local column array should I hand-write first?”
|
|
142
|
+
|
|
143
|
+
and more:
|
|
144
|
+
|
|
145
|
+
- “which backend field metadata should own this column?”
|
|
146
|
+
|
|
147
|
+
This is why table work often belongs in the broader contract loop when the real source of truth is backend field metadata.
|
|
148
|
+
|
|
149
|
+
For the schema side of that contract, also see [API Schema Guide](/frontend/api-schema-guide).
|
|
150
|
+
|
|
151
|
+
## Step 4: Use built-in or custom `tableCell` render resources
|
|
152
|
+
|
|
153
|
+
A column render is usually chosen through schema metadata such as:
|
|
154
|
+
|
|
155
|
+
```typescript
|
|
156
|
+
render: 'basic-text:text';
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
or another `tableCell` resource such as:
|
|
160
|
+
|
|
161
|
+
- `basic-date:date`
|
|
162
|
+
- `basic-select:select`
|
|
163
|
+
- `basic-table:actionOperationsRow`
|
|
164
|
+
|
|
165
|
+
These render resources are not ordinary page-local callbacks. They are Zova bean-scene resources registered under the `tableCell` scene.
|
|
166
|
+
|
|
167
|
+
That matters because the table runtime can then:
|
|
168
|
+
|
|
169
|
+
- resolve the render resource through the bean system
|
|
170
|
+
- merge decorator options with column props
|
|
171
|
+
- ask the bean whether the cell should be visible
|
|
172
|
+
- run render-time JSX/CEL evaluation in the correct table and cell scope
|
|
173
|
+
|
|
174
|
+
A practical rule is:
|
|
175
|
+
|
|
176
|
+
- use built-in `tableCell` resources first
|
|
177
|
+
- add a custom `tableCell` bean only when the business UI really needs module-owned rendering behavior
|
|
178
|
+
|
|
179
|
+
## Step 5: Create a custom `tableCell` bean
|
|
180
|
+
|
|
181
|
+
When a built-in renderer is not enough, use the existing CLI-backed scene workflow.
|
|
182
|
+
|
|
183
|
+
Inspect the command first:
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
npm run zova :create:bean --help
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
Create a normal table-cell bean:
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
npm run zova :create:bean tableCell level -- --module=training-student
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Create a row-actions variant:
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
npm run zova :create:bean tableCell actionOperationsRow -- --module=training-student --boilerplate=tableActionRow
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
The default generated shape is intentionally small:
|
|
202
|
+
|
|
203
|
+
```tsx
|
|
204
|
+
@TableCell<ITableCellOptionsLevel>()
|
|
205
|
+
export class TableCellLevel extends BeanBase implements ITableCellRender {
|
|
206
|
+
render(
|
|
207
|
+
_options: ITableCellOptionsLevel,
|
|
208
|
+
_renderContext: IJsxRenderContextTableCell,
|
|
209
|
+
next: NextTableCellRender,
|
|
210
|
+
) {
|
|
211
|
+
return next();
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
That scaffold is useful because it starts from the correct Zova scene contract:
|
|
217
|
+
|
|
218
|
+
- the bean is marked with `@TableCell(...)`
|
|
219
|
+
- the bean participates in the `tableCell` scene
|
|
220
|
+
- the bean receives controller-prepared render context
|
|
221
|
+
- `next()` already represents the cell’s underlying value or children path
|
|
222
|
+
|
|
223
|
+
For the broader scene system behind this decorator, see [Bean Scene Authoring](/frontend/bean-scene-authoring).
|
|
224
|
+
|
|
225
|
+
## Step 6: Add page-local custom columns with `getColumns(...)`
|
|
226
|
+
|
|
227
|
+
When most columns should stay schema-driven but one column should be page-local, use `getColumns(...)`.
|
|
228
|
+
|
|
229
|
+
A representative pattern is:
|
|
230
|
+
|
|
231
|
+
```tsx
|
|
232
|
+
<ZTable
|
|
233
|
+
data={this.students}
|
|
234
|
+
schema={this.schemaRow}
|
|
235
|
+
getColumns={async (next, createColumnRender) => {
|
|
236
|
+
const columns = await next();
|
|
237
|
+
const operationsRender = await createColumnRender(
|
|
238
|
+
'operations',
|
|
239
|
+
'basic-table:actionOperationsRow',
|
|
240
|
+
);
|
|
241
|
+
if (operationsRender) {
|
|
242
|
+
columns.push({
|
|
243
|
+
id: 'operations',
|
|
244
|
+
header: () => 'Operations',
|
|
245
|
+
cell: props => operationsRender(props),
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
return columns;
|
|
249
|
+
}}
|
|
250
|
+
></ZTable>
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
The important design point is that `createColumnRender(...)` still routes through the table runtime.
|
|
254
|
+
|
|
255
|
+
That means your page-local column can still reuse:
|
|
256
|
+
|
|
257
|
+
- `tableCell` resource resolution
|
|
258
|
+
- column scope creation
|
|
259
|
+
- cell scope creation
|
|
260
|
+
- JSX/CEL evaluation
|
|
261
|
+
- `checkVisible(...)` handling
|
|
262
|
+
|
|
263
|
+
A practical caveat is:
|
|
264
|
+
|
|
265
|
+
- if the custom column key is not a real schema property, the render pipeline still works, but schema-derived property metadata for that key will be absent
|
|
266
|
+
- prefer a real schema-backed key when you want property-driven metadata such as `rest.table` behavior for that column
|
|
267
|
+
|
|
268
|
+
So a mixed table does **not** mean bypassing Zova. It means extending the existing runtime through its own hooks.
|
|
269
|
+
|
|
270
|
+
## Step 7: Use resource-driven page blocks for CRUD list pages
|
|
271
|
+
|
|
272
|
+
For standard resource pages, the more common public surface is not direct `ZTable` usage. It is the block-based page runtime:
|
|
273
|
+
|
|
274
|
+
- `basic-page:blockPage`
|
|
275
|
+
- `basic-page:blockFilter`
|
|
276
|
+
- `basic-page:blockTable`
|
|
277
|
+
- `basic-page:blockPager`
|
|
278
|
+
|
|
279
|
+
In that path:
|
|
280
|
+
|
|
281
|
+
1. the page block owns the resource model
|
|
282
|
+
2. the page block loads row schema, permissions, and paged data
|
|
283
|
+
3. the table block renders `ZTable`
|
|
284
|
+
4. the table controller derives columns from the same row schema
|
|
285
|
+
|
|
286
|
+
This gives you a cohesive CRUD path where:
|
|
287
|
+
|
|
288
|
+
- filter and pager reuse the same page state
|
|
289
|
+
- table refresh can react to permission changes
|
|
290
|
+
- the page can keep a `tableRef` to the controller instance through `controllerRef`
|
|
291
|
+
|
|
292
|
+
For the resource ownership side of that page shape, see [Model Resource Owner Pattern](/frontend/model-resource-owner-pattern).
|
|
293
|
+
|
|
294
|
+
## Step 8: Know when to use `BeanControllerPageTableBase`
|
|
295
|
+
|
|
296
|
+
If your table belongs directly to a page controller rather than a reusable component controller, the page-oriented base class already exists:
|
|
297
|
+
|
|
298
|
+
- `BeanControllerPageTableBase`
|
|
299
|
+
|
|
300
|
+
It provides the same `$useTable(...)` TanStack bridge as the component-oriented base while staying aligned with page-controller architecture.
|
|
301
|
+
|
|
302
|
+
A practical rule is:
|
|
303
|
+
|
|
304
|
+
- use `ZTable` and its built-in controller when you only need the reusable component surface
|
|
305
|
+
- evaluate `BeanControllerPageTableBase` when the table runtime truly belongs inside a page-controller-owned workflow
|
|
306
|
+
|
|
307
|
+
## Common mistakes to avoid
|
|
308
|
+
|
|
309
|
+
### Mistake 1: Treating `ZTable` as only a Vue wrapper around TanStack Table
|
|
310
|
+
|
|
311
|
+
TanStack Table is still important, but the business-facing runtime is controller-owned and schema-aware.
|
|
312
|
+
|
|
313
|
+
### Mistake 2: Hand-writing every column before checking schema metadata
|
|
314
|
+
|
|
315
|
+
For many resource pages, the faster path is to let `rest.table` metadata describe the default columns first.
|
|
316
|
+
|
|
317
|
+
### Mistake 3: Bypassing `tableCell` beans for reusable cell behavior
|
|
318
|
+
|
|
319
|
+
If a renderer should be shared across pages or modules, prefer a `tableCell` resource over repeated page-local callbacks.
|
|
320
|
+
|
|
321
|
+
### Mistake 4: Treating `controllerRef` like a generic Vue DOM ref
|
|
322
|
+
|
|
323
|
+
`controllerRef` gives you the table controller instance, not a plain DOM element.
|
|
324
|
+
|
|
325
|
+
### Mistake 5: Rebuilding CRUD list wiring manually when `basic-page` already owns it
|
|
326
|
+
|
|
327
|
+
For standard resource pages, prefer the existing block/page runtime before hand-building a custom table flow.
|
|
328
|
+
|
|
329
|
+
## A practical authoring order
|
|
330
|
+
|
|
331
|
+
If you want the shortest accurate path to a real business table, use this order:
|
|
332
|
+
|
|
333
|
+
1. make sure the backend row schema is already the right contract truth
|
|
334
|
+
2. start with a resource page or direct `ZTable`
|
|
335
|
+
3. let schema metadata drive the default columns
|
|
336
|
+
4. reuse built-in `tableCell` renderers first
|
|
337
|
+
5. add page-local `getColumns(...)` only where needed
|
|
338
|
+
6. create custom `tableCell` beans only where the UI becomes business-specific
|
|
339
|
+
7. continue with [TableCell Authoring Cookbook](/frontend/table-cell-cookbook) when you want concrete patterns for custom cell beans and row actions
|
|
340
|
+
8. continue with [Table + Resource CRUD Cookbook](/frontend/table-resource-crud-cookbook) when you want the standard resource-page integration path for filter, bulk actions, table, and pager
|
|
341
|
+
9. continue with [Zova Table Under the Hood](/frontend/zova-table-under-the-hood) when you want the runtime explanation behind the public authoring surface
|
|
342
|
+
10. continue with [Zova Table Source Reading Map](/frontend/zova-table-source-reading-map) when you need framework-level source details and targeted file-order guidance
|
|
343
|
+
|
|
344
|
+
## Verification checklist
|
|
345
|
+
|
|
346
|
+
When documenting or changing a table workflow, verify in this order:
|
|
347
|
+
|
|
348
|
+
1. confirm the CLI command shape still exists:
|
|
349
|
+
|
|
350
|
+
```bash
|
|
351
|
+
npm run zova :create:bean --help
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
2. confirm the `tableCell` scene metadata still exists in the current `a-table` module
|
|
355
|
+
3. confirm the runtime claims against the current `a-table`, `basic-table`, and `basic-page` source
|
|
356
|
+
4. if you changed docs, build the docs site:
|
|
357
|
+
|
|
358
|
+
```bash
|
|
359
|
+
npm run docs:build
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
## Final takeaway
|
|
363
|
+
|
|
364
|
+
Zova Table is not only a column array plus JSX.
|
|
365
|
+
|
|
366
|
+
It moves table ownership into:
|
|
367
|
+
|
|
368
|
+
- table controller beans
|
|
369
|
+
- schema-driven column metadata
|
|
370
|
+
- `tableCell` bean-scene render resources
|
|
371
|
+
- resource-page integration
|
|
372
|
+
|
|
373
|
+
TanStack Table is still the underlying row-model engine, but the business-facing runtime model is Zova-native.
|