@uxf/data-grid 11.19.3 → 11.20.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.
Files changed (77) hide show
  1. package/_components/drawer.js +2 -2
  2. package/components.d.ts +5 -0
  3. package/components.js +5 -0
  4. package/data-grid-custom-example.stories.d.ts +2 -0
  5. package/data-grid-custom-example.stories.js +57 -0
  6. package/data-grid.js +16 -14
  7. package/data-grid.stories.js +0 -1
  8. package/export-button/export-button.d.ts +4 -3
  9. package/export-button/export-button.js +3 -1
  10. package/export-button/export-button.stories.js +1 -1
  11. package/filter-handler/entity-multi-select.js +7 -3
  12. package/filter-list/filter-list.d.ts +4 -1
  13. package/filter-list/filter-list.js +4 -2
  14. package/filter-list/filter-list.stories.js +1 -1
  15. package/filters/filters.d.ts +4 -4
  16. package/filters/filters.js +4 -2
  17. package/filters/filters.stories.js +1 -1
  18. package/filters-button/filters-button.d.ts +4 -4
  19. package/filters-button/filters-button.js +4 -2
  20. package/filters-button/filters-button.stories.js +1 -1
  21. package/footer/footer.d.ts +7 -0
  22. package/footer/footer.js +13 -0
  23. package/footer/index.d.ts +1 -0
  24. package/footer/index.js +17 -0
  25. package/fulltext-input/fulltext-input.d.ts +4 -3
  26. package/fulltext-input/fulltext-input.js +3 -1
  27. package/fulltext-input/fulltext-input.stories.js +1 -1
  28. package/hidden-columns/hidden-columns.d.ts +4 -3
  29. package/hidden-columns/hidden-columns.js +3 -1
  30. package/hidden-columns/hidden-columns.stories.js +1 -1
  31. package/hidden-columns-button/hidden-columns-button.d.ts +4 -3
  32. package/hidden-columns-button/hidden-columns-button.js +3 -1
  33. package/hidden-columns-button/hidden-columns-button.stories.js +1 -1
  34. package/linear-progress/linear-progress.d.ts +4 -0
  35. package/linear-progress/linear-progress.js +3 -1
  36. package/package.json +4 -3
  37. package/pagination/pagination.d.ts +4 -0
  38. package/pagination/pagination.js +3 -1
  39. package/pagination/pagination.stories.js +1 -1
  40. package/root/index.d.ts +1 -0
  41. package/root/index.js +17 -0
  42. package/root/root.d.ts +8 -0
  43. package/root/root.js +13 -0
  44. package/row-counts/row-counts.d.ts +4 -0
  45. package/row-counts/row-counts.js +4 -2
  46. package/row-counts/row-counts.stories.js +1 -1
  47. package/rows-per-page-select/rows-per-page-select.d.ts +2 -0
  48. package/rows-per-page-select/rows-per-page-select.js +3 -1
  49. package/rows-per-page-select/rows-per-page-select.stories.js +1 -1
  50. package/selected-rows-toolbar/selected-rows-toolbar.d.ts +4 -0
  51. package/selected-rows-toolbar/selected-rows-toolbar.js +3 -1
  52. package/selected-rows-toolbar/selected-rows-toolbar.stories.js +1 -1
  53. package/table/table.d.ts +5 -2
  54. package/table/table.js +7 -4
  55. package/table/table.stories.js +1 -1
  56. package/table/types.d.ts +2 -0
  57. package/table-v2/hooks/use-resizable-columns.js +5 -6
  58. package/table-v2/table-v2.d.ts +4 -2
  59. package/table-v2/table-v2.js +4 -2
  60. package/table-v2/table-v2.stories.js +2 -2
  61. package/table-v2/types.d.ts +2 -0
  62. package/toolbar/index.d.ts +1 -0
  63. package/toolbar/index.js +17 -0
  64. package/toolbar/toolbar.d.ts +6 -0
  65. package/toolbar/toolbar.js +13 -0
  66. package/toolbar-control/toolbar-control.d.ts +4 -1
  67. package/toolbar-control/toolbar-control.js +8 -6
  68. package/toolbar-control/toolbar-control.stories.js +1 -1
  69. package/toolbar-customs/toolbar-customs.d.ts +4 -0
  70. package/toolbar-customs/toolbar-customs.js +3 -1
  71. package/toolbar-customs/toolbar-customs.stories.js +1 -1
  72. package/toolbar-tabs/toolbar-tabs.d.ts +5 -1
  73. package/toolbar-tabs/toolbar-tabs.js +4 -2
  74. package/toolbar-tabs/toolbar-tabs.stories.js +1 -1
  75. package/types/data-grid-props.d.ts +5 -4
  76. package/use-data-grid-fetching/use-data-grid-fetching.d.ts +0 -1
  77. package/use-data-grid-fetching/use-data-grid-fetching.js +3 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxf/data-grid",
