nestiq-component-library 1.1.161 → 1.1.162

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.
@@ -6,6 +6,7 @@ interface PopupProps {
6
6
  title: string;
7
7
  url: string;
8
8
  }[];
9
+ onClose?: () => void;
9
10
  }
10
11
  export default function ImageListPopup(props: PopupProps): React.JSX.Element;
11
12
  export {};
@@ -21,6 +21,7 @@ interface PopupProps {
21
21
  expose: {
22
22
  title: string;
23
23
  };
24
+ selectedFloorPlan?: string;
24
25
  pictures: {
25
26
  contentUrl: string;
26
27
  pictureType: {
@@ -35,7 +36,10 @@ interface PopupProps {
35
36
  messageOnClick: () => void;
36
37
  onclickSuccess: () => void;
37
38
  onClick: () => void;
38
- onFloorPlanClick: () => void;
39
+ onFloorPlanClick: (images: {
40
+ url: string;
41
+ title: string;
42
+ }[]) => void;
39
43
  }
40
44
  export default function PropertyCard(props: PopupProps): React.JSX.Element;
41
45
  export {};
package/dist/index.es.js CHANGED
@@ -181,13 +181,13 @@ var iconLayers$1 = "/static/media/layer_icon.9b56c187199c44b5.svg";
181
181
  var css_248z$6 = ".mainImage {\r\n height: 80%;\r\n}\r\n\r\n.secondList {\r\n height: 20%;\r\n max-height: 121.6px;\r\n}\r\n\r\n.listImageButton {\r\n background-image: linear-gradient(to top, #000, #666);\r\n align-items: center !important;\r\n justify-content: center !important;\r\n min-height: 121px;\r\n}\r\n\r\n.listImgText {\r\n height: 30px;\r\n font-size: 14px;\r\n line-height: 2.14;\r\n color: #fff;\r\n}\r\n\r\n.arroIconColour {\r\n height: 30px;\r\n fill: #fff !important;\r\n}\r\n\r\n.onImageArrow {\r\n width: 50px;\r\n height: 50px;\r\n padding: 23px 8px;\r\n background-color: rgba(255, 255, 255, 0.8);\r\n}\r\n\r\n.blackArrow {\r\n width: 20px;\r\n height: 20px;\r\n}\r\n\r\n\r\n.imagesArray {\r\n background-size: cover !important;\r\n}\r\n@media (max-width: 450px) {\r\n .Pimagelist {\r\n }\r\n .mainImage {\r\n height: 500px;\r\n width: 88vw;\r\n }\r\n}\r\n\r\n/* @media (min-width: 390px) and (max-width: 850px) {\r\n .Pimagelist {\r\n }\r\n .mainImage {\r\n height: 500px;\r\n width: 58vw;\r\n }\r\n} */\r\n@media (min-width: 768px) and (max-width: 819px) {\r\n .Pimagelist {\r\n }\r\n .mainImage {\r\n height: 80%;\r\n width: 58vw;\r\n }\r\n}\r\n@media (min-width: 820px) and (max-width: 850px) {\r\n .Pimagelist {\r\n }\r\n .mainImage {\r\n height: 80%;\r\n width: 58vw;\r\n }\r\n}\r\n\r\n.image-thumbnail {\r\n position: relative;\r\n transition: opacity 0.3s ease-in-out;\r\n height: 100%;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n}\r\n\r\n.image-thumbnail img {\r\n height: 100%;\r\n object-fit: cover;\r\n border-radius: 8px;\r\n}\r\n\r\n.image-thumbnail.greyed-out img {\r\n filter: grayscale(100%) brightness(50%);\r\n}\r\n\r\n.image-thumbnail.selected img {\r\n filter: none;\r\n border: 2px solid #007bff; /* Highlight border for selected image */\r\n}";
182
182
  styleInject(css_248z$6);
183
183
 
184
- var css_248z$5 = ".popup-header {\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n width: 100%;\r\n padding: 1rem;\r\n position: absolute;\r\n top: 0;\r\n}\r\n\r\n.popup-title {\r\n color: white;\r\n font-size: 24px;\r\n font-weight: bold;\r\n}\r\n\r\n.btn-close {\r\n position: absolute;\r\n right: 1rem;\r\n top: 1rem;\r\n background: none;\r\n border: none;\r\n color: white;\r\n font-size: 24px;\r\n cursor: pointer;\r\n}\r\n\r\n.popup-body {\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n padding: 1rem;\r\n position: relative;\r\n flex: 1;\r\n}\r\n\r\n.main-image {\r\n max-width: 100%;\r\n max-height: 80vh;\r\n border-radius: 8px;\r\n}\r\n\r\n.btn-prev,\r\n.btn-next {\r\n background: none;\r\n border: none;\r\n color: white;\r\n font-size: 48px;\r\n cursor: pointer;\r\n position: absolute;\r\n top: 50%;\r\n transform: translateY(-50%);\r\n}\r\n\r\n.btn-prev {\r\n left: 10px;\r\n}\r\n\r\n.btn-next {\r\n right: 10px;\r\n}\r\n\r\n.popup-thumbnails {\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n gap: 10px;\r\n padding: 1rem;\r\n}\r\n\r\n.thumbnail {\r\n width: 60px;\r\n height: 60px;\r\n object-fit: cover;\r\n border-radius: 8px;\r\n cursor: pointer;\r\n opacity: 0.6;\r\n}\r\n\r\n.thumbnail.active {\r\n border: 2px solid white;\r\n opacity: 1;\r\n}\r\n";
184
+ var css_248z$5 = ".popup-header {\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n width: 100%;\r\n padding: 1rem;\r\n position: absolute;\r\n top: 0;\r\n}\r\n\r\n.closeIconNestiq {\r\n position: absolute;\r\n right: 10px;\r\n top: 10px;\r\n width: 12px;\r\n height: 12px;\r\n cursor: pointer;\r\n z-index: 1;\r\n}\r\n\r\n.popup-title {\r\n color: white;\r\n font-size: 24px;\r\n font-weight: bold;\r\n}\r\n\r\n.btn-close {\r\n position: absolute;\r\n right: 1rem;\r\n top: 1rem;\r\n background: none;\r\n border: none;\r\n color: white;\r\n font-size: 24px;\r\n cursor: pointer;\r\n}\r\n\r\n.popup-body {\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n padding: 1rem;\r\n position: relative;\r\n flex: 1;\r\n}\r\n\r\n.main-image {\r\n max-width: 100%;\r\n max-height: 80vh;\r\n border-radius: 8px;\r\n}\r\n\r\n.btn-prev,\r\n.btn-next {\r\n background: none;\r\n border: none;\r\n color: white;\r\n font-size: 48px;\r\n cursor: pointer;\r\n position: absolute;\r\n top: 50%;\r\n transform: translateY(-50%);\r\n}\r\n\r\n.btn-prev {\r\n left: 10px;\r\n}\r\n\r\n.btn-next {\r\n right: 10px;\r\n}\r\n\r\n.popup-thumbnails {\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n gap: 10px;\r\n padding: 1rem;\r\n}\r\n\r\n.thumbnail {\r\n width: 60px;\r\n height: 60px;\r\n object-fit: cover;\r\n border-radius: 8px;\r\n cursor: pointer;\r\n opacity: 0.6;\r\n}\r\n\r\n.thumbnail.active {\r\n border: 2px solid white;\r\n opacity: 1;\r\n}\r\n";
185
185
  styleInject(css_248z$5);
186
186
 
187
187
  var iconClose = "/static/media/close.b5ce9141e80c688b.png";
188
188
 
189
189
  function ImageListPopup(props) {
190
- var _a = useState(true), showPopUp = _a[0], setShowPopUp = _a[1];
190
+ var _a = useState(true), showPopUp = _a[0]; _a[1];
191
191
  var _b = useState(0), currentImageIndex = _b[0], setCurrentImageIndex = _b[1];
192
192
  var imageListRef = useRef(null);
193
193
  var handleArrowClickInMainImage = function (direction) {
@@ -209,19 +209,21 @@ function ImageListPopup(props) {
209
209
  });
210
210
  };
211
211
  var handleClose = function () {
212
- setShowPopUp(false);
212
+ if (props.onClose) {
213
+ props.onClose();
214
+ }
213
215
  };
214
216
  return (React.createElement("div", null, showPopUp && (React.createElement("div", { className: "popup-overlay" },
215
217
  React.createElement("div", { className: " d-flex flex-column " },
216
218
  React.createElement("div", { className: "d-flex align-self-end me-5 " },
217
- React.createElement("img", { src: iconClose, alt: "close", className: "closeIcon", onClick: handleClose })),
219
+ React.createElement("img", { src: iconClose, alt: "close", className: "closeIconNestiq", onClick: handleClose })),
218
220
  React.createElement("span", { className: "text-white align-self-center" }, props.pictureUrls[currentImageIndex].title),
219
221
  React.createElement("div", { className: "d-flex justify-content-center" },
220
222
  React.createElement("div", { className: "p-2 bd-highlight align-self-center align-items-center me-5" },
221
223
  React.createElement("div", { className: "rounded-circle border onImageArrow start-0 d-flex ", role: "button", onClick: function () { return handleArrowClickInMainImage("left"); } },
222
224
  React.createElement("img", { src: blcIconArrowLeft, className: "blackArrow align-self-center", alt: "Left Arrow" }))),
223
225
  React.createElement("div", { className: "p-2 bd-highlight" },
224
- React.createElement("div", { className: " rounded-5 mainImage ", style: {
226
+ React.createElement("div", { className: " rounded-5", style: {
225
227
  backgroundImage: "url(".concat(props.pictureUrls[currentImageIndex].url, ")"),
226
228
  height: "465px",
227
229
  width: "880px",
@@ -233,21 +235,26 @@ function ImageListPopup(props) {
233
235
  React.createElement("div", { role: "button", className: "rounded-circle border onImageArrow d-flex justify-content-center", onClick: function () { return handleArrowClickInMainImage("right"); } },
234
236
  React.createElement("img", { src: blcIconArrowRight, className: "blackArrow align-self-center", alt: "Right Arrow" })))),
235
237
  React.createElement("div", { className: "d-flex flex-row" }),
236
- React.createElement("div", { className: "d-flex flex-row gap-4 w-100 secondList " },
237
- React.createElement("div", { className: "col-lg-12 d-flex flex-row p-1 align-self-center mt-5" },
238
- React.createElement("div", { className: "col-12 position-relative d-flex justify-content-center" },
239
- React.createElement("div", { className: "col-lg-10 rounded-3 h-100 w-100 d-flex flex-row gap-2 overflow-auto ", ref: imageListRef }, props.pictureUrls.length > 0 && (React.createElement("div", { className: "col-lg-5 d-flex gap-4 flex-row rounded-3" }, props.pictureUrls.map(function (picture, index) { return (React.createElement("div", { key: index, className: "col-lg-12 d-flex", onClick: function () {
240
- setCurrentImageIndex(index);
241
- imageListRef.current.scrollTo({
242
- left: index * 150,
243
- behavior: "smooth",
244
- });
245
- }, role: "button", style: {
246
- cursor: "pointer",
247
- width: "150px",
248
- height: "150px",
249
- } },
250
- React.createElement("img", { src: picture.url, alt: "Image ".concat(index + 1), className: "col-12 h-100 rounded-3 object-fit-cover" }))); }))))))))))));
238
+ React.createElement("div", { className: "d-flex flex-row justify-content-center w-100 mt-5" },
239
+ React.createElement("div", { className: "d-flex flex-row gap-4 overflow-auto px-3", ref: imageListRef, style: {
240
+ maxWidth: "100%",
241
+ scrollbarWidth: "thin",
242
+ } }, props.pictureUrls.length > 0 && (React.createElement(React.Fragment, null, props.pictureUrls.map(function (picture, index) { return (React.createElement("div", { key: index, className: "flex-shrink-0 ".concat(index === currentImageIndex
243
+ ? "border border-3 border-primary"
244
+ : ""), onClick: function () {
245
+ setCurrentImageIndex(index);
246
+ imageListRef.current.scrollTo({
247
+ left: index * 170, // 150px width + gap
248
+ behavior: "smooth",
249
+ });
250
+ }, role: "button", style: {
251
+ cursor: "pointer",
252
+ width: "150px",
253
+ height: "150px",
254
+ } },
255
+ React.createElement("img", { src: picture.url, alt: "Image ".concat(index + 1), className: "w-100 h-100 rounded-3 object-fit-cover", style: {
256
+ display: "block",
257
+ } }))); }))))))))));
251
258
  }
252
259
 
253
260
  var FloorPlanPopup = function (_a) {
@@ -384,7 +391,7 @@ function PropertyImageList(prop) {
384
391
  React.createElement("div", { className: "border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3" },
385
392
  React.createElement("img", { src: iconMap, alt: "Map Icon" }),
386
393
  React.createElement("span", { className: "listImgText" }, "Karte")))))),
387
- isImagePopupOpen && React.createElement(ImageListPopup, { pictureUrls: prop.pictureUrls }),
394
+ isImagePopupOpen && (React.createElement(ImageListPopup, { pictureUrls: prop.pictureUrls, onClose: function () { return setIsImagePopupOpen(false); } })),
388
395
  isFloorPlanPopupOpen && (React.createElement(FloorPlanPopup, { contentUrl: prop.floorPlanUrl, onCloseClick: floorPlanPopupCloseHandler }))));
