@react-fabric/searchbar 1.0.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.
Files changed (57) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +10 -0
  3. package/dist/cjs/filterbar/Context.js +34 -0
  4. package/dist/cjs/filterbar/FilterBar.js +149 -0
  5. package/dist/cjs/filterbar/FilterEdit.js +51 -0
  6. package/dist/cjs/filterbar/FilterForm.js +262 -0
  7. package/dist/cjs/filterbar/FilterMenu.js +80 -0
  8. package/dist/cjs/filterbar/FilterTag.js +93 -0
  9. package/dist/cjs/filterbar/FilterView.js +88 -0
  10. package/dist/cjs/filterbar/QueryForm.js +135 -0
  11. package/dist/cjs/i18n/ar.json.js +84 -0
  12. package/dist/cjs/i18n/en.json.js +84 -0
  13. package/dist/cjs/i18n/index.js +33 -0
  14. package/dist/cjs/index.js +11 -0
  15. package/dist/cjs/searchbar/SearchBar.js +154 -0
  16. package/dist/cjs/types/index.js +70 -0
  17. package/dist/esm/filterbar/Context.js +33 -0
  18. package/dist/esm/filterbar/FilterBar.js +149 -0
  19. package/dist/esm/filterbar/FilterEdit.js +51 -0
  20. package/dist/esm/filterbar/FilterForm.js +262 -0
  21. package/dist/esm/filterbar/FilterMenu.js +80 -0
  22. package/dist/esm/filterbar/FilterTag.js +93 -0
  23. package/dist/esm/filterbar/FilterView.js +88 -0
  24. package/dist/esm/filterbar/QueryForm.js +135 -0
  25. package/dist/esm/i18n/ar.json.js +77 -0
  26. package/dist/esm/i18n/en.json.js +77 -0
  27. package/dist/esm/i18n/index.js +33 -0
  28. package/dist/esm/index.js +5 -0
  29. package/dist/esm/searchbar/SearchBar.js +154 -0
  30. package/dist/esm/types/index.js +68 -0
  31. package/dist/types/filterbar/Context.d.ts +4 -0
  32. package/dist/types/filterbar/FilterBar.d.ts +2 -0
  33. package/dist/types/filterbar/FilterEdit.d.ts +6 -0
  34. package/dist/types/filterbar/FilterForm.d.ts +6 -0
  35. package/dist/types/filterbar/FilterMenu.d.ts +7 -0
  36. package/dist/types/filterbar/FilterTag.d.ts +6 -0
  37. package/dist/types/filterbar/FilterView.d.ts +5 -0
  38. package/dist/types/filterbar/QueryForm.d.ts +6 -0
  39. package/dist/types/i18n/index.d.ts +1 -0
  40. package/dist/types/index.d.ts +3 -0
  41. package/dist/types/searchbar/SearchBar.d.ts +2 -0
  42. package/dist/types/types/index.d.ts +203 -0
  43. package/package.json +56 -0
  44. package/src/filterbar/Context.tsx +31 -0
  45. package/src/filterbar/FilterBar.tsx +195 -0
  46. package/src/filterbar/FilterEdit.tsx +70 -0
  47. package/src/filterbar/FilterForm.tsx +281 -0
  48. package/src/filterbar/FilterMenu.tsx +100 -0
  49. package/src/filterbar/FilterTag.tsx +114 -0
  50. package/src/filterbar/FilterView.tsx +89 -0
  51. package/src/filterbar/QueryForm.tsx +151 -0
  52. package/src/i18n/ar.json +68 -0
  53. package/src/i18n/en.json +68 -0
  54. package/src/i18n/index.ts +28 -0
  55. package/src/index.ts +32 -0
  56. package/src/searchbar/SearchBar.tsx +162 -0
  57. package/src/types/index.ts +315 -0