3
- "version": "11.19.3",
3
+ "version": "11.20.0",
4
4
  "description": "UXF DataGrid",
5
5
  "homepage": "https://gitlab.com/uxf-npm/data-grid#readme",
6
6
  "main": "index.js",
@@ -31,8 +31,9 @@
31
31
  "typecheck": "tsc --noEmit --skipLibCheck"
32
32
  },
33
33
  "dependencies": {
34
- "@uxf/core": "11.19.0",
35
- "@uxf/ui": "11.19.0",
34
+ "@uxf/core": "11.20.0",
35
+ "@uxf/core-react": "11.20.0",
36
+ "@uxf/ui": "11.20.0",
36
37
  "dayjs": "1.11.10",
37
38
  "deepmerge": "4.3.1",
38
39
  "fast-glob": "3.3.2",
@@ -1,8 +1,12 @@
1
1
  import { Nullish } from "@uxf/core/types";
2
2
  import React from "react";
3
3
  import { DataGridControl } from "../use-data-grid-control";
4
+ /** @deprecated Use DataGridPaginationProps */
4
5
  interface PaginationProps extends DataGridControl {
5
6
  count: number | Nullish;
6
7
  }
8
+ export type DataGridPaginationProps = PaginationProps;
9
+ /** @deprecated Use DataGridPagination */
7
10
  export declare function Pagination(props: PaginationProps): React.JSX.Element;
11
+ export declare const DataGridPagination: typeof Pagination;
8
12
  export {};
@@ -3,10 +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.Pagination = void 0;
6
+ exports.DataGridPagination = exports.Pagination = void 0;
7
7
  const is_not_nil_1 = require("@uxf/core/utils/is-not-nil");
8
8
  const pagination_1 = require("@uxf/ui/pagination");
9
9
  const react_1 = __importDefault(require("react"));
10
+ /** @deprecated Use DataGridPagination */
10
11
  function Pagination(props) {
11
12
  const pageCount = (0, is_not_nil_1.isNotNil)(props.count) && props.count > 0
12
13
  ? Math.max(Math.ceil(props.count / props.state.request.perPage), 1)
@@ -14,3 +15,4 @@ function Pagination(props) {
14
15
  return (react_1.default.createElement(pagination_1.Pagination, { count: pageCount, page: props.state.request.page + 1, onPageChange: (value) => props.actions.changePage(value - 1) }));
15
16
  }
16
17
  exports.Pagination = Pagination;
18
+ exports.DataGridPagination = Pagination;
@@ -12,7 +12,7 @@ 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.Pagination, { state: state, actions: actions, count: 100 }),
15
+ react_1.default.createElement(pagination_1.DataGridPagination, { state: state, actions: actions, count: 100 }),
16
16
  react_1.default.createElement(json_renderer_1.JsonRenderer, { value: state })));
17
17
  }
18
18
  exports.Default = Default;
@@ -0,0 +1 @@
1
+ export * from "./root";
package/root/index.js ADDED
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./root"), exports);
package/root/root.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ import React, { ReactNode } from "react";
2
+ export interface DataGridRootProps {
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
+ className?: string;
7
+ }
8
+ export declare function DataGridRoot(props: DataGridRootProps): React.JSX.Element;
package/root/root.js ADDED
@@ -0,0 +1,13 @@
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.DataGridRoot = void 0;
7
+ const cx_1 = require("@uxf/core/utils/cx");
8
+ const react_1 = __importDefault(require("react"));
9
+ const classes_1 = require("../utils/classes");
10
+ function DataGridRoot(props) {
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
+ }
13
+ exports.DataGridRoot = DataGridRoot;
@@ -1,8 +1,12 @@
1
1
  import React from "react";
2
2
  import { DataGridControl } from "../use-data-grid-control";
3
+ /** @deprecated Use DataGridRowCountsProps */
3
4
  export interface RowCountsProps {
4
5
  state: DataGridControl["state"];
5
6
  totalCount: number;
6
7
  count: number;
7
8
  }
9
+ export type DataGridRowCountsProps = RowCountsProps;
10
+ /** @deprecated Use DataGridRowCounts */
8
11
  export declare function RowCounts(props: RowCountsProps): React.JSX.Element;
12
+ export declare const DataGridRowCounts: typeof RowCounts;
@@ -3,9 +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.RowCounts = void 0;
7
- const show_1 = require("@uxf/core/components/show");
6
+ exports.DataGridRowCounts = exports.RowCounts = void 0;
7
+ const show_1 = require("@uxf/core-react/components/show");
8
8
  const react_1 = __importDefault(require("react"));
9
+ /** @deprecated Use DataGridRowCounts */
9
10
  function RowCounts(props) {
10
11
  const fromNumber = props.state.request.page * props.state.request.perPage + 1;
11
12
  const toNumber = Math.min(props.state.request.page * props.state.request.perPage + props.state.request.perPage, props.totalCount);
@@ -22,3 +23,4 @@ function RowCounts(props) {
22
23
  ")")));
