cabloy 5.1.60 → 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.
Files changed (232) hide show
  1. package/.claude/hooks/contract-loop-gate.ts +296 -0
  2. package/.claude/settings.json +16 -0
  3. package/.claude/skills/cabloy-backend-scaffold/SKILL.md +2 -0
  4. package/.claude/skills/cabloy-backend-scaffold/references/follow-up-checklist.md +1 -0
  5. package/.claude/skills/cabloy-contract-loop/SKILL.md +89 -16
  6. package/.claude/skills/cabloy-contract-loop/references/contract-loop-map.md +102 -14
  7. package/.claude/skills/cabloy-contract-loop/references/resource-custom-state-pattern.md +4 -0
  8. package/.claude/skills/cabloy-contract-loop/references/verification-checklist.md +32 -14
  9. package/.claude/skills/cabloy-domain-planning/SKILL.md +212 -0
  10. package/.claude/skills/cabloy-frontend-scaffold/SKILL.md +13 -0
  11. package/.claude/skills/cabloy-frontend-scaffold/references/follow-up-checklist.md +2 -0
  12. package/.claude/skills/cabloy-module-removal/SKILL.md +144 -0
  13. package/.claude/skills/cabloy-resource-field-update/SKILL.md +7 -0
  14. package/.claude/skills/cabloy-zova-source-reading/SKILL.md +221 -0
  15. package/.claude/skills/cabloy-zova-source-reading/references/analysis-modes.md +91 -0
  16. package/.claude/skills/cabloy-zova-source-reading/references/core-reading-paths.md +117 -0
  17. package/CHANGELOG.md +64 -0
  18. package/CLAUDE.md +11 -0
  19. package/cabloy-docs/.vitepress/config.mjs +197 -5
  20. package/cabloy-docs/ai/cli-to-skill-map.md +7 -0
  21. package/cabloy-docs/ai/docs-skills-rules-mapping.md +22 -0
  22. package/cabloy-docs/ai/future-skill-roadmap.md +12 -7
  23. package/cabloy-docs/ai/introduction.md +1 -0
  24. package/cabloy-docs/ai/playbook-backend-module.md +6 -0
  25. package/cabloy-docs/ai/playbook-module-removal.md +164 -0
  26. package/cabloy-docs/ai/skills.md +12 -0
  27. package/cabloy-docs/backend/backend-contract-emission-output-inspection.md +189 -0
  28. package/cabloy-docs/backend/backend-contract-emission-source-reading-map.md +160 -0
  29. package/cabloy-docs/backend/backend-contract-emission-specimen.md +170 -0
  30. package/cabloy-docs/backend/backend-resource-module-contract-chain.md +323 -0
  31. package/cabloy-docs/backend/backend-source-reading-debug-checklist.md +173 -0
  32. package/cabloy-docs/backend/backend-source-reading-roadmap.md +129 -0
  33. package/cabloy-docs/backend/backend-source-reading-verify-playbook.md +166 -0
  34. package/cabloy-docs/backend/bean-scene-authoring.md +4 -4
  35. package/cabloy-docs/backend/broadcast-guide.md +3 -3
  36. package/cabloy-docs/backend/cli.md +20 -11
  37. package/cabloy-docs/backend/config-guide.md +4 -4
  38. package/cabloy-docs/backend/controller-aop-guide.md +10 -10
  39. package/cabloy-docs/backend/controller-guide.md +12 -2
  40. package/cabloy-docs/backend/crud-workflow.md +7 -3
  41. package/cabloy-docs/backend/dto-guide.md +18 -2
  42. package/cabloy-docs/backend/dto-infer-generation.md +201 -25
  43. package/cabloy-docs/backend/election-guide.md +2 -2
  44. package/cabloy-docs/backend/entity-guide.md +30 -3
  45. package/cabloy-docs/backend/error-guide.md +3 -3
  46. package/cabloy-docs/backend/event-guide.md +4 -4
  47. package/cabloy-docs/backend/external-aop-guide.md +2 -2
  48. package/cabloy-docs/backend/field-indexes.md +9 -3
  49. package/cabloy-docs/backend/foundation.md +8 -8
  50. package/cabloy-docs/backend/i18n-guide.md +6 -6
  51. package/cabloy-docs/backend/internal-aop-guide.md +2 -2
  52. package/cabloy-docs/backend/introduction.md +15 -0
  53. package/cabloy-docs/backend/migration-and-changes.md +3 -3
  54. package/cabloy-docs/backend/model-guide.md +16 -6
  55. package/cabloy-docs/backend/openapi-guide.md +3 -0
  56. package/cabloy-docs/backend/queue-guide.md +3 -3
  57. package/cabloy-docs/backend/redlock-guide.md +2 -2
  58. package/cabloy-docs/backend/schedule-guide.md +2 -2
  59. package/cabloy-docs/backend/scripts.md +8 -0
  60. package/cabloy-docs/backend/serialization-guide.md +12 -2
  61. package/cabloy-docs/backend/service-guide.md +18 -9
  62. package/cabloy-docs/backend/startup-guide.md +5 -5
  63. package/cabloy-docs/backend/status-guide.md +271 -0
  64. package/cabloy-docs/backend/unit-testing.md +3 -3
  65. package/cabloy-docs/backend/vona-source-reading-map.md +157 -0
  66. package/cabloy-docs/backend/websocket-protocol-guide.md +5 -5
  67. package/cabloy-docs/backend/websocket-usage-guide.md +15 -8
  68. package/cabloy-docs/frontend/a-model-under-the-hood.md +281 -0
  69. package/cabloy-docs/frontend/a-openapi-under-the-hood.md +248 -0
  70. package/cabloy-docs/frontend/a-router-guide.md +307 -0
  71. package/cabloy-docs/frontend/api-guide.md +6 -4
  72. package/cabloy-docs/frontend/api-schema-guide.md +1 -0
  73. package/cabloy-docs/frontend/app-startup-guide.md +7 -4
  74. package/cabloy-docs/frontend/bean-scene-authoring.md +3 -1
  75. package/cabloy-docs/frontend/behavior-guide.md +16 -16
  76. package/cabloy-docs/frontend/cli.md +14 -2
  77. package/cabloy-docs/frontend/command-scene-authoring.md +504 -0
  78. package/cabloy-docs/frontend/component-guide.md +5 -5
  79. package/cabloy-docs/frontend/component-props-guide.md +1 -1
  80. package/cabloy-docs/frontend/component-v-model-guide.md +2 -2
  81. package/cabloy-docs/frontend/design-principles.md +6 -0
  82. package/cabloy-docs/frontend/fetch-interceptor-guide.md +440 -0
  83. package/cabloy-docs/frontend/filter-query-select-data-flow-guide.md +260 -0
  84. package/cabloy-docs/frontend/form-guide.md +786 -0
  85. package/cabloy-docs/frontend/form-scene-to-page-meta-guide.md +303 -0
  86. package/cabloy-docs/frontend/foundation.md +33 -0
  87. package/cabloy-docs/frontend/frontend-source-reading-roadmap.md +249 -0
  88. package/cabloy-docs/frontend/generated-contract-consumption-debug-checklist.md +190 -0
  89. package/cabloy-docs/frontend/generated-contract-consumption-entry-branch.md +205 -0
  90. package/cabloy-docs/frontend/generated-contract-consumption-list-branch.md +157 -0
  91. package/cabloy-docs/frontend/generated-contract-consumption-specimen.md +203 -0
  92. package/cabloy-docs/frontend/generated-contract-consumption-verify-playbook.md +189 -0
  93. package/cabloy-docs/frontend/generic-component-guide.md +1 -1
  94. package/cabloy-docs/frontend/introduction.md +38 -5
  95. package/cabloy-docs/frontend/ioc-and-beans.md +6 -0
  96. package/cabloy-docs/frontend/mock-guide.md +1 -0
  97. package/cabloy-docs/frontend/model-architecture.md +288 -39
  98. package/cabloy-docs/frontend/model-resource-best-practices.md +379 -0
  99. package/cabloy-docs/frontend/model-resource-cookbook.md +508 -0
  100. package/cabloy-docs/frontend/model-resource-internals-deep-dive.md +238 -0
  101. package/cabloy-docs/frontend/model-resource-owner-pattern.md +402 -0
  102. package/cabloy-docs/frontend/model-resource-usage-guide.md +334 -0
  103. package/cabloy-docs/frontend/model-state-guide.md +371 -15
  104. package/cabloy-docs/frontend/module-scope.md +8 -8
  105. package/cabloy-docs/frontend/modules-and-suites.md +2 -1
  106. package/cabloy-docs/frontend/navigation-guards-guide.md +7 -0
  107. package/cabloy-docs/frontend/openapi-sdk-guide.md +17 -6
  108. package/cabloy-docs/frontend/page-guide.md +15 -9
  109. package/cabloy-docs/frontend/page-meta-guide.md +466 -0
  110. package/cabloy-docs/frontend/page-params-guide.md +3 -3
  111. package/cabloy-docs/frontend/page-query-guide.md +2 -2
  112. package/cabloy-docs/frontend/page-route-guide.md +6 -0
  113. package/cabloy-docs/frontend/permission-formscene-action-visibility-guide.md +263 -0
  114. package/cabloy-docs/frontend/quickstart.md +18 -2
  115. package/cabloy-docs/frontend/reading-zova-for-vue-developers.md +266 -0
  116. package/cabloy-docs/frontend/resource-entry-page-deep-dive.md +271 -0
  117. package/cabloy-docs/frontend/resource-list-page-deep-dive.md +279 -0
  118. package/cabloy-docs/frontend/rest-resource-source-reading-map.md +522 -0
  119. package/cabloy-docs/frontend/rest-resource-under-the-hood.md +622 -0
  120. package/cabloy-docs/frontend/root-behaviors-guide.md +282 -0
  121. package/cabloy-docs/frontend/route-alias-guide.md +6 -0
  122. package/cabloy-docs/frontend/router-stack-guide.md +229 -0
  123. package/cabloy-docs/frontend/router-tabs-introduction.md +26 -3
  124. package/cabloy-docs/frontend/router-tabs-layout-integration.md +367 -0
  125. package/cabloy-docs/frontend/router-tabs-mechanism.md +6 -0
  126. package/cabloy-docs/frontend/router-tabs-route-meta-cookbook.md +7 -0
  127. package/cabloy-docs/frontend/router-tabs-vs-stack.md +167 -0
  128. package/cabloy-docs/frontend/router-view-hosts-guide.md +450 -0
  129. package/cabloy-docs/frontend/server-data.md +4 -1
  130. package/cabloy-docs/frontend/system-startup-guide.md +2 -2
  131. package/cabloy-docs/frontend/table-action-visibility-permission-flow-guide.md +263 -0
  132. package/cabloy-docs/frontend/table-cell-cookbook.md +568 -0
  133. package/cabloy-docs/frontend/table-guide.md +373 -0
  134. package/cabloy-docs/frontend/table-resource-crud-cookbook.md +496 -0
  135. package/cabloy-docs/frontend/zova-app-guide.md +251 -0
  136. package/cabloy-docs/frontend/zova-form-source-reading-map.md +293 -0
  137. package/cabloy-docs/frontend/zova-form-under-the-hood.md +561 -0
  138. package/cabloy-docs/frontend/zova-reactivity-under-the-hood.md +320 -0
  139. package/cabloy-docs/frontend/zova-router-under-the-hood.md +561 -0
  140. package/cabloy-docs/frontend/zova-source-reading-map.md +421 -0
  141. package/cabloy-docs/frontend/zova-table-controller-render-supplement.md +225 -0
  142. package/cabloy-docs/frontend/zova-table-source-reading-map.md +317 -0
  143. package/cabloy-docs/frontend/zova-table-under-the-hood.md +532 -0
  144. package/cabloy-docs/frontend/zova-vs-vue3-comparison.md +308 -0
  145. package/cabloy-docs/fullstack/backend-metadata-to-frontend-table-actions-debug-checklist.md +245 -0
  146. package/cabloy-docs/fullstack/backend-metadata-to-frontend-table-actions-source-reading-map.md +139 -0
  147. package/cabloy-docs/fullstack/backend-metadata-to-frontend-table-actions-verify-playbook.md +248 -0
  148. package/cabloy-docs/fullstack/backend-metadata-to-frontend-table-actions.md +511 -0
  149. package/cabloy-docs/fullstack/contract-loop-playbook.md +356 -0
  150. package/cabloy-docs/fullstack/edition-collaboration-differences.md +6 -0
  151. package/cabloy-docs/fullstack/frontend-metadata-to-backend.md +199 -23
  152. package/cabloy-docs/fullstack/introduction.md +15 -1
  153. package/cabloy-docs/fullstack/openapi-to-sdk.md +135 -11
  154. package/cabloy-docs/fullstack/suites-and-modules.md +333 -0
  155. package/cabloy-docs/fullstack/tutorial-1-first-module.md +3 -0
  156. package/cabloy-docs/fullstack/tutorial-2-first-crud.md +4 -0
  157. package/cabloy-docs/fullstack/tutorial-3-frontend-metadata-sharing.md +6 -2
  158. package/cabloy-docs/fullstack/tutorial-4-custom-level-renderers.md +60 -23
  159. package/cabloy-docs/fullstack/tutorial-5-backend-contract-sharing.md +14 -7
  160. package/cabloy-docs/fullstack/tutorial-6-one-contract-four-uses.md +6 -0
  161. package/cabloy-docs/fullstack/tutorials-overview.md +17 -4
  162. package/cabloy-docs/reference/bean-scene-boilerplates.md +15 -13
  163. package/cabloy-docs/reference/package-map.md +4 -3
  164. package/package.json +2 -1
  165. package/scripts/init.ts +2 -18
  166. package/scripts/initTestData.ts +25 -0
  167. package/scripts/upgrade.ts +17 -2
  168. package/vona/pnpm-lock.yaml +48 -194
  169. package/vona/src/suite/a-training/modules/training-student/package.json +53 -0
  170. package/vona/src/suite/a-training/modules/training-student/src/.metadata/index.ts +400 -0
  171. package/vona/src/suite/a-training/modules/training-student/src/.metadata/locales.ts +18 -0
  172. package/vona/src/suite/a-training/modules/training-student/src/.metadata/this.ts +2 -0
  173. package/vona/src/suite/a-training/modules/training-student/src/bean/meta.index.ts +12 -0
  174. package/vona/src/suite/a-training/modules/training-student/src/bean/meta.version.ts +21 -0
  175. package/vona/src/suite/a-training/modules/training-student/src/bean/ssrMenu.student.ts +29 -0
  176. package/vona/src/suite/a-training/modules/training-student/src/config/locale/en-us.ts +15 -0
  177. package/vona/src/suite/a-training/modules/training-student/src/config/locale/zh-cn.ts +15 -0
  178. package/vona/src/suite/a-training/modules/training-student/src/controller/student.ts +74 -0
  179. package/vona/src/suite/a-training/modules/training-student/src/dto/studentCreate.tsx +28 -0
  180. package/vona/src/suite/a-training/modules/training-student/src/dto/studentSelectReq.tsx +44 -0
  181. package/vona/src/suite/a-training/modules/training-student/src/dto/studentSelectRes.tsx +11 -0
  182. package/vona/src/suite/a-training/modules/training-student/src/dto/studentSelectResItem.tsx +45 -0
  183. package/vona/src/suite/a-training/modules/training-student/src/dto/studentSummary.tsx +42 -0
  184. package/vona/src/suite/a-training/modules/training-student/src/dto/studentUpdate.tsx +28 -0
  185. package/vona/src/suite/a-training/modules/training-student/src/dto/studentView.tsx +25 -0
  186. package/vona/src/suite/a-training/modules/training-student/src/entity/student.tsx +84 -0
  187. package/vona/src/suite/a-training/modules/training-student/src/index.ts +2 -0
  188. package/vona/src/suite/a-training/modules/training-student/src/model/student.ts +10 -0
  189. package/vona/src/suite/a-training/modules/training-student/src/service/student.ts +57 -0
  190. package/vona/src/suite/a-training/modules/training-student/test/student.test.ts +173 -0
  191. package/vona/src/suite/a-training/modules/training-student/tsconfig.build.json +11 -0
  192. package/vona/src/suite/a-training/modules/training-student/tsconfig.json +7 -0
  193. package/vona/src/suite/a-training/package.json +12 -0
  194. package/vona/src/suite/a-training/tsconfig.base.json +4 -0
  195. package/vona/src/suite/a-training/tsconfig.json +10 -0
  196. package/zova/packages-cli/cli/package.json +2 -2
  197. package/zova/packages-cli/cli-set-front/cli/templates/openapi/config/boilerplate/module/openapi.config.ts +6 -1
  198. package/zova/packages-cli/cli-set-front/package.json +1 -1
  199. package/zova/packages-cli/cli-set-front/src/lib/bean/cli.openapi.generate.ts +34 -4
  200. package/zova/packages-zova/zova/package.json +2 -2
  201. package/zova/pnpm-lock.yaml +416 -690
  202. package/zova/src/suite/a-training/modules/training-student/cli/openapi.config.ts +9 -0
  203. package/zova/src/suite/a-training/modules/training-student/package.json +52 -0
  204. package/zova/src/suite/a-training/modules/training-student/src/.metadata/component/formFieldLevel.ts +31 -0
  205. package/zova/src/suite/a-training/modules/training-student/src/.metadata/index.ts +258 -0
  206. package/zova/src/suite/a-training/modules/training-student/src/.metadata/locales.ts +7 -0
  207. package/zova/src/suite/a-training/modules/training-student/src/.metadata/this.ts +2 -0
  208. package/zova/src/suite/a-training/modules/training-student/src/api/openapi/baseURL.ts +5 -0
  209. package/zova/src/suite/a-training/modules/training-student/src/api/openapi/index.ts +3 -0
  210. package/zova/src/suite/a-training/modules/training-student/src/api/openapi/schemas.ts +196 -0
  211. package/zova/src/suite/a-training/modules/training-student/src/api/openapi/types.ts +4146 -0
  212. package/zova/src/suite/a-training/modules/training-student/src/api/trainingStudent.ts +151 -0
  213. package/zova/src/suite/a-training/modules/training-student/src/apiSchema/trainingStudent.ts +43 -0
  214. package/zova/src/suite/a-training/modules/training-student/src/bean/tableCell.actionDeleteForce.tsx +51 -0
  215. package/zova/src/suite/a-training/modules/training-student/src/bean/tableCell.actionSummary.tsx +56 -0
  216. package/zova/src/suite/a-training/modules/training-student/src/bean/tableCell.level.tsx +63 -0
  217. package/zova/src/suite/a-training/modules/training-student/src/component/formFieldLevel/controller.tsx +117 -0
  218. package/zova/src/suite/a-training/modules/training-student/src/config/locale/en-us.ts +9 -0
  219. package/zova/src/suite/a-training/modules/training-student/src/config/locale/zh-cn.ts +9 -0
  220. package/zova/src/suite/a-training/modules/training-student/src/index.ts +2 -0
  221. package/zova/src/suite/a-training/modules/training-student/src/model/student.ts +42 -0
  222. package/zova/src/suite/a-training/modules/training-student/tsconfig.build.json +13 -0
  223. package/zova/src/suite/a-training/modules/training-student/tsconfig.json +5 -0
  224. package/zova/src/suite/a-training/package.json +12 -0
  225. package/zova/src/suite/a-training/tsconfig.base.json +4 -0
  226. package/zova/src/suite/a-training/tsconfig.json +4 -0
  227. package/zova/src/suite/cabloy-basic/modules/basic-select/src/component/formFieldSelect/controller.tsx +29 -7
  228. package/zova/src/suite/cabloy-basic/modules/basic-select/src/component/select/controller.tsx +34 -11
  229. package/zova/src/suite-vendor/a-zova/modules/a-table/package.json +1 -1
  230. package/zova/src/suite-vendor/a-zova/modules/a-table/src/component/table/controller.tsx +3 -3
  231. package/zova/src/suite-vendor/a-zova/modules/a-table/src/lib/tableCell.ts +1 -1
  232. package/zova/src/suite-vendor/a-zova/package.json +2 -2
