@blaze-cms/plugin-search-ui 0.146.0-rc-eagle.0 → 0.146.0-rc-eagle-3.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 (62) hide show
  1. package/CHANGELOG.md +5 -1
  2. package/lib/components/SearchAdmin/SearchAdmin.js +2 -1
  3. package/lib/components/SearchAdmin/SearchAdmin.js.map +1 -1
  4. package/lib/components/SearchAdmin/SearchAdminSideBar/SearchAdminSideBar.js +2 -1
  5. package/lib/components/SearchAdmin/SearchAdminSideBar/SearchAdminSideBar.js.map +1 -1
  6. package/lib/components/SearchAdmin/SearchResults/SearchResults.js +2 -1
  7. package/lib/components/SearchAdmin/SearchResults/SearchResults.js.map +1 -1
  8. package/lib/components/SearchPublishedContent/SearchPublishedContent.js +2 -1
  9. package/lib/components/SearchPublishedContent/SearchPublishedContent.js.map +1 -1
  10. package/lib-es/application/query/index.js +33 -0
  11. package/lib-es/application/query/index.js.map +1 -0
  12. package/lib-es/components/SearchAdmin/RecentSearches/RecentSearches.js +38 -0
  13. package/lib-es/components/SearchAdmin/RecentSearches/RecentSearches.js.map +1 -0
  14. package/lib-es/components/SearchAdmin/RecentSearches/index.js +3 -0
  15. package/lib-es/components/SearchAdmin/RecentSearches/index.js.map +1 -0
  16. package/lib-es/components/SearchAdmin/SearchAdmin.js +147 -0
  17. package/lib-es/components/SearchAdmin/SearchAdmin.js.map +1 -0
  18. package/lib-es/components/SearchAdmin/SearchAdminSideBar/SearchAdminSideBar.js +76 -0
  19. package/lib-es/components/SearchAdmin/SearchAdminSideBar/SearchAdminSideBar.js.map +1 -0
  20. package/lib-es/components/SearchAdmin/SearchAdminSideBar/index.js +3 -0
  21. package/lib-es/components/SearchAdmin/SearchAdminSideBar/index.js.map +1 -0
  22. package/lib-es/components/SearchAdmin/SearchBar/SearchBar.js +52 -0
  23. package/lib-es/components/SearchAdmin/SearchBar/SearchBar.js.map +1 -0
  24. package/lib-es/components/SearchAdmin/SearchBar/index.js +3 -0
  25. package/lib-es/components/SearchAdmin/SearchBar/index.js.map +1 -0
  26. package/lib-es/components/SearchAdmin/SearchResults/SearchResults.js +151 -0
  27. package/lib-es/components/SearchAdmin/SearchResults/SearchResults.js.map +1 -0
  28. package/lib-es/components/SearchAdmin/SearchResults/index.js +3 -0
  29. package/lib-es/components/SearchAdmin/SearchResults/index.js.map +1 -0
  30. package/lib-es/components/SearchAdmin/TriggerModal/TriggerModal.js +14 -0
  31. package/lib-es/components/SearchAdmin/TriggerModal/TriggerModal.js.map +1 -0
  32. package/lib-es/components/SearchAdmin/TriggerModal/index.js +3 -0
  33. package/lib-es/components/SearchAdmin/TriggerModal/index.js.map +1 -0
  34. package/lib-es/components/SearchAdmin/index.js +3 -0
  35. package/lib-es/components/SearchAdmin/index.js.map +1 -0
  36. package/lib-es/components/SearchPublishedContent/SearchPublishedContent.js +148 -0
  37. package/lib-es/components/SearchPublishedContent/SearchPublishedContent.js.map +1 -0
  38. package/lib-es/components/SearchPublishedContent/index.js +3 -0
  39. package/lib-es/components/SearchPublishedContent/index.js.map +1 -0
  40. package/lib-es/components/useLocalStorage/index.js +3 -0
  41. package/lib-es/components/useLocalStorage/index.js.map +1 -0
  42. package/lib-es/components/useLocalStorage/useLocalStorage.js +15 -0
  43. package/lib-es/components/useLocalStorage/useLocalStorage.js.map +1 -0
  44. package/lib-es/components/useSearch/index.js +3 -0
  45. package/lib-es/components/useSearch/index.js.map +1 -0
  46. package/lib-es/components/useSearch/useSearch.js +109 -0
  47. package/lib-es/components/useSearch/useSearch.js.map +1 -0
  48. package/lib-es/components/useSearchResults/index.js +3 -0
  49. package/lib-es/components/useSearchResults/index.js.map +1 -0
  50. package/lib-es/components/useSearchResults/useSearchResults.js +53 -0
  51. package/lib-es/components/useSearchResults/useSearchResults.js.map +1 -0
  52. package/lib-es/constants.js +11 -0
  53. package/lib-es/constants.js.map +1 -0
  54. package/lib-es/hooks/index.js +3 -0
  55. package/lib-es/hooks/index.js.map +1 -0
  56. package/lib-es/hooks/useDebounceSearch.js +44 -0
  57. package/lib-es/hooks/useDebounceSearch.js.map +1 -0
  58. package/lib-es/index.js +6 -0
  59. package/lib-es/index.js.map +1 -0
  60. package/package.json +12 -6
  61. package/babel.config.js +0 -3
  62. package/jest.config.js +0 -5
