@smartsoft001/crud-shell-react 0.0.0-stage → 2.194.0
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/README.md +11 -3
- package/package.json +29 -4
- package/src/index.d.ts +19 -0
- package/src/index.js +23 -0
- package/src/index.js.map +1 -0
- package/src/lib/components/export/export.d.ts +7 -0
- package/src/lib/components/export/export.js +15 -0
- package/src/lib/components/export/export.js.map +1 -0
- package/src/lib/components/export/export.types.d.ts +8 -0
- package/src/lib/components/export/export.types.js +3 -0
- package/src/lib/components/export/export.types.js.map +1 -0
- package/src/lib/components/export/index.d.ts +3 -0
- package/src/lib/components/export/index.js +7 -0
- package/src/lib/components/export/index.js.map +1 -0
- package/src/lib/components/export/use-crud-export.d.ts +15 -0
- package/src/lib/components/export/use-crud-export.js +72 -0
- package/src/lib/components/export/use-crud-export.js.map +1 -0
- package/src/lib/components/filter/base/use-crud-filter.d.ts +65 -0
- package/src/lib/components/filter/base/use-crud-filter.js +244 -0
- package/src/lib/components/filter/base/use-crud-filter.js.map +1 -0
- package/src/lib/components/filter/check/filter-check.d.ts +6 -0
- package/src/lib/components/filter/check/filter-check.js +44 -0
- package/src/lib/components/filter/check/filter-check.js.map +1 -0
- package/src/lib/components/filter/date/filter-date.d.ts +6 -0
- package/src/lib/components/filter/date/filter-date.js +18 -0
- package/src/lib/components/filter/date/filter-date.js.map +1 -0
- package/src/lib/components/filter/date/use-crud-filter-date.d.ts +22 -0
- package/src/lib/components/filter/date/use-crud-filter-date.js +40 -0
- package/src/lib/components/filter/date/use-crud-filter-date.js.map +1 -0
- package/src/lib/components/filter/date/use-crud-filter-value.d.ts +6 -0
- package/src/lib/components/filter/date/use-crud-filter-value.js +25 -0
- package/src/lib/components/filter/date/use-crud-filter-value.js.map +1 -0
- package/src/lib/components/filter/date-time/filter-date-time.d.ts +7 -0
- package/src/lib/components/filter/date-time/filter-date-time.js +26 -0
- package/src/lib/components/filter/date-time/filter-date-time.js.map +1 -0
- package/src/lib/components/filter/date-with-edit/filter-date-with-edit.d.ts +8 -0
- package/src/lib/components/filter/date-with-edit/filter-date-with-edit.js +41 -0
- package/src/lib/components/filter/date-with-edit/filter-date-with-edit.js.map +1 -0
- package/src/lib/components/filter/filter.d.ts +7 -0
- package/src/lib/components/filter/filter.js +42 -0
- package/src/lib/components/filter/filter.js.map +1 -0
- package/src/lib/components/filter/filter.types.d.ts +14 -0
- package/src/lib/components/filter/filter.types.js +3 -0
- package/src/lib/components/filter/filter.types.js.map +1 -0
- package/src/lib/components/filter/flag/filter-flag.d.ts +6 -0
- package/src/lib/components/filter/flag/filter-flag.js +19 -0
- package/src/lib/components/filter/flag/filter-flag.js.map +1 -0
- package/src/lib/components/filter/index.d.ts +13 -0
- package/src/lib/components/filter/index.js +17 -0
- package/src/lib/components/filter/index.js.map +1 -0
- package/src/lib/components/filter/int/filter-int.d.ts +11 -0
- package/src/lib/components/filter/int/filter-int.js +45 -0
- package/src/lib/components/filter/int/filter-int.js.map +1 -0
- package/src/lib/components/filter/radio/filter-radio.d.ts +7 -0
- package/src/lib/components/filter/radio/filter-radio.js +20 -0
- package/src/lib/components/filter/radio/filter-radio.js.map +1 -0
- package/src/lib/components/filter/text/filter-text.d.ts +7 -0
- package/src/lib/components/filter/text/filter-text.js +20 -0
- package/src/lib/components/filter/text/filter-text.js.map +1 -0
- package/src/lib/components/filters/filters.d.ts +9 -0
- package/src/lib/components/filters/filters.js +19 -0
- package/src/lib/components/filters/filters.js.map +1 -0
- package/src/lib/components/filters/filters.types.d.ts +5 -0
- package/src/lib/components/filters/filters.types.js +3 -0
- package/src/lib/components/filters/filters.types.js.map +1 -0
- package/src/lib/components/filters/index.d.ts +3 -0
- package/src/lib/components/filters/index.js +7 -0
- package/src/lib/components/filters/index.js.map +1 -0
- package/src/lib/components/filters/use-crud-filters.d.ts +16 -0
- package/src/lib/components/filters/use-crud-filters.js +62 -0
- package/src/lib/components/filters/use-crud-filters.js.map +1 -0
- package/src/lib/components/filters-config/filters-config.d.ts +6 -0
- package/src/lib/components/filters-config/filters-config.js +37 -0
- package/src/lib/components/filters-config/filters-config.js.map +1 -0
- package/src/lib/components/filters-config/index.d.ts +1 -0
- package/src/lib/components/filters-config/index.js +5 -0
- package/src/lib/components/filters-config/index.js.map +1 -0
- package/src/lib/components/group/group.d.ts +9 -0
- package/src/lib/components/group/group.js +18 -0
- package/src/lib/components/group/group.js.map +1 -0
- package/src/lib/components/group/group.types.d.ts +8 -0
- package/src/lib/components/group/group.types.js +3 -0
- package/src/lib/components/group/group.types.js.map +1 -0
- package/src/lib/components/group/index.d.ts +3 -0
- package/src/lib/components/group/index.js +7 -0
- package/src/lib/components/group/index.js.map +1 -0
- package/src/lib/components/group/use-crud-group.d.ts +16 -0
- package/src/lib/components/group/use-crud-group.js +48 -0
- package/src/lib/components/group/use-crud-group.js.map +1 -0
- package/src/lib/components/multiselect/index.d.ts +2 -0
- package/src/lib/components/multiselect/index.js +6 -0
- package/src/lib/components/multiselect/index.js.map +1 -0
- package/src/lib/components/multiselect/multiselect.d.ts +9 -0
- package/src/lib/components/multiselect/multiselect.js +24 -0
- package/src/lib/components/multiselect/multiselect.js.map +1 -0
- package/src/lib/components/multiselect/use-crud-multiselect.d.ts +23 -0
- package/src/lib/components/multiselect/use-crud-multiselect.js +71 -0
- package/src/lib/components/multiselect/use-crud-multiselect.js.map +1 -0
- package/src/lib/crud.config.d.ts +66 -0
- package/src/lib/crud.config.js +3 -0
- package/src/lib/crud.config.js.map +1 -0
- package/src/lib/crud.context.d.ts +23 -0
- package/src/lib/crud.context.js +25 -0
- package/src/lib/crud.context.js.map +1 -0
- package/src/lib/crud.provider.d.ts +16 -0
- package/src/lib/crud.provider.js +68 -0
- package/src/lib/crud.provider.js.map +1 -0
- package/src/lib/factories/form-options.d.ts +10 -0
- package/src/lib/factories/form-options.js +26 -0
- package/src/lib/factories/form-options.js.map +1 -0
- package/src/lib/hooks.d.ts +15 -0
- package/src/lib/hooks.js +66 -0
- package/src/lib/hooks.js.map +1 -0
- package/src/lib/models/index.d.ts +1 -0
- package/src/lib/models/index.js +5 -0
- package/src/lib/models/index.js.map +1 -0
- package/src/lib/models/interfaces.d.ts +29 -0
- package/src/lib/models/interfaces.js +3 -0
- package/src/lib/models/interfaces.js.map +1 -0
- package/src/lib/pages/crud-pages.d.ts +31 -0
- package/src/lib/pages/crud-pages.js +63 -0
- package/src/lib/pages/crud-pages.js.map +1 -0
- package/src/lib/pages/index.d.ts +12 -0
- package/src/lib/pages/index.js +16 -0
- package/src/lib/pages/index.js.map +1 -0
- package/src/lib/pages/item/item-page.d.ts +15 -0
- package/src/lib/pages/item/item-page.js +28 -0
- package/src/lib/pages/item/item-page.js.map +1 -0
- package/src/lib/pages/item/item-page.types.d.ts +43 -0
- package/src/lib/pages/item/item-page.types.js +3 -0
- package/src/lib/pages/item/item-page.types.js.map +1 -0
- package/src/lib/pages/item/standard/item-page-standard.d.ts +8 -0
- package/src/lib/pages/item/standard/item-page-standard.js +17 -0
- package/src/lib/pages/item/standard/item-page-standard.js.map +1 -0
- package/src/lib/pages/item/use-crud-item-page-base.d.ts +21 -0
- package/src/lib/pages/item/use-crud-item-page-base.js +46 -0
- package/src/lib/pages/item/use-crud-item-page-base.js.map +1 -0
- package/src/lib/pages/item/use-crud-item-page.d.ts +44 -0
- package/src/lib/pages/item/use-crud-item-page.js +296 -0
- package/src/lib/pages/item/use-crud-item-page.js.map +1 -0
- package/src/lib/pages/list/list-page.d.ts +14 -0
- package/src/lib/pages/list/list-page.js +29 -0
- package/src/lib/pages/list/list-page.js.map +1 -0
- package/src/lib/pages/list/list-page.types.d.ts +25 -0
- package/src/lib/pages/list/list-page.types.js +3 -0
- package/src/lib/pages/list/list-page.types.js.map +1 -0
- package/src/lib/pages/list/standard/list-page-standard.d.ts +11 -0
- package/src/lib/pages/list/standard/list-page-standard.js +26 -0
- package/src/lib/pages/list/standard/list-page-standard.js.map +1 -0
- package/src/lib/pages/list/use-crud-list-page.d.ts +35 -0
- package/src/lib/pages/list/use-crud-list-page.js +307 -0
- package/src/lib/pages/list/use-crud-list-page.js.map +1 -0
- package/src/lib/pages/use-crud-bound-component.d.ts +9 -0
- package/src/lib/pages/use-crud-bound-component.js +27 -0
- package/src/lib/pages/use-crud-bound-component.js.map +1 -0
- package/src/lib/pages/use-crud-page-config.d.ts +8 -0
- package/src/lib/pages/use-crud-page-config.js +18 -0
- package/src/lib/pages/use-crud-page-config.js.map +1 -0
- package/src/lib/providers/model-label.provider.d.ts +11 -0
- package/src/lib/providers/model-label.provider.js +27 -0
- package/src/lib/providers/model-label.provider.js.map +1 -0
- package/src/lib/services/crud/crud.service.d.ts +43 -0
- package/src/lib/services/crud/crud.service.js +112 -0
- package/src/lib/services/crud/crud.service.js.map +1 -0
- package/src/lib/services/list-group/list-group.service.d.ts +18 -0
- package/src/lib/services/list-group/list-group.service.js +52 -0
- package/src/lib/services/list-group/list-group.service.js.map +1 -0
- package/src/lib/services/page/page.service.d.ts +8 -0
- package/src/lib/services/page/page.service.js +33 -0
- package/src/lib/services/page/page.service.js.map +1 -0
- package/src/lib/services/search/search.service.d.ts +14 -0
- package/src/lib/services/search/search.service.js +28 -0
- package/src/lib/services/search/search.service.js.map +1 -0
- package/src/lib/state/crud.actions.d.ts +157 -0
- package/src/lib/state/crud.actions.js +257 -0
- package/src/lib/state/crud.actions.js.map +1 -0
- package/src/lib/state/crud.effects.d.ts +19 -0
- package/src/lib/state/crud.effects.js +127 -0
- package/src/lib/state/crud.effects.js.map +1 -0
- package/src/lib/state/crud.facade.d.ts +42 -0
- package/src/lib/state/crud.facade.js +92 -0
- package/src/lib/state/crud.facade.js.map +1 -0
- package/src/lib/state/crud.reducer.d.ts +20 -0
- package/src/lib/state/crud.reducer.js +218 -0
- package/src/lib/state/crud.reducer.js.map +1 -0
- package/src/lib/state/crud.selectors.d.ts +9 -0
- package/src/lib/state/crud.selectors.js +24 -0
- package/src/lib/state/crud.selectors.js.map +1 -0
- package/src/lib/state/crud.store.d.ts +17 -0
- package/src/lib/state/crud.store.js +33 -0
- package/src/lib/state/crud.store.js.map +1 -0
- package/src/lib/state/index.d.ts +6 -0
- package/src/lib/state/index.js +10 -0
- package/src/lib/state/index.js.map +1 -0
- package/styles.css +6001 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { IEntity } from '@smartsoft001/domain-core';
|
|
3
|
+
import { CrudConfig, CrudFullConfig } from './crud.config';
|
|
4
|
+
import { CrudService } from './services/crud/crud.service';
|
|
5
|
+
export interface CrudProviderProps<T extends IEntity<string>> {
|
|
6
|
+
config: CrudConfig<T> | CrudFullConfig<T>;
|
|
7
|
+
/** Replaces the REST client, e.g. with a subclass. */
|
|
8
|
+
service?: CrudService<T>;
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Sets up a CRUD feature for its subtree: the service, the store with its
|
|
13
|
+
* effects, the facade and the file service pointed at the resource. Pass a
|
|
14
|
+
* memoised `config`.
|
|
15
|
+
*/
|
|
16
|
+
export declare function CrudProvider<T extends IEntity<string>>({ config, service, children, }: CrudProviderProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CrudProvider = CrudProvider;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const react_2 = require("@smartsoft001/react");
|
|
7
|
+
const crud_context_1 = require("./crud.context");
|
|
8
|
+
const crud_service_1 = require("./services/crud/crud.service");
|
|
9
|
+
const list_group_service_1 = require("./services/list-group/list-group.service");
|
|
10
|
+
const search_service_1 = require("./services/search/search.service");
|
|
11
|
+
const crud_effects_1 = require("./state/crud.effects");
|
|
12
|
+
const crud_facade_1 = require("./state/crud.facade");
|
|
13
|
+
const crud_reducer_1 = require("./state/crud.reducer");
|
|
14
|
+
const crud_store_1 = require("./state/crud.store");
|
|
15
|
+
// One registry per application (per `SmartProvider`, whose HTTP client is
|
|
16
|
+
// created once), so features with the same entity share their state, while
|
|
17
|
+
// two applications rendered in one process (SSR) stay apart.
|
|
18
|
+
const registries = new WeakMap();
|
|
19
|
+
function getRegistry(http) {
|
|
20
|
+
let registry = registries.get(http);
|
|
21
|
+
if (!registry) {
|
|
22
|
+
registry = { features: new Map(), searchService: new search_service_1.CrudSearchService() };
|
|
23
|
+
registries.set(http, registry);
|
|
24
|
+
}
|
|
25
|
+
return registry;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Sets up a CRUD feature for its subtree: the service, the store with its
|
|
29
|
+
* effects, the facade and the file service pointed at the resource. Pass a
|
|
30
|
+
* memoised `config`.
|
|
31
|
+
*/
|
|
32
|
+
function CrudProvider({ config, service, children, }) {
|
|
33
|
+
const smart = (0, react_2.useSmart)();
|
|
34
|
+
const crud = (0, react_1.useMemo)(() => {
|
|
35
|
+
const registry = getRegistry(smart.http);
|
|
36
|
+
const crudService = service ?? new crud_service_1.CrudService(config, smart.http);
|
|
37
|
+
let feature = registry.features.get(config.entity);
|
|
38
|
+
if (!feature) {
|
|
39
|
+
const store = new crud_store_1.CrudStore(config.entity, config.reducerFactory
|
|
40
|
+
? config.reducerFactory()
|
|
41
|
+
: (0, crud_reducer_1.getReducer)(config.entity));
|
|
42
|
+
const effects = new crud_effects_1.CrudEffects(crudService);
|
|
43
|
+
effects.init(store);
|
|
44
|
+
feature = { store, effects };
|
|
45
|
+
registry.features.set(config.entity, feature);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
// The effects talk to the latest service, e.g. after `apiUrl` changed.
|
|
49
|
+
feature.effects.service = crudService;
|
|
50
|
+
}
|
|
51
|
+
const facade = new crud_facade_1.CrudFacade(feature.store, config);
|
|
52
|
+
return {
|
|
53
|
+
config,
|
|
54
|
+
service: crudService,
|
|
55
|
+
store: feature.store,
|
|
56
|
+
facade,
|
|
57
|
+
searchService: registry.searchService,
|
|
58
|
+
listGroupService: new list_group_service_1.CrudListGroupService(facade),
|
|
59
|
+
};
|
|
60
|
+
}, [config, service, smart.http]);
|
|
61
|
+
// Attachments of the feature's items live under its own API.
|
|
62
|
+
const smartValue = (0, react_1.useMemo)(() => ({
|
|
63
|
+
...smart,
|
|
64
|
+
fileService: new react_2.FileService({ apiUrl: config.apiUrl }, smart.http, () => smart.authService.getAccessToken()),
|
|
65
|
+
}), [smart, config.apiUrl]);
|
|
66
|
+
return ((0, jsx_runtime_1.jsx)(react_2.SmartContext.Provider, { value: smartValue, children: (0, jsx_runtime_1.jsx)(crud_context_1.CrudContext.Provider, { value: crud, children: children }) }));
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=crud.provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crud.provider.js","sourceRoot":"","sources":["../../../../../../../packages/crud/shell/react/src/lib/crud.provider.tsx"],"names":[],"mappings":";;AA2DA,oCAyDC;;AApHD,iCAAgC;AAIhC,+CAK6B;AAG7B,iDAA+D;AAC/D,+DAA2D;AAC3D,iFAAgF;AAChF,qEAAqE;AACrE,uDAAmD;AACnD,qDAAiD;AACjD,uDAAkD;AAClD,mDAA+C;AAY/C,0EAA0E;AAC1E,2EAA2E;AAC3E,6DAA6D;AAC7D,MAAM,UAAU,GAAG,IAAI,OAAO,EAAiC,CAAC;AAEhE,SAAS,WAAW,CAAC,IAAqB;IACxC,IAAI,QAAQ,GAAG,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAEpC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,QAAQ,GAAG,EAAE,QAAQ,EAAE,IAAI,GAAG,EAAE,EAAE,aAAa,EAAE,IAAI,kCAAiB,EAAE,EAAE,CAAC;QAC3E,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACjC,CAAC;IAED,OAAO,QAA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,MAAM;YACN,aAAa,EAAE,QAAQ,CAAC,aAAa;YACrC,gBAAgB,EAAE,IAAI,yCAAoB,CAAI,MAAM,CAAC;SACtD,CAAC;IACJ,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAElC,6DAA6D;IAC7D,MAAM,UAAU,GAAG,IAAA,eAAO,EACxB,GAAG,EAAE,CAAC,CAAC;QACL,GAAG,KAAK;QACR,WAAW,EAAE,IAAI,mBAAW,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE,CACvE,KAAK,CAAC,WAAW,CAAC,cAAc,EAAE,CACnC;KACF,CAAC,EACF,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,CACvB,CAAC;IAEF,OAAO,CACL,uBAAC,oBAAY,CAAC,QAAQ,IAAC,KAAK,EAAE,UAAU,YACtC,uBAAC,0BAAW,CAAC,QAAQ,IAAC,KAAK,EAAE,IAAI,YAAG,QAAQ,GAAwB,GAC9C,CACzB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
2
|
+
import { IEntity } from '@smartsoft001/domain-core';
|
|
3
|
+
import { IFormOptions } from '@smartsoft001/react';
|
|
4
|
+
/**
|
|
5
|
+
* The form options of the item page: a fresh model for `create`, a model
|
|
6
|
+
* filled from `item` for any other mode.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getCrudFormOptions<T extends IEntity<string>>(item: T | null | undefined, mode: string, type: any, uniqueProvider?: (values: Record<keyof T, any>) => Promise<boolean>, inputComponents?: {
|
|
9
|
+
[key: string]: ComponentType<any>;
|
|
10
|
+
}): IFormOptions<T> | null;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCrudFormOptions = getCrudFormOptions;
|
|
4
|
+
/**
|
|
5
|
+
* The form options of the item page: a fresh model for `create`, a model
|
|
6
|
+
* filled from `item` for any other mode.
|
|
7
|
+
*/
|
|
8
|
+
function getCrudFormOptions(item, mode, type, uniqueProvider, inputComponents) {
|
|
9
|
+
if (!mode || !type)
|
|
10
|
+
return null;
|
|
11
|
+
const model = new type();
|
|
12
|
+
if (mode !== 'create' && item) {
|
|
13
|
+
Object.keys(item).forEach((key) => {
|
|
14
|
+
model[key] = item[key];
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
mode,
|
|
19
|
+
possibilities: {},
|
|
20
|
+
inputComponents,
|
|
21
|
+
uniqueProvider,
|
|
22
|
+
model,
|
|
23
|
+
show: true,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=form-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-options.js","sourceRoot":"","sources":["../../../../../../../../packages/crud/shell/react/src/lib/factories/form-options.ts"],"names":[],"mappings":";;AASA,gDAyBC;AA7BD;;;GAGG;AACH,SAAgB,kBAAkB,CAChC,IAA0B,EAC1B,IAAY,EACZ,IAAS,EACT,cAAmE,EACnE,eAAuD;IAEvD,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IAEhC,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE,CAAC;IAEzB,IAAI,IAAI,KAAK,QAAQ,IAAI,IAAI,EAAE,CAAC;QAC9B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YAC/B,KAAa,CAAC,GAAG,CAAC,GAAI,IAAY,CAAC,GAAG,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,IAAI;QACJ,aAAa,EAAE,EAAE;QACjB,eAAe;QACf,cAAc;QACd,KAAK;QACL,IAAI,EAAE,IAAI;KACX,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IEntity } from '@smartsoft001/domain-core';
|
|
2
|
+
import { IListPaginationOptions, PaginationMode } from '@smartsoft001/react';
|
|
3
|
+
import { CrudState } from './state/crud.reducer';
|
|
4
|
+
/** The feature's state (or a slice of it), re-rendering when it changes. */
|
|
5
|
+
export declare function useCrudState<T extends IEntity<string>>(): CrudState<T>;
|
|
6
|
+
export declare function useCrudState<T extends IEntity<string>, S>(selector: (state: CrudState<T>) => S): S;
|
|
7
|
+
/**
|
|
8
|
+
* The pagination options of the list, driven by the feature's filter and
|
|
9
|
+
* links: the next / previous page loaders resolve once the read settled, with
|
|
10
|
+
* whether there is a further page.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useCrudListPagination(options: {
|
|
13
|
+
mode?: PaginationMode;
|
|
14
|
+
limit: number;
|
|
15
|
+
}): IListPaginationOptions;
|
package/src/lib/hooks.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useCrudState = useCrudState;
|
|
4
|
+
exports.useCrudListPagination = useCrudListPagination;
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const react_2 = require("@smartsoft001/react");
|
|
7
|
+
const crud_context_1 = require("./crud.context");
|
|
8
|
+
function useCrudState(selector) {
|
|
9
|
+
const { store } = (0, crud_context_1.useCrud)();
|
|
10
|
+
return (0, react_2.useStore)(store, (selector ?? ((state) => state)));
|
|
11
|
+
}
|
|
12
|
+
function whenLoaded(store) {
|
|
13
|
+
return new Promise((resolve) => {
|
|
14
|
+
if (store.get().loaded) {
|
|
15
|
+
resolve();
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const unsubscribe = store.subscribe(() => {
|
|
19
|
+
if (!store.get().loaded)
|
|
20
|
+
return;
|
|
21
|
+
unsubscribe();
|
|
22
|
+
resolve();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The pagination options of the list, driven by the feature's filter and
|
|
28
|
+
* links: the next / previous page loaders resolve once the read settled, with
|
|
29
|
+
* whether there is a further page.
|
|
30
|
+
*/
|
|
31
|
+
function useCrudListPagination(options) {
|
|
32
|
+
const { store, facade } = (0, crud_context_1.useCrud)();
|
|
33
|
+
const filter = useCrudState((state) => state.filter);
|
|
34
|
+
const totalCount = useCrudState((state) => state.totalCount);
|
|
35
|
+
const { mode, limit } = options;
|
|
36
|
+
return (0, react_1.useMemo)(() => {
|
|
37
|
+
const load = (direction) => {
|
|
38
|
+
const links = store.get().links;
|
|
39
|
+
if (!links || !links[direction])
|
|
40
|
+
return Promise.resolve(false);
|
|
41
|
+
const current = store.get().filter ?? {};
|
|
42
|
+
const step = current.limit || 0;
|
|
43
|
+
const settled = new Promise((resolve) => {
|
|
44
|
+
// Reading flips `loaded` to false first; wait for it to come back.
|
|
45
|
+
queueMicrotask(() => whenLoaded(store).then(() => setTimeout(() => {
|
|
46
|
+
const next = store.get().links;
|
|
47
|
+
resolve(!!(next && next[direction]));
|
|
48
|
+
})));
|
|
49
|
+
});
|
|
50
|
+
facade.read({
|
|
51
|
+
...current,
|
|
52
|
+
offset: (current.offset || 0) + (direction === 'next' ? step : -step),
|
|
53
|
+
});
|
|
54
|
+
return settled;
|
|
55
|
+
};
|
|
56
|
+
return {
|
|
57
|
+
mode,
|
|
58
|
+
limit,
|
|
59
|
+
loadNextPage: () => load('next'),
|
|
60
|
+
loadPrevPage: () => load('prev'),
|
|
61
|
+
page: filter?.limit ? (filter.offset || 0) / filter.limit + 1 : 0,
|
|
62
|
+
totalPages: filter?.limit && totalCount ? Math.ceil(totalCount / filter.limit) : 0,
|
|
63
|
+
};
|
|
64
|
+
}, [store, facade, mode, limit, filter, totalCount]);
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=hooks.js.map
|
|
@@ -0,0 +1 @@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CAAC;YAChC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;YACjE,UAAU,EACR,MAAM,EAAE,KAAK,IAAI,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;SACzE,CAAC;IACJ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;AACvD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './interfaces';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/crud/shell/react/src/lib/models/index.ts"],"names":[],"mappings":";;;AAAA,uDAA6B"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { IModelFilter } from '@smartsoft001/models';
|
|
2
|
+
import { PaginationMode } from '@smartsoft001/react';
|
|
3
|
+
export interface ICrudFilter {
|
|
4
|
+
searchText?: string;
|
|
5
|
+
sortBy?: string;
|
|
6
|
+
sortDesc?: boolean;
|
|
7
|
+
offset?: number;
|
|
8
|
+
limit?: number;
|
|
9
|
+
paginationMode?: PaginationMode;
|
|
10
|
+
query?: Array<ICrudFilterQueryItem>;
|
|
11
|
+
}
|
|
12
|
+
export interface ICrudFilterQueryItem extends IModelFilter {
|
|
13
|
+
key: string;
|
|
14
|
+
value: any;
|
|
15
|
+
type: '=' | '!=' | '>=' | '<=' | '<' | '>';
|
|
16
|
+
hidden?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface ICrudCreateManyOptions {
|
|
19
|
+
mode: CrudCreateManyMode;
|
|
20
|
+
}
|
|
21
|
+
export interface ICrudListGroup {
|
|
22
|
+
key: string;
|
|
23
|
+
value: string;
|
|
24
|
+
text: string;
|
|
25
|
+
show?: boolean;
|
|
26
|
+
changed?: boolean;
|
|
27
|
+
children?: Array<ICrudListGroup>;
|
|
28
|
+
}
|
|
29
|
+
export type CrudCreateManyMode = 'default' | 'replace';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../../../../../packages/crud/shell/react/src/lib/models/interfaces.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** The page of a CRUD feature a URL leads to (see `matchCrudRoute`). */
|
|
2
|
+
export type CrudRoute = {
|
|
3
|
+
page: 'list';
|
|
4
|
+
} | {
|
|
5
|
+
page: 'item';
|
|
6
|
+
id?: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* The CRUD page that `url` leads to, relative to `basePath`: `basePath` is
|
|
10
|
+
* the list, `basePath/add` the item page creating an item, `basePath/:id` the
|
|
11
|
+
* item page of `id`. `null` for any other URL.
|
|
12
|
+
*/
|
|
13
|
+
export declare function matchCrudRoute(url: string, basePath: string): CrudRoute | null;
|
|
14
|
+
export interface SmartCrudPagesProps {
|
|
15
|
+
/** The path the CRUD feature is mounted at, e.g. `/notes`. */
|
|
16
|
+
basePath: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The CRUD pages without a router: renders `SmartCrudListPage` on
|
|
20
|
+
* `basePath`, `SmartCrudItemPage` creating an item on `basePath/add` and
|
|
21
|
+
* `SmartCrudItemPage` of the item on `basePath/:id`, following the URL of
|
|
22
|
+
* `useNavigation()` (`getCurrentUrl()` + `subscribe`).
|
|
23
|
+
* Renders nothing on any other URL. Render it inside the `CrudProvider` of
|
|
24
|
+
* the feature.
|
|
25
|
+
*
|
|
26
|
+
* An application with a router can render the two pages from its own routes
|
|
27
|
+
* instead: `<SmartCrudListPage basePath="/notes" />` on `/notes`,
|
|
28
|
+
* `<SmartCrudItemPage basePath="/notes" />` on `/notes/add` and
|
|
29
|
+
* `<SmartCrudItemPage id={id} basePath="/notes" />` on `/notes/:id`.
|
|
30
|
+
*/
|
|
31
|
+
export declare function SmartCrudPages({ basePath }: SmartCrudPagesProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.matchCrudRoute = matchCrudRoute;
|
|
4
|
+
exports.SmartCrudPages = SmartCrudPages;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const react_2 = require("@smartsoft001/react");
|
|
8
|
+
const item_page_1 = require("./item/item-page");
|
|
9
|
+
const list_page_1 = require("./list/list-page");
|
|
10
|
+
/** The path without the query string, the hash and trailing slashes. */
|
|
11
|
+
function normalizePath(path) {
|
|
12
|
+
return path.split(/[?#]/)[0].replace(/\/+$/, '') || '/';
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The CRUD page that `url` leads to, relative to `basePath`: `basePath` is
|
|
16
|
+
* the list, `basePath/add` the item page creating an item, `basePath/:id` the
|
|
17
|
+
* item page of `id`. `null` for any other URL.
|
|
18
|
+
*/
|
|
19
|
+
function matchCrudRoute(url, basePath) {
|
|
20
|
+
const path = normalizePath(url);
|
|
21
|
+
const base = normalizePath(basePath);
|
|
22
|
+
if (path === base)
|
|
23
|
+
return { page: 'list' };
|
|
24
|
+
const prefix = base === '/' ? '/' : base + '/';
|
|
25
|
+
if (!path.startsWith(prefix))
|
|
26
|
+
return null;
|
|
27
|
+
const segment = path.slice(prefix.length);
|
|
28
|
+
if (!segment || segment.includes('/'))
|
|
29
|
+
return null;
|
|
30
|
+
if (segment === 'add')
|
|
31
|
+
return { page: 'item' };
|
|
32
|
+
return { page: 'item', id: decodeURIComponent(segment) };
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The CRUD pages without a router: renders `SmartCrudListPage` on
|
|
36
|
+
* `basePath`, `SmartCrudItemPage` creating an item on `basePath/add` and
|
|
37
|
+
* `SmartCrudItemPage` of the item on `basePath/:id`, following the URL of
|
|
38
|
+
* `useNavigation()` (`getCurrentUrl()` + `subscribe`).
|
|
39
|
+
* Renders nothing on any other URL. Render it inside the `CrudProvider` of
|
|
40
|
+
* the feature.
|
|
41
|
+
*
|
|
42
|
+
* An application with a router can render the two pages from its own routes
|
|
43
|
+
* instead: `<SmartCrudListPage basePath="/notes" />` on `/notes`,
|
|
44
|
+
* `<SmartCrudItemPage basePath="/notes" />` on `/notes/add` and
|
|
45
|
+
* `<SmartCrudItemPage id={id} basePath="/notes" />` on `/notes/:id`.
|
|
46
|
+
*/
|
|
47
|
+
function SmartCrudPages({ basePath }) {
|
|
48
|
+
const navigation = (0, react_2.useNavigation)();
|
|
49
|
+
const [url, setUrl] = (0, react_1.useState)(() => navigation.getCurrentUrl());
|
|
50
|
+
(0, react_1.useEffect)(() => {
|
|
51
|
+
setUrl(navigation.getCurrentUrl());
|
|
52
|
+
return navigation.subscribe(setUrl);
|
|
53
|
+
}, [navigation]);
|
|
54
|
+
const route = matchCrudRoute(url, basePath);
|
|
55
|
+
if (!route)
|
|
56
|
+
return null;
|
|
57
|
+
if (route.page === 'list')
|
|
58
|
+
return (0, jsx_runtime_1.jsx)(list_page_1.SmartCrudListPage, { basePath: basePath });
|
|
59
|
+
// The page is created anew between `add` and an id; between two ids the
|
|
60
|
+
// same page stays and gets the new `id`.
|
|
61
|
+
return ((0, jsx_runtime_1.jsx)(item_page_1.SmartCrudItemPage, { id: route.id, basePath: basePath }, route.id === undefined ? 'add' : 'item'));
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=crud-pages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crud-pages.js","sourceRoot":"","sources":["../../../../../../../../packages/crud/shell/react/src/lib/pages/crud-pages.tsx"],"names":[],"mappings":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AAC,GAAG,IAAA,gBAAQ,EAAC,GAAG,EAAE,CAAC,UAAU,CAAC,aAAa,EAAE,CAAC,CAAC;IAEjE,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,MAAM,CAAC,UAAU,CAAC,aAAa,EAAE,CAAC,CAAC;QAEnC,OAAO,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAEjB,MAAM,KAAK,GAAG,cAAc,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAE5C,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAExB,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM;QAAE,OAAO,uBAAC,6BAAiB,IAAC,QAAQ,EAAE,QAAQ,GAAI,CAAC;IAE5E,wEAAwE;IACxE,yCAAyC;IACzC,OAAO,CACL,uBAAC,6BAAiB,IAEhB,EAAE,EAAE,KAAK,CAAC,EAAE,EACZ,QAAQ,EAAE,QAAQ,IAFb,KAAK,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAG5C,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './crud-pages';
|
|
2
|
+
export * from './item/item-page';
|
|
3
|
+
export * from './item/item-page.types';
|
|
4
|
+
export * from './item/standard/item-page-standard';
|
|
5
|
+
export * from './item/use-crud-item-page';
|
|
6
|
+
export * from './item/use-crud-item-page-base';
|
|
7
|
+
export * from './list/list-page';
|
|
8
|
+
export * from './list/list-page.types';
|
|
9
|
+
export * from './list/standard/list-page-standard';
|
|
10
|
+
export * from './list/use-crud-list-page';
|
|
11
|
+
export * from './use-crud-bound-component';
|
|
12
|
+
export * from './use-crud-page-config';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./crud-pages"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./item/item-page"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./item/item-page.types"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./item/standard/item-page-standard"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./item/use-crud-item-page"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./item/use-crud-item-page-base"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./list/list-page"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./list/list-page.types"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./list/standard/list-page-standard"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./list/use-crud-list-page"), exports);
|
|
14
|
+
tslib_1.__exportStar(require("./use-crud-bound-component"), exports);
|
|
15
|
+
tslib_1.__exportStar(require("./use-crud-page-config"), exports);
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/crud/shell/react/src/lib/pages/index.ts"],"names":[],"mappings":";;;AAAA,uDAA6B;AAC7B,2DAAiC;AACjC,iEAAuC;AACvC,6EAAmD;AACnD,oEAA0C;AAC1C,yEAA+C;AAC/C,2DAAiC;AACjC,iEAAuC;AACvC,6EAAmD;AACnD,oEAA0C;AAC1C,qEAA2C;AAC3C,iEAAuC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IEntity } from '@smartsoft001/domain-core';
|
|
2
|
+
import { SmartCrudItemPageProps } from './item-page.types';
|
|
3
|
+
/**
|
|
4
|
+
* The item page of a CRUD feature: a `SmartPage` with the title, back button
|
|
5
|
+
* and mode buttons of `useCrudItemPage`, the add / edit components above and
|
|
6
|
+
* below the body, and the body: the one registered as
|
|
7
|
+
* `components['crud-item-page']` on `SmartProvider`, else
|
|
8
|
+
* `SmartCrudItemPageStandard`. Without `id` it creates an item. Render it
|
|
9
|
+
* inside the feature's `CrudProvider` with a `CrudFullConfig`.
|
|
10
|
+
*
|
|
11
|
+
* A registered body renders in the `.dynamic-content` element. It gets the
|
|
12
|
+
* same props as the standard one and must put the form it renders in
|
|
13
|
+
* `formRef` (see `useCrudItemPageBase`), or add and save do nothing.
|
|
14
|
+
*/
|
|
15
|
+
export declare function SmartCrudItemPage<T extends IEntity<string>>(props: SmartCrudItemPageProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SmartCrudItemPage = SmartCrudItemPage;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("@smartsoft001/react");
|
|
6
|
+
const item_page_standard_1 = require("./standard/item-page-standard");
|
|
7
|
+
const use_crud_item_page_1 = require("./use-crud-item-page");
|
|
8
|
+
/**
|
|
9
|
+
* The item page of a CRUD feature: a `SmartPage` with the title, back button
|
|
10
|
+
* and mode buttons of `useCrudItemPage`, the add / edit components above and
|
|
11
|
+
* below the body, and the body: the one registered as
|
|
12
|
+
* `components['crud-item-page']` on `SmartProvider`, else
|
|
13
|
+
* `SmartCrudItemPageStandard`. Without `id` it creates an item. Render it
|
|
14
|
+
* inside the feature's `CrudProvider` with a `CrudFullConfig`.
|
|
15
|
+
*
|
|
16
|
+
* A registered body renders in the `.dynamic-content` element. It gets the
|
|
17
|
+
* same props as the standard one and must put the form it renders in
|
|
18
|
+
* `formRef` (see `useCrudItemPageBase`), or add and save do nothing.
|
|
19
|
+
*/
|
|
20
|
+
function SmartCrudItemPage(props) {
|
|
21
|
+
const { children } = props;
|
|
22
|
+
const { config, mode, pageOptions, detailsOptions, uniqueProvider, onPartialChange, onChange, onValidChange, formRef, TopComponent, BottomComponent, } = (0, use_crud_item_page_1.useCrudItemPage)(props);
|
|
23
|
+
const Body = (0, react_1.useSmartComponent)('crud-item-page', item_page_standard_1.SmartCrudItemPageStandard);
|
|
24
|
+
const standard = Body === item_page_standard_1.SmartCrudItemPageStandard;
|
|
25
|
+
const body = ((0, jsx_runtime_1.jsx)(Body, { detailsOptions: detailsOptions, mode: mode, uniqueProvider: uniqueProvider, onPartialChange: onPartialChange, onChange: onChange, onValidChange: onValidChange, formRef: formRef, children: children }));
|
|
26
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.SmartPage, { options: pageOptions, className: config.className || '', children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xl py-2.5 separator", children: TopComponent ? (0, jsx_runtime_1.jsx)(TopComponent, {}) : null }), standard ? body : null, (0, jsx_runtime_1.jsx)("div", { className: "dynamic-content", children: !standard ? body : null }), (0, jsx_runtime_1.jsx)("div", { className: "text-xl py-2.5 separator", children: BottomComponent ? (0, jsx_runtime_1.jsx)(BottomComponent, {}) : null })] }));
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=item-page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item-page.js","sourceRoot":"","sources":["../../../../../../../../../packages/crud/shell/react/src/lib/pages/item/item-page.tsx"],"names":[],"mappings":";;AAsBA,8CAiDC;;AAtED,+CAAmE;AAMnE,sEAA0E;AAC1E,6DAAuD;AAEvD;;;;;;;;;;;GAWG;AACH,SAAgB,iBAAiB,CAC/B,KAA6B;IAE7B,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAC3B,MAAM,EACJ,MAAM,EACN,IAAI,EACJ,WAAW,EACX,cAAc,EACd,cAAc,EACd,eAAe,EACf,QAAQ,EACR,aAAa,EACb,OAAO,EACP,YAAY,EACZ,eAAe,GAChB,GAAG,IAAA,oCAAe,EAAI,KAAK,CAAC,CAAC;IAC9B,MAAM,IAAI,GAAG,IAAA,yBAAiB,EAC5B,gBAAgB,EAChB,8CAAyB,CAC1B,CAAC;IACF,MAAM,QAAQ,GAAG,IAAI,KAAK,8CAAyB,CAAC;IAEpD,MAAM,IAAI,GAAG,CACX,uBAAC,IAAI,IACH,cAAc,EAAE,cAAc,EAC9B,IAAI,EAAE,IAAI,EACV,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,EAChC,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,aAAa,EAC5B,OAAO,EAAE,OAAO,YAEf,QAAQ,GACJ,CACR,CAAC;IAEF,OAAO,CACL,wBAAC,iBAAS,IAAC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,IAAI,EAAE,aAChE,gCAAK,SAAS,EAAC,0BAA0B,YACtC,YAAY,CAAC,CAAC,CAAC,uBAAC,YAAY,KAAG,CAAC,CAAC,CAAC,IAAI,GACnC,EACL,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EACvB,gCAAK,SAAS,EAAC,iBAAiB,YAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAO,EAChE,gCAAK,SAAS,EAAC,0BAA0B,YACtC,eAAe,CAAC,CAAC,CAAC,uBAAC,eAAe,KAAG,CAAC,CAAC,CAAC,IAAI,GACzC,IACI,CACb,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ReactNode, RefObject } from 'react';
|
|
2
|
+
import { IEntity } from '@smartsoft001/domain-core';
|
|
3
|
+
import { IDetailsOptions, SmartFormGroup } from '@smartsoft001/react';
|
|
4
|
+
/** The props of `<SmartCrudItemPage>`. */
|
|
5
|
+
export interface SmartCrudItemPageProps {
|
|
6
|
+
/**
|
|
7
|
+
* The id of the item. Without it the page creates a new item.
|
|
8
|
+
*/
|
|
9
|
+
id?: string;
|
|
10
|
+
/**
|
|
11
|
+
* The path of the list. After a create, or a save without details, the page
|
|
12
|
+
* navigates there; without it, it goes back in the history.
|
|
13
|
+
*/
|
|
14
|
+
basePath?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Handed to the body. The standard body does not render it; a body
|
|
17
|
+
* registered as `crud-item-page` can.
|
|
18
|
+
*/
|
|
19
|
+
children?: ReactNode;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The props of the item page body: `SmartCrudItemPageStandard` or a body
|
|
23
|
+
* registered as `components['crud-item-page']` on `SmartProvider`.
|
|
24
|
+
*/
|
|
25
|
+
export interface SmartCrudItemPageBodyProps<T extends IEntity<string> = any> {
|
|
26
|
+
detailsOptions?: IDetailsOptions<T>;
|
|
27
|
+
/** `'create'`, `'update'` or `'details'`. */
|
|
28
|
+
mode?: string;
|
|
29
|
+
uniqueProvider?: (values: Record<keyof T, any>) => Promise<boolean>;
|
|
30
|
+
/** The values of the changed fields (`onPartialChange`). */
|
|
31
|
+
onPartialChange?: (value: Partial<T>) => void;
|
|
32
|
+
/** The form value (`onChange`). */
|
|
33
|
+
onChange?: (value: T) => void;
|
|
34
|
+
/** The form validity (`onValidChange`). */
|
|
35
|
+
onValidChange?: (valid: boolean) => void;
|
|
36
|
+
/**
|
|
37
|
+
* Where the body keeps the form it renders: the page validates it before a
|
|
38
|
+
* create or a save. `useCrudItemPageBase` fills
|
|
39
|
+
* it.
|
|
40
|
+
*/
|
|
41
|
+
formRef?: RefObject<SmartFormGroup | null>;
|
|
42
|
+
children?: ReactNode;
|
|
43
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item-page.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/crud/shell/react/src/lib/pages/item/item-page.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IEntity } from '@smartsoft001/domain-core';
|
|
2
|
+
import { SmartCrudItemPageBodyProps } from '../item-page.types';
|
|
3
|
+
/**
|
|
4
|
+
* The default item page body: `SmartDetails` of `detailsOptions` in the
|
|
5
|
+
* details mode, else `SmartForm` of the selected item for the mode, reporting
|
|
6
|
+
* its changes, value and validity. `children` are not rendered.
|
|
7
|
+
*/
|
|
8
|
+
export declare function SmartCrudItemPageStandard<T extends IEntity<string>>(props: SmartCrudItemPageBodyProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SmartCrudItemPageStandard = SmartCrudItemPageStandard;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("@smartsoft001/react");
|
|
6
|
+
const use_crud_item_page_base_1 = require("../use-crud-item-page-base");
|
|
7
|
+
/**
|
|
8
|
+
* The default item page body: `SmartDetails` of `detailsOptions` in the
|
|
9
|
+
* details mode, else `SmartForm` of the selected item for the mode, reporting
|
|
10
|
+
* its changes, value and validity. `children` are not rendered.
|
|
11
|
+
*/
|
|
12
|
+
function SmartCrudItemPageStandard(props) {
|
|
13
|
+
const { mode, detailsOptions, onPartialChange, onChange, onValidChange } = props;
|
|
14
|
+
const { formOptions } = (0, use_crud_item_page_base_1.useCrudItemPageBase)(props);
|
|
15
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [mode === 'details' ? (detailsOptions ? ((0, jsx_runtime_1.jsx)(react_1.SmartDetails, { options: detailsOptions })) : null) : formOptions ? ((0, jsx_runtime_1.jsx)(react_1.SmartForm, { options: formOptions, onValuePartialChange: onPartialChange, onValueChange: onChange, onValidChange: onValidChange })) : null, (0, jsx_runtime_1.jsx)("br", {}), (0, jsx_runtime_1.jsx)("br", {})] }));
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=item-page-standard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item-page-standard.js","sourceRoot":"","sources":["../../../../../../../../../../packages/crud/shell/react/src/lib/pages/item/standard/item-page-standard.tsx"],"names":[],"mappings":";;AAWA,8DAyBC;;AAnCD,+CAA8D;AAG9D,wEAAiE;AAEjE;;;;GAIG;AACH,SAAgB,yBAAyB,CACvC,KAAoC;IAEpC,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,eAAe,EAAE,QAAQ,EAAE,aAAa,EAAE,GACtE,KAAK,CAAC;IACR,MAAM,EAAE,WAAW,EAAE,GAAG,IAAA,6CAAmB,EAAI,KAAK,CAAC,CAAC;IAEtD,OAAO,CACL,6DACG,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,CACpB,cAAc,CAAC,CAAC,CAAC,CACf,uBAAC,oBAAY,IAAC,OAAO,EAAE,cAAc,GAAI,CAC1C,CAAC,CAAC,CAAC,IAAI,CACT,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAChB,uBAAC,iBAAS,IACR,OAAO,EAAE,WAAW,EACpB,oBAAoB,EAAE,eAAe,EACrC,aAAa,EAAE,QAAQ,EACvB,aAAa,EAAE,aAAa,GAC5B,CACH,CAAC,CAAC,CAAC,IAAI,EACR,gCAAM,EACN,gCAAM,IACL,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IEntity } from '@smartsoft001/domain-core';
|
|
2
|
+
import { IFormOptions } from '@smartsoft001/react';
|
|
3
|
+
import { SmartCrudItemPageBodyProps } from './item-page.types';
|
|
4
|
+
/**
|
|
5
|
+
* What every item page body shares: `config`, `facade`, the `selected` item
|
|
6
|
+
* and, outside the details mode, the form of the item: `formOptions` (built
|
|
7
|
+
* from `selected`, `mode`, `config.type`, `uniqueProvider` and
|
|
8
|
+
* `config.inputComponents`, with the built form as `control`) and `form`,
|
|
9
|
+
* which is put in `formRef` for the page to validate. Render
|
|
10
|
+
* `<SmartForm options={formOptions}>` once both exist.
|
|
11
|
+
*
|
|
12
|
+
* A new form is built when the selected item, the mode or the provider
|
|
13
|
+
* change; while creating, the selected item is ignored.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useCrudItemPageBase<T extends IEntity<string>>({ mode, uniqueProvider, formRef, }: SmartCrudItemPageBodyProps<T>): {
|
|
16
|
+
config: import("../../crud.config").CrudConfig<T> & Partial<import("../../crud.config").CrudFullConfig<T>>;
|
|
17
|
+
facade: import("../../state").CrudFacade<T>;
|
|
18
|
+
selected: T | null | undefined;
|
|
19
|
+
formOptions: IFormOptions<T> | null;
|
|
20
|
+
form: import("@smartsoft001/react").SmartFormGroup<Record<string, any>> | null;
|
|
21
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useCrudItemPageBase = useCrudItemPageBase;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const react_2 = require("@smartsoft001/react");
|
|
6
|
+
const crud_context_1 = require("../../crud.context");
|
|
7
|
+
const form_options_1 = require("../../factories/form-options");
|
|
8
|
+
const hooks_1 = require("../../hooks");
|
|
9
|
+
/**
|
|
10
|
+
* What every item page body shares: `config`, `facade`, the `selected` item
|
|
11
|
+
* and, outside the details mode, the form of the item: `formOptions` (built
|
|
12
|
+
* from `selected`, `mode`, `config.type`, `uniqueProvider` and
|
|
13
|
+
* `config.inputComponents`, with the built form as `control`) and `form`,
|
|
14
|
+
* which is put in `formRef` for the page to validate. Render
|
|
15
|
+
* `<SmartForm options={formOptions}>` once both exist.
|
|
16
|
+
*
|
|
17
|
+
* A new form is built when the selected item, the mode or the provider
|
|
18
|
+
* change; while creating, the selected item is ignored.
|
|
19
|
+
*/
|
|
20
|
+
function useCrudItemPageBase({ mode, uniqueProvider, formRef, }) {
|
|
21
|
+
const config = (0, crud_context_1.useCrudConfig)();
|
|
22
|
+
const facade = (0, crud_context_1.useCrudFacade)();
|
|
23
|
+
const selected = (0, hooks_1.useCrudState)((state) => state.selected);
|
|
24
|
+
const item = mode === 'create' ? null : selected;
|
|
25
|
+
const type = config?.type;
|
|
26
|
+
const inputComponents = config.inputComponents;
|
|
27
|
+
const options = (0, react_1.useMemo)(() => mode && mode !== 'details'
|
|
28
|
+
? (0, form_options_1.getCrudFormOptions)(item, mode, type, uniqueProvider, inputComponents)
|
|
29
|
+
: null, [item, mode, type, uniqueProvider, inputComponents]);
|
|
30
|
+
const form = (0, react_2.useModelForm)(options?.model, {
|
|
31
|
+
mode: options?.mode,
|
|
32
|
+
uniqueProvider: options?.uniqueProvider,
|
|
33
|
+
});
|
|
34
|
+
(0, react_1.useEffect)(() => {
|
|
35
|
+
if (!formRef)
|
|
36
|
+
return undefined;
|
|
37
|
+
formRef.current = form;
|
|
38
|
+
return () => {
|
|
39
|
+
if (formRef.current === form)
|
|
40
|
+
formRef.current = null;
|
|
41
|
+
};
|
|
42
|
+
}, [form, formRef]);
|
|
43
|
+
const formOptions = (0, react_1.useMemo)(() => (options && form ? { ...options, control: form } : null), [options, form]);
|
|
44
|
+
return { config, facade, selected, formOptions, form };
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=use-crud-item-page-base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-crud-item-page-base.js","sourceRoot":"","sources":["../../../../../../../../../packages/crud/shell/react/src/lib/pages/item/use-crud-item-page-base.ts"],"names":[],"mappings":";;AAqBA,kDAmDC;AAxED,iCAA2C;AAG3C,+CAAiE;AAGjE,qDAAkE;AAClE,+DAAkE;AAClE,uCAA2C;AAE3C;;;;;;;;;;GAUG;AACH,SAAgB,mBAAmB,CAA4B,EAC7D,IAAI,EACJ,cAAc,EACd,OAAO,GACuB;IAC9B,MAAM,MAAM,GAAG,IAAA,4BAAa,GAAK,CAAC;IAClC,MAAM,MAAM,GAAG,IAAA,4BAAa,GAAK,CAAC;IAClC,MAAM,QAAQ,GAAG,IAAA,oBAAY,EAC3B,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAC1B,CAAC;IAEF,MAAM,IAAI,GAAG,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC;IACjD,MAAM,IAAI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