cabloy 5.1.62 → 5.1.64
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 +19 -0
- package/cabloy-docs/frontend/form-guide.md +10 -4
- package/cabloy-docs/frontend/table-cell-cookbook.md +4 -1
- package/package.json +1 -1
- package/vona/packages-vona/vona/package.json +1 -1
- package/vona/pnpm-lock.yaml +78 -2
- package/vona/src/suite/a-training/modules/training-record/package.json +53 -0
- package/vona/src/suite/a-training/modules/training-record/src/.metadata/index.ts +198 -0
- package/vona/src/suite/a-training/modules/training-record/src/.metadata/locales.ts +18 -0
- package/vona/src/suite/a-training/modules/training-record/src/.metadata/this.ts +2 -0
- package/vona/src/suite/a-training/modules/training-record/src/bean/meta.index.ts +12 -0
- package/vona/src/suite/a-training/modules/training-record/src/bean/meta.version.ts +21 -0
- package/vona/src/suite/a-training/modules/training-record/src/config/locale/en-us.ts +7 -0
- package/vona/src/suite/a-training/modules/training-record/src/config/locale/zh-cn.ts +7 -0
- package/vona/src/suite/a-training/modules/training-record/src/entity/record.tsx +48 -0
- package/vona/src/suite/a-training/modules/training-record/src/index.ts +2 -0
- package/vona/src/suite/a-training/modules/training-record/src/model/record.ts +10 -0
- package/vona/src/suite/a-training/modules/training-record/tsconfig.build.json +11 -0
- package/vona/src/suite/a-training/modules/training-record/tsconfig.json +7 -0
- package/vona/src/suite/a-training/modules/training-student/src/.metadata/index.ts +39 -3
- package/vona/src/suite/a-training/modules/training-student/src/config/locale/en-us.ts +1 -0
- package/vona/src/suite/a-training/modules/training-student/src/config/locale/zh-cn.ts +1 -0
- package/vona/src/suite/a-training/modules/training-student/src/dto/detailRecordBase.tsx +12 -0
- package/vona/src/suite/a-training/modules/training-student/src/dto/detailRecordMutate.tsx +31 -0
- package/vona/src/suite/a-training/modules/training-student/src/dto/detailRecordResItem.tsx +41 -0
- package/vona/src/suite/a-training/modules/training-student/src/dto/detailRecordView.tsx +28 -0
- package/vona/src/suite/a-training/modules/training-student/src/dto/studentCreate.tsx +16 -1
- package/vona/src/suite/a-training/modules/training-student/src/dto/studentUpdate.tsx +4 -1
- package/vona/src/suite/a-training/modules/training-student/src/dto/studentView.tsx +4 -1
- package/vona/src/suite/a-training/modules/training-student/src/model/student.ts +9 -2
- package/vona/src/suite/a-training/modules/training-student/src/service/student.ts +1 -1
- package/vona/src/suite/a-training/package.json +1 -0
- package/vona/src/suite/a-training/tsconfig.json +3 -0
- 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/dto.ts +2 -0
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/dto/dtoGet.ts +3 -3
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/lib/dto/dtoMutate.ts +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/dto/dtoGet.ts +3 -0
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/dto/dtoMutate.ts +2 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/types/modelGeneral.ts +3 -0
- package/vona/src/suite-vendor/a-vona/package.json +1 -1
- package/zova/packages-cli/cli/package.json +2 -2
- package/zova/packages-cli/cli-set-front/cli/templates/create/component/boilerplateBlockPage/controller.tsx_ +6 -2
- package/zova/packages-cli/cli-set-front/cli/templates/create/component/boilerplateBlockPageEntry/controller.tsx_ +6 -2
- package/zova/packages-cli/cli-set-front/cli/templates/create/component/boilerplateFormActionRow/controller.tsx_ +6 -2
- package/zova/packages-cli/cli-set-front/cli/templates/create/component/boilerplateFormField/controller.tsx_ +2 -1
- package/zova/packages-cli/cli-set-front/cli/templates/create/component/boilerplateTableActionBulk/controller.tsx_ +6 -2
- package/zova/packages-cli/cli-set-front/cli/templates/rest/component.ts +22 -0
- package/zova/packages-cli/cli-set-front/cli/templates/rest/render.ts +4 -0
- package/zova/packages-cli/cli-set-front/package.json +1 -1
- package/zova/packages-zova/zova/package.json +2 -2
- package/zova/pnpm-lock.yaml +32 -2
- package/zova/src/suite/a-demo/modules/demo-basic/src/page/toolOne/render.tsx +5 -3
- package/zova/src/suite/a-home/modules/home-login/src/page/login/render.tsx +5 -3
- package/zova/src/suite/a-training/modules/training-student/package.json +6 -1
- package/zova/src/suite/a-training/modules/training-student/src/bean/tableCell.actionDeleteForce.tsx +13 -11
- package/zova/src/suite/a-training/modules/training-student/src/bean/tableCell.actionSummary.tsx +1 -1
- package/zova/src/suite/cabloy-basic/modules/basic-app/package.json +60 -0
- package/zova/src/suite/cabloy-basic/modules/basic-app/src/.metadata/index.ts +137 -0
- package/zova/src/suite/cabloy-basic/modules/basic-app/src/.metadata/locales.ts +7 -0
- package/zova/src/suite/cabloy-basic/modules/basic-app/src/.metadata/this.ts +2 -0
- package/zova/src/suite/cabloy-basic/modules/basic-app/src/bean/behavior.appModal.tsx +260 -0
- package/zova/src/suite/cabloy-basic/modules/basic-app/src/config/config.ts +39 -0
- package/zova/src/suite/cabloy-basic/modules/basic-app/src/config/locale/en-us.ts +7 -0
- package/zova/src/suite/cabloy-basic/modules/basic-app/src/config/locale/zh-cn.ts +7 -0
- package/zova/src/suite/cabloy-basic/modules/basic-app/src/index.ts +4 -0
- package/zova/src/suite/cabloy-basic/modules/basic-app/src/lib/appModalItem.ts +16 -0
- package/zova/src/suite/cabloy-basic/modules/basic-app/src/lib/index.ts +1 -0
- package/zova/src/suite/cabloy-basic/modules/basic-app/src/monkey.ts +38 -0
- package/zova/src/suite/cabloy-basic/modules/basic-app/src/monkeySys.ts +14 -0
- package/zova/src/suite/cabloy-basic/modules/basic-app/src/service/appModal.ts +89 -0
- package/zova/src/suite/cabloy-basic/modules/basic-app/src/types/appModal.ts +52 -0
- package/zova/src/suite/cabloy-basic/modules/basic-app/src/types/index.ts +1 -0
- package/zova/src/suite/cabloy-basic/modules/basic-app/tsconfig.build.json +13 -0
- package/zova/src/suite/cabloy-basic/modules/basic-app/tsconfig.json +5 -0
- package/zova/src/suite/cabloy-basic/modules/basic-commands/package.json +6 -1
- package/zova/src/suite/cabloy-basic/modules/basic-commands/src/.metadata/index.ts +16 -0
- package/zova/src/suite/cabloy-basic/modules/basic-commands/src/bean/command.alert.tsx +8 -14
- package/zova/src/suite/cabloy-basic/modules/basic-commands/src/bean/command.confirm.tsx +10 -7
- package/zova/src/suite/cabloy-basic/modules/basic-commands/src/bean/command.prompt.tsx +30 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/package.json +52 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/.metadata/component/actionCreate.ts +31 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/.metadata/component/blockDetails.ts +34 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/.metadata/component/blockDetailsToolbarBulk.ts +31 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/.metadata/component/formFieldDetails.ts +31 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/.metadata/index.ts +116 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/.metadata/locales.ts +7 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/.metadata/this.ts +2 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/component/actionCreate/controller.tsx +42 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/component/blockDetails/controller.tsx +114 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/component/blockDetailsToolbarBulk/controller.tsx +61 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/component/formFieldDetails/controller.tsx +105 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/config/locale/en-us.ts +3 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/config/locale/zh-cn.ts +3 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/index.ts +3 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/types/details.ts +8 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/src/types/index.ts +1 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/tsconfig.build.json +13 -0
- package/zova/src/suite/cabloy-basic/modules/basic-details/tsconfig.json +5 -0
- package/zova/src/suite/cabloy-basic/modules/basic-pageentry/src/component/blockForm/controller.tsx +5 -3
- package/zova/src/suite/cabloy-basic/modules/basic-table/package.json +6 -1
- package/zova/src/suite/cabloy-basic/modules/basic-table/src/bean/tableCell.actionDelete.tsx +4 -2
- package/zova/src/suite/cabloy-basic/package.json +2 -0
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/package.json +1 -1
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/action.ts +2 -0
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/detail/details.ts +7 -0
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/detail/detailsActionBulk.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/index.ts +1 -0
- package/zova/src/suite-vendor/a-zova/modules/a-openapi/src/types/permissions.ts +6 -0
- package/zova/src/suite-vendor/a-zova/package.json +2 -2
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ZovaSys } from 'zova';
|
|
2
|
+
import type { IIconRecord } from 'zova-module-a-icon';
|
|
3
|
+
|
|
4
|
+
export const config = (_sys: ZovaSys) => {
|
|
5
|
+
return {
|
|
6
|
+
model: {
|
|
7
|
+
alert: {
|
|
8
|
+
icons: {
|
|
9
|
+
success: ':outline:check-circle-outline' as keyof IIconRecord,
|
|
10
|
+
info: ':outline:alert-outline' as keyof IIconRecord,
|
|
11
|
+
warning: ':outline:alert-outline' as keyof IIconRecord,
|
|
12
|
+
error: ':outline:alert-outline' as keyof IIconRecord,
|
|
13
|
+
},
|
|
14
|
+
default: {
|
|
15
|
+
maxWidth: 360,
|
|
16
|
+
closeOnBackdrop: true,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
confirm: {
|
|
20
|
+
icons: {
|
|
21
|
+
confirm: ':outline:alert-outline' as keyof IIconRecord,
|
|
22
|
+
},
|
|
23
|
+
default: {
|
|
24
|
+
maxWidth: 360,
|
|
25
|
+
closeOnBackdrop: true,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
prompt: {
|
|
29
|
+
icons: {
|
|
30
|
+
prompt: ':outline:alert-outline' as keyof IIconRecord,
|
|
31
|
+
},
|
|
32
|
+
default: {
|
|
33
|
+
maxWidth: 360,
|
|
34
|
+
closeOnBackdrop: true,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ServiceAppModal } from '../service/appModal.js';
|
|
2
|
+
import type { IModalItem } from '../types/appModal.js';
|
|
3
|
+
|
|
4
|
+
export class AppModalItem {
|
|
5
|
+
private serviceAppModal: ServiceAppModal;
|
|
6
|
+
private modalItem: IModalItem;
|
|
7
|
+
|
|
8
|
+
constructor(serviceAppModal: ServiceAppModal, modalItem: IModalItem) {
|
|
9
|
+
this.serviceAppModal = serviceAppModal;
|
|
10
|
+
this.modalItem = modalItem;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
public close() {
|
|
14
|
+
this.serviceAppModal.close(this.modalItem.id);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './appModalItem.js';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { IModule } from '@cabloy/module-info';
|
|
2
|
+
import type { BeanBase, BeanContainer, IMonkeyBeanInit, IMonkeyModule } from 'zova';
|
|
3
|
+
|
|
4
|
+
import { BeanSimple } from 'zova';
|
|
5
|
+
|
|
6
|
+
import type { ServiceAppModal } from './service/appModal.js';
|
|
7
|
+
|
|
8
|
+
export class Monkey extends BeanSimple implements IMonkeyModule, IMonkeyBeanInit {
|
|
9
|
+
private _moduleSelf: IModule;
|
|
10
|
+
private _serviceAppModal: ServiceAppModal;
|
|
11
|
+
|
|
12
|
+
constructor(moduleSelf: IModule) {
|
|
13
|
+
super();
|
|
14
|
+
this._moduleSelf = moduleSelf;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
async moduleLoading(_module: IModule) {}
|
|
18
|
+
async moduleLoaded(module: IModule) {
|
|
19
|
+
if (this._moduleSelf === module) {
|
|
20
|
+
await this._loadServiceAppModal();
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
async beanInit(bean: BeanContainer, beanInstance: BeanBase) {
|
|
25
|
+
const self = this;
|
|
26
|
+
bean.defineProperty(beanInstance, '$appModal', {
|
|
27
|
+
enumerable: false,
|
|
28
|
+
configurable: true,
|
|
29
|
+
get() {
|
|
30
|
+
return self._serviceAppModal;
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
private async _loadServiceAppModal() {
|
|
36
|
+
this._serviceAppModal = await this.app.bean._getBean('basic-app.service.appModal', true);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { IMonkeySysInitialize } from 'zova';
|
|
2
|
+
import type { IBehaviorItem } from 'zova-module-a-behavior';
|
|
3
|
+
|
|
4
|
+
import { BeanSimple, deepExtend } from 'zova';
|
|
5
|
+
|
|
6
|
+
export class MonkeySys extends BeanSimple implements IMonkeySysInitialize {
|
|
7
|
+
async sysInitialize() {
|
|
8
|
+
const configCustom: IBehaviorItem = {
|
|
9
|
+
'basic-app:appModal': {},
|
|
10
|
+
};
|
|
11
|
+
const scopeAppConfig = this.sys.util.getModuleConfigSafe('a-app');
|
|
12
|
+
scopeAppConfig.behaviors = deepExtend({}, scopeAppConfig.behaviors, configCustom);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { BeanBase } from 'zova';
|
|
2
|
+
import { Service } from 'zova-module-a-bean';
|
|
3
|
+
|
|
4
|
+
import { AppModalItem } from '../lib/appModalItem.js';
|
|
5
|
+
import {
|
|
6
|
+
IModalAlertOptions,
|
|
7
|
+
IModalConfirmOptions,
|
|
8
|
+
IModalDialogOptions,
|
|
9
|
+
IModalItem,
|
|
10
|
+
IModalPromptOptions,
|
|
11
|
+
} from '../types/appModal.js';
|
|
12
|
+
|
|
13
|
+
@Service()
|
|
14
|
+
export class ServiceAppModal extends BeanBase {
|
|
15
|
+
public modalItems: IModalItem[] = [];
|
|
16
|
+
private modalItemIdCounter: number = 0;
|
|
17
|
+
|
|
18
|
+
protected async __init__() {}
|
|
19
|
+
|
|
20
|
+
private newModalItemId() {
|
|
21
|
+
return ++this.modalItemIdCounter;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public alert(options?: IModalAlertOptions, dialogOptions?: IModalDialogOptions) {
|
|
25
|
+
const id = this.newModalItemId();
|
|
26
|
+
const modalItem: IModalItem = {
|
|
27
|
+
id,
|
|
28
|
+
type: 'alert',
|
|
29
|
+
options,
|
|
30
|
+
dialogOptions,
|
|
31
|
+
};
|
|
32
|
+
this.modalItems.push(modalItem);
|
|
33
|
+
return new AppModalItem(this, modalItem);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
public confirm(
|
|
37
|
+
options?: IModalConfirmOptions,
|
|
38
|
+
dialogOptions?: IModalDialogOptions,
|
|
39
|
+
): Promise<boolean> {
|
|
40
|
+
return new Promise(resolve => {
|
|
41
|
+
const id = this.newModalItemId();
|
|
42
|
+
const modalItem: IModalItem = {
|
|
43
|
+
id,
|
|
44
|
+
type: 'confirm',
|
|
45
|
+
options: {
|
|
46
|
+
...options,
|
|
47
|
+
onCallback: (yes: boolean) => {
|
|
48
|
+
return resolve(yes);
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
dialogOptions,
|
|
52
|
+
};
|
|
53
|
+
this.modalItems.push(modalItem);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
public prompt(
|
|
58
|
+
options?: IModalPromptOptions,
|
|
59
|
+
dialogOptions?: IModalDialogOptions,
|
|
60
|
+
): Promise<string | undefined> {
|
|
61
|
+
return new Promise(resolve => {
|
|
62
|
+
const id = this.newModalItemId();
|
|
63
|
+
const modalItem: IModalItem = {
|
|
64
|
+
id,
|
|
65
|
+
type: 'prompt',
|
|
66
|
+
options: {
|
|
67
|
+
...options,
|
|
68
|
+
onCallback: (res: string | undefined) => {
|
|
69
|
+
return resolve(res);
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
dialogOptions,
|
|
73
|
+
};
|
|
74
|
+
this.modalItems.push(modalItem);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
public close(id: number) {
|
|
79
|
+
const [index] = this.findModalItem(id);
|
|
80
|
+
if (index === -1) return;
|
|
81
|
+
this.modalItems.splice(index, 1);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
protected findModalItem(id: number): [number, IModalItem | undefined] {
|
|
85
|
+
const index = this.modalItems.findIndex(item => item.id === id);
|
|
86
|
+
if (index === -1) return [index, undefined];
|
|
87
|
+
return [index, this.modalItems[index]];
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { IIconRecord } from 'zova-module-a-icon';
|
|
2
|
+
|
|
3
|
+
import type { ServiceAppModal } from '../service/appModal.js';
|
|
4
|
+
|
|
5
|
+
export type ModalType = 'alert' | 'confirm' | 'prompt';
|
|
6
|
+
export type AlertType = 'success' | 'info' | 'warning' | 'error';
|
|
7
|
+
|
|
8
|
+
export interface IModalDialogOptions {
|
|
9
|
+
maxWidth?: number | string;
|
|
10
|
+
closeOnBackdrop?: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface IModalAlertOptions {
|
|
14
|
+
type?: AlertType;
|
|
15
|
+
icon?: keyof IIconRecord;
|
|
16
|
+
title?: string;
|
|
17
|
+
text?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface IModalConfirmOptions {
|
|
21
|
+
icon?: keyof IIconRecord;
|
|
22
|
+
title?: string;
|
|
23
|
+
text?: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface IModalConfirmOptionsInner extends IModalConfirmOptions {
|
|
27
|
+
onCallback?: (yes: boolean) => void;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface IModalPromptOptions {
|
|
31
|
+
icon?: keyof IIconRecord;
|
|
32
|
+
title?: string;
|
|
33
|
+
text?: string;
|
|
34
|
+
defaultValue?: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface IModalPromptOptionsInner extends IModalPromptOptions {
|
|
38
|
+
onCallback?: (res: string | undefined) => void;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface IModalItem {
|
|
42
|
+
id: number;
|
|
43
|
+
type: ModalType;
|
|
44
|
+
options?: IModalAlertOptions | IModalConfirmOptionsInner | IModalPromptOptionsInner;
|
|
45
|
+
dialogOptions?: IModalDialogOptions;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
declare module 'zova' {
|
|
49
|
+
export interface BeanBase {
|
|
50
|
+
$appModal: ServiceAppModal;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './appModal.js';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../tsconfig.base",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"rootDir": "src",
|
|
5
|
+
"outDir": "dist",
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"declarationMap": true,
|
|
8
|
+
"emitDeclarationOnly": true,
|
|
9
|
+
"allowImportingTsExtensions": true,
|
|
10
|
+
"noEmit": false
|
|
11
|
+
},
|
|
12
|
+
"include": ["src", "src/.metadata/**/*"]
|
|
13
|
+
}
|
|
@@ -6,6 +6,7 @@ export * from '../bean/command.copy.jsx';
|
|
|
6
6
|
export * from '../bean/command.create.jsx';
|
|
7
7
|
export * from '../bean/command.delete.jsx';
|
|
8
8
|
export * from '../bean/command.edit.jsx';
|
|
9
|
+
export * from '../bean/command.prompt.jsx';
|
|
9
10
|
export * from '../bean/command.setValue.jsx';
|
|
10
11
|
export * from '../bean/command.view.jsx';
|
|
11
12
|
import { ICommandOptionsAlert } from '../bean/command.alert.jsx';
|
|
@@ -14,6 +15,7 @@ import { ICommandOptionsCopy } from '../bean/command.copy.jsx';
|
|
|
14
15
|
import { ICommandOptionsCreate } from '../bean/command.create.jsx';
|
|
15
16
|
import { ICommandOptionsDelete } from '../bean/command.delete.jsx';
|
|
16
17
|
import { ICommandOptionsEdit } from '../bean/command.edit.jsx';
|
|
18
|
+
import { ICommandOptionsPrompt } from '../bean/command.prompt.jsx';
|
|
17
19
|
import { ICommandOptionsSetValue } from '../bean/command.setValue.jsx';
|
|
18
20
|
import { ICommandOptionsView } from '../bean/command.view.jsx';
|
|
19
21
|
import 'zova-module-a-command';
|
|
@@ -26,6 +28,7 @@ declare module 'zova-module-a-command' {
|
|
|
26
28
|
'basic-commands:create': ICommandOptionsCreate;
|
|
27
29
|
'basic-commands:delete': ICommandOptionsDelete;
|
|
28
30
|
'basic-commands:edit': ICommandOptionsEdit;
|
|
31
|
+
'basic-commands:prompt': ICommandOptionsPrompt;
|
|
29
32
|
'basic-commands:setValue': ICommandOptionsSetValue;
|
|
30
33
|
'basic-commands:view': ICommandOptionsView;
|
|
31
34
|
}
|
|
@@ -100,6 +103,17 @@ declare module 'zova-module-basic-commands' {
|
|
|
100
103
|
get $onionOptions(): ICommandOptionsEdit;
|
|
101
104
|
}
|
|
102
105
|
|
|
106
|
+
export interface CommandPrompt {
|
|
107
|
+
/** @internal */
|
|
108
|
+
get scope(): ScopeModuleBasicCommands;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export interface CommandPrompt {
|
|
112
|
+
get $beanFullName(): 'basic-commands.command.prompt';
|
|
113
|
+
get $onionName(): 'basic-commands:prompt';
|
|
114
|
+
get $onionOptions(): ICommandOptionsPrompt;
|
|
115
|
+
}
|
|
116
|
+
|
|
103
117
|
export interface CommandSetValue {
|
|
104
118
|
/** @internal */
|
|
105
119
|
get scope(): ScopeModuleBasicCommands;
|
|
@@ -130,6 +144,7 @@ import { CommandCopy } from '../bean/command.copy.jsx';
|
|
|
130
144
|
import { CommandCreate } from '../bean/command.create.jsx';
|
|
131
145
|
import { CommandDelete } from '../bean/command.delete.jsx';
|
|
132
146
|
import { CommandEdit } from '../bean/command.edit.jsx';
|
|
147
|
+
import { CommandPrompt } from '../bean/command.prompt.jsx';
|
|
133
148
|
import { CommandSetValue } from '../bean/command.setValue.jsx';
|
|
134
149
|
import { CommandView } from '../bean/command.view.jsx';
|
|
135
150
|
import 'zova';
|
|
@@ -141,6 +156,7 @@ declare module 'zova' {
|
|
|
141
156
|
'basic-commands.command.create': CommandCreate;
|
|
142
157
|
'basic-commands.command.delete': CommandDelete;
|
|
143
158
|
'basic-commands.command.edit': CommandEdit;
|
|
159
|
+
'basic-commands.command.prompt': CommandPrompt;
|
|
144
160
|
'basic-commands.command.setValue': CommandSetValue;
|
|
145
161
|
'basic-commands.command.view': CommandView;
|
|
146
162
|
}
|
|
@@ -1,33 +1,27 @@
|
|
|
1
1
|
import type { ICommandExecute, ICommandOptionsBase } from 'zova-module-a-command';
|
|
2
2
|
import type { NextCommandExecute } from 'zova-module-a-command';
|
|
3
3
|
import type { IJsxRenderContextBase } from 'zova-module-a-openapi';
|
|
4
|
+
import type { IModalAlertOptions, IModalDialogOptions } from 'zova-module-basic-app';
|
|
4
5
|
|
|
5
6
|
import { BeanBase } from 'zova';
|
|
6
7
|
import { Command } from 'zova-module-a-command';
|
|
7
8
|
|
|
8
9
|
export type TypeCommandAlertResult = unknown;
|
|
9
10
|
|
|
10
|
-
export interface ICommandOptionsAlert
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
export interface ICommandOptionsAlert
|
|
12
|
+
extends ICommandOptionsBase<TypeCommandAlertResult>, IModalAlertOptions {
|
|
13
|
+
dialogOptions?: IModalDialogOptions;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
|
-
@Command<ICommandOptionsAlert>(
|
|
16
|
+
@Command<ICommandOptionsAlert>()
|
|
16
17
|
export class CommandAlert extends BeanBase implements ICommandExecute {
|
|
17
18
|
execute(
|
|
18
19
|
options: ICommandOptionsAlert,
|
|
19
|
-
|
|
20
|
+
renderContext: IJsxRenderContextBase,
|
|
20
21
|
next: NextCommandExecute,
|
|
21
22
|
) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
window.alert(options.message);
|
|
25
|
-
} else {
|
|
26
|
-
setTimeout(() => {
|
|
27
|
-
// eslint-disable-next-line no-alert
|
|
28
|
-
window.alert(options.message);
|
|
29
|
-
}, 0);
|
|
30
|
-
}
|
|
23
|
+
const { $host } = renderContext;
|
|
24
|
+
$host.$appModal.alert(options, options.dialogOptions);
|
|
31
25
|
return next();
|
|
32
26
|
}
|
|
33
27
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { IModalConfirmOptions, IModalDialogOptions } from 'zova-module-basic-app';
|
|
2
|
+
|
|
1
3
|
import { BeanBase } from 'zova';
|
|
2
4
|
import {
|
|
3
5
|
Command,
|
|
@@ -7,21 +9,22 @@ import {
|
|
|
7
9
|
} from 'zova-module-a-command';
|
|
8
10
|
import { IJsxRenderContextBase } from 'zova-module-a-openapi';
|
|
9
11
|
|
|
10
|
-
export type TypeCommandConfirmResult = boolean
|
|
12
|
+
export type TypeCommandConfirmResult = Promise<boolean>;
|
|
11
13
|
|
|
12
|
-
export interface ICommandOptionsConfirm
|
|
13
|
-
|
|
14
|
+
export interface ICommandOptionsConfirm
|
|
15
|
+
extends ICommandOptionsBase<TypeCommandConfirmResult>, IModalConfirmOptions {
|
|
16
|
+
dialogOptions?: IModalDialogOptions;
|
|
14
17
|
}
|
|
15
18
|
|
|
16
19
|
@Command<ICommandOptionsConfirm>()
|
|
17
20
|
export class CommandConfirm extends BeanBase implements ICommandExecute {
|
|
18
|
-
execute(
|
|
21
|
+
async execute(
|
|
19
22
|
options: ICommandOptionsConfirm,
|
|
20
|
-
|
|
23
|
+
renderContext: IJsxRenderContextBase,
|
|
21
24
|
next: NextCommandExecute,
|
|
22
25
|
) {
|
|
23
|
-
|
|
24
|
-
const res =
|
|
26
|
+
const { $host } = renderContext;
|
|
27
|
+
const res = await $host.$appModal.confirm(options, options.dialogOptions);
|
|
25
28
|
return next(res);
|
|
26
29
|
}
|
|
27
30
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ICommandExecute,
|
|
3
|
+
ICommandOptionsBase,
|
|
4
|
+
NextCommandExecute,
|
|
5
|
+
} from 'zova-module-a-command';
|
|
6
|
+
import type { IJsxRenderContextBase } from 'zova-module-a-openapi';
|
|
7
|
+
import type { IModalDialogOptions, IModalPromptOptions } from 'zova-module-basic-app';
|
|
8
|
+
|
|
9
|
+
import { BeanBase } from 'zova';
|
|
10
|
+
import { Command } from 'zova-module-a-command';
|
|
11
|
+
|
|
12
|
+
export type TypeCommandPromptResult = unknown;
|
|
13
|
+
|
|
14
|
+
export interface ICommandOptionsPrompt
|
|
15
|
+
extends ICommandOptionsBase<TypeCommandPromptResult>, IModalPromptOptions {
|
|
16
|
+
dialogOptions?: IModalDialogOptions;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@Command<ICommandOptionsPrompt>()
|
|
20
|
+
export class CommandPrompt extends BeanBase implements ICommandExecute {
|
|
21
|
+
async execute(
|
|
22
|
+
options: ICommandOptionsPrompt,
|
|
23
|
+
renderContext: IJsxRenderContextBase,
|
|
24
|
+
next: NextCommandExecute,
|
|
25
|
+
) {
|
|
26
|
+
const { $host } = renderContext;
|
|
27
|
+
const res = await $host.$appModal.prompt(options, options.dialogOptions);
|
|
28
|
+
return next(res);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "zova-module-basic-details",
|
|
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 && npm run clean"
|
|
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-details"
|
|
52
|
+
}
|
package/zova/src/suite/cabloy-basic/modules/basic-details/src/.metadata/component/actionCreate.ts
ADDED
|
@@ -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 { ControllerActionCreateProps } from '../../component/actionCreate/controller.jsx';
|
|
7
|
+
|
|
8
|
+
import { ControllerActionCreate } from '../../component/actionCreate/controller.jsx';
|
|
9
|
+
export type ZActionCreateProps = {
|
|
10
|
+
controllerRef?: (ref: ControllerActionCreate) => void;
|
|
11
|
+
} & ControllerActionCreateProps;
|
|
12
|
+
|
|
13
|
+
type ControllerInnerProps = TypeControllerInnerProps<
|
|
14
|
+
ControllerActionCreateProps,
|
|
15
|
+
keyof typeof ControllerActionCreate.$propsDefault
|
|
16
|
+
>;
|
|
17
|
+
declare module 'zova-module-basic-details' {
|
|
18
|
+
export interface ControllerActionCreate {
|
|
19
|
+
$props: ControllerInnerProps;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const ZActionCreate = defineComponent((_props: ZActionCreateProps) => {
|
|
24
|
+
useController(ControllerActionCreate, undefined, undefined);
|
|
25
|
+
return () => {};
|
|
26
|
+
}, prepareComponentOptions(ControllerActionCreate.$componentOptions));
|
|
27
|
+
declare module 'zova-module-a-bean' {
|
|
28
|
+
export interface IVonaComponentRecord {
|
|
29
|
+
'basic-details:actionCreate': ControllerActionCreateProps;
|
|
30
|
+
}
|
|
31
|
+
}
|
package/zova/src/suite/cabloy-basic/modules/basic-details/src/.metadata/component/blockDetails.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { TypeControllerInnerProps } from 'zova';
|
|
2
|
+
|
|
3
|
+
import { defineComponent } from 'vue';
|
|
4
|
+
import { prepareComponentOptions, useController } from 'zova';
|
|
5
|
+
|
|
6
|
+
import type { ControllerBlockDetailsProps } from '../../component/blockDetails/controller.jsx';
|
|
7
|
+
|
|
8
|
+
import { ControllerBlockDetails } from '../../component/blockDetails/controller.jsx';
|
|
9
|
+
export type ZBlockDetailsProps<TData extends {} = {}> = {
|
|
10
|
+
controllerRef?: (ref: ControllerBlockDetails<TData>) => void;
|
|
11
|
+
} & ControllerBlockDetailsProps<TData>;
|
|
12
|
+
|
|
13
|
+
type ControllerInnerProps<TData extends {} = {}> = TypeControllerInnerProps<
|
|
14
|
+
ControllerBlockDetailsProps<TData>,
|
|
15
|
+
keyof typeof ControllerBlockDetails.$propsDefault
|
|
16
|
+
>;
|
|
17
|
+
declare module 'zova-module-basic-details' {
|
|
18
|
+
export interface ControllerBlockDetails<TData extends {} = {}> {
|
|
19
|
+
$props: ControllerInnerProps<TData>;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const ZBlockDetails = defineComponent(
|
|
24
|
+
<TData extends {} = {}>(_props: ZBlockDetailsProps<TData>) => {
|
|
25
|
+
useController(ControllerBlockDetails, undefined, undefined);
|
|
26
|
+
return () => {};
|
|
27
|
+
},
|
|
28
|
+
prepareComponentOptions(ControllerBlockDetails.$componentOptions),
|
|
29
|
+
);
|
|
30
|
+
declare module 'zova-module-a-bean' {
|
|
31
|
+
export interface IVonaComponentRecord {
|
|
32
|
+
'basic-details:blockDetails': ControllerBlockDetailsProps;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -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 { ControllerBlockDetailsToolbarBulkProps } from '../../component/blockDetailsToolbarBulk/controller.jsx';
|
|
7
|
+
|
|
8
|
+
import { ControllerBlockDetailsToolbarBulk } from '../../component/blockDetailsToolbarBulk/controller.jsx';
|
|
9
|
+
export type ZBlockDetailsToolbarBulkProps = {
|
|
10
|
+
controllerRef?: (ref: ControllerBlockDetailsToolbarBulk) => void;
|
|
11
|
+
} & ControllerBlockDetailsToolbarBulkProps;
|
|
12
|
+
|
|
13
|
+
type ControllerInnerProps = TypeControllerInnerProps<
|
|
14
|
+
ControllerBlockDetailsToolbarBulkProps,
|
|
15
|
+
keyof typeof ControllerBlockDetailsToolbarBulk.$propsDefault
|
|
16
|
+
>;
|
|
17
|
+
declare module 'zova-module-basic-details' {
|
|
18
|
+
export interface ControllerBlockDetailsToolbarBulk {
|
|
19
|
+
$props: ControllerInnerProps;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const ZBlockDetailsToolbarBulk = defineComponent((_props: ZBlockDetailsToolbarBulkProps) => {
|
|
24
|
+
useController(ControllerBlockDetailsToolbarBulk, undefined, undefined);
|
|
25
|
+
return () => {};
|
|
26
|
+
}, prepareComponentOptions(ControllerBlockDetailsToolbarBulk.$componentOptions));
|
|
27
|
+
declare module 'zova-module-a-bean' {
|
|
28
|
+
export interface IVonaComponentRecord {
|
|
29
|
+
'basic-details:blockDetailsToolbarBulk': ControllerBlockDetailsToolbarBulkProps;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -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 { ControllerFormFieldDetailsProps } from '../../component/formFieldDetails/controller.jsx';
|
|
7
|
+
|
|
8
|
+
import { ControllerFormFieldDetails } from '../../component/formFieldDetails/controller.jsx';
|
|
9
|
+
export type ZFormFieldDetailsProps = {
|
|
10
|
+
controllerRef?: (ref: ControllerFormFieldDetails) => void;
|
|
11
|
+
} & ControllerFormFieldDetailsProps;
|
|
12
|
+
|
|
13
|
+
type ControllerInnerProps = TypeControllerInnerProps<
|
|
14
|
+
ControllerFormFieldDetailsProps,
|
|
15
|
+
keyof typeof ControllerFormFieldDetails.$propsDefault
|
|
16
|
+
>;
|
|
17
|
+
declare module 'zova-module-basic-details' {
|
|
18
|
+
export interface ControllerFormFieldDetails {
|
|
19
|
+
$props: ControllerInnerProps;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const ZFormFieldDetails = defineComponent((_props: ZFormFieldDetailsProps) => {
|
|
24
|
+
useController(ControllerFormFieldDetails, undefined, undefined);
|
|
25
|
+
return () => {};
|
|
26
|
+
}, prepareComponentOptions(ControllerFormFieldDetails.$componentOptions));
|
|
27
|
+
declare module 'zova-module-a-bean' {
|
|
28
|
+
export interface IVonaComponentRecord {
|
|
29
|
+
'basic-details:formFieldDetails': ControllerFormFieldDetailsProps;
|
|
30
|
+
}
|
|
31
|
+
}
|