@@ -0,0 +1,76 @@
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
@@ -0,0 +1 @@
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,EAAE,YAAY,EAAE,YAAY,CAAC;AAEjF,MAAMC,kBAAkB,GAAGA,CAAC;EAC1BC,2BAA2B;EAC3BC,iBAAiB;EACjBC,oBAAoB;EACpBC,qBAAqB;EACrBC,YAAY;EACZC;AACF,CAAC,KAAK;EACJ,MAAM,CAACC,QAAQ,EAAEC,WAAW,CAAC,GAAGb,QAAQ,CAAC,KAAK,CAAC;EAC/C,MAAM;IAAEc,IAAI,EAAE;MAAEC,gBAAgB,GAAG;IAAG,CAAC,GAAG,CAAC,CAAC;IAAEC;EAAQ,CAAC,GAAGf,QAAQ,CAChEC,QAAQ,CAAC,4BAA4B,CAAC,EACtC;IACEe,SAAS,EAAE;MACTC,YAAY,EAAEd;IAChB;EACF,CACF,CAAC;EAED,IAAIY,OAAO,EAAE,OAAO,IAAI;EAExB,MAAMG,uBAAuB,GAAGJ,gBAAgB,CAACK,MAAM,CAACC,MAAM,IAAI;IAChE,IAAIA,MAAM,CAACC,MAAM,IAAID,MAAM,CAACC,MAAM,CAACC,aAAa,EAAE;MAChD,OAAOF,MAAM,CAACC,MA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ACX,MAAM,iBACxBtB,KAAA,CAAA6B,aAAA,CAACzB,QAAQ;IACP8B,OAAO,EAAEvB,YAAY,CAACwB,IAAI,CAACC,OAAO,IAAIA,OAAO,CAACC,EAAE,KAAKf,MAAM,CAACe,EAAE,CAAE;IAChEC,KAAK,EAAEhB,MAAM,CAACiB,WAAY;IAC1BF,EAAE,EAAEf,MAAM,CAACe,EAAG;IACdG,IAAI,EAAElB,MAAM,CAACe,EAAG;IAChBI,QAAQ,EAAEA,CAAC;MAAEC,KAAK,EAAE;QAAER;MAAQ;IAAE,CAAC,KAAKxB,qBAAqB,CAACY,MAAM;EAAE,CACrE,CACF,CAAC,eACFtB,KAAA,CAAA6B,aAAA;IACEC,SAAS,EAAC,8BAA8B;IACxCC,IAAI,EAAC,QAAQ;IACbC,OAAO,EAAEA,CAAA,KAAMlB,WAAW,CAAC,CAACD,QAAQ;EAAE,gBACtCb,KAAA,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":[]}
@@ -0,0 +1,3 @@
1
+ import SearchAdminSideBar from './SearchAdminSideBar';
2
+ export default SearchAdminSideBar;
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
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":[]}
@@ -0,0 +1,52 @@
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
@@ -0,0 +1 @@
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: 'Search...',\n toggleSearchModal: null,\n searchInputRef: null\n};\n\nexport default SearchBar;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAElC,MAAMC,SAAS,GAAGA,CAAC;EACjBC,aAAa;EACbC,cAAc;EACdC,gBAAgB;EAChBC,UAAU;EACVC,iBAAiB;EACjBC,KAAK;EACLC,MAAM;EACNC;AACF,CAAC,kBACCV,KAAA,CAAAW,aAAA;EAAKC,SAAS,EAAC;AAAiB,gBAC9BZ,KAAA,CAAAW,aAAA;EACEE,SAAS,EAAEV,aAAc;EACzBW,GAAG,EAAEV,cAAe;EACpBM,WAAW,EAAEA,WAAY;EACzBK,IAAI,EAAC,MAAM;EACXC,QAAQ,EAAEX,gBAAiB;EAC3BY,KAAK,EAAEX;AAAW,CACnB,CAAC,eACFN,KAAA,CAAAW,aAAA;EACEO,OAAO,EAAET,MAAO;EAChBU,IAAI,EAAC,QAAQ;EACbP,SAAS,EAAC;AAAqD,gBAC/DZ,KAAA,CAAAW,aAAA;EAAGC,SAAS,EAAC;AAAgB,GAAC,QAAS,CACnC,CAAC,EACNJ,KAAK,iBACJR,KAAA,CAAAW,aAAA;EAAKC,SAAS,EAAC;AAAc,gBAC3BZ,KAAA,CAAAW,aAAA;EAAGC,SAAS,EAAC,gBAAgB;EAACM,OAAO,EAAEX,iBAAkB;EAACY,IAAI,EAAC;AAAQ,GAAC,OAErE,CACA,CAEJ,CACN;AAEDjB,SAAS,CAACkB,SAAS,GAAG;EACpBZ,KAAK,EAAEP,SAAS,CAACoB,IAAI;EACrBlB,aAAa,EAAEF,SAAS,CAACqB,IAAI,CAACC,UAAU;EACxCnB,cAAc,EAAEH,SAAS,CAACuB,MAAM;EAChCnB,gBAAgB,EAAEJ,SAAS,CAACqB,IAAI,CAACC,UAAU;EAC3CjB,UAAU,EAAEL,SAAS,CAACwB,MAAM;EAC5BlB,iBAAiB,EAAEN,SAAS,CAACqB,IAAI;EACjCb,MAAM,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":[]}
@@ -0,0 +1,3 @@
1
+ import SearchBar from './SearchBar';
2
+ export default SearchBar;
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
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":[]}
@@ -0,0 +1,151 @@
1
+ /* eslint-disable jsx-a11y/anchor-is-valid */
2
+ /* eslint-disable jsx-a11y/no-static-element-interactions */
3
+ import React, { useState, useEffect } from 'react';
4
+ import PropTypes from 'prop-types';
5
+ import VirtualList from 'react-tiny-virtual-list';
6
+ import { withRouter } from 'react-router-dom';
7
+ import { SEARCH_RESULTS_OVER_SCAN_BUFFER, SEARCH_RESULTS_ELEMENTS_HEIGHT_ABOVE_LIST, SEARCH_RESULTS_HEIGHT_OFFSET, SEARCH_RESULTS_ITEM_SIZE, FILE } from '../../../constants';
8
+ const SearchResults = ({
9
+ currentValue,
10
+ entities,
11
+ loading,
12
+ results,
13
+ total,
14
+ setQueryParams,
15
+ closeModal,
16
+ history
17
+ }) => {
18
+ const [verifiedRanges, setVerifiedRanges] = useState([]);
19
+ const [currentIndex, setCurrentIndex] = useState(0);
20
+ const [currentResults, setCurrentResults] = useState('');
21
+ const [allResults, setAllResults] = useState([]);
22
+ const [currentParams, setCurrentParams] = useState('');
23
+ useEffect(() => {
24
+ if (!loading) {
25
+ const newResults = results.map(({
26
+ id
27
+ }) => id).join(',');
28
+ if (currentResults !== newResults) {
29
+ const newParams = `${currentValue},${entities.join(',')}`;
30
+ if (newParams !== currentParams) {
31
+ setAllResults(results);
32
+ setCurrentParams(newParams);
33
+ if (verifiedRanges.length) setVerifiedRanges([]);
34
+ } else {
35
+ setAllResults(allResults.concat(results));
36
+ }
37
+ setCurrentResults(newResults);
38
+ }
39
+ }
40
+ }, [allResults, currentParams, currentResults, currentValue, entities, loading, results, total, verifiedRanges.length]);
41
+ const handleRenderedItems = async ({
42
+ startIndex
43
+ }) => {
44
+ const rowsLength = allResults.length;
45
+ const loadIndex = Math.floor(rowsLength / 2) - SEARCH_RESULTS_OVER_SCAN_BUFFER;
46
+ if (loadIndex > 0 && loadIndex < startIndex && !verifiedRanges.includes(loadIndex)) {
47
+ setQueryParams({
48
+ value: currentValue,
49
+ offset: allResults.length
50
+ });
51
+ setVerifiedRanges([...verifiedRanges, loadIndex]);
52
+ setCurrentIndex(startIndex + SEARCH_RESULTS_OVER_SCAN_BUFFER);
53
+ }
54
+ };
55
+ const getNavigationRoute = ({
56
+ id,
57
+ docType
58
+ }) => docType === FILE ? `/media/edit/${id}` : `/data-listing/${docType}/update/${id}`;
59
+ const navigate = ({
60
+ id,
61
+ docType
62
+ }) => {
63
+ history.push(getNavigationRoute({
64
+ id,
65
+ docType
66
+ }));
67
+ closeModal();
68
+ };
69
+ const getDateFormat = date => {
70
+ const newDate = new Date(date);
71
+ const day = `0${newDate.getDate()}`.slice(-2);
72
+ const month = `0${newDate.getMonth() + 1}`.slice(-2);
73
+ const year = String(newDate.getYear()).slice(-2);
74
+ return `${day}.${month}.${year}`;
75
+ };
76
+ if (!allResults.length) return /*#__PURE__*/React.createElement("div", {
77
+ className: "list list--search"
78
+ }, /*#__PURE__*/React.createElement("div", {
79
+ className: "header header--list"
80
+ }, /*#__PURE__*/React.createElement("h2", null, "No Results")));
81
+ return /*#__PURE__*/React.createElement("div", {
82
+ className: "modal__content modal__content--search"
83
+ }, /*#__PURE__*/React.createElement("div", {
84
+ className: "header header--list"
85
+ }, /*#__PURE__*/React.createElement("h2", {
86
+ className: "header--list--results"
87
+ }, "About ", /*#__PURE__*/React.createElement("b", null, total), " search keywords results")), /*#__PURE__*/React.createElement(VirtualList, {
88
+ width: "100%",
89
+ height: window.innerHeight - SEARCH_RESULTS_ELEMENTS_HEIGHT_ABOVE_LIST - SEARCH_RESULTS_HEIGHT_OFFSET,
90
+ itemCount: allResults.length,
91
+ itemSize: SEARCH_RESULTS_ITEM_SIZE,
92
+ overscanCount: SEARCH_RESULTS_OVER_SCAN_BUFFER,
93
+ scrollToIndex: currentIndex,
94
+ onItemsRendered: handleRenderedItems,
95
+ renderItem: ({
96
+ index,
97
+ style
98
+ }) => {
99
+ const {
100
+ id,
101
+ docType,
102
+ updated,
103
+ name,
104
+ entityIdentifier,
105
+ published,
106
+ created,
107
+ status
108
+ } = allResults[index];
109
+ const updatedDate = updated ? getDateFormat(updated) : null;
110
+ const createdDate = created ? getDateFormat(created) : null;
111
+ const publishedDate = published ? getDateFormat(published) : null;
112
+ return /*#__PURE__*/React.createElement("div", {
113
+ key: index,
114
+ style: style,
115
+ className: "list__item--resultWrapper"
116
+ }, /*#__PURE__*/React.createElement("div", {
117
+ className: "list__item list__item--result"
118
+ }, /*#__PURE__*/React.createElement("div", {
119
+ className: "list__item-row list__item-row--result"
120
+ }, /*#__PURE__*/React.createElement("span", {
121
+ className: "list__item-identifier"
122
+ }, entityIdentifier), /*#__PURE__*/React.createElement("a", {
123
+ href: getNavigationRoute({
124
+ id,
125
+ docType
126
+ }),
127
+ onClick: () => navigate({
128
+ id,
129
+ docType
130
+ }),
131
+ className: "list__item-link"
132
+ }, name), /*#__PURE__*/React.createElement("div", {
133
+ className: "list__item-dates"
134
+ }, publishedDate && /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("b", null, "Published: "), publishedDate), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("b", null, "Created: "), createdDate), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("b", null, "Updated: "), updatedDate)), /*#__PURE__*/React.createElement("div", {
135
+ className: "list__item-status"
136
+ }, status && /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("b", null, "Status: "), status)))));
137
+ }
138
+ }), loading && /*#__PURE__*/React.createElement("span", null, "Loading..."));
139
+ };
140
+ SearchResults.propTypes = {
141
+ loading: PropTypes.bool.isRequired,
142
+ results: PropTypes.array.isRequired,
143
+ total: PropTypes.number.isRequired,
144
+ setQueryParams: PropTypes.func.isRequired,
145
+ closeModal: PropTypes.func.isRequired,
146
+ history: PropTypes.object.isRequired,
147
+ currentValue: PropTypes.string.isRequired,
148
+ entities: PropTypes.array.isRequired
149
+ };
150
+ export default withRouter(SearchResults);
151
+ //# sourceMappingURL=SearchResults.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SearchResults.js","names":["React","useState","useEffect","PropTypes","VirtualList","withRouter","SEARCH_RESULTS_OVER_SCAN_BUFFER","SEARCH_RESULTS_ELEMENTS_HEIGHT_ABOVE_LIST","SEARCH_RESULTS_HEIGHT_OFFSET","SEARCH_RESULTS_ITEM_SIZE","FILE","SearchResults","currentValue","entities","loading","results","total","setQueryParams","closeModal","history","verifiedRanges","setVerifiedRanges","currentIndex","setCurrentIndex","currentResults","setCurrentResults","allResults","setAllResults","currentParams","setCurrentParams","newResults","map","id","join","newParams","length","concat","handleRenderedItems","startIndex","rowsLength","loadIndex","Math","floor","includes","value","offset","getNavigationRoute","docType","navigate","push","getDateFormat","date","newDate","Date","day","getDate","slice","month","getMonth","year","String","getYear","createElement","className","width","height","window","innerHeight","itemCount","itemSize","overscanCount","scrollToIndex","onItemsRendered","renderItem","index","style","updated","name","entityIdentifier","published","created","status","updatedDate","createdDate","publishedDate","key","href","onClick","propTypes","bool","isRequired","array","number","func","object","string"],"sources":["../../../../src/components/SearchAdmin/SearchResults/SearchResults.js"],"sourcesContent":["/* eslint-disable jsx-a11y/anchor-is-valid */\n/* eslint-disable jsx-a11y/no-static-element-interactions */\nimport React, { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport VirtualList from 'react-tiny-virtual-list';\nimport { withRouter } from 'react-router-dom';\nimport {\n SEARCH_RESULTS_OVER_SCAN_BUFFER,\n SEARCH_RESULTS_ELEMENTS_HEIGHT_ABOVE_LIST,\n SEARCH_RESULTS_HEIGHT_OFFSET,\n SEARCH_RESULTS_ITEM_SIZE,\n FILE\n} from '../../../constants';\n\nconst SearchResults = ({\n currentValue,\n entities,\n loading,\n results,\n total,\n setQueryParams,\n closeModal,\n history\n}) => {\n const [verifiedRanges, setVerifiedRanges] = useState([]);\n const [currentIndex, setCurrentIndex] = useState(0);\n const [currentResults, setCurrentResults] = useState('');\n const [allResults, setAllResults] = useState([]);\n const [currentParams, setCurrentParams] = useState('');\n\n useEffect(() => {\n if (!loading) {\n const newResults = results.map(({ id }) => id).join(',');\n if (currentResults !== newResults) {\n const newParams = `${currentValue},${entities.join(',')}`;\n if (newParams !== currentParams) {\n setAllResults(results);\n setCurrentParams(newParams);\n if (verifiedRanges.length) setVerifiedRanges([]);\n } else {\n setAllResults(allResults.concat(results));\n }\n setCurrentResults(newResults);\n }\n }\n }, [\n allResults,\n currentParams,\n currentResults,\n currentValue,\n entities,\n loading,\n results,\n total,\n verifiedRanges.length\n ]);\n\n const handleRenderedItems = async ({ startIndex }) => {\n const rowsLength = allResults.length;\n const loadIndex = Math.floor(rowsLength / 2) - SEARCH_RESULTS_OVER_SCAN_BUFFER;\n if (loadIndex > 0 && loadIndex < startIndex && !verifiedRanges.includes(loadIndex)) {\n setQueryParams({ value: currentValue, offset: allResults.length });\n setVerifiedRanges([...verifiedRanges, loadIndex]);\n setCurrentIndex(startIndex + SEARCH_RESULTS_OVER_SCAN_BUFFER);\n }\n };\n\n const getNavigationRoute = ({ id, docType }) =>\n docType === FILE ? `/media/edit/${id}` : `/data-listing/${docType}/update/${id}`;\n\n const navigate = ({ id, docType }) => {\n history.push(getNavigationRoute({ id, docType }));\n closeModal();\n };\n\n const getDateFormat = date => {\n const newDate = new Date(date);\n const day = `0${newDate.getDate()}`.slice(-2);\n const month = `0${newDate.getMonth() + 1}`.slice(-2);\n const year = String(newDate.getYear()).slice(-2);\n return `${day}.${month}.${year}`;\n };\n\n if (!allResults.length)\n return (\n <div className=\"list list--search\">\n <div className=\"header header--list\">\n <h2>No Results</h2>\n </div>\n </div>\n );\n\n return (\n <div className=\"modal__content modal__content--search\">\n <div className=\"header header--list\">\n <h2 className=\"header--list--results\">\n About <b>{total}</b> search keywords results\n </h2>\n </div>\n <VirtualList\n width=\"100%\"\n height={\n window.innerHeight -\n SEARCH_RESULTS_ELEMENTS_HEIGHT_ABOVE_LIST -\n SEARCH_RESULTS_HEIGHT_OFFSET\n }\n itemCount={allResults.length}\n itemSize={SEARCH_RESULTS_ITEM_SIZE}\n overscanCount={SEARCH_RESULTS_OVER_SCAN_BUFFER}\n scrollToIndex={currentIndex}\n onItemsRendered={handleRenderedItems}\n renderItem={({ index, style }) => {\n const { id, docType, updated, name, entityIdentifier, published, created, status } =\n allResults[index];\n const updatedDate = updated ? getDateFormat(updated) : null;\n const createdDate = created ? getDateFormat(created) : null;\n const publishedDate = published ? getDateFormat(published) : null;\n return (\n <div key={index} style={style} className=\"list__item--resultWrapper\">\n <div className=\"list__item list__item--result\">\n <div className=\"list__item-row list__item-row--result\">\n <span className=\"list__item-identifier\">{entityIdentifier}</span>\n <a\n href={getNavigationRoute({\n id,\n docType\n })}\n onClick={() =>\n navigate({\n id,\n docType\n })\n }\n className=\"list__item-link\">\n {name}\n </a>\n\n <div className=\"list__item-dates\">\n {publishedDate && (\n <span>\n <b>Published: </b>\n {publishedDate}\n </span>\n )}\n <span>\n <b>Created: </b>\n {createdDate}\n </span>\n <span>\n <b>Updated: </b>\n {updatedDate}\n </span>\n </div>\n <div className=\"list__item-status\">\n {status && (\n <span>\n <b>Status: </b>\n {status}\n </span>\n )}\n </div>\n </div>\n </div>\n </div>\n );\n }}\n />\n {loading && <span>Loading...</span>}\n </div>\n );\n};\n\nSearchResults.propTypes = {\n loading: PropTypes.bool.isRequired,\n results: PropTypes.array.isRequired,\n total: PropTypes.number.isRequired,\n setQueryParams: PropTypes.func.isRequired,\n closeModal: PropTypes.func.isRequired,\n history: PropTypes.object.isRequired,\n currentValue: PropTypes.string.isRequired,\n entities: PropTypes.array.isRequired\n};\n\nexport default withRouter(SearchResults);\n"],"mappings":"AAAA;AACA;AACA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,SAAS,QAAQ,OAAO;AAClD,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,WAAW,MAAM,yBAAyB;AACjD,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,SACEC,+BAA+B,EAC/BC,yCAAyC,EACzCC,4BAA4B,EAC5BC,wBAAwB,EACxBC,IAAI,QACC,oBAAoB;AAE3B,MAAMC,aAAa,GAAGA,C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8D,aAAA,4BACE9D,KAAA,CAAA8D,aAAA,YAAG,UAAW,CAAC,EACdmB,MACG,CAEL,CACF,CACF,CACF,CAAC;IAEV;EAAE,CACH,CAAC,EACDnE,OAAO,iBAAId,KAAA,CAAA8D,aAAA,eAAM,YAAgB,CAC/B,CAAC;AAEV,CAAC;AAEDnD,aAAa,CAAC6E,SAAS,GAAG;EACxB1E,OAAO,EAAEX,SAAS,CAACsF,IAAI,CAACC,UAAU;EAClC3E,OAAO,EAAEZ,SAAS,CAACwF,KAAK,CAACD,UAAU;EACnC1E,KAAK,EAAEb,SAAS,CAACyF,MAAM,CAACF,UAAU;EAClCzE,cAAc,EAAEd,SAAS,CAAC0F,IAAI,CAACH,UAAU;EACzCxE,UAAU,EAAEf,SAAS,CAAC0F,IAAI,CAACH,UAAU;EACrCvE,OAAO,EAAEhB,SAAS,CAAC2F,MAAM,CAACJ,UAAU;EACpC9E,YAAY,EAAET,SAAS,CAAC4F,MAAM,CAACL,UAAU;EACzC7E,QAAQ,EAAEV,SAAS,CAACwF,KAAK,CAACD;AAC5B,CAAC;AAED,eAAerF,UAAU,CAACM,aAAa,CAAC","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ import SearchResults from './SearchResults';
2
+ export default SearchResults;
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["SearchResults"],"sources":["../../../../src/components/SearchAdmin/SearchResults/index.js"],"sourcesContent":["import SearchResults from './SearchResults';\n\nexport default SearchResults;\n"],"mappings":"AAAA,OAAOA,aAAa,MAAM,iBAAiB;AAE3C,eAAeA,aAAa","ignoreList":[]}
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ const TriggerModal = ({
4
+ toggleSearchModal
5
+ }) => /*#__PURE__*/React.createElement("span", {
6
+ role: "button",
7
+ className: "material-icons searchModal-search-icon",
8
+ onClick: toggleSearchModal
9
+ }, "search");
10
+ TriggerModal.propTypes = {
11
+ toggleSearchModal: PropTypes.func.isRequired
12
+ };
13
+ export default TriggerModal;
14
+ //# sourceMappingURL=TriggerModal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TriggerModal.js","names":["React","PropTypes","TriggerModal","toggleSearchModal","createElement","role","className","onClick","propTypes","func","isRequired"],"sources":["../../../../src/components/SearchAdmin/TriggerModal/TriggerModal.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst TriggerModal = ({ toggleSearchModal }) => (\n <span\n role=\"button\"\n className=\"material-icons searchModal-search-icon\"\n onClick={toggleSearchModal}>\n search\n </span>\n);\n\nTriggerModal.propTypes = {\n toggleSearchModal: PropTypes.func.isRequired\n};\n\nexport default TriggerModal;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAElC,MAAMC,YAAY,GAAGA,CAAC;EAAEC;AAAkB,CAAC,kBACzCH,KAAA,CAAAI,aAAA;EACEC,IAAI,EAAC,QAAQ;EACbC,SAAS,EAAC,wCAAwC;EAClDC,OAAO,EAAEJ;AAAkB,GAAC,QAExB,CACP;AAEDD,YAAY,CAACM,SAAS,GAAG;EACvBL,iBAAiB,EAAEF,SAAS,CAACQ,IAAI,CAACC;AACpC,CAAC;AAED,eAAeR,YAAY","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ import TriggerModal from './TriggerModal';
2
+ export default TriggerModal;
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["TriggerModal"],"sources":["../../../../src/components/SearchAdmin/TriggerModal/index.js"],"sourcesContent":["import TriggerModal from './TriggerModal';\n\nexport default TriggerModal;\n"],"mappings":"AAAA,OAAOA,YAAY,MAAM,gBAAgB;AAEzC,eAAeA,YAAY","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ import SearchAdmin from './SearchAdmin';
2
+ export default SearchAdmin;
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["SearchAdmin"],"sources":["../../../src/components/SearchAdmin/index.js"],"sourcesContent":["import SearchAdmin from './SearchAdmin';\n\nexport default SearchAdmin;\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AAEvC,eAAeA,WAAW","ignoreList":[]}
@@ -0,0 +1,148 @@
1
+ import React, { useState, useEffect } from 'react';
2
+ import classnames from 'classnames';
3
+ import PropTypes from 'prop-types';
4
+ import { MdClose, MdSearch } from 'react-icons/md';
5
+ import { useDebounce } from '@blaze-react/utils/lib/customHooks';
6
+ import useSearchResults from '../useSearchResults';
7
+ import { SEARCH_PUBLISHED, DEFAULT_RESULTS_KEYS, SEARCH_BUTTON } from '../../constants';
8
+ const SearchPublishedContent = ({
9
+ entities,
10
+ children,
11
+ resultKeys,
12
+ getIsOpenSearchBar,
13
+ SearchIcon,
14
+ CloseIcon,
15
+ className,
16
+ onChange,
17
+ placeholder,
18
+ onEnterPress,
19
+ inputRef,
20
+ isSearchBarOpen,
21
+ fields
22
+ }) => {
23
+ const [displaySearchBar, setDisplaySearchBar] = useState(isSearchBarOpen);
24
+ const [searchTerm, setSearchTerm] = useState('');
25
+ const [previousSearchTerm, setPreviousSearchTerm] = useState(null);
26
+ const debouncedSearchTerm = useDebounce(searchTerm, 500);
27
+ const [{
28
+ loading,
29
+ results
30
+ }, setQueryParams] = useSearchResults({
31
+ queryKey: SEARCH_PUBLISHED,
32
+ resultKeys,
33
+ entities,
34
+ fields
35
+ });
36
+ useEffect(() => {
37
+ if (isSearchBarOpen !== displaySearchBar) {
38
+ setDisplaySearchBar(isSearchBarOpen);
39
+ }
40
+ },
41
+ // eslint-disable-next-line react-hooks/exhaustive-deps
42
+ [isSearchBarOpen]);
43
+ useEffect(() => {
44
+ if (inputRef && inputRef.current && displaySearchBar) {
45
+ inputRef.current.focus();
46
+ }
47
+ },
48
+ // eslint-disable-next-line react-hooks/exhaustive-deps
49
+ [displaySearchBar]);
50
+ useEffect(() => {
51
+ if (debouncedSearchTerm && debouncedSearchTerm !== previousSearchTerm) {
52
+ setQueryParams({
53
+ value: `${debouncedSearchTerm}*`
54
+ });
55
+ setPreviousSearchTerm(debouncedSearchTerm);
56
+ }
57
+ }, [debouncedSearchTerm, previousSearchTerm, setQueryParams]);
58
+ const handleOnChange = ({
59
+ target: {
60
+ value = ''
61
+ } = {}
62
+ }) => {
63
+ onChange(value);
64
+ setSearchTerm(value);
65
+ };
66
+ const handleKeyPress = event => {
67
+ const onEnter = event.key === 'Enter';
68
+ onEnter && onEnterPress();
69
+ };
70
+ const handleSearchBar = () => {
71
+ const voidSearchTerm = '';
72
+ displaySearchBar && setSearchTerm(voidSearchTerm);
73
+ handleOnChange({
74
+ value: voidSearchTerm
75
+ });
76
+ if (isSearchBarOpen !== null) {
77
+ getIsOpenSearchBar(!displaySearchBar);
78
+ }
79
+ setDisplaySearchBar(!displaySearchBar);
80
+ };
81
+ const searchWrapperClassname = classnames('search__wrapper', {
82
+ 'search__wrapper--toggle-display': displaySearchBar,
83
+ 'search__wrapper--toggle': !displaySearchBar
84
+ });
85
+ const triggerClassname = classnames('search__icon', {
86
+ open: displaySearchBar
87
+ });
88
+ return /*#__PURE__*/React.createElement("div", {
89
+ className: `search-wrapper ${className}`
90
+ }, /*#__PURE__*/React.createElement("div", {
91
+ className: "search search--header search--toggle"
92
+ }, /*#__PURE__*/React.createElement("div", {
93
+ className: searchWrapperClassname
94
+ }, /*#__PURE__*/React.createElement("input", {
95
+ "data-testid": "search-input",
96
+ onKeyPress: handleKeyPress,
97
+ placeholder: placeholder,
98
+ type: "text",
99
+ onChange: handleOnChange,
100
+ value: searchTerm,
101
+ ref: inputRef
102
+ }), /*#__PURE__*/React.createElement("button", {
103
+ type: "button",
104
+ className: "icon-button icon-button--search icon-button--toggle"
105
+ }, /*#__PURE__*/React.createElement(SearchIcon, null))), /*#__PURE__*/React.createElement("div", {
106
+ role: "button",
107
+ className: triggerClassname,
108
+ onClick: handleSearchBar,
109
+ id: SEARCH_BUTTON,
110
+ title: SEARCH_BUTTON
111
+ }, !displaySearchBar ? /*#__PURE__*/React.createElement(SearchIcon, null) : /*#__PURE__*/React.createElement(CloseIcon, null))), /*#__PURE__*/React.createElement("div", {
112
+ className: "search-modal"
113
+ }, children({
114
+ results: results.length && searchTerm ? results : [],
115
+ loading
116
+ })));
117
+ };
118
+ SearchPublishedContent.propTypes = {
119
+ entities: PropTypes.array,
120
+ children: PropTypes.func.isRequired,
121
+ resultKeys: PropTypes.string,
122
+ getIsOpenSearchBar: PropTypes.func,
123
+ SearchIcon: PropTypes.func,
124
+ CloseIcon: PropTypes.func,
125
+ onChange: PropTypes.func,
126
+ onEnterPress: PropTypes.func,
127
+ className: PropTypes.string,
128
+ placeholder: PropTypes.string,
129
+ inputRef: PropTypes.object,
130
+ isSearchBarOpen: PropTypes.bool,
131
+ fields: PropTypes.array
132
+ };
133
+ SearchPublishedContent.defaultProps = {
134
+ entities: ['published_page'],
135
+ placeholder: '',
136
+ resultKeys: DEFAULT_RESULTS_KEYS,
137
+ onChange: () => {},
138
+ onEnterPress: () => {},
139
+ getIsOpenSearchBar: state => state,
140
+ SearchIcon: () => /*#__PURE__*/React.createElement("i", null, /*#__PURE__*/React.createElement(MdSearch, null)),
141
+ CloseIcon: () => /*#__PURE__*/React.createElement("i", null, /*#__PURE__*/React.createElement(MdClose, null)),
142
+ className: '',
143
+ inputRef: null,
144
+ isSearchBarOpen: null,
145
+ fields: []
146
+ };
147
+ export default SearchPublishedContent;
148
+ //# sourceMappingURL=SearchPublishedContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SearchPublishedContent.js","names":["React","useState","useEffect","classnames","PropTypes","MdClose","MdSearch","useDebounce","useSearchResults","SEARCH_PUBLISHED","DEFAULT_RESULTS_KEYS","SEARCH_BUTTON","SearchPublishedContent","entities","children","resultKeys","getIsOpenSearchBar","SearchIcon","CloseIcon","className","onChange","placeholder","onEnterPress","inputRef","isSearchBarOpen","fields","displaySearchBar","setDisplaySearchBar","searchTerm","setSearchTerm","previousSearchTerm","setPreviousSearchTerm","debouncedSearchTerm","loading","results","setQueryParams","queryKey","current","focus","value","handleOnChange","target","handleKeyPress","event","onEnter","key","handleSearchBar","voidSearchTerm","searchWrapperClassname","triggerClassname","open","createElement","onKeyPress","type","ref","role","onClick","id","title","length","propTypes","array","func","isRequired","string","object","bool","defaultProps","state"],"sources":["../../../src/components/SearchPublishedContent/SearchPublishedContent.js"],"sourcesContent":["import React, { useState, useEffect } from 'react';\nimport classnames from 'classnames';\nimport PropTypes from 'prop-types';\nimport { MdClose, MdSearch } from 'react-icons/md';\nimport { useDebounce } from '@blaze-react/utils/lib/customHooks';\nimport useSearchResults from '../useSearchResults';\nimport { SEARCH_PUBLISHED, DEFAULT_RESULTS_KEYS, SEARCH_BUTTON } from '../../constants';\n\nconst SearchPublishedContent = ({\n entities,\n children,\n resultKeys,\n getIsOpenSearchBar,\n SearchIcon,\n CloseIcon,\n className,\n onChange,\n placeholder,\n onEnterPress,\n inputRef,\n isSearchBarOpen,\n fields\n}) => {\n const [displaySearchBar, setDisplaySearchBar] = useState(isSearchBarOpen);\n const [searchTerm, setSearchTerm] = useState('');\n const [previousSearchTerm, setPreviousSearchTerm] = useState(null);\n const debouncedSearchTerm = useDebounce(searchTerm, 500);\n\n const [{ loading, results }, setQueryParams] = useSearchResults({\n queryKey: SEARCH_PUBLISHED,\n resultKeys,\n entities,\n fields\n });\n\n useEffect(\n () => {\n if (isSearchBarOpen !== displaySearchBar) {\n setDisplaySearchBar(isSearchBarOpen);\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [isSearchBarOpen]\n );\n\n useEffect(\n () => {\n if (inputRef && inputRef.current && displaySearchBar) {\n inputRef.current.focus();\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [displaySearchBar]\n );\n\n useEffect(() => {\n if (debouncedSearchTerm && debouncedSearchTerm !== previousSearchTerm) {\n setQueryParams({ value: `${debouncedSearchTerm}*` });\n setPreviousSearchTerm(debouncedSearchTerm);\n }\n }, [debouncedSearchTerm, previousSearchTerm, setQueryParams]);\n\n const handleOnChange = ({ target: { value = '' } = {} }) => {\n onChange(value);\n setSearchTerm(value);\n };\n\n const handleKeyPress = event => {\n const onEnter = event.key === 'Enter';\n onEnter && onEnterPress();\n };\n\n const handleSearchBar = () => {\n const voidSearchTerm = '';\n displaySearchBar && setSearchTerm(voidSearchTerm);\n handleOnChange({ value: voidSearchTerm });\n if (isSearchBarOpen !== null) {\n getIsOpenSearchBar(!displaySearchBar);\n }\n setDisplaySearchBar(!displaySearchBar);\n };\n\n const searchWrapperClassname = classnames('search__wrapper', {\n 'search__wrapper--toggle-display': displaySearchBar,\n 'search__wrapper--toggle': !displaySearchBar\n });\n\n const triggerClassname = classnames('search__icon', {\n open: displaySearchBar\n });\n\n return (\n <div className={`search-wrapper ${className}`}>\n <div className=\"search search--header search--toggle\">\n <div className={searchWrapperClassname}>\n <input\n data-testid=\"search-input\"\n onKeyPress={handleKeyPress}\n placeholder={placeholder}\n type=\"text\"\n onChange={handleOnChange}\n value={searchTerm}\n ref={inputRef}\n />\n <button type=\"button\" className=\"icon-button icon-button--search icon-button--toggle\">\n <SearchIcon />\n </button>\n </div>\n <div\n role=\"button\"\n className={triggerClassname}\n onClick={handleSearchBar}\n id={SEARCH_BUTTON}\n title={SEARCH_BUTTON}>\n {!displaySearchBar ? <SearchIcon /> : <CloseIcon />}\n </div>\n </div>\n <div className=\"search-modal\">\n {children({ results: results.length && searchTerm ? results : [], loading })}\n </div>\n </div>\n );\n};\n\nSearchPublishedContent.propTypes = {\n entities: PropTypes.array,\n children: PropTypes.func.isRequired,\n resultKeys: PropTypes.string,\n getIsOpenSearchBar: PropTypes.func,\n SearchIcon: PropTypes.func,\n CloseIcon: PropTypes.func,\n onChange: PropTypes.func,\n onEnterPress: PropTypes.func,\n className: PropTypes.string,\n placeholder: PropTypes.string,\n inputRef: PropTypes.object,\n isSearchBarOpen: PropTypes.bool,\n fields: PropTypes.array\n};\n\nSearchPublishedContent.defaultProps = {\n entities: ['published_page'],\n placeholder: '',\n resultKeys: DEFAULT_RESULTS_KEYS,\n onChange: () => {},\n onEnterPress: () => {},\n getIsOpenSearchBar: state => state,\n SearchIcon: () => (\n <i>\n <MdSearch />\n </i>\n ),\n CloseIcon: () => (\n <i>\n <MdClose />\n </i>\n ),\n className: '',\n inputRef: null,\n isSearchBarOpen: null,\n fields: []\n};\n\nexport default SearchPublishedContent;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,SAAS,QAAQ,OAAO;AAClD,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,OAAO,EAAEC,QAAQ,QAAQ,gBAAgB;AAClD,SAASC,WAAW,QAAQ,oCAAoC;AAChE,OAAOC,gBAAgB,MAAM,qBAAqB;AAClD,SAASC,gBAAgB,EAAEC,oBAAoB,EAAEC,aAAa,QAAQ,iBAAiB;AAEvF,MAAMC,sBAAsB,GAAGA,CAAC;EAC9BC,QAAQ;EACRC,QAAQ;EACRC,UAAU;EACVC,kBAAkB;EAClBC,UAAU;EACVC,SAAS;EACTC,SAAS;EACTC,QAAQ;EACRC,WAAW;EACXC,YAAY;EACZC,QAAQ;EACRC,eAAe;EACfC;AACF,CAAC,KAAK;EACJ,MAAM,CAACC,gBAAgB,EAAEC,mBAAmB,CAAC,GAAG1B,QAAQ,CAACuB,eAAe,CAAC;EACzE,MAAM,CAACI,UAAU,EAAEC,aAAa,CAAC,GAAG5B,QAAQ,CAAC,EAAE,CAAC;EAChD,MAAM,CAAC6B,kBAAkB,EAAEC,qBAAqB,CAAC,GAAG9B,QAAQ,CAAC,IAAI,CAAC;EAClE,MAAM+B,mBAAmB,GAAGzB,WAAW,CAACqB,UAAU,EAAE,GAAG,CAAC;EAExD,MAAM,CAAC;IAAEK,OAAO;IAAEC;EAAQ,CAAC,EAAEC,cAAc,CAAC,GAAG3B,gBAAgB,CAAC;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AEA,CAAA,kBACTlB,KAAA,CAAAmD,aAAA,yBACEnD,KAAA,CAAAmD,aAAA,CAAC9C,OAAO,MAAE,CACT,CACJ;EACDc,SAAS,EAAE,EAAE;EACbI,QAAQ,EAAE,IAAI;EACdC,eAAe,EAAE,IAAI;EACrBC,MAAM,EAAE;AACV,CAAC;AAED,eAAeb,sBAAsB","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ import SearchPublishedContent from './SearchPublishedContent';
2
+ export default SearchPublishedContent;
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["SearchPublishedContent"],"sources":["../../../src/components/SearchPublishedContent/index.js"],"sourcesContent":["import SearchPublishedContent from './SearchPublishedContent';\n\nexport default SearchPublishedContent;\n"],"mappings":"AAAA,OAAOA,sBAAsB,MAAM,0BAA0B;AAE7D,eAAeA,sBAAsB","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ import useLocalStorage from './useLocalStorage';
2
+ export default useLocalStorage;
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["useLocalStorage"],"sources":["../../../src/components/useLocalStorage/index.js"],"sourcesContent":["import useLocalStorage from './useLocalStorage';\n\nexport default useLocalStorage;\n"],"mappings":"AAAA,OAAOA,eAAe,MAAM,mBAAmB;AAE/C,eAAeA,eAAe","ignoreList":[]}
@@ -0,0 +1,15 @@
1
+ import { useState } from 'react';
2
+ function useLocalStorage(key, initialValue) {
3
+ const [storedValue, setStoredValue] = useState(() => {
4
+ const item = window.localStorage.getItem(key);
5
+ return item ? JSON.parse(item) : initialValue;
6
+ });
7
+ const setValue = value => {
8
+ const valueToStore = value instanceof Function ? value(storedValue) : value;
9
+ setStoredValue(valueToStore);
10
+ window.localStorage.setItem(key, JSON.stringify(valueToStore));
11
+ };
12
+ return [storedValue, setValue];
13
+ }
14
+ export default useLocalStorage;
15
+ //# sourceMappingURL=useLocalStorage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useLocalStorage.js","names":["useState","useLocalStorage","key","initialValue","storedValue","setStoredValue","item","window","localStorage","getItem","JSON","parse","setValue","value","valueToStore","Function","setItem","stringify"],"sources":["../../../src/components/useLocalStorage/useLocalStorage.js"],"sourcesContent":["import { useState } from 'react';\n\nfunction useLocalStorage(key, initialValue) {\n const [storedValue, setStoredValue] = useState(() => {\n const item = window.localStorage.getItem(key);\n return item ? JSON.parse(item) : initialValue;\n });\n\n const setValue = value => {\n const valueToStore = value instanceof Function ? value(storedValue) : value;\n setStoredValue(valueToStore);\n window.localStorage.setItem(key, JSON.stringify(valueToStore));\n };\n\n return [storedValue, setValue];\n}\n\nexport default useLocalStorage;\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,OAAO;AAEhC,SAASC,eAAeA,CAACC,GAAG,EAAEC,YAAY,EAAE;EAC1C,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAGL,QAAQ,CAAC,MAAM;IACnD,MAAMM,IAAI,GAAGC,MAAM,CAACC,YAAY,CAACC,OAAO,CAACP,GAAG,CAAC;IAC7C,OAAOI,IAAI,GAAGI,IAAI,CAACC,KAAK,CAACL,IAAI,CAAC,GAAGH,YAAY;EAC/C,CAAC,CAAC;EAEF,MAAMS,QAAQ,GAAGC,KAAK,IAAI;IACxB,MAAMC,YAAY,GAAGD,KAAK,YAAYE,QAAQ,GAAGF,KAAK,CAACT,WAAW,CAAC,GAAGS,KAAK;IAC3ER,cAAc,CAACS,YAAY,CAAC;IAC5BP,MAAM,CAACC,YAAY,CAACQ,OAAO,CAACd,GAAG,EAAEQ,IAAI,CAACO,SAAS,CAACH,YAAY,CAAC,CAAC;EAChE,CAAC;EAED,OAAO,CAACV,WAAW,EAAEQ,QAAQ,CAAC;AAChC;AAEA,eAAeX,eAAe","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ import useSearch from './useSearch';
2
+ export default useSearch;
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["useSearch"],"sources":["../../../src/components/useSearch/index.js"],"sourcesContent":["import useSearch from './useSearch';\n\nexport default useSearch;\n"],"mappings":"AAAA,OAAOA,SAAS,MAAM,aAAa;AAEnC,eAAeA,SAAS","ignoreList":[]}