@lanaco/lnc-react-ui 4.0.189 → 4.0.190
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,13 +1,13 @@
|
|
|
1
|
-
"use strict";const t=require("react/jsx-runtime"),c=require("react"),
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),c=require("react"),F=require("./emotion-styled.browser.esm-BtEseadx.cjs"),B=require("./consts-goSZX3xP.cjs"),R=require("./Button.cjs"),l=require("./utils-RnrgDDZP.cjs"),I=require("./useDetectMobile-zkbzoOGV.cjs"),Q=require("./style-CkcozOY6.cjs"),w=require("./index-Coo0aVuh.cjs"),_=require("./index-CSNxZFTX.cjs"),$=F.styled.div`
|
|
2
2
|
display: grid;
|
|
3
|
-
grid-template-columns: ${
|
|
3
|
+
grid-template-columns: ${o=>`repeat(${o.limit}, minmax(0, 1fr))`};
|
|
4
4
|
gap: 1.25rem;
|
|
5
5
|
|
|
6
6
|
& .button-link {
|
|
7
7
|
white-space: nowrap;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
@media (max-width: ${
|
|
10
|
+
@media (max-width: ${B.MOBILE_SIZE_PX+"px"}) {
|
|
11
11
|
display: flex;
|
|
12
12
|
gap: 1rem;
|
|
13
13
|
overflow-x: auto;
|
|
@@ -26,4 +26,4 @@
|
|
|
26
26
|
/* Safari and Chrome */
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
`,
|
|
29
|
+
`,v=c.memo(w.DetailedProductCard),O=c.forwardRef((o,D)=>{const{icon:u,title:L,buttonLink:d,items:i,buttonText:m,limit:n=4,onSelectCard:g=()=>{},onButtonAction:T=()=>{},isLoading:p=!1,getImage:b=()=>{},negotiableText:k,freeText:y,options:r,onSelectOption:S=()=>{},productsToolbarName:U="All",sponsoredText:C,onBookmark:f=()=>{},actionComponent:h,componentName:N,LinkComponent:P,urgentText:q}=o,j=I.useDetectMobile(),M=c.useMemo(()=>t.jsx(t.Fragment,{children:j===!0?i==null?void 0:i.map((e,a)=>t.jsx(v,{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,nameSlug:e==null?void 0:e.nameSlug,onSelectCard:(E,s)=>g({uuid:e==null?void 0:e.uuid,nameSlug:e==null?void 0:e.nameSlug,cardRef:s}),sellerName:e==null?void 0:e.sellerName,imageUrl:b(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:y,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,forCart:e==null?void 0:e.forCart,sponsoredText:C,onBookmark:f,actionComponent:h,bookmarked:e==null?void 0:e.bookmarked,bookmarkLists:e==null?void 0:e.bookmarkLists,metadata:{accessor:e==null?void 0:e.accessor,name:N},LinkComponent:P,activeSalesPackages:e==null?void 0:e.activeSalesPackages,urgentText:q},a)):i==null?void 0:i.slice(0,n).map((e,a)=>t.jsx(v,{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,location:e==null?void 0:e.location,sponsored:e==null?void 0:e.sponsored,imageComponent:e==null?void 0:e.imageComponent,onSelectCard:(E,s)=>g({uuid:e==null?void 0:e.uuid,nameSlug:e==null?void 0:e.nameSlug,cardRef:s}),nameSlug:e==null?void 0:e.nameSlug,imageUrl:b(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:y,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,forCart:e==null?void 0:e.forCart,sponsoredText:C,onBookmark:f,actionComponent:h,bookmarked:e==null?void 0:e.bookmarked,bookmarkLists:e==null?void 0:e.bookmarkLists,metadata:{accessor:e==null?void 0:e.accessor,name:N},sellerName:e==null?void 0:e.sellerName,LinkComponent:P,activeSalesPackages:e==null?void 0:e.activeSalesPackages,urgentText:q},a))}),[i,j,n]);return t.jsxs(Q.TitleWithOptionsSectionWrapper,{ref:D,children:[t.jsxs("div",{className:"regular-title",children:[t.jsxs("div",{className:"regular-title-text",children:[l.isDefinedNotEmptyString(u)&&t.jsx("i",{className:u}),t.jsx("span",{children:L})]}),l.isDefinedNotEmptyString(d)&&l.isDefinedNotEmptyString(m)&&!p&&t.jsx(R,{type:"button",btnType:"tinted",color:"neutral",onClick:e=>{var a;(a=e==null?void 0:e.target)==null||a.blur(),T(d)},borderRadius:"curved",className:"button-link",children:m})]}),(r==null?void 0:r.length)>0&&t.jsx(_.SelectBar,{items:r,onRemove:e=>{S(e)},onSelect:e=>{S(e)},labelKey:"name",valueKey:"code",noMargin:!0,productsToolbarName:U}),t.jsx(w.SuspenseDetailedProductCard,{isLoading:p,keyPrefix:"detailed-products-skeleton",children:t.jsx($,{limit:n,children:M})})]})});module.exports=O;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { s as
|
|
4
|
-
import { M as
|
|
5
|
-
import
|
|
1
|
+
import { jsx as a, Fragment as q, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { memo as E, forwardRef as I, useMemo as Q } from "react";
|
|
3
|
+
import { s as O } from "./emotion-styled.browser.esm-BNN1dTl3.js";
|
|
4
|
+
import { M as R } from "./consts-BuFChS64.js";
|
|
5
|
+
import W from "./Button.js";
|
|
6
6
|
import { k as m } from "./utils-Dc5zIpaz.js";
|
|
7
|
-
import { u as
|
|
8
|
-
import { T as
|
|
9
|
-
import { D as
|
|
10
|
-
import { S as
|
|
11
|
-
const
|
|
7
|
+
import { u as $ } from "./useDetectMobile-Bkvj0VMa.js";
|
|
8
|
+
import { T as j } from "./style-C7FUSHmS.js";
|
|
9
|
+
import { D as z, S as A } from "./index-PhMLWAC1.js";
|
|
10
|
+
import { S as K } from "./index-BGiZlEQt.js";
|
|
11
|
+
const _ = O.div`
|
|
12
12
|
display: grid;
|
|
13
13
|
grid-template-columns: ${(i) => `repeat(${i.limit}, minmax(0, 1fr))`};
|
|
14
14
|
gap: 1.25rem;
|
|
@@ -17,7 +17,7 @@ const K = Q.div`
|
|
|
17
17
|
white-space: nowrap;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
@media (max-width: ${
|
|
20
|
+
@media (max-width: ${R + "px"}) {
|
|
21
21
|
display: flex;
|
|
22
22
|
gap: 1rem;
|
|
23
23
|
overflow-x: auto;
|
|
@@ -36,35 +36,36 @@ const K = Q.div`
|
|
|
36
36
|
/* Safari and Chrome */
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
`,
|
|
39
|
+
`, T = E(z), te = I((i, L) => {
|
|
40
40
|
const {
|
|
41
|
-
icon:
|
|
42
|
-
title:
|
|
43
|
-
buttonLink:
|
|
44
|
-
items:
|
|
41
|
+
icon: c,
|
|
42
|
+
title: U,
|
|
43
|
+
buttonLink: d,
|
|
44
|
+
items: t,
|
|
45
45
|
buttonText: u,
|
|
46
46
|
limit: n = 4,
|
|
47
|
-
onSelectCard:
|
|
47
|
+
onSelectCard: g = () => {
|
|
48
48
|
},
|
|
49
|
-
onButtonAction:
|
|
49
|
+
onButtonAction: M = () => {
|
|
50
50
|
},
|
|
51
|
-
isLoading:
|
|
52
|
-
getImage:
|
|
51
|
+
isLoading: p = !1,
|
|
52
|
+
getImage: k = () => {
|
|
53
53
|
},
|
|
54
|
-
negotiableText:
|
|
54
|
+
negotiableText: b,
|
|
55
55
|
freeText: f,
|
|
56
|
-
options:
|
|
57
|
-
onSelectOption:
|
|
56
|
+
options: r,
|
|
57
|
+
onSelectOption: S = () => {
|
|
58
58
|
},
|
|
59
|
-
productsToolbarName:
|
|
60
|
-
sponsoredText:
|
|
61
|
-
onBookmark:
|
|
59
|
+
productsToolbarName: D = "All",
|
|
60
|
+
sponsoredText: y,
|
|
61
|
+
onBookmark: C = () => {
|
|
62
62
|
},
|
|
63
63
|
actionComponent: h,
|
|
64
64
|
componentName: N,
|
|
65
|
-
LinkComponent:
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
LinkComponent: P,
|
|
66
|
+
urgentText: v
|
|
67
|
+
} = i, w = $(), F = Q(() => /* @__PURE__ */ a(q, { children: w === !0 ? t == null ? void 0 : t.map((e, o) => /* @__PURE__ */ a(
|
|
68
|
+
T,
|
|
68
69
|
{
|
|
69
70
|
name: e == null ? void 0 : e.name,
|
|
70
71
|
price: e == null ? void 0 : e.price,
|
|
@@ -76,16 +77,16 @@ const K = Q.div`
|
|
|
76
77
|
sponsored: e == null ? void 0 : e.sponsored,
|
|
77
78
|
imageComponent: e == null ? void 0 : e.imageComponent,
|
|
78
79
|
nameSlug: e == null ? void 0 : e.nameSlug,
|
|
79
|
-
onSelectCard: (
|
|
80
|
+
onSelectCard: (B, s) => g({
|
|
80
81
|
uuid: e == null ? void 0 : e.uuid,
|
|
81
82
|
nameSlug: e == null ? void 0 : e.nameSlug,
|
|
82
83
|
cardRef: s
|
|
83
84
|
}),
|
|
84
85
|
sellerName: e == null ? void 0 : e.sellerName,
|
|
85
|
-
imageUrl:
|
|
86
|
+
imageUrl: k(e == null ? void 0 : e.image, e == null ? void 0 : e.uuid, e == null ? void 0 : e.sellerUuid) || null,
|
|
86
87
|
isFree: e == null ? void 0 : e.isFree,
|
|
87
88
|
isNegotiable: e == null ? void 0 : e.isNegotiable,
|
|
88
|
-
negotiableText:
|
|
89
|
+
negotiableText: b,
|
|
89
90
|
freeText: f,
|
|
90
91
|
tags: e == null ? void 0 : e.tags,
|
|
91
92
|
categoryCode: e == null ? void 0 : e.categoryCode,
|
|
@@ -95,17 +96,19 @@ const K = Q.div`
|
|
|
95
96
|
status: e == null ? void 0 : e.status,
|
|
96
97
|
trade: e == null ? void 0 : e.trade,
|
|
97
98
|
forCart: e == null ? void 0 : e.forCart,
|
|
98
|
-
sponsoredText:
|
|
99
|
-
onBookmark:
|
|
99
|
+
sponsoredText: y,
|
|
100
|
+
onBookmark: C,
|
|
100
101
|
actionComponent: h,
|
|
101
102
|
bookmarked: e == null ? void 0 : e.bookmarked,
|
|
102
103
|
bookmarkLists: e == null ? void 0 : e.bookmarkLists,
|
|
103
104
|
metadata: { accessor: e == null ? void 0 : e.accessor, name: N },
|
|
104
|
-
LinkComponent:
|
|
105
|
+
LinkComponent: P,
|
|
106
|
+
activeSalesPackages: e == null ? void 0 : e.activeSalesPackages,
|
|
107
|
+
urgentText: v
|
|
105
108
|
},
|
|
106
|
-
|
|
107
|
-
)) :
|
|
108
|
-
|
|
109
|
+
o
|
|
110
|
+
)) : t == null ? void 0 : t.slice(0, n).map((e, o) => /* @__PURE__ */ a(
|
|
111
|
+
T,
|
|
109
112
|
{
|
|
110
113
|
name: e == null ? void 0 : e.name,
|
|
111
114
|
price: e == null ? void 0 : e.price,
|
|
@@ -117,16 +120,16 @@ const K = Q.div`
|
|
|
117
120
|
location: e == null ? void 0 : e.location,
|
|
118
121
|
sponsored: e == null ? void 0 : e.sponsored,
|
|
119
122
|
imageComponent: e == null ? void 0 : e.imageComponent,
|
|
120
|
-
onSelectCard: (
|
|
123
|
+
onSelectCard: (B, s) => g({
|
|
121
124
|
uuid: e == null ? void 0 : e.uuid,
|
|
122
125
|
nameSlug: e == null ? void 0 : e.nameSlug,
|
|
123
126
|
cardRef: s
|
|
124
127
|
}),
|
|
125
128
|
nameSlug: e == null ? void 0 : e.nameSlug,
|
|
126
|
-
imageUrl:
|
|
129
|
+
imageUrl: k(e == null ? void 0 : e.image, e == null ? void 0 : e.uuid, e == null ? void 0 : e.sellerUuid) || null,
|
|
127
130
|
isFree: e == null ? void 0 : e.isFree,
|
|
128
131
|
isNegotiable: e == null ? void 0 : e.isNegotiable,
|
|
129
|
-
negotiableText:
|
|
132
|
+
negotiableText: b,
|
|
130
133
|
freeText: f,
|
|
131
134
|
tags: e == null ? void 0 : e.tags,
|
|
132
135
|
categoryCode: e == null ? void 0 : e.categoryCode,
|
|
@@ -136,32 +139,34 @@ const K = Q.div`
|
|
|
136
139
|
status: e == null ? void 0 : e.status,
|
|
137
140
|
trade: e == null ? void 0 : e.trade,
|
|
138
141
|
forCart: e == null ? void 0 : e.forCart,
|
|
139
|
-
sponsoredText:
|
|
140
|
-
onBookmark:
|
|
142
|
+
sponsoredText: y,
|
|
143
|
+
onBookmark: C,
|
|
141
144
|
actionComponent: h,
|
|
142
145
|
bookmarked: e == null ? void 0 : e.bookmarked,
|
|
143
146
|
bookmarkLists: e == null ? void 0 : e.bookmarkLists,
|
|
144
147
|
metadata: { accessor: e == null ? void 0 : e.accessor, name: N },
|
|
145
148
|
sellerName: e == null ? void 0 : e.sellerName,
|
|
146
|
-
LinkComponent:
|
|
149
|
+
LinkComponent: P,
|
|
150
|
+
activeSalesPackages: e == null ? void 0 : e.activeSalesPackages,
|
|
151
|
+
urgentText: v
|
|
147
152
|
},
|
|
148
|
-
|
|
149
|
-
)) }), [
|
|
150
|
-
return /* @__PURE__ */ l(
|
|
153
|
+
o
|
|
154
|
+
)) }), [t, w, n]);
|
|
155
|
+
return /* @__PURE__ */ l(j, { ref: L, children: [
|
|
151
156
|
/* @__PURE__ */ l("div", { className: "regular-title", children: [
|
|
152
157
|
/* @__PURE__ */ l("div", { className: "regular-title-text", children: [
|
|
153
|
-
m(
|
|
154
|
-
/* @__PURE__ */
|
|
158
|
+
m(c) && /* @__PURE__ */ a("i", { className: c }),
|
|
159
|
+
/* @__PURE__ */ a("span", { children: U })
|
|
155
160
|
] }),
|
|
156
|
-
m(
|
|
157
|
-
|
|
161
|
+
m(d) && m(u) && !p && /* @__PURE__ */ a(
|
|
162
|
+
W,
|
|
158
163
|
{
|
|
159
164
|
type: "button",
|
|
160
165
|
btnType: "tinted",
|
|
161
166
|
color: "neutral",
|
|
162
167
|
onClick: (e) => {
|
|
163
|
-
var
|
|
164
|
-
(
|
|
168
|
+
var o;
|
|
169
|
+
(o = e == null ? void 0 : e.target) == null || o.blur(), M(d);
|
|
165
170
|
},
|
|
166
171
|
borderRadius: "curved",
|
|
167
172
|
className: "button-link",
|
|
@@ -169,28 +174,28 @@ const K = Q.div`
|
|
|
169
174
|
}
|
|
170
175
|
)
|
|
171
176
|
] }),
|
|
172
|
-
(
|
|
173
|
-
|
|
177
|
+
(r == null ? void 0 : r.length) > 0 && /* @__PURE__ */ a(
|
|
178
|
+
K,
|
|
174
179
|
{
|
|
175
|
-
items:
|
|
180
|
+
items: r,
|
|
176
181
|
onRemove: (e) => {
|
|
177
|
-
|
|
182
|
+
S(e);
|
|
178
183
|
},
|
|
179
184
|
onSelect: (e) => {
|
|
180
|
-
|
|
185
|
+
S(e);
|
|
181
186
|
},
|
|
182
187
|
labelKey: "name",
|
|
183
188
|
valueKey: "code",
|
|
184
189
|
noMargin: !0,
|
|
185
|
-
productsToolbarName:
|
|
190
|
+
productsToolbarName: D
|
|
186
191
|
}
|
|
187
192
|
),
|
|
188
|
-
/* @__PURE__ */
|
|
189
|
-
|
|
193
|
+
/* @__PURE__ */ a(
|
|
194
|
+
A,
|
|
190
195
|
{
|
|
191
|
-
isLoading:
|
|
196
|
+
isLoading: p,
|
|
192
197
|
keyPrefix: "detailed-products-skeleton",
|
|
193
|
-
children: /* @__PURE__ */
|
|
198
|
+
children: /* @__PURE__ */ a(_, { limit: n, children: F })
|
|
194
199
|
}
|
|
195
200
|
)
|
|
196
201
|
] });
|