@abcagency/hc-ui-components 1.3.18 → 1.3.20

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 (190) hide show
  1. package/dist/apis/hcApi.js +85 -183
  2. package/dist/apis/hcApi.js.map +1 -1
  3. package/dist/components/HireControlMap.js +10 -5
  4. package/dist/components/HireControlMap.js.map +1 -1
  5. package/dist/components/modules/accordions/MapAccordionItem.js +10 -67
  6. package/dist/components/modules/accordions/MapAccordionItem.js.map +1 -1
  7. package/dist/components/modules/filter/index.js.map +1 -1
  8. package/dist/components/modules/filter/radio-item.js +1 -2
  9. package/dist/components/modules/filter/radio-item.js.map +1 -1
  10. package/dist/components/modules/jobListing/listing-details-container.js +45 -0
  11. package/dist/components/modules/jobListing/listing-details-container.js.map +1 -0
  12. package/dist/components/modules/jobListing/listing-details.js +25 -24
  13. package/dist/components/modules/jobListing/listing-details.js.map +1 -1
  14. package/dist/components/modules/{maps/list → list}/field-mapper.js +8 -7
  15. package/dist/components/modules/list/field-mapper.js.map +1 -0
  16. package/dist/components/modules/{maps/list → list}/header-item.js +2 -2
  17. package/dist/components/modules/list/header-item.js.map +1 -0
  18. package/dist/components/modules/{maps/list → list}/header.js +6 -4
  19. package/dist/components/modules/list/header.js.map +1 -0
  20. package/dist/components/modules/list/index.js +36 -0
  21. package/dist/components/modules/list/index.js.map +1 -0
  22. package/dist/components/modules/{maps/list → list}/item-expand-card/index.js +3 -1
  23. package/dist/components/modules/list/item-expand-card/index.js.map +1 -0
  24. package/dist/components/modules/{maps/list → list}/item-expand-card/recruiter-contact-nav.js +2 -2
  25. package/dist/components/modules/list/item-expand-card/recruiter-contact-nav.js.map +1 -0
  26. package/dist/components/modules/{maps/list → list}/item-expand-card/recruiter-details.js +1 -1
  27. package/dist/components/modules/list/item-expand-card/recruiter-details.js.map +1 -0
  28. package/dist/components/modules/list/item-expand-card/recruiter-headshot.js.map +1 -0
  29. package/dist/components/modules/list/item-list.js +131 -0
  30. package/dist/components/modules/list/item-list.js.map +1 -0
  31. package/dist/components/modules/list/list-item/index.js +75 -0
  32. package/dist/components/modules/list/list-item/index.js.map +1 -0
  33. package/dist/components/modules/list/list-item/list-item-container.js +47 -0
  34. package/dist/components/modules/list/list-item/list-item-container.js.map +1 -0
  35. package/dist/components/modules/{maps/list/list-item/index.js → list/list-item/list-item.js} +29 -33
  36. package/dist/components/modules/list/list-item/list-item.js.map +1 -0
  37. package/dist/components/modules/maps/map-list.js +3 -3
  38. package/dist/components/modules/maps/map-list.js.map +1 -1
  39. package/dist/contexts/mapContext.js +84 -113
  40. package/dist/contexts/mapContext.js.map +1 -1
  41. package/dist/contexts/mapListContext.js +181 -293
  42. package/dist/contexts/mapListContext.js.map +1 -1
  43. package/dist/contexts/trackEventContext.js +1 -1
  44. package/dist/services/configService.js +10 -28
  45. package/dist/services/configService.js.map +1 -1
  46. package/dist/services/googlePlacesNearbyService.js +33 -58
  47. package/dist/services/googlePlacesNearbyService.js.map +1 -1
  48. package/dist/services/listingAggregatorService.js +35 -75
  49. package/dist/services/listingAggregatorService.js.map +1 -1
  50. package/dist/services/listingEntityService.js +10 -31
  51. package/dist/services/listingEntityService.js.map +1 -1
  52. package/dist/services/listingService.js +26 -60
  53. package/dist/services/listingService.js.map +1 -1
  54. package/dist/services/recruiterService.js +11 -31
  55. package/dist/services/recruiterService.js.map +1 -1
  56. package/dist/types/apis/hcApi.d.ts +5 -0
  57. package/dist/types/clientToken.d.ts +2 -0
  58. package/dist/types/components/modules/accordions/MapAccordionItem.d.ts +9 -0
  59. package/dist/types/components/modules/accordions/default.d.ts +19 -0
  60. package/dist/types/components/modules/buttons/button-group-apply.d.ts +24 -0
  61. package/dist/types/components/modules/buttons/commute-pill.d.ts +5 -0
  62. package/dist/types/components/modules/buttons/default.d.ts +48 -0
  63. package/dist/types/components/modules/buttons/pill-wrapper.d.ts +3 -0
  64. package/dist/types/components/modules/dialogs/apply-dialog.d.ts +8 -0
  65. package/dist/types/components/modules/filter/sort.d.ts +8 -0
  66. package/dist/types/components/modules/grid.d.ts +8 -0
  67. package/dist/types/components/modules/icon.d.ts +10 -0
  68. package/dist/types/components/modules/jobListing/listing-details-container.d.ts +6 -0
  69. package/dist/types/components/modules/jobListing/listing-details.d.ts +18 -0
  70. package/dist/types/components/modules/list/field-mapper.d.ts +10 -0
  71. package/dist/types/components/modules/list/header-item.d.ts +11 -0
  72. package/dist/types/components/modules/list/header.d.ts +11 -0
  73. package/dist/types/components/modules/list/index.d.ts +9 -0
  74. package/dist/types/components/modules/list/item-expand-card/index.d.ts +7 -0
  75. package/dist/types/components/modules/list/item-expand-card/recruiter-contact-nav.d.ts +17 -0
  76. package/dist/types/components/modules/list/item-expand-card/recruiter-details.d.ts +21 -0
  77. package/dist/types/components/modules/list/item-expand-card/recruiter-headshot.d.ts +8 -0
  78. package/dist/types/components/modules/list/item-list.d.ts +21 -0
  79. package/dist/types/components/modules/list/list-item/index.d.ts +12 -0
  80. package/dist/types/components/modules/list/list-item/list-item-container.d.ts +14 -0
  81. package/dist/types/components/modules/list/list-item/list-item.d.ts +3 -0
  82. package/dist/types/constants/eventTypes.d.ts +13 -0
  83. package/dist/types/contexts/mapContext.d.ts +29 -0
  84. package/dist/types/contexts/mapListContext.d.ts +58 -0
  85. package/dist/types/contexts/trackEventContext.d.ts +6 -0
  86. package/dist/types/enums/SectionType.d.ts +9 -0
  87. package/dist/types/hooks/useList.d.ts +13 -0
  88. package/dist/types/services/configService.d.ts +6 -0
  89. package/dist/types/services/googlePlacesNearbyService.d.ts +5 -0
  90. package/dist/types/services/listingAggregatorService.d.ts +12 -0
  91. package/dist/types/services/listingEntityService.d.ts +6 -0
  92. package/dist/types/services/listingService.d.ts +9 -0
  93. package/dist/types/services/recruiterService.d.ts +6 -0
  94. package/dist/types/types/Address.d.ts +7 -0
  95. package/dist/types/types/ContentSection.d.ts +8 -0
  96. package/dist/types/types/GetListingParams.d.ts +8 -0
  97. package/dist/types/types/LatLng.d.ts +4 -0
  98. package/dist/types/types/ListingEntity.d.ts +10 -0
  99. package/dist/types/types/ListingFields.d.ts +20 -0
  100. package/dist/types/types/Listings.d.ts +31 -0
  101. package/dist/types/types/Recruiter.d.ts +9 -0
  102. package/dist/types/types/SimilarListing.d.ts +24 -0
  103. package/dist/types/types/config/Colors.d.ts +8 -0
  104. package/dist/types/types/config/MapConfig.d.ts +29 -0
  105. package/dist/types/types/config/PointsOfInterestConfig.d.ts +13 -0
  106. package/dist/types/types/config/SearchConfig.d.ts +4 -0
  107. package/dist/types/util/filterUtil.d.ts +28 -0
  108. package/dist/types/util/loading.d.ts +3 -0
  109. package/dist/types/util/localStorageUtil.d.ts +3 -0
  110. package/dist/types/util/mapUtil.d.ts +15 -0
  111. package/dist/types/util/sortUtil.d.ts +1 -0
  112. package/dist/types/util/stringUtils.d.ts +1 -0
  113. package/dist/util/filterUtil.js +1 -3
  114. package/dist/util/filterUtil.js.map +1 -1
  115. package/dist/util/localStorageUtil.js +37 -28
  116. package/dist/util/localStorageUtil.js.map +1 -1
  117. package/dist/util/mapUtil.js.map +1 -1
  118. package/package.json +23 -17
  119. package/rollup.config.mjs +23 -19
  120. package/src/apis/{hcApi.js → hcApi.ts} +27 -11
  121. package/src/components/HireControlMap.js +132 -129
  122. package/src/components/modules/accordions/MapAccordionItem.js +32 -74
  123. package/src/components/modules/filter/index.js +89 -89
  124. package/src/components/modules/filter/radio-item.js +0 -1
  125. package/src/components/modules/jobListing/listing-details-container.js +40 -0
  126. package/src/components/modules/jobListing/listing-details.js +209 -99
  127. package/src/components/modules/{maps/list → list}/field-mapper.js +114 -112
  128. package/src/components/modules/{maps/list → list}/header.js +49 -47
  129. package/src/components/modules/list/index.tsx +83 -0
  130. package/src/components/modules/{maps/list → list}/item-expand-card/index.js +24 -22
  131. package/src/components/modules/list/item-list.tsx +198 -0
  132. package/src/components/modules/list/list-item/index.js +70 -0
  133. package/src/components/modules/list/list-item/list-item-container.js +43 -0
  134. package/src/components/modules/{maps/list/list-item/index.js → list/list-item/list-item.js} +32 -38
  135. package/src/components/modules/maps/map-list.js +74 -74
  136. package/src/contexts/mapContext.tsx +129 -0
  137. package/src/contexts/mapListContext.tsx +297 -0
  138. package/src/enums/SectionType.ts +9 -0
  139. package/src/services/{configService.js → configService.ts} +16 -16
  140. package/src/services/{googlePlacesNearbyService.js → googlePlacesNearbyService.ts} +11 -2
  141. package/src/services/listingAggregatorService.ts +76 -0
  142. package/src/services/listingEntityService.ts +16 -0
  143. package/src/services/listingService.ts +40 -0
  144. package/src/services/{recruiterService.js → recruiterService.ts} +18 -17
  145. package/src/types/Address.ts +7 -0
  146. package/src/types/ContentSection.ts +9 -0
  147. package/src/types/GetListingParams.ts +8 -0
  148. package/src/types/LatLng.ts +4 -0
  149. package/src/types/ListingEntity.ts +11 -0
  150. package/src/types/ListingFields.ts +20 -0
  151. package/src/types/Listings.ts +32 -0
  152. package/src/types/Recruiter.ts +9 -0
  153. package/src/types/SimilarListing.ts +24 -0
  154. package/src/types/config/Colors.ts +8 -0
  155. package/src/types/config/MapConfig.ts +30 -0
  156. package/src/types/config/PointsOfInterestConfig.ts +13 -0
  157. package/src/types/config/SearchConfig.ts +4 -0
  158. package/src/util/filterUtil.js +239 -239
  159. package/src/util/localStorageUtil.ts +34 -0
  160. package/src/util/mapUtil.js +91 -91
  161. package/tsconfig.json +23 -0
  162. package/dist/components/modules/maps/list/field-mapper.js.map +0 -1
  163. package/dist/components/modules/maps/list/header-item.js.map +0 -1
  164. package/dist/components/modules/maps/list/header.js.map +0 -1
  165. package/dist/components/modules/maps/list/index.js +0 -102
  166. package/dist/components/modules/maps/list/index.js.map +0 -1
  167. package/dist/components/modules/maps/list/item-expand-card/index.js.map +0 -1
  168. package/dist/components/modules/maps/list/item-expand-card/recruiter-contact-nav.js.map +0 -1
  169. package/dist/components/modules/maps/list/item-expand-card/recruiter-details.js.map +0 -1
  170. package/dist/components/modules/maps/list/item-expand-card/recruiter-headshot.js.map +0 -1
  171. package/dist/components/modules/maps/list/list-item/index.js.map +0 -1
  172. package/dist/services/_virtual/_rollupPluginBabelHelpers.js +0 -372
  173. package/dist/services/_virtual/_rollupPluginBabelHelpers.js.map +0 -1
  174. package/dist/services/apis/hcApi.js +0 -189
  175. package/dist/services/apis/hcApi.js.map +0 -1
  176. package/dist/services/clientToken.js +0 -7
  177. package/dist/services/clientToken.js.map +0 -1
  178. package/dist/services/styles/index.css +0 -3
  179. package/src/components/modules/maps/list/index.js +0 -112
  180. package/src/contexts/mapContext.js +0 -101
  181. package/src/contexts/mapListContext.js +0 -242
  182. package/src/services/listingAggregatorService.js +0 -50
  183. package/src/services/listingEntityService.js +0 -15
  184. package/src/services/listingService.js +0 -26
  185. package/src/util/localStorageUtil.js +0 -27
  186. /package/dist/components/modules/{maps/list → list}/item-expand-card/recruiter-headshot.js +0 -0
  187. /package/src/components/modules/{maps/list → list}/header-item.js +0 -0
  188. /package/src/components/modules/{maps/list → list}/item-expand-card/recruiter-contact-nav.js +0 -0
  189. /package/src/components/modules/{maps/list → list}/item-expand-card/recruiter-details.js +0 -0
  190. /package/src/components/modules/{maps/list → list}/item-expand-card/recruiter-headshot.js +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"item-list.js","sources":["../../../../src/components/modules/list/item-list.tsx"],"sourcesContent":["// import React, { RefObject } from 'react';\n// import Accordion from '~/components/modules/accordions/default';\n// import Header from '~/components/modules/list/header';\n// import MapAccordionItemContainer from '~/components/modules/list/list-item';\n// import Sort from '~/components/modules/filter/sort';\n// import ListingDetails from '~/components/modules/jobListing/listing-details';\n// import Loading from \"~/util/loading\";\n// import { dynamicSort } from '~/util/sortUtil';\n// import { IListing } from '~/interfaces/IListings';\n// import { IMapConfig } from '~/interfaces/config/IMapConfig';\n\n// interface ItemsListProps {\n// fieldNames: Record<string, string>;\n// showMap: boolean;\n// fieldsShown: string[];\n// specialFeatures: any;\n// mapItems: any;\n// filteredListings: IListing[];\n// loading: boolean;\n// sortSetting: any;\n// setSortSetting: (setting: any) => void;\n// itemLimit: number;\n// loader: RefObject<HTMLDivElement>;\n// scrollContainerRef: RefObject<HTMLDivElement>;\n// itemRefs: any;\n// selectedListItem: IListing | null;\n// itemExpandedContent: (item: IListing, recruiters: any) => JSX.Element | null;\n// }\n\n// const ItemsList: React.FC<ItemsListProps> = ({\n// \tfieldNames,\n// \tshowMap,\n// \tfieldsShown,\n// \tspecialFeatures,\n// \tmapItems,\n// \tfilteredListings,\n// \tloading,\n// \tsortSetting,\n// \tsetSortSetting,\n// \titemLimit,\n// \tloader,\n// \tscrollContainerRef,\n// \titemRefs,\n// \tselectedListItem,\n// \titemExpandedContent\n// }) => (\n// \t<div className=\"hc-relative hc-bg-white md:hc-px-4 hc-flex hc-flex-col\">\n// \t\t<div className=\"hc-flex hc-flex-wrap hc-items-center hc-justify-between hc-gap-4 md:hc-mb-2 hc-p-3 md:hc-p-0 hc-bg-uiAccent/10 md:hc-bg-transparent hc-border-b md:hc-border-none hc-border-uiAccent/20\">\n// \t\t\t<h2 className=\"hc-text-gray-500 hc-font-semibold hc-text-xs md:hc-text-sm\">\n// \t\t\t\t{loading && <span>Loading...</span>}\n// \t\t\t\t{!loading && <span>{filteredListings.length} results</span>}\n// \t\t\t</h2>\n// \t\t\t<div className=\"hc-block md:hc-hidden\">\n// \t\t\t\t<Sort\n// \t\t\t\t\tclassName={''}\n// \t\t\t\t\tfields={fieldsShown}\n// \t\t\t\t\tsetSortSetting={setSortSetting}\n// \t\t\t\t\tfieldNames={fieldNames}\n// \t\t\t\t/>\n// \t\t\t</div>\n// \t\t</div>\n// \t\t<div>\n// \t\t\t<Header\n// \t\t\t\tclassName={''}\n// \t\t\t\tsetSortSetting={setSortSetting}\n// \t\t\t\tsortSetting={sortSetting}\n// \t\t\t\tfieldsShown={fieldsShown}\n// \t\t\t\tfieldNames={fieldNames}\n// \t\t\t/>\n// \t\t</div>\n// \t\t<div\n// \t\t\tref={scrollContainerRef}\n// \t\t\tclassName={`\n// hc-flex-grow hc-overflow-y-auto\n// ${showMap ? \"md:hc-max-h-45vh hc-max-h-[100vh]\" : \"md:hc-max-h-95vh hc-max-h-[95vh]\"}\n// `}\n// \t\t>\n// \t\t\t{loading ? (\n// \t\t\t\t<div className=\"hc-flex hc-justify-center hc-items-center hc-pt-20\">\n// \t\t\t\t\t<Loading />\n// \t\t\t\t</div>\n// \t\t\t) : (\n// \t\t\t\t<Accordion className=\"hc-divide-y hc-divide-uiAccent/10 hc-z-[1000]\" defaultValue={selectedListItem?.id}>\n// \t\t\t\t\t{(sortSetting ? dynamicSort(filteredListings, sortSetting.field, sortSetting.type) : filteredListings).slice(0, itemLimit).map((item: IListing) => (\n// \t\t\t\t\t\t<MapAccordionItemContainer\n// \t\t\t\t\t\t\tkey={item.id}\n// \t\t\t\t\t\t\tshowMap={showMap}\n// \t\t\t\t\t\t\titem={item}\n// \t\t\t\t\t\t\titemRefs={itemRefs}\n// \t\t\t\t\t\t\tfieldsShown={fieldsShown}\n// \t\t\t\t\t\t\titemExpandedContent={itemExpandedContent}\n// \t\t\t\t\t\t\tspecialFeatures={specialFeatures}\n// \t\t\t\t\t\t\tmapItems={mapItems}\n// \t\t\t\t\t\t\tisActive={selectedListItem?.id === item.id}\n// \t\t\t\t\t\t\thasListItemSelected={selectedListItem != null}\n// \t\t\t\t\t\t/>\n// \t\t\t\t\t))}\n\n// \t\t\t\t</Accordion>\n// \t\t\t)}\n// \t\t\t<div ref={loader} style={{ height: \"100px\", textAlign: \"center\" }}>\n// \t\t\t\t{filteredListings.length >= itemLimit && <Loading />}\n// \t\t\t</div>\n// \t\t</div>\n// \t</div>\n// );\n\n// export default ItemsList;\nimport React, { RefObject, ReactNode } from 'react';\nimport Header from '~/components/modules/list/header';\nimport MapAccordionItemContainer from '~/components/modules/list/list-item';\nimport Sort from '~/components/modules/filter/sort';\nimport Loading from \"~/util/loading\";\nimport { dynamicSort } from '~/util/sortUtil';\nimport { Listing } from '~/types/Listings';\n\ninterface ItemsListProps {\n fieldNames: Record<string, string>;\n showMap: boolean;\n fieldsShown: string[];\n filteredListings: Listing[];\n loading: boolean;\n sortSetting: any;\n setSortSetting: (setting: any) => void;\n itemLimit: number;\n loader: RefObject<HTMLDivElement>;\n scrollContainerRef: RefObject<HTMLDivElement>;\n itemRefs: any;\n selectedListItem: Listing | null;\n itemExpandedContent: (item: Listing, recruiters: any) => JSX.Element | null;\n children: ReactNode;\n includeFavorite: boolean;\n}\n\nconst ItemsList: React.FC<ItemsListProps> = ({\n\tfieldNames,\n\tshowMap,\n\tfieldsShown,\n\tfilteredListings,\n\tloading,\n\tsortSetting,\n\tsetSortSetting,\n\titemLimit,\n\tloader,\n\tscrollContainerRef,\n\titemRefs,\n\tselectedListItem,\n\titemExpandedContent,\n\tincludeFavorite = false,\n\tchildren // Destructure children\n}) => (\n\t<div className=\"hc-relative hc-bg-white md:hc-px-4 hc-flex hc-flex-col\">\n\t\t<div className=\"hc-flex hc-flex-wrap hc-items-center hc-justify-between hc-gap-4 md:hc-mb-2 hc-p-3 md:hc-p-0 hc-bg-uiAccent/10 md:hc-bg-transparent hc-border-b md:hc-border-none hc-border-uiAccent/20\">\n\t\t\t<h2 className=\"hc-text-gray-500 hc-font-semibold hc-text-xs md:hc-text-sm\">\n\t\t\t\t{loading && <span>Loading...</span>}\n\t\t\t\t{!loading && <span>{filteredListings.length} results</span>}\n\t\t\t</h2>\n\t\t\t<div className=\"hc-block md:hc-hidden\">\n\t\t\t\t<Sort\n\t\t\t\t\tclassName={''}\n\t\t\t\t\tfields={fieldsShown}\n\t\t\t\t\tsetSortSetting={setSortSetting}\n\t\t\t\t\tfieldNames={fieldNames}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t\t<div>\n\t\t\t<Header\n\t\t\t\tclassName={''}\n\t\t\t\tsetSortSetting={setSortSetting}\n\t\t\t\tsortSetting={sortSetting}\n\t\t\t\tfieldsShown={fieldsShown}\n\t\t\t\tfieldNames={fieldNames}\n\t\t\t\tincludeFavorite={includeFavorite}\n\t\t\t/>\n\t\t</div>\n\t\t<div\n\t\t\tref={scrollContainerRef}\n\t\t\tclassName={`\n hc-flex-grow hc-overflow-y-auto\n ${showMap ? \"md:hc-max-h-45vh hc-max-h-[100vh]\" : \"md:hc-max-h-95vh hc-max-h-[95vh]\"}\n `}\n\t\t>\n\t\t\t{loading ? (\n\t\t\t\t<div className=\"hc-flex hc-justify-center hc-items-center hc-pt-20\">\n\t\t\t\t\t<Loading />\n\t\t\t\t</div>\n\t\t\t) : (\n\t\t\t\tchildren\n\t\t\t)}\n\t\t\t<div ref={loader} style={{ height: \"100px\", textAlign: \"center\" }}>\n\t\t\t\t{filteredListings.length >= itemLimit && <Loading />}\n\t\t\t</div>\n\t\t</div>\n\t</div>\n);\n\nexport default ItemsList;\n"],"names":["Sort","Header"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AA2BA,MAAM,SAAS,GAA6B,CAAC,EAC5C,UAAU,EACV,OAAO,EACP,WAAW,EACX,gBAAgB,EAChB,OAAO,EACP,WAAW,EACX,cAAc,EACd,SAAS,EACT,MAAM,EACN,kBAAkB,EAClB,QAAQ,EACR,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,GAAG,KAAK,EACvB,QAAQ;AACR,E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OAAO,OAAG,CACN,KAEN,QAAQ,CACR;AACD,QAAA,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAA,EAC/D,gBAAgB,CAAC,MAAM,IAAI,SAAS,IAAI,KAAC,CAAA,aAAA,CAAA,OAAO,EAAG,IAAA,CAAA,CAC/C,CACD,CACD;;;;"}
@@ -0,0 +1,75 @@
1
+ import React from 'react';
2
+ import { useMap } from '../../../../contexts/mapContext.js';
3
+ import { useMapList } from '../../../../contexts/mapListContext.js';
4
+ import { useTrackEvent } from '../../../../contexts/trackEventContext.js';
5
+ import { setStorageObject } from '../../../../util/localStorageUtil.js';
6
+ import MapAccordionItem from '../../accordions/MapAccordionItem.js';
7
+ import ListItemContainer from './list-item-container.js';
8
+
9
+ var MapAccordionItemContainer = function MapAccordionItemContainer(_ref) {
10
+ var showMap = _ref.showMap,
11
+ item = _ref.item,
12
+ itemRefs = _ref.itemRefs,
13
+ fieldsShown = _ref.fieldsShown,
14
+ itemExpandedContent = _ref.itemExpandedContent,
15
+ specialFeatures = _ref.specialFeatures,
16
+ isActive = _ref.isActive,
17
+ hasListItemSelected = _ref.hasListItemSelected;
18
+ var _useMapList = useMapList(),
19
+ mapItems = _useMapList.mapItems;
20
+ var _useMap = useMap(),
21
+ selectItem = _useMap.selectItem;
22
+ var _useTrackEvent = useTrackEvent(),
23
+ trackEvent = _useTrackEvent.trackEvent,
24
+ eventTypes = _useTrackEvent.eventTypes;
25
+ var setSelectedItemAndZoomMap = function setSelectedItemAndZoomMap(item, isActive) {
26
+ if (isActive) {
27
+ localStorage.removeItem("selectedListItem");
28
+ mapItems.find(function (x) {
29
+ return Object.prototype.hasOwnProperty.call(x.items, item.id);
30
+ }) || null;
31
+ selectItem(null, null, 9, {
32
+ lat: 39.8283,
33
+ lng: -98.5795
34
+ });
35
+ } else {
36
+ setStorageObject("selectedListItem", item);
37
+ var _location = mapItems.find(function (x) {
38
+ return Object.prototype.hasOwnProperty.call(x.items, item.id);
39
+ }) || null;
40
+ selectItem(item, _location, 12, {
41
+ lat: _location === null || _location === void 0 ? void 0 : _location.latitude,
42
+ lng: _location === null || _location === void 0 ? void 0 : _location.longitude
43
+ });
44
+ }
45
+ };
46
+ var handleItemClick = function handleItemClick(item) {
47
+ var _item$mapDetails;
48
+ trackEvent(eventTypes.JOB_LISTING_SELECTED, {
49
+ jobTitle: item.fields.position,
50
+ jobCategory: item.fields.category,
51
+ entityDisplayName: item === null || item === void 0 || (_item$mapDetails = item.mapDetails) === null || _item$mapDetails === void 0 ? void 0 : _item$mapDetails.entityDisplayName
52
+ });
53
+ setSelectedItemAndZoomMap(item, isActive);
54
+ };
55
+ return /*#__PURE__*/React.createElement(MapAccordionItem, {
56
+ item: item,
57
+ itemRefs: itemRefs,
58
+ itemExpandedContent: itemExpandedContent,
59
+ isActive: isActive
60
+ }, /*#__PURE__*/React.createElement(ListItemContainer, {
61
+ showMap: showMap,
62
+ item: item,
63
+ itemRefs: itemRefs,
64
+ fieldsShown: fieldsShown,
65
+ specialFeatures: specialFeatures,
66
+ isActive: isActive,
67
+ hasListItemSelected: hasListItemSelected,
68
+ onClick: function onClick() {
69
+ return handleItemClick(item);
70
+ }
71
+ }));
72
+ };
73
+
74
+ export { MapAccordionItemContainer as default };
75
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/components/modules/list/list-item/index.js"],"sourcesContent":["import React from 'react';\nimport { useMap } from '~/contexts/mapContext';\nimport { useMapList } from '~/contexts/mapListContext';\nimport { useTrackEvent } from '~/contexts/trackEventContext';\nimport { setStorageObject } from '~/util/localStorageUtil';\nimport MapAccordionItem from '~/components/modules/accordions/MapAccordionItem';\nimport ListItemContainer from '~/components/modules/list/list-item/list-item-container';\n\nconst MapAccordionItemContainer = ({\n\tshowMap,\n\titem,\n\titemRefs,\n\tfieldsShown,\n\titemExpandedContent,\n\tspecialFeatures,\n\tisActive,\n\thasListItemSelected\n}) => {\n\tconst { mapItems } = useMapList();\n\tconst { selectItem } = useMap();\n\tconst { trackEvent, eventTypes } = useTrackEvent();\n\n\tconst setSelectedItemAndZoomMap = (item, isActive) => {\n\t\tif (isActive) {\n\t\t\tlocalStorage.removeItem(\"selectedListItem\");\n\t\t\tconst location = mapItems.find(x => Object.prototype.hasOwnProperty.call(x.items, item.id)) || null;\n\t\t\tselectItem(null, null, 9, { lat: 39.8283, lng: -98.5795 });\n\t\t} else {\n\t\t\tsetStorageObject(\"selectedListItem\", item);\n\t\t\tconst location = mapItems.find(x => Object.prototype.hasOwnProperty.call(x.items, item.id)) || null;\n\t\t\tselectItem(item, location, 12, {\n\t\t\t\tlat: location?.latitude,\n\t\t\t\tlng: location?.longitude\n\t\t\t});\n\t\t}\n\t};\n\n\tconst handleItemClick = item => {\n\t\ttrackEvent(eventTypes.JOB_LISTING_SELECTED, {\n\t\t\tjobTitle: item.fields.position,\n\t\t\tjobCategory: item.fields.category,\n\t\t\tentityDisplayName: item?.mapDetails?.entityDisplayName\n\t\t});\n\n\t\tsetSelectedItemAndZoomMap(item, isActive);\n\t};\n\n\treturn (\n\t\t<MapAccordionItem\n\t\t\titem={item}\n\t\t\titemRefs={itemRefs}\n\t\t\titemExpandedContent={itemExpandedContent}\n\t\t\tisActive={isActive}\n\n\t\t>\n\t\t\t<ListItemContainer\n\t\t\t\tshowMap={showMap}\n\t\t\t\titem={item}\n\t\t\t\titemRefs={itemRefs}\n\t\t\t\tfieldsShown={fieldsShown}\n\t\t\t\tspecialFeatures={specialFeatures}\n\t\t\t\tisActive={isActive}\n\t\t\t\thasListItemSelected={hasListItemSelected}\n\t\t\t\tonClick={() => handleItemClick(item)}\n\t\t\t/>\n\t\t</MapAccordionItem>\n\t);\n};\n\nexport default MapAccordionItemContainer;\n"],"names":["MapAccordionItemContainer","_ref","showMap","item","itemRefs","fieldsShown","itemExpandedContent","specialFeatures","isActive","hasListItemSelected","_useMapList","useMapList","mapItems","_useMap","useMap","selectItem","_useTrackEvent","useTrackEvent","trackEvent","eventTypes","setSelectedItemAndZoomMap","localStorage","removeItem","find","x","Object","prototype","hasOwnProperty","call","items","id","lat","lng","setStorageObject","location","latitude","longitude","handleItemClick","_item$mapDetails","JOB_LISTING_SELECTED","jobTitle","fields","position","jobCategory","category","entityDisplayName","mapDetails","React","createElement","MapAccordionItem","ListItemContainer","onClick"],"mappings":";;;;;;;;AAQA,IAAMA,yBAAyB,GAAG,SAA5BA,yBAAyBA,CAAAC,IAAA,EASzB;AAAA,EAAA,IARLC,OAAO,GAAAD,IAAA,CAAPC,OAAO;IACPC,IAAI,GAAAF,IAAA,CAAJE,IAAI;IACJC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IACRC,WAAW,GAAAJ,IAAA,CAAXI,WAAW;IACXC,mBAAmB,GAAAL,IAAA,CAAnBK,mBAAmB;IACnBC,eAAe,GAAAN,IAAA,CAAfM,eAAe;IACfC,QAAQ,GAAAP,IAAA,CAARO,QAAQ;IACRC,mBAAmB,GAAAR,IAAA,CAAnBQ,mBAAmB,CAAA;AAEnB,EAAA,IAAAC,WAAA,GAAqBC,UAAU,EAAE;IAAzBC,QAAQ,GAAAF,WAAA,CAARE,QAAQ,CAAA;AAChB,EAAA,IAAAC,OAAA,GAAuBC,MAAM,EAAE;IAAvBC,UAAU,GAAAF,OAAA,CAAVE,UAAU,CAAA;AAClB,EAAA,IAAAC,cAAA,GAAmCC,aAAa,EAAE;IAA1CC,UAAU,GAAAF,cAAA,CAAVE,UAAU;IAAEC,UAAU,GAAAH,cAAA,CAAVG,UAAU,CAAA;EAE9B,IAAMC,yBAAyB,GAAG,SAA5BA,yBAAyBA,CAAIjB,IAAI,EAAEK,QAAQ,EAAK;AACrD,IAAA,IAAIA,QAAQ,EAAE;AACba,MAAAA,YAAY,CAACC,UAAU,CAAC,kBAAkB,CAAC,CAAA;AAC3C,MAAiBV,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AAQ,EAAErC,IAAI,CAACsC,MAAM,CAACC,QAAQ;AAC9BC,MAAAA,WAAW,EAAExC,IAAI,CAACsC,MAAM,CAACG,QAAQ;AACjCC,MAAAA,iBAAiB,EAAE1C,IAAI,KAAJA,IAAAA,IAAAA,IAAI,gBAAAmC,gBAAA,GAAJnC,IAAI,CAAE2C,UAAU,MAAA,IAAA,IAAAR,gBAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAhBA,gBAAA,CAAkBO,iBAAAA;AACtC,KAAC,CAAC,CAAA;AAEFzB,IAAAA,yBAAyB,CAACjB,IAAI,EAAEK,QAAQ,CAAC,CAAA;GACzC,CAAA;AAED,EAAA,oBACCuC,KAAA,CAAAC,aAAA,CAACC,gBAAgB,EAAA;AAChB9C,IAAAA,IAAI,EAAEA,IAAK;AACXC,IAAAA,QAAQ,EAAEA,QAAS;AACnBE,IAAAA,mBAAmB,EAAEA,mBAAoB;AACzCE,IAAAA,QAAQ,EAAEA,QAAAA;AAAS,GAAA,eAGnBuC,KAAA,CAAAC,aAAA,CAACE,iBAAiB,EAAA;AACjBhD,IAAAA,OAAO,EAAEA,OAAQ;AACjBC,IAAAA,IAAI,EAAEA,IAAK;AACXC,IAAAA,QAAQ,EAAEA,QAAS;AACnBC,IAAAA,WAAW,EAAEA,WAAY;AACzBE,IAAAA,eAAe,EAAEA,eAAgB;AACjCC,IAAAA,QAAQ,EAAEA,QAAS;AACnBC,IAAAA,mBAAmB,EAAEA,mBAAoB;IACzC0C,OAAO,EAAE,SAAAA,OAAA,GAAA;MAAA,OAAMd,eAAe,CAAClC,IAAI,CAAC,CAAA;AAAA,KAAA;AAAC,GACrC,CACgB,CAAC,CAAA;AAErB;;;;"}
@@ -0,0 +1,47 @@
1
+ import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../../../_virtual/_rollupPluginBabelHelpers.js';
2
+ import React from 'react';
3
+ import { useMapList } from '../../../../contexts/mapListContext.js';
4
+ import { useTrackEvent } from '../../../../contexts/trackEventContext.js';
5
+ import ListItem from './list-item.js';
6
+
7
+ var _excluded = ["isActive", "showMap", "item", "itemRefs", "fieldsShown", "specialFeatures", "className", "bodyClassName", "onItemSelected"];
8
+ var ListItemContainer = function ListItemContainer(_ref) {
9
+ var isActive = _ref.isActive,
10
+ showMap = _ref.showMap,
11
+ item = _ref.item,
12
+ itemRefs = _ref.itemRefs,
13
+ fieldsShown = _ref.fieldsShown,
14
+ specialFeatures = _ref.specialFeatures;
15
+ _ref.className;
16
+ var bodyClassName = _ref.bodyClassName,
17
+ onItemSelected = _ref.onItemSelected,
18
+ props = _objectWithoutProperties(_ref, _excluded);
19
+ var _useMapList = useMapList(),
20
+ siteConfig = _useMapList.siteConfig,
21
+ favorites = _useMapList.favorites,
22
+ handleSettingFavorites = _useMapList.handleSettingFavorites,
23
+ setMobileTab = _useMapList.setMobileTab;
24
+ var _useTrackEvent = useTrackEvent(),
25
+ trackEvent = _useTrackEvent.trackEvent,
26
+ eventTypes = _useTrackEvent.eventTypes;
27
+ return /*#__PURE__*/React.createElement(ListItem, _extends({
28
+ isActive: isActive,
29
+ showMap: showMap,
30
+ item: item,
31
+ itemRefs: itemRefs,
32
+ fieldsShown: fieldsShown,
33
+ specialFeatures: specialFeatures,
34
+ className: isActive ? "!hc-border-secondary hc-border hc-border-b-0" : "hc-opacity-85",
35
+ bodyClassName: bodyClassName,
36
+ onItemSelected: onItemSelected,
37
+ setMobileTab: setMobileTab,
38
+ siteConfig: siteConfig,
39
+ trackEvent: trackEvent,
40
+ eventTypes: eventTypes,
41
+ favorites: favorites,
42
+ handleSettingFavorites: handleSettingFavorites
43
+ }, props));
44
+ };
45
+
46
+ export { ListItemContainer as default };
47
+ //# sourceMappingURL=list-item-container.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-item-container.js","sources":["../../../../../src/components/modules/list/list-item/list-item-container.js"],"sourcesContent":["import React, { useState } from 'react';\nimport { useMapList } from '~/contexts/mapListContext';\nimport { useTrackEvent } from '~/contexts/trackEventContext';\nimport ListItem from '~/components/modules/list/list-item/list-item';\n\nconst ListItemContainer = ({\n\tisActive,\n\tshowMap,\n\titem,\n\titemRefs,\n\tfieldsShown,\n\tspecialFeatures,\n\tclassName,\n\tbodyClassName,\n\tonItemSelected,\n\t...props\n}) => {\n\tconst { siteConfig, favorites, handleSettingFavorites, setMobileTab } = useMapList();\n\tconst { trackEvent, eventTypes } = useTrackEvent();\n\n\treturn (\n\t\t<ListItem\n\t\t\tisActive={isActive}\n\t\t\tshowMap={showMap}\n\t\t\titem={item}\n\t\t\titemRefs={itemRefs}\n\t\t\tfieldsShown={fieldsShown}\n\t\t\tspecialFeatures={specialFeatures}\n\t\t\tclassName={isActive ? \"!hc-border-secondary hc-border hc-border-b-0\" : \"hc-opacity-85\"}\n\t\t\tbodyClassName={bodyClassName}\n\t\t\tonItemSelected={onItemSelected}\n\t\t\tsetMobileTab={setMobileTab}\n\t\t\tsiteConfig={siteConfig}\n\t\t\ttrackEvent={trackEvent}\n\t\t\teventTypes={eventTypes}\n\t\t\tfavorites={favorites}\n\t\t\thandleSettingFavorites={handleSettingFavorites}\n\t\t\t{...props}\n\t\t/>\n\t);\n};\n\nexport default ListItemContainer;\n"],"names":["ListItemContainer","_ref","isActive","showMap","item","itemRefs","fieldsShown","specialFeatures","className","bodyClassName","onItemSelected","props","_objectWithoutProperties","_excluded","_useMapList","useMapList","siteConfig","favorites","handleSettingFavorites","setMobileTab","_useTrackEvent","useTrackEvent","trackEvent","eventTypes","React","createElement","ListItem","_extends"],"mappings":";;;;;;;AAKA,IAAMA,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAAC,IAAA,EAWjB;AAAA,EAAA,IAVLC,QAAQ,GAAAD,IAAA,CAARC,QAAQ,CAAA;IACRC,OAAO,GAAAF,IAAA,CAAPE,OAAO,CAAA;IACPC,IAAI,GAAAH,IAAA,CAAJG,IAAI,CAAA;IACJC,QAAQ,GAAAJ,IAAA,CAARI,QAAQ,CAAA;IACRC,WAA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;GACpBP,EAAAA,KAAK,CACT,CAAC,CAAA;AAEJ;;;;"}
@@ -1,14 +1,12 @@
1
- import { objectWithoutProperties as _objectWithoutProperties, extends as _extends, toConsumableArray as _toConsumableArray } from '../../../../../_virtual/_rollupPluginBabelHelpers.js';
1
+ import { objectWithoutProperties as _objectWithoutProperties, extends as _extends, toConsumableArray as _toConsumableArray } from '../../../../_virtual/_rollupPluginBabelHelpers.js';
2
2
  import React, { forwardRef } from 'react';
3
- import Grid from '../../../grid.js';
4
- import IconContained from '../../../icon.js';
3
+ import Grid from '../../grid.js';
4
+ import IconContained from '../../icon.js';
5
5
  import FieldMapper from '../field-mapper.js';
6
- import { useMapList } from '../../../../../contexts/mapListContext.js';
7
- import { useTrackEvent } from '../../../../../contexts/trackEventContext.js';
8
6
 
9
- var _excluded = ["isActive", "bodyClassName", "className", "item", "fieldsShown", "specialFeatures", "onItemSelected", "showMap", "setMobileTab", "favorites", "setFavorites"];
7
+ var _excluded = ["isActive", "bodyClassName", "className", "item", "fieldsShown", "specialFeatures", "onItemSelected", "showMap", "setMobileTab", "handleSettingFavorites", "favorites", "includeFavorite", "siteConfig", "trackEvent", "eventTypes"];
10
8
  var ListItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
11
- var _item$mapDetails2, _item$mapDetails3, _item$mapDetails4, _item$mapDetails5;
9
+ var _item$mapDetails, _item$mapDetails2, _item$mapDetails3, _item$mapDetails4;
12
10
  var isActive = _ref.isActive,
13
11
  bodyClassName = _ref.bodyClassName,
14
12
  className = _ref.className,
@@ -18,22 +16,23 @@ var ListItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
18
16
  onItemSelected = _ref.onItemSelected,
19
17
  showMap = _ref.showMap,
20
18
  setMobileTab = _ref.setMobileTab,
19
+ handleSettingFavorites = _ref.handleSettingFavorites,
21
20
  favorites = _ref.favorites,
22
- setFavorites = _ref.setFavorites,
23
- props = _objectWithoutProperties(_ref, _excluded);
24
- var _useMapList = useMapList(),
25
- siteConfig = _useMapList.siteConfig;
26
- var _useTrackEvent = useTrackEvent(),
27
- trackEvent = _useTrackEvent.trackEvent,
28
- eventTypes = _useTrackEvent.eventTypes;
29
- var mapPinColor = siteConfig.colors.primary.replace("#", "");
21
+ _ref$includeFavorite = _ref.includeFavorite,
22
+ includeFavorite = _ref$includeFavorite === void 0 ? false : _ref$includeFavorite,
23
+ siteConfig = _ref.siteConfig;
24
+ _ref.trackEvent;
25
+ _ref.eventTypes;
26
+ var props = _objectWithoutProperties(_ref, _excluded);
27
+ var mapPinColor = !showMap ? null : siteConfig.colors.primary.replace("#", "");
30
28
  var handleClick = function handleClick() {
31
29
  if (onItemSelected) {
32
30
  onItemSelected(item);
33
31
  }
34
32
  };
35
33
  var isFavorite = favorites.includes(item.id);
36
- var handleFavouriteClick = function handleFavouriteClick(event) {
34
+ var handleFavouriteClick = function handleFavouriteClick(event, item) {
35
+ if (!includeFavorite) return;
37
36
  event.stopPropagation();
38
37
  var updatedFavorites;
39
38
  if (isFavorite) {
@@ -41,26 +40,22 @@ var ListItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
41
40
  return fav !== item.id;
42
41
  });
43
42
  } else {
44
- var _item$mapDetails;
45
- trackEvent(eventTypes.FAVORITE_SELECTED, {
46
- jobTitle: item.fields.position,
47
- jobCategory: item.fields.category,
48
- entityDisplayName: item === null || item === void 0 || (_item$mapDetails = item.mapDetails) === null || _item$mapDetails === void 0 ? void 0 : _item$mapDetails.entityDisplayName
49
- });
50
43
  updatedFavorites = [].concat(_toConsumableArray(favorites), [item.id]);
51
44
  }
52
45
  isFavorite = !isFavorite;
53
- setFavorites(updatedFavorites);
46
+ handleSettingFavorites(updatedFavorites);
54
47
  };
55
48
  return /*#__PURE__*/React.createElement("button", _extends({
56
49
  ref: ref,
57
- onClick: handleClick,
58
- className: "\n\t\t\t\t\thc-group hc-relative hc-flex md:hc-flex-col hc-w-full md:hc-pl-4 hc-text-left hc-bg-clip-border hc-border hc-border-transparent hc-break-words hc-overflow-hidden hc-cursor-pointer hc-transition-colors hover:hc-bg-uiAccent/5 focus:hover:hc-bg-uiAccent/5\n\t\t\t\t\t".concat(isActive ? "hc-bg-uiAccent/5 hc-border-secondary hc-border" : "hc-text-uiText hc-bg-white", "\n\t\t\t\t\t").concat(className !== null && className !== void 0 ? className : "", "\n ")
50
+ onClick: function onClick() {
51
+ handleClick();
52
+ },
53
+ className: "\n hc-group hc-relative hc-flex md:hc-flex-col hc-w-full md:hc-pl-4 hc-text-left hc-bg-clip-border hc-border hc-border-transparent hc-break-words hc-overflow-hidden hc-cursor-pointer hc-transition-colors hover:hc-bg-uiAccent/5 focus:hover:hc-bg-uiAccent/5\n ".concat(isActive ? "hc-bg-uiAccent/5 hc-border-secondary hc-border" : "hc-text-uiText hc-bg-white", "\n ").concat(className !== null && className !== void 0 ? className : "", "\n ")
59
54
  }, props), /*#__PURE__*/React.createElement(Grid, {
60
55
  columns: "hc-grid-flow-col hc-auto-cols-fr",
61
56
  gap: "hc-gap-2",
62
57
  isAnimated: false,
63
- className: "\n\t\t\t\t\t\thc-block md:hc-grid hc-p-2 hc-ps-4 hc-w-full hc-grow hc-leading-tight hc-text-sm md:hc-text-xs lg:hc-text-sm\n\t\t\t\t\t\t".concat(bodyClassName !== null && bodyClassName !== void 0 ? bodyClassName : "", "\n\t\t\t\t\t")
58
+ className: "\n hc-block md:hc-grid hc-p-2 hc-ps-4 hc-w-full hc-grow hc-leading-tight hc-text-sm md:hc-text-xs lg:hc-text-sm\n ".concat(bodyClassName !== null && bodyClassName !== void 0 ? bodyClassName : "", "\n ")
64
59
  }, /*#__PURE__*/React.createElement(Grid.Item, {
65
60
  className: "hc-hidden md:hc-block md:hc-absolute md:hc-left-1.5 hc-top-1.5"
66
61
  }, /*#__PURE__*/React.createElement("span", {
@@ -68,14 +63,15 @@ var ListItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
68
63
  }, "Expand row"), /*#__PURE__*/React.createElement(IconContained, {
69
64
  icon: "fluent-emoji-high-contrast:plus",
70
65
  size: "hc-size-2.5",
71
- className: "\n\t\t\t\t\t\t\t\thc-opacity-0 hc-text-uiText/60 hc-transition group-hover:hc-opacity-100 group-active:hc-opacity-100\n\t\t\t\t\t\t\t\t".concat(isActive ? "hc-opacity-100 hc-rotate-45" : "", "\n\t\t\t\t\t\t\t")
66
+ className: "\n hc-opacity-0 hc-text-uiText/60 hc-transition group-hover:hc-opacity-100 group-active:hc-opacity-100\n ".concat(isActive ? "hc-opacity-100 hc-rotate-45" : "", "\n ")
72
67
  })), /*#__PURE__*/React.createElement(FieldMapper, {
73
68
  item: item,
74
69
  fieldsShown: fieldsShown,
75
70
  specialFeatures: specialFeatures,
76
71
  isFavorite: isFavorite,
72
+ includeFavorite: includeFavorite,
77
73
  handleFavouriteClick: handleFavouriteClick
78
- }), /*#__PURE__*/React.createElement(Grid.Item, {
74
+ }), includeFavorite && /*#__PURE__*/React.createElement(Grid.Item, {
79
75
  key: "favorites",
80
76
  className: "hc-hidden md:hc-block hc-col-span-1"
81
77
  }, /*#__PURE__*/React.createElement(IconContained, {
@@ -83,9 +79,9 @@ var ListItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
83
79
  size: "hc-size-3.5",
84
80
  iconClasses: isFavorite ? "hc-text-primary" : "",
85
81
  title: !isFavorite ? 'Add job to favorites' : 'Remove job from favorites',
86
- className: "\n\t\t\t\t\t\t\thc-pr-2 hc-transition-opacity hc-duration-300 hc-cursor-pointer hc-opacity-100\"\n\t\t\t\t\t\t",
82
+ className: "hc-pr-2 hc-transition-opacity hc-duration-300 hc-cursor-pointer hc-opacity-100",
87
83
  onClick: function onClick(e) {
88
- return handleFavouriteClick(e);
84
+ handleFavouriteClick(e, item);
89
85
  }
90
86
  }))), showMap && /*#__PURE__*/React.createElement("div", {
91
87
  onClick: function onClick() {
@@ -94,15 +90,15 @@ var ListItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
94
90
  },
95
91
  className: "md:hc-hidden hc-w-2/5 sm:hc-w-1/3 hc-p-1.5 hc-my-1 hc-bg-uiAccent/5 hc-border hc-border-uiAccent/10 hc-rounded-sm"
96
92
  }, /*#__PURE__*/React.createElement("img", {
97
- src: "https://maps.googleapis.com/maps/api/staticmap?scale=2&center=".concat((_item$mapDetails2 = item.mapDetails) === null || _item$mapDetails2 === void 0 ? void 0 : _item$mapDetails2.latitude, ",").concat((_item$mapDetails3 = item.mapDetails) === null || _item$mapDetails3 === void 0 ? void 0 : _item$mapDetails3.longitude, "&zoom=10&size=240x180&maptype=roadmap&markers=color:0x").concat(mapPinColor, "%7Clabel:\u2022%7C").concat((_item$mapDetails4 = item.mapDetails) === null || _item$mapDetails4 === void 0 ? void 0 : _item$mapDetails4.latitude, ",").concat((_item$mapDetails5 = item.mapDetails) === null || _item$mapDetails5 === void 0 ? void 0 : _item$mapDetails5.longitude, "&key=", "AIzaSyAXPlfaoMCrmjNV1u-vFYdLBi7GkGeh4S4"),
93
+ src: "https://maps.googleapis.com/maps/api/staticmap?scale=2&center=".concat((_item$mapDetails = item.mapDetails) === null || _item$mapDetails === void 0 ? void 0 : _item$mapDetails.latitude, ",").concat((_item$mapDetails2 = item.mapDetails) === null || _item$mapDetails2 === void 0 ? void 0 : _item$mapDetails2.longitude, "&zoom=10&size=240x180&maptype=roadmap&markers=color:0x").concat(mapPinColor, "%7Clabel:\u2022%7C").concat((_item$mapDetails3 = item.mapDetails) === null || _item$mapDetails3 === void 0 ? void 0 : _item$mapDetails3.latitude, ",").concat((_item$mapDetails4 = item.mapDetails) === null || _item$mapDetails4 === void 0 ? void 0 : _item$mapDetails4.longitude, "&key=", "AIzaSyAXPlfaoMCrmjNV1u-vFYdLBi7GkGeh4S4"),
98
94
  alt: "Map of location for ".concat(item.fields.position),
99
95
  className: "hc-w-full hc-h-full hc-object-cover"
100
96
  })));
101
97
  });
