@lanaco/lnc-react-ui 4.0.193 → 4.0.194
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 t=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),c=require("react"),f=require("./emotion-styled.browser.esm-BtEseadx.cjs"),Q=require("./consts-goSZX3xP.cjs"),G=require("./IconButton.cjs"),W=require("./Button.cjs"),a=require("./utils-RnrgDDZP.cjs"),X=require("./useDetectMobile-zkbzoOGV.cjs"),b=require("./index-Lmz3An4A.cjs"),Z=require("./index-CSNxZFTX.cjs"),l=require("./style-BAcV7F53.cjs"),H=f.styled.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 1.5rem;
|
|
@@ -21,9 +21,18 @@
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
& .section__options {
|
|
25
|
+
& button {
|
|
26
|
+
&:focus {
|
|
27
|
+
outline: none;
|
|
28
|
+
outline-offset: 0;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
24
33
|
& .section__items {
|
|
25
34
|
display: grid;
|
|
26
|
-
grid-template-columns: ${
|
|
35
|
+
grid-template-columns: ${o=>`repeat(${o.limit}, minmax(0, 1fr))`};
|
|
27
36
|
gap: 2rem;
|
|
28
37
|
}
|
|
29
38
|
|
|
@@ -47,7 +56,7 @@
|
|
|
47
56
|
white-space: nowrap;
|
|
48
57
|
}
|
|
49
58
|
|
|
50
|
-
@media (max-width: ${
|
|
59
|
+
@media (max-width: ${Q.MOBILE_SIZE_PX+"px"}) {
|
|
51
60
|
gap: 1.25rem;
|
|
52
61
|
|
|
53
62
|
& .section__items {
|
|
@@ -70,4 +79,4 @@
|
|
|
70
79
|
}
|
|
71
80
|
}
|
|
72
81
|
}
|
|
73
|
-
`,
|
|
82
|
+
`,J=f.styled(l.SkeletonRowWrapper)``,Y=({keyPrefix:o})=>t.jsxs(J,{children:[t.jsx(l.SkeletonLinePlaceholder,{width:"5rem",borderRadius:"0.75rem"},`${o}-1`),t.jsx(l.SkeletonLinePlaceholder,{width:"5rem",borderRadius:"0.75rem"},`${o}-2`),t.jsx(l.SkeletonLinePlaceholder,{width:"5rem",borderRadius:"0.75rem"},`${o}-3`)]}),x=({keyPrefix:o,isLoading:d=!1,fallbackComponent:n=t.jsx(t.Fragment,{}),children:i})=>t.jsx(c.Suspense,{fallbackComponent:n,children:d===!0?t.jsx(Y,{keyPrefix:o}):i}),ee=c.memo(b.DetailedProductCard),te=c.forwardRef((o,d)=>{const{title:n,icon:i,items:r,limit:h=4,isLoading:u=!1,onSelectCard:S=()=>{},onLoadMore:w=()=>{},onButtonAction:_=()=>{},getImage:y=()=>{},viewAllbuttonLink:m,viewAllButonText:p="View all",negotiableText:k,freeText:v,loadMoreButtonIcon:j="angle-down",sponsoredText:C,onBookmark:N=()=>{},actionComponent:L,componentName:q,hasNextPage:P=!1,LinkComponent:B,urgentText:R,options:O=[],isLoadingOptions:D=!1,selectedOption:M,onSelectOption:E=()=>{},onRemoveOption:I=()=>{},allOptionsEnabled:T=!1,allOptionsLabel:$="All",onSelectAllOptions:A=()=>{},optionLabel:z="label",optionValue:F="value",optionCode:U="code"}=o,g=X.useDetectMobile(),V=c.useMemo(()=>r==null?void 0:r.map((e,s)=>t.jsx(ee,{name:e==null?void 0:e.name,price:e==null?void 0:e.price,sellingPrice:e==null?void 0:e.sellingPrice,currency:e==null?void 0:e.currency,image:e==null?void 0:e.image,sellerUuid:e==null?void 0:e.sellerUuid,uuid:e==null?void 0:e.uuid,sponsored:e==null?void 0:e.sponsored,imageComponent:e==null?void 0:e.imageComponent,onSelectCard:(oe,K)=>S({uuid:e==null?void 0:e.uuid,nameSlug:e==null?void 0:e.nameSlug,cardRef:K}),nameSlug:e==null?void 0:e.nameSlug,imageUrl:y(e==null?void 0:e.image,e==null?void 0:e.uuid,e==null?void 0:e.sellerUuid)||null,isFree:e==null?void 0:e.isFree,isNegotiable:e==null?void 0:e.isNegotiable,negotiableText:k,freeText:v,tags:e==null?void 0:e.tags,categoryCode:e==null?void 0:e.categoryCode,condition:e==null?void 0:e.condition,quantity:e==null?void 0:e.quantity,hasQuantities:e==null?void 0:e.hasQuantities,status:e==null?void 0:e.status,trade:e==null?void 0:e.trade,sponsoredText:C,onBookmark:N,actionComponent:L,bookmarked:e==null?void 0:e.bookmarked,bookmarkLists:e==null?void 0:e.bookmarkLists,metadata:{accessor:e==null?void 0:e.accessor,name:q},sellerName:e==null?void 0:e.sellerName,forCart:e==null?void 0:e.forCart,forOrder:e==null?void 0:e.forOrder,contactSeller:e==null?void 0:e.contactSeller,hasVariants:e==null?void 0:e.hasVariants,LinkComponent:B,activeSalesPackages:e==null?void 0:e.activeSalesPackages,urgentText:R},s)),[r]);return t.jsxs(H,{ref:d,limit:h,children:[t.jsxs("div",{className:"section__heading",children:[a.isDefinedNotEmptyString(n)&&t.jsxs("div",{className:"section__title",children:[a.isDefinedNotEmptyString(i)&&t.jsx("i",{className:i})," ",n]}),g&&a.isDefinedNotEmptyString(m)&&a.isDefinedNotEmptyString(p)&&!u&&t.jsx(W,{type:"button",btnType:"tinted",color:"neutral",onClick:e=>{var s;(s=e==null?void 0:e.target)==null||s.blur(),_(m)},borderRadius:"curved",className:"section__view-all",children:p})]}),t.jsx(x,{isLoading:D,children:t.jsx(Z.SelectBar,{items:O,selectedIds:M,onRemove:I,onSelect:E,allButton:T,onSelectAll:A,labelKey:z,valueKey:F,codeKey:U,noMargin:!0,productsToolbarName:$,noGradient:!0,className:"section__options"})}),t.jsx(b.SuspenseDetailedProductCard,{isLoading:u,keyPrefix:"detailed-product-card-skeleton",children:t.jsx("div",{className:"section__items",children:V})}),!g&&!u&&P&&t.jsx(G,{icon:j,borderRadius:"curved",btnType:"basic",color:"neutral",className:"section__show-more",onClick:w})]})});module.exports=te;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { s as
|
|
4
|
-
import { M as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { k as
|
|
8
|
-
import { u as
|
|
9
|
-
import { D as
|
|
10
|
-
|
|
1
|
+
import { jsxs as s, jsx as o, Fragment as q } from "react/jsx-runtime";
|
|
2
|
+
import { Suspense as Q, memo as G, forwardRef as W, useMemo as X } from "react";
|
|
3
|
+
import { s as f } from "./emotion-styled.browser.esm-BNN1dTl3.js";
|
|
4
|
+
import { M as Z } from "./consts-BuFChS64.js";
|
|
5
|
+
import H from "./IconButton.js";
|
|
6
|
+
import J from "./Button.js";
|
|
7
|
+
import { k as l } from "./utils-Dc5zIpaz.js";
|
|
8
|
+
import { u as Y } from "./useDetectMobile-Bkvj0VMa.js";
|
|
9
|
+
import { D as x, S as ee } from "./index-DqBXIFsQ.js";
|
|
10
|
+
import { S as oe } from "./index-BGiZlEQt.js";
|
|
11
|
+
import { a as te, b as m } from "./style-CXMUA6cI.js";
|
|
12
|
+
const ie = f.div`
|
|
11
13
|
display: flex;
|
|
12
14
|
flex-direction: column;
|
|
13
15
|
gap: 1.5rem;
|
|
@@ -30,9 +32,18 @@ const R = E.div`
|
|
|
30
32
|
}
|
|
31
33
|
}
|
|
32
34
|
|
|
35
|
+
& .section__options {
|
|
36
|
+
& button {
|
|
37
|
+
&:focus {
|
|
38
|
+
outline: none;
|
|
39
|
+
outline-offset: 0;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
33
44
|
& .section__items {
|
|
34
45
|
display: grid;
|
|
35
|
-
grid-template-columns: ${(
|
|
46
|
+
grid-template-columns: ${(t) => `repeat(${t.limit}, minmax(0, 1fr))`};
|
|
36
47
|
gap: 2rem;
|
|
37
48
|
}
|
|
38
49
|
|
|
@@ -56,7 +67,7 @@ const R = E.div`
|
|
|
56
67
|
white-space: nowrap;
|
|
57
68
|
}
|
|
58
69
|
|
|
59
|
-
@media (max-width: ${
|
|
70
|
+
@media (max-width: ${Z + "px"}) {
|
|
60
71
|
gap: 1.25rem;
|
|
61
72
|
|
|
62
73
|
& .section__items {
|
|
@@ -79,36 +90,80 @@ const R = E.div`
|
|
|
79
90
|
}
|
|
80
91
|
}
|
|
81
92
|
}
|
|
82
|
-
`,
|
|
93
|
+
`, ne = f(te)``, re = ({ keyPrefix: t }) => /* @__PURE__ */ s(ne, { children: [
|
|
94
|
+
/* @__PURE__ */ o(
|
|
95
|
+
m,
|
|
96
|
+
{
|
|
97
|
+
width: "5rem",
|
|
98
|
+
borderRadius: "0.75rem"
|
|
99
|
+
},
|
|
100
|
+
`${t}-1`
|
|
101
|
+
),
|
|
102
|
+
/* @__PURE__ */ o(
|
|
103
|
+
m,
|
|
104
|
+
{
|
|
105
|
+
width: "5rem",
|
|
106
|
+
borderRadius: "0.75rem"
|
|
107
|
+
},
|
|
108
|
+
`${t}-2`
|
|
109
|
+
),
|
|
110
|
+
/* @__PURE__ */ o(
|
|
111
|
+
m,
|
|
112
|
+
{
|
|
113
|
+
width: "5rem",
|
|
114
|
+
borderRadius: "0.75rem"
|
|
115
|
+
},
|
|
116
|
+
`${t}-3`
|
|
117
|
+
)
|
|
118
|
+
] }), ae = ({
|
|
119
|
+
keyPrefix: t,
|
|
120
|
+
isLoading: c = !1,
|
|
121
|
+
fallbackComponent: i = /* @__PURE__ */ o(q, {}),
|
|
122
|
+
children: n
|
|
123
|
+
}) => /* @__PURE__ */ o(Q, { fallbackComponent: i, children: c === !0 ? /* @__PURE__ */ o(re, { keyPrefix: t }) : n }), le = G(x), _e = W((t, c) => {
|
|
83
124
|
const {
|
|
84
|
-
title:
|
|
85
|
-
icon:
|
|
86
|
-
items:
|
|
87
|
-
limit:
|
|
88
|
-
isLoading:
|
|
89
|
-
onSelectCard:
|
|
125
|
+
title: i,
|
|
126
|
+
icon: n,
|
|
127
|
+
items: r,
|
|
128
|
+
limit: b = 4,
|
|
129
|
+
isLoading: d = !1,
|
|
130
|
+
onSelectCard: h = () => {
|
|
90
131
|
},
|
|
91
|
-
onLoadMore:
|
|
132
|
+
onLoadMore: w = () => {
|
|
92
133
|
},
|
|
93
|
-
onButtonAction:
|
|
134
|
+
onButtonAction: S = () => {
|
|
94
135
|
},
|
|
95
|
-
getImage:
|
|
136
|
+
getImage: _ = () => {
|
|
96
137
|
},
|
|
97
|
-
viewAllbuttonLink:
|
|
98
|
-
viewAllButonText:
|
|
99
|
-
negotiableText:
|
|
100
|
-
freeText:
|
|
138
|
+
viewAllbuttonLink: u,
|
|
139
|
+
viewAllButonText: p = "View all",
|
|
140
|
+
negotiableText: k,
|
|
141
|
+
freeText: v,
|
|
101
142
|
loadMoreButtonIcon: y = "angle-down",
|
|
102
|
-
sponsoredText:
|
|
103
|
-
onBookmark:
|
|
143
|
+
sponsoredText: C,
|
|
144
|
+
onBookmark: N = () => {
|
|
104
145
|
},
|
|
105
|
-
actionComponent:
|
|
106
|
-
componentName:
|
|
146
|
+
actionComponent: L,
|
|
147
|
+
componentName: B,
|
|
107
148
|
hasNextPage: P = !1,
|
|
108
|
-
LinkComponent:
|
|
109
|
-
urgentText:
|
|
110
|
-
|
|
111
|
-
|
|
149
|
+
LinkComponent: O,
|
|
150
|
+
urgentText: M,
|
|
151
|
+
options: R = [],
|
|
152
|
+
isLoadingOptions: T = !1,
|
|
153
|
+
selectedOption: $,
|
|
154
|
+
onSelectOption: I = () => {
|
|
155
|
+
},
|
|
156
|
+
onRemoveOption: A = () => {
|
|
157
|
+
},
|
|
158
|
+
allOptionsEnabled: D = !1,
|
|
159
|
+
allOptionsLabel: z = "All",
|
|
160
|
+
onSelectAllOptions: E = () => {
|
|
161
|
+
},
|
|
162
|
+
optionLabel: F = "label",
|
|
163
|
+
optionValue: U = "value",
|
|
164
|
+
optionCode: V = "code"
|
|
165
|
+
} = t, g = Y(), j = X(() => r == null ? void 0 : r.map((e, a) => /* @__PURE__ */ o(
|
|
166
|
+
le,
|
|
112
167
|
{
|
|
113
168
|
name: e == null ? void 0 : e.name,
|
|
114
169
|
price: e == null ? void 0 : e.price,
|
|
@@ -119,13 +174,13 @@ const R = E.div`
|
|
|
119
174
|
uuid: e == null ? void 0 : e.uuid,
|
|
120
175
|
sponsored: e == null ? void 0 : e.sponsored,
|
|
121
176
|
imageComponent: e == null ? void 0 : e.imageComponent,
|
|
122
|
-
onSelectCard: (
|
|
177
|
+
onSelectCard: (se, K) => h({ uuid: e == null ? void 0 : e.uuid, nameSlug: e == null ? void 0 : e.nameSlug, cardRef: K }),
|
|
123
178
|
nameSlug: e == null ? void 0 : e.nameSlug,
|
|
124
|
-
imageUrl:
|
|
179
|
+
imageUrl: _(e == null ? void 0 : e.image, e == null ? void 0 : e.uuid, e == null ? void 0 : e.sellerUuid) || null,
|
|
125
180
|
isFree: e == null ? void 0 : e.isFree,
|
|
126
181
|
isNegotiable: e == null ? void 0 : e.isNegotiable,
|
|
127
|
-
negotiableText:
|
|
128
|
-
freeText:
|
|
182
|
+
negotiableText: k,
|
|
183
|
+
freeText: v,
|
|
129
184
|
tags: e == null ? void 0 : e.tags,
|
|
130
185
|
categoryCode: e == null ? void 0 : e.categoryCode,
|
|
131
186
|
condition: e == null ? void 0 : e.condition,
|
|
@@ -133,67 +188,85 @@ const R = E.div`
|
|
|
133
188
|
hasQuantities: e == null ? void 0 : e.hasQuantities,
|
|
134
189
|
status: e == null ? void 0 : e.status,
|
|
135
190
|
trade: e == null ? void 0 : e.trade,
|
|
136
|
-
sponsoredText:
|
|
137
|
-
onBookmark:
|
|
138
|
-
actionComponent:
|
|
191
|
+
sponsoredText: C,
|
|
192
|
+
onBookmark: N,
|
|
193
|
+
actionComponent: L,
|
|
139
194
|
bookmarked: e == null ? void 0 : e.bookmarked,
|
|
140
195
|
bookmarkLists: e == null ? void 0 : e.bookmarkLists,
|
|
141
|
-
metadata: { accessor: e == null ? void 0 : e.accessor, name:
|
|
196
|
+
metadata: { accessor: e == null ? void 0 : e.accessor, name: B },
|
|
142
197
|
sellerName: e == null ? void 0 : e.sellerName,
|
|
143
198
|
forCart: e == null ? void 0 : e.forCart,
|
|
144
199
|
forOrder: e == null ? void 0 : e.forOrder,
|
|
145
200
|
contactSeller: e == null ? void 0 : e.contactSeller,
|
|
146
201
|
hasVariants: e == null ? void 0 : e.hasVariants,
|
|
147
|
-
LinkComponent:
|
|
202
|
+
LinkComponent: O,
|
|
148
203
|
activeSalesPackages: e == null ? void 0 : e.activeSalesPackages,
|
|
149
|
-
urgentText:
|
|
204
|
+
urgentText: M
|
|
150
205
|
},
|
|
151
|
-
|
|
152
|
-
)), [
|
|
153
|
-
return /* @__PURE__ */ s(
|
|
206
|
+
a
|
|
207
|
+
)), [r]);
|
|
208
|
+
return /* @__PURE__ */ s(ie, { ref: c, limit: b, children: [
|
|
154
209
|
/* @__PURE__ */ s("div", { className: "section__heading", children: [
|
|
155
|
-
|
|
156
|
-
|
|
210
|
+
l(i) && /* @__PURE__ */ s("div", { className: "section__title", children: [
|
|
211
|
+
l(n) && /* @__PURE__ */ o("i", { className: n }),
|
|
157
212
|
" ",
|
|
158
|
-
|
|
213
|
+
i
|
|
159
214
|
] }),
|
|
160
|
-
|
|
161
|
-
|
|
215
|
+
g && l(u) && l(p) && !d && /* @__PURE__ */ o(
|
|
216
|
+
J,
|
|
162
217
|
{
|
|
163
218
|
type: "button",
|
|
164
219
|
btnType: "tinted",
|
|
165
220
|
color: "neutral",
|
|
166
221
|
onClick: (e) => {
|
|
167
|
-
var
|
|
168
|
-
(
|
|
222
|
+
var a;
|
|
223
|
+
(a = e == null ? void 0 : e.target) == null || a.blur(), S(u);
|
|
169
224
|
},
|
|
170
225
|
borderRadius: "curved",
|
|
171
226
|
className: "section__view-all",
|
|
172
|
-
children:
|
|
227
|
+
children: p
|
|
173
228
|
}
|
|
174
229
|
)
|
|
175
230
|
] }),
|
|
176
|
-
/* @__PURE__ */
|
|
177
|
-
|
|
231
|
+
/* @__PURE__ */ o(ae, { isLoading: T, children: /* @__PURE__ */ o(
|
|
232
|
+
oe,
|
|
233
|
+
{
|
|
234
|
+
items: R,
|
|
235
|
+
selectedIds: $,
|
|
236
|
+
onRemove: A,
|
|
237
|
+
onSelect: I,
|
|
238
|
+
allButton: D,
|
|
239
|
+
onSelectAll: E,
|
|
240
|
+
labelKey: F,
|
|
241
|
+
valueKey: U,
|
|
242
|
+
codeKey: V,
|
|
243
|
+
noMargin: !0,
|
|
244
|
+
productsToolbarName: z,
|
|
245
|
+
noGradient: !0,
|
|
246
|
+
className: "section__options"
|
|
247
|
+
}
|
|
248
|
+
) }),
|
|
249
|
+
/* @__PURE__ */ o(
|
|
250
|
+
ee,
|
|
178
251
|
{
|
|
179
|
-
isLoading:
|
|
252
|
+
isLoading: d,
|
|
180
253
|
keyPrefix: "detailed-product-card-skeleton",
|
|
181
|
-
children: /* @__PURE__ */
|
|
254
|
+
children: /* @__PURE__ */ o("div", { className: "section__items", children: j })
|
|
182
255
|
}
|
|
183
256
|
),
|
|
184
|
-
!
|
|
185
|
-
|
|
257
|
+
!g && !d && P && /* @__PURE__ */ o(
|
|
258
|
+
H,
|
|
186
259
|
{
|
|
187
260
|
icon: y,
|
|
188
261
|
borderRadius: "curved",
|
|
189
262
|
btnType: "basic",
|
|
190
263
|
color: "neutral",
|
|
191
264
|
className: "section__show-more",
|
|
192
|
-
onClick:
|
|
265
|
+
onClick: w
|
|
193
266
|
}
|
|
194
267
|
)
|
|
195
268
|
] });
|
|
196
269
|
});
|
|
197
270
|
export {
|
|
198
|
-
|
|
271
|
+
_e as default
|
|
199
272
|
};
|