@blaze-cms/plugin-search-ui 0.146.0-node18-tooltips.37 → 0.146.0-node18-core-styles-tooltips.45

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 (52) hide show
  1. package/CHANGELOG.md +55 -13
  2. package/package.json +6 -7
  3. package/lib-es/application/query/index.js +0 -33
  4. package/lib-es/application/query/index.js.map +0 -1
  5. package/lib-es/components/SearchAdmin/RecentSearches/RecentSearches.js +0 -38
  6. package/lib-es/components/SearchAdmin/RecentSearches/RecentSearches.js.map +0 -1
  7. package/lib-es/components/SearchAdmin/RecentSearches/index.js +0 -3
  8. package/lib-es/components/SearchAdmin/RecentSearches/index.js.map +0 -1
  9. package/lib-es/components/SearchAdmin/SearchAdmin.js +0 -147
  10. package/lib-es/components/SearchAdmin/SearchAdmin.js.map +0 -1
  11. package/lib-es/components/SearchAdmin/SearchAdminSideBar/SearchAdminSideBar.js +0 -76
  12. package/lib-es/components/SearchAdmin/SearchAdminSideBar/SearchAdminSideBar.js.map +0 -1
  13. package/lib-es/components/SearchAdmin/SearchAdminSideBar/index.js +0 -3
  14. package/lib-es/components/SearchAdmin/SearchAdminSideBar/index.js.map +0 -1
  15. package/lib-es/components/SearchAdmin/SearchBar/SearchBar.js +0 -52
  16. package/lib-es/components/SearchAdmin/SearchBar/SearchBar.js.map +0 -1
  17. package/lib-es/components/SearchAdmin/SearchBar/index.js +0 -3
  18. package/lib-es/components/SearchAdmin/SearchBar/index.js.map +0 -1
  19. package/lib-es/components/SearchAdmin/SearchResults/SearchResults.js +0 -151
  20. package/lib-es/components/SearchAdmin/SearchResults/SearchResults.js.map +0 -1
  21. package/lib-es/components/SearchAdmin/SearchResults/index.js +0 -3
  22. package/lib-es/components/SearchAdmin/SearchResults/index.js.map +0 -1
  23. package/lib-es/components/SearchAdmin/TriggerModal/TriggerModal.js +0 -14
  24. package/lib-es/components/SearchAdmin/TriggerModal/TriggerModal.js.map +0 -1
  25. package/lib-es/components/SearchAdmin/TriggerModal/index.js +0 -3
  26. package/lib-es/components/SearchAdmin/TriggerModal/index.js.map +0 -1
  27. package/lib-es/components/SearchAdmin/index.js +0 -3
  28. package/lib-es/components/SearchAdmin/index.js.map +0 -1
  29. package/lib-es/components/SearchPublishedContent/SearchPublishedContent.js +0 -148
  30. package/lib-es/components/SearchPublishedContent/SearchPublishedContent.js.map +0 -1
  31. package/lib-es/components/SearchPublishedContent/index.js +0 -3
  32. package/lib-es/components/SearchPublishedContent/index.js.map +0 -1
  33. package/lib-es/components/useLocalStorage/index.js +0 -3
  34. package/lib-es/components/useLocalStorage/index.js.map +0 -1
  35. package/lib-es/components/useLocalStorage/useLocalStorage.js +0 -15
  36. package/lib-es/components/useLocalStorage/useLocalStorage.js.map +0 -1
  37. package/lib-es/components/useSearch/index.js +0 -3
  38. package/lib-es/components/useSearch/index.js.map +0 -1
  39. package/lib-es/components/useSearch/useSearch.js +0 -109
  40. package/lib-es/components/useSearch/useSearch.js.map +0 -1
  41. package/lib-es/components/useSearchResults/index.js +0 -3
  42. package/lib-es/components/useSearchResults/index.js.map +0 -1
  43. package/lib-es/components/useSearchResults/useSearchResults.js +0 -53
  44. package/lib-es/components/useSearchResults/useSearchResults.js.map +0 -1
  45. package/lib-es/constants.js +0 -11
  46. package/lib-es/constants.js.map +0 -1
  47. package/lib-es/hooks/index.js +0 -3
  48. package/lib-es/hooks/index.js.map +0 -1
  49. package/lib-es/hooks/useDebounceSearch.js +0 -44
  50. package/lib-es/hooks/useDebounceSearch.js.map +0 -1
  51. package/lib-es/index.js +0 -6
  52. package/lib-es/index.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -3,7 +3,7 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- # [0.146.0-node18-tooltips.37](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.36...v0.146.0-node18-tooltips.37) (2026-01-08)
6
+ # [0.146.0-node18-core-styles-tooltips.45](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.44...v0.146.0-node18-core-styles-tooltips.45) (2026-01-15)
7
7
 
8
8
  **Note:** Version bump only for package @blaze-cms/plugin-search-ui
9
9
 
@@ -11,7 +11,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
11
11
 
12
12
 
13
13
 
14
- # [0.146.0-node18-tooltips.34](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.33...v0.146.0-node18-tooltips.34) (2025-12-17)
14
+ # [0.146.0-node18-core-styles-tooltips.44](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.43...v0.146.0-node18-core-styles-tooltips.44) (2026-01-02)
15
15
 
16
16
  **Note:** Version bump only for package @blaze-cms/plugin-search-ui
17
17
 
@@ -19,7 +19,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
19
19
 
20
20
 
21
21
 
22
- # [0.146.0-node18-tooltips.33](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.32...v0.146.0-node18-tooltips.33) (2025-12-15)
22
+ # [0.146.0-node18-core-styles-tooltips.42](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.41...v0.146.0-node18-core-styles-tooltips.42) (2025-12-17)
23
23
 
24
24
  **Note:** Version bump only for package @blaze-cms/plugin-search-ui
25
25
 
@@ -27,7 +27,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
27
27
 
28
28
 
29
29
 
30
- # [0.146.0-node18-tooltips.32](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.31...v0.146.0-node18-tooltips.32) (2025-12-15)
30
+ # [0.146.0-node18-core-styles-tooltips.41](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.40...v0.146.0-node18-core-styles-tooltips.41) (2025-12-15)
31
31
 
32
32
  **Note:** Version bump only for package @blaze-cms/plugin-search-ui
33
33
 
@@ -35,7 +35,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
35
35
 
36
36
 
37
37
 