23
24
  }
24
25
  exports.RowCounts = RowCounts;
26
+ exports.DataGridRowCounts = 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, count: 100 });
13
+ return react_1.default.createElement(row_counts_1.DataGridRowCounts, { state: state, totalCount: 150, count: 100 });
14
14
  }
15
15
  exports.Default = Default;
@@ -1,3 +1,5 @@
1
1
  import React from "react";
2
2
  import { DataGridControl } from "../use-data-grid-control";
3
+ /** @deprecated Use DataGridRowsPerPageSelect */
3
4
  export declare function RowsPerPageSelect(props: DataGridControl): React.JSX.Element;
5
+ export declare const DataGridRowsPerPageSelect: typeof 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.RowsPerPageSelect = void 0;
6
+ exports.DataGridRowsPerPageSelect = exports.RowsPerPageSelect = void 0;
7
7
  const select_1 = require("@uxf/ui/select");
8
8
  const react_1 = __importDefault(require("react"));
9
9
  const PER_PAGE_OPTIONS = [
@@ -12,9 +12,11 @@ const PER_PAGE_OPTIONS = [
12
12
  { id: 50, label: "50" },
13
13
  { id: 100, label: "100" },
14
14
  ];
15
+ /** @deprecated Use DataGridRowsPerPageSelect */
15
16
  function RowsPerPageSelect(props) {
16
17
  return (react_1.default.createElement("div", { className: "uxf-data-grid__rows-per-page" },
17
18
  react_1.default.createElement("label", { htmlFor: "uxf-data-grid--select-per-page" }, "Po\u010Det \u0159\u00E1dk\u016F"),
18
19
  react_1.default.createElement(select_1.Select, { id: "uxf-data-grid--select-per-page", value: props.state.request.perPage, onChange: (value) => props.actions.changePerPage(value !== null && value !== void 0 ? value : 10), options: PER_PAGE_OPTIONS, size: "small", label: "Po\u010Det \u0159\u00E1dk\u016F", hiddenLabel: true, name: "rows-per-page" })));
19
20
  }
20
21
  exports.RowsPerPageSelect = RowsPerPageSelect;
22
+ exports.DataGridRowsPerPageSelect = RowsPerPageSelect;
@@ -12,7 +12,7 @@ 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.RowsPerPageSelect, { state: state, actions: actions }),
15
+ react_1.default.createElement(rows_per_page_select_1.DataGridRowsPerPageSelect, { state: state, actions: actions }),
16
16
  react_1.default.createElement(json_renderer_1.JsonRenderer, { value: state })));
17
17
  }
18
18
  exports.Default = Default;
@@ -4,8 +4,12 @@ export interface SelectedRowsToolbarActionsProps extends DataGridControl {
4
4
  reload: () => void;
5
5
  }
6
6
  export type SelectedRowsToolbarActionsComponent = FC<SelectedRowsToolbarActionsProps>;
7
+ /** @deprecated Use DataGridSelectedRowsToolbarProps */
7
8
  export interface SelectedRowsToolbarProps extends DataGridControl {
8
9
  Actions?: SelectedRowsToolbarActionsComponent;
9
10
  onReload?: () => void;
10
11
  }
12
+ export type DataGridSelectedRowsToolbarProps = SelectedRowsToolbarProps;
13
+ /** @deprecated Use DataGridSelectedRowsToolbar */
11
14
  export declare function SelectedRowsToolbar(props: SelectedRowsToolbarProps): React.JSX.Element | null;
15
+ export declare const DataGridSelectedRowsToolbar: typeof SelectedRowsToolbar;
@@ -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.SelectedRowsToolbar = void 0;
6
+ exports.DataGridSelectedRowsToolbar = exports.SelectedRowsToolbar = void 0;
7
7
  const button_1 = require("@uxf/ui/button");
8
8
  const react_1 = __importDefault(require("react"));
9
9
  const getText = (count) => {
@@ -15,6 +15,7 @@ const getText = (count) => {
15
15
  }
16
16
  return `Vybráno ${count} záznamů`;
17
17
  };
18
+ /** @deprecated Use DataGridSelectedRowsToolbar */
18
19
  function SelectedRowsToolbar(props) {
19
20
  if (!props.state.selectedRows) {
20
21
  return null;
@@ -30,3 +31,4 @@ function SelectedRowsToolbar(props) {
30
31
  react_1.default.createElement(button_1.Button, { onClick: () => props.actions.setSelectedRows([]) }, "Zru\u0161it v\u00FDb\u011Br")))));
31
32
  }
32
33
  exports.SelectedRowsToolbar = SelectedRowsToolbar;
