cabloy 5.1.64 → 5.1.66
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/CHANGELOG.md +50 -0
- package/cabloy-docs/.vitepress/config.mjs +1 -1
- package/cabloy-docs/backend/crud-workflow.md +33 -0
- package/cabloy-docs/backend/master-detail-workflow.md +149 -0
- package/cabloy-docs/frontend/bean-scene-authoring.md +1 -1
- package/cabloy-docs/frontend/cli.md +12 -1
- package/cabloy-docs/frontend/command-scene-authoring.md +12 -1
- package/cabloy-docs/frontend/component-guide.md +10 -0
- package/cabloy-docs/frontend/permission-formscene-action-visibility-guide.md +69 -7
- package/cabloy-docs/frontend/table-cell-cookbook.md +10 -0
- package/cabloy-docs/fullstack/backend-metadata-to-frontend-table-actions.md +83 -2
- package/cabloy-docs/reference/bean-scene-boilerplates.md +9 -4
- package/package.json +1 -1
- package/vona/packages-cli/cabloy-cli/package.json +1 -1
- package/vona/packages-cli/cabloy-cli/src/lib/local.helper.ts +38 -0
- package/vona/packages-cli/cli/package.json +1 -1
- package/vona/packages-cli/cli-set-api/cli/templates/tools/masterDetail/boilerplate/dto/<%=argv.detailDtoBaseName%>.tsx_ +18 -0
- package/vona/packages-cli/cli-set-api/cli/templates/tools/masterDetail/boilerplate/dto/<%=argv.detailDtoMutateName%>.tsx_ +17 -0
- package/vona/packages-cli/cli-set-api/cli/templates/tools/masterDetail/boilerplate/dto/<%=argv.detailDtoResItemName%>.tsx_ +60 -0
- package/vona/packages-cli/cli-set-api/cli/templates/tools/masterDetail/boilerplate/dto/<%=argv.detailDtoViewName%>.tsx_ +17 -0
- package/vona/packages-cli/cli-set-api/package.json +1 -1
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.create.bean.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.create.module.ts +3 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.create.suite.ts +1 -1
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.create.test.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.asset.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.config.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.constant.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.error.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.lib.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.locale.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.main.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.monkey.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.static.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.init.types.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.tools.crud.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.tools.crudBasic.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.tools.crudStart.ts +2 -6
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.tools.masterDetail.ts +699 -0
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.tools.metadata.ts +1 -2
- package/vona/packages-cli/cli-set-api/src/lib/beans.ts +2 -0
- package/vona/packages-cli/cli-set-api/src/lib/command/tools.masterDetail.ts +78 -0
- package/vona/packages-cli/cli-set-api/src/lib/commands.ts +2 -0
- package/vona/packages-vona/vona/package.json +1 -1
- package/vona/packages-vona/vona-core/package.json +1 -1
- package/vona/packages-vona/vona-core/src/lib/mappedClass/type.ts +1 -0
- package/vona/packages-vona/vona-core/src/lib/mappedClass/utils.ts +36 -14
- package/vona/packages-vona/vona-mock/package.json +1 -1
- package/vona/pnpm-lock.yaml +29 -11
- package/vona/src/suite/a-training/modules/training-record/src/entity/record.tsx +1 -7
- package/vona/src/suite/a-training/modules/training-student/src/config/locale/en-us.ts +3 -0
- package/vona/src/suite/a-training/modules/training-student/src/config/locale/zh-cn.ts +3 -0
- package/vona/src/suite/a-training/modules/training-student/src/dto/detailRecordBase.tsx +8 -2
- package/vona/src/suite/a-training/modules/training-student/src/dto/detailRecordMutate.tsx +1 -15
- package/vona/src/suite/a-training/modules/training-student/src/dto/detailRecordResItem.tsx +27 -8
- package/vona/src/suite/a-training/modules/training-student/src/dto/detailRecordView.tsx +1 -12
- package/vona/src/suite/a-training/modules/training-student/src/dto/studentCreate.tsx +6 -4
- package/vona/src/suite/a-training/modules/training-student/src/dto/studentSelectReq.tsx +3 -6
- package/vona/src/suite/a-training/modules/training-student/src/dto/studentSummary.tsx +1 -1
- package/vona/src/suite/a-training/modules/training-student/src/dto/studentUpdate.tsx +14 -1
- package/vona/src/suite/a-training/modules/training-student/src/dto/studentView.tsx +14 -1
- package/vona/src/suite/a-training/modules/training-student/src/entity/student.tsx +1 -5
- package/vona/src/suite/a-training/modules/training-student/src/service/student.ts +9 -4
- package/vona/src/suite-vendor/a-vona/modules/a-core/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-openapiutils/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-openapiutils/src/lib/const/decorator.ts +3 -1
- package/vona/src/suite-vendor/a-vona/modules/a-openapiutils/src/lib/schema/makeSchemaLikes.ts +21 -17
- package/vona/src/suite-vendor/a-vona/modules/a-openapiutils/src/lib/utils.ts +44 -2
- package/vona/src/suite-vendor/a-vona/modules/a-orm/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/dto/dtoGet.ts +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/dto/dtoMutate.ts +8 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/service/relations_.ts +32 -16
- package/vona/src/suite-vendor/a-vona/modules/a-web/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-web/src/lib/decorator/bean.ts +26 -5
- package/vona/src/suite-vendor/a-vona/package.json +1 -1
- package/zova/packages-cli/cli/package.json +3 -3
- package/zova/packages-cli/cli-set-front/cli/templates/create/component/boilerplateDetailsActionBulk/controller.tsx_ +31 -0
- package/zova/packages-cli/cli-set-front/cli/templates/rest/component.ts +24 -2
- package/zova/packages-cli/cli-set-front/cli/templates/rest/render.ts +4 -0
- package/zova/packages-cli/cli-set-front/package.json +2 -2
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.create.bean.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.create.mock.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.create.module.ts +3 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.create.suite.ts +1 -1
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.init.asset.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.init.config.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.init.constant.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.init.error.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.init.icon.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.init.lib.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.init.locale.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.init.main.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.init.mainSys.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.init.monkey.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.init.monkeySys.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.init.types.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.openapi.config.ts +1 -4
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.openapi.generate.ts +2 -2
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.refactor.anotherRender.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.refactor.anotherStyle.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.refactor.componentEmits.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.refactor.componentGeneric.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.refactor.componentModel.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.refactor.componentProps.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.refactor.componentSlots.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.refactor.firstRender.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.refactor.firstStyle.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.refactor.pageParams.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.refactor.pageQuery.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.refactor.renameComponent.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/bean/cli.tools.metadata.ts +1 -2
- package/zova/packages-cli/cli-set-front/src/lib/common/cliCreateComponent.ts +2 -6
- package/zova/packages-cli/cli-set-front/src/lib/common/cliCreatePage.ts +2 -6
- package/zova/packages-zova/zova/package.json +2 -2
- package/zova/pnpm-lock.yaml +744 -884
- package/zova/src/suite/a-training/modules/training-student/package.json +2 -1
- package/zova/src/suite/cabloy-basic/modules/basic-app/src/bean/behavior.appModal.tsx +131 -13
- package/zova/src/suite/cabloy-basic/modules/basic-app/src/config/config.ts +15 -0
- package/zova/src/suite/cabloy-basic/modules/basic-app/src/service/appModal.ts +23 -5
- package/zova/src/suite/cabloy-basic/modules/basic-app/src/types/appModal.ts +30 -4
- package/zova/src/suite/cabloy-basic/modules/basic-details/package.json +6 -1
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/.metadata/component/blockForm.ts +31 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/.metadata/component/blockTable.ts +31 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/.metadata/component/blockToolbarBulk.ts +31 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/.metadata/index.ts +204 -9
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/bean/command.delete.tsx +47 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/bean/tableCell.actionDelete.tsx +52 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/bean/tableCell.actionOperationsRow.tsx +72 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/bean/tableCell.actionUpdate.tsx +73 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/bean/tableCell.actionView.tsx +64 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/bean/tableCell.lineNumber.tsx +30 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/component/actionCreate/controller.tsx +31 -7
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/component/blockDetails/controller.tsx +28 -12
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/component/blockForm/controller.tsx +53 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/component/blockTable/controller.tsx +49 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/component/{blockDetailsToolbarBulk → blockToolbarBulk}/controller.tsx +6 -4
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/component/formFieldDetails/controller.tsx +24 -12
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/config/locale/en-us.ts +5 -1
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/config/locale/zh-cn.ts +5 -1
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/index.ts +1 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/lib/index.ts +1 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/lib/utils.ts +12 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/service/detail.tsx +172 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/types/detail.ts +18 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/types/details.ts +11 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/types/dialogForm.ts +22 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/types/index.ts +2 -0
- package/zova/src/suite-vendor/a-cabloy/modules/rest-resource/package.json +1 -1
- package/zova/src/suite-vendor/a-cabloy/modules/rest-resource/src/page/entry/controller.tsx +1 -2
- package/zova/src/suite-vendor/a-cabloy/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-command/cli/command/boilerplate/{{sceneName}}.{{beanName}}.tsx_ +6 -1
- package/zova/src/suite-vendor/a-zova/modules/a-command/cli/commandBulk/boilerplate/{{sceneName}}.{{beanName}}.tsx_ +6 -1
- package/zova/src/suite-vendor/a-zova/modules/a-command/cli/commandDetailsRow/boilerplate/{{sceneName}}.{{beanName}}.tsx_ +20 -0
- package/zova/src/suite-vendor/a-zova/modules/a-command/cli/commandRow/boilerplate/{{sceneName}}.{{beanName}}.tsx_ +6 -1
- package/zova/src/suite-vendor/a-zova/modules/a-command/package.json +3 -2
- package/zova/src/suite-vendor/a-zova/modules/a-command/src/types/command.ts +2 -0
- package/zova/src/suite-vendor/a-zova/modules/a-form/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-form/src/component/form/controller.tsx +1 -0
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/lib/schema.ts +20 -4
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/action.ts +2 -1
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/detail/detail.ts +10 -0
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/detail/details.ts +4 -1
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/detail/detailsActionRow.ts +24 -0
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/detail/index.ts +2 -0
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/permissions.ts +4 -0
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/rest.ts +2 -0
- package/zova/src/suite-vendor/a-zova/modules/a-table/cli/detailsActionRow/boilerplate/{{sceneName}}.{{beanName}}.tsx_ +24 -0
- package/zova/src/suite-vendor/a-zova/modules/a-table/package.json +3 -2
- package/zova/src/suite-vendor/a-zova/modules/a-table/src/component/table/controller.tsx +5 -3
- package/zova/src/suite-vendor/a-zova/modules/a-zova/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/package.json +6 -6
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/.metadata/component/blockDetailsToolbarBulk.ts +0 -31
|
@@ -149,11 +149,30 @@ export class LocalHelper {
|
|
|
149
149
|
return moduleInfo;
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
+
parseModuleInfoCanonical(moduleName, moduleRole = 'module') {
|
|
153
|
+
const moduleInfo = this.parseModuleInfo(moduleName);
|
|
154
|
+
if (moduleInfo.relativeName !== moduleName) {
|
|
155
|
+
throw new Error(
|
|
156
|
+
`${moduleRole} name must use the canonical relative module name: ${moduleInfo.relativeName}. Received: ${moduleName}. Use names like training-student, not package names or extra-suffixed names.`,
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
return moduleInfo;
|
|
160
|
+
}
|
|
161
|
+
|
|
152
162
|
findModule(moduleName) {
|
|
153
163
|
const moduleInfo = this.parseModuleInfo(moduleName);
|
|
154
164
|
return this.cli.modulesMeta.modules[moduleInfo.relativeName];
|
|
155
165
|
}
|
|
156
166
|
|
|
167
|
+
findModuleCanonical(moduleName, moduleRole = 'module') {
|
|
168
|
+
const moduleInfo = this.parseModuleInfoCanonical(moduleName, moduleRole);
|
|
169
|
+
const module = this.cli.modulesMeta.modules[moduleInfo.relativeName];
|
|
170
|
+
if (!module) {
|
|
171
|
+
throw new Error(`${moduleRole} does not exist: ${moduleName}`);
|
|
172
|
+
}
|
|
173
|
+
return module;
|
|
174
|
+
}
|
|
175
|
+
|
|
157
176
|
parseSuiteInfo(suiteName) {
|
|
158
177
|
const suiteInfo = ModuleInfo.parseInfoPro(
|
|
159
178
|
suiteName,
|
|
@@ -164,11 +183,30 @@ export class LocalHelper {
|
|
|
164
183
|
return suiteInfo;
|
|
165
184
|
}
|
|
166
185
|
|
|
186
|
+
parseSuiteInfoCanonical(suiteName, suiteRole = 'suite') {
|
|
187
|
+
const suiteInfo = this.parseSuiteInfo(suiteName);
|
|
188
|
+
if (suiteInfo.relativeName !== suiteName) {
|
|
189
|
+
throw new Error(
|
|
190
|
+
`${suiteRole} name must use the canonical relative suite name: ${suiteInfo.relativeName}. Received: ${suiteName}. Use names like a-training, not package names or extra-suffixed names.`,
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
return suiteInfo;
|
|
194
|
+
}
|
|
195
|
+
|
|
167
196
|
findSuite(suiteName) {
|
|
168
197
|
const suiteInfo = this.parseSuiteInfo(suiteName);
|
|
169
198
|
return this.cli.modulesMeta.suites[suiteInfo.relativeName];
|
|
170
199
|
}
|
|
171
200
|
|
|
201
|
+
findSuiteCanonical(suiteName, suiteRole = 'suite') {
|
|
202
|
+
const suiteInfo = this.parseSuiteInfoCanonical(suiteName, suiteRole);
|
|
203
|
+
const suite = this.cli.modulesMeta.suites[suiteInfo.relativeName];
|
|
204
|
+
if (!suite) {
|
|
205
|
+
throw new Error(`${suiteRole} does not exist: ${suiteName}`);
|
|
206
|
+
}
|
|
207
|
+
return suite;
|
|
208
|
+
}
|
|
209
|
+
|
|
172
210
|
async ensureDir(dir) {
|
|
173
211
|
await fse.ensureDir(dir);
|
|
174
212
|
return dir;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { IDecoratorDtoOptions } from 'vona-module-a-web';
|
|
2
|
+
|
|
3
|
+
import { $makeMetadata } from 'vona-module-a-openapiutils';
|
|
4
|
+
import { $Dto } from 'vona-module-a-orm';
|
|
5
|
+
import { Dto } from 'vona-module-a-web';
|
|
6
|
+
import { Model<%=argv.detailResourceNameCapitalize%> } from '<%=argv.detailPackageName%>';
|
|
7
|
+
import { ZovaRender } from 'zova-rest-cabloy-basic-admin';
|
|
8
|
+
|
|
9
|
+
export interface IDtoOptions<%=cli.helper.firstCharToUpperCase(argv.detailDtoBaseName)%> extends IDecoratorDtoOptions {}
|
|
10
|
+
|
|
11
|
+
@Dto<IDtoOptions<%=cli.helper.firstCharToUpperCase(argv.detailDtoBaseName)%>>({
|
|
12
|
+
fields: {
|
|
13
|
+
id: $makeMetadata(ZovaRender.visible(false)),
|
|
14
|
+
},
|
|
15
|
+
})
|
|
16
|
+
export class Dto<%=cli.helper.firstCharToUpperCase(argv.detailDtoBaseName)%> extends $Dto.get(() => Model<%=argv.detailResourceNameCapitalize%>, {
|
|
17
|
+
columns: ['id', 'deleted', 'name', 'description'],
|
|
18
|
+
}) {}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { IDecoratorDtoOptions } from 'vona-module-a-web';
|
|
2
|
+
|
|
3
|
+
import { $Dto } from 'vona-module-a-orm';
|
|
4
|
+
import { Dto } from 'vona-module-a-web';
|
|
5
|
+
import { Model<%=argv.detailResourceNameCapitalize%> } from '<%=argv.detailPackageName%>';
|
|
6
|
+
import { ZovaRender } from 'zova-rest-cabloy-basic-admin';
|
|
7
|
+
|
|
8
|
+
import { Dto<%=cli.helper.firstCharToUpperCase(argv.detailDtoBaseName)%> } from './<%=argv.detailDtoBaseName%>.tsx';
|
|
9
|
+
|
|
10
|
+
export interface IDtoOptions<%=cli.helper.firstCharToUpperCase(argv.detailDtoMutateName)%> extends IDecoratorDtoOptions {}
|
|
11
|
+
|
|
12
|
+
@Dto<IDtoOptions<%=cli.helper.firstCharToUpperCase(argv.detailDtoMutateName)%>>({
|
|
13
|
+
blocks: [ZovaRender.block('basic-details:blockForm')],
|
|
14
|
+
})
|
|
15
|
+
export class Dto<%=cli.helper.firstCharToUpperCase(argv.detailDtoMutateName)%> extends $Dto.mutate(() => Model<%=argv.detailResourceNameCapitalize%>, {
|
|
16
|
+
dtoClass: Dto<%=cli.helper.firstCharToUpperCase(argv.detailDtoBaseName)%>,
|
|
17
|
+
}) {}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { IDecoratorDtoOptions } from 'vona-module-a-web';
|
|
2
|
+
|
|
3
|
+
import { $makeMetadata, Api, v } from 'vona-module-a-openapiutils';
|
|
4
|
+
import { $Dto } from 'vona-module-a-orm';
|
|
5
|
+
import { Dto } from 'vona-module-a-web';
|
|
6
|
+
import { Model<%=argv.detailResourceNameCapitalize%> } from '<%=argv.detailPackageName%>';
|
|
7
|
+
import { ZovaRender } from 'zova-rest-cabloy-basic-admin';
|
|
8
|
+
|
|
9
|
+
import { $locale } from '../.metadata/locales.ts';
|
|
10
|
+
import { Dto<%=cli.helper.firstCharToUpperCase(argv.detailDtoBaseName)%> } from './<%=argv.detailDtoBaseName%>.tsx';
|
|
11
|
+
|
|
12
|
+
export interface IDtoOptions<%=cli.helper.firstCharToUpperCase(argv.detailDtoResItemName)%> extends IDecoratorDtoOptions {}
|
|
13
|
+
|
|
14
|
+
@Dto<IDtoOptions<%=cli.helper.firstCharToUpperCase(argv.detailDtoResItemName)%>>({
|
|
15
|
+
blocks: [
|
|
16
|
+
ZovaRender.block('basic-details:blockDetails', {
|
|
17
|
+
blocks: [
|
|
18
|
+
ZovaRender.block('basic-details:blockToolbarBulk', {
|
|
19
|
+
actions: [
|
|
20
|
+
ZovaRender.detailsActionBulk('basic-details:actionCreate', {
|
|
21
|
+
dialogOptions: { title: $locale('Add<%=argv.detailDialogTitleCapitalize%>') },
|
|
22
|
+
permission: { formScene: ['create', 'edit'] },
|
|
23
|
+
}),
|
|
24
|
+
],
|
|
25
|
+
}),
|
|
26
|
+
ZovaRender.block('basic-details:blockTable'),
|
|
27
|
+
],
|
|
28
|
+
}),
|
|
29
|
+
],
|
|
30
|
+
fields: {
|
|
31
|
+
name: $makeMetadata(
|
|
32
|
+
ZovaRender.cell('basic-details:actionView', {
|
|
33
|
+
dialogOptions: { title: $locale('View<%=argv.detailDialogTitleCapitalize%>') },
|
|
34
|
+
}),
|
|
35
|
+
),
|
|
36
|
+
},
|
|
37
|
+
})
|
|
38
|
+
export class Dto<%=cli.helper.firstCharToUpperCase(argv.detailDtoResItemName)%> extends $Dto.get(() => Model<%=argv.detailResourceNameCapitalize%>, {
|
|
39
|
+
dtoClass: Dto<%=cli.helper.firstCharToUpperCase(argv.detailDtoBaseName)%>,
|
|
40
|
+
}) {
|
|
41
|
+
@Api.field(v.title('#'), ZovaRender.order(1, 'core'), ZovaRender.cell('basic-details:lineNumber'))
|
|
42
|
+
_lineNumber?: number;
|
|
43
|
+
|
|
44
|
+
@Api.field(
|
|
45
|
+
v.title($locale('Operations')),
|
|
46
|
+
ZovaRender.order(1, 'max'),
|
|
47
|
+
ZovaRender.cell('basic-details:actionOperationsRow', {
|
|
48
|
+
actions: [
|
|
49
|
+
ZovaRender.detailsActionRow('basic-details:actionUpdate', {
|
|
50
|
+
dialogOptions: { title: $locale('Edit<%=argv.detailDialogTitleCapitalize%>') },
|
|
51
|
+
permission: { formScene: ['create', 'edit'] },
|
|
52
|
+
}),
|
|
53
|
+
ZovaRender.detailsActionRow('basic-details:actionDelete', {
|
|
54
|
+
permission: { formScene: ['create', 'edit'] },
|
|
55
|
+
}),
|
|
56
|
+
],
|
|
57
|
+
}),
|
|
58
|
+
)
|
|
59
|
+
_operationsRow?: unknown;
|
|
60
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { IDecoratorDtoOptions } from 'vona-module-a-web';
|
|
2
|
+
|
|
3
|
+
import { $Dto } from 'vona-module-a-orm';
|
|
4
|
+
import { Dto } from 'vona-module-a-web';
|
|
5
|
+
import { Model<%=argv.detailResourceNameCapitalize%> } from '<%=argv.detailPackageName%>';
|
|
6
|
+
import { ZovaRender } from 'zova-rest-cabloy-basic-admin';
|
|
7
|
+
|
|
8
|
+
import { Dto<%=cli.helper.firstCharToUpperCase(argv.detailDtoBaseName)%> } from './<%=argv.detailDtoBaseName%>.tsx';
|
|
9
|
+
|
|
10
|
+
export interface IDtoOptions<%=cli.helper.firstCharToUpperCase(argv.detailDtoViewName)%> extends IDecoratorDtoOptions {}
|
|
11
|
+
|
|
12
|
+
@Dto<IDtoOptions<%=cli.helper.firstCharToUpperCase(argv.detailDtoViewName)%>>({
|
|
13
|
+
blocks: [ZovaRender.block('basic-details:blockForm')],
|
|
14
|
+
})
|
|
15
|
+
export class Dto<%=cli.helper.firstCharToUpperCase(argv.detailDtoViewName)%> extends $Dto.get(() => Model<%=argv.detailResourceNameCapitalize%>, {
|
|
16
|
+
dtoClass: Dto<%=cli.helper.firstCharToUpperCase(argv.detailDtoBaseName)%>,
|
|
17
|
+
}) {}
|
|
@@ -60,12 +60,8 @@ export class CliCreateBean extends BeanCliBase {
|
|
|
60
60
|
: 'zova-rest-cabloy-basic-web';
|
|
61
61
|
// module name/info
|
|
62
62
|
const moduleName = argv.module;
|
|
63
|
-
argv.moduleInfo = this.helper.
|
|
64
|
-
|
|
65
|
-
const _module = this.helper.findModule(moduleName);
|
|
66
|
-
if (!_module) {
|
|
67
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
68
|
-
}
|
|
63
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
64
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
69
65
|
// target dir
|
|
70
66
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
71
67
|
// scene name
|
|
@@ -25,12 +25,9 @@ export class CliCreateModule extends BeanCliBase {
|
|
|
25
25
|
// suite name/info
|
|
26
26
|
const suiteName = argv.suite;
|
|
27
27
|
if (suiteName) {
|
|
28
|
-
argv.suiteInfo = this.helper.
|
|
28
|
+
argv.suiteInfo = this.helper.parseSuiteInfoCanonical(suiteName);
|
|
29
29
|
// check if exists
|
|
30
|
-
argv._suite = this.helper.
|
|
31
|
-
if (!argv._suite) {
|
|
32
|
-
throw new Error(`suite does not exist: ${suiteName}`);
|
|
33
|
-
}
|
|
30
|
+
argv._suite = this.helper.findSuiteCanonical(suiteName);
|
|
34
31
|
}
|
|
35
32
|
// nameMeta
|
|
36
33
|
const nameMeta = this.helper.parseNameMeta(argv.name);
|
|
@@ -38,7 +35,7 @@ export class CliCreateModule extends BeanCliBase {
|
|
|
38
35
|
argv.name = nameMeta.short;
|
|
39
36
|
// module name/info
|
|
40
37
|
const moduleName = argv.name;
|
|
41
|
-
argv.moduleInfo = this.helper.
|
|
38
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
42
39
|
argv.relativeNameCapitalize = this.helper.stringToCapitalize(argv.moduleInfo.relativeName, '-');
|
|
43
40
|
// check if exists
|
|
44
41
|
const _module = this.helper.findModule(moduleName);
|
|
@@ -24,7 +24,7 @@ export class CliCreateSuite extends BeanCliBase {
|
|
|
24
24
|
argv.name = nameMeta.short;
|
|
25
25
|
// suite name/info
|
|
26
26
|
const suiteName = argv.name;
|
|
27
|
-
argv.suiteInfo = this.helper.
|
|
27
|
+
argv.suiteInfo = this.helper.parseSuiteInfoCanonical(suiteName);
|
|
28
28
|
// check if exists
|
|
29
29
|
const _suite = this.helper.findSuite(suiteName);
|
|
30
30
|
if (_suite) {
|
|
@@ -24,12 +24,8 @@ export class CliCreateTest extends BeanCliBase {
|
|
|
24
24
|
await super.execute();
|
|
25
25
|
// module name/info
|
|
26
26
|
const moduleName = argv.module;
|
|
27
|
-
argv.moduleInfo = this.helper.
|
|
28
|
-
|
|
29
|
-
const _module = this.helper.findModule(moduleName);
|
|
30
|
-
if (!_module) {
|
|
31
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
32
|
-
}
|
|
27
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
28
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
33
29
|
// target dir
|
|
34
30
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
35
31
|
// name
|
|
@@ -19,12 +19,8 @@ export class CliInitAsset extends BeanCliBase {
|
|
|
19
19
|
await super.execute();
|
|
20
20
|
// module name/info
|
|
21
21
|
const moduleName = argv.module;
|
|
22
|
-
argv.moduleInfo = this.helper.
|
|
23
|
-
|
|
24
|
-
const _module = this.helper.findModule(moduleName);
|
|
25
|
-
if (!_module) {
|
|
26
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
27
|
-
}
|
|
22
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
23
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
28
24
|
// target dir
|
|
29
25
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
30
26
|
// scene
|
|
@@ -16,12 +16,8 @@ export class CliInitConfig extends BeanCliBase {
|
|
|
16
16
|
// module name/info
|
|
17
17
|
const moduleName = argv._[0];
|
|
18
18
|
if (!moduleName) return;
|
|
19
|
-
argv.moduleInfo = this.helper.
|
|
20
|
-
|
|
21
|
-
const _module = this.helper.findModule(moduleName);
|
|
22
|
-
if (!_module) {
|
|
23
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
24
|
-
}
|
|
19
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
20
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
25
21
|
// target dir
|
|
26
22
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
27
23
|
const configFile = path.join(targetDir, 'src/config/config.ts');
|
|
@@ -16,12 +16,8 @@ export class CliInitConstant extends BeanCliBase {
|
|
|
16
16
|
// module name/info
|
|
17
17
|
const moduleName = argv._[0];
|
|
18
18
|
if (!moduleName) return;
|
|
19
|
-
argv.moduleInfo = this.helper.
|
|
20
|
-
|
|
21
|
-
const _module = this.helper.findModule(moduleName);
|
|
22
|
-
if (!_module) {
|
|
23
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
24
|
-
}
|
|
19
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
20
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
25
21
|
// target dir
|
|
26
22
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
27
23
|
const constantFile = path.join(targetDir, 'src/config/constants.ts');
|
|
@@ -16,12 +16,8 @@ export class CliInitError extends BeanCliBase {
|
|
|
16
16
|
// module name/info
|
|
17
17
|
const moduleName = argv._[0];
|
|
18
18
|
if (!moduleName) return;
|
|
19
|
-
argv.moduleInfo = this.helper.
|
|
20
|
-
|
|
21
|
-
const _module = this.helper.findModule(moduleName);
|
|
22
|
-
if (!_module) {
|
|
23
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
24
|
-
}
|
|
19
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
20
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
25
21
|
// target dir
|
|
26
22
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
27
23
|
const errorFile = path.join(targetDir, 'src/config/errors.ts');
|
|
@@ -16,12 +16,8 @@ export class CliInitLib extends BeanCliBase {
|
|
|
16
16
|
// module name/info
|
|
17
17
|
const moduleName = argv._[0];
|
|
18
18
|
if (!moduleName) return;
|
|
19
|
-
argv.moduleInfo = this.helper.
|
|
20
|
-
|
|
21
|
-
const _module = this.helper.findModule(moduleName);
|
|
22
|
-
if (!_module) {
|
|
23
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
24
|
-
}
|
|
19
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
20
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
25
21
|
// target dir
|
|
26
22
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
27
23
|
const mainFile = path.join(targetDir, 'src/lib/index.ts');
|
|
@@ -16,12 +16,8 @@ export class CliInitLocale extends BeanCliBase {
|
|
|
16
16
|
// module name/info
|
|
17
17
|
const moduleName = argv._[0];
|
|
18
18
|
if (!moduleName) return;
|
|
19
|
-
argv.moduleInfo = this.helper.
|
|
20
|
-
|
|
21
|
-
const _module = this.helper.findModule(moduleName);
|
|
22
|
-
if (!_module) {
|
|
23
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
24
|
-
}
|
|
19
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
20
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
25
21
|
// target dir
|
|
26
22
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
27
23
|
const localeFile = path.join(targetDir, 'src/config/locale');
|
|
@@ -16,12 +16,8 @@ export class CliInitMain extends BeanCliBase {
|
|
|
16
16
|
// module name/info
|
|
17
17
|
const moduleName = argv._[0];
|
|
18
18
|
if (!moduleName) return;
|
|
19
|
-
argv.moduleInfo = this.helper.
|
|
20
|
-
|
|
21
|
-
const _module = this.helper.findModule(moduleName);
|
|
22
|
-
if (!_module) {
|
|
23
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
24
|
-
}
|
|
19
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
20
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
25
21
|
// target dir
|
|
26
22
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
27
23
|
const mainFile = path.join(targetDir, 'src/main.ts');
|
|
@@ -16,12 +16,8 @@ export class CliInitMonkey extends BeanCliBase {
|
|
|
16
16
|
// module name/info
|
|
17
17
|
const moduleName = argv._[0];
|
|
18
18
|
if (!moduleName) return;
|
|
19
|
-
argv.moduleInfo = this.helper.
|
|
20
|
-
|
|
21
|
-
const _module = this.helper.findModule(moduleName);
|
|
22
|
-
if (!_module) {
|
|
23
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
24
|
-
}
|
|
19
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
20
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
25
21
|
// target dir
|
|
26
22
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
27
23
|
const monkeyFile = path.join(targetDir, 'src/monkey.ts');
|
|
@@ -16,12 +16,8 @@ export class CliInitStatic extends BeanCliBase {
|
|
|
16
16
|
// module name/info
|
|
17
17
|
const moduleName = argv._[0];
|
|
18
18
|
if (!moduleName) return;
|
|
19
|
-
argv.moduleInfo = this.helper.
|
|
20
|
-
|
|
21
|
-
const _module = this.helper.findModule(moduleName);
|
|
22
|
-
if (!_module) {
|
|
23
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
24
|
-
}
|
|
19
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
20
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
25
21
|
// target dir
|
|
26
22
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
27
23
|
const staticDir = path.join(targetDir, 'assets/static');
|
|
@@ -16,12 +16,8 @@ export class CliInitTypes extends BeanCliBase {
|
|
|
16
16
|
// module name/info
|
|
17
17
|
const moduleName = argv._[0];
|
|
18
18
|
if (!moduleName) return;
|
|
19
|
-
argv.moduleInfo = this.helper.
|
|
20
|
-
|
|
21
|
-
const _module = this.helper.findModule(moduleName);
|
|
22
|
-
if (!_module) {
|
|
23
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
24
|
-
}
|
|
19
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
20
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
25
21
|
// target dir
|
|
26
22
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
27
23
|
const mainFile = path.join(targetDir, 'src/types/index.ts');
|
|
@@ -34,12 +34,8 @@ export class CliToolsCrud extends BeanCliBase {
|
|
|
34
34
|
: 'basic-siteadmin:management';
|
|
35
35
|
// module name/info
|
|
36
36
|
const moduleName = argv.module;
|
|
37
|
-
argv.moduleInfo = this.helper.
|
|
38
|
-
|
|
39
|
-
const _module = this.helper.findModule(moduleName);
|
|
40
|
-
if (!_module) {
|
|
41
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
42
|
-
}
|
|
37
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
38
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
43
39
|
// target dir
|
|
44
40
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
45
41
|
// resourceName
|
|
@@ -25,12 +25,8 @@ export class CliToolsCrudBasic extends BeanCliBase {
|
|
|
25
25
|
await super.execute();
|
|
26
26
|
// module name/info
|
|
27
27
|
const moduleName = argv.module;
|
|
28
|
-
argv.moduleInfo = this.helper.
|
|
29
|
-
|
|
30
|
-
const _module = this.helper.findModule(moduleName);
|
|
31
|
-
if (!_module) {
|
|
32
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
33
|
-
}
|
|
28
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
29
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
34
30
|
// target dir
|
|
35
31
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
36
32
|
// resourceName
|
|
@@ -25,12 +25,8 @@ export class CliToolsCrudStart extends BeanCliBase {
|
|
|
25
25
|
await super.execute();
|
|
26
26
|
// module name/info
|
|
27
27
|
const moduleName = argv.module;
|
|
28
|
-
argv.moduleInfo = this.helper.
|
|
29
|
-
|
|
30
|
-
const _module = this.helper.findModule(moduleName);
|
|
31
|
-
if (!_module) {
|
|
32
|
-
throw new Error(`module does not exist: ${moduleName}`);
|
|
33
|
-
}
|
|
28
|
+
argv.moduleInfo = this.helper.parseModuleInfoCanonical(moduleName);
|
|
29
|
+
const _module = this.helper.findModuleCanonical(moduleName);
|
|
34
30
|
// target dir
|
|
35
31
|
const targetDir = await this.helper.ensureDir(_module.root);
|
|
36
32
|
// resourceName
|