38
- # [0.146.0-node18-tooltips.30](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.29...v0.146.0-node18-tooltips.30) (2025-11-17)
38
+ # [0.146.0-node18-core-styles-tooltips.38](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.37...v0.146.0-node18-core-styles-tooltips.38) (2025-12-04)
39
39
 
40
40
  **Note:** Version bump only for package @blaze-cms/plugin-search-ui
41
41
 
@@ -43,7 +43,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
43
43
 
44
44
 
45
45
 
46
- # [0.146.0-node18-tooltips.28](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.27...v0.146.0-node18-tooltips.28) (2025-11-10)
46
+ # [0.146.0-node18-core-styles-tooltips.30](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.29...v0.146.0-node18-core-styles-tooltips.30) (2025-11-25)
47
47
 
48
48
  **Note:** Version bump only for package @blaze-cms/plugin-search-ui
49
49
 
@@ -51,7 +51,23 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
51
51
 
52
52
 
53
53
 
54
- # [0.146.0-node18-tooltips.27](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.26...v0.146.0-node18-tooltips.27) (2025-11-06)
54
+ # [0.146.0-node18-core-styles-tooltips.27](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.26...v0.146.0-node18-core-styles-tooltips.27) (2025-11-13)
55
+
56
+ **Note:** Version bump only for package @blaze-cms/plugin-search-ui
57
+
58
+
59
+
60
+
61
+
62
+ # [0.146.0-node18-core-styles-tooltips.26](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.25...v0.146.0-node18-core-styles-tooltips.26) (2025-11-12)
63
+
64
+ **Note:** Version bump only for package @blaze-cms/plugin-search-ui
65
+
66
+
67
+
68
+
69
+
70
+ # [0.146.0-node18-core-styles-tooltips.25](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.24...v0.146.0-node18-core-styles-tooltips.25) (2025-11-07)
55
71
 
56
72
 
57
73
  ### Bug Fixes
@@ -62,7 +78,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
62
78
 
63
79
 
64
80
 
65
- # [0.146.0-node18-tooltips.26](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.25...v0.146.0-node18-tooltips.26) (2025-10-29)
81
+ # [0.146.0-node18-core-styles-tooltips.24](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.23...v0.146.0-node18-core-styles-tooltips.24) (2025-11-03)
66
82
 
67
83
  **Note:** Version bump only for package @blaze-cms/plugin-search-ui
68
84
 
@@ -70,7 +86,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
70
86
 
71
87
 
72
88
 
73
- # [0.146.0-node18-tooltips.22](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.21...v0.146.0-node18-tooltips.22) (2025-10-17)
89
+ # [0.146.0-node18-core-styles-tooltips.22](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.21...v0.146.0-node18-core-styles-tooltips.22) (2025-10-20)
74
90
 
75
91
  **Note:** Version bump only for package @blaze-cms/plugin-search-ui
76
92
 
@@ -78,7 +94,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
78
94
 
79
95
 
80
96
 
81
- # [0.146.0-node18-tooltips.11](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.10...v0.146.0-node18-tooltips.11) (2025-10-01)
97
+ # [0.146.0-node18-core-styles-tooltips.19](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.18...v0.146.0-node18-core-styles-tooltips.19) (2025-10-01)
82
98
 
83
99
  **Note:** Version bump only for package @blaze-cms/plugin-search-ui
84
100
 
@@ -86,7 +102,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
86
102
 
87
103
 
88
104
 
89
- # [0.146.0-node18-tooltips.4](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-tooltips.3...v0.146.0-node18-tooltips.4) (2025-09-22)
105
+ # [0.146.0-node18-core-styles-tooltips.15](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.14...v0.146.0-node18-core-styles-tooltips.15) (2025-09-23)
90
106
 
91
107
  **Note:** Version bump only for package @blaze-cms/plugin-search-ui
92
108
 
@@ -94,7 +110,34 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
94
110
 
95
111
 
96
112
 
