@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
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SmartCrudFilterText = SmartCrudFilterText;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const react_2 = require("@smartsoft001/react");
|
|
7
|
+
const use_crud_filter_1 = require("../base/use-crud-filter");
|
|
8
|
+
/**
|
|
9
|
+
* `<smart-crud-filter-text>` (Angular `FilterTextComponent`): the shared text
|
|
10
|
+
* field bound to the item's value, and a clear button while it has one.
|
|
11
|
+
* Typing reads the list 500 ms after the last change.
|
|
12
|
+
*/
|
|
13
|
+
function SmartCrudFilterText(props) {
|
|
14
|
+
const filter = (0, use_crud_filter_1.useCrudFilter)(props);
|
|
15
|
+
const control = (0, use_crud_filter_1.useCrudFilterControl)(filter);
|
|
16
|
+
const { buildInputOptions, hasValue, refresh } = filter;
|
|
17
|
+
const options = (0, react_1.useMemo)(() => buildInputOptions(control), [buildInputOptions, control]);
|
|
18
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "smart:block smart:w-full", children: (0, jsx_runtime_1.jsxs)("div", { className: "smart:flex smart:w-full smart:items-end smart:gap-2", children: [(0, jsx_runtime_1.jsx)("div", { className: "smart:flex-1", children: (0, jsx_runtime_1.jsx)(react_2.SmartInputText, { className: "smart:flex-1", options: options }) }), hasValue && ((0, jsx_runtime_1.jsx)("button", { type: "button", onClick: () => refresh(null), "aria-label": "clear", className: "smart:shrink-0 smart:rounded smart:px-2 smart:py-2 smart:text-red-600 smart:hover:bg-red-50", children: "\u00D7" }))] }) }));
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=filter-text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter-text.js","sourceRoot":"","sources":["../../../../../../../../../../packages/crud/shell/react/src/lib/components/filter/text/filter-text.tsx"],"names":[],"mappings":";;AAYA,kDA4BC;;AAxCD,iCAAgC;AAEhC,+CAAqD;AAErD,6DAA8E;AAG9E;;;;GAIG;AACH,SAAgB,mBAAmB,CAAC,KAA2B;IAC7D,MAAM,MAAM,GAAG,IAAA,+BAAa,EAAC,KAAK,CAAC,CAAC;IACpC,MAAM,OAAO,GAAG,IAAA,sCAAoB,EAAC,MAAM,CAAC,CAAC;IAC7C,MAAM,EAAE,iBAAiB,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;IACxD,MAAM,OAAO,GAAG,IAAA,eAAO,EACrB,GAAG,EAAE,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAChC,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAC7B,CAAC;IAEF,OAAO,CACL,gCAAK,SAAS,EAAC,0BAA0B,YACvC,iCAAK,SAAS,EAAC,qDAAqD,aAClE,gCAAK,SAAS,EAAC,cAAc,YAC3B,uBAAC,sBAAc,IAAC,SAAS,EAAC,cAAc,EAAC,OAAO,EAAE,OAAO,GAAI,GACzD,EACL,QAAQ,IAAI,CACX,mCACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,gBACjB,OAAO,EAClB,SAAS,EAAC,6FAA6F,uBAGhG,CACV,IACG,GACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IEntity } from '@smartsoft001/domain-core';
|
|
2
|
+
import { SmartCrudFiltersProps } from './filters.types';
|
|
3
|
+
/**
|
|
4
|
+
* `<smart-crud-filters>`: the filters panel of the CRUD feature (the Angular
|
|
5
|
+
* `FiltersComponent`), opened in the end menu — a header with the title and
|
|
6
|
+
* a close button (unless `hideMenu`), then a `SmartCrudFilter` for every
|
|
7
|
+
* filter of the model: the `filters` of `@Model` and the fields with
|
|
8
|
+
* `list.filter`. Render it inside `<CrudProvider>`.
|
|
9
|
+
*/
|
|
10
|
+
export declare function SmartCrudFilters<T extends IEntity<string>>(props: SmartCrudFiltersProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SmartCrudFilters = SmartCrudFilters;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("@smartsoft001/react");
|
|
6
|
+
const use_crud_filters_1 = require("./use-crud-filters");
|
|
7
|
+
const filter_1 = require("../filter/filter");
|
|
8
|
+
/**
|
|
9
|
+
* `<smart-crud-filters>`: the filters panel of the CRUD feature (the Angular
|
|
10
|
+
* `FiltersComponent`), opened in the end menu — a header with the title and
|
|
11
|
+
* a close button (unless `hideMenu`), then a `SmartCrudFilter` for every
|
|
12
|
+
* filter of the model: the `filters` of `@Model` and the fields with
|
|
13
|
+
* `list.filter`. Render it inside `<CrudProvider>`.
|
|
14
|
+
*/
|
|
15
|
+
function SmartCrudFilters(props) {
|
|
16
|
+
const t = (0, react_1.useTranslate)();
|
|
17
|
+
const { elementRef, hideMenu, list, filter, onClose } = (0, use_crud_filters_1.useCrudFilters)(props);
|
|
18
|
+
return ((0, jsx_runtime_1.jsxs)("div", { ref: elementRef, className: "smart:flex smart:h-full smart:flex-col", children: [!hideMenu && ((0, jsx_runtime_1.jsxs)("header", { className: "smart:flex smart:items-center smart:justify-between smart:border-b smart:border-gray-200 smart:px-4 smart:py-3", children: [(0, jsx_runtime_1.jsx)("h2", { className: "smart:text-lg smart:font-semibold smart:text-gray-900", children: t('filters') }), (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: onClose, "aria-label": "close", className: "smart:rounded smart:p-1 smart:text-gray-500 smart:hover:bg-gray-100", children: "\u2715" })] })), (0, jsx_runtime_1.jsx)("div", { className: "smart:flex-1 smart:overflow-y-auto smart:px-4 smart:py-3", children: list.map((item, index) => ((0, jsx_runtime_1.jsx)(filter_1.SmartCrudFilter, { item: item, filter: filter }, `${index}:${item.key}`))) })] }));
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=filters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../../../../../packages/crud/shell/react/src/lib/components/filters/filters.tsx"],"names":[],"mappings":";;AAcA,4CAsCC;;AAnDD,+CAAmD;AAGnD,yDAAoD;AACpD,6CAAmD;AAEnD;;;;;;GAMG;AACH,SAAgB,gBAAgB,CAC9B,KAA4B;IAE5B,MAAM,CAAC,GAAG,IAAA,oBAAY,GAAE,CAAC;IACzB,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,GACnD,IAAA,iCAAc,EAAI,KAAK,CAAC,CAAC;IAE3B,OAAO,CACL,iCAAK,GAAG,EAAE,UAAU,EAAE,SAAS,EAAC,wCAAwC,aACrE,CAAC,QAAQ,IAAI,CACZ,oCAAQ,SAAS,EAAC,gHAAgH,aAChI,+BAAI,SAAS,EAAC,uDAAuD,YAClE,CAAC,CAAC,SAAS,CAAC,GACV,EACL,mCACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,OAAO,gBACL,OAAO,EAClB,SAAS,EAAC,qEAAqE,uBAGxE,IACF,CACV,EAID,gCAAK,SAAS,EAAC,0DAA0D,YACtE,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CACzB,uBAAC,wBAAe,IAEd,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,IAFT,GAAG,KAAK,IAAI,IAAI,CAAC,GAAG,EAAE,CAG3B,CACH,CAAC,GACE,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filters.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/crud/shell/react/src/lib/components/filters/filters.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("./filters"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./filters.types"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./use-crud-filters"), exports);
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/crud/shell/react/src/lib/components/filters/index.ts"],"names":[],"mappings":";;;AAAA,oDAA0B;AAC1B,0DAAgC;AAChC,6DAAmC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IEntity } from '@smartsoft001/domain-core';
|
|
2
|
+
import { IModelFilter } from '@smartsoft001/models';
|
|
3
|
+
import { SmartCrudFiltersProps } from './filters.types';
|
|
4
|
+
/**
|
|
5
|
+
* The behaviour of the filters panel (the Angular `FiltersBaseComponent`):
|
|
6
|
+
* `list` holds the filters of `config.type`, `filter` the current filter of
|
|
7
|
+
* the feature, and `onClose` closes the end menu the panel is shown in.
|
|
8
|
+
* Attach `elementRef` to the root element: it gets the application style
|
|
9
|
+
* (the Angular `styleService.init(elementRef)`).
|
|
10
|
+
*/
|
|
11
|
+
export declare function useCrudFilters<T extends IEntity<string>>({ hideMenu, }?: SmartCrudFiltersProps): {
|
|
12
|
+
elementRef: import("react").RefObject<HTMLDivElement | null>;
|
|
13
|
+
hideMenu: boolean;
|
|
14
|
+
list: IModelFilter[];
|
|
15
|
+
filter: import("../../models").ICrudFilter | null | undefined;
|
|
16
|
+
onClose: () => Promise<void>;
|
|
17
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useCrudFilters = useCrudFilters;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const models_1 = require("@smartsoft001/models");
|
|
6
|
+
const react_2 = require("@smartsoft001/react");
|
|
7
|
+
const crud_context_1 = require("../../crud.context");
|
|
8
|
+
const hooks_1 = require("../../hooks");
|
|
9
|
+
/**
|
|
10
|
+
* The filters of the model `type`: the model's `filters` (labelled
|
|
11
|
+
* `MODEL.<key>` when they have no label — set on the model's filter, as in
|
|
12
|
+
* Angular), then a filter for each field with `list.filter`: `~=` for text
|
|
13
|
+
* fields, `=` for the others.
|
|
14
|
+
*/
|
|
15
|
+
function getFilters(type) {
|
|
16
|
+
const modelFilters = (0, models_1.getModelOptions)(type)?.filters;
|
|
17
|
+
return [
|
|
18
|
+
...(modelFilters
|
|
19
|
+
? modelFilters.map((item) => {
|
|
20
|
+
if (!item.label) {
|
|
21
|
+
item.label = 'MODEL.' + item.key;
|
|
22
|
+
}
|
|
23
|
+
return item;
|
|
24
|
+
})
|
|
25
|
+
: []),
|
|
26
|
+
...(0, models_1.getModelFieldsWithOptions)(new type())
|
|
27
|
+
.filter((item) => item.options?.list?.filter)
|
|
28
|
+
.map((item) => ({
|
|
29
|
+
key: item.key,
|
|
30
|
+
type: item.options.type === models_1.FieldType.text ||
|
|
31
|
+
item.options.type === models_1.FieldType.longText
|
|
32
|
+
? '~='
|
|
33
|
+
: '=',
|
|
34
|
+
label: 'MODEL.' + item.key,
|
|
35
|
+
fieldType: item.options.type,
|
|
36
|
+
})),
|
|
37
|
+
];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The behaviour of the filters panel (the Angular `FiltersBaseComponent`):
|
|
41
|
+
* `list` holds the filters of `config.type`, `filter` the current filter of
|
|
42
|
+
* the feature, and `onClose` closes the end menu the panel is shown in.
|
|
43
|
+
* Attach `elementRef` to the root element: it gets the application style
|
|
44
|
+
* (the Angular `styleService.init(elementRef)`).
|
|
45
|
+
*/
|
|
46
|
+
function useCrudFilters({ hideMenu = false, } = {}) {
|
|
47
|
+
const config = (0, crud_context_1.useCrudConfig)();
|
|
48
|
+
const menuService = (0, react_2.useMenuService)();
|
|
49
|
+
const styleService = (0, react_2.useStyleService)();
|
|
50
|
+
const elementRef = (0, react_1.useRef)(null);
|
|
51
|
+
const filter = (0, hooks_1.useCrudState)((state) => state.filter);
|
|
52
|
+
const list = (0, react_1.useMemo)(() => getFilters(config.type), [config.type]);
|
|
53
|
+
// A local service writes the style, so the shared one is not redirected
|
|
54
|
+
// to this element.
|
|
55
|
+
(0, react_1.useEffect)(() => {
|
|
56
|
+
new react_2.StyleService().init(elementRef.current, styleService.get());
|
|
57
|
+
}, [styleService]);
|
|
58
|
+
const onClose = (0, react_1.useCallback)(async () => {
|
|
59
|
+
await menuService.closeEnd();
|
|
60
|
+
}, [menuService]);
|
|
61
|
+
return { elementRef, hideMenu, list, filter, onClose };
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=use-crud-filters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-crud-filters.js","sourceRoot":"","sources":["../../../../../../../../../packages/crud/shell/react/src/lib/components/filters/use-crud-filters.ts"],"names":[],"mappings":";;AA4DA,wCAsBC;AAlFD,iCAAgE;AAGhE,iDAM8B;AAC9B,+CAI6B;AAG7B,qDAAmD;AACnD,uCAA2C;AAE3C;;;;;GAKG;AACH,SAAS,UAAU,CAAC,IAAsB;IACxC,MAAM,YAAY,GAAG,IAAA,wBAAe,EAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IAEpD,OAAO;QACL,GAAG,CAAC,YAAY;YACd,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;gBACxB,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;oBAChB,IAAI,CAAC,KAAK,GAAG,QAAQ,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E;IACxE,mBAAmB;IACnB,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,oBAAY,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,YAAY,CAAC,GAAG,EAAE,CAAC,CAAC;IAClE,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAEnB,MAAM,OAAO,GAAG,IAAA,mBAAW,EAAC,KAAK,IAAmB,EAAE;QACpD,MAAM,WAAW,CAAC,QAAQ,EAAE,CAAC;IAC/B,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAElB,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<smart-crud-filters-config>`: the active filters of the CRUD feature
|
|
3
|
+
* (the visible items of `filter.query`) as chips; clicking a chip removes the
|
|
4
|
+
* item and reads the list again. Render it inside `<CrudProvider>`.
|
|
5
|
+
*/
|
|
6
|
+
export declare function SmartCrudFiltersConfig(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SmartCrudFiltersConfig = SmartCrudFiltersConfig;
|
|
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 hooks_1 = require("../../hooks");
|
|
9
|
+
// The Angular `{{ item.value | translate }}`: a text is translated, any other
|
|
10
|
+
// value is shown as it is.
|
|
11
|
+
function translateValue(t, value) {
|
|
12
|
+
if (value === null || value === undefined)
|
|
13
|
+
return '';
|
|
14
|
+
if (typeof value === 'string')
|
|
15
|
+
return t(value);
|
|
16
|
+
return String(value);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* `<smart-crud-filters-config>`: the active filters of the CRUD feature
|
|
20
|
+
* (the visible items of `filter.query`) as chips; clicking a chip removes the
|
|
21
|
+
* item and reads the list again. Render it inside `<CrudProvider>`.
|
|
22
|
+
*/
|
|
23
|
+
function SmartCrudFiltersConfig() {
|
|
24
|
+
const t = (0, react_2.useTranslate)();
|
|
25
|
+
const facade = (0, crud_context_1.useCrudFacade)();
|
|
26
|
+
const filter = (0, hooks_1.useCrudState)((state) => state.filter);
|
|
27
|
+
const query = (0, react_1.useMemo)(() => filter?.query?.filter((i) => !i.hidden) || [], [filter]);
|
|
28
|
+
const onRemoveQuery = (item) => {
|
|
29
|
+
const current = facade.filter;
|
|
30
|
+
facade.read(current?.query
|
|
31
|
+
? { ...current, query: current.query.filter((i) => i !== item) }
|
|
32
|
+
: current);
|
|
33
|
+
};
|
|
34
|
+
if (!query.length)
|
|
35
|
+
return null;
|
|
36
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "smart:flex smart:flex-wrap smart:gap-2 smart:px-4 smart:py-2", children: query.map((item, index) => ((0, jsx_runtime_1.jsxs)("button", { type: "button", onClick: () => onRemoveQuery(item), className: "smart:inline-flex smart:items-center smart:gap-1 smart:rounded-full smart:border smart:border-gray-300 smart:bg-gray-50 smart:px-3 smart:py-1 smart:text-sm smart:text-gray-700 smart:hover:bg-gray-100", "aria-label": t('remove') + ' ' + t('MODEL.' + item.key), children: [(0, jsx_runtime_1.jsxs)("span", { children: [t('MODEL.' + item.key), " ", item.type, " ", translateValue(t, item.value)] }), (0, jsx_runtime_1.jsx)("span", { "aria-hidden": "true", className: "smart:text-red-600", children: "\u2715" })] }, `${index}:${item.key}:${item.type}`))) }));
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=filters-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filters-config.js","sourceRoot":"","sources":["../../../../../../../../../packages/crud/shell/react/src/lib/components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E,OAAO,IAAI,CAAC;IAE/B,OAAO,CACL,gCAAK,SAAS,EAAC,8DAA8D,YAC1E,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAC1B,oCAEE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,EAClC,SAAS,EAAC,yMAAyM,gBACvM,CAAC,CAAC,QAAQ,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,aAEtD,6CACG,CAAC,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,OAAG,IAAI,CAAC,IAAI,OAAG,cAAc,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAC9D,EACP,gDAAkB,MAAM,EAAC,SAAS,EAAC,oBAAoB,uBAEhD,KAXF,GAAG,KAAK,IAAI,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,CAYjC,CACV,CAAC,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './filters-config';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/crud/shell/react/src/lib/components/filters-config/index.ts"],"names":[],"mappings":";;;AAAA,2DAAiC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IEntity } from '@smartsoft001/domain-core';
|
|
2
|
+
import { SmartCrudGroupProps } from './group.types';
|
|
3
|
+
/**
|
|
4
|
+
* `<smart-crud-group>`: the list grouped by `groups` (the Angular
|
|
5
|
+
* `GroupComponent`), each group an accessible disclosure — a button with
|
|
6
|
+
* `aria-expanded` / `aria-controls` and its region. An open group shows the
|
|
7
|
+
* list with `listOptions`, or its `children` groups. Render it inside
|
|
8
|
+
* `<CrudProvider>`.
|
|
9
|
+
*/
|
|
10
|
+
export declare function SmartCrudGroup<T extends IEntity<string>>(props: SmartCrudGroupProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SmartCrudGroup = SmartCrudGroup;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("@smartsoft001/react");
|
|
6
|
+
const use_crud_group_1 = require("./use-crud-group");
|
|
7
|
+
/**
|
|
8
|
+
* `<smart-crud-group>`: the list grouped by `groups` (the Angular
|
|
9
|
+
* `GroupComponent`), each group an accessible disclosure — a button with
|
|
10
|
+
* `aria-expanded` / `aria-controls` and its region. An open group shows the
|
|
11
|
+
* list with `listOptions`, or its `children` groups. Render it inside
|
|
12
|
+
* `<CrudProvider>`.
|
|
13
|
+
*/
|
|
14
|
+
function SmartCrudGroup(props) {
|
|
15
|
+
const t = (0, react_1.useTranslate)();
|
|
16
|
+
const { groups, listOptions, change } = (0, use_crud_group_1.useCrudGroup)(props);
|
|
17
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: groups?.map((item) => ((0, jsx_runtime_1.jsxs)("div", { className: "smart:border-b smart:border-gray-200", children: [(0, jsx_runtime_1.jsxs)("button", { type: "button", onClick: () => change(!item.show, item), "aria-expanded": item.show || false, "aria-controls": 'smart-crud-group-' + item.key, className: (0, react_1.cn)('smart:flex smart:w-full smart:items-center smart:justify-between smart:py-3 smart:text-left smart:text-sm', item.show && 'smart:font-bold'), children: [(0, jsx_runtime_1.jsx)("span", { children: t(item.text) }), (0, jsx_runtime_1.jsx)("span", { "aria-hidden": "true", className: "smart:text-gray-500", children: item.show ? '▾' : '▸' })] }), item.show && ((0, jsx_runtime_1.jsxs)("div", { id: 'smart-crud-group-' + item.key, className: "smart:pb-3", children: [!item.children && listOptions && ((0, jsx_runtime_1.jsx)(react_1.SmartList, { options: listOptions })), item.children && ((0, jsx_runtime_1.jsx)("div", { className: "smart:ml-12", children: (0, jsx_runtime_1.jsx)(SmartCrudGroup, { groups: item.children, listOptions: listOptions }) }))] }))] }, item.key))) }));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group.js","sourceRoot":"","sources":["../../../../../../../../../packages/crud/shell/react/src/lib/components/group/group.tsx"],"names":[],"mappings":";;AAaA,wCA4CC;;AAxDD,+CAAkE;AAGlE,qDAAgD;AAEhD;;;;;;GAMG;AACH,SAAgB,cAAc,CAC5B,KAA6B;IAE7B,MAAM,CAAC,GAAG,IAAA,oBAAY,GAAE,CAAC;IACzB,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,IAAA,6BAAY,EAAI,KAAK,CAAC,CAAC;IAE/D,OAAO,CACL,2DACG,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACrB,iCAAoB,SAAS,EAAC,sCAAsC,aAClE,oCACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,mBACxB,IAAI,CAAC,IAAI,IAAI,KAAK,mBAClB,mBAAmB,GAAG,IAAI,CAAC,GAAG,EAC7C,SAAS,EAAE,IAAA,UAAE,EACX,2GAA2G,EAC3G,IAAI,CAAC,IAAI,IAAI,iBAAiB,CAC/B,aAED,2CAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAQ,EAC3B,gDAAkB,MAAM,EAAC,SAAS,EAAC,qBAAqB,YACrD,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GACjB,IACA,EACR,IAAI,CAAC,IAAI,IAAI,CACZ,iCAAK,EAAE,EAAE,mBAAmB,GAAG,IAAI,CAAC,GAAG,EAAE,SAAS,EAAC,YAAY,aAC5D,CAAC,IAAI,CAAC,QAAQ,IAAI,WAAW,IAAI,CAChC,uBAAC,iBAAS,IAAC,OAAO,EAAE,WAAW,GAAI,CACpC,EACA,IAAI,CAAC,QAAQ,IAAI,CAChB,gCAAK,SAAS,EAAC,aAAa,YAC1B,uBAAC,cAAc,IACb,MAAM,EAAE,IAAI,CAAC,QAAQ,EACrB,WAAW,EAAE,WAAW,GACxB,GACE,CACP,IACG,CACP,KA9BO,IAAI,CAAC,GAAG,CA+BZ,CACP,CAAC,GACD,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IEntity } from '@smartsoft001/domain-core';
|
|
2
|
+
import { IListOptions } from '@smartsoft001/react';
|
|
3
|
+
import { ICrudListGroup } from '../../models';
|
|
4
|
+
/** The props of `<SmartCrudGroup>` (`<smart-crud-group>`). */
|
|
5
|
+
export interface SmartCrudGroupProps<T extends IEntity<string>> {
|
|
6
|
+
groups?: Array<ICrudListGroup> | null;
|
|
7
|
+
listOptions?: IListOptions<T> | null;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/crud/shell/react/src/lib/components/group/group.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("./group"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./group.types"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./use-crud-group"), exports);
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/crud/shell/react/src/lib/components/group/index.ts"],"names":[],"mappings":";;;AAAA,kDAAwB;AACxB,wDAA8B;AAC9B,2DAAiC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IEntity } from '@smartsoft001/domain-core';
|
|
2
|
+
import { SmartCrudGroupProps } from './group.types';
|
|
3
|
+
import { ICrudListGroup } from '../../models';
|
|
4
|
+
/**
|
|
5
|
+
* The behaviour of the list groups (the Angular `GroupBaseComponent`).
|
|
6
|
+
* `change(val, item)` closes the other groups, filters the list by the group
|
|
7
|
+
* through `CrudListGroupService` and sets `item.show` — on the next tick when
|
|
8
|
+
* opening (the list reads first), at once when closing. The groups are
|
|
9
|
+
* plain objects changed in place, as in Angular; the hook re-renders after
|
|
10
|
+
* each change. When the component goes away, the service drops the query
|
|
11
|
+
* items of the groups again.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useCrudGroup<T extends IEntity<string>>({ groups, listOptions, }: SmartCrudGroupProps<T>): {
|
|
14
|
+
groups: ICrudListGroup[] | null;
|
|
15
|
+
listOptions: import("dist/packages/shared/react/src").IListOptions<T> | null;
|
|
16
|
+
change: (val: boolean, item: ICrudListGroup, force?: boolean) => void;
|
|
17
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useCrudGroup = useCrudGroup;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const crud_context_1 = require("../../crud.context");
|
|
6
|
+
/**
|
|
7
|
+
* The behaviour of the list groups (the Angular `GroupBaseComponent`).
|
|
8
|
+
* `change(val, item)` closes the other groups, filters the list by the group
|
|
9
|
+
* through `CrudListGroupService` and sets `item.show` — on the next tick when
|
|
10
|
+
* opening (the list reads first), at once when closing. The groups are
|
|
11
|
+
* plain objects changed in place, as in Angular; the hook re-renders after
|
|
12
|
+
* each change. When the component goes away, the service drops the query
|
|
13
|
+
* items of the groups again.
|
|
14
|
+
*/
|
|
15
|
+
function useCrudGroup({ groups = null, listOptions = null, }) {
|
|
16
|
+
const groupService = (0, crud_context_1.useCrudListGroupService)();
|
|
17
|
+
// The Angular `cd.detectChanges()`.
|
|
18
|
+
const [, detectChanges] = (0, react_1.useReducer)((tick) => tick + 1, 0);
|
|
19
|
+
const latest = (0, react_1.useRef)({ groups, groupService });
|
|
20
|
+
(0, react_1.useEffect)(() => {
|
|
21
|
+
latest.current = { groups, groupService };
|
|
22
|
+
});
|
|
23
|
+
(0, react_1.useEffect)(() => () => {
|
|
24
|
+
const current = latest.current;
|
|
25
|
+
if (current.groups)
|
|
26
|
+
current.groupService.destroy(current.groups);
|
|
27
|
+
}, []);
|
|
28
|
+
const change = (0, react_1.useCallback)((val, item, force = false) => {
|
|
29
|
+
if (groups) {
|
|
30
|
+
groups
|
|
31
|
+
.filter((i) => i.value !== item.value || i.key !== item.key)
|
|
32
|
+
.forEach((i) => {
|
|
33
|
+
i.show = false;
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
groupService.change(val, item, force);
|
|
37
|
+
if (val) {
|
|
38
|
+
setTimeout(() => {
|
|
39
|
+
item.show = val;
|
|
40
|
+
detectChanges();
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
item.show = val;
|
|
45
|
+
detectChanges();
|
|
46
|
+
}
|
|
47
|
+
}, [groups, groupService]);
|
|
48
|
+
return { groups, listOptions, change };
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=use-crud-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-crud-group.js","sourceRoot":"","sources":["../../../../../../../../../packages/crud/shell/react/src/lib/components/group/use-crud-group.ts"],"names":[],"mappings":";;AAiBA,oCAgDC;AAjED,iCAAmE;AAKnE,qDAA6D;AAG7D;;;;;;;;GAQG;AACH,SAAgB,YAAY,CAA4B,EACtD,MAAM,GAAG,IAAI,EACb,WAAW,GAAG,IAAI,GACK;IACvB,MAAM,YAAY,GAAG,IAAA,sCAAuB,GAAK,CAAC;IAClD,oCAAoC;IACpC,MAAM,CAAC,EAA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,CAAC,IAAI,GAAG,GAAG,CAAC;YAChB,aAAa,EAAE,CAAC;QAClB,CAAC;IACH,CAAC,EACD,CAAC,MAAM,EAAE,YAAY,CAAC,CACvB,CAAC;IAEF,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./multiselect"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./use-crud-multiselect"), exports);
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/crud/shell/react/src/lib/components/multiselect/index.ts"],"names":[],"mappings":";;;AAAA,wDAA8B;AAC9B,iEAAuC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IEntity } from '@smartsoft001/domain-core';
|
|
2
|
+
/**
|
|
3
|
+
* `<smart-crud-multiselect>`: the panel of the items selected in the list
|
|
4
|
+
* (the Angular `MultiselectComponent`), opened in the end menu. A header
|
|
5
|
+
* with the count and a close button, the `config.list.components.multi`
|
|
6
|
+
* component with the selected `items`, and the `multiUpdate` form of the
|
|
7
|
+
* model with the button applying it to every selected item. Render it inside
|
|
8
|
+
* `<CrudProvider>`.
|
|
9
|
+
*/
|
|
10
|
+
export declare function SmartCrudMultiselect<T extends IEntity<string>>(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SmartCrudMultiselect = SmartCrudMultiselect;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const react_2 = require("@smartsoft001/react");
|
|
7
|
+
const use_crud_multiselect_1 = require("./use-crud-multiselect");
|
|
8
|
+
const form_options_1 = require("../../factories/form-options");
|
|
9
|
+
/**
|
|
10
|
+
* `<smart-crud-multiselect>`: the panel of the items selected in the list
|
|
11
|
+
* (the Angular `MultiselectComponent`), opened in the end menu. A header
|
|
12
|
+
* with the count and a close button, the `config.list.components.multi`
|
|
13
|
+
* component with the selected `items`, and the `multiUpdate` form of the
|
|
14
|
+
* model with the button applying it to every selected item. Render it inside
|
|
15
|
+
* `<CrudProvider>`.
|
|
16
|
+
*/
|
|
17
|
+
function SmartCrudMultiselect() {
|
|
18
|
+
const t = (0, react_2.useTranslate)();
|
|
19
|
+
const { config, list, item, showForm, lock, valid, buttonOptions, onClose, onPartialChange, onValidChange, } = (0, use_crud_multiselect_1.useCrudMultiselect)();
|
|
20
|
+
const Multi = config?.list?.components?.multi;
|
|
21
|
+
// The Angular `item | smartFormOptions: 'multiUpdate' : config.type`.
|
|
22
|
+
const formOptions = (0, react_1.useMemo)(() => (0, form_options_1.getCrudFormOptions)(item, 'multiUpdate', config.type), [item, config.type]);
|
|
23
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("header", { className: "smart:flex smart:items-center smart:justify-between smart:border-b smart:border-gray-200 smart:px-4 smart:py-3", children: [(0, jsx_runtime_1.jsxs)("h2", { className: "smart:text-lg smart:font-semibold smart:text-gray-900", children: [t('selected'), ": ", list.length] }), (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: onClose, "aria-label": "close", className: "smart:rounded smart:p-1 smart:text-gray-500 smart:hover:bg-gray-100", children: "\u2715" })] }), Multi && ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(Multi, { items: list }) })), showForm && item && formOptions && ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(react_2.SmartForm, { options: formOptions, onValuePartialChange: (changes) => onPartialChange(changes, list), onValidChange: onValidChange }), (0, jsx_runtime_1.jsx)(react_2.SmartButton, { className: "smart:float-right", disabled: lock || !valid, options: buttonOptions, children: t('change') })] }))] }));
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=multiselect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multiselect.js","sourceRoot":"","sources":["../../../../../../../../../packages/crud/shell/react/src/lib/components/multiselect/multiselect.tsx"],"names":[],"mappings":";;AAgBA,oDAgEC;;AAhFD,iCAAgC;AAGhC,+CAA2E;AAE3E,iEAA4D;AAC5D,+DAAkE;AAElE;;;;;;;GAOG;AACH,SAAgB,oBAAoB;IAClC,MAAM,CAAC,GAAG,IAAA,oBAAY,GAAE,CAAC;IACzB,MAAM,EACJ,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,aAAa,EACb,OAAO,EACP,eAAe,EACf,aAAa,GACd,GAAG,IAAA,yCAAkB,GAAK,CAAC;IAE5B,MAAM,KAAK,GAAG,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC;IAE9C,sEAAsE;IACtE,MAAM,WAAW,GAAG,IAAA,eAAO,EACzB,GAAG,EAAE,CAAC,IAAA,iCAAkB,EAAC,IAAI,EAAE,aAAa,EAAE,MAAM,CAAC,IAAI,CAAC,EAC1D,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,CACpB,CAAC;IAEF,OAAO,CACL,6DACE,oCAAQ,SAAS,EAAC,gHAAgH,aAChI,gCAAI,SAAS,EAAC,uDAAuD,aAClE,CAAC,CAAC,UAAU,CAAC,QAAI,IAAI,CAAC,MAAM,IAC1B,EACL,mCACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,OAAO,gBACL,OAAO,EAClB,SAAS,EAAC,qEAAqE,uBAGxE,IACF,EAER,KAAK,IAAI,CACR,0CACE,uBAAC,KAAK,IAAC,KAAK,EAAE,IAAI,GAAI,GAClB,CACP,EAEA,QAAQ,IAAI,IAAI,IAAI,WAAW,IAAI,CAClC,4CACE,uBAAC,iBAAS,IACR,OAAO,EAAE,WAAW,EACpB,oBAAoB,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,eAAe,CAAC,OAAO,EAAE,IAAI,CAAC,EACjE,aAAa,EAAE,aAAa,GAC5B,EAEF,uBAAC,mBAAW,IACV,SAAS,EAAC,mBAAmB,EAC7B,QAAQ,EAAE,IAAI,IAAI,CAAC,KAAK,EACxB,OAAO,EAAE,aAAa,YAErB,CAAC,CAAC,QAAQ,CAAC,GACA,IACV,CACP,IACA,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { IEntity } from '@smartsoft001/domain-core';
|
|
2
|
+
import { IButtonOptions } from '@smartsoft001/react';
|
|
3
|
+
/**
|
|
4
|
+
* The behaviour of the multi-selection panel (the Angular
|
|
5
|
+
* `MultiselectBaseComponent`): `list` is the selection, `item` a model of
|
|
6
|
+
* `config.type` holding the values the selected items share in the fields
|
|
7
|
+
* with `update.multi` (`showForm` when there is such a field). The form
|
|
8
|
+
* reports its changes with `onPartialChange(changes, list)` and its validity
|
|
9
|
+
* with `onValidChange`; `buttonOptions` (with confirmation) apply the changes
|
|
10
|
+
* to every selected item and close the end menu. `lock` is set again
|
|
11
|
+
* whenever the selection changes, until the form reports.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useCrudMultiselect<T extends IEntity<string>>(): {
|
|
14
|
+
config: import("../../crud.config").CrudConfig<T> & Partial<import("../../crud.config").CrudFullConfig<T>>;
|
|
15
|
+
list: T[];
|
|
16
|
+
item: T;
|
|
17
|
+
showForm: boolean;
|
|
18
|
+
lock: boolean;
|
|
19
|
+
valid: boolean;
|
|
20
|
+
buttonOptions: IButtonOptions;
|
|
21
|
+
onClose: () => Promise<void>;
|
|
22
|
+
onPartialChange: (changes: Partial<T>, current: Array<T>) => void;
|
|
23
|
+
onValidChange: (value: boolean) => void;
|
|
24
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useCrudMultiselect = useCrudMultiselect;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const models_1 = require("@smartsoft001/models");
|
|
6
|
+
const react_2 = require("@smartsoft001/react");
|
|
7
|
+
const crud_context_1 = require("../../crud.context");
|
|
8
|
+
const hooks_1 = require("../../hooks");
|
|
9
|
+
/**
|
|
10
|
+
* The behaviour of the multi-selection panel (the Angular
|
|
11
|
+
* `MultiselectBaseComponent`): `list` is the selection, `item` a model of
|
|
12
|
+
* `config.type` holding the values the selected items share in the fields
|
|
13
|
+
* with `update.multi` (`showForm` when there is such a field). The form
|
|
14
|
+
* reports its changes with `onPartialChange(changes, list)` and its validity
|
|
15
|
+
* with `onValidChange`; `buttonOptions` (with confirmation) apply the changes
|
|
16
|
+
* to every selected item and close the end menu. `lock` is set again
|
|
17
|
+
* whenever the selection changes, until the form reports.
|
|
18
|
+
*/
|
|
19
|
+
function useCrudMultiselect() {
|
|
20
|
+
const facade = (0, crud_context_1.useCrudFacade)();
|
|
21
|
+
const config = (0, crud_context_1.useCrudConfig)();
|
|
22
|
+
const menuService = (0, react_2.useMenuService)();
|
|
23
|
+
const multiSelected = (0, hooks_1.useCrudState)((state) => state.multiSelected);
|
|
24
|
+
const list = (0, react_1.useMemo)(() => multiSelected || [], [multiSelected]);
|
|
25
|
+
const [partial, setPartial] = (0, react_1.useState)(null);
|
|
26
|
+
const [valid, setValid] = (0, react_1.useState)(false);
|
|
27
|
+
const { item, showForm } = (0, react_1.useMemo)(() => {
|
|
28
|
+
const model = new config.type();
|
|
29
|
+
const fieldsWithOptions = (0, models_1.getModelFieldsWithOptions)(model)?.filter((f) => f.options.update?.multi);
|
|
30
|
+
fieldsWithOptions.forEach(({ key }) => {
|
|
31
|
+
const uniques = Array.from(new Set(list.map((i) => i[key])));
|
|
32
|
+
if (uniques.length === 1) {
|
|
33
|
+
model[key] = uniques[0];
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
return { item: model, showForm: !!fieldsWithOptions.length };
|
|
37
|
+
}, [list, config.type]);
|
|
38
|
+
const lock = partial?.list !== list;
|
|
39
|
+
const buttonOptions = {
|
|
40
|
+
click: async () => {
|
|
41
|
+
const result = (partial?.list ?? []).map((i) => ({
|
|
42
|
+
...partial?.changes,
|
|
43
|
+
id: i.id,
|
|
44
|
+
}));
|
|
45
|
+
facade.updatePartialMany(result);
|
|
46
|
+
await menuService.closeEnd();
|
|
47
|
+
},
|
|
48
|
+
confirm: true,
|
|
49
|
+
};
|
|
50
|
+
const onClose = (0, react_1.useCallback)(async () => {
|
|
51
|
+
await menuService.closeEnd();
|
|
52
|
+
}, [menuService]);
|
|
53
|
+
const onPartialChange = (0, react_1.useCallback)((changes, current) => {
|
|
54
|
+
setPartial({ list: current, changes });
|
|
55
|
+
}, []);
|
|
56
|
+
const onValidChange = (0, react_1.useCallback)((value) => {
|
|
57
|
+
setValid(value);
|
|
58
|
+
}, []);
|
|
59
|
+
return {
|
|
60
|
+
config,
|
|
61
|
+
list,
|
|
62
|
+
item,
|
|
63
|
+
showForm,
|
|
64
|
+
lock,
|
|
65
|
+
valid,
|
|
66
|
+
buttonOptions,
|
|
67
|
+
onClose,
|
|
68
|
+
onPartialChange,
|
|
69
|
+
onValidChange,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=use-crud-multiselect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-crud-multiselect.js","sourceRoot":"","sources":["../../../../../../../../../packages/crud/shell/react/src/lib/components/multiselect/use-crud-multiselect.ts"],"names":[],"mappings":";;AA2BA,gDA2EC;AAtGD,iCAAuD;AAGvD,iDAG8B;AAC9B,+CAAqE;AAErE,qDAAkE;AAClE,uCAA2C;AAO3C;;;;;;;;;GASG;AACH,SAAgB,kBAAkB;IAChC,MAAM,M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