zova-module-rest-resource 5.1.53 → 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/index.js +15 -36
- package/dist/index.js.map +1 -1
- package/dist/lib/resourcePicker.d.ts +29 -0
- package/dist/lib/resourcePicker.d.ts.map +1 -1
- package/dist/page/resourcePicker/controller.d.ts +3 -22
- package/dist/page/resourcePicker/controller.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/lib/resourcePicker.ts +42 -0
- package/src/page/resourcePicker/controller.tsx +20 -79
package/dist/index.js
CHANGED
|
@@ -8,7 +8,6 @@ import { createVNode, defineComponent, isVNode } from "vue";
|
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
import { ZovaJsx } from "zova-jsx";
|
|
10
10
|
import { Virtual } from "zova-core";
|
|
11
|
-
import { routedDialogContextKey } from "zova-module-basic-app";
|
|
12
11
|
//#region src/lib/deleteRequest.ts
|
|
13
12
|
function prepareDeleteRequestConfig(config, body) {
|
|
14
13
|
if (body === void 0) return config;
|
|
@@ -306,6 +305,7 @@ var ModelResource = (_dec$6 = Model({ enableSelector: true }), _dec2$6 = BeanInf
|
|
|
306
305
|
//#endregion
|
|
307
306
|
//#region src/lib/resourcePicker.ts
|
|
308
307
|
var resourcePickerPageContextKey = "$resourcePickerPageContext";
|
|
308
|
+
var resourcePickerPageHostKey = "$resourcePickerPageHost";
|
|
309
309
|
//#endregion
|
|
310
310
|
//#region src/component/resourcePickerContext/controller.tsx
|
|
311
311
|
var _dec$5;
|
|
@@ -513,13 +513,13 @@ function _isSlot(s) {
|
|
|
513
513
|
}
|
|
514
514
|
var ControllerPageResourcePickerSchemaParams = z.object({ resource: z.string() });
|
|
515
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:
|
|
516
|
+
name: resourcePickerPageHostKey,
|
|
517
517
|
injectionScope: "host"
|
|
518
|
-
}), _dec7 = Reflect.metadata("design:type", typeof
|
|
518
|
+
}), _dec7 = Reflect.metadata("design:type", typeof IResourcePickerPageHost === "undefined" ? Object : IResourcePickerPageHost), _dec$1(_class$1 = _dec2$1(_class$1 = (_class2 = class ControllerPageResourcePicker extends BeanControllerPageBase {
|
|
519
519
|
constructor(...args) {
|
|
520
520
|
super(...args);
|
|
521
521
|
this.jsxZova = void 0;
|
|
522
|
-
_initializerDefineProperty(this, "$$
|
|
522
|
+
_initializerDefineProperty(this, "$$pickerHost", _descriptor, this);
|
|
523
523
|
}
|
|
524
524
|
get $$modelResource() {
|
|
525
525
|
return usePrepareArg(this.resource, true);
|
|
@@ -528,13 +528,15 @@ var ControllerPageResourcePicker = (_dec$1 = Controller(), _dec2$1 = BeanInfo({
|
|
|
528
528
|
return this.$params.resource;
|
|
529
529
|
}
|
|
530
530
|
get pickerContext() {
|
|
531
|
-
const
|
|
532
|
-
|
|
533
|
-
|
|
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");
|
|
534
536
|
return {
|
|
535
537
|
options,
|
|
536
538
|
session,
|
|
537
|
-
dialog:
|
|
539
|
+
dialog: host
|
|
538
540
|
};
|
|
539
541
|
}
|
|
540
542
|
async __init__() {
|
|
@@ -545,7 +547,8 @@ var ControllerPageResourcePicker = (_dec$1 = Controller(), _dec2$1 = BeanInfo({
|
|
|
545
547
|
return this.$$modelResource.schemaRow;
|
|
546
548
|
}
|
|
547
549
|
render() {
|
|
548
|
-
const
|
|
550
|
+
const pickerContext = this.pickerContext;
|
|
551
|
+
const blocks = this.$$pickerHost.prepareBlocks(this.schemaRow?.rest?.blocks, pickerContext);
|
|
549
552
|
if (!blocks || blocks.length === 0) return;
|
|
550
553
|
const domBlocks = [];
|
|
551
554
|
blocks.forEach((block, index) => {
|
|
@@ -555,37 +558,13 @@ var ControllerPageResourcePicker = (_dec$1 = Controller(), _dec2$1 = BeanInfo({
|
|
|
555
558
|
if (Array.isArray(domBlock)) domBlocks.push(...domBlock);
|
|
556
559
|
else domBlocks.push(domBlock);
|
|
557
560
|
});
|
|
558
|
-
return createVNode(ZResourcePickerContext, { "context":
|
|
559
|
-
}
|
|
560
|
-
_prepareBlocks(blocks) {
|
|
561
|
-
if (!blocks) return;
|
|
562
|
-
return blocks.map((block) => {
|
|
563
|
-
if (block.render !== "basic-page:blockPage") return block;
|
|
564
|
-
const pickerContext = this.pickerContext;
|
|
565
|
-
return {
|
|
566
|
-
...block,
|
|
567
|
-
options: deepExtend({}, block.options, {
|
|
568
|
-
actionPath: pickerContext.options.actionPath,
|
|
569
|
-
queryFixed: pickerContext.options.query,
|
|
570
|
-
selectionPolicy: "always",
|
|
571
|
-
selectionMode: pickerContext.options.selectionMode,
|
|
572
|
-
selectionMax: pickerContext.options.selectionMax,
|
|
573
|
-
selectedIds: pickerContext.session.selectedIds,
|
|
574
|
-
selectedRows: pickerContext.session.selectedRows,
|
|
575
|
-
onSelectionChange: (selection) => {
|
|
576
|
-
pickerContext.session.selectedIds = [...selection.ids];
|
|
577
|
-
pickerContext.session.selectedRows = selection.rows.map((row) => ({ ...row }));
|
|
578
|
-
},
|
|
579
|
-
blocks: [...block.options.blocks ?? [], { render: "basic-resource:blockResourcePickerActions" }]
|
|
580
|
-
})
|
|
581
|
-
};
|
|
582
|
-
});
|
|
561
|
+
return createVNode(ZResourcePickerContext, { "context": pickerContext }, { default: () => [createVNode(ZPage, null, _isSlot(domBlocks) ? domBlocks : { default: () => [domBlocks] })] });
|
|
583
562
|
}
|
|
584
563
|
}, _applyDecoratedDescriptor(_class2.prototype, "$$modelResource", [
|
|
585
564
|
_dec3,
|
|
586
565
|
_dec4,
|
|
587
566
|
_dec5
|
|
588
|
-
], Object.getOwnPropertyDescriptor(_class2.prototype, "$$modelResource"), _class2.prototype), _descriptor = _applyDecoratedDescriptor(_class2.prototype, "$$
|
|
567
|
+
], Object.getOwnPropertyDescriptor(_class2.prototype, "$$modelResource"), _class2.prototype), _descriptor = _applyDecoratedDescriptor(_class2.prototype, "$$pickerHost", [_dec6, _dec7], {
|
|
589
568
|
configurable: true,
|
|
590
569
|
enumerable: true,
|
|
591
570
|
writable: true,
|
|
@@ -681,6 +660,6 @@ var components = { "resourcePickerContext": ZResourcePickerContext };
|
|
|
681
660
|
var ScopeModuleRestResource = (_dec = Scope(), _dec2 = BeanInfo({ module: "rest-resource" }), _dec(_class = _dec2(_class = class ScopeModuleRestResource extends BeanScopeBase {}) || _class) || _class);
|
|
682
661
|
/** scope: end */
|
|
683
662
|
//#endregion
|
|
684
|
-
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, 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 };
|
|
685
664
|
|
|
686
665
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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","routedDialogContextKey","ZResourcePickerContext","_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","IRoutedDialogContext","_class","_class2","constructor","args","jsxZova","_initializerDefineProperty","_descriptor","$$modelResource","$params","pickerContext","options","$$routedDialogContext","props","session","Error","dialog","__init__","bean","_newBeanSimple","apiSchemasSelect","sdk","schemaRow","render","blocks","_prepareBlocks","rest","length","domBlocks","forEach","block","index","key","domBlock","Array","isArray","push","_createVNode","default","ZPage","map","actionPath","queryFixed","query","selectionPolicy","selectionMode","selectionMax","selectedIds","selectedRows","onSelectionChange","selection","ids","rows","row","_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';","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 { TableIdentity } from 'table-identity';\nimport type { VNode } from 'vue';\nimport type {\n IResourceBlockOptionsBase,\n IResourceRenderBlockOptionsBlock,\n IResourceTableSelectionPayload,\n ITableQuery,\n} from 'zova-module-a-openapi';\nimport type { IRoutedDialogContext } from 'zova-module-basic-app';\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 { routedDialogContextKey } from 'zova-module-basic-app';\nimport { ZPage } from 'zova-module-home-base';\n\nimport type { ModelResource } from '../../model/resource.js';\n\nimport { ZResourcePickerContext } from '../../.metadata/component/resourcePickerContext.js';\n\nexport const ControllerPageResourcePickerSchemaParams = z.object({\n resource: z.string(),\n});\n\nexport interface IResourcePickerPageOptions extends Record<string, unknown> {\n resource: string;\n actionPath?: string;\n query?: ITableQuery;\n selectionMode: 'single' | 'multiple';\n selectionMax?: number;\n selectedIds?: readonly TableIdentity[];\n}\n\nexport interface IResourcePickerPageSession {\n selectedIds: TableIdentity[];\n selectedRows: Record<string, unknown>[];\n}\n\nexport interface IResourcePickerPageContext {\n options: IResourcePickerPageOptions;\n session: IResourcePickerPageSession;\n dialog: IRoutedDialogContext<\n IResourceTableSelectionPayload,\n IResourcePickerPageOptions,\n IResourcePickerPageSession\n >;\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: routedDialogContextKey, injectionScope: 'host' })\n $$routedDialogContext: IRoutedDialogContext<\n IResourceTableSelectionPayload,\n IResourcePickerPageOptions,\n IResourcePickerPageSession\n >;\n\n get resource() {\n return this.$params.resource;\n }\n\n get pickerContext(): IResourcePickerPageContext {\n const options = this.$$routedDialogContext.props;\n const session = this.$$routedDialogContext.session;\n if (!options || !session || 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: this.$$routedDialogContext,\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 blocks = this._prepareBlocks(this.schemaRow?.rest?.blocks);\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={this.pickerContext}>\n <ZPage>{domBlocks}</ZPage>\n </ZResourcePickerContext>\n );\n }\n\n private _prepareBlocks(blocks: IResourceRenderBlockOptionsBlock[] | undefined) {\n if (!blocks) return;\n return blocks.map(block => {\n if (block.render !== 'basic-page:blockPage') return block;\n const pickerContext = this.pickerContext;\n return {\n ...block,\n options: deepExtend({}, block.options, {\n actionPath: pickerContext.options.actionPath,\n queryFixed: pickerContext.options.query,\n selectionPolicy: 'always',\n selectionMode: pickerContext.options.selectionMode,\n selectionMax: pickerContext.options.selectionMax,\n selectedIds: pickerContext.session.selectedIds,\n selectedRows: pickerContext.session.selectedRows,\n onSelectionChange: (selection: IResourceTableSelectionPayload) => {\n pickerContext.session.selectedIds = [...selection.ids];\n pickerContext.session.selectedRows = selection.rows.map(row => ({ ...row }));\n },\n blocks: [\n ...((\n block.options as IResourceBlockOptionsBase & {\n blocks?: IResourceRenderBlockOptionsBlock[];\n }\n ).blocks ?? []),\n {\n render: 'basic-resource:blockResourcePickerActions',\n },\n ],\n }),\n };\n });\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);","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,IAA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MA,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"}
|
|
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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,IAAW;CACV,SAAU,iCAAiC;CACrB,gCAAgC,eAAe;AACtE,EAAA,CAAG,mCAAmC,iCAAiC,CAAC,EAAE;AAC1E,IAAa,sBAAsB,wBAAwB,8BAA8B,KAAA,GAAW,KAAA,CAAS;;;ACP7G,IAAa,oBAAoB;CAC/B,QAAQ;CACR,cAAc;CACd,YAAY;AACd;AACA,SAAgB,eAAe,OAAO;CACpC,OAAO,kBAAkB,mBAAmB,MAAM,OAAO,QAAQ;AACnE;;;ACFA,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,EACJ,YAAY,UACd;CACF;CAAG;EACD,MAAM;EACN,MAAM;EACN,WAAW;EACX,MAAM;GACJ,QAAQ;GACR,YAAY;EACd;CACF;AAAC;;;;;ACjCD,IAAI;AAAM,IAAA;AAAO,IAAA;AAkCjB,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"}
|
|
@@ -1,2 +1,31 @@
|
|
|
1
|
+
import type { TableIdentity } from 'table-identity';
|
|
2
|
+
import type { IResourceRenderBlockOptionsBlock, IResourceTableSelectionPayload, ITableQuery } from 'zova-module-a-openapi';
|
|
1
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
|
+
}
|
|
2
31
|
//# sourceMappingURL=resourcePicker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resourcePicker.d.ts","sourceRoot":"","sources":["../../src/lib/resourcePicker.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,+BAA+B,CAAC"}
|
|
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"}
|
|
@@ -1,39 +1,20 @@
|
|
|
1
|
-
import type { TableIdentity } from 'table-identity';
|
|
2
|
-
import type { IResourceTableSelectionPayload, ITableQuery } from 'zova-module-a-openapi';
|
|
3
|
-
import type { IRoutedDialogContext } from 'zova-module-basic-app';
|
|
4
1
|
import { z } from 'zod';
|
|
5
2
|
import { BeanControllerPageBase } from 'zova';
|
|
6
3
|
import { ZovaJsx } from 'zova-jsx';
|
|
4
|
+
import type { IResourcePickerPageContext, IResourcePickerPageHost } from '../../lib/resourcePicker.js';
|
|
7
5
|
import type { ModelResource } from '../../model/resource.js';
|
|
8
6
|
export declare const ControllerPageResourcePickerSchemaParams: z.ZodObject<{
|
|
9
7
|
resource: z.ZodString;
|
|
10
8
|
}, z.core.$strip>;
|
|
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
|
-
export interface IResourcePickerPageSession {
|
|
20
|
-
selectedIds: TableIdentity[];
|
|
21
|
-
selectedRows: Record<string, unknown>[];
|
|
22
|
-
}
|
|
23
|
-
export interface IResourcePickerPageContext {
|
|
24
|
-
options: IResourcePickerPageOptions;
|
|
25
|
-
session: IResourcePickerPageSession;
|
|
26
|
-
dialog: IRoutedDialogContext<IResourceTableSelectionPayload, IResourcePickerPageOptions, IResourcePickerPageSession>;
|
|
27
|
-
}
|
|
28
9
|
export declare class ControllerPageResourcePicker extends BeanControllerPageBase {
|
|
29
10
|
jsxZova: ZovaJsx;
|
|
30
11
|
get $$modelResource(): ModelResource;
|
|
31
|
-
$$
|
|
12
|
+
$$pickerHost: IResourcePickerPageHost | undefined;
|
|
32
13
|
get resource(): string;
|
|
33
14
|
get pickerContext(): IResourcePickerPageContext;
|
|
34
15
|
protected __init__(): Promise<void>;
|
|
35
16
|
get schemaRow(): import("zova-module-a-openapi").ISchemaObjectExtensionField | undefined;
|
|
36
17
|
render(): import("vue/jsx-runtime").JSX.Element | undefined;
|
|
37
|
-
private _prepareBlocks;
|
|
38
18
|
}
|
|
19
|
+
export type { IResourcePickerPageContext } from '../../lib/resourcePicker.js';
|
|
39
20
|
//# sourceMappingURL=controller.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../../src/page/resourcePicker/controller.tsx"],"names":[],"mappings":"
|
|
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/package.json
CHANGED
|
@@ -1 +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
|
+
|
|
1
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
|
+
}
|
|
@@ -1,53 +1,25 @@
|
|
|
1
|
-
import type { TableIdentity } from 'table-identity';
|
|
2
1
|
import type { VNode } from 'vue';
|
|
3
|
-
import type {
|
|
4
|
-
IResourceBlockOptionsBase,
|
|
5
|
-
IResourceRenderBlockOptionsBlock,
|
|
6
|
-
IResourceTableSelectionPayload,
|
|
7
|
-
ITableQuery,
|
|
8
|
-
} from 'zova-module-a-openapi';
|
|
9
|
-
import type { IRoutedDialogContext } from 'zova-module-basic-app';
|
|
10
2
|
|
|
11
3
|
import { z } from 'zod';
|
|
12
4
|
import { BeanControllerPageBase, deepExtend, Use, usePrepareArg } from 'zova';
|
|
13
5
|
import { ZovaJsx } from 'zova-jsx';
|
|
14
6
|
import { Controller } from 'zova-module-a-bean';
|
|
15
7
|
import { $QueryEnsureLoaded } from 'zova-module-a-model';
|
|
16
|
-
import { routedDialogContextKey } from 'zova-module-basic-app';
|
|
17
8
|
import { ZPage } from 'zova-module-home-base';
|
|
18
9
|
|
|
10
|
+
import type {
|
|
11
|
+
IResourcePickerPageContext,
|
|
12
|
+
IResourcePickerPageHost,
|
|
13
|
+
} from '../../lib/resourcePicker.js';
|
|
19
14
|
import type { ModelResource } from '../../model/resource.js';
|
|
20
15
|
|
|
21
16
|
import { ZResourcePickerContext } from '../../.metadata/component/resourcePickerContext.js';
|
|
17
|
+
import { resourcePickerPageHostKey } from '../../lib/resourcePicker.js';
|
|
22
18
|
|
|
23
19
|
export const ControllerPageResourcePickerSchemaParams = z.object({
|
|
24
20
|
resource: z.string(),
|
|
25
21
|
});
|
|
26
22
|
|
|
27
|
-
export interface IResourcePickerPageOptions extends Record<string, unknown> {
|
|
28
|
-
resource: string;
|
|
29
|
-
actionPath?: string;
|
|
30
|
-
query?: ITableQuery;
|
|
31
|
-
selectionMode: 'single' | 'multiple';
|
|
32
|
-
selectionMax?: number;
|
|
33
|
-
selectedIds?: readonly TableIdentity[];
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export interface IResourcePickerPageSession {
|
|
37
|
-
selectedIds: TableIdentity[];
|
|
38
|
-
selectedRows: Record<string, unknown>[];
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface IResourcePickerPageContext {
|
|
42
|
-
options: IResourcePickerPageOptions;
|
|
43
|
-
session: IResourcePickerPageSession;
|
|
44
|
-
dialog: IRoutedDialogContext<
|
|
45
|
-
IResourceTableSelectionPayload,
|
|
46
|
-
IResourcePickerPageOptions,
|
|
47
|
-
IResourcePickerPageSession
|
|
48
|
-
>;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
23
|
@Controller()
|
|
52
24
|
export class ControllerPageResourcePicker extends BeanControllerPageBase {
|
|
53
25
|
jsxZova: ZovaJsx;
|
|
@@ -57,27 +29,27 @@ export class ControllerPageResourcePicker extends BeanControllerPageBase {
|
|
|
57
29
|
return usePrepareArg(this.resource, true);
|
|
58
30
|
}
|
|
59
31
|
|
|
60
|
-
@Use({ name:
|
|
61
|
-
$$
|
|
62
|
-
IResourceTableSelectionPayload,
|
|
63
|
-
IResourcePickerPageOptions,
|
|
64
|
-
IResourcePickerPageSession
|
|
65
|
-
>;
|
|
32
|
+
@Use({ name: resourcePickerPageHostKey, injectionScope: 'host' })
|
|
33
|
+
$$pickerHost: IResourcePickerPageHost | undefined;
|
|
66
34
|
|
|
67
35
|
get resource() {
|
|
68
36
|
return this.$params.resource;
|
|
69
37
|
}
|
|
70
38
|
|
|
71
39
|
get pickerContext(): IResourcePickerPageContext {
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
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) {
|
|
75
47
|
throw new Error('resource picker context does not match route resource');
|
|
76
48
|
}
|
|
77
49
|
return {
|
|
78
50
|
options,
|
|
79
51
|
session,
|
|
80
|
-
dialog:
|
|
52
|
+
dialog: host,
|
|
81
53
|
};
|
|
82
54
|
}
|
|
83
55
|
|
|
@@ -91,7 +63,8 @@ export class ControllerPageResourcePicker extends BeanControllerPageBase {
|
|
|
91
63
|
}
|
|
92
64
|
|
|
93
65
|
public render() {
|
|
94
|
-
const
|
|
66
|
+
const pickerContext = this.pickerContext;
|
|
67
|
+
const blocks = this.$$pickerHost!.prepareBlocks(this.schemaRow?.rest?.blocks, pickerContext);
|
|
95
68
|
if (!blocks || blocks.length === 0) return;
|
|
96
69
|
const domBlocks: VNode[] = [];
|
|
97
70
|
blocks.forEach((block, index) => {
|
|
@@ -102,43 +75,11 @@ export class ControllerPageResourcePicker extends BeanControllerPageBase {
|
|
|
102
75
|
else domBlocks.push(domBlock);
|
|
103
76
|
});
|
|
104
77
|
return (
|
|
105
|
-
<ZResourcePickerContext context={
|
|
78
|
+
<ZResourcePickerContext context={pickerContext}>
|
|
106
79
|
<ZPage>{domBlocks}</ZPage>
|
|
107
80
|
</ZResourcePickerContext>
|
|
108
81
|
);
|
|
109
82
|
}
|
|
110
|
-
|
|
111
|
-
private _prepareBlocks(blocks: IResourceRenderBlockOptionsBlock[] | undefined) {
|
|
112
|
-
if (!blocks) return;
|
|
113
|
-
return blocks.map(block => {
|
|
114
|
-
if (block.render !== 'basic-page:blockPage') return block;
|
|
115
|
-
const pickerContext = this.pickerContext;
|
|
116
|
-
return {
|
|
117
|
-
...block,
|
|
118
|
-
options: deepExtend({}, block.options, {
|
|
119
|
-
actionPath: pickerContext.options.actionPath,
|
|
120
|
-
queryFixed: pickerContext.options.query,
|
|
121
|
-
selectionPolicy: 'always',
|
|
122
|
-
selectionMode: pickerContext.options.selectionMode,
|
|
123
|
-
selectionMax: pickerContext.options.selectionMax,
|
|
124
|
-
selectedIds: pickerContext.session.selectedIds,
|
|
125
|
-
selectedRows: pickerContext.session.selectedRows,
|
|
126
|
-
onSelectionChange: (selection: IResourceTableSelectionPayload) => {
|
|
127
|
-
pickerContext.session.selectedIds = [...selection.ids];
|
|
128
|
-
pickerContext.session.selectedRows = selection.rows.map(row => ({ ...row }));
|
|
129
|
-
},
|
|
130
|
-
blocks: [
|
|
131
|
-
...((
|
|
132
|
-
block.options as IResourceBlockOptionsBase & {
|
|
133
|
-
blocks?: IResourceRenderBlockOptionsBlock[];
|
|
134
|
-
}
|
|
135
|
-
).blocks ?? []),
|
|
136
|
-
{
|
|
137
|
-
render: 'basic-resource:blockResourcePickerActions',
|
|
138
|
-
},
|
|
139
|
-
],
|
|
140
|
-
}),
|
|
141
|
-
};
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
83
|
}
|
|
84
|
+
|
|
85
|
+
export type { IResourcePickerPageContext } from '../../lib/resourcePicker.js';
|