@smartsoft001/crud-shell-react 0.0.0-stage → 2.193.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 +12 -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 +16 -0
- package/src/lib/components/export/use-crud-export.js +74 -0
- package/src/lib/components/export/use-crud-export.js.map +1 -0
- package/src/lib/components/filter/base/use-crud-filter.d.ts +68 -0
- package/src/lib/components/filter/base/use-crud-filter.js +248 -0
- package/src/lib/components/filter/base/use-crud-filter.js.map +1 -0
- package/src/lib/components/filter/check/filter-check.d.ts +7 -0
- package/src/lib/components/filter/check/filter-check.js +45 -0
- package/src/lib/components/filter/check/filter-check.js.map +1 -0
- package/src/lib/components/filter/date/filter-date.d.ts +7 -0
- package/src/lib/components/filter/date/filter-date.js +19 -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 +23 -0
- package/src/lib/components/filter/date/use-crud-filter-date.js +41 -0
- package/src/lib/components/filter/date/use-crud-filter-date.js.map +1 -0
- package/src/lib/components/filter/date/use-crud-filter-ng-model.d.ts +6 -0
- package/src/lib/components/filter/date/use-crud-filter-ng-model.js +25 -0
- package/src/lib/components/filter/date/use-crud-filter-ng-model.js.map +1 -0
- package/src/lib/components/filter/date-time/filter-date-time.d.ts +8 -0
- package/src/lib/components/filter/date-time/filter-date-time.js +27 -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 +9 -0
- package/src/lib/components/filter/date-with-edit/filter-date-with-edit.js +42 -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 +8 -0
- package/src/lib/components/filter/filter.js +43 -0
- package/src/lib/components/filter/filter.js.map +1 -0
- package/src/lib/components/filter/filter.types.d.ts +17 -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 +7 -0
- package/src/lib/components/filter/flag/filter-flag.js +20 -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 +12 -0
- package/src/lib/components/filter/int/filter-int.js +47 -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 +10 -0
- package/src/lib/components/filters/filters.js +20 -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 +17 -0
- package/src/lib/components/filters/use-crud-filters.js +63 -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 +38 -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 +10 -0
- package/src/lib/components/group/group.js +19 -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 +17 -0
- package/src/lib/components/group/use-crud-group.js +50 -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 +10 -0
- package/src/lib/components/multiselect/multiselect.js +25 -0
- package/src/lib/components/multiselect/multiselect.js.map +1 -0
- package/src/lib/components/multiselect/use-crud-multiselect.d.ts +24 -0
- package/src/lib/components/multiselect/use-crud-multiselect.js +72 -0
- package/src/lib/components/multiselect/use-crud-multiselect.js.map +1 -0
- package/src/lib/crud.config.d.ts +67 -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 +69 -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 +32 -0
- package/src/lib/pages/crud-pages.js +64 -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 +18 -0
- package/src/lib/pages/item/item-page.js +31 -0
- package/src/lib/pages/item/item-page.js.map +1 -0
- package/src/lib/pages/item/item-page.types.d.ts +47 -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 +10 -0
- package/src/lib/pages/item/standard/item-page-standard.js +19 -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 +22 -0
- package/src/lib/pages/item/use-crud-item-page-base.js +47 -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 +297 -0
- package/src/lib/pages/item/use-crud-item-page.js.map +1 -0
- package/src/lib/pages/list/list-page.d.ts +17 -0
- package/src/lib/pages/list/list-page.js +32 -0
- package/src/lib/pages/list/list-page.js.map +1 -0
- package/src/lib/pages/list/list-page.types.d.ts +27 -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 +13 -0
- package/src/lib/pages/list/standard/list-page-standard.js +28 -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 +309 -0
- package/src/lib/pages/list/use-crud-list-page.js.map +1 -0
- package/src/lib/pages/use-crud-bound-component.d.ts +10 -0
- package/src/lib/pages/use-crud-bound-component.js +28 -0
- package/src/lib/pages/use-crud-bound-component.js.map +1 -0
- package/src/lib/pages/use-crud-page-config.d.ts +9 -0
- package/src/lib/pages/use-crud-page-config.js +19 -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 +44 -0
- package/src/lib/services/crud/crud.service.js +113 -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 +20 -0
- package/src/lib/state/crud.effects.js +128 -0
- package/src/lib/state/crud.effects.js.map +1 -0
- package/src/lib/state/crud.facade.d.ts +43 -0
- package/src/lib/state/crud.facade.js +93 -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 +25 -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
package/README.md
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @smartsoft001/crud-shell-react
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
The React CRUD screens of the smartsoft001 framework: the list and item pages generated from a
|
|
4
|
+
configuration object and the model's metadata, the filters, and the CRUD service with its store and
|
|
5
|
+
facade, speaking the same REST contract as
|
|
6
|
+
[`@smartsoft001/crud-shell-nestjs`](https://www.npmjs.com/package/@smartsoft001/crud-shell-nestjs).
|
|
7
|
+
It mirrors [`@smartsoft001/crud-shell-angular`](https://www.npmjs.com/package/@smartsoft001/crud-shell-angular).
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @smartsoft001/crud-shell-react @smartsoft001/react react
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The full documentation is at https://framework.smartflow.biz.pl/docs/packages/crud-shell-react/.
|
package/package.json
CHANGED
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smartsoft001/crud-shell-react",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
6
|
-
|
|
3
|
+
"version": "2.193.0",
|
|
4
|
+
"type": "commonjs",
|
|
5
|
+
"description": "React CRUD screens driven by model metadata: the list and item pages, filters, the CRUD service and its store, mirroring @smartsoft001/crud-shell-angular.",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"main": "./src/index.js",
|
|
11
|
+
"typings": "./src/index.d.ts",
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"moment": "^2.31.0"
|
|
14
|
+
},
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"@smartsoft001/domain-core": "2.193.0",
|
|
17
|
+
"@smartsoft001/models": "2.193.0",
|
|
18
|
+
"@smartsoft001/react": "2.193.0",
|
|
19
|
+
"@smartsoft001/utils": "2.193.0",
|
|
20
|
+
"react": "^19.0.0"
|
|
21
|
+
},
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"types": "./src/index.d.ts",
|
|
25
|
+
"default": "./src/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./styles.css": "./styles.css",
|
|
28
|
+
"./package.json": "./package.json"
|
|
29
|
+
},
|
|
30
|
+
"types": "./src/index.d.ts"
|
|
31
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export * from './lib/components/export';
|
|
2
|
+
export * from './lib/components/filter';
|
|
3
|
+
export * from './lib/components/filters';
|
|
4
|
+
export * from './lib/components/filters-config';
|
|
5
|
+
export * from './lib/components/group';
|
|
6
|
+
export * from './lib/components/multiselect';
|
|
7
|
+
export * from './lib/crud.config';
|
|
8
|
+
export * from './lib/crud.context';
|
|
9
|
+
export * from './lib/crud.provider';
|
|
10
|
+
export * from './lib/factories/form-options';
|
|
11
|
+
export * from './lib/hooks';
|
|
12
|
+
export * from './lib/models';
|
|
13
|
+
export * from './lib/pages';
|
|
14
|
+
export * from './lib/providers/model-label.provider';
|
|
15
|
+
export * from './lib/services/crud/crud.service';
|
|
16
|
+
export * from './lib/services/list-group/list-group.service';
|
|
17
|
+
export * from './lib/services/page/page.service';
|
|
18
|
+
export * from './lib/services/search/search.service';
|
|
19
|
+
export * from './lib/state';
|
package/src/index.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./lib/components/export"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./lib/components/filter"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./lib/components/filters"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./lib/components/filters-config"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./lib/components/group"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./lib/components/multiselect"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./lib/crud.config"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./lib/crud.context"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./lib/crud.provider"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./lib/factories/form-options"), exports);
|
|
14
|
+
tslib_1.__exportStar(require("./lib/hooks"), exports);
|
|
15
|
+
tslib_1.__exportStar(require("./lib/models"), exports);
|
|
16
|
+
tslib_1.__exportStar(require("./lib/pages"), exports);
|
|
17
|
+
tslib_1.__exportStar(require("./lib/providers/model-label.provider"), exports);
|
|
18
|
+
tslib_1.__exportStar(require("./lib/services/crud/crud.service"), exports);
|
|
19
|
+
tslib_1.__exportStar(require("./lib/services/list-group/list-group.service"), exports);
|
|
20
|
+
tslib_1.__exportStar(require("./lib/services/page/page.service"), exports);
|
|
21
|
+
tslib_1.__exportStar(require("./lib/services/search/search.service"), exports);
|
|
22
|
+
tslib_1.__exportStar(require("./lib/state"), exports);
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/crud/shell/react/src/index.ts"],"names":[],"mappings":";;;AAAA,kEAAwC;AACxC,kEAAwC;AACxC,mEAAyC;AACzC,0EAAgD;AAChD,iEAAuC;AACvC,uEAA6C;AAC7C,4DAAkC;AAClC,6DAAmC;AACnC,8DAAoC;AACpC,uEAA6C;AAC7C,sDAA4B;AAC5B,uDAA6B;AAC7B,sDAA4B;AAC5B,+EAAqD;AACrD,2EAAiD;AACjD,uFAA6D;AAC7D,2EAAiD;AACjD,+EAAqD;AACrD,sDAA4B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IEntity } from '@smartsoft001/domain-core';
|
|
2
|
+
import { SmartCrudExportProps } from './export.types';
|
|
3
|
+
/**
|
|
4
|
+
* `<smart-crud-export>`: the CSV / XLSX buttons exporting the list of the
|
|
5
|
+
* CRUD feature with its current filter (the Angular `ExportComponent`).
|
|
6
|
+
*/
|
|
7
|
+
export declare function SmartCrudExport<T extends IEntity<string>>(props: SmartCrudExportProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SmartCrudExport = SmartCrudExport;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("@smartsoft001/react");
|
|
6
|
+
const use_crud_export_1 = require("./use-crud-export");
|
|
7
|
+
/**
|
|
8
|
+
* `<smart-crud-export>`: the CSV / XLSX buttons exporting the list of the
|
|
9
|
+
* CRUD feature with its current filter (the Angular `ExportComponent`).
|
|
10
|
+
*/
|
|
11
|
+
function SmartCrudExport(props) {
|
|
12
|
+
const { elementRef, buttonExportCsvOptions, buttonExportXlsxOptions } = (0, use_crud_export_1.useCrudExport)(props);
|
|
13
|
+
return ((0, jsx_runtime_1.jsxs)("div", { ref: elementRef, className: "smart:p-5", children: [(0, jsx_runtime_1.jsx)("p", { className: "smart:my-2.5 smart:mx-0", children: (0, jsx_runtime_1.jsx)(react_1.SmartButton, { options: buttonExportCsvOptions, className: "smart:w-full smart:block", children: "CSV" }) }), (0, jsx_runtime_1.jsx)("p", { children: (0, jsx_runtime_1.jsx)(react_1.SmartButton, { options: buttonExportXlsxOptions, className: "smart:w-full smart:block", children: "XLSX" }) })] }));
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=export.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.js","sourceRoot":"","sources":["../../../../../../../../../packages/crud/shell/react/src/lib/components/export/export.tsx"],"names":[],"mappings":";;AAUA,0CA0BC;;AAnCD,+CAAkD;AAGlD,uDAAkD;AAElD;;;GAGG;AACH,SAAgB,eAAe,CAC7B,KAA2B;IAE3B,MAAM,EAAE,UAAU,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,GACnE,IAAA,+BAAa,EAAI,KAAK,CAAC,CAAC;IAE1B,OAAO,CACL,iCAAK,GAAG,EAAE,UAAU,EAAE,SAAS,EAAC,WAAW,aACzC,8BAAG,SAAS,EAAC,yBAAyB,YACpC,uBAAC,mBAAW,IACV,OAAO,EAAE,sBAAsB,EAC/B,SAAS,EAAC,0BAA0B,oBAGxB,GACZ,EACJ,wCACE,uBAAC,mBAAW,IACV,OAAO,EAAE,uBAAuB,EAChC,SAAS,EAAC,0BAA0B,qBAGxB,GACZ,IACA,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** The props of `<SmartCrudExport>` (`<smart-crud-export>`). */
|
|
2
|
+
export interface SmartCrudExportProps {
|
|
3
|
+
/**
|
|
4
|
+
* Closes the overlay the component is shown in. `ModalService` passes it
|
|
5
|
+
* to the component it opens; without it the last opened modal is closed.
|
|
6
|
+
*/
|
|
7
|
+
dismiss?: (data?: unknown) => void;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/crud/shell/react/src/lib/components/export/export.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./export"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./export.types"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./use-crud-export"), exports);
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/crud/shell/react/src/lib/components/export/index.ts"],"names":[],"mappings":";;;AAAA,mDAAyB;AACzB,yDAA+B;AAC/B,4DAAkC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IEntity } from '@smartsoft001/domain-core';
|
|
2
|
+
import { IButtonOptions } from '@smartsoft001/react';
|
|
3
|
+
import { SmartCrudExportProps } from './export.types';
|
|
4
|
+
/**
|
|
5
|
+
* The behaviour of the export buttons (the Angular `ExportBaseComponent`):
|
|
6
|
+
* a click exports the list with the current filter, without paging, in its
|
|
7
|
+
* format, and closes the overlay the component is shown in once the export
|
|
8
|
+
* finished. The buttons are loading while the feature is. Attach
|
|
9
|
+
* `elementRef` to the root element: it gets the application style (the
|
|
10
|
+
* Angular `styleService.init(elementRef)`).
|
|
11
|
+
*/
|
|
12
|
+
export declare function useCrudExport<T extends IEntity<string>>({ dismiss, }?: SmartCrudExportProps): {
|
|
13
|
+
elementRef: import("react").RefObject<HTMLDivElement | null>;
|
|
14
|
+
buttonExportCsvOptions: IButtonOptions;
|
|
15
|
+
buttonExportXlsxOptions: IButtonOptions;
|
|
16
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useCrudExport = useCrudExport;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const react_2 = require("@smartsoft001/react");
|
|
6
|
+
const crud_context_1 = require("../../crud.context");
|
|
7
|
+
const hooks_1 = require("../../hooks");
|
|
8
|
+
/**
|
|
9
|
+
* Runs `callback` once the feature is loaded, now or after a later change
|
|
10
|
+
* (the Angular `toObservable(loaded).pipe(filter(l => !!l), take(1))`).
|
|
11
|
+
* Returns the unsubscribe function.
|
|
12
|
+
*/
|
|
13
|
+
function onceLoaded(store, callback) {
|
|
14
|
+
if (store.get().loaded) {
|
|
15
|
+
callback();
|
|
16
|
+
return () => undefined;
|
|
17
|
+
}
|
|
18
|
+
const unsubscribe = store.subscribe(() => {
|
|
19
|
+
if (!store.get().loaded)
|
|
20
|
+
return;
|
|
21
|
+
unsubscribe();
|
|
22
|
+
callback();
|
|
23
|
+
});
|
|
24
|
+
return unsubscribe;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The behaviour of the export buttons (the Angular `ExportBaseComponent`):
|
|
28
|
+
* a click exports the list with the current filter, without paging, in its
|
|
29
|
+
* format, and closes the overlay the component is shown in once the export
|
|
30
|
+
* finished. The buttons are loading while the feature is. Attach
|
|
31
|
+
* `elementRef` to the root element: it gets the application style (the
|
|
32
|
+
* Angular `styleService.init(elementRef)`).
|
|
33
|
+
*/
|
|
34
|
+
function useCrudExport({ dismiss, } = {}) {
|
|
35
|
+
const { facade, store } = (0, crud_context_1.useCrud)();
|
|
36
|
+
const modalService = (0, react_2.useModalService)();
|
|
37
|
+
const styleService = (0, react_2.useStyleService)();
|
|
38
|
+
const elementRef = (0, react_1.useRef)(null);
|
|
39
|
+
const loading = (0, hooks_1.useCrudState)((state) => !state.loaded);
|
|
40
|
+
const dismissRef = (0, react_1.useRef)(dismiss);
|
|
41
|
+
const subscriptions = (0, react_1.useRef)([]);
|
|
42
|
+
(0, react_1.useEffect)(() => {
|
|
43
|
+
dismissRef.current = dismiss;
|
|
44
|
+
});
|
|
45
|
+
// A local service writes the style, so the shared one is not redirected
|
|
46
|
+
// to this element.
|
|
47
|
+
(0, react_1.useEffect)(() => {
|
|
48
|
+
new react_2.StyleService().init(elementRef.current, styleService.get());
|
|
49
|
+
}, [styleService]);
|
|
50
|
+
(0, react_1.useEffect)(() => {
|
|
51
|
+
const current = subscriptions.current;
|
|
52
|
+
return () => current.forEach((unsubscribe) => unsubscribe());
|
|
53
|
+
}, []);
|
|
54
|
+
// The Angular `popoverService.close()`.
|
|
55
|
+
const close = () => {
|
|
56
|
+
if (dismissRef.current)
|
|
57
|
+
dismissRef.current();
|
|
58
|
+
else
|
|
59
|
+
void modalService.dismiss();
|
|
60
|
+
};
|
|
61
|
+
const initButtonExportOptions = (format) => ({
|
|
62
|
+
click: () => {
|
|
63
|
+
facade.export({ ...facade.filter, offset: undefined, limit: undefined }, format);
|
|
64
|
+
subscriptions.current.push(onceLoaded(store, close));
|
|
65
|
+
},
|
|
66
|
+
loading,
|
|
67
|
+
});
|
|
68
|
+
return {
|
|
69
|
+
elementRef,
|
|
70
|
+
buttonExportCsvOptions: initButtonExportOptions('csv'),
|
|
71
|
+
buttonExportXlsxOptions: initButtonExportOptions('xlsx'),
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=use-crud-export.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-crud-export.js","sourceRoot":"","sources":["../../../../../../../../../packages/crud/shell/react/src/lib/components/export/use-crud-export.ts"],"names":[],"mappings":";;AA4CA,sCAkDC;AA9FD,iCAA0C;AAG1C,+CAK6B;AAG7B,qDAA6C;AAC7C,uCAA2C;AAG3C;;;;GAIG;AACH,SAAS,UAAU,CAAC,KAAgB,EAAE,QAAoB;IACxD,IAAI,KAAK,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC;QACvB,QAAQ,EAAE,CAAC;QACX,OAAO,GAAG,EAAE,CAAC,SAAS,CAAC;IACzB,CAAC;IAED,MAAM,WAAW,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACvC,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,MAAM;YAAE,OAAO;QAEhC,WAAW,EAAE,CAAC;QACd,QAAQ,EAAE,CAAC;IACb,CAAC,CAAC,CAAC;IAEH,OAAO,WAAW,CAAC;AACrB,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,aAAa,CAA4B,EACvD,OAAO,MACiB,EAAE;IAC1B,MAAM,EAAE,MAAM,EAAE,KAA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KAAK,EAAE,GAAG,EAAE;YACV,MAAM,CAAC,MAAM,CACX,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,EACzD,MAAM,CACP,CAAC;YAEF,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;QACvD,CAAC;QACD,OAAO;KACR,CAAC,CAAC;IAEH,OAAO;QACL,UAAU;QACV,sBAAsB,EAAE,uBAAuB,CAAC,KAAK,CAAC;QACtD,uBAAuB,EAAE,uBAAuB,CAAC,MAAM,CAAC;KACzD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { InputOptions, SmartAbstractControl, SmartFormControl } from '@smartsoft001/react';
|
|
2
|
+
import { ICrudFilter } from '../../../models';
|
|
3
|
+
import { CrudFilterPossibility, SmartCrudFilterProps } from '../filter.types';
|
|
4
|
+
/** The wait of the Angular `@Debounce(500)` on `refresh`. */
|
|
5
|
+
export declare const CRUD_FILTER_REFRESH_DEBOUNCE = 500;
|
|
6
|
+
/** What `useCrudFilter` returns (the API of the Angular `BaseComponent`). */
|
|
7
|
+
export interface UseCrudFilterResult {
|
|
8
|
+
/** The item's value (a list for a check filter); `null` without a query. */
|
|
9
|
+
value: any;
|
|
10
|
+
/** The item's `>=` value (range "from"). */
|
|
11
|
+
minValue: any;
|
|
12
|
+
/** The item's `<=` value (range "to"). */
|
|
13
|
+
maxValue: any;
|
|
14
|
+
/** Debounced `refresh(val)` (the Angular `value` setter). */
|
|
15
|
+
setValue: (val: any) => void;
|
|
16
|
+
/** Debounced `refresh(val, '>=')` (the Angular `minValue` setter). */
|
|
17
|
+
setMinValue: (val: any) => void;
|
|
18
|
+
/** Debounced `refresh(val, '<=')` (the Angular `maxValue` setter). */
|
|
19
|
+
setMaxValue: (val: any) => void;
|
|
20
|
+
/** The item's entry has a non-empty value. */
|
|
21
|
+
hasValue: boolean;
|
|
22
|
+
/** The item's `>=` entry has a non-empty value. */
|
|
23
|
+
hasMinValue: boolean;
|
|
24
|
+
/** The item's `<=` entry has a non-empty value. */
|
|
25
|
+
hasMaxValue: boolean;
|
|
26
|
+
/** The options of a radio / check filter. */
|
|
27
|
+
possibilities: CrudFilterPossibility[] | undefined;
|
|
28
|
+
/** An instance of the feature's model, for the input options. */
|
|
29
|
+
model: any;
|
|
30
|
+
/** The current language. */
|
|
31
|
+
lang: string;
|
|
32
|
+
/** The filter the values are read from (the pending copy or the prop). */
|
|
33
|
+
effectiveFilter: ICrudFilter | null | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Sets the item's entry of `type` (`item.type` by default) to `val`, or
|
|
36
|
+
* removes it for an empty value, and reads the list from the first page;
|
|
37
|
+
* debounced by 500 ms.
|
|
38
|
+
*/
|
|
39
|
+
refresh: (val: any, type?: string | null) => void;
|
|
40
|
+
/** Removes every entry of the item and reads the list from the first page. */
|
|
41
|
+
clear: () => void;
|
|
42
|
+
/**
|
|
43
|
+
* The options of a shared `SmartInput*` field bound to `control`; with the
|
|
44
|
+
* possibilities as unchecked options when `withPossibilities`.
|
|
45
|
+
*/
|
|
46
|
+
buildInputOptions: (control: SmartAbstractControl, withPossibilities?: boolean) => InputOptions<any>;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The behaviour every filter field shares (the Angular filter
|
|
50
|
+
* `BaseComponent`): the item's values in the current filter, and `refresh` /
|
|
51
|
+
* `clear`, which read the list through the facade with a changed copy of the
|
|
52
|
+
* filter. Until the store's new filter comes back through the `filter` prop,
|
|
53
|
+
* the values are read from that copy.
|
|
54
|
+
*
|
|
55
|
+
* `refresh` is debounced by 500 ms like the Angular `@Debounce(500)`: only
|
|
56
|
+
* the last call within the wait is applied, and a pending call still runs
|
|
57
|
+
* after the field unmounts.
|
|
58
|
+
*/
|
|
59
|
+
export declare function useCrudFilter({ item, filter, }: SmartCrudFilterProps): UseCrudFilterResult;
|
|
60
|
+
/**
|
|
61
|
+
* A form control bridged to one query slot of a filter (the Angular
|
|
62
|
+
* `bindControl(type)`; `bindValueControl()` is `type` `null`): seeded once with
|
|
63
|
+
* the slot's current value (`null` = `value`, `'>='` = `minValue`, `'<='` =
|
|
64
|
+
* `maxValue`), and every change runs the debounced `refresh` for the slot.
|
|
65
|
+
* As in Angular, the control is not re-synced when the filter changes
|
|
66
|
+
* elsewhere (TODO GAP-19).
|
|
67
|
+
*/
|
|
68
|
+
export declare function useCrudFilterControl({ value, minValue, maxValue, refresh, }: Pick<UseCrudFilterResult, 'value' | 'minValue' | 'maxValue' | 'refresh'>, type?: string | null): SmartFormControl;
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CRUD_FILTER_REFRESH_DEBOUNCE = void 0;
|
|
4
|
+
exports.useCrudFilter = useCrudFilter;
|
|
5
|
+
exports.useCrudFilterControl = useCrudFilterControl;
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const models_1 = require("@smartsoft001/models");
|
|
8
|
+
const react_2 = require("@smartsoft001/react");
|
|
9
|
+
const crud_context_1 = require("../../../crud.context");
|
|
10
|
+
/** The wait of the Angular `@Debounce(500)` on `refresh`. */
|
|
11
|
+
exports.CRUD_FILTER_REFRESH_DEBOUNCE = 500;
|
|
12
|
+
/**
|
|
13
|
+
* The item's own possibilities: an Angular-style signal (as typed in
|
|
14
|
+
* `IModelFilter`) or a plain list.
|
|
15
|
+
*/
|
|
16
|
+
function readItemPossibilities(source) {
|
|
17
|
+
if (typeof source === 'function')
|
|
18
|
+
return source();
|
|
19
|
+
if (Array.isArray(source))
|
|
20
|
+
return source;
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
/** A check filter holds a list of values, one query entry each. */
|
|
24
|
+
function isArrayType(item) {
|
|
25
|
+
return item?.fieldType === models_1.FieldType.check;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The pending working copy while the `filter` prop is still the one it was
|
|
29
|
+
* derived from; once the store update brings a new prop, the prop wins.
|
|
30
|
+
*/
|
|
31
|
+
function getEffectiveFilter(filter, pending) {
|
|
32
|
+
if (pending && filter === pending.source)
|
|
33
|
+
return pending.filter;
|
|
34
|
+
return filter;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A copy safe to change (object, query list and entries), so the filter in
|
|
38
|
+
* the store is never touched.
|
|
39
|
+
*/
|
|
40
|
+
function cloneFilter(source) {
|
|
41
|
+
if (!source)
|
|
42
|
+
return undefined;
|
|
43
|
+
const clone = { ...source };
|
|
44
|
+
if (source.query)
|
|
45
|
+
clone.query = source.query.map((q) => ({ ...q }));
|
|
46
|
+
return clone;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The value of the item's query entry of `type` (the Angular `value`,
|
|
50
|
+
* `minValue` and `maxValue` getters): `null` without a query, the list of
|
|
51
|
+
* matching values for a check filter, otherwise the first match's value.
|
|
52
|
+
*/
|
|
53
|
+
function readQueryValue(filter, item, type) {
|
|
54
|
+
if (!filter || !item || !filter.query)
|
|
55
|
+
return null;
|
|
56
|
+
if (isArrayType(item)) {
|
|
57
|
+
return filter.query
|
|
58
|
+
.filter((q) => q.key === item.key && q.type === type)
|
|
59
|
+
.map((q) => q.value);
|
|
60
|
+
}
|
|
61
|
+
const query = filter.query.find((q) => q.key === item.key && q.type === type);
|
|
62
|
+
return query?.value;
|
|
63
|
+
}
|
|
64
|
+
function hasQueryValue(filter, item, type) {
|
|
65
|
+
if (!filter || !item || !filter.query)
|
|
66
|
+
return false;
|
|
67
|
+
const query = filter.query.find((q) => q.key === item.key && q.type === type);
|
|
68
|
+
if (!query)
|
|
69
|
+
return false;
|
|
70
|
+
const val = query.value;
|
|
71
|
+
return val !== null && val !== undefined && val !== '';
|
|
72
|
+
}
|
|
73
|
+
function refreshArrayFilter(filter, item, vals, type) {
|
|
74
|
+
const query = (filter.query ?? []).filter((q) => !(q.key === item.key && q.type === type));
|
|
75
|
+
filter.query = query;
|
|
76
|
+
if (vals === null || vals === undefined || !vals.length)
|
|
77
|
+
return filter;
|
|
78
|
+
vals.forEach((val) => {
|
|
79
|
+
query.push({ key: item.key, type: type, value: val });
|
|
80
|
+
});
|
|
81
|
+
return filter;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* The filter after `refresh(val, type)` (the Angular `refresh` body): back on
|
|
85
|
+
* the first page, with the item's entry of the slot set to `val`, or removed
|
|
86
|
+
* for an empty value. `null` when there is nothing to read.
|
|
87
|
+
*/
|
|
88
|
+
function refreshFilter(source, item, val, type) {
|
|
89
|
+
const filter = cloneFilter(source);
|
|
90
|
+
if (!filter || !item)
|
|
91
|
+
return null;
|
|
92
|
+
const slot = type || item.type;
|
|
93
|
+
if (!filter.query)
|
|
94
|
+
filter.query = [];
|
|
95
|
+
filter.offset = 0;
|
|
96
|
+
if (isArrayType(item))
|
|
97
|
+
return refreshArrayFilter(filter, item, val, slot);
|
|
98
|
+
const queries = filter.query;
|
|
99
|
+
let query = queries.find((q) => q.key === item.key && q.type === slot);
|
|
100
|
+
if (val === null || val === undefined || val === '') {
|
|
101
|
+
if (query)
|
|
102
|
+
queries.splice(queries.indexOf(query), 1);
|
|
103
|
+
return filter;
|
|
104
|
+
}
|
|
105
|
+
if (!query) {
|
|
106
|
+
query = { key: item.key, type: slot, value: null };
|
|
107
|
+
queries.push(query);
|
|
108
|
+
}
|
|
109
|
+
query.value = val;
|
|
110
|
+
query.label = item.label;
|
|
111
|
+
return filter;
|
|
112
|
+
}
|
|
113
|
+
/** The filter without any entry of the item, back on the first page. */
|
|
114
|
+
function clearFilter(source, item) {
|
|
115
|
+
const filter = cloneFilter(source);
|
|
116
|
+
if (!filter || !item || !filter.query)
|
|
117
|
+
return null;
|
|
118
|
+
filter.query = filter.query.filter((q) => q.key !== item.key);
|
|
119
|
+
filter.offset = 0;
|
|
120
|
+
return filter;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* The options of the item: the ones the model possibilities provider returns
|
|
124
|
+
* for the model type and the item key (where the Angular filter asked the
|
|
125
|
+
* deprecated `CRUD_MODEL_POSSIBILITIES_PROVIDER`), otherwise the item's own.
|
|
126
|
+
*/
|
|
127
|
+
function useFilterPossibilities(item, modelType, model) {
|
|
128
|
+
const provider = (0, react_2.useSmart)().modelPossibilitiesProvider;
|
|
129
|
+
const key = item?.key;
|
|
130
|
+
const [fromProvider, setFromProvider] = (0, react_1.useState)(null);
|
|
131
|
+
(0, react_1.useEffect)(() => {
|
|
132
|
+
if (!provider || !key)
|
|
133
|
+
return undefined;
|
|
134
|
+
let active = true;
|
|
135
|
+
Promise.resolve(provider.get({ type: modelType, key, instance: model })).then((list) => {
|
|
136
|
+
if (active && list)
|
|
137
|
+
setFromProvider({ key, list });
|
|
138
|
+
});
|
|
139
|
+
return () => {
|
|
140
|
+
active = false;
|
|
141
|
+
};
|
|
142
|
+
}, [provider, modelType, key, model]);
|
|
143
|
+
if (fromProvider && fromProvider.key === key)
|
|
144
|
+
return fromProvider.list;
|
|
145
|
+
return readItemPossibilities(item?.possibilities);
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* The behaviour every filter field shares (the Angular filter
|
|
149
|
+
* `BaseComponent`): the item's values in the current filter, and `refresh` /
|
|
150
|
+
* `clear`, which read the list through the facade with a changed copy of the
|
|
151
|
+
* filter. Until the store's new filter comes back through the `filter` prop,
|
|
152
|
+
* the values are read from that copy.
|
|
153
|
+
*
|
|
154
|
+
* `refresh` is debounced by 500 ms like the Angular `@Debounce(500)`: only
|
|
155
|
+
* the last call within the wait is applied, and a pending call still runs
|
|
156
|
+
* after the field unmounts.
|
|
157
|
+
*/
|
|
158
|
+
function useCrudFilter({ item, filter, }) {
|
|
159
|
+
const facade = (0, crud_context_1.useCrudFacade)();
|
|
160
|
+
const modelType = (0, crud_context_1.useCrudConfig)().type;
|
|
161
|
+
const lang = (0, react_2.useSmart)().language;
|
|
162
|
+
const model = (0, react_1.useMemo)(() => (modelType ? new modelType() : undefined), [modelType]);
|
|
163
|
+
const possibilities = useFilterPossibilities(item, modelType, model);
|
|
164
|
+
const [pending, setPending] = (0, react_1.useState)(null);
|
|
165
|
+
const effectiveFilter = getEffectiveFilter(filter, pending);
|
|
166
|
+
const latest = (0, react_1.useRef)({ item, filter, pending, facade });
|
|
167
|
+
const timer = (0, react_1.useRef)(null);
|
|
168
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
169
|
+
latest.current = { item, filter, pending, facade };
|
|
170
|
+
});
|
|
171
|
+
const commitFilter = (0, react_1.useCallback)((next) => {
|
|
172
|
+
if (!next)
|
|
173
|
+
return;
|
|
174
|
+
const current = latest.current;
|
|
175
|
+
const entry = { source: current.filter, filter: next };
|
|
176
|
+
current.pending = entry;
|
|
177
|
+
setPending(entry);
|
|
178
|
+
current.facade.read(next);
|
|
179
|
+
}, []);
|
|
180
|
+
const refresh = (0, react_1.useCallback)((val, type = null) => {
|
|
181
|
+
if (timer.current)
|
|
182
|
+
clearTimeout(timer.current);
|
|
183
|
+
timer.current = setTimeout(() => {
|
|
184
|
+
timer.current = null;
|
|
185
|
+
const current = latest.current;
|
|
186
|
+
commitFilter(refreshFilter(getEffectiveFilter(current.filter, current.pending), current.item, val, type));
|
|
187
|
+
}, exports.CRUD_FILTER_REFRESH_DEBOUNCE);
|
|
188
|
+
}, [commitFilter]);
|
|
189
|
+
const clear = (0, react_1.useCallback)(() => {
|
|
190
|
+
const current = latest.current;
|
|
191
|
+
commitFilter(clearFilter(getEffectiveFilter(current.filter, current.pending), current.item));
|
|
192
|
+
}, [commitFilter]);
|
|
193
|
+
const setValue = (0, react_1.useCallback)((val) => refresh(val), [refresh]);
|
|
194
|
+
const setMinValue = (0, react_1.useCallback)((val) => refresh(val, '>='), [refresh]);
|
|
195
|
+
const setMaxValue = (0, react_1.useCallback)((val) => refresh(val, '<='), [refresh]);
|
|
196
|
+
const fieldKey = item?.key ?? '';
|
|
197
|
+
const buildInputOptions = (0, react_1.useCallback)((control, withPossibilities = false) => {
|
|
198
|
+
const options = {
|
|
199
|
+
treeLevel: 0,
|
|
200
|
+
control,
|
|
201
|
+
model,
|
|
202
|
+
fieldKey,
|
|
203
|
+
};
|
|
204
|
+
if (withPossibilities) {
|
|
205
|
+
options.possibilities = (possibilities ?? []).map(({ id, text }) => ({
|
|
206
|
+
id,
|
|
207
|
+
text,
|
|
208
|
+
checked: false,
|
|
209
|
+
}));
|
|
210
|
+
}
|
|
211
|
+
return options;
|
|
212
|
+
}, [model, fieldKey, possibilities]);
|
|
213
|
+
return {
|
|
214
|
+
value: readQueryValue(effectiveFilter, item, item?.type),
|
|
215
|
+
minValue: readQueryValue(effectiveFilter, item, '>='),
|
|
216
|
+
maxValue: readQueryValue(effectiveFilter, item, '<='),
|
|
217
|
+
setValue,
|
|
218
|
+
setMinValue,
|
|
219
|
+
setMaxValue,
|
|
220
|
+
hasValue: hasQueryValue(effectiveFilter, item, item?.type),
|
|
221
|
+
hasMinValue: hasQueryValue(effectiveFilter, item, '>='),
|
|
222
|
+
hasMaxValue: hasQueryValue(effectiveFilter, item, '<='),
|
|
223
|
+
possibilities,
|
|
224
|
+
model,
|
|
225
|
+
lang,
|
|
226
|
+
effectiveFilter,
|
|
227
|
+
refresh,
|
|
228
|
+
clear,
|
|
229
|
+
buildInputOptions,
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* A form control bridged to one query slot of a filter (the Angular
|
|
234
|
+
* `bindControl(type)`; `bindValueControl()` is `type` `null`): seeded once with
|
|
235
|
+
* the slot's current value (`null` = `value`, `'>='` = `minValue`, `'<='` =
|
|
236
|
+
* `maxValue`), and every change runs the debounced `refresh` for the slot.
|
|
237
|
+
* As in Angular, the control is not re-synced when the filter changes
|
|
238
|
+
* elsewhere (TODO GAP-19).
|
|
239
|
+
*/
|
|
240
|
+
function useCrudFilterControl({ value, minValue, maxValue, refresh, }, type = null) {
|
|
241
|
+
const [control] = (0, react_1.useState)(() => new react_2.SmartFormControl(type === '>=' ? minValue : type === '<=' ? maxValue : value));
|
|
242
|
+
(0, react_1.useEffect)(() => {
|
|
243
|
+
const subscription = control.valueChanges.subscribe((val) => refresh(val, type));
|
|
244
|
+
return () => subscription.unsubscribe();
|
|
245
|
+
}, [control, refresh, type]);
|
|
246
|
+
return control;
|
|
247
|
+
}
|
|
248
|
+
//# sourceMappingURL=use-crud-filter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-crud-filter.js","sourceRoot":"","sources":["../../../../../../../../../../packages/crud/shell/react/src/lib/components/filter/base/use-crud-filter.ts"],"names":[],"mappings":";;;AA+RA,sCA8GC;AAUD,oDAyBC;AAhbD,iCAOe;AAEf,iDAA+D;AAC/D,+CAK6B;AAE7B,wDAAqE;AAIrE,6DAA6D;AAChD,QAAA,4BAA4B,GAAG,GAAG,CAAC;AAwDhD;;;GAGG;AACH,SAAS,qBAAqB,CAC5B,MAAe;IAEf,IAAI,OAAO,MAAM,KAAK,UAAU;QAAE,OAAO,MAAM,EAAE,CAAC;IAClD,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;QAAE,OAAO,MAAM,CAAC;IAEzC,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,mEAAmE;AACnE,SAAS,WAAW,CAAC,IAA8B;IACjD,OAAO,IAAI,EAAE,SAAS,KAAK,kBAAS,CAAC,KAAK,CAAC;AAC7C,CAAC;AAED;;;GAGG;AACH,SAAS,kBAAkB,CACzB,MAAsC,EACtC,OAA6B;IAE7B,IAAI,OAAO,IAAI,MAAM,KAAK,OAAO,CAAC,MAAM;QAAE,OAAO,OAAO,CAAC,MAAM,CAAC;IAEhE,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;GAGG;AACH,SAAS,WAAW,CAClB,MAAsC;IAEtC,IAAI,CAAC,MAAM;QAAE,OAAO,SAAS,CAAC;IAE9B,MAAM,KAAK,GA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,CAAC;QACvD,WAAW,EAAE,aAAa,CAAC,eAAe,EAAE,IAAI,EAAE,IAAI,CAAC;QACvD,aAAa;QACb,KAAK;QACL,IAAI;QACJ,eAAe;QACf,OAAO;QACP,KAAK;QACL,iBAAiB;KAClB,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,oBAAoB,CAClC,EACE,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,OAAO,GACkE,EAC3E,OAAsB,IAAI;IAE1B,MAAM,CAAC,OAAO,CAAC,GAAG,IAAA,gBAAQ,EACxB,GAAG,EAAE,CACH,IAAI,wBAAgB,CAClB,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAC5D,CACJ,CAAC;IAEF,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,EAAE,CAC1D,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CACnB,CAAC;QAEF,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC;IAC1C,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;IAE7B,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SmartCrudFilterProps } from '../filter.types';
|
|
2
|
+
/**
|
|
3
|
+
* `<smart-crud-filter-check>` (Angular `FilterCheckComponent`): a checkbox
|
|
4
|
+
* per possibility, checked when its id is among the item's values, and a
|
|
5
|
+
* clear button while any is checked. Each value is its own query entry.
|
|
6
|
+
*/
|
|
7
|
+
export declare function SmartCrudFilterCheck(props: SmartCrudFilterProps): import("react/jsx-runtime").JSX.Element;
|