@uxf/data-grid 11.47.2 → 11.48.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.stories.js +1 -1
- package/package.json +2 -2
- package/table-v2/components/action-cell-wrapper.d.ts +6 -0
- package/table-v2/components/action-cell-wrapper.js +10 -0
- package/table-v2/components/action-cell.d.ts +4 -3
- package/table-v2/components/action-cell.js +6 -2
- package/table-v2/components/index.d.ts +2 -0
- package/table-v2/components/index.js +2 -0
- package/table-v2/table-v2.js +2 -1
- package/table-v2/table-v2.stories.js +2 -1
package/data-grid-v2.stories.js
CHANGED
|
@@ -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(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 }),
|
|
89
|
+
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" }),
|
|
90
90
|
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, onCsvDownload: console.log, reload: reload, rowHeight: "auto", schema: schemaWithFrontendConfig, state: state }),
|
|
91
91
|
react_1.default.createElement(json_renderer_1.JsonRenderer, { value: state })));
|
|
92
92
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxf/data-grid",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.48.2",
|
|
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.47.0",
|
|
35
35
|
"@uxf/core-react": "11.47.0",
|
|
36
|
-
"@uxf/ui": "11.
|
|
36
|
+
"@uxf/ui": "11.48.2",
|
|
37
37
|
"dayjs": "1.11.13",
|
|
38
38
|
"deepmerge": "4.3.1",
|
|
39
39
|
"fast-glob": "3.3.2",
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ActionCellWrapper = ActionCellWrapper;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
function ActionCellWrapper(props) {
|
|
9
|
+
return react_1.default.createElement("div", { className: "uxf-dg-table__action-cell" }, props.children);
|
|
10
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ButtonListProps } from "@uxf/ui/button-list";
|
|
2
|
-
import React from "react";
|
|
2
|
+
import React, { ReactNode } from "react";
|
|
3
3
|
export interface ActionCellProps {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
buttons?: ButtonListProps["buttons"];
|
|
6
|
+
visibleButtonsCount?: ButtonListProps["visibleButtonsCount"];
|
|
6
7
|
}
|
|
7
8
|
export declare function ActionCell(props: ActionCellProps): React.JSX.Element;
|
|
@@ -4,9 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ActionCell = ActionCell;
|
|
7
|
+
const is_not_empty_1 = require("@uxf/core/utils/is-not-empty");
|
|
8
|
+
const is_not_nil_1 = require("@uxf/core/utils/is-not-nil");
|
|
7
9
|
const button_list_1 = require("@uxf/ui/button-list");
|
|
8
10
|
const react_1 = __importDefault(require("react"));
|
|
9
11
|
function ActionCell(props) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
var _a;
|
|
13
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
14
|
+
(0, is_not_nil_1.isNotNil)(props.buttons) && (0, is_not_empty_1.isNotEmpty)(props.buttons) && (react_1.default.createElement(button_list_1.ButtonList, { buttons: props.buttons, size: "sm", variant: "secondary", visibleButtonsCount: (_a = props.visibleButtonsCount) !== null && _a !== void 0 ? _a : 0 })),
|
|
15
|
+
props.children));
|
|
12
16
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ActionCell } from "./action-cell";
|
|
2
|
+
import { ActionCellWrapper } from "./action-cell-wrapper";
|
|
2
3
|
import { Body } from "./body";
|
|
3
4
|
import { Cell } from "./cell";
|
|
4
5
|
import { Header } from "./header";
|
|
@@ -12,6 +13,7 @@ export declare const Table: import("react").ForwardRefExoticComponent<import("./
|
|
|
12
13
|
HeaderCell: import("react").ForwardRefExoticComponent<import("./header-cell").HeaderCellProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
13
14
|
Cell: typeof Cell;
|
|
14
15
|
ActionCell: typeof ActionCell;
|
|
16
|
+
ActionCellWrapper: typeof ActionCellWrapper;
|
|
15
17
|
HeaderActionCell: typeof HeaderActionCell;
|
|
16
18
|
Header: typeof Header;
|
|
17
19
|
SelectRowCheckbox: typeof SelectRowCheckbox;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Table = void 0;
|
|
4
4
|
const action_cell_1 = require("./action-cell");
|
|
5
|
+
const action_cell_wrapper_1 = require("./action-cell-wrapper");
|
|
5
6
|
const body_1 = require("./body");
|
|
6
7
|
const cell_1 = require("./cell");
|
|
7
8
|
const header_1 = require("./header");
|
|
@@ -17,6 +18,7 @@ exports.Table = Object.assign(root_1.Root, {
|
|
|
17
18
|
HeaderCell: header_cell_1.HeaderCell,
|
|
18
19
|
Cell: cell_1.Cell,
|
|
19
20
|
ActionCell: action_cell_1.ActionCell,
|
|
21
|
+
ActionCellWrapper: action_cell_wrapper_1.ActionCellWrapper,
|
|
20
22
|
HeaderActionCell: header_action_cell_1.HeaderActionCell,
|
|
21
23
|
Header: header_1.Header,
|
|
22
24
|
SelectRowCheckbox: select_row_checkbox_1.SelectRowCheckbox,
|
package/table-v2/table-v2.js
CHANGED
|
@@ -71,5 +71,6 @@ function DataGridTableV2(props) {
|
|
|
71
71
|
return (react_1.default.createElement(components_1.Table.Cell, { column: column, key: column.name },
|
|
72
72
|
react_1.default.createElement(BodyCell, { column: column, reload: props.reload, row: row, value: row[column.name] })));
|
|
73
73
|
}),
|
|
74
|
-
(0, is_not_nil_1.isNotNil)(props.actionCell) && react_1.default.createElement(
|
|
74
|
+
(0, is_not_nil_1.isNotNil)(props.actionCell) && (react_1.default.createElement(components_1.Table.ActionCellWrapper, null,
|
|
75
|
+
react_1.default.createElement(props.actionCell.Component, { reload: props.reload, row: row })))))))));
|
|
75
76
|
}
|
|
@@ -11,12 +11,13 @@ const schema_1 = require("../_story-utils/schema");
|
|
|
11
11
|
const body_cell_1 = require("../body-cell");
|
|
12
12
|
const hidden_columns_button_1 = require("../hidden-columns-button");
|
|
13
13
|
const use_data_grid_control_1 = require("../use-data-grid-control");
|
|
14
|
+
const action_cell_1 = require("./components/action-cell");
|
|
14
15
|
const table_v2_1 = require("./table-v2");
|
|
15
16
|
function Default() {
|
|
16
17
|
const { state, actions } = (0, use_data_grid_control_1.useDataGridControl)({ schema: schema_1.schema, isDebug: true });
|
|
17
18
|
const reload = () => new Promise(() => null);
|
|
18
19
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
19
20
|
react_1.default.createElement(hidden_columns_button_1.DataGridHiddenColumnsButton, { actions: actions, schema: schema_1.schema, state: state }),
|
|
20
|
-
react_1.default.createElement(table_v2_1.DataGridTableV2, { actionCell: { width: 150, Component: () => react_1.default.createElement(
|
|
21
|
+
react_1.default.createElement(table_v2_1.DataGridTableV2, { actionCell: { width: 150, Component: () => react_1.default.createElement(action_cell_1.ActionCell, null, "Action cell") }, actions: actions, bodyCells: body_cell_1.BodyCells, data: data_1.data, error: undefined, isLoading: true, isRowSelectable: true, reload: reload, schema: schema_1.schema, state: state }),
|
|
21
22
|
react_1.default.createElement(json_renderer_1.JsonRenderer, { value: state })));
|
|
22
23
|
}
|