@uxf/cms 11.0.0 → 11.1.1
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/api/index.d.ts +4 -0
- package/api/index.js +5 -1
- package/package.json +5 -5
- package/pages/grid-page/grid-page.js +2 -1
- package/pages/grid-page/types.d.ts +4 -1
package/api/index.d.ts
CHANGED
@@ -154,6 +154,10 @@ export declare function saveFormValues<T extends Record<string, any>>(ctx: any,
|
|
154
154
|
entityAlias: string;
|
155
155
|
id?: number | null;
|
156
156
|
}, body: T): Promise<import("axios").AxiosResponse<T, any>>;
|
157
|
+
export declare function removeEntity(ctx: any, path: {
|
158
|
+
entityAlias: string;
|
159
|
+
id: number;
|
160
|
+
}): Promise<import("axios").AxiosResponse<undefined, any>>;
|
157
161
|
export declare function userConfigSave(name: string, data: any): Promise<import("axios").AxiosResponse<UserConfigBagResponse, any>>;
|
158
162
|
export declare function userConfigGetAll(ctx: any): Promise<import("axios").AxiosResponse<UserConfigBagResponse, any>>;
|
159
163
|
export declare function userConfigGet<T>(ctx: any, name: string, defaultValue?: T): Promise<T | undefined>;
|
package/api/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.uploadFile = exports.userConfigGet = exports.userConfigGetAll = exports.userConfigSave = exports.saveFormValues = exports.autocomplete = exports.login = exports.getFormValues = exports.getFormSchema = exports.getEntityMetaSchemas = exports.getLoggedUser = exports.forgottenPassword = exports.dataGridAutocompleteGet = exports.dataGridSchemaGet = exports.contentUpdate = exports.contentCreate = exports.contentGet = void 0;
|
3
|
+
exports.uploadFile = exports.userConfigGet = exports.userConfigGetAll = exports.userConfigSave = exports.removeEntity = exports.saveFormValues = exports.autocomplete = exports.login = exports.getFormValues = exports.getFormSchema = exports.getEntityMetaSchemas = exports.getLoggedUser = exports.forgottenPassword = exports.dataGridAutocompleteGet = exports.dataGridSchemaGet = exports.contentUpdate = exports.contentCreate = exports.contentGet = void 0;
|
4
4
|
// eslint-disable-next-line import/no-cycle
|
5
5
|
const api_1 = require("../lib/api");
|
6
6
|
const { axiosRequest, axiosInstance } = (0, api_1.createAxiosInstance)();
|
@@ -58,6 +58,10 @@ function saveFormValues(ctx, path, body) {
|
|
58
58
|
: axiosRequest(ctx, `/api/cms/form/${path.entityAlias}`, "post", body, null);
|
59
59
|
}
|
60
60
|
exports.saveFormValues = saveFormValues;
|
61
|
+
function removeEntity(ctx, path) {
|
62
|
+
return axiosRequest(ctx, `/api/cms/form/${path.entityAlias}/${path.id}`, "delete", null, null);
|
63
|
+
}
|
64
|
+
exports.removeEntity = removeEntity;
|
61
65
|
async function userConfigSave(name, data) {
|
62
66
|
return axiosRequest(null, "/api/cms/user-config", "post", { name, data }, null);
|
63
67
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@uxf/cms",
|
3
|
-
"version": "11.
|
3
|
+
"version": "11.1.1",
|
4
4
|
"description": "UXF Cms",
|
5
5
|
"author": "UXFans <dev@uxf.cz>",
|
6
6
|
"homepage": "https://gitlab.com/uxf-npm/cms#readme",
|
@@ -31,11 +31,11 @@
|
|
31
31
|
"@floating-ui/react": "0.26.0",
|
32
32
|
"@redux-devtools/extension": "3.2.5",
|
33
33
|
"@uxf/core": "10.10.1",
|
34
|
-
"@uxf/data-grid": "11.
|
35
|
-
"@uxf/form": "11.
|
34
|
+
"@uxf/data-grid": "11.1.1",
|
35
|
+
"@uxf/form": "11.1.0",
|
36
36
|
"@uxf/router": "10.0.0",
|
37
|
-
"@uxf/ui": "11.
|
38
|
-
"@uxf/wysiwyg": "11.
|
37
|
+
"@uxf/ui": "11.1.0",
|
38
|
+
"@uxf/wysiwyg": "11.1.1",
|
39
39
|
"axios": "1.5.1",
|
40
40
|
"axios-hooks": "5.0.0",
|
41
41
|
"es6-error": "4.1.1",
|
@@ -58,6 +58,7 @@ const GridPageComponent = (props) => {
|
|
58
58
|
const { state, actions } = (0, use_data_grid_control_1.useDataGridControl)({
|
59
59
|
schema: props.gridSchema,
|
60
60
|
initialState: query.filter ? (0, router_1.queryParamToString)(query.filter) : undefined,
|
61
|
+
initialUserConfig: props.initialUserConfig,
|
61
62
|
});
|
62
63
|
const universalLoader = (0, react_1.useCallback)((gridName, request, encodedRequest) => {
|
63
64
|
var _a, _b;
|
@@ -130,7 +131,7 @@ const GridPageComponent = (props) => {
|
|
130
131
|
GridPageComponent.displayName = "GridPageComponent";
|
131
132
|
const GridPage = (config) => {
|
132
133
|
const Component = (props) => {
|
133
|
-
return (react_1.default.createElement(GridPageComponent, { ...props, AddIcon: config.AddIcon, customActions: config.customActions, getEditUrl: config.getEditUrl, getOpenUrl: config.getOpenUrl, loader: config.loader, onAdd: config.onAdd, onAddTitle: config.onAddTitle, onEdit: config.onEdit, onOpen: config.onOpen, onRemove: config.onRemove, rowHeight: config.rowHeight, selectable: config.selectable, title: config.title, ui: config.ui }));
|
134
|
+
return (react_1.default.createElement(GridPageComponent, { ...props, AddIcon: config.AddIcon, customActions: config.customActions, getEditUrl: config.getEditUrl, getOpenUrl: config.getOpenUrl, loader: config.loader, onAdd: config.onAdd, onAddTitle: config.onAddTitle, onEdit: config.onEdit, onOpen: config.onOpen, onRemove: config.onRemove, rowHeight: config.rowHeight, selectable: config.selectable, title: config.title, ui: config.ui, initialUserConfig: config.initialUserConfig }));
|
134
135
|
};
|
135
136
|
Component.getInitialProps = async (ctx) => {
|
136
137
|
const entityAlias = typeof config.entityAlias === "function" ? config.entityAlias(ctx) : config.entityAlias;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
/// <reference types="node" />
|
2
|
-
import {
|
2
|
+
import { Nullish } from "@uxf/core/types";
|
3
|
+
import { DataGridProps, DataGridUserConfig, Loader, Schema } from "@uxf/data-grid";
|
3
4
|
import { NextPageContext } from "next";
|
4
5
|
import { ParsedUrlQuery } from "querystring";
|
5
6
|
import { FC, ReactElement } from "react";
|
@@ -29,6 +30,7 @@ export type GridPageComponentProps = {
|
|
29
30
|
onAddTitle?: string;
|
30
31
|
selectable?: boolean;
|
31
32
|
customActions?: DataGridProps<any, any>["customActions"];
|
33
|
+
initialUserConfig?: DataGridUserConfig | Nullish;
|
32
34
|
};
|
33
35
|
export type EntityAliasExtractor = (ctx: NextPageContext) => string;
|
34
36
|
type UIComponents = {
|
@@ -55,5 +57,6 @@ export type GridPageConfig<T extends object = any> = {
|
|
55
57
|
onAddTitle?: string;
|
56
58
|
selectable?: boolean;
|
57
59
|
customActions?: DataGridProps<any, any>["customActions"];
|
60
|
+
initialUserConfig?: DataGridUserConfig | Nullish;
|
58
61
|
};
|
59
62
|
export {};
|