@uxf/data-grid 11.67.0 → 11.68.2
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/data-grid-v2.js +1 -1
- package/data-grid-v2.stories.js +1 -1
- package/data-grid.js +1 -1
- package/data-grid.stories.js +1 -1
- package/export-button/export-button.d.ts +2 -3
- package/export-button/export-button.js +2 -1
- package/export-button/export-button.stories.js +1 -1
- package/package.json +4 -4
- package/table-v2/styles.css +3 -1
- package/toolbar-control/toolbar-control.d.ts +2 -2
- package/toolbar-control/toolbar-control.js +1 -1
- package/toolbar-control/toolbar-control.stories.js +1 -1
- package/types/core.d.ts +1 -1
- package/types/data-grid-props.d.ts +2 -2
- package/utils.d.ts +1 -2
package/data-grid-v2.js
CHANGED
|
@@ -28,7 +28,7 @@ function DataGridV2(props) {
|
|
|
28
28
|
react_1.default.createElement(root_1.DataGridRoot, { className: props.className },
|
|
29
29
|
react_1.default.createElement(toolbar_1.DataGridToolbar, null,
|
|
30
30
|
react_1.default.createElement(toolbar_tabs_1.DataGridToolbarTabs, { actions: props.actions, changeTabFilterBehavior: props.changeTabFilterBehavior, schema: props.schema, state: props.state }),
|
|
31
|
-
react_1.default.createElement(toolbar_control_1.DataGridToolbarControl, { actions: props.actions, filterHandlers: (_a = props.filterHandlers) !== null && _a !== void 0 ? _a : filter_handler_1.defaultFilterHandlers,
|
|
31
|
+
react_1.default.createElement(toolbar_control_1.DataGridToolbarControl, { actions: props.actions, filterHandlers: (_a = props.filterHandlers) !== null && _a !== void 0 ? _a : filter_handler_1.defaultFilterHandlers, getCsvDownloadUrl: props.getCsvDownloadUrl, schema: props.schema, state: props.state }),
|
|
32
32
|
react_1.default.createElement(toolbar_customs_1.DataGridToolbarCustoms, { buttons: props.customActions })),
|
|
33
33
|
react_1.default.createElement(linear_progress_1.DataGridLinearProgress, { isLoading: props.isLoading }),
|
|
34
34
|
react_1.default.createElement(filter_list_1.DataGridFilterList, { actions: props.actions, filterHandlers: (_b = props.filterHandlers) !== null && _b !== void 0 ? _b : filter_handler_1.defaultFilterHandlers, schema: props.schema, state: props.state }),
|
package/data-grid-v2.stories.js
CHANGED
|
@@ -94,6 +94,6 @@ function Default() {
|
|
|
94
94
|
});
|
|
95
95
|
return (react_1.default.createElement("div", { className: "p-10" },
|
|
96
96
|
react_1.default.createElement(radio_group_1.RadioGroup, { label: "Chov\u00E1n\u00ED p\u0159ep\u00EDn\u00E1n\u00ED tab\u016F", name: "filterBehavior", onChange: (value) => setFilterBehavior(value), options: FILTER_BEHAVIOR_OPTIONS, value: filterBehavior, variant: "row" }),
|
|
97
|
-
react_1.default.createElement(data_grid_v2_1.DataGridV2, { actionCell: actionCell, actions: actions, changeTabFilterBehavior: filterBehavior !== null && filterBehavior !== void 0 ? filterBehavior : "filtersPerTab", data: data, error: error, isLoading: isLoading, isRowSelectable: true,
|
|
97
|
+
react_1.default.createElement(data_grid_v2_1.DataGridV2, { actionCell: actionCell, actions: actions, changeTabFilterBehavior: filterBehavior !== null && filterBehavior !== void 0 ? filterBehavior : "filtersPerTab", data: data, error: error, getCsvDownloadUrl: () => ``, isLoading: isLoading, isRowSelectable: true, reload: reload, rowAccent: (row) => (row.id === 2 ? "success" : undefined), rowClassName: (row) => (row.id === 3 ? "some-custom-classname" : undefined), rowHeight: "auto", schema: schemaWithFrontendConfig, state: state }),
|
|
98
98
|
react_1.default.createElement(json_renderer_1.JsonRenderer, { value: state })));
|
|
99
99
|
}
|
package/data-grid.js
CHANGED
|
@@ -29,7 +29,7 @@ function DataGrid(props) {
|
|
|
29
29
|
react_1.default.createElement(root_1.DataGridRoot, { className: props.className },
|
|
30
30
|
react_1.default.createElement(toolbar_1.DataGridToolbar, null,
|
|
31
31
|
react_1.default.createElement(toolbar_tabs_1.DataGridToolbarTabs, { actions: props.actions, changeTabFilterBehavior: props.changeTabFilterBehavior, schema: props.schema, state: props.state }),
|
|
32
|
-
react_1.default.createElement(toolbar_control_1.DataGridToolbarControl, { actions: props.actions, filterHandlers: (_a = props.filterHandlers) !== null && _a !== void 0 ? _a : filter_handler_1.defaultFilterHandlers,
|
|
32
|
+
react_1.default.createElement(toolbar_control_1.DataGridToolbarControl, { actions: props.actions, filterHandlers: (_a = props.filterHandlers) !== null && _a !== void 0 ? _a : filter_handler_1.defaultFilterHandlers, getCsvDownloadUrl: props.getCsvDownloadUrl, schema: props.schema, state: props.state }),
|
|
33
33
|
react_1.default.createElement(toolbar_customs_1.DataGridToolbarCustoms, { buttons: props.customActions })),
|
|
34
34
|
react_1.default.createElement(linear_progress_1.DataGridLinearProgress, { isLoading: props.isLoading }),
|
|
35
35
|
react_1.default.createElement(filter_list_1.DataGridFilterList, { actions: props.actions, filterHandlers: (_b = props.filterHandlers) !== null && _b !== void 0 ? _b : filter_handler_1.defaultFilterHandlers, schema: props.schema, state: props.state }),
|
package/data-grid.stories.js
CHANGED
|
@@ -101,6 +101,6 @@ function Default() {
|
|
|
101
101
|
});
|
|
102
102
|
return (react_1.default.createElement("div", { className: "p-10" },
|
|
103
103
|
react_1.default.createElement(radio_group_1.RadioGroup, { label: "Chov\u00E1n\u00ED p\u0159ep\u00EDn\u00E1n\u00ED tab\u016F", name: "filterBehavior", onChange: (value) => setFilterBehavior(value), options: FILTER_BEHAVIOR_OPTIONS, value: filterBehavior, variant: "row" }),
|
|
104
|
-
react_1.default.createElement(data_grid_1.DataGrid, { actionCell: actionCell, actions: actions, changeTabFilterBehavior: filterBehavior !== null && filterBehavior !== void 0 ? filterBehavior : "filtersPerTab", data: data, error: error, isLoading: isLoading, isRowSelectable: true,
|
|
104
|
+
react_1.default.createElement(data_grid_1.DataGrid, { actionCell: actionCell, actions: actions, changeTabFilterBehavior: filterBehavior !== null && filterBehavior !== void 0 ? filterBehavior : "filtersPerTab", data: data, error: error, getCsvDownloadUrl: () => "", isLoading: isLoading, isRowSelectable: true, reload: reload, schema: schemaWithFrontendConfig, state: state }),
|
|
105
105
|
react_1.default.createElement(json_renderer_1.JsonRenderer, { value: state })));
|
|
106
106
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { Schema } from "../types/schema";
|
|
2
|
+
import { CsvDownloadGetUrl, Schema } from "../types";
|
|
4
3
|
import { DataGridControl } from "../use-data-grid-control";
|
|
5
4
|
export interface DataGridExportButtonProps extends DataGridControl {
|
|
6
|
-
|
|
5
|
+
getCsvDownloadUrl: CsvDownloadGetUrl;
|
|
7
6
|
schema: Schema<any>;
|
|
8
7
|
}
|
|
9
8
|
export declare function DataGridExportButton(props: DataGridExportButtonProps): React.JSX.Element;
|
|
@@ -5,11 +5,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.DataGridExportButton = DataGridExportButton;
|
|
8
|
+
const download_file_1 = require("@uxf/core/utils/download-file");
|
|
8
9
|
const button_1 = require("@uxf/ui/button");
|
|
9
10
|
const icon_1 = require("@uxf/ui/icon");
|
|
10
11
|
const react_1 = __importDefault(require("react"));
|
|
11
12
|
const utils_1 = require("../utils");
|
|
12
13
|
function DataGridExportButton(props) {
|
|
13
|
-
return (react_1.default.createElement(button_1.Button, { className: "uxf-data-grid__plugin-button", isIconButton: true, onClick: () => props.
|
|
14
|
+
return (react_1.default.createElement(button_1.Button, { className: "uxf-data-grid__plugin-button", isIconButton: true, onClick: () => (0, download_file_1.downloadFile)(props.getCsvDownloadUrl((0, utils_1.createRequest)(props.state.request)), "export.csv"), size: "sm", title: "St\u00E1hnout CSV", variant: "secondary" },
|
|
14
15
|
react_1.default.createElement(icon_1.Icon, { name: "file-arrow-down" })));
|
|
15
16
|
}
|
|
@@ -12,6 +12,6 @@ const export_button_1 = require("./export-button");
|
|
|
12
12
|
function Default() {
|
|
13
13
|
const { state, actions } = (0, use_data_grid_control_1.useDataGridControl)({ schema: schema_1.schema });
|
|
14
14
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
15
|
-
react_1.default.createElement(export_button_1.DataGridExportButton, { actions: actions,
|
|
15
|
+
react_1.default.createElement(export_button_1.DataGridExportButton, { actions: actions, getCsvDownloadUrl: () => "", schema: schema_1.schema, state: state }),
|
|
16
16
|
react_1.default.createElement(json_renderer_1.JsonRenderer, { value: state })));
|
|
17
17
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxf/data-grid",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.68.2",
|
|
4
4
|
"description": "UXF DataGrid",
|
|
5
5
|
"homepage": "https://gitlab.com/uxf-npm/data-grid#readme",
|
|
6
6
|
"main": "index.js",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"typecheck": "tsc --noEmit --skipLibCheck"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@uxf/core": "11.
|
|
35
|
-
"@uxf/core-react": "11.
|
|
36
|
-
"@uxf/ui": "11.
|
|
34
|
+
"@uxf/core": "11.68.2",
|
|
35
|
+
"@uxf/core-react": "11.68.2",
|
|
36
|
+
"@uxf/ui": "11.68.2",
|
|
37
37
|
"dayjs": "1.11.13",
|
|
38
38
|
"deepmerge": "4.3.1",
|
|
39
39
|
"fast-glob": "3.3.2",
|
package/table-v2/styles.css
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Nullish } from "@uxf/core/types";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { FilterHandlers } from "../filter-handler";
|
|
4
|
-
import {
|
|
4
|
+
import { CsvDownloadGetUrl, Schema } from "../types";
|
|
5
5
|
import { DataGridControl } from "../use-data-grid-control";
|
|
6
6
|
export interface DataGridToolbarControlProps extends DataGridControl {
|
|
7
7
|
schema: Schema<any>;
|
|
8
8
|
filterHandlers: FilterHandlers;
|
|
9
|
-
|
|
9
|
+
getCsvDownloadUrl?: CsvDownloadGetUrl;
|
|
10
10
|
isBorderHidden?: boolean | Nullish;
|
|
11
11
|
fulltextInputPlaceholder?: string;
|
|
12
12
|
}
|
|
@@ -16,7 +16,7 @@ function DataGridToolbarControl(props) {
|
|
|
16
16
|
return (react_1.default.createElement("div", { className: "uxf-data-grid__toolbar-control" },
|
|
17
17
|
react_1.default.createElement(hide_1.Hide, { when: !props.schema.fullText },
|
|
18
18
|
react_1.default.createElement(fulltext_input_1.DataGridFulltextInput, { actions: props.actions, placeholder: props.fulltextInputPlaceholder, state: props.state })),
|
|
19
|
-
(0, is_not_nil_1.isNotNil)(props.
|
|
19
|
+
(0, is_not_nil_1.isNotNil)(props.getCsvDownloadUrl) && (react_1.default.createElement(export_button_1.DataGridExportButton, { actions: props.actions, getCsvDownloadUrl: props.getCsvDownloadUrl, schema: props.schema, state: props.state })),
|
|
20
20
|
react_1.default.createElement(hidden_columns_button_1.DataGridHiddenColumnsButton, { actions: props.actions, schema: props.schema, state: props.state }),
|
|
21
21
|
react_1.default.createElement(filters_button_1.DataGridFiltersButton, { actions: props.actions, filterHandlers: props.filterHandlers, schema: props.schema, state: props.state })));
|
|
22
22
|
}
|
|
@@ -14,6 +14,6 @@ function Default() {
|
|
|
14
14
|
const { state, actions } = (0, use_data_grid_control_1.useDataGridControl)({ schema: schema_1.schema });
|
|
15
15
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
16
16
|
react_1.default.createElement("div", { className: "flex flex-row" },
|
|
17
|
-
react_1.default.createElement(toolbar_control_1.DataGridToolbarControl, { actions: actions, filterHandlers: filter_handler_1.defaultFilterHandlers,
|
|
17
|
+
react_1.default.createElement(toolbar_control_1.DataGridToolbarControl, { actions: actions, filterHandlers: filter_handler_1.defaultFilterHandlers, getCsvDownloadUrl: () => "", schema: schema_1.schema, state: state })),
|
|
18
18
|
react_1.default.createElement(json_renderer_1.JsonRenderer, { value: state })));
|
|
19
19
|
}
|
package/types/core.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Nullish } from "@uxf/core/types";
|
|
|
2
2
|
import { Request, Response, ResultItem } from "./api";
|
|
3
3
|
import { BaseGridType } from "./schema";
|
|
4
4
|
export type KeyExtractor = (row: ResultItem) => number;
|
|
5
|
-
export type
|
|
5
|
+
export type CsvDownloadGetUrl = (request: Request) => string;
|
|
6
6
|
export type Loader = (gridName: string | undefined, request: Request, encodedRequest: string) => Promise<Response>;
|
|
7
7
|
export type CallbackRef = {
|
|
8
8
|
reload: () => Promise<any>;
|
|
@@ -7,7 +7,7 @@ import { DataGridToolbarCustomsProps } from "../toolbar-customs";
|
|
|
7
7
|
import { DataGridControl } from "../use-data-grid-control";
|
|
8
8
|
import { DataGridFetchingResult } from "../use-data-grid-fetching";
|
|
9
9
|
import { BodyCellComponents, ChangeTabFilterBehavior } from "./components";
|
|
10
|
-
import {
|
|
10
|
+
import { CsvDownloadGetUrl, KeyExtractor, RowAccent } from "./core";
|
|
11
11
|
import { BaseGridType, Schema } from "./schema";
|
|
12
12
|
export type DataGridControlProps = DataGridControl;
|
|
13
13
|
export type DataGridDataProps<Row> = DataGridFetchingResult<Row>;
|
|
@@ -15,7 +15,7 @@ export type DataGridBaseProps<GridType extends BaseGridType, Row> = {
|
|
|
15
15
|
schema: Schema<GridType>;
|
|
16
16
|
gridName?: string;
|
|
17
17
|
keyExtractor?: KeyExtractor;
|
|
18
|
-
|
|
18
|
+
getCsvDownloadUrl?: CsvDownloadGetUrl;
|
|
19
19
|
rowHeight?: number | ((row: Row) => number) | "auto";
|
|
20
20
|
headerRowHeight?: number;
|
|
21
21
|
rowAccent?: (row: Row) => RowAccent;
|
package/utils.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Request } from "./types
|
|
2
|
-
import { GridRequest } from "./types/state";
|
|
1
|
+
import { GridRequest, Request } from "./types";
|
|
3
2
|
export declare function decodeFilter(filterString: string): null | Request;
|
|
4
3
|
export declare function encodeFilter(request: Request): string;
|
|
5
4
|
export declare function createRequest(request: GridRequest, config?: {
|