@abcagency/hc-ui-components 1.3.78 → 1.3.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/containers/maps/map-container.js +3 -3
- package/dist/components/containers/maps/map-container.js.map +1 -1
- package/dist/components/modules/list/field-mapper-desktop.js +36 -0
- package/dist/components/modules/list/field-mapper-desktop.js.map +1 -0
- package/dist/components/modules/list/field-mapper-mobile.js +90 -0
- package/dist/components/modules/list/field-mapper-mobile.js.map +1 -0
- package/dist/components/modules/list/list-item/list-item-desktop.js +50 -0
- package/dist/components/modules/list/list-item/list-item-desktop.js.map +1 -0
- package/dist/components/modules/list/list-item/list-item-mobile.js +51 -0
- package/dist/components/modules/list/list-item/list-item-mobile.js.map +1 -0
- package/dist/components/modules/list/list-item/list-item.js +14 -3
- package/dist/components/modules/list/list-item/list-item.js.map +1 -1
- package/dist/types/components/modules/list/field-mapper-desktop.d.ts +7 -0
- package/dist/types/components/modules/list/field-mapper-mobile.d.ts +10 -0
- package/dist/types/components/modules/list/list-item/list-item-desktop.d.ts +12 -0
- package/dist/types/components/modules/list/list-item/list-item-mobile.d.ts +15 -0
- package/dist/util/mapIconUtil.js +18 -18
- package/dist/util/mapIconUtil.js.map +1 -1
- package/package.json +1 -1
- package/src/components/modules/list/field-mapper-desktop.jsx +46 -0
- package/src/components/modules/list/field-mapper-mobile.jsx +105 -0
- package/src/components/modules/list/list-item/{list-item.js → list-item.jsx} +15 -3
- package/src/util/mapIconUtil.js +32 -8
- package/src/components/modules/list/field-mapper.js +0 -130
|
@@ -253,7 +253,7 @@ var MapContainer = function MapContainer(_ref) {
|
|
|
253
253
|
onClick: onClusterClick
|
|
254
254
|
}, function (clusterer) {
|
|
255
255
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, mapItems.map(function (item) {
|
|
256
|
-
Object.values(item.items).length;
|
|
256
|
+
var markerCount = Object.values(item.items).length;
|
|
257
257
|
return /*#__PURE__*/React__default.createElement(MapMarkerContainer, {
|
|
258
258
|
key: item.id,
|
|
259
259
|
item: item,
|
|
@@ -263,8 +263,8 @@ var MapContainer = function MapContainer(_ref) {
|
|
|
263
263
|
setSelectedLocation: setLocation,
|
|
264
264
|
markerClickHandler: markerClickHandler,
|
|
265
265
|
clusterer: clusterer,
|
|
266
|
-
markerIcon: markerIcon(markerConfigs),
|
|
267
|
-
markerIconSelected: markerIconSelected(markerConfigs),
|
|
266
|
+
markerIcon: markerIcon(markerConfigs, markerCount),
|
|
267
|
+
markerIconSelected: markerIconSelected(markerConfigs, markerCount),
|
|
268
268
|
setMapInteracted: setMapInteracted
|
|
269
269
|
});
|
|
270
270
|
}), additionalMapMarkers && additionalMapMarkers.map(function (marker, index) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-container.js","sources":["../../../../src/components/containers/maps/map-container.js"],"sourcesContent":["\"use client\";\n\nimport React, { useEffect, useRef, useState } from \"react\";\n\nimport MapMarker from \"~/components/containers/maps/map-marker-container\";\nimport PlaceMarker from \"~/components/modules/maps/place-marker\";\n\nimport { usePlaces } from \"~/contexts/placesContext\";\nimport { useMap } from \"~/contexts/mapContext\";\nimport { useMapList } from \"~/contexts/mapListContext\";\n\nimport { markerIconSelected, markerIcon, pinIcon } from \"~/util/mapIconUtil\";\n\nimport Map from \"~/components/modules/maps/map\";\nimport { MarkerClustererF, Marker } from \"@react-google-maps/api\";\nimport { clusterOptions } from \"~/util/mapUtil\";\n\nconst MapContainer = ({ markerConfigs, infoWindowClasses, clusterGridSize = 60 }) => {\n\tconst {\n\t\tlocation,\n\t\tzoom,\n\t\tcenter,\n\t\tselectLocationEntity,\n\t\tsetLocation,\n\t\tmapInteracted,\n\t\tsetMapInteracted,\n\t\tdefaultZoomOverride\n\t} = useMap();\n\n\tconst {\n\t\tmapItems: oldMapItems,\n\t\tfilteredListings,\n\t\tselectedFilters,\n\t\tsetSelectedFilters,\n\t\tsetQuery,\n\t\tsiteConfig\n\t} = useMapList();\n\tconst [mapItems, setMapItems] = useState(null);\n\tconst [markersToHideFromBounds, setMarkersToHideFromBounds] = useState([]);\n\n\tconst mapRef = useRef();\n\tconst markerRefs = useRef({});\n\tconst mapContainerRef = useRef(null);\n\tconst {\n\t\tpoiMarkers,\n\t\tsetCurrentCenter,\n\t\tcurrentCenter,\n\t\tsetCurrentZoom,\n\t\tcurrentZoom,\n\t\tselectedPlaceMarker,\n\t\tsetSelectedPlaceMarker,\n\t\tplacesWindow,\n\t\tsetPlacesWindow,\n\t\tadditionalMapMarkers\n\t} = usePlaces();\n\n\tconst onIdle = () => {\n\t\tif (!currentCenter || !mapRef.current) return;\n\t\tconst newCenter = mapRef.current.getCenter().toJSON();\n\t\tconst newZoom = mapRef.current.zoom;\n\t\tsetCurrentCenter(newCenter);\n\n\t\tif (newZoom !== currentZoom) {\n\t\t\tsetCurrentZoom(newZoom);\n\t\t}\n\t};\n\n\tuseEffect(() => {\n\t\tif (!oldMapItems || oldMapItems.length === 0) return;\n\n\t\tif (!siteConfig.defaultMapState || mapInteracted || selectedFilters?.state || selectedFilters?.city) {\n\t\t\tsetMapItems(oldMapItems);\n\t\t\tsetMarkersToHideFromBounds([]);\n\t\t\treturn;\n\t\t}\n\n\t\tconst markersToHide = oldMapItems\n\t\t\t.filter(x => x.address.state !== siteConfig.defaultMapState)\n\t\t\t.map(item => item.id);\n\n\t\tsetMarkersToHideFromBounds(markersToHide);\n\t\tsetMapItems(oldMapItems);\n\t}, [oldMapItems, selectedFilters, siteConfig, mapInteracted]);\n\n\tuseEffect(() => {\n\t\tif (mapContainerRef.current) {\n\t\t\tconst handleScroll = () => {\n\t\t\t\tsetMapInteracted(true);\n\t\t\t};\n\t\t\tvar mapContainerRefCurrent = mapContainerRef.current;\n\t\t\tmapContainerRef.current.addEventListener(\"wheel\", handleScroll);\n\t\t\treturn () => mapContainerRefCurrent.removeEventListener(\"wheel\", handleScroll);\n\t\t}\n\t}, [mapContainerRef.current]);\n\n\tuseEffect(() => {\n\t\tif (mapRef.current && defaultZoomOverride && !mapInteracted && !location) {\n\t\t\tmapRef.current.setZoom(defaultZoomOverride);\n\t\t}\n\t}, [mapInteracted]);\n\n\tuseEffect(() => {\n\t\tif (mapRef.current) {\n\t\t\tconst mapInstance = mapRef.current;\n\t\t\tconst dragStartListener = mapInstance.addListener(\"dragstart\", () => {\n\t\t\t\tsetMapInteracted(true);\n\t\t\t\tsetMarkersToHideFromBounds([]);\n\t\t\t});\n\t\t\tconst mouseDownListener = mapInstance.addListener(\"mousedown\", () => {\n\t\t\t\tsetMapInteracted(true);\n\t\t\t\tsetMarkersToHideFromBounds([]);\n\t\t\t});\n\t\t\treturn () => {\n\t\t\t\tgoogle.maps.event.removeListener(dragStartListener);\n\t\t\t\tgoogle.maps.event.removeListener(mouseDownListener);\n\t\t\t};\n\t\t}\n\t}, [mapRef.current, mapContainerRef.current]);\n\n\tuseEffect(() => {\n\t\tif (((mapItems && mapItems.length > 0) || poiMarkers.length > 0) && mapRef.current && !mapInteracted) {\n\t\t\tfitBounds(mapRef.current);\n\t\t}\n\t}, [mapItems, mapRef.current, location]);\n\n\tuseEffect(() => {\n\t\tif (((mapItems && mapItems.length > 0) || poiMarkers.length > 0) && mapRef.current && !mapInteracted) {\n\t\t\tfitBounds(mapRef.current, true);\n\t\t}\n\t\tif (mapRef.current && !mapInteracted) {\n\t\t\tconst currZoom = mapRef.current.zoom;\n\t\t\tconst setZoomVal = currZoom < 13 ? currZoom : 12;\n\t\t\tmapRef.current.setZoom(setZoomVal);\n\t\t}\n\t}, [filteredListings]);\n\n\tuseEffect(() => {\n\t\tif (!mapRef.current || !location || mapInteracted) return;\n\t\tmapRef.current.panTo(new google.maps.LatLng(location.latitude, location.longitude));\n\t\tif (mapRef.current) {\n\t\t\tconst setZoomVal = zoom < 13 ? zoom : 12;\n\t\t\tmapRef.current.setZoom(setZoomVal);\n\t\t}\n\t}, [location, zoom, mapRef.current]);\n\n\tconst fitBounds = (map, overload = false) => {\n\t\tif ((mapInteracted === false || overload) && mapItems != null) {\n\t\t\tconst bounds = new window.google.maps.LatLngBounds();\n\n\t\t\tmapItems.forEach(item => {\n\t\t\t\tif (!mapInteracted && markersToHideFromBounds.includes(item.id)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tbounds.extend(new google.maps.LatLng(item.latitude, item.longitude));\n\t\t\t});\n\n\t\t\tif (siteConfig.optionalShowLocationClusterConfig) {\n\t\t\t\tconst configLocation = new google.maps.LatLng(\n\t\t\t\t\tsiteConfig.optionalShowLocationClusterConfig.latitude,\n\t\t\t\t\tsiteConfig.optionalShowLocationClusterConfig.longitude\n\t\t\t\t);\n\t\t\t\tmap.panTo(configLocation);\n\t\t\t\tbounds.extend(\n\t\t\t\t\tnew google.maps.LatLng(\n\t\t\t\t\t\tsiteConfig.optionalShowLocationClusterConfig.latitude,\n\t\t\t\t\t\tsiteConfig.optionalShowLocationClusterConfig.longitude\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (!map) return;\n\t\t\tconst currentCenter = map.getCenter();\n\t\t\tmap.fitBounds(bounds);\n\t\t\tconst newCenter = bounds.getCenter();\n\t\t\tif (currentCenter && newCenter) {\n\t\t\t\tmap.panTo(newCenter);\n\t\t\t}\n\t\t}\n\t\tif (defaultZoomOverride && !mapInteracted && !location) {\n\t\t\tmapRef.current.setZoom(defaultZoomOverride);\n\t\t} else if (mapRef.current.zoom > 17) {\n\t\t\tmapRef.current.setZoom(16);\n\t\t}\n\t};\n\n\tconst markerClickHandler = mapLocation => {\n\t\tsetMapInteracted(true);\n\t\tsetMarkersToHideFromBounds([]);\n\t\tselectLocationEntity(mapLocation);\n\t};\n\n\tconst onLoad = map => {\n\t\tif (!location || location === null) {\n\t\t\tmapRef.current = map;\n\t\t\tfitBounds(map, true);\n\t\t\treturn;\n\t\t}\n\t\tmapRef.current = map;\n\n\t\tif (mapInteracted === false) {\n\t\t\tmapRef.current.panTo(new google.maps.LatLng(location.latitude, location.longitude));\n\n\t\t\tmapRef.current.setZoom(zoom);\n\t\t}\n\t};\n\n\tconst pinIconUrl = pinIcon({\n\t\tfillColor: markerConfigs.fillColor,\n\t\tstrokeColor: markerConfigs.strokeColor\n\t});\n\n\tconst onClusterClick = cluster => {\n\t\tif (\n\t\t\t!siteConfig.optionalShowLocationClusterConfig ||\n mapRef.current.zoom > siteConfig.optionalShowLocationClusterConfig.showForZoomLevelLessThan\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!cluster || typeof cluster.getMarkers !== \"function\") {\n\t\t\tconsole.error(\"Cluster object or getMarkers method not available.\");\n\t\t\treturn;\n\t\t}\n\n\t\tconst markers = cluster.getMarkers();\n\n\t\tif (!markers || markers.length === 0) {\n\t\t\tconsole.error(\"No markers found in the cluster.\");\n\t\t\treturn;\n\t\t}\n\n\t\tsetTimeout(() => {\n\t\t\tconst bounds = new window.google.maps.LatLngBounds();\n\n\t\t\tmarkers.forEach(marker => {\n\t\t\t\tbounds.extend(marker.getPosition());\n\t\t\t});\n\t\t\tconst clusterCenter = bounds.getCenter();\n\n\t\t\tconst configLat = siteConfig.optionalShowLocationClusterConfig.latitude;\n\t\t\tconst configLng = siteConfig.optionalShowLocationClusterConfig.longitude;\n\n\t\t\tconst latDiff = clusterCenter.lat() - configLat;\n\t\t\tconst lngDiff = clusterCenter.lng() - configLng;\n\t\t\tconst distance = Math.sqrt(latDiff * latDiff + lngDiff * lngDiff);\n\n\t\t\tconst distanceThreshold = 1;\n\t\t\tif (distance <= distanceThreshold) {\n\t\t\t\tbounds.extend(new google.maps.LatLng(configLat, configLng));\n\t\t\t}\n\n\t\t\tif (mapRef.current) {\n\t\t\t\tmapRef.current.fitBounds(bounds);\n\t\t\t}\n\t\t}, 300);\n\t};\n\tif (!mapItems) {\n\t\treturn null;\n\t}\n\tconst mapItemsKey = mapItems.map(item => item.id).join(\"-\");\n\n\tconsole.log(location);\n\treturn (\n\t\t<Map\n\t\t\tzoom={zoom}\n\t\t\tcenter={center}\n\t\t\tmapContainerRef={mapContainerRef}\n\t\t\tonLoad={onLoad}\n\t\t\tonIdle={onIdle}\n\t\t\tmapInteracted={mapInteracted}\n\t\t\tpinIconUrl={pinIconUrl}\n\t\t\tsetMapInteracted={setMapInteracted}\n\t\t\tfitBounds={fitBounds}\n\t\t\tmapRef={mapRef}\n\t\t\tsetQuery={setQuery}\n\t\t\tfilteredListingsLength={filteredListings.length}\n\t\t\tsetSelectedFilters={setSelectedFilters}\n\t\t>\n\t\t\t<MarkerClustererF\n\t\t\t\tkey={mapItemsKey}\n\t\t\t\tcalculator={markers => {\n\t\t\t\t\tconst totalCount = markers.reduce((sum, marker) => sum + (marker.get(\"count\") || 1), 0);\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttext: totalCount.toString(),\n\t\t\t\t\t\tindex: Math.min(5, Math.floor(totalCount / 10))\n\t\t\t\t\t};\n\t\t\t\t}}\n\t\t\t\toptions={{\n\t\t\t\t\t...clusterOptions(clusterGridSize, markerConfigs.fillColor)\n\t\t\t\t}}\n\t\t\t\tonClick={onClusterClick}\n\t\t\t>\n\t\t\t\t{clusterer => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{mapItems.map(item => {\n\t\t\t\t\t\t\tconst markerCount = Object.values(item.items).length;\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<MapMarker\n\t\t\t\t\t\t\t\t\tkey={item.id}\n\t\t\t\t\t\t\t\t\titem={item}\n\t\t\t\t\t\t\t\t\tselectedLocation={location}\n\t\t\t\t\t\t\t\t\tmarkerRefs={markerRefs}\n\t\t\t\t\t\t\t\t\tinfoWindowClasses={infoWindowClasses}\n\t\t\t\t\t\t\t\t\tsetSelectedLocation={setLocation}\n\t\t\t\t\t\t\t\t\tmarkerClickHandler={markerClickHandler}\n\t\t\t\t\t\t\t\t\tclusterer={clusterer}\n\t\t\t\t\t\t\t\t\tmarkerIcon={markerIcon(markerConfigs, markerCount)}\n\t\t\t\t\t\t\t\t\tmarkerIconSelected={markerIconSelected(markerConfigs, markerCount)}\n\t\t\t\t\t\t\t\t\tsetMapInteracted={setMapInteracted}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})}\n\n\t\t\t\t\t\t{additionalMapMarkers &&\n additionalMapMarkers.map(\n \t(marker, index) =>\n \t\tcurrentZoom >= marker.minZoom &&\n currentZoom <= marker.maxZoom && (\n \t\t\t<Marker\n \t\t\t\tkey={`marker-${marker.title}-${index}`}\n \t\t\t\tposition={marker.position}\n \t\t\t\ttitle={marker.title}\n \t\t\t\ticon={{\n \t\t\t\t\turl: marker.iconUrl,\n \t\t\t\t\tscaledSize: new window.google.maps.Size(40, 40)\n \t\t\t\t}}\n \t\t\t/>\n \t\t)\n )}\n\n\t\t\t\t\t\t{poiMarkers &&\n poiMarkers.markers.map((marker, index) => (\n \t<PlaceMarker\n \t\tkey={`marker-${marker.title}-${index}`}\n \t\tmarker={marker}\n \t\tindex={index}\n \t\tselectedPlaceMarker={selectedPlaceMarker}\n \t\tplacesWindow={placesWindow}\n \t\tsetPlacesWindow={setPlacesWindow}\n \t\tsetSelectedPlaceMarker={setSelectedPlaceMarker}\n \t/>\n ))}\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t</MarkerClustererF>\n\t\t</Map>\n\t);\n};\n\nexport default MapContainer;\n\n"],"names":["MapContainer","_ref","markerConfigs","infoWindowClasses","_ref$clusterGridSize","clusterGridSize","_useMap","useMap","location","zoom","center","selectLocationEntity","setLocation","mapInteracted","setMapInteracted","defaultZoomOverride","_useMapList","useMapList","oldMapItems","mapItems","filteredListings","selectedFilters","setSelectedFilters","setQuery","siteConfig","_useState","useState","_useState2","_slicedToArray","setMapItems","_useState3","_useState4","markersToHideFromBounds","setMarkersToHideFromBounds","mapRef","useRef","markerRefs","mapContainerRef","_usePlaces","usePlaces","poiMarkers","setCurrentCenter","currentCenter","setCurrentZoom","currentZoom","selectedPlaceMarker","setSelectedPlaceMarker","placesWindow","setPlacesWindow","additionalMapMarkers","onIdle","current","newCenter","getCenter","toJSON","newZoom","useEffect","length","defaultMapState","state","city","markersToHide","filter","x","address","map","item","id","handleScroll","mapContainerRefCurrent","addEventListener","removeEventListener","setZoom","mapInstance","dragStartListener","addListener","mouseDownListener","google","maps","event","removeListener","fitBounds","currZoom","setZoomVal","panTo","LatLng","latitude","longitude","overload","arguments","undefined","bounds","window","LatLngBounds","forEach","includes","extend","optionalShowLocationClusterConfig","configLocation","markerClickHandler","mapLocation","onLoad","pinIconUrl","pinIcon","fillColor","strokeColor","onClusterClick","cluster","showForZoomLevelLessThan","getMarkers","console","error","markers","setTimeout","marker","getPosition","clusterCenter","configLat","configLng","latDiff","lat","lngDiff","lng","distance","Math","sqrt","distanceThreshold","mapItemsKey","join","log","React","createElement","Map","filteredListingsLength","MarkerClustererF","key","calculator","totalCount","reduce","sum","get","text","toString","index","min","floor","options","_objectSpread","clusterOptions","onClick","clusterer","Fragment","Object","values","items","MapMarker","selectedLocation","setSelectedLocation","markerIcon","markerIconSelected","minZoom","maxZoom","Marker","concat","title","position","icon","url","iconUrl","scaledSize","Size","PlaceMarker"],"mappings":";;;;;;;;;;;;AAiBA,IAAMA,YAAY,GAAG,SAAfA,YAAYA,CAAAC,IAAA,EAAmE;AAAA,EAAA,IAA7DC,aAAa,GAAAD,IAAA,CAAbC,aAAa;IAAEC,iBAAiB,GAAAF,IAAA,CAAjBE,iBAAiB;IAAAC,oBAAA,GAAAH,IAAA,CAAEI,eAAe;AAAfA,IAAAA,eAAe,GAAAD,oBAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,oBAAA,CAAA;AAC7E,EAAA,IAAAE,OAAA,GASIC,MAAM,EAAE;IARXC,QAAQ,GAAAF,OAAA,CAARE,QAAQ;IACRC,IAAI,GAAAH,OAAA,CAAJG,IAAI;IACJC,MAAM,GAAAJ,OAAA,CAANI,MAAM;IACNC,oBAAoB,GAAAL,OAAA,CAApBK,oBAAoB;IACpBC,WAAW,GAAAN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C/C,SAAA;AAAE,OACF,CACD,CAAA;AAAA,KACH,CAAC,EAERlI,UAAU,IACHA,UAAU,CAACwE,OAAO,CAAC/C,GAAG,CAAC,UAACiD,MAAM,EAAE6B,KAAK,EAAA;AAAA,MAAA,oBACpCb,cAAA,CAAAC,aAAA,CAACwC,WAAW,EAAA;QACXpC,GAAG,EAAA,SAAA,CAAA4B,MAAA,CAAYjD,MAAM,CAACkD,KAAK,EAAAD,GAAAA,CAAAA,CAAAA,MAAA,CAAIpB,KAAK,CAAG;AACvC7B,QAAAA,MAAM,EAAEA,MAAO;AACf6B,QAAAA,KAAK,EAAEA,KAAM;AACblG,QAAAA,mBAAmB,EAAEA,mBAAoB;AACzCE,QAAAA,YAAY,EAAEA,YAAa;AAC3BC,QAAAA,eAAe,EAAEA,eAAgB;AACjCF,QAAAA,sBAAsB,EAAEA,sBAAAA;AAAuB,OAC/C,CAAC,CAAA;AAAA,KACF,CACR,CAAC,CAAA;AAAA,GAEa,CACd,CAAC,CAAA;AAER;;;;"}
|
|
1
|
+
{"version":3,"file":"map-container.js","sources":["../../../../src/components/containers/maps/map-container.js"],"sourcesContent":["\"use client\";\n\nimport React, { useEffect, useRef, useState } from \"react\";\n\nimport MapMarker from \"~/components/containers/maps/map-marker-container\";\nimport PlaceMarker from \"~/components/modules/maps/place-marker\";\n\nimport { usePlaces } from \"~/contexts/placesContext\";\nimport { useMap } from \"~/contexts/mapContext\";\nimport { useMapList } from \"~/contexts/mapListContext\";\n\nimport { markerIconSelected, markerIcon, pinIcon } from \"~/util/mapIconUtil\";\n\nimport Map from \"~/components/modules/maps/map\";\nimport { MarkerClustererF, Marker } from \"@react-google-maps/api\";\nimport { clusterOptions } from \"~/util/mapUtil\";\n\nconst MapContainer = ({ markerConfigs, infoWindowClasses, clusterGridSize = 60 }) => {\n\tconst {\n\t\tlocation,\n\t\tzoom,\n\t\tcenter,\n\t\tselectLocationEntity,\n\t\tsetLocation,\n\t\tmapInteracted,\n\t\tsetMapInteracted,\n\t\tdefaultZoomOverride\n\t} = useMap();\n\n\tconst {\n\t\tmapItems: oldMapItems,\n\t\tfilteredListings,\n\t\tselectedFilters,\n\t\tsetSelectedFilters,\n\t\tsetQuery,\n\t\tsiteConfig\n\t} = useMapList();\n\tconst [mapItems, setMapItems] = useState(null);\n\tconst [markersToHideFromBounds, setMarkersToHideFromBounds] = useState([]);\n\n\tconst mapRef = useRef();\n\tconst markerRefs = useRef({});\n\tconst mapContainerRef = useRef(null);\n\tconst {\n\t\tpoiMarkers,\n\t\tsetCurrentCenter,\n\t\tcurrentCenter,\n\t\tsetCurrentZoom,\n\t\tcurrentZoom,\n\t\tselectedPlaceMarker,\n\t\tsetSelectedPlaceMarker,\n\t\tplacesWindow,\n\t\tsetPlacesWindow,\n\t\tadditionalMapMarkers\n\t} = usePlaces();\n\n\tconst onIdle = () => {\n\t\tif (!currentCenter || !mapRef.current) return;\n\t\tconst newCenter = mapRef.current.getCenter().toJSON();\n\t\tconst newZoom = mapRef.current.zoom;\n\t\tsetCurrentCenter(newCenter);\n\n\t\tif (newZoom !== currentZoom) {\n\t\t\tsetCurrentZoom(newZoom);\n\t\t}\n\t};\n\n\tuseEffect(() => {\n\t\tif (!oldMapItems || oldMapItems.length === 0) return;\n\n\t\tif (!siteConfig.defaultMapState || mapInteracted || selectedFilters?.state || selectedFilters?.city) {\n\t\t\tsetMapItems(oldMapItems);\n\t\t\tsetMarkersToHideFromBounds([]);\n\t\t\treturn;\n\t\t}\n\n\t\tconst markersToHide = oldMapItems\n\t\t\t.filter(x => x.address.state !== siteConfig.defaultMapState)\n\t\t\t.map(item => item.id);\n\n\t\tsetMarkersToHideFromBounds(markersToHide);\n\t\tsetMapItems(oldMapItems);\n\t}, [oldMapItems, selectedFilters, siteConfig, mapInteracted]);\n\n\tuseEffect(() => {\n\t\tif (mapContainerRef.current) {\n\t\t\tconst handleScroll = () => {\n\t\t\t\tsetMapInteracted(true);\n\t\t\t};\n\t\t\tvar mapContainerRefCurrent = mapContainerRef.current;\n\t\t\tmapContainerRef.current.addEventListener(\"wheel\", handleScroll);\n\t\t\treturn () => mapContainerRefCurrent.removeEventListener(\"wheel\", handleScroll);\n\t\t}\n\t}, [mapContainerRef.current]);\n\n\tuseEffect(() => {\n\t\tif (mapRef.current && defaultZoomOverride && !mapInteracted && !location) {\n\t\t\tmapRef.current.setZoom(defaultZoomOverride);\n\t\t}\n\t}, [mapInteracted]);\n\n\tuseEffect(() => {\n\t\tif (mapRef.current) {\n\t\t\tconst mapInstance = mapRef.current;\n\t\t\tconst dragStartListener = mapInstance.addListener(\"dragstart\", () => {\n\t\t\t\tsetMapInteracted(true);\n\t\t\t\tsetMarkersToHideFromBounds([]);\n\t\t\t});\n\t\t\tconst mouseDownListener = mapInstance.addListener(\"mousedown\", () => {\n\t\t\t\tsetMapInteracted(true);\n\t\t\t\tsetMarkersToHideFromBounds([]);\n\t\t\t});\n\t\t\treturn () => {\n\t\t\t\tgoogle.maps.event.removeListener(dragStartListener);\n\t\t\t\tgoogle.maps.event.removeListener(mouseDownListener);\n\t\t\t};\n\t\t}\n\t}, [mapRef.current, mapContainerRef.current]);\n\n\tuseEffect(() => {\n\t\tif (((mapItems && mapItems.length > 0) || poiMarkers.length > 0) && mapRef.current && !mapInteracted) {\n\t\t\tfitBounds(mapRef.current);\n\t\t}\n\t}, [mapItems, mapRef.current, location]);\n\n\tuseEffect(() => {\n\t\tif (((mapItems && mapItems.length > 0) || poiMarkers.length > 0) && mapRef.current && !mapInteracted) {\n\t\t\tfitBounds(mapRef.current, true);\n\t\t}\n\t\tif (mapRef.current && !mapInteracted) {\n\t\t\tconst currZoom = mapRef.current.zoom;\n\t\t\tconst setZoomVal = currZoom < 13 ? currZoom : 12;\n\t\t\tmapRef.current.setZoom(setZoomVal);\n\t\t}\n\t}, [filteredListings]);\n\n\tuseEffect(() => {\n\t\tif (!mapRef.current || !location || mapInteracted) return;\n\t\tmapRef.current.panTo(new google.maps.LatLng(location.latitude, location.longitude));\n\t\tif (mapRef.current) {\n\t\t\tconst setZoomVal = zoom < 13 ? zoom : 12;\n\t\t\tmapRef.current.setZoom(setZoomVal);\n\t\t}\n\t}, [location, zoom, mapRef.current]);\n\n\tconst fitBounds = (map, overload = false) => {\n\t\tif ((mapInteracted === false || overload) && mapItems != null) {\n\t\t\tconst bounds = new window.google.maps.LatLngBounds();\n\n\t\t\tmapItems.forEach(item => {\n\t\t\t\tif (!mapInteracted && markersToHideFromBounds.includes(item.id)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tbounds.extend(new google.maps.LatLng(item.latitude, item.longitude));\n\t\t\t});\n\n\t\t\tif (siteConfig.optionalShowLocationClusterConfig) {\n\t\t\t\tconst configLocation = new google.maps.LatLng(\n\t\t\t\t\tsiteConfig.optionalShowLocationClusterConfig.latitude,\n\t\t\t\t\tsiteConfig.optionalShowLocationClusterConfig.longitude\n\t\t\t\t);\n\t\t\t\tmap.panTo(configLocation);\n\t\t\t\tbounds.extend(\n\t\t\t\t\tnew google.maps.LatLng(\n\t\t\t\t\t\tsiteConfig.optionalShowLocationClusterConfig.latitude,\n\t\t\t\t\t\tsiteConfig.optionalShowLocationClusterConfig.longitude\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (!map) return;\n\t\t\tconst currentCenter = map.getCenter();\n\t\t\tmap.fitBounds(bounds);\n\t\t\tconst newCenter = bounds.getCenter();\n\t\t\tif (currentCenter && newCenter) {\n\t\t\t\tmap.panTo(newCenter);\n\t\t\t}\n\t\t}\n\t\tif (defaultZoomOverride && !mapInteracted && !location) {\n\t\t\tmapRef.current.setZoom(defaultZoomOverride);\n\t\t} else if (mapRef.current.zoom > 17) {\n\t\t\tmapRef.current.setZoom(16);\n\t\t}\n\t};\n\n\tconst markerClickHandler = mapLocation => {\n\t\tsetMapInteracted(true);\n\t\tsetMarkersToHideFromBounds([]);\n\t\tselectLocationEntity(mapLocation);\n\t};\n\n\tconst onLoad = map => {\n\t\tif (!location || location === null) {\n\t\t\tmapRef.current = map;\n\t\t\tfitBounds(map, true);\n\t\t\treturn;\n\t\t}\n\t\tmapRef.current = map;\n\n\t\tif (mapInteracted === false) {\n\t\t\tmapRef.current.panTo(new google.maps.LatLng(location.latitude, location.longitude));\n\n\t\t\tmapRef.current.setZoom(zoom);\n\t\t}\n\t};\n\n\tconst pinIconUrl = pinIcon({\n\t\tfillColor: markerConfigs.fillColor,\n\t\tstrokeColor: markerConfigs.strokeColor\n\t});\n\n\tconst onClusterClick = cluster => {\n\t\tif (\n\t\t\t!siteConfig.optionalShowLocationClusterConfig ||\n mapRef.current.zoom > siteConfig.optionalShowLocationClusterConfig.showForZoomLevelLessThan\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!cluster || typeof cluster.getMarkers !== \"function\") {\n\t\t\tconsole.error(\"Cluster object or getMarkers method not available.\");\n\t\t\treturn;\n\t\t}\n\n\t\tconst markers = cluster.getMarkers();\n\n\t\tif (!markers || markers.length === 0) {\n\t\t\tconsole.error(\"No markers found in the cluster.\");\n\t\t\treturn;\n\t\t}\n\n\t\tsetTimeout(() => {\n\t\t\tconst bounds = new window.google.maps.LatLngBounds();\n\n\t\t\tmarkers.forEach(marker => {\n\t\t\t\tbounds.extend(marker.getPosition());\n\t\t\t});\n\t\t\tconst clusterCenter = bounds.getCenter();\n\n\t\t\tconst configLat = siteConfig.optionalShowLocationClusterConfig.latitude;\n\t\t\tconst configLng = siteConfig.optionalShowLocationClusterConfig.longitude;\n\n\t\t\tconst latDiff = clusterCenter.lat() - configLat;\n\t\t\tconst lngDiff = clusterCenter.lng() - configLng;\n\t\t\tconst distance = Math.sqrt(latDiff * latDiff + lngDiff * lngDiff);\n\n\t\t\tconst distanceThreshold = 1;\n\t\t\tif (distance <= distanceThreshold) {\n\t\t\t\tbounds.extend(new google.maps.LatLng(configLat, configLng));\n\t\t\t}\n\n\t\t\tif (mapRef.current) {\n\t\t\t\tmapRef.current.fitBounds(bounds);\n\t\t\t}\n\t\t}, 300);\n\t};\n\tif (!mapItems) {\n\t\treturn null;\n\t}\n\tconst mapItemsKey = mapItems.map(item => item.id).join(\"-\");\n\n\tconsole.log(location);\n\treturn (\n\t\t<Map\n\t\t\tzoom={zoom}\n\t\t\tcenter={center}\n\t\t\tmapContainerRef={mapContainerRef}\n\t\t\tonLoad={onLoad}\n\t\t\tonIdle={onIdle}\n\t\t\tmapInteracted={mapInteracted}\n\t\t\tpinIconUrl={pinIconUrl}\n\t\t\tsetMapInteracted={setMapInteracted}\n\t\t\tfitBounds={fitBounds}\n\t\t\tmapRef={mapRef}\n\t\t\tsetQuery={setQuery}\n\t\t\tfilteredListingsLength={filteredListings.length}\n\t\t\tsetSelectedFilters={setSelectedFilters}\n\t\t>\n\t\t\t<MarkerClustererF\n\t\t\t\tkey={mapItemsKey}\n\t\t\t\tcalculator={markers => {\n\t\t\t\t\tconst totalCount = markers.reduce((sum, marker) => sum + (marker.get(\"count\") || 1), 0);\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttext: totalCount.toString(),\n\t\t\t\t\t\tindex: Math.min(5, Math.floor(totalCount / 10))\n\t\t\t\t\t};\n\t\t\t\t}}\n\t\t\t\toptions={{\n\t\t\t\t\t...clusterOptions(clusterGridSize, markerConfigs.fillColor)\n\t\t\t\t}}\n\t\t\t\tonClick={onClusterClick}\n\t\t\t>\n\t\t\t\t{clusterer => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{mapItems.map(item => {\n\t\t\t\t\t\t\tconst markerCount = Object.values(item.items).length;\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<MapMarker\n\t\t\t\t\t\t\t\t\tkey={item.id}\n\t\t\t\t\t\t\t\t\titem={item}\n\t\t\t\t\t\t\t\t\tselectedLocation={location}\n\t\t\t\t\t\t\t\t\tmarkerRefs={markerRefs}\n\t\t\t\t\t\t\t\t\tinfoWindowClasses={infoWindowClasses}\n\t\t\t\t\t\t\t\t\tsetSelectedLocation={setLocation}\n\t\t\t\t\t\t\t\t\tmarkerClickHandler={markerClickHandler}\n\t\t\t\t\t\t\t\t\tclusterer={clusterer}\n\t\t\t\t\t\t\t\t\tmarkerIcon={markerIcon(markerConfigs, markerCount)}\n\t\t\t\t\t\t\t\t\tmarkerIconSelected={markerIconSelected(markerConfigs, markerCount)}\n\t\t\t\t\t\t\t\t\tsetMapInteracted={setMapInteracted}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t})}\n\n\t\t\t\t\t\t{additionalMapMarkers &&\n additionalMapMarkers.map(\n \t(marker, index) =>\n \t\tcurrentZoom >= marker.minZoom &&\n currentZoom <= marker.maxZoom && (\n \t\t\t<Marker\n \t\t\t\tkey={`marker-${marker.title}-${index}`}\n \t\t\t\tposition={marker.position}\n \t\t\t\ttitle={marker.title}\n \t\t\t\ticon={{\n \t\t\t\t\turl: marker.iconUrl,\n \t\t\t\t\tscaledSize: new window.google.maps.Size(40, 40)\n \t\t\t\t}}\n \t\t\t/>\n \t\t)\n )}\n\n\t\t\t\t\t\t{poiMarkers &&\n poiMarkers.markers.map((marker, index) => (\n \t<PlaceMarker\n \t\tkey={`marker-${marker.title}-${index}`}\n \t\tmarker={marker}\n \t\tindex={index}\n \t\tselectedPlaceMarker={selectedPlaceMarker}\n \t\tplacesWindow={placesWindow}\n \t\tsetPlacesWindow={setPlacesWindow}\n \t\tsetSelectedPlaceMarker={setSelectedPlaceMarker}\n \t/>\n ))}\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t</MarkerClustererF>\n\t\t</Map>\n\t);\n};\n\nexport default MapContainer;\n\n"],"names":["MapContainer","_ref","markerConfigs","infoWindowClasses","_ref$clusterGridSize","clusterGridSize","_useMap","useMap","location","zoom","center","selectLocationEntity","setLocation","mapInteracted","setMapInteracted","defaultZoomOverride","_useMapList","useMapList","oldMapItems","mapItems","filteredListings","selectedFilters","setSelectedFilters","setQuery","siteConfig","_useState","useState","_useState2","_slicedToArray","setMapItems","_useState3","_useState4","markersToHideFromBounds","setMarkersToHideFromBounds","mapRef","useRef","markerRefs","mapContainerRef","_usePlaces","usePlaces","poiMarkers","setCurrentCenter","currentCenter","setCurrentZoom","currentZoom","selectedPlaceMarker","setSelectedPlaceMarker","placesWindow","setPlacesWindow","additionalMapMarkers","onIdle","current","newCenter","getCenter","toJSON","newZoom","useEffect","length","defaultMapState","state","city","markersToHide","filter","x","address","map","item","id","handleScroll","mapContainerRefCurrent","addEventListener","removeEventListener","setZoom","mapInstance","dragStartListener","addListener","mouseDownListener","google","maps","event","removeListener","fitBounds","currZoom","setZoomVal","panTo","LatLng","latitude","longitude","overload","arguments","undefined","bounds","window","LatLngBounds","forEach","includes","extend","optionalShowLocationClusterConfig","configLocation","markerClickHandler","mapLocation","onLoad","pinIconUrl","pinIcon","fillColor","strokeColor","onClusterClick","cluster","showForZoomLevelLessThan","getMarkers","console","error","markers","setTimeout","marker","getPosition","clusterCenter","configLat","configLng","latDiff","lat","lngDiff","lng","distance","Math","sqrt","distanceThreshold","mapItemsKey","join","log","React","createElement","Map","filteredListingsLength","MarkerClustererF","key","calculator","totalCount","reduce","sum","get","text","toString","index","min","floor","options","_objectSpread","clusterOptions","onClick","clusterer","Fragment","markerCount","Object","values","items","MapMarker","selectedLocation","setSelectedLocation","markerIcon","markerIconSelected","minZoom","maxZoom","Marker","concat","title","position","icon","url","iconUrl","scaledSize","Size","PlaceMarker"],"mappings":";;;;;;;;;;;;AAiBA,IAAMA,YAAY,GAAG,SAAfA,YAAYA,CAAAC,IAAA,EAAmE;AAAA,EAAA,IAA7DC,aAAa,GAAAD,IAAA,CAAbC,aAAa;IAAEC,iBAAiB,GAAAF,IAAA,CAAjBE,iBAAiB;IAAAC,oBAAA,GAAAH,IAAA,CAAEI,eAAe;AAAfA,IAAAA,eAAe,GAAAD,oBAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,oBAAA,CAAA;AAC7E,EAAA,IAAAE,OAAA,GASIC,MAAM,EAAE;IARXC,QAAQ,GAAAF,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KAAK,EAAEnD,MAAM,CAACmD,KAAM;AACpBE,QAAAA,IAAI,EAAE;UACLC,GAAG,EAAEtD,MAAM,CAACuD,OAAO;AACnBC,UAAAA,UAAU,EAAE,IAAI9E,MAAM,CAACf,MAAM,CAACC,IAAI,CAAC6F,IAAI,CAAC,EAAE,EAAE,EAAE,CAAA;AAC/C,SAAA;AAAE,OACF,CACD,CAAA;AAAA,KACH,CAAC,EAERnI,UAAU,IACHA,UAAU,CAACwE,OAAO,CAAC/C,GAAG,CAAC,UAACiD,MAAM,EAAE6B,KAAK,EAAA;AAAA,MAAA,oBACpCb,cAAA,CAAAC,aAAA,CAACyC,WAAW,EAAA;QACXrC,GAAG,EAAA,SAAA,CAAA6B,MAAA,CAAYlD,MAAM,CAACmD,KAAK,EAAAD,GAAAA,CAAAA,CAAAA,MAAA,CAAIrB,KAAK,CAAG;AACvC7B,QAAAA,MAAM,EAAEA,MAAO;AACf6B,QAAAA,KAAK,EAAEA,KAAM;AACblG,QAAAA,mBAAmB,EAAEA,mBAAoB;AACzCE,QAAAA,YAAY,EAAEA,YAAa;AAC3BC,QAAAA,eAAe,EAAEA,eAAgB;AACjCF,QAAAA,sBAAsB,EAAEA,sBAAAA;AAAuB,OAC/C,CAAC,CAAA;AAAA,KACF,CACR,CAAC,CAAA;AAAA,GAEa,CACd,CAAC,CAAA;AAER;;;;"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { slicedToArray as _slicedToArray } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import Grid from '../grid.js';
|
|
4
|
+
import { PillWrapper } from '../buttons/pill-wrapper.js';
|
|
5
|
+
import { capitalize } from '../../../util/stringUtils.js';
|
|
6
|
+
|
|
7
|
+
var FieldMapperDesktop = function FieldMapperDesktop(_ref) {
|
|
8
|
+
var item = _ref.item,
|
|
9
|
+
fieldsShown = _ref.fieldsShown,
|
|
10
|
+
specialFeatures = _ref.specialFeatures;
|
|
11
|
+
var orderedFields = fieldsShown.filter(function (field) {
|
|
12
|
+
return field in item.fields;
|
|
13
|
+
});
|
|
14
|
+
var specialFeaturePills = function specialFeaturePills(field) {
|
|
15
|
+
return field === 'position' && specialFeatures && Object.entries(specialFeatures).map(function (_ref2) {
|
|
16
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
|
17
|
+
featureKey = _ref3[0],
|
|
18
|
+
featureLabel = _ref3[1];
|
|
19
|
+
return item.fields[featureKey] == 1 && /*#__PURE__*/React__default.createElement(PillWrapper, {
|
|
20
|
+
key: featureKey
|
|
21
|
+
}, featureLabel);
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, orderedFields.map(function (field, index) {
|
|
25
|
+
var value = item.fields[field];
|
|
26
|
+
return /*#__PURE__*/React__default.createElement(Grid.Item, {
|
|
27
|
+
key: field,
|
|
28
|
+
className: "\n hc-hidden md:hc-block hc-px-2\n ".concat(index === 0 ? "hc-pl-7" : "", "\n ").concat(field.toLowerCase() === "position" ? "hc-col-span-4 hc-text-balance hc-font-semibold" : field.toLowerCase() === "state" || field.toLowerCase() == "favorite" ? "hc-col-span-1" : "hc-col-span-2", "\n ")
|
|
29
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
30
|
+
className: "hc-sr-only"
|
|
31
|
+
}, capitalize(field)), value, /*#__PURE__*/React__default.createElement("br", null), specialFeaturePills(field));
|
|
32
|
+
}));
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export { FieldMapperDesktop as default };
|
|
36
|
+
//# sourceMappingURL=field-mapper-desktop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-mapper-desktop.js","sources":["../../../../src/components/modules/list/field-mapper-desktop.jsx"],"sourcesContent":["import React from 'react';\nimport Grid from '~/components/modules/grid';\nimport PillWrapper from '~/components/modules/buttons/pill-wrapper';\nimport { capitalize } from '~/util/stringUtils';\n\nconst FieldMapperDesktop = ({\n\titem,\n\tfieldsShown,\n\tspecialFeatures\n}) => {\n\tconst orderedFields = fieldsShown.filter(field => field in item.fields);\n\n\tconst specialFeaturePills = field => {\n\t\treturn field === 'position' && specialFeatures &&\n Object.entries(specialFeatures).map(([featureKey, featureLabel]) => {\n \treturn item.fields[featureKey] == 1 && (\n \t\t<PillWrapper key={featureKey}>{featureLabel}</PillWrapper>\n \t);\n });\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t{orderedFields.map((field, index) => {\n\t\t\t\tlet value = item.fields[field];\n\t\t\t\treturn (\n\t\t\t\t\t<Grid.Item\n\t\t\t\t\t\tkey={field}\n\t\t\t\t\t\tclassName={`\n hc-hidden md:hc-block hc-px-2\n ${index === 0 ? \"hc-pl-7\" : \"\"}\n ${field.toLowerCase() === \"position\" ? \"hc-col-span-4 hc-text-balance hc-font-semibold\" : (field.toLowerCase() === \"state\" || field.toLowerCase() == \"favorite\") ? \"hc-col-span-1\" : \"hc-col-span-2\"}\n `}\n\t\t\t\t\t>\n\t\t\t\t\t\t<span className=\"hc-sr-only\">{capitalize(field)}</span>\n\t\t\t\t\t\t{value}\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\t{specialFeaturePills(field)}\n\t\t\t\t\t</Grid.Item>\n\t\t\t\t);\n\t\t\t})}\n\t\t</>\n\t);\n};\n\nexport default FieldMapperDesktop;"],"names":["FieldMapperDesktop","_ref","item","fieldsShown","specialFeatures","orderedFields","filter","field","fields","specialFeaturePills","Object","entries","map","_ref2","_ref3","_slicedToArray","featureKey","featureLabel","React","createElement","PillWrapper","key","Fragment","index","value","Grid","Item","className","concat","toLowerCase","capitalize"],"mappings":";;;;;;AAKA,IAAMA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAAC,IAAA,EAIlB;AAAA,EAAA,IAHLC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IACJC,WAAW,GAAAF,IAAA,CAAXE,WAAW;IACXC,eAAe,GAAAH,IAAA,CAAfG,eAAe,C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,KAAK,UAAU,GAAG,gDAAgD,GAAItB,KAAK,CAACsB,WAAW,EAAE,KAAK,OAAO,IAAItB,KAAK,CAACsB,WAAW,EAAE,IAAI,UAAU,GAAI,eAAe,GAAG,eAAe,EAAA,gBAAA,CAAA;KAG5MX,eAAAA,cAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AAAMQ,MAAAA,SAAS,EAAC,YAAA;AAAY,KAAA,EAAEG,UAAU,CAACvB,KAAK,CAAQ,CAAC,EACtDiB,KAAK,eACNN,cAAA,CAAAC,aAAA,WAAK,CAAC,EACLV,mBAAmB,CAACF,KAAK,CAChB,CAAC,CAAA;AAEd,GAAC,CACA,CAAC,CAAA;AAEL;;;;"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { slicedToArray as _slicedToArray } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import Grid from '../grid.js';
|
|
4
|
+
import IconContained from '../icon.js';
|
|
5
|
+
import { PillWrapper } from '../buttons/pill-wrapper.js';
|
|
6
|
+
|
|
7
|
+
var FieldMapperMobile = function FieldMapperMobile(_ref) {
|
|
8
|
+
var item = _ref.item,
|
|
9
|
+
fieldsShown = _ref.fieldsShown,
|
|
10
|
+
specialFeatures = _ref.specialFeatures,
|
|
11
|
+
handleFavouriteClick = _ref.handleFavouriteClick,
|
|
12
|
+
isFavorite = _ref.isFavorite,
|
|
13
|
+
_ref$includeFavorite = _ref.includeFavorite,
|
|
14
|
+
includeFavorite = _ref$includeFavorite === void 0 ? true : _ref$includeFavorite;
|
|
15
|
+
var specialFeaturePills = function specialFeaturePills(field) {
|
|
16
|
+
return field === 'position' && specialFeatures && Object.entries(specialFeatures).map(function (_ref2) {
|
|
17
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
|
18
|
+
featureKey = _ref3[0],
|
|
19
|
+
featureLabel = _ref3[1];
|
|
20
|
+
return item.fields[featureKey] == 1 && /*#__PURE__*/React__default.createElement(PillWrapper, {
|
|
21
|
+
key: featureKey
|
|
22
|
+
}, featureLabel);
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
return /*#__PURE__*/React__default.createElement(Grid.Item, {
|
|
26
|
+
className: "md:hc-hidden"
|
|
27
|
+
}, fieldsShown.includes("position") && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
28
|
+
className: "hc-flex hc-items-start"
|
|
29
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
30
|
+
className: "hc-flex hc-justify-between hc-items-center hc-min-w-[100%]"
|
|
31
|
+
}, /*#__PURE__*/React__default.createElement("h3", {
|
|
32
|
+
className: "hc-font-bold hc-mb-3 hc-flex-1"
|
|
33
|
+
}, item.fields.position), includeFavorite && /*#__PURE__*/React__default.createElement("div", {
|
|
34
|
+
className: "hc-flex hc-justify-end hc-pb-2"
|
|
35
|
+
}, /*#__PURE__*/React__default.createElement(IconContained, {
|
|
36
|
+
icon: isFavorite ? "mdi:heart" : "mdi:heart-outline",
|
|
37
|
+
size: "hc-size-3.5",
|
|
38
|
+
iconClasses: isFavorite ? "hc-text-primary" : "",
|
|
39
|
+
className: "hc-transition-opacity hc-duration-300 hc-cursor-pointer\n ".concat(isFavorite ? "hc-opacity-100" : "hc-text-uiText/60 group-hover:hc-opacity-100", "\n "),
|
|
40
|
+
onClick: function onClick(e) {
|
|
41
|
+
return handleFavouriteClick(e, item);
|
|
42
|
+
}
|
|
43
|
+
})))), specialFeatures && /*#__PURE__*/React__default.createElement("div", {
|
|
44
|
+
className: "hc-pb-4"
|
|
45
|
+
}, specialFeaturePills("position"), " ")), /*#__PURE__*/React__default.createElement("ul", {
|
|
46
|
+
className: "hc-space-y-2 hc-text-xs"
|
|
47
|
+
}, [{
|
|
48
|
+
field: "categoryClass",
|
|
49
|
+
name: "categoryClass",
|
|
50
|
+
icon: "icon-park-solid:tree-list"
|
|
51
|
+
}, {
|
|
52
|
+
field: "category",
|
|
53
|
+
name: "Category",
|
|
54
|
+
icon: "icon-park-solid:tree-list"
|
|
55
|
+
}, {
|
|
56
|
+
field: "schedule",
|
|
57
|
+
name: "Schedule",
|
|
58
|
+
icon: "gravity-ui:clock-fill"
|
|
59
|
+
}, {
|
|
60
|
+
field: "city",
|
|
61
|
+
name: "Location",
|
|
62
|
+
icon: "fluent:location-16-filled"
|
|
63
|
+
}, {
|
|
64
|
+
field: "state",
|
|
65
|
+
name: "Location",
|
|
66
|
+
icon: "fluent:location-16-filled"
|
|
67
|
+
}, {
|
|
68
|
+
field: "cityState",
|
|
69
|
+
name: "Location",
|
|
70
|
+
icon: "fluent:location-16-filled"
|
|
71
|
+
}, {
|
|
72
|
+
field: "travelTime",
|
|
73
|
+
name: "Commute",
|
|
74
|
+
icon: "ri:pin-distance-fill"
|
|
75
|
+
}].map(function (listItem) {
|
|
76
|
+
return fieldsShown.includes(listItem.field) && item.fields[listItem.field] && /*#__PURE__*/React__default.createElement("li", {
|
|
77
|
+
key: listItem.field,
|
|
78
|
+
className: "hc-flex hc-gap-2"
|
|
79
|
+
}, /*#__PURE__*/React__default.createElement(IconContained, {
|
|
80
|
+
icon: listItem.icon,
|
|
81
|
+
size: "hc-size-3.5",
|
|
82
|
+
className: "hc-text-uiAccent/30"
|
|
83
|
+
}), /*#__PURE__*/React__default.createElement("span", {
|
|
84
|
+
className: "hc-sr-only"
|
|
85
|
+
}, listItem.name), item.fields[listItem.field]);
|
|
86
|
+
})));
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export { FieldMapperMobile as default };
|
|
90
|
+
//# sourceMappingURL=field-mapper-mobile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-mapper-mobile.js","sources":["../../../../src/components/modules/list/field-mapper-mobile.jsx"],"sourcesContent":["import React from 'react';\nimport Grid from '~/components/modules/grid';\nimport Icon from '~/components/modules/icon';\nimport PillWrapper from '~/components/modules/buttons/pill-wrapper';\n\nconst FieldMapperMobile = ({\n item,\n fieldsShown,\n specialFeatures,\n handleFavouriteClick,\n isFavorite,\n includeFavorite = true\n}) => {\n const specialFeaturePills = field => {\n return field === 'position' && specialFeatures &&\n Object.entries(specialFeatures).map(([featureKey, featureLabel]) => {\n return item.fields[featureKey] == 1 && (\n <PillWrapper key={featureKey}>{featureLabel}</PillWrapper>\n );\n });\n };\n\n return (\n <Grid.Item className=\"md:hc-hidden\">\n {fieldsShown.includes(\"position\") &&\n <>\n <div className=\"hc-flex hc-items-start\">\n <div className=\"hc-flex hc-justify-between hc-items-center hc-min-w-[100%]\">\n <h3 className=\"hc-font-bold hc-mb-3 hc-flex-1\">{item.fields.position}</h3>\n {includeFavorite && <div className=\"hc-flex hc-justify-end hc-pb-2\">\n <Icon\n icon={isFavorite ? \"mdi:heart\" : \"mdi:heart-outline\"}\n size=\"hc-size-3.5\"\n iconClasses={isFavorite ? \"hc-text-primary\" : \"\"}\n className={`hc-transition-opacity hc-duration-300 hc-cursor-pointer\n ${isFavorite ? \"hc-opacity-100\" : \"hc-text-uiText/60 group-hover:hc-opacity-100\"}\n `}\n onClick={e => handleFavouriteClick(e, item)}\n />\n </div>\n }\n </div>\n </div>\n {specialFeatures && <div className='hc-pb-4'>{specialFeaturePills(\"position\", true)} </div>}\n </>\n }\n\n <ul className=\"hc-space-y-2 hc-text-xs\">\n {[\n {\n field: \"categoryClass\",\n name: \"categoryClass\",\n icon: \"icon-park-solid:tree-list\"\n },\n {\n field: \"category\",\n name: \"Category\",\n icon: \"icon-park-solid:tree-list\"\n },\n {\n field: \"schedule\",\n name: \"Schedule\",\n icon: \"gravity-ui:clock-fill\"\n },\n {\n field: \"city\",\n name: \"Location\",\n icon: \"fluent:location-16-filled\"\n },\n {\n field: \"state\",\n name: \"Location\",\n icon: \"fluent:location-16-filled\"\n },\n {\n field: \"cityState\",\n name: \"Location\",\n icon: \"fluent:location-16-filled\"\n },\n {\n field: \"travelTime\",\n name: \"Commute\",\n icon: \"ri:pin-distance-fill\"\n }\n ].map(listItem => (\n (fieldsShown.includes(listItem.field) && item.fields[listItem.field]) &&\n <li\n key={listItem.field}\n className=\"hc-flex hc-gap-2\"\n >\n <Icon\n icon={listItem.icon}\n size=\"hc-size-3.5\"\n className=\"hc-text-uiAccent/30\"\n />\n <span className=\"hc-sr-only\">{listItem.name}</span>\n {item.fields[listItem.field]}\n </li>\n ))}\n </ul>\n </Grid.Item>\n );\n};\n\nexport default FieldMapperMobile;"],"names":["FieldMapperMobile","_ref","item","fieldsShown","specialFeatures","handleFavouriteClick","isFavorite","_ref$includeFavorite","includeFavorite","specialFeaturePills","field","Object","entries","map","_ref2","_ref3","_slicedToArray","featureKey","featureLabel","fields","React","createElement","PillWrapper","key","Grid","Item","className","includes","Fragment","position","Icon","icon","size","iconClasses","concat","onClick","e","name","listItem"],"mappings":";;;;;;AAKA,IAAMA,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAAC,IAAA,EAOjB;AAAA,EAAA,IANJC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IACJC,WAAW,GAAAF,IAAA,CAAXE,WAAW;IACXC,eAAe,GAAAH,IAAA,CAAfG,eAAe;IACfC,oBAAoB,GAAAJ,IAAA,CAApBI,oBAAoB;IACpBC,UAAU,GAAAL,IAAA,CAAVK,UAAU;IAAAC,oBAAA,GAAAN,IAAA,CACVO,eAAe;AAAfA,IAAAA,eAAe,GAAAD,oBAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,oBAAA,CAAA;AAEtB,EAAA,IAAME,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAGC,KAAK,EAAI;AACnC,IAAA,OAAOA,KAAK,KAAK,UAAU,IAAIN,eAAe,IAC5CO,MAAM,CAACC,OAAO,CAACR,eAAe,CAAC,CAACS,GAAG,CAAC,UAAAC,KAAA,EAAgC;AAAA,MAAA,IAAAC,KAAA,GAAAC,cAAA,CAAAF,KAAA,EAAA,CAAA,CAAA;AAA9BG,QAAAA,UAAU,GAAAF,KAAA,CAAA,CAAA,CAA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C,UAAAyB,QAAQ,EAAA;IAAA,OACXnC,WAAW,CAACwB,QAAQ,CAACW,QAAQ,CAAC5B,KAAK,CAAC,IAAIR,IAAI,CAACiB,MAAM,CAACmB,QAAQ,CAAC5B,KAAK,CAAC,iBACpEU,cAAA,CAAAC,aAAA,CAAA,IAAA,EAAA;MACEE,GAAG,EAAEe,QAAQ,CAAC5B,KAAM;AACpBgB,MAAAA,SAAS,EAAC,kBAAA;AAAkB,KAAA,eAE5BN,cAAA,CAAAC,aAAA,CAACS,aAAI,EAAA;MACHC,IAAI,EAAEO,QAAQ,CAACP,IAAK;AACpBC,MAAAA,IAAI,EAAC,aAAa;AAClBN,MAAAA,SAAS,EAAC,qBAAA;AAAqB,KAChC,CAAC,eACFN,cAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AAAMK,MAAAA,SAAS,EAAC,YAAA;AAAY,KAAA,EAAEY,QAAQ,CAACD,IAAW,CAAC,EAClDnC,IAAI,CAACiB,MAAM,CAACmB,QAAQ,CAAC5B,KAAK,CACzB,CAAC,CAAA;GACN,CACC,CACK,CAAC,CAAA;AAEhB;;;;"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import Grid from '../../grid.js';
|
|
3
|
+
import IconContained from '../../icon.js';
|
|
4
|
+
import FieldMapper from '../field-mapper-desktop.js';
|
|
5
|
+
|
|
6
|
+
var ListItemDesktop = function ListItemDesktop(_ref) {
|
|
7
|
+
var isActive = _ref.isActive,
|
|
8
|
+
bodyClassName = _ref.bodyClassName,
|
|
9
|
+
item = _ref.item,
|
|
10
|
+
fieldsShown = _ref.fieldsShown,
|
|
11
|
+
specialFeatures = _ref.specialFeatures,
|
|
12
|
+
isFavorite = _ref.isFavorite,
|
|
13
|
+
includeFavorite = _ref.includeFavorite,
|
|
14
|
+
handleFavouriteClick = _ref.handleFavouriteClick;
|
|
15
|
+
return /*#__PURE__*/React__default.createElement(Grid, {
|
|
16
|
+
columns: "hc-pl-2 hc-md-pl-0 hc-grid-flow-col hc-auto-cols-fr",
|
|
17
|
+
gap: "hc-gap-0",
|
|
18
|
+
className: "\n hc-hidden md:hc-grid hc-py-2 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 ")
|
|
19
|
+
}, /*#__PURE__*/React__default.createElement(Grid.Item, {
|
|
20
|
+
className: "md:hc-absolute md:hc-left-1.5 hc-top-1.5"
|
|
21
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
22
|
+
className: "hc-sr-only"
|
|
23
|
+
}, "Expand row"), /*#__PURE__*/React__default.createElement(IconContained, {
|
|
24
|
+
icon: "fluent-emoji-high-contrast:plus",
|
|
25
|
+
size: "hc-size-2.5",
|
|
26
|
+
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 ")
|
|
27
|
+
})), /*#__PURE__*/React__default.createElement(FieldMapper, {
|
|
28
|
+
item: item,
|
|
29
|
+
fieldsShown: fieldsShown,
|
|
30
|
+
specialFeatures: specialFeatures,
|
|
31
|
+
isFavorite: isFavorite,
|
|
32
|
+
includeFavorite: includeFavorite,
|
|
33
|
+
handleFavouriteClick: handleFavouriteClick
|
|
34
|
+
}), includeFavorite && /*#__PURE__*/React__default.createElement(Grid.Item, {
|
|
35
|
+
key: "favorites",
|
|
36
|
+
className: "hc-col-span-1 hc-px-2"
|
|
37
|
+
}, /*#__PURE__*/React__default.createElement(IconContained, {
|
|
38
|
+
icon: isFavorite ? "mdi:heart" : "mdi:heart-outline",
|
|
39
|
+
size: "hc-size-3.5",
|
|
40
|
+
iconClasses: isFavorite ? "hc-text-primary" : "",
|
|
41
|
+
title: !isFavorite ? 'Add job to favorites' : 'Remove job from favorites',
|
|
42
|
+
className: "hc-pr-2 hc-transition-opacity hc-duration-300 hc-cursor-pointer hc-opacity-100",
|
|
43
|
+
onClick: function onClick(e) {
|
|
44
|
+
handleFavouriteClick(e, item);
|
|
45
|
+
}
|
|
46
|
+
})));
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export { ListItemDesktop as default };
|
|
50
|
+
//# sourceMappingURL=list-item-desktop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-item-desktop.js","sources":["../../../../../src/components/modules/list/list-item/list-item-desktop.jsx"],"sourcesContent":["import React from 'react';\nimport Grid from '~/components/modules/grid';\nimport Icon from '~/components/modules/icon';\nimport FieldMapper from '~/components/modules/list/field-mapper-desktop';\n\nconst ListItemDesktop = ({\n\tisActive,\n\tbodyClassName,\n\titem,\n\tfieldsShown,\n\tspecialFeatures,\n\tisFavorite,\n\tincludeFavorite,\n\thandleFavouriteClick\n}) => {\n\treturn (\n\t\t<Grid\n\t\t\tcolumns=\"hc-pl-2 hc-md-pl-0 hc-grid-flow-col hc-auto-cols-fr\"\n\t\t\tgap=\"hc-gap-0\"\n\t\t\tclassName={`\n hc-hidden md:hc-grid hc-py-2 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>\n\t\t\t<Grid.Item className=\"md:hc-absolute md:hc-left-1.5 hc-top-1.5\">\n\t\t\t\t<span className=\"hc-sr-only\">Expand row</span>\n\t\t\t\t<Icon\n\t\t\t\t\ticon=\"fluent-emoji-high-contrast:plus\"\n\t\t\t\t\tsize=\"hc-size-2.5\"\n\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/>\n\t\t\t</Grid.Item>\n\t\t\t<FieldMapper\n\t\t\t\titem={item}\n\t\t\t\tfieldsShown={fieldsShown}\n\t\t\t\tspecialFeatures={specialFeatures}\n\t\t\t\tisFavorite={isFavorite}\n\t\t\t\tincludeFavorite={includeFavorite}\n\t\t\t\thandleFavouriteClick={handleFavouriteClick}\n\t\t\t/>\n\t\t\t{includeFavorite &&\n <Grid.Item\n \tkey={\"favorites\"}\n \tclassName=\"hc-col-span-1 hc-px-2\"\n >\n \t<Icon\n \t\ticon={isFavorite ? \"mdi:heart\" : \"mdi:heart-outline\"}\n \t\tsize=\"hc-size-3.5\"\n \t\ticonClasses={isFavorite ? \"hc-text-primary\" : \"\"}\n \t\ttitle={!isFavorite ? 'Add job to favorites' : 'Remove job from favorites'}\n \t\tclassName=\"hc-pr-2 hc-transition-opacity hc-duration-300 hc-cursor-pointer hc-opacity-100\"\n \t\tonClick={e => {handleFavouriteClick(e, item);}}\n \t/>\n </Grid.Item>\n\t\t\t}\n\t\t</Grid>\n\t);\n};\n\nexport default ListItemDesktop;"],"names":["ListItemDesktop","_ref","isActive","bodyClassName","item","fieldsShown","specialFeatures","isFavorite","includeFavorite","handleFavouriteClick","React","createElement","Grid","columns","gap","className","concat","Item","Icon","icon","size","FieldMapper","key","iconClasses","title","onClick","e"],"mappings":";;;;;AAKA,IAAMA,eAAe,GAAG,SAAlBA,eAAeA,CAAAC,IAAA,EASf;AAAA,EAAA,IARLC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IACRC,aAAa,GAAAF,IAAA,CAAbE,aAAa;IACbC,IAAI,GAAAH,IAAA,CAAJG,IAAI;IACJC,WAAW,GAAAJ,IAAA,CAAXI,WAAW;IACXC,eAAe,GAAAL,IAAA,CAAfK,eAAe;IACfC,UAAU,GAAAN,IAAA,CAAVM,UAAU;IACVC,eAAe,GAAAP,IAAA,CAAfO,eAAe;IACfC,oBAAoB,GAAAR,IAAA,CAApBQ,oBAAoB,CAAA;AAEpB,EAAA,oBACCC,cAAA,CAAAC,aAAA,CAACC,IAAI,EAAA;AACJC,IAAAA,OAAO,EAAC,qDAAqD;AAC7DC,IAAAA,GAAG,EAAC,UAAU;IACdC,SAAS,EA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A4B;AAC1EQ,IAAAA,SAAS,EAAC,gFAAgF;AAC1FU,IAAAA,OAAO,EAAE,SAAAA,OAAAC,CAAAA,CAAC,EAAI;AAACjB,MAAAA,oBAAoB,CAACiB,CAAC,EAAEtB,IAAI,CAAC,CAAA;AAAC,KAAA;GAC7C,CACS,CAEX,CAAC,CAAA;AAET;;;;"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import Grid from '../../grid.js';
|
|
3
|
+
import FieldMapperMobile from '../field-mapper-mobile.js';
|
|
4
|
+
|
|
5
|
+
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
6
|
+
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
|
7
|
+
var ListItemMobile = function ListItemMobile(_ref) {
|
|
8
|
+
var _item$mapDetails, _item$mapDetails2, _item$mapDetails3, _item$mapDetails4;
|
|
9
|
+
var bodyClassName = _ref.bodyClassName,
|
|
10
|
+
item = _ref.item,
|
|
11
|
+
fieldsShown = _ref.fieldsShown,
|
|
12
|
+
specialFeatures = _ref.specialFeatures,
|
|
13
|
+
isFavorite = _ref.isFavorite,
|
|
14
|
+
includeFavorite = _ref.includeFavorite,
|
|
15
|
+
handleFavouriteClick = _ref.handleFavouriteClick,
|
|
16
|
+
showMap = _ref.showMap,
|
|
17
|
+
setMobileTab = _ref.setMobileTab,
|
|
18
|
+
onItemSelected = _ref.onItemSelected,
|
|
19
|
+
siteConfig = _ref.siteConfig;
|
|
20
|
+
var mapPinColor = !showMap ? null : siteConfig.colors.primary.replace("#", "");
|
|
21
|
+
var handleClick = function handleClick() {
|
|
22
|
+
if (onItemSelected) {
|
|
23
|
+
onItemSelected(item);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Grid, {
|
|
27
|
+
columns: "hc-pl-2 hc-grid-flow-col hc-auto-cols-fr",
|
|
28
|
+
gap: "hc-gap-0",
|
|
29
|
+
className: "\n hc-block md:hc-hidden hc-py-2 hc-w-full hc-grow hc-leading-tight hc-text-sm\n ".concat(bodyClassName !== null && bodyClassName !== void 0 ? bodyClassName : "", "\n ")
|
|
30
|
+
}, /*#__PURE__*/React__default.createElement(FieldMapperMobile, {
|
|
31
|
+
item: item,
|
|
32
|
+
fieldsShown: fieldsShown,
|
|
33
|
+
specialFeatures: specialFeatures,
|
|
34
|
+
isFavorite: isFavorite,
|
|
35
|
+
includeFavorite: includeFavorite,
|
|
36
|
+
handleFavouriteClick: handleFavouriteClick
|
|
37
|
+
})), showMap && /*#__PURE__*/React__default.createElement("div", {
|
|
38
|
+
onClick: function onClick() {
|
|
39
|
+
setMobileTab("mapTab");
|
|
40
|
+
handleClick();
|
|
41
|
+
},
|
|
42
|
+
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"
|
|
43
|
+
}, /*#__PURE__*/React__default.createElement("img", {
|
|
44
|
+
src: "https://maps.googleapis.com/maps/api/staticmap?scale=2¢er=".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"),
|
|
45
|
+
alt: "Map of location for ".concat(item.fields.position),
|
|
46
|
+
className: "hc-w-full hc-h-full hc-object-cover"
|
|
47
|
+
})));
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export { ListItemMobile as default };
|
|
51
|
+
//# sourceMappingURL=list-item-mobile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-item-mobile.js","sources":["../../../../../src/components/modules/list/list-item/list-item-mobile.jsx"],"sourcesContent":["/* eslint-disable jsx-a11y/no-static-element-interactions */\n/* eslint-disable jsx-a11y/click-events-have-key-events */\nimport React from 'react';\nimport Grid from '~/components/modules/grid';\nimport FieldMapper from '~/components/modules/list/field-mapper-mobile';\n\nconst ListItemMobile = ({\n\tbodyClassName,\n\titem,\n\tfieldsShown,\n\tspecialFeatures,\n\tisFavorite,\n\tincludeFavorite,\n\thandleFavouriteClick,\n\tshowMap,\n\tsetMobileTab,\n\tonItemSelected,\n\tsiteConfig\n}) => {\n\tconst mapPinColor = !showMap ? null : siteConfig.colors.primary.replace(\"#\", \"\");\n\n\tconst handleClick = () => {\n\t\tif (onItemSelected) {\n\t\t\tonItemSelected(item);\n\t\t}\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<Grid\n\t\t\t\tcolumns=\"hc-pl-2 hc-grid-flow-col hc-auto-cols-fr\"\n\t\t\t\tgap=\"hc-gap-0\"\n\t\t\t\tclassName={`\n hc-block md:hc-hidden hc-py-2 hc-w-full hc-grow hc-leading-tight hc-text-sm\n ${bodyClassName ?? \"\"}\n `}\n\t\t\t>\n\t\t\t\t<FieldMapper\n\t\t\t\t\titem={item}\n\t\t\t\t\tfieldsShown={fieldsShown}\n\t\t\t\t\tspecialFeatures={specialFeatures}\n\t\t\t\t\tisFavorite={isFavorite}\n\t\t\t\t\tincludeFavorite={includeFavorite}\n\t\t\t\t\thandleFavouriteClick={handleFavouriteClick}\n\t\t\t\t/>\n\t\t\t</Grid>\n\n\t\t\t{showMap && (\n\t\t\t\t<div\n\t\t\t\t\tonClick={() => { setMobileTab(\"mapTab\"); handleClick(); }}\n\t\t\t\t\tclassName=\"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>\n\t\t\t\t\t<img\n\t\t\t\t\t\tsrc={`https://maps.googleapis.com/maps/api/staticmap?scale=2¢er=${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\talt={`Map of location for ${item.fields.position}`}\n\t\t\t\t\t\tclassName=\"hc-w-full hc-h-full hc-object-cover\"\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</>\n\t);\n};\n\nexport default ListItemMobile;"],"names":["ListItemMobile","_ref","_item$mapDetails","_item$mapDetails2","_item$mapDetails3","_item$mapDetails4","bodyClassName","item","fieldsShown","specialFeatures","isFavorite","includeFavorite","handleFavouriteClick","showMap","setMobileTab","onItemSelected","siteConfig","mapPinColor","colors","primary","replace","handleClick","React","createElement","Fragment","Grid","columns","gap","className","concat","FieldMapper","onClick","src","mapDetails","latitude","longitude","alt","fields","position"],"mappings":";;;;AAAA;AACA;AAKA,IAAMA,cAAc,GAAG,SAAjBA,cAAcA,CAAAC,IAAA,EAYd;AAAA,EAAA,IAAAC,gBAAA,EAAAC,iBAAA,EAAAC,iBAAA,EAAAC,iBAAA,CAAA;AAAA,EAAA,IAXLC,aAAa,GAAAL,IAAA,CAAbK,aAAa;IACbC,IAAI,GAAAN,IAAA,CAAJM,IAAI;IACJC,WAAW,GAAAP,IAAA,CAAXO,WAAW;IACXC,eAAe,GAAAR,IAAA,CAAfQ,eAAe;IACfC,UAAU,GAAAT,IAAA,CAAVS,UAAU;IACVC,eAAe,GAAAV,IAAA,CAAfU,eAAe;IACfC,oBAAoB,GAAAX,IAAA,CAApBW,oBAAoB;IACpBC,OAAO,GAAAZ,IAAA,CAAPY,OAAO;IAC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,cAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AACCS,IAAAA,GAAG,EAAAH,gEAAAA,CAAAA,MAAA,CAAA3B,CAAAA,gBAAA,GAAmEK,IAAI,CAAC0B,UAAU,MAAA/B,IAAAA,IAAAA,gBAAA,KAAfA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,gBAAA,CAAiBgC,QAAQ,EAAAL,GAAAA,CAAAA,CAAAA,MAAA,CAAA1B,CAAAA,iBAAA,GAAII,IAAI,CAAC0B,UAAU,MAAA9B,IAAAA,IAAAA,iBAAA,KAAfA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,iBAAA,CAAiBgC,SAAS,4DAAAN,MAAA,CAAyDZ,WAAW,EAAA,oBAAA,CAAA,CAAAY,MAAA,CAAA,CAAAzB,iBAAA,GAAgBG,IAAI,CAAC0B,UAAU,MAAA,IAAA,IAAA7B,iBAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAfA,iBAAA,CAAiB8B,QAAQ,EAAA,GAAA,CAAA,CAAAL,MAAA,CAAA,CAAAxB,iBAAA,GAAIE,IAAI,CAAC0B,UAAU,MAAA,IAAA,IAAA5B,iBAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAfA,iBAAA,CAAiB8B,SAAS,EAAA,OAAA,EAAQ,yCAA+B,CAAG;IAClTC,GAAG,EAAA,sBAAA,CAAAP,MAAA,CAAyBtB,IAAI,CAAC8B,MAAM,CAACC,QAAQ,CAAG;AACnDV,IAAAA,SAAS,EAAC,qCAAA;GACV,CACG,CAEL,CAAC,CAAA;AAEL;;;;"}
|
|
@@ -2,7 +2,8 @@ import { objectWithoutProperties as _objectWithoutProperties, extends as _extend
|
|
|
2
2
|
import React__default, { forwardRef } from 'react';
|
|
3
3
|
import Grid from '../../grid.js';
|
|
4
4
|
import IconContained from '../../icon.js';
|
|
5
|
-
import
|
|
5
|
+
import FieldMapperDesktop from '../field-mapper-desktop.js';
|
|
6
|
+
import FieldMapperMobile from '../field-mapper-mobile.js';
|
|
6
7
|
|
|
7
8
|
var _excluded = ["isActive", "bodyClassName", "className", "item", "fieldsShown", "specialFeatures", "onItemSelected", "showMap", "setMobileTab", "handleSettingFavorites", "favorites", "includeFavorite", "siteConfig"];
|
|
8
9
|
var ListItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
@@ -61,14 +62,24 @@ var ListItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
61
62
|
icon: "fluent-emoji-high-contrast:plus",
|
|
62
63
|
size: "hc-size-2.5",
|
|
63
64
|
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 ")
|
|
64
|
-
})), /*#__PURE__*/React__default.createElement(
|
|
65
|
+
})), /*#__PURE__*/React__default.createElement(FieldMapperDesktop, {
|
|
65
66
|
item: item,
|
|
66
67
|
fieldsShown: fieldsShown,
|
|
67
68
|
specialFeatures: specialFeatures,
|
|
68
69
|
isFavorite: isFavorite,
|
|
69
70
|
includeFavorite: includeFavorite,
|
|
70
71
|
handleFavouriteClick: handleFavouriteClick
|
|
71
|
-
}),
|
|
72
|
+
}), /*#__PURE__*/React__default.createElement(FieldMapperMobile, {
|
|
73
|
+
item: item,
|
|
74
|
+
fieldsShown: fieldsShown,
|
|
75
|
+
specialFeatures: specialFeatures,
|
|
76
|
+
isFavorite: isFavorite,
|
|
77
|
+
includeFavorite: includeFavorite,
|
|
78
|
+
handleFavouriteClick: handleFavouriteClick
|
|
79
|
+
}), includeFavorite &&
|
|
80
|
+
/*#__PURE__*/
|
|
81
|
+
/* DESKTOP ONLY: This favorites icon is hidden on mobile (hc-hidden) and visible on desktop (md:hc-block) */
|
|
82
|
+
React__default.createElement(Grid.Item, {
|
|
72
83
|
key: "favorites",
|
|
73
84
|
className: "hc-hidden md:hc-block hc-col-span-1 hc-px-2"
|
|
74
85
|
}, /*#__PURE__*/React__default.createElement(IconContained, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-item.js","sources":["../../../../../src/components/modules/list/list-item/list-item.js"],"sourcesContent":["import React, { forwardRef } 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 = true,\n\t\t\tsiteConfig,\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\t\t\t\thc-group hc-relative hc-flex md:hc-flex-col hc-w-full 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${isActive ? \"hc-bg-uiAccent/5 hc-border-secondary hc-border\" : \"hc-text-uiText hc-bg-white\"}\n\t\t\t\t${className ?? \"\"}\n\t\t\t\t`}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t<Grid\n\t\t\t\t\tcolumns=\"hc-pl-2 hc-md-pl-0 hc-grid-flow-col hc-auto-cols-fr\"\n\t\t\t\t\tgap=\"hc-gap-0\"\n\t\t\t\t\tclassName={`\n hc-block md:hc-grid hc-py-2 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 hc-px-2\"\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¢er=${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\tprevProps.item.fields.travelTime === nextProps.item.fields.travelTime &&\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","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","Item","Icon","icon","size","FieldMapper","key","iconClasses","title","e","src","mapDetails","latitude","longitude","alt","fields","position","displayName","memo","prevProps","nextProps","travelTime"],"mappings":";;;;;;;AAKA,IAAMA,QAAQ,gBAAGC,UAAU,CAC1B,UAAAC,IAAA,EAiBCC,GAAG,EACC;AAAA,EAAA,IAAAC,gBAAA,EAAAC,iBAAA,EAAAC,iBAAA,EAAAC,iBAAA,CAAA;AAAA,EAAA,IAhBHC,QAAQ,GAAAN,IAAA,CAARM,QAAQ;IACRC,aAAa,GAAAP,IAAA,CAAbO,aAAa;IACbC,SAAS,GAAAR,IAAA,CAATQ,SAAS;IACTC,IAAI,GAAAT,IAAA,CAAJS,IAAI;IACJC,WAAW,GAAAV,IAAA,CAAXU,WAAW;IACXC,eAAe,GAAAX,IAAA,CAAfW,eAAe;IACfC,cAAc,GAAAZ,IAAA,CAAdY,cAAc;IACdC,OAAO,GAAAb,IAAA,CAAPa,OAAO;IACPC,YAAY,GAAAd,IAAA,CAAZc,YAAY;IACZC,sBAAsB,GAAAf,IAAA,CAAtBe,sBAAsB;IACtBC,SAAS,GAAAhB,IAAA,CAATgB,SAAS;IAAAC,oBAAA,GAAAjB,IAAA,CACTkB,eAAe;AAAfA,IAAAA,eAAe,GAAAD,oBAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,oBAAA;IACtBE,U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yD,SAAS,CAACxD,SAAS,KAAKyD,SAAS,CAACzD,SAAS,CAAA;AAE/C,CAAC,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"list-item.js","sources":["../../../../../src/components/modules/list/list-item/list-item.jsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport Grid from '~/components/modules/grid';\nimport Icon from '~/components/modules/icon';\nimport FieldMapper from '~/components/modules/list/field-mapper-desktop';\nimport FieldMapperMobile from '~/components/modules/list/field-mapper-mobile';\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 = true,\n\t\t\tsiteConfig,\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\t\t\t\thc-group hc-relative hc-flex md:hc-flex-col hc-w-full 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${isActive ? \"hc-bg-uiAccent/5 hc-border-secondary hc-border\" : \"hc-text-uiText hc-bg-white\"}\n\t\t\t\t${className ?? \"\"}\n\t\t\t\t`}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{/* This Grid is displayed as block on mobile and grid on desktop */}\n\t\t\t\t<Grid\n\t\t\t\t\tcolumns=\"hc-pl-2 hc-md-pl-0 hc-grid-flow-col hc-auto-cols-fr\"\n\t\t\t\t\tgap=\"hc-gap-0\"\n\t\t\t\t\tclassName={`\n hc-block md:hc-grid hc-py-2 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{/* DESKTOP ONLY: This expand icon is hidden on mobile (hc-hidden) and visible on desktop (md:hc-block) */}\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<FieldMapperMobile\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/* DESKTOP ONLY: This favorites icon is hidden on mobile (hc-hidden) and visible on desktop (md:hc-block) */\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 hc-px-2\"\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{/* MOBILE ONLY: This map section is visible on mobile and hidden on desktop (md:hc-hidden) */}\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¢er=${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\tprevProps.item.fields.travelTime === nextProps.item.fields.travelTime &&\n prevProps.fieldsShown === nextProps.fieldsShown &&\n prevProps.bodyClassName === nextProps.bodyClassName &&\n prevProps.className === nextProps.className\n\t);\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","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","Item","Icon","icon","size","FieldMapper","FieldMapperMobile","key","iconClasses","title","e","src","mapDetails","latitude","longitude","alt","fields","position","displayName","memo","prevProps","nextProps","travelTime"],"mappings":";;;;;;;;AAKA,IAAMA,QAAQ,gBAAGC,UAAU,CAC1B,UAAAC,IAAA,EAiBCC,GAAG,EACC;AAAA,EAAA,IAAAC,gBAAA,EAAAC,iBAAA,EAAAC,iBAAA,EAAAC,iB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,CAACgD,UAAU,MAAA,IAAA,IAAApD,iBAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAfA,iBAAA,CAAiBsD,SAAS,EAAA,OAAA,EAAQ,yCAA+B,CAAG;IAClTC,GAAG,EAAA,sBAAA,CAAAvB,MAAA,CAAyB5B,IAAI,CAACoD,MAAM,CAACC,QAAQ,CAAG;AACnDtD,IAAAA,SAAS,EAAC,qCAAA;GACV,CACG,CAEC,CAAC,CAAA;AAEX,CACD,CAAC,CAAA;AAEDV,QAAQ,CAACiE,WAAW,GAAG,UAAU,CAAA;AAEjC,iBAAexB,aAAAA,cAAK,CAACyB,IAAI,CAAClE,QAAQ,EAAE,UAACmE,SAAS,EAAEC,SAAS,EAAK;AAC7D,EAAA,OACCD,SAAS,CAAC3D,QAAQ,KAAK4D,SAAS,CAAC5D,QAAQ,IACzC2D,SAAS,CAACjD,SAAS,KAAKkD,SAAS,CAAClD,SAAS,IACzCiD,SAAS,CAACxD,IAAI,CAACqB,EAAE,KAAKoC,SAAS,CAACzD,IAAI,CAACqB,EAAE,IAC1CmC,SAAS,CAACxD,IAAI,CAACoD,MAAM,CAACM,UAAU,KAAKD,SAAS,CAACzD,IAAI,CAACoD,MAAM,CAACM,UAAU,IAClEF,SAAS,CAACvD,WAAW,KAAKwD,SAAS,CAACxD,WAAW,IAC/CuD,SAAS,CAAC1D,aAAa,KAAK2D,SAAS,CAAC3D,aAAa,IACnD0D,SAAS,CAACzD,SAAS,KAAK0D,SAAS,CAAC1D,SAAS,CAAA;AAE/C,CAAC,CAAC;;;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default FieldMapperMobile;
|
|
2
|
+
declare function FieldMapperMobile({ item, fieldsShown, specialFeatures, handleFavouriteClick, isFavorite, includeFavorite }: {
|
|
3
|
+
item: any;
|
|
4
|
+
fieldsShown: any;
|
|
5
|
+
specialFeatures: any;
|
|
6
|
+
handleFavouriteClick: any;
|
|
7
|
+
isFavorite: any;
|
|
8
|
+
includeFavorite?: boolean | undefined;
|
|
9
|
+
}): React.JSX.Element;
|
|
10
|
+
import React from "react";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default ListItemDesktop;
|
|
2
|
+
declare function ListItemDesktop({ isActive, bodyClassName, item, fieldsShown, specialFeatures, isFavorite, includeFavorite, handleFavouriteClick }: {
|
|
3
|
+
isActive: any;
|
|
4
|
+
bodyClassName: any;
|
|
5
|
+
item: any;
|
|
6
|
+
fieldsShown: any;
|
|
7
|
+
specialFeatures: any;
|
|
8
|
+
isFavorite: any;
|
|
9
|
+
includeFavorite: any;
|
|
10
|
+
handleFavouriteClick: any;
|
|
11
|
+
}): React.JSX.Element;
|
|
12
|
+
import React from "react";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default ListItemMobile;
|
|
2
|
+
declare function ListItemMobile({ bodyClassName, item, fieldsShown, specialFeatures, isFavorite, includeFavorite, handleFavouriteClick, showMap, setMobileTab, onItemSelected, siteConfig }: {
|
|
3
|
+
bodyClassName: any;
|
|
4
|
+
item: any;
|
|
5
|
+
fieldsShown: any;
|
|
6
|
+
specialFeatures: any;
|
|
7
|
+
isFavorite: any;
|
|
8
|
+
includeFavorite: any;
|
|
9
|
+
handleFavouriteClick: any;
|
|
10
|
+
showMap: any;
|
|
11
|
+
setMobileTab: any;
|
|
12
|
+
onItemSelected: any;
|
|
13
|
+
siteConfig: any;
|
|
14
|
+
}): React.JSX.Element;
|
|
15
|
+
import React from "react";
|
package/dist/util/mapIconUtil.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import { placeTypes } from '../constants/placeTypes.js';
|
|
3
2
|
|
|
3
|
+
/* eslint-disable no-undef */
|
|
4
4
|
var customSVGIcon = function customSVGIcon(type) {
|
|
5
5
|
var fillColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "#FFFFFF";
|
|
6
6
|
var strokeColor = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "#000000";
|
|
@@ -20,6 +20,9 @@ var customSVGIcon = function customSVGIcon(type) {
|
|
|
20
20
|
case placeTypes.STORE:
|
|
21
21
|
svg = "<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t\t\t\t\tviewBox=\"0 0 60.8 89.6\" preserveAspectRatio=\"xMidYMid meet\" style=\"enable-background:new 0 0 60.8 89.6;\" xml:space=\"preserve\">\n\t\t\t\t\t<style type=\"text/css\">\n\t\t\t\t\t.st0{fill:".concat(fillColor, "; stroke:").concat(strokeColor, ";}\n\t\t\t\t\t.svg-background{fill:").concat(backgroundFill, "; stroke:").concat(backgroundStroke, ";}\n\t\t\t\t\t</style>\n\t\t\t\t\t<g>\n\t\t\t\t\t\t<path class=\"svg-background\" d=\"M30.4,3.9C14.3,3.9,1.3,16.8,1.3,33c0,21,18.6,29.1,29.1,56.6C40.9,62.1,59.5,54.9,59.5,33C60.3,16.8,46.6,3.9,30.4,3.9z\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t</g>\n\t\t\t\t\t<path class=\"st0\" d=\"M45.4,27.7L42,41.1c-0.1,0.6-0.7,1-1.3,1c1.8,0,3.3,1.5,3.3,3.3s-1.5,3.3-3.3,3.3s-3.3-1.5-3.3-3.3\n\t\t\t\t\t\ts1.5-3.3,3.3-3.3H23.3c1.8,0,3.3,1.5,3.3,3.3s-1.5,3.3-3.3,3.3S20,47.2,20,45.4s1.5-3.3,3.3-3.3c-0.6,0-1.2-0.4-1.3-1l-4.1-16.4\n\t\t\t\t\t\th-1.3c-0.7,0-1.3-0.6-1.3-1.3s0.6-1.3,1.3-1.3h2.3c0.6,0,1.2,0.4,1.3,1l0.8,3h23.1c0.4,0,0.8,0.2,1.1,0.5\n\t\t\t\t\t\tC45.4,26.9,45.5,27.3,45.4,27.7z\"/>\n\t\t\t\t\t<path d=\"M41.4,45.5c0-0.4-0.3-0.7-0.7-0.7S40,45.1,40,45.5C40.1,46.2,41.4,46.2,41.4,45.5z\"/>\n\t\t\t\t\t<path d=\"M24,45.5c0-0.4-0.3-0.7-0.7-0.7s-0.7,0.3-0.7,0.7C22.6,46.2,24,46.2,24,45.5z\"/>\n\t\t\t\t\t</svg>\n\t\t\t\t\t");
|
|
22
22
|
break;
|
|
23
|
+
case placeTypes.AIRPORT:
|
|
24
|
+
svg = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"80\" height=\"80\">\n <!-- Blue Background Circle -->\n <circle cx=\"480\" cy=\"-480\" r=\"480\" fill=\"#0470FF\"/>\n\n <!-- White Airplane Icon -->\n <path fill=\"#FFFFFF\" d=\"M280-80v-100l120-84v-144L80-280v-120l320-224v-176q0-33 23.5-56.5T480-880q33 0 56.5 23.5T560-800v176l320 224v120L560-408v144l120 84v100l-200-60-200 60Z\"/>\n</svg>\n";
|
|
25
|
+
break;
|
|
23
26
|
case placeTypes.TRANSIT_STATION:
|
|
24
27
|
svg = "<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t\t\t\t\tviewBox=\"0 0 60.8 89.6\" preserveAspectRatio=\"xMidYMid meet\" style=\"enable-background:new 0 0 60.8 89.6;\" xml:space=\"preserve\">\n\t\t\t\t\t<style type=\"text/css\">\n\t\t\t\t\t.st0{fill:".concat(fillColor, "; stroke:").concat(strokeColor, ";}\n\t\t\t\t\t.svg-background{fill:").concat(backgroundFill, "; stroke:").concat(backgroundStroke, ";}\n\t\t\t\t\t</style>\n\t\t\t\t\t<g>\n\t\t\t\t\t\t<path class=\"svg-background\" d=\"M30.4,3.9C14.3,3.9,1.3,16.8,1.3,33c0,21,18.6,29.1,29.1,56.6C40.9,62.1,59.5,54.9,59.5,33C60.3,16.8,46.6,3.9,30.4,3.9z\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t</g>\n\t\t\t\t\t<path class=\"st0\" d=\"M26.3,41.3h-2.8L20.7,44h-1.4v-1.4l1.4-1.4c-2.3,0-4.2-1.9-4.2-4.2V26c0-2.3,1.9-4.2,4.2-4.2h9.7\n\t\t\t\t\t\tc2.3,0,4.2,1.9,4.2,4.2v1.4h-2.8v-2.8H19.3v9.7h6.9v7H26.3z\"/>\n\t\t\t\t\t<path class=\"st0\" d=\"M44.3,43c0,0.5-0.4,1-1,1h-0.8c-0.5,0-1-0.5-1-1.1v-1.7H30.4V43c0,0.5-0.4,1.1-0.9,1.1h-0.9c-0.5,0-1-0.5-1-1\n\t\t\t\t\t\tv-7.6l2-5.7c0.2-0.6,0.7-0.9,1.4-0.9h10c0.6,0,1.1,0.4,1.3,0.9l2,5.7V43z\"/>\n\t\t\t\t\t<circle cx=\"20.7\" cy=\"37.1\" r=\"1.4\"/>\n\t\t\t\t\t<circle cx=\"41.5\" cy=\"37.1\" r=\"1.4\"/>\n\t\t\t\t\t<circle cx=\"30.4\" cy=\"37.1\" r=\"1.4\"/>\n\t\t\t\t\t<polygon points=\"31,30.2 29.6,34.4 42.4,34.4 40.9,30.2 \"/>\n\t\t\t\t\t</svg>\n\t\t\t\t\t");
|
|
25
28
|
break;
|
|
@@ -41,26 +44,23 @@ var markerIconProps = function markerIconProps(placeMarkerConfigs, type) {
|
|
|
41
44
|
anchor: new google.maps.Point(scaledWidth / 2, scaledHeight)
|
|
42
45
|
};
|
|
43
46
|
};
|
|
44
|
-
var
|
|
47
|
+
var markerIcon = function markerIcon(markerConfigs) {
|
|
48
|
+
var count = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
49
|
+
var svg = "\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"30\" height=\"30\" viewBox=\"-6 -4 24 24\">\n <path d=\"".concat(iconPath, "\" fill=\"").concat(markerConfigs.fillColor, "\"/>\n <text x=\"5.5\" y=\"8\" font-family=\"Arial\" font-size=\"5\" text-anchor=\"middle\" fill=\"white\">").concat(count, "</text>\n </svg>\n ");
|
|
45
50
|
return {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
scale: 1.6,
|
|
50
|
-
anchor: new google.maps.Point(12, 17)
|
|
51
|
+
url: "data:image/svg+xml;utf8,".concat(encodeURIComponent(svg)),
|
|
52
|
+
scaledSize: new window.google.maps.Size(55, 55),
|
|
53
|
+
anchor: new window.google.maps.Point(18, 25)
|
|
51
54
|
};
|
|
52
55
|
};
|
|
53
|
-
var markerIcon = function markerIcon(markerConfigs) {
|
|
54
|
-
return _objectSpread2(_objectSpread2({}, iconProps()), {}, {
|
|
55
|
-
fillColor: markerConfigs.fillColor,
|
|
56
|
-
strokeColor: markerConfigs.strokeColor
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
56
|
var markerIconSelected = function markerIconSelected(markerConfigs) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
57
|
+
var count = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
58
|
+
var svg = "\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"30\" height=\"30\" viewBox=\"-6 -4 24 24\">\n <path d=\"".concat(iconPath, "\" fill=\"").concat(markerConfigs.selectedFillColor, "\"/>\n <text x=\"5.5\" y=\"8\" font-family=\"Arial\" font-size=\"5\" text-anchor=\"middle\" fill=\"white\">").concat(count, "</text>\n </svg>\n ");
|
|
59
|
+
return {
|
|
60
|
+
url: "data:image/svg+xml;utf8,".concat(encodeURIComponent(svg)),
|
|
61
|
+
scaledSize: new window.google.maps.Size(50, 50),
|
|
62
|
+
anchor: new window.google.maps.Point(12, 17)
|
|
63
|
+
};
|
|
64
64
|
};
|
|
65
65
|
var pinIcon = function pinIcon(markerConfigs) {
|
|
66
66
|
var fillColor = markerConfigs.fillColor,
|
|
@@ -69,5 +69,5 @@ var pinIcon = function pinIcon(markerConfigs) {
|
|
|
69
69
|
return "data:image/svg+xml;utf8,".concat(encodeURIComponent(svg));
|
|
70
70
|
};
|
|
71
71
|
|
|
72
|
-
export { iconPath,
|
|
72
|
+
export { iconPath, markerIcon, markerIconProps, markerIconSelected, pinIcon };
|
|
73
73
|
//# sourceMappingURL=mapIconUtil.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapIconUtil.js","sources":["../../src/util/mapIconUtil.js"],"sourcesContent":["/* eslint-disable no-undef */\nimport { placeTypes } from '~/constants/placeTypes';\n\nconst customSVGIcon = (\n\ttype,\n\tfillColor = \"#FFFFFF\",\n\tstrokeColor = \"#000000\",\n\tbackgroundFill = \"#000000\",\n\tbackgroundStroke = \"#000000\"\n) => {\n\tlet svg = \"\";\n\tswitch (type) {\n\t\tcase placeTypes.FOOD:\n\t\t\tsvg = `\n\t\t\t\t\t<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t\t\t\t\t\tviewBox=\"0 0 60.8 89.6\" preserveAspectRatio=\"xMidYMid meet\" style=\"enable-background:new 0 0 60.8 89.6;\" xml:space=\"preserve\">\n\t\t\t\t\t<style type=\"text/css\">\n\t\t\t\t\t.st0{fill:${fillColor}; stroke:${strokeColor};}\n\t\t\t\t\t.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}\n\t\t\t\t\t</style>\n\t\t\t\t\t<path class=\"svg-background\" d=\"M30.4,3.9C14.3,3.9,1.3,16.8,1.3,33c0,21,18.6,29.1,29.1,56.6C40.9,62.1,59.5,54.9,59.5,33C60.3,16.8,46.6,3.9,30.4,3.9z\"/>\n\t\t\t\t\t<path class=\"st0\" d=\"M25.7,36.6l0.6,15.8c0.1,2.4-2.3,2.4-2.3,2.4s-2.4,0-2.3-2.4l0.6-15.8c0.1-2-4.3-2.9-4-4.9l2.3-13.3h1.1\n\t\t\t\t\t\tl-0.6,9.7l1.7,1.2l0.6-10.9h1.1l0.6,10.9l1.7-1.2l-0.6-9.7h1.1l2.3,13.3C29.7,33.7,25.6,34.6,25.7,36.6z\"/>\n\t\t\t\t\t<path class=\"st0\" d=\"M40,52.4c0,2.4-2.3,2.4-2.3,2.4s-2.5,0-2.3-2.4L36.6,39c-0.9,0-3.4-0.4-3.4-2.4v-6.1c0-2.4,0.3-6.4,1.2-8.2\n\t\t\t\t\t\tc1.1-2.4,3.9-4,5.6-4C40,18.3,40,52.4,40,52.4z\"/>\n\t\t\t\t\t</svg>\n\t\t\t\t\t`;\n\t\t\tbreak;\n\t\tcase placeTypes.TOURIST_ATTRACTION:\n\t\t\tsvg = `<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t\t\t\t\tviewBox=\"0 0 60.8 89.6\" preserveAspectRatio=\"xMidYMid meet\" style=\"enable-background:new 0 0 60.8 89.6;\" xml:space=\"preserve\">\n\t\t\t\t\t<style type=\"text/css\">\n\t\t\t\t\t.st0{fill:${fillColor}; stroke:${strokeColor};}\n\t\t\t\t\t.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}\n\t\t\t\t\t</style>\n\t\t\t\t\t<path class=\"svg-background\" d=\"M30.4,3.9C14.3,3.9,1.3,16.8,1.3,33c0,21,18.6,29.1,29.1,56.6C40.9,62.1,59.5,54.9,59.5,33C60.3,16.8,46.6,3.9,30.4,3.9z\"/>\n\t\t\t\t\t<path class=\"st0\" d=\"M27,18.5c-1.2,0-1.7,1.1-2.2,2.2L23.7,23h-4.5c-1.9,0-3.4,1.5-3.4,3.4v11.2c0,1.9,1.5,3.4,3.4,3.4h22.5\n\t\t\t\t\t\tc1.9,0,3.4-1.5,3.4-3.4V26.4c0-1.9-1.5-3.4-3.4-3.4h-4.5L36,20.8c-0.6-1.1-1-2.2-2.2-2.2H27z M19.2,25.3c0.6,0,1.1,0.5,1.1,1.1\n\t\t\t\t\t\tc0,0.6-0.5,1.1-1.1,1.1c-0.6,0-1.1-0.5-1.1-1.1C18,25.8,18.5,25.3,19.2,25.3z M30.4,25.3c3.7,0,6.7,3,6.7,6.7s-3,6.7-6.7,6.7\n\t\t\t\t\t\ts-6.7-3-6.7-6.7S26.7,25.3,30.4,25.3z M30.4,28.7c-1.9,0-3.4,1.5-3.4,3.4s1.5,3.4,3.4,3.4c1.9,0,3.4-1.5,3.4-3.4\n\t\t\t\t\t\tS32.3,28.7,30.4,28.7z\"/>\n\t\t\t\t\t</svg>\n\t\t\t\t\t`;\n\t\t\tbreak;\n\t\tcase placeTypes.SCHOOL:\n\t\t\tsvg = `\n\t\t\t\t\t<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t\t\t\t\t\tviewBox=\"0 0 60.8 89.6\" preserveAspectRatio=\"xMidYMid meet\" style=\"enable-background:new 0 0 60.8 89.6;\" xml:space=\"preserve\">\n\t\t\t\t\t<style type=\"text/css\">\n\t\t\t\t\t.st0{fill:${fillColor}; stroke:${strokeColor};}\n\t\t\t\t\t.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}\n\t\t\t\t\t</style>\n\t\t\t\t\t<path class=\"svg-background\" d=\"M30.4,3.9C14.3,3.9,1.3,16.8,1.3,33c0,21,18.6,29.1,29.1,56.6C40.9,62.1,59.5,54.9,59.5,33C60.3,16.8,46.6,3.9,30.4,3.9z\"/>\n\t\t\t\t\t<path class=\"st0\" d=\"M39.2,40.6c0,0-4.1,4.6-9.1,4.6S21,40.6,21,40.6v-5.2l9.1,5l9.1-5V40.6z\"/>\n\t\t\t\t\t<polygon class=\"st0\" points=\"44.4,40.4 41.8,40.4 41.8,31.4 30.1,37.8 15.8,30 30.1,22.2 44.4,30 \"/>\n\t\t\t\t\t</svg>\n\t\t\t\t\t`;\n\t\t\tbreak;\n\t\tcase placeTypes.STORE:\n\t\t\tsvg = `<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t\t\t\t\tviewBox=\"0 0 60.8 89.6\" preserveAspectRatio=\"xMidYMid meet\" style=\"enable-background:new 0 0 60.8 89.6;\" xml:space=\"preserve\">\n\t\t\t\t\t<style type=\"text/css\">\n\t\t\t\t\t.st0{fill:${fillColor}; stroke:${strokeColor};}\n\t\t\t\t\t.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}\n\t\t\t\t\t</style>\n\t\t\t\t\t<g>\n\t\t\t\t\t\t<path class=\"svg-background\" d=\"M30.4,3.9C14.3,3.9,1.3,16.8,1.3,33c0,21,18.6,29.1,29.1,56.6C40.9,62.1,59.5,54.9,59.5,33C60.3,16.8,46.6,3.9,30.4,3.9z\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t</g>\n\t\t\t\t\t<path class=\"st0\" d=\"M45.4,27.7L42,41.1c-0.1,0.6-0.7,1-1.3,1c1.8,0,3.3,1.5,3.3,3.3s-1.5,3.3-3.3,3.3s-3.3-1.5-3.3-3.3\n\t\t\t\t\t\ts1.5-3.3,3.3-3.3H23.3c1.8,0,3.3,1.5,3.3,3.3s-1.5,3.3-3.3,3.3S20,47.2,20,45.4s1.5-3.3,3.3-3.3c-0.6,0-1.2-0.4-1.3-1l-4.1-16.4\n\t\t\t\t\t\th-1.3c-0.7,0-1.3-0.6-1.3-1.3s0.6-1.3,1.3-1.3h2.3c0.6,0,1.2,0.4,1.3,1l0.8,3h23.1c0.4,0,0.8,0.2,1.1,0.5\n\t\t\t\t\t\tC45.4,26.9,45.5,27.3,45.4,27.7z\"/>\n\t\t\t\t\t<path d=\"M41.4,45.5c0-0.4-0.3-0.7-0.7-0.7S40,45.1,40,45.5C40.1,46.2,41.4,46.2,41.4,45.5z\"/>\n\t\t\t\t\t<path d=\"M24,45.5c0-0.4-0.3-0.7-0.7-0.7s-0.7,0.3-0.7,0.7C22.6,46.2,24,46.2,24,45.5z\"/>\n\t\t\t\t\t</svg>\n\t\t\t\t\t`;\n\t\t\tbreak;\n\t\tcase placeTypes.TRANSIT_STATION:\n\t\t\tsvg = `<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t\t\t\t\tviewBox=\"0 0 60.8 89.6\" preserveAspectRatio=\"xMidYMid meet\" style=\"enable-background:new 0 0 60.8 89.6;\" xml:space=\"preserve\">\n\t\t\t\t\t<style type=\"text/css\">\n\t\t\t\t\t.st0{fill:${fillColor}; stroke:${strokeColor};}\n\t\t\t\t\t.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}\n\t\t\t\t\t</style>\n\t\t\t\t\t<g>\n\t\t\t\t\t\t<path class=\"svg-background\" d=\"M30.4,3.9C14.3,3.9,1.3,16.8,1.3,33c0,21,18.6,29.1,29.1,56.6C40.9,62.1,59.5,54.9,59.5,33C60.3,16.8,46.6,3.9,30.4,3.9z\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t</g>\n\t\t\t\t\t<path class=\"st0\" d=\"M26.3,41.3h-2.8L20.7,44h-1.4v-1.4l1.4-1.4c-2.3,0-4.2-1.9-4.2-4.2V26c0-2.3,1.9-4.2,4.2-4.2h9.7\n\t\t\t\t\t\tc2.3,0,4.2,1.9,4.2,4.2v1.4h-2.8v-2.8H19.3v9.7h6.9v7H26.3z\"/>\n\t\t\t\t\t<path class=\"st0\" d=\"M44.3,43c0,0.5-0.4,1-1,1h-0.8c-0.5,0-1-0.5-1-1.1v-1.7H30.4V43c0,0.5-0.4,1.1-0.9,1.1h-0.9c-0.5,0-1-0.5-1-1\n\t\t\t\t\t\tv-7.6l2-5.7c0.2-0.6,0.7-0.9,1.4-0.9h10c0.6,0,1.1,0.4,1.3,0.9l2,5.7V43z\"/>\n\t\t\t\t\t<circle cx=\"20.7\" cy=\"37.1\" r=\"1.4\"/>\n\t\t\t\t\t<circle cx=\"41.5\" cy=\"37.1\" r=\"1.4\"/>\n\t\t\t\t\t<circle cx=\"30.4\" cy=\"37.1\" r=\"1.4\"/>\n\t\t\t\t\t<polygon points=\"31,30.2 29.6,34.4 42.4,34.4 40.9,30.2 \"/>\n\t\t\t\t\t</svg>\n\t\t\t\t\t`;\n\t\t\tbreak;\n\t\tcase placeTypes.PLACE_OF_WORSHIP:\n\t\t\tsvg = `<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t\t\t\t\tviewBox=\"0 0 60.8 89.6\" style=\"enable-background:new 0 0 60.8 89.6;\" xml:space=\"preserve\">\n\t\t\t\t\t<style type=\"text/css\">\n\t\t\t\t\t.st0{fill:${fillColor}; stroke:${strokeColor};}\n\t\t\t\t\t.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}\n\t\t\t\t\t</style>\n\t\t\t\t\t<path class=\"svg-background\" d=\"M30.4,3.9C14.3,3.9,1.3,16.8,1.3,33c0,21,18.6,29.1,29.1,56.6C40.9,62.1,59.5,54.9,59.5,33C60.3,16.8,46.6,3.9,30.4,3.9z\"/>\n\t\t\t\t\t<path class=\"st0\" d=\"M21.3,40.8h-3.8c-1.3,0-2.3-1-2.3-2.3v-4.3c0-0.8,0.5-1.6,1.2-2l4.9-2.7V40.8z\"/>\n\t\t\t\t\t<path class=\"st0\" d=\"M38,40.8h-4.6v-4.6c0-1.7-1.4-3-3-3c-1.7,0-3,1.4-3,3v4.6h-4.6V30c0-0.8,0.4-1.5,1.1-2l1.9-1.2v-5.1l0,0\n\t\t\t\t\t\tc0-0.4,0.2-0.8,0.4-1.1l3.6-3.6c0.3-0.3,0.8-0.3,1.1,0l3.6,3.6c0.3,0.3,0.4,0.7,0.4,1.1v5.1l1.9,1.2c0.7,0.4,1.1,1.2,1.1,2L38,40.8\n\t\t\t\t\t\tL38,40.8z\"/>\n\t\t\t\t\t<path class=\"st0\" d=\"M45.6,38.5c0,1.3-1,2.3-2.3,2.3h-3.8V29.5l4.9,2.7c0.7,0.4,1.2,1.2,1.2,2C45.6,34.2,45.6,38.5,45.6,38.5z\"/>\n\t\t\t\t\t</svg>\n\t\t\t\t\t`;\n\t\t\tbreak;\n\t}\n\n\tconst iconUrl = `data:image/svg+xml;utf8,${encodeURIComponent(svg)}`;\n\treturn iconUrl;\n};\n\nexport const iconPath = \"M5.5 0A5.27 5.27 0 0 0 0 5.01v.49c0 1.73 1.38 3.43 2.07 4.12s3.43 4.12 3.43 4.12 2.75-3.43 3.43-4.12 2.06-2.39 2.06-4.12c.14-2.9-2.1-5.36-5-5.5H5.5Zm-.04 5.71c-.32 0-.57-.27-.56-.58 0-.32.27-.57.58-.56.32 0 .57.27.56.58 0 .31-.25.55-.56.56h-.02Z\";\n\nexport const markerIconProps = (placeMarkerConfigs, type) => {\n\n\tconst scaledWidth = placeMarkerConfigs.size;\n\tconst scaledHeight = (scaledWidth * 3) / 2;\n\tconst iconUrl = customSVGIcon(\n\t\ttype,\n\t\tplaceMarkerConfigs.colors.innerFillColor,\n\t\tplaceMarkerConfigs.colors.innerStrokeColor,\n\t\tplaceMarkerConfigs.colors.outerFillColor,\n\t\tplaceMarkerConfigs.colors.outerStrokeColor\n\t);\n\treturn {\n\t\turl: iconUrl,\n\t\tscaledSize: new google.maps.Size(scaledWidth, scaledHeight),\n\t\tanchor: new google.maps.Point(scaledWidth / 2, scaledHeight)\n\t};\n};\n\nexport const iconProps = () => {\n\treturn {\n\t\tpath: iconPath,\n\t\tfillOpacity: 1,\n\t\tstrokeWeight: 1.75,\n\t\tscale: 1.6,\n\t\tanchor: new google.maps.Point(12, 17)\n\t};\n};\n\nexport const markerIcon = markerConfigs => {\n\treturn {\n\t\t...iconProps(),\n\t\tfillColor: markerConfigs.fillColor,\n\t\tstrokeColor: markerConfigs.strokeColor\n\t};\n};\n\nexport const markerIconSelected = markerConfigs => {\n\treturn {\n\t\t...iconProps(),\n\t\tfillColor: markerConfigs.selectedFillColor,\n\t\tstrokeColor: markerConfigs.selectedStrokeColor\n\t};\n};\n\nexport const pinIcon = markerConfigs => {\n\tconst { fillColor, strokeColor } = markerConfigs;\n\n\tconst svg = `\n\t<svg aria-hidden=\"true\" xmlns=\"http://www.w3.org/2000/svg\" width=\"30\" height=\"30\" viewBox=\"-6 -4 24 24\">\n\t\t<path d=\"${iconPath}\" fill=\"${fillColor}\" stroke=\"${strokeColor}\" stroke-width=\"2\"/>\n\t </svg>\n\t`;\n\n\treturn `data:image/svg+xml;utf8,${encodeURIComponent(svg)}`;\n};\n\n"],"names":["customSVGIcon","type","fillColor","arguments","length","undefined","strokeColor","backgroundFill","backgroundStroke","svg","placeTypes","FOOD","concat","TOURIST_ATTRACTION","SCHOOL","STORE","TRANSIT_STATION","PLACE_OF_WORSHIP","iconUrl","encodeURIComponent","iconPath","markerIconProps","placeMarkerConfigs","scaledWidth","size","scaledHeight","colors","innerFillColor","innerStrokeColor","outerFillColor","outerStrokeColor","url","scaledSize","google","maps","Size","anchor","Point","iconProps","path","fillOpacity","strokeWeight","scale","markerIcon","markerConfigs","_objectSpread","markerIconSelected","selectedFillColor","selectedStrokeColor","pinIcon"],"mappings":";;;AAGA,IAAMA,aAAa,GAAG,SAAhBA,aAAaA,CAClBC,IAAI,EAKA;AAAA,EAAA,IAJJC,SAAS,GAAAC,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,SAAS,CAAA;AAAA,EAAA,IACrBG,WAAW,GAAAH,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,SAAS,CAAA;AAAA,EAAA,IACvB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,OAAOA,CAAGL,aAAa,EAAI;AACvC,EAAA,IAAQ1C,SAAS,GAAkB0C,aAAa,CAAxC1C,SAAS;IAAEI,WAAW,GAAKsC,aAAa,CAA7BtC,WAAW,CAAA;AAE9B,EAAA,IAAMG,GAAG,GAAA,wIAAA,CAAAG,MAAA,CAEGQ,QAAQ,EAAA,YAAA,CAAA,CAAAR,MAAA,CAAWV,SAAS,EAAA,cAAA,CAAA,CAAAU,MAAA,CAAaN,WAAW,EAE/D,yCAAA,CAAA,CAAA;AAED,EAAA,OAAA,0BAAA,CAAAM,MAAA,CAAkCO,kBAAkB,CAACV,GAAG,CAAC,CAAA,CAAA;AAC1D;;;;"}
|
|
1
|
+
{"version":3,"file":"mapIconUtil.js","sources":["../../src/util/mapIconUtil.js"],"sourcesContent":["/* eslint-disable no-undef */\nimport { placeTypes } from '~/constants/placeTypes';\n\nconst customSVGIcon = (\n\ttype,\n\tfillColor = \"#FFFFFF\",\n\tstrokeColor = \"#000000\",\n\tbackgroundFill = \"#000000\",\n\tbackgroundStroke = \"#000000\"\n) => {\n\tlet svg = \"\";\n\tswitch (type) {\n\t\tcase placeTypes.FOOD:\n\t\t\tsvg = `\n\t\t\t\t\t<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t\t\t\t\t\tviewBox=\"0 0 60.8 89.6\" preserveAspectRatio=\"xMidYMid meet\" style=\"enable-background:new 0 0 60.8 89.6;\" xml:space=\"preserve\">\n\t\t\t\t\t<style type=\"text/css\">\n\t\t\t\t\t.st0{fill:${fillColor}; stroke:${strokeColor};}\n\t\t\t\t\t.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}\n\t\t\t\t\t</style>\n\t\t\t\t\t<path class=\"svg-background\" d=\"M30.4,3.9C14.3,3.9,1.3,16.8,1.3,33c0,21,18.6,29.1,29.1,56.6C40.9,62.1,59.5,54.9,59.5,33C60.3,16.8,46.6,3.9,30.4,3.9z\"/>\n\t\t\t\t\t<path class=\"st0\" d=\"M25.7,36.6l0.6,15.8c0.1,2.4-2.3,2.4-2.3,2.4s-2.4,0-2.3-2.4l0.6-15.8c0.1-2-4.3-2.9-4-4.9l2.3-13.3h1.1\n\t\t\t\t\t\tl-0.6,9.7l1.7,1.2l0.6-10.9h1.1l0.6,10.9l1.7-1.2l-0.6-9.7h1.1l2.3,13.3C29.7,33.7,25.6,34.6,25.7,36.6z\"/>\n\t\t\t\t\t<path class=\"st0\" d=\"M40,52.4c0,2.4-2.3,2.4-2.3,2.4s-2.5,0-2.3-2.4L36.6,39c-0.9,0-3.4-0.4-3.4-2.4v-6.1c0-2.4,0.3-6.4,1.2-8.2\n\t\t\t\t\t\tc1.1-2.4,3.9-4,5.6-4C40,18.3,40,52.4,40,52.4z\"/>\n\t\t\t\t\t</svg>\n\t\t\t\t\t`;\n\t\t\tbreak;\n\t\tcase placeTypes.TOURIST_ATTRACTION:\n\t\t\tsvg = `<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t\t\t\t\tviewBox=\"0 0 60.8 89.6\" preserveAspectRatio=\"xMidYMid meet\" style=\"enable-background:new 0 0 60.8 89.6;\" xml:space=\"preserve\">\n\t\t\t\t\t<style type=\"text/css\">\n\t\t\t\t\t.st0{fill:${fillColor}; stroke:${strokeColor};}\n\t\t\t\t\t.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}\n\t\t\t\t\t</style>\n\t\t\t\t\t<path class=\"svg-background\" d=\"M30.4,3.9C14.3,3.9,1.3,16.8,1.3,33c0,21,18.6,29.1,29.1,56.6C40.9,62.1,59.5,54.9,59.5,33C60.3,16.8,46.6,3.9,30.4,3.9z\"/>\n\t\t\t\t\t<path class=\"st0\" d=\"M27,18.5c-1.2,0-1.7,1.1-2.2,2.2L23.7,23h-4.5c-1.9,0-3.4,1.5-3.4,3.4v11.2c0,1.9,1.5,3.4,3.4,3.4h22.5\n\t\t\t\t\t\tc1.9,0,3.4-1.5,3.4-3.4V26.4c0-1.9-1.5-3.4-3.4-3.4h-4.5L36,20.8c-0.6-1.1-1-2.2-2.2-2.2H27z M19.2,25.3c0.6,0,1.1,0.5,1.1,1.1\n\t\t\t\t\t\tc0,0.6-0.5,1.1-1.1,1.1c-0.6,0-1.1-0.5-1.1-1.1C18,25.8,18.5,25.3,19.2,25.3z M30.4,25.3c3.7,0,6.7,3,6.7,6.7s-3,6.7-6.7,6.7\n\t\t\t\t\t\ts-6.7-3-6.7-6.7S26.7,25.3,30.4,25.3z M30.4,28.7c-1.9,0-3.4,1.5-3.4,3.4s1.5,3.4,3.4,3.4c1.9,0,3.4-1.5,3.4-3.4\n\t\t\t\t\t\tS32.3,28.7,30.4,28.7z\"/>\n\t\t\t\t\t</svg>\n\t\t\t\t\t`;\n\t\t\tbreak;\n\t\tcase placeTypes.SCHOOL:\n\t\t\tsvg = `\n\t\t\t\t\t<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t\t\t\t\t\tviewBox=\"0 0 60.8 89.6\" preserveAspectRatio=\"xMidYMid meet\" style=\"enable-background:new 0 0 60.8 89.6;\" xml:space=\"preserve\">\n\t\t\t\t\t<style type=\"text/css\">\n\t\t\t\t\t.st0{fill:${fillColor}; stroke:${strokeColor};}\n\t\t\t\t\t.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}\n\t\t\t\t\t</style>\n\t\t\t\t\t<path class=\"svg-background\" d=\"M30.4,3.9C14.3,3.9,1.3,16.8,1.3,33c0,21,18.6,29.1,29.1,56.6C40.9,62.1,59.5,54.9,59.5,33C60.3,16.8,46.6,3.9,30.4,3.9z\"/>\n\t\t\t\t\t<path class=\"st0\" d=\"M39.2,40.6c0,0-4.1,4.6-9.1,4.6S21,40.6,21,40.6v-5.2l9.1,5l9.1-5V40.6z\"/>\n\t\t\t\t\t<polygon class=\"st0\" points=\"44.4,40.4 41.8,40.4 41.8,31.4 30.1,37.8 15.8,30 30.1,22.2 44.4,30 \"/>\n\t\t\t\t\t</svg>\n\t\t\t\t\t`;\n\t\t\tbreak;\n\t\tcase placeTypes.STORE:\n\t\t\tsvg = `<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t\t\t\t\tviewBox=\"0 0 60.8 89.6\" preserveAspectRatio=\"xMidYMid meet\" style=\"enable-background:new 0 0 60.8 89.6;\" xml:space=\"preserve\">\n\t\t\t\t\t<style type=\"text/css\">\n\t\t\t\t\t.st0{fill:${fillColor}; stroke:${strokeColor};}\n\t\t\t\t\t.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}\n\t\t\t\t\t</style>\n\t\t\t\t\t<g>\n\t\t\t\t\t\t<path class=\"svg-background\" d=\"M30.4,3.9C14.3,3.9,1.3,16.8,1.3,33c0,21,18.6,29.1,29.1,56.6C40.9,62.1,59.5,54.9,59.5,33C60.3,16.8,46.6,3.9,30.4,3.9z\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t</g>\n\t\t\t\t\t<path class=\"st0\" d=\"M45.4,27.7L42,41.1c-0.1,0.6-0.7,1-1.3,1c1.8,0,3.3,1.5,3.3,3.3s-1.5,3.3-3.3,3.3s-3.3-1.5-3.3-3.3\n\t\t\t\t\t\ts1.5-3.3,3.3-3.3H23.3c1.8,0,3.3,1.5,3.3,3.3s-1.5,3.3-3.3,3.3S20,47.2,20,45.4s1.5-3.3,3.3-3.3c-0.6,0-1.2-0.4-1.3-1l-4.1-16.4\n\t\t\t\t\t\th-1.3c-0.7,0-1.3-0.6-1.3-1.3s0.6-1.3,1.3-1.3h2.3c0.6,0,1.2,0.4,1.3,1l0.8,3h23.1c0.4,0,0.8,0.2,1.1,0.5\n\t\t\t\t\t\tC45.4,26.9,45.5,27.3,45.4,27.7z\"/>\n\t\t\t\t\t<path d=\"M41.4,45.5c0-0.4-0.3-0.7-0.7-0.7S40,45.1,40,45.5C40.1,46.2,41.4,46.2,41.4,45.5z\"/>\n\t\t\t\t\t<path d=\"M24,45.5c0-0.4-0.3-0.7-0.7-0.7s-0.7,0.3-0.7,0.7C22.6,46.2,24,46.2,24,45.5z\"/>\n\t\t\t\t\t</svg>\n\t\t\t\t\t`;\n\t\t\tbreak;\n\t\tcase placeTypes.AIRPORT:\n\t\t\tsvg = `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 -960 960 960\" width=\"80\" height=\"80\">\n <!-- Blue Background Circle -->\n <circle cx=\"480\" cy=\"-480\" r=\"480\" fill=\"#0470FF\"/>\n\n <!-- White Airplane Icon -->\n <path fill=\"#FFFFFF\" d=\"M280-80v-100l120-84v-144L80-280v-120l320-224v-176q0-33 23.5-56.5T480-880q33 0 56.5 23.5T560-800v176l320 224v120L560-408v144l120 84v100l-200-60-200 60Z\"/>\n</svg>\n`;\n\t\t\tbreak;\n\t\tcase placeTypes.TRANSIT_STATION:\n\t\t\tsvg = `<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t\t\t\t\tviewBox=\"0 0 60.8 89.6\" preserveAspectRatio=\"xMidYMid meet\" style=\"enable-background:new 0 0 60.8 89.6;\" xml:space=\"preserve\">\n\t\t\t\t\t<style type=\"text/css\">\n\t\t\t\t\t.st0{fill:${fillColor}; stroke:${strokeColor};}\n\t\t\t\t\t.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}\n\t\t\t\t\t</style>\n\t\t\t\t\t<g>\n\t\t\t\t\t\t<path class=\"svg-background\" d=\"M30.4,3.9C14.3,3.9,1.3,16.8,1.3,33c0,21,18.6,29.1,29.1,56.6C40.9,62.1,59.5,54.9,59.5,33C60.3,16.8,46.6,3.9,30.4,3.9z\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t</g>\n\t\t\t\t\t<path class=\"st0\" d=\"M26.3,41.3h-2.8L20.7,44h-1.4v-1.4l1.4-1.4c-2.3,0-4.2-1.9-4.2-4.2V26c0-2.3,1.9-4.2,4.2-4.2h9.7\n\t\t\t\t\t\tc2.3,0,4.2,1.9,4.2,4.2v1.4h-2.8v-2.8H19.3v9.7h6.9v7H26.3z\"/>\n\t\t\t\t\t<path class=\"st0\" d=\"M44.3,43c0,0.5-0.4,1-1,1h-0.8c-0.5,0-1-0.5-1-1.1v-1.7H30.4V43c0,0.5-0.4,1.1-0.9,1.1h-0.9c-0.5,0-1-0.5-1-1\n\t\t\t\t\t\tv-7.6l2-5.7c0.2-0.6,0.7-0.9,1.4-0.9h10c0.6,0,1.1,0.4,1.3,0.9l2,5.7V43z\"/>\n\t\t\t\t\t<circle cx=\"20.7\" cy=\"37.1\" r=\"1.4\"/>\n\t\t\t\t\t<circle cx=\"41.5\" cy=\"37.1\" r=\"1.4\"/>\n\t\t\t\t\t<circle cx=\"30.4\" cy=\"37.1\" r=\"1.4\"/>\n\t\t\t\t\t<polygon points=\"31,30.2 29.6,34.4 42.4,34.4 40.9,30.2 \"/>\n\t\t\t\t\t</svg>\n\t\t\t\t\t`;\n\t\t\tbreak;\n\t\tcase placeTypes.PLACE_OF_WORSHIP:\n\t\t\tsvg = `<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t\t\t\t\tviewBox=\"0 0 60.8 89.6\" style=\"enable-background:new 0 0 60.8 89.6;\" xml:space=\"preserve\">\n\t\t\t\t\t<style type=\"text/css\">\n\t\t\t\t\t.st0{fill:${fillColor}; stroke:${strokeColor};}\n\t\t\t\t\t.svg-background{fill:${backgroundFill}; stroke:${backgroundStroke};}\n\t\t\t\t\t</style>\n\t\t\t\t\t<path class=\"svg-background\" d=\"M30.4,3.9C14.3,3.9,1.3,16.8,1.3,33c0,21,18.6,29.1,29.1,56.6C40.9,62.1,59.5,54.9,59.5,33C60.3,16.8,46.6,3.9,30.4,3.9z\"/>\n\t\t\t\t\t<path class=\"st0\" d=\"M21.3,40.8h-3.8c-1.3,0-2.3-1-2.3-2.3v-4.3c0-0.8,0.5-1.6,1.2-2l4.9-2.7V40.8z\"/>\n\t\t\t\t\t<path class=\"st0\" d=\"M38,40.8h-4.6v-4.6c0-1.7-1.4-3-3-3c-1.7,0-3,1.4-3,3v4.6h-4.6V30c0-0.8,0.4-1.5,1.1-2l1.9-1.2v-5.1l0,0\n\t\t\t\t\t\tc0-0.4,0.2-0.8,0.4-1.1l3.6-3.6c0.3-0.3,0.8-0.3,1.1,0l3.6,3.6c0.3,0.3,0.4,0.7,0.4,1.1v5.1l1.9,1.2c0.7,0.4,1.1,1.2,1.1,2L38,40.8\n\t\t\t\t\t\tL38,40.8z\"/>\n\t\t\t\t\t<path class=\"st0\" d=\"M45.6,38.5c0,1.3-1,2.3-2.3,2.3h-3.8V29.5l4.9,2.7c0.7,0.4,1.2,1.2,1.2,2C45.6,34.2,45.6,38.5,45.6,38.5z\"/>\n\t\t\t\t\t</svg>\n\t\t\t\t\t`;\n\t\t\tbreak;\n\t}\n\n\tconst iconUrl = `data:image/svg+xml;utf8,${encodeURIComponent(svg)}`;\n\treturn iconUrl;\n};\n\nexport const iconPath = \"M5.5 0A5.27 5.27 0 0 0 0 5.01v.49c0 1.73 1.38 3.43 2.07 4.12s3.43 4.12 3.43 4.12 2.75-3.43 3.43-4.12 2.06-2.39 2.06-4.12c.14-2.9-2.1-5.36-5-5.5H5.5Zm-.04 5.71c-.32 0-.57-.27-.56-.58 0-.32.27-.57.58-.56.32 0 .57.27.56.58 0 .31-.25.55-.56.56h-.02Z\";\n\nexport const markerIconProps = (placeMarkerConfigs, type) => {\n\n\tconst scaledWidth = placeMarkerConfigs.size;\n\tconst scaledHeight = (scaledWidth * 3) / 2;\n\tconst iconUrl = customSVGIcon(\n\t\ttype,\n\t\tplaceMarkerConfigs.colors.innerFillColor,\n\t\tplaceMarkerConfigs.colors.innerStrokeColor,\n\t\tplaceMarkerConfigs.colors.outerFillColor,\n\t\tplaceMarkerConfigs.colors.outerStrokeColor\n\t);\n\treturn {\n\t\turl: iconUrl,\n\t\tscaledSize: new google.maps.Size(scaledWidth, scaledHeight),\n\t\tanchor: new google.maps.Point(scaledWidth / 2, scaledHeight)\n\t};\n};\n\nexport const iconProps = () => {\n\treturn {\n\t\tpath: iconPath,\n\t\tfillOpacity: 1,\n\t\tstrokeWeight: 1.75,\n\t\tscale: 1.6,\n\t\tanchor: new google.maps.Point(12, 17)\n\t};\n};\n\nexport const markerIcon = (markerConfigs, count = 0) => {\n\tconst svg = `\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"30\" height=\"30\" viewBox=\"-6 -4 24 24\">\n <path d=\"${iconPath}\" fill=\"${markerConfigs.fillColor}\"/>\n <text x=\"5.5\" y=\"8\" font-family=\"Arial\" font-size=\"5\" text-anchor=\"middle\" fill=\"white\">${count}</text>\n </svg>\n `;\n\n\treturn {\n\t\turl: `data:image/svg+xml;utf8,${encodeURIComponent(svg)}`,\n\t\tscaledSize: new window.google.maps.Size(55, 55),\n\t\tanchor: new window.google.maps.Point(18, 25)\n\t};\n};\n\nexport const markerIconSelected = (markerConfigs, count = 0) => {\n\tconst svg = `\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"30\" height=\"30\" viewBox=\"-6 -4 24 24\">\n <path d=\"${iconPath}\" fill=\"${markerConfigs.selectedFillColor}\"/>\n <text x=\"5.5\" y=\"8\" font-family=\"Arial\" font-size=\"5\" text-anchor=\"middle\" fill=\"white\">${count}</text>\n </svg>\n `;\n\n\treturn {\n\t\turl: `data:image/svg+xml;utf8,${encodeURIComponent(svg)}`,\n\t\tscaledSize: new window.google.maps.Size(50, 50),\n\t\tanchor: new window.google.maps.Point(12, 17)\n\t};\n};\n\nexport const pinIcon = markerConfigs => {\n\tconst { fillColor, strokeColor } = markerConfigs;\n\n\tconst svg = `\n\t<svg aria-hidden=\"true\" xmlns=\"http://www.w3.org/2000/svg\" width=\"30\" height=\"30\" viewBox=\"-6 -4 24 24\">\n\t\t<path d=\"${iconPath}\" fill=\"${fillColor}\" stroke=\"${strokeColor}\" stroke-width=\"2\"/>\n\t </svg>\n\t`;\n\n\treturn `data:image/svg+xml;utf8,${encodeURIComponent(svg)}`;\n};\n\n"],"names":["customSVGIcon","type","fillColor","arguments","length","undefined","strokeColor","backgroundFill","backgroundStroke","svg","placeTypes","FOOD","concat","TOURIST_ATTRACTION","SCHOOL","STORE","AIRPORT","TRANSIT_STATION","PLACE_OF_WORSHIP","iconUrl","encodeURIComponent","iconPath","markerIconProps","placeMarkerConfigs","scaledWidth","size","scaledHeight","colors","innerFillColor","innerStrokeColor","outerFillColor","outerStrokeColor","url","scaledSize","google","maps","Size","anchor","Point","markerIcon","markerConfigs","count","window","markerIconSelected","selectedFillColor","pinIcon"],"mappings":";;AAAA;AAGA,IAAMA,aAAa,GAAG,SAAhBA,aAAaA,CAClBC,IAAI,EAKA;AAAA,EAAA,IAJJC,SAAS,GAAAC,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,SAAS,CAAA;AAAA,EAAA,IACrBG,WAAW,GAAAH,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,SAAS,CAAA;AAAA,EAAA,IACvBI,cAAc,GAAAJ,SAAA,CAAAC,MAAA,GAAA,CAAA,IAAAD,SAAA,CAAA,CAAA,CAAA,KAAAE,SAAA,GAAAF,SAAA,CAAA,CAAA,CAAA,GAAG,SAAS,CAAA;AAAA,EAAA,IAC1BK,g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,GAAG,CAAC,CAAA;AAC1D,EAAA,IAAMM,GAAG,GAAA,uHAAA,CAAAG,MAAA,CAEOS,QAAQ,EAAAT,YAAAA,CAAAA,CAAAA,MAAA,CAAW4B,aAAa,CAACI,iBAAiB,EAAA,kHAAA,CAAA,CAAAhC,MAAA,CAC6B6B,KAAK,EAElG,yBAAA,CAAA,CAAA;EAEF,OAAO;AACNT,IAAAA,GAAG,6BAAApB,MAAA,CAA6BQ,kBAAkB,CAACX,GAAG,CAAC,CAAE;AACzDwB,IAAAA,UAAU,EAAE,IAAIS,MAAM,CAACR,MAAM,CAACC,IAAI,CAACC,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC;AAC/CC,IAAAA,MAAM,EAAE,IAAIK,MAAM,CAACR,MAAM,CAACC,IAAI,CAACG,KAAK,CAAC,EAAE,EAAE,EAAE,CAAA;GAC3C,CAAA;AACF,EAAC;IAEYO,OAAO,GAAG,SAAVA,OAAOA,CAAGL,aAAa,EAAI;AACvC,EAAA,IAAQtC,SAAS,GAAkBsC,aAAa,CAAxCtC,SAAS;IAAEI,WAAW,GAAKkC,aAAa,CAA7BlC,WAAW,CAAA;AAE9B,EAAA,IAAMG,GAAG,GAAA,wIAAA,CAAAG,MAAA,CAEGS,QAAQ,EAAA,YAAA,CAAA,CAAAT,MAAA,CAAWV,SAAS,EAAA,cAAA,CAAA,CAAAU,MAAA,CAAaN,WAAW,EAE/D,yCAAA,CAAA,CAAA;AAED,EAAA,OAAA,0BAAA,CAAAM,MAAA,CAAkCQ,kBAAkB,CAACX,GAAG,CAAC,CAAA,CAAA;AAC1D;;;;"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Grid from '~/components/modules/grid';
|
|
3
|
+
import PillWrapper from '~/components/modules/buttons/pill-wrapper';
|
|
4
|
+
import { capitalize } from '~/util/stringUtils';
|
|
5
|
+
|
|
6
|
+
const FieldMapperDesktop = ({
|
|
7
|
+
item,
|
|
8
|
+
fieldsShown,
|
|
9
|
+
specialFeatures
|
|
10
|
+
}) => {
|
|
11
|
+
const orderedFields = fieldsShown.filter(field => field in item.fields);
|
|
12
|
+
|
|
13
|
+
const specialFeaturePills = field => {
|
|
14
|
+
return field === 'position' && specialFeatures &&
|
|
15
|
+
Object.entries(specialFeatures).map(([featureKey, featureLabel]) => {
|
|
16
|
+
return item.fields[featureKey] == 1 && (
|
|
17
|
+
<PillWrapper key={featureKey}>{featureLabel}</PillWrapper>
|
|
18
|
+
);
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<>
|
|
24
|
+
{orderedFields.map((field, index) => {
|
|
25
|
+
let value = item.fields[field];
|
|
26
|
+
return (
|
|
27
|
+
<Grid.Item
|
|
28
|
+
key={field}
|
|
29
|
+
className={`
|
|
30
|
+
hc-hidden md:hc-block hc-px-2
|
|
31
|
+
${index === 0 ? "hc-pl-7" : ""}
|
|
32
|
+
${field.toLowerCase() === "position" ? "hc-col-span-4 hc-text-balance hc-font-semibold" : (field.toLowerCase() === "state" || field.toLowerCase() == "favorite") ? "hc-col-span-1" : "hc-col-span-2"}
|
|
33
|
+
`}
|
|
34
|
+
>
|
|
35
|
+
<span className="hc-sr-only">{capitalize(field)}</span>
|
|
36
|
+
{value}
|
|
37
|
+
<br />
|
|
38
|
+
{specialFeaturePills(field)}
|
|
39
|
+
</Grid.Item>
|
|
40
|
+
);
|
|
41
|
+
})}
|
|
42
|
+
</>
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export default FieldMapperDesktop;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Grid from '~/components/modules/grid';
|
|
3
|
+
import Icon from '~/components/modules/icon';
|
|
4
|
+
import PillWrapper from '~/components/modules/buttons/pill-wrapper';
|
|
5
|
+
|
|
6
|
+
const FieldMapperMobile = ({
|
|
7
|
+
item,
|
|
8
|
+
fieldsShown,
|
|
9
|
+
specialFeatures,
|
|
10
|
+
handleFavouriteClick,
|
|
11
|
+
isFavorite,
|
|
12
|
+
includeFavorite = true
|
|
13
|
+
}) => {
|
|
14
|
+
const specialFeaturePills = field => {
|
|
15
|
+
return field === 'position' && specialFeatures &&
|
|
16
|
+
Object.entries(specialFeatures).map(([featureKey, featureLabel]) => {
|
|
17
|
+
return item.fields[featureKey] == 1 && (
|
|
18
|
+
<PillWrapper key={featureKey}>{featureLabel}</PillWrapper>
|
|
19
|
+
);
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<Grid.Item className="md:hc-hidden">
|
|
25
|
+
{fieldsShown.includes("position") &&
|
|
26
|
+
<>
|
|
27
|
+
<div className="hc-flex hc-items-start">
|
|
28
|
+
<div className="hc-flex hc-justify-between hc-items-center hc-min-w-[100%]">
|
|
29
|
+
<h3 className="hc-font-bold hc-mb-3 hc-flex-1">{item.fields.position}</h3>
|
|
30
|
+
{includeFavorite && <div className="hc-flex hc-justify-end hc-pb-2">
|
|
31
|
+
<Icon
|
|
32
|
+
icon={isFavorite ? "mdi:heart" : "mdi:heart-outline"}
|
|
33
|
+
size="hc-size-3.5"
|
|
34
|
+
iconClasses={isFavorite ? "hc-text-primary" : ""}
|
|
35
|
+
className={`hc-transition-opacity hc-duration-300 hc-cursor-pointer
|
|
36
|
+
${isFavorite ? "hc-opacity-100" : "hc-text-uiText/60 group-hover:hc-opacity-100"}
|
|
37
|
+
`}
|
|
38
|
+
onClick={e => handleFavouriteClick(e, item)}
|
|
39
|
+
/>
|
|
40
|
+
</div>
|
|
41
|
+
}
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
{specialFeatures && <div className='hc-pb-4'>{specialFeaturePills("position", true)} </div>}
|
|
45
|
+
</>
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
<ul className="hc-space-y-2 hc-text-xs">
|
|
49
|
+
{[
|
|
50
|
+
{
|
|
51
|
+
field: "categoryClass",
|
|
52
|
+
name: "categoryClass",
|
|
53
|
+
icon: "icon-park-solid:tree-list"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
field: "category",
|
|
57
|
+
name: "Category",
|
|
58
|
+
icon: "icon-park-solid:tree-list"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
field: "schedule",
|
|
62
|
+
name: "Schedule",
|
|
63
|
+
icon: "gravity-ui:clock-fill"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
field: "city",
|
|
67
|
+
name: "Location",
|
|
68
|
+
icon: "fluent:location-16-filled"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
field: "state",
|
|
72
|
+
name: "Location",
|
|
73
|
+
icon: "fluent:location-16-filled"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
field: "cityState",
|
|
77
|
+
name: "Location",
|
|
78
|
+
icon: "fluent:location-16-filled"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
field: "travelTime",
|
|
82
|
+
name: "Commute",
|
|
83
|
+
icon: "ri:pin-distance-fill"
|
|
84
|
+
}
|
|
85
|
+
].map(listItem => (
|
|
86
|
+
(fieldsShown.includes(listItem.field) && item.fields[listItem.field]) &&
|
|
87
|
+
<li
|
|
88
|
+
key={listItem.field}
|
|
89
|
+
className="hc-flex hc-gap-2"
|
|
90
|
+
>
|
|
91
|
+
<Icon
|
|
92
|
+
icon={listItem.icon}
|
|
93
|
+
size="hc-size-3.5"
|
|
94
|
+
className="hc-text-uiAccent/30"
|
|
95
|
+
/>
|
|
96
|
+
<span className="hc-sr-only">{listItem.name}</span>
|
|
97
|
+
{item.fields[listItem.field]}
|
|
98
|
+
</li>
|
|
99
|
+
))}
|
|
100
|
+
</ul>
|
|
101
|
+
</Grid.Item>
|
|
102
|
+
);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export default FieldMapperMobile;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
2
|
import Grid from '~/components/modules/grid';
|
|
3
3
|
import Icon from '~/components/modules/icon';
|
|
4
|
-
import FieldMapper from '~/components/modules/list/field-mapper';
|
|
5
|
-
|
|
4
|
+
import FieldMapper from '~/components/modules/list/field-mapper-desktop';
|
|
5
|
+
import FieldMapperMobile from '~/components/modules/list/field-mapper-mobile';
|
|
6
6
|
const ListItem = forwardRef(
|
|
7
7
|
(
|
|
8
8
|
{
|
|
@@ -55,6 +55,7 @@ const ListItem = forwardRef(
|
|
|
55
55
|
`}
|
|
56
56
|
{...props}
|
|
57
57
|
>
|
|
58
|
+
{/* This Grid is displayed as block on mobile and grid on desktop */}
|
|
58
59
|
<Grid
|
|
59
60
|
columns="hc-pl-2 hc-md-pl-0 hc-grid-flow-col hc-auto-cols-fr"
|
|
60
61
|
gap="hc-gap-0"
|
|
@@ -63,6 +64,7 @@ const ListItem = forwardRef(
|
|
|
63
64
|
${bodyClassName ?? ""}
|
|
64
65
|
`}
|
|
65
66
|
>
|
|
67
|
+
{/* DESKTOP ONLY: This expand icon is hidden on mobile (hc-hidden) and visible on desktop (md:hc-block) */}
|
|
66
68
|
<Grid.Item className="hc-hidden md:hc-block md:hc-absolute md:hc-left-1.5 hc-top-1.5">
|
|
67
69
|
<span className="hc-sr-only">Expand row</span>
|
|
68
70
|
<Icon
|
|
@@ -82,7 +84,16 @@ const ListItem = forwardRef(
|
|
|
82
84
|
includeFavorite={includeFavorite}
|
|
83
85
|
handleFavouriteClick={handleFavouriteClick}
|
|
84
86
|
/>
|
|
87
|
+
<FieldMapperMobile
|
|
88
|
+
item={item}
|
|
89
|
+
fieldsShown={fieldsShown}
|
|
90
|
+
specialFeatures={specialFeatures}
|
|
91
|
+
isFavorite={isFavorite}
|
|
92
|
+
includeFavorite={includeFavorite}
|
|
93
|
+
handleFavouriteClick={handleFavouriteClick}
|
|
94
|
+
/>
|
|
85
95
|
{includeFavorite &&
|
|
96
|
+
/* DESKTOP ONLY: This favorites icon is hidden on mobile (hc-hidden) and visible on desktop (md:hc-block) */
|
|
86
97
|
<Grid.Item
|
|
87
98
|
key={"favorites"}
|
|
88
99
|
className="hc-hidden md:hc-block hc-col-span-1 hc-px-2"
|
|
@@ -98,6 +109,7 @@ const ListItem = forwardRef(
|
|
|
98
109
|
</Grid.Item>
|
|
99
110
|
}
|
|
100
111
|
</Grid>
|
|
112
|
+
{/* MOBILE ONLY: This map section is visible on mobile and hidden on desktop (md:hc-hidden) */}
|
|
101
113
|
{showMap && (
|
|
102
114
|
<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">
|
|
103
115
|
<img
|
|
@@ -124,4 +136,4 @@ export default React.memo(ListItem, (prevProps, nextProps) => {
|
|
|
124
136
|
prevProps.bodyClassName === nextProps.bodyClassName &&
|
|
125
137
|
prevProps.className === nextProps.className
|
|
126
138
|
);
|
|
127
|
-
});
|
|
139
|
+
});
|
package/src/util/mapIconUtil.js
CHANGED
|
@@ -76,6 +76,16 @@ const customSVGIcon = (
|
|
|
76
76
|
</svg>
|
|
77
77
|
`;
|
|
78
78
|
break;
|
|
79
|
+
case placeTypes.AIRPORT:
|
|
80
|
+
svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" width="80" height="80">
|
|
81
|
+
<!-- Blue Background Circle -->
|
|
82
|
+
<circle cx="480" cy="-480" r="480" fill="#0470FF"/>
|
|
83
|
+
|
|
84
|
+
<!-- White Airplane Icon -->
|
|
85
|
+
<path fill="#FFFFFF" d="M280-80v-100l120-84v-144L80-280v-120l320-224v-176q0-33 23.5-56.5T480-880q33 0 56.5 23.5T560-800v176l320 224v120L560-408v144l120 84v100l-200-60-200 60Z"/>
|
|
86
|
+
</svg>
|
|
87
|
+
`;
|
|
88
|
+
break;
|
|
79
89
|
case placeTypes.TRANSIT_STATION:
|
|
80
90
|
svg = `<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
81
91
|
viewBox="0 0 60.8 89.6" preserveAspectRatio="xMidYMid meet" style="enable-background:new 0 0 60.8 89.6;" xml:space="preserve">
|
|
@@ -150,19 +160,33 @@ export const iconProps = () => {
|
|
|
150
160
|
};
|
|
151
161
|
};
|
|
152
162
|
|
|
153
|
-
export const markerIcon = markerConfigs => {
|
|
163
|
+
export const markerIcon = (markerConfigs, count = 0) => {
|
|
164
|
+
const svg = `
|
|
165
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="-6 -4 24 24">
|
|
166
|
+
<path d="${iconPath}" fill="${markerConfigs.fillColor}"/>
|
|
167
|
+
<text x="5.5" y="8" font-family="Arial" font-size="5" text-anchor="middle" fill="white">${count}</text>
|
|
168
|
+
</svg>
|
|
169
|
+
`;
|
|
170
|
+
|
|
154
171
|
return {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
172
|
+
url: `data:image/svg+xml;utf8,${encodeURIComponent(svg)}`,
|
|
173
|
+
scaledSize: new window.google.maps.Size(55, 55),
|
|
174
|
+
anchor: new window.google.maps.Point(18, 25)
|
|
158
175
|
};
|
|
159
176
|
};
|
|
160
177
|
|
|
161
|
-
export const markerIconSelected = markerConfigs => {
|
|
178
|
+
export const markerIconSelected = (markerConfigs, count = 0) => {
|
|
179
|
+
const svg = `
|
|
180
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="-6 -4 24 24">
|
|
181
|
+
<path d="${iconPath}" fill="${markerConfigs.selectedFillColor}"/>
|
|
182
|
+
<text x="5.5" y="8" font-family="Arial" font-size="5" text-anchor="middle" fill="white">${count}</text>
|
|
183
|
+
</svg>
|
|
184
|
+
`;
|
|
185
|
+
|
|
162
186
|
return {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
187
|
+
url: `data:image/svg+xml;utf8,${encodeURIComponent(svg)}`,
|
|
188
|
+
scaledSize: new window.google.maps.Size(50, 50),
|
|
189
|
+
anchor: new window.google.maps.Point(12, 17)
|
|
166
190
|
};
|
|
167
191
|
};
|
|
168
192
|
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import Grid from '~/components/modules/grid';
|
|
4
|
-
import Icon from '~/components/modules/icon';
|
|
5
|
-
import PillWrapper from '~/components/modules/buttons/pill-wrapper';
|
|
6
|
-
|
|
7
|
-
import { capitalize } from '~/util/stringUtils';
|
|
8
|
-
|
|
9
|
-
const FieldMapper = ({
|
|
10
|
-
item,
|
|
11
|
-
fieldsShown,
|
|
12
|
-
specialFeatures,
|
|
13
|
-
handleFavouriteClick,
|
|
14
|
-
isFavorite,
|
|
15
|
-
includeFavorite = true
|
|
16
|
-
}) => {
|
|
17
|
-
const orderedFields = fieldsShown.filter(field => field in item.fields);
|
|
18
|
-
|
|
19
|
-
const specialFeaturePills = field => {
|
|
20
|
-
return field === 'position' && specialFeatures &&
|
|
21
|
-
Object.entries(specialFeatures).map(([featureKey, featureLabel]) => {
|
|
22
|
-
return item.fields[featureKey] == 1 && (
|
|
23
|
-
<PillWrapper key={featureKey}>{featureLabel}</PillWrapper>
|
|
24
|
-
);
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<>
|
|
30
|
-
{orderedFields.map((field, index) => {
|
|
31
|
-
let value = item.fields[field];
|
|
32
|
-
return (
|
|
33
|
-
<Grid.Item
|
|
34
|
-
key={field}
|
|
35
|
-
className={`
|
|
36
|
-
hc-hidden md:hc-block hc-px-2
|
|
37
|
-
${index === 0 ? "hc-pl-7" : ""}
|
|
38
|
-
${field.toLowerCase() === "position" ? "hc-col-span-4 hc-text-balance hc-font-semibold" : (field.toLowerCase() === "state" || field.toLowerCase() == "favorite") ? "hc-col-span-1" : "hc-col-span-2"}
|
|
39
|
-
`}
|
|
40
|
-
>
|
|
41
|
-
<span className="hc-sr-only">{capitalize(field)}</span>
|
|
42
|
-
{value}
|
|
43
|
-
<br />
|
|
44
|
-
{specialFeaturePills(field)}
|
|
45
|
-
</Grid.Item>
|
|
46
|
-
);
|
|
47
|
-
})}
|
|
48
|
-
<Grid.Item className="md:hc-hidden">
|
|
49
|
-
{fieldsShown.includes("position") &&
|
|
50
|
-
<>
|
|
51
|
-
<div className="hc-flex hc-items-start">
|
|
52
|
-
<div className="hc-flex hc-justify-between hc-items-center hc-min-w-[100%]"> {}
|
|
53
|
-
<h3 className="hc-font-bold hc-mb-3 hc-flex-1">{item.fields.position}</h3>
|
|
54
|
-
{includeFavorite && <div className="hc-flex hc-justify-end hc-pb-2">
|
|
55
|
-
<Icon
|
|
56
|
-
icon={isFavorite ? "mdi:heart" : "mdi:heart-outline"}
|
|
57
|
-
size="hc-size-3.5"
|
|
58
|
-
iconClasses={isFavorite ? "hc-text-primary" : ""}
|
|
59
|
-
className={`hc-transition-opacity hc-duration-300 hc-cursor-pointer
|
|
60
|
-
${isFavorite ? "hc-opacity-100" : "hc-text-uiText/60 group-hover:hc-opacity-100"}
|
|
61
|
-
`}
|
|
62
|
-
onClick={e => handleFavouriteClick(e, item)}
|
|
63
|
-
/>
|
|
64
|
-
</div>
|
|
65
|
-
}
|
|
66
|
-
</div>
|
|
67
|
-
</div>
|
|
68
|
-
{specialFeatures && <div className='hc-pb-4'>{specialFeaturePills("position", true)} </div>}
|
|
69
|
-
</>
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
<ul className="hc-space-y-2 hc-text-xs">
|
|
73
|
-
{[
|
|
74
|
-
{
|
|
75
|
-
field: "categoryClass",
|
|
76
|
-
name: "categoryClass",
|
|
77
|
-
icon: "icon-park-solid:tree-list"
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
field: "category",
|
|
81
|
-
name: "Category",
|
|
82
|
-
icon: "icon-park-solid:tree-list"
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
field: "schedule",
|
|
86
|
-
name: "Schedule",
|
|
87
|
-
icon: "gravity-ui:clock-fill"
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
field: "city",
|
|
91
|
-
name: "Location",
|
|
92
|
-
icon: "fluent:location-16-filled"
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
field: "state",
|
|
96
|
-
name: "Location",
|
|
97
|
-
icon: "fluent:location-16-filled"
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
field: "cityState",
|
|
101
|
-
name: "Location",
|
|
102
|
-
icon: "fluent:location-16-filled"
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
field: "travelTime",
|
|
106
|
-
name: "Commute",
|
|
107
|
-
icon: "ri:pin-distance-fill"
|
|
108
|
-
}
|
|
109
|
-
].map(listItem => (
|
|
110
|
-
(fieldsShown.includes(listItem.field) && item.fields[listItem.field]) &&
|
|
111
|
-
<li
|
|
112
|
-
key={listItem.field}
|
|
113
|
-
className="hc-flex hc-gap-2"
|
|
114
|
-
>
|
|
115
|
-
<Icon
|
|
116
|
-
icon={listItem.icon}
|
|
117
|
-
size="hc-size-3.5"
|
|
118
|
-
className="hc-text-uiAccent/30"
|
|
119
|
-
/>
|
|
120
|
-
<span className="hc-sr-only">{listItem.name}</span>
|
|
121
|
-
{item.fields[listItem.field]}
|
|
122
|
-
</li>
|
|
123
|
-
))}
|
|
124
|
-
</ul>
|
|
125
|
-
</Grid.Item>
|
|
126
|
-
</>
|
|
127
|
-
);
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
export default FieldMapper;
|