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.
package/dist/index.js CHANGED
@@ -183,13 +183,13 @@ var iconLayers$1 = "/static/media/layer_icon.9b56c187199c44b5.svg";
183
183
  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}";
184
184
  styleInject(css_248z$6);
185
185
 
186
- 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";
186
+ 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";
187
187
  styleInject(css_248z$5);
188
188
 
189
189
  var iconClose = "/static/media/close.b5ce9141e80c688b.png";
190
190
 
191
191
  function ImageListPopup(props) {
192
- var _a = React.useState(true), showPopUp = _a[0], setShowPopUp = _a[1];
192
+ var _a = React.useState(true), showPopUp = _a[0]; _a[1];
193
193
  var _b = React.useState(0), currentImageIndex = _b[0], setCurrentImageIndex = _b[1];
194
194
  var imageListRef = React.useRef(null);
195
195
  var handleArrowClickInMainImage = function (direction) {
@@ -211,19 +211,21 @@ function ImageListPopup(props) {
211
211
  });
212
212
  };
213
213
  var handleClose = function () {
214
- setShowPopUp(false);
214
+ if (props.onClose) {
215
+ props.onClose();
216
+ }
215
217
  };
216
218
  return (React.createElement("div", null, showPopUp && (React.createElement("div", { className: "popup-overlay" },
217
219
  React.createElement("div", { className: " d-flex flex-column " },
218
220
  React.createElement("div", { className: "d-flex align-self-end me-5 " },
219
- React.createElement("img", { src: iconClose, alt: "close", className: "closeIcon", onClick: handleClose })),
221
+ React.createElement("img", { src: iconClose, alt: "close", className: "closeIconNestiq", onClick: handleClose })),
220
222
  React.createElement("span", { className: "text-white align-self-center" }, props.pictureUrls[currentImageIndex].title),
221
223
  React.createElement("div", { className: "d-flex justify-content-center" },
222
224
  React.createElement("div", { className: "p-2 bd-highlight align-self-center align-items-center me-5" },
223
225
  React.createElement("div", { className: "rounded-circle border onImageArrow start-0 d-flex ", role: "button", onClick: function () { return handleArrowClickInMainImage("left"); } },
224
226
  React.createElement("img", { src: blcIconArrowLeft, className: "blackArrow align-self-center", alt: "Left Arrow" }))),
225
227
  React.createElement("div", { className: "p-2 bd-highlight" },
226
- React.createElement("div", { className: " rounded-5 mainImage ", style: {
228
+ React.createElement("div", { className: " rounded-5", style: {
227
229
  backgroundImage: "url(".concat(props.pictureUrls[currentImageIndex].url, ")"),
228
230
  height: "465px",
229
231
  width: "880px",
@@ -235,21 +237,26 @@ function ImageListPopup(props) {
235
237
  React.createElement("div", { role: "button", className: "rounded-circle border onImageArrow d-flex justify-content-center", onClick: function () { return handleArrowClickInMainImage("right"); } },
236
238
  React.createElement("img", { src: blcIconArrowRight, className: "blackArrow align-self-center", alt: "Right Arrow" })))),
237
239
  React.createElement("div", { className: "d-flex flex-row" }),
238
- React.createElement("div", { className: "d-flex flex-row gap-4 w-100 secondList " },
239
- React.createElement("div", { className: "col-lg-12 d-flex flex-row p-1 align-self-center mt-5" },
240
- React.createElement("div", { className: "col-12 position-relative d-flex justify-content-center" },
241
- 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 () {
242
- setCurrentImageIndex(index);
243
- imageListRef.current.scrollTo({
244
- left: index * 150,
245
- behavior: "smooth",
246
- });
247
- }, role: "button", style: {
248
- cursor: "pointer",
249
- width: "150px",
250
- height: "150px",
251
- } },
252
- React.createElement("img", { src: picture.url, alt: "Image ".concat(index + 1), className: "col-12 h-100 rounded-3 object-fit-cover" }))); }))))))))))));
240
+ React.createElement("div", { className: "d-flex flex-row justify-content-center w-100 mt-5" },
241
+ React.createElement("div", { className: "d-flex flex-row gap-4 overflow-auto px-3", ref: imageListRef, style: {
242
+ maxWidth: "100%",
243
+ scrollbarWidth: "thin",
244
+ } }, 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
245
+ ? "border border-3 border-primary"
246
+ : ""), onClick: function () {
247
+ setCurrentImageIndex(index);
248
+ imageListRef.current.scrollTo({
249
+ left: index * 170, // 150px width + gap
250
+ behavior: "smooth",
251
+ });
252
+ }, role: "button", style: {
253
+ cursor: "pointer",
254
+ width: "150px",
255
+ height: "150px",
256
+ } },
257
+ React.createElement("img", { src: picture.url, alt: "Image ".concat(index + 1), className: "w-100 h-100 rounded-3 object-fit-cover", style: {
258
+ display: "block",
259
+ } }))); }))))))))));
253
260
  }
