@uxf/data-grid 11.31.0 → 11.32.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/_api/index.js +2 -3
- package/_components/drawer.js +1 -1
- package/_store/reducer.js +7 -7
- package/body-cell/body-cell-boolean.js +2 -1
- package/body-cell/body-cell-url.js +1 -1
- package/data-grid-custom-example.stories.js +5 -5
- package/data-grid.js +10 -10
- package/data-grid.stories.js +3 -4
- package/export-button/export-button.js +3 -3
- package/export-button/export-button.stories.js +2 -3
- package/filter-handler/boolean-select.js +2 -2
- package/filter-handler/checkbox.js +1 -1
- package/filter-handler/date.js +2 -2
- package/filter-handler/datetime.js +2 -2
- package/filter-handler/entity-multi-select.js +1 -1
- package/filter-handler/entity-select.js +1 -1
- package/filter-handler/interval.js +1 -1
- package/filter-handler/multi-select.js +2 -1
- package/filter-handler/select.js +2 -1
- package/filter-handler/string.js +1 -1
- package/filter-list/filter-list.js +5 -4
- package/filter-list/filter-list.stories.js +2 -3
- package/filters/filters.js +2 -2
- package/filters/filters.stories.js +2 -3
- package/filters-button/filters-button.js +5 -5
- package/filters-button/filters-button.stories.js +2 -3
- package/footer/footer.js +1 -2
- package/fulltext-input/fulltext-input.js +3 -3
- package/fulltext-input/fulltext-input.stories.js +2 -3
- package/hidden-columns/hidden-columns.js +4 -8
- package/hidden-columns/hidden-columns.stories.js +2 -3
- package/hidden-columns-button/hidden-columns-button.js +5 -5
- package/hidden-columns-button/hidden-columns-button.stories.js +2 -3
- package/hooks/useCallbackRef.d.ts +0 -1
- package/linear-progress/linear-progress.js +2 -2
- package/package.json +10 -10
- package/pagination/pagination.js +2 -2
- package/pagination/pagination.stories.js +2 -3
- package/root/root.js +1 -2
- package/row-counts/row-counts.js +2 -2
- package/row-counts/row-counts.stories.js +2 -3
- package/rows-per-page-select/rows-per-page-select.js +3 -3
- package/rows-per-page-select/rows-per-page-select.stories.js +2 -3
- package/selected-rows-toolbar/selected-rows-toolbar.js +3 -3
- package/selected-rows-toolbar/selected-rows-toolbar.stories.js +3 -4
- package/table/components/action-cell-wrapper.js +1 -2
- package/table/components/action-cell.js +2 -3
- package/table/components/select-row-checkbox.js +2 -3
- package/table/hooks/use-rdg-visuals.d.ts +0 -1
- package/table/hooks/use-rdg-visuals.js +1 -2
- package/table/hooks/use-react-data-grid-columns.js +2 -3
- package/table/no-rows-fallback.js +1 -2
- package/table/table.js +10 -7
- package/table/table.stories.js +2 -3
- package/table-v2/components/action-cell.js +1 -2
- package/table-v2/components/body.js +1 -2
- package/table-v2/components/cell.js +1 -2
- package/table-v2/components/header-action-cell.js +1 -2
- package/table-v2/components/header-cell.js +3 -3
- package/table-v2/components/header.js +1 -2
- package/table-v2/components/index.d.ts +0 -1
- package/table-v2/components/row.js +1 -2
- package/table-v2/hooks/use-resizable-columns.d.ts +0 -1
- package/table-v2/hooks/use-resizable-columns.js +1 -2
- package/table-v2/no-rows-fallback.js +1 -2
- package/table-v2/table-v2.js +9 -7
- package/table-v2/table-v2.stories.js +3 -4
- package/table-v2/utils/get-grid-template-rows.js +1 -2
- package/toolbar/toolbar.js +1 -2
- package/toolbar-control/toolbar-control.js +6 -6
- package/toolbar-control/toolbar-control.stories.js +2 -3
- package/toolbar-customs/toolbar-customs.js +6 -4
- package/toolbar-customs/toolbar-customs.stories.js +1 -2
- package/toolbar-tabs/toolbar-tabs.js +9 -9
- package/toolbar-tabs/toolbar-tabs.stories.js +2 -3
- package/types/components.d.ts +4 -4
- package/types/schema.d.ts +8 -8
- package/use-data-grid-control/actions-factory.js +1 -2
- package/use-data-grid-control/use-data-grid-control.d.ts +1 -1
- package/use-data-grid-control/use-data-grid-control.js +1 -2
- package/use-data-grid-fetching/use-data-grid-fetching.js +1 -2
- package/utils/create-filter-component-props.js +1 -2
- package/utils/merge-schema-with-config.js +1 -2
- package/utils.js +4 -4
|
@@ -3,7 +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.Default =
|
|
6
|
+
exports.Default = Default;
|
|
7
7
|
const json_renderer_1 = require("@uxf/example/src/components/json-renderer");
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
9
|
const schema_1 = require("../_story-utils/schema");
|
|
@@ -12,7 +12,6 @@ const hidden_columns_1 = require("./hidden-columns");
|
|
|
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(hidden_columns_1.DataGridHiddenColumns, {
|
|
15
|
+
react_1.default.createElement(hidden_columns_1.DataGridHiddenColumns, { actions: actions, schema: schema_1.schema, state: state }),
|
|
16
16
|
react_1.default.createElement(json_renderer_1.JsonRenderer, { value: state })));
|
|
17
17
|
}
|
|
18
|
-
exports.Default = Default;
|
|
@@ -23,7 +23,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.DataGridHiddenColumnsButton =
|
|
26
|
+
exports.DataGridHiddenColumnsButton = void 0;
|
|
27
|
+
exports.HiddenColumnsButton = HiddenColumnsButton;
|
|
27
28
|
const button_1 = require("@uxf/ui/button");
|
|
28
29
|
const icon_1 = require("@uxf/ui/icon");
|
|
29
30
|
const react_1 = __importStar(require("react"));
|
|
@@ -34,10 +35,9 @@ function HiddenColumnsButton(props) {
|
|
|
34
35
|
var _a;
|
|
35
36
|
const [isOpen, setIsOpen] = (0, react_1.useState)(false);
|
|
36
37
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
37
|
-
react_1.default.createElement(button_1.Button, {
|
|
38
|
+
react_1.default.createElement(button_1.Button, { className: "uxf-data-grid__plugin-button", isIconButton: true, onClick: () => setIsOpen(true), size: "sm", title: "Nastaven\u00ED sloupc\u016F", variant: "secondary" },
|
|
38
39
|
react_1.default.createElement(icon_1.Icon, { name: "table-columns" })),
|
|
39
|
-
react_1.default.createElement(drawer_1.Drawer, {
|
|
40
|
-
react_1.default.createElement(hidden_columns_1.HiddenColumns, {
|
|
40
|
+
react_1.default.createElement(drawer_1.Drawer, { onClose: () => setIsOpen(false), open: isOpen, title: (_a = props.drawerTitle) !== null && _a !== void 0 ? _a : "Sloupce" },
|
|
41
|
+
react_1.default.createElement(hidden_columns_1.HiddenColumns, { actions: props.actions, schema: props.schema, state: props.state }))));
|
|
41
42
|
}
|
|
42
|
-
exports.HiddenColumnsButton = HiddenColumnsButton;
|
|
43
43
|
exports.DataGridHiddenColumnsButton = HiddenColumnsButton;
|
|
@@ -3,7 +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.Default =
|
|
6
|
+
exports.Default = Default;
|
|
7
7
|
const json_renderer_1 = require("@uxf/example/src/components/json-renderer");
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
9
|
const schema_1 = require("../_story-utils/schema");
|
|
@@ -12,7 +12,6 @@ const hidden_columns_button_1 = require("./hidden-columns-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(hidden_columns_button_1.DataGridHiddenColumnsButton, {
|
|
15
|
+
react_1.default.createElement(hidden_columns_button_1.DataGridHiddenColumnsButton, { actions: actions, schema: schema_1.schema, state: state }),
|
|
16
16
|
react_1.default.createElement(json_renderer_1.JsonRenderer, { value: state })));
|
|
17
17
|
}
|
|
18
|
-
exports.Default = Default;
|
|
@@ -3,7 +3,8 @@ 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 =
|
|
6
|
+
exports.DataGridLinearProgress = void 0;
|
|
7
|
+
exports.LinearProgress = LinearProgress;
|
|
7
8
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
8
9
|
const react_1 = __importDefault(require("react"));
|
|
9
10
|
/** @deprecated Use DataGridLinearProgress */
|
|
@@ -11,5 +12,4 @@ function LinearProgress(props) {
|
|
|
11
12
|
return (react_1.default.createElement("div", { className: "uxf-data-grid__linear-progress-wrapper" },
|
|
12
13
|
react_1.default.createElement("div", { className: (0, cx_1.cx)("uxf-data-grid__linear-progress", props.isLoading && "is-loading") })));
|
|
13
14
|
}
|
|
14
|
-
exports.LinearProgress = LinearProgress;
|
|
15
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.32.0",
|
|
4
4
|
"description": "UXF DataGrid",
|
|
5
5
|
"homepage": "https://gitlab.com/uxf-npm/data-grid#readme",
|
|
6
6
|
"main": "index.js",
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
"typecheck": "tsc --noEmit --skipLibCheck"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@uxf/core": "11.
|
|
35
|
-
"@uxf/core-react": "11.
|
|
36
|
-
"@uxf/ui": "11.
|
|
37
|
-
"dayjs": "1.11.
|
|
34
|
+
"@uxf/core": "11.32.0",
|
|
35
|
+
"@uxf/core-react": "11.32.0",
|
|
36
|
+
"@uxf/ui": "11.32.0",
|
|
37
|
+
"dayjs": "1.11.13",
|
|
38
38
|
"deepmerge": "4.3.1",
|
|
39
39
|
"fast-glob": "3.3.2",
|
|
40
|
-
"qs": "6.
|
|
40
|
+
"qs": "6.13.0",
|
|
41
41
|
"react-data-grid": "7.0.0-beta.39",
|
|
42
42
|
"yargs": "17.7.2"
|
|
43
43
|
},
|
|
@@ -46,10 +46,10 @@
|
|
|
46
46
|
"react-dom": ">=18.2.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@types/react": "18.
|
|
50
|
-
"@types/react-dom": "18.
|
|
51
|
-
"react": "18.
|
|
52
|
-
"react-dom": "18.
|
|
49
|
+
"@types/react": "18.3.5",
|
|
50
|
+
"@types/react-dom": "18.3.0",
|
|
51
|
+
"react": "18.3.1",
|
|
52
|
+
"react-dom": "18.3.1"
|
|
53
53
|
},
|
|
54
54
|
"gitHead": "e4f21a15c3d50fb6614d70cdaf36685232de87e7"
|
|
55
55
|
}
|
package/pagination/pagination.js
CHANGED
|
@@ -3,7 +3,8 @@ 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 =
|
|
6
|
+
exports.DataGridPagination = void 0;
|
|
7
|
+
exports.Pagination = Pagination;
|
|
7
8
|
const is_not_nil_1 = require("@uxf/core/utils/is-not-nil");
|
|
8
9
|
const pagination_1 = require("@uxf/ui/pagination");
|
|
9
10
|
const react_1 = __importDefault(require("react"));
|
|
@@ -14,5 +15,4 @@ function Pagination(props) {
|
|
|
14
15
|
: 1;
|
|
15
16
|
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 }));
|
|
16
17
|
}
|
|
17
|
-
exports.Pagination = Pagination;
|
|
18
18
|
exports.DataGridPagination = Pagination;
|
|
@@ -3,7 +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.Default =
|
|
6
|
+
exports.Default = Default;
|
|
7
7
|
const json_renderer_1 = require("@uxf/example/src/components/json-renderer");
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
9
|
const schema_1 = require("../_story-utils/schema");
|
|
@@ -12,7 +12,6 @@ const pagination_1 = require("./pagination");
|
|
|
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(pagination_1.DataGridPagination, {
|
|
15
|
+
react_1.default.createElement(pagination_1.DataGridPagination, { actions: actions, count: 100, state: state }),
|
|
16
16
|
react_1.default.createElement(json_renderer_1.JsonRenderer, { value: state })));
|
|
17
17
|
}
|
|
18
|
-
exports.Default = Default;
|
package/root/root.js
CHANGED
|
@@ -3,11 +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.DataGridRoot =
|
|
6
|
+
exports.DataGridRoot = DataGridRoot;
|
|
7
7
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
9
|
const classes_1 = require("../utils/classes");
|
|
10
10
|
function DataGridRoot(props) {
|
|
11
11
|
return (react_1.default.createElement("div", { className: (0, cx_1.cx)("uxf-data-grid", props.noBorder && classes_1.NO_BORDER_CLASS, props.className) }, props.children));
|
|
12
12
|
}
|
|
13
|
-
exports.DataGridRoot = DataGridRoot;
|
package/row-counts/row-counts.js
CHANGED
|
@@ -3,7 +3,8 @@ 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 =
|
|
6
|
+
exports.DataGridRowCounts = void 0;
|
|
7
|
+
exports.RowCounts = RowCounts;
|
|
7
8
|
const show_1 = require("@uxf/core-react/components/show");
|
|
8
9
|
const react_1 = __importDefault(require("react"));
|
|
9
10
|
/** @deprecated Use DataGridRowCounts */
|
|
@@ -22,5 +23,4 @@ function RowCounts(props) {
|
|
|
22
23
|
props.totalCount,
|
|
23
24
|
")")));
|
|
24
25
|
}
|
|
25
|
-
exports.RowCounts = RowCounts;
|
|
26
26
|
exports.DataGridRowCounts = RowCounts;
|
|
@@ -3,13 +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.Default =
|
|
6
|
+
exports.Default = Default;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const schema_1 = require("../_story-utils/schema");
|
|
9
9
|
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.DataGridRowCounts, { state: state, totalCount: 150
|
|
13
|
+
return react_1.default.createElement(row_counts_1.DataGridRowCounts, { count: 100, state: state, totalCount: 150 });
|
|
14
14
|
}
|
|
15
|
-
exports.Default = Default;
|
|
@@ -3,7 +3,8 @@ 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 =
|
|
6
|
+
exports.DataGridRowsPerPageSelect = void 0;
|
|
7
|
+
exports.RowsPerPageSelect = RowsPerPageSelect;
|
|
7
8
|
const select_1 = require("@uxf/ui/select");
|
|
8
9
|
const react_1 = __importDefault(require("react"));
|
|
9
10
|
const PER_PAGE_OPTIONS = [
|
|
@@ -16,7 +17,6 @@ const PER_PAGE_OPTIONS = [
|
|
|
16
17
|
function RowsPerPageSelect(props) {
|
|
17
18
|
return (react_1.default.createElement("div", { className: "uxf-data-grid__rows-per-page" },
|
|
18
19
|
react_1.default.createElement("label", { htmlFor: "uxf-data-grid--select-per-page" }, "Po\u010Det \u0159\u00E1dk\u016F"),
|
|
19
|
-
react_1.default.createElement(select_1.Select, { id: "uxf-data-grid--select-per-page",
|
|
20
|
+
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 })));
|
|
20
21
|
}
|
|
21
|
-
exports.RowsPerPageSelect = RowsPerPageSelect;
|
|
22
22
|
exports.DataGridRowsPerPageSelect = RowsPerPageSelect;
|
|
@@ -3,7 +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.Default =
|
|
6
|
+
exports.Default = Default;
|
|
7
7
|
const json_renderer_1 = require("@uxf/example/src/components/json-renderer");
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
9
|
const schema_1 = require("../_story-utils/schema");
|
|
@@ -12,7 +12,6 @@ const rows_per_page_select_1 = require("./rows-per-page-select");
|
|
|
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(rows_per_page_select_1.DataGridRowsPerPageSelect, {
|
|
15
|
+
react_1.default.createElement(rows_per_page_select_1.DataGridRowsPerPageSelect, { actions: actions, state: state }),
|
|
16
16
|
react_1.default.createElement(json_renderer_1.JsonRenderer, { value: state })));
|
|
17
17
|
}
|
|
18
|
-
exports.Default = Default;
|
|
@@ -3,7 +3,8 @@ 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 =
|
|
6
|
+
exports.DataGridSelectedRowsToolbar = void 0;
|
|
7
|
+
exports.SelectedRowsToolbar = SelectedRowsToolbar;
|
|
7
8
|
const button_1 = require("@uxf/ui/button");
|
|
8
9
|
const react_1 = __importDefault(require("react"));
|
|
9
10
|
const getText = (count) => {
|
|
@@ -27,8 +28,7 @@ function SelectedRowsToolbar(props) {
|
|
|
27
28
|
react_1.default.createElement("div", { className: "uxf-data-grid__selected-rows-toolbar" },
|
|
28
29
|
react_1.default.createElement("p", null, getText(props.state.selectedRows.length)),
|
|
29
30
|
react_1.default.createElement("div", { className: "uxf-data-grid__selected-rows-toolbar-actions" },
|
|
30
|
-
props.Actions && (react_1.default.createElement(props.Actions, {
|
|
31
|
+
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 })),
|
|
31
32
|
react_1.default.createElement(button_1.Button, { onClick: () => props.actions.setSelectedRows([]) }, "Zru\u0161it v\u00FDb\u011Br")))));
|
|
32
33
|
}
|
|
33
|
-
exports.SelectedRowsToolbar = SelectedRowsToolbar;
|
|
34
34
|
exports.DataGridSelectedRowsToolbar = SelectedRowsToolbar;
|
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.Default =
|
|
26
|
+
exports.Default = Default;
|
|
27
27
|
const json_renderer_1 = require("@uxf/example/src/components/json-renderer");
|
|
28
28
|
const button_1 = require("@uxf/ui/button");
|
|
29
29
|
const icon_1 = require("@uxf/ui/icon");
|
|
@@ -37,8 +37,7 @@ function Default() {
|
|
|
37
37
|
actions.setSelectedRows([{ id: 1 }, { id: 2 }]);
|
|
38
38
|
}, [actions]);
|
|
39
39
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
40
|
-
react_1.default.createElement(selected_rows_toolbar_1.DataGridSelectedRowsToolbar, {
|
|
41
|
-
react_1.default.createElement(icon_1.Icon, { name: "camera" }))) }),
|
|
40
|
+
react_1.default.createElement(selected_rows_toolbar_1.DataGridSelectedRowsToolbar, { Actions: () => (react_1.default.createElement(button_1.Button, { isIconButton: true },
|
|
41
|
+
react_1.default.createElement(icon_1.Icon, { name: "camera" }))), actions: actions, state: state }),
|
|
42
42
|
react_1.default.createElement(json_renderer_1.JsonRenderer, { value: state })));
|
|
43
43
|
}
|
|
44
|
-
exports.Default = Default;
|
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.ActionCellWrapper =
|
|
26
|
+
exports.ActionCellWrapper = ActionCellWrapper;
|
|
27
27
|
const react_1 = __importStar(require("react"));
|
|
28
28
|
function ActionCellWrapper(props) {
|
|
29
29
|
const innerRef = (0, react_1.useRef)(null);
|
|
@@ -55,4 +55,3 @@ function ActionCellWrapper(props) {
|
|
|
55
55
|
}, []);
|
|
56
56
|
return (react_1.default.createElement("div", { className: "uxf-data-grid__action-cell-wrapper", ref: innerRef }, props.children));
|
|
57
57
|
}
|
|
58
|
-
exports.ActionCellWrapper = ActionCellWrapper;
|
|
@@ -3,12 +3,11 @@ 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.ActionCell =
|
|
6
|
+
exports.ActionCell = ActionCell;
|
|
7
7
|
const button_list_1 = require("@uxf/ui/button-list");
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
9
|
const action_cell_wrapper_1 = require("./action-cell-wrapper");
|
|
10
10
|
function ActionCell(props) {
|
|
11
11
|
return (react_1.default.createElement(action_cell_wrapper_1.ActionCellWrapper, null,
|
|
12
|
-
react_1.default.createElement(button_list_1.ButtonList, { buttons: props.buttons,
|
|
12
|
+
react_1.default.createElement(button_list_1.ButtonList, { buttons: props.buttons, size: "sm", variant: "secondary", visibleButtonsCount: props.visibleButtonsCount })));
|
|
13
13
|
}
|
|
14
|
-
exports.ActionCell = ActionCell;
|
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.SelectRowCheckbox =
|
|
26
|
+
exports.SelectRowCheckbox = SelectRowCheckbox;
|
|
27
27
|
const checkbox_1 = require("@uxf/ui/checkbox");
|
|
28
28
|
const react_1 = __importStar(require("react"));
|
|
29
29
|
function SelectRowCheckbox(props) {
|
|
@@ -36,6 +36,5 @@ function SelectRowCheckbox(props) {
|
|
|
36
36
|
};
|
|
37
37
|
const id = (0, react_1.useId)();
|
|
38
38
|
return (react_1.default.createElement("div", { className: "uxf-data-grid__select-row-checkbox-wrapper" },
|
|
39
|
-
react_1.default.createElement(checkbox_1.Checkbox, { ...props, value: (_a = props.checked) !== null && _a !== void 0 ? _a : false
|
|
39
|
+
react_1.default.createElement(checkbox_1.Checkbox, { ...props, name: id, onChange: handleChange, value: (_a = props.checked) !== null && _a !== void 0 ? _a : false })));
|
|
40
40
|
}
|
|
41
|
-
exports.SelectRowCheckbox = SelectRowCheckbox;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useRdgVisuals =
|
|
3
|
+
exports.useRdgVisuals = useRdgVisuals;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
function useRdgVisuals(props) {
|
|
6
6
|
var _a, _b;
|
|
@@ -44,4 +44,3 @@ function useRdgVisuals(props) {
|
|
|
44
44
|
style: { height },
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
exports.useRdgVisuals = useRdgVisuals;
|
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.useReactDataGridColumns =
|
|
26
|
+
exports.useReactDataGridColumns = useReactDataGridColumns;
|
|
27
27
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
28
28
|
const react_1 = __importStar(require("react"));
|
|
29
29
|
const react_data_grid_1 = require("react-data-grid");
|
|
@@ -66,7 +66,7 @@ function useReactDataGridColumns(props, state) {
|
|
|
66
66
|
label: p.column.name,
|
|
67
67
|
sort: p.column.sortable,
|
|
68
68
|
type: columnType,
|
|
69
|
-
},
|
|
69
|
+
}, reload: () => onReload === null || onReload === void 0 ? void 0 : onReload(), row: p.row, value: p.row[p.column.key] }));
|
|
70
70
|
},
|
|
71
71
|
});
|
|
72
72
|
}
|
|
@@ -84,4 +84,3 @@ function useReactDataGridColumns(props, state) {
|
|
|
84
84
|
return columns;
|
|
85
85
|
}, [userConfigColumns, actionCell, schema.columns, bodyCells, isRowSelectable, onReload, state.userConfig.columns]);
|
|
86
86
|
}
|
|
87
|
-
exports.useReactDataGridColumns = useReactDataGridColumns;
|
|
@@ -3,7 +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.NoRowsFallback =
|
|
6
|
+
exports.NoRowsFallback = NoRowsFallback;
|
|
7
7
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
8
8
|
const icon_1 = require("@uxf/ui/icon");
|
|
9
9
|
const react_1 = __importDefault(require("react"));
|
|
@@ -12,4 +12,3 @@ function NoRowsFallback(props) {
|
|
|
12
12
|
react_1.default.createElement(icon_1.Icon, { name: "warning", size: 24 }),
|
|
13
13
|
react_1.default.createElement("p", null, "Vyskytla se chyba"))) : (react_1.default.createElement(react_1.default.Fragment, null, "\u017D\u00E1dn\u00E9 z\u00E1znamy"))));
|
|
14
14
|
}
|
|
15
|
-
exports.NoRowsFallback = NoRowsFallback;
|
package/table/table.js
CHANGED
|
@@ -26,9 +26,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.DataGridTable =
|
|
29
|
+
exports.DataGridTable = void 0;
|
|
30
|
+
exports.Table = Table;
|
|
30
31
|
const show_1 = require("@uxf/core-react/components/show");
|
|
31
32
|
const use_is_mounted_1 = require("@uxf/core-react/hooks/use-is-mounted");
|
|
33
|
+
const empty_array_1 = require("@uxf/core/constants/empty-array");
|
|
34
|
+
const is_not_nil_1 = require("@uxf/core/utils/is-not-nil");
|
|
32
35
|
const react_1 = __importStar(require("react"));
|
|
33
36
|
const react_data_grid_1 = __importDefault(require("react-data-grid"));
|
|
34
37
|
const select_row_checkbox_1 = require("./components/select-row-checkbox");
|
|
@@ -54,7 +57,7 @@ function Table(props) {
|
|
|
54
57
|
overflowY: "hidden",
|
|
55
58
|
};
|
|
56
59
|
const NoRowsFallback = (_d = props.NoRowsFallback) !== null && _d !== void 0 ? _d : DefaultNoRowsFallback;
|
|
57
|
-
const isLoading =
|
|
60
|
+
const isLoading = Boolean(props.isLoading);
|
|
58
61
|
const error = props.error;
|
|
59
62
|
const components = (0, react_1.useMemo)(() => ({
|
|
60
63
|
renderCheckbox: (args) => react_1.default.createElement(select_row_checkbox_1.SelectRowCheckbox, { ...args }),
|
|
@@ -69,8 +72,9 @@ function Table(props) {
|
|
|
69
72
|
props.actions.setSelectedRows(selectedRows);
|
|
70
73
|
};
|
|
71
74
|
const onSortColumnChange = (sortColumns) => {
|
|
72
|
-
|
|
73
|
-
|
|
75
|
+
const firstSortColumn = sortColumns.at(0);
|
|
76
|
+
if ((0, is_not_nil_1.isNotNil)(firstSortColumn)) {
|
|
77
|
+
props.actions.sort(firstSortColumn.columnKey, firstSortColumn.direction.toLowerCase());
|
|
74
78
|
}
|
|
75
79
|
else {
|
|
76
80
|
props.actions.sortClear();
|
|
@@ -78,15 +82,14 @@ function Table(props) {
|
|
|
78
82
|
};
|
|
79
83
|
const sortColumns = props.state.request.s
|
|
80
84
|
? [{ columnKey: props.state.request.s.name, direction: props.state.request.s.dir.toUpperCase() }]
|
|
81
|
-
:
|
|
85
|
+
: empty_array_1.EMPTY_ARRAY;
|
|
82
86
|
const rdgVisuals = (0, use_rdg_visuals_1.useRdgVisuals)({
|
|
83
87
|
headerRowHeight: props.headerRowHeight,
|
|
84
88
|
rowHeight: props.rowHeight,
|
|
85
89
|
rows: props.data,
|
|
86
90
|
});
|
|
87
91
|
return (react_1.default.createElement(show_1.Show, { when: isMounted },
|
|
88
|
-
react_1.default.createElement(react_data_grid_1.default, { className: rdgVisuals.className, columns: columns, enableVirtualization: false, headerRowHeight: rdgVisuals.headerRowHeight, onSelectedRowsChange: onSelectRows, onSortColumnsChange: onSortColumnChange, ref: rdgVisuals.ref, renderers: components, rowClass: props.rowClass, rowHeight: rdgVisuals.rowHeight, rowKeyGetter: (_e = props.keyExtractor) !== null && _e !== void 0 ? _e : defaultKeyExtractor, rows: props.data, selectedRows: new Set((_g = (_f = props.state.selectedRows) === null || _f === void 0 ? void 0 : _f.map(keyExtractor)) !== null && _g !== void 0 ? _g :
|
|
92
|
+
react_1.default.createElement(react_data_grid_1.default, { className: rdgVisuals.className, columns: columns, enableVirtualization: false, headerRowHeight: rdgVisuals.headerRowHeight, onSelectedRowsChange: onSelectRows, onSortColumnsChange: onSortColumnChange, ref: rdgVisuals.ref, renderers: components, rowClass: props.rowClass, rowHeight: rdgVisuals.rowHeight, rowKeyGetter: (_e = props.keyExtractor) !== null && _e !== void 0 ? _e : defaultKeyExtractor, rows: props.data, selectedRows: new Set((_g = (_f = props.state.selectedRows) === null || _f === void 0 ? void 0 : _f.map(keyExtractor)) !== null && _g !== void 0 ? _g : empty_array_1.EMPTY_ARRAY), sortColumns: sortColumns, style: reactDataGridStyles })));
|
|
89
93
|
}
|
|
90
|
-
exports.Table = Table;
|
|
91
94
|
/** @deprecated will be remove, use DataGridTableV2 */
|
|
92
95
|
exports.DataGridTable = Table;
|
package/table/table.stories.js
CHANGED
|
@@ -3,7 +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.Default =
|
|
6
|
+
exports.Default = Default;
|
|
7
7
|
const json_renderer_1 = require("@uxf/example/src/components/json-renderer");
|
|
8
8
|
const react_1 = __importDefault(require("react"));
|
|
9
9
|
const data_1 = require("../_story-utils/data");
|
|
@@ -14,7 +14,6 @@ const table_1 = require("./table");
|
|
|
14
14
|
function Default() {
|
|
15
15
|
const { state, actions } = (0, use_data_grid_control_1.useDataGridControl)({ schema: schema_1.schema });
|
|
16
16
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
17
|
-
react_1.default.createElement(table_1.DataGridTable, {
|
|
17
|
+
react_1.default.createElement(table_1.DataGridTable, { actions: actions, bodyCells: body_cell_1.BodyCells, data: data_1.data, error: undefined, isLoading: true, isRowSelectable: true, schema: schema_1.schema, state: state }),
|
|
18
18
|
react_1.default.createElement(json_renderer_1.JsonRenderer, { value: state })));
|
|
19
19
|
}
|
|
20
|
-
exports.Default = Default;
|
|
@@ -3,9 +3,8 @@ 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.ActionCell =
|
|
6
|
+
exports.ActionCell = ActionCell;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
function ActionCell(props) {
|
|
9
9
|
return react_1.default.createElement("div", { className: "uxf-dg-table__action-cell" }, props.children);
|
|
10
10
|
}
|
|
11
|
-
exports.ActionCell = ActionCell;
|
|
@@ -3,9 +3,8 @@ 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.Body =
|
|
6
|
+
exports.Body = Body;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
function Body(props) {
|
|
9
9
|
return react_1.default.createElement("div", { className: "uxf-dg-table__body" }, props.children);
|
|
10
10
|
}
|
|
11
|
-
exports.Body = Body;
|
|
@@ -3,9 +3,8 @@ 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.Cell =
|
|
6
|
+
exports.Cell = Cell;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
function Cell(props) {
|
|
9
9
|
return react_1.default.createElement("div", { className: `uxf-dg-table__cell uxf-dg-table__cell--type-${props.column.type}` }, props.children);
|
|
10
10
|
}
|
|
11
|
-
exports.Cell = Cell;
|
|
@@ -3,9 +3,8 @@ 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.HeaderActionCell =
|
|
6
|
+
exports.HeaderActionCell = HeaderActionCell;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
function HeaderActionCell() {
|
|
9
9
|
return react_1.default.createElement("div", { className: "uxf-dg-table__action-cell uxf-dg-table__action-cell--header" });
|
|
10
10
|
}
|
|
11
|
-
exports.HeaderActionCell = HeaderActionCell;
|
|
@@ -38,10 +38,10 @@ function HeaderCellComponent(props, ref) {
|
|
|
38
38
|
: "sort";
|
|
39
39
|
return (
|
|
40
40
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
41
|
-
react_1.default.createElement("div", {
|
|
41
|
+
react_1.default.createElement("div", { className: (0, cx_1.cx)(`uxf-dg-table__cell uxf-dg-table__cell--header uxf-dg-table__cell--type-${props.column.type}`, props.column.sort && "is-sortable"), onClick: props.onClick, ref: ref },
|
|
42
42
|
props.column.label,
|
|
43
|
-
iconName && react_1.default.createElement(icon_1.Icon, {
|
|
44
|
-
react_1.default.createElement("button", { className: "uxf-dg-table__column-resize-handle",
|
|
43
|
+
iconName && react_1.default.createElement(icon_1.Icon, { className: "ml-auto", name: iconName }),
|
|
44
|
+
react_1.default.createElement("button", { className: "uxf-dg-table__column-resize-handle", onClick: (event) => event.stopPropagation(), onMouseDown: props.onResizeStart })));
|
|
45
45
|
}
|
|
46
46
|
exports.HeaderCell = (0, react_1.forwardRef)(HeaderCellComponent);
|
|
47
47
|
exports.HeaderCell.displayName = "HeaderCell";
|
|
@@ -3,9 +3,8 @@ 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.Header =
|
|
6
|
+
exports.Header = Header;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
function Header(props) {
|
|
9
9
|
return react_1.default.createElement("div", { className: "uxf-dg-table__header" }, props.children);
|
|
10
10
|
}
|
|
11
|
-
exports.Header = Header;
|
|
@@ -3,9 +3,8 @@ 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.Row =
|
|
6
|
+
exports.Row = Row;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
function Row(props) {
|
|
9
9
|
return react_1.default.createElement("div", { className: "uxf-dg-table__row" }, props.children);
|
|
10
10
|
}
|
|
11
|
-
exports.Row = Row;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useResizableColumns =
|
|
3
|
+
exports.useResizableColumns = useResizableColumns;
|
|
4
4
|
const is_empty_1 = require("@uxf/core/utils/is-empty");
|
|
5
5
|
const is_nil_1 = require("@uxf/core/utils/is-nil");
|
|
6
6
|
const is_not_nil_1 = require("@uxf/core/utils/is-not-nil");
|
|
@@ -65,4 +65,3 @@ function useResizableColumns(columns, actionCell, actions) {
|
|
|
65
65
|
},
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
|
-
exports.useResizableColumns = useResizableColumns;
|
|
@@ -3,7 +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.NoRowsFallback =
|
|
6
|
+
exports.NoRowsFallback = NoRowsFallback;
|
|
7
7
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
8
8
|
const icon_1 = require("@uxf/ui/icon");
|
|
9
9
|
const react_1 = __importDefault(require("react"));
|
|
@@ -12,4 +12,3 @@ function NoRowsFallback(props) {
|
|
|
12
12
|
react_1.default.createElement(icon_1.Icon, { name: "warning", size: 24 }),
|
|
13
13
|
react_1.default.createElement("p", null, "Vyskytla se chyba"))) : (react_1.default.createElement(react_1.default.Fragment, null, "\u017D\u00E1dn\u00E9 z\u00E1znamy"))));
|
|
14
14
|
}
|
|
15
|
-
exports.NoRowsFallback = NoRowsFallback;
|