102
98
  ListItem.displayName = "ListItem";
103
99
  var ListItem$1 = /*#__PURE__*/React.memo(ListItem, function (prevProps, nextProps) {
104
- return (prevProps.isActive === nextProps.isActive || prevProps.isActive !== nextProps.isActive) && prevProps.bodyClassName === nextProps.bodyClassName && prevProps.className === nextProps.className && prevProps.fieldsShown === nextProps.fieldsShown && prevProps.item.id === nextProps.item.id;
100
+ return prevProps.isActive === nextProps.isActive && prevProps.favorites === nextProps.favorites && prevProps.item.id === nextProps.item.id && prevProps.fieldsShown === nextProps.fieldsShown && prevProps.bodyClassName === nextProps.bodyClassName && prevProps.className === nextProps.className;
105
101
  });
106
102
 
107
103
  export { ListItem$1 as default };
108
- //# sourceMappingURL=index.js.map
104
+ //# sourceMappingURL=list-item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-item.js","sources":["../../../../../src/components/modules/list/list-item/list-item.js"],"sourcesContent":["import React, { forwardRef, useState } from 'react';\nimport Grid from '~/components/modules/grid';\nimport Icon from '~/components/modules/icon';\nimport FieldMapper from '~/components/modules/list/field-mapper';\n\nconst ListItem = forwardRef(\n\t(\n\t\t{\n\t\t\tisActive,\n\t\t\tbodyClassName,\n\t\t\tclassName,\n\t\t\titem,\n\t\t\tfieldsShown,\n\t\t\tspecialFeatures,\n\t\t\tonItemSelected,\n\t\t\tshowMap,\n\t\t\tsetMobileTab,\n\t\t\thandleSettingFavorites,\n\t\t\tfavorites,\n\t\t\tincludeFavorite = false,\n\t\t\tsiteConfig,\n\t\t\ttrackEvent,\n\t\t\teventTypes,\n\t\t\t...props\n\t\t},\n\t\tref\n\t) => {\n\t\tconst mapPinColor = !showMap ? null : siteConfig.colors.primary.replace(\"#\", \"\");\n\n\t\tconst handleClick = () => {\n\t\t\tif (onItemSelected) {\n\t\t\t\tonItemSelected(item);\n\t\t\t}\n\t\t};\n\t\tlet isFavorite = favorites.includes(item.id);\n\n\t\tconst handleFavouriteClick = (event, item) => {\n\t\t\tif(!includeFavorite)return;\n\t\t\tevent.stopPropagation();\n\t\t\tlet updatedFavorites;\n\t\t\tif (isFavorite) {\n\t\t\t\tupdatedFavorites = favorites.filter(fav => fav !== item.id);\n\t\t\t} else {\n\t\t\t\tupdatedFavorites = [...favorites, item.id];\n\t\t\t}\n\t\t\tisFavorite = !isFavorite;\n\t\t\thandleSettingFavorites(updatedFavorites);\n\t\t};\n\t\treturn (\n\t\t\t<button\n\t\t\t\tref={ref}\n\t\t\t\tonClick={() => { handleClick(); }}\n\t\t\t\tclassName={`\n hc-group hc-relative hc-flex md:hc-flex-col hc-w-full md:hc-pl-4 hc-text-left hc-bg-clip-border hc-border hc-border-transparent hc-break-words hc-overflow-hidden hc-cursor-pointer hc-transition-colors hover:hc-bg-uiAccent/5 focus:hover:hc-bg-uiAccent/5\n ${isActive ? \"hc-bg-uiAccent/5 hc-border-secondary hc-border\" : \"hc-text-uiText hc-bg-white\"}\n ${className ?? \"\"}\n `}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t<Grid\n\t\t\t\t\tcolumns=\"hc-grid-flow-col hc-auto-cols-fr\"\n\t\t\t\t\tgap=\"hc-gap-2\"\n\t\t\t\t\tisAnimated={false}\n\t\t\t\t\tclassName={`\n hc-block md:hc-grid hc-p-2 hc-ps-4 hc-w-full hc-grow hc-leading-tight hc-text-sm md:hc-text-xs lg:hc-text-sm\n ${bodyClassName ?? \"\"}\n `}\n\t\t\t\t>\n\t\t\t\t\t<Grid.Item className=\"hc-hidden md:hc-block md:hc-absolute md:hc-left-1.5 hc-top-1.5\">\n\t\t\t\t\t\t<span className=\"hc-sr-only\">Expand row</span>\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon=\"fluent-emoji-high-contrast:plus\"\n\t\t\t\t\t\t\tsize=\"hc-size-2.5\"\n\t\t\t\t\t\t\tclassName={`\n hc-opacity-0 hc-text-uiText/60 hc-transition group-hover:hc-opacity-100 group-active:hc-opacity-100\n ${isActive ? \"hc-opacity-100 hc-rotate-45\" : \"\"}\n `}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Grid.Item>\n\t\t\t\t\t<FieldMapper\n\t\t\t\t\t\titem={item}\n\t\t\t\t\t\tfieldsShown={fieldsShown}\n\t\t\t\t\t\tspecialFeatures={specialFeatures}\n\t\t\t\t\t\tisFavorite={isFavorite}\n\t\t\t\t\t\tincludeFavorite={includeFavorite}\n\t\t\t\t\t\thandleFavouriteClick={handleFavouriteClick}\n\t\t\t\t\t/>\n\t\t\t\t\t{includeFavorite &&\n\t\t\t\t\t<Grid.Item\n\t\t\t\t\t\tkey={\"favorites\"}\n\t\t\t\t\t\tclassName=\"hc-hidden md:hc-block hc-col-span-1\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon={isFavorite ? \"mdi:heart\" : \"mdi:heart-outline\"}\n\t\t\t\t\t\t\tsize=\"hc-size-3.5\"\n\t\t\t\t\t\t\ticonClasses={isFavorite ? \"hc-text-primary\" : \"\"}\n\t\t\t\t\t\t\ttitle={!isFavorite ? 'Add job to favorites' : 'Remove job from favorites'}\n\t\t\t\t\t\t\tclassName=\"hc-pr-2 hc-transition-opacity hc-duration-300 hc-cursor-pointer hc-opacity-100\"\n\t\t\t\t\t\t\tonClick={e => {handleFavouriteClick(e, item);}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Grid.Item>\n\t\t\t\t\t}\n\t\t\t\t</Grid>\n\t\t\t\t{showMap && (\n\t\t\t\t\t<div onClick={() => { setMobileTab(\"mapTab\"); handleClick(); }} className=\"md:hc-hidden hc-w-2/5 sm:hc-w-1/3 hc-p-1.5 hc-my-1 hc-bg-uiAccent/5 hc-border hc-border-uiAccent/10 hc-rounded-sm\">\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\tsrc={`https://maps.googleapis.com/maps/api/staticmap?scale=2&center=${item.mapDetails?.latitude},${item.mapDetails?.longitude}&zoom=10&size=240x180&maptype=roadmap&markers=color:0x${mapPinColor}%7Clabel:•%7C${item.mapDetails?.latitude},${item.mapDetails?.longitude}&key=${process.env.GOOGLE_MAPS_API_KEY}`}\n\t\t\t\t\t\t\talt={`Map of location for ${item.fields.position}`}\n\t\t\t\t\t\t\tclassName=\"hc-w-full hc-h-full hc-object-cover\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</button>\n\t\t);\n\t}\n);\n\nListItem.displayName = \"ListItem\";\n\nexport default React.memo(ListItem, (prevProps, nextProps) => {\n\treturn (\n\t\tprevProps.isActive === nextProps.isActive &&\n\t\tprevProps.favorites === nextProps.favorites &&\n prevProps.item.id === nextProps.item.id &&\n prevProps.fieldsShown === nextProps.fieldsShown &&\n prevProps.bodyClassName === nextProps.bodyClassName &&\n prevProps.className === nextProps.className\n\t);\n});\n"],"names":["ListItem","forwardRef","_ref","ref","_item$mapDetails","_item$mapDetails2","_item$mapDetails3","_item$mapDetails4","isActive","bodyClassName","className","item","fieldsShown","specialFeatures","onItemSelected","showMap","setMobileTab","handleSettingFavorites","favorites","_ref$includeFavorite","includeFavorite","siteConfig","trackEvent","eventTypes","props","_objectWithoutProperties","_excluded","mapPinColor","colors","primary","replace","handleClick","isFavorite","includes","id","handleFavouriteClick","event","stopPropagation","updatedFavorites","filter","fav","concat","_toConsumableArray","React","createElement","_extends","onClick","Grid","columns","gap","isAnimated","Item","Icon","icon","size","FieldMapper","key","iconClasses","title","e","src","mapDetails","latitude","longitude","alt","fields","position","displayName","memo","prevProps","nextProps"],"mappings":";;;;;;;AAKA,IAAMA,QAAQ,gBAAGC,UAAU,CAC1B,UAAAC,IAAA,EAmBCC,GAAG,EACC;AAAA,EAAA,IAAAC,gBAAA,EAAAC,iBAAA,EAAAC,iBAAA,EAAAC,iBAAA,CAAA;AAAA,EAAA,IAlBHC,QAAQ,GAAAN,IAAA,CAARM,QAAQ,CAAA;IACRC,aAAa,GAAAP,IAAA,CAAbO,aAAa,CAAA;IACbC,SAAS,GAAAR,IAAA,CAATQ,SAAS,CAAA;IACTC,IAAI,GAAAT,IAAA,CAAJS,IAAI,CAAA;IACJC,WAAW,GAAAV,IAAA,CAAXU,WAAW,CAAA;IACXC,eAAe,GAAAX,IAAA,CAAfW,eAAe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IAAI,CAACpE,QAAQ,EAAE,UAACqE,SAAS,EAAEC,SAAS,EAAK;EAC7D,OACCD,SAAS,CAAC7D,QAAQ,KAAK8D,SAAS,CAAC9D,QAAQ,IACzC6D,SAAS,CAACnD,SAAS,KAAKoD,SAAS,CAACpD,SAAS,IACzCmD,SAAS,CAAC1D,IAAI,CAACuB,EAAE,KAAKoC,SAAS,CAAC3D,IAAI,CAACuB,EAAE,IACvCmC,SAAS,CAACzD,WAAW,KAAK0D,SAAS,CAAC1D,WAAW,IAC/CyD,SAAS,CAAC5D,aAAa,KAAK6D,SAAS,CAAC7D,aAAa,IACnD4D,SAAS,CAAC3D,SAAS,KAAK4D,SAAS,CAAC5D,SAAS,CAAA;AAE/C,CAAC,CAAC;;;;"}
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import ItemsList from './list/index.js';
2
+ import ItemsListContainer from '../list/index.js';
3
3
  import Map from './map.js';
