cabloy 5.1.59 → 5.1.61

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 (149) 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/references/follow-up-checklist.md +1 -0
  4. package/.claude/skills/cabloy-contract-loop/SKILL.md +103 -14
  5. package/.claude/skills/cabloy-contract-loop/references/contract-loop-map.md +126 -12
  6. package/.claude/skills/cabloy-contract-loop/references/resource-custom-state-pattern.md +148 -0
  7. package/.claude/skills/cabloy-contract-loop/references/verification-checklist.md +49 -13
  8. package/.claude/skills/cabloy-frontend-scaffold/SKILL.md +11 -0
  9. package/.claude/skills/cabloy-frontend-scaffold/references/follow-up-checklist.md +2 -0
  10. package/.claude/skills/cabloy-module-removal/SKILL.md +144 -0
  11. package/.claude/skills/cabloy-resource-field-update/SKILL.md +274 -0
  12. package/.claude/skills/cabloy-resource-field-update/evals/evals.json +53 -0
  13. package/.claude/skills/cabloy-resource-field-update/references/custom-renderer-demo-checklist.md +102 -0
  14. package/.claude/skills/cabloy-resource-field-update/references/field-update-decision-tree.md +120 -0
  15. package/.claude/skills/cabloy-resource-field-update/references/follow-up-checklist.md +80 -0
  16. package/.claude/skills/cabloy-resource-field-update/references/verification-checklist.md +97 -0
  17. package/.claude/skills/cabloy-zova-source-reading/SKILL.md +221 -0
  18. package/.claude/skills/cabloy-zova-source-reading/references/analysis-modes.md +91 -0
  19. package/.claude/skills/cabloy-zova-source-reading/references/core-reading-paths.md +117 -0
  20. package/.github/workflows/docs-pages.yml +2 -0
  21. package/.github/workflows/vona-cov-pg.yml +2 -0
  22. package/.github/workflows/vona-test-crud.yml +4 -2
  23. package/.github/workflows/vona-test-mysql.yml +2 -0
  24. package/.github/workflows/vona-test-pg.yml +2 -0
  25. package/.github/workflows/vona-test-sqlite3.yml +2 -0
  26. package/.github/workflows/vona-tsc.yml +2 -0
  27. package/.github/workflows/zova-ui.yml +2 -0
  28. package/.gitignore +0 -4
  29. package/CHANGELOG.md +52 -0
  30. package/CLAUDE.md +12 -0
  31. package/README.md +15 -0
  32. package/cabloy-docs/.vitepress/config.mjs +89 -0
  33. package/cabloy-docs/ai/class-placement-rule.md +2 -0
  34. package/cabloy-docs/ai/cli-to-skill-map.md +14 -0
  35. package/cabloy-docs/ai/docs-skills-rules-mapping.md +14 -0
  36. package/cabloy-docs/ai/future-skill-roadmap.md +27 -9
  37. package/cabloy-docs/ai/introduction.md +1 -0
  38. package/cabloy-docs/ai/playbook-backend-module.md +6 -0
  39. package/cabloy-docs/ai/playbook-module-removal.md +164 -0
  40. package/cabloy-docs/ai/skills.md +11 -0
  41. package/cabloy-docs/backend/bean-scene-authoring.md +350 -0
  42. package/cabloy-docs/backend/cli.md +26 -1
  43. package/cabloy-docs/backend/dto-guide.md +6 -0
  44. package/cabloy-docs/backend/entity-guide.md +18 -0
  45. package/cabloy-docs/backend/foundation.md +28 -3
  46. package/cabloy-docs/backend/introduction.md +10 -0
  47. package/cabloy-docs/backend/serialization-guide.md +10 -0
  48. package/cabloy-docs/backend/service-guide.md +2 -0
  49. package/cabloy-docs/backend/status-guide.md +271 -0
  50. package/cabloy-docs/backend/websocket-call-flow.md +435 -0
  51. package/cabloy-docs/backend/websocket-guide.md +455 -0
  52. package/cabloy-docs/backend/websocket-protocol-guide.md +381 -0
  53. package/cabloy-docs/backend/websocket-usage-guide.md +356 -0
  54. package/cabloy-docs/frontend/api-guide.md +2 -0
  55. package/cabloy-docs/frontend/bean-scene-authoring.md +374 -0
  56. package/cabloy-docs/frontend/behavior-guide.md +449 -0
  57. package/cabloy-docs/frontend/cli.md +24 -0
  58. package/cabloy-docs/frontend/command-scene-authoring.md +495 -0
  59. package/cabloy-docs/frontend/design-principles.md +6 -0
  60. package/cabloy-docs/frontend/fetch-interceptor-guide.md +440 -0
  61. package/cabloy-docs/frontend/form-guide.md +795 -0
  62. package/cabloy-docs/frontend/foundation.md +29 -0
  63. package/cabloy-docs/frontend/introduction.md +17 -1
  64. package/cabloy-docs/frontend/ioc-and-beans.md +16 -9
  65. package/cabloy-docs/frontend/mock-guide.md +1 -0
  66. package/cabloy-docs/frontend/model-architecture.md +252 -39
  67. package/cabloy-docs/frontend/model-resource-best-practices.md +379 -0
  68. package/cabloy-docs/frontend/model-resource-cookbook.md +505 -0
  69. package/cabloy-docs/frontend/model-resource-owner-pattern.md +382 -0
  70. package/cabloy-docs/frontend/model-resource-usage-guide.md +318 -0
  71. package/cabloy-docs/frontend/model-state-guide.md +366 -13
  72. package/cabloy-docs/frontend/openapi-sdk-guide.md +5 -2
  73. package/cabloy-docs/frontend/page-guide.md +6 -0
  74. package/cabloy-docs/frontend/quickstart.md +4 -0
  75. package/cabloy-docs/frontend/reading-zova-for-vue-developers.md +266 -0
  76. package/cabloy-docs/frontend/router-tabs-admin-web-comparison.md +206 -0
  77. package/cabloy-docs/frontend/router-tabs-introduction.md +106 -0
  78. package/cabloy-docs/frontend/router-tabs-mechanism.md +469 -0
  79. package/cabloy-docs/frontend/router-tabs-overview.md +227 -0
  80. package/cabloy-docs/frontend/router-tabs-route-meta-cookbook.md +343 -0
  81. package/cabloy-docs/frontend/server-data.md +2 -0
  82. package/cabloy-docs/frontend/ssr-architecture-overview.md +211 -0
  83. package/cabloy-docs/frontend/ssr-build-deploy-guide.md +308 -0
  84. package/cabloy-docs/frontend/ssr-review-checklist.md +184 -0
  85. package/cabloy-docs/frontend/ssr-troubleshooting-guide.md +301 -0
  86. package/cabloy-docs/frontend/zova-form-source-reading-map.md +295 -0
  87. package/cabloy-docs/frontend/zova-form-under-the-hood.md +556 -0
  88. package/cabloy-docs/frontend/zova-reactivity-under-the-hood.md +320 -0
  89. package/cabloy-docs/frontend/zova-source-reading-map.md +327 -0
  90. package/cabloy-docs/frontend/zova-vs-vue3-comparison.md +308 -0
  91. package/cabloy-docs/fullstack/contract-loop-playbook.md +350 -0
  92. package/cabloy-docs/fullstack/framework-performance.md +3 -3
  93. package/cabloy-docs/fullstack/frontend-metadata-to-backend.md +44 -1
  94. package/cabloy-docs/fullstack/introduction.md +40 -0
  95. package/cabloy-docs/fullstack/openapi-to-sdk.md +19 -9
  96. package/cabloy-docs/fullstack/quickstart.md +7 -1
  97. package/cabloy-docs/fullstack/tutorial-1-first-module.md +111 -0
  98. package/cabloy-docs/fullstack/tutorial-2-first-crud.md +122 -0
  99. package/cabloy-docs/fullstack/tutorial-3-frontend-metadata-sharing.md +131 -0
  100. package/cabloy-docs/fullstack/tutorial-4-custom-level-renderers.md +144 -0
  101. package/cabloy-docs/fullstack/tutorial-5-backend-contract-sharing.md +146 -0
  102. package/cabloy-docs/fullstack/tutorial-6-one-contract-four-uses.md +170 -0
  103. package/cabloy-docs/fullstack/tutorials-overview.md +192 -0
  104. package/cabloy-docs/index.md +4 -3
  105. package/cabloy-docs/reference/bean-scene-boilerplates.md +75 -0
  106. package/cabloy-docs/reference/cli-reference.md +2 -0
  107. package/package.json +7 -2
  108. package/scripts/initTestData.ts +25 -0
  109. package/scripts/upgrade.ts +17 -2
  110. package/vona/packages-cli/cabloy-cli/package.json +2 -2
  111. package/vona/packages-cli/cli/package.json +1 -1
  112. package/vona/packages-cli/cli-set-api/package.json +1 -1
  113. package/vona/packages-cli/cli-set-api/src/lib/bean/cli.create.module.ts +4 -0
  114. package/vona/packages-vona/vona/package.json +1 -1
  115. package/vona/pnpm-lock.yaml +226 -1091
  116. package/vona/pnpm-workspace.yaml +0 -1
  117. package/vona/src/suite-vendor/a-vona/modules/a-core/assets/static/img/vona.svg +1 -1
  118. package/vona/src/suite-vendor/a-vona/modules/a-core/package.json +1 -1
  119. package/vona/src/suite-vendor/a-vona/modules/a-permission/package.json +1 -1
  120. package/vona/src/suite-vendor/a-vona/modules/a-permission/src/bean/bean.permission.ts +1 -1
  121. package/vona/src/suite-vendor/a-vona/modules/a-upload/package.json +2 -2
  122. package/vona/src/suite-vendor/a-vona/package.json +1 -1
  123. package/zova/package.original.json +1 -1
  124. package/zova/packages-cli/cli/package.json +3 -3
  125. package/zova/packages-cli/cli-set-front/cli/templates/init/icon/boilerplate/icons/default/zova.svg +1 -1
  126. package/zova/packages-cli/cli-set-front/cli/templates/openapi/config/boilerplate/module/openapi.config.ts +6 -1
  127. package/zova/packages-cli/cli-set-front/package.json +3 -3
  128. package/zova/packages-cli/cli-set-front/src/lib/bean/cli.create.module.ts +4 -0
  129. package/zova/packages-cli/cli-set-front/src/lib/bean/cli.openapi.generate.ts +34 -4
  130. package/zova/packages-cli/cli-set-front/src/lib/command/create.bean.ts +5 -1
  131. package/zova/packages-utils/zova-vite/package.json +2 -2
  132. package/zova/packages-zova/zova/package.json +2 -2
  133. package/zova/pnpm-lock.yaml +282 -1311
  134. package/zova/pnpm-workspace.yaml +0 -1
  135. package/zova/src/suite/a-home/modules/home-icon/icons/social/cabloy.svg +1 -1
  136. package/zova/src/suite/a-home/modules/home-icon/icons/social/vona.svg +1 -1
  137. package/zova/src/suite/a-home/modules/home-icon/icons/social/zova.svg +1 -1
  138. package/zova/src/suite/a-home/modules/home-icon/src/.metadata/icons/groups/social.svg +3 -3
  139. package/zova/src/suite/cabloy-basic/modules/basic-select/src/component/formFieldSelect/controller.tsx +9 -0
  140. package/zova/src/suite-vendor/a-cabloy/modules/rest-resource/package.json +1 -1
  141. package/zova/src/suite-vendor/a-cabloy/modules/rest-resource/src/model/resource.ts +66 -16
  142. package/zova/src/suite-vendor/a-cabloy/package.json +2 -2
  143. package/zova/src/suite-vendor/a-zova/modules/a-routertabs/package.json +1 -1
  144. package/zova/src/suite-vendor/a-zova/modules/a-routertabs/src/model/tabs.ts +60 -18
  145. package/zova/src/suite-vendor/a-zova/modules/a-table/cli/tableActionRow/boilerplate/{{sceneName}}.{{beanName}}.tsx_ +6 -1
  146. package/zova/src/suite-vendor/a-zova/modules/a-table/cli/tableCell/boilerplate/{{sceneName}}.{{beanName}}.tsx_ +6 -1
  147. package/zova/src/suite-vendor/a-zova/modules/a-table/package.json +1 -1
  148. package/zova/src/suite-vendor/a-zova/modules/a-zova/package.json +2 -2
  149. package/zova/src/suite-vendor/a-zova/package.json +4 -4