97
- # [0.146.0-node18-tooltips.0](https://github.com/thebyte9/blaze/compare/v0.145.0...v0.146.0-node18-tooltips.0) (2025-09-09)
113
+ # [0.146.0-node18-core-styles-tooltips.11](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.10...v0.146.0-node18-core-styles-tooltips.11) (2025-08-27)
114
+
115
+
116
+ ### Features
117
+
118
+ * add hook for search content component ([#4866](https://github.com/thebyte9/blaze/issues/4866)) ([2fe2fb9](https://github.com/thebyte9/blaze/commit/2fe2fb91a13199b2c7cabbd734c3b79f9c962cad))
119
+
120
+
121
+
122
+
123
+
124
+ # [0.146.0-node18-core-styles-tooltips.5](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.4...v0.146.0-node18-core-styles-tooltips.5) (2025-07-18)
125
+
126
+ **Note:** Version bump only for package @blaze-cms/plugin-search-ui
127
+
128
+
129
+
130
+
131
+
132
+ # [0.146.0-node18-core-styles-tooltips.4](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.3...v0.146.0-node18-core-styles-tooltips.4) (2025-07-10)
133
+
134
+ **Note:** Version bump only for package @blaze-cms/plugin-search-ui
135
+
136
+
137
+
138
+
139
+
140
+ # [0.146.0-node18-core-styles-tooltips.0](https://github.com/thebyte9/blaze/compare/v0.145.0...v0.146.0-node18-core-styles-tooltips.0) (2025-06-18)
98
141
 
99
142
 
100
143
  ### Bug Fixes
@@ -110,7 +153,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
110
153
 
111
154
  ### Features
112
155
 
113
- * add hook for search content component ([#4866](https://github.com/thebyte9/blaze/issues/4866)) ([2fe2fb9](https://github.com/thebyte9/blaze/commit/2fe2fb91a13199b2c7cabbd734c3b79f9c962cad))
114
156
  * updated react to 18 ([9335f84](https://github.com/thebyte9/blaze/commit/9335f8432b376494501abb9c3deef1ddaa9b35a8))
115
157
 
116
158
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blaze-cms/plugin-search-ui",
3
- "version": "0.146.0-node18-tooltips.37",
3
+ "version": "0.146.0-node18-core-styles-tooltips.45",
4
4
  "description": "Blaze plugin search ui",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib-es/index.js",
@@ -27,9 +27,9 @@
27
27
  },
28
28
  "license": "GPL-3.0",
29
29
  "dependencies": {
30
- "@blaze-cms/admin-ui-utils": "0.146.0-node18-tooltips.37",
31
- "@blaze-cms/core-errors": "0.146.0-node18-tooltips.0",
32
- "@blaze-cms/setup-ui": "0.146.0-node18-tooltips.0",
30
+ "@blaze-cms/admin-ui-utils": "0.146.0-node18-core-styles-tooltips.45",
31
+ "@blaze-cms/core-errors": "0.146.0-node18-core-styles-tooltips.3",
32
+ "@blaze-cms/setup-ui": "0.146.0-node18-core-styles-tooltips.3",
33
33
  "@blaze-react/button": "0.5.19",
34
34
  "@blaze-react/checkboxes": "^0.7.0",
35
35
  "@blaze-react/input": "0.8.0-alpha.100",
@@ -41,7 +41,7 @@
41
41
  "react-tiny-virtual-list": "2.2.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@blaze-cms/core-ui": "0.146.0-node18-tooltips.32"
44
+ "@blaze-cms/core-ui": "0.146.0-node18-core-styles-tooltips.38"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@apollo/client": "3.x",
@@ -52,6 +52,5 @@
52
52
  "eslintIgnore": [
53
53
  "lib/*",
54
54
  "lib-es/*"
55
- ],
56
- "gitHead": "e1ee3c1f0f1a39f2815b751d434342d767d8c99d"
55
+ ]
57
56
  }
@@ -1,33 +0,0 @@
1
- import { gql } from '@apollo/client';
2
- const SEARCH_ADMIN = () => gql`
3
- query searchAdmin($limit: Int, $offset: Int, $sort: String, $rawQuery: JSON!) {
4
- search: searchAdmin(limit: $limit, offset: $offset, sort: $sort, rawQuery: $rawQuery) {
5
- jsonResults
6
- total
7
- }
8
- }
9
- `;
10
- const SEARCH_PUBLISHED = ({
11
- resultKeys
12
- }) => gql`
13
- query searchPublishedContent($limit: Int, $offset: Int, $sort: String, $rawQuery: JSON!) {
14
- search: searchPublishedContent(
15
- limit: $limit
16
- offset: $offset
17
- sort: $sort
18
- rawQuery: $rawQuery
19
- ) {
20
- results {
21
- ...on ContentContentInterface {
22
- ${resultKeys}
23
- }
24
- }
25
- total
26
- }
27
- }
28
- `;
29
- export default {
30
- SEARCH_ADMIN,
31
- SEARCH_PUBLISHED
32
- };
33
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["gql","SEARCH_ADMIN","SEARCH_PUBLISHED","resultKeys"],"sources":["../../../src/application/query/index.js"],"sourcesContent":["import { gql } from '@apollo/client';\n\nconst SEARCH_ADMIN = () => gql`\n query searchAdmin($limit: Int, $offset: Int, $sort: String, $rawQuery: JSON!) {\n search: searchAdmin(limit: $limit, offset: $offset, sort: $sort, rawQuery: $rawQuery) {\n jsonResults\n total\n }\n }\n`;\n\nconst SEARCH_PUBLISHED = ({ resultKeys }) => gql`\n query searchPublishedContent($limit: Int, $offset: Int, $sort: String, $rawQuery: JSON!) {\n search: searchPublishedContent(\n limit: $limit\n offset: $offset\n sort: $sort\n rawQuery: $rawQuery\n ) {\n results {\n ...on ContentContentInterface {\n ${resultKeys}\n } \n }\n total\n }\n }\n`;\n\nexport default { SEARCH_ADMIN, SEARCH_PUBLISHED };\n"],"mappings":"AAAA,SAASA,GAAG,QAAQ,gBAAgB;AAEpC,MAAMC,YAAY,GAAGA,CAAA,KAAMD,GAAG;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,MAAME,gBAAgB,GAAGA,CAAC;EAAEC;AAAW,CAAC,KAAKH,GAAG;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAYG,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,eAAe;EAAEF,YAAY;EAAEC;AAAiB,CAAC","ignoreList":[]}
@@ -1,38 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- const RecentSearches = ({
4
- recentSearches,
5
- handleSearchTerm,
6
- search
7
- }) => /*#__PURE__*/React.createElement("div", {
8
- className: "list list--search"
9
- }, /*#__PURE__*/React.createElement("div", {
10
- className: "header header--list"
11
- }, /*#__PURE__*/React.createElement("h2", null, "Recent searches")), [...recentSearches].reverse().map(searchedTerm => /*#__PURE__*/React.createElement("div", {
12
- key: searchedTerm,
13
- role: "button",
14
- className: "list__item list__item--search",
15
- onClick: () => {
16
- handleSearchTerm({
17
- target: {
18
- value: searchedTerm
19
- }
20
- });
21
- search({
22
- value: searchedTerm
23
- });
24
- }
25
- }, /*#__PURE__*/React.createElement("div", {
26
- className: "list__item-row list__item-row--search"
27
- }, /*#__PURE__*/React.createElement("i", {
28
- className: "material-icons"
29
- }, "search"), /*#__PURE__*/React.createElement("div", {
30
- className: "list__item-text list__item-text--search"
31
- }, searchedTerm)))));
32
- RecentSearches.propTypes = {
33
- recentSearches: PropTypes.array.isRequired,
34
- handleSearchTerm: PropTypes.func.isRequired,
35
- search: PropTypes.func.isRequired
36
- };
37
- export default RecentSearches;
38
- //# sourceMappingURL=RecentSearches.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RecentSearches.js","names":["React","PropTypes","RecentSearches","recentSearches","handleSearchTerm","search","createElement","className","reverse","map","searchedTerm","key","role","onClick","target","value","propTypes","array","isRequired","func"],"sources":["../../../../src/components/SearchAdmin/RecentSearches/RecentSearches.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst RecentSearches = ({ recentSearches, handleSearchTerm, search }) => (\n <div className=\"list list--search\">\n <div className=\"header header--list\">\n <h2>Recent searches</h2>\n </div>\n {[...recentSearches].reverse().map(searchedTerm => (\n <div\n key={searchedTerm}\n role=\"button\"\n className=\"list__item list__item--search\"\n onClick={() => {\n handleSearchTerm({ target: { value: searchedTerm } });\n search({ value: searchedTerm });\n }}>\n <div className=\"list__item-row list__item-row--search\">\n <i className=\"material-icons\">search</i>\n <div className=\"list__item-text list__item-text--search\">{searchedTerm}</div>\n </div>\n </div>\n ))}\n </div>\n);\n\nRecentSearches.propTypes = {\n recentSearches: PropTypes.array.isRequired,\n handleSearchTerm: PropTypes.func.isRequired,\n search: PropTypes.func.isRequired\n};\n\nexport default RecentSearches;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAElC,MAAMC,cAAc,GAAGA,CAAC;EAAEC,cAAc;EAAEC,gBAAgB;EAAEC;AAAO,CAAC,kBAClEL,KAAA,CAAAM,aAAA;EAAKC,SAAS,EAAC;AAAmB,gBAChCP,KAAA,CAAAM,aAAA;EAAKC,SAAS,EAAC;AAAqB,gBAClCP,KAAA,CAAAM,aAAA,aAAI,iBAAmB,CACpB,CAAC,EACL,CAAC,GAAGH,cAAc,CAAC,CAACK,OAAO,CAAC,CAAC,CAACC,GAAG,CAACC,YAAY,iBAC7CV,KAAA,CAAAM,aAAA;EACEK,GAAG,EAAED,YAAa;EAClBE,IAAI,EAAC,QAAQ;EACbL,SAAS,EAAC,+BAA+B;EACzCM,OAAO,EAAEA,CAAA,KAAM;IACbT,gBAAgB,CAAC;MAAEU,MAAM,EAAE;QAAEC,KAAK,EAAEL;MAAa;IAAE,CAAC,CAAC;IACrDL,MAAM,CAAC;MAAEU,KAAK,EAAEL;IAAa,CAAC,CAAC;EACjC;AAAE,gBACFV,KAAA,CAAAM,aAAA;EAAKC,SAAS,EAAC;AAAuC,gBACpDP,KAAA,CAAAM,aAAA;EAAGC,SAAS,EAAC;AAAgB,GAAC,QAAS,CAAC,eACxCP,KAAA,CAAAM,aAAA;EAAKC,SAAS,EAAC;AAAyC,GAAEG,YAAkB,CACzE,CACF,CACN,CACE,CACN;AAEDR,cAAc,CAACc,SAAS,GAAG;EACzBb,cAAc,EAAEF,SAAS,CAACgB,KAAK,CAACC,UAAU;EAC1Cd,gBAAgB,EAAEH,SAAS,CAACkB,IAAI,CAACD,UAAU;EAC3Cb,MAAM,EAAEJ,SAAS,CAACkB,IAAI,CAACD;AACzB,CAAC;AAED,eAAehB,cAAc","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- import RecentSearches from './RecentSearches';
2
- export default RecentSearches;
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["RecentSearches"],"sources":["../../../../src/components/SearchAdmin/RecentSearches/index.js"],"sourcesContent":["import RecentSearches from './RecentSearches';\n\nexport default RecentSearches;\n"],"mappings":"AAAA,OAAOA,cAAc,MAAM,kBAAkB;AAE7C,eAAeA,cAAc","ignoreList":[]}
@@ -1,147 +0,0 @@
1
- import React, { useState, useRef, useEffect } from 'react';
2
- import classnames from 'classnames';
3
- import { useDebounce } from '@blaze-react/utils/lib/customHooks';
4
- import useLocalStorage from '../useLocalStorage';
5
- import SearchBar from './SearchBar';
6
- import RecentSearches from './RecentSearches';
7
- import SearchResults from './SearchResults';
8
- import TriggerModal from './TriggerModal';
9
- import SearchAdminSideBar from './SearchAdminSideBar';
10
- import useSearchResults from '../useSearchResults';
11
- import { SEARCH_ADMIN } from '../../constants';
12
- const SearchAdmin = () => {
13
- const [searchTerm, setSearchTerm] = useState('');
14
- const [openSearchSideBar, setOpenSearchSideBar] = useState(true);
15
- const [entityValues, setEntityValues] = useState([]);
16
- const [recentSearches, setRecentSearches] = useLocalStorage('recentSearches', []);
17
- const [displaySearchModalFrame, setDisplaySearchModalFrame] = useState(false);
18
- const [enableResults, setEnableResults] = useState(true);
19
- const searchInputRef = useRef(null);
20
- const debouncedEntityValues = useDebounce(entityValues, 500);
21
- const entities = debouncedEntityValues.map(e => e.id);
22
- const [{
23
- loading,
24
- newResults: results = [],
25
- total
26
- }, setQueryParams] = useSearchResults({
27
- queryKey: SEARCH_ADMIN,
28
- entities
29
- });
30
- useEffect(() => {
31
- if (searchInputRef && searchInputRef.current) {
32
- searchInputRef.current.focus();
33
- }
34
- }, [displaySearchModalFrame]);
35
- const handleSearchTerm = ({
36
- target: {
37
- value
38
- }
39
- }) => {
40
- setSearchTerm(value);
41
- };
42
- const toggleSearchModal = () => {
43
- setSearchTerm(null);
44
- setEnableResults(false);
45
- setDisplaySearchModalFrame(!displaySearchModalFrame);
46
- };
47
- const search = ({
48
- value
49
- }) => {
50
- if (!value) return;
51
- !enableResults && setEnableResults(true);
52
- const MAX_RECENT_SEARCHES = 5;
53
- const recentSearchesCopy = recentSearches.slice();
54
- if (!recentSearchesCopy.includes(value)) {
55
- recentSearchesCopy.push(value);
56
- if (recentSearchesCopy.length > MAX_RECENT_SEARCHES) {
57
- recentSearchesCopy.shift();
58
- }
59
- }
60
- setRecentSearches(recentSearchesCopy);
61
- setQueryParams({
62
- value
63
- });
64
- };
65
- const handleKeyDown = ({
66
- key
67
- }) => {
68
- if (key === 'Enter') {
69
- if (!searchTerm) return clear();
70
- search({
71
- value: searchTerm
72
- });
73
- }
74
- };
75
- const clear = () => {
76
- setSearchTerm('');
77
- setEnableResults(false);
78
- };
79
- const searchModalResultsClassName = classnames('modal modal--full-screen modal--search', {
80
- 'modal--show': displaySearchModalFrame
81
- });
82
- const searchModalSideBarClassName = classnames('modal__search__sidebar', {
83
- 'modal__search__sidebar--close': !openSearchSideBar
84
- });
85
- const isEmptySearchTermAndData = !searchTerm && !results.length;
86
- const isEmptySearchTermnAndDisabledResults = !searchTerm && !enableResults;
87
- const shouldDisplayRecentSearches = isEmptySearchTermAndData || isEmptySearchTermnAndDisabledResults;
88
- const handleSetEntityValues = newEntity => {
89
- const entityExists = entityValues.some(entity => entity.id === newEntity.id);
90
- if (entityExists) {
91
- setQueryParams({
92
- value: searchTerm,
93
- offset: 0
94
- });
95
- setEntityValues(entityValues.filter(entity => entity.id !== newEntity.id));
96
- } else {
97
- setQueryParams({
98
- value: searchTerm,
99
- offset: 0
100
- });
101
- setEntityValues([...entityValues, newEntity]);
102
- }
103
- };
104
- return /*#__PURE__*/React.createElement("div", {
105
- className: "search search--header"
106
- }, /*#__PURE__*/React.createElement(TriggerModal, {
107
- toggleSearchModal: toggleSearchModal
108
- }), /*#__PURE__*/React.createElement("div", {
109
- className: searchModalResultsClassName
110
- }, displaySearchModalFrame && /*#__PURE__*/React.createElement("div", {
111
- className: "modal__search"
112
- }, /*#__PURE__*/React.createElement(SearchAdminSideBar, {
113
- searchModalSideBarClassName: searchModalSideBarClassName,
114
- openSearchSideBar: openSearchSideBar,
115
- setOpenSearchSideBar: setOpenSearchSideBar,
116
- handleSetEntityValues: handleSetEntityValues,
117
- entityValues: entityValues,
118
- setEntityValues: setEntityValues
119
- }), /*#__PURE__*/React.createElement("div", {
120
- className: "modal__search__content"
121
- }, /*#__PURE__*/React.createElement("div", {
122
- className: "modal__header modal__header--search"
123
- }, /*#__PURE__*/React.createElement(SearchBar, {
124
- toggleSearchModal: toggleSearchModal,
125
- handleKeyDown: handleKeyDown,
126
- searchInputRef: searchInputRef,
127
- handleSearchTerm: handleSearchTerm,
128
- searchTerm: searchTerm,
129
- search: () => search({
130
- value: searchTerm
131
- })
132
- })), shouldDisplayRecentSearches && /*#__PURE__*/React.createElement(RecentSearches, {
133
- recentSearches: recentSearches,
134
- handleSearchTerm: handleSearchTerm,
135
- search: search
136
- }), enableResults && /*#__PURE__*/React.createElement(SearchResults, {
137
- currentValue: searchTerm,
138
- entities: entities,
139
- loading: loading,
140
- results: results,
141
- total: total,
142
- setQueryParams: setQueryParams,
143
- closeModal: toggleSearchModal
144
- })))));
145
- };
146
- export default SearchAdmin;
147
- //# sourceMappingURL=SearchAdmin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SearchAdmin.js","names":["React","useState","useRef","useEffect","classnames","useDebounce","useLocalStorage","SearchBar","RecentSearches","SearchResults","TriggerModal","SearchAdminSideBar","useSearchResults","SEARCH_ADMIN","SearchAdmin","searchTerm","setSearchTerm","openSearchSideBar","setOpenSearchSideBar","entityValues","setEntityValues","recentSearches","setRecentSearches","displaySearchModalFrame","setDisplaySearchModalFrame","enableResults","setEnableResults","searchInputRef","debouncedEntityValues","entities","map","e","id","loading","newResults","results","total","setQueryParams","queryKey","current","focus","handleSearchTerm","target","value","toggleSearchModal","search","MAX_RECENT_SEARCHES","recentSearchesCopy","slice","includes","push","length","shift","handleKeyDown","key","clear","searchModalResultsClassName","searchModalSideBarClassName","isEmptySearchTermAndData","isEmptySearchTermnAndDisabledResults","shouldDisplayRecentSearches","handleSetEntityValues","newEntity","entityExists","some","entity","offset","filter","createElement","className","currentValue","closeModal"],"sources":["../../../src/components/SearchAdmin/SearchAdmin.js"],"sourcesContent":["import React, { useState, useRef, useEffect } from 'react';\nimport classnames from 'classnames';\nimport { useDebounce } from '@blaze-react/utils/lib/customHooks';\nimport useLocalStorage from '../useLocalStorage';\nimport SearchBar from './SearchBar';\nimport RecentSearches from './RecentSearches';\nimport SearchResults from './SearchResults';\nimport TriggerModal from './TriggerModal';\nimport SearchAdminSideBar from './SearchAdminSideBar';\nimport useSearchResults from '../useSearchResults';\nimport { SEARCH_ADMIN } from '../../constants';\n\nconst SearchAdmin = () => {\n const [searchTerm, setSearchTerm] = useState('');\n const [openSearchSideBar, setOpenSearchSideBar] = useState(true);\n const [entityValues, setEntityValues] = useState([]);\n const [recentSearches, setRecentSearches] = useLocalStorage('recentSearches', []);\n const [displaySearchModalFrame, setDisplaySearchModalFrame] = useState(false);\n const [enableResults, setEnableResults] = useState(true);\n const searchInputRef = useRef(null);\n const debouncedEntityValues = useDebounce(entityValues, 500);\n const entities = debouncedEntityValues.map(e => e.id);\n const [{ loading, newResults: results = [], total }, setQueryParams] = useSearchResults({\n queryKey: SEARCH_ADMIN,\n entities\n });\n\n useEffect(() => {\n if (searchInputRef && searchInputRef.current) {\n searchInputRef.current.focus();\n }\n }, [displaySearchModalFrame]);\n\n const handleSearchTerm = ({ target: { value } }) => {\n setSearchTerm(value);\n };\n\n const toggleSearchModal = () => {\n setSearchTerm(null);\n setEnableResults(false);\n setDisplaySearchModalFrame(!displaySearchModalFrame);\n };\n\n const search = ({ value }) => {\n if (!value) return;\n !enableResults && setEnableResults(true);\n const MAX_RECENT_SEARCHES = 5;\n const recentSearchesCopy = recentSearches.slice();\n\n if (!recentSearchesCopy.includes(value)) {\n recentSearchesCopy.push(value);\n if (recentSearchesCopy.length > MAX_RECENT_SEARCHES) {\n recentSearchesCopy.shift();\n }\n }\n\n setRecentSearches(recentSearchesCopy);\n setQueryParams({ value });\n };\n\n const handleKeyDown = ({ key }) => {\n if (key === 'Enter') {\n if (!searchTerm) return clear();\n search({ value: searchTerm });\n }\n };\n\n const clear = () => {\n setSearchTerm('');\n setEnableResults(false);\n };\n\n const searchModalResultsClassName = classnames('modal modal--full-screen modal--search', {\n 'modal--show': displaySearchModalFrame\n });\n\n const searchModalSideBarClassName = classnames('modal__search__sidebar', {\n 'modal__search__sidebar--close': !openSearchSideBar\n });\n\n const isEmptySearchTermAndData = !searchTerm && !results.length;\n const isEmptySearchTermnAndDisabledResults = !searchTerm && !enableResults;\n const shouldDisplayRecentSearches =\n isEmptySearchTermAndData || isEmptySearchTermnAndDisabledResults;\n\n const handleSetEntityValues = newEntity => {\n const entityExists = entityValues.some(entity => entity.id === newEntity.id);\n if (entityExists) {\n setQueryParams({ value: searchTerm, offset: 0 });\n setEntityValues(entityValues.filter(entity => entity.id !== newEntity.id));\n } else {\n setQueryParams({ value: searchTerm, offset: 0 });\n setEntityValues([...entityValues, newEntity]);\n }\n };\n\n return (\n <div className=\"search search--header\">\n <TriggerModal toggleSearchModal={toggleSearchModal} />\n <div className={searchModalResultsClassName}>\n {displaySearchModalFrame && (\n <div className=\"modal__search\">\n <SearchAdminSideBar\n searchModalSideBarClassName={searchModalSideBarClassName}\n openSearchSideBar={openSearchSideBar}\n setOpenSearchSideBar={setOpenSearchSideBar}\n handleSetEntityValues={handleSetEntityValues}\n entityValues={entityValues}\n setEntityValues={setEntityValues}\n />\n <div className=\"modal__search__content\">\n <div className=\"modal__header modal__header--search\">\n <SearchBar\n toggleSearchModal={toggleSearchModal}\n handleKeyDown={handleKeyDown}\n searchInputRef={searchInputRef}\n handleSearchTerm={handleSearchTerm}\n searchTerm={searchTerm}\n search={() => search({ value: searchTerm })}\n />\n </div>\n {shouldDisplayRecentSearches && (\n <RecentSearches\n recentSearches={recentSearches}\n handleSearchTerm={handleSearchTerm}\n search={search}\n />\n )}\n {enableResults && (\n <SearchResults\n currentValue={searchTerm}\n entities={entities}\n loading={loading}\n results={results}\n total={total}\n setQueryParams={setQueryParams}\n closeModal={toggleSearchModal}\n />\n )}\n </div>\n </div>\n )}\n </div>\n </div>\n );\n};\n\nexport default SearchAdmin;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,MAAM,EAAEC,SAAS,QAAQ,OAAO;AAC1D,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,WAAW,QAAQ,oCAAoC;AAChE,OAAOC,eAAe,MAAM,oBAAoB;AAChD,OAAOC,SAAS,MAAM,aAAa;AACnC,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,OAAOC,YAAY,MAAM,gBAAgB;AACzC,OAAOC,kBAAkB,MAAM,sBAAsB;AACrD,OAAOC,gBAAgB,MAAM,qBAAqB;AAClD,SAASC,YAAY,QAAQ,iBAAiB;AAE9C,MAAMC,WAAW,GAAGA,CAAA,KAAM;EACxB,MAAM,CAAC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Y,EAAEA,YAAa;IAC3BC,eAAe,EAAEA;EAAgB,CAClC,CAAC,eACFpB,KAAA,CAAAoE,aAAA;IAAKC,SAAS,EAAC;EAAwB,gBACrCrE,KAAA,CAAAoE,aAAA;IAAKC,SAAS,EAAC;EAAqC,gBAClDrE,KAAA,CAAAoE,aAAA,CAAC7D,SAAS;IACRqC,iBAAiB,EAAEA,iBAAkB;IACrCS,aAAa,EAAEA,aAAc;IAC7B1B,cAAc,EAAEA,cAAe;IAC/Bc,gBAAgB,EAAEA,gBAAiB;IACnC1B,UAAU,EAAEA,UAAW;IACvB8B,MAAM,EAAEA,CAAA,KAAMA,MAAM,CAAC;MAAEF,KAAK,EAAE5B;IAAW,CAAC;EAAE,CAC7C,CACE,CAAC,EACL6C,2BAA2B,iBAC1B5D,KAAA,CAAAoE,aAAA,CAAC5D,cAAc;IACba,cAAc,EAAEA,cAAe;IAC/BoB,gBAAgB,EAAEA,gBAAiB;IACnCI,MAAM,EAAEA;EAAO,CAChB,CACF,EACApB,aAAa,iBACZzB,KAAA,CAAAoE,aAAA,CAAC3D,aAAa;IACZ6D,YAAY,EAAEvD,UAAW;IACzBc,QAAQ,EAAEA,QAAS;IACnBI,OAAO,EAAEA,OAAQ;IACjBE,OAAO,EAAEA,OAAQ;IACjBC,KAAK,EAAEA,KAAM;IACbC,cAAc,EAAEA,cAAe;IAC/BkC,UAAU,EAAE3B;EAAkB,CAC/B,CAEA,CACF,CAEJ,CACF,CAAC;AAEV,CAAC;AAED,eAAe9B,WAAW","ignoreList":[]}
@@ -1,76 +0,0 @@
1
- import React, { useState } from 'react';
2
- import { useQuery } from '@apollo/client';
3
- import { getQuery } from '@blaze-cms/admin-ui-utils';
4
- import { Checkbox } from '@blaze-react/checkboxes';
5
- const MENU_PERMISSIONS = ['update:any', 'update:own', 'create:any', 'create:own'];
6
- const SearchAdminSideBar = ({
7
- searchModalSideBarClassName,
8
- openSearchSideBar,
9
- setOpenSearchSideBar,
10
- handleSetEntityValues,
11
- entityValues,
12
- setEntityValues
13
- }) => {
14
- const [loadMore, setLoadMore] = useState(false);
15
- const {
16
- data: {
17
- getEntitySchemas = []
18
- } = {},
19
- loading
20
- } = useQuery(getQuery('GET_USER_EDITABLE_ENTITIES'), {
21
- variables: {
22
- canDoActions: MENU_PERMISSIONS
23
- }
24
- });
25
- if (loading) return null;
26
- const filteredEntitiesSchemas = getEntitySchemas.filter(entity => {
27
- if (entity.extras && entity.extras.searchIndexes) {
28
- return entity.extras.searchIndexes.includes('admin');
29
- }
30
- return false;
31
- });
32
- const entitiesToShow = filteredEntitiesSchemas.slice(0, loadMore ? filteredEntitiesSchemas.length : 5);
33
- return /*#__PURE__*/React.createElement("div", {
34
- className: searchModalSideBarClassName
35
- }, /*#__PURE__*/React.createElement("div", {
36
- className: "modal__search__sidebar__button",
37
- role: "button",
38
- onClick: () => setOpenSearchSideBar(!openSearchSideBar)
39
- }, /*#__PURE__*/React.createElement("i", {
40
- className: "material-icons"
41
- }, openSearchSideBar ? 'keyboard_arrow_left' : 'keyboard_arrow_right')), /*#__PURE__*/React.createElement("div", {
42
- className: "modal__search__sidebar__container"
43
- }, /*#__PURE__*/React.createElement("div", {
44
- className: "modal__search__sidebar__wrapper"
45
- }, /*#__PURE__*/React.createElement("div", {
46
- className: "modal__search__sidebar__filters"
47
- }, /*#__PURE__*/React.createElement("i", {
48
- className: "material-icons modal__search__sidebar__icon"
49
- }, "tune"), /*#__PURE__*/React.createElement("span", null, "Filters")), /*#__PURE__*/React.createElement("div", {
50
- className: "modal__search__sidebar__clear",
51
- role: "button",
52
- onClick: () => setEntityValues([])
53
- }, /*#__PURE__*/React.createElement("span", null, "Clear all"), /*#__PURE__*/React.createElement("i", {
54
- className: "material-icons modal__search__sidebar__icon--clear"
55
- }, "replay"))), /*#__PURE__*/React.createElement("div", {
56
- className: "modal__search__sidebar__entity-list"
57
- }, /*#__PURE__*/React.createElement("h1", null, "Entity list"), entitiesToShow.map(entity => /*#__PURE__*/React.createElement(Checkbox, {
58
- checked: entityValues.some(_entity => _entity.id === entity.id),
59
- label: entity.displayName,
60
- id: entity.id,
61
- name: entity.id,
62
- onChange: ({
63
- value: {
64
- checked
65
- }
66
- }) => handleSetEntityValues(entity)
67
- })), /*#__PURE__*/React.createElement("div", {
68
- className: "modal__search__sidebar__more",
69
- role: "button",
70
- onClick: () => setLoadMore(!loadMore)
71
- }, /*#__PURE__*/React.createElement("i", {
72
- className: "material-icons"
73
- }, !loadMore ? 'navigate_next' : 'expand_less'), /*#__PURE__*/React.createElement("span", null, loadMore ? 'Less' : 'More')))));
74
- };
75
- export default SearchAdminSideBar;
76
- //# sourceMappingURL=SearchAdminSideBar.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SearchAdminSideBar.js","names":["React","useState","useQuery","getQuery","Checkbox","MENU_PERMISSIONS","SearchAdminSideBar","searchModalSideBarClassName","openSearchSideBar","setOpenSearchSideBar","handleSetEntityValues","entityValues","setEntityValues","loadMore","setLoadMore","data","getEntitySchemas","loading","variables","canDoActions","filteredEntitiesSchemas","filter","entity","extras","searchIndexes","includes","entitiesToShow","slice","length","createElement","className","role","onClick","map","checked","some","_entity","id","label","displayName","name","onChange","value"],"sources":["../../../../src/components/SearchAdmin/SearchAdminSideBar/SearchAdminSideBar.js"],"sourcesContent":["import React, { useState } from 'react';\nimport { useQuery } from '@apollo/client';\nimport { getQuery } from '@blaze-cms/admin-ui-utils';\nimport { Checkbox } from '@blaze-react/checkboxes';\n\nconst MENU_PERMISSIONS = ['update:any', 'update:own', 'create:any', 'create:own'];\n\nconst SearchAdminSideBar = ({\n searchModalSideBarClassName,\n openSearchSideBar,\n setOpenSearchSideBar,\n handleSetEntityValues,\n entityValues,\n setEntityValues\n}) => {\n const [loadMore, setLoadMore] = useState(false);\n const { data: { getEntitySchemas = [] } = {}, loading } = useQuery(\n getQuery('GET_USER_EDITABLE_ENTITIES'),\n {\n variables: {\n canDoActions: MENU_PERMISSIONS\n }\n }\n );\n\n if (loading) return null;\n\n const filteredEntitiesSchemas = getEntitySchemas.filter(entity => {\n if (entity.extras && entity.extras.searchIndexes) {\n return entity.extras.searchIndexes.includes('admin');\n }\n return false;\n });\n\n const entitiesToShow = filteredEntitiesSchemas.slice(\n 0,\n loadMore ? filteredEntitiesSchemas.length : 5\n );\n\n return (\n <div className={searchModalSideBarClassName}>\n <div\n className=\"modal__search__sidebar__button\"\n role=\"button\"\n onClick={() => setOpenSearchSideBar(!openSearchSideBar)}>\n <i className=\"material-icons\">\n {openSearchSideBar ? 'keyboard_arrow_left' : 'keyboard_arrow_right'}\n </i>\n </div>\n <div className=\"modal__search__sidebar__container\">\n <div className=\"modal__search__sidebar__wrapper\">\n <div className=\"modal__search__sidebar__filters\">\n <i className=\"material-icons modal__search__sidebar__icon\">tune</i>\n <span>Filters</span>\n </div>\n <div\n className=\"modal__search__sidebar__clear\"\n role=\"button\"\n onClick={() => setEntityValues([])}>\n <span>Clear all</span>\n <i className=\"material-icons modal__search__sidebar__icon--clear\">replay</i>\n </div>\n </div>\n <div className=\"modal__search__sidebar__entity-list\">\n <h1>Entity list</h1>\n {entitiesToShow.map(entity => (\n <Checkbox\n checked={entityValues.some(_entity => _entity.id === entity.id)}\n label={entity.displayName}\n id={entity.id}\n name={entity.id}\n onChange={({ value: { checked } }) => handleSetEntityValues(entity)}\n />\n ))}\n <div\n className=\"modal__search__sidebar__more\"\n role=\"button\"\n onClick={() => setLoadMore(!loadMore)}>\n <i className=\"material-icons\">{!loadMore ? 'navigate_next' : 'expand_less'}</i>\n <span>{loadMore ? 'Less' : 'More'}</span>\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nexport default SearchAdminSideBar;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,QAAQ,QAAQ,gBAAgB;AACzC,SAASC,QAAQ,QAAQ,2BAA2B;AACpD,SAASC,QAAQ,QAAQ,yBAAyB;AAElD,MAAMC,gBAAgB,GAAG,CAAC,YAAY,EAAE,YAAY,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A,CAAA6B,aAAA;IAAGC,SAAS,EAAC;EAAgB,GAAE,CAACjB,QAAQ,GAAG,eAAe,GAAG,aAAiB,CAAC,eAC/Eb,KAAA,CAAA6B,aAAA,eAAOhB,QAAQ,GAAG,MAAM,GAAG,MAAa,CACrC,CACF,CACF,CACF,CAAC;AAEV,CAAC;AAED,eAAeP,kBAAkB","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- import SearchAdminSideBar from './SearchAdminSideBar';
2
- export default SearchAdminSideBar;
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["SearchAdminSideBar"],"sources":["../../../../src/components/SearchAdmin/SearchAdminSideBar/index.js"],"sourcesContent":["import SearchAdminSideBar from './SearchAdminSideBar';\n\nexport default SearchAdminSideBar;\n"],"mappings":"AAAA,OAAOA,kBAAkB,MAAM,sBAAsB;AAErD,eAAeA,kBAAkB","ignoreList":[]}
@@ -1,52 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- const SearchBar = ({
4
- handleKeyDown,
5
- searchInputRef,
6
- handleSearchTerm,
7
- searchTerm,
8
- toggleSearchModal,
9
- close,
10
- search,
11
- placeholder
12
- }) => /*#__PURE__*/React.createElement("div", {
13
- className: "search__wrapper"
14
- }, /*#__PURE__*/React.createElement("input", {
15
- onKeyDown: handleKeyDown,
16
- ref: searchInputRef,
17
- placeholder: placeholder,
18
- type: "text",
19
- onChange: handleSearchTerm,
20
- value: searchTerm
21
- }), /*#__PURE__*/React.createElement("span", {
22
- onClick: search,
23
- role: "button",
24
- className: "icon-button icon-button--search icon-button--toggle"
25
- }, /*#__PURE__*/React.createElement("i", {
26
- className: "material-icons"
27
- }, "search")), close && /*#__PURE__*/React.createElement("div", {
28
- className: "modal__close"
29
- }, /*#__PURE__*/React.createElement("i", {
30
- className: "material-icons",
31
- onClick: toggleSearchModal,
32
- role: "button"
33
- }, "close")));
34
- SearchBar.propTypes = {
35
- close: PropTypes.bool,
36
- handleKeyDown: PropTypes.func.isRequired,
37
- searchInputRef: PropTypes.object,
38
- handleSearchTerm: PropTypes.func.isRequired,
39
- searchTerm: PropTypes.string,
40
- toggleSearchModal: PropTypes.func,
41
- search: PropTypes.func.isRequired,
42
- placeholder: PropTypes.string
43
- };
44
- SearchBar.defaultProps = {
45
- searchTerm: '',
46
- close: true,
47
- placeholder: 'Search...',
48
- toggleSearchModal: null,
49
- searchInputRef: null
50
- };
51
- export default SearchBar;
52
- //# sourceMappingURL=SearchBar.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SearchBar.js","names":["React","PropTypes","SearchBar","handleKeyDown","searchInputRef","handleSearchTerm","searchTerm","toggleSearchModal","close","search","placeholder","createElement","className","onKeyDown","ref","type","onChange","value","onClick","role","propTypes","bool","func","isRequired","object","string","defaultProps"],"sources":["../../../../src/components/SearchAdmin/SearchBar/SearchBar.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst SearchBar = ({\n handleKeyDown,\n searchInputRef,\n handleSearchTerm,\n searchTerm,\n toggleSearchModal,\n close,\n search,\n placeholder\n}) => (\n <div className=\"search__wrapper\">\n <input\n onKeyDown={handleKeyDown}\n ref={searchInputRef}\n placeholder={placeholder}\n type=\"text\"\n onChange={handleSearchTerm}\n value={searchTerm}\n />\n <span\n onClick={search}\n role=\"button\"\n className=\"icon-button icon-button--search icon-button--toggle\">\n <i className=\"material-icons\">search</i>\n </span>\n {close && (\n <div className=\"modal__close\">\n <i className=\"material-icons\" onClick={toggleSearchModal} role=\"button\">\n close\n </i>\n </div>\n )}\n </div>\n);\n\nSearchBar.propTypes = {\n close: PropTypes.bool,\n handleKeyDown: PropTypes.func.isRequired,\n searchInputRef: PropTypes.object,\n handleSearchTerm: PropTypes.func.isRequired,\n searchTerm: PropTypes.string,\n toggleSearchModal: PropTypes.func,\n search: PropTypes.func.isRequired,\n placeholder: PropTypes.string\n};\n\nSearchBar.defaultProps = {\n searchTerm: '',\n close: true,\n placeholder: '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,EAAER,SAAS,CAACqB,IAAI,CAACC,UAAU;EACjCb,WAAW,EAAET,SAAS,CAACwB;AACzB,CAAC;AAEDvB,SAAS,CAACwB,YAAY,GAAG;EACvBpB,UAAU,EAAE,EAAE;EACdE,KAAK,EAAE,IAAI;EACXE,WAAW,EAAE,WAAW;EACxBH,iBAAiB,EAAE,IAAI;EACvBH,cAAc,EAAE;AAClB,CAAC;AAED,eAAeF,SAAS","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- import SearchBar from './SearchBar';
2
- export default SearchBar;
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["SearchBar"],"sources":["../../../../src/components/SearchAdmin/SearchBar/index.js"],"sourcesContent":["import SearchBar from './SearchBar';\n\nexport default SearchBar;\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,aAAa;AAEnC,eAAeA,SAAS","ignoreList":[]}