@lanaco/lnc-react-ui 4.0.156 → 4.0.157
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/BlogCardsSponsoredSection.cjs +1 -1
- package/dist/BlogCardsSponsoredSection.js +1 -1
- package/dist/BlogListSection.cjs +1 -1
- package/dist/BlogListSection.js +1 -1
- package/dist/BlogsSectionDetailed.cjs +1 -1
- package/dist/BlogsSectionDetailed.js +1 -1
- package/dist/BlogsSectionSimple.cjs +1 -1
- package/dist/BlogsSectionSimple.js +1 -1
- package/dist/BlogsSectionWithFilters.cjs +1 -1
- package/dist/BlogsSectionWithFilters.js +1 -1
- package/dist/DetailedProductsInfinitiveSection.cjs +7 -2
- package/dist/DetailedProductsInfinitiveSection.js +60 -50
- package/dist/DetailedProductsSection.cjs +1 -1
- package/dist/DetailedProductsSection.js +2 -2
- package/dist/GiftCardsSection.cjs +1 -1
- package/dist/GiftCardsSection.js +1 -1
- package/dist/ProductsWithBannerSection.cjs +1 -1
- package/dist/ProductsWithBannerSection.js +1 -1
- package/dist/SalesCampaignsSection.cjs +1 -1
- package/dist/SalesCampaignsSection.js +63 -60
- package/dist/SimpleCategoriesSection.cjs +1 -1
- package/dist/SimpleCategoriesSection.js +1 -1
- package/dist/UrgentSaleProductsSection.cjs +1 -1
- package/dist/UrgentSaleProductsSection.js +1 -1
- package/dist/{style-DFPWLJBr.js → style-BLuyU97E.js} +4 -0
- package/dist/{style-CyHewQxg.cjs → style-lSjkOR95.cjs} +6 -2
- package/dist/{suspense-product-card-detailed-YJVsf2-a.js → suspense-product-card-detailed-BWoxabjZ.js} +162 -136
- package/dist/suspense-product-card-detailed-DYyH_jf5.cjs +300 -0
- package/package.json +1 -1
- package/dist/suspense-product-card-detailed-mCJwteOy.cjs +0 -265
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),i=require("react"),t=require("./utils-Dl9xPH4c.cjs"),C=require("./emotion-styled.browser.esm-BtEseadx.cjs"),le=require("./index-BueKsXT8.cjs"),_=require("./Badge.cjs"),de=require("./Popover.cjs"),me=require("./PopoverTrigger.cjs"),pe=require("./PopoverContent.cjs"),ue=require("./useDetectMobile-zkbzoOGV.cjs"),G=require("./consts-goSZX3xP.cjs"),A=C.styled.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 0.5rem;
|
|
5
|
+
cursor: pointer;
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
width: 100%;
|
|
8
|
+
|
|
9
|
+
& .wrapper-card-1 {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
gap: 0.38rem;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
& .wrapper-card-2 {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
gap: 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
& .wrapper-card-3 {
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-wrap: wrap;
|
|
24
|
+
gap: 0.25rem;
|
|
25
|
+
|
|
26
|
+
& > div {
|
|
27
|
+
& > div {
|
|
28
|
+
width: 100% !important;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
& .tag {
|
|
34
|
+
height: 1.5rem;
|
|
35
|
+
gap: 0.25rem;
|
|
36
|
+
padding: 0.25rem 0.375rem;
|
|
37
|
+
border-radius: 0.375rem;
|
|
38
|
+
background: #f9fafb;
|
|
39
|
+
border: 1px solid var(--gray-95012, #14161a1f);
|
|
40
|
+
font-weight: 400;
|
|
41
|
+
font-size: 0.75rem;
|
|
42
|
+
line-height: 1rem;
|
|
43
|
+
letter-spacing: 0.025rem;
|
|
44
|
+
color: var(--gray-950, #14161a);
|
|
45
|
+
white-space: nowrap;
|
|
46
|
+
flex: 0 0 auto;
|
|
47
|
+
|
|
48
|
+
& i {
|
|
49
|
+
color: var(--yellow-500, #f59e0b);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
& .card-title {
|
|
54
|
+
font-size: 0.875rem;
|
|
55
|
+
font-weight: 600;
|
|
56
|
+
${t.truncateTextInRows(2)}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
& .price-text {
|
|
60
|
+
font-size: 1rem;
|
|
61
|
+
font-weight: 600;
|
|
62
|
+
${t.truncateText()}
|
|
63
|
+
display: flex;
|
|
64
|
+
align-items: end;
|
|
65
|
+
gap: 0.5rem;
|
|
66
|
+
color: var(--gray-950, #14161a);
|
|
67
|
+
|
|
68
|
+
&.new-price {
|
|
69
|
+
color: var(--danger-600, #e11d48);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
& .full-price {
|
|
73
|
+
text-decoration: line-through;
|
|
74
|
+
font-size: 0.75rem;
|
|
75
|
+
font-weight: 400;
|
|
76
|
+
padding-bottom: 0.125rem;
|
|
77
|
+
color: var(--gray-600, #676e79);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
& .location-text {
|
|
82
|
+
font-size: 0.75rem;
|
|
83
|
+
font-weight: 400;
|
|
84
|
+
color: var(--gray-600, #676e79);
|
|
85
|
+
${t.truncateText()}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
& .tags-wrapper {
|
|
89
|
+
display: flex;
|
|
90
|
+
gap: 0.5rem;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
& .skeleton-img {
|
|
94
|
+
background-color: ${t.linearGradientAnimation("-90deg")};
|
|
95
|
+
border-radius: 0.75rem;
|
|
96
|
+
border: 1px solid white;
|
|
97
|
+
width: 100%;
|
|
98
|
+
height: 11rem;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
& .skeleton-title {
|
|
102
|
+
background-color: ${t.linearGradientAnimation("-90deg")};
|
|
103
|
+
width: 100%;
|
|
104
|
+
height: 2.5rem;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
& .skeleton-tags {
|
|
108
|
+
background-color: ${t.linearGradientAnimation("-90deg")};
|
|
109
|
+
width: 80%;
|
|
110
|
+
height: 1.5rem;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
& .skeleton-price {
|
|
114
|
+
background-color: ${t.linearGradientAnimation("-90deg")};
|
|
115
|
+
width: 50%;
|
|
116
|
+
height: 2.5rem;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
& .skeleton-sponsored {
|
|
120
|
+
background-color: ${t.linearGradientAnimation("-90deg")};
|
|
121
|
+
width: 50%;
|
|
122
|
+
height: 1rem;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
& .tags-popover__trigger {
|
|
126
|
+
display: flex;
|
|
127
|
+
gap: 0.25rem;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
@media (max-width: ${G.MOBILE_SIZE_PX+"px"}) {
|
|
131
|
+
overflow: visible;
|
|
132
|
+
|
|
133
|
+
& .wrapper-card-3 {
|
|
134
|
+
flex-wrap: nowrap;
|
|
135
|
+
justify-content: flex-start;
|
|
136
|
+
overflow-x: scroll;
|
|
137
|
+
width: 8.875rem !important;
|
|
138
|
+
|
|
139
|
+
-webkit-overflow-scrolling: touch;
|
|
140
|
+
::-webkit-scrollbar {
|
|
141
|
+
-webkit-appearance: none;
|
|
142
|
+
}
|
|
143
|
+
-ms-overflow-style: none;
|
|
144
|
+
/* Internet Explorer 10+ */
|
|
145
|
+
scrollbar-width: none;
|
|
146
|
+
/* Firefox */
|
|
147
|
+
|
|
148
|
+
&::-webkit-scrollbar {
|
|
149
|
+
display: none;
|
|
150
|
+
/* Safari and Chrome */
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
& > div {
|
|
154
|
+
& > div {
|
|
155
|
+
width: 8.875rem !important;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
& .tags-popover__trigger {
|
|
161
|
+
overflow-x: scroll;
|
|
162
|
+
justify-content: flex-start;
|
|
163
|
+
width: 100%;
|
|
164
|
+
|
|
165
|
+
-webkit-overflow-scrolling: touch;
|
|
166
|
+
::-webkit-scrollbar {
|
|
167
|
+
-webkit-appearance: none;
|
|
168
|
+
}
|
|
169
|
+
-ms-overflow-style: none;
|
|
170
|
+
/* Internet Explorer 10+ */
|
|
171
|
+
scrollbar-width: none;
|
|
172
|
+
/* Firefox */
|
|
173
|
+
|
|
174
|
+
&::-webkit-scrollbar {
|
|
175
|
+
display: none;
|
|
176
|
+
/* Safari and Chrome */
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
& .price-text {
|
|
181
|
+
font-size: 0.875rem;
|
|
182
|
+
font-weight: 600;
|
|
183
|
+
|
|
184
|
+
& .full-price {
|
|
185
|
+
display: none;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
&:hover .product-image-wrapper img {
|
|
191
|
+
transform: scale(1.1);
|
|
192
|
+
}
|
|
193
|
+
`,ge=C.styled.div`
|
|
194
|
+
position: relative;
|
|
195
|
+
overflow: hidden;
|
|
196
|
+
border-radius: 0.75rem;
|
|
197
|
+
width: 100%;
|
|
198
|
+
aspect-ratio: 1 / 1;
|
|
199
|
+
border: 1px solid #0c15201f;
|
|
200
|
+
|
|
201
|
+
& .bookmarking-btn {
|
|
202
|
+
position: absolute;
|
|
203
|
+
right: 0.5rem;
|
|
204
|
+
top: 0.5rem;
|
|
205
|
+
z-index: 1;
|
|
206
|
+
|
|
207
|
+
display: none;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
&:hover {
|
|
211
|
+
& .bookmarking-btn {
|
|
212
|
+
display: flex;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
& img {
|
|
217
|
+
display: block;
|
|
218
|
+
width: 100%;
|
|
219
|
+
height: 100%;
|
|
220
|
+
object-fit: cover;
|
|
221
|
+
border-radius: 0.75rem;
|
|
222
|
+
transition: var(--transition, all 0.3s ease);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
@media (max-width: ${G.MOBILE_SIZE_PX+"px"}) {
|
|
226
|
+
& img {
|
|
227
|
+
width: 8.875rem;
|
|
228
|
+
height: 8.875rem;
|
|
229
|
+
min-width: 8.875rem;
|
|
230
|
+
min-height: 8.875rem;
|
|
231
|
+
object-fit: cover;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
& .bookmarking-btn {
|
|
235
|
+
display: flex;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
`,he=C.styled.div`
|
|
239
|
+
background: var(--white, #fff);
|
|
240
|
+
z-index: 1;
|
|
241
|
+
|
|
242
|
+
border: 1px solid var(--gray-200, #dddfe4);
|
|
243
|
+
border-radius: 0.5rem;
|
|
244
|
+
line-height: 1rem;
|
|
245
|
+
position: absolute;
|
|
246
|
+
padding: 0.5rem 0.75rem;
|
|
247
|
+
top: 0.5rem;
|
|
248
|
+
left: 25%;
|
|
249
|
+
transform: translateX(-50%);
|
|
250
|
+
min-width: 13rem;
|
|
251
|
+
|
|
252
|
+
&::before,
|
|
253
|
+
&::after {
|
|
254
|
+
content: "";
|
|
255
|
+
position: absolute;
|
|
256
|
+
left: 50%;
|
|
257
|
+
transform: translateX(-50%);
|
|
258
|
+
border-style: solid;
|
|
259
|
+
border-width: 0.625rem;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
&::after {
|
|
263
|
+
top: -1.1875rem;
|
|
264
|
+
border-color: transparent transparent var(--white, #fff) transparent;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
&::before {
|
|
268
|
+
top: -1.25rem;
|
|
269
|
+
border-color: transparent transparent var(--gray-200, #dddfe4) transparent;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
& .tags-popover__content {
|
|
273
|
+
display: flex;
|
|
274
|
+
flex-wrap: wrap;
|
|
275
|
+
flex-direction: column;
|
|
276
|
+
gap: 0.375rem;
|
|
277
|
+
font-size: 0.75rem;
|
|
278
|
+
font-weight: 400;
|
|
279
|
+
|
|
280
|
+
& .tags-popover__name {
|
|
281
|
+
color: var(--gray-600, #676e79);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
& .tags-popover__value {
|
|
285
|
+
color: var(--gray-950, #14161a);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
`,fe=C.styled.div`
|
|
289
|
+
display: flex;
|
|
290
|
+
align-items: center;
|
|
291
|
+
gap: 0.25rem;
|
|
292
|
+
color: var(--gray-500);
|
|
293
|
+
font-size: 0.75rem;
|
|
294
|
+
font-weight: 500;
|
|
295
|
+
|
|
296
|
+
& i {
|
|
297
|
+
font-size: 1rem;
|
|
298
|
+
color: var(--warning-500, #F59E0B);
|
|
299
|
+
}
|
|
300
|
+
`,ve=i.forwardRef(({sponsoredText:l="Sponsored"},v)=>e.jsxs(fe,{ref:v,className:"sponsored-line",children:[e.jsx("i",{className:"mng-lnc-paw2"}),e.jsx("span",{children:l})]})),we="Vehicles_Cars",be="Vehicles_Motorcycles",ye="Vehicles_Trucks",ke="Vehicles_AgriculturalMachines_Tractors",je="Vehicles_ConstructionMachines",xe="Vehicles_Bus",_e="Vehicles_Campers",Ce="RealEstates_",s={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:""}},Ne=i.forwardRef((l,v)=>{const{uuid:d,name:k,price:g=0,sellingPrice:j,currency:x,isNegotiable:N,isFree:P,imageUrl:X,location:L,sponsored:U,imageComponent:S,onSelectCard:Y=()=>{},freeText:K="Free",negotiableText:Z="Negotiable",tags:n=[],categoryCode:$,condition:T,quantity:O,trade:V,sponsoredText:H,onBookmark:B=()=>{},bookmarkComponent:b,bookmarked:F,bookmarkLists:J}=l,E=ue.useDetectMobile(),Q=()=>{var m;if(!t.isDefined(b))return e.jsx(e.Fragment,{});const r=b,o=(m=b==null?void 0:b.props)==null?void 0:m.children,c=i.cloneElement(o,{key:`bookmark_pr__${F}`,bookmarked:F,productUuid:d,onAddToBookmark:()=>B(!0,d),onRemoveFromBookmark:()=>B(!1,d),bookmarkedUuidList:J});return i.cloneElement(r,void 0,c)},M=[we,be,ye,ke,je,xe,_e,Ce].some(r=>$==null?void 0:$.includes(r)),[ee,q]=i.useState(!1),re=()=>{q(!0)},oe=()=>{q(!1)},a=i.useRef(null),h=i.useRef([]),[ne,z]=i.useState(n==null?void 0:n.length),te=()=>{var m,w,y;if(!(a!=null&&a.current)||((m=h==null?void 0:h.current)==null?void 0:m.length)===0)return;if(E){z(n==null?void 0:n.length);return}const r=(w=a==null?void 0:a.current)==null?void 0:w.offsetWidth;let o=0,c=0;for(let p=0;p<(n==null?void 0:n.length);p++){const f=((y=h==null?void 0:h.current[p])==null?void 0:y.offsetWidth)||0,u=o+f+4;if(u<=r)o+=u,c++;else break}z(c)};i.useEffect(()=>{const r=a==null?void 0:a.current;if(!r)return;const o=new ResizeObserver(()=>{te()});return o.observe(r),()=>{o.disconnect()}},[n,E]);const se=()=>{var r;return e.jsx("div",{className:"tags-popover__trigger",children:(r=n==null?void 0:n.slice(0,ne))==null?void 0:r.map((o,c)=>{var f,u,W,D,R;const m=((f=s==null?void 0:s[o==null?void 0:o.code])==null?void 0:f.icon)??((u=s==null?void 0:s.default)==null?void 0:u.icon)??"",w=((W=o==null?void 0:o.measurementUnit)==null?void 0:W.symbol)??((D=s==null?void 0:s[o==null?void 0:o.code])==null?void 0:D.measure)??"",p=[(o==null?void 0:o.value)??((R=o==null?void 0:o.multiOptions)==null?void 0:R[0])??"",w].filter(Boolean).join(" ");return e.jsxs(_,{ref:ce=>h.current[c]=ce,className:"tag",children:[e.jsx("i",{className:m}),p]},`detailed-products-section-tag__${c+1}`)})})},ie=()=>e.jsx("div",{className:"tags-popover__content",children:n==null?void 0:n.map((r,o)=>{var p,f,u;const c=((p=r==null?void 0:r.measurementUnit)==null?void 0:p.symbol)??((f=s==null?void 0:s[r==null?void 0:r.code])==null?void 0:f.measure)??"",w=[(r==null?void 0:r.value)??((u=r==null?void 0:r.multiOptions)==null?void 0:u[0])??"",c].filter(Boolean).join(" "),y=r==null?void 0:r.name;return e.jsxs("div",{children:[e.jsx("span",{className:"tags-popover__name",children:`${y}: `}),e.jsx("span",{className:"tags-popover__value",children:w})]},`detailed-products-section-tag-dropdown__${o+1}`)})}),ae=()=>e.jsxs(e.Fragment,{children:[T&&e.jsx(_,{className:"tag",children:T},"detailed-products-section-tag__condition"),O&&e.jsx(_,{className:"tag",children:O},"detailed-products-section-tag__quantity"),V&&e.jsx(_,{className:"tag",children:V},"detailed-products-section-tag__trade")]}),I=g>0&&x&&N!==!0&&P!==!0&&g!==j;return e.jsxs(A,{ref:a,className:"product-card",onClick:Y,children:[e.jsxs(ge,{className:"product-image-wrapper",children:[e.jsx(Q,{}),t.isDefined(S)?S:e.jsx(le.ProductImageWrapper,{src:X})]}),e.jsx("div",{className:"wrapper-card-1",children:e.jsx("div",{className:"card-title",children:k})}),e.jsxs("div",{className:"wrapper-card-3",children:[M&&e.jsx("div",{...E?{}:{onMouseEnter:re,onMouseLeave:oe},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()})})]})}),!M&&ae()]}),e.jsxs("div",{className:"wrapper-card-2",children:[e.jsxs("div",{className:`price-text ${I?"new-price":""}`,children:[j>0&&x&&N!==!0&&P!==!0&&e.jsx("div",{children:`${t.formatPrice(j)} ${t.GetCurrencySymbol(x)}`}),I&&e.jsx("div",{className:`${j>0?"full-price":""}`,children:`${t.formatPrice(g)} ${t.GetCurrencySymbol(x)}`}),N&&Z,P&&K]}),e.jsx("div",{className:"location-text",children:L})]}),U===!0&&e.jsx(ve,{sponsoredText:H})]})}),Pe=i.forwardRef(({},l)=>e.jsxs(A,{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:l=5,isLoading:v=!1,keyPrefix:d})=>e.jsx(e.Fragment,{children:Array.from({length:l},(k,g)=>e.jsx(Pe,{isLoading:v},`${d}-skeleton-product-card-${g}`))}),Ee=({children:l,fallbackComponent:v=e.jsx(e.Fragment,{}),isLoading:d=!1,limit:k,keyPrefix:g})=>e.jsx(i.Suspense,{fallbackComponent:v,children:d===!0?e.jsx($e,{isLoading:d,limit:k,keyPrefix:g}):l});exports.DetailedProductCard=Ne;exports.SuspenseDetailedProductCard=Ee;
|
package/package.json
CHANGED
|
@@ -1,265 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),a=require("react"),t=require("./utils-Dl9xPH4c.cjs"),N=require("./emotion-styled.browser.esm-BtEseadx.cjs"),le=require("./index-BueKsXT8.cjs"),x=require("./Badge.cjs"),de=require("./Popover.cjs"),me=require("./PopoverTrigger.cjs"),pe=require("./PopoverContent.cjs"),ue=require("./useDetectMobile-zkbzoOGV.cjs"),R=require("./consts-goSZX3xP.cjs"),G=N.styled.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
gap: 0.5rem;
|
|
5
|
-
cursor: pointer;
|
|
6
|
-
overflow: hidden;
|
|
7
|
-
width: 100%;
|
|
8
|
-
|
|
9
|
-
& .wrapper-card-1 {
|
|
10
|
-
display: flex;
|
|
11
|
-
flex-direction: column;
|
|
12
|
-
gap: 0.38rem;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
& .wrapper-card-2 {
|
|
16
|
-
display: flex;
|
|
17
|
-
flex-direction: column;
|
|
18
|
-
gap: 0;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
& .wrapper-card-3 {
|
|
22
|
-
display: flex;
|
|
23
|
-
flex-wrap: wrap;
|
|
24
|
-
gap: 0.25rem;
|
|
25
|
-
|
|
26
|
-
& > div {
|
|
27
|
-
& > div {
|
|
28
|
-
width: 100% !important;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
& .tag {
|
|
34
|
-
height: 1.5rem;
|
|
35
|
-
gap: 0.25rem;
|
|
36
|
-
padding: 0.25rem 0.375rem;
|
|
37
|
-
border-radius: 0.375rem;
|
|
38
|
-
background: #f9fafb;
|
|
39
|
-
border: 1px solid var(--gray-95012, #14161a1f);
|
|
40
|
-
font-weight: 400;
|
|
41
|
-
font-size: 0.75rem;
|
|
42
|
-
line-height: 1rem;
|
|
43
|
-
letter-spacing: 0.025rem;
|
|
44
|
-
color: var(--gray-950, #14161a);
|
|
45
|
-
white-space: nowrap;
|
|
46
|
-
flex: 0 0 auto;
|
|
47
|
-
|
|
48
|
-
& i {
|
|
49
|
-
color: var(--yellow-500, #f59e0b);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
& .tag-mobile {
|
|
54
|
-
font-weight: 400;
|
|
55
|
-
font-size: 0.75rem;
|
|
56
|
-
line-height: 1rem;
|
|
57
|
-
letter-spacing: 0.025rem;
|
|
58
|
-
color: var(--gray-600, #676e79);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
& .card-title {
|
|
62
|
-
font-size: 0.875rem;
|
|
63
|
-
font-weight: 600;
|
|
64
|
-
${t.truncateTextInRows(2)}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
& .price-text {
|
|
68
|
-
font-size: 1rem;
|
|
69
|
-
font-weight: 600;
|
|
70
|
-
${t.truncateText()}
|
|
71
|
-
display: flex;
|
|
72
|
-
align-items: end;
|
|
73
|
-
gap: 0.5rem;
|
|
74
|
-
color: var(--gray-950, #14161a);
|
|
75
|
-
|
|
76
|
-
&.new-price {
|
|
77
|
-
color: var(--danger-600, #e11d48);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
& .full-price {
|
|
81
|
-
text-decoration: line-through;
|
|
82
|
-
font-size: 0.75rem;
|
|
83
|
-
font-weight: 400;
|
|
84
|
-
padding-bottom: 0.125rem;
|
|
85
|
-
color: var(--gray-600, #676e79);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
& .location-text {
|
|
90
|
-
font-size: 0.75rem;
|
|
91
|
-
font-weight: 400;
|
|
92
|
-
color: var(--gray-600, #676e79);
|
|
93
|
-
${t.truncateText()}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
& .tags-wrapper {
|
|
97
|
-
display: flex;
|
|
98
|
-
gap: 0.5rem;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
& .skeleton-img {
|
|
102
|
-
background-color: ${t.linearGradientAnimation("-90deg")};
|
|
103
|
-
border-radius: 0.75rem;
|
|
104
|
-
border: 1px solid white;
|
|
105
|
-
width: 100%;
|
|
106
|
-
height: 11rem;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
& .skeleton-title {
|
|
110
|
-
background-color: ${t.linearGradientAnimation("-90deg")};
|
|
111
|
-
width: 100%;
|
|
112
|
-
height: 2.5rem;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
& .skeleton-tags {
|
|
116
|
-
background-color: ${t.linearGradientAnimation("-90deg")};
|
|
117
|
-
width: 80%;
|
|
118
|
-
height: 1.5rem;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
& .skeleton-price {
|
|
122
|
-
background-color: ${t.linearGradientAnimation("-90deg")};
|
|
123
|
-
width: 50%;
|
|
124
|
-
height: 2.5rem;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
& .skeleton-sponsored {
|
|
128
|
-
background-color: ${t.linearGradientAnimation("-90deg")};
|
|
129
|
-
width: 50%;
|
|
130
|
-
height: 1rem;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
& .tags-popover__trigger {
|
|
134
|
-
display: flex;
|
|
135
|
-
gap: 0.25rem;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
@media (max-width: ${R.MOBILE_SIZE_PX+"px"}) {
|
|
139
|
-
overflow: visible;
|
|
140
|
-
|
|
141
|
-
& .tags-popover__trigger {
|
|
142
|
-
flex-wrap: wrap;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
& .price-text {
|
|
146
|
-
font-size: 0.875rem;
|
|
147
|
-
font-weight: 600;
|
|
148
|
-
|
|
149
|
-
& .full-price {
|
|
150
|
-
display: none;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
&:hover .product-image-wrapper img {
|
|
156
|
-
transform: scale(1.1);
|
|
157
|
-
}
|
|
158
|
-
`,ge=N.styled.div`
|
|
159
|
-
position: relative;
|
|
160
|
-
overflow: hidden;
|
|
161
|
-
border-radius: 0.75rem;
|
|
162
|
-
width: 100%;
|
|
163
|
-
aspect-ratio: 1 / 1;
|
|
164
|
-
border: 1px solid #0c15201f;
|
|
165
|
-
|
|
166
|
-
& .bookmarking-btn {
|
|
167
|
-
position: absolute;
|
|
168
|
-
right: 0.5rem;
|
|
169
|
-
top: 0.5rem;
|
|
170
|
-
z-index: 1;
|
|
171
|
-
|
|
172
|
-
display: none;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
&:hover {
|
|
176
|
-
& .bookmarking-btn {
|
|
177
|
-
display: flex;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
& img {
|
|
182
|
-
display: block;
|
|
183
|
-
width: 100%;
|
|
184
|
-
height: 100%;
|
|
185
|
-
object-fit: cover;
|
|
186
|
-
border-radius: 0.75rem;
|
|
187
|
-
transition: var(--transition, all 0.3s ease);
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
@media (max-width: ${R.MOBILE_SIZE_PX+"px"}) {
|
|
191
|
-
& img {
|
|
192
|
-
width: 8.875rem;
|
|
193
|
-
height: 8.875rem;
|
|
194
|
-
min-width: 8.875rem;
|
|
195
|
-
min-height: 8.875rem;
|
|
196
|
-
object-fit: cover;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
& .bookmarking-btn {
|
|
200
|
-
display: flex;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
`,he=N.styled.div`
|
|
204
|
-
background: var(--white, #fff);
|
|
205
|
-
z-index: 1;
|
|
206
|
-
|
|
207
|
-
border: 1px solid var(--gray-200, #dddfe4);
|
|
208
|
-
border-radius: 0.5rem;
|
|
209
|
-
line-height: 1rem;
|
|
210
|
-
position: absolute;
|
|
211
|
-
padding: 0.5rem 0.75rem;
|
|
212
|
-
top: 0.5rem;
|
|
213
|
-
left: 25%;
|
|
214
|
-
transform: translateX(-50%);
|
|
215
|
-
min-width: 13rem;
|
|
216
|
-
|
|
217
|
-
&::before,
|
|
218
|
-
&::after {
|
|
219
|
-
content: "";
|
|
220
|
-
position: absolute;
|
|
221
|
-
left: 50%;
|
|
222
|
-
transform: translateX(-50%);
|
|
223
|
-
border-style: solid;
|
|
224
|
-
border-width: 0.625rem;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
&::after {
|
|
228
|
-
top: -1.1875rem;
|
|
229
|
-
border-color: transparent transparent var(--white, #fff) transparent;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
&::before {
|
|
233
|
-
top: -1.25rem;
|
|
234
|
-
border-color: transparent transparent var(--gray-200, #dddfe4) transparent;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
& .tags-popover__content {
|
|
238
|
-
display: flex;
|
|
239
|
-
flex-wrap: wrap;
|
|
240
|
-
flex-direction: column;
|
|
241
|
-
gap: 0.375rem;
|
|
242
|
-
font-size: 0.75rem;
|
|
243
|
-
font-weight: 400;
|
|
244
|
-
|
|
245
|
-
& .tags-popover__name {
|
|
246
|
-
color: var(--gray-600, #676e79);
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
& .tags-popover__value {
|
|
250
|
-
color: var(--gray-950, #14161a);
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
`,fe=N.styled.div`
|
|
254
|
-
display: flex;
|
|
255
|
-
align-items: center;
|
|
256
|
-
gap: 0.25rem;
|
|
257
|
-
color: var(--gray-500);
|
|
258
|
-
font-size: 0.75rem;
|
|
259
|
-
font-weight: 500;
|
|
260
|
-
|
|
261
|
-
& i {
|
|
262
|
-
font-size: 1rem;
|
|
263
|
-
color: var(--warning-500, #F59E0B);
|
|
264
|
-
}
|
|
265
|
-
`,ve=a.forwardRef(({sponsoredText:p="Sponsored"},w)=>e.jsxs(fe,{ref:w,className:"sponsored-line",children:[e.jsx("i",{className:"mng-lnc-paw2"}),e.jsx("span",{children:p})]})),we="Vehicles_Cars",be="Vehicles_Motorcycles",ye="Vehicles_Trucks",je="Vehicles_AgriculturalMachines_Tractors",ke="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=a.forwardRef((p,w)=>{const{uuid:u,name:j,price:h=0,sellingPrice:k,currency:_,isNegotiable:C,isFree:P,imageUrl:A,location:X,sponsored:L,imageComponent:V,onSelectCard:U=()=>{},freeText:Y="Free",negotiableText:K="Negotiable",tags:o=[],categoryCode:$,condition:E,quantity:S,trade:T,sponsoredText:Z,onBookmark:B=()=>{},bookmarkComponent:b,bookmarked:z,bookmarkLists:H}=p,O=ue.useDetectMobile(),J=()=>{var l;if(!t.isDefined(b))return e.jsx(e.Fragment,{});const r=b,n=(l=b==null?void 0:b.props)==null?void 0:l.children,s=a.cloneElement(n,{key:`bookmark_pr__${z}`,bookmarked:z,productUuid:u,onAddToBookmark:()=>B(!0,u),onRemoveFromBookmark:()=>B(!1,u),bookmarkedUuidList:H});return a.cloneElement(r,void 0,s)},M=[we,be,ye,je,ke,_e,xe,Ne].some(r=>$==null?void 0:$.includes(r)),[Q,q]=a.useState(!1),ee=()=>{q(!0)},re=()=>{q(!1)},c=a.useRef(null),f=a.useRef([]),[ne,oe]=a.useState(o==null?void 0:o.length),te=()=>{var l,d,y;if(!(c!=null&&c.current)||((l=f==null?void 0:f.current)==null?void 0:l.length)===0)return;const r=(d=c==null?void 0:c.current)==null?void 0:d.offsetWidth;let n=0,s=0;for(let m=0;m<(o==null?void 0:o.length);m++){const v=((y=f==null?void 0:f.current[m])==null?void 0:y.offsetWidth)||0,g=n+v+4;if(g<=r)n+=g,s++;else break}oe(s)};a.useEffect(()=>{const r=c==null?void 0:c.current;if(!r)return;const n=new ResizeObserver(()=>{te()});return n.observe(r),()=>{n.disconnect()}},[o]);const se=()=>{var r;return e.jsx("div",{className:"tags-popover__trigger",children:(r=o==null?void 0:o.slice(0,ne))==null?void 0:r.map((n,s)=>{var v,g,W,D,I;const l=((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)??"",d=((W=n==null?void 0:n.measurementUnit)==null?void 0:W.symbol)??((D=i==null?void 0:i[n==null?void 0:n.code])==null?void 0:D.measure)??"",m=[(n==null?void 0:n.value)??((I=n==null?void 0:n.multiOptions)==null?void 0:I[0])??"",d].filter(Boolean).join(" ");return O?e.jsxs("div",{className:"tag-mobile",children:[m,s<(o==null?void 0:o.length)-1?" · ":""]}):e.jsxs(x,{ref:ce=>f.current[s]=ce,className:"tag",children:[e.jsx("i",{className:l}),m]},`detailed-products-section-tag__${s+1}`)})})},ie=()=>e.jsx("div",{className:"tags-popover__content",children:o==null?void 0:o.map((r,n)=>{var m,v,g;const s=((m=r==null?void 0:r.measurementUnit)==null?void 0:m.symbol)??((v=i==null?void 0:i[r==null?void 0:r.code])==null?void 0:v.measure)??"",d=[(r==null?void 0:r.value)??((g=r==null?void 0:r.multiOptions)==null?void 0:g[0])??"",s].filter(Boolean).join(" "),y=r==null?void 0:r.name;return e.jsxs("div",{children:[e.jsx("span",{className:"tags-popover__name",children:`${y}: `}),e.jsx("span",{className:"tags-popover__value",children:d})]},`detailed-products-section-tag-dropdown__${n+1}`)})}),ae=()=>{var r;if(O){const n=[E,S,T];return(r=n==null?void 0:n.filter(s=>t.isDefinedNotEmptyString(s)))==null?void 0:r.map((s,l,d)=>e.jsxs("div",{className:"tag-mobile",children:[s,l<(d==null?void 0:d.length)-1?" · ":""]}))}return e.jsxs(e.Fragment,{children:[E&&e.jsx(x,{className:"tag",children:E},"detailed-products-section-tag__condition"),S&&e.jsx(x,{className:"tag",children:S},"detailed-products-section-tag__quantity"),T&&e.jsx(x,{className:"tag",children:T},"detailed-products-section-tag__trade")]})},F=h>0&&_&&C!==!0&&P!==!0&&h!==k;return e.jsxs(G,{ref:c,className:"product-card",onClick:U,children:[e.jsxs(ge,{className:"product-image-wrapper",children:[e.jsx(J,{}),t.isDefined(V)?V:e.jsx(le.ProductImageWrapper,{src:A})]}),e.jsx("div",{className:"wrapper-card-1",children:e.jsx("div",{className:"card-title",children:j})}),e.jsxs("div",{className:"wrapper-card-3",children:[M&&e.jsx("div",{...O?{}:{onMouseEnter:ee,onMouseLeave:re},children:e.jsxs(de,{placement:"bottom",open:Q,children:[e.jsx(me,{children:se()}),e.jsx(pe,{style:{all:"unset"},children:e.jsx(he,{children:ie()})})]})}),!M&&ae()]}),e.jsxs("div",{className:"wrapper-card-2",children:[e.jsxs("div",{className:`price-text ${F?"new-price":""}`,children:[k>0&&_&&C!==!0&&P!==!0&&e.jsx("div",{children:`${t.formatPrice(k)} ${t.GetCurrencySymbol(_)}`}),F&&e.jsx("div",{className:`${k>0?"full-price":""}`,children:`${t.formatPrice(h)} ${t.GetCurrencySymbol(_)}`}),C&&K,P&&Y]}),e.jsx("div",{className:"location-text",children:X})]}),L===!0&&e.jsx(ve,{sponsoredText:Z})]})}),Pe=a.forwardRef(({},p)=>e.jsxs(G,{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:p=5,isLoading:w=!1,keyPrefix:u})=>e.jsx(e.Fragment,{children:Array.from({length:p},(j,h)=>e.jsx(Pe,{isLoading:w},`${u}-skeleton-product-card-${h}`))}),Ee=({children:p,fallbackComponent:w=e.jsx(e.Fragment,{}),isLoading:u=!1,limit:j,keyPrefix:h})=>e.jsx(a.Suspense,{fallbackComponent:w,children:u===!0?e.jsx($e,{isLoading:u,limit:j,keyPrefix:h}):p});exports.DetailedProductCard=Ce;exports.SuspenseDetailedProductCard=Ee;
|