@@ -1,6 +1,5 @@
1
1
  packages:
2
2
  - 'packages-cli/*'
3
- - 'packages-docs'
4
3
  - 'packages-utils/*'
5
4
  - 'packages-zova/*'
6
5
  - 'src/module/*'
@@ -1,3 +1,3 @@
1
- <svg width="16" height="20" viewBox="0 0 16 20" fill="none" xmlns="http://www.w3.org/2000/svg">
1
+ <svg width="32" height="32" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
2
  <path d="M14.1094 0C14.7552 0 15.1979 0.0729167 15.4375 0.21875C15.6771 0.364583 15.7969 0.619792 15.7969 0.984375V6.98438C15.7969 7.33854 15.6354 7.59375 15.3125 7.75C15 7.89583 14.474 7.96875 13.7344 7.96875C13.2448 7.96875 12.8646 7.9375 12.5938 7.875C12.3333 7.80208 12.151 7.69792 12.0469 7.5625C11.9427 7.42708 11.8906 7.23438 11.8906 6.98438C11.8906 5.94271 11.6042 5.10938 11.0312 4.48438C10.4688 3.85938 9.66146 3.54688 8.60938 3.54688C7.16146 3.54688 6.0625 4.06771 5.3125 5.10938C4.5625 6.15104 4.1875 7.65104 4.1875 9.60938C4.1875 11.5469 4.58333 13.0469 5.375 14.1094C6.17708 15.1615 7.30729 15.6875 8.76562 15.6875C9.67188 15.6875 10.5417 15.5677 11.375 15.3281C12.2083 15.0781 13.1146 14.7031 14.0938 14.2031C14.2604 14.1198 14.4167 14.0781 14.5625 14.0781C15.0521 14.0781 15.4583 14.5104 15.7812 15.375C15.9271 15.7708 16 16.125 16 16.4375C16 16.9688 15.7604 17.349 15.2812 17.5781C13.0521 18.6823 10.8281 19.2344 8.60938 19.2344C6.90104 19.2344 5.39583 18.8438 4.09375 18.0625C2.79167 17.2812 1.78125 16.1667 1.0625 14.7188C0.354167 13.2604 0 11.5573 0 9.60938C0 7.67188 0.348958 5.97917 1.04688 4.53125C1.74479 3.07292 2.70833 1.95312 3.9375 1.17188C5.17708 0.390625 6.57812 0 8.14062 0C9.96354 0 11.3177 0.65625 12.2031 1.96875V0.984375C12.2031 0.630208 12.3542 0.380208 12.6562 0.234375C12.9583 0.078125 13.4427 0 14.1094 0Z" fill="#FF9300"/>
