zova-module-rest-resource 5.1.52 → 5.1.54
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/dist/.metadata/component/resourcePickerContext.d.ts +26 -0
- package/dist/.metadata/component/resourcePickerContext.d.ts.map +1 -0
- package/dist/.metadata/index.d.ts +48 -4
- package/dist/.metadata/index.d.ts.map +1 -1
- package/dist/.metadata/page/resourcePicker.d.ts +11 -0
- package/dist/.metadata/page/resourcePicker.d.ts.map +1 -0
- package/dist/component/resourcePickerContext/controller.d.ts +13 -0
- package/dist/component/resourcePickerContext/controller.d.ts.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +179 -49
- package/dist/index.js.map +1 -1
- package/dist/lib/resourcePicker.d.ts +31 -0
- package/dist/lib/resourcePicker.d.ts.map +1 -0
- package/dist/page/resourcePicker/controller.d.ts +20 -0
- package/dist/page/resourcePicker/controller.d.ts.map +1 -0
- package/dist/routes.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/.metadata/component/resourcePickerContext.ts +31 -0
- package/src/.metadata/index.ts +48 -5
- package/src/.metadata/page/resourcePicker.ts +16 -0
- package/src/component/resourcePickerContext/controller.tsx +26 -0
- package/src/index.ts +2 -0
- package/src/lib/resourcePicker.ts +43 -0
- package/src/page/resourcePicker/controller.tsx +85 -0
- package/src/routes.ts +9 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { TypeControllerInnerProps } from 'zova';
|
|
2
|
+
import type { ControllerResourcePickerContextProps } from '../../component/resourcePickerContext/controller.jsx';
|
|
3
|
+
import { ControllerResourcePickerContext } from '../../component/resourcePickerContext/controller.jsx';
|
|
4
|
+
export type ZResourcePickerContextProps = {
|
|
5
|
+
controllerRef?: (ref: ControllerResourcePickerContext) => void;
|
|
6
|
+
} & ControllerResourcePickerContextProps;
|
|
7
|
+
type ControllerInnerProps = TypeControllerInnerProps<ControllerResourcePickerContextProps, keyof typeof ControllerResourcePickerContext.$propsDefault>;
|
|
8
|
+
declare module 'zova-module-rest-resource' {
|
|
9
|
+
interface ControllerResourcePickerContext {
|
|
10
|
+
$props: ControllerInnerProps;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export declare const ZResourcePickerContext: import("vue").DefineSetupFnComponent<ZResourcePickerContextProps, import("vue").EmitsOptions, import("vue").SlotsType<Record<string, any>>, {
|
|
14
|
+
controllerRef?: (ref: ControllerResourcePickerContext) => void;
|
|
15
|
+
} & ControllerResourcePickerContextProps & ({
|
|
16
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
17
|
+
} | {
|
|
18
|
+
[x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
|
|
19
|
+
}), import("vue").PublicProps>;
|
|
20
|
+
declare module 'zova-module-a-bean' {
|
|
21
|
+
interface IVonaComponentRecord {
|
|
22
|
+
'rest-resource:resourcePickerContext': ControllerResourcePickerContextProps;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=resourcePickerContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resourcePickerContext.d.ts","sourceRoot":"","sources":["../../../src/.metadata/component/resourcePickerContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,MAAM,CAAC;AAKrD,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,sDAAsD,CAAC;AAEjH,OAAO,EAAE,+BAA+B,EAAE,MAAM,sDAAsD,CAAC;AACvG,MAAM,MAAM,2BAA2B,GAAG;IACxC,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,+BAA+B,KAAK,IAAI,CAAC;CAChE,GAAG,oCAAoC,CAAC;AAEzC,KAAK,oBAAoB,GAAG,wBAAwB,CAClD,oCAAoC,EACpC,MAAM,OAAO,+BAA+B,CAAC,aAAa,CAC3D,CAAC;AACF,OAAO,QAAQ,2BAA2B,CAAC;IACzC,UAAiB,+BAA+B;QAC9C,MAAM,EAAE,oBAAoB,CAAC;KAC9B;CACF;AAED,eAAO,MAAM,sBAAsB;oBAbjB,CAAC,GAAG,EAAE,+BAA+B,KAAK,IAAI;;;;;8BAgBnC,CAAC;AAC9B,OAAO,QAAQ,oBAAoB,CAAC;IAClC,UAAiB,oBAAoB;QACnC,qCAAqC,EAAE,oCAAoC,CAAC;KAC7E;CACF"}
|
|
@@ -18,7 +18,7 @@ declare module 'zova-module-rest-resource' {
|
|
|
18
18
|
}
|
|
19
19
|
/** model: end */
|
|
20
20
|
/** model: begin */
|
|
21
|
-
import { ModelResource } from '../model/resource.js';
|
|
21
|
+
import type { ModelResource } from '../model/resource.js';
|
|
22
22
|
import 'zova';
|
|
23
23
|
declare module 'zova' {
|
|
24
24
|
interface IBeanRecordGeneral {
|
|
@@ -27,29 +27,39 @@ declare module 'zova' {
|
|
|
27
27
|
}
|
|
28
28
|
/** model: end */
|
|
29
29
|
/** controller: begin */
|
|
30
|
+
export * from '../component/resourcePickerContext/controller.jsx';
|
|
30
31
|
export * from '../page/entry/controller.jsx';
|
|
31
32
|
export * from '../page/entryCreate/controller.jsx';
|
|
32
33
|
export * from '../page/resource/controller.jsx';
|
|
34
|
+
export * from '../page/resourcePicker/controller.jsx';
|
|
33
35
|
import 'zova';
|
|
34
36
|
declare module 'zova' {
|
|
35
37
|
}
|
|
36
38
|
declare module 'zova-module-rest-resource' {
|
|
39
|
+
interface ControllerResourcePickerContext {
|
|
40
|
+
}
|
|
37
41
|
interface ControllerPageEntry {
|
|
38
42
|
}
|
|
39
43
|
interface ControllerPageResource {
|
|
40
44
|
}
|
|
45
|
+
interface ControllerPageResourcePicker {
|
|
46
|
+
}
|
|
41
47
|
}
|
|
42
48
|
/** controller: end */
|
|
43
49
|
/** controller: begin */
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
50
|
+
import type { ControllerResourcePickerContext } from '../component/resourcePickerContext/controller.jsx';
|
|
51
|
+
import type { ControllerPageEntry } from '../page/entry/controller.jsx';
|
|
52
|
+
import type { ControllerPageEntryCreate } from '../page/entryCreate/controller.jsx';
|
|
53
|
+
import type { ControllerPageResource } from '../page/resource/controller.jsx';
|
|
54
|
+
import type { ControllerPageResourcePicker } from '../page/resourcePicker/controller.jsx';
|
|
47
55
|
import 'zova';
|
|
48
56
|
declare module 'zova' {
|
|
49
57
|
interface IBeanRecordLocal {
|
|
58
|
+
'rest-resource.controller.resourcePickerContext': ControllerResourcePickerContext;
|
|
50
59
|
'rest-resource.controller.pageEntry': ControllerPageEntry;
|
|
51
60
|
'rest-resource.controller.pageEntryCreate': ControllerPageEntryCreate;
|
|
52
61
|
'rest-resource.controller.pageResource': ControllerPageResource;
|
|
62
|
+
'rest-resource.controller.pageResourcePicker': ControllerPageResourcePicker;
|
|
53
63
|
}
|
|
54
64
|
}
|
|
55
65
|
/** controller: end */
|
|
@@ -60,6 +70,8 @@ export * from './page/entryCreate.js';
|
|
|
60
70
|
import { NSControllerPageEntryCreate } from './page/entryCreate.js';
|
|
61
71
|
export * from './page/resource.js';
|
|
62
72
|
import { NSControllerPageResource } from './page/resource.js';
|
|
73
|
+
export * from './page/resourcePicker.js';
|
|
74
|
+
import { NSControllerPageResourcePicker } from './page/resourcePicker.js';
|
|
63
75
|
export * from '../routes.js';
|
|
64
76
|
import { TypePagePathSchema } from 'zova-module-a-router';
|
|
65
77
|
import 'zova';
|
|
@@ -68,11 +80,13 @@ declare module 'zova-module-a-router' {
|
|
|
68
80
|
'/rest/resource/:resource/:id/:formScene?': TypePagePathSchema<NSControllerPageEntry.ParamsInput, undefined>;
|
|
69
81
|
'/rest/resource/:resource/create': TypePagePathSchema<NSControllerPageEntryCreate.ParamsInput, undefined>;
|
|
70
82
|
'/rest/resource/:resource': TypePagePathSchema<NSControllerPageResource.ParamsInput, undefined>;
|
|
83
|
+
'/rest/resource/:resource/picker': TypePagePathSchema<NSControllerPageResourcePicker.ParamsInput, undefined>;
|
|
71
84
|
}
|
|
72
85
|
interface IPageNameRecord {
|
|
73
86
|
'rest-resource:entry': TypePagePathSchema<NSControllerPageEntry.ParamsInput, undefined>;
|
|
74
87
|
'rest-resource:entryCreate': TypePagePathSchema<NSControllerPageEntryCreate.ParamsInput, undefined>;
|
|
75
88
|
'rest-resource:resource': TypePagePathSchema<NSControllerPageResource.ParamsInput, undefined>;
|
|
89
|
+
'rest-resource:resourcePicker': TypePagePathSchema<NSControllerPageResourcePicker.ParamsInput, undefined>;
|
|
76
90
|
}
|
|
77
91
|
}
|
|
78
92
|
export declare const pagePathSchemas: {};
|
|
@@ -96,6 +110,11 @@ export declare const pageNameSchemas: {
|
|
|
96
110
|
resource: import("zod").ZodString;
|
|
97
111
|
}, import("zod/v4/core").$strip>;
|
|
98
112
|
};
|
|
113
|
+
'rest-resource:resourcePicker': {
|
|
114
|
+
params: import("zod").ZodObject<{
|
|
115
|
+
resource: import("zod").ZodString;
|
|
116
|
+
}, import("zod/v4/core").$strip>;
|
|
117
|
+
};
|
|
99
118
|
};
|
|
100
119
|
declare module 'zova-module-rest-resource' {
|
|
101
120
|
interface ControllerPageEntry {
|
|
@@ -107,8 +126,33 @@ declare module 'zova-module-rest-resource' {
|
|
|
107
126
|
interface ControllerPageResource {
|
|
108
127
|
$params: NSControllerPageResource.ParamsOutput;
|
|
109
128
|
}
|
|
129
|
+
interface ControllerPageResourcePicker {
|
|
130
|
+
$params: NSControllerPageResourcePicker.ParamsOutput;
|
|
131
|
+
}
|
|
110
132
|
}
|
|
111
133
|
/** pages: end */
|
|
134
|
+
/** components: begin */
|
|
135
|
+
export * from './component/resourcePickerContext.js';
|
|
136
|
+
import { ZResourcePickerContext } from './component/resourcePickerContext.js';
|
|
137
|
+
export declare const components: {
|
|
138
|
+
resourcePickerContext: import("vue").DefineSetupFnComponent<import("zova-module-rest-resource").ZResourcePickerContextProps, import("vue").EmitsOptions, import("vue").SlotsType<Record<string, any>>, {
|
|
139
|
+
controllerRef?: (ref: ControllerResourcePickerContext) => void;
|
|
140
|
+
} & import("zova-module-rest-resource").ControllerResourcePickerContextProps & ({
|
|
141
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
142
|
+
} | {
|
|
143
|
+
[x: `on${Capitalize<string>}`]: ((...args: never) => any) | undefined;
|
|
144
|
+
}), import("vue").PublicProps>;
|
|
145
|
+
};
|
|
146
|
+
import 'zova';
|
|
147
|
+
declare module 'zova' {
|
|
148
|
+
interface IComponentRecord {
|
|
149
|
+
'rest-resource:resourcePickerContext': ControllerResourcePickerContext;
|
|
150
|
+
}
|
|
151
|
+
interface IZovaComponentRecord {
|
|
152
|
+
'rest-resource:resourcePickerContext': typeof ZResourcePickerContext;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
/** components: end */
|
|
112
156
|
/** scope: begin */
|
|
113
157
|
import { BeanScopeBase, type BeanScopeUtil } from 'zova';
|
|
114
158
|
export declare class ScopeModuleRestResource extends BeanScopeBase {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/.metadata/index.ts"],"names":[],"mappings":"AACA,mBAAmB;AACnB,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,qBAAqB,CAAC;AAC7B,OAAO,QAAQ,qBAAqB,CAAC;IAEjC,UAAiB,YAAY;QAC3B,wBAAwB,EAAE,qBAAqB,CAAC;KACjD;CAGJ;AACD,OAAO,QAAQ,2BAA2B,CAAC;IAEnC,UAAiB,aAAa;KAG7B;IAED,UAAiB,aAAa;QAC5B,IAAI,aAAa,IAAI,8BAA8B,CAAC;QACpD,IAAI,UAAU,IAAI,wBAAwB,CAAC;QAC3C,IAAI,aAAa,IAAI,qBAAqB,CAAC;KAC5C;CACR;AACD,iBAAiB;AACjB,mBAAmB;AACnB,OAAO,EAAE,aAAa,EAAE,MAAM,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AAa,EAAE,KAAK,aAAa,EAAE,MAAM,MAAM,CAAC;AAGzD,qBACa,uBAAwB,SAAQ,aAAa;CAAG;AAE7D,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,aAAa,CAAC;CACrB;AAED,OAAO,MAAM,CAAC;AACd,OAAO,QAAQ,MAAM,CAAC;IACpB,UAAiB,gBAAgB;QAC/B,eAAe,EAAE,uBAAuB,CAAC;KAC1C;CAOF;AAED,iBAAiB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ControllerPageResourcePickerSchemaParams } from '../../page/resourcePicker/controller.jsx';
|
|
3
|
+
export declare namespace NSControllerPageResourcePicker {
|
|
4
|
+
const paramsSchema: z.ZodObject<{
|
|
5
|
+
resource: z.ZodString;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
type ParamsInput = z.input<typeof ControllerPageResourcePickerSchemaParams>;
|
|
8
|
+
type ParamsOutput = z.output<typeof ControllerPageResourcePickerSchemaParams>;
|
|
9
|
+
}
|
|
10
|
+
export declare const ZPageResourcePicker: import("vue").DefineSetupFnComponent<Record<string, any>, {}, {}, Record<string, any> & {}, import("vue").PublicProps>;
|
|
11
|
+
//# sourceMappingURL=resourcePicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resourcePicker.d.ts","sourceRoot":"","sources":["../../../src/.metadata/page/resourcePicker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,wCAAwC,EAAE,MAAM,0CAA0C,CAAC;AACpG,yBAAiB,8BAA8B,CAAC;IACvC,MAAM,YAAY;;qBAA2C,CAAC;IACrE,KAAY,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wCAAwC,CAAC,CAAC;IACnF,KAAY,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,wCAAwC,CAAC,CAAC;CACtF;AAED,eAAO,MAAM,mBAAmB,wHAI/B,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BeanControllerBase } from 'zova';
|
|
2
|
+
import type { IResourcePickerPageContext } from '../../page/resourcePicker/controller.js';
|
|
3
|
+
export interface ControllerResourcePickerContextProps {
|
|
4
|
+
context: IResourcePickerPageContext;
|
|
5
|
+
}
|
|
6
|
+
export declare class ControllerResourcePickerContext extends BeanControllerBase {
|
|
7
|
+
static $propsDefault: {};
|
|
8
|
+
protected __init__(): Promise<void>;
|
|
9
|
+
protected render(): import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}> | undefined;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../../src/component/resourcePickerContext/controller.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAC;AAG1C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAI1F,MAAM,WAAW,oCAAoC;IACnD,OAAO,EAAE,0BAA0B,CAAC;CACrC;AAED,qBACa,+BAAgC,SAAQ,kBAAkB;IACrE,MAAM,CAAC,aAAa,KAAM;cAEV,QAAQ;IAOxB,SAAS,CAAC,MAAM;;;CAGjB"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qCAAqC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { BeanControllerPageBase, BeanInfo, BeanScopeBase, Use, UseScope, createZovaComponentAsync, createZovaComponentPage, deepExtend, usePrepareArg } from "zova";
|
|
1
|
+
import { BeanControllerBase, BeanControllerPageBase, BeanInfo, BeanScopeBase, Use, UseScope, createZovaComponentAsync, createZovaComponentPage, deepExtend, prepareComponentOptions, useController, usePrepareArg } from "zova";
|
|
2
2
|
import { hashkey, isNil } from "@cabloy/utils";
|
|
3
3
|
import { formMetaFromFormScene, formSceneFromFormMeta } from "zova-module-a-form";
|
|
4
4
|
import { $QueryEnsureLoaded, BeanModelBase, Model } from "zova-module-a-model";
|
|
5
5
|
import { SymbolOpenapiSchemaName } from "zova-module-a-openapi";
|
|
6
|
-
import {
|
|
6
|
+
import { Controller, Scope } from "zova-module-a-bean";
|
|
7
|
+
import { createVNode, defineComponent, isVNode } from "vue";
|
|
7
8
|
import { z } from "zod";
|
|
8
9
|
import { ZovaJsx } from "zova-jsx";
|
|
9
|
-
import { Controller, Scope } from "zova-module-a-bean";
|
|
10
10
|
import { Virtual } from "zova-core";
|
|
11
11
|
//#region src/lib/deleteRequest.ts
|
|
12
12
|
function prepareDeleteRequestConfig(config, body) {
|
|
@@ -38,14 +38,14 @@ function validateSelectedIds(ids) {
|
|
|
38
38
|
}
|
|
39
39
|
//#endregion
|
|
40
40
|
//#region src/model/resource.ts
|
|
41
|
-
var _dec$
|
|
42
|
-
var _dec2$
|
|
43
|
-
var _dec3$
|
|
44
|
-
var _dec4$
|
|
45
|
-
var _class$
|
|
46
|
-
var _class2$
|
|
47
|
-
var _descriptor;
|
|
48
|
-
function _initializerDefineProperty(e, i, r, l) {
|
|
41
|
+
var _dec$6;
|
|
42
|
+
var _dec2$6;
|
|
43
|
+
var _dec3$4;
|
|
44
|
+
var _dec4$3;
|
|
45
|
+
var _class$6;
|
|
46
|
+
var _class2$3;
|
|
47
|
+
var _descriptor$1;
|
|
48
|
+
function _initializerDefineProperty$1(e, i, r, l) {
|
|
49
49
|
r && Object.defineProperty(e, i, {
|
|
50
50
|
enumerable: r.enumerable,
|
|
51
51
|
configurable: r.configurable,
|
|
@@ -53,7 +53,7 @@ function _initializerDefineProperty(e, i, r, l) {
|
|
|
53
53
|
value: r.initializer ? r.initializer.call(l) : void 0
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
|
-
function _applyDecoratedDescriptor$
|
|
56
|
+
function _applyDecoratedDescriptor$3(i, e, r, n, l) {
|
|
57
57
|
var a = {};
|
|
58
58
|
return Object.keys(n).forEach(function(i) {
|
|
59
59
|
a[i] = n[i];
|
|
@@ -61,7 +61,7 @@ function _applyDecoratedDescriptor$2(i, e, r, n, l) {
|
|
|
61
61
|
return n(i, e, r) || r;
|
|
62
62
|
}, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a;
|
|
63
63
|
}
|
|
64
|
-
var ModelResource = (_dec$
|
|
64
|
+
var ModelResource = (_dec$6 = Model({ enableSelector: true }), _dec2$6 = BeanInfo({ module: "rest-resource" }), _dec3$4 = UseScope("a-openapi"), _dec4$3 = Reflect.metadata("design:type", typeof ScopeModuleAOpenapi === "undefined" ? Object : ScopeModuleAOpenapi), _dec$6(_class$6 = _dec2$6(_class$6 = (_class2$3 = class ModelResource extends BeanModelBase {
|
|
65
65
|
constructor(...args) {
|
|
66
66
|
super(...args);
|
|
67
67
|
this.resource = void 0;
|
|
@@ -75,7 +75,7 @@ var ModelResource = (_dec$4 = Model({ enableSelector: true }), _dec2$4 = BeanInf
|
|
|
75
75
|
this.schemaOrder = void 0;
|
|
76
76
|
this.schemaRow = void 0;
|
|
77
77
|
this.schemaPages = void 0;
|
|
78
|
-
_initializerDefineProperty(this, "$$scopeOpenapi", _descriptor, this);
|
|
78
|
+
_initializerDefineProperty$1(this, "$$scopeOpenapi", _descriptor$1, this);
|
|
79
79
|
}
|
|
80
80
|
async __init__(resource) {
|
|
81
81
|
if (!resource) throw new Error("resource not specified");
|
|
@@ -296,22 +296,40 @@ var ModelResource = (_dec$4 = Model({ enableSelector: true }), _dec2$4 = BeanInf
|
|
|
296
296
|
if (!queryBootstrap?.data) throw new Error(`not found sdk of resource: ${this.resource}`);
|
|
297
297
|
this.resourceApi = this.sys.util.parseResourceApi(this.resource, queryBootstrap.data.apiPath);
|
|
298
298
|
}
|
|
299
|
-
}, _descriptor = _applyDecoratedDescriptor$
|
|
299
|
+
}, _descriptor$1 = _applyDecoratedDescriptor$3(_class2$3.prototype, "$$scopeOpenapi", [_dec3$4, _dec4$3], {
|
|
300
300
|
configurable: true,
|
|
301
301
|
enumerable: true,
|
|
302
302
|
writable: true,
|
|
303
303
|
initializer: null
|
|
304
|
-
}), _class2$
|
|
304
|
+
}), _class2$3)) || _class$6) || _class$6);
|
|
305
|
+
//#endregion
|
|
306
|
+
//#region src/lib/resourcePicker.ts
|
|
307
|
+
var resourcePickerPageContextKey = "$resourcePickerPageContext";
|
|
308
|
+
var resourcePickerPageHostKey = "$resourcePickerPageHost";
|
|
309
|
+
//#endregion
|
|
310
|
+
//#region src/component/resourcePickerContext/controller.tsx
|
|
311
|
+
var _dec$5;
|
|
312
|
+
var _dec2$5;
|
|
313
|
+
var _class$5;
|
|
314
|
+
var _ControllerResourcePickerContext;
|
|
315
|
+
var ControllerResourcePickerContext = (_dec$5 = Controller(), _dec2$5 = BeanInfo({ module: "rest-resource" }), _dec$5(_class$5 = _dec2$5(_class$5 = (_ControllerResourcePickerContext = class ControllerResourcePickerContext extends BeanControllerBase {
|
|
316
|
+
async __init__() {
|
|
317
|
+
this.bean._setBean("$resourcePickerPageContext", this.$props.context);
|
|
318
|
+
}
|
|
319
|
+
render() {
|
|
320
|
+
return this.$slotDefault?.();
|
|
321
|
+
}
|
|
322
|
+
}, _ControllerResourcePickerContext.$propsDefault = {}, _ControllerResourcePickerContext)) || _class$5) || _class$5);
|
|
305
323
|
//#endregion
|
|
306
324
|
//#region src/page/entry/controller.tsx
|
|
307
|
-
var _dec$
|
|
308
|
-
var _dec2$
|
|
309
|
-
var _dec3$
|
|
310
|
-
var _dec4$
|
|
311
|
-
var _dec5$
|
|
312
|
-
var _class$
|
|
313
|
-
var _class2$
|
|
314
|
-
function _applyDecoratedDescriptor$
|
|
325
|
+
var _dec$4;
|
|
326
|
+
var _dec2$4;
|
|
327
|
+
var _dec3$3;
|
|
328
|
+
var _dec4$2;
|
|
329
|
+
var _dec5$2;
|
|
330
|
+
var _class$4;
|
|
331
|
+
var _class2$2;
|
|
332
|
+
function _applyDecoratedDescriptor$2(i, e, r, n, l) {
|
|
315
333
|
var a = {};
|
|
316
334
|
return Object.keys(n).forEach(function(i) {
|
|
317
335
|
a[i] = n[i];
|
|
@@ -319,8 +337,8 @@ function _applyDecoratedDescriptor$1(i, e, r, n, l) {
|
|
|
319
337
|
return n(i, e, r) || r;
|
|
320
338
|
}, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a;
|
|
321
339
|
}
|
|
322
|
-
var ZPage$
|
|
323
|
-
function _isSlot$
|
|
340
|
+
var ZPage$2 = createZovaComponentAsync("home-base", "page");
|
|
341
|
+
function _isSlot$2(s) {
|
|
324
342
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
325
343
|
}
|
|
326
344
|
var ControllerPageEntrySchemaParams = z.object({
|
|
@@ -328,7 +346,7 @@ var ControllerPageEntrySchemaParams = z.object({
|
|
|
328
346
|
id: z.string().optional(),
|
|
329
347
|
formScene: z.string().optional()
|
|
330
348
|
});
|
|
331
|
-
var ControllerPageEntry = (_dec$
|
|
349
|
+
var ControllerPageEntry = (_dec$4 = Controller(), _dec2$4 = BeanInfo({ module: "rest-resource" }), _dec3$3 = Use({ beanFullName: "rest-resource.model.resource" }), _dec4$2 = Reflect.metadata("design:type", Function), _dec5$2 = Reflect.metadata("design:paramtypes", []), _dec$4(_class$4 = _dec2$4(_class$4 = (_class2$2 = class ControllerPageEntry extends BeanControllerPageBase {
|
|
332
350
|
constructor(...args) {
|
|
333
351
|
super(...args);
|
|
334
352
|
this.formMeta = void 0;
|
|
@@ -379,30 +397,108 @@ var ControllerPageEntry = (_dec$3 = Controller(), _dec2$3 = BeanInfo({ module: "
|
|
|
379
397
|
if (Array.isArray(domBlock)) domBlocks.push(...domBlock);
|
|
380
398
|
else domBlocks.push(domBlock);
|
|
381
399
|
});
|
|
382
|
-
return createVNode(ZPage$
|
|
400
|
+
return createVNode(ZPage$2, null, _isSlot$2(domBlocks) ? domBlocks : { default: () => [domBlocks] });
|
|
383
401
|
}
|
|
384
|
-
}, _applyDecoratedDescriptor$
|
|
385
|
-
_dec3$
|
|
386
|
-
_dec4$
|
|
387
|
-
_dec5$
|
|
388
|
-
], Object.getOwnPropertyDescriptor(_class2$
|
|
402
|
+
}, _applyDecoratedDescriptor$2(_class2$2.prototype, "$$modelResource", [
|
|
403
|
+
_dec3$3,
|
|
404
|
+
_dec4$2,
|
|
405
|
+
_dec5$2
|
|
406
|
+
], Object.getOwnPropertyDescriptor(_class2$2.prototype, "$$modelResource"), _class2$2.prototype), _class2$2)) || _class$4) || _class$4);
|
|
389
407
|
//#endregion
|
|
390
408
|
//#region src/page/entryCreate/controller.tsx
|
|
409
|
+
var _dec$3;
|
|
410
|
+
var _dec2$3;
|
|
411
|
+
var _dec3$2;
|
|
412
|
+
var _class$3;
|
|
413
|
+
var ControllerPageEntryCreateSchemaParams = ControllerPageEntrySchemaParams;
|
|
414
|
+
var ControllerPageEntryCreate = (_dec$3 = Controller(), _dec2$3 = Virtual(), _dec3$2 = BeanInfo({ module: "rest-resource" }), _dec$3(_class$3 = _dec2$3(_class$3 = _dec3$2(_class$3 = class ControllerPageEntryCreate extends ControllerPageEntry {}) || _class$3) || _class$3) || _class$3);
|
|
415
|
+
//#endregion
|
|
416
|
+
//#region src/page/resource/controller.tsx
|
|
391
417
|
var _dec$2;
|
|
392
418
|
var _dec2$2;
|
|
393
419
|
var _dec3$1;
|
|
420
|
+
var _dec4$1;
|
|
421
|
+
var _dec5$1;
|
|
394
422
|
var _class$2;
|
|
395
|
-
var
|
|
396
|
-
|
|
423
|
+
var _class2$1;
|
|
424
|
+
function _applyDecoratedDescriptor$1(i, e, r, n, l) {
|
|
425
|
+
var a = {};
|
|
426
|
+
return Object.keys(n).forEach(function(i) {
|
|
427
|
+
a[i] = n[i];
|
|
428
|
+
}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function(r, n) {
|
|
429
|
+
return n(i, e, r) || r;
|
|
430
|
+
}, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a;
|
|
431
|
+
}
|
|
432
|
+
var ZPage$1 = createZovaComponentAsync("home-base", "page");
|
|
433
|
+
function _isSlot$1(s) {
|
|
434
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
435
|
+
}
|
|
436
|
+
var ControllerPageResourceSchemaParams = z.object({ resource: z.string() });
|
|
437
|
+
var ControllerPageResource = (_dec$2 = Controller(), _dec2$2 = BeanInfo({ module: "rest-resource" }), _dec3$1 = Use({ beanFullName: "rest-resource.model.resource" }), _dec4$1 = Reflect.metadata("design:type", Function), _dec5$1 = Reflect.metadata("design:paramtypes", []), _dec$2(_class$2 = _dec2$2(_class$2 = (_class2$1 = class ControllerPageResource extends BeanControllerPageBase {
|
|
438
|
+
constructor(...args) {
|
|
439
|
+
super(...args);
|
|
440
|
+
this.jsxZova = void 0;
|
|
441
|
+
}
|
|
442
|
+
get $$modelResource() {
|
|
443
|
+
return usePrepareArg(this.$params.resource, true);
|
|
444
|
+
}
|
|
445
|
+
get resource() {
|
|
446
|
+
return this.$params.resource;
|
|
447
|
+
}
|
|
448
|
+
async __init__() {
|
|
449
|
+
this._prepareJsx();
|
|
450
|
+
await $QueryEnsureLoaded(() => this.$$modelResource.apiSchemasSelect.sdk);
|
|
451
|
+
}
|
|
452
|
+
_prepareJsx() {
|
|
453
|
+
this.jsxZova = this.bean._newBeanSimple(ZovaJsx, false);
|
|
454
|
+
}
|
|
455
|
+
get schemaRow() {
|
|
456
|
+
return this.$$modelResource.schemaRow;
|
|
457
|
+
}
|
|
458
|
+
render() {
|
|
459
|
+
const blocks = this.schemaRow?.rest?.blocks;
|
|
460
|
+
if (!blocks || blocks.length === 0) return;
|
|
461
|
+
const domBlocks = [];
|
|
462
|
+
blocks.forEach((block, index) => {
|
|
463
|
+
const options = deepExtend({ key: index }, { resource: this.resource }, block.options);
|
|
464
|
+
const domBlock = this.jsxZova.render(block.render, options);
|
|
465
|
+
if (!domBlock) return;
|
|
466
|
+
if (Array.isArray(domBlock)) domBlocks.push(...domBlock);
|
|
467
|
+
else domBlocks.push(domBlock);
|
|
468
|
+
});
|
|
469
|
+
return createVNode(ZPage$1, null, _isSlot$1(domBlocks) ? domBlocks : { default: () => [domBlocks] });
|
|
470
|
+
}
|
|
471
|
+
}, _applyDecoratedDescriptor$1(_class2$1.prototype, "$$modelResource", [
|
|
472
|
+
_dec3$1,
|
|
473
|
+
_dec4$1,
|
|
474
|
+
_dec5$1
|
|
475
|
+
], Object.getOwnPropertyDescriptor(_class2$1.prototype, "$$modelResource"), _class2$1.prototype), _class2$1)) || _class$2) || _class$2);
|
|
397
476
|
//#endregion
|
|
398
|
-
//#region src/
|
|
477
|
+
//#region src/.metadata/component/resourcePickerContext.ts
|
|
478
|
+
var ZResourcePickerContext = defineComponent((_props) => {
|
|
479
|
+
useController(ControllerResourcePickerContext, void 0, void 0);
|
|
480
|
+
return () => {};
|
|
481
|
+
}, prepareComponentOptions());
|
|
482
|
+
//#endregion
|
|
483
|
+
//#region src/page/resourcePicker/controller.tsx
|
|
399
484
|
var _dec$1;
|
|
400
485
|
var _dec2$1;
|
|
401
486
|
var _dec3;
|
|
402
487
|
var _dec4;
|
|
403
488
|
var _dec5;
|
|
489
|
+
var _dec6;
|
|
490
|
+
var _dec7;
|
|
404
491
|
var _class$1;
|
|
405
492
|
var _class2;
|
|
493
|
+
var _descriptor;
|
|
494
|
+
function _initializerDefineProperty(e, i, r, l) {
|
|
495
|
+
r && Object.defineProperty(e, i, {
|
|
496
|
+
enumerable: r.enumerable,
|
|
497
|
+
configurable: r.configurable,
|
|
498
|
+
writable: r.writable,
|
|
499
|
+
value: r.initializer ? r.initializer.call(l) : void 0
|
|
500
|
+
});
|
|
501
|
+
}
|
|
406
502
|
function _applyDecoratedDescriptor(i, e, r, n, l) {
|
|
407
503
|
var a = {};
|
|
408
504
|
return Object.keys(n).forEach(function(i) {
|
|
@@ -415,30 +511,44 @@ var ZPage = createZovaComponentAsync("home-base", "page");
|
|
|
415
511
|
function _isSlot(s) {
|
|
416
512
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
417
513
|
}
|
|
418
|
-
var
|
|
419
|
-
var
|
|
514
|
+
var ControllerPageResourcePickerSchemaParams = z.object({ resource: z.string() });
|
|
515
|
+
var ControllerPageResourcePicker = (_dec$1 = Controller(), _dec2$1 = BeanInfo({ module: "rest-resource" }), _dec3 = Use({ beanFullName: "rest-resource.model.resource" }), _dec4 = Reflect.metadata("design:type", Function), _dec5 = Reflect.metadata("design:paramtypes", []), _dec6 = Use({
|
|
516
|
+
name: resourcePickerPageHostKey,
|
|
517
|
+
injectionScope: "host"
|
|
518
|
+
}), _dec7 = Reflect.metadata("design:type", typeof IResourcePickerPageHost === "undefined" ? Object : IResourcePickerPageHost), _dec$1(_class$1 = _dec2$1(_class$1 = (_class2 = class ControllerPageResourcePicker extends BeanControllerPageBase {
|
|
420
519
|
constructor(...args) {
|
|
421
520
|
super(...args);
|
|
422
521
|
this.jsxZova = void 0;
|
|
522
|
+
_initializerDefineProperty(this, "$$pickerHost", _descriptor, this);
|
|
423
523
|
}
|
|
424
524
|
get $$modelResource() {
|
|
425
|
-
return usePrepareArg(this
|
|
525
|
+
return usePrepareArg(this.resource, true);
|
|
426
526
|
}
|
|
427
527
|
get resource() {
|
|
428
528
|
return this.$params.resource;
|
|
429
529
|
}
|
|
430
|
-
|
|
431
|
-
this
|
|
432
|
-
|
|
530
|
+
get pickerContext() {
|
|
531
|
+
const host = this.$$pickerHost;
|
|
532
|
+
if (!host) throw new Error("resource picker requires a page host");
|
|
533
|
+
const options = host.options;
|
|
534
|
+
const session = host.session;
|
|
535
|
+
if (options.resource !== this.resource) throw new Error("resource picker context does not match route resource");
|
|
536
|
+
return {
|
|
537
|
+
options,
|
|
538
|
+
session,
|
|
539
|
+
dialog: host
|
|
540
|
+
};
|
|
433
541
|
}
|
|
434
|
-
|
|
542
|
+
async __init__() {
|
|
435
543
|
this.jsxZova = this.bean._newBeanSimple(ZovaJsx, false);
|
|
544
|
+
await $QueryEnsureLoaded(() => this.$$modelResource.apiSchemasSelect.sdk);
|
|
436
545
|
}
|
|
437
546
|
get schemaRow() {
|
|
438
547
|
return this.$$modelResource.schemaRow;
|
|
439
548
|
}
|
|
440
549
|
render() {
|
|
441
|
-
const
|
|
550
|
+
const pickerContext = this.pickerContext;
|
|
551
|
+
const blocks = this.$$pickerHost.prepareBlocks(this.schemaRow?.rest?.blocks, pickerContext);
|
|
442
552
|
if (!blocks || blocks.length === 0) return;
|
|
443
553
|
const domBlocks = [];
|
|
444
554
|
blocks.forEach((block, index) => {
|
|
@@ -448,13 +558,18 @@ var ControllerPageResource = (_dec$1 = Controller(), _dec2$1 = BeanInfo({ module
|
|
|
448
558
|
if (Array.isArray(domBlock)) domBlocks.push(...domBlock);
|
|
449
559
|
else domBlocks.push(domBlock);
|
|
450
560
|
});
|
|
451
|
-
return createVNode(ZPage, null, _isSlot(domBlocks) ? domBlocks : { default: () => [domBlocks] });
|
|
561
|
+
return createVNode(ZResourcePickerContext, { "context": pickerContext }, { default: () => [createVNode(ZPage, null, _isSlot(domBlocks) ? domBlocks : { default: () => [domBlocks] })] });
|
|
452
562
|
}
|
|
453
563
|
}, _applyDecoratedDescriptor(_class2.prototype, "$$modelResource", [
|
|
454
564
|
_dec3,
|
|
455
565
|
_dec4,
|
|
456
566
|
_dec5
|
|
457
|
-
], Object.getOwnPropertyDescriptor(_class2.prototype, "$$modelResource"), _class2.prototype), _class2
|
|
567
|
+
], Object.getOwnPropertyDescriptor(_class2.prototype, "$$modelResource"), _class2.prototype), _descriptor = _applyDecoratedDescriptor(_class2.prototype, "$$pickerHost", [_dec6, _dec7], {
|
|
568
|
+
configurable: true,
|
|
569
|
+
enumerable: true,
|
|
570
|
+
writable: true,
|
|
571
|
+
initializer: null
|
|
572
|
+
}), _class2)) || _class$1) || _class$1);
|
|
458
573
|
//#endregion
|
|
459
574
|
//#region src/.metadata/page/entry.ts
|
|
460
575
|
var NSControllerPageEntry;
|
|
@@ -477,6 +592,13 @@ var NSControllerPageResource;
|
|
|
477
592
|
})(NSControllerPageResource || (NSControllerPageResource = {}));
|
|
478
593
|
var ZPageResource = createZovaComponentPage(ControllerPageResource, void 0, void 0);
|
|
479
594
|
//#endregion
|
|
595
|
+
//#region src/.metadata/page/resourcePicker.ts
|
|
596
|
+
var NSControllerPageResourcePicker;
|
|
597
|
+
(function(_NSControllerPageResourcePicker) {
|
|
598
|
+
_NSControllerPageResourcePicker.paramsSchema = ControllerPageResourcePickerSchemaParams;
|
|
599
|
+
})(NSControllerPageResourcePicker || (NSControllerPageResourcePicker = {}));
|
|
600
|
+
var ZPageResourcePicker = createZovaComponentPage(ControllerPageResourcePicker, void 0, void 0);
|
|
601
|
+
//#endregion
|
|
480
602
|
//#region src/lib/resourceRouteMeta.ts
|
|
481
603
|
var resourceRouteMeta = {
|
|
482
604
|
tabKey: resourceTabKey,
|
|
@@ -504,6 +626,12 @@ var routes = [
|
|
|
504
626
|
ssrProfile: "session"
|
|
505
627
|
}
|
|
506
628
|
},
|
|
629
|
+
{
|
|
630
|
+
name: "resourcePicker",
|
|
631
|
+
path: ":resource/picker",
|
|
632
|
+
component: ZPageResourcePicker,
|
|
633
|
+
meta: { ssrProfile: "session" }
|
|
634
|
+
},
|
|
507
635
|
{
|
|
508
636
|
name: "entry",
|
|
509
637
|
path: ":resource/:id/:formScene?",
|
|
@@ -516,7 +644,7 @@ var routes = [
|
|
|
516
644
|
];
|
|
517
645
|
//#endregion
|
|
518
646
|
//#region src/.metadata/index.ts
|
|
519
|
-
/**
|
|
647
|
+
/** components: end */
|
|
520
648
|
/** scope: begin */
|
|
521
649
|
var _dec;
|
|
522
650
|
var _dec2;
|
|
@@ -525,11 +653,13 @@ var pagePathSchemas = {};
|
|
|
525
653
|
var pageNameSchemas = {
|
|
526
654
|
"rest-resource:entry": { params: NSControllerPageEntry.paramsSchema },
|
|
527
655
|
"rest-resource:entryCreate": { params: NSControllerPageEntryCreate.paramsSchema },
|
|
528
|
-
"rest-resource:resource": { params: NSControllerPageResource.paramsSchema }
|
|
656
|
+
"rest-resource:resource": { params: NSControllerPageResource.paramsSchema },
|
|
657
|
+
"rest-resource:resourcePicker": { params: NSControllerPageResourcePicker.paramsSchema }
|
|
529
658
|
};
|
|
659
|
+
var components = { "resourcePickerContext": ZResourcePickerContext };
|
|
530
660
|
var ScopeModuleRestResource = (_dec = Scope(), _dec2 = BeanInfo({ module: "rest-resource" }), _dec(_class = _dec2(_class = class ScopeModuleRestResource extends BeanScopeBase {}) || _class) || _class);
|
|
531
661
|
/** scope: end */
|
|
532
662
|
//#endregion
|
|
533
|
-
export { ControllerPageEntry, ControllerPageEntryCreate, ControllerPageEntryCreateSchemaParams, ControllerPageEntrySchemaParams, ControllerPageResource, ControllerPageResourceSchemaParams, ModelResource, NSControllerPageEntry, NSControllerPageEntryCreate, NSControllerPageResource, ScopeModuleRestResource, ZPageEntry, ZPageEntryCreate, ZPageResource, pageNameSchemas, pagePathSchemas, routes };
|
|
663
|
+
export { ControllerPageEntry, ControllerPageEntryCreate, ControllerPageEntryCreateSchemaParams, ControllerPageEntrySchemaParams, ControllerPageResource, ControllerPageResourcePicker, ControllerPageResourcePickerSchemaParams, ControllerPageResourceSchemaParams, ControllerResourcePickerContext, ModelResource, NSControllerPageEntry, NSControllerPageEntryCreate, NSControllerPageResource, NSControllerPageResourcePicker, ScopeModuleRestResource, ZPageEntry, ZPageEntryCreate, ZPageResource, ZPageResourcePicker, ZResourcePickerContext, components, pageNameSchemas, pagePathSchemas, resourcePickerPageContextKey, resourcePickerPageHostKey, routes };
|
|
534
664
|
|
|
535
665
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["isNil","z","BeanControllerPageBase","deepExtend","Use","usePrepareArg","ZovaJsx","Controller","formMetaFromFormScene","$QueryEnsureLoaded","_isSlot","s","Object","prototype","toString","call","_isVNode","ControllerPageEntrySchemaParams","object","resource","string","id","optional","formScene","ControllerPageEntry","_dec","_dec2","__z_BeanInfo","module","_dec3","beanFullName","_dec4","Reflect","metadata","Function","_dec5","_class","_class2","constructor","args","formMeta","formProvider","formSchema","jsxZova","$$modelResource","$params","entryId","__init__","$computed","getFormSchema","_prepareJsx","getFormApiSchemas","sdk","bean","_newBeanSimple","components","render","blocks","rest","length","domBlocks","forEach","block","index","options","key","domBlock","Array","isArray","push","_createVNode","ZPage","default","_applyDecoratedDescriptor","getOwnPropertyDescriptor","Virtual","Controller","ControllerPageEntry","ControllerPageEntrySchemaParams","ControllerPageEntryCreateSchemaParams","ControllerPageEntryCreate","_dec","_dec2","_dec3","__z_BeanInfo","module","_class","z","BeanControllerPageBase","deepExtend","Use","usePrepareArg","ZovaJsx","Controller","$QueryEnsureLoaded","_isSlot","s","Object","prototype","toString","call","_isVNode","ControllerPageResourceSchemaParams","object","resource","string","ControllerPageResource","_dec","_dec2","__z_BeanInfo","module","_dec3","beanFullName","_dec4","Reflect","metadata","Function","_dec5","_class","_class2","constructor","args","jsxZova","$$modelResource","$params","__init__","_prepareJsx","apiSchemasSelect","sdk","bean","_newBeanSimple","schemaRow","render","blocks","rest","length","domBlocks","forEach","block","index","options","key","domBlock","Array","isArray","push","_createVNode","ZPage","default","_applyDecoratedDescriptor","getOwnPropertyDescriptor"],"sources":["../src/lib/deleteRequest.ts","../src/lib/mutationSuccess.ts","../src/lib/selectedIds.ts","../src/model/resource.ts","../src/page/entry/controller.tsx","../src/page/entryCreate/controller.tsx","../src/page/resource/controller.tsx","../src/.metadata/page/entry.ts","../src/.metadata/page/entryCreate.ts","../src/.metadata/page/resource.ts","../src/lib/resourceRouteMeta.ts","../src/routes.ts","../src/.metadata/index.ts"],"sourcesContent":["export function prepareDeleteRequestConfig(config, body) {\n if (body === undefined) return config;\n return {\n ...config,\n data: body\n };\n}","export async function runMutationSuccess(options) {\n await options.invalidateSelect?.();\n await options.invalidateItem?.();\n await options.onSuccess?.();\n}","import { isNil } from '@cabloy/utils';\nexport function validateSelectedIds(ids) {\n if (ids.length === 0) throw new Error('selected ids cannot empty');\n const keys = new Set();\n for (const id of ids) {\n if (isNil(id) || id === '') throw new Error('selected row id cannot empty');\n const key = String(id);\n if (keys.has(key)) throw new Error(`duplicate selected row id: ${key}`);\n keys.add(key);\n }\n return [...ids];\n}","var _dec, _dec2, _dec3, _dec4, _class, _class2, _descriptor;\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\nimport { hashkey, isNil } from '@cabloy/utils';\nimport { UseScope } from 'zova';\nimport { formSceneFromFormMeta } from 'zova-module-a-form';\nimport { $QueryEnsureLoaded, BeanModelBase, Model } from 'zova-module-a-model';\nimport { SymbolOpenapiSchemaName } from 'zova-module-a-openapi';\nimport { prepareDeleteRequestConfig } from '../lib/deleteRequest.js';\nimport { runMutationSuccess } from '../lib/mutationSuccess.js';\nimport { validateSelectedIds } from '../lib/selectedIds.js';\nexport let ModelResource = (_dec = Model({\n enableSelector: true\n}), _dec2 = __z_BeanInfo({\n module: \"rest-resource\"\n}), _dec3 = UseScope(\"a-openapi\"), _dec4 = Reflect.metadata(\"design:type\", typeof ScopeModuleAOpenapi === \"undefined\" ? Object : ScopeModuleAOpenapi), _dec(_class = _dec2(_class = (_class2 = class ModelResource extends BeanModelBase {\n constructor(...args) {\n super(...args);\n this.resource = void 0;\n this.resourceApi = void 0;\n this.permissions = void 0;\n this.formProvider = void 0;\n this.schemaView = void 0;\n this.schemaCreate = void 0;\n this.schemaUpdate = void 0;\n this.schemaFilter = void 0;\n this.schemaOrder = void 0;\n this.schemaRow = void 0;\n this.schemaPages = void 0;\n _initializerDefineProperty(this, \"$$scopeOpenapi\", _descriptor, this);\n }\n async __init__(resource) {\n if (!resource) throw new Error('resource not specified');\n await super.__init__(resource);\n this.resource = resource;\n this.permissions = this.$computed(() => {\n if (this.$ssr.cookieDisabledOnServer) return;\n const permissions = this.$sdk.getPermissions(this.resource);\n return permissions.data;\n });\n this.formProvider = this.$computed(() => {\n return this.$$scopeOpenapi.config.formProvider;\n });\n this.schemaView = this.$computed(() => {\n return this.apiSchemasView.responseBody;\n });\n this.schemaCreate = this.$computed(() => {\n return this.apiSchemasCreate.requestBody;\n });\n this.schemaUpdate = this.$computed(() => {\n return this.apiSchemasUpdate.requestBody;\n });\n this.schemaFilter = this.$computed(() => {\n return this.apiSchemasSelect.filter;\n });\n this.schemaOrder = this.$computed(() => {\n return this.apiSchemasSelect.order;\n });\n this.schemaRow = this.$computed(() => {\n return this.apiSchemasSelect.row;\n });\n this.schemaPages = this.$computed(() => {\n return this.apiSchemasSelect.paged;\n });\n // bootstrap\n await this._bootstrap();\n }\n selectGeneral(actionPath, query) {\n return this.$useStateData({\n queryKey: this.keySelect(actionPath, query),\n queryFn: async () => {\n const apiPath = actionPath ? `${this.resourceApi}/${actionPath}` : this.resourceApi;\n return this.$fetch.get(this.sys.util.apiActionPathTranslate(apiPath), this.sys.util.apiActionConfigPrepare(undefined, {\n query\n }));\n }\n });\n }\n select(query) {\n return this.selectGeneral(undefined, query);\n }\n query(action, queryFn) {\n return this.$useStateData({\n queryKey: this.keySelect(action),\n queryFn\n });\n }\n queryItem(options) {\n const {\n id,\n action,\n queryFn,\n meta\n } = options;\n if (isNil(id)) throw new Error('row id cannot empty');\n return this.$useStateData({\n queryKey: this.keyItem(id, action),\n queryFn,\n meta\n });\n }\n view(id) {\n return this.queryItem({\n id,\n action: 'view',\n queryFn: async () => {\n const res = await this.$fetch.get(this.sys.util.apiActionPathTranslate(`${this.resourceApi}/:id`, {\n id\n }), this.sys.util.apiActionConfigPrepare());\n return res ?? null;\n }\n });\n }\n create() {\n return this.$useMutationData({\n mutationKey: ['create'],\n mutationFn: async params => {\n return this.$fetch.post(this.sys.util.apiActionPathTranslate(this.resourceApi), params, this.sys.util.apiActionConfigPrepare());\n },\n onSuccess: async () => {\n await runMutationSuccess({\n invalidateSelect: () => this.$invalidateQueries({\n queryKey: ['select']\n })\n });\n }\n });\n }\n mutationItem(options) {\n const {\n id,\n action,\n mutationFn,\n onSuccess,\n invalidateSelect = true\n } = options;\n if (isNil(id)) throw new Error('row id cannot empty');\n return this.$useMutationData({\n mutationKey: [...this.keyItem(id, action), 'mutation'],\n mutationFn,\n onSuccess: async (data, variables, context) => {\n await runMutationSuccess({\n invalidateSelect: invalidateSelect ? () => this.$invalidateQueries({\n queryKey: ['select']\n }) : undefined,\n invalidateItem: () => this.$invalidateQueries({\n queryKey: this.keyItemRoot(id)\n }),\n onSuccess: () => onSuccess?.(data, variables, context)\n });\n }\n });\n }\n mutationSelected(options) {\n const {\n action,\n getIds,\n mutationFn,\n onSuccess,\n invalidateSelect = true\n } = options;\n return this.$useMutationData({\n mutationKey: ['selected', action, 'mutation'],\n mutationFn: async variables => {\n this._getMutationSelectedIds(getIds, variables);\n return await mutationFn(variables);\n },\n onSuccess: async (data, variables, context) => {\n const ids = this._getMutationSelectedIds(getIds, variables);\n await runMutationSuccess({\n invalidateSelect: invalidateSelect ? () => this.$invalidateQueries({\n queryKey: ['select']\n }) : undefined,\n invalidateItem: async () => {\n await Promise.all(ids.map(id => this.$invalidateQueries({\n queryKey: this.keyItemRoot(id)\n })));\n },\n onSuccess: () => onSuccess?.(data, variables, context)\n });\n }\n });\n }\n deleteBulk() {\n return this.mutationSelected({\n action: 'delete',\n getIds: body => body.ids,\n mutationFn: async body => {\n return this.$fetch.post(this.sys.util.apiActionPathTranslate(`${this.resourceApi}/bulk/delete`), body, this.sys.util.apiActionConfigPrepare());\n }\n });\n }\n update(id) {\n return this.mutationItem({\n id,\n action: 'update',\n mutationFn: async params => {\n return this.$fetch.patch(this.sys.util.apiActionPathTranslate(`${this.resourceApi}/:id`, {\n id\n }), params, this.sys.util.apiActionConfigPrepare());\n }\n });\n }\n delete(id) {\n return this.mutationItem({\n id,\n action: 'delete',\n mutationFn: async body => {\n const apiPath = this.sys.util.apiActionPathTranslate(`${this.resourceApi}/:id`, {\n id\n });\n const apiConfig = prepareDeleteRequestConfig(this.sys.util.apiActionConfigPrepare(), body);\n return this.$fetch.delete(apiPath, apiConfig);\n }\n });\n }\n get apiSchemasSelect() {\n return this.$sdk.createApiSchemas(this.resourceApi, 'get');\n }\n get apiSchemasView() {\n return this.$sdk.createApiSchemas(`${this.resourceApi}/:id`, 'get');\n }\n get apiSchemasCreate() {\n return this.$sdk.createApiSchemas(this.resourceApi, 'post');\n }\n get apiSchemasUpdate() {\n return this.$sdk.createApiSchemas(`${this.resourceApi}/:id`, 'patch');\n }\n get apiSchemasDelete() {\n return this.$sdk.createApiSchemas(`${this.resourceApi}/:id`, 'delete');\n }\n getFormSchema(formMeta) {\n const formScene = formMeta.formScene ?? formSceneFromFormMeta(formMeta);\n if (formScene === 'view') return this.schemaView;\n if (formScene === 'create') return this.schemaCreate;\n if (formScene === 'edit') return this.schemaUpdate;\n }\n getFormApiSchemas(formMeta) {\n const formScene = formMeta.formScene ?? formSceneFromFormMeta(formMeta);\n if (formScene === 'view') return this.apiSchemasView;\n if (formScene === 'create') return this.apiSchemasCreate;\n if (formScene === 'edit') return this.apiSchemasUpdate;\n throw new Error('invalid parameters');\n }\n getFormMutationSubmit(formMeta, id) {\n if (formMeta.formMode !== 'edit') return;\n if (formMeta.editMode === 'create') {\n return this.create();\n } else if (formMeta.editMode === 'update') {\n return this.update(id);\n }\n }\n getFormData(formMeta, id) {\n if (formMeta.formMode === 'edit' && formMeta.editMode === 'create') {\n return this.getQueryDataDefaultValue(this.schemaCreate);\n }\n if (isNil(id)) return undefined;\n return this.view(id).data;\n }\n getQueryDataDefaultValue(schemaName) {\n if (!schemaName) return;\n if (typeof schemaName === 'object') {\n schemaName = schemaName[SymbolOpenapiSchemaName];\n }\n return this.$sdk.getSchemaDefaultValue(schemaName);\n }\n _getMutationSelectedIds(getIds, variables) {\n return validateSelectedIds(getIds(variables));\n }\n keySelect(actionPath, query) {\n return ['select', actionPath ?? '', hashkey(query)];\n }\n keyItemRoot(id) {\n if (isNil(id)) throw new Error('row id cannot empty');\n return ['item', id];\n }\n keyItem(id, action) {\n if (isNil(id)) throw new Error('row id cannot empty');\n return ['item', id, action];\n }\n async _bootstrap() {\n const queryBootstrap = await $QueryEnsureLoaded(() => this.$sdk.getBootstrap(this.resource));\n if (!queryBootstrap?.data) {\n throw new Error(`not found sdk of resource: ${this.resource}`);\n }\n this.resourceApi = this.sys.util.parseResourceApi(this.resource, queryBootstrap.data.apiPath);\n }\n}, _descriptor = _applyDecoratedDescriptor(_class2.prototype, \"$$scopeOpenapi\", [_dec3, _dec4], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _class2)) || _class) || _class);","import type {\n IFormMeta,\n IFormProvider,\n ISchemaObjectExtensionField,\n TypeFormScene,\n} from 'zova-module-a-openapi';\n\nimport { isNil } from '@cabloy/utils';\nimport { VNode } from 'vue';\nimport { z } from 'zod';\nimport { BeanControllerPageBase, deepExtend, Use, usePrepareArg } from 'zova';\nimport { ZovaJsx } from 'zova-jsx';\nimport { Controller } from 'zova-module-a-bean';\nimport { formMetaFromFormScene } from 'zova-module-a-form';\nimport { $QueryEnsureLoaded } from 'zova-module-a-model';\nimport { ZPage } from 'zova-module-home-base';\n\nimport type { ModelResource } from '../../model/resource.js';\n\nexport const ControllerPageEntrySchemaParams = z.object({\n resource: z.string(),\n id: z.string().optional(),\n formScene: z.string().optional(),\n});\n\n@Controller()\nexport class ControllerPageEntry extends BeanControllerPageBase {\n formMeta: IFormMeta;\n formProvider: IFormProvider;\n formSchema?: ISchemaObjectExtensionField;\n jsxZova: ZovaJsx;\n\n @Use({ beanFullName: 'rest-resource.model.resource' })\n get $$modelResource(): ModelResource {\n return usePrepareArg(this.$params.resource, true);\n }\n\n get resource() {\n return this.$params.resource;\n }\n\n get entryId() {\n return this.$params.id;\n }\n\n get formScene() {\n return (\n (this.$params.formScene as TypeFormScene | undefined) ??\n (isNil(this.entryId) ? 'create' : 'view')\n );\n }\n\n protected async __init__() {\n this.formMeta = this.$computed(() => {\n return formMetaFromFormScene(this.formScene);\n });\n this.formProvider = this.$computed(() => {\n return this.$$modelResource.formProvider;\n });\n this.formSchema = this.$computed(() => {\n return this.$$modelResource.getFormSchema(this.formMeta);\n });\n // jsx\n this._prepareJsx();\n // load schema\n await $QueryEnsureLoaded(() => this.$$modelResource.getFormApiSchemas(this.formMeta)?.sdk);\n }\n\n private _prepareJsx() {\n this.jsxZova = this.bean._newBeanSimple(ZovaJsx, false, this.formProvider.components);\n }\n\n protected render() {\n const blocks = this.formSchema?.rest?.blocks;\n if (!blocks || blocks.length === 0) return;\n const domBlocks: VNode[] = [];\n blocks.forEach((block, index) => {\n const options = deepExtend(\n { key: index },\n {\n resource: this.resource,\n id: this.entryId,\n formScene: this.formScene,\n },\n block.options,\n );\n const domBlock = this.jsxZova.render(block.render!, options);\n if (!domBlock) return;\n if (Array.isArray(domBlock)) {\n domBlocks.push(...domBlock);\n } else {\n domBlocks.push(domBlock);\n }\n });\n return <ZPage>{domBlocks}</ZPage>;\n }\n}\n","import { Virtual } from 'zova-core';\nimport { Controller } from 'zova-module-a-bean';\n\nimport { ControllerPageEntry, ControllerPageEntrySchemaParams } from '../entry/controller.jsx';\n\nexport const ControllerPageEntryCreateSchemaParams = ControllerPageEntrySchemaParams;\n\n@Controller()\n@Virtual()\nexport class ControllerPageEntryCreate extends ControllerPageEntry {}\n","import { VNode } from 'vue';\nimport { z } from 'zod';\nimport { BeanControllerPageBase, deepExtend, Use, usePrepareArg } from 'zova';\nimport { ZovaJsx } from 'zova-jsx';\nimport { Controller } from 'zova-module-a-bean';\nimport { $QueryEnsureLoaded } from 'zova-module-a-model';\nimport { ZPage } from 'zova-module-home-base';\n\nimport type { ModelResource } from '../../model/resource.js';\n\nexport const ControllerPageResourceSchemaParams = z.object({\n resource: z.string(),\n});\n\n@Controller()\nexport class ControllerPageResource extends BeanControllerPageBase {\n jsxZova: ZovaJsx;\n\n @Use({ beanFullName: 'rest-resource.model.resource' })\n get $$modelResource(): ModelResource {\n return usePrepareArg(this.$params.resource, true);\n }\n\n get resource() {\n return this.$params.resource;\n }\n\n protected async __init__() {\n // jsx\n this._prepareJsx();\n // load schema/data\n await $QueryEnsureLoaded(() => this.$$modelResource.apiSchemasSelect.sdk);\n }\n\n private _prepareJsx() {\n this.jsxZova = this.bean._newBeanSimple(ZovaJsx, false);\n }\n\n get schemaRow() {\n return this.$$modelResource.schemaRow;\n }\n\n public render() {\n const blocks = this.schemaRow?.rest?.blocks;\n if (!blocks || blocks.length === 0) return;\n const domBlocks: VNode[] = [];\n blocks.forEach((block, index) => {\n const options = deepExtend(\n { key: index },\n {\n resource: this.resource,\n },\n block.options,\n );\n const domBlock = this.jsxZova.render(block.render!, options);\n if (!domBlock) return;\n if (Array.isArray(domBlock)) {\n domBlocks.push(...domBlock);\n } else {\n domBlocks.push(domBlock);\n }\n });\n return <ZPage>{domBlocks}</ZPage>;\n }\n}\n","import { createZovaComponentPage } from 'zova';\nimport { ControllerPageEntry } from '../../page/entry/controller.jsx';\nimport { ControllerPageEntrySchemaParams } from '../../page/entry/controller.jsx';\nexport let NSControllerPageEntry;\n(function (_NSControllerPageEntry) {\n const paramsSchema = _NSControllerPageEntry.paramsSchema = ControllerPageEntrySchemaParams;\n})(NSControllerPageEntry || (NSControllerPageEntry = {}));\nexport const ZPageEntry = createZovaComponentPage(ControllerPageEntry, undefined, undefined);","import { createZovaComponentPage } from 'zova';\nimport { ControllerPageEntryCreate } from '../../page/entryCreate/controller.jsx';\nimport { ControllerPageEntryCreateSchemaParams } from '../../page/entryCreate/controller.jsx';\nexport let NSControllerPageEntryCreate;\n(function (_NSControllerPageEntryCreate) {\n const paramsSchema = _NSControllerPageEntryCreate.paramsSchema = ControllerPageEntryCreateSchemaParams;\n})(NSControllerPageEntryCreate || (NSControllerPageEntryCreate = {}));\nexport const ZPageEntryCreate = createZovaComponentPage(ControllerPageEntryCreate, undefined, undefined);","import { createZovaComponentPage } from 'zova';\nimport { ControllerPageResource } from '../../page/resource/controller.jsx';\nimport { ControllerPageResourceSchemaParams } from '../../page/resource/controller.jsx';\nexport let NSControllerPageResource;\n(function (_NSControllerPageResource) {\n const paramsSchema = _NSControllerPageResource.paramsSchema = ControllerPageResourceSchemaParams;\n})(NSControllerPageResource || (NSControllerPageResource = {}));\nexport const ZPageResource = createZovaComponentPage(ControllerPageResource, undefined, undefined);","export const resourceRouteMeta = {\n tabKey: resourceTabKey,\n componentKey: resourceTabKey,\n ssrProfile: 'session'\n};\nexport function resourceTabKey(route) {\n return `/rest/resource/${encodeURIComponent(route.params.resource)}`;\n}","import { ZPageEntry } from './.metadata/page/entry.js';\nimport { ZPageEntryCreate } from './.metadata/page/entryCreate.js';\nimport { ZPageResource } from './.metadata/page/resource.js';\nimport { resourceRouteMeta, resourceTabKey } from './lib/resourceRouteMeta.js';\nexport const routes = [{\n name: 'resource',\n path: ':resource',\n component: ZPageResource,\n meta: resourceRouteMeta\n}, {\n name: 'entryCreate',\n path: ':resource/create',\n component: ZPageEntryCreate,\n meta: {\n tabKey: resourceTabKey,\n ssrProfile: 'session'\n }\n}, {\n name: 'entry',\n path: ':resource/:id/:formScene?',\n component: ZPageEntry,\n meta: {\n tabKey: resourceTabKey,\n ssrProfile: 'session'\n }\n}];","var _dec, _dec2, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\n// eslint-disable\n/** model: begin */\nexport * from '../model/resource.js';\nimport 'zova-module-a-model';\n/** model: end */\n/** model: begin */\nimport { ModelResource } from '../model/resource.js';\nimport 'zova';\n/** model: end */\n/** controller: begin */\nexport * from '../page/entry/controller.jsx';\nexport * from '../page/entryCreate/controller.jsx';\nexport * from '../page/resource/controller.jsx';\nimport 'zova';\n/** controller: end */\n/** controller: begin */\nimport { ControllerPageEntry } from '../page/entry/controller.jsx';\nimport { ControllerPageEntryCreate } from '../page/entryCreate/controller.jsx';\nimport { ControllerPageResource } from '../page/resource/controller.jsx';\nimport 'zova';\n/** controller: end */\n/** pages: begin */\nexport * from './page/entry.js';\nimport { NSControllerPageEntry } from './page/entry.js';\nexport * from './page/entryCreate.js';\nimport { NSControllerPageEntryCreate } from './page/entryCreate.js';\nexport * from './page/resource.js';\nimport { NSControllerPageResource } from './page/resource.js';\nexport * from '../routes.js';\nimport 'zova';\nexport const pagePathSchemas = {};\nexport const pageNameSchemas = {\n 'rest-resource:entry': {\n params: NSControllerPageEntry.paramsSchema\n },\n 'rest-resource:entryCreate': {\n params: NSControllerPageEntryCreate.paramsSchema\n },\n 'rest-resource:resource': {\n params: NSControllerPageResource.paramsSchema\n }\n};\n/** pages: end */\n\n/** scope: begin */\nimport { BeanScopeBase } from 'zova';\nimport { Scope } from 'zova-module-a-bean';\nexport let ScopeModuleRestResource = (_dec = Scope(), _dec2 = __z_BeanInfo({\n module: \"rest-resource\"\n}), _dec(_class = _dec2(_class = class ScopeModuleRestResource extends BeanScopeBase {}) || _class) || _class);\nimport 'zova';\n\n/** scope: end */"],"mappings":";;;;;;;;;;;AAAA,SAAgB,2BAA2B,QAAQ,MAAM;CACvD,IAAI,SAAS,KAAA,GAAW,OAAO;CAC/B,OAAO;EACL,GAAG;EACH,MAAM;CACR;AACF;;;ACNA,eAAsB,mBAAmB,SAAS;CAChD,MAAM,QAAQ,mBAAmB;CACjC,MAAM,QAAQ,iBAAiB;CAC/B,MAAM,QAAQ,YAAY;AAC5B;;;ACHA,SAAgB,oBAAoB,KAAK;CACvC,IAAI,IAAI,WAAW,GAAG,MAAM,IAAI,MAAM,2BAA2B;CACjE,MAAM,uBAAO,IAAI,IAAI;CACrB,KAAK,MAAM,MAAM,KAAK;EACpB,IAAI,MAAM,EAAE,KAAK,OAAO,IAAI,MAAM,IAAI,MAAM,8BAA8B;EAC1E,MAAM,MAAM,OAAO,EAAE;EACrB,IAAI,KAAK,IAAI,GAAG,GAAG,MAAM,IAAI,MAAM,8BAA8B,KAAK;EACtE,KAAK,IAAI,GAAG;CACd;CACA,OAAO,CAAC,GAAG,GAAG;AAChB;;;ACXA,IAAI;AAAM,IAAA;AAAO,IAAA;AAAO,IAAA;AAAO,IAAA;AAAQ,IAAA;AAAS,IAAA;AAChD,SAAS,2BAA2B,GAAG,GAAG,GAAG,GAAG;CAAE,KAAK,OAAO,eAAe,GAAG,GAAG;EAA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Aa,oBAAoB;CAC/B,QAAQ;CACR,cAAc;CACd,YAAY;AACd;AACA,SAAgB,eAAe,OAAO;CACpC,OAAO,kBAAkB,mBAAmB,MAAM,OAAO,QAAQ;AACnE;;;ACHA,IAAa,SAAS;CAAC;EACrB,MAAM;EACN,MAAM;EACN,WAAW;EACX,MAAM;CACR;CAAG;EACD,MAAM;EACN,MAAM;EACN,WAAW;EACX,MAAM;GACJ,QAAQ;GACR,YAAY;EACd;CACF;CAAG;EACD,MAAM;EACN,MAAM;EACN,WAAW;EACX,MAAM;GACJ,QAAQ;GACR,YAAY;EACd;CACF;AAAC;;;;;ACzBD,IAAI;AAAM,IAAA;AAAO,IAAA;AAgCjB,IAAa,kBAAkB,CAAC;AAChC,IAAa,kBAAkB;CAC7B,uBAAuB,EACrB,QAAQ,sBAAsB,aAChC;CACA,6BAA6B,EAC3B,QAAQ,4BAA4B,aACtC;CACA,0BAA0B,EACxB,QAAQ,yBAAyB,aACnC;AACF;AAMA,IAAW,2BAA2B,OAAO,MAAM,GAAG,QAAQ,SAAa,EACzE,QAAQ,gBACV,CAAC,GAAG,KAAK,SAAS,MAAM,SAAS,MAAM,gCAAgC,cAAc,CAAC,CAAC,KAAK,MAAM,KAAK"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["BeanControllerBase","Controller","resourcePickerPageContextKey","ControllerResourcePickerContext","_dec","_dec2","__z_BeanInfo","module","_class","_ControllerResourcePickerContext","__init__","bean","_setBean","$props","context","render","$slotDefault","$propsDefault","isNil","z","BeanControllerPageBase","deepExtend","Use","usePrepareArg","ZovaJsx","Controller","formMetaFromFormScene","$QueryEnsureLoaded","_isSlot","s","Object","prototype","toString","call","_isVNode","ControllerPageEntrySchemaParams","object","resource","string","id","optional","formScene","ControllerPageEntry","_dec","_dec2","__z_BeanInfo","module","_dec3","beanFullName","_dec4","Reflect","metadata","Function","_dec5","_class","_class2","constructor","args","formMeta","formProvider","formSchema","jsxZova","$$modelResource","$params","entryId","__init__","$computed","getFormSchema","_prepareJsx","getFormApiSchemas","sdk","bean","_newBeanSimple","components","render","blocks","rest","length","domBlocks","forEach","block","index","options","key","domBlock","Array","isArray","push","_createVNode","ZPage","default","_applyDecoratedDescriptor","getOwnPropertyDescriptor","Virtual","Controller","ControllerPageEntry","ControllerPageEntrySchemaParams","ControllerPageEntryCreateSchemaParams","ControllerPageEntryCreate","_dec","_dec2","_dec3","__z_BeanInfo","module","_class","z","BeanControllerPageBase","deepExtend","Use","usePrepareArg","ZovaJsx","Controller","$QueryEnsureLoaded","_isSlot","s","Object","prototype","toString","call","_isVNode","ControllerPageResourceSchemaParams","object","resource","string","ControllerPageResource","_dec","_dec2","__z_BeanInfo","module","_dec3","beanFullName","_dec4","Reflect","metadata","Function","_dec5","_class","_class2","constructor","args","jsxZova","$$modelResource","$params","__init__","_prepareJsx","apiSchemasSelect","sdk","bean","_newBeanSimple","schemaRow","render","blocks","rest","length","domBlocks","forEach","block","index","options","key","domBlock","Array","isArray","push","_createVNode","ZPage","default","_applyDecoratedDescriptor","getOwnPropertyDescriptor","z","BeanControllerPageBase","deepExtend","Use","usePrepareArg","ZovaJsx","Controller","$QueryEnsureLoaded","ZResourcePickerContext","resourcePickerPageHostKey","_isSlot","s","Object","prototype","toString","call","_isVNode","ControllerPageResourcePickerSchemaParams","object","resource","string","ControllerPageResourcePicker","_dec","_dec2","__z_BeanInfo","module","_dec3","beanFullName","_dec4","Reflect","metadata","Function","_dec5","_dec6","name","injectionScope","_dec7","IResourcePickerPageHost","_class","_class2","constructor","args","jsxZova","_initializerDefineProperty","_descriptor","$$modelResource","$params","pickerContext","host","$$pickerHost","Error","options","session","dialog","__init__","bean","_newBeanSimple","apiSchemasSelect","sdk","schemaRow","render","blocks","prepareBlocks","rest","length","domBlocks","forEach","block","index","key","domBlock","Array","isArray","push","_createVNode","default","ZPage","_applyDecoratedDescriptor","getOwnPropertyDescriptor","configurable","enumerable","writable","initializer"],"sources":["../src/lib/deleteRequest.ts","../src/lib/mutationSuccess.ts","../src/lib/selectedIds.ts","../src/model/resource.ts","../src/lib/resourcePicker.ts","../src/component/resourcePickerContext/controller.tsx","../src/page/entry/controller.tsx","../src/page/entryCreate/controller.tsx","../src/page/resource/controller.tsx","../src/.metadata/component/resourcePickerContext.ts","../src/page/resourcePicker/controller.tsx","../src/.metadata/page/entry.ts","../src/.metadata/page/entryCreate.ts","../src/.metadata/page/resource.ts","../src/.metadata/page/resourcePicker.ts","../src/lib/resourceRouteMeta.ts","../src/routes.ts","../src/.metadata/index.ts"],"sourcesContent":["export function prepareDeleteRequestConfig(config, body) {\n if (body === undefined) return config;\n return {\n ...config,\n data: body\n };\n}","export async function runMutationSuccess(options) {\n await options.invalidateSelect?.();\n await options.invalidateItem?.();\n await options.onSuccess?.();\n}","import { isNil } from '@cabloy/utils';\nexport function validateSelectedIds(ids) {\n if (ids.length === 0) throw new Error('selected ids cannot empty');\n const keys = new Set();\n for (const id of ids) {\n if (isNil(id) || id === '') throw new Error('selected row id cannot empty');\n const key = String(id);\n if (keys.has(key)) throw new Error(`duplicate selected row id: ${key}`);\n keys.add(key);\n }\n return [...ids];\n}","var _dec, _dec2, _dec3, _dec4, _class, _class2, _descriptor;\nfunction _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }\nfunction _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, (\"value\" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a; }\nfunction _initializerWarningHelper(r, e) { throw Error(\"Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform.\"); }\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\nimport { hashkey, isNil } from '@cabloy/utils';\nimport { UseScope } from 'zova';\nimport { formSceneFromFormMeta } from 'zova-module-a-form';\nimport { $QueryEnsureLoaded, BeanModelBase, Model } from 'zova-module-a-model';\nimport { SymbolOpenapiSchemaName } from 'zova-module-a-openapi';\nimport { prepareDeleteRequestConfig } from '../lib/deleteRequest.js';\nimport { runMutationSuccess } from '../lib/mutationSuccess.js';\nimport { validateSelectedIds } from '../lib/selectedIds.js';\nexport let ModelResource = (_dec = Model({\n enableSelector: true\n}), _dec2 = __z_BeanInfo({\n module: \"rest-resource\"\n}), _dec3 = UseScope(\"a-openapi\"), _dec4 = Reflect.metadata(\"design:type\", typeof ScopeModuleAOpenapi === \"undefined\" ? Object : ScopeModuleAOpenapi), _dec(_class = _dec2(_class = (_class2 = class ModelResource extends BeanModelBase {\n constructor(...args) {\n super(...args);\n this.resource = void 0;\n this.resourceApi = void 0;\n this.permissions = void 0;\n this.formProvider = void 0;\n this.schemaView = void 0;\n this.schemaCreate = void 0;\n this.schemaUpdate = void 0;\n this.schemaFilter = void 0;\n this.schemaOrder = void 0;\n this.schemaRow = void 0;\n this.schemaPages = void 0;\n _initializerDefineProperty(this, \"$$scopeOpenapi\", _descriptor, this);\n }\n async __init__(resource) {\n if (!resource) throw new Error('resource not specified');\n await super.__init__(resource);\n this.resource = resource;\n this.permissions = this.$computed(() => {\n if (this.$ssr.cookieDisabledOnServer) return;\n const permissions = this.$sdk.getPermissions(this.resource);\n return permissions.data;\n });\n this.formProvider = this.$computed(() => {\n return this.$$scopeOpenapi.config.formProvider;\n });\n this.schemaView = this.$computed(() => {\n return this.apiSchemasView.responseBody;\n });\n this.schemaCreate = this.$computed(() => {\n return this.apiSchemasCreate.requestBody;\n });\n this.schemaUpdate = this.$computed(() => {\n return this.apiSchemasUpdate.requestBody;\n });\n this.schemaFilter = this.$computed(() => {\n return this.apiSchemasSelect.filter;\n });\n this.schemaOrder = this.$computed(() => {\n return this.apiSchemasSelect.order;\n });\n this.schemaRow = this.$computed(() => {\n return this.apiSchemasSelect.row;\n });\n this.schemaPages = this.$computed(() => {\n return this.apiSchemasSelect.paged;\n });\n // bootstrap\n await this._bootstrap();\n }\n selectGeneral(actionPath, query) {\n return this.$useStateData({\n queryKey: this.keySelect(actionPath, query),\n queryFn: async () => {\n const apiPath = actionPath ? `${this.resourceApi}/${actionPath}` : this.resourceApi;\n return this.$fetch.get(this.sys.util.apiActionPathTranslate(apiPath), this.sys.util.apiActionConfigPrepare(undefined, {\n query\n }));\n }\n });\n }\n select(query) {\n return this.selectGeneral(undefined, query);\n }\n query(action, queryFn) {\n return this.$useStateData({\n queryKey: this.keySelect(action),\n queryFn\n });\n }\n queryItem(options) {\n const {\n id,\n action,\n queryFn,\n meta\n } = options;\n if (isNil(id)) throw new Error('row id cannot empty');\n return this.$useStateData({\n queryKey: this.keyItem(id, action),\n queryFn,\n meta\n });\n }\n view(id) {\n return this.queryItem({\n id,\n action: 'view',\n queryFn: async () => {\n const res = await this.$fetch.get(this.sys.util.apiActionPathTranslate(`${this.resourceApi}/:id`, {\n id\n }), this.sys.util.apiActionConfigPrepare());\n return res ?? null;\n }\n });\n }\n create() {\n return this.$useMutationData({\n mutationKey: ['create'],\n mutationFn: async params => {\n return this.$fetch.post(this.sys.util.apiActionPathTranslate(this.resourceApi), params, this.sys.util.apiActionConfigPrepare());\n },\n onSuccess: async () => {\n await runMutationSuccess({\n invalidateSelect: () => this.$invalidateQueries({\n queryKey: ['select']\n })\n });\n }\n });\n }\n mutationItem(options) {\n const {\n id,\n action,\n mutationFn,\n onSuccess,\n invalidateSelect = true\n } = options;\n if (isNil(id)) throw new Error('row id cannot empty');\n return this.$useMutationData({\n mutationKey: [...this.keyItem(id, action), 'mutation'],\n mutationFn,\n onSuccess: async (data, variables, context) => {\n await runMutationSuccess({\n invalidateSelect: invalidateSelect ? () => this.$invalidateQueries({\n queryKey: ['select']\n }) : undefined,\n invalidateItem: () => this.$invalidateQueries({\n queryKey: this.keyItemRoot(id)\n }),\n onSuccess: () => onSuccess?.(data, variables, context)\n });\n }\n });\n }\n mutationSelected(options) {\n const {\n action,\n getIds,\n mutationFn,\n onSuccess,\n invalidateSelect = true\n } = options;\n return this.$useMutationData({\n mutationKey: ['selected', action, 'mutation'],\n mutationFn: async variables => {\n this._getMutationSelectedIds(getIds, variables);\n return await mutationFn(variables);\n },\n onSuccess: async (data, variables, context) => {\n const ids = this._getMutationSelectedIds(getIds, variables);\n await runMutationSuccess({\n invalidateSelect: invalidateSelect ? () => this.$invalidateQueries({\n queryKey: ['select']\n }) : undefined,\n invalidateItem: async () => {\n await Promise.all(ids.map(id => this.$invalidateQueries({\n queryKey: this.keyItemRoot(id)\n })));\n },\n onSuccess: () => onSuccess?.(data, variables, context)\n });\n }\n });\n }\n deleteBulk() {\n return this.mutationSelected({\n action: 'delete',\n getIds: body => body.ids,\n mutationFn: async body => {\n return this.$fetch.post(this.sys.util.apiActionPathTranslate(`${this.resourceApi}/bulk/delete`), body, this.sys.util.apiActionConfigPrepare());\n }\n });\n }\n update(id) {\n return this.mutationItem({\n id,\n action: 'update',\n mutationFn: async params => {\n return this.$fetch.patch(this.sys.util.apiActionPathTranslate(`${this.resourceApi}/:id`, {\n id\n }), params, this.sys.util.apiActionConfigPrepare());\n }\n });\n }\n delete(id) {\n return this.mutationItem({\n id,\n action: 'delete',\n mutationFn: async body => {\n const apiPath = this.sys.util.apiActionPathTranslate(`${this.resourceApi}/:id`, {\n id\n });\n const apiConfig = prepareDeleteRequestConfig(this.sys.util.apiActionConfigPrepare(), body);\n return this.$fetch.delete(apiPath, apiConfig);\n }\n });\n }\n get apiSchemasSelect() {\n return this.$sdk.createApiSchemas(this.resourceApi, 'get');\n }\n get apiSchemasView() {\n return this.$sdk.createApiSchemas(`${this.resourceApi}/:id`, 'get');\n }\n get apiSchemasCreate() {\n return this.$sdk.createApiSchemas(this.resourceApi, 'post');\n }\n get apiSchemasUpdate() {\n return this.$sdk.createApiSchemas(`${this.resourceApi}/:id`, 'patch');\n }\n get apiSchemasDelete() {\n return this.$sdk.createApiSchemas(`${this.resourceApi}/:id`, 'delete');\n }\n getFormSchema(formMeta) {\n const formScene = formMeta.formScene ?? formSceneFromFormMeta(formMeta);\n if (formScene === 'view') return this.schemaView;\n if (formScene === 'create') return this.schemaCreate;\n if (formScene === 'edit') return this.schemaUpdate;\n }\n getFormApiSchemas(formMeta) {\n const formScene = formMeta.formScene ?? formSceneFromFormMeta(formMeta);\n if (formScene === 'view') return this.apiSchemasView;\n if (formScene === 'create') return this.apiSchemasCreate;\n if (formScene === 'edit') return this.apiSchemasUpdate;\n throw new Error('invalid parameters');\n }\n getFormMutationSubmit(formMeta, id) {\n if (formMeta.formMode !== 'edit') return;\n if (formMeta.editMode === 'create') {\n return this.create();\n } else if (formMeta.editMode === 'update') {\n return this.update(id);\n }\n }\n getFormData(formMeta, id) {\n if (formMeta.formMode === 'edit' && formMeta.editMode === 'create') {\n return this.getQueryDataDefaultValue(this.schemaCreate);\n }\n if (isNil(id)) return undefined;\n return this.view(id).data;\n }\n getQueryDataDefaultValue(schemaName) {\n if (!schemaName) return;\n if (typeof schemaName === 'object') {\n schemaName = schemaName[SymbolOpenapiSchemaName];\n }\n return this.$sdk.getSchemaDefaultValue(schemaName);\n }\n _getMutationSelectedIds(getIds, variables) {\n return validateSelectedIds(getIds(variables));\n }\n keySelect(actionPath, query) {\n return ['select', actionPath ?? '', hashkey(query)];\n }\n keyItemRoot(id) {\n if (isNil(id)) throw new Error('row id cannot empty');\n return ['item', id];\n }\n keyItem(id, action) {\n if (isNil(id)) throw new Error('row id cannot empty');\n return ['item', id, action];\n }\n async _bootstrap() {\n const queryBootstrap = await $QueryEnsureLoaded(() => this.$sdk.getBootstrap(this.resource));\n if (!queryBootstrap?.data) {\n throw new Error(`not found sdk of resource: ${this.resource}`);\n }\n this.resourceApi = this.sys.util.parseResourceApi(this.resource, queryBootstrap.data.apiPath);\n }\n}, _descriptor = _applyDecoratedDescriptor(_class2.prototype, \"$$scopeOpenapi\", [_dec3, _dec4], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _class2)) || _class) || _class);","export const resourcePickerPageContextKey = '$resourcePickerPageContext';\nexport const resourcePickerPageHostKey = '$resourcePickerPageHost';","import { BeanControllerBase } from 'zova';\nimport { Controller } from 'zova-module-a-bean';\n\nimport type { IResourcePickerPageContext } from '../../page/resourcePicker/controller.js';\n\nimport { resourcePickerPageContextKey } from '../../lib/resourcePicker.js';\n\nexport interface ControllerResourcePickerContextProps {\n context: IResourcePickerPageContext;\n}\n\n@Controller()\nexport class ControllerResourcePickerContext extends BeanControllerBase {\n static $propsDefault = {};\n\n protected async __init__() {\n this.bean._setBean(\n resourcePickerPageContextKey,\n (this.$props as ControllerResourcePickerContextProps).context,\n );\n }\n\n protected render() {\n return this.$slotDefault?.();\n }\n}\n","import type {\n IFormMeta,\n IFormProvider,\n ISchemaObjectExtensionField,\n TypeFormScene,\n} from 'zova-module-a-openapi';\n\nimport { isNil } from '@cabloy/utils';\nimport { VNode } from 'vue';\nimport { z } from 'zod';\nimport { BeanControllerPageBase, deepExtend, Use, usePrepareArg } from 'zova';\nimport { ZovaJsx } from 'zova-jsx';\nimport { Controller } from 'zova-module-a-bean';\nimport { formMetaFromFormScene } from 'zova-module-a-form';\nimport { $QueryEnsureLoaded } from 'zova-module-a-model';\nimport { ZPage } from 'zova-module-home-base';\n\nimport type { ModelResource } from '../../model/resource.js';\n\nexport const ControllerPageEntrySchemaParams = z.object({\n resource: z.string(),\n id: z.string().optional(),\n formScene: z.string().optional(),\n});\n\n@Controller()\nexport class ControllerPageEntry extends BeanControllerPageBase {\n formMeta: IFormMeta;\n formProvider: IFormProvider;\n formSchema?: ISchemaObjectExtensionField;\n jsxZova: ZovaJsx;\n\n @Use({ beanFullName: 'rest-resource.model.resource' })\n get $$modelResource(): ModelResource {\n return usePrepareArg(this.$params.resource, true);\n }\n\n get resource() {\n return this.$params.resource;\n }\n\n get entryId() {\n return this.$params.id;\n }\n\n get formScene() {\n return (\n (this.$params.formScene as TypeFormScene | undefined) ??\n (isNil(this.entryId) ? 'create' : 'view')\n );\n }\n\n protected async __init__() {\n this.formMeta = this.$computed(() => {\n return formMetaFromFormScene(this.formScene);\n });\n this.formProvider = this.$computed(() => {\n return this.$$modelResource.formProvider;\n });\n this.formSchema = this.$computed(() => {\n return this.$$modelResource.getFormSchema(this.formMeta);\n });\n // jsx\n this._prepareJsx();\n // load schema\n await $QueryEnsureLoaded(() => this.$$modelResource.getFormApiSchemas(this.formMeta)?.sdk);\n }\n\n private _prepareJsx() {\n this.jsxZova = this.bean._newBeanSimple(ZovaJsx, false, this.formProvider.components);\n }\n\n protected render() {\n const blocks = this.formSchema?.rest?.blocks;\n if (!blocks || blocks.length === 0) return;\n const domBlocks: VNode[] = [];\n blocks.forEach((block, index) => {\n const options = deepExtend(\n { key: index },\n {\n resource: this.resource,\n id: this.entryId,\n formScene: this.formScene,\n },\n block.options,\n );\n const domBlock = this.jsxZova.render(block.render!, options);\n if (!domBlock) return;\n if (Array.isArray(domBlock)) {\n domBlocks.push(...domBlock);\n } else {\n domBlocks.push(domBlock);\n }\n });\n return <ZPage>{domBlocks}</ZPage>;\n }\n}\n","import { Virtual } from 'zova-core';\nimport { Controller } from 'zova-module-a-bean';\n\nimport { ControllerPageEntry, ControllerPageEntrySchemaParams } from '../entry/controller.jsx';\n\nexport const ControllerPageEntryCreateSchemaParams = ControllerPageEntrySchemaParams;\n\n@Controller()\n@Virtual()\nexport class ControllerPageEntryCreate extends ControllerPageEntry {}\n","import { VNode } from 'vue';\nimport { z } from 'zod';\nimport { BeanControllerPageBase, deepExtend, Use, usePrepareArg } from 'zova';\nimport { ZovaJsx } from 'zova-jsx';\nimport { Controller } from 'zova-module-a-bean';\nimport { $QueryEnsureLoaded } from 'zova-module-a-model';\nimport { ZPage } from 'zova-module-home-base';\n\nimport type { ModelResource } from '../../model/resource.js';\n\nexport const ControllerPageResourceSchemaParams = z.object({\n resource: z.string(),\n});\n\n@Controller()\nexport class ControllerPageResource extends BeanControllerPageBase {\n jsxZova: ZovaJsx;\n\n @Use({ beanFullName: 'rest-resource.model.resource' })\n get $$modelResource(): ModelResource {\n return usePrepareArg(this.$params.resource, true);\n }\n\n get resource() {\n return this.$params.resource;\n }\n\n protected async __init__() {\n // jsx\n this._prepareJsx();\n // load schema/data\n await $QueryEnsureLoaded(() => this.$$modelResource.apiSchemasSelect.sdk);\n }\n\n private _prepareJsx() {\n this.jsxZova = this.bean._newBeanSimple(ZovaJsx, false);\n }\n\n get schemaRow() {\n return this.$$modelResource.schemaRow;\n }\n\n public render() {\n const blocks = this.schemaRow?.rest?.blocks;\n if (!blocks || blocks.length === 0) return;\n const domBlocks: VNode[] = [];\n blocks.forEach((block, index) => {\n const options = deepExtend(\n { key: index },\n {\n resource: this.resource,\n },\n block.options,\n );\n const domBlock = this.jsxZova.render(block.render!, options);\n if (!domBlock) return;\n if (Array.isArray(domBlock)) {\n domBlocks.push(...domBlock);\n } else {\n domBlocks.push(domBlock);\n }\n });\n return <ZPage>{domBlocks}</ZPage>;\n }\n}\n","import { defineComponent } from 'vue';\nimport { prepareComponentOptions, useController } from 'zova';\nimport { ControllerResourcePickerContext } from '../../component/resourcePickerContext/controller.jsx';\nexport const ZResourcePickerContext = defineComponent(_props => {\n useController(ControllerResourcePickerContext, undefined, undefined);\n return () => {};\n}, prepareComponentOptions());","import type { VNode } from 'vue';\n\nimport { z } from 'zod';\nimport { BeanControllerPageBase, deepExtend, Use, usePrepareArg } from 'zova';\nimport { ZovaJsx } from 'zova-jsx';\nimport { Controller } from 'zova-module-a-bean';\nimport { $QueryEnsureLoaded } from 'zova-module-a-model';\nimport { ZPage } from 'zova-module-home-base';\n\nimport type {\n IResourcePickerPageContext,\n IResourcePickerPageHost,\n} from '../../lib/resourcePicker.js';\nimport type { ModelResource } from '../../model/resource.js';\n\nimport { ZResourcePickerContext } from '../../.metadata/component/resourcePickerContext.js';\nimport { resourcePickerPageHostKey } from '../../lib/resourcePicker.js';\n\nexport const ControllerPageResourcePickerSchemaParams = z.object({\n resource: z.string(),\n});\n\n@Controller()\nexport class ControllerPageResourcePicker extends BeanControllerPageBase {\n jsxZova: ZovaJsx;\n\n @Use({ beanFullName: 'rest-resource.model.resource' })\n get $$modelResource(): ModelResource {\n return usePrepareArg(this.resource, true);\n }\n\n @Use({ name: resourcePickerPageHostKey, injectionScope: 'host' })\n $$pickerHost: IResourcePickerPageHost | undefined;\n\n get resource() {\n return this.$params.resource;\n }\n\n get pickerContext(): IResourcePickerPageContext {\n const host = this.$$pickerHost;\n if (!host) {\n throw new Error('resource picker requires a page host');\n }\n const options = host.options;\n const session = host.session;\n if (options.resource !== this.resource) {\n throw new Error('resource picker context does not match route resource');\n }\n return {\n options,\n session,\n dialog: host,\n };\n }\n\n protected async __init__() {\n this.jsxZova = this.bean._newBeanSimple(ZovaJsx, false);\n await $QueryEnsureLoaded(() => this.$$modelResource.apiSchemasSelect.sdk);\n }\n\n get schemaRow() {\n return this.$$modelResource.schemaRow;\n }\n\n public render() {\n const pickerContext = this.pickerContext;\n const blocks = this.$$pickerHost!.prepareBlocks(this.schemaRow?.rest?.blocks, pickerContext);\n if (!blocks || blocks.length === 0) return;\n const domBlocks: VNode[] = [];\n blocks.forEach((block, index) => {\n const options = deepExtend({ key: index }, { resource: this.resource }, block.options);\n const domBlock = this.jsxZova.render(block.render!, options);\n if (!domBlock) return;\n if (Array.isArray(domBlock)) domBlocks.push(...domBlock);\n else domBlocks.push(domBlock);\n });\n return (\n <ZResourcePickerContext context={pickerContext}>\n <ZPage>{domBlocks}</ZPage>\n </ZResourcePickerContext>\n );\n }\n}\n\nexport type { IResourcePickerPageContext } from '../../lib/resourcePicker.js';\n","import { createZovaComponentPage } from 'zova';\nimport { ControllerPageEntry } from '../../page/entry/controller.jsx';\nimport { ControllerPageEntrySchemaParams } from '../../page/entry/controller.jsx';\nexport let NSControllerPageEntry;\n(function (_NSControllerPageEntry) {\n const paramsSchema = _NSControllerPageEntry.paramsSchema = ControllerPageEntrySchemaParams;\n})(NSControllerPageEntry || (NSControllerPageEntry = {}));\nexport const ZPageEntry = createZovaComponentPage(ControllerPageEntry, undefined, undefined);","import { createZovaComponentPage } from 'zova';\nimport { ControllerPageEntryCreate } from '../../page/entryCreate/controller.jsx';\nimport { ControllerPageEntryCreateSchemaParams } from '../../page/entryCreate/controller.jsx';\nexport let NSControllerPageEntryCreate;\n(function (_NSControllerPageEntryCreate) {\n const paramsSchema = _NSControllerPageEntryCreate.paramsSchema = ControllerPageEntryCreateSchemaParams;\n})(NSControllerPageEntryCreate || (NSControllerPageEntryCreate = {}));\nexport const ZPageEntryCreate = createZovaComponentPage(ControllerPageEntryCreate, undefined, undefined);","import { createZovaComponentPage } from 'zova';\nimport { ControllerPageResource } from '../../page/resource/controller.jsx';\nimport { ControllerPageResourceSchemaParams } from '../../page/resource/controller.jsx';\nexport let NSControllerPageResource;\n(function (_NSControllerPageResource) {\n const paramsSchema = _NSControllerPageResource.paramsSchema = ControllerPageResourceSchemaParams;\n})(NSControllerPageResource || (NSControllerPageResource = {}));\nexport const ZPageResource = createZovaComponentPage(ControllerPageResource, undefined, undefined);","import { createZovaComponentPage } from 'zova';\nimport { ControllerPageResourcePicker } from '../../page/resourcePicker/controller.jsx';\nimport { ControllerPageResourcePickerSchemaParams } from '../../page/resourcePicker/controller.jsx';\nexport let NSControllerPageResourcePicker;\n(function (_NSControllerPageResourcePicker) {\n const paramsSchema = _NSControllerPageResourcePicker.paramsSchema = ControllerPageResourcePickerSchemaParams;\n})(NSControllerPageResourcePicker || (NSControllerPageResourcePicker = {}));\nexport const ZPageResourcePicker = createZovaComponentPage(ControllerPageResourcePicker, undefined, undefined);","export const resourceRouteMeta = {\n tabKey: resourceTabKey,\n componentKey: resourceTabKey,\n ssrProfile: 'session'\n};\nexport function resourceTabKey(route) {\n return `/rest/resource/${encodeURIComponent(route.params.resource)}`;\n}","import { ZPageEntry } from './.metadata/page/entry.js';\nimport { ZPageEntryCreate } from './.metadata/page/entryCreate.js';\nimport { ZPageResource } from './.metadata/page/resource.js';\nimport { ZPageResourcePicker } from './.metadata/page/resourcePicker.js';\nimport { resourceRouteMeta, resourceTabKey } from './lib/resourceRouteMeta.js';\nexport const routes = [{\n name: 'resource',\n path: ':resource',\n component: ZPageResource,\n meta: resourceRouteMeta\n}, {\n name: 'entryCreate',\n path: ':resource/create',\n component: ZPageEntryCreate,\n meta: {\n tabKey: resourceTabKey,\n ssrProfile: 'session'\n }\n}, {\n name: 'resourcePicker',\n path: ':resource/picker',\n component: ZPageResourcePicker,\n meta: {\n ssrProfile: 'session'\n }\n}, {\n name: 'entry',\n path: ':resource/:id/:formScene?',\n component: ZPageEntry,\n meta: {\n tabKey: resourceTabKey,\n ssrProfile: 'session'\n }\n}];","var _dec, _dec2, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\n// eslint-disable\n/** model: begin */\nexport * from '../model/resource.js';\nimport 'zova-module-a-model';\n/** model: end */\n/** model: begin */\n\nimport 'zova';\n/** model: end */\n/** controller: begin */\nexport * from '../component/resourcePickerContext/controller.jsx';\nexport * from '../page/entry/controller.jsx';\nexport * from '../page/entryCreate/controller.jsx';\nexport * from '../page/resource/controller.jsx';\nexport * from '../page/resourcePicker/controller.jsx';\nimport 'zova';\n/** controller: end */\n/** controller: begin */\n\nimport 'zova';\n/** controller: end */\n/** pages: begin */\nexport * from './page/entry.js';\nimport { NSControllerPageEntry } from './page/entry.js';\nexport * from './page/entryCreate.js';\nimport { NSControllerPageEntryCreate } from './page/entryCreate.js';\nexport * from './page/resource.js';\nimport { NSControllerPageResource } from './page/resource.js';\nexport * from './page/resourcePicker.js';\nimport { NSControllerPageResourcePicker } from './page/resourcePicker.js';\nexport * from '../routes.js';\nimport 'zova';\nexport const pagePathSchemas = {};\nexport const pageNameSchemas = {\n 'rest-resource:entry': {\n params: NSControllerPageEntry.paramsSchema\n },\n 'rest-resource:entryCreate': {\n params: NSControllerPageEntryCreate.paramsSchema\n },\n 'rest-resource:resource': {\n params: NSControllerPageResource.paramsSchema\n },\n 'rest-resource:resourcePicker': {\n params: NSControllerPageResourcePicker.paramsSchema\n }\n};\n/** pages: end */\n\n/** components: begin */\nexport * from './component/resourcePickerContext.js';\nimport { ZResourcePickerContext } from './component/resourcePickerContext.js';\nexport const components = {\n 'resourcePickerContext': ZResourcePickerContext\n};\nimport 'zova';\n/** components: end */\n/** scope: begin */\nimport { BeanScopeBase } from 'zova';\nimport { Scope } from 'zova-module-a-bean';\nexport let ScopeModuleRestResource = (_dec = Scope(), _dec2 = __z_BeanInfo({\n module: \"rest-resource\"\n}), _dec(_class = _dec2(_class = class ScopeModuleRestResource extends BeanScopeBase {}) || _class) || _class);\nimport 'zova';\n\n/** scope: end */"],"mappings":";;;;;;;;;;;AAAA,SAAgB,2BAA2B,QAAQ,MAAM;CACvD,IAAI,SAAS,KAAA,GAAW,OAAO;CAC/B,OAAO;EACL,GAAG;EACH,MAAM;CACR;AACF;;;ACNA,eAAsB,mBAAmB,SAAS;CAChD,MAAM,QAAQ,mBAAmB;CACjC,MAAM,QAAQ,iBAAiB;CAC/B,MAAM,QAAQ,YAAY;AAC5B;;;ACHA,SAAgB,oBAAoB,KAAK;CACvC,IAAI,IAAI,WAAW,GAAG,MAAM,IAAI,MAAM,2BAA2B;CACjE,MAAM,uBAAO,IAAI,IAAI;CACrB,KAAK,MAAM,MAAM,KAAK;EACpB,IAAI,MAAM,EAAE,KAAK,OAAO,IAAI,MAAM,IAAI,MAAM,8BAA8B;EAC1E,MAAM,MAAM,OAAO,EAAE;EACrB,IAAI,KAAK,IAAI,GAAG,GAAG,MAAM,IAAI,MAAM,8BAA8B,KAAK;EACtE,KAAK,IAAI,GAAG;CACd;CACA,OAAO,CAAC,GAAG,GAAG;AAChB;;;ACXA,IAAI;AAAM,IAAA;AAAO,IAAA;AAAO,IAAA;AAAO,IAAA;AAAQ,IAAA;AAAS,IAAA;AAChD,SAAS,6BAA2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IAAa,kBAAkB,CAAC;AAChC,IAAa,kBAAkB;CAC7B,uBAAuB,EACrB,QAAQ,sBAAsB,aAChC;CACA,6BAA6B,EAC3B,QAAQ,4BAA4B,aACtC;CACA,0BAA0B,EACxB,QAAQ,yBAAyB,aACnC;CACA,gCAAgC,EAC9B,QAAQ,+BAA+B,aACzC;AACF;AAMA,IAAa,aAAa,EACxB,yBAAyB,uBAC3B;AAMA,IAAW,2BAA2B,OAAO,MAAM,GAAG,QAAQ,SAAa,EACzE,QAAQ,gBACV,CAAC,GAAG,KAAK,SAAS,MAAM,SAAS,MAAM,gCAAgC,cAAc,CAAC,CAAC,KAAK,MAAM,KAAK"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { TableIdentity } from 'table-identity';
|
|
2
|
+
import type { IResourceRenderBlockOptionsBlock, IResourceTableSelectionPayload, ITableQuery } from 'zova-module-a-openapi';
|
|
3
|
+
export declare const resourcePickerPageContextKey = "$resourcePickerPageContext";
|
|
4
|
+
export declare const resourcePickerPageHostKey = "$resourcePickerPageHost";
|
|
5
|
+
export interface IResourcePickerPageOptions extends Record<string, unknown> {
|
|
6
|
+
resource: string;
|
|
7
|
+
actionPath?: string;
|
|
8
|
+
query?: ITableQuery;
|
|
9
|
+
selectionMode: 'single' | 'multiple';
|
|
10
|
+
selectionMax?: number;
|
|
11
|
+
selectedIds?: readonly TableIdentity[];
|
|
12
|
+
}
|
|
13
|
+
export interface IResourcePickerPageSession {
|
|
14
|
+
selectedIds: TableIdentity[];
|
|
15
|
+
selectedRows: Record<string, unknown>[];
|
|
16
|
+
}
|
|
17
|
+
export interface IResourcePickerPageDialog {
|
|
18
|
+
resolve(value: IResourceTableSelectionPayload): void;
|
|
19
|
+
cancel(): void;
|
|
20
|
+
}
|
|
21
|
+
export interface IResourcePickerPageContext {
|
|
22
|
+
options: IResourcePickerPageOptions;
|
|
23
|
+
session: IResourcePickerPageSession;
|
|
24
|
+
dialog: IResourcePickerPageDialog;
|
|
25
|
+
}
|
|
26
|
+
export interface IResourcePickerPageHost extends IResourcePickerPageDialog {
|
|
27
|
+
options: IResourcePickerPageOptions;
|
|
28
|
+
session: IResourcePickerPageSession;
|
|
29
|
+
prepareBlocks(blocks: IResourceRenderBlockOptionsBlock[] | undefined, context: IResourcePickerPageContext): IResourceRenderBlockOptionsBlock[] | undefined;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=resourcePicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resourcePicker.d.ts","sourceRoot":"","sources":["../../src/lib/resourcePicker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EACV,gCAAgC,EAChC,8BAA8B,EAC9B,WAAW,EACZ,MAAM,uBAAuB,CAAC;AAE/B,eAAO,MAAM,4BAA4B,+BAA+B,CAAC;AACzE,eAAO,MAAM,yBAAyB,4BAA4B,CAAC;AAEnE,MAAM,WAAW,0BAA2B,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACzE,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,aAAa,EAAE,QAAQ,GAAG,UAAU,CAAC;IACrC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;CACxC;AAED,MAAM,WAAW,0BAA0B;IACzC,WAAW,EAAE,aAAa,EAAE,CAAC;IAC7B,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;CACzC;AAED,MAAM,WAAW,yBAAyB;IACxC,OAAO,CAAC,KAAK,EAAE,8BAA8B,GAAG,IAAI,CAAC;IACrD,MAAM,IAAI,IAAI,CAAC;CAChB;AAED,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,0BAA0B,CAAC;IACpC,OAAO,EAAE,0BAA0B,CAAC;IACpC,MAAM,EAAE,yBAAyB,CAAC;CACnC;AAED,MAAM,WAAW,uBAAwB,SAAQ,yBAAyB;IACxE,OAAO,EAAE,0BAA0B,CAAC;IACpC,OAAO,EAAE,0BAA0B,CAAC;IACpC,aAAa,CACX,MAAM,EAAE,gCAAgC,EAAE,GAAG,SAAS,EACtD,OAAO,EAAE,0BAA0B,GAClC,gCAAgC,EAAE,GAAG,SAAS,CAAC;CACnD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BeanControllerPageBase } from 'zova';
|
|
3
|
+
import { ZovaJsx } from 'zova-jsx';
|
|
4
|
+
import type { IResourcePickerPageContext, IResourcePickerPageHost } from '../../lib/resourcePicker.js';
|
|
5
|
+
import type { ModelResource } from '../../model/resource.js';
|
|
6
|
+
export declare const ControllerPageResourcePickerSchemaParams: z.ZodObject<{
|
|
7
|
+
resource: z.ZodString;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export declare class ControllerPageResourcePicker extends BeanControllerPageBase {
|
|
10
|
+
jsxZova: ZovaJsx;
|
|
11
|
+
get $$modelResource(): ModelResource;
|
|
12
|
+
$$pickerHost: IResourcePickerPageHost | undefined;
|
|
13
|
+
get resource(): string;
|
|
14
|
+
get pickerContext(): IResourcePickerPageContext;
|
|
15
|
+
protected __init__(): Promise<void>;
|
|
16
|
+
get schemaRow(): import("zova-module-a-openapi").ISchemaObjectExtensionField | undefined;
|
|
17
|
+
render(): import("vue/jsx-runtime").JSX.Element | undefined;
|
|
18
|
+
}
|
|
19
|
+
export type { IResourcePickerPageContext } from '../../lib/resourcePicker.js';
|
|
20
|
+
//# sourceMappingURL=controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../../src/page/resourcePicker/controller.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAkC,MAAM,MAAM,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAKnC,OAAO,KAAK,EACV,0BAA0B,EAC1B,uBAAuB,EACxB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAK7D,eAAO,MAAM,wCAAwC;;iBAEnD,CAAC;AAEH,qBACa,4BAA6B,SAAQ,sBAAsB;IACtE,OAAO,EAAE,OAAO,CAAC;IAEjB,IACI,eAAe,IAAI,aAAa,CAEnC;IAGD,YAAY,EAAE,uBAAuB,GAAG,SAAS,CAAC;IAElD,IAAI,QAAQ,WAEX;IAED,IAAI,aAAa,IAAI,0BAA0B,CAe9C;cAEe,QAAQ;IAKxB,IAAI,SAAS,4EAEZ;IAEM,MAAM;CAkBd;AAED,YAAY,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC"}
|
package/dist/routes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAQzD,eAAO,MAAM,MAAM,EAAE,YAAY,EAiChC,CAAC"}
|
package/package.json
CHANGED
|
@@ -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 { ControllerResourcePickerContextProps } from '../../component/resourcePickerContext/controller.jsx';
|
|
7
|
+
|
|
8
|
+
import { ControllerResourcePickerContext } from '../../component/resourcePickerContext/controller.jsx';
|
|
9
|
+
export type ZResourcePickerContextProps = {
|
|
10
|
+
controllerRef?: (ref: ControllerResourcePickerContext) => void;
|
|
11
|
+
} & ControllerResourcePickerContextProps;
|
|
12
|
+
|
|
13
|
+
type ControllerInnerProps = TypeControllerInnerProps<
|
|
14
|
+
ControllerResourcePickerContextProps,
|
|
15
|
+
keyof typeof ControllerResourcePickerContext.$propsDefault
|
|
16
|
+
>;
|
|
17
|
+
declare module 'zova-module-rest-resource' {
|
|
18
|
+
export interface ControllerResourcePickerContext {
|
|
19
|
+
$props: ControllerInnerProps;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const ZResourcePickerContext = defineComponent((_props: ZResourcePickerContextProps) => {
|
|
24
|
+
useController(ControllerResourcePickerContext, undefined, undefined);
|
|
25
|
+
return () => {};
|
|
26
|
+
}, prepareComponentOptions());
|
|
27
|
+
declare module 'zova-module-a-bean' {
|
|
28
|
+
export interface IVonaComponentRecord {
|
|
29
|
+
'rest-resource:resourcePickerContext': ControllerResourcePickerContextProps;
|
|
30
|
+
}
|
|
31
|
+
}
|
package/src/.metadata/index.ts
CHANGED
|
@@ -26,7 +26,7 @@ declare module 'zova-module-rest-resource' {
|
|
|
26
26
|
}
|
|
27
27
|
/** model: end */
|
|
28
28
|
/** model: begin */
|
|
29
|
-
import { ModelResource } from '../model/resource.js';
|
|
29
|
+
import type { ModelResource } from '../model/resource.js';
|
|
30
30
|
import 'zova';
|
|
31
31
|
declare module 'zova' {
|
|
32
32
|
export interface IBeanRecordGeneral {
|
|
@@ -35,9 +35,11 @@ declare module 'zova' {
|
|
|
35
35
|
}
|
|
36
36
|
/** model: end */
|
|
37
37
|
/** controller: begin */
|
|
38
|
+
export * from '../component/resourcePickerContext/controller.jsx';
|
|
38
39
|
export * from '../page/entry/controller.jsx';
|
|
39
40
|
export * from '../page/entryCreate/controller.jsx';
|
|
40
41
|
export * from '../page/resource/controller.jsx';
|
|
42
|
+
export * from '../page/resourcePicker/controller.jsx';
|
|
41
43
|
|
|
42
44
|
import 'zova';
|
|
43
45
|
declare module 'zova' {
|
|
@@ -46,6 +48,11 @@ declare module 'zova' {
|
|
|
46
48
|
}
|
|
47
49
|
declare module 'zova-module-rest-resource' {
|
|
48
50
|
|
|
51
|
+
export interface ControllerResourcePickerContext {
|
|
52
|
+
/** @internal */
|
|
53
|
+
get scope(): ScopeModuleRestResource;
|
|
54
|
+
}
|
|
55
|
+
|
|
49
56
|
export interface ControllerPageEntry {
|
|
50
57
|
/** @internal */
|
|
51
58
|
get scope(): ScopeModuleRestResource;
|
|
@@ -55,18 +62,27 @@ declare module 'zova-module-rest-resource' {
|
|
|
55
62
|
/** @internal */
|
|
56
63
|
get scope(): ScopeModuleRestResource;
|
|
57
64
|
}
|
|
65
|
+
|
|
66
|
+
export interface ControllerPageResourcePicker {
|
|
67
|
+
/** @internal */
|
|
68
|
+
get scope(): ScopeModuleRestResource;
|
|
69
|
+
}
|
|
58
70
|
}
|
|
59
71
|
/** controller: end */
|
|
60
72
|
/** controller: begin */
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
73
|
+
import type { ControllerResourcePickerContext } from '../component/resourcePickerContext/controller.jsx';
|
|
74
|
+
import type { ControllerPageEntry } from '../page/entry/controller.jsx';
|
|
75
|
+
import type { ControllerPageEntryCreate } from '../page/entryCreate/controller.jsx';
|
|
76
|
+
import type { ControllerPageResource } from '../page/resource/controller.jsx';
|
|
77
|
+
import type { ControllerPageResourcePicker } from '../page/resourcePicker/controller.jsx';
|
|
64
78
|
import 'zova';
|
|
65
79
|
declare module 'zova' {
|
|
66
80
|
export interface IBeanRecordLocal {
|
|
67
|
-
'rest-resource.controller.
|
|
81
|
+
'rest-resource.controller.resourcePickerContext': ControllerResourcePickerContext;
|
|
82
|
+
'rest-resource.controller.pageEntry': ControllerPageEntry;
|
|
68
83
|
'rest-resource.controller.pageEntryCreate': ControllerPageEntryCreate;
|
|
69
84
|
'rest-resource.controller.pageResource': ControllerPageResource;
|
|
85
|
+
'rest-resource.controller.pageResourcePicker': ControllerPageResourcePicker;
|
|
70
86
|
}
|
|
71
87
|
}
|
|
72
88
|
/** controller: end */
|
|
@@ -77,6 +93,8 @@ export * from './page/entryCreate.js';
|
|
|
77
93
|
import { NSControllerPageEntryCreate } from './page/entryCreate.js';
|
|
78
94
|
export * from './page/resource.js';
|
|
79
95
|
import { NSControllerPageResource } from './page/resource.js';
|
|
96
|
+
export * from './page/resourcePicker.js';
|
|
97
|
+
import { NSControllerPageResourcePicker } from './page/resourcePicker.js';
|
|
80
98
|
export * from '../routes.js';
|
|
81
99
|
import { TypePagePathSchema } from 'zova-module-a-router';
|
|
82
100
|
import 'zova';
|
|
@@ -85,11 +103,13 @@ export interface IPagePathRecord {
|
|
|
85
103
|
'/rest/resource/:resource/:id/:formScene?': TypePagePathSchema<NSControllerPageEntry.ParamsInput,undefined>;
|
|
86
104
|
'/rest/resource/:resource/create': TypePagePathSchema<NSControllerPageEntryCreate.ParamsInput,undefined>;
|
|
87
105
|
'/rest/resource/:resource': TypePagePathSchema<NSControllerPageResource.ParamsInput,undefined>;
|
|
106
|
+
'/rest/resource/:resource/picker': TypePagePathSchema<NSControllerPageResourcePicker.ParamsInput,undefined>;
|
|
88
107
|
}
|
|
89
108
|
export interface IPageNameRecord {
|
|
90
109
|
'rest-resource:entry': TypePagePathSchema<NSControllerPageEntry.ParamsInput,undefined>;
|
|
91
110
|
'rest-resource:entryCreate': TypePagePathSchema<NSControllerPageEntryCreate.ParamsInput,undefined>;
|
|
92
111
|
'rest-resource:resource': TypePagePathSchema<NSControllerPageResource.ParamsInput,undefined>;
|
|
112
|
+
'rest-resource:resourcePicker': TypePagePathSchema<NSControllerPageResourcePicker.ParamsInput,undefined>;
|
|
93
113
|
}
|
|
94
114
|
}
|
|
95
115
|
export const pagePathSchemas = {
|
|
@@ -107,6 +127,10 @@ export const pageNameSchemas = {
|
|
|
107
127
|
'rest-resource:resource': {
|
|
108
128
|
params: NSControllerPageResource.paramsSchema,
|
|
109
129
|
|
|
130
|
+
},
|
|
131
|
+
'rest-resource:resourcePicker': {
|
|
132
|
+
params: NSControllerPageResourcePicker.paramsSchema,
|
|
133
|
+
|
|
110
134
|
},
|
|
111
135
|
};
|
|
112
136
|
declare module 'zova-module-rest-resource' {
|
|
@@ -119,9 +143,28 @@ export interface ControllerPageEntryCreate {
|
|
|
119
143
|
export interface ControllerPageResource {
|
|
120
144
|
$params: NSControllerPageResource.ParamsOutput;
|
|
121
145
|
}
|
|
146
|
+
export interface ControllerPageResourcePicker {
|
|
147
|
+
$params: NSControllerPageResourcePicker.ParamsOutput;
|
|
148
|
+
}
|
|
122
149
|
}
|
|
123
150
|
/** pages: end */
|
|
124
151
|
|
|
152
|
+
/** components: begin */
|
|
153
|
+
export * from './component/resourcePickerContext.js';
|
|
154
|
+
import { ZResourcePickerContext } from './component/resourcePickerContext.js';
|
|
155
|
+
export const components = {
|
|
156
|
+
'resourcePickerContext': ZResourcePickerContext,
|
|
157
|
+
};
|
|
158
|
+
import 'zova';
|
|
159
|
+
declare module 'zova' {
|
|
160
|
+
export interface IComponentRecord {
|
|
161
|
+
'rest-resource:resourcePickerContext': ControllerResourcePickerContext;
|
|
162
|
+
}
|
|
163
|
+
export interface IZovaComponentRecord {
|
|
164
|
+
'rest-resource:resourcePickerContext': typeof ZResourcePickerContext;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
/** components: end */
|
|
125
168
|
/** scope: begin */
|
|
126
169
|
import { BeanScopeBase, type BeanScopeUtil } from 'zova';
|
|
127
170
|
import { Scope } from 'zova-module-a-bean';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { createZovaComponentPage } from 'zova';
|
|
3
|
+
|
|
4
|
+
import { ControllerPageResourcePicker } from '../../page/resourcePicker/controller.jsx';
|
|
5
|
+
import { ControllerPageResourcePickerSchemaParams } from '../../page/resourcePicker/controller.jsx';
|
|
6
|
+
export namespace NSControllerPageResourcePicker {
|
|
7
|
+
export const paramsSchema = ControllerPageResourcePickerSchemaParams;
|
|
8
|
+
export type ParamsInput = z.input<typeof ControllerPageResourcePickerSchemaParams>;
|
|
9
|
+
export type ParamsOutput = z.output<typeof ControllerPageResourcePickerSchemaParams>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const ZPageResourcePicker = createZovaComponentPage(
|
|
13
|
+
ControllerPageResourcePicker,
|
|
14
|
+
undefined,
|
|
15
|
+
undefined,
|
|
16
|
+
);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { BeanControllerBase } from 'zova';
|
|
2
|
+
import { Controller } from 'zova-module-a-bean';
|
|
3
|
+
|
|
4
|
+
import type { IResourcePickerPageContext } from '../../page/resourcePicker/controller.js';
|
|
5
|
+
|
|
6
|
+
import { resourcePickerPageContextKey } from '../../lib/resourcePicker.js';
|
|
7
|
+
|
|
8
|
+
export interface ControllerResourcePickerContextProps {
|
|
9
|
+
context: IResourcePickerPageContext;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@Controller()
|
|
13
|
+
export class ControllerResourcePickerContext extends BeanControllerBase {
|
|
14
|
+
static $propsDefault = {};
|
|
15
|
+
|
|
16
|
+
protected async __init__() {
|
|
17
|
+
this.bean._setBean(
|
|
18
|
+
resourcePickerPageContextKey,
|
|
19
|
+
(this.$props as ControllerResourcePickerContextProps).context,
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
protected render() {
|
|
24
|
+
return this.$slotDefault?.();
|
|
25
|
+
}
|
|
26
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { TableIdentity } from 'table-identity';
|
|
2
|
+
import type {
|
|
3
|
+
IResourceRenderBlockOptionsBlock,
|
|
4
|
+
IResourceTableSelectionPayload,
|
|
5
|
+
ITableQuery,
|
|
6
|
+
} from 'zova-module-a-openapi';
|
|
7
|
+
|
|
8
|
+
export const resourcePickerPageContextKey = '$resourcePickerPageContext';
|
|
9
|
+
export const resourcePickerPageHostKey = '$resourcePickerPageHost';
|
|
10
|
+
|
|
11
|
+
export interface IResourcePickerPageOptions extends Record<string, unknown> {
|
|
12
|
+
resource: string;
|
|
13
|
+
actionPath?: string;
|
|
14
|
+
query?: ITableQuery;
|
|
15
|
+
selectionMode: 'single' | 'multiple';
|
|
16
|
+
selectionMax?: number;
|
|
17
|
+
selectedIds?: readonly TableIdentity[];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface IResourcePickerPageSession {
|
|
21
|
+
selectedIds: TableIdentity[];
|
|
22
|
+
selectedRows: Record<string, unknown>[];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface IResourcePickerPageDialog {
|
|
26
|
+
resolve(value: IResourceTableSelectionPayload): void;
|
|
27
|
+
cancel(): void;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface IResourcePickerPageContext {
|
|
31
|
+
options: IResourcePickerPageOptions;
|
|
32
|
+
session: IResourcePickerPageSession;
|
|
33
|
+
dialog: IResourcePickerPageDialog;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface IResourcePickerPageHost extends IResourcePickerPageDialog {
|
|
37
|
+
options: IResourcePickerPageOptions;
|
|
38
|
+
session: IResourcePickerPageSession;
|
|
39
|
+
prepareBlocks(
|
|
40
|
+
blocks: IResourceRenderBlockOptionsBlock[] | undefined,
|
|
41
|
+
context: IResourcePickerPageContext,
|
|
42
|
+
): IResourceRenderBlockOptionsBlock[] | undefined;
|
|
43
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { VNode } from 'vue';
|
|
2
|
+
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { BeanControllerPageBase, deepExtend, Use, usePrepareArg } from 'zova';
|
|
5
|
+
import { ZovaJsx } from 'zova-jsx';
|
|
6
|
+
import { Controller } from 'zova-module-a-bean';
|
|
7
|
+
import { $QueryEnsureLoaded } from 'zova-module-a-model';
|
|
8
|
+
import { ZPage } from 'zova-module-home-base';
|
|
9
|
+
|
|
10
|
+
import type {
|
|
11
|
+
IResourcePickerPageContext,
|
|
12
|
+
IResourcePickerPageHost,
|
|
13
|
+
} from '../../lib/resourcePicker.js';
|
|
14
|
+
import type { ModelResource } from '../../model/resource.js';
|
|
15
|
+
|
|
16
|
+
import { ZResourcePickerContext } from '../../.metadata/component/resourcePickerContext.js';
|
|
17
|
+
import { resourcePickerPageHostKey } from '../../lib/resourcePicker.js';
|
|
18
|
+
|
|
19
|
+
export const ControllerPageResourcePickerSchemaParams = z.object({
|
|
20
|
+
resource: z.string(),
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
@Controller()
|
|
24
|
+
export class ControllerPageResourcePicker extends BeanControllerPageBase {
|
|
25
|
+
jsxZova: ZovaJsx;
|
|
26
|
+
|
|
27
|
+
@Use({ beanFullName: 'rest-resource.model.resource' })
|
|
28
|
+
get $$modelResource(): ModelResource {
|
|
29
|
+
return usePrepareArg(this.resource, true);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@Use({ name: resourcePickerPageHostKey, injectionScope: 'host' })
|
|
33
|
+
$$pickerHost: IResourcePickerPageHost | undefined;
|
|
34
|
+
|
|
35
|
+
get resource() {
|
|
36
|
+
return this.$params.resource;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
get pickerContext(): IResourcePickerPageContext {
|
|
40
|
+
const host = this.$$pickerHost;
|
|
41
|
+
if (!host) {
|
|
42
|
+
throw new Error('resource picker requires a page host');
|
|
43
|
+
}
|
|
44
|
+
const options = host.options;
|
|
45
|
+
const session = host.session;
|
|
46
|
+
if (options.resource !== this.resource) {
|
|
47
|
+
throw new Error('resource picker context does not match route resource');
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
options,
|
|
51
|
+
session,
|
|
52
|
+
dialog: host,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
protected async __init__() {
|
|
57
|
+
this.jsxZova = this.bean._newBeanSimple(ZovaJsx, false);
|
|
58
|
+
await $QueryEnsureLoaded(() => this.$$modelResource.apiSchemasSelect.sdk);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
get schemaRow() {
|
|
62
|
+
return this.$$modelResource.schemaRow;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
public render() {
|
|
66
|
+
const pickerContext = this.pickerContext;
|
|
67
|
+
const blocks = this.$$pickerHost!.prepareBlocks(this.schemaRow?.rest?.blocks, pickerContext);
|
|
68
|
+
if (!blocks || blocks.length === 0) return;
|
|
69
|
+
const domBlocks: VNode[] = [];
|
|
70
|
+
blocks.forEach((block, index) => {
|
|
71
|
+
const options = deepExtend({ key: index }, { resource: this.resource }, block.options);
|
|
72
|
+
const domBlock = this.jsxZova.render(block.render!, options);
|
|
73
|
+
if (!domBlock) return;
|
|
74
|
+
if (Array.isArray(domBlock)) domBlocks.push(...domBlock);
|
|
75
|
+
else domBlocks.push(domBlock);
|
|
76
|
+
});
|
|
77
|
+
return (
|
|
78
|
+
<ZResourcePickerContext context={pickerContext}>
|
|
79
|
+
<ZPage>{domBlocks}</ZPage>
|
|
80
|
+
</ZResourcePickerContext>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export type { IResourcePickerPageContext } from '../../lib/resourcePicker.js';
|
package/src/routes.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { IModuleRoute } from 'zova-module-a-router';
|
|
|
3
3
|
import { ZPageEntry } from './.metadata/page/entry.js';
|
|
4
4
|
import { ZPageEntryCreate } from './.metadata/page/entryCreate.js';
|
|
5
5
|
import { ZPageResource } from './.metadata/page/resource.js';
|
|
6
|
+
import { ZPageResourcePicker } from './.metadata/page/resourcePicker.js';
|
|
6
7
|
import { resourceRouteMeta, resourceTabKey } from './lib/resourceRouteMeta.js';
|
|
7
8
|
|
|
8
9
|
export const routes: IModuleRoute[] = [
|
|
@@ -21,6 +22,14 @@ export const routes: IModuleRoute[] = [
|
|
|
21
22
|
ssrProfile: 'session',
|
|
22
23
|
},
|
|
23
24
|
},
|
|
25
|
+
{
|
|
26
|
+
name: 'resourcePicker',
|
|
27
|
+
path: ':resource/picker',
|
|
28
|
+
component: ZPageResourcePicker,
|
|
29
|
+
meta: {
|
|
30
|
+
ssrProfile: 'session',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
24
33
|
{
|
|
25
34
|
name: 'entry',
|
|
26
35
|
path: ':resource/:id/:formScene?',
|