@uxf/data-grid 11.0.0 → 11.1.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxf/data-grid",
3
- "version": "11.0.0",
3
+ "version": "11.1.1",
4
4
  "description": "UXF DataGrid",
5
5
  "homepage": "https://gitlab.com/uxf-npm/data-grid#readme",
6
6
  "main": "index.js",
@@ -30,7 +30,7 @@
30
30
  "typecheck": "tsc --noEmit --skipLibCheck"
31
31
  },
32
32
  "dependencies": {
33
- "@uxf/ui": "11.0.0",
33
+ "@uxf/ui": "11.1.0",
34
34
  "dayjs": "1.11.10",
35
35
  "fast-glob": "^3.3.2",
36
36
  "react-data-grid": "7.0.0-beta.39",
@@ -31,7 +31,7 @@ function useReactDataGridColumns(props, state) {
31
31
  const { onReload, schema, isRowSelectable, bodyCells, actionCell } = props;
32
32
  const columnsConfig = state.userConfig.columns;
33
33
  return (0, react_1.useMemo)(() => {
34
- var _a;
34
+ var _a, _b, _c, _d;
35
35
  const columns = [];
36
36
  if (isRowSelectable) {
37
37
  columns.push(react_data_grid_1.SelectColumn);
@@ -47,7 +47,7 @@ function useReactDataGridColumns(props, state) {
47
47
  headerCellClass: (0, cx_1.cx)("uxf-data-grid__cell", "uxf-data-grid__cell--header", `uxf-data-grid__cell--type-${schemaColumn.type}`, `uxf-data-grid__cell--name-${schemaColumn.name}`),
48
48
  resizable: true,
49
49
  sortable: schemaColumn.sort,
50
- width: schemaColumn.width,
50
+ width: (_d = (_c = (_b = state.userConfig.columns) === null || _b === void 0 ? void 0 : _b[schemaColumn.name]) === null || _c === void 0 ? void 0 : _c.width) !== null && _d !== void 0 ? _d : schemaColumn.width,
51
51
  minWidth: schemaColumn.minWidth,
52
52
  maxWidth: schemaColumn.maxWidth,
53
53
  cellClass: (0, cx_1.cx)("uxf-data-grid__cell", `uxf-data-grid__cell--type-${schemaColumn.type}`, `uxf-data-grid__cell--name-${schemaColumn.name}`),
@@ -79,6 +79,6 @@ function useReactDataGridColumns(props, state) {
79
79
  });
80
80
  }
81
81
  return columns;
82
- }, [columnsConfig, actionCell, schema.columns, bodyCells, isRowSelectable, onReload]);
82
+ }, [columnsConfig, actionCell, schema.columns, bodyCells, isRowSelectable, onReload, state.userConfig.columns]);
83
83
  }
84
84
  exports.useReactDataGridColumns = useReactDataGridColumns;
@@ -1,10 +1,11 @@
1
+ import { ButtonVariant } from "@uxf/ui/button";
1
2
  import React, { ReactElement } from "react";
2
3
  export interface ToolbarCustomsProps {
3
4
  buttons?: {
4
5
  label: string | ReactElement;
5
6
  onClick?: () => void;
6
7
  href?: string;
7
- variant?: "default" | "outlined" | "text";
8
+ variant?: ButtonVariant;
8
9
  }[];
9
10
  }
10
11
  export declare function ToolbarCustoms(props: ToolbarCustomsProps): React.JSX.Element | null;
package/types/state.d.ts CHANGED
@@ -10,7 +10,7 @@ export type GridRequest = {
10
10
  tab: string | null;
11
11
  };
12
12
  interface ColumnConfig {
13
- isHidden: boolean;
13
+ isHidden?: boolean;
14
14
  width?: number;
15
15
  }
16
16
  export interface DataGridUserConfig {
package/utils.js CHANGED
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createRequest = exports.encodeFilter = exports.decodeFilter = void 0;
4
4
  function decodeFilter(filterString) {
5
+ var _a, _b;
5
6
  try {
6
7
  const filter = JSON.parse(decodeURIComponent(escape(atob(filterString))));
7
8
  return {
@@ -10,6 +11,8 @@ function decodeFilter(filterString) {
10
11
  page: filter.page || 0,
11
12
  dir: filter.dir || "asc",
12
13
  sort: filter.sort || "id",
14
+ tab: (_a = filter.tab) !== null && _a !== void 0 ? _a : null,
15
+ search: (_b = filter.search) !== null && _b !== void 0 ? _b : "",
13
16
  };
14
17
  }
15
18
  catch (e) {