@@ -0,0 +1,568 @@
1
+ # TableCell Authoring Cookbook
2
+
3
+ This cookbook explains how to author `tableCell` resources in Zova for the most common business table patterns.
4
+
5
+ Use this page when the public table runtime already makes sense to you and your next question is practical:
6
+
7
+ - how should I write a custom `tableCell` bean?
8
+ - when should I use `next()` directly?
9
+ - how should I format values, wrap them with styles, or trigger commands?
10
+ - when should I use the `tableActionRow` boilerplate instead of a normal `tableCell`?
11
+
12
+ Use this page together with:
13
+
14
+ - [Table Guide](/frontend/table-guide)
15
+ - [Table + Resource CRUD Cookbook](/frontend/table-resource-crud-cookbook)
16
+ - [Zova Table Under the Hood](/frontend/zova-table-under-the-hood)
17
+ - [Zova Table Source Reading Map](/frontend/zova-table-source-reading-map)
18
+ - [Bean Scene Authoring](/frontend/bean-scene-authoring)
19
+ - [Bean Scene Boilerplate Variants](/reference/bean-scene-boilerplates)
20
+ - [Tutorial 4: Custom Form/Table Renderers for Level](/fullstack/tutorial-4-custom-level-renderers)
21
+ - [Tutorial 5: Backend Contract Sharing](/fullstack/tutorial-5-backend-contract-sharing)
22
+
23
+ ## What a `tableCell` bean is for
24
+
25
+ A `tableCell` bean is the main reusable extension surface for one table cell in Zova.
26
+
27
+ It is a good fit when:
28
+
29
+ - the same cell behavior should be reused across pages
30
+ - a schema field should point to a named frontend render resource
31
+ - a row action should be represented as one reusable render unit
32
+ - the table runtime should continue owning scope, visibility, and render orchestration
33
+
34
+ It is **not** the first choice when:
35
+
36
+ - the change is only one page-local layout tweak with no reuse value
37
+ - the page should instead add or remove whole columns through `getColumns(...)`
38
+ - the business truth really belongs in backend schema metadata and no custom frontend behavior is needed yet
39
+
40
+ A practical rule is:
41
+
42
+ - use schema metadata first
43
+ - use built-in table-cell resources second
44
+ - add a custom `tableCell` bean only when the UI behavior becomes business-specific or reusable
45
+
46
+ ## The smallest correct mental model
47
+
48
+ If you only remember one idea, remember this one:
49
+
50
+ > A `tableCell` bean does not own the whole table. The table controller owns the table runtime, and your `tableCell` bean receives a prepared render context plus `next()` for the current cell.
51
+
52
+ That is why `tableCell` authoring usually feels small and focused.
53
+
54
+ Your bean normally decides only one of these things:
55
+
56
+ - format the current value
57
+ - wrap the current value with extra markup
58
+ - trigger a command or action
59
+ - orchestrate several nested row actions
60
+
61
+ ## Step 1: Start from the CLI scaffold
62
+
63
+ Inspect the CLI surface first:
64
+
65
+ ```bash
66
+ npm run zova :create:bean --help
67
+ ```
68
+
69
+ Create a normal table-cell bean:
70
+
71
+ ```bash
72
+ npm run zova :create:bean tableCell level -- --module=training-student
73
+ ```
74
+
75
+ Create a row-action variant:
76
+
77
+ ```bash
78
+ npm run zova :create:bean tableCell actionOperationsRow -- --module=training-student --boilerplate=tableActionRow
79
+ ```
80
+
81
+ The default scaffold shape is intentionally small:
82
+
83
+ ```tsx
84
+ @TableCell<ITableCellOptionsLevel>()
85
+ export class TableCellLevel extends BeanBase implements ITableCellRender {
86
+ render(
87
+ _options: ITableCellOptionsLevel,
88
+ _renderContext: IJsxRenderContextTableCell,
89
+ next: NextTableCellRender,
90
+ ) {
91
+ return next();
92
+ }
93
+ }
94
+ ```
95
+
96
+ That is already the correct architectural starting point because:
97
+
98
+ - the bean is registered in the `tableCell` scene
99
+ - the options type is local to your resource identity
100
+ - the render context is already prepared by the table controller
101
+ - `next()` already represents the cell’s current value or downstream content path
102
+
103
+ ## Step 2: Understand the three parameters you receive
104
+
105
+ The `render(...)` method usually receives:
106
+
107
+ - `options` — the final merged options for this cell resource
108
+ - `renderContext` — the current table/cell runtime context
109
+ - `next` — the function that gives you the downstream cell content
110
+
111
+ ### `options`
112
+
113
+ Use `options` for things such as:
114
+
115
+ - `class`
116
+ - formatting presets
117
+ - display items
118
+ - command options
119
+ - action lists for row-action cells
120
+
121
+ These options may come from more than one layer, including:
122
+
123
+ - decorator defaults on `@TableCell(...)`
124
+ - schema `rest.table.columnProps`
125
+ - action metadata options
126
+
127
+ ### `renderContext`
128
+
129
+ Use `renderContext` when you need access to:
130
+
131
+ - `$host` — the host controller utilities such as `$performCommand(...)`
132
+ - `$$table` — the current table controller
133
+ - `cellContext` — the TanStack cell context
134
+ - `$celScope` — the current cell scope
135
+
136
+ ### `next()`
137
+
138
+ Use `next()` when your cell should build on top of the current value rather than replace the whole rendering path.
139
+
140
+ A practical rule is:
141
+
142
+ - if the cell is basically a formatter or wrapper, start from `next()`
143
+ - if the cell is a command button or link, you may ignore `next()` and render your own content
144
+
145
+ ## Pattern 1: Minimal pass-through cell
146
+
147
+ Use this pattern when you only want a reusable placeholder bean or a very thin wrapper.
148
+
149
+ Representative shape:
150
+
151
+ ```tsx
152
+ @TableCell<ITableCellOptionsLevel>()
153
+ export class TableCellLevel extends BeanBase implements ITableCellRender {
154
+ render(
155
+ _options: ITableCellOptionsLevel,
156
+ _renderContext: IJsxRenderContextTableCell,
157
+ next: NextTableCellRender,
158
+ ) {
159
+ return next();
160
+ }
161
+ }
162
+ ```
163
+
164
+ Use this when:
165
+
166
+ - the backend already points to a custom cell resource but the UI behavior is still small
167
+ - you want the resource identity to exist before you add richer logic
168
+ - you want a stable extension point for future customization
169
+
170
+ This is the right starting point for many business-specific fields.
171
+
172
+ ## Pattern 2: Format a value and optionally wrap it with a class
173
+
174
+ Use this pattern when the cell is still “show the field value,” but the value needs formatting.
175
+
176
+ Representative built-in examples are:
177
+
178
+ - `basic-date:date`
179
+ - `basic-currency:currency`
180
+ - `basic-select:select`
181
+ - `basic-text:text`
182
+
183
+ The common pattern is:
184
+
185
+ 1. call `next()`
186
+ 2. transform the value
187
+ 3. if `options.class` exists, wrap the result with a container
188
+
189
+ Representative shape:
190
+
191
+ ```tsx
192
+ @TableCell<ITableCellOptionsCurrency>()
193
+ export class TableCellCurrency extends BeanBase implements ITableCellRender {
194
+ render(
195
+ options: ITableCellOptionsCurrency,
196
+ _renderContext: IJsxRenderContextTableCell,
197
+ next: NextTableCellRender,
198
+ ) {
199
+ const value = currencyFormat(next(), options);
200
+ if (!options.class) return value;
201
+ return <div class={options.class}>{value}</div>;
202
+ }
203
+ }
204
+ ```
205
+
206
+ This is a good fit when:
207
+
208
+ - the field is still conceptually one value
209
+ - formatting logic should be shared across multiple pages
210
+ - schema metadata should be able to point to one stable frontend renderer
211
+
212
+ A practical rule is:
213
+
214
+ - prefer formatting around `next()` for date, currency, enum-label, or badge-like display
215
+ - do not re-fetch row data manually if the current cell value is already enough
216
+
217
+ ## Pattern 3: Map a raw value to an item label
218
+
219
+ Use this pattern when the raw stored value is not the final display value.
220
+
221
+ Representative built-in example:
222
+
223
+ - `basic-select:select`
224
+
225
+ Representative shape:
226
+
227
+ ```tsx
228
+ @TableCell<ITableCellOptionsSelect>({
229
+ itemValue: 'value',
230
+ itemTitle: 'title',
231
+ })
232
+ export class TableCellSelect extends BeanBase implements ITableCellRender {
233
+ render(
234
+ options: ITableCellOptionsSelect,
235
+ _renderContext: IJsxRenderContextTableCell,
236
+ next: NextTableCellRender,
237
+ ) {
238
+ const value = next();
239
+ const item = options.items?.find(
240
+ item => String(item[String(options.itemValue)]) === String(value),
241
+ );
242
+ const value2 = item?.[String(options.itemTitle)];
243
+ if (!options.class) return value2;
244
+ return <div class={options.class}>{value2}</div>;
245
+ }
246
+ }
247
+ ```
248
+
249
+ This is a good fit when:
250
+
251
+ - the stored value is a code, enum, or id-like value
252
+ - the visible table should show a label instead
253
+ - the same mapping should be reused in several places
254
+
255
+ ## Pattern 4: Turn the cell into a command link or button
256
+
257
+ Use this pattern when the cell should trigger a user action.
258
+
259
+ Representative built-in examples are:
260
+
261
+ - `basic-table:actionView`
262
+ - `basic-table:actionDelete`
263
+
264
+ A command-link pattern looks like this:
265
+
266
+ ```tsx
267
+ @TableCell<ITableCellOptionsActionView>({
268
+ class: 'hover:text-blue-500',
269
+ })
270
+ export class TableCellActionView extends BeanBase implements ITableCellRender {
271
+ render(
272
+ options: ITableCellOptionsActionView,
273
+ renderContext: IJsxRenderContextTableCell,
274
+ next: NextTableCellRender,
275
+ ) {
276
+ const { $host } = renderContext;
277
+ const value = next();
278
+ return (
279
+ <a
280
+ class={options.class}
281
+ href="#"
282
+ onClick={async e => {
283
+ e.preventDefault();
284
+ e.stopPropagation();
285
+ await $host.$performCommand('basic-commands:view', options, renderContext);
286
+ }}
287
+ >
288
+ {value}
289
+ </a>
290
+ );
291
+ }
292
+ }
293
+ ```
294
+
295
+ A command-button pattern looks like this:
296
+
297
+ ```tsx
298
+ @TableCell<ITableCellOptionsActionDelete>({
299
+ class: 'btn btn-outline btn-error join-item',
300
+ })
301
+ export class TableCellActionDelete extends BeanBase implements ITableCellRender {
302
+ render(
303
+ options: ITableCellOptionsActionDelete,
304
+ renderContext: IJsxRenderContextTableCell,
305
+ _next: NextTableCellRender,
306
+ ) {
307
+ const { $host } = renderContext;
308
+ return (
309
+ <button
310
+ class={options.class}
311
+ type="button"
312
+ onClick={async () => {
313
+ if (!window.confirm(this.scope.locale.DeleteConfirm())) return;
314
+ await $host.$performCommand('basic-commands:delete', options, renderContext);
315
+ }}
316
+ >
317
+ Delete
318
+ </button>
319
+ );
320
+ }
321
+ }
322
+ ```
323
+
324
+ This is a good fit when:
325
+
326
+ - the cell is really an action, not only formatted display
327
+ - the same action should be reusable across resource pages
328
+ - command-scene infrastructure should remain the action execution path
329
+
330
+ A practical rule is:
331
+
332
+ - let the cell resource own the render interaction
333
+ - let the command bean or model layer own the actual action semantics
334
+
335
+ ## Pattern 5: Row-action composition with `tableActionRow`
336
+
337
+ Use this pattern when one cell should show several row actions together.
338
+
339
+ Representative built-in example:
340
+
341
+ - `basic-table:actionOperationsRow`
342
+
343
+ This pattern is different from a normal single-action cell because the bean often needs to:
344
+
345
+ - inspect an `actions` array
346
+ - filter actions by permission
347
+ - preload nested renders
348
+ - render several child action cells in one wrapper
349
+
350
+ That is why the `tableActionRow` boilerplate exists.
351
+
352
+ Representative runtime shape:
353
+
354
+ ```tsx
355
+ @TableCell<ITableCellOptionsActionOperationsRow>({
356
+ class: 'join',
357
+ })
358
+ export class TableCellActionOperationsRow extends BeanBase implements ITableCellRender {
359
+ async checkVisible(
360
+ options: ITableCellOptionsActionOperationsRow,
361
+ renderContext: IJsxRenderContextTableColumn,
362
+ ): Promise<boolean> {
363
+ const { $celScope, $host, $$table } = renderContext;
364
+ const permissions = $celScope.permissions;
365
+ const actions = options.actions;
366
+ if (!actions || actions.length === 0) return false;
367
+ const renders: TypeTableCellRenderComponent[] = [];
368
+ for (const action of actions) {
369
+ const actionName = action.name;
370
+ const actionRender = action.render;
371
+ const permissionHint = action.options?.permission;
372
+ if ($host.$passport.checkPermission(permissions, actionName, permissionHint)) {
373
+ if (!actionRender) throw new Error(`should specify action render: ${actionName}`);
374
+ renders.push(actionRender);
375
+ }
376
+ }
377
+ await $$table.cellRenderPrepare(renders);
378
+ return renders.length > 0;
379
+ }
380
+ }
381
+ ```
382
+
383
+ And the render step usually reuses the table runtime again:
384
+
385
+ ```tsx
386
+ render(options, renderContext) {
387
+ const { $celScope, $host, $$table } = renderContext;
388
+ const permissions = $celScope.permissions;
389
+ const actions = options.actions;
390
+ if (!actions || actions.length === 0) return;
391
+ const domActions = [];
392
+ actions.forEach((action, index) => {
393
+ const actionName = action.name;
394
+ const permissionHint = action.options?.permission;
395
+ if (!$host.$passport.checkPermission(permissions, actionName, permissionHint)) return;
396
+ const options2 = Object.assign({ key: index }, action.options);
397
+ domActions.push($$table.cellRender(action.render!, options2, renderContext));
398
+ });
399
+ return <div class={options.class}>{domActions}</div>;
400
+ }
401
+ ```
402
+
403
+ This is a good fit when:
404
+
405
+ - one Operations column should contain several reusable child actions
406
+ - permission filtering belongs in the table action layer
407
+ - nested action cells should still reuse the same table-cell pipeline
408
+
409
+ A practical rule is:
410
+
411
+ - use the normal scaffold for one render resource
412
+ - use `--boilerplate=tableActionRow` when the cell is really a row-action container
413
+
414
+ ## Pattern 6: Business-specific badge or label cell
415
+
416
+ Use this pattern when a field such as `level`, `status`, or `state` should have module-owned presentation.
417
+
418
+ A typical workflow is:
419
+
420
+ 1. create a module-local table cell bean
421
+ 2. move the presentation logic into that bean
422
+ 3. point backend metadata to the bean resource name
423
+
424
+ Representative CLI command:
425
+
426
+ ```bash
427
+ npm run zova :create:bean tableCell level -- --module=training-student
428
+ ```
429
+
430
+ Representative backend-facing metadata target:
431
+
432
+ ```typescript
433
+ ZovaRender.cell('training-student:level', { items: levelItems });
434
+ ```
435
+
436
+ This is the right fit when:
437
+
438
+ - the field now has business-specific UI meaning
439
+ - built-in renderers are a good start but no longer enough
440
+ - the backend contract should still choose the frontend resource identity
441
+
442
+ For the full walkthrough around `level`, see [Tutorial 4: Custom Form/Table Renderers for Level](/fullstack/tutorial-4-custom-level-renderers).
443
+
444
+ ## Pattern 7: Backend contract to frontend cell handoff
445
+
446
+ Many table-cell workflows are easiest to understand as a contract chain.
447
+
448
+ A common chain is:
449
+
450
+ 1. backend row DTO owns the field metadata or row-action metadata
451
+ 2. frontend `tableCell` bean provides the render resource implementation
452
+ 3. the table controller resolves that render resource at runtime
453
+ 4. the visible table page reuses the same table runtime with no page-local duplication
454
+
455
+ For row actions, the chain often continues further:
456
+
457
+ 1. backend action contract exists
458
+ 2. frontend generated API exists
459
+ 3. frontend model wraps the generated API thinly
460
+ 4. `tableCell.actionXxx.tsx` triggers that action through command or model logic
461
+
462
+ That is why custom table cells often belong to the contract loop rather than to isolated page-only UI work.
463
+
464
+ For the forward-chain row-action example, see [Tutorial 5: Backend Contract Sharing](/fullstack/tutorial-5-backend-contract-sharing).
465
+
466
+ ## How to choose between the common patterns
467
+
468
+ Use this quick rule set:
469
+
470
+ ### Choose a minimal pass-through cell when:
471
+
472
+ - you only need a stable module-owned resource identity
473
+ - you expect richer logic later
474
+
475
+ ### Choose a formatting cell when:
476
+
477
+ - the cell still represents one value
478
+ - the business behavior is formatting or display mapping
479
+
480
+ ### Choose a command cell when:
481
+
482
+ - the cell is an action trigger
483
+ - the action should be reusable and command-oriented
484
+
485
+ ### Choose a row-action cell when:
486
+
487
+ - one column should contain several child actions
488
+ - permission-sensitive action composition is needed
489
+
490
+ ### Stay with schema metadata only when:
491
+
492
+ - built-in render resources already solve the problem
493
+ - no module-owned frontend logic is needed yet
494
+
495
+ ## Common mistakes to avoid
496
+
497
+ ### Mistake 1: Rebuilding row access manually
498
+
499
+ The table controller already prepares `cellContext`, scope, and render context. Use `next()` and `renderContext` first.
500
+
501
+ ### Mistake 2: Using a custom `tableCell` bean for a one-off page-local column shape
502
+
503
+ If the behavior is not reusable, consider `getColumns(...)` or page-local rendering first.
504
+
505
+ ### Mistake 3: Putting business action semantics directly into ad hoc click handlers everywhere
506
+
507
+ Prefer one reusable command or model path, and let the `tableCell` bean stay the render-facing adapter.
508
+
509
+ ### Mistake 4: Using the normal scaffold when the cell is really a row-action container
510
+
511
+ If the cell will host several actions, prefer `--boilerplate=tableActionRow`.
512
+
513
+ ### Mistake 5: Treating a `tableCell` bean like a full table replacement
514
+
515
+ It only owns one cell render resource. The table controller still owns the table runtime.
516
+
517
+ ## A practical authoring order
518
+
519
+ If you want the shortest path to a correct custom table cell, use this order:
520
+
521
+ 1. confirm whether built-in renderers already solve the problem
522
+ 2. confirm whether the truth should live in backend schema or row-action metadata
523
+ 3. generate the correct `tableCell` scaffold
524
+ 4. start from `next()` when the cell is still value-centric
525
+ 5. use `renderContext.$host` when the cell needs commands or host services
526
+ 6. use `tableActionRow` only for multi-action composition
527
+ 7. point backend metadata to the new frontend cell resource when the contract is ready
528
+ 8. continue with [Table + Resource CRUD Cookbook](/frontend/table-resource-crud-cookbook) if the cell belongs inside a standard resource list page
529
+ 9. continue with [Backend Metadata to Frontend Table Actions](/fullstack/backend-metadata-to-frontend-table-actions) if the cell is part of a larger contract-loop action chain
530
+ 10. continue with [Zova Table Under the Hood](/frontend/zova-table-under-the-hood) if you need the controller-level runtime explanation
531
+ 11. continue with [Zova Table Source Reading Map](/frontend/zova-table-source-reading-map) if you need the exact next files to read
532
+
533
+ ## Verification checklist
534
+
535
+ When authoring or documenting a custom `tableCell`, verify in this order:
536
+
537
+ 1. confirm the CLI command shape still exists:
538
+
539
+ ```bash
540
+ npm run zova :create:bean --help
541
+ ```
542
+
543
+ 2. confirm the scene variant still exists before recommending it:
544
+
545
+ ```bash
546
+ npm run zova :create:bean tableCell test -- --module=training-student --boilerplate=tableActionRow
547
+ ```
548
+
549
+ 3. confirm your bean follows the current `ITableCellRender` contract
550
+ 4. confirm the target backend metadata points to the intended resource name
551
+ 5. run the docs build if you changed docs:
552
+
553
+ ```bash
554
+ npm run docs:build
555
+ ```
556
+
557
+ ## Final takeaway
558
+
559
+ A good `tableCell` bean is usually small.
560
+
561
+ It does not replace the table runtime. It plugs into it.
562
+
563
+ That is why the best `tableCell` authoring style is usually:
564
+
565
+ - small bean
566
+ - clear options type
567
+ - minimal render responsibility
568
+ - stable contract-facing resource identity