@uxf/data-grid 10.0.0-beta.65 → 10.0.0-beta.67

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.
@@ -75,7 +75,7 @@ const schema = {
75
75
  { name: "only-odd-ids", label: "Only odd ids blablabla" },
76
76
  // { name: "only-odd-ids", label: "Only odd ids" },
77
77
  ],
78
- dir: "asc",
78
+ dir: _1.DataGridSortDir.Asc,
79
79
  sort: "id",
80
80
  perPage: 10,
81
81
  fullText: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxf/data-grid",
3
- "version": "10.0.0-beta.65",
3
+ "version": "10.0.0-beta.67",
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
  "node": ">=8.9"
31
31
  },
32
32
  "peerDependencies": {
33
- "@uxf/ui": "10.0.0-beta.63",
33
+ "@uxf/ui": "10.0.0-beta.67",
34
34
  "react": "^18.0.0",
35
35
  "react-dom": "^18.0.0",
36
36
  "dayjs": "^1.11.7"
@@ -1,4 +1,4 @@
1
- import { RequestFilter, Response, SortDirection } from "../types";
1
+ import { DataGridSortDir, RequestFilter, Response } from "../types";
2
2
  export declare const dataGridActions: {
3
3
  filter: (filterValue: RequestFilter) => {
4
4
  type: string;
@@ -34,10 +34,10 @@ export declare const dataGridActions: {
34
34
  type: string;
35
35
  search: string;
36
36
  };
37
- sort: (columnName: string, direction: SortDirection) => {
37
+ sort: (columnName: string, direction: DataGridSortDir) => {
38
38
  type: string;
39
39
  columnName: string;
40
- direction: SortDirection;
40
+ direction: DataGridSortDir;
41
41
  };
42
42
  sortClear: () => {
43
43
  type: string;
package/types/api.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { SortDirection } from "./schema";
1
+ import { DataGridSortDir } from "./schema";
2
2
  export type ResultItem = any;
3
3
  export interface RequestFilter<T = any> {
4
4
  name: string;
@@ -9,7 +9,7 @@ export interface RequestFilter<T = any> {
9
9
  export interface Request {
10
10
  f?: RequestFilter[];
11
11
  sort?: string;
12
- dir?: SortDirection;
12
+ dir?: DataGridSortDir;
13
13
  page?: number;
14
14
  perPage?: number;
15
15
  search?: string;
package/types/schema.d.ts CHANGED
@@ -1,5 +1,8 @@
1
1
  import { ReactElement } from "react";
2
- export type SortDirection = "asc" | "desc";
2
+ export declare enum DataGridSortDir {
3
+ Asc = "asc",
4
+ Desc = "desc"
5
+ }
3
6
  export interface Tab {
4
7
  name: string;
5
8
  label: string;
@@ -42,7 +45,7 @@ export interface Schema<GritType extends BaseGridType> {
42
45
  filters: Filters<GritType["filters"]>[];
43
46
  tabs?: Tab[];
44
47
  sort: string;
45
- dir: SortDirection;
48
+ dir: DataGridSortDir;
46
49
  perPage: number;
47
50
  fullText?: boolean;
48
51
  }
package/types/schema.js CHANGED
@@ -1,2 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DataGridSortDir = void 0;
4
+ var DataGridSortDir;
5
+ (function (DataGridSortDir) {
6
+ DataGridSortDir["Asc"] = "asc";
7
+ DataGridSortDir["Desc"] = "desc";
8
+ })(DataGridSortDir || (exports.DataGridSortDir = DataGridSortDir = {}));
package/types/state.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { RequestFilter, Response } from "./api";
2
- import { SortDirection } from "./schema";
2
+ import { DataGridSortDir } from "./schema";
3
3
  type GridRequest = {
4
4
  f: RequestFilter[];
5
5
  sort: string | null;
6
- dir: SortDirection | null;
6
+ dir: DataGridSortDir | null;
7
7
  page: number;
8
8
  perPage: number;
9
9
  search: string;
package/utils.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { DataGridState, Request, SortDirection } from "./types";
1
+ import { DataGridSortDir, DataGridState, Request } from "./types";
2
2
  export declare function decodeFilter(filterString: string): null | Request;
3
3
  export declare function encodeFilter(request: Request): string;
4
- export declare function createRequest(state: DataGridState, defaultSort: string, defaultDir: SortDirection): Request;
4
+ export declare function createRequest(state: DataGridState, defaultSort: string, defaultDir: DataGridSortDir): Request;
5
5
  export type ClassArray = ClassValue[];
6
6
  export type ClassValue = ClassArray | Record<string, any> | string | number | null | boolean | undefined;
7
7
  export declare function cx(...classes: ClassValue[]): string;