cabloy 5.1.174 → 5.1.175

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 (76) hide show
  1. package/.cabloy-version +1 -1
  2. package/.claude/skills/cabloy-frontend-scaffold/SKILL.md +4 -0
  3. package/CHANGELOG.md +18 -0
  4. package/package.json +2 -2
  5. package/repo-docs/.vitepress/config.mjs +7 -0
  6. package/repo-docs/frontend/a-model-under-the-hood.md +11 -0
  7. package/repo-docs/frontend/behavior-guide.md +73 -0
  8. package/repo-docs/frontend/column-configuration-guide.md +254 -0
  9. package/repo-docs/frontend/component-guide.md +2 -29
  10. package/repo-docs/frontend/controller-boundary-guide.md +229 -0
  11. package/repo-docs/frontend/introduction.md +4 -0
  12. package/repo-docs/frontend/page-route-guide.md +6 -0
  13. package/repo-docs/frontend/resource-picker-guide.md +223 -0
  14. package/repo-docs/frontend/rest-resource-source-reading-map.md +37 -21
  15. package/repo-docs/frontend/rest-resource-under-the-hood.md +50 -30
  16. package/repo-docs/frontend/routed-dialog-guide.md +471 -0
  17. package/repo-docs/frontend/router-stack-guide.md +4 -2
  18. package/repo-docs/frontend/router-view-hosts-guide.md +3 -2
  19. package/repo-docs/frontend/ssr-client-only.md +6 -0
  20. package/repo-docs/frontend/table-guide.md +2 -1
  21. package/repo-docs/frontend/table-resource-crud-cookbook.md +1 -0
  22. package/repo-docs/frontend/use-state-data-best-practices.md +26 -0
  23. package/repo-e2e/specs/cabloy-basic.spec.ts +11 -0
  24. package/repo-e2e/specs/controller-boundary.spec.ts +1 -2
  25. package/test-results/.last-run.json +1 -1
  26. package/vona/packages-cli/cli/package.json +1 -1
  27. package/vona/packages-cli/cli-set-api/package.json +1 -1
  28. package/vona/packages-vona/vona/package.json +1 -1
  29. package/vona/packages-vona/vona-core/package.json +1 -1
  30. package/vona/packages-vona/vona-core/src/lib/utils/util.ts +1 -0
  31. package/vona/packages-vona/vona-mock/package.json +1 -1
  32. package/vona/src/suite/a-training/modules/training-student/test/student.test.ts +1 -1
  33. package/vona/src/suite-vendor/a-cabloy/modules/a-layoutprofile/package.json +1 -1
  34. package/vona/src/suite-vendor/a-cabloy/modules/a-layoutprofile/test/layoutprofile.test.ts +2 -3
  35. package/vona/src/suite-vendor/a-cabloy/package.json +2 -2
  36. package/vona/src/suite-vendor/a-vona/modules/a-core/package.json +1 -1
  37. package/vona/src/suite-vendor/a-vona/modules/a-executor/package.json +1 -1
  38. package/vona/src/suite-vendor/a-vona/modules/a-executor/src/service/executor.ts +6 -1
  39. package/vona/src/suite-vendor/a-vona/package.json +1 -1
  40. package/zova/package.original.json +1 -1
  41. package/zova/packages-zova/zova/package.json +2 -2
  42. package/zova/src/suite/a-commerce/modules/commerce-catalog/src/page/product/controller.tsx +4 -3
  43. package/zova/src/suite/a-commerce/modules/commerce-member/src/page/address/controller.tsx +4 -3
  44. package/zova/src/suite/a-commerce/modules/commerce-trade/src/component/tableCellActionAdjustStock/controller.tsx +3 -2
  45. package/zova/src/suite/a-commerce/modules/commerce-trade/src/component/tableCellActionRefund/controller.tsx +16 -20
  46. package/zova/src/suite/a-commerce/modules/commerce-trade/src/component/tableCellActionShip/controller.tsx +3 -2
  47. package/zova/src/suite/a-commerce/modules/commerce-trade/src/page/cart/controller.tsx +6 -5
  48. package/zova/src/suite/a-commerce/modules/commerce-trade/src/page/checkout/controller.tsx +5 -4
  49. package/zova/src/suite/a-commerce/modules/commerce-trade/src/page/order/controller.tsx +4 -4
  50. package/zova/src/suite/a-demo/modules/demo-basic/src/page/controllerBoundary/controller.tsx +2 -2
  51. package/zova/src/suite/a-training/modules/training-student/src/bean/tableCell.actionDeleteForce.tsx +4 -4
  52. package/zova/src/suite/a-training/modules/training-student/src/bean/tableCell.actionSummary.tsx +4 -4
  53. package/zova/src/suite/cabloy-basic/modules/basic-app/src/monkey.ts +11 -0
  54. package/zova/src/suite/cabloy-basic/modules/basic-app/src/types/appModal.ts +1 -0
  55. package/zova/src/suite/cabloy-basic/modules/basic-app/test/lib/routedDialogContext.test.ts +60 -0
  56. package/zova/src/suite/cabloy-basic/modules/basic-details/src/bean/tableCell.actionUpdate.tsx +4 -4
  57. package/zova/src/suite/cabloy-basic/modules/basic-details/src/component/actionCreate/controller.tsx +4 -4
  58. package/zova/src/suite/cabloy-basic/modules/basic-metrics/src/page/dashboard/controller.tsx +8 -2
  59. package/zova/src/suite/cabloy-basic/modules/basic-table/src/bean/tableCell.actionUpdate.tsx +4 -4
  60. package/zova/src/suite/cabloy-basic/modules/basic-table/src/component/actionCreate/controller.tsx +4 -4
  61. package/zova/src/suite/cabloy-basic/modules/basic-table/src/component/actionDeleteBulk/controller.tsx +4 -4
  62. package/zova/src/suite-vendor/a-pay/modules/a-pay/package.json +1 -1
  63. package/zova/src/suite-vendor/a-pay/modules/a-pay/src/component/paymentNextAction/controller.tsx +6 -5
  64. package/zova/src/suite-vendor/a-pay/package.json +2 -2
  65. package/zova/src/suite-vendor/a-zova/modules/a-router/package.json +1 -1
  66. package/zova/src/suite-vendor/a-zova/modules/a-router/src/monkey.ts +17 -3
  67. package/zova/src/suite-vendor/a-zova/modules/a-zova/package.json +1 -2
  68. package/zova/src/suite-vendor/a-zova/package.json +3 -4
  69. package/zova/pnpm-lock.yaml +0 -15375
  70. package/zova/src/suite-vendor/a-zova/modules/a-boundary/LICENSE +0 -21
  71. package/zova/src/suite-vendor/a-zova/modules/a-boundary/package.json +0 -52
  72. package/zova/src/suite-vendor/a-zova/modules/a-boundary/src/.metadata/index.ts +0 -26
  73. package/zova/src/suite-vendor/a-zova/modules/a-boundary/src/.metadata/this.ts +0 -2
  74. package/zova/src/suite-vendor/a-zova/modules/a-boundary/src/index.ts +0 -1
  75. package/zova/src/suite-vendor/a-zova/modules/a-boundary/tsconfig.build.json +0 -13
  76. package/zova/src/suite-vendor/a-zova/modules/a-boundary/tsconfig.json +0 -5