3
3
  </svg>
@@ -1,3 +1,3 @@
1
- <svg width="20" height="19" viewBox="0 0 20 19" fill="none" xmlns="http://www.w3.org/2000/svg">
1
+ <svg width="32" height="32" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
2
  <path d="M18.5156 0C18.7656 0 18.9583 0.046875 19.0938 0.140625C19.2292 0.223958 19.3281 0.380208 19.3906 0.609375C19.4635 0.838542 19.5 1.17188 19.5 1.60938C19.5 2.04688 19.4635 2.38021 19.3906 2.60938C19.3281 2.83854 19.2292 2.99479 19.0938 3.07812C18.9583 3.16146 18.7656 3.20312 18.5156 3.20312H17.4531L11.7812 17.875C11.6354 18.25 11.4115 18.5104 11.1094 18.6562C10.8073 18.8125 10.3385 18.8906 9.70312 18.8906C9.06771 18.8906 8.59896 18.8125 8.29688 18.6562C8.00521 18.5 7.79167 18.2396 7.65625 17.875L2.1875 3.20312H0.984375C0.734375 3.20312 0.541667 3.16146 0.40625 3.07812C0.270833 2.99479 0.171875 2.83854 0.109375 2.60938C0.0364583 2.38021 0 2.04688 0 1.60938C0 1.17188 0.0364583 0.838542 0.109375 0.609375C0.171875 0.380208 0.270833 0.223958 0.40625 0.140625C0.541667 0.046875 0.734375 0 0.984375 0H7.76562C8.01562 0 8.20833 0.046875 8.34375 0.140625C8.47917 0.223958 8.57812 0.380208 8.64062 0.609375C8.71354 0.838542 8.75 1.17188 8.75 1.60938C8.75 2.04688 8.71354 2.38021 8.64062 2.60938C8.57812 2.83854 8.47917 2.99479 8.34375 3.07812C8.20833 3.16146 8.01562 3.20312 7.76562 3.20312H6.375L9.73438 12.7812L13.3125 3.20312H12.2031C11.9531 3.20312 11.7604 3.16146 11.625 3.07812C11.4896 2.99479 11.3854 2.83854 11.3125 2.60938C11.25 2.38021 11.2188 2.04688 11.2188 1.60938C11.2188 1.17188 11.25 0.838542 11.3125 0.609375C11.3854 0.380208 11.4896 0.223958 11.625 0.140625C11.7604 0.046875 11.9531 0 12.2031 0H18.5156Z" fill="#FF9300"/>
