@uxf/cms 11.0.0-beta.1 → 11.0.0-beta.10
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/package.json +2 -2
- package/pages/grid-page/grid-page.js +10 -2
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@uxf/cms",
|
3
|
-
"version": "11.0.0-beta.
|
3
|
+
"version": "11.0.0-beta.10",
|
4
4
|
"description": "UXF Cms",
|
5
5
|
"author": "UXFans <dev@uxf.cz>",
|
6
6
|
"homepage": "https://gitlab.com/uxf-npm/cms#readme",
|
@@ -31,7 +31,7 @@
|
|
31
31
|
"@floating-ui/react": "0.26.0",
|
32
32
|
"@redux-devtools/extension": "3.2.5",
|
33
33
|
"@uxf/core": "10.0.0",
|
34
|
-
"@uxf/data-grid": "11.0.0-beta.
|
34
|
+
"@uxf/data-grid": "11.0.0-beta.10",
|
35
35
|
"@uxf/form": "10.0.9",
|
36
36
|
"@uxf/router": "10.0.0",
|
37
37
|
"@uxf/ui": "10.0.7",
|
@@ -53,7 +53,10 @@ const GridPageComponent = (props) => {
|
|
53
53
|
// eslint-disable-next-line react/destructuring-assignment
|
54
54
|
const { metaSchema, entityAlias, gridSchema, getOpenUrl, getEditUrl, onOpen, onAdd, onEdit, onRemove, query, rowHeight, AddIcon = react_1.default.createElement(icon_1.Icon, { name: "plus" }), onAddTitle = "Přidat záznam", customActions = [], } = props;
|
55
55
|
const Layout = (_b = (_a = props.ui) === null || _a === void 0 ? void 0 : _a.Layout) !== null && _b !== void 0 ? _b : DefaultLayout;
|
56
|
-
const { state, actions } = (0, use_data_grid_control_1.useDataGridControl)(
|
56
|
+
const { state, actions } = (0, use_data_grid_control_1.useDataGridControl)({
|
57
|
+
schema: props.gridSchema,
|
58
|
+
initialState: query.filter ? (0, router_1.queryParamToString)(query.filter) : undefined,
|
59
|
+
});
|
57
60
|
const universalLoader = (0, react_1.useCallback)((gridName, request, encodedRequest) => {
|
58
61
|
var _a, _b;
|
59
62
|
const response = (0, exports.dataGridLoader)(gridName !== null && gridName !== void 0 ? gridName : "", request);
|
@@ -63,7 +66,12 @@ const GridPageComponent = (props) => {
|
|
63
66
|
router_2.default.replace(`${(0, url_1.parse)(((_a = window.history.state) === null || _a === void 0 ? void 0 : _a.url) || "").pathname}?${(0, qs_1.stringify)(newQuery)}`, `${(0, url_1.parse)(((_b = window.history.state) === null || _b === void 0 ? void 0 : _b.as) || "").pathname}?${(0, qs_1.stringify)(newQuery)}`, { shallow: true });
|
64
67
|
return response;
|
65
68
|
}, [query]);
|
66
|
-
const { data, isLoading, error, onReload } = (0, use_data_grid_fetching_1.useDataGridFetching)(
|
69
|
+
const { data, isLoading, error, onReload } = (0, use_data_grid_fetching_1.useDataGridFetching)({
|
70
|
+
loader: (_c = props.loader) !== null && _c !== void 0 ? _c : universalLoader,
|
71
|
+
schema: props.gridSchema,
|
72
|
+
gridName: (_e = (_d = props.metaSchema) === null || _d === void 0 ? void 0 : _d.entityAlias) !== null && _e !== void 0 ? _e : "",
|
73
|
+
state,
|
74
|
+
});
|
67
75
|
const uiContextValues = (0, react_1.useContext)(context_1.UiContext);
|
68
76
|
const actionsBag = (0, react_1.useMemo)(() => ({
|
69
77
|
reload: onReload,
|