@bigbinary/neeto-filters-frontend 2.3.1 → 2.3.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/types.d.ts +69 -39
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigbinary/neeto-filters-frontend",
3
- "version": "2.3.1",
3
+ "version": "2.3.2",
4
4
  "description": "Manage filters across neeto products.",
5
5
  "author": "BigBinary",
6
6
  "license": "MIT",
package/types.d.ts CHANGED
@@ -1,53 +1,83 @@
1
- import { ButtonProps } from "@bigbinary/neetoui";
2
-
3
- interface FilterNodeType {
1
+ import { ButtonProps, PaneProps } from "@bigbinary/neetoui";
2
+ interface ColumnType {
3
+ key: string;
4
4
  node: string;
5
- label?: string;
5
+ label: string;
6
6
  type: string;
7
- rule: string;
8
- value: string | number;
7
+ model?: string;
9
8
  values?: (string | number)[];
10
- conditionsJoinType?: string;
11
- }
12
-
13
- interface FilterType {
14
- conditions: FilterNodeType[];
15
- groupJoinType?: string;
9
+ hidden?: boolean;
10
+ [otherProps: string]: any;
16
11
  }
17
12
 
18
- interface SegmentType {
19
- id: String;
20
- name: String;
21
- filters: FilterType[];
13
+ interface KeywordType {
14
+ node: string;
15
+ value: string;
16
+ setValue: () => void;
17
+ model?: string;
18
+ [otherProps: string]: any;
22
19
  }
23
20
 
24
- interface ColumnType {
21
+ type condition = {
25
22
  node: string;
26
- label: string;
27
- type: string;
28
- defaultValue?: string | number;
29
- inputType?: string;
30
- filters?: string[];
31
- values?: (string | number)[];
23
+ rule: "contains"
24
+ | "does_not_contain"
25
+ | "is"
26
+ | "is_not"
27
+ | "starts_with"
28
+ | "does_not_start_with"
29
+ | "ends_with"
30
+ | "does_not_end_with"
31
+ | "greater_than"
32
+ | "less_than"
33
+ | "on"
34
+ | "before"
35
+ | "after"
36
+ | "between";
37
+ type: "date"
38
+ | "single_date"
39
+ | "time"
40
+ | "single_time"
41
+ | "number"
42
+ | "text"
43
+ | "multi_option"
44
+ | "single_option"
45
+ | "time_range"
46
+ | "boolean";
47
+ value: string;
48
+ model?: string;
32
49
  hidden?: boolean;
50
+ [otherProps: string]: any;
33
51
  }
34
52
 
35
- export function NeetoFilters(props: {
36
- entity: string;
37
- columns: ColumnType[];
38
- onChange: (segment: SegmentType) => void;
39
- segmentsEnabled?: boolean;
40
- hideActionButtons?: boolean;
41
- deleteButtonProps?: ButtonProps;
42
- submitButtonProps?: ButtonProps;
43
- className?: string;
44
- }): JSX.Element;
53
+ type filter = {
54
+ conditions: condition[];
55
+ [otherProps: string]: any;
56
+ }
45
57
 
46
- export function SegmentMenu({ entity: string }): JSX.Element;
58
+ export function Filters(
59
+ props: {
60
+ isOpen: boolean;
61
+ setIsOpen: (boolean) => void;
62
+ columns: ColumnType[];
63
+ onChange : (filters: filter[]) => void;
64
+ buttonProps?: ButtonProps;
65
+ paneProps?: PaneProps;
66
+ isSearchable?: boolean;
67
+ className?: string;
68
+ keyword?: KeywordType;
69
+ [otherProps: string]: any;
70
+ }
71
+ ): JSX.Element;
47
72
 
48
- export function encodeFilters(filters: FilterType[]): string;
73
+ export function Bar(
74
+ props: {
75
+ setIsPaneOpen: (boolean) => void;
76
+ columns: ColumnType[];
77
+ keyword?: KeywordType;
78
+ className?: string;
79
+ [otherProps: string]: any;
80
+ }
81
+ ): JSX.Element;
49
82
 
50
- export function decodeFilters(
51
- filters: FilterType[],
52
- columns: ColumnType[]
53
- ): string;
83
+ export function buildFiltersFromURL(columns: ColumnType[]): string;