4
4
  import MapTabs from './tabs.js';
5
5
  import Filter from '../filter/index.js';
@@ -40,11 +40,11 @@ var MapList = function MapList(_ref) {
40
40
  var map = /*#__PURE__*/React.createElement(Map, mapProps);
41
41
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
42
42
  className: "\n\t\t\t\t\t".concat(showMap == false ? "md:hc-grid-rows-[100vh]" : "md:hc-grid-rows-[50vh_50vh]", "\n\t\t\t\t\tmd:hc-grid md:hc-pt-4 hc-overflow-hidden hc-relative bg-gray-100\n\t\t\t\t")
43
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(ItemsList, listProps)), /*#__PURE__*/React.createElement("div", null, showMap && map)), /*#__PURE__*/React.createElement("div", {
43
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(ItemsListContainer, listProps)), /*#__PURE__*/React.createElement("div", null, showMap && map)), /*#__PURE__*/React.createElement("div", {
44
44
  className: "md:hc-hidden"
45
45
  }, /*#__PURE__*/React.createElement(MapTabs, {
46
46
  showMap: showMap,
47
- list: /*#__PURE__*/React.createElement(ItemsList, listProps),
47
+ list: /*#__PURE__*/React.createElement(ItemsListContainer, listProps),
48
48
  map: !loading && showMap && map,
49
49
  filter: /*#__PURE__*/React.createElement(Filter, {
50
50
  showMap: showMap,
@@ -1 +1 @@
1
- {"version":3,"file":"map-list.js","sources":["../../../../src/components/modules/maps/map-list.js"],"sourcesContent":["import React from 'react';\r\n\r\nimport List from '~/components/modules/maps/list';\r\nimport Map from '~/components/modules/maps/map';\r\nimport Tabs from '~/components/modules/maps/tabs';\r\nimport Filter from '~/components/modules/filter';\r\n\r\nconst MapList = ({\r\n\tloading = false,\r\n\tmapDetails,\r\n\tmarkerConfigs,\r\n\titemExpandedContent,\r\n\tfieldsShown,\r\n\tspecialFeatures,\r\n\tfieldNames,\r\n\tshowMap,\r\n\tplaceMappings\r\n}) => {\r\n\r\n\tconst listProps = {\r\n\t\tfieldsShown: fieldsShown,\r\n\t\tfieldNames: fieldNames,\r\n\t\titemExpandedContent: itemExpandedContent,\r\n\t\tloading: loading,\r\n\t\tshowMap: showMap,\r\n\t\tspecialFeatures: specialFeatures\r\n\t};\r\n\r\n\tconst mapProps = {\r\n\t\tmapDetails: mapDetails,\r\n\t\tmarkerConfigs: markerConfigs,\r\n\t\tplaceMappings: placeMappings,\r\n\t\tclusterGridSize: 60,\r\n\t\tshowMap: showMap\r\n\t};\r\n\r\n\t// useEffect(() => {\r\n\t// \tif (selectedItem !== null) {\r\n\t// \t\ttrackEvent(\"Map\", \"View Location\", selectedItem[titlePropName]);\r\n\t// \t}\r\n\t// \t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t// }, []);\r\n\tconst map = <Map {...mapProps} />;\r\n\treturn (\r\n\t\t<>\r\n\t\t\t<div\r\n\t\t\t\tclassName={`\r\n\t\t\t\t\t${showMap == false ? \"md:hc-grid-rows-[100vh]\" : \"md:hc-grid-rows-[50vh_50vh]\"}\r\n\t\t\t\t\tmd:hc-grid md:hc-pt-4 hc-overflow-hidden hc-relative bg-gray-100\r\n\t\t\t\t`}\r\n\t\t\t>\r\n\t\t\t\t<div>\r\n\t\t\t\t\t<List {...listProps} />\r\n\t\t\t\t</div>\r\n\t\t\t\t<div>{showMap && map}</div>\r\n\t\t\t</div>\r\n\t\t\t<div className=\"md:hc-hidden\">\r\n\t\t\t\t<Tabs\r\n\t\t\t\t\tshowMap={showMap}\r\n\t\t\t\t\tlist={<List {...listProps} />}\r\n\t\t\t\t\tmap={!loading && showMap && map}\r\n\t\t\t\t\tfilter={\r\n\t\t\t\t\t\t<Filter\r\n\t\t\t\t\t\t\tshowMap={showMap}\r\n\t\t\t\t\t\t\tclassName=\"md:hc-hidden\"\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t}\r\n\t\t\t\t/>\r\n\t\t\t</div>\r\n\t\t</>\r\n\t);\r\n};\r\n\r\nexport default MapList;\r\n"],"names":["MapList","_ref","_ref$loading","loading","mapDetails","markerConfigs","itemExpandedContent","fieldsShown","specialFeatures","fieldNames","showMap","placeMappings","listProps","mapProps","clusterGridSize","map","React","createElement","Map","Fragment","className","concat","List","Tabs","list","filter","Filter"],"mappings":";;;;;;AAOA,IAAMA,OAAO,GAAG,SAAVA,OAAOA,CAAAC,IAAA,EAUP;AAAA,EAAA,IAAAC,YAAA,GAAAD,IAAA,CATLE,OAAO;AAAPA,IAAAA,OAAO,GAAAD,YAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,YAAA;IACfE,UAAU,GAAAH,IAAA,CAAVG,UAAU;IACVC,aAAa,GAAAJ,IAAA,CAAbI,aAAa;IACbC,mBAAmB,GAAAL,IAAA,CAAnBK,mBAAmB;IACnBC,WAAW,GAAAN,IAAA,CAAXM,WAAW;IACXC,eAAe,GAAAP,IAAA,CAAfO,eAAe;IACfC,UAAU,GAAAR,IAAA,CAAVQ,UAAU;IACVC,OAAO,GAAAT,IAAA,CAAPS,OAAO;IACPC,aAAa,GAAAV,IAAA,CAAbU,aAAa,CAAA;AAG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EAAKV,SAAY,CAAE;AAC9BG,IAAAA,GAAG,EAAE,CAACZ,OAAO,IAAIO,OAAO,IAAIK,GAAI;AAChCU,IAAAA,MAAM,eACLT,KAAA,CAAAC,aAAA,CAACS,MAAM,EAAA;AACNhB,MAAAA,OAAO,EAAEA,OAAQ;AACjBU,MAAAA,SAAS,EAAC,cAAA;KACV,CAAA;GAEF,CACG,CACJ,CAAC,CAAA;AAEL;;;;"}
1
+ {"version":3,"file":"map-list.js","sources":["../../../../src/components/modules/maps/map-list.js"],"sourcesContent":["import React from 'react';\n\nimport List from '~/components/modules/list';\nimport Map from '~/components/modules/maps/map';\nimport Tabs from '~/components/modules/maps/tabs';\nimport Filter from '~/components/modules/filter';\n\nconst MapList = ({\n\tloading = false,\n\tmapDetails,\n\tmarkerConfigs,\n\titemExpandedContent,\n\tfieldsShown,\n\tspecialFeatures,\n\tfieldNames,\n\tshowMap,\n\tplaceMappings\n}) => {\n\n\tconst listProps = {\n\t\tfieldsShown: fieldsShown,\n\t\tfieldNames: fieldNames,\n\t\titemExpandedContent: itemExpandedContent,\n\t\tloading: loading,\n\t\tshowMap: showMap,\n\t\tspecialFeatures: specialFeatures\n\t};\n\n\tconst mapProps = {\n\t\tmapDetails: mapDetails,\n\t\tmarkerConfigs: markerConfigs,\n\t\tplaceMappings: placeMappings,\n\t\tclusterGridSize: 60,\n\t\tshowMap: showMap\n\t};\n\n\t// useEffect(() => {\n\t// \tif (selectedItem !== null) {\n\t// \t\ttrackEvent(\"Map\", \"View Location\", selectedItem[titlePropName]);\n\t// \t}\n\t// \t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t// }, []);\n\tconst map = <Map {...mapProps} />;\n\treturn (\n\t\t<>\n\t\t\t<div\n\t\t\t\tclassName={`\n\t\t\t\t\t${showMap == false ? \"md:hc-grid-rows-[100vh]\" : \"md:hc-grid-rows-[50vh_50vh]\"}\n\t\t\t\t\tmd:hc-grid md:hc-pt-4 hc-overflow-hidden hc-relative bg-gray-100\n\t\t\t\t`}\n\t\t\t>\n\t\t\t\t<div>\n\t\t\t\t\t<List {...listProps} />\n\t\t\t\t</div>\n\t\t\t\t<div>{showMap && map}</div>\n\t\t\t</div>\n\t\t\t<div className=\"md:hc-hidden\">\n\t\t\t\t<Tabs\n\t\t\t\t\tshowMap={showMap}\n\t\t\t\t\tlist={<List {...listProps} />}\n\t\t\t\t\tmap={!loading && showMap && map}\n\t\t\t\t\tfilter={\n\t\t\t\t\t\t<Filter\n\t\t\t\t\t\t\tshowMap={showMap}\n\t\t\t\t\t\t\tclassName=\"md:hc-hidden\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\nexport default MapList;\n"],"names":["MapList","_ref","_ref$loading","loading","mapDetails","markerConfigs","itemExpandedContent","fieldsShown","specialFeatures","fieldNames","showMap","placeMappings","listProps","mapProps","clusterGridSize","map","React","createElement","Map","Fragment","className","concat","List","Tabs","list","filter","Filter"],"mappings":";;;;;;AAOA,IAAMA,OAAO,GAAG,SAAVA,OAAOA,CAAAC,IAAA,EAUP;AAAA,EAAA,IAAAC,YAAA,GAAAD,IAAA,CATLE,OAAO;AAAPA,IAAAA,OAAO,GAAAD,YAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,YAAA;IACfE,UAAU,GAAAH,IAAA,CAAVG,UAAU;IACVC,aAAa,GAAAJ,IAAA,CAAbI,aAAa;IACbC,mBAAmB,GAAAL,IAAA,CAAnBK,mBAAmB;IACnBC,WAAW,GAAAN,IAAA,CAAXM,WAAW;IACXC,eAAe,GAAAP,IAAA,CAAfO,eAAe;IACfC,UAAU,GAAAR,IAAA,CAAVQ,UAAU;IACVC,OAAO,GAAAT,IAAA,CAAPS,OAAO;IACPC,aAAa,GAAAV,IAAA,CAAbU,aAAa,CAAA;AAGb,EAAA,IAAMC,SAAS,GAAG;AACjBL,IAAAA,WAAW,EAAEA,WAAW;AACxBE,IAAAA,UAAU,EAAEA,UA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ChCU,IAAAA,MAAM,eACLT,KAAA,CAAAC,aAAA,CAACS,MAAM,EAAA;AACNhB,MAAAA,OAAO,EAAEA,OAAQ;AACjBU,MAAAA,SAAS,EAAC,cAAA;KACV,CAAA;GAEF,CACG,CACJ,CAAC,CAAA;AAEL;;;;"}
@@ -1,118 +1,89 @@
1
- import { slicedToArray as _slicedToArray } from '../_virtual/_rollupPluginBabelHelpers.js';
2
- import React, { useState, useRef, useEffect, createContext, useContext } from 'react';
1
+ import React, { createContext, useState, useRef, useEffect, useContext } from 'react';
3
2
  import { getStorageObject, setStorageObject } from '../util/localStorageUtil.js';
4
3
 
5
- var MapContext = /*#__PURE__*/createContext();
6
- var useMap = function useMap() {
7
- var context = useContext(MapContext);
8
- if (!context) {
9
- throw new Error("useMap must be used within a MapProvider");
10
- }
11
- return context;
12
- };
13
- var MapProvider = function MapProvider(_ref) {
14
- var _getStorageObject;
15
- var children = _ref.children,
16
- resetFilters = _ref.resetFilters;
17
- var _useState = useState(getStorageObject('selectedListItem')),
18
- _useState2 = _slicedToArray(_useState, 2),
19
- selectedListItem = _useState2[0],
20
- setSelectedListItem = _useState2[1];
21
- var _useState3 = useState(getStorageObject('location')),
22
- _useState4 = _slicedToArray(_useState3, 2),
23
- location = _useState4[0],
24
- setLocation = _useState4[1];
25
- var _useState5 = useState(getStorageObject("center", {
26
- lat: 39.8283,
27
- lng: -98.5795
28
- })),
29
- _useState6 = _slicedToArray(_useState5, 2),
30
- center = _useState6[0],
31
- setCenter = _useState6[1];
32
- var _useState7 = useState(getStorageObject("zoom", 10)),
33
- _useState8 = _slicedToArray(_useState7, 2),
34
- zoom = _useState8[0],
35
- setZoom = _useState8[1];
36
- var _useState9 = useState([]),
37
- _useState10 = _slicedToArray(_useState9, 2),
38
- selectedPlaces = _useState10[0],
39
- setSelectedPlaces = _useState10[1];
40
- var _useState11 = useState(false),
41
- _useState12 = _slicedToArray(_useState11, 2),
42
- mapInteracted = _useState12[0],
43
- setMapInteracted = _useState12[1];
44
- var _useState13 = useState((_getStorageObject = getStorageObject('selectedListItem')) !== null && _getStorageObject !== void 0 ? _getStorageObject : {
45
- id: "defaultId"
46
- }),
47
- _useState14 = _slicedToArray(_useState13, 1),
48
- firstLoadListItem = _useState14[0];
49
- var userSetZoom = useRef(true);
50
- useEffect(function () {
51
- setStorageObject("selectedListItem", selectedListItem);
52
- }, [selectedListItem]);
53
- useEffect(function () {
54
- localStorage.setItem("zoom", zoom);
55
- }, [zoom]);
56
- useEffect(function () {
57
- if (location == null) {
58
- localStorage.removeItem("location");
59
- } else {
60
- setStorageObject("location", location);
61
- }
62
- }, [location]);
63
- useEffect(function () {
64
- setStorageObject("center", center);
65
- }, [center]);
66
- var selectItem = function selectItem(item, itemLocation, zoom, center) {
67
- setSelectedListItem(item);
68
- if (mapInteracted === false && itemLocation != null) {
69
- setLocation(itemLocation);
70
- }
71
- if (mapInteracted === false || itemLocation != null) {
72
- setLocation(itemLocation);
73
- setCenter(center);
74
- }
75
- if (mapInteracted === false) {
76
- setZoom(zoom);
77
- }
78
- };
79
- var filterReset = function filterReset() {
80
- setSelectedPlaces({});
81
- setSelectedListItem(null);
82
- setLocation(null);
83
- setZoom(8);
84
- setMapInteracted(false);
85
- };
86
- if (resetFilters === true) {
87
- filterReset();
88
- }
89
- var selectLocationEntity = function selectLocationEntity(location) {
90
- localStorage.removeItem("selectedListItem");
91
- setTimeout(function () {
92
- return setLocation(location);
93
- }, 200);
94
- setSelectedListItem(null);
95
- };
96
- return /*#__PURE__*/React.createElement(MapContext.Provider, {
97
- value: {
98
- selectedListItem: selectedListItem,
99
- setSelectedListItem: setSelectedListItem,
100
- location: location,
101
- center: center,
102
- zoom: zoom,
103
- setZoom: setZoom,
104
- selectItem: selectItem,
105
- setSelectedPlaces: setSelectedPlaces,
106
- selectedPlaces: selectedPlaces,
107
- selectLocationEntity: selectLocationEntity,
108
- setLocation: setLocation,
109
- setMapInteracted: setMapInteracted,
110
- mapInteracted: mapInteracted,
111
- userSetZoom: userSetZoom,
112
- firstLoadListItem: firstLoadListItem,
113
- filterReset: filterReset
114
- }
115
- }, children);
4
+ const MapContext = createContext(undefined);
5
+ const useMap = () => {
6
+ const context = useContext(MapContext);
7
+ if (!context) {
8
+ throw new Error("useMap must be used within a MapProvider");
9
+ }
10
+ return context;
11
+ };
12
+ const MapProvider = ({ children, resetFilters }) => {
13
+ const [selectedListItem, setSelectedListItem] = useState(getStorageObject('selectedListItem'));
14
+ const [location, setLocation] = useState(getStorageObject('location'));
15
+ const [center, setCenter] = useState(getStorageObject("center", { lat: 39.8283, lng: -98.5795 }) || { lat: 39.8283, lng: -98.5795 });
16
+ const [zoom, setZoom] = useState(getStorageObject("zoom", 10) || 10);
17
+ const [selectedPlaces, setSelectedPlaces] = useState([]);
18
+ const [mapInteracted, setMapInteracted] = useState(false);
19
+ const [firstLoadListItem] = useState(getStorageObject('selectedListItem', { id: "defaultId" }));
20
+ const userSetZoom = useRef(true);
21
+ useEffect(() => {
22
+ setStorageObject("selectedListItem", selectedListItem);
23
+ }, [selectedListItem]);
24
+ useEffect(() => {
25
+ localStorage.setItem("zoom", zoom.toString());
26
+ }, [zoom]);
27
+ useEffect(() => {
28
+ if (location == null) {
29
+ localStorage.removeItem("location");
30
+ }
31
+ else {
32
+ setStorageObject("location", location);
33
+ }
34
+ }, [location]);
35
+ useEffect(() => {
36
+ setStorageObject("center", center);
37
+ }, [center]);
38
+ const selectItem = (item, itemLocation, zoom, center) => {
39
+ setSelectedListItem(item);
40
+ if (mapInteracted === false && itemLocation != null) {
41
+ setLocation(itemLocation);
42
+ }
43
+ if (mapInteracted === false || itemLocation != null) {
44
+ setLocation(itemLocation);
45
+ setCenter(center);
46
+ }
47
+ if (mapInteracted === false) {
48
+ setZoom(zoom);
49
+ }
50
+ };
51
+ const filterReset = () => {
52
+ setSelectedPlaces([]);
53
+ setSelectedListItem(null);
54
+ setLocation(null);
55
+ setZoom(8);
56
+ setMapInteracted(false);
57
+ };
58
+ useEffect(() => {
59
+ if (resetFilters === true) {
60
+ filterReset();
61
+ }
62
+ }, [resetFilters]);
63
+ const selectLocationEntity = (location) => {
64
+ localStorage.removeItem("selectedListItem");
65
+ setTimeout(() => setLocation(location), 200);
66
+ setSelectedListItem(null);
67
+ };
68
+ return (React.createElement(MapContext.Provider, { value: {
69
+ selectedListItem,
70
+ setSelectedListItem,
71
+ location,
72
+ center,
73
+ setCenter,
74
+ zoom,
75
+ setZoom,
76
+ selectItem,
77
+ setSelectedPlaces,
78
+ selectedPlaces,
79
+ selectLocationEntity,
80
+ setLocation,
81
+ setMapInteracted,
82
+ mapInteracted,
83
+ userSetZoom,
84
+ firstLoadListItem,
85
+ filterReset
86
+ } }, children));
116
87
  };
117
88
 
118
89
  export { MapProvider, useMap };