389
396
  }
390
397
 
@@ -466,21 +473,35 @@ var iconLayers = "/static/media/layer_icon.9b56c187199c44b5.svg";
466
473
  var immooly = "/static/media/imooly.b46514ac970e6052.svg";
467
474
 
468
475
  function PropertyCard(props) {
469
- var _a, _b, _c, _d, _e, _f, _g;
470
- var _h = useState(false); _h[0]; _h[1];
471
- var _j = useState(null), mainImage = _j[0], setMainImage = _j[1];
472
- var _k = useState(0), currentImageIndex = _k[0], setCurrentImageIndex = _k[1];
476
+ var _a, _b, _c, _d, _e, _f, _g, _h;
477
+ var _j = useState(false); _j[0]; _j[1];
478
+ var _k = useState(null), mainImage = _k[0], setMainImage = _k[1];
479
+ var _l = useState(0), currentImageIndex = _l[0], setCurrentImageIndex = _l[1];
473
480
  var imageListRef = useRef(null);
474
- var _l = useState(false); _l[0]; _l[1];
475
481
  var _m = useState(false); _m[0]; _m[1];
476
- var _o = useState(false), sharePopUp = _o[0], setSharePopUp = _o[1];
482
+ var _o = useState(false); _o[0]; _o[1];
483
+ var _p = useState(false), sharePopUp = _p[0], setSharePopUp = _p[1];
484
+ var _q = useState(false), isImagePopupOpen = _q[0], setIsImagePopupOpen = _q[1];
477
485
  var pictureUrls = ((_b = (_a = props.property) === null || _a === void 0 ? void 0 : _a.pictures) === null || _b === void 0 ? void 0 : _b.length) > 0
478
486
  ? props.property.pictures
479
487
  .filter(function (picture) { return picture.pictureType.id === 2; })
480
488
  .map(function (picture) { return "".concat(props.baseUrl).concat(picture.contentUrl); })
481
489
  : [noImageIcon];
482
- var floorPlanOnClick = function () {
483
- props.onFloorPlanClick();
490
+ var floorPlanImages = ((_c = props.property.pictures) === null || _c === void 0 ? void 0 : _c.filter(function (p) { var _a; return ((_a = p.pictureType) === null || _a === void 0 ? void 0 : _a.id) === 1; }).map(function (p, index) { return ({
491
+ url: props.baseUrl + p.contentUrl,
492
+ title: "Floor Plan ".concat(index + 1),
493
+ }); })) || [];
494
+ if (props.property.selectedFloorPlan) {
495
+ floorPlanImages.push({
496
+ url: props.property.selectedFloorPlan,
497
+ title: "Selected Floor Plan",
498
+ });
499
+ }
500
+ var handleFloorPlanButton = function () {
501
+ setIsImagePopupOpen(true);
502
+ if (props.onFloorPlanClick) {
503
+ props.onFloorPlanClick(floorPlanImages);
504
+ }
484
505
  };
485
506
  var handleMessagPopUp = function () {
486
507
  // setMessagPopUp(true);
@@ -530,7 +551,7 @@ function PropertyCard(props) {
530
551
  React.createElement("img", { src: arrowRight, style: { right: "16px" } }))),
531
552
  React.createElement("div", { className: "d-flex flex-row align-self-end justify-item-start justify-content-between align-item-start gap-1 mb-2 ms-4", style: { position: "absolute", left: "0" } },
532
553
  React.createElement("div", { className: "cardTag", style: { marginBottom: "16px" } }, "".concat(currentImageIndex + 1, "/").concat(pictureUrls.length)),
533
- React.createElement("div", { className: "Grundriss kontact-button-text ms-2 ", role: "button", onClick: floorPlanOnClick, style: { marginBottom: "16px" } },
554
+ React.createElement("div", { className: "Grundriss kontact-button-text ms-2 ", role: "button", onClick: function () { return handleFloorPlanButton(); }, style: { marginBottom: "16px" } },
534
555
  React.createElement("img", { src: iconLayers, className: "", style: { width: "18px" } }),
535
556
  " ",
536
557
  "Grundriss")))),
@@ -540,7 +561,7 @@ function PropertyCard(props) {
540
561
  React.createElement("span", { className: "propertyTitle align-items-start ", style: {
541
562
  paddingLeft: "32px",
542
563
  paddingTop: "32px",
543
- }, onClick: props.onClick, role: "button" }, (_c = props.property.expose) === null || _c === void 0 ? void 0 : _c.title),
564
+ }, onClick: props.onClick, role: "button" }, (_d = props.property.expose) === null || _d === void 0 ? void 0 : _d.title),
544
565
  React.createElement("div", { className: "d-flex gap-2", style: {
545
566
  paddingRight: "32px",
546
567
  paddingTop: "21px",
@@ -561,7 +582,7 @@ function PropertyCard(props) {
561
582
  paddingRight: "32px",
562
583
  } },
563
584
  React.createElement("span", { className: "priceValue col-lg-4 col-md-4 col-sm-6 " },
564
- formatPrice((_f = (_e = (_d = props.property) === null || _d === void 0 ? void 0 : _d.evaluation) === null || _e === void 0 ? void 0 : _e.askingPrice) !== null && _f !== void 0 ? _f : 0),
585
+ formatPrice((_g = (_f = (_e = props.property) === null || _e === void 0 ? void 0 : _e.evaluation) === null || _f === void 0 ? void 0 : _f.askingPrice) !== null && _g !== void 0 ? _g : 0),
565
586
  " \u20AC",
566
587
  React.createElement("div", { className: "price_label" }, "Kaufpreis")),
567
588
  React.createElement("span", { className: "text-dark value col-lg-5 col-md-5 col-sm-7" },
@@ -569,7 +590,7 @@ function PropertyCard(props) {
569
590
  " m\u00B2",
570
591
  React.createElement("div", { className: "details" }, "Wohnfl\u00E4che")),
571
592
  React.createElement("span", { className: "text-dark value col-lg-4 col-md-3 col-sm-6 text-truncate " },
572
- +((_g = props.property) === null || _g === void 0 ? void 0 : _g.rooms),
593
+ +((_h = props.property) === null || _h === void 0 ? void 0 : _h.rooms),
573
594
  React.createElement("div", { className: "details" }, "Zimmer")),
574
595
  React.createElement("span", { className: "text-dark value col-lg-4 col-md-3 col-sm-4 text-truncate " },
575
596
  +props.property.propertyArea,
@@ -612,7 +633,8 @@ function PropertyCard(props) {
612
633
  React.createElement("span", { className: "kontact-button-text" },
613
634
  "Kontakt aufnehmen",
614
635
  " "))))))),
615
- sharePopUp && React.createElement(SharePopup, { onClick: function () { return setSharePopUp(false); } })));
636
+ sharePopUp && React.createElement(SharePopup, { onClick: function () { return setSharePopUp(false); } }),
637
+ isImagePopupOpen && (React.createElement(ImageListPopup, { pictureUrls: floorPlanImages, onClose: function () { return setIsImagePopupOpen(false); } }))));
616
638
  }
617
639
 
618
640
  var x = "/static/media/icon_close_2.e41bb9a4db48e048.png";