34
+ exports.DataGridSelectedRowsToolbar = SelectedRowsToolbar;
@@ -37,7 +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.SelectedRowsToolbar, { state: state, actions: actions, Actions: () => (react_1.default.createElement(button_1.Button, { isIconButton: true },
40
+ react_1.default.createElement(selected_rows_toolbar_1.DataGridSelectedRowsToolbar, { state: state, actions: actions, Actions: () => (react_1.default.createElement(button_1.Button, { isIconButton: true },
41
41
  react_1.default.createElement(icon_1.Icon, { name: "camera" }))) }),
42
42
  react_1.default.createElement(json_renderer_1.JsonRenderer, { value: state })));
43
43
  }
package/table/table.d.ts CHANGED
@@ -1,3 +1,6 @@
1
1
  import React from "react";
2
- import { TableProps } from "./types";
3
- export declare function Table(props: TableProps<any>): React.JSX.Element;
2
+ import { DataGridTableProps } from "./types";
3
+ /** @deprecated will be remove, use DataGridTableV2 */
4
+ export declare function Table(props: DataGridTableProps<any>): React.JSX.Element;
5
+ /** @deprecated will be remove, use DataGridTableV2 */
6
+ export declare const DataGridTable: typeof Table;
package/table/table.js CHANGED
@@ -26,9 +26,9 @@ 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.Table = void 0;
30
- const show_1 = require("@uxf/core/components/show");
31
- const useIsMounted_1 = require("@uxf/core/hooks/useIsMounted");
29
+ exports.DataGridTable = exports.Table = void 0;
30
+ const show_1 = require("@uxf/core-react/components/show");
31
+ const use_is_mounted_1 = require("@uxf/core-react/hooks/use-is-mounted");
32
32
  const react_1 = __importStar(require("react"));
33
33
  const react_data_grid_1 = __importDefault(require("react-data-grid"));
34
34
  const select_row_checkbox_1 = require("./components/select-row-checkbox");
@@ -36,9 +36,10 @@ const use_rdg_visuals_1 = require("./hooks/use-rdg-visuals");
36
36
  const use_react_data_grid_columns_1 = require("./hooks/use-react-data-grid-columns");
37
37
  const defaultKeyExtractor = (r) => r.id;
38
38
  const DefaultNoRowsFallback = () => react_1.default.createElement("div", null, "no rows");
39
+ /** @deprecated will be remove, use DataGridTableV2 */
39
40
  function Table(props) {
40
41
  var _a, _b, _c, _d, _e, _f, _g;
41
- const isMounted = (0, useIsMounted_1.useIsMounted)();
42
+ const isMounted = (0, use_is_mounted_1.useIsMounted)();
42
43
  const rowHeight = (_a = props.rowHeight) !== null && _a !== void 0 ? _a : 44;
43
44
  const headerRowHeight = (_b = props.headerRowHeight) !== null && _b !== void 0 ? _b : 36;
44
45
  const keyExtractor = (_c = props.keyExtractor) !== null && _c !== void 0 ? _c : defaultKeyExtractor;
@@ -86,3 +87,5 @@ function Table(props) {
86
87
  react_1.default.createElement(react_data_grid_1.default, { ref: rdgVisuals.ref, style: reactDataGridStyles, className: rdgVisuals.className, columns: columns, rows: props.data, enableVirtualization: false, onSortColumnsChange: onSortColumnChange, sortColumns: sortColumns, rowHeight: rdgVisuals.rowHeight, headerRowHeight: rdgVisuals.headerRowHeight, rowClass: props.rowClass, rowKeyGetter: (_e = props.keyExtractor) !== null && _e !== void 0 ? _e : defaultKeyExtractor, selectedRows: new Set((_g = (_f = props.state.selectedRows) === null || _f === void 0 ? void 0 : _f.map(keyExtractor)) !== null && _g !== void 0 ? _g : []), onSelectedRowsChange: onSelectRows, renderers: components })));
87
88
  }
88
89
  exports.Table = Table;
90
+ /** @deprecated will be remove, use DataGridTableV2 */
91
+ exports.DataGridTable = Table;
@@ -14,7 +14,7 @@ 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.Table, { state: state, actions: actions, data: data_1.data, isLoading: true, error: undefined, schema: schema_1.schema, bodyCells: body_cell_1.BodyCells, isRowSelectable: true }),
17
+ react_1.default.createElement(table_1.DataGridTable, { state: state, actions: actions, data: data_1.data, isLoading: true, error: undefined, schema: schema_1.schema, bodyCells: body_cell_1.BodyCells, isRowSelectable: true }),
18
18
  react_1.default.createElement(json_renderer_1.JsonRenderer, { value: state })));
19
19
  }
20
20
  exports.Default = Default;
package/table/types.d.ts CHANGED
@@ -4,6 +4,7 @@ import { KeyExtractor } from "../types/core";
4
4
  import { Schema } from "../types/schema";
5
5
  import { DataGridControl } from "../use-data-grid-control";
