@uxf/data-grid 11.36.0 → 11.37.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/_store/reducer.js +17 -14
- package/components.d.ts +0 -5
- package/components.js +0 -5
- package/data-grid-custom-example.stories.js +2 -2
- package/data-grid.js +7 -8
- package/data-grid.stories.js +3 -3
- package/export-button/export-button.d.ts +1 -3
- package/export-button/export-button.js +2 -5
- package/filter-list/filter-list.d.ts +2 -6
- package/filter-list/filter-list.js +2 -5
- package/filters/filters.d.ts +1 -3
- package/filters/filters.js +2 -5
- package/filters-button/filters-button.d.ts +1 -3
- package/filters-button/filters-button.js +2 -5
- package/footer/footer.d.ts +0 -2
- package/footer/footer.js +1 -3
- package/fulltext-input/fulltext-input.d.ts +1 -3
- package/fulltext-input/fulltext-input.js +2 -5
- package/linear-progress/linear-progress.d.ts +2 -6
- package/linear-progress/linear-progress.js +2 -5
- package/package.json +2 -2
- package/pagination/pagination.d.ts +2 -6
- package/pagination/pagination.js +2 -5
- package/root/root.d.ts +0 -2
- package/root/root.js +1 -2
- package/row-counts/row-counts.d.ts +2 -6
- package/row-counts/row-counts.js +2 -5
- package/rows-per-page-select/rows-per-page-select.d.ts +1 -3
- package/rows-per-page-select/rows-per-page-select.js +2 -5
- package/selected-rows-toolbar/selected-rows-toolbar.d.ts +2 -6
- package/selected-rows-toolbar/selected-rows-toolbar.js +2 -5
- package/styles.css +0 -8
- package/table/hooks/use-react-data-grid-columns.d.ts +2 -2
- package/table/hooks/use-react-data-grid-columns.js +1 -1
- package/table/table.d.ts +1 -3
- package/table/table.js +2 -5
- package/table/types.d.ts +1 -3
- package/table-v2/hooks/use-resizable-columns.js +5 -1
- package/table-v2/table-v2.d.ts +1 -3
- package/table-v2/table-v2.js +7 -6
- package/table-v2/types.d.ts +1 -3
- package/table-v2/utils/get-grid-template-columns.d.ts +5 -1
- package/table-v2/utils/get-grid-template-columns.js +5 -4
- package/table-v2/utils/get-grid-template-rows.d.ts +2 -2
- package/toolbar/toolbar.d.ts +0 -1
- package/toolbar/toolbar.js +1 -3
- package/toolbar-control/toolbar-control.d.ts +2 -6
- package/toolbar-control/toolbar-control.js +2 -5
- package/toolbar-customs/toolbar-customs.d.ts +2 -6
- package/toolbar-customs/toolbar-customs.js +2 -5
- package/toolbar-tabs/toolbar-tabs.d.ts +4 -6
- package/toolbar-tabs/toolbar-tabs.js +8 -10
- package/types/components.d.ts +1 -0
- package/types/data-grid-props.d.ts +2 -3
- package/types/index.d.ts +6 -6
- package/types/index.js +0 -20
- package/types/schema.d.ts +0 -5
- package/types/schema.js +0 -7
- package/use-data-grid-control/actions-factory.d.ts +2 -1
- package/use-data-grid-control/actions-factory.js +1 -1
- package/use-data-grid-control/use-data-grid-control.d.ts +1 -1
- package/data-grid-v2.d.ts +0 -3
- package/data-grid-v2.js +0 -43
- package/data-grid-v2.stories.d.ts +0 -2
- package/data-grid-v2.stories.js +0 -92
- package/utils/classes.d.ts +0 -1
- package/utils/classes.js +0 -4
package/_store/reducer.js
CHANGED
|
@@ -118,28 +118,31 @@ const reducer = (state, action) => {
|
|
|
118
118
|
page: 0,
|
|
119
119
|
},
|
|
120
120
|
};
|
|
121
|
-
case "CHANGE_TAB":
|
|
122
|
-
// eslint-disable-next-line
|
|
121
|
+
case "CHANGE_TAB": {
|
|
122
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
123
123
|
const tabHistory = (_d = state.tabRequests[action.tab.name]) !== null && _d !== void 0 ? _d : {};
|
|
124
124
|
return {
|
|
125
125
|
...state,
|
|
126
|
-
request:
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
126
|
+
request: action.filterBehavior === "sharedFilters"
|
|
127
|
+
? { ...state.request, tab: action.tab.name }
|
|
128
|
+
: {
|
|
129
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
130
|
+
f: (_e = tabHistory.f) !== null && _e !== void 0 ? _e : [],
|
|
131
|
+
s: (_g = (_f = tabHistory.s) !== null && _f !== void 0 ? _f : action.tab.s) !== null && _g !== void 0 ? _g : state.request.s,
|
|
132
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
133
|
+
search: (_h = tabHistory.search) !== null && _h !== void 0 ? _h : "",
|
|
134
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
135
|
+
page: (_j = tabHistory.page) !== null && _j !== void 0 ? _j : 0,
|
|
136
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
137
|
+
perPage: (_k = tabHistory.perPage) !== null && _k !== void 0 ? _k : state.request.perPage,
|
|
138
|
+
tab: action.tab.name,
|
|
139
|
+
},
|
|
138
140
|
tabRequests: {
|
|
139
141
|
...state.tabRequests,
|
|
140
142
|
[(_l = state.request.tab) !== null && _l !== void 0 ? _l : "__DEFAULT_TAB__"]: state.request,
|
|
141
143
|
},
|
|
142
144
|
};
|
|
145
|
+
}
|
|
143
146
|
case "SET_SELECTED_ROWS":
|
|
144
147
|
return {
|
|
145
148
|
...state,
|
package/components.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as dataGridStories from "./data-grid.stories";
|
|
2
2
|
import * as dataGridCustomExampleStories from "./data-grid-custom-example.stories";
|
|
3
|
-
import * as dataGridV2Stories from "./data-grid-v2.stories";
|
|
4
3
|
import * as exportButtonStories from "./export-button/export-button.stories";
|
|
5
4
|
import * as filterListStories from "./filter-list/filter-list.stories";
|
|
6
5
|
import * as filtersStories from "./filters/filters.stories";
|
|
@@ -26,10 +25,6 @@ export declare const components: {
|
|
|
26
25
|
readonly title: "DataGridCustomExample";
|
|
27
26
|
readonly stories: typeof dataGridCustomExampleStories;
|
|
28
27
|
};
|
|
29
|
-
readonly "data-grid-v2": {
|
|
30
|
-
readonly title: "DataGridV2";
|
|
31
|
-
readonly stories: typeof dataGridV2Stories;
|
|
32
|
-
};
|
|
33
28
|
readonly "export-button": {
|
|
34
29
|
readonly title: "ExportButton";
|
|
35
30
|
readonly stories: typeof exportButtonStories;
|
package/components.js
CHANGED
|
@@ -27,7 +27,6 @@ exports.components = void 0;
|
|
|
27
27
|
// generated file
|
|
28
28
|
const dataGridStories = __importStar(require("./data-grid.stories"));
|
|
29
29
|
const dataGridCustomExampleStories = __importStar(require("./data-grid-custom-example.stories"));
|
|
30
|
-
const dataGridV2Stories = __importStar(require("./data-grid-v2.stories"));
|
|
31
30
|
const exportButtonStories = __importStar(require("./export-button/export-button.stories"));
|
|
32
31
|
const filterListStories = __importStar(require("./filter-list/filter-list.stories"));
|
|
33
32
|
const filtersStories = __importStar(require("./filters/filters.stories"));
|
|
@@ -53,10 +52,6 @@ exports.components = {
|
|
|
53
52
|
title: "DataGridCustomExample",
|
|
54
53
|
stories: dataGridCustomExampleStories
|
|
55
54
|
},
|
|
56
|
-
"data-grid-v2": {
|
|
57
|
-
title: "DataGridV2",
|
|
58
|
-
stories: dataGridV2Stories
|
|
59
|
-
},
|
|
60
55
|
"export-button": {
|
|
61
56
|
title: "ExportButton",
|
|
62
57
|
stories: exportButtonStories
|
|
@@ -18,7 +18,7 @@ const root_1 = require("./root");
|
|
|
18
18
|
const row_counts_1 = require("./row-counts");
|
|
19
19
|
const rows_per_page_select_1 = require("./rows-per-page-select");
|
|
20
20
|
const selected_rows_toolbar_1 = require("./selected-rows-toolbar");
|
|
21
|
-
const
|
|
21
|
+
const table_v2_1 = require("./table-v2");
|
|
22
22
|
const toolbar_1 = require("./toolbar");
|
|
23
23
|
const toolbar_control_1 = require("./toolbar-control");
|
|
24
24
|
const toolbar_customs_1 = require("./toolbar-customs");
|
|
@@ -48,7 +48,7 @@ function DataGrid() {
|
|
|
48
48
|
react_1.default.createElement(toolbar_customs_1.DataGridToolbarCustoms, { buttons: toolbarCustomButtons })),
|
|
49
49
|
react_1.default.createElement(linear_progress_1.DataGridLinearProgress, { isLoading: isLoading }),
|
|
50
50
|
react_1.default.createElement(filter_list_1.DataGridFilterList, { ...control, filterHandlers: filterHandlers, schema: schema }),
|
|
51
|
-
react_1.default.createElement(
|
|
51
|
+
react_1.default.createElement(table_v2_1.DataGridTableV2, { ...control, actionCell: actionCell, bodyCells: bodyCells, data: (_a = data === null || data === void 0 ? void 0 : data.result) !== null && _a !== void 0 ? _a : empty_array_1.EMPTY_ARRAY, error: error, isLoading: isLoading, onReload: onReload, schema: schema }),
|
|
52
52
|
react_1.default.createElement(footer_1.DataGridFooter, null,
|
|
53
53
|
react_1.default.createElement(rows_per_page_select_1.DataGridRowsPerPageSelect, { ...control }),
|
|
54
54
|
react_1.default.createElement(row_counts_1.DataGridRowCounts, { ...control, count: (_b = data === null || data === void 0 ? void 0 : data.count) !== null && _b !== void 0 ? _b : 0, totalCount: (_c = data === null || data === void 0 ? void 0 : data.totalCount) !== null && _c !== void 0 ? _c : 0 }),
|
package/data-grid.js
CHANGED
|
@@ -16,26 +16,25 @@ const root_1 = require("./root");
|
|
|
16
16
|
const row_counts_1 = require("./row-counts");
|
|
17
17
|
const rows_per_page_select_1 = require("./rows-per-page-select");
|
|
18
18
|
const selected_rows_toolbar_1 = require("./selected-rows-toolbar");
|
|
19
|
-
const
|
|
19
|
+
const table_v2_1 = require("./table-v2");
|
|
20
20
|
const no_rows_fallback_1 = require("./table/no-rows-fallback");
|
|
21
21
|
const toolbar_1 = require("./toolbar");
|
|
22
22
|
const toolbar_control_1 = require("./toolbar-control");
|
|
23
23
|
const toolbar_customs_1 = require("./toolbar-customs");
|
|
24
24
|
const toolbar_tabs_1 = require("./toolbar-tabs");
|
|
25
|
-
const classes_1 = require("./utils/classes");
|
|
26
25
|
const DefaultSelectedRowsToolbarActions = () => null;
|
|
27
26
|
function DataGrid(props) {
|
|
28
27
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
29
28
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
30
|
-
react_1.default.createElement(root_1.DataGridRoot, { className: props.className
|
|
31
|
-
react_1.default.createElement(toolbar_1.DataGridToolbar,
|
|
32
|
-
react_1.default.createElement(toolbar_tabs_1.DataGridToolbarTabs, { actions: props.actions, schema: props.schema, state: props.state }),
|
|
29
|
+
react_1.default.createElement(root_1.DataGridRoot, { className: props.className },
|
|
30
|
+
react_1.default.createElement(toolbar_1.DataGridToolbar, null,
|
|
31
|
+
react_1.default.createElement(toolbar_tabs_1.DataGridToolbarTabs, { actions: props.actions, changeTabFilterBehavior: props.changeTabFilterBehavior, schema: props.schema, state: props.state }),
|
|
33
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, onCsvDownload: props.onCsvDownload, schema: props.schema, state: props.state }),
|
|
34
33
|
react_1.default.createElement(toolbar_customs_1.DataGridToolbarCustoms, { buttons: props.customActions })),
|
|
35
34
|
react_1.default.createElement(linear_progress_1.DataGridLinearProgress, { isLoading: props.isLoading }),
|
|
36
|
-
react_1.default.createElement(filter_list_1.DataGridFilterList, { actions: props.actions,
|
|
37
|
-
react_1.default.createElement(
|
|
38
|
-
react_1.default.createElement(footer_1.DataGridFooter,
|
|
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 }),
|
|
36
|
+
react_1.default.createElement(table_v2_1.DataGridTableV2, { NoRowsFallback: (_c = props.NoRowsFallback) !== null && _c !== void 0 ? _c : no_rows_fallback_1.NoRowsFallback, actionCell: props.actionCell, actions: props.actions, bodyCells: (_d = props.bodyCells) !== null && _d !== void 0 ? _d : body_cell_1.BodyCells, data: (_f = (_e = props.data) === null || _e === void 0 ? void 0 : _e.result) !== null && _f !== void 0 ? _f : empty_array_1.EMPTY_ARRAY, error: props.error, headerRowHeight: props.headerRowHeight, isLoading: props.isLoading, isRowSelectable: props.isRowSelectable, keyExtractor: props.keyExtractor, onReload: props.onReload, rowClass: props.rowClass, rowHeight: props.rowHeight, schema: props.schema, state: props.state }),
|
|
37
|
+
react_1.default.createElement(footer_1.DataGridFooter, null,
|
|
39
38
|
react_1.default.createElement(rows_per_page_select_1.DataGridRowsPerPageSelect, { actions: props.actions, state: props.state }),
|
|
40
39
|
react_1.default.createElement(row_counts_1.DataGridRowCounts, { count: (_h = (_g = props.data) === null || _g === void 0 ? void 0 : _g.count) !== null && _h !== void 0 ? _h : 0, state: props.state, totalCount: (_k = (_j = props.data) === null || _j === void 0 ? void 0 : _j.totalCount) !== null && _k !== void 0 ? _k : 0 }),
|
|
41
40
|
react_1.default.createElement(pagination_1.DataGridPagination, { actions: props.actions, count: (_m = (_l = props.data) === null || _l === void 0 ? void 0 : _l.count) !== null && _m !== void 0 ? _m : 0, showFirstButton: true, showLastButton: true, size: "sm", state: props.state }))),
|
package/data-grid.stories.js
CHANGED
|
@@ -68,7 +68,7 @@ const schemaWithFrontendConfig = (0, merge_schema_with_config_1.mergeSchemaWithC
|
|
|
68
68
|
},
|
|
69
69
|
});
|
|
70
70
|
function Default() {
|
|
71
|
-
const [
|
|
71
|
+
const [hasSharedFilters, setHasSharedFilters] = (0, react_1.useState)(false);
|
|
72
72
|
const { state, actions } = (0, use_data_grid_control_1.useDataGridControl)({
|
|
73
73
|
schema: schema_1.schema,
|
|
74
74
|
initialUserConfig: {
|
|
@@ -86,7 +86,7 @@ function Default() {
|
|
|
86
86
|
state,
|
|
87
87
|
});
|
|
88
88
|
return (react_1.default.createElement("div", { className: "p-10" },
|
|
89
|
-
react_1.default.createElement(toggle_1.Toggle, { label: "
|
|
90
|
-
react_1.default.createElement(data_grid_1.DataGrid, { actionCell: actionCell, actions: actions, data: data, error: error, isLoading: isLoading, isRowSelectable: true,
|
|
89
|
+
react_1.default.createElement(toggle_1.Toggle, { label: "Has shared Filters for all Tabs", name: "hasSharedFilters", onChange: (value) => setHasSharedFilters(Boolean(value)), value: hasSharedFilters }),
|
|
90
|
+
react_1.default.createElement(data_grid_1.DataGrid, { actionCell: actionCell, actions: actions, changeTabFilterBehavior: hasSharedFilters ? "sharedFilters" : "filtersPerTab", data: data, error: error, isLoading: isLoading, isRowSelectable: true, onCsvDownload: console.log, onReload: onReload, schema: schemaWithFrontendConfig, state: state }),
|
|
91
91
|
react_1.default.createElement(json_renderer_1.JsonRenderer, { value: state })));
|
|
92
92
|
}
|
|
@@ -6,6 +6,4 @@ export interface DataGridExportButtonProps extends DataGridControl {
|
|
|
6
6
|
onCsvDownload: CsvDownloadHandler;
|
|
7
7
|
schema: Schema<any>;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
export declare function ExportButton(props: DataGridExportButtonProps): React.JSX.Element;
|
|
11
|
-
export declare const DataGridExportButton: typeof ExportButton;
|
|
9
|
+
export declare function DataGridExportButton(props: DataGridExportButtonProps): React.JSX.Element;
|
|
@@ -3,15 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.DataGridExportButton =
|
|
7
|
-
exports.ExportButton = ExportButton;
|
|
6
|
+
exports.DataGridExportButton = DataGridExportButton;
|
|
8
7
|
const button_1 = require("@uxf/ui/button");
|
|
9
8
|
const icon_1 = require("@uxf/ui/icon");
|
|
10
9
|
const react_1 = __importDefault(require("react"));
|
|
11
10
|
const utils_1 = require("../utils");
|
|
12
|
-
|
|
13
|
-
function ExportButton(props) {
|
|
11
|
+
function DataGridExportButton(props) {
|
|
14
12
|
return (react_1.default.createElement(button_1.Button, { className: "uxf-data-grid__plugin-button", isIconButton: true, onClick: () => props.onCsvDownload((0, utils_1.createRequest)(props.state.request)), size: "sm", title: "St\u00E1hnout CSV", variant: "secondary" },
|
|
15
13
|
react_1.default.createElement(icon_1.Icon, { name: "file-arrow-down" })));
|
|
16
14
|
}
|
|
17
|
-
exports.DataGridExportButton = ExportButton;
|
|
@@ -2,13 +2,9 @@ import React from "react";
|
|
|
2
2
|
import { FilterHandlers } from "../filter-handler";
|
|
3
3
|
import { Schema } from "../types";
|
|
4
4
|
import { DataGridControl } from "../use-data-grid-control";
|
|
5
|
-
|
|
6
|
-
export interface FilterListProps extends DataGridControl {
|
|
5
|
+
export interface DataGridFilterListProps extends DataGridControl {
|
|
7
6
|
filterHandlers: FilterHandlers;
|
|
8
7
|
className?: string;
|
|
9
8
|
schema: Schema<any>;
|
|
10
9
|
}
|
|
11
|
-
export
|
|
12
|
-
/** @deprecated Use DataGridFilterList */
|
|
13
|
-
export declare function FilterList(props: FilterListProps): React.JSX.Element | null;
|
|
14
|
-
export declare const DataGridFilterList: typeof FilterList;
|
|
10
|
+
export declare function DataGridFilterList(props: DataGridFilterListProps): React.JSX.Element | null;
|
|
@@ -3,15 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.DataGridFilterList =
|
|
7
|
-
exports.FilterList = FilterList;
|
|
6
|
+
exports.DataGridFilterList = DataGridFilterList;
|
|
8
7
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
9
8
|
const is_empty_1 = require("@uxf/core/utils/is-empty");
|
|
10
9
|
const is_nil_1 = require("@uxf/core/utils/is-nil");
|
|
11
10
|
const react_1 = __importDefault(require("react"));
|
|
12
11
|
const create_filter_component_props_1 = require("../utils/create-filter-component-props");
|
|
13
|
-
|
|
14
|
-
function FilterList(props) {
|
|
12
|
+
function DataGridFilterList(props) {
|
|
15
13
|
const renderedFilters = props.state.request.f
|
|
16
14
|
.map((filterRequest) => {
|
|
17
15
|
const filter = props.schema.filters.find((f) => f.name === filterRequest.name);
|
|
@@ -31,4 +29,3 @@ function FilterList(props) {
|
|
|
31
29
|
}
|
|
32
30
|
return react_1.default.createElement("div", { className: (0, cx_1.cx)("uxf-data-grid__filter-list", props.className) }, renderedFilters);
|
|
33
31
|
}
|
|
34
|
-
exports.DataGridFilterList = FilterList;
|
package/filters/filters.d.ts
CHANGED
|
@@ -6,6 +6,4 @@ export interface DataGridFiltersProps extends DataGridControl {
|
|
|
6
6
|
schema: Schema<any>;
|
|
7
7
|
filterHandlers: FilterHandlers;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
export declare function Filters(props: DataGridFiltersProps): React.JSX.Element;
|
|
11
|
-
export declare const DataGridFilters: typeof Filters;
|
|
9
|
+
export declare function DataGridFilters(props: DataGridFiltersProps): React.JSX.Element;
|
package/filters/filters.js
CHANGED
|
@@ -3,12 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.DataGridFilters =
|
|
7
|
-
exports.Filters = Filters;
|
|
6
|
+
exports.DataGridFilters = DataGridFilters;
|
|
8
7
|
const react_1 = __importDefault(require("react"));
|
|
9
8
|
const create_filter_component_props_1 = require("../utils/create-filter-component-props");
|
|
10
|
-
|
|
11
|
-
function Filters(props) {
|
|
9
|
+
function DataGridFilters(props) {
|
|
12
10
|
return (react_1.default.createElement("div", { className: "uxf-data-grid__filters" }, props.schema.filters.map((filter) => {
|
|
13
11
|
const filterHandler = props.filterHandlers[filter.type];
|
|
14
12
|
const FilterInput = filterHandler === null || filterHandler === void 0 ? void 0 : filterHandler.Input;
|
|
@@ -21,4 +19,3 @@ function Filters(props) {
|
|
|
21
19
|
return (react_1.default.createElement(FilterInput, { key: filter.name, ...(0, create_filter_component_props_1.createFilterComponentProps)(props.schema.name, filter, props.state, props.actions) }));
|
|
22
20
|
})));
|
|
23
21
|
}
|
|
24
|
-
exports.DataGridFilters = Filters;
|
|
@@ -7,6 +7,4 @@ export interface DataGridFiltersButtonProps extends DataGridControl {
|
|
|
7
7
|
filterHandlers: FilterHandlers;
|
|
8
8
|
schema: Schema<any>;
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
export declare function FiltersButton(props: DataGridFiltersButtonProps): React.JSX.Element | null;
|
|
12
|
-
export declare const DataGridFiltersButton: typeof FiltersButton;
|
|
10
|
+
export declare function DataGridFiltersButton(props: DataGridFiltersButtonProps): React.JSX.Element | null;
|
|
@@ -23,15 +23,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.DataGridFiltersButton =
|
|
27
|
-
exports.FiltersButton = FiltersButton;
|
|
26
|
+
exports.DataGridFiltersButton = DataGridFiltersButton;
|
|
28
27
|
const button_1 = require("@uxf/ui/button");
|
|
29
28
|
const icon_1 = require("@uxf/ui/icon");
|
|
30
29
|
const react_1 = __importStar(require("react"));
|
|
31
30
|
const drawer_1 = require("../_components/drawer");
|
|
32
31
|
const filters_1 = require("../filters");
|
|
33
|
-
|
|
34
|
-
function FiltersButton(props) {
|
|
32
|
+
function DataGridFiltersButton(props) {
|
|
35
33
|
var _a;
|
|
36
34
|
const [isOpen, setIsOpen] = (0, react_1.useState)(false);
|
|
37
35
|
if (props.schema.filters.length === 0) {
|
|
@@ -43,4 +41,3 @@ function FiltersButton(props) {
|
|
|
43
41
|
react_1.default.createElement(drawer_1.Drawer, { isOpen: isOpen, onClose: () => setIsOpen(false), title: (_a = props.drawerTitle) !== null && _a !== void 0 ? _a : "Filtrování" },
|
|
44
42
|
react_1.default.createElement(filters_1.DataGridFilters, { actions: props.actions, filterHandlers: props.filterHandlers, schema: props.schema, state: props.state }))));
|
|
45
43
|
}
|
|
46
|
-
exports.DataGridFiltersButton = FiltersButton;
|
package/footer/footer.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React, { ReactNode } from "react";
|
|
2
2
|
export interface DataGridFooterProps {
|
|
3
|
-
/** @deprecated will be remove, create custom data grid https://fe.uxf.dev/docs/data-grid/data-grid-custom-example */
|
|
4
|
-
noBorder?: boolean;
|
|
5
3
|
children: ReactNode;
|
|
6
4
|
}
|
|
7
5
|
export declare function DataGridFooter(props: DataGridFooterProps): React.JSX.Element;
|
package/footer/footer.js
CHANGED
|
@@ -4,9 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.DataGridFooter = DataGridFooter;
|
|
7
|
-
const cx_1 = require("@uxf/core/utils/cx");
|
|
8
7
|
const react_1 = __importDefault(require("react"));
|
|
9
|
-
const classes_1 = require("../utils/classes");
|
|
10
8
|
function DataGridFooter(props) {
|
|
11
|
-
return react_1.default.createElement("div", { className:
|
|
9
|
+
return react_1.default.createElement("div", { className: "uxf-data-grid__footer" }, props.children);
|
|
12
10
|
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { DataGridControl } from "../use-data-grid-control";
|
|
3
3
|
export type DataGridFulltextInputProps = DataGridControl;
|
|
4
|
-
|
|
5
|
-
export declare function FulltextInput(props: DataGridFulltextInputProps): React.JSX.Element;
|
|
6
|
-
export declare const DataGridFulltextInput: typeof FulltextInput;
|
|
4
|
+
export declare function DataGridFulltextInput(props: DataGridFulltextInputProps): React.JSX.Element;
|
|
@@ -3,13 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.DataGridFulltextInput =
|
|
7
|
-
exports.FulltextInput = FulltextInput;
|
|
6
|
+
exports.DataGridFulltextInput = DataGridFulltextInput;
|
|
8
7
|
const icon_1 = require("@uxf/ui/icon");
|
|
9
8
|
const text_input_1 = require("@uxf/ui/text-input");
|
|
10
9
|
const react_1 = __importDefault(require("react"));
|
|
11
|
-
|
|
12
|
-
function FulltextInput(props) {
|
|
10
|
+
function DataGridFulltextInput(props) {
|
|
13
11
|
return (react_1.default.createElement(text_input_1.TextInput, { className: "uxf-data-grid__plugin-fulltext", hiddenLabel: true, label: "Vyhled\u00E1v\u00E1n\u00ED", leftElement: react_1.default.createElement(icon_1.Icon, { name: "search", size: 16 }), name: "fulltext", onChange: props.actions.search, placeholder: "Pi\u0161te pro hled\u00E1n\u00ED", size: "small", value: props.state.request.search }));
|
|
14
12
|
}
|
|
15
|
-
exports.DataGridFulltextInput = FulltextInput;
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
3
|
-
export interface LinearProgressProps {
|
|
2
|
+
export interface DataGridLinearProgressProps {
|
|
4
3
|
isLoading: boolean;
|
|
5
4
|
}
|
|
6
|
-
export
|
|
7
|
-
/** @deprecated Use DataGridLinearProgress */
|
|
8
|
-
export declare function LinearProgress(props: LinearProgressProps): React.JSX.Element;
|
|
9
|
-
export declare const DataGridLinearProgress: typeof LinearProgress;
|
|
5
|
+
export declare function DataGridLinearProgress(props: DataGridLinearProgressProps): React.JSX.Element;
|
|
@@ -3,13 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.DataGridLinearProgress =
|
|
7
|
-
exports.LinearProgress = LinearProgress;
|
|
6
|
+
exports.DataGridLinearProgress = DataGridLinearProgress;
|
|
8
7
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
9
8
|
const react_1 = __importDefault(require("react"));
|
|
10
|
-
|
|
11
|
-
function LinearProgress(props) {
|
|
9
|
+
function DataGridLinearProgress(props) {
|
|
12
10
|
return (react_1.default.createElement("div", { className: "uxf-data-grid__linear-progress-wrapper" },
|
|
13
11
|
react_1.default.createElement("div", { className: (0, cx_1.cx)("uxf-data-grid__linear-progress", props.isLoading && "is-loading") })));
|
|
14
12
|
}
|
|
15
|
-
exports.DataGridLinearProgress = LinearProgress;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxf/data-grid",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.37.0",
|
|
4
4
|
"description": "UXF DataGrid",
|
|
5
5
|
"homepage": "https://gitlab.com/uxf-npm/data-grid#readme",
|
|
6
6
|
"main": "index.js",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@uxf/core": "11.35.0",
|
|
35
35
|
"@uxf/core-react": "11.36.0",
|
|
36
|
-
"@uxf/ui": "11.
|
|
36
|
+
"@uxf/ui": "11.37.0",
|
|
37
37
|
"dayjs": "1.11.13",
|
|
38
38
|
"deepmerge": "4.3.1",
|
|
39
39
|
"fast-glob": "3.3.2",
|
|
@@ -2,15 +2,11 @@ import { Nullish } from "@uxf/core/types";
|
|
|
2
2
|
import { PaginationSizes } from "@uxf/ui/pagination/theme";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { DataGridControl } from "../use-data-grid-control";
|
|
5
|
-
|
|
6
|
-
interface PaginationProps extends DataGridControl {
|
|
5
|
+
interface DataGridPaginationProps extends DataGridControl {
|
|
7
6
|
count: number | Nullish;
|
|
8
7
|
showFirstButton?: boolean;
|
|
9
8
|
showLastButton?: boolean;
|
|
10
9
|
size?: keyof PaginationSizes;
|
|
11
10
|
}
|
|
12
|
-
export
|
|
13
|
-
/** @deprecated Use DataGridPagination */
|
|
14
|
-
export declare function Pagination(props: PaginationProps): React.JSX.Element;
|
|
15
|
-
export declare const DataGridPagination: typeof Pagination;
|
|
11
|
+
export declare function DataGridPagination(props: DataGridPaginationProps): React.JSX.Element;
|
|
16
12
|
export {};
|
package/pagination/pagination.js
CHANGED
|
@@ -3,16 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.DataGridPagination =
|
|
7
|
-
exports.Pagination = Pagination;
|
|
6
|
+
exports.DataGridPagination = DataGridPagination;
|
|
8
7
|
const is_not_nil_1 = require("@uxf/core/utils/is-not-nil");
|
|
9
8
|
const pagination_1 = require("@uxf/ui/pagination");
|
|
10
9
|
const react_1 = __importDefault(require("react"));
|
|
11
|
-
|
|
12
|
-
function Pagination(props) {
|
|
10
|
+
function DataGridPagination(props) {
|
|
13
11
|
const pageCount = (0, is_not_nil_1.isNotNil)(props.count) && props.count > 0
|
|
14
12
|
? Math.max(Math.ceil(props.count / props.state.request.perPage), 1)
|
|
15
13
|
: 1;
|
|
16
14
|
return (react_1.default.createElement(pagination_1.Pagination, { count: pageCount, onPageChange: (value) => props.actions.changePage(value - 1), page: props.state.request.page + 1, showFirstButton: props.showFirstButton, showLastButton: props.showLastButton, size: props.size }));
|
|
17
15
|
}
|
|
18
|
-
exports.DataGridPagination = Pagination;
|
package/root/root.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from "react";
|
|
2
2
|
export interface DataGridRootProps {
|
|
3
3
|
children: ReactNode;
|
|
4
|
-
/** @deprecated will be remove, create custom data grid https://fe.uxf.dev/docs/data-grid/data-grid-custom-example */
|
|
5
|
-
noBorder?: boolean;
|
|
6
4
|
className?: string;
|
|
7
5
|
}
|
|
8
6
|
export declare function DataGridRoot(props: DataGridRootProps): React.JSX.Element;
|
package/root/root.js
CHANGED
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.DataGridRoot = DataGridRoot;
|
|
7
7
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
|
-
const classes_1 = require("../utils/classes");
|
|
10
9
|
function DataGridRoot(props) {
|
|
11
|
-
return
|
|
10
|
+
return react_1.default.createElement("div", { className: (0, cx_1.cx)("uxf-data-grid", props.className) }, props.children);
|
|
12
11
|
}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { DataGridControl } from "../use-data-grid-control";
|
|
3
|
-
|
|
4
|
-
export interface RowCountsProps {
|
|
3
|
+
export interface DataGridRowCountsProps {
|
|
5
4
|
state: DataGridControl["state"];
|
|
6
5
|
totalCount: number;
|
|
7
6
|
count: number;
|
|
8
7
|
}
|
|
9
|
-
export
|
|
10
|
-
/** @deprecated Use DataGridRowCounts */
|
|
11
|
-
export declare function RowCounts(props: RowCountsProps): React.JSX.Element;
|
|
12
|
-
export declare const DataGridRowCounts: typeof RowCounts;
|
|
8
|
+
export declare function DataGridRowCounts(props: DataGridRowCountsProps): React.JSX.Element;
|
package/row-counts/row-counts.js
CHANGED
|
@@ -3,12 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.DataGridRowCounts =
|
|
7
|
-
exports.RowCounts = RowCounts;
|
|
6
|
+
exports.DataGridRowCounts = DataGridRowCounts;
|
|
8
7
|
const show_1 = require("@uxf/core-react/components/show");
|
|
9
8
|
const react_1 = __importDefault(require("react"));
|
|
10
|
-
|
|
11
|
-
function RowCounts(props) {
|
|
9
|
+
function DataGridRowCounts(props) {
|
|
12
10
|
const fromNumber = props.state.request.page * props.state.request.perPage + 1;
|
|
13
11
|
const toNumber = Math.min(props.state.request.page * props.state.request.perPage + props.state.request.perPage, props.totalCount);
|
|
14
12
|
return (react_1.default.createElement("p", { className: "uxf-data-grid__pagination-counts" },
|
|
@@ -23,4 +21,3 @@ function RowCounts(props) {
|
|
|
23
21
|
props.totalCount,
|
|
24
22
|
")")));
|
|
25
23
|
}
|
|
26
|
-
exports.DataGridRowCounts = RowCounts;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { DataGridControl } from "../use-data-grid-control";
|
|
3
|
-
|
|
4
|
-
export declare function RowsPerPageSelect(props: DataGridControl): React.JSX.Element;
|
|
5
|
-
export declare const DataGridRowsPerPageSelect: typeof RowsPerPageSelect;
|
|
3
|
+
export declare function DataGridRowsPerPageSelect(props: DataGridControl): React.JSX.Element;
|
|
@@ -3,8 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.DataGridRowsPerPageSelect =
|
|
7
|
-
exports.RowsPerPageSelect = RowsPerPageSelect;
|
|
6
|
+
exports.DataGridRowsPerPageSelect = DataGridRowsPerPageSelect;
|
|
8
7
|
const select_1 = require("@uxf/ui/select");
|
|
9
8
|
const react_1 = __importDefault(require("react"));
|
|
10
9
|
const PER_PAGE_OPTIONS = [
|
|
@@ -13,10 +12,8 @@ const PER_PAGE_OPTIONS = [
|
|
|
13
12
|
{ id: 50, label: "50" },
|
|
14
13
|
{ id: 100, label: "100" },
|
|
15
14
|
];
|
|
16
|
-
|
|
17
|
-
function RowsPerPageSelect(props) {
|
|
15
|
+
function DataGridRowsPerPageSelect(props) {
|
|
18
16
|
return (react_1.default.createElement("div", { className: "uxf-data-grid__rows-per-page" },
|
|
19
17
|
react_1.default.createElement("label", { htmlFor: "uxf-data-grid--select-per-page" }, "Po\u010Det \u0159\u00E1dk\u016F"),
|
|
20
18
|
react_1.default.createElement(select_1.Select, { hiddenLabel: true, id: "uxf-data-grid--select-per-page", label: "Po\u010Det \u0159\u00E1dk\u016F", name: "rows-per-page", onChange: (value) => props.actions.changePerPage(value !== null && value !== void 0 ? value : 10), options: PER_PAGE_OPTIONS, size: "small", value: props.state.request.perPage })));
|
|
21
19
|
}
|
|
22
|
-
exports.DataGridRowsPerPageSelect = RowsPerPageSelect;
|
|
@@ -4,12 +4,8 @@ export interface SelectedRowsToolbarActionsProps extends DataGridControl {
|
|
|
4
4
|
reload: () => void;
|
|
5
5
|
}
|
|
6
6
|
export type SelectedRowsToolbarActionsComponent = FC<SelectedRowsToolbarActionsProps>;
|
|
7
|
-
|
|
8
|
-
export interface SelectedRowsToolbarProps extends DataGridControl {
|
|
7
|
+
export interface DataGridSelectedRowsToolbarProps extends DataGridControl {
|
|
9
8
|
Actions?: SelectedRowsToolbarActionsComponent;
|
|
10
9
|
onReload?: () => void;
|
|
11
10
|
}
|
|
12
|
-
export
|
|
13
|
-
/** @deprecated Use DataGridSelectedRowsToolbar */
|
|
14
|
-
export declare function SelectedRowsToolbar(props: SelectedRowsToolbarProps): React.JSX.Element | null;
|
|
15
|
-
export declare const DataGridSelectedRowsToolbar: typeof SelectedRowsToolbar;
|
|
11
|
+
export declare function DataGridSelectedRowsToolbar(props: DataGridSelectedRowsToolbarProps): React.JSX.Element | null;
|
|
@@ -3,8 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.DataGridSelectedRowsToolbar =
|
|
7
|
-
exports.SelectedRowsToolbar = SelectedRowsToolbar;
|
|
6
|
+
exports.DataGridSelectedRowsToolbar = DataGridSelectedRowsToolbar;
|
|
8
7
|
const button_1 = require("@uxf/ui/button");
|
|
9
8
|
const react_1 = __importDefault(require("react"));
|
|
10
9
|
const getText = (count) => {
|
|
@@ -16,8 +15,7 @@ const getText = (count) => {
|
|
|
16
15
|
}
|
|
17
16
|
return `Vybráno ${count} záznamů`;
|
|
18
17
|
};
|
|
19
|
-
|
|
20
|
-
function SelectedRowsToolbar(props) {
|
|
18
|
+
function DataGridSelectedRowsToolbar(props) {
|
|
21
19
|
if (!props.state.selectedRows) {
|
|
22
20
|
return null;
|
|
23
21
|
}
|
|
@@ -31,4 +29,3 @@ function SelectedRowsToolbar(props) {
|
|
|
31
29
|
props.Actions && (react_1.default.createElement(props.Actions, { actions: props.actions, reload: () => { var _a; return (_a = props.onReload) === null || _a === void 0 ? void 0 : _a.call(props); }, state: props.state })),
|
|
32
30
|
react_1.default.createElement(button_1.Button, { onClick: () => props.actions.setSelectedRows([]) }, "Zru\u0161it v\u00FDb\u011Br")))));
|
|
33
31
|
}
|
|
34
|
-
exports.DataGridSelectedRowsToolbar = SelectedRowsToolbar;
|
package/styles.css
CHANGED
|
@@ -35,10 +35,6 @@
|
|
|
35
35
|
border: 1px solid var(--rdg-border-color);
|
|
36
36
|
border-radius: theme("borderRadius.DEFAULT");
|
|
37
37
|
|
|
38
|
-
&.no-border {
|
|
39
|
-
border-style: none;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
38
|
&__action-cell {
|
|
43
39
|
background-color: var(--rdg-background-color);
|
|
44
40
|
border-inline-start: 1px solid var(--rdg-border-color);
|
|
@@ -321,10 +317,6 @@
|
|
|
321
317
|
justify-content: flex-end;
|
|
322
318
|
padding: theme("spacing.2");
|
|
323
319
|
|
|
324
|
-
&.no-border {
|
|
325
|
-
padding-right: 0;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
320
|
:root .dark & {
|
|
329
321
|
border-bottom-color: theme("colors.darkBorder");
|
|
330
322
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Column } from "react-data-grid";
|
|
2
2
|
import { DataGridState } from "../../types";
|
|
3
|
-
import {
|
|
4
|
-
export declare function useReactDataGridColumns(props:
|
|
3
|
+
import { DataGridTableProps } from "../types";
|
|
4
|
+
export declare function useReactDataGridColumns(props: DataGridTableProps<any>, state: DataGridState<any>): Column<any>[];
|
|
@@ -46,7 +46,7 @@ function useReactDataGridColumns(props, state) {
|
|
|
46
46
|
continue;
|
|
47
47
|
}
|
|
48
48
|
columns.push({
|
|
49
|
-
key: schemaColumn.name,
|
|
49
|
+
key: schemaColumn.name,
|
|
50
50
|
name: schemaColumn.label,
|
|
51
51
|
headerCellClass: (0, cx_1.cx)("uxf-data-grid__cell", "uxf-data-grid__cell--header", `uxf-data-grid__cell--type-${schemaColumn.type}`, `uxf-data-grid__cell--name-${schemaColumn.name}`),
|
|
52
52
|
resizable: true,
|
package/table/table.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { DataGridTableProps } from "./types";
|
|
3
3
|
/** @deprecated will be remove, use DataGridTableV2 */
|
|
4
|
-
export declare function
|
|
5
|
-
/** @deprecated will be remove, use DataGridTableV2 */
|
|
6
|
-
export declare const DataGridTable: typeof Table;
|
|
4
|
+
export declare function DataGridTable(props: DataGridTableProps<any>): React.JSX.Element;
|