nestiq-component-library 1.1.161 → 1.1.163

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\r\n.activeStyle {\r\n border: 3px solid transparent;\r\n border-radius: 4px;\r\n transition: transform 0.2s ease, border-color 0.2s ease;\r\n cursor: pointer;\r\n}\r\n\r\n.activeStyle:hover {\r\n transform: scale(1.05);\r\n}\r\n\r\n.activeStyle:focus {\r\n outline: none;\r\n transform: scale(1.05);\r\n}\r\n\r\n.activeStyle.active {\r\n transform: scale(1.05);\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
- React.createElement("div", { className: "rounded-circle border onImageArrow start-0 d-flex ", role: "button", onClick: function () { return handleArrowClickInMainImage("left"); } },
225
+ React.createElement("div", { className: "rounded-circle border onImageArrow d-flex justify-content-center", 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",
@@ -232,24 +234,27 @@ function ImageListPopup(props) {
232
234
  } })),
233
235
  React.createElement("div", { className: "p-2 bd-highlight align-self-center ms-5" },
234
236
  " ",
235
- React.createElement("div", { role: "button", className: "rounded-circle border onImageArrow d-flex justify-content-center", onClick: function () { return handleArrowClickInMainImage("right"); } },
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 activeStyle ".concat(index === currentImageIndex ? "active" : ""), 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
+ } }))); }))))))))));
253
258
  }
254
259
 
255
260
  var FloorPlanPopup = function (_a) {
@@ -386,7 +391,7 @@ function PropertyImageList(prop) {
386
391
  React.createElement("div", { className: "border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3" },
387
392
  React.createElement("img", { src: iconMap, alt: "Map Icon" }),
388
393
  React.createElement("span", { className: "listImgText" }, "Karte")))))),
389
- isImagePopupOpen && React.createElement(ImageListPopup, { pictureUrls: prop.pictureUrls }),
394
+ isImagePopupOpen && (React.createElement(ImageListPopup, { pictureUrls: prop.pictureUrls, onClose: function () { return setIsImagePopupOpen(false); } })),
390
395
  isFloorPlanPopupOpen && (React.createElement(FloorPlanPopup, { contentUrl: prop.floorPlanUrl, onCloseClick: floorPlanPopupCloseHandler }))));
391
396
  }
392
397
 
@@ -468,21 +473,35 @@ var iconLayers = "/static/media/layer_icon.9b56c187199c44b5.svg";
468
473
  var immooly = "/static/media/imooly.b46514ac970e6052.svg";
469
474
 
470
475
  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];
476
+ var _a, _b, _c, _d, _e, _f, _g, _h;
477
+ var _j = React.useState(false); _j[0]; _j[1];
478
+ var _k = React.useState(null), mainImage = _k[0], setMainImage = _k[1];
479
+ var _l = React.useState(0), currentImageIndex = _l[0], setCurrentImageIndex = _l[1];
475
480
  var imageListRef = React.useRef(null);
476
- var _l = React.useState(false); _l[0]; _l[1];
477
481
  var _m = React.useState(false); _m[0]; _m[1];
478
- var _o = React.useState(false), sharePopUp = _o[0], setSharePopUp = _o[1];
482
+ var _o = React.useState(false); _o[0]; _o[1];
483
+ var _p = React.useState(false), sharePopUp = _p[0], setSharePopUp = _p[1];
484
+ var _q = React.useState(false), isImagePopupOpen = _q[0], setIsImagePopupOpen = _q[1];
479
485
  var pictureUrls = ((_b = (_a = props.property) === null || _a === void 0 ? void 0 : _a.pictures) === null || _b === void 0 ? void 0 : _b.length) > 0
480
486
  ? props.property.pictures
481
487
  .filter(function (picture) { return picture.pictureType.id === 2; })
482
488
  .map(function (picture) { return "".concat(props.baseUrl).concat(picture.contentUrl); })
483
489
  : [noImageIcon];
484
- var floorPlanOnClick = function () {
485
- 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
+ }
486
505
  };
487
506
  var handleMessagPopUp = function () {
488
507
  // setMessagPopUp(true);
@@ -532,7 +551,7 @@ function PropertyCard(props) {
532
551
  React.createElement("img", { src: arrowRight, style: { right: "16px" } }))),
533
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" } },
534
553
  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" } },
554
+ React.createElement("div", { className: "Grundriss kontact-button-text ms-2 ", role: "button", onClick: function () { return handleFloorPlanButton(); }, style: { marginBottom: "16px" } },
536
555
  React.createElement("img", { src: iconLayers, className: "", style: { width: "18px" } }),
537
556
  " ",
538
557
  "Grundriss")))),
@@ -542,7 +561,7 @@ function PropertyCard(props) {
542
561
  React.createElement("span", { className: "propertyTitle align-items-start ", style: {
543
562
  paddingLeft: "32px",
544
563
  paddingTop: "32px",
545
- }, 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),
546
565
  React.createElement("div", { className: "d-flex gap-2", style: {
547
566
  paddingRight: "32px",
548
567
  paddingTop: "21px",
@@ -563,7 +582,7 @@ function PropertyCard(props) {
563
582
  paddingRight: "32px",
564
583
  } },
565
584
  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),
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),
567
586
  " \u20AC",
568
587
  React.createElement("div", { className: "price_label" }, "Kaufpreis")),
569
588
  React.createElement("span", { className: "text-dark value col-lg-5 col-md-5 col-sm-7" },
@@ -571,7 +590,7 @@ function PropertyCard(props) {
571
590
  " m\u00B2",
572
591
  React.createElement("div", { className: "details" }, "Wohnfl\u00E4che")),
573
592
  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),
593
+ +((_h = props.property) === null || _h === void 0 ? void 0 : _h.rooms),
575
594
  React.createElement("div", { className: "details" }, "Zimmer")),
576
595
  React.createElement("span", { className: "text-dark value col-lg-4 col-md-3 col-sm-4 text-truncate " },
577
596
  +props.property.propertyArea,
@@ -614,7 +633,8 @@ function PropertyCard(props) {
614
633
  React.createElement("span", { className: "kontact-button-text" },
615
634
  "Kontakt aufnehmen",
616
635
  " "))))))),
617
- 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); } }))));
618
638
  }
619
639
 
620
640
  var x = "/static/media/icon_close_2.e41bb9a4db48e048.png";