6
6
  import { NoRowsFallbackComponent } from "./no-rows-fallback";
7
+ /** @deprecated Use DataGridTableProps */
7
8
  export interface TableProps<Row> extends DataGridControl {
8
9
  schema: Schema<any>;
9
10
  data: Row[];
@@ -22,3 +23,4 @@ export interface TableProps<Row> extends DataGridControl {
22
23
  NoRowsFallback?: NoRowsFallbackComponent;
23
24
  isRowSelectable?: boolean;
24
25
  }
26
+ export type DataGridTableProps<Row> = TableProps<Row>;
@@ -21,17 +21,16 @@ function useResizableColumns(columns, actionCell, actions) {
21
21
  let tempColumnSizes = [];
22
22
  const onMouseMove = (e) => {
23
23
  const gridColumns = columns.map((_, i) => {
24
- var _a, _b, _c, _d, _e, _f;
24
+ var _a, _b, _c, _d;
25
25
  const columnRef = columnRefs.current[i];
26
26
  if (i === activeIndex) {
27
- const tableLeft = (_b = (_a = tableRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().left) !== null && _b !== void 0 ? _b : 0;
28
- const tableScrollLeft = (_d = (_c = tableRef.current) === null || _c === void 0 ? void 0 : _c.scrollLeft) !== null && _d !== void 0 ? _d : 0;
29
- const columnOffsetLeft = (_e = columnRef === null || columnRef === void 0 ? void 0 : columnRef.offsetLeft) !== null && _e !== void 0 ? _e : 0;
27
+ const tableScrollLeft = (_b = (_a = tableRef.current) === null || _a === void 0 ? void 0 : _a.scrollLeft) !== null && _b !== void 0 ? _b : 0;
28
+ const columnOffsetLeft = (_c = columnRef === null || columnRef === void 0 ? void 0 : columnRef.offsetLeft) !== null && _c !== void 0 ? _c : 0;
30
29
  const clickPositionX = e.clientX + tableScrollLeft;
31
- const width = clickPositionX - columnOffsetLeft - tableLeft;
30
+ const width = clickPositionX - columnOffsetLeft;
32
31
  return width >= 50 ? width : 50;
33
32
  }
34
- return (_f = columnRef === null || columnRef === void 0 ? void 0 : columnRef.offsetWidth) !== null && _f !== void 0 ? _f : 50;
33
+ return (_d = columnRef === null || columnRef === void 0 ? void 0 : columnRef.offsetWidth) !== null && _d !== void 0 ? _d : 50;
35
34
  });
36
35
  // TODO @vejvis - jak tohle udělat lépe??
37
36
  tempColumnSizes = gridColumns;
@@ -1,3 +1,5 @@
1
1
  import React from "react";
2
- import { TableProps } from "./types";
3
- export declare function TableV2(props: TableProps<any>): React.JSX.Element;
2
+ import { DataGridTableProps } from "./types";
3
+ /** @deprecated Use DataGridTableV2 */
4
+ export declare function TableV2(props: DataGridTableProps<any>): React.JSX.Element;
5
+ export declare const DataGridTableV2: typeof TableV2;
@@ -3,8 +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.TableV2 = void 0;
7
- const show_1 = require("@uxf/core/components/show");
6
+ exports.DataGridTableV2 = exports.TableV2 = void 0;
7
+ const show_1 = require("@uxf/core-react/components/show");
8
8
  const is_nil_1 = require("@uxf/core/utils/is-nil");
9
9
  const is_not_nil_1 = require("@uxf/core/utils/is-not-nil");
10
10
  const rem_1 = require("@uxf/styles/units/rem");
@@ -14,6 +14,7 @@ const use_resizable_columns_1 = require("./hooks/use-resizable-columns");
14
14
  const get_grid_template_rows_1 = require("./utils/get-grid-template-rows");
15
15
  const defaultKeyExtractor = (r) => r.id;
16
16
  const DefaultBodyCell = () => "Unknown body cell.";
17
+ /** @deprecated Use DataGridTableV2 */
17
18
  function TableV2(props) {
18
19
  var _a, _b, _c, _d;
19
20
  const keyExtractor = (_a = props.keyExtractor) !== null && _a !== void 0 ? _a : defaultKeyExtractor;
@@ -49,3 +50,4 @@ function TableV2(props) {
49
50
  react_1.default.createElement(props.actionCell.Component, { row: row, reload: () => { var _a; return (_a = props.onReload) === null || _a === void 0 ? void 0 : _a.call(props); } })))))))));
50
51
  }
51
52
  exports.TableV2 = TableV2;