@@ -0,0 +1,151 @@
1
+ /*
2
+ * React Fabric
3
+ * @version: 1.0.0
4
+ *
5
+ *
6
+ * The MIT License (MIT)
7
+ * Copyright (c) 2024 Adarsh Pastakia
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
10
+ * and associated documentation files (the "Software"), to deal in the Software without restriction,
11
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
12
+ * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
13
+ * subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in all copies or substantial
16
+ * portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
19
+ * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ */
23
+
24
+ import { useFloatingTree } from "@floating-ui/react";
25
+ import { Button, Callout } from "@react-fabric/core";
26
+ import { Controller, Form, Input } from "@react-fabric/form";
27
+ import { CodeEditor } from "@react-fabric/monaco";
28
+ import { isEmpty, shortHash, yup } from "@react-fabric/utilities";
29
+ import classNames from "classnames";
30
+ import { useCallback, useEffect, useMemo, useRef } from "react";
31
+ import { useTranslation } from "react-i18next";
32
+ import { type FilterObject } from "../types";
33
+ import { useFilterContext } from "./Context";
34
+
35
+ const QuerySchema = new yup.ObjectSchema({
36
+ id: yup.string().required(),
37
+ label: yup.string().required(),
38
+ query: yup
39
+ .string()
40
+ .required()
41
+ .test((value) => {
42
+ try {
43
+ return !isEmpty(JSON.parse(value));
44
+ } catch {
45
+ return false;
46
+ }
47
+ }),
48
+ });
49
+
50
+ type QuerySchemaType = yup.InferType<typeof QuerySchema>;
51
+
52
+ export const QueryForm = ({
53
+ filter,
54
+ onChange,
55
+ onRemove,
56
+ }: {
57
+ filter?: FilterObject;
58
+ onRemove?: () => void;
59
+ onChange?: (filter: FilterObject) => void;
60
+ }) => {
61
+ const { t } = useTranslation("searchbar");
62
+ const tree = useFloatingTree();
63
+ const { defaultQuery = "", querySchema } = useFilterContext();
64
+ const inputRef = useRef<HTMLInputElement>(null);
65
+
66
+ const filterValue = useMemo(() => {
67
+ if (filter && "query" in filter && filter.query)
68
+ return {
69
+ id: filter.id,
70
+ query: JSON.stringify(JSON.parse(filter.query ?? "{}"), null, 4),
71
+ label: filter.label,
72
+ };
73
+ return {
74
+ id: shortHash(),
75
+ label: "",
76
+ query: defaultQuery,
77
+ };
78
+ }, [filter]);
79
+
80
+ useEffect(() => {
81
+ setTimeout(() => {
82
+ inputRef.current?.focus();
83
+ }, 100);
84
+ }, []);
85
+
86
+ const handleSubmit = useCallback(
87
+ (model: QuerySchemaType) => {
88
+ const filter: FilterObject = {
89
+ id: model.id,
90
+ query: model.query,
91
+ label: model.label,
92
+ };
93
+ onChange?.(filter);
94
+ tree?.events.emit("close");
95
+ },
96
+ [onChange],
97
+ );
98
+
99
+ return (
100
+ <Form<QuerySchemaType>
101
+ schema={QuerySchema}
102
+ defaultValues={filterValue}
103
+ onSubmit={handleSubmit}
104
+ >
105
+ <Callout color="warning">For advanced users only!</Callout>
106
+ <Controller name="label">
107
+ <Input
108
+ required
109
+ ref={inputRef}
110
+ label={t("label.label")}
111
+ placeholder={t("label.label")}
112
+ />
113
+ </Controller>
114
+ <Controller name="query">
115
+ {({ checked, error, invalid, ...field }) => (
116
+ <div className="my-2">
117
+ <label
118
+ className={classNames("block px-2", invalid && "text-danger-600")}
119
+ >
120
+ {t("label.query")}
121
+ </label>
122
+ <div className="h-[380px] w-[600px] grid outline">
123
+ <CodeEditor minimal required {...field} schema={querySchema} />
124
+ </div>
125
+ </div>
126
+ )}
127
+ </Controller>
128
+ <div className="flex justify-end gap-1">
129
+ {onRemove && (
130
+ <div className="flex-1">
131
+ <Button
132
+ data-dropdown-dismiss="true"
133
+ variant="link"
134
+ size="sm"
135
+ color="danger"
136
+ onClick={onRemove}
137
+ >
138
+ {t("label.remove")}
139
+ </Button>
140
+ </div>
141
+ )}
142
+ <Button data-dropdown-dismiss="true" variant="link" size="sm">
143
+ {t("label.cancel")}
144
+ </Button>
145
+ <Button type="submit" variant="solid" size="sm">
146
+ {t("label.apply")}
147
+ </Button>
148
+ </div>
149
+ </Form>
150
+ );
151
+ };
@@ -0,0 +1,68 @@
1
+ {
2
+ "label": {
3
+ "filters": "المرشحات",
4
+ "all_filters": "جميع المرشحات",
5
+ "field": "مجال",
6
+ "operator": "المشغل",
7
+ "value": "قيمة",
8
+ "label": "ملصق",
9
+ "optional": "خياري",
10
+ "add": "إضافة عامل تصفية",
11
+ "edit": "يحرر",
12
+ "view": "منظر",
13
+ "pin": "مثبت",
14
+ "unpin": "غير مثبت",
15
+ "includeAll": "تضمين الكل",
16
+ "excludeAll": "استبعاد الكل",
17
+ "invertAll": "عكس التضمين/الاستبعاد",
18
+ "removeAll": "إزالة الكل",
19
+ "enableAll": "تمكين الكل",
20
+ "disableAll": "تعطيل الكل",
21
+ "toggleDisable": "عكس تعطيل/تمكين",
22
+ "remove": "يزيل",
23
+ "enable": "يُمكَِن",
24
+ "disable": "إبطال",
25
+ "exclude": "استبعاد",
26
+ "include": "يشمل",
27
+ "refresh": "ينعش",
28
+ "update": "تحديث",
29
+ "query": "استفسار",
30
+ "apply": "يتقدم",
31
+ "cancel": "يلغي",
32
+ "delete": "يمسح",
33
+ "basicFilter": "الفلتر الأساسي",
34
+ "customQuery": "استعلام مخصص",
35
+ "forAdvanced": "للمستخدمين المتقدمين فقط!"
36
+ },
37
+ "operator": {
38
+ "EXISTS": "موجود",
39
+ "IS": "يكون",
40
+ "IN": "في",
41
+ "LT": "<",
42
+ "GT": ">",
43
+ "LTE": "≤",
44
+ "GTE": "≥",
45
+ "INCLUDES": "يشمل",
46
+ "STARTS": "ابدا ب",
47
+ "ENDS": "ينتهي مع",
48
+ "WITHIN": "في غضون",
49
+ "BETWEEN": "بين هذا وذاك"
50
+ },
51
+ "placeholder": "مصطلح البحث...",
52
+ "type": {
53
+ "STRING": "سلسلة",
54
+ "NUMBER": "كثافة العمليات",
55
+ "DECIMAL": "يطفو",
56
+ "BOOLEAN": "رقم",
57
+ "DATE": "منطقي",
58
+ "DATETIME": "تاريخ",
59
+ "GEO": "GeoJSON"
60
+ },
61
+ "validate": {
62
+ "field": "حقل مطلوب",
63
+ "operator": "عامل مطلوب",
64
+ "value": "القيمة المطلوبة",
65
+ "compare": "مقارنة الحقل المطلوب",
66
+ "label": "التصنيف مطلوب"
67
+ }
68
+ }
@@ -0,0 +1,68 @@
1
+ {
2
+ "label": {
3
+ "filters": "Filters",
4
+ "all_filters": "All Filters",
5
+ "field": "Field",
6
+ "operator": "Operator",
7
+ "value": "Value",
8
+ "label": "Label",
9
+ "optional": "Optional",
10
+ "add": "Add Filter",
11
+ "edit": "Edit",
12
+ "view": "View",
13
+ "pin": "Pinned",
14
+ "unpin": "Unpinned",
15
+ "includeAll": "Include All",
16
+ "excludeAll": "Exclude All",
17
+ "invertAll": "Invert Include/Exclude",
18
+ "removeAll": "Remove All",
19
+ "enableAll": "Enable All",
20
+ "disableAll": "Disable All",
21
+ "toggleDisable": "Invert Disable/Enable",
22
+ "remove": "Remove",
23
+ "enable": "Enable",
24
+ "disable": "Disable",
25
+ "exclude": "Exclude",
26
+ "include": "Include",
27
+ "refresh": "Refresh",
28
+ "update": "Update",
29
+ "query": "Query",
30
+ "apply": "Apply",
31
+ "cancel": "Cancel",
32
+ "delete": "Delete",
33
+ "basicFilter": "Basic Filter",
34
+ "customQuery": "Custom Query",
35
+ "forAdvanced": "For advanced users only!"
36
+ },
37
+ "operator": {
38
+ "EXISTS": "Exists",
39
+ "IS": "Is",
40
+ "IN": "In",
41
+ "LT": "<",
42
+ "GT": ">",
43
+ "LTE": "≤",
44
+ "GTE": "≥",
45
+ "INCLUDES": "Includes",
46
+ "STARTS": "Starts with",
47
+ "ENDS": "Ends with",
48
+ "WITHIN": "Within",
49
+ "BETWEEN": "Between"
50
+ },
51
+ "placeholder": "Search term...",
52
+ "type": {
53
+ "STRING": "String",
54
+ "NUMBER": "Number",
55
+ "DECIMAL": "Decimal",
56
+ "BOOLEAN": "Bool",
57
+ "DATE": "Date",
58
+ "DATETIME": "Date Time",
59
+ "GEO": "GeoJSON"
60
+ },
61
+ "validate": {
62
+ "field": "Field required",
63
+ "operator": "Operator required",
64
+ "value": "Value required",
65
+ "compare": "Compare field required",
66
+ "label": "Label required"
67
+ }
68
+ }
@@ -0,0 +1,28 @@
1
+ /*
2
+ * React Fabric
3
+ * @version: 1.0.0
4
+ *
5
+ *
6
+ * The MIT License (MIT)
7
+ * Copyright (c) 2024 Adarsh Pastakia
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
10
+ * and associated documentation files (the "Software"), to deal in the Software without restriction,
11
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
12
+ * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
13
+ * subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in all copies or substantial
16
+ * portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
19
+ * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ */
23
+
24
+ import { addTranslationBundle } from "@react-fabric/core";
25
+ import ar from "./ar.json";
26
+ import en from "./en.json";
27
+
28
+ addTranslationBundle("searchbar", { en, ar });
package/src/index.ts ADDED
@@ -0,0 +1,32 @@
1
+ /*
2
+ * React Fabric
3
+ * @version: 1.0.0
4
+ *
5
+ *
6
+ * The MIT License (MIT)
7
+ * Copyright (c) 2024 Adarsh Pastakia
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
10
+ * and associated documentation files (the "Software"), to deal in the Software without restriction,
11
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
12
+ * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
13
+ * subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in all copies or substantial
16
+ * portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
19
+ * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ */
23
+
24
+ import "./i18n";
25
+
26
+ export { SearchBar } from "./searchbar/SearchBar";
27
+ export {
28
+ FIELD_TYPE,
29
+ OPERATOR,
30
+ type FilterObject,
31
+ type SearchObject,
32
+ } from "./types";
@@ -0,0 +1,162 @@
1
+ /*
2
+ * React Fabric
3
+ * @version: 1.0.0
4
+ *
5
+ *
6
+ * The MIT License (MIT)
7
+ * Copyright (c) 2024 Adarsh Pastakia
8
+ *
9
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
10
+ * and associated documentation files (the "Software"), to deal in the Software without restriction,
11
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
12
+ * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
13
+ * subject to the following conditions:
14
+ *
15
+ * The above copyright notice and this permission notice shall be included in all copies or substantial
16
+ * portions of the Software.
17
+ *
18
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
19
+ * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ */
23
+
24
+ import { Button, useDebounce, useLocalStorage } from "@react-fabric/core";
25
+ import { AutoComplete, Field } from "@react-fabric/form";
26
+ import { dedupe, EMPTY_ARRAY, isArray } from "@react-fabric/utilities";
27
+ import { useMemo, useReducer, useState } from "react";
28
+ import { useTranslation } from "react-i18next";
29
+ import { FilterBar } from "../filterbar/FilterBar";
30
+ import {
31
+ type FilterBarProps,
32
+ type FilterObject,
33
+ type SearchBarProps,
34
+ } from "../types";
35
+
36
+ interface SearchState {
37
+ dirty: boolean;
38
+ query: string | string[];
39
+ filters: FilterObject[];
40
+ }
41
+
42
+ type SearchActions =
43
+ | { type: "dirty"; dirty: boolean }
44
+ | { type: "query"; query: string | string[] }
45
+ | { type: "filter"; filters: FilterObject[] };
46
+
47
+ export const SearchBar = ({
48
+ historyKey = "ruf:search",
49
+ historyCount = 20,
50
+ defaultQueryList,
51
+ prepend,
52
+ append,
53
+ decorateEnd,
54
+ decorateStart,
55
+ actions,
56
+ hideFilters,
57
+ defaultCollapsed = false,
58
+ disabled,
59
+ onCollapsed,
60
+ onQuery,
61
+ onSearch,
62
+ query,
63
+ multiple,
64
+ filters = EMPTY_ARRAY,
65
+ ...filterProps
66
+ }: SearchBarProps & Omit<FilterBarProps, "onFilterChanged">) => {
67
+ const { t } = useTranslation("searchbar");
68
+ const [history, setHistory] = useLocalStorage<string[]>(
69
+ historyKey,
70
+ defaultQueryList ?? [],
71
+ );
72
+
73
+ const [collapsed, setCollapsed] = useState(defaultCollapsed);
74
+ const emptyValue = useMemo(() => (multiple ? EMPTY_ARRAY : ""), [multiple]);
75
+
76
+ const fireSearch = useDebounce((query: string[], filters: FilterObject[]) => {
77
+ onSearch?.({
78
+ query,
79
+ filters,
80
+ });
81
+ }, []);
82
+
83
+ const [state, dispatch] = useReducer(
84
+ (state: SearchState, action: SearchActions) => {
85
+ if (action.type === "dirty") {
86
+ return { ...state, dirty: action.dirty };
87
+ }
88
+ if (action.type === "query") {
89
+ !multiple && fireSearch(action.query ?? emptyValue, state.filters);
90
+ return { ...state, dirty: false, query: action.query ?? emptyValue };
91
+ }
92
+ if (action.type === "filter") {
93
+ fireSearch(state.query, action.filters ?? []);
94
+ return { ...state, dirty: false, filters: action.filters ?? [] };
95
+ }
96
+ return state;
97
+ },
98
+ {
99
+ dirty: false,
100
+ query,
101
+ filters,
102
+ },
103
+ );
104
+
105
+ const updateHistory = (value: string | string[]) => {
106
+ const historyEntry = isArray(value) ? value : [value];
107
+ setHistory(dedupe([...historyEntry, ...history]).slice(0, historyCount));
108
+ dispatch({ type: "query", query: value });
109
+ };
110
+
111
+ const handleFilterChange = (filters: FilterObject[] = []) => {
112
+ dispatch({ type: "filter", filters });
113
+ };
114
+
115
+ return (
116
+ <div>
117
+ <div className="flex flex-nowrap gap-1 mb-1">
118
+ <Field data-inner={true} className="flex-1">
119
+ {!hideFilters && (
120
+ <Button
121
+ variant="link"
122
+ badge={filters.length}
123
+ onClick={() => setCollapsed(!collapsed)}
124
+ >
125
+ {t("label.filters")}
126
+ </Button>
127
+ )}
128
+ {prepend}
129
+ <AutoComplete
130
+ allowClear
131
+ expandOnEdit
132
+ multiple={multiple}
133
+ history={history}
134
+ value={state.query}
135
+ decorateEnd={decorateEnd}
136
+ decorateStart={decorateStart}
137
+ onInput={() => dispatch({ type: "dirty", dirty: true })}
138
+ onSelect={updateHistory}
139
+ onQuery={onQuery}
140
+ onEnterPressed={() => fireSearch(state.query, state.filters)}
141
+ />
142
+ {append}
143
+ <Button
144
+ variant="solid"
145
+ color={state.dirty ? "warning" : "primary"}
146
+ onClick={() => fireSearch(state.query, state.filters)}
147
+ >
148
+ {t(state.dirty ? "label.update" : "label.refresh")}
149
+ </Button>
150
+ </Field>
151
+ {actions}
152
+ </div>
153
+ {!hideFilters && !collapsed && (
154
+ <FilterBar
155
+ {...filterProps}
156
+ filters={state.filters}
157
+ onFilterChanged={handleFilterChange}
158
+ />
159
+ )}
160
+ </div>
161
+ );
162
+ };