@abcagency/hc-ui-components 1.2.8 → 1.2.9
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/_virtual/_rollupPluginBabelHelpers.js +516 -516
- package/dist/apis/hcApi.js +189 -189
- package/dist/apis/hcApi.js.map +1 -1
- package/dist/clientToken.js +10 -10
- package/dist/clientToken.js.map +1 -1
- package/dist/components/HireControlMap.js +135 -135
- package/dist/components/HireControlMap.js.map +1 -1
- package/dist/components/modules/accordions/MapAccordionItem.js +76 -76
- package/dist/components/modules/accordions/MapAccordionItem.js.map +1 -1
- package/dist/components/modules/accordions/default.js +108 -108
- package/dist/components/modules/accordions/default.js.map +1 -1
- package/dist/components/modules/accordions/filterItem.js +50 -50
- package/dist/components/modules/accordions/filterItem.js.map +1 -1
- package/dist/components/modules/accordions/filters.js +46 -46
- package/dist/components/modules/accordions/filters.js.map +1 -1
- package/dist/components/modules/buttons/button-group-apply.js +87 -87
- package/dist/components/modules/buttons/button-group-apply.js.map +1 -1
- package/dist/components/modules/buttons/commute-pill.js +18 -18
- package/dist/components/modules/buttons/commute-pill.js.map +1 -1
- package/dist/components/modules/buttons/default.js +145 -145
- package/dist/components/modules/buttons/default.js.map +1 -1
- package/dist/components/modules/buttons/items-pill.js +23 -23
- package/dist/components/modules/buttons/items-pill.js.map +1 -1
- package/dist/components/modules/buttons/pill-wrapper.js +20 -20
- package/dist/components/modules/buttons/pill-wrapper.js.map +1 -1
- package/dist/components/modules/buttons/show-all-button.js +39 -39
- package/dist/components/modules/buttons/show-all-button.js.map +1 -1
- package/dist/components/modules/cards/default.js +102 -102
- package/dist/components/modules/cards/default.js.map +1 -1
- package/dist/components/modules/cards/filter.js +38 -38
- package/dist/components/modules/cards/filter.js.map +1 -1
- package/dist/components/modules/dialogs/apply-dialog.js +46 -46
- package/dist/components/modules/dialogs/apply-dialog.js.map +1 -1
- package/dist/components/modules/filter/commute.js +184 -184
- package/dist/components/modules/filter/commute.js.map +1 -1
- package/dist/components/modules/filter/index.js +79 -79
- package/dist/components/modules/filter/index.js.map +1 -1
- package/dist/components/modules/filter/item.js +71 -71
- package/dist/components/modules/filter/item.js.map +1 -1
- package/dist/components/modules/filter/location.js +68 -68
- package/dist/components/modules/filter/location.js.map +1 -1
- package/dist/components/modules/filter/points-of-interest.js +38 -38
- package/dist/components/modules/filter/points-of-interest.js.map +1 -1
- package/dist/components/modules/filter/radio-item.js +46 -46
- package/dist/components/modules/filter/radio-item.js.map +1 -1
- package/dist/components/modules/filter/search.js +83 -83
- package/dist/components/modules/filter/search.js.map +1 -1
- package/dist/components/modules/filter/sort.js +93 -93
- package/dist/components/modules/filter/sort.js.map +1 -1
- package/dist/components/modules/grid.js +39 -39
- package/dist/components/modules/grid.js.map +1 -1
- package/dist/components/modules/icon.js +23 -23
- package/dist/components/modules/icon.js.map +1 -1
- package/dist/components/modules/jobListing/listing-details.js +71 -71
- package/dist/components/modules/jobListing/listing-details.js.map +1 -1
- package/dist/components/modules/maps/info-window-card.js +14 -14
- package/dist/components/modules/maps/info-window-card.js.map +1 -1
- package/dist/components/modules/maps/info-window-content.js +49 -39
- package/dist/components/modules/maps/info-window-content.js.map +1 -1
- package/dist/components/modules/maps/list/field-mapper.js +88 -88
- package/dist/components/modules/maps/list/field-mapper.js.map +1 -1
- package/dist/components/modules/maps/list/header-item.js +59 -59
- package/dist/components/modules/maps/list/header-item.js.map +1 -1
- package/dist/components/modules/maps/list/header.js +37 -37
- package/dist/components/modules/maps/list/header.js.map +1 -1
- package/dist/components/modules/maps/list/index.js +93 -93
- package/dist/components/modules/maps/list/index.js.map +1 -1
- package/dist/components/modules/maps/list/item-expand-card/index.js +16 -16
- package/dist/components/modules/maps/list/item-expand-card/index.js.map +1 -1
- package/dist/components/modules/maps/list/item-expand-card/recruiter-contact-nav.js +38 -38
- package/dist/components/modules/maps/list/item-expand-card/recruiter-contact-nav.js.map +1 -1
- package/dist/components/modules/maps/list/item-expand-card/recruiter-details.js +40 -40
- package/dist/components/modules/maps/list/item-expand-card/recruiter-details.js.map +1 -1
- package/dist/components/modules/maps/list/item-expand-card/recruiter-headshot.js +20 -20
- package/dist/components/modules/maps/list/item-expand-card/recruiter-headshot.js.map +1 -1
- package/dist/components/modules/maps/list/list-item/index.js +98 -98
- package/dist/components/modules/maps/list/list-item/index.js.map +1 -1
- package/dist/components/modules/maps/map-list.js +57 -57
- package/dist/components/modules/maps/map-list.js.map +1 -1
- package/dist/components/modules/maps/map-marker.js +85 -85
- package/dist/components/modules/maps/map-marker.js.map +1 -1
- package/dist/components/modules/maps/map.js +201 -201
- package/dist/components/modules/maps/map.js.map +1 -1
- package/dist/components/modules/maps/place-marker.js +37 -37
- package/dist/components/modules/maps/place-marker.js.map +1 -1
- package/dist/components/modules/maps/tabs.js +84 -84
- package/dist/components/modules/maps/tabs.js.map +1 -1
- package/dist/constants/placeTypes.js +11 -11
- package/dist/constants/placeTypes.js.map +1 -1
- package/dist/contexts/mapContext.js +133 -133
- package/dist/contexts/mapContext.js.map +1 -1
- package/dist/contexts/mapListContext.js +280 -280
- package/dist/contexts/mapListContext.js.map +1 -1
- package/dist/contexts/placesContext.js +152 -152
- package/dist/contexts/placesContext.js.map +1 -1
- package/dist/hooks/useList.js +119 -119
- package/dist/hooks/useList.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/services/_virtual/_rollupPluginBabelHelpers.js +372 -372
- package/dist/services/apis/hcApi.js +189 -189
- package/dist/services/apis/hcApi.js.map +1 -1
- package/dist/services/clientToken.js +7 -7
- package/dist/services/clientToken.js.map +1 -1
- package/dist/services/configService.js +33 -33
- package/dist/services/configService.js.map +1 -1
- package/dist/services/googlePlacesNearbyService.js +61 -61
- package/dist/services/googlePlacesNearbyService.js.map +1 -1
- package/dist/services/listingAggregatorService.js +56 -56
- package/dist/services/listingAggregatorService.js.map +1 -1
- package/dist/services/listingEntityService.js +36 -36
- package/dist/services/listingEntityService.js.map +1 -1
- package/dist/services/listingService.js +64 -64
- package/dist/services/listingService.js.map +1 -1
- package/dist/services/recruiterService.js +36 -36
- package/dist/services/recruiterService.js.map +1 -1
- package/dist/services/styles/index.css +2 -2
- package/dist/styles/index.css +2 -2
- package/dist/util/filterUtil.js +213 -213
- package/dist/util/filterUtil.js.map +1 -1
- package/dist/util/loading.js +16 -16
- package/dist/util/loading.js.map +1 -1
- package/dist/util/localStorageUtil.js +32 -32
- package/dist/util/localStorageUtil.js.map +1 -1
- package/dist/util/mapIconUtil.js +73 -73
- package/dist/util/mapIconUtil.js.map +1 -1
- package/dist/util/mapUtil.js +76 -76
- package/dist/util/mapUtil.js.map +1 -1
- package/dist/util/sortUtil.js +33 -33
- package/dist/util/sortUtil.js.map +1 -1
- package/dist/util/stringUtils.js +9 -9
- package/dist/util/stringUtils.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,98 +1,98 @@
|
|
|
1
|
-
import { objectWithoutProperties as _objectWithoutProperties, extends as _extends, toConsumableArray as _toConsumableArray } from '../../../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import React, { forwardRef } from 'react';
|
|
3
|
-
import Grid from '../../../grid.js';
|
|
4
|
-
import IconContained from '../../../icon.js';
|
|
5
|
-
import FieldMapper from '../field-mapper.js';
|
|
6
|
-
import { useMapList } from '../../../../../contexts/mapListContext.js';
|
|
7
|
-
|
|
8
|
-
var _excluded = ["isActive", "bodyClassName", "className", "item", "fieldsShown", "specialFeatures", "onItemSelected", "showMap", "setMobileTab", "favorites", "setFavorites"];
|
|
9
|
-
var ListItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
10
|
-
var _item$mapDetails, _item$mapDetails2, _item$mapDetails3, _item$mapDetails4;
|
|
11
|
-
var isActive = _ref.isActive,
|
|
12
|
-
bodyClassName = _ref.bodyClassName,
|
|
13
|
-
className = _ref.className,
|
|
14
|
-
item = _ref.item,
|
|
15
|
-
fieldsShown = _ref.fieldsShown,
|
|
16
|
-
specialFeatures = _ref.specialFeatures,
|
|
17
|
-
onItemSelected = _ref.onItemSelected,
|
|
18
|
-
showMap = _ref.showMap,
|
|
19
|
-
setMobileTab = _ref.setMobileTab,
|
|
20
|
-
favorites = _ref.favorites,
|
|
21
|
-
setFavorites = _ref.setFavorites,
|
|
22
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
23
|
-
var _useMapList = useMapList(),
|
|
24
|
-
siteConfig = _useMapList.siteConfig;
|
|
25
|
-
var mapPinColor = siteConfig.colors.primary.replace("#", "");
|
|
26
|
-
var handleClick = function handleClick() {
|
|
27
|
-
if (onItemSelected) {
|
|
28
|
-
onItemSelected(item);
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
var isFavorite = favorites.includes(item.id);
|
|
32
|
-
var handleFavouriteClick = function handleFavouriteClick(event) {
|
|
33
|
-
event.stopPropagation();
|
|
34
|
-
var updatedFavorites;
|
|
35
|
-
if (isFavorite) {
|
|
36
|
-
updatedFavorites = favorites.filter(function (fav) {
|
|
37
|
-
return fav !== item.id;
|
|
38
|
-
});
|
|
39
|
-
} else {
|
|
40
|
-
updatedFavorites = [].concat(_toConsumableArray(favorites), [item.id]);
|
|
41
|
-
}
|
|
42
|
-
isFavorite = !isFavorite;
|
|
43
|
-
setFavorites(updatedFavorites);
|
|
44
|
-
};
|
|
45
|
-
return /*#__PURE__*/React.createElement("button", _extends({
|
|
46
|
-
ref: ref,
|
|
47
|
-
onClick: handleClick,
|
|
48
|
-
className: "\n\t\t\t\t\thc-group hc-relative hc-flex md:hc-flex-col hc-w-full md:hc-pl-4 hc-text-left hc-bg-clip-border hc-border hc-border-transparent hc-break-words hc-overflow-hidden hc-cursor-pointer hc-transition-colors hover:hc-bg-uiAccent/5 focus:hover:hc-bg-uiAccent/5\n\t\t\t\t\t".concat(isActive ? "hc-bg-uiAccent/5 hc-border-secondary hc-border" : "hc-text-uiText hc-bg-white", "\n\t\t\t\t\t").concat(className !== null && className !== void 0 ? className : "", "\n ")
|
|
49
|
-
}, props), /*#__PURE__*/React.createElement(Grid, {
|
|
50
|
-
columns: "hc-grid-flow-col hc-auto-cols-fr",
|
|
51
|
-
gap: "hc-gap-2",
|
|
52
|
-
isAnimated: false,
|
|
53
|
-
className: "\n\t\t\t\t\t\thc-block md:hc-grid hc-p-2 hc-ps-4 hc-w-full hc-grow hc-leading-tight hc-text-sm md:hc-text-xs lg:hc-text-sm\n\t\t\t\t\t\t".concat(bodyClassName !== null && bodyClassName !== void 0 ? bodyClassName : "", "\n\t\t\t\t\t")
|
|
54
|
-
}, /*#__PURE__*/React.createElement(Grid.Item, {
|
|
55
|
-
className: "hc-hidden md:hc-block md:hc-absolute md:hc-left-1.5 hc-top-1.5"
|
|
56
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
57
|
-
className: "hc-sr-only"
|
|
58
|
-
}, "Expand row"), /*#__PURE__*/React.createElement(IconContained, {
|
|
59
|
-
icon: "fluent-emoji-high-contrast:plus",
|
|
60
|
-
size: "hc-size-2.5",
|
|
61
|
-
className: "\n\t\t\t\t\t\t\t\thc-opacity-0 hc-text-uiText/60 hc-transition group-hover:hc-opacity-100 group-active:hc-opacity-100\n\t\t\t\t\t\t\t\t".concat(isActive ? "hc-opacity-100 hc-rotate-45" : "", "\n\t\t\t\t\t\t\t")
|
|
62
|
-
})), /*#__PURE__*/React.createElement(FieldMapper, {
|
|
63
|
-
item: item,
|
|
64
|
-
fieldsShown: fieldsShown,
|
|
65
|
-
specialFeatures: specialFeatures,
|
|
66
|
-
isFavorite: isFavorite,
|
|
67
|
-
handleFavouriteClick: handleFavouriteClick
|
|
68
|
-
}), /*#__PURE__*/React.createElement(Grid.Item, {
|
|
69
|
-
key: "favorites",
|
|
70
|
-
className: "hc-hidden md:hc-block hc-col-span-1"
|
|
71
|
-
}, /*#__PURE__*/React.createElement(IconContained, {
|
|
72
|
-
icon: isFavorite ? "mdi:heart" : "mdi:heart-outline",
|
|
73
|
-
size: "hc-size-3.5",
|
|
74
|
-
iconClasses: isFavorite ? "hc-text-primary" : "",
|
|
75
|
-
title: !isFavorite ? 'Add job to favorites' : 'Remove job from favorites',
|
|
76
|
-
className: "\n\t\t\t\t\t\t\thc-pr-2 hc-transition-opacity hc-duration-300 hc-cursor-pointer hc-opacity-100\"\n\t\t\t\t\t\t",
|
|
77
|
-
onClick: function onClick(e) {
|
|
78
|
-
return handleFavouriteClick(e);
|
|
79
|
-
}
|
|
80
|
-
}))), showMap && /*#__PURE__*/React.createElement("div", {
|
|
81
|
-
onClick: function onClick() {
|
|
82
|
-
setMobileTab("mapTab");
|
|
83
|
-
handleClick();
|
|
84
|
-
},
|
|
85
|
-
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"
|
|
86
|
-
}, /*#__PURE__*/React.createElement("img", {
|
|
87
|
-
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"),
|
|
88
|
-
alt: "Map of location for ".concat(item.fields.position),
|
|
89
|
-
className: "hc-w-full hc-h-full hc-object-cover"
|
|
90
|
-
})));
|
|
91
|
-
});
|
|
92
|
-
ListItem.displayName = "ListItem";
|
|
93
|
-
var ListItem$1 = /*#__PURE__*/React.memo(ListItem, function (prevProps, nextProps) {
|
|
94
|
-
return (prevProps.isActive === nextProps.isActive || prevProps.isActive !== nextProps.isActive) && prevProps.bodyClassName === nextProps.bodyClassName && prevProps.className === nextProps.className && prevProps.fieldsShown === nextProps.fieldsShown && prevProps.item.id === nextProps.item.id;
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
export { ListItem$1 as default };
|
|
98
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import { objectWithoutProperties as _objectWithoutProperties, extends as _extends, toConsumableArray as _toConsumableArray } from '../../../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import React, { forwardRef } from 'react';
|
|
3
|
+
import Grid from '../../../grid.js';
|
|
4
|
+
import IconContained from '../../../icon.js';
|
|
5
|
+
import FieldMapper from '../field-mapper.js';
|
|
6
|
+
import { useMapList } from '../../../../../contexts/mapListContext.js';
|
|
7
|
+
|
|
8
|
+
var _excluded = ["isActive", "bodyClassName", "className", "item", "fieldsShown", "specialFeatures", "onItemSelected", "showMap", "setMobileTab", "favorites", "setFavorites"];
|
|
9
|
+
var ListItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
10
|
+
var _item$mapDetails, _item$mapDetails2, _item$mapDetails3, _item$mapDetails4;
|
|
11
|
+
var isActive = _ref.isActive,
|
|
12
|
+
bodyClassName = _ref.bodyClassName,
|
|
13
|
+
className = _ref.className,
|
|
14
|
+
item = _ref.item,
|
|
15
|
+
fieldsShown = _ref.fieldsShown,
|
|
16
|
+
specialFeatures = _ref.specialFeatures,
|
|
17
|
+
onItemSelected = _ref.onItemSelected,
|
|
18
|
+
showMap = _ref.showMap,
|
|
19
|
+
setMobileTab = _ref.setMobileTab,
|
|
20
|
+
favorites = _ref.favorites,
|
|
21
|
+
setFavorites = _ref.setFavorites,
|
|
22
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
23
|
+
var _useMapList = useMapList(),
|
|
24
|
+
siteConfig = _useMapList.siteConfig;
|
|
25
|
+
var mapPinColor = siteConfig.colors.primary.replace("#", "");
|
|
26
|
+
var handleClick = function handleClick() {
|
|
27
|
+
if (onItemSelected) {
|
|
28
|
+
onItemSelected(item);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
var isFavorite = favorites.includes(item.id);
|
|
32
|
+
var handleFavouriteClick = function handleFavouriteClick(event) {
|
|
33
|
+
event.stopPropagation();
|
|
34
|
+
var updatedFavorites;
|
|
35
|
+
if (isFavorite) {
|
|
36
|
+
updatedFavorites = favorites.filter(function (fav) {
|
|
37
|
+
return fav !== item.id;
|
|
38
|
+
});
|
|
39
|
+
} else {
|
|
40
|
+
updatedFavorites = [].concat(_toConsumableArray(favorites), [item.id]);
|
|
41
|
+
}
|
|
42
|
+
isFavorite = !isFavorite;
|
|
43
|
+
setFavorites(updatedFavorites);
|
|
44
|
+
};
|
|
45
|
+
return /*#__PURE__*/React.createElement("button", _extends({
|
|
46
|
+
ref: ref,
|
|
47
|
+
onClick: handleClick,
|
|
48
|
+
className: "\n\t\t\t\t\thc-group hc-relative hc-flex md:hc-flex-col hc-w-full md:hc-pl-4 hc-text-left hc-bg-clip-border hc-border hc-border-transparent hc-break-words hc-overflow-hidden hc-cursor-pointer hc-transition-colors hover:hc-bg-uiAccent/5 focus:hover:hc-bg-uiAccent/5\n\t\t\t\t\t".concat(isActive ? "hc-bg-uiAccent/5 hc-border-secondary hc-border" : "hc-text-uiText hc-bg-white", "\n\t\t\t\t\t").concat(className !== null && className !== void 0 ? className : "", "\n ")
|
|
49
|
+
}, props), /*#__PURE__*/React.createElement(Grid, {
|
|
50
|
+
columns: "hc-grid-flow-col hc-auto-cols-fr",
|
|
51
|
+
gap: "hc-gap-2",
|
|
52
|
+
isAnimated: false,
|
|
53
|
+
className: "\n\t\t\t\t\t\thc-block md:hc-grid hc-p-2 hc-ps-4 hc-w-full hc-grow hc-leading-tight hc-text-sm md:hc-text-xs lg:hc-text-sm\n\t\t\t\t\t\t".concat(bodyClassName !== null && bodyClassName !== void 0 ? bodyClassName : "", "\n\t\t\t\t\t")
|
|
54
|
+
}, /*#__PURE__*/React.createElement(Grid.Item, {
|
|
55
|
+
className: "hc-hidden md:hc-block md:hc-absolute md:hc-left-1.5 hc-top-1.5"
|
|
56
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
57
|
+
className: "hc-sr-only"
|
|
58
|
+
}, "Expand row"), /*#__PURE__*/React.createElement(IconContained, {
|
|
59
|
+
icon: "fluent-emoji-high-contrast:plus",
|
|
60
|
+
size: "hc-size-2.5",
|
|
61
|
+
className: "\n\t\t\t\t\t\t\t\thc-opacity-0 hc-text-uiText/60 hc-transition group-hover:hc-opacity-100 group-active:hc-opacity-100\n\t\t\t\t\t\t\t\t".concat(isActive ? "hc-opacity-100 hc-rotate-45" : "", "\n\t\t\t\t\t\t\t")
|
|
62
|
+
})), /*#__PURE__*/React.createElement(FieldMapper, {
|
|
63
|
+
item: item,
|
|
64
|
+
fieldsShown: fieldsShown,
|
|
65
|
+
specialFeatures: specialFeatures,
|
|
66
|
+
isFavorite: isFavorite,
|
|
67
|
+
handleFavouriteClick: handleFavouriteClick
|
|
68
|
+
}), /*#__PURE__*/React.createElement(Grid.Item, {
|
|
69
|
+
key: "favorites",
|
|
70
|
+
className: "hc-hidden md:hc-block hc-col-span-1"
|
|
71
|
+
}, /*#__PURE__*/React.createElement(IconContained, {
|
|
72
|
+
icon: isFavorite ? "mdi:heart" : "mdi:heart-outline",
|
|
73
|
+
size: "hc-size-3.5",
|
|
74
|
+
iconClasses: isFavorite ? "hc-text-primary" : "",
|
|
75
|
+
title: !isFavorite ? 'Add job to favorites' : 'Remove job from favorites',
|
|
76
|
+
className: "\n\t\t\t\t\t\t\thc-pr-2 hc-transition-opacity hc-duration-300 hc-cursor-pointer hc-opacity-100\"\n\t\t\t\t\t\t",
|
|
77
|
+
onClick: function onClick(e) {
|
|
78
|
+
return handleFavouriteClick(e);
|
|
79
|
+
}
|
|
80
|
+
}))), showMap && /*#__PURE__*/React.createElement("div", {
|
|
81
|
+
onClick: function onClick() {
|
|
82
|
+
setMobileTab("mapTab");
|
|
83
|
+
handleClick();
|
|
84
|
+
},
|
|
85
|
+
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"
|
|
86
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
87
|
+
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"),
|
|
88
|
+
alt: "Map of location for ".concat(item.fields.position),
|
|
89
|
+
className: "hc-w-full hc-h-full hc-object-cover"
|
|
90
|
+
})));
|
|
91
|
+
});
|
|
92
|
+
ListItem.displayName = "ListItem";
|
|
93
|
+
var ListItem$1 = /*#__PURE__*/React.memo(ListItem, function (prevProps, nextProps) {
|
|
94
|
+
return (prevProps.isActive === nextProps.isActive || prevProps.isActive !== nextProps.isActive) && prevProps.bodyClassName === nextProps.bodyClassName && prevProps.className === nextProps.className && prevProps.fieldsShown === nextProps.fieldsShown && prevProps.item.id === nextProps.item.id;
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
export { ListItem$1 as default };
|
|
98
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../src/components/modules/maps/list/list-item/index.js"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport Grid from '~/components/modules/grid';\nimport Icon from '~/components/modules/icon';\nimport FieldMapper from '~/components/modules/maps/list/field-mapper';\n\nimport { useMapList } from '~/contexts/mapListContext';\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\tfavorites,\n\t\t\tsetFavorites,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst { siteConfig } = useMapList();\n\t\tconst mapPinColor = 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\n\t\tlet isFavorite = favorites.includes(item.id);\n\n\t\tconst handleFavouriteClick = event => {\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\tsetFavorites(updatedFavorites);\n\n\t\t};\n\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\t\thc-group hc-relative hc-flex md:hc-flex-col hc-w-full md:hc-pl-4 hc-text-left hc-bg-clip-border hc-border hc-border-transparent hc-break-words hc-overflow-hidden hc-cursor-pointer hc-transition-colors hover:hc-bg-uiAccent/5 focus:hover:hc-bg-uiAccent/5\n\t\t\t\t\t${isActive ? \"hc-bg-uiAccent/5 hc-border-secondary hc-border\" : \"hc-text-uiText hc-bg-white\"}\n\t\t\t\t\t${className ?? \"\"}\n `}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t<Grid\n\t\t\t\t\tcolumns=\"hc-grid-flow-col hc-auto-cols-fr\"\n\t\t\t\t\tgap=\"hc-gap-2\"\n\t\t\t\t\tisAnimated={false}\n\t\t\t\t\tclassName={`\n\t\t\t\t\t\thc-block md:hc-grid hc-p-2 hc-ps-4 hc-w-full hc-grow hc-leading-tight hc-text-sm md:hc-text-xs lg:hc-text-sm\n\t\t\t\t\t\t${bodyClassName ?? \"\"}\n\t\t\t\t\t`}\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\t\t\t\t\t\t\t\thc-opacity-0 hc-text-uiText/60 hc-transition group-hover:hc-opacity-100 group-active:hc-opacity-100\n\t\t\t\t\t\t\t\t${isActive ? \"hc-opacity-100 hc-rotate-45\" : \"\"}\n\t\t\t\t\t\t\t`}\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t</Grid.Item>\n\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\thandleFavouriteClick={handleFavouriteClick}\n\t\t\t\t\t/>\n\t\t\t\t\t<Grid.Item\n\t\t\t\t\t\tkey={\"favorites\"}\n\t\t\t\t\t\tclassName=\"hc-hidden md:hc-block hc-col-span-1\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon={isFavorite ? \"mdi:heart\" : \"mdi:heart-outline\"}\n\t\t\t\t\t\t\tsize=\"hc-size-3.5\"\n\t\t\t\t\t\t\ticonClasses={isFavorite ? \"hc-text-primary\" : \"\"}\n\t\t\t\t\t\t\ttitle={!isFavorite ? 'Add job to favorites' : 'Remove job from favorites'}\n\t\t\t\t\t\t\tclassName={`\n\t\t\t\t\t\t\thc-pr-2 hc-transition-opacity hc-duration-300 hc-cursor-pointer hc-opacity-100\"\n\t\t\t\t\t\t`}\n\t\t\t\t\t\t\tonClick={e => handleFavouriteClick(e)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Grid.Item>\n\t\t\t\t</Grid>\n\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\t(prevProps.isActive === nextProps.isActive ||\n\t\t\tprevProps.isActive !== nextProps.isActive) &&\n\t\tprevProps.bodyClassName === nextProps.bodyClassName &&\n\t\tprevProps.className === nextProps.className &&\n\t\tprevProps.fieldsShown === nextProps.fieldsShown &&\n\t\tprevProps.item.id === nextProps.item.id\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","favorites","setFavorites","props","_objectWithoutProperties","_excluded","_useMapList","useMapList","siteConfig","mapPinColor","colors","primary","replace","handleClick","isFavorite","includes","id","handleFavouriteClick","event","stopPropagation","updatedFavorites","filter","fav","concat","_toConsumableArray","React","createElement","_extends","onClick","Grid","columns","gap","isAnimated","Item","Icon","icon","size","FieldMapper","key","iconClasses","title","e","src","mapDetails","latitude","longitude","alt","fields","position","displayName","memo","prevProps","nextProps"],"mappings":";;;;;;;;AAQA,IAAMA,QAAQ,gBAAGC,UAAU,CAC1B,UAAAC,IAAA,EAeCC,GAAG,EACC;AAAA,EAAA,IAAAC,gBAAA,EAAAC,iBAAA,EAAAC,iBAAA,EAAAC,iBAAA,CAAA;AAAA,EAAA,IAdHC,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,SAAS,GAAAf,IAAA,CAATe,SAAS;IACTC,YAAY,GAAAhB,IAAA,CAAZgB,YAAY;AACTC,IAAAA,KAAK,GAAAC,wBAAA,CAAAlB,IAAA,EAAAmB,SAAA,CAAA,CAAA;AAIT,EAAA,IAAAC,WAAA,GAAuBC,UAAU,EAAE;IAA3BC,UAAU,GAAAF,WAAA,CAAVE,UAAU,CAAA;AAClB,EAAA,IAAMC,WAAW,GAAGD,UAAU,CAACE,MAAM,CAACC,OAAO,CAACC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;AA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BAAA,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,KAAK,CAACyB,IAAI,CAAClE,QAAQ,EAAE,UAACmE,SAAS,EAAEC,SAAS,EAAK;EAC7D,OACC,CAACD,SAAS,CAAC3D,QAAQ,KAAK4D,SAAS,CAAC5D,QAAQ,IACzC2D,SAAS,CAAC3D,QAAQ,KAAK4D,SAAS,CAAC5D,QAAQ,KAC1C2D,SAAS,CAAC1D,aAAa,KAAK2D,SAAS,CAAC3D,aAAa,IACnD0D,SAAS,CAACzD,SAAS,KAAK0D,SAAS,CAAC1D,SAAS,IAC3CyD,SAAS,CAACvD,WAAW,KAAKwD,SAAS,CAACxD,WAAW,IAC/CuD,SAAS,CAACxD,IAAI,CAACqB,EAAE,KAAKoC,SAAS,CAACzD,IAAI,CAACqB,EAAE,CAAA;AAEzC,CAAC,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../src/components/modules/maps/list/list-item/index.js"],"sourcesContent":["import React, { forwardRef } from 'react';\r\n\r\nimport Grid from '~/components/modules/grid';\r\nimport Icon from '~/components/modules/icon';\r\nimport FieldMapper from '~/components/modules/maps/list/field-mapper';\r\n\r\nimport { useMapList } from '~/contexts/mapListContext';\r\n\r\nconst ListItem = forwardRef(\r\n\t(\r\n\t\t{\r\n\t\t\tisActive,\r\n\t\t\tbodyClassName,\r\n\t\t\tclassName,\r\n\t\t\titem,\r\n\t\t\tfieldsShown,\r\n\t\t\tspecialFeatures,\r\n\t\t\tonItemSelected,\r\n\t\t\tshowMap,\r\n\t\t\tsetMobileTab,\r\n\t\t\tfavorites,\r\n\t\t\tsetFavorites,\r\n\t\t\t...props\r\n\t\t},\r\n\t\tref,\r\n\t) => {\r\n\t\tconst { siteConfig } = useMapList();\r\n\t\tconst mapPinColor = siteConfig.colors.primary.replace(\"#\", \"\");\r\n\r\n\t\tconst handleClick = () => {\r\n\t\t\tif (onItemSelected) {\r\n\t\t\t\tonItemSelected(item);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tlet isFavorite = favorites.includes(item.id);\r\n\r\n\t\tconst handleFavouriteClick = event => {\r\n\t\t\tevent.stopPropagation();\r\n\t\t\tlet updatedFavorites;\r\n\t\t\tif (isFavorite) {\r\n\t\t\t\tupdatedFavorites = favorites.filter(fav => fav !== item.id);\r\n\t\t\t} else {\r\n\t\t\t\tupdatedFavorites = [...favorites, item.id];\r\n\t\t\t}\r\n\t\t\tisFavorite = !isFavorite;\r\n\t\t\tsetFavorites(updatedFavorites);\r\n\r\n\t\t};\r\n\r\n\t\treturn (\r\n\t\t\t<button\r\n\t\t\t\tref={ref}\r\n\t\t\t\tonClick={handleClick}\r\n\t\t\t\tclassName={`\r\n\t\t\t\t\thc-group hc-relative hc-flex md:hc-flex-col hc-w-full md:hc-pl-4 hc-text-left hc-bg-clip-border hc-border hc-border-transparent hc-break-words hc-overflow-hidden hc-cursor-pointer hc-transition-colors hover:hc-bg-uiAccent/5 focus:hover:hc-bg-uiAccent/5\r\n\t\t\t\t\t${isActive ? \"hc-bg-uiAccent/5 hc-border-secondary hc-border\" : \"hc-text-uiText hc-bg-white\"}\r\n\t\t\t\t\t${className ?? \"\"}\r\n `}\r\n\t\t\t\t{...props}\r\n\t\t\t>\r\n\t\t\t\t<Grid\r\n\t\t\t\t\tcolumns=\"hc-grid-flow-col hc-auto-cols-fr\"\r\n\t\t\t\t\tgap=\"hc-gap-2\"\r\n\t\t\t\t\tisAnimated={false}\r\n\t\t\t\t\tclassName={`\r\n\t\t\t\t\t\thc-block md:hc-grid hc-p-2 hc-ps-4 hc-w-full hc-grow hc-leading-tight hc-text-sm md:hc-text-xs lg:hc-text-sm\r\n\t\t\t\t\t\t${bodyClassName ?? \"\"}\r\n\t\t\t\t\t`}\r\n\t\t\t\t>\r\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\">\r\n\t\t\t\t\t\t<span className=\"hc-sr-only\">Expand row</span>\r\n\t\t\t\t\t\t<Icon\r\n\t\t\t\t\t\t\ticon=\"fluent-emoji-high-contrast:plus\"\r\n\t\t\t\t\t\t\tsize=\"hc-size-2.5\"\r\n\t\t\t\t\t\t\tclassName={`\r\n\t\t\t\t\t\t\t\thc-opacity-0 hc-text-uiText/60 hc-transition group-hover:hc-opacity-100 group-active:hc-opacity-100\r\n\t\t\t\t\t\t\t\t${isActive ? \"hc-opacity-100 hc-rotate-45\" : \"\"}\r\n\t\t\t\t\t\t\t`}\r\n\t\t\t\t\t\t/>\r\n\r\n\t\t\t\t\t</Grid.Item>\r\n\r\n\t\t\t\t\t<FieldMapper\r\n\t\t\t\t\t\titem={item}\r\n\t\t\t\t\t\tfieldsShown={fieldsShown}\r\n\t\t\t\t\t\tspecialFeatures={specialFeatures}\r\n\t\t\t\t\t\tisFavorite={isFavorite}\r\n\t\t\t\t\t\thandleFavouriteClick={handleFavouriteClick}\r\n\t\t\t\t\t/>\r\n\t\t\t\t\t<Grid.Item\r\n\t\t\t\t\t\tkey={\"favorites\"}\r\n\t\t\t\t\t\tclassName=\"hc-hidden md:hc-block hc-col-span-1\"\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t<Icon\r\n\t\t\t\t\t\t\ticon={isFavorite ? \"mdi:heart\" : \"mdi:heart-outline\"}\r\n\t\t\t\t\t\t\tsize=\"hc-size-3.5\"\r\n\t\t\t\t\t\t\ticonClasses={isFavorite ? \"hc-text-primary\" : \"\"}\r\n\t\t\t\t\t\t\ttitle={!isFavorite ? 'Add job to favorites' : 'Remove job from favorites'}\r\n\t\t\t\t\t\t\tclassName={`\r\n\t\t\t\t\t\t\thc-pr-2 hc-transition-opacity hc-duration-300 hc-cursor-pointer hc-opacity-100\"\r\n\t\t\t\t\t\t`}\r\n\t\t\t\t\t\t\tonClick={e => handleFavouriteClick(e)}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t</Grid.Item>\r\n\t\t\t\t</Grid>\r\n\r\n\t\t\t\t{showMap && (\r\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\">\r\n\t\t\t\t\t\t<img\r\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}`}\r\n\t\t\t\t\t\t\talt={`Map of location for ${item.fields.position}`}\r\n\t\t\t\t\t\t\tclassName=\"hc-w-full hc-h-full hc-object-cover\"\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t)}\r\n\t\t\t</button>\r\n\t\t);\r\n\t},\r\n);\r\n\r\nListItem.displayName = \"ListItem\";\r\n\r\nexport default React.memo(ListItem, (prevProps, nextProps) => {\r\n\treturn (\r\n\t\t(prevProps.isActive === nextProps.isActive ||\r\n\t\t\tprevProps.isActive !== nextProps.isActive) &&\r\n\t\tprevProps.bodyClassName === nextProps.bodyClassName &&\r\n\t\tprevProps.className === nextProps.className &&\r\n\t\tprevProps.fieldsShown === nextProps.fieldsShown &&\r\n\t\tprevProps.item.id === nextProps.item.id\r\n\t);\r\n});\r\n"],"names":["ListItem","forwardRef","_ref","ref","_item$mapDetails","_item$mapDetails2","_item$mapDetails3","_item$mapDetails4","isActive","bodyClassName","className","item","fieldsShown","specialFeatures","onItemSelected","showMap","setMobileTab","favorites","setFavorites","props","_objectWithoutProperties","_excluded","_useMapList","useMapList","siteConfig","mapPinColor","colors","primary","replace","handleClick","isFavorite","includes","id","handleFavouriteClick","event","stopPropagation","updatedFavorites","filter","fav","concat","_toConsumableArray","React","createElement","_extends","onClick","Grid","columns","gap","isAnimated","Item","Icon","icon","size","FieldMapper","key","iconClasses","title","e","src","mapDetails","latitude","longitude","alt","fields","position","displayName","memo","prevProps","nextProps"],"mappings":";;;;;;;;AAQA,IAAMA,QAAQ,gBAAGC,UAAU,CAC1B,UAAAC,IAAA,EAeCC,GAAG,EACC;AAAA,EAAA,IAAAC,gBAAA,EAAAC,iBAAA,EAAAC,iBAAA,EAAAC,iBAAA,CAAA;AAAA,EAAA,IAdHC,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,SAAS,GAAAf,IAAA,CAATe,SAAS;IACTC,YAAY,GAAAhB,IAAA,CAAZgB,YAAY;AACTC,IAAAA,KAAK,GAAAC,wBAAA,CAAAlB,IAAA,EAAAmB,SAAA,CAAA,CAAA;AAIT,EAAA,IAAAC,WAAA,GAAuBC,UAAU,EAAE;IAA3BC,UAAU,GAAAF,WAAA,CAAVE,UAAU,CAAA;AAClB,EAAA,IAAMC,WAAW,GAAGD,UAAU,CAACE,MAAM,CAACC,OAAO,CAACC,OAAO,CAA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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,KAAK,CAACyB,IAAI,CAAClE,QAAQ,EAAE,UAACmE,SAAS,EAAEC,SAAS,EAAK;EAC7D,OACC,CAACD,SAAS,CAAC3D,QAAQ,KAAK4D,SAAS,CAAC5D,QAAQ,IACzC2D,SAAS,CAAC3D,QAAQ,KAAK4D,SAAS,CAAC5D,QAAQ,KAC1C2D,SAAS,CAAC1D,aAAa,KAAK2D,SAAS,CAAC3D,aAAa,IACnD0D,SAAS,CAACzD,SAAS,KAAK0D,SAAS,CAAC1D,SAAS,IAC3CyD,SAAS,CAACvD,WAAW,KAAKwD,SAAS,CAACxD,WAAW,IAC/CuD,SAAS,CAACxD,IAAI,CAACqB,EAAE,KAAKoC,SAAS,CAACzD,IAAI,CAACqB,EAAE,CAAA;AAEzC,CAAC,CAAC;;;;"}
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import ItemsList from './list/index.js';
|
|
3
|
-
import Map from './map.js';
|
|
4
|
-
import MapTabs from './tabs.js';
|
|
5
|
-
import Filter from '../filter/index.js';
|
|
6
|
-
|
|
7
|
-
var MapList = function MapList(_ref) {
|
|
8
|
-
var _ref$loading = _ref.loading,
|
|
9
|
-
loading = _ref$loading === void 0 ? false : _ref$loading,
|
|
10
|
-
mapDetails = _ref.mapDetails,
|
|
11
|
-
markerConfigs = _ref.markerConfigs,
|
|
12
|
-
itemExpandedContent = _ref.itemExpandedContent,
|
|
13
|
-
fieldsShown = _ref.fieldsShown,
|
|
14
|
-
specialFeatures = _ref.specialFeatures,
|
|
15
|
-
fieldNames = _ref.fieldNames,
|
|
16
|
-
showMap = _ref.showMap,
|
|
17
|
-
placeMappings = _ref.placeMappings;
|
|
18
|
-
var listProps = {
|
|
19
|
-
fieldsShown: fieldsShown,
|
|
20
|
-
fieldNames: fieldNames,
|
|
21
|
-
itemExpandedContent: itemExpandedContent,
|
|
22
|
-
loading: loading,
|
|
23
|
-
showMap: showMap,
|
|
24
|
-
specialFeatures: specialFeatures
|
|
25
|
-
};
|
|
26
|
-
var mapProps = {
|
|
27
|
-
mapDetails: mapDetails,
|
|
28
|
-
markerConfigs: markerConfigs,
|
|
29
|
-
placeMappings: placeMappings,
|
|
30
|
-
clusterGridSize: 60,
|
|
31
|
-
showMap: showMap
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
// useEffect(() => {
|
|
35
|
-
// if (selectedItem !== null) {
|
|
36
|
-
// trackEvent("Map", "View Location", selectedItem[titlePropName]);
|
|
37
|
-
// }
|
|
38
|
-
// // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
39
|
-
// }, []);
|
|
40
|
-
var map = /*#__PURE__*/React.createElement(Map, mapProps);
|
|
41
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
42
|
-
className: "\n\t\t\t\t\t".concat(showMap == false ? "md:hc-grid-rows-[100vh]" : "md:hc-grid-rows-[50vh_50vh]", "\n\t\t\t\t\tmd:hc-grid md:hc-pt-4 hc-overflow-hidden hc-relative bg-gray-100\n\t\t\t\t")
|
|
43
|
-
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(ItemsList, listProps)), /*#__PURE__*/React.createElement("div", null, showMap && map)), /*#__PURE__*/React.createElement("div", {
|
|
44
|
-
className: "md:hc-hidden"
|
|
45
|
-
}, /*#__PURE__*/React.createElement(MapTabs, {
|
|
46
|
-
showMap: showMap,
|
|
47
|
-
list: /*#__PURE__*/React.createElement(ItemsList, listProps),
|
|
48
|
-
map: !loading && showMap && map,
|
|
49
|
-
filter: /*#__PURE__*/React.createElement(Filter, {
|
|
50
|
-
showMap: showMap,
|
|
51
|
-
className: "md:hc-hidden"
|
|
52
|
-
})
|
|
53
|
-
})));
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export { MapList as default };
|
|
57
|
-
//# sourceMappingURL=map-list.js.map
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ItemsList from './list/index.js';
|
|
3
|
+
import Map from './map.js';
|
|
4
|
+
import MapTabs from './tabs.js';
|
|
5
|
+
import Filter from '../filter/index.js';
|
|
6
|
+
|
|
7
|
+
var MapList = function MapList(_ref) {
|
|
8
|
+
var _ref$loading = _ref.loading,
|
|
9
|
+
loading = _ref$loading === void 0 ? false : _ref$loading,
|
|
10
|
+
mapDetails = _ref.mapDetails,
|
|
11
|
+
markerConfigs = _ref.markerConfigs,
|
|
12
|
+
itemExpandedContent = _ref.itemExpandedContent,
|
|
13
|
+
fieldsShown = _ref.fieldsShown,
|
|
14
|
+
specialFeatures = _ref.specialFeatures,
|
|
15
|
+
fieldNames = _ref.fieldNames,
|
|
16
|
+
showMap = _ref.showMap,
|
|
17
|
+
placeMappings = _ref.placeMappings;
|
|
18
|
+
var listProps = {
|
|
19
|
+
fieldsShown: fieldsShown,
|
|
20
|
+
fieldNames: fieldNames,
|
|
21
|
+
itemExpandedContent: itemExpandedContent,
|
|
22
|
+
loading: loading,
|
|
23
|
+
showMap: showMap,
|
|
24
|
+
specialFeatures: specialFeatures
|
|
25
|
+
};
|
|
26
|
+
var mapProps = {
|
|
27
|
+
mapDetails: mapDetails,
|
|
28
|
+
markerConfigs: markerConfigs,
|
|
29
|
+
placeMappings: placeMappings,
|
|
30
|
+
clusterGridSize: 60,
|
|
31
|
+
showMap: showMap
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
// useEffect(() => {
|
|
35
|
+
// if (selectedItem !== null) {
|
|
36
|
+
// trackEvent("Map", "View Location", selectedItem[titlePropName]);
|
|
37
|
+
// }
|
|
38
|
+
// // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
39
|
+
// }, []);
|
|
40
|
+
var map = /*#__PURE__*/React.createElement(Map, mapProps);
|
|
41
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
42
|
+
className: "\n\t\t\t\t\t".concat(showMap == false ? "md:hc-grid-rows-[100vh]" : "md:hc-grid-rows-[50vh_50vh]", "\n\t\t\t\t\tmd:hc-grid md:hc-pt-4 hc-overflow-hidden hc-relative bg-gray-100\n\t\t\t\t")
|
|
43
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(ItemsList, listProps)), /*#__PURE__*/React.createElement("div", null, showMap && map)), /*#__PURE__*/React.createElement("div", {
|
|
44
|
+
className: "md:hc-hidden"
|
|
45
|
+
}, /*#__PURE__*/React.createElement(MapTabs, {
|
|
46
|
+
showMap: showMap,
|
|
47
|
+
list: /*#__PURE__*/React.createElement(ItemsList, listProps),
|
|
48
|
+
map: !loading && showMap && map,
|
|
49
|
+
filter: /*#__PURE__*/React.createElement(Filter, {
|
|
50
|
+
showMap: showMap,
|
|
51
|
+
className: "md:hc-hidden"
|
|
52
|
+
})
|
|
53
|
+
})));
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export { MapList as default };
|
|
57
|
+
//# sourceMappingURL=map-list.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-list.js","sources":["../../../../src/components/modules/maps/map-list.js"],"sourcesContent":["import React from 'react';\n\nimport List from '~/components/modules/maps/list';\nimport Map from '~/components/modules/maps/map';\nimport Tabs from '~/components/modules/maps/tabs';\nimport Filter from '~/components/modules/filter';\n\nconst MapList = ({\n\tloading = false,\n\tmapDetails,\n\tmarkerConfigs,\n\titemExpandedContent,\n\tfieldsShown,\n\tspecialFeatures,\n\tfieldNames,\n\tshowMap,\n\tplaceMappings\n}) => {\n\n\tconst listProps = {\n\t\tfieldsShown: fieldsShown,\n\t\tfieldNames: fieldNames,\n\t\titemExpandedContent: itemExpandedContent,\n\t\tloading: loading,\n\t\tshowMap: showMap,\n\t\tspecialFeatures: specialFeatures\n\t};\n\n\tconst mapProps = {\n\t\tmapDetails: mapDetails,\n\t\tmarkerConfigs: markerConfigs,\n\t\tplaceMappings: placeMappings,\n\t\tclusterGridSize: 60,\n\t\tshowMap: showMap\n\t};\n\n\t// useEffect(() => {\n\t// \tif (selectedItem !== null) {\n\t// \t\ttrackEvent(\"Map\", \"View Location\", selectedItem[titlePropName]);\n\t// \t}\n\t// \t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t// }, []);\n\tconst map = <Map {...mapProps} />;\n\treturn (\n\t\t<>\n\t\t\t<div\n\t\t\t\tclassName={`\n\t\t\t\t\t${showMap == false ? \"md:hc-grid-rows-[100vh]\" : \"md:hc-grid-rows-[50vh_50vh]\"}\n\t\t\t\t\tmd:hc-grid md:hc-pt-4 hc-overflow-hidden hc-relative bg-gray-100\n\t\t\t\t`}\n\t\t\t>\n\t\t\t\t<div>\n\t\t\t\t\t<List {...listProps} />\n\t\t\t\t</div>\n\t\t\t\t<div>{showMap && map}</div>\n\t\t\t</div>\n\t\t\t<div className=\"md:hc-hidden\">\n\t\t\t\t<Tabs\n\t\t\t\t\tshowMap={showMap}\n\t\t\t\t\tlist={<List {...listProps} />}\n\t\t\t\t\tmap={!loading && showMap && map}\n\t\t\t\t\tfilter={\n\t\t\t\t\t\t<Filter\n\t\t\t\t\t\t\tshowMap={showMap}\n\t\t\t\t\t\t\tclassName=\"md:hc-hidden\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\nexport default MapList;\n"],"names":["MapList","_ref","_ref$loading","loading","mapDetails","markerConfigs","itemExpandedContent","fieldsShown","specialFeatures","fieldNames","showMap","placeMappings","listProps","mapProps","clusterGridSize","map","React","createElement","Map","Fragment","className","concat","List","Tabs","list","filter","Filter"],"mappings":";;;;;;AAOA,IAAMA,OAAO,GAAG,SAAVA,OAAOA,CAAAC,IAAA,EAUP;AAAA,EAAA,IAAAC,YAAA,GAAAD,IAAA,CATLE,OAAO;AAAPA,IAAAA,OAAO,GAAAD,YAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,YAAA;IACfE,UAAU,GAAAH,IAAA,CAAVG,UAAU;IACVC,aAAa,GAAAJ,IAAA,CAAbI,aAAa;IACbC,mBAAmB,GAAAL,IAAA,CAAnBK,mBAAmB;IACnBC,WAAW,GAAAN,IAAA,CAAXM,WAAW;IACXC,eAAe,GAAAP,IAAA,CAAfO,eAAe;IACfC,UAAU,GAAAR,IAAA,CAAVQ,UAAU;IACVC,OAAO,GAAAT,IAAA,CAAPS,OAAO;IACPC,aAAa,GAAAV,IAAA,CAAbU,aAAa,CAAA;AAGb,EAAA,IAAMC,SAAS,GAAG;AACjBL,IAAAA,WAAW,EAAEA,WAAW;AACxBE,IAAAA,UAAU,EAAEA,UAAU;AACtBH,IAAAA,mBAAmB,EAAEA,mBAAmB;AACxCH,IAAAA,OAAO,EAAEA,OAAO;AAChBO,IAAAA,OAAO,EAAEA,OAAO;AAChBF,IAAAA,eAAe,EAAEA,eAAAA;GACjB,CAAA;AAED,EAAA,IAAMK,QAAQ,GAAG;AAChBT,IAAAA,UAAU,EAAEA,UAAU;AACtBC,IAAAA,aAAa,EAAEA,aAAa;AAC5BM,IAAAA,aAAa,EAAEA,aAAa;AAC5BG,IAAAA,eAAe,EAAE,EAAE;AACnBJ,IAAAA,OAAO,EAAEA,OAAAA;GACT,CAAA;;AAED;AACA;AACA;AACA;AACA;AACA;EACA,IAAMK,GAAG,gBAAGC,KAAA,CAAAC,aAAA,CAACC,GAAG,EAAKL,QAAW,CAAC,CAAA;EACjC,oBACCG,KAAA,CAAAC,aAAA,CAAAD,KAAA,CAAAG,QAAA,EAAA,IAAA,eACCH,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;IACCG,SAAS,EAAA,cAAA,CAAAC,MAAA,CACNX,OAAO,IAAI,KAAK,GAAG,yBAAyB,GAAG,6BAA6B,EAAA,wFAAA,CAAA;GAI/EM,eAAAA,KAAA,CAAAC,aAAA,CACCD,KAAAA,EAAAA,IAAAA,eAAAA,KAAA,CAAAC,aAAA,CAACK,SAAI,EAAKV,SAAY,CAClB,CAAC,eACNI,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA,IAAA,EAAMP,OAAO,IAAIK,GAAS,CACtB,CAAC,eACNC,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AAAKG,IAAAA,SAAS,EAAC,cAAA;AAAc,GAAA,eAC5BJ,KAAA,CAAAC,aAAA,CAACM,OAAI,EAAA;AACJb,IAAAA,OAAO,EAAEA,OAAQ;IACjBc,IAAI,eAAER,KAAA,CAAAC,aAAA,CAACK,SAAI,EAAKV,SAAY,CAAE;AAC9BG,IAAAA,GAAG,EAAE,CAACZ,OAAO,IAAIO,OAAO,IAAIK,GAAI;AAChCU,IAAAA,MAAM,eACLT,KAAA,CAAAC,aAAA,CAACS,MAAM,EAAA;AACNhB,MAAAA,OAAO,EAAEA,OAAQ;AACjBU,MAAAA,SAAS,EAAC,cAAA;KACV,CAAA;GAEF,CACG,CACJ,CAAC,CAAA;AAEL;;;;"}
|
|
1
|
+
{"version":3,"file":"map-list.js","sources":["../../../../src/components/modules/maps/map-list.js"],"sourcesContent":["import React from 'react';\r\n\r\nimport List from '~/components/modules/maps/list';\r\nimport Map from '~/components/modules/maps/map';\r\nimport Tabs from '~/components/modules/maps/tabs';\r\nimport Filter from '~/components/modules/filter';\r\n\r\nconst MapList = ({\r\n\tloading = false,\r\n\tmapDetails,\r\n\tmarkerConfigs,\r\n\titemExpandedContent,\r\n\tfieldsShown,\r\n\tspecialFeatures,\r\n\tfieldNames,\r\n\tshowMap,\r\n\tplaceMappings\r\n}) => {\r\n\r\n\tconst listProps = {\r\n\t\tfieldsShown: fieldsShown,\r\n\t\tfieldNames: fieldNames,\r\n\t\titemExpandedContent: itemExpandedContent,\r\n\t\tloading: loading,\r\n\t\tshowMap: showMap,\r\n\t\tspecialFeatures: specialFeatures\r\n\t};\r\n\r\n\tconst mapProps = {\r\n\t\tmapDetails: mapDetails,\r\n\t\tmarkerConfigs: markerConfigs,\r\n\t\tplaceMappings: placeMappings,\r\n\t\tclusterGridSize: 60,\r\n\t\tshowMap: showMap\r\n\t};\r\n\r\n\t// useEffect(() => {\r\n\t// \tif (selectedItem !== null) {\r\n\t// \t\ttrackEvent(\"Map\", \"View Location\", selectedItem[titlePropName]);\r\n\t// \t}\r\n\t// \t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t// }, []);\r\n\tconst map = <Map {...mapProps} />;\r\n\treturn (\r\n\t\t<>\r\n\t\t\t<div\r\n\t\t\t\tclassName={`\r\n\t\t\t\t\t${showMap == false ? \"md:hc-grid-rows-[100vh]\" : \"md:hc-grid-rows-[50vh_50vh]\"}\r\n\t\t\t\t\tmd:hc-grid md:hc-pt-4 hc-overflow-hidden hc-relative bg-gray-100\r\n\t\t\t\t`}\r\n\t\t\t>\r\n\t\t\t\t<div>\r\n\t\t\t\t\t<List {...listProps} />\r\n\t\t\t\t</div>\r\n\t\t\t\t<div>{showMap && map}</div>\r\n\t\t\t</div>\r\n\t\t\t<div className=\"md:hc-hidden\">\r\n\t\t\t\t<Tabs\r\n\t\t\t\t\tshowMap={showMap}\r\n\t\t\t\t\tlist={<List {...listProps} />}\r\n\t\t\t\t\tmap={!loading && showMap && map}\r\n\t\t\t\t\tfilter={\r\n\t\t\t\t\t\t<Filter\r\n\t\t\t\t\t\t\tshowMap={showMap}\r\n\t\t\t\t\t\t\tclassName=\"md:hc-hidden\"\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t}\r\n\t\t\t\t/>\r\n\t\t\t</div>\r\n\t\t</>\r\n\t);\r\n};\r\n\r\nexport default MapList;\r\n"],"names":["MapList","_ref","_ref$loading","loading","mapDetails","markerConfigs","itemExpandedContent","fieldsShown","specialFeatures","fieldNames","showMap","placeMappings","listProps","mapProps","clusterGridSize","map","React","createElement","Map","Fragment","className","concat","List","Tabs","list","filter","Filter"],"mappings":";;;;;;AAOA,IAAMA,OAAO,GAAG,SAAVA,OAAOA,CAAAC,IAAA,EAUP;AAAA,EAAA,IAAAC,YAAA,GAAAD,IAAA,CATLE,OAAO;AAAPA,IAAAA,OAAO,GAAAD,YAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,YAAA;IACfE,UAAU,GAAAH,IAAA,CAAVG,UAAU;IACVC,aAAa,GAAAJ,IAAA,CAAbI,aAAa;IACbC,mBAAmB,GAAAL,IAAA,CAAnBK,mBAAmB;IACnBC,WAAW,GAAAN,IAAA,CAAXM,WAAW;IACXC,eAAe,GAAAP,IAAA,CAAfO,eAAe;IACfC,UAAU,GAAAR,IAAA,CAAVQ,UAAU;IACVC,OAAO,GAAAT,IAAA,CAAPS,OAAO;IACPC,aAAa,GAAAV,IAAA,CAAbU,aAAa,CAAA;AAGb,EAAA,IAAMC,SAAS,GAAG;AACjBL,IAAAA,WAAW,EAAEA,WAAW;AACxBE,IAAAA,UAAU,EAAEA,UAAU;AACtBH,IAAAA,mBAAmB,EAAEA,mBAAmB;AACxCH,IAAAA,OAAO,EAAEA,OAAO;AAChBO,IAAAA,OAAO,EAAEA,OAAO;AAChBF,IAAAA,eAAe,EAAEA,eAAAA;GACjB,CAAA;AAED,EAAA,IAAMK,QAAQ,GAAG;AAChBT,IAAAA,UAAU,EAAEA,UAAU;AACtBC,IAAAA,aAAa,EAAEA,aAAa;AAC5BM,IAAAA,aAAa,EAAEA,aAAa;AAC5BG,IAAAA,eAAe,EAAE,EAAE;AACnBJ,IAAAA,OAAO,EAAEA,OAAAA;GACT,CAAA;;AAED;AACA;AACA;AACA;AACA;AACA;EACA,IAAMK,GAAG,gBAAGC,KAAA,CAAAC,aAAA,CAACC,GAAG,EAAKL,QAAW,CAAC,CAAA;EACjC,oBACCG,KAAA,CAAAC,aAAA,CAAAD,KAAA,CAAAG,QAAA,EAAA,IAAA,eACCH,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;IACCG,SAAS,EAAA,cAAA,CAAAC,MAAA,CACNX,OAAO,IAAI,KAAK,GAAG,yBAAyB,GAAG,6BAA6B,EAAA,wFAAA,CAAA;GAI/EM,eAAAA,KAAA,CAAAC,aAAA,CACCD,KAAAA,EAAAA,IAAAA,eAAAA,KAAA,CAAAC,aAAA,CAACK,SAAI,EAAKV,SAAY,CAClB,CAAC,eACNI,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA,IAAA,EAAMP,OAAO,IAAIK,GAAS,CACtB,CAAC,eACNC,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AAAKG,IAAAA,SAAS,EAAC,cAAA;AAAc,GAAA,eAC5BJ,KAAA,CAAAC,aAAA,CAACM,OAAI,EAAA;AACJb,IAAAA,OAAO,EAAEA,OAAQ;IACjBc,IAAI,eAAER,KAAA,CAAAC,aAAA,CAACK,SAAI,EAAKV,SAAY,CAAE;AAC9BG,IAAAA,GAAG,EAAE,CAACZ,OAAO,IAAIO,OAAO,IAAIK,GAAI;AAChCU,IAAAA,MAAM,eACLT,KAAA,CAAAC,aAAA,CAACS,MAAM,EAAA;AACNhB,MAAAA,OAAO,EAAEA,OAAQ;AACjBU,MAAAA,SAAS,EAAC,cAAA;KACV,CAAA;GAEF,CACG,CACJ,CAAC,CAAA;AAEL;;;;"}
|
|
@@ -1,85 +1,85 @@
|
|
|
1
|
-
import React, { useRef, useEffect } from 'react';
|
|
2
|
-
import { MarkerF, InfoWindow } from '@react-google-maps/api';
|
|
3
|
-
import CardInfoWindow from './info-window-card.js';
|
|
4
|
-
import InfoWindowContent from './info-window-content.js';
|
|
5
|
-
import { useMap } from '../../../contexts/mapContext.js';
|
|
6
|
-
import { useMapList } from '../../../contexts/mapListContext.js';
|
|
7
|
-
|
|
8
|
-
var MapMarker = function MapMarker(_ref) {
|
|
9
|
-
var item = _ref.item,
|
|
10
|
-
markerRefs = _ref.markerRefs,
|
|
11
|
-
infoWindowClasses = _ref.infoWindowClasses,
|
|
12
|
-
markerClickHandler = _ref.markerClickHandler,
|
|
13
|
-
clusterer = _ref.clusterer,
|
|
14
|
-
markerIconSelected = _ref.markerIconSelected,
|
|
15
|
-
markerIcon = _ref.markerIcon,
|
|
16
|
-
selectedLocation = _ref.selectedLocation,
|
|
17
|
-
setMapInteracted = _ref.setMapInteracted;
|
|
18
|
-
var _useMap = useMap(),
|
|
19
|
-
setLocation = _useMap.setLocation,
|
|
20
|
-
commuteLocation = _useMap.commuteLocation;
|
|
21
|
-
var isSelected = item.id === (selectedLocation === null || selectedLocation === void 0 ? void 0 : selectedLocation.id);
|
|
22
|
-
var markerRef = useRef(null);
|
|
23
|
-
var _useMapList = useMapList(),
|
|
24
|
-
handleFilterListingsByLocation = _useMapList.handleFilterListingsByLocation;
|
|
25
|
-
useEffect(function () {
|
|
26
|
-
markerRefs.current[item.id] = markerRef.current;
|
|
27
|
-
}, []);
|
|
28
|
-
var onMarkerClick = function onMarkerClick() {
|
|
29
|
-
setMapInteracted(true);
|
|
30
|
-
markerClickHandler(item);
|
|
31
|
-
};
|
|
32
|
-
var getInfoWindow = function getInfoWindow() {
|
|
33
|
-
if (!isSelected || !item || !item.id || !selectedLocation) {
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
//Direct dom removal of empty info windows
|
|
37
|
-
document.querySelectorAll("div.gm-style-iw.gm-style-iw-c").forEach(function (x) {
|
|
38
|
-
if (!x.innerHTML.includes(item.id)) x.parentElement.remove();
|
|
39
|
-
});
|
|
40
|
-
return /*#__PURE__*/React.createElement(InfoWindow, {
|
|
41
|
-
position: {
|
|
42
|
-
lat: item.latitude,
|
|
43
|
-
lng: item.longitude
|
|
44
|
-
},
|
|
45
|
-
anchor: markerRefs.current[item.id],
|
|
46
|
-
onCloseClick: function onCloseClick() {
|
|
47
|
-
setMapInteracted(true);
|
|
48
|
-
setLocation(null);
|
|
49
|
-
},
|
|
50
|
-
options: {
|
|
51
|
-
maxWidth: 400
|
|
52
|
-
}
|
|
53
|
-
}, /*#__PURE__*/React.createElement(CardInfoWindow, {
|
|
54
|
-
className: infoWindowClasses,
|
|
55
|
-
id: item.id,
|
|
56
|
-
content: /*#__PURE__*/React.createElement(InfoWindowContent, {
|
|
57
|
-
item: item,
|
|
58
|
-
commuteLocation: commuteLocation,
|
|
59
|
-
filterListingsByLocation: function filterListingsByLocation() {
|
|
60
|
-
return handleFilterListingsByLocation(selectedLocation);
|
|
61
|
-
}
|
|
62
|
-
})
|
|
63
|
-
}));
|
|
64
|
-
};
|
|
65
|
-
return /*#__PURE__*/React.createElement(MarkerF, {
|
|
66
|
-
key: item.id,
|
|
67
|
-
position: {
|
|
68
|
-
lat: item.latitude,
|
|
69
|
-
lng: item.longitude
|
|
70
|
-
},
|
|
71
|
-
title: item.name,
|
|
72
|
-
options: {
|
|
73
|
-
icon: isSelected ? markerIconSelected : markerIcon
|
|
74
|
-
},
|
|
75
|
-
zIndex: isSelected ? 9999 : 1,
|
|
76
|
-
onLoad: function onLoad(marker) {
|
|
77
|
-
return markerRef.current = marker;
|
|
78
|
-
},
|
|
79
|
-
onClick: onMarkerClick,
|
|
80
|
-
clusterer: clusterer
|
|
81
|
-
}, isSelected && getInfoWindow());
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
export { MapMarker as default };
|
|
85
|
-
//# sourceMappingURL=map-marker.js.map
|
|
1
|
+
import React, { useRef, useEffect } from 'react';
|
|
2
|
+
import { MarkerF, InfoWindow } from '@react-google-maps/api';
|
|
3
|
+
import CardInfoWindow from './info-window-card.js';
|
|
4
|
+
import InfoWindowContent from './info-window-content.js';
|
|
5
|
+
import { useMap } from '../../../contexts/mapContext.js';
|
|
6
|
+
import { useMapList } from '../../../contexts/mapListContext.js';
|
|
7
|
+
|
|
8
|
+
var MapMarker = function MapMarker(_ref) {
|
|
9
|
+
var item = _ref.item,
|
|
10
|
+
markerRefs = _ref.markerRefs,
|
|
11
|
+
infoWindowClasses = _ref.infoWindowClasses,
|
|
12
|
+
markerClickHandler = _ref.markerClickHandler,
|
|
13
|
+
clusterer = _ref.clusterer,
|
|
14
|
+
markerIconSelected = _ref.markerIconSelected,
|
|
15
|
+
markerIcon = _ref.markerIcon,
|
|
16
|
+
selectedLocation = _ref.selectedLocation,
|
|
17
|
+
setMapInteracted = _ref.setMapInteracted;
|
|
18
|
+
var _useMap = useMap(),
|
|
19
|
+
setLocation = _useMap.setLocation,
|
|
20
|
+
commuteLocation = _useMap.commuteLocation;
|
|
21
|
+
var isSelected = item.id === (selectedLocation === null || selectedLocation === void 0 ? void 0 : selectedLocation.id);
|
|
22
|
+
var markerRef = useRef(null);
|
|
23
|
+
var _useMapList = useMapList(),
|
|
24
|
+
handleFilterListingsByLocation = _useMapList.handleFilterListingsByLocation;
|
|
25
|
+
useEffect(function () {
|
|
26
|
+
markerRefs.current[item.id] = markerRef.current;
|
|
27
|
+
}, []);
|
|
28
|
+
var onMarkerClick = function onMarkerClick() {
|
|
29
|
+
setMapInteracted(true);
|
|
30
|
+
markerClickHandler(item);
|
|
31
|
+
};
|
|
32
|
+
var getInfoWindow = function getInfoWindow() {
|
|
33
|
+
if (!isSelected || !item || !item.id || !selectedLocation) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
//Direct dom removal of empty info windows
|
|
37
|
+
document.querySelectorAll("div.gm-style-iw.gm-style-iw-c").forEach(function (x) {
|
|
38
|
+
if (!x.innerHTML.includes(item.id)) x.parentElement.remove();
|
|
39
|
+
});
|
|
40
|
+
return /*#__PURE__*/React.createElement(InfoWindow, {
|
|
41
|
+
position: {
|
|
42
|
+
lat: item.latitude,
|
|
43
|
+
lng: item.longitude
|
|
44
|
+
},
|
|
45
|
+
anchor: markerRefs.current[item.id],
|
|
46
|
+
onCloseClick: function onCloseClick() {
|
|
47
|
+
setMapInteracted(true);
|
|
48
|
+
setLocation(null);
|
|
49
|
+
},
|
|
50
|
+
options: {
|
|
51
|
+
maxWidth: 400
|
|
52
|
+
}
|
|
53
|
+
}, /*#__PURE__*/React.createElement(CardInfoWindow, {
|
|
54
|
+
className: infoWindowClasses,
|
|
55
|
+
id: item.id,
|
|
56
|
+
content: /*#__PURE__*/React.createElement(InfoWindowContent, {
|
|
57
|
+
item: item,
|
|
58
|
+
commuteLocation: commuteLocation,
|
|
59
|
+
filterListingsByLocation: function filterListingsByLocation() {
|
|
60
|
+
return handleFilterListingsByLocation(selectedLocation);
|
|
61
|
+
}
|
|
62
|
+
})
|
|
63
|
+
}));
|
|
64
|
+
};
|
|
65
|
+
return /*#__PURE__*/React.createElement(MarkerF, {
|
|
66
|
+
key: item.id,
|
|
67
|
+
position: {
|
|
68
|
+
lat: item.latitude,
|
|
69
|
+
lng: item.longitude
|
|
70
|
+
},
|
|
71
|
+
title: item.name,
|
|
72
|
+
options: {
|
|
73
|
+
icon: isSelected ? markerIconSelected : markerIcon
|
|
74
|
+
},
|
|
75
|
+
zIndex: isSelected ? 9999 : 1,
|
|
76
|
+
onLoad: function onLoad(marker) {
|
|
77
|
+
return markerRef.current = marker;
|
|
78
|
+
},
|
|
79
|
+
onClick: onMarkerClick,
|
|
80
|
+
clusterer: clusterer
|
|
81
|
+
}, isSelected && getInfoWindow());
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export { MapMarker as default };
|
|
85
|
+
//# sourceMappingURL=map-marker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-marker.js","sources":["../../../../src/components/modules/maps/map-marker.js"],"sourcesContent":["import React, { useEffect, useRef } from 'react';\nimport { MarkerF, InfoWindow } from '@react-google-maps/api';\n\nimport InfoWindowCard from '~/components/modules/maps/info-window-card';\nimport InfoWindowContent from \"~/components/modules/maps/info-window-content\";\n\nimport { useMap } from \"~/contexts/mapContext\";\nimport { useMapList } from \"~/contexts/mapListContext\";\n\nconst MapMarker = ({\n\titem,\n\tmarkerRefs,\n\tinfoWindowClasses,\n\tmarkerClickHandler,\n\tclusterer,\n\tmarkerIconSelected,\n\tmarkerIcon,\n\tselectedLocation,\n\tsetMapInteracted\n}) => {\n\tconst { setLocation, commuteLocation } = useMap();\n\tconst isSelected = item.id === selectedLocation?.id;\n\tconst markerRef = useRef(null);\n\n\tconst {\n\t\thandleFilterListingsByLocation\n\t} = useMapList();\n\n\tuseEffect(() => {\n\t\tmarkerRefs.current[item.id] = markerRef.current;\n\t}, []);\n\n\tconst onMarkerClick = () => {\n\t\tsetMapInteracted(true);\n\t\tmarkerClickHandler(item);\n\t};\n\n\tconst getInfoWindow = () => {\n\t\tif (!isSelected || !item || !item.id || !selectedLocation) {\n\t\t\treturn;\n\t\t}\n\t\t//Direct dom removal of empty info windows\n\t\tdocument.querySelectorAll(\"div.gm-style-iw.gm-style-iw-c\").forEach(x => { if (!x.innerHTML.includes(item.id)) x.parentElement.remove(); });\n\t\treturn (\n\t\t\t<InfoWindow\n\t\t\t\tposition={{ lat: item.latitude, lng: item.longitude }}\n\t\t\t\tanchor={markerRefs.current[item.id]}\n\t\t\t\tonCloseClick={() => {\n\t\t\t\t\tsetMapInteracted(true);\n\t\t\t\t\tsetLocation(null);\n\t\t\t\t}}\n\t\t\t\toptions={{ maxWidth: 400 }}\n\t\t\t>\n\t\t\t\t<InfoWindowCard\n\t\t\t\t\tclassName={infoWindowClasses}\n\t\t\t\t\tid={item.id}\n\t\t\t\t\tcontent={<InfoWindowContent\n\t\t\t\t\t\titem={item}\n\t\t\t\t\t\tcommuteLocation={commuteLocation}\n\t\t\t\t\t\tfilterListingsByLocation={() =>\n\t\t\t\t\t\t\thandleFilterListingsByLocation(selectedLocation)\n\t\t\t\t\t\t}\n\t\t\t\t\t/>}\n\t\t\t\t/>\n\t\t\t</InfoWindow>\n\t\t);\n\t};\n\treturn (\n\t\t<MarkerF\n\t\t\tkey={item.id}\n\t\t\tposition={{ lat: item.latitude, lng: item.longitude }}\n\t\t\ttitle={item.name}\n\t\t\toptions={{\n\t\t\t\ticon: isSelected ? markerIconSelected : markerIcon\n\t\t\t}}\n\t\t\tzIndex={isSelected ? 9999 : 1}\n\t\t\tonLoad={marker => (markerRef.current = marker)}\n\t\t\tonClick={onMarkerClick}\n\t\t\tclusterer={clusterer}\n\t\t>\n\t\t\t{isSelected && getInfoWindow()}\n\t\t</MarkerF>\n\t);\n};\n\nexport default MapMarker;\n"],"names":["MapMarker","_ref","item","markerRefs","infoWindowClasses","markerClickHandler","clusterer","markerIconSelected","markerIcon","selectedLocation","setMapInteracted","_useMap","useMap","setLocation","commuteLocation","isSelected","id","markerRef","useRef","_useMapList","useMapList","handleFilterListingsByLocation","useEffect","current","onMarkerClick","getInfoWindow","document","querySelectorAll","forEach","x","innerHTML","includes","parentElement","remove","React","createElement","InfoWindow","position","lat","latitude","lng","longitude","anchor","onCloseClick","options","maxWidth","InfoWindowCard","className","content","InfoWindowContent","filterListingsByLocation","MarkerF","key","title","name","icon","zIndex","onLoad","marker","onClick"],"mappings":";;;;;;;AASA,IAAMA,SAAS,GAAG,SAAZA,SAASA,CAAAC,IAAA,EAUT;AAAA,EAAA,IATLC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IACJC,UAAU,GAAAF,IAAA,CAAVE,UAAU;IACVC,iBAAiB,GAAAH,IAAA,CAAjBG,iBAAiB;IACjBC,kBAAkB,GAAAJ,IAAA,CAAlBI,kBAAkB;IAClBC,SAAS,GAAAL,IAAA,CAATK,SAAS;IACTC,kBAAkB,GAAAN,IAAA,CAAlBM,kBAAkB;IAClBC,UAAU,GAAAP,IAAA,CAAVO,UAAU;IACVC,gBAAgB,GAAAR,IAAA,CAAhBQ,gBAAgB;IAChBC,gBAAgB,GAAAT,IAAA,CAAhBS,gBAAgB,CAAA;AAEhB,EAAA,IAAAC,OAAA,GAAyCC,MAAM,EAAE;IAAzCC,WAAW,GAAAF,OAAA,CAAX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;AAAA,MAAA,OAAKzC,SAAS,CAACM,OAAO,GAAGmC,MAAM,CAAA;KAAE;AAC/CC,IAAAA,OAAO,EAAEnC,aAAc;AACvBlB,IAAAA,SAAS,EAAEA,SAAAA;AAAU,GAAA,EAEpBS,UAAU,IAAIU,aAAa,EACpB,CAAC,CAAA;AAEZ;;;;"}
|
|
1
|
+
{"version":3,"file":"map-marker.js","sources":["../../../../src/components/modules/maps/map-marker.js"],"sourcesContent":["import React, { useEffect, useRef } from 'react';\r\nimport { MarkerF, InfoWindow } from '@react-google-maps/api';\r\n\r\nimport InfoWindowCard from '~/components/modules/maps/info-window-card';\r\nimport InfoWindowContent from \"~/components/modules/maps/info-window-content\";\r\n\r\nimport { useMap } from \"~/contexts/mapContext\";\r\nimport { useMapList } from \"~/contexts/mapListContext\";\r\n\r\nconst MapMarker = ({\r\n\titem,\r\n\tmarkerRefs,\r\n\tinfoWindowClasses,\r\n\tmarkerClickHandler,\r\n\tclusterer,\r\n\tmarkerIconSelected,\r\n\tmarkerIcon,\r\n\tselectedLocation,\r\n\tsetMapInteracted\r\n}) => {\r\n\tconst { setLocation, commuteLocation } = useMap();\r\n\tconst isSelected = item.id === selectedLocation?.id;\r\n\tconst markerRef = useRef(null);\r\n\r\n\tconst {\r\n\t\thandleFilterListingsByLocation\r\n\t} = useMapList();\r\n\r\n\tuseEffect(() => {\r\n\t\tmarkerRefs.current[item.id] = markerRef.current;\r\n\t}, []);\r\n\r\n\tconst onMarkerClick = () => {\r\n\t\tsetMapInteracted(true);\r\n\t\tmarkerClickHandler(item);\r\n\t};\r\n\r\n\tconst getInfoWindow = () => {\r\n\t\tif (!isSelected || !item || !item.id || !selectedLocation) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t//Direct dom removal of empty info windows\r\n\t\tdocument.querySelectorAll(\"div.gm-style-iw.gm-style-iw-c\").forEach(x => { if (!x.innerHTML.includes(item.id)) x.parentElement.remove(); });\r\n\t\treturn (\r\n\t\t\t<InfoWindow\r\n\t\t\t\tposition={{ lat: item.latitude, lng: item.longitude }}\r\n\t\t\t\tanchor={markerRefs.current[item.id]}\r\n\t\t\t\tonCloseClick={() => {\r\n\t\t\t\t\tsetMapInteracted(true);\r\n\t\t\t\t\tsetLocation(null);\r\n\t\t\t\t}}\r\n\t\t\t\toptions={{ maxWidth: 400 }}\r\n\t\t\t>\r\n\t\t\t\t<InfoWindowCard\r\n\t\t\t\t\tclassName={infoWindowClasses}\r\n\t\t\t\t\tid={item.id}\r\n\t\t\t\t\tcontent={<InfoWindowContent\r\n\t\t\t\t\t\titem={item}\r\n\t\t\t\t\t\tcommuteLocation={commuteLocation}\r\n\t\t\t\t\t\tfilterListingsByLocation={() =>\r\n\t\t\t\t\t\t\thandleFilterListingsByLocation(selectedLocation)\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t/>}\r\n\t\t\t\t/>\r\n\t\t\t</InfoWindow>\r\n\t\t);\r\n\t};\r\n\treturn (\r\n\t\t<MarkerF\r\n\t\t\tkey={item.id}\r\n\t\t\tposition={{ lat: item.latitude, lng: item.longitude }}\r\n\t\t\ttitle={item.name}\r\n\t\t\toptions={{\r\n\t\t\t\ticon: isSelected ? markerIconSelected : markerIcon\r\n\t\t\t}}\r\n\t\t\tzIndex={isSelected ? 9999 : 1}\r\n\t\t\tonLoad={marker => (markerRef.current = marker)}\r\n\t\t\tonClick={onMarkerClick}\r\n\t\t\tclusterer={clusterer}\r\n\t\t>\r\n\t\t\t{isSelected && getInfoWindow()}\r\n\t\t</MarkerF>\r\n\t);\r\n};\r\n\r\nexport default MapMarker;\r\n"],"names":["MapMarker","_ref","item","markerRefs","infoWindowClasses","markerClickHandler","clusterer","markerIconSelected","markerIcon","selectedLocation","setMapInteracted","_useMap","useMap","setLocation","commuteLocation","isSelected","id","markerRef","useRef","_useMapList","useMapList","handleFilterListingsByLocation","useEffect","current","onMarkerClick","getInfoWindow","document","querySelectorAll","forEach","x","innerHTML","includes","parentElement","remove","React","createElement","InfoWindow","position","lat","latitude","lng","longitude","anchor","onCloseClick","options","maxWidth","InfoWindowCard","className","content","InfoWindowContent","filterListingsByLocation","MarkerF","key","title","name","icon","zIndex","onLoad","marker","onClick"],"mappings":";;;;;;;AASA,IAAMA,SAAS,GAAG,SAAZA,SAASA,CAAAC,IAAA,EAUT;AAAA,EAAA,IATLC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IACJC,UAAU,GAAAF,IAAA,CAAVE,UAAU;IACVC,iBAAiB,GAAAH,IAAA,CAAjBG,iBAAiB;IACjBC,kBAAkB,GAAAJ,IAAA,CAAlBI,kBAAkB;IAClBC,SAAS,GAAAL,IAAA,CAATK,SAAS;IACTC,kBAAkB,GAAAN,IAAA,CAAlBM,kBAAkB;IAClBC,UAAU,GAAAP,IAAA,CAAVO,UAAU;IACVC,gBAAgB,GAAAR,IAAA,CAAhBQ,gBAAgB;IAChBC,gBAAgB,GAAAT,IAAA,CAAhBS,gBAAgB,CAAA;AAEhB,EAAA,IAAAC,OAAA,GAAyCC,MAAM,EAAE;IAAzCC,WAAW,GAAAF,OAAA,CAAXE,WAAW;IAAEC,eAAe,GAAAH,OAAA,CAAfG,eAAe,CAAA;AACpC,EAAA,IAAMC,UAAU,GAAGb,IAAI,CAACc,EAAE,MAAKP,gBAAgB,KAAA,IAAA,IAAhBA,gBAAgB,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAhBA,gBAAgB,CAAEO,EAAE,CAAA,CAAA;AACnD,EAAA,IAAMC,SAAS,GAAGC,MAAM,CAAC,IAAI,CAAC,CAAA;AAE9B,EAAA,IAAAC,WAAA,GAEIC,UAAU,EAAE;IADfC,8BAA8B,GAAAF,WAAA,CAA9BE,8BAA8B,CAAA;AAG/BC,EAAAA,SAAS,CAAC,YAAM;IACfnB,UAAU,CAACoB,OAAO,CAACrB,IAAI,CAACc,EAAE,CAAC,GAAGC,SAAS,CAACM,OAAO,CAAA;GAC/C,EAAE,EAAE,CAAC,CAAA;AAEN,EAAA,IAAMC,aAAa,GAA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