@lanaco/lnc-react-ui 4.0.164 → 4.0.165
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const o=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";const o=require("react/jsx-runtime"),s=require("react"),_=require("./emotion-styled.browser.esm-BtEseadx.cjs"),C=require("./consts-goSZX3xP.cjs"),$=require("./useDetectMobile-zkbzoOGV.cjs"),T=require("./Button.cjs"),S=require("./suspense-product-card-detailed-D-pjVe22.cjs"),D=_.styled.div`
|
|
2
2
|
padding: 1.75rem 3rem;
|
|
3
3
|
display: grid;
|
|
4
4
|
grid-template-columns: ${a=>`repeat(${a.limit||5}, minmax(0, 1fr))`};
|
|
@@ -54,13 +54,13 @@
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
@media (max-width: ${
|
|
57
|
+
@media (max-width: ${C.MOBILE_SIZE_PX+"px"}) {
|
|
58
58
|
grid-template-columns: repeat(2, 1fr);
|
|
59
59
|
padding: 2rem 1.25rem;
|
|
60
60
|
gap: 1.19rem;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
@media (max-width: ${
|
|
63
|
+
@media (max-width: ${C.SMALL_MOBILE_SIZE_PX+"px"}) {
|
|
64
64
|
display: flex;
|
|
65
65
|
flex-direction: column;
|
|
66
66
|
|
|
@@ -71,4 +71,4 @@
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
`,w=
|
|
74
|
+
`,w=s.memo(S.DetailedProductCard),F=s.forwardRef((a,P)=>{const{items:r,limit:i=5,limitMobile:l=4,onSelectCard:u=()=>{},title:j="Urgent sale",showLessText:q="Show less",showMoreText:L="Show more",isLoading:M=!1,getImage:g=()=>{},negotiableText:p,freeText:b,onBookmark:f=()=>{},bookmarkComponent:k,componentName:h,sponsoredText:y}=a,d=$.useDetectMobile(),[n,U]=s.useState(!1),v=s.useMemo(()=>{var t;return o.jsx(o.Fragment,{children:d===!0?(t=r==null?void 0:r.slice(0,n===!0?r==null?void 0:r.length:l))==null?void 0:t.map((e,m)=>o.jsx(w,{name:e==null?void 0:e.name,price:e==null?void 0:e.price,sellingPrice:e==null?void 0:e.sellingPrice,isFree:e==null?void 0:e.isFree,isNegotiable:e==null?void 0:e.isNegotiable,currency:e==null?void 0:e.currency,categoryCode:e==null?void 0:e.categoryCode,sellerUuid:e==null?void 0:e.sellerUuid,uuid:e==null?void 0:e.uuid,sponsored:e==null?void 0:e.sponsored,onSelectCard:(N,c)=>u({uuid:e==null?void 0:e.uuid,nameSlug:e==null?void 0:e.nameSlug,cardRef:c}),image:e==null?void 0:e.image,imageUrl:g(e==null?void 0:e.image,e==null?void 0:e.uuid,e==null?void 0:e.sellerUuid)||null,imageComponent:e==null?void 0:e.imageComponent,negotiableText:p,freeText:b,onBookmark:f,bookmarkComponent:k,bookmarked:e==null?void 0:e.bookmarked,bookmarkLists:e==null?void 0:e.bookmarkLists,metadata:{name:h,accessor:e==null?void 0:e.accessor},tags:e==null?void 0:e.tags,condition:e==null?void 0:e.condition,quantity:e==null?void 0:e.quantity,trade:e==null?void 0:e.trade,sponsoredText:y},m)):r==null?void 0:r.slice(0,i).map((e,m)=>o.jsx(w,{name:e==null?void 0:e.name,price:e==null?void 0:e.price,sellingPrice:e==null?void 0:e.sellingPrice,isFree:e==null?void 0:e.isFree,isNegotiable:e==null?void 0:e.isNegotiable,currency:e==null?void 0:e.currency,categoryCode:e==null?void 0:e.categoryCode,sellerUuid:e==null?void 0:e.sellerUuid,uuid:e==null?void 0:e.uuid,location:e==null?void 0:e.location,sponsored:e==null?void 0:e.sponsored,onSelectCard:(N,c)=>u({uuid:e==null?void 0:e.uuid,nameSlug:e==null?void 0:e.nameSlug,cardRef:c}),image:e==null?void 0:e.image,imageUrl:g(e==null?void 0:e.image,e==null?void 0:e.uuid,e==null?void 0:e.sellerUuid)||null,imageComponent:e==null?void 0:e.imageComponent,negotiableText:p,freeText:b,onBookmark:f,bookmarkComponent:k,bookmarked:e==null?void 0:e.bookmarked,bookmarkLists:e==null?void 0:e.bookmarkLists,metadata:{name:h,accessor:e==null?void 0:e.accessor},tags:e==null?void 0:e.tags,condition:e==null?void 0:e.condition,quantity:e==null?void 0:e.quantity,trade:e==null?void 0:e.trade,sponsoredText:y},m))})},[r,d,i,l,n]);return o.jsxs(D,{ref:P,limit:i,children:[o.jsxs("div",{className:"urgent-tag",children:[o.jsx("i",{className:"mng mng-lnc-bolt-filled"}),o.jsx("span",{children:j})]}),o.jsx(S.SuspenseDetailedProductCard,{isLoading:M,limit:i,keyPrefix:"explore-landing",children:v}),d===!0&&l<(r==null?void 0:r.length)&&o.jsx(T,{className:"show-more",btnType:"basic",type:"button",color:"neutral",onClick:t=>{var e;(e=t==null?void 0:t.target)==null||e.blur(),U(!n)},children:n===!0?q:L})]})});module.exports=F;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as a, Fragment as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { s as
|
|
1
|
+
import { jsx as a, Fragment as $, jsxs as y } from "react/jsx-runtime";
|
|
2
|
+
import { memo as T, forwardRef as F, useState as I, useMemo as _ } from "react";
|
|
3
|
+
import { s as q } from "./emotion-styled.browser.esm-BNN1dTl3.js";
|
|
4
4
|
import { M as B, S as D } from "./consts-BuFChS64.js";
|
|
5
5
|
import { u as E } from "./useDetectMobile-Bkvj0VMa.js";
|
|
6
6
|
import j from "./Button.js";
|
|
7
7
|
import { D as z, S as A } from "./suspense-product-card-detailed-BZtObEfA.js";
|
|
8
|
-
const G =
|
|
8
|
+
const G = q.div`
|
|
9
9
|
padding: 1.75rem 3rem;
|
|
10
10
|
display: grid;
|
|
11
11
|
grid-template-columns: ${(o) => `repeat(${o.limit || 5}, minmax(0, 1fr))`};
|
|
@@ -78,15 +78,15 @@ const G = _.div`
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
`,
|
|
81
|
+
`, C = T(z), K = F((o, S) => {
|
|
82
82
|
const {
|
|
83
83
|
items: r,
|
|
84
84
|
limit: t = 5,
|
|
85
|
-
limitMobile:
|
|
85
|
+
limitMobile: s = 4,
|
|
86
86
|
onSelectCard: c = () => {
|
|
87
87
|
},
|
|
88
|
-
title:
|
|
89
|
-
showLessText:
|
|
88
|
+
title: w = "Urgent sale",
|
|
89
|
+
showLessText: P = "Show less",
|
|
90
90
|
showMoreText: L = "Show more",
|
|
91
91
|
isLoading: M = !1,
|
|
92
92
|
getImage: u = () => {
|
|
@@ -96,68 +96,87 @@ const G = _.div`
|
|
|
96
96
|
onBookmark: f = () => {
|
|
97
97
|
},
|
|
98
98
|
bookmarkComponent: b,
|
|
99
|
-
componentName: k
|
|
100
|
-
|
|
99
|
+
componentName: k,
|
|
100
|
+
sponsoredText: h
|
|
101
|
+
} = o, l = E(), [n, U] = I(!1), v = _(() => {
|
|
101
102
|
var i;
|
|
102
|
-
return /* @__PURE__ */ a(
|
|
103
|
-
|
|
103
|
+
return /* @__PURE__ */ a($, { children: l === !0 ? (i = r == null ? void 0 : r.slice(0, n === !0 ? r == null ? void 0 : r.length : s)) == null ? void 0 : i.map((e, m) => /* @__PURE__ */ a(
|
|
104
|
+
C,
|
|
104
105
|
{
|
|
105
|
-
|
|
106
|
+
name: e == null ? void 0 : e.name,
|
|
106
107
|
price: e == null ? void 0 : e.price,
|
|
108
|
+
sellingPrice: e == null ? void 0 : e.sellingPrice,
|
|
107
109
|
isFree: e == null ? void 0 : e.isFree,
|
|
108
110
|
isNegotiable: e == null ? void 0 : e.isNegotiable,
|
|
109
111
|
currency: e == null ? void 0 : e.currency,
|
|
112
|
+
categoryCode: e == null ? void 0 : e.categoryCode,
|
|
110
113
|
sellerUuid: e == null ? void 0 : e.sellerUuid,
|
|
111
114
|
uuid: e == null ? void 0 : e.uuid,
|
|
112
|
-
|
|
115
|
+
sponsored: e == null ? void 0 : e.sponsored,
|
|
113
116
|
onSelectCard: (N, d) => c({
|
|
114
117
|
uuid: e == null ? void 0 : e.uuid,
|
|
115
118
|
nameSlug: e == null ? void 0 : e.nameSlug,
|
|
116
119
|
cardRef: d
|
|
117
120
|
}),
|
|
121
|
+
image: e == null ? void 0 : e.image,
|
|
118
122
|
imageUrl: u(e == null ? void 0 : e.image, e == null ? void 0 : e.uuid, e == null ? void 0 : e.sellerUuid) || null,
|
|
123
|
+
imageComponent: e == null ? void 0 : e.imageComponent,
|
|
119
124
|
negotiableText: g,
|
|
120
125
|
freeText: p,
|
|
121
126
|
onBookmark: f,
|
|
122
127
|
bookmarkComponent: b,
|
|
123
128
|
bookmarked: e == null ? void 0 : e.bookmarked,
|
|
124
129
|
bookmarkLists: e == null ? void 0 : e.bookmarkLists,
|
|
125
|
-
metadata: { name: k, accessor: e == null ? void 0 : e.accessor }
|
|
130
|
+
metadata: { name: k, accessor: e == null ? void 0 : e.accessor },
|
|
131
|
+
tags: e == null ? void 0 : e.tags,
|
|
132
|
+
condition: e == null ? void 0 : e.condition,
|
|
133
|
+
quantity: e == null ? void 0 : e.quantity,
|
|
134
|
+
trade: e == null ? void 0 : e.trade,
|
|
135
|
+
sponsoredText: h
|
|
126
136
|
},
|
|
127
137
|
m
|
|
128
138
|
)) : r == null ? void 0 : r.slice(0, t).map((e, m) => /* @__PURE__ */ a(
|
|
129
|
-
|
|
139
|
+
C,
|
|
130
140
|
{
|
|
131
|
-
|
|
141
|
+
name: e == null ? void 0 : e.name,
|
|
132
142
|
price: e == null ? void 0 : e.price,
|
|
143
|
+
sellingPrice: e == null ? void 0 : e.sellingPrice,
|
|
133
144
|
isFree: e == null ? void 0 : e.isFree,
|
|
134
145
|
isNegotiable: e == null ? void 0 : e.isNegotiable,
|
|
135
146
|
currency: e == null ? void 0 : e.currency,
|
|
147
|
+
categoryCode: e == null ? void 0 : e.categoryCode,
|
|
136
148
|
sellerUuid: e == null ? void 0 : e.sellerUuid,
|
|
137
149
|
uuid: e == null ? void 0 : e.uuid,
|
|
138
150
|
location: e == null ? void 0 : e.location,
|
|
139
|
-
|
|
151
|
+
sponsored: e == null ? void 0 : e.sponsored,
|
|
140
152
|
onSelectCard: (N, d) => c({
|
|
141
153
|
uuid: e == null ? void 0 : e.uuid,
|
|
142
154
|
nameSlug: e == null ? void 0 : e.nameSlug,
|
|
143
155
|
cardRef: d
|
|
144
156
|
}),
|
|
157
|
+
image: e == null ? void 0 : e.image,
|
|
145
158
|
imageUrl: u(e == null ? void 0 : e.image, e == null ? void 0 : e.uuid, e == null ? void 0 : e.sellerUuid) || null,
|
|
159
|
+
imageComponent: e == null ? void 0 : e.imageComponent,
|
|
146
160
|
negotiableText: g,
|
|
147
161
|
freeText: p,
|
|
148
162
|
onBookmark: f,
|
|
149
163
|
bookmarkComponent: b,
|
|
150
164
|
bookmarked: e == null ? void 0 : e.bookmarked,
|
|
151
165
|
bookmarkLists: e == null ? void 0 : e.bookmarkLists,
|
|
152
|
-
metadata: { name: k, accessor: e == null ? void 0 : e.accessor }
|
|
166
|
+
metadata: { name: k, accessor: e == null ? void 0 : e.accessor },
|
|
167
|
+
tags: e == null ? void 0 : e.tags,
|
|
168
|
+
condition: e == null ? void 0 : e.condition,
|
|
169
|
+
quantity: e == null ? void 0 : e.quantity,
|
|
170
|
+
trade: e == null ? void 0 : e.trade,
|
|
171
|
+
sponsoredText: h
|
|
153
172
|
},
|
|
154
173
|
m
|
|
155
174
|
)) });
|
|
156
|
-
}, [r,
|
|
157
|
-
return /* @__PURE__ */
|
|
158
|
-
/* @__PURE__ */
|
|
175
|
+
}, [r, l, t, s, n]);
|
|
176
|
+
return /* @__PURE__ */ y(G, { ref: S, limit: t, children: [
|
|
177
|
+
/* @__PURE__ */ y("div", { className: "urgent-tag", children: [
|
|
159
178
|
/* @__PURE__ */ a("i", { className: "mng mng-lnc-bolt-filled" }),
|
|
160
|
-
/* @__PURE__ */ a("span", { children:
|
|
179
|
+
/* @__PURE__ */ a("span", { children: w })
|
|
161
180
|
] }),
|
|
162
181
|
/* @__PURE__ */ a(
|
|
163
182
|
A,
|
|
@@ -168,7 +187,7 @@ const G = _.div`
|
|
|
168
187
|
children: v
|
|
169
188
|
}
|
|
170
189
|
),
|
|
171
|
-
|
|
190
|
+
l === !0 && s < (r == null ? void 0 : r.length) && /* @__PURE__ */ a(
|
|
172
191
|
j,
|
|
173
192
|
{
|
|
174
193
|
className: "show-more",
|
|
@@ -177,13 +196,13 @@ const G = _.div`
|
|
|
177
196
|
color: "neutral",
|
|
178
197
|
onClick: (i) => {
|
|
179
198
|
var e;
|
|
180
|
-
(e = i == null ? void 0 : i.target) == null || e.blur(), U(!
|
|
199
|
+
(e = i == null ? void 0 : i.target) == null || e.blur(), U(!n);
|
|
181
200
|
},
|
|
182
|
-
children:
|
|
201
|
+
children: n === !0 ? P : L
|
|
183
202
|
}
|
|
184
203
|
)
|
|
185
204
|
] });
|
|
186
205
|
});
|
|
187
206
|
export {
|
|
188
|
-
|
|
207
|
+
K as default
|
|
189
208
|
};
|