cabloy 5.1.65 → 5.1.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/skills/cabloy-resource-field-update/SKILL.md +6 -0
- package/CHANGELOG.md +55 -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/create/module/boilerplate/_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 +2 -2
- 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 +35 -11
- package/vona/src/suite/a-demo/modules/demo-basic/package.json +1 -1
- package/vona/src/suite/a-home/modules/home-base/package.json +1 -1
- package/vona/src/suite/a-home/modules/home-index/package.json +1 -1
- package/vona/src/suite/a-home/modules/home-user/package.json +1 -1
- package/vona/src/suite/a-training/modules/training-record/package.json +1 -1
- package/vona/src/suite/a-training/modules/training-record/src/.metadata/index.ts +232 -3
- package/vona/src/suite/a-training/modules/training-record/src/bean/ssrMenu.record.ts +29 -0
- package/vona/src/suite/a-training/modules/training-record/src/config/locale/en-us.ts +9 -1
- package/vona/src/suite/a-training/modules/training-record/src/config/locale/zh-cn.ts +9 -1
- package/vona/src/suite/a-training/modules/training-record/src/controller/record.ts +59 -0
- package/vona/src/suite/a-training/modules/training-record/src/dto/detailRecordSubjectBase.tsx +18 -0
- package/vona/src/suite/a-training/modules/training-record/src/dto/detailRecordSubjectMutate.tsx +17 -0
- package/vona/src/suite/a-training/modules/training-record/src/dto/detailRecordSubjectResItem.tsx +60 -0
- package/vona/src/suite/a-training/modules/training-record/src/dto/detailRecordSubjectView.tsx +17 -0
- package/vona/src/suite/a-training/modules/training-record/src/dto/recordCreate.tsx +45 -0
- package/vona/src/suite/a-training/modules/training-record/src/dto/recordSelectReq.tsx +38 -0
- package/vona/src/suite/a-training/modules/training-record/src/dto/recordSelectRes.tsx +11 -0
- package/vona/src/suite/a-training/modules/training-record/src/dto/recordSelectResItem.tsx +39 -0
- package/vona/src/suite/a-training/modules/training-record/src/dto/recordUpdate.tsx +45 -0
- package/vona/src/suite/a-training/modules/training-record/src/dto/recordView.tsx +42 -0
- package/vona/src/suite/a-training/modules/training-record/src/entity/record.tsx +23 -6
- package/vona/src/suite/a-training/modules/training-record/src/model/record.ts +15 -2
- package/vona/src/suite/a-training/modules/training-record/src/service/record.ts +50 -0
- package/vona/src/suite/a-training/modules/training-record/test/record.test.ts +138 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/package.json +53 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/src/.metadata/index.ts +198 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/src/.metadata/locales.ts +18 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/src/.metadata/this.ts +2 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/src/bean/meta.index.ts +12 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/src/bean/meta.version.ts +21 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/src/config/locale/en-us.ts +9 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/src/config/locale/zh-cn.ts +9 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/src/entity/subject.tsx +42 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/src/index.ts +2 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/src/model/subject.ts +10 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/tsconfig.build.json +11 -0
- package/vona/src/suite/a-training/modules/training-recordsubject/tsconfig.json +7 -0
- package/vona/src/suite/a-training/modules/training-student/package.json +1 -1
- package/vona/src/suite/a-training/modules/training-student/src/config/locale/en-us.ts +8 -1
- package/vona/src/suite/a-training/modules/training-student/src/config/locale/zh-cn.ts +8 -1
- package/vona/src/suite/a-training/modules/training-student/src/dto/detailRecordBase.tsx +17 -2
- package/vona/src/suite/a-training/modules/training-student/src/dto/detailRecordMutate.tsx +12 -17
- package/vona/src/suite/a-training/modules/training-student/src/dto/detailRecordResItem.tsx +26 -5
- package/vona/src/suite/a-training/modules/training-student/src/dto/detailRecordView.tsx +12 -14
- 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 +2 -4
- package/vona/src/suite/a-training/modules/training-student/src/service/student.ts +22 -5
- package/vona/src/suite/a-training/modules/training-student/test/student.test.ts +69 -15
- package/vona/src/suite/a-training/package.json +1 -0
- package/vona/src/suite/a-training/tsconfig.json +3 -0
- package/vona/src/suite/cabloy-basic/modules/basic-siteadmin/package.json +1 -1
- package/vona/src/suite/cabloy-basic/modules/basic-siteweb/package.json +1 -1
- package/vona/src/suite-vendor/a-auth/modules/a-auth/package.json +2 -2
- package/vona/src/suite-vendor/a-auth/modules/auth-oauth/package.json +2 -2
- package/vona/src/suite-vendor/a-auth/modules/auth-simple/package.json +2 -2
- package/vona/src/suite-vendor/a-auth/package.json +2 -2
- package/vona/src/suite-vendor/a-cabloy/modules/a-cabloy/package.json +2 -2
- package/vona/src/suite-vendor/a-cabloy/modules/a-datasharding/package.json +2 -2
- package/vona/src/suite-vendor/a-cabloy/modules/a-datasource/package.json +2 -2
- package/vona/src/suite-vendor/a-cabloy/modules/a-socket/package.json +2 -2
- package/vona/src/suite-vendor/a-cabloy/modules/a-ssr/package.json +2 -2
- package/vona/src/suite-vendor/a-cabloy/modules/a-ssrhmr/package.json +2 -2
- package/vona/src/suite-vendor/a-cabloy/modules/a-status/package.json +2 -2
- package/vona/src/suite-vendor/a-cabloy/package.json +1 -1
- package/vona/src/suite-vendor/a-captcha/modules/a-captcha/package.json +2 -2
- package/vona/src/suite-vendor/a-captcha/modules/captcha-simple/package.json +2 -2
- package/vona/src/suite-vendor/a-captcha/package.json +1 -1
- package/vona/src/suite-vendor/a-paypal/modules/a-paypal/package.json +2 -2
- package/vona/src/suite-vendor/a-paypal/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-aspect/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-aspectutils/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-bean/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-beanmutate/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-body/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-broadcast/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-cache/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-caching/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-core/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-election/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-error/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-event/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-executor/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-hmr/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-hmrbase/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-index/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-instance/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-jwt/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-locale/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-logger/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-mail/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-mailconfirm/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-menu/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-meta/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-onion/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-openapi/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-openapischema/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-openapiutils/package.json +2 -2
- 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 +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/dto/dtoGet.ts +6 -2
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/dto/dtoMutate.ts +13 -4
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/utils.ts +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/service/relations_.ts +37 -16
- package/vona/src/suite-vendor/a-vona/modules/a-ormdialect/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-ormutils/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-permission/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-play/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-printtip/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-queue/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-redis/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-redlock/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-runtime/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-schedule/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-security/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-serialization/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-startup/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-static/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-summer/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-swagger/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-upload/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-user/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-validation/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-version/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-vona/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-web/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-web/src/lib/decorator/bean.ts +26 -5
- package/vona/src/suite-vendor/a-vona/modules/a-worker/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-zod/package.json +2 -2
- 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/create/module/boilerplate/_package.json +1 -1
- package/zova/packages-cli/cli-set-front/cli/templates/rest/component.ts +21 -0
- package/zova/packages-cli/cli-set-front/cli/templates/rest/render.ts +4 -0
- package/zova/packages-cli/cli-set-front/package.json +3 -3
- 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 +695 -791
- package/zova/src/suite/a-demo/modules/demo-basic/package.json +1 -1
- package/zova/src/suite/a-demo/modules/demo-todo/package.json +1 -1
- package/zova/src/suite/a-devui/modules/devui-adapter/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-api/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-base/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-icon/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-indexadmin/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-indexweb/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-layoutadmin/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-layoutempty/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-layoutweb/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-login/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-passport/package.json +1 -1
- package/zova/src/suite/a-home/modules/home-theme/package.json +1 -1
- package/zova/src/suite/a-training/modules/training-student/package.json +3 -2
- package/zova/src/suite/cabloy-basic/modules/basic-adapter/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-app/package.json +1 -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-captcha/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-commands/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-commandssync/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-currency/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-date/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-details/package.json +7 -2
- 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/index.ts +149 -2
- 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 +44 -6
- 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 +29 -5
- 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 +7 -2
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/component/blockToolbarBulk/controller.tsx +3 -1
- 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 +4 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/config/locale/zh-cn.ts +4 -0
- 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/cabloy-basic/modules/basic-form/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-input/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-page/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-pageentry/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-resource/package.json +52 -0
- package/zova/src/suite/cabloy-basic/modules/basic-resource/src/.metadata/component/formFieldResourcePicker.ts +31 -0
- package/zova/src/suite/cabloy-basic/modules/basic-resource/src/.metadata/index.ts +103 -0
- package/zova/src/suite/cabloy-basic/modules/basic-resource/src/.metadata/this.ts +2 -0
- package/zova/src/suite/cabloy-basic/modules/basic-resource/src/bean/tableCell.resourcePicker.tsx +46 -0
- package/zova/src/suite/cabloy-basic/modules/basic-resource/src/component/formFieldResourcePicker/controller.tsx +157 -0
- package/zova/src/suite/cabloy-basic/modules/basic-resource/src/index.ts +1 -0
- package/zova/src/suite/cabloy-basic/modules/basic-resource/tsconfig.build.json +13 -0
- package/zova/src/suite/cabloy-basic/modules/basic-resource/tsconfig.json +5 -0
- package/zova/src/suite/cabloy-basic/modules/basic-select/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-table/package.json +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-text/package.json +1 -1
- package/zova/src/suite/cabloy-basic/package.json +1 -0
- package/zova/src/suite-vendor/a-cabloy/modules/rest-resource/package.json +2 -2
- 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-api/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-app/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-bean/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-behavior/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-behaviors/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-boundary/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 +4 -3
- 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-fetch/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-form/package.json +2 -2
- 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-icon/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-interceptor/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-logger/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-meta/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-model/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-model/src/bean/bean.model/bean.model.useQuery.ts +2 -1
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/package.json +3 -3
- 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/model/sdk.ts +4 -0
- 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/index.ts +1 -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-router/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-routerstack/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-routertabs/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-ssr/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-ssrhmr/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-ssrserver/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-style/package.json +2 -2
- 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 +4 -3
- 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-zod/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/modules/a-zova/package.json +3 -3
- package/zova/src/suite-vendor/a-zova/package.json +26 -26
package/zova/src/suite/cabloy-basic/modules/basic-details/src/component/blockDetails/controller.tsx
CHANGED
|
@@ -5,12 +5,11 @@ import { ZovaJsx } from 'zova-jsx';
|
|
|
5
5
|
import { Controller } from 'zova-module-a-bean';
|
|
6
6
|
import {
|
|
7
7
|
IDetailsScope,
|
|
8
|
+
IFormMeta,
|
|
8
9
|
IJsxRenderContextDetails,
|
|
9
|
-
IPermissionHintDetailsActionBulk,
|
|
10
10
|
IResourceBlockOptionsBase,
|
|
11
11
|
IResourceRenderBlockOptionsBlock,
|
|
12
12
|
ISchemaObjectExtensionField,
|
|
13
|
-
TypeFormScene,
|
|
14
13
|
} from 'zova-module-a-openapi';
|
|
15
14
|
import { BeanControllerTableBase } from 'zova-module-a-table';
|
|
16
15
|
|
|
@@ -24,8 +23,9 @@ export interface ControllerBlockDetailsProps<
|
|
|
24
23
|
TData extends {} = {},
|
|
25
24
|
> extends IResourceBlockOptionsBase {
|
|
26
25
|
blocks?: IResourceRenderBlockOptionsBlock[];
|
|
27
|
-
|
|
26
|
+
formMeta?: IFormMeta;
|
|
28
27
|
schemaRow?: ISchemaObjectExtensionField;
|
|
28
|
+
schemaForm?: ISchemaObjectExtensionField;
|
|
29
29
|
getDetailItems?: () => TData[] | undefined;
|
|
30
30
|
setDetailItems?: (detailItems: TData[]) => void;
|
|
31
31
|
}
|
|
@@ -50,21 +50,24 @@ export class ControllerBlockDetails<TData extends {} = {}> extends BeanControlle
|
|
|
50
50
|
return this.$props.getDetailItems?.() ?? [];
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
set data(detailItems: TData[]) {
|
|
54
|
+
this.$props.setDetailItems?.(detailItems);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
get formMeta() {
|
|
58
|
+
return this.$props.formMeta!;
|
|
59
|
+
}
|
|
60
|
+
|
|
53
61
|
get formScene() {
|
|
54
|
-
return this
|
|
62
|
+
return this.formMeta.formScene!;
|
|
55
63
|
}
|
|
56
64
|
|
|
57
65
|
get schemaRow() {
|
|
58
66
|
return this.$props.schemaRow!;
|
|
59
67
|
}
|
|
60
68
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const formSceneHint = permissionHint?.formScene;
|
|
64
|
-
if (!formSceneHint) return true;
|
|
65
|
-
if (Array.isArray(formSceneHint) && formSceneHint.includes(formScene!)) return true;
|
|
66
|
-
if (formSceneHint === formScene) return true;
|
|
67
|
-
return false;
|
|
69
|
+
get schemaForm() {
|
|
70
|
+
return this.$props.schemaForm!;
|
|
68
71
|
}
|
|
69
72
|
|
|
70
73
|
private _prepareJsx() {
|
|
@@ -83,7 +86,20 @@ export class ControllerBlockDetails<TData extends {} = {}> extends BeanControlle
|
|
|
83
86
|
}
|
|
84
87
|
|
|
85
88
|
private _prepareJsxCelScope(): IDetailsScope {
|
|
86
|
-
|
|
89
|
+
// eslint-disable-next-line
|
|
90
|
+
const self = this;
|
|
91
|
+
const $$details = this.$customRef(() => {
|
|
92
|
+
return {
|
|
93
|
+
get() {
|
|
94
|
+
return self;
|
|
95
|
+
},
|
|
96
|
+
set(_value) {},
|
|
97
|
+
};
|
|
98
|
+
}) as any;
|
|
99
|
+
return {
|
|
100
|
+
formMeta: this.formMeta,
|
|
101
|
+
$$details,
|
|
102
|
+
};
|
|
87
103
|
}
|
|
88
104
|
|
|
89
105
|
protected render() {
|
package/zova/src/suite/cabloy-basic/modules/basic-details/src/component/blockForm/controller.tsx
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { IComponentOptions } from 'zova';
|
|
2
|
+
import type { IResourceBlockOptionsBase, IJsxRenderContextDetail } from 'zova-module-a-openapi';
|
|
3
|
+
|
|
4
|
+
import { BeanControllerBase, Use } from 'zova';
|
|
5
|
+
import { Controller } from 'zova-module-a-bean';
|
|
6
|
+
import { BeanControllerFormBase, ZForm } from 'zova-module-a-form';
|
|
7
|
+
|
|
8
|
+
declare module 'zova-module-a-openapi' {
|
|
9
|
+
export interface IResourceBlockRecord {
|
|
10
|
+
'basic-details:blockForm'?: ControllerBlockFormProps;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface ControllerBlockFormProps extends IResourceBlockOptionsBase {}
|
|
15
|
+
|
|
16
|
+
@Controller()
|
|
17
|
+
export class ControllerBlockForm extends BeanControllerBase {
|
|
18
|
+
static $propsDefault = {};
|
|
19
|
+
static $componentOptions: IComponentOptions = { inheritAttrs: false, deepExtendDefault: true };
|
|
20
|
+
|
|
21
|
+
formRef: BeanControllerFormBase;
|
|
22
|
+
|
|
23
|
+
@Use({ injectionScope: 'host' })
|
|
24
|
+
$$renderContext: IJsxRenderContextDetail;
|
|
25
|
+
|
|
26
|
+
protected async __init__() {}
|
|
27
|
+
|
|
28
|
+
protected render() {
|
|
29
|
+
const { $$detail } = this.$$renderContext;
|
|
30
|
+
return (
|
|
31
|
+
<ZForm
|
|
32
|
+
class={this.$props.class}
|
|
33
|
+
controllerRef={ref => {
|
|
34
|
+
this.formRef = ref;
|
|
35
|
+
$$detail.formRef = ref;
|
|
36
|
+
}}
|
|
37
|
+
data={$$detail.formData}
|
|
38
|
+
schema={$$detail.formSchema}
|
|
39
|
+
schemaScene={$$detail.schemaScene}
|
|
40
|
+
formMeta={$$detail.formMeta}
|
|
41
|
+
formProvider={$$detail.formProvider}
|
|
42
|
+
formScope={$$detail.jsxCelScope}
|
|
43
|
+
onSubmitData={data => $$detail.submitData(data)}
|
|
44
|
+
onShowError={async ({ error }) => {
|
|
45
|
+
await this.$performCommand('basic-commands:alert', {
|
|
46
|
+
type: 'error',
|
|
47
|
+
text: error.message,
|
|
48
|
+
});
|
|
49
|
+
}}
|
|
50
|
+
></ZForm>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
}
|
package/zova/src/suite/cabloy-basic/modules/basic-details/src/component/blockTable/controller.tsx
CHANGED
|
@@ -27,7 +27,9 @@ export class ControllerBlockTable<TData extends {} = {}> extends BeanControllerB
|
|
|
27
27
|
|
|
28
28
|
protected render() {
|
|
29
29
|
const { $$details } = this.$$renderContext;
|
|
30
|
-
const data =
|
|
30
|
+
const data = ($$details.data as TData[]).filter(
|
|
31
|
+
item => (item as Record<string, any>).deleted !== true,
|
|
32
|
+
);
|
|
31
33
|
return (
|
|
32
34
|
<ZTable<TData>
|
|
33
35
|
class={this.$props.class}
|
|
@@ -35,9 +37,12 @@ export class ControllerBlockTable<TData extends {} = {}> extends BeanControllerB
|
|
|
35
37
|
this.tableRef = ref;
|
|
36
38
|
$$details.tableRef = ref as unknown as BeanControllerTableBase<{}>;
|
|
37
39
|
}}
|
|
38
|
-
data={data
|
|
40
|
+
data={data}
|
|
39
41
|
schema={$$details.schemaRow}
|
|
40
42
|
tableScope={$$details.jsxCelScope}
|
|
43
|
+
getRowId={(_originalRow: TData, index: number) => {
|
|
44
|
+
return String(index);
|
|
45
|
+
}}
|
|
41
46
|
></ZTable>
|
|
42
47
|
);
|
|
43
48
|
}
|
|
@@ -9,6 +9,8 @@ import { VNode } from 'vue';
|
|
|
9
9
|
import { BeanControllerBase, Use } from 'zova';
|
|
10
10
|
import { Controller } from 'zova-module-a-bean';
|
|
11
11
|
|
|
12
|
+
import { checkPermission } from '../../lib/utils.js';
|
|
13
|
+
|
|
12
14
|
declare module 'zova-module-a-openapi' {
|
|
13
15
|
export interface IResourceBlockRecord {
|
|
14
16
|
'basic-details:blockToolbarBulk'?: ControllerBlockToolbarBulkProps;
|
|
@@ -46,7 +48,7 @@ export class ControllerBlockToolbarBulk extends BeanControllerBase {
|
|
|
46
48
|
const domActions: VNode[] = [];
|
|
47
49
|
actions.forEach((action, index) => {
|
|
48
50
|
const permissionHint = action.options?.permission;
|
|
49
|
-
if (
|
|
51
|
+
if (!checkPermission($$details.formScene, permissionHint)) return;
|
|
50
52
|
const options = Object.assign({ key: index }, action.options);
|
|
51
53
|
const domAction = $jsx.render(action.render!, options, $celScope, this.$$renderContext);
|
|
52
54
|
if (!domAction) return;
|
|
@@ -14,7 +14,7 @@ import { VNode } from 'vue';
|
|
|
14
14
|
import { BeanControllerBase, deepExtend } from 'zova';
|
|
15
15
|
import { ZovaJsx } from 'zova-jsx';
|
|
16
16
|
import { Controller } from 'zova-module-a-bean';
|
|
17
|
-
import { ZFormField } from 'zova-module-a-form';
|
|
17
|
+
import { formMetaFromFormScene, ZFormField } from 'zova-module-a-form';
|
|
18
18
|
|
|
19
19
|
declare module 'zova-module-a-openapi' {
|
|
20
20
|
export interface IResourceFormFieldRecord {
|
|
@@ -22,7 +22,9 @@ declare module 'zova-module-a-openapi' {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
export interface IResourceFormFieldDetailsOptions extends IResourceFormFieldOptionsBase {
|
|
25
|
+
export interface IResourceFormFieldDetailsOptions extends IResourceFormFieldOptionsBase {
|
|
26
|
+
// schemaRow?:
|
|
27
|
+
}
|
|
26
28
|
|
|
27
29
|
export interface ControllerFormFieldDetailsProps extends IFormFieldComponentOptions {
|
|
28
30
|
options?: IResourceFormFieldDetailsOptions;
|
|
@@ -60,19 +62,17 @@ export class ControllerFormFieldDetails extends BeanControllerBase {
|
|
|
60
62
|
$$formField: ControllerFormField,
|
|
61
63
|
) {
|
|
62
64
|
const { propsBucket } = formFieldRenderContext;
|
|
63
|
-
//
|
|
64
|
-
const
|
|
65
|
-
if (!schemaName) {
|
|
66
|
-
return <div>Should specify the detail schema</div>;
|
|
67
|
-
}
|
|
68
|
-
const schemaRow: ISchemaObjectExtensionField | undefined = this.$sdk.getSchema(
|
|
69
|
-
schemaName!,
|
|
70
|
-
).data;
|
|
65
|
+
// schemaRow
|
|
66
|
+
const schemaRow = this._getSchemaRow($$formField);
|
|
71
67
|
if (!schemaRow) return;
|
|
72
|
-
//
|
|
68
|
+
// schemaForm
|
|
69
|
+
const schemaForm = $$formField.property!.items;
|
|
70
|
+
if (!schemaForm) return;
|
|
71
|
+
// formMeta
|
|
73
72
|
const formScene: TypeFormScene = propsBucket.readonly
|
|
74
73
|
? 'view'
|
|
75
74
|
: $$formField.formMeta!.formScene!;
|
|
75
|
+
const formMeta = formMetaFromFormScene(formScene);
|
|
76
76
|
// blocks
|
|
77
77
|
const blocks = schemaRow?.rest?.blocks;
|
|
78
78
|
if (!blocks || blocks.length === 0) return;
|
|
@@ -81,8 +81,9 @@ export class ControllerFormFieldDetails extends BeanControllerBase {
|
|
|
81
81
|
const options = deepExtend(
|
|
82
82
|
{ key: index },
|
|
83
83
|
{
|
|
84
|
-
|
|
84
|
+
formMeta,
|
|
85
85
|
schemaRow,
|
|
86
|
+
schemaForm,
|
|
86
87
|
getDetailItems: () => {
|
|
87
88
|
return propsBucket.value;
|
|
88
89
|
},
|
|
@@ -102,4 +103,15 @@ export class ControllerFormFieldDetails extends BeanControllerBase {
|
|
|
102
103
|
});
|
|
103
104
|
return <div>{domBlocks}</div>;
|
|
104
105
|
}
|
|
106
|
+
|
|
107
|
+
private _getSchemaRow($$formField: ControllerFormField): ISchemaObjectExtensionField | undefined {
|
|
108
|
+
const fieldNameAux = `_${$$formField.name}`;
|
|
109
|
+
const propertyAux = $$formField.$$form.getFieldProperty(fieldNameAux);
|
|
110
|
+
// schema
|
|
111
|
+
const schemaName = propertyAux?.items?.$ref;
|
|
112
|
+
if (!schemaName) {
|
|
113
|
+
throw new Error(`Should specify the schemaRow of detail by auxiliary Field: ${fieldNameAux}`);
|
|
114
|
+
}
|
|
115
|
+
return this.$sdk.getSchema(schemaName!).data;
|
|
116
|
+
}
|
|
105
117
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './utils.js';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IPermissionHintDetailsActionBulk, TypeFormScene } from 'zova-module-a-openapi';
|
|
2
|
+
|
|
3
|
+
export function checkPermission(
|
|
4
|
+
formScene: TypeFormScene,
|
|
5
|
+
permissionHint?: IPermissionHintDetailsActionBulk,
|
|
6
|
+
): boolean {
|
|
7
|
+
const formSceneHint = permissionHint?.formScene;
|
|
8
|
+
if (!formSceneHint) return true;
|
|
9
|
+
if (Array.isArray(formSceneHint) && formSceneHint.includes(formScene!)) return true;
|
|
10
|
+
if (formSceneHint === formScene) return true;
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { celEnvBase } from '@cabloy/utils';
|
|
2
|
+
import { classes } from 'typestyle';
|
|
3
|
+
import { VNode } from 'vue';
|
|
4
|
+
import { BeanBase, UseScope } from 'zova';
|
|
5
|
+
import { ZovaJsx } from 'zova-jsx';
|
|
6
|
+
import { Service } from 'zova-module-a-bean';
|
|
7
|
+
import {
|
|
8
|
+
BeanControllerFormBase,
|
|
9
|
+
formMetaFromFormScene,
|
|
10
|
+
TypeFormOnSubmitData,
|
|
11
|
+
} from 'zova-module-a-form';
|
|
12
|
+
import {
|
|
13
|
+
IDetailScope,
|
|
14
|
+
IFormMeta,
|
|
15
|
+
IFormProvider,
|
|
16
|
+
IJsxRenderContextDetail,
|
|
17
|
+
ISchemaObjectExtensionField,
|
|
18
|
+
ScopeModuleAOpenapi,
|
|
19
|
+
TypeFormScene,
|
|
20
|
+
TypeFormSchemaScene,
|
|
21
|
+
} from 'zova-module-a-openapi';
|
|
22
|
+
import { AppModalItem } from 'zova-module-basic-app';
|
|
23
|
+
|
|
24
|
+
import { IDialogFormOptions } from '../types/dialogForm.js';
|
|
25
|
+
|
|
26
|
+
@Service()
|
|
27
|
+
export class ServiceDetail<TData extends {} = {}> extends BeanBase {
|
|
28
|
+
private options: IDialogFormOptions<TData>;
|
|
29
|
+
private dialogInstance: AppModalItem | undefined;
|
|
30
|
+
|
|
31
|
+
formRef: BeanControllerFormBase<TData> | undefined;
|
|
32
|
+
|
|
33
|
+
formScene: TypeFormScene;
|
|
34
|
+
schemaScene: TypeFormSchemaScene;
|
|
35
|
+
|
|
36
|
+
formMeta: IFormMeta;
|
|
37
|
+
formProvider: IFormProvider;
|
|
38
|
+
formSchema?: ISchemaObjectExtensionField;
|
|
39
|
+
formData?: TData;
|
|
40
|
+
|
|
41
|
+
jsxZova: ZovaJsx;
|
|
42
|
+
jsxCelScope: IDetailScope;
|
|
43
|
+
jsxRenderContext: IJsxRenderContextDetail<TData>;
|
|
44
|
+
|
|
45
|
+
@UseScope()
|
|
46
|
+
$$scopeOpenapi: ScopeModuleAOpenapi;
|
|
47
|
+
|
|
48
|
+
protected async __init__(options: IDialogFormOptions<TData>) {
|
|
49
|
+
this.options = options;
|
|
50
|
+
this.formScene = options.formScene;
|
|
51
|
+
this.schemaScene = options.schemaScene;
|
|
52
|
+
this.formMeta = formMetaFromFormScene(this.formScene);
|
|
53
|
+
this.formProvider = this.$$scopeOpenapi.config.formProvider;
|
|
54
|
+
this.formSchema = options.schema;
|
|
55
|
+
this.formData = options.data;
|
|
56
|
+
// jsx
|
|
57
|
+
this._prepareJsx();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
private _prepareJsx() {
|
|
61
|
+
const jsxCelEnv = celEnvBase.clone();
|
|
62
|
+
this.jsxZova = this.bean._newBeanSimple(
|
|
63
|
+
ZovaJsx,
|
|
64
|
+
false,
|
|
65
|
+
this.formProvider.components,
|
|
66
|
+
jsxCelEnv,
|
|
67
|
+
);
|
|
68
|
+
this.jsxCelScope = this._prepareJsxCelScope();
|
|
69
|
+
this.jsxRenderContext = {
|
|
70
|
+
app: this.app,
|
|
71
|
+
ctx: this.ctx,
|
|
72
|
+
$scene: 'detail',
|
|
73
|
+
$host: this,
|
|
74
|
+
$celScope: this.jsxCelScope,
|
|
75
|
+
$jsx: this.jsxZova,
|
|
76
|
+
$$detail: this,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
private _prepareJsxCelScope(): IDetailScope {
|
|
81
|
+
// eslint-disable-next-line
|
|
82
|
+
const self = this;
|
|
83
|
+
const $$detail = this.$customRef(() => {
|
|
84
|
+
return {
|
|
85
|
+
get() {
|
|
86
|
+
return self;
|
|
87
|
+
},
|
|
88
|
+
set(_value) {},
|
|
89
|
+
};
|
|
90
|
+
}) as any;
|
|
91
|
+
return {
|
|
92
|
+
formMeta: this.formMeta,
|
|
93
|
+
$$detail,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
private _renderBlocks() {
|
|
98
|
+
const blocks = this.formSchema?.rest?.blocks;
|
|
99
|
+
if (!blocks || blocks.length === 0) return;
|
|
100
|
+
const domBlocks: VNode[] = [];
|
|
101
|
+
blocks.forEach((block, index) => {
|
|
102
|
+
const options = Object.assign({ key: index }, block.options);
|
|
103
|
+
const domBlock = this.jsxZova.render(
|
|
104
|
+
block.render!,
|
|
105
|
+
options,
|
|
106
|
+
this.jsxCelScope,
|
|
107
|
+
this.jsxRenderContext,
|
|
108
|
+
);
|
|
109
|
+
if (!domBlock) return;
|
|
110
|
+
if (Array.isArray(domBlock)) {
|
|
111
|
+
domBlocks.push(...domBlock);
|
|
112
|
+
} else {
|
|
113
|
+
domBlocks.push(domBlock);
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
return domBlocks;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
public closeDialog() {
|
|
120
|
+
if (this.dialogInstance) {
|
|
121
|
+
this.dialogInstance.close();
|
|
122
|
+
this.dialogInstance = undefined;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
public submitData(data: TypeFormOnSubmitData<TData>) {
|
|
127
|
+
this.options.onSubmitData?.(data, this.dialogInstance!);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
openDialogForm() {
|
|
131
|
+
const options = this.options;
|
|
132
|
+
this.dialogInstance = this.$appModal.dialog(
|
|
133
|
+
{
|
|
134
|
+
icon: options.icon,
|
|
135
|
+
title: options.title,
|
|
136
|
+
slotDefault: () => {
|
|
137
|
+
return <>{this._renderBlocks()}</>;
|
|
138
|
+
},
|
|
139
|
+
slotActions: () => {
|
|
140
|
+
const isSubmitting = this.formRef?.formState.isSubmitting;
|
|
141
|
+
return (
|
|
142
|
+
<>
|
|
143
|
+
{isSubmitting && <span class="loading loading-spinner text-primary"></span>}
|
|
144
|
+
<button
|
|
145
|
+
type="button"
|
|
146
|
+
class="btn btn-ghost"
|
|
147
|
+
onClick={() => {
|
|
148
|
+
this.closeDialog();
|
|
149
|
+
}}
|
|
150
|
+
>
|
|
151
|
+
{options.locale.Cancel()}
|
|
152
|
+
</button>
|
|
153
|
+
{this.formScene !== 'view' && (
|
|
154
|
+
<button
|
|
155
|
+
type="button"
|
|
156
|
+
class={classes('btn btn-primary', isSubmitting && 'btn-disabled')}
|
|
157
|
+
onClick={async () => {
|
|
158
|
+
if (isSubmitting) return;
|
|
159
|
+
await this.formRef?.submit();
|
|
160
|
+
}}
|
|
161
|
+
>
|
|
162
|
+
{options.locale.OK()}
|
|
163
|
+
</button>
|
|
164
|
+
)}
|
|
165
|
+
</>
|
|
166
|
+
);
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
options.dialogOptions,
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IDetailScope } from 'zova-module-a-openapi';
|
|
2
|
+
import 'zova-module-a-form';
|
|
3
|
+
import 'zova-module-a-openapi';
|
|
4
|
+
import type { ServiceDetail } from '../service/detail.jsx';
|
|
5
|
+
|
|
6
|
+
declare module 'zova-module-a-openapi' {
|
|
7
|
+
export interface IJsxRenderContextDetail<TData extends {} = {}> {
|
|
8
|
+
$$detail: ServiceDetail<TData>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface IDetailScope {
|
|
12
|
+
$$detail?: ServiceDetail;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare module 'zova-module-a-form' {
|
|
17
|
+
export interface IFormScope extends IDetailScope {}
|
|
18
|
+
}
|
|
@@ -1,8 +1,19 @@
|
|
|
1
|
+
import 'zova-module-a-table';
|
|
1
2
|
import 'zova-module-a-openapi';
|
|
3
|
+
import type { IDetailsScope } from 'zova-module-a-openapi';
|
|
4
|
+
|
|
2
5
|
import { ControllerBlockDetails } from '../component/blockDetails/controller.jsx';
|
|
3
6
|
|
|
4
7
|
declare module 'zova-module-a-openapi' {
|
|
5
8
|
export interface IJsxRenderContextDetails<TData extends {} = {}> {
|
|
6
9
|
$$details: ControllerBlockDetails<TData>;
|
|
7
10
|
}
|
|
11
|
+
|
|
12
|
+
export interface IDetailsScope {
|
|
13
|
+
$$details?: ControllerBlockDetails<any>;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
declare module 'zova-module-a-table' {
|
|
18
|
+
export interface ITableScope extends IDetailsScope {}
|
|
8
19
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { TypeFormOnSubmitData } from 'zova-module-a-form';
|
|
2
|
+
import { IIconRecord } from 'zova-module-a-icon';
|
|
3
|
+
import { TypeFormScene, TypeFormSchemaScene } from 'zova-module-a-openapi';
|
|
4
|
+
import { AppModalItem, IModalDialogOptions } from 'zova-module-basic-app';
|
|
5
|
+
|
|
6
|
+
export interface IDialogFormOptions<TData extends {} = {}> {
|
|
7
|
+
locale: {
|
|
8
|
+
Cancel: () => string;
|
|
9
|
+
OK: () => string;
|
|
10
|
+
};
|
|
11
|
+
schema: any;
|
|
12
|
+
data: TData;
|
|
13
|
+
formScene: TypeFormScene;
|
|
14
|
+
schemaScene: TypeFormSchemaScene;
|
|
15
|
+
dialogOptions?: IModalDialogOptions;
|
|
16
|
+
icon?: keyof IIconRecord;
|
|
17
|
+
title: string;
|
|
18
|
+
onSubmitData?: (
|
|
19
|
+
data: TypeFormOnSubmitData<TData>,
|
|
20
|
+
dialogInstance: AppModalItem,
|
|
21
|
+
) => void | Promise<void>;
|
|
22
|
+
}
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"tsc:publish": "npm run clean && node ../../../../../packages-cli/cli/src/bin/zova.ts :bin:buildModule --sourcemap && tsc -p tsconfig.build.json",
|
|
32
32
|
"prepublishOnly": "npm run tsc:publish",
|
|
33
33
|
"prepack": "clean-package",
|
|
34
|
-
"postpack": "clean-package restore
|
|
34
|
+
"postpack": "clean-package restore"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"clean-package": "^2.2.0",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"tsc:publish": "npm run clean && node ../../../../../packages-cli/cli/src/bin/zova.ts :bin:buildModule --sourcemap && tsc -p tsconfig.build.json",
|
|
32
32
|
"prepublishOnly": "npm run tsc:publish",
|
|
33
33
|
"prepack": "clean-package",
|
|
34
|
-
"postpack": "clean-package restore
|
|
34
|
+
"postpack": "clean-package restore"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {},
|
|
37
37
|
"devDependencies": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"tsc:publish": "npm run clean && node ../../../../../packages-cli/cli/src/bin/zova.ts :bin:buildModule --sourcemap && tsc -p tsconfig.build.json",
|
|
32
32
|
"prepublishOnly": "npm run tsc:publish",
|
|
33
33
|
"prepack": "clean-package",
|
|
34
|
-
"postpack": "clean-package restore
|
|
34
|
+
"postpack": "clean-package restore"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {},
|
|
37
37
|
"devDependencies": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"tsc:publish": "npm run clean && node ../../../../../packages-cli/cli/src/bin/zova.ts :bin:buildModule --sourcemap && tsc -p tsconfig.build.json",
|
|
32
32
|
"prepublishOnly": "npm run tsc:publish",
|
|
33
33
|
"prepack": "clean-package",
|
|
34
|
-
"postpack": "clean-package restore
|
|
34
|
+
"postpack": "clean-package restore"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {},
|
|
37
37
|
"devDependencies": {
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "zova-module-basic-resource",
|
|
3
|
+
"version": "5.0.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"Zova Module"
|
|
7
|
+
],
|
|
8
|
+
"author": "",
|
|
9
|
+
"files": [
|
|
10
|
+
"mock",
|
|
11
|
+
"dist",
|
|
12
|
+
"src",
|
|
13
|
+
"icons",
|
|
14
|
+
"assets"
|
|
15
|
+
],
|
|
16
|
+
"type": "module",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": [
|
|
20
|
+
"./src/index.ts",
|
|
21
|
+
"./dist/index.d.ts"
|
|
22
|
+
],
|
|
23
|
+
"import": "./src/index.ts",
|
|
24
|
+
"default": "./dist/index.js"
|
|
25
|
+
},
|
|
26
|
+
"./*": "./*"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"clean": "rimraf dist tsconfig.build.tsbuildinfo",
|
|
30
|
+
"tsc:publish": "npm run clean && node ../../../../../packages-cli/cli/src/bin/zova.ts :bin:buildModule --sourcemap && tsc -p tsconfig.build.json",
|
|
31
|
+
"prepublishOnly": "npm run tsc:publish",
|
|
32
|
+
"prepack": "clean-package",
|
|
33
|
+
"postpack": "clean-package restore"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"clean-package": "^2.2.0",
|
|
38
|
+
"rimraf": "^6.1.3"
|
|
39
|
+
},
|
|
40
|
+
"clean-package": {
|
|
41
|
+
"indent": 2,
|
|
42
|
+
"replace": {
|
|
43
|
+
"exports.\\..types": "./dist/index.d.ts"
|
|
44
|
+
},
|
|
45
|
+
"remove": [
|
|
46
|
+
"clean-package",
|
|
47
|
+
"devDependencies",
|
|
48
|
+
"exports.\\..import"
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
"title": "basic-resource"
|
|
52
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { TypeControllerInnerProps } from 'zova';
|
|
2
|
+
|
|
3
|
+
import { defineComponent } from 'vue';
|
|
4
|
+
import { prepareComponentOptions, useController } from 'zova';
|
|
5
|
+
|
|
6
|
+
import type { ControllerFormFieldResourcePickerProps } from '../../component/formFieldResourcePicker/controller.jsx';
|
|
7
|
+
|
|
8
|
+
import { ControllerFormFieldResourcePicker } from '../../component/formFieldResourcePicker/controller.jsx';
|
|
9
|
+
export type ZFormFieldResourcePickerProps = {
|
|
10
|
+
controllerRef?: (ref: ControllerFormFieldResourcePicker) => void;
|
|
11
|
+
} & ControllerFormFieldResourcePickerProps;
|
|
12
|
+
|
|
13
|
+
type ControllerInnerProps = TypeControllerInnerProps<
|
|
14
|
+
ControllerFormFieldResourcePickerProps,
|
|
15
|
+
keyof typeof ControllerFormFieldResourcePicker.$propsDefault
|
|
16
|
+
>;
|
|
17
|
+
declare module 'zova-module-basic-resource' {
|
|
18
|
+
export interface ControllerFormFieldResourcePicker {
|
|
19
|
+
$props: ControllerInnerProps;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const ZFormFieldResourcePicker = defineComponent((_props: ZFormFieldResourcePickerProps) => {
|
|
24
|
+
useController(ControllerFormFieldResourcePicker, undefined, undefined);
|
|
25
|
+
return () => {};
|
|
26
|
+
}, prepareComponentOptions(ControllerFormFieldResourcePicker.$componentOptions));
|
|
27
|
+
declare module 'zova-module-a-bean' {
|
|
28
|
+
export interface IVonaComponentRecord {
|
|
29
|
+
'basic-resource:formFieldResourcePicker': ControllerFormFieldResourcePickerProps;
|
|
30
|
+
}
|
|
31
|
+
}
|