254
261
 
255
262
  var FloorPlanPopup = function (_a) {
@@ -386,7 +393,7 @@ function PropertyImageList(prop) {
386
393
  React.createElement("div", { className: "border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3" },
387
394
  React.createElement("img", { src: iconMap, alt: "Map Icon" }),
388
395
  React.createElement("span", { className: "listImgText" }, "Karte")))))),
389
- isImagePopupOpen && React.createElement(ImageListPopup, { pictureUrls: prop.pictureUrls }),
396
+ isImagePopupOpen && (React.createElement(ImageListPopup, { pictureUrls: prop.pictureUrls, onClose: function () { return setIsImagePopupOpen(false); } })),
390
397
  isFloorPlanPopupOpen && (React.createElement(FloorPlanPopup, { contentUrl: prop.floorPlanUrl, onCloseClick: floorPlanPopupCloseHandler }))));
391
398
  }
392
399
 
@@ -468,21 +475,35 @@ var iconLayers = "/static/media/layer_icon.9b56c187199c44b5.svg";
468
475
  var immooly = "/static/media/imooly.b46514ac970e6052.svg";
469
476
 
470
477
  function PropertyCard(props) {
471
- var _a, _b, _c, _d, _e, _f, _g;
472
- var _h = React.useState(false); _h[0]; _h[1];
473
- var _j = React.useState(null), mainImage = _j[0], setMainImage = _j[1];
474
- var _k = React.useState(0), currentImageIndex = _k[0], setCurrentImageIndex = _k[1];
478
+ var _a, _b, _c, _d, _e, _f, _g, _h;
479
+ var _j = React.useState(false); _j[0]; _j[1];
480
+ var _k = React.useState(null), mainImage = _k[0], setMainImage = _k[1];
481
+ var _l = React.useState(0), currentImageIndex = _l[0], setCurrentImageIndex = _l[1];
475
482
  var imageListRef = React.useRef(null);
476
- var _l = React.useState(false); _l[0]; _l[1];
477
483
  var _m = React.useState(false); _m[0]; _m[1];
478
- var _o = React.useState(false), sharePopUp = _o[0], setSharePopUp = _o[1];
484
+ var _o = React.useState(false); _o[0]; _o[1];
485
+ var _p = React.useState(false), sharePopUp = _p[0], setSharePopUp = _p[1];
486
+ var _q = React.useState(false), isImagePopupOpen = _q[0], setIsImagePopupOpen = _q[1];
479
487
  var pictureUrls = ((_b = (_a = props.property) === null || _a === void 0 ? void 0 : _a.pictures) === null || _b === void 0 ? void 0 : _b.length) > 0
480
488
  ? props.property.pictures
481
489
  .filter(function (picture) { return picture.pictureType.id === 2; })
482
490
  .map(function (picture) { return "".concat(props.baseUrl).concat(picture.contentUrl); })
483
491
  : [noImageIcon];
484
- var floorPlanOnClick = function () {
485
- props.onFloorPlanClick();
492
+ 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 ({
493
+ url: props.baseUrl + p.contentUrl,
494
+ title: "Floor Plan ".concat(index + 1),
495
+ }); })) || [];
496
+ if (props.property.selectedFloorPlan) {
497
+ floorPlanImages.push({
498
+ url: props.property.selectedFloorPlan,
499
+ title: "Selected Floor Plan",
500
+ });
501
+ }
502
+ var handleFloorPlanButton = function () {
503
+ setIsImagePopupOpen(true);
504
+ if (props.onFloorPlanClick) {
505
+ props.onFloorPlanClick(floorPlanImages);
506
+ }
486
507
  };
