@uxf/data-grid 11.0.0-beta.14 → 11.0.0-beta.15
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/_story-utils/loader.js
CHANGED
|
@@ -29,7 +29,7 @@ const loader = async (_, request) => {
|
|
|
29
29
|
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
30
30
|
return {
|
|
31
31
|
count: filteredData.length,
|
|
32
|
-
totalCount:
|
|
32
|
+
totalCount: data_1.data.length,
|
|
33
33
|
result: filteredData.slice(page * perPage, page * perPage + perPage),
|
|
34
34
|
};
|
|
35
35
|
};
|
package/data-grid.js
CHANGED
|
@@ -23,7 +23,7 @@ const toolbar_tabs_1 = require("./toolbar-tabs");
|
|
|
23
23
|
const classes_1 = require("./utils/classes");
|
|
24
24
|
const DefaultSelectedRowsToolbarActions = () => null;
|
|
25
25
|
function DataGrid(props) {
|
|
26
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
26
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
27
27
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
28
28
|
react_1.default.createElement("div", { className: (0, cx_1.cx)("uxf-data-grid", props.noBorder && classes_1.NO_BORDER_CLASS, props.className) },
|
|
29
29
|
react_1.default.createElement("div", { className: (0, cx_1.cx)("uxf-data-grid__toolbar", props.noBorder && classes_1.NO_BORDER_CLASS) },
|
|
@@ -35,8 +35,8 @@ function DataGrid(props) {
|
|
|
35
35
|
react_1.default.createElement(table_1.Table, { state: props.state, actions: props.actions, schema: props.schema, data: (_f = (_e = props.data) === null || _e === void 0 ? void 0 : _e.result) !== null && _f !== void 0 ? _f : [], isLoading: props.isLoading, error: props.error, rowClass: props.rowClass, keyExtractor: props.keyExtractor, rowHeight: props.rowHeight, headerRowHeight: props.headerRowHeight, BodyCells: (_h = (_g = props.ui) === null || _g === void 0 ? void 0 : _g.BodyCells) !== null && _h !== void 0 ? _h : body_cell_1.BodyCells, NoRowsFallback: (_k = (_j = props.ui) === null || _j === void 0 ? void 0 : _j.NoRowsFallback) !== null && _k !== void 0 ? _k : no_rows_fallback_1.NoRowsFallback, ActionCell: (_m = (_l = props.ui) === null || _l === void 0 ? void 0 : _l.ActionCell) !== null && _m !== void 0 ? _m : action_cell_base_1.ActionCellBase, onRemove: props.onRemove, onEdit: props.onEdit, getEditUrl: props.getEditUrl, onOpen: props.onOpen, getOpenUrl: props.getOpenUrl, onReload: props.onReload, isRowSelectable: props.isRowSelectable }),
|
|
36
36
|
react_1.default.createElement("div", { className: (0, cx_1.cx)("uxf-data-grid__footer", props.noBorder && classes_1.NO_BORDER_CLASS) },
|
|
37
37
|
react_1.default.createElement(rows_per_page_select_1.RowsPerPageSelect, { state: props.state, actions: props.actions }),
|
|
38
|
-
react_1.default.createElement(row_counts_1.RowCounts, { state: props.state,
|
|
39
|
-
react_1.default.createElement(pagination_1.Pagination, { state: props.state, actions: props.actions, count: (
|
|
40
|
-
react_1.default.createElement(selected_rows_toolbar_1.SelectedRowsToolbar, { state: props.state, actions: props.actions, Actions: (
|
|
38
|
+
react_1.default.createElement(row_counts_1.RowCounts, { state: props.state, count: (_p = (_o = props.data) === null || _o === void 0 ? void 0 : _o.count) !== null && _p !== void 0 ? _p : 0, totalCount: (_r = (_q = props.data) === null || _q === void 0 ? void 0 : _q.totalCount) !== null && _r !== void 0 ? _r : 0 }),
|
|
39
|
+
react_1.default.createElement(pagination_1.Pagination, { state: props.state, actions: props.actions, count: (_t = (_s = props.data) === null || _s === void 0 ? void 0 : _s.count) !== null && _t !== void 0 ? _t : 0 }))),
|
|
40
|
+
react_1.default.createElement(selected_rows_toolbar_1.SelectedRowsToolbar, { state: props.state, actions: props.actions, Actions: (_v = (_u = props.ui) === null || _u === void 0 ? void 0 : _u.SelectedRowsToolbarActions) !== null && _v !== void 0 ? _v : DefaultSelectedRowsToolbarActions })));
|
|
41
41
|
}
|
|
42
42
|
exports.DataGrid = DataGrid;
|
package/package.json
CHANGED
package/row-counts/row-counts.js
CHANGED
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.RowCounts = void 0;
|
|
7
|
+
const show_1 = require("@uxf/core/components/show");
|
|
7
8
|
const react_1 = __importDefault(require("react"));
|
|
8
9
|
function RowCounts(props) {
|
|
9
10
|
const fromNumber = props.state.request.page * props.state.request.perPage + 1;
|
|
@@ -13,6 +14,11 @@ function RowCounts(props) {
|
|
|
13
14
|
"-",
|
|
14
15
|
toNumber,
|
|
15
16
|
" z ",
|
|
16
|
-
props.
|
|
17
|
+
props.count,
|
|
18
|
+
" ",
|
|
19
|
+
react_1.default.createElement(show_1.Show, { when: props.count !== props.totalCount },
|
|
20
|
+
"(celkem ",
|
|
21
|
+
props.totalCount,
|
|
22
|
+
")")));
|
|
17
23
|
}
|
|
18
24
|
exports.RowCounts = RowCounts;
|
|
@@ -10,6 +10,6 @@ const use_data_grid_control_1 = require("../use-data-grid-control");
|
|
|
10
10
|
const row_counts_1 = require("./row-counts");
|
|
11
11
|
function Default() {
|
|
12
12
|
const { state } = (0, use_data_grid_control_1.useDataGridControl)({ schema: schema_1.schema });
|
|
13
|
-
return react_1.default.createElement(row_counts_1.RowCounts, { state: state, totalCount: 150 });
|
|
13
|
+
return react_1.default.createElement(row_counts_1.RowCounts, { state: state, totalCount: 150, count: 100 });
|
|
14
14
|
}
|
|
15
15
|
exports.Default = Default;
|