@bigbinary/neeto-filters-frontend 3.1.3 → 3.2.0-beta.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.
- package/README.md +3 -0
- package/app/javascript/src/translations/en.json +9 -5
- package/package.json +7 -7
- package/types.d.ts +42 -26
- package/dist/index.cjs.js +0 -3865
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.js +0 -3821
- package/dist/index.js.map +0 -1
package/README.md
CHANGED
|
@@ -126,6 +126,7 @@ export default App;
|
|
|
126
126
|
- `childrenKeys`: The list of keys which has to be cleared from url during clear filters operation.
|
|
127
127
|
- `entity`: The entity associated with the filters.
|
|
128
128
|
- `defaultSegmentName`: The name of segment which results all entities without applying any filter. Default name is "All results".
|
|
129
|
+
- `customFilters`: To specify the custom components specific to the host application. This should be same as `children` passed to the `Filters` component.
|
|
129
130
|
|
|
130
131
|
All these props must be same as that passed to the `Filters` component. The
|
|
131
132
|
option to save filters as segments will be enabled only when the entity prop is
|
|
@@ -184,6 +185,8 @@ export default App;
|
|
|
184
185
|
- `entity`: The entity associated with the segments.
|
|
185
186
|
- `setIsPaneOpen`: To trigger the isOpen state of the filters pane.
|
|
186
187
|
- `defaultSegmentName`: The name of segment which results all entities without applying any filter. Default name is "All results".
|
|
188
|
+
- `customFilters`: To specify the custom components specific to the host application. This should be same as `children` passed to the `Filters` component.
|
|
189
|
+
- `childrenKeys`: The list of keys which has to be cleared from url during clear filters operation.
|
|
187
190
|
|
|
188
191
|
The "columns" prop must be same as that passed to the `Filters` component.
|
|
189
192
|
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
"clearFilters": "Clear filters",
|
|
5
5
|
"columns": "Columns",
|
|
6
6
|
"delete": "Delete",
|
|
7
|
+
"edit": "Edit",
|
|
7
8
|
"done": "Done",
|
|
8
9
|
"filter": "Filter",
|
|
9
10
|
"filters": "Filters",
|
|
@@ -46,21 +47,24 @@
|
|
|
46
47
|
},
|
|
47
48
|
"segments": {
|
|
48
49
|
"addNewSegment": "Add new segment",
|
|
50
|
+
"saveAsNewSegment": "Add as new segment",
|
|
51
|
+
"editSegment": "Edit segment",
|
|
49
52
|
"deleteAlertMessage": "You are permanently deleting the segment <strong>{{entity,anyCase}}</strong>. This can't be undone.",
|
|
50
53
|
"deleteAlertTitle": "Delete segment?",
|
|
51
54
|
"manageSegments": "Manage segments",
|
|
52
55
|
"name": "Segment name",
|
|
53
56
|
"noSegmentsFound": "No segments found",
|
|
54
57
|
"saveSegment": "Save segment",
|
|
55
|
-
"
|
|
56
|
-
"saveAsNewSegment": "Save as new segment",
|
|
58
|
+
"updateSegment": "Update segment",
|
|
57
59
|
"searchSegments": "Search segments",
|
|
58
60
|
"segmentName": "Segment name",
|
|
59
61
|
"showLess": "See less",
|
|
60
62
|
"showMoreNumbers": "See {{entity}} more",
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
63
|
+
"nameIsRequired": "Segment name is required",
|
|
64
|
+
"reservedNameErrorMessage": "This name is reserved. Please choose another name.",
|
|
65
|
+
"addFilter": "Add filter",
|
|
66
|
+
"newFilter": "New filter",
|
|
67
|
+
"selectFilter": "Select filter"
|
|
64
68
|
},
|
|
65
69
|
"labels": {
|
|
66
70
|
"keyword": "Keyword"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-filters-frontend",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0-beta.0",
|
|
4
4
|
"description": "Manage filters across neeto products.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"homepage": "https://github.com/bigbinary/neeto-filters-nano",
|
|
@@ -51,12 +51,12 @@
|
|
|
51
51
|
"@bigbinary/eslint-plugin-neeto": "1.1.42",
|
|
52
52
|
"@bigbinary/neeto-audit-frontend": "2.0.9",
|
|
53
53
|
"@bigbinary/neeto-cist": "1.0.8",
|
|
54
|
-
"@bigbinary/neeto-commons-frontend": "3.1.
|
|
55
|
-
"@bigbinary/neeto-filters-frontend": "3.1.
|
|
54
|
+
"@bigbinary/neeto-commons-frontend": "3.1.17",
|
|
55
|
+
"@bigbinary/neeto-filters-frontend": "3.1.3",
|
|
56
56
|
"@bigbinary/neeto-hotkeys": "^1.0.1",
|
|
57
57
|
"@bigbinary/neeto-icons": "1.17.11",
|
|
58
58
|
"@bigbinary/neeto-molecules": "1.6.3",
|
|
59
|
-
"@bigbinary/neetoui": "6.2.
|
|
59
|
+
"@bigbinary/neetoui": "6.2.2",
|
|
60
60
|
"@emotion/is-prop-valid": "1.2.0",
|
|
61
61
|
"@faker-js/faker": "8.2.0",
|
|
62
62
|
"@honeybadger-io/js": "6.5.3",
|
|
@@ -154,12 +154,12 @@
|
|
|
154
154
|
},
|
|
155
155
|
"peerDependencies": {
|
|
156
156
|
"@bigbinary/neeto-cist": "latest",
|
|
157
|
-
"@bigbinary/neeto-commons-frontend": "3.1.
|
|
158
|
-
"@bigbinary/neeto-filters-frontend": "3.1.
|
|
157
|
+
"@bigbinary/neeto-commons-frontend": "3.1.17",
|
|
158
|
+
"@bigbinary/neeto-filters-frontend": "3.1.3",
|
|
159
159
|
"@bigbinary/neeto-hotkeys": "^1.0.1",
|
|
160
160
|
"@bigbinary/neeto-icons": "1.17.11",
|
|
161
161
|
"@bigbinary/neeto-molecules": "1.6.3",
|
|
162
|
-
"@bigbinary/neetoui": "6.2.
|
|
162
|
+
"@bigbinary/neetoui": "6.2.2",
|
|
163
163
|
"@honeybadger-io/js": "^6.5.3",
|
|
164
164
|
"@honeybadger-io/react": "^6.1.9",
|
|
165
165
|
"axios": "^1.6.0",
|
package/types.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ButtonProps, PaneProps } from "@bigbinary/neetoui";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
UseQueryResult,
|
|
5
|
+
UseQueryOptions,
|
|
6
|
+
UseMutationOptions,
|
|
7
|
+
UseMutationResult,
|
|
8
|
+
MutationOptions,
|
|
9
|
+
} from "react-query";
|
|
4
10
|
|
|
5
11
|
interface labelAndValue {
|
|
6
12
|
label: string | number;
|
|
@@ -11,10 +17,10 @@ type helpIconProps = {
|
|
|
11
17
|
icon?: string;
|
|
12
18
|
onClick?: () => void;
|
|
13
19
|
tooltipProps: {
|
|
14
|
-
content: string
|
|
15
|
-
position?: string
|
|
16
|
-
}
|
|
17
|
-
}
|
|
20
|
+
content: string;
|
|
21
|
+
position?: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
18
24
|
interface ColumnType {
|
|
19
25
|
suffixComponent?: React.ComponentType<any>;
|
|
20
26
|
helpIconProps?: helpIconProps;
|
|
@@ -41,9 +47,9 @@ interface KeywordType {
|
|
|
41
47
|
}
|
|
42
48
|
|
|
43
49
|
interface SegmentType {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
50
|
+
id: string;
|
|
51
|
+
name: string;
|
|
52
|
+
filters: filters[];
|
|
47
53
|
}
|
|
48
54
|
|
|
49
55
|
type condition = {
|
|
@@ -116,6 +122,7 @@ export function Bar(props: {
|
|
|
116
122
|
onSelectorsChange?: (selectors: selectors) => void;
|
|
117
123
|
childrenKeys?: string[];
|
|
118
124
|
defaultSegmentName?: string;
|
|
125
|
+
customFilters?: React.ReactNode;
|
|
119
126
|
[otherProps: string]: any;
|
|
120
127
|
}): JSX.Element;
|
|
121
128
|
|
|
@@ -124,6 +131,8 @@ export function Segments(props: {
|
|
|
124
131
|
columns: ColumnType[];
|
|
125
132
|
setIsFilterPaneOpen: (boolean) => void;
|
|
126
133
|
defaultSegmentName?: string;
|
|
134
|
+
customFilters?: React.ReactNode;
|
|
135
|
+
childrenKeys?: string[];
|
|
127
136
|
}): JSX.Element;
|
|
128
137
|
|
|
129
138
|
export function buildFiltersFromURL(
|
|
@@ -144,33 +153,40 @@ type FieldType = {
|
|
|
144
153
|
displayOrder?: number;
|
|
145
154
|
ownerType?: string;
|
|
146
155
|
ownerId?: string;
|
|
147
|
-
}
|
|
156
|
+
};
|
|
148
157
|
|
|
149
158
|
export function buildFilterColumnsFromFields(args: {
|
|
150
|
-
fields: Array<FieldType
|
|
151
|
-
selectedFields?: string[]
|
|
152
|
-
showRuleSelector?: boolean
|
|
153
|
-
groupName?: string
|
|
159
|
+
fields: Array<FieldType>;
|
|
160
|
+
selectedFields?: string[];
|
|
161
|
+
showRuleSelector?: boolean;
|
|
162
|
+
groupName?: string;
|
|
154
163
|
}): ColumnType[];
|
|
155
164
|
|
|
156
|
-
export function useFetchSegments(
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
165
|
+
export function useFetchSegments(
|
|
166
|
+
args: {
|
|
167
|
+
entity: string;
|
|
168
|
+
searchTerm?: string;
|
|
169
|
+
},
|
|
170
|
+
options?: UseQueryOptions
|
|
171
|
+
): UseQueryResult<SegmentType[]>;
|
|
160
172
|
|
|
161
173
|
export function buildUrlFromSegment(args: {
|
|
162
|
-
columns: ColumnType[]
|
|
163
|
-
filters: filters[]
|
|
164
|
-
id: string
|
|
174
|
+
columns: ColumnType[];
|
|
175
|
+
filters: filters[];
|
|
176
|
+
id: string;
|
|
165
177
|
}): string;
|
|
166
178
|
|
|
167
|
-
export function useDestroySegment(
|
|
179
|
+
export function useDestroySegment(
|
|
180
|
+
options?: UseMutationOptions
|
|
181
|
+
): UseMutationResult<TData, TError, TVariables, TContext>;
|
|
168
182
|
|
|
169
|
-
export function useUpdateSegment(
|
|
183
|
+
export function useUpdateSegment(
|
|
184
|
+
options?: UseMutationOptions
|
|
185
|
+
): UseMutationResult<TData, TError, TVariables, TContext>;
|
|
170
186
|
|
|
171
187
|
export function buildUrlFromFilters(args: {
|
|
172
|
-
columns: ColumnType[]
|
|
173
|
-
filters: filters[]
|
|
174
|
-
isClearAll?: boolean
|
|
175
|
-
childrenKeys?: string[]
|
|
188
|
+
columns: ColumnType[];
|
|
189
|
+
filters: filters[];
|
|
190
|
+
isClearAll?: boolean;
|
|
191
|
+
childrenKeys?: string[];
|
|
176
192
|
}): string;
|