487
508
  var handleMessagPopUp = function () {
488
509
  // setMessagPopUp(true);
@@ -532,7 +553,7 @@ function PropertyCard(props) {
532
553
  React.createElement("img", { src: arrowRight, style: { right: "16px" } }))),
533
554
  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" } },
534
555
  React.createElement("div", { className: "cardTag", style: { marginBottom: "16px" } }, "".concat(currentImageIndex + 1, "/").concat(pictureUrls.length)),
535
- React.createElement("div", { className: "Grundriss kontact-button-text ms-2 ", role: "button", onClick: floorPlanOnClick, style: { marginBottom: "16px" } },
556
+ React.createElement("div", { className: "Grundriss kontact-button-text ms-2 ", role: "button", onClick: function () { return handleFloorPlanButton(); }, style: { marginBottom: "16px" } },
536
557
  React.createElement("img", { src: iconLayers, className: "", style: { width: "18px" } }),
537
558
  " ",
538
559
  "Grundriss")))),
@@ -542,7 +563,7 @@ function PropertyCard(props) {
542
563
  React.createElement("span", { className: "propertyTitle align-items-start ", style: {
543
564
  paddingLeft: "32px",
544
565
  paddingTop: "32px",
545
- }, onClick: props.onClick, role: "button" }, (_c = props.property.expose) === null || _c === void 0 ? void 0 : _c.title),
566
+ }, onClick: props.onClick, role: "button" }, (_d = props.property.expose) === null || _d === void 0 ? void 0 : _d.title),
546
567
  React.createElement("div", { className: "d-flex gap-2", style: {
547
568
  paddingRight: "32px",
548
569
  paddingTop: "21px",
@@ -563,7 +584,7 @@ function PropertyCard(props) {
563
584
  paddingRight: "32px",
564
585
  } },
565
586
  React.createElement("span", { className: "priceValue col-lg-4 col-md-4 col-sm-6 " },
566
- 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),
587
+ 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),
567
588
  " \u20AC",
568
589
  React.createElement("div", { className: "price_label" }, "Kaufpreis")),
569
590
  React.createElement("span", { className: "text-dark value col-lg-5 col-md-5 col-sm-7" },
@@ -571,7 +592,7 @@ function PropertyCard(props) {
571
592
  " m\u00B2",
572
593
  React.createElement("div", { className: "details" }, "Wohnfl\u00E4che")),
573
594
  React.createElement("span", { className: "text-dark value col-lg-4 col-md-3 col-sm-6 text-truncate " },
574
- +((_g = props.property) === null || _g === void 0 ? void 0 : _g.rooms),
595
+ +((_h = props.property) === null || _h === void 0 ? void 0 : _h.rooms),
575
596
  React.createElement("div", { className: "details" }, "Zimmer")),
576
597
  React.createElement("span", { className: "text-dark value col-lg-4 col-md-3 col-sm-4 text-truncate " },
577
598
  +props.property.propertyArea,
@@ -614,7 +635,8 @@ function PropertyCard(props) {
614
635
  React.createElement("span", { className: "kontact-button-text" },
615
636
  "Kontakt aufnehmen",
616
637
  " "))))))),
617
- sharePopUp && React.createElement(SharePopup, { onClick: function () { return setSharePopUp(false); } })));
638
+ sharePopUp && React.createElement(SharePopup, { onClick: function () { return setSharePopUp(false); } }),
639
+ isImagePopupOpen && (React.createElement(ImageListPopup, { pictureUrls: floorPlanImages, onClose: function () { return setIsImagePopupOpen(false); } }))));
618
640
  }
619
641
 
620
642
  var x = "/static/media/icon_close_2.e41bb9a4db48e048.png";