@lanaco/lnc-react-ui 4.0.142 → 4.0.144
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/Button.cjs +5 -5
- package/dist/Button.js +31 -31
- package/dist/DetailedProductsSection.cjs +2 -2
- package/dist/DetailedProductsSection.js +11 -11
- package/dist/IconButton.cjs +6 -6
- package/dist/IconButton.js +27 -27
- package/dist/SalesCampaignsSection.cjs +102 -51
- package/dist/SalesCampaignsSection.js +430 -403
- package/dist/UrgentSaleProductsSection.cjs +1 -1
- package/dist/UrgentSaleProductsSection.js +1 -1
- package/dist/{suspense-product-card-detailed-BA06QK8a.cjs → suspense-product-card-detailed-B7gioG73.cjs} +1 -1
- package/dist/{suspense-product-card-detailed-CUd-EI3U.js → suspense-product-card-detailed-FUKF_Pyc.js} +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const i=require("react/jsx-runtime"),l=require("react"),v=require("./emotion-styled.browser.esm-BtEseadx.cjs"),k=require("./consts-goSZX3xP.cjs"),C=require("./useDetectMobile-zkbzoOGV.cjs"),q=require("./Button.cjs"),w=require("./suspense-product-card-detailed-
|
|
1
|
+
"use strict";const i=require("react/jsx-runtime"),l=require("react"),v=require("./emotion-styled.browser.esm-BtEseadx.cjs"),k=require("./consts-goSZX3xP.cjs"),C=require("./useDetectMobile-zkbzoOGV.cjs"),q=require("./Button.cjs"),w=require("./suspense-product-card-detailed-B7gioG73.cjs"),N=v.styled.div`
|
|
2
2
|
padding: 1.75rem 3rem;
|
|
3
3
|
display: grid;
|
|
4
4
|
grid-template-columns: ${o=>`repeat(${o.limit||5}, minmax(0, 1fr))`};
|
|
@@ -4,7 +4,7 @@ import { s as F } from "./emotion-styled.browser.esm-BNN1dTl3.js";
|
|
|
4
4
|
import { M as I, S as T } from "./consts-BuFChS64.js";
|
|
5
5
|
import { u as _ } from "./useDetectMobile-Bkvj0VMa.js";
|
|
6
6
|
import B from "./Button.js";
|
|
7
|
-
import { D, S as E } from "./suspense-product-card-detailed-
|
|
7
|
+
import { D, S as E } from "./suspense-product-card-detailed-FUKF_Pyc.js";
|
|
8
8
|
const j = F.div`
|
|
9
9
|
padding: 1.75rem 3rem;
|
|
10
10
|
display: grid;
|
|
@@ -262,4 +262,4 @@
|
|
|
262
262
|
font-size: 1rem;
|
|
263
263
|
color: var(--warning-500, #F59E0B);
|
|
264
264
|
}
|
|
265
|
-
`,ve=l.forwardRef(({sponsoredText:m="Sponsored"},w)=>e.jsxs(fe,{ref:w,className:"sponsored-line",children:[e.jsx("i",{className:"mng-lnc-paw2"}),e.jsx("span",{children:m})]})),we="Vehicles_Cars",be="Vehicles_Motorcycles",ye="Vehicles_Trucks",ke="Vehicles_AgriculturalMachines_Tractors",je="Vehicles_ConstructionMachines",_e="Vehicles_Bus",xe="Vehicles_Campers",Ne="RealEstates_",i={Mileage:{icon:"mng-lnc-road",measure:"km"},YearOfProduction:{icon:"mng-lnc-calendar",measure:""},Fuel:{icon:"mng-lnc-gas-station",measure:""},EnginePowerKW:{icon:"mng-lnc-engine",measure:"kW"},Transmission:{icon:"mng-lnc-transmission",measure:""},Model:{icon:"mng-lnc-application",measure:""},Brand:{icon:"mng-lnc-car--front",measure:""},SurfaceArea:{icon:"mng-lnc-right-angle",measure:""},Floor:{icon:"mng-lnc-elevator",measure:""},FurnishedCondition:{icon:"mng-lnc-sofa-01",measure:""},AdType:{icon:"mng-lnc-notes",measure:""},NumberOfRooms:{icon:"mng-lnc-meeting-room",measure:""},HeatingType:{icon:"mng-lnc-heat",measure:""},AirConditioning:{icon:"mng-lnc-air-conditioner",measure:""},Type:{icon:"mng-lnc-house-building",measure:""},Parking:{icon:"mng-lnc-parking-area-circle",measure:""},Internet:{icon:"mng-lnc-wifi-02",measure:""},State:{icon:"mng-lnc-settings-1",measure:""},NumberOfPremises:{icon:"mng-lnc-meeting-room",measure:""},Pool:{icon:"mng-lnc-pool",measure:""},Approach:{icon:"mng-lnc-driveway",measure:""},NumberOfBeds:{icon:"mng-lnc-bed",measure:""},Kitchen:{icon:"mng-lnc-fridge",measure:""},BathroomToilet:{icon:"mng-lnc-bath",measure:""},default:{icon:" mng-lnc-clock--filled",measure:""}},Ce=l.forwardRef((m,w)=>{const{uuid:p,
|
|
265
|
+
`,ve=l.forwardRef(({sponsoredText:m="Sponsored"},w)=>e.jsxs(fe,{ref:w,className:"sponsored-line",children:[e.jsx("i",{className:"mng-lnc-paw2"}),e.jsx("span",{children:m})]})),we="Vehicles_Cars",be="Vehicles_Motorcycles",ye="Vehicles_Trucks",ke="Vehicles_AgriculturalMachines_Tractors",je="Vehicles_ConstructionMachines",_e="Vehicles_Bus",xe="Vehicles_Campers",Ne="RealEstates_",i={Mileage:{icon:"mng-lnc-road",measure:"km"},YearOfProduction:{icon:"mng-lnc-calendar",measure:""},Fuel:{icon:"mng-lnc-gas-station",measure:""},EnginePowerKW:{icon:"mng-lnc-engine",measure:"kW"},Transmission:{icon:"mng-lnc-transmission",measure:""},Model:{icon:"mng-lnc-application",measure:""},Brand:{icon:"mng-lnc-car--front",measure:""},SurfaceArea:{icon:"mng-lnc-right-angle",measure:""},Floor:{icon:"mng-lnc-elevator",measure:""},FurnishedCondition:{icon:"mng-lnc-sofa-01",measure:""},AdType:{icon:"mng-lnc-notes",measure:""},NumberOfRooms:{icon:"mng-lnc-meeting-room",measure:""},HeatingType:{icon:"mng-lnc-heat",measure:""},AirConditioning:{icon:"mng-lnc-air-conditioner",measure:""},Type:{icon:"mng-lnc-house-building",measure:""},Parking:{icon:"mng-lnc-parking-area-circle",measure:""},Internet:{icon:"mng-lnc-wifi-02",measure:""},State:{icon:"mng-lnc-settings-1",measure:""},NumberOfPremises:{icon:"mng-lnc-meeting-room",measure:""},Pool:{icon:"mng-lnc-pool",measure:""},Approach:{icon:"mng-lnc-driveway",measure:""},NumberOfBeds:{icon:"mng-lnc-bed",measure:""},Kitchen:{icon:"mng-lnc-fridge",measure:""},BathroomToilet:{icon:"mng-lnc-bath",measure:""},default:{icon:" mng-lnc-clock--filled",measure:""}},Ce=l.forwardRef((m,w)=>{const{uuid:p,name:y,price:u=0,sellingPrice:k,currency:j,isNegotiable:N,isFree:C,imageUrl:L,location:U,sponsored:O,imageComponent:V,onSelectCard:Y=()=>{},freeText:K="Free",negotiableText:Z="Negotiable",tags:t=[],categoryCode:P,condition:$,quantity:S,trade:E,sponsoredText:H,onBookmark:B=()=>{},bookmarkComponent:z,bookmarked:M,bookmarkLists:J}=m,T=ge.useDetectMobile(),Q=()=>o.isDefined(z)?l.cloneElement(z,{key:`bookmark_pr__${M}`,bookmarked:M,productUuid:p,onAddToBookmark:()=>B(!0,p),onRemoveFromBookmark:()=>B(!1,p),bookmarkedUuidList:J}):e.jsx(e.Fragment,{}),q=[we,be,ye,ke,je,_e,xe,Ne].some(r=>P==null?void 0:P.includes(r)),[ee,F]=l.useState(!1),re=()=>{F(!0)},ne=()=>{F(!1)},a=l.useRef(null),h=l.useRef([]),[W,oe]=l.useState(t==null?void 0:t.length),te=()=>{var f,c,b;if(!(a!=null&&a.current)||((f=h==null?void 0:h.current)==null?void 0:f.length)===0)return;const r=(c=a==null?void 0:a.current)==null?void 0:c.offsetWidth;let n=0,s=0;for(let d=0;d<(t==null?void 0:t.length);d++){const v=((b=h==null?void 0:h.current[d])==null?void 0:b.offsetWidth)||0,g=n+v+4;if(g<=r)n+=g,s++;else break}oe(s)};l.useEffect(()=>{const r=a==null?void 0:a.current;if(!r)return;const n=new ResizeObserver(()=>{te()});return n.observe(r),()=>{n.disconnect()}},[t]);const se=()=>{var r;return e.jsx("div",{className:"tags-popover__trigger",children:(r=t==null?void 0:t.slice(0,W))==null?void 0:r.map((n,s)=>{var v,g,I,R,G;const f=((v=i==null?void 0:i[n==null?void 0:n.code])==null?void 0:v.icon)??((g=i==null?void 0:i.default)==null?void 0:g.icon)??"",c=((I=n==null?void 0:n.measurementUnit)==null?void 0:I.symbol)??((R=i==null?void 0:i[n==null?void 0:n.code])==null?void 0:R.measure)??"",d=[(n==null?void 0:n.value)??((G=n==null?void 0:n.multiOptions)==null?void 0:G[0])??"",c].filter(Boolean).join(" ");return T?e.jsxs("div",{className:"tag-mobile",children:[d,s<W-1?" · ":""]}):e.jsxs(_,{ref:ce=>h.current[s]=ce,className:`tag ${O?"tag-sponsored":""}`,children:[e.jsx("i",{className:f}),d]},`detailed-products-section-tag__${s+1}`)})})},ie=()=>e.jsx("div",{className:"tags-popover__content",children:t==null?void 0:t.map((r,n)=>{var d,v,g;const s=((d=r==null?void 0:r.measurementUnit)==null?void 0:d.symbol)??((v=i==null?void 0:i[r==null?void 0:r.code])==null?void 0:v.measure)??"",c=[(r==null?void 0:r.value)??((g=r==null?void 0:r.multiOptions)==null?void 0:g[0])??"",s].filter(Boolean).join(" "),b=r==null?void 0:r.name;return e.jsxs("div",{children:[e.jsx("span",{className:"tags-popover__name",children:`${b}: `}),e.jsx("span",{className:"tags-popover__value",children:c})]},`detailed-products-section-tag-dropdown__${n+1}`)})}),ae=()=>{var r;if(T){const n=[$,S,E];return(r=n==null?void 0:n.filter(s=>o.isDefinedNotEmptyString(s)))==null?void 0:r.map((s,f,c)=>e.jsxs("div",{className:"tag-mobile",children:[s,f<(c==null?void 0:c.length)-1?" · ":""]}))}return e.jsxs(e.Fragment,{children:[$&&e.jsx(_,{className:"tag",children:$},"detailed-products-section-tag__condition"),S&&e.jsx(_,{className:"tag",children:S},"detailed-products-section-tag__quantity"),E&&e.jsx(_,{className:"tag",children:E},"detailed-products-section-tag__trade")]})},D=u>0&&j&&N!==!0&&C!==!0&&u!==k;return e.jsxs(X,{ref:a,className:"product-card",onClick:Y,children:[e.jsxs(ue,{className:"product-image-wrapper",children:[e.jsx(Q,{}),o.isDefined(V)?V:e.jsx(le.ProductImageWrapper,{src:L})]}),e.jsx("div",{className:"wrapper-card-1",children:e.jsx("div",{className:"card-title",children:y})}),e.jsxs("div",{className:"wrapper-card-3",children:[q&&e.jsx("div",{...T?{}:{onMouseEnter:re,onMouseLeave:ne},children:e.jsxs(de,{placement:"bottom",open:ee,children:[e.jsx(me,{children:se()}),e.jsx(pe,{style:{all:"unset"},children:e.jsx(he,{children:ie()})})]})}),!q&&ae()]}),e.jsxs("div",{className:"wrapper-card-2",children:[e.jsxs("div",{className:`price-text ${D?"new-price":""}`,children:[k>0&&j&&N!==!0&&C!==!0&&e.jsx("div",{children:`${o.formatPrice(k)} ${o.GetCurrencySymbol(j)}`}),D&&e.jsx("div",{className:`${k>0?"full-price":""}`,children:`${o.formatPrice(u)} ${o.GetCurrencySymbol(j)}`}),N&&Z,C&&K]}),e.jsx("div",{className:"location-text",children:U})]}),O===!0&&e.jsx(ve,{sponsoredText:H})]})}),Pe=l.forwardRef(({},m)=>e.jsxs(X,{className:"product-card",children:[e.jsx("img",{className:"skeleton-img"}),e.jsxs("div",{className:"wrapper-card-1",children:[e.jsx("div",{className:"skeleton-title"}),e.jsx("div",{className:"skeleton-tags"})]}),e.jsxs("div",{className:"wrapper-card-1",children:[e.jsx("div",{className:"skeleton-price"}),e.jsx("div",{className:"skeleton-sponsored"})]})]})),$e=({limit:m=5,isLoading:w=!1,keyPrefix:p})=>e.jsx(e.Fragment,{children:Array.from({length:m},(y,u)=>e.jsx(Pe,{isLoading:w},`${p}-skeleton-product-card-${u}`))}),Se=({children:m,fallbackComponent:w=e.jsx(e.Fragment,{}),isLoading:p=!1,limit:y,keyPrefix:u})=>e.jsx(l.Suspense,{fallbackComponent:w,children:p===!0?e.jsx($e,{isLoading:p,limit:y,keyPrefix:u}):m});exports.DetailedProductCard=Ce;exports.SuspenseDetailedProductCard=Se;
|