3
3
  </svg>
@@ -1,3 +1,3 @@
1
- <svg width="15" height="19" viewBox="0 0 15 19" fill="none" xmlns="http://www.w3.org/2000/svg">
1
+ <svg width="32" height="32" viewBox="0 0 15 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
2
  <path d="M13.7344 0C13.9844 0 14.1771 0.046875 14.3125 0.140625C14.4479 0.223958 14.5469 0.380208 14.6094 0.609375C14.6823 0.838542 14.7188 1.17188 14.7188 1.60938C14.7188 2.24479 14.599 2.72396 14.3594 3.04688L5.39062 15.1875H11.125V11.7188C11.125 11.3646 11.276 11.1146 11.5781 10.9688C11.8802 10.8125 12.3646 10.7344 13.0312 10.7344C13.6771 10.7344 14.1198 10.8073 14.3594 10.9531C14.599 11.099 14.7188 11.3542 14.7188 11.7188V17.5312C14.7188 17.8854 14.6406 18.1458 14.4844 18.3125C14.3281 18.4688 14.0677 18.5469 13.7031 18.5469H0.984375C0.734375 18.5469 0.541667 18.5052 0.40625 18.4219C0.270833 18.3385 0.166667 18.1823 0.09375 17.9531C0.03125 17.724 0 17.3906 0 16.9531C0 16.2656 0.104167 15.7812 0.3125 15.5L9.28125 3.35938H4.0625V6.51562C4.0625 6.86979 3.91146 7.125 3.60938 7.28125C3.30729 7.42708 2.82292 7.5 2.15625 7.5C1.51042 7.5 1.06771 7.42708 0.828125 7.28125C0.588542 7.13542 0.46875 6.88021 0.46875 6.51562V1.01562C0.46875 0.651042 0.546875 0.390625 0.703125 0.234375C0.869792 0.078125 1.13021 0 1.48438 0H13.7344Z" fill="#FF9300"/>
3
3
  </svg>
@@ -1,5 +1,5 @@
1
1
  <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
2
- <symbol id="zova-svg-icon-home-icon-social-cabloy" xmlns="http://www.w3.org/2000/svg" fill="none"><path fill="#FF9300" d="M14.11 0q.968 0 1.328.219.36.218.359.765v6q0 .532-.485.766-.468.219-1.578.219-.735 0-1.14-.094-.39-.11-.547-.312-.156-.204-.156-.579 0-1.562-.86-2.5-.843-.937-2.422-.937-2.172 0-3.296 1.562-1.125 1.563-1.125 4.5 0 2.907 1.187 4.5 1.203 1.58 3.39 1.579 1.36 0 2.61-.36 1.25-.375 2.719-1.125.25-.125.469-.125.734 0 1.218 1.297.219.594.219 1.063 0 .796-.719 1.14-3.344 1.656-6.672 1.656-2.562 0-4.515-1.172-1.953-1.17-3.032-3.343Q0 12.53 0 9.609q0-2.906 1.047-5.078 1.047-2.187 2.89-3.36Q5.798.002 8.142 0q2.735 0 4.062 1.969V.984q0-.531.453-.75Q13.11 0 14.11 0"/></symbol>
2
+ <symbol id="zova-svg-icon-home-icon-social-cabloy" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 20"><path fill="#FF9300" d="M14.11 0q.968 0 1.328.219.36.218.359.765v6q0 .532-.485.766-.468.219-1.578.219-.735 0-1.14-.094-.39-.11-.547-.312-.156-.204-.156-.579 0-1.562-.86-2.5-.843-.937-2.422-.937-2.172 0-3.296 1.562-1.125 1.563-1.125 4.5 0 2.907 1.187 4.5 1.203 1.58 3.39 1.579 1.36 0 2.61-.36 1.25-.375 2.719-1.125.25-.125.469-.125.734 0 1.218 1.297.219.594.219 1.063 0 .796-.719 1.14-3.344 1.656-6.672 1.656-2.562 0-4.515-1.172-1.953-1.17-3.032-3.343Q0 12.53 0 9.609q0-2.906 1.047-5.078 1.047-2.187 2.89-3.36Q5.798.002 8.142 0q2.735 0 4.062 1.969V.984q0-.531.453-.75Q13.11 0 14.11 0"/></symbol>
3
3
  <symbol id="zova-svg-icon-home-icon-social-chat" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="m6 18-2.3 2.3q-.475.475-1.088.213T2 19.575V4q0-.825.588-1.412T4 2h16q.825 0 1.413.588T22 4v12q0 .825-.587 1.413T20 18zm1-4h6q.425 0 .713-.288T14 13t-.288-.712T13 12H7q-.425 0-.712.288T6 13t.288.713T7 14m0-3h10q.425 0 .713-.288T18 10t-.288-.712T17 9H7q-.425 0-.712.288T6 10t.288.713T7 11m0-3h10q.425 0 .713-.288T18 7t-.288-.712T17 6H7q-.425 0-.712.288T6 7t.288.713T7 8"/></symbol>
4
4
  <symbol id="zova-svg-icon-home-icon-social-facebook" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" class="iconify iconify--ic" viewBox="0 0 24 24"><path fill="currentColor" d="M22 12c0-5.52-4.48-10-10-10S2 6.48 2 12c0 4.84 3.44 8.87 8 9.8V15H8v-3h2V9.5C10 7.57 11.57 6 13.5 6H16v3h-2c-.55 0-1 .45-1 1v2h3v3h-3v6.95c5.05-.5 9-4.76 9-9.95"/></symbol>