@@ -9,6 +9,7 @@ import { BeanControllerBase, Use } from 'zova';
9
9
  import { Controller } from 'zova-module-a-bean';
10
10
  import { TypeFormOnSubmitData } from 'zova-module-a-form';
11
11
  import { IIconRecord } from 'zova-module-a-icon';
12
+ import { ZButton } from 'zova-module-basic-button';
12
13
 
13
14
  import { ServiceDetail } from '../../service/detail.jsx';
14
15
  import { IDialogFormOptions } from '../../types/dialogForm.js';
@@ -33,10 +34,9 @@ export class ControllerActionCreate extends BeanControllerBase {
33
34
 
34
35
  protected render() {
35
36
  return (
36
- <button
37
+ <ZButton
37
38
  class={this.$props.class}
38
- type="button"
39
- onClick={async () => {
39
+ onPerform={async () => {
40
40
  const { $$details } = this.$$renderContext;
41
41
  const serverDetail = await this.bean._newBean(ServiceDetail, true, {
42
42
  locale: this.scope.locale,
@@ -60,7 +60,7 @@ export class ControllerActionCreate extends BeanControllerBase {
60
60
  }}
61
61
  >
62
62
  {this.scope.locale.AddDetail()}
63
- </button>
63
+ </ZButton>
64
64
  );
65
65
  }
66
66
  }
@@ -1,6 +1,7 @@
1
1
  import { BeanControllerPageBase, Use } from 'zova';
2
2
  import { Controller } from 'zova-module-a-bean';
3
3
  import { $QueryEnsureLoaded } from 'zova-module-a-model';
4
+ import { ZButton } from 'zova-module-basic-button';
4
5
 
5
6
  import { ModelMetrics } from '../../model/metrics.js';
6
7
 
@@ -24,9 +25,14 @@ export class ControllerPageDashboard extends BeanControllerPageBase {
24
25
  <main class="p-6">
25
26
  <div class="flex flex-wrap items-center justify-between gap-3">
26
27
  <h1 class="text-2xl font-semibold">Metrics</h1>
27
- <button class="btn btn-sm" onClick={() => this.querySnapshot.refetch()}>
28
+ <ZButton
29
+ class="btn btn-sm"
30
+ onPerform={async () => {
31
+ await this.querySnapshot.refetch({ throwOnError: true });
32
+ }}
33
+ >
28
34
  Refresh
29
- </button>
35
+ </ZButton>
30
36
  </div>
31
37
  {!snapshot.enabled ? (
32
38
  <div class="alert mt-6">Metrics collection is disabled.</div>
@@ -8,6 +8,7 @@ import type {
8
8
  import { BeanBase } from 'zova';
9
9
  import { ZIcon } from 'zova-module-a-icon';
10
10
  import { TableCell } from 'zova-module-a-table';
11
+ import { ZButton } from 'zova-module-basic-button';
11
12
 
12
13
  declare module 'zova-module-a-openapi' {
13
14
  export interface IResourceTableActionRowRecord {
@@ -28,15 +29,14 @@ export class TableCellActionUpdate extends BeanBase implements ITableCellRender
28
29
  ) {
29
30
  const { $host } = renderContext;
30
31
  return (
31
- <button
32
+ <ZButton
32
33
  class={options.class}
33
- type="button"
34
- onClick={async () => {
34
+ onPerform={async () => {
35
35
  await $host.$performCommand('basic-commands:edit', options, renderContext);
36
36
  }}
37
37
  >
38
38
  <ZIcon name="::draft" width={24}></ZIcon>
39
- </button>
39
+ </ZButton>
40
40
  );
41
41
  }
42
42
  }
@@ -6,6 +6,7 @@ import type {
6
6
 
7
7
  import { BeanControllerBase, Use } from 'zova';
8
8
  import { Controller } from 'zova-module-a-bean';
9
+ import { ZButton } from 'zova-module-basic-button';
9
10
 
10
11
  declare module 'zova-module-a-openapi' {
11
12
  export interface IResourceTableActionBulkRecord {
@@ -28,17 +29,16 @@ export class ControllerActionCreate extends BeanControllerBase {
28
29
  protected render() {
29
30
  const disabled = this.$props.disabled === true || this.$props.dynamicDisabled === true;
30
31
  return (
31
- <button
32
+ <ZButton
32
33
  class={this.$props.class}
33
- type="button"
34
34
  disabled={disabled}
35
- onClick={async () => {
35
+ onPerform={async () => {
36
36
  if (disabled) return;
37
37
  await this.$performCommand('basic-commands:create', this.$props, this.$$renderContext);
38
38
  }}
39
39
  >
40
40
  {this.scope.locale.Create()}
41
- </button>
41
+ </ZButton>
42
42
  );
43
43
  }
44
44
  }
@@ -6,6 +6,7 @@ import type {
6
6
 
7
7
  import { BeanControllerBase, Use } from 'zova';
8
8
  import { Controller } from 'zova-module-a-bean';
9
+ import { ZButton } from 'zova-module-basic-button';
9
10
 
10
11
  declare module 'zova-module-a-openapi' {
11
12
  export interface IResourceTableActionBulkRecord {
@@ -27,13 +28,12 @@ export class ControllerActionDeleteBulk extends BeanControllerBase {
27
28
  const { dynamicDisabledReason, dynamicSelection } = this.$props;
28
29
  const disabled = this.$props.disabled === true || this.$props.dynamicDisabled === true;
29
30
  return (
30
- <button
31
+ <ZButton
31
32
  class={this.$props.class}
32
- type="button"
33
33
  disabled={disabled}
34
34
  title={dynamicDisabledReason}
35
35
  aria-description={dynamicDisabledReason}
36
- onClick={async () => {
36
+ onPerform={async () => {
37
37
  if (disabled) return;
38
38
  const confirmed = await this.$performCommand(
39
39
  'basic-commands:confirm',
@@ -51,7 +51,7 @@ export class ControllerActionDeleteBulk extends BeanControllerBase {
51
51
  }}
52
52
  >
53
53
  {this.scope.locale.DeleteBulk() as string}
54
- </button>
54
+ </ZButton>
55
55
  );
56
56
  }
57
57
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zova-module-a-pay",
3
- "version": "5.0.7",
3
+ "version": "5.0.8",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "Zova Module"
@@ -1,5 +1,6 @@
1
1
  import { BeanControllerBase, Use } from 'zova';
2
2
  import { Controller } from 'zova-module-a-bean';
3
+ import { ZButton } from 'zova-module-basic-button';
3
4
 
4
5
  import type { TypePaymentNextAction } from '../../types/payment.js';
5
6
 
@@ -49,13 +50,13 @@ export class ControllerPaymentNextAction extends BeanControllerBase {
49
50
  return (
50
51
  <div class="mt-6 space-y-3">
51
52
  <p class="text-base-content/70">{continueToPaymentHelpText}</p>
52
- <button
53
+ <ZButton
53
54
  class="btn btn-primary"
54
55
  disabled={disabled}
55
- onClick={() => this.continueRedirect()}
56
+ onPerform={() => this.continueRedirect()}
56
57
  >
57
58
  {continueToPaymentText}
58
- </button>
59
+ </ZButton>
59
60
  </div>
60
61
  );
61
62
  }
@@ -68,9 +69,9 @@ export class ControllerPaymentNextAction extends BeanControllerBase {
68
69
  : paymentPreparingText}
69
70
  </p>
70
71
  {onRefresh && (
71
- <button class="btn btn-outline" disabled={disabled} onClick={() => onRefresh()}>
72
+ <ZButton class="btn btn-outline" disabled={disabled} onPerform={() => onRefresh()}>
72
73
  {refreshPaymentStatusText}
73
- </button>
74
+ </ZButton>
74
75
  )}
75
76
  </div>
76
77
  );
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "zova-suite-a-pay",
3
- "version": "5.0.6",
3
+ "version": "5.0.7",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "files": [],
7
7
  "type": "module",
8
8
  "dependencies": {
9
- "zova-module-a-pay": "^5.0.7",
9
+ "zova-module-a-pay": "^5.0.8",
10
10
  "zova-module-pay-mock": "^5.0.5",
11
11
  "zova-module-pay-paypal": "^5.0.2",
12
12
  "zova-module-pay-stripe": "^5.0.2"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zova-module-a-router",
3
- "version": "5.1.38",
3
+ "version": "5.1.39",
4
4
  "gitHead": "09d901d17140a80ee0764211b441cda72fd94663",
5
5
  "description": "router",
6
6
  "keywords": [
@@ -190,8 +190,6 @@ export class Monkey
190
190
  // check if changed
191
191
  const changed = !controller.$route || controller.$route.fullPath !== route.fullPath;
192
192
  if (!changed) return;
193
- controller.$route = route;
194
- controller.$routeMatched = routeMatched;
195
193
  // update $params/$query
196
194
  const routeName = getRealRouteName(routeMatched.name);
197
195
  const schemaKey = routeName || String(routeMatched.path);
@@ -205,7 +203,23 @@ export class Monkey
205
203
  // do nothing
206
204
  return;
207
205
  }
208
- const module = this.app.meta.module.get(moduleInfo.relativeName)!;
206
+ const module = this.app.meta.module.get(moduleInfo.relativeName, false);
207
+ if (!module) {
208
+ void this.app.meta.module
209
+ .use(moduleInfo.relativeName)
210
+ .then(() => {
211
+ if (cast(controller).ctx.disposed) return;
212
+ const currentRoute = getPageRoute(cast<ZovaContext>(cast(controller).ctx));
213
+ if (!currentRoute || currentRoute.fullPath !== route.fullPath) return;
214
+ this._initControllerRoute(currentRoute, controller);
215
+ })
216
+ .catch(err => {
217
+ console.error('failed to load route module', moduleInfo.relativeName, err);
218
+ });
219
+ return;
220
+ }
221
+ controller.$route = route;
222
+ controller.$routeMatched = routeMatched;
209
223
  if (routeName) {
210
224
  schemas = module.resource.pageNameSchemas?.[schemaKey];
211
225
  } else {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zova-module-a-zova",
3
- "version": "5.1.105",
3
+ "version": "5.1.106",
4
4
  "gitHead": "2c5c19284bab738e492856189acb6fad74b8a7b7",
5
5
  "description": "zova",
6
6
  "keywords": [
@@ -70,7 +70,6 @@
70
70
  "a-app": "5.0.0",
71
71
  "a-bean": "5.0.0",
72
72
  "a-behavior": "5.0.0",
73
- "a-boundary": "5.0.0",
74
73
  "a-fetch": "5.0.0",
75
74
  "a-form": "5.0.0",
76
75
  "a-icon": "5.0.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zova-suite-a-zova",
3
- "version": "5.1.162",
3
+ "version": "5.1.163",
4
4
  "gitHead": "2c5c19284bab738e492856189acb6fad74b8a7b7",
5
5
  "description": "zova",
6
6
  "license": "MIT",
@@ -13,7 +13,6 @@
13
13
  "zova-module-a-bean": "^5.1.36",
14
14
  "zova-module-a-behavior": "^5.1.26",
15
15
  "zova-module-a-behaviors": "^5.1.22",
16
- "zova-module-a-boundary": "^5.1.22",
17
16
  "zova-module-a-command": "^5.1.35",
18
17
  "zova-module-a-fetch": "^5.1.25",
19
18
  "zova-module-a-form": "^5.1.51",
@@ -23,7 +22,7 @@
23
22
  "zova-module-a-meta": "^5.1.22",
24
23
  "zova-module-a-model": "^5.1.37",
25
24
  "zova-module-a-openapi": "^5.1.54",
26
- "zova-module-a-router": "^5.1.38",
25
+ "zova-module-a-router": "^5.1.39",
27
26
  "zova-module-a-routerstack": "^5.1.29",
28
27
  "zova-module-a-routertabs": "^5.1.34",
29
28
  "zova-module-a-ssr": "^5.1.40",
@@ -32,7 +31,7 @@
32
31
  "zova-module-a-style": "^5.1.35",
33
32
  "zova-module-a-table": "^5.1.43",
34
33
  "zova-module-a-zod": "^5.1.37",
35
- "zova-module-a-zova": "^5.1.105"
34
+ "zova-module-a-zova": "^5.1.106"
36
35
  },
37
36
  "title": "a-zova"
38
37
  }