53
+ exports.DataGridTableV2 = TableV2;
@@ -15,8 +15,8 @@ const table_v2_1 = require("./table-v2");
15
15
  function Default() {
16
16
  const { state, actions } = (0, use_data_grid_control_1.useDataGridControl)({ schema: schema_1.schema, isDebug: true });
17
17
  return (react_1.default.createElement(react_1.default.Fragment, null,
18
- react_1.default.createElement(hidden_columns_button_1.HiddenColumnsButton, { schema: schema_1.schema, state: state, actions: actions }),
19
- react_1.default.createElement(table_v2_1.TableV2, { state: state, actions: actions, data: data_1.data, isLoading: true, error: undefined, schema: schema_1.schema, bodyCells: body_cell_1.BodyCells, isRowSelectable: true, actionCell: { width: 150, Component: () => react_1.default.createElement("div", null, "ActionCell") } }),
18
+ react_1.default.createElement(hidden_columns_button_1.DataGridHiddenColumnsButton, { schema: schema_1.schema, state: state, actions: actions }),
19
+ react_1.default.createElement(table_v2_1.DataGridTableV2, { state: state, actions: actions, data: data_1.data, isLoading: true, error: undefined, schema: schema_1.schema, bodyCells: body_cell_1.BodyCells, isRowSelectable: true, actionCell: { width: 150, Component: () => react_1.default.createElement("div", null, "ActionCell") } }),
20
20
  react_1.default.createElement(json_renderer_1.JsonRenderer, { value: state })));
21
21
  }
22
22
  exports.Default = Default;
@@ -4,6 +4,7 @@ import { KeyExtractor } from "../types/core";
4
4
  import { Schema } from "../types/schema";
5
5
  import { DataGridControl } from "../use-data-grid-control";
6
6
  import { NoRowsFallbackComponent } from "./no-rows-fallback";
7
+ /** @deprecated Use DataGridTableProps */
7
8
  export interface TableProps<Row> extends DataGridControl {
8
9
  schema: Schema<any>;
9
10
  data: Row[];
@@ -22,3 +23,4 @@ export interface TableProps<Row> extends DataGridControl {
22
23
  NoRowsFallback?: NoRowsFallbackComponent;
23
24
  isRowSelectable?: boolean;
24
25
  }
26
+ export type DataGridTableProps<Row> = TableProps<Row>;
@@ -0,0 +1 @@
1
+ export * from "./toolbar";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./toolbar"), exports);
@@ -0,0 +1,6 @@
1
+ import React, { ReactNode } from "react";
2
+ export interface DataGridToolbarProps {
3
+ children: ReactNode;
4
+ noBorder?: boolean;
5
+ }
6
+ export declare function DataGridToolbar(props: DataGridToolbarProps): React.JSX.Element;
@@ -0,0 +1,13 @@
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.DataGridToolbar = void 0;
7
+ const cx_1 = require("@uxf/core/utils/cx");
8
+ const react_1 = __importDefault(require("react"));
9
+ const classes_1 = require("../utils/classes");
10
+ function DataGridToolbar(props) {
11
+ return react_1.default.createElement("div", { className: (0, cx_1.cx)("uxf-data-grid__toolbar", props.noBorder && classes_1.NO_BORDER_CLASS) }, props.children);
12
+ }
13
+ exports.DataGridToolbar = DataGridToolbar;
@@ -3,11 +3,14 @@ import React from "react";
3
3
  import { FilterHandlers } from "../filter-handler";
4
4
  import { CsvDownloadHandler, Schema } from "../types";
5
5
  import { DataGridControl } from "../use-data-grid-control";
6
+ /** @deprecated Use DataGridToolbarControlProps */
6
7
  export interface ToolbarControlProps extends DataGridControl {
7
- gridName: string | undefined;
8
8
  schema: Schema<any>;
9
9
  filterHandlers: FilterHandlers;
10
10
  onCsvDownload?: CsvDownloadHandler;
11
11
  isBorderHidden?: boolean | Nullish;
12
12
  }
13
+ export type DataGridToolbarControlProps = ToolbarControlProps;
14
+ /** @deprecated Use DataGridToolbarControl */
13
15
  export declare function ToolbarControl(props: ToolbarControlProps): React.JSX.Element;
16
+ export declare const DataGridToolbarControl: typeof ToolbarControl;
@@ -3,20 +3,22 @@ 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.ToolbarControl = void 0;
7
- const hide_1 = require("@uxf/core/components/hide");
6
+ exports.DataGridToolbarControl = exports.ToolbarControl = void 0;
7
+ const hide_1 = require("@uxf/core-react/components/hide");
8
8
  const is_not_nil_1 = require("@uxf/core/utils/is-not-nil");
9
9
  const react_1 = __importDefault(require("react"));
10
10
  const export_button_1 = require("../export-button");
11
11
  const filters_button_1 = require("../filters-button");
12
12
  const fulltext_input_1 = require("../fulltext-input");
13
13
  const hidden_columns_button_1 = require("../hidden-columns-button");
14
+ /** @deprecated Use DataGridToolbarControl */
14
15
  function ToolbarControl(props) {
15
16
  return (react_1.default.createElement("div", { className: "uxf-data-grid__toolbar-control" },
16
17
  react_1.default.createElement(hide_1.Hide, { when: !props.schema.fullText },
17
- react_1.default.createElement(fulltext_input_1.FulltextInput, { state: props.state, actions: props.actions })),
18
- (0, is_not_nil_1.isNotNil)(props.onCsvDownload) && (react_1.default.createElement(export_button_1.ExportButton, { state: props.state, actions: props.actions, schema: props.schema, onCsvDownload: props.onCsvDownload })),
19
- react_1.default.createElement(hidden_columns_button_1.HiddenColumnsButton, { state: props.state, actions: props.actions, schema: props.schema }),
20
- react_1.default.createElement(filters_button_1.FiltersButton, { state: props.state, actions: props.actions, gridName: props.gridName, schema: props.schema, filterHandlers: props.filterHandlers })));
18
+ react_1.default.createElement(fulltext_input_1.DataGridFulltextInput, { state: props.state, actions: props.actions })),
19
+ (0, is_not_nil_1.isNotNil)(props.onCsvDownload) && (react_1.default.createElement(export_button_1.DataGridExportButton, { state: props.state, actions: props.actions, schema: props.schema, onCsvDownload: props.onCsvDownload })),
20
+ react_1.default.createElement(hidden_columns_button_1.DataGridHiddenColumnsButton, { state: props.state, actions: props.actions, schema: props.schema }),
21
+ react_1.default.createElement(filters_button_1.DataGridFiltersButton, { state: props.state, actions: props.actions, schema: props.schema, filterHandlers: props.filterHandlers })));
21
22
  }