5
5
  <symbol id="zova-svg-icon-home-icon-social-github" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M12 2A10 10 0 0 0 2 12c0 4.42 2.87 8.17 6.84 9.5.5.08.66-.23.66-.5v-1.69c-2.77.6-3.36-1.34-3.36-1.34-.46-1.16-1.11-1.47-1.11-1.47-.91-.62.07-.6.07-.6 1 .07 1.53 1.03 1.53 1.03.87 1.52 2.34 1.07 2.91.83.09-.65.35-1.09.63-1.34-2.22-.25-4.55-1.11-4.55-4.92 0-1.11.38-2 1.03-2.71-.1-.25-.45-1.29.1-2.64 0 0 .84-.27 2.75 1.02.79-.22 1.65-.33 2.5-.33s1.71.11 2.5.33c1.91-1.29 2.75-1.02 2.75-1.02.55 1.35.2 2.39.1 2.64.65.71 1.03 1.6 1.03 2.71 0 3.82-2.34 4.66-4.57 4.91.36.31.69.92.69 1.85V21c0 .27.16.59.67.5C19.14 20.16 22 16.42 22 12A10 10 0 0 0 12 2"/></symbol>
@@ -7,6 +7,6 @@
7
7
  <symbol id="zova-svg-icon-home-icon-social-record-voice-over" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M19.95 15.95 18.4 14.4q1.1-1.025 1.725-2.425T20.75 9t-.625-2.95-1.725-2.4l1.55-1.6q1.4 1.325 2.225 3.125T23 9t-.825 3.825-2.225 3.125m-3.2-3.2-1.6-1.6q.45-.425.725-.962T16.15 9t-.275-1.187-.725-.963l1.6-1.6q.8.725 1.25 1.688T18.45 9 18 11.063t-1.25 1.687M9 13q-1.65 0-2.825-1.175T5 9t1.175-2.825T9 5t2.825 1.175T13 9t-1.175 2.825T9 13m-8 8v-2.8q0-.825.425-1.55t1.175-1.1q1.275-.65 2.875-1.1T9 14t3.525.45 2.875 1.1q.75.375 1.175 1.1T17 18.2V21z"/></symbol>
8
8
  <symbol id="zova-svg-icon-home-icon-social-school" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M21 17v-6.9L12 15 1 9l11-6 11 6v8zm-9 4-7-3.8v-5l7 3.8 7-3.8v5z"/></symbol>
9
9
  <symbol id="zova-svg-icon-home-icon-social-twitter" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" class="iconify iconify--mdi" viewBox="0 0 24 24"><path fill="currentColor" d="M22.46 6c-.77.35-1.6.58-2.46.69.88-.53 1.56-1.37 1.88-2.38-.83.5-1.75.85-2.72 1.05C18.37 4.5 17.26 4 16 4c-2.35 0-4.27 1.92-4.27 4.29 0 .34.04.67.11.98C8.28 9.09 5.11 7.38 3 4.79c-.37.63-.58 1.37-.58 2.15 0 1.49.75 2.81 1.91 3.56-.71 0-1.37-.2-1.95-.5v.03c0 2.08 1.48 3.82 3.44 4.21a4.2 4.2 0 0 1-1.93.07 4.28 4.28 0 0 0 4 2.98 8.52 8.52 0 0 1-5.33 1.84q-.51 0-1.02-.06C3.44 20.29 5.7 21 8.12 21 16 21 20.33 14.46 20.33 8.79c0-.19 0-.37-.01-.56.84-.6 1.56-1.36 2.14-2.23"/></symbol>
10
- <symbol id="zova-svg-icon-home-icon-social-vona" xmlns="http://www.w3.org/2000/svg" fill="none"><path fill="#FF9300" d="M18.516 0q.375 0 .578.14.203.126.297.47.11.343.109 1 0 .655-.11 1-.093.343-.296.468t-.578.125h-1.063l-5.672 14.672q-.219.562-.672.781-.452.235-1.406.235-.953 0-1.406-.235-.438-.234-.64-.781L2.186 3.203H.984q-.374 0-.578-.125Q.204 2.953.11 2.61 0 2.266 0 1.61q0-.655.11-1Q.202.266.405.141.61 0 .984 0h6.782q.375 0 .578.14.203.126.297.47.11.343.109 1 0 .655-.11 1-.092.343-.296.468t-.578.125H6.375l3.36 9.578 3.578-9.578h-1.11q-.375 0-.578-.125t-.312-.469q-.094-.343-.094-1 0-.655.094-1 .109-.343.312-.468.203-.141.578-.141z"/></symbol>
11
- <symbol id="zova-svg-icon-home-icon-social-zova" xmlns="http://www.w3.org/2000/svg" fill="none"><path fill="#FF9300" d="M13.734 0q.375 0 .579.14.203.126.296.47.11.343.11 1 0 .953-.36 1.437l-8.968 12.14h5.734V11.72q0-.531.453-.75.454-.235 1.453-.235.97 0 1.328.22.36.217.36.765v5.812q0 .531-.235.782-.234.234-.78.234H.983q-.374 0-.578-.125-.203-.126-.312-.469-.094-.343-.094-1 0-1.031.313-1.453L9.28 3.36H4.062v3.156q0 .531-.453.765-.453.219-1.453.219-.968 0-1.328-.219-.36-.218-.36-.765v-5.5q0-.547.235-.782Q.953 0 1.484 0z"/></symbol>
10
+ <symbol id="zova-svg-icon-home-icon-social-vona" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 20"><path fill="#FF9300" d="M18.516 0q.375 0 .578.14.203.126.297.47.11.343.109 1 0 .655-.11 1-.093.343-.296.468t-.578.125h-1.063l-5.672 14.672q-.219.562-.672.781-.452.235-1.406.235-.953 0-1.406-.235-.438-.234-.64-.781L2.186 3.203H.984q-.374 0-.578-.125Q.204 2.953.11 2.61 0 2.266 0 1.61q0-.655.11-1Q.202.266.405.141.61 0 .984 0h6.782q.375 0 .578.14.203.126.297.47.11.343.109 1 0 .655-.11 1-.092.343-.296.468t-.578.125H6.375l3.36 9.578 3.578-9.578h-1.11q-.375 0-.578-.125t-.312-.469q-.094-.343-.094-1 0-.655.094-1 .109-.343.312-.468.203-.141.578-.141z"/></symbol>
11
+ <symbol id="zova-svg-icon-home-icon-social-zova" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 15 20"><path fill="#FF9300" d="M13.734 0q.375 0 .579.14.203.126.296.47.11.343.11 1 0 .953-.36 1.437l-8.968 12.14h5.734V11.72q0-.531.453-.75.454-.235 1.453-.235.97 0 1.328.22.36.217.36.765v5.812q0 .531-.235.782-.234.234-.78.234H.983q-.374 0-.578-.125-.203-.126-.312-.469-.094-.343-.094-1 0-1.031.313-1.453L9.28 3.36H4.062v3.156q0 .531-.453.765-.453.219-1.453.219-.968 0-1.328-.219-.36-.218-.36-.765v-5.5q0-.547.235-.782Q.953 0 1.484 0z"/></symbol>
12
12
  </svg>
@@ -65,12 +65,21 @@ export class ControllerFormFieldSelect extends BeanControllerBase {
65
65
  ...props,
66
66
  'class': className,
67
67
  };
68
+ propsNew.items = this._ensureEmptyItemFallback(propsNew.items, propsNew.placeholder);
68
69
  return <ZSelect {...propsNew}></ZSelect>;
69
70
  }}
70
71
  ></ZFormField>
71
72
  );
72
73
  }
73
74
 
75
+ private _ensureEmptyItemFallback(items: any[] | undefined, placeholder: unknown): any[] | undefined {
76
+ if (!!placeholder || !items?.length) return items;
77
+ const valueKey = String(this.$props.options.itemValue);
78
+ const titleKey = String(this.$props.options.itemTitle);
79
+ if (items[0]?.[valueKey] === undefined) return items;
80
+ return [{ [valueKey]: undefined, [titleKey]: '' }, ...items];
81
+ }
82
+
74
83
  private _getValueByItems() {
75
84
  const value = this.$props.value;
76
85
  const item = this.$props.options.items?.find(
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zova-module-rest-resource",
3
- "version": "5.1.35",
3
+ "version": "5.1.36",
4
4
  "gitHead": "4dece229b6d3f4735930e833afcb4b95ec51bf86",
5
5
  "description": "",
6
6
  "keywords": [
@@ -18,6 +18,23 @@ import { ScopeModuleAOpenapi, SymbolOpenapiSchemaName } from 'zova-module-a-open
18
18
 
19
19
  export interface IModelOptionsResource extends IDecoratorModelOptions {}
20
20
 
21
+ interface IModelResourceQueryItemOptions<TData> {
22
+ id: TableIdentity;
23
+ action: string;
24
+ queryFn: () => Promise<TData>;
25
+ meta?: {
26
+ disableSuspenseOnInit?: boolean;
27
+ };
28
+ }
29
+
30
+ interface IModelResourceMutationItemOptions<TData = void, TVariables = void> {
31
+ id: TableIdentity;
32
+ action: string;
33
+ mutationFn: (params: TVariables) => Promise<TData>;
34
+ onSuccess?: (data: TData, variables: TVariables, context: unknown) => void | Promise<void>;
35
+ invalidateSelect?: boolean;
36
+ }
37
+
21
38
  @Model<IModelOptionsResource>({
22
39
  enableSelector: true,
23
40
  })
@@ -74,9 +91,8 @@ export class ModelResource<
74
91
  }
75
92
 
76
93
  selectGeneral(actionPath?: string, query?: ITableQuery) {
77
- const queryHash = hashkey(query);
78
94
  return this.$useStateData({
79
- queryKey: ['select', actionPath ?? '', queryHash],
95
+ queryKey: this.keySelect(actionPath, query),
80
96
  queryFn: async () => {
81
97
  const apiPath = actionPath ? `${this.resourceApi}/${actionPath}` : this.resourceApi;
82
98
  return this.$fetch.get<any, ITableRes<Entity>>(
@@ -91,10 +107,20 @@ export class ModelResource<
91
107
  return this.selectGeneral(undefined, query);
92
108
  }
93
109
 
94
- view(id: TableIdentity) {
110
+ queryItem<TData>(options: IModelResourceQueryItemOptions<TData>) {
111
+ const { id, action, queryFn, meta } = options;
95
112
  if (isNil(id)) throw new Error('row id cannot empty');
96
113
  return this.$useStateData({
97
- queryKey: ['get', id],
114
+ queryKey: this.keyItem(id, action),
115
+ queryFn,
116
+ meta,
117
+ });
118
+ }
119
+
120
+ view(id: TableIdentity) {
121
+ return this.queryItem<Entity | null>({
122
+ id,
123
+ action: 'view',
98
124
  queryFn: async () => {
99
125
  const res = await this.$fetch.get<any, Entity>(
100
126
  this.sys.util.apiActionPathTranslate(`${this.resourceApi}/:id`, { id }),
@@ -121,9 +147,26 @@ export class ModelResource<
121
147
  });
122
148
  }
123
149
 
150
+ mutationItem<TData = void, TVariables = void>(options: IModelResourceMutationItemOptions<TData, TVariables>) {
151
+ const { id, action, mutationFn, onSuccess, invalidateSelect = true } = options;
152
+ if (isNil(id)) throw new Error('row id cannot empty');
153
+ return this.$useMutationData<TData, TVariables>({
154
+ mutationKey: [...this.keyItem(id, action), 'mutation'],
155
+ mutationFn,
156
+ onSuccess: async (data, variables, context) => {
157
+ if (invalidateSelect) {
158
+ this.$invalidateQueries({ queryKey: ['select'] });
159
+ }
160
+ this.$invalidateQueries({ queryKey: this.keyItemRoot(id) });
161
+ await onSuccess?.(data, variables, context);
162
+ },
163
+ });
164
+ }
165
+
124
166
  update(id: TableIdentity) {
125
- return this.$useMutationData<void, EntityUpdate>({
126
- mutationKey: ['update', id],
167
+ return this.mutationItem<void, EntityUpdate>({
168
+ id,
169
+ action: 'update',
127
170
  mutationFn: async params => {
128
171
  return this.$fetch.patch<any, void, EntityUpdate>(
129
172
  this.sys.util.apiActionPathTranslate(`${this.resourceApi}/:id`, { id }),
@@ -131,26 +174,19 @@ export class ModelResource<
131
174
  this.sys.util.apiActionConfigPrepare(),
132
175
  );
133
176
  },
134
- onSuccess: () => {
135
- this.$invalidateQueries({ queryKey: ['select'] });
136
- this.$invalidateQueries({ queryKey: ['get', id] });
137
- },
138
177
  });
139
178
  }
140
179
 
141
180
  delete(id: TableIdentity) {
142
- return this.$useMutationData<void, void>({
143
- mutationKey: ['delete', id],
181
+ return this.mutationItem<void, void>({
182
+ id,
183
+ action: 'delete',
144
184
  mutationFn: async () => {
145
185
  return this.$fetch.delete<any, void, void>(
146
186
  this.sys.util.apiActionPathTranslate(`${this.resourceApi}/:id`, { id }),
147
187
  this.sys.util.apiActionConfigPrepare(),
148
188
  );
149
189
  },
150
- onSuccess: () => {
151
- this.$invalidateQueries({ queryKey: ['select'] });
152
- this.$invalidateQueries({ queryKey: ['get', id] });
153
- },
154
190
  });
155
191
  }
156
192
 
@@ -213,6 +249,20 @@ export class ModelResource<
213
249
  return this.$sdk.getSchemaDefaultValue(schemaName) as EntityCreate | undefined;
214
250
  }
215
251
 
252
+ protected keySelect(actionPath?: string, query?: ITableQuery) {
253
+ return ['select', actionPath ?? '', hashkey(query)] as const;
254
+ }
255
+
256
+ protected keyItemRoot(id: TableIdentity) {
257
+ if (isNil(id)) throw new Error('row id cannot empty');
258
+ return ['item', id] as const;
259
+ }
260
+
261
+ protected keyItem(id: TableIdentity, action: string) {
262
+ if (isNil(id)) throw new Error('row id cannot empty');
263
+ return ['item', id, action] as const;
264
+ }
265
+
216
266
  private async _bootstrap() {
217
267
  const queryBootstrap = await $QueryAutoLoad(() => this.$sdk.getBootstrap(this.resource));
218
268
  if (!queryBootstrap?.data) {
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "zova-suite-a-cabloy",
3
- "version": "5.1.36",
3
+ "version": "5.1.37",
4
4
  "gitHead": "4dece229b6d3f4735930e833afcb4b95ec51bf86",
5
5
  "description": "",
6
6
  "author": "",
7
7
  "files": [],
8
8
  "type": "module",
9
9
  "dependencies": {
10
- "zova-module-rest-resource": "^5.1.35"
10
+ "zova-module-rest-resource": "^5.1.36"
11
11
  },
12
12
  "title": "a-cabloy"
13
13
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zova-module-a-routertabs",
3
- "version": "5.1.28",
3
+ "version": "5.1.29",
4
4
  "gitHead": "09d901d17140a80ee0764211b441cda72fd94663",
5
5
  "description": "routertabs",
6
6
  "keywords": [
@@ -156,15 +156,10 @@ export class ModelTabs extends BeanModelBase {
156
156
  updatedAt: Date.now(),
157
157
  info: tabInfo,
158
158
  };
159
- if (this.tabCurrentIndex === -1) {
160
- this.tabs = mutate(this.tabs, copyState => {
161
- copyState.push(tabNew);
162
- });
163
- } else {
164
- this.tabs = mutate(this.tabs, copyState => {
165
- copyState.splice(this.tabCurrentIndex + 1, 0, tabNew);
166
- });
167
- }
159
+ const insertIndex = this._getInsertIndexForNewTab(tabNew);
160
+ this.tabs = mutate(this.tabs, copyState => {
161
+ copyState.splice(insertIndex, 0, tabNew);
162
+ });
168
163
  // need not await
169
164
  this.pruneTabs();
170
165
  } else {
@@ -324,17 +319,15 @@ export class ModelTabs extends BeanModelBase {
324
319
  keepAlive: tab.keepAlive,
325
320
  updatedAt: Date.now(),
326
321
  };
327
- const index = items.findIndex(item => item.componentKey === tab.componentKey);
328
- if (index === -1) {
329
- items.push(tabItem);
322
+ const itemIndex = this._findTabItemIndex(items, tab.componentKey);
323
+ if (itemIndex === -1) {
324
+ const insertIndex = this._getInsertIndexForNewTabItem(tabOld, items);
325
+ items.splice(insertIndex, 0, tabItem);
330
326
  } else {
331
- const tabItemNew: IRouteViewRouteItem = { ...items[index], ...tabItem };
332
- items.splice(index, 1, tabItemNew);
327
+ const tabItemNew: IRouteViewRouteItem = { ...items[itemIndex], ...tabItem };
328
+ items.splice(itemIndex, 1, tabItemNew);
333
329
  }
334
- // not use fullPath, because fullPath has query string
335
- items.sort(
336
- (a, b) => (a.componentKey === tabKey ? 0 : 1) - (b.componentKey === tabKey ? 0 : 1),
337
- );
330
+ this._moveAnchorItemFirst(items, tabKey);
338
331
  }
339
332
  const tabNew: RouteTab = {
340
333
  ...tabOld,
@@ -379,6 +372,55 @@ export class ModelTabs extends BeanModelBase {
379
372
  return [index, this.tabs[index]];
380
373
  }
381
374
 
375
+ private _getInsertIndexForNewTab(tabNew: RouteTab) {
376
+ const lastAffixTabIndex = this._getLastAffixTabIndex();
377
+ if (this.tabCurrentIndex === -1) {
378
+ return lastAffixTabIndex + 1;
379
+ }
380
+ if (tabNew.affix) {
381
+ return lastAffixTabIndex + 1;
382
+ }
383
+ const tabCurrent = this.tabs[this.tabCurrentIndex];
384
+ if (tabCurrent?.affix) {
385
+ return lastAffixTabIndex + 1;
386
+ }
387
+ return this.tabCurrentIndex + 1;
388
+ }
389
+
390
+ private _getLastAffixTabIndex() {
391
+ let lastAffixTabIndex = -1;
392
+ for (let index = 0; index < this.tabs.length; index++) {
393
+ if (!this.tabs[index].affix) break;
394
+ lastAffixTabIndex = index;
395
+ }
396
+ return lastAffixTabIndex;
397
+ }
398
+
399
+ private _findTabItemIndex(items: IRouteViewRouteItem[], componentKey?: string) {
400
+ if (!componentKey) return -1;
401
+ return items.findIndex(item => item.componentKey === componentKey);
402
+ }
403
+
404
+ private _getCurrentTabItemIndex(tab: RouteTab, items: IRouteViewRouteItem[]) {
405
+ if (this.tabKeyCurrent !== tab.tabKey) return -1;
406
+ return this._findTabItemIndex(items, this.componentKeyCurrent);
407
+ }
408
+
409
+ private _getInsertIndexForNewTabItem(tab: RouteTab, items: IRouteViewRouteItem[]) {
410
+ const indexCurrentTabItem = this._getCurrentTabItemIndex(tab, items);
411
+ if (indexCurrentTabItem > -1) {
412
+ return indexCurrentTabItem + 1;
413
+ }
414
+ return items.length;
415
+ }
416
+
417
+ private _moveAnchorItemFirst(items: IRouteViewRouteItem[], tabKey: string) {
418
+ const indexAnchor = items.findIndex(item => item.componentKey === tabKey);
419
+ if (indexAnchor <= 0) return;
420
+ const [anchorItem] = items.splice(indexAnchor, 1);
421
+ items.unshift(anchorItem);
422
+ }
423
+
382
424
  async pruneTabs() {
383
425
  let max = this.tabsOptions.max;
384
426
  if (max === undefined || max === -1) return;
@@ -1,7 +1,12 @@
1
1
  import type { IResourceTableActionRowOptionsBase } from 'zova-module-a-openapi';
2
+ import type {
3
+ IJsxRenderContextTableCell,
4
+ ITableCellRender,
5
+ NextTableCellRender,
6
+ } from 'zova-module-a-table';
2
7
 
3
8
  import { BeanBase } from 'zova';
4
- import { type IJsxRenderContextTableCell, type ITableCellRender, type NextTableCellRender, TableCell } from 'zova-module-a-table';
9
+ import { TableCell } from 'zova-module-a-table';
5
10
 
6
11
  declare module 'zova-module-a-openapi' {
7
12
  export interface IResourceTableActionRowRecord {
@@ -1,7 +1,12 @@
1
1
  import type { IResourceTableCellOptionsBase } from 'zova-module-a-openapi';
2
+ import type {
3
+ IJsxRenderContextTableCell,
4
+ ITableCellRender,
5
+ NextTableCellRender,
6
+ } from 'zova-module-a-table';
2
7
 
3
8
  import { BeanBase } from 'zova';
4
- import { TableCell, type IJsxRenderContextTableCell, type ITableCellRender, type NextTableCellRender } from 'zova-module-a-table';
9
+ import { TableCell } from 'zova-module-a-table';
5
10
 
6
11
  declare module 'zova-module-a-openapi' {
7
12
  export interface IResourceTableCellRecord {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zova-module-a-table",
3
- "version": "5.1.30",
3
+ "version": "5.1.31",
4
4
  "gitHead": "09d901d17140a80ee0764211b441cda72fd94663",
5
5
  "description": "",
6
6
  "keywords": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zova-module-a-zova",
3
- "version": "5.1.69",
3
+ "version": "5.1.70",
4
4
  "gitHead": "2c5c19284bab738e492856189acb6fad74b8a7b7",
5
5
  "description": "zova",
6
6
  "keywords": [
@@ -46,7 +46,7 @@
46
46
  "zova-jsx": "^1.1.63"
47
47
  },
48
48
  "devDependencies": {
49
- "@cabloy/cli": "^3.1.17",
49
+ "@cabloy/cli": "^3.1.18",
50
50
  "@types/luxon": "^3.7.1",
51
51
  "clean-package": "^2.2.0",
52
52
  "fs-extra": "^11.3.5",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zova-suite-a-zova",
3
- "version": "5.1.101",
3
+ "version": "5.1.102",
4
4
  "gitHead": "2c5c19284bab738e492856189acb6fad74b8a7b7",
5
5
  "description": "zova",
6
6
  "license": "MIT",
@@ -25,14 +25,14 @@
25
25
  "zova-module-a-openapi": "^5.1.34",
26
26
  "zova-module-a-router": "^5.1.26",
27
27
  "zova-module-a-routerstack": "^5.1.23",
28
- "zova-module-a-routertabs": "^5.1.28",
28
+ "zova-module-a-routertabs": "^5.1.29",
29
29
  "zova-module-a-ssr": "^5.1.23",
30
30
  "zova-module-a-ssrhmr": "^5.1.19",
31
31
  "zova-module-a-ssrserver": "^5.1.19",
32
32
  "zova-module-a-style": "^5.1.29",
33
- "zova-module-a-table": "^5.1.30",
33
+ "zova-module-a-table": "^5.1.31",
34
34
  "zova-module-a-zod": "^5.1.30",
35
- "zova-module-a-zova": "^5.1.69"
35
+ "zova-module-a-zova": "^5.1.70"
36
36
  },
37
37
  "title": "a-zova"
38
38
  }