22
23
  exports.ToolbarControl = ToolbarControl;
24
+ exports.DataGridToolbarControl = ToolbarControl;
@@ -14,7 +14,7 @@ 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.ToolbarControl, { state: state, actions: actions, schema: schema_1.schema, filterHandlers: filter_handler_1.defaultFilterHandlers, gridName: "grid-name", onCsvDownload: console.log })),
17
+ react_1.default.createElement(toolbar_control_1.DataGridToolbarControl, { state: state, actions: actions, schema: schema_1.schema, filterHandlers: filter_handler_1.defaultFilterHandlers, onCsvDownload: console.log })),
18
18
  react_1.default.createElement(json_renderer_1.JsonRenderer, { value: state })));
19
19
  }
20
20
  exports.Default = Default;
@@ -1,5 +1,6 @@
1
1
  import { ButtonVariant } from "@uxf/ui/button";
2
2
  import React, { ReactElement } from "react";
3
+ /** @deprecated Use DataGridToolbarCustomsProps */
3
4
  export interface ToolbarCustomsProps {
4
5
  buttons?: {
5
6
  label: string | ReactElement;
@@ -8,4 +9,7 @@ export interface ToolbarCustomsProps {
8
9
  variant?: ButtonVariant;
9
10
  }[];
10
11
  }
12
+ export type DataGridToolbarCustomsProps = ToolbarCustomsProps;
13
+ /** @deprecated Use DataGridToolbarCustoms */
11
14
  export declare function ToolbarCustoms(props: ToolbarCustomsProps): React.JSX.Element | null;
15
+ export declare const DataGridToolbarCustoms: typeof ToolbarCustoms;
@@ -3,10 +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.ToolbarCustoms = void 0;
6
+ exports.DataGridToolbarCustoms = exports.ToolbarCustoms = void 0;
7
7
  const button_1 = require("@uxf/ui/button");
8
8
  const button_list_1 = require("@uxf/ui/button-list");
9
9
  const react_1 = __importDefault(require("react"));
10
+ /** @deprecated Use DataGridToolbarCustoms */
10
11
  function ToolbarCustoms(props) {
11
12
  if (!props.buttons) {
12
13
  return null;
@@ -16,3 +17,4 @@ function ToolbarCustoms(props) {
16
17
  react_1.default.createElement("div", { className: "uxf-data-grid__toolbar-customs-desktop" }, props.buttons.map((button, index) => (react_1.default.createElement(button_1.Button, { key: index, href: button.href, onClick: button.onClick, size: "sm", variant: button.variant }, button.label))))));
17
18
  }
18
19
  exports.ToolbarCustoms = ToolbarCustoms;
20
+ exports.DataGridToolbarCustoms = ToolbarCustoms;
@@ -7,7 +7,7 @@ exports.Default = void 0;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const toolbar_customs_1 = require("./toolbar-customs");
9
9
  function Default() {
10
- return (react_1.default.createElement(toolbar_customs_1.ToolbarCustoms, { buttons: [
10
+ return (react_1.default.createElement(toolbar_customs_1.DataGridToolbarCustoms, { buttons: [
11
11
  { label: "Default", href: "/", variant: "default" },
12
12
  { label: "Text", href: "/", variant: "text" },
13
13
  { label: "Outlined", href: "/", variant: "outlined" },
@@ -1,7 +1,11 @@
1
1
  import React from "react";
2
2
  import { Schema } from "../types/schema";
3
3
  import { DataGridControl } from "../use-data-grid-control";
4
+ /** @deprecated Use DataGridToolbarTabsProps */
4
5
  export interface ToolbarTabsProps extends DataGridControl {
5
6
  schema: Schema<any>;
6
7
  }
7
- export declare function ToolbarTabs(props: ToolbarTabsProps): React.JSX.Element;
8
+ export type DataGridToolbarTabsProps = ToolbarTabsProps;
9
+ /** @deprecated Use DataGridToolbarTabs */
10
+ export declare function ToolbarTabs(props: DataGridToolbarTabsProps): React.JSX.Element;
11
+ export declare const DataGridToolbarTabs: typeof ToolbarTabs;
@@ -3,8 +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.ToolbarTabs = void 0;
7
- const show_1 = require("@uxf/core/components/show");
6
+ exports.DataGridToolbarTabs = exports.ToolbarTabs = void 0;
7
+ const show_1 = require("@uxf/core-react/components/show");
8
8
  const cx_1 = require("@uxf/core/utils/cx");
9
9
  const button_1 = require("@uxf/ui/button");
10
10
  const icon_1 = require("@uxf/ui/icon");
@@ -13,6 +13,7 @@ const react_1 = __importDefault(require("react"));
13
13
  function Tab(props) {
14
14
  return (react_1.default.createElement("button", { className: (0, cx_1.cx)("uxf-data-grid__toolbar-tab", props.isActive && "is-active"), onClick: props.onClick }, props.title));
15
15
  }
16
+ /** @deprecated Use DataGridToolbarTabs */
16
17
  function ToolbarTabs(props) {
17
18
  var _a, _b, _c, _d;
18
19
  return (react_1.default.createElement(show_1.Show, { when: !!((_a = props.schema.tabs) === null || _a === void 0 ? void 0 : _a.length) },
@@ -34,3 +35,4 @@ function ToolbarTabs(props) {
34
35
  react_1.default.createElement(icon_1.Icon, { name: "caretDown", className: "uxf-data-grid__toolbar-tabs-button-icon", size: 16 }))))));
35
36
  }
36
37
  exports.ToolbarTabs = ToolbarTabs;
38
+ exports.DataGridToolbarTabs = ToolbarTabs;
@@ -12,7 +12,7 @@ const toolbar_tabs_1 = require("./toolbar-tabs");
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(toolbar_tabs_1.ToolbarTabs, { state: state, actions: actions, schema: schema_1.schema }),
15
+ react_1.default.createElement(toolbar_tabs_1.DataGridToolbarTabs, { state: state, actions: actions, schema: schema_1.schema }),
16
16
  react_1.default.createElement(json_renderer_1.JsonRenderer, { value: state })));
17
17
  }
18
18
  exports.Default = Default;
@@ -1,8 +1,8 @@
1
1
  import { FilterHandlers } from "../filter-handler";
2
2
  import { SelectedRowsToolbarActionsComponent } from "../selected-rows-toolbar";
3
3
  import { NoRowsFallbackComponent } from "../table/no-rows-fallback";
4
- import { TableProps } from "../table/types";
5
- import { ToolbarCustomsProps } from "../toolbar-customs";
4
+ import { DataGridTableProps } from "../table/types";
5
+ import { DataGridToolbarCustomsProps } from "../toolbar-customs";
6
6
  import { DataGridControl } from "../use-data-grid-control";
7
7
  import { DataGridFetchingResult } from "../use-data-grid-fetching";
8
8
  import { BodyCellComponents } from "./components";
@@ -15,13 +15,14 @@ export type DataGridBaseProps<GridType extends BaseGridType, Row> = {
15
15
  gridName?: string;
16
16
  keyExtractor?: KeyExtractor;
17
17
  onCsvDownload?: CsvDownloadHandler;
18
+ /** @deprecated will be remove, create custom data grid https://fe.uxf.dev/docs/data-grid/data-grid-custom-example */
18
19
  noBorder?: boolean;
19
20
  rowHeight?: number | ((row: Row) => number);
20
21
  headerRowHeight?: number;
21
22
  rowClass?: (row: Row) => "success" | "warning" | "error" | "primary" | "secondary" | string | null | undefined;
22
23
  className?: string;
23
- customActions?: ToolbarCustomsProps["buttons"];
24
- actionCell?: TableProps<Row>["actionCell"];
24
+ customActions?: DataGridToolbarCustomsProps["buttons"];
25
+ actionCell?: DataGridTableProps<Row>["actionCell"];
25
26
  bodyCells?: BodyCellComponents<GridType["columns"], Row>;
26
27
  filterHandlers?: FilterHandlers;
27
28
  NoRowsFallback?: NoRowsFallbackComponent;