@phillips/seldon 1.146.2 → 1.147.0
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,75 +1,75 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as v, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as V } from "react";
|
|
3
3
|
import k from "../../node_modules/classnames/index.js";
|
|
4
4
|
import { getCommonProps as q, findChildrenOfType as z, findChildrenExcludingTypes as F } from "../../utils/index.js";
|
|
5
5
|
import G from "../DetailList/DetailList.js";
|
|
6
|
-
import
|
|
7
|
-
import { LotStatus as
|
|
6
|
+
import p from "../../components/Detail/Detail.js";
|
|
7
|
+
import { LotStatus as t, SupportedLanguages as H } from "../../types/commonTypes.js";
|
|
8
8
|
import J from "../../components/Countdown/Countdown.js";
|
|
9
9
|
import { CountdownVariants as K } from "../../components/Countdown/types.js";
|
|
10
10
|
import { BidStatusEnum as Q } from "./types.js";
|
|
11
|
-
import
|
|
12
|
-
import { isAfter as
|
|
11
|
+
import L from "./BidMessage.js";
|
|
12
|
+
import { isAfter as w } from "../../node_modules/date-fns/isAfter.js";
|
|
13
13
|
import { differenceInMinutes as U } from "../../node_modules/date-fns/differenceInMinutes.js";
|
|
14
14
|
const X = (o) => o === 1 ? `${o} bid` : `${o} bids`, Y = V(
|
|
15
15
|
({
|
|
16
|
-
lotStatus: o =
|
|
17
|
-
bidStatus:
|
|
18
|
-
bidsLabelText:
|
|
16
|
+
lotStatus: o = t.ready,
|
|
17
|
+
bidStatus: d,
|
|
18
|
+
bidsLabelText: C = X,
|
|
19
19
|
children: c,
|
|
20
|
-
className:
|
|
21
|
-
closingText:
|
|
20
|
+
className: T,
|
|
21
|
+
closingText: x = "Closes in",
|
|
22
22
|
currency: r = "$",
|
|
23
23
|
currentBid: f,
|
|
24
|
-
currentBidText:
|
|
25
|
-
formatDurationStr:
|
|
26
|
-
lang:
|
|
24
|
+
currentBidText: N = "Current bid",
|
|
25
|
+
formatDurationStr: W = (a) => a.replace(/seconds?/, "sec").replace(/minutes?/, "min"),
|
|
26
|
+
lang: y = "en",
|
|
27
27
|
saleCloseDate: i,
|
|
28
28
|
lotCloseDate: l,
|
|
29
29
|
numberOfBids: u = 0,
|
|
30
|
-
startingBid:
|
|
30
|
+
startingBid: h,
|
|
31
31
|
startingBidText: B = "Starting bid",
|
|
32
|
-
soldPrice:
|
|
32
|
+
soldPrice: $,
|
|
33
33
|
soldForText: M = "Sold for",
|
|
34
34
|
wonForText: j = "Won for",
|
|
35
35
|
currentDateTime: E = /* @__PURE__ */ new Date(),
|
|
36
|
-
|
|
36
|
+
...b
|
|
37
37
|
}, P) => {
|
|
38
|
-
const { className: a, ...R } = q(
|
|
38
|
+
const { className: a, ...R } = q(b, "BidSnapshot"), m = f !== null && u > 0, g = o === t.ready, s = o === t.live, S = o === t.past, e = E, _ = s && l && w(l, e) && i && (U(i, e) < 60 || w(e, i)), A = z(c, L), D = F(c, [L]), I = k(a, T, {
|
|
39
39
|
[`${a}--live`]: s,
|
|
40
|
-
[`${a}--has-bids`]: m ||
|
|
40
|
+
[`${a}--has-bids`]: m || S
|
|
41
41
|
});
|
|
42
|
-
return /* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
return /* @__PURE__ */ v("div", { ...R, ...b, ref: P, className: I, children: [
|
|
43
|
+
/* @__PURE__ */ v(G, { hasSeparators: !0, className: `${a}__text`, children: [
|
|
44
|
+
S ? /* @__PURE__ */ n(
|
|
45
|
+
p,
|
|
46
46
|
{
|
|
47
|
-
label:
|
|
48
|
-
value:
|
|
47
|
+
label: d === Q.Won ? j : M,
|
|
48
|
+
value: $ ? `${r}${$?.toLocaleString()}` : "",
|
|
49
49
|
hasWrap: !1
|
|
50
50
|
}
|
|
51
51
|
) : null,
|
|
52
|
-
s && m ? /* @__PURE__ */
|
|
53
|
-
|
|
52
|
+
s && m ? /* @__PURE__ */ n(
|
|
53
|
+
p,
|
|
54
54
|
{
|
|
55
|
-
label:
|
|
56
|
-
subLabel: `(${
|
|
55
|
+
label: N,
|
|
56
|
+
subLabel: `(${C(u)})`,
|
|
57
57
|
value: `${r}${f?.toLocaleString()}`,
|
|
58
58
|
hasWrap: !1
|
|
59
59
|
}
|
|
60
60
|
) : null,
|
|
61
|
-
|
|
61
|
+
h && (g || s && !m) ? /* @__PURE__ */ n(p, { label: B, value: `${r}${h?.toLocaleString()}`, hasWrap: !1 }) : null
|
|
62
62
|
] }),
|
|
63
|
-
|
|
63
|
+
d && !g ? A : null,
|
|
64
64
|
D,
|
|
65
|
-
_ ? /* @__PURE__ */
|
|
65
|
+
_ ? /* @__PURE__ */ n(
|
|
66
66
|
J,
|
|
67
67
|
{
|
|
68
68
|
endDateTime: l,
|
|
69
|
-
label:
|
|
69
|
+
label: x,
|
|
70
70
|
variant: K.compact,
|
|
71
|
-
locale: H[
|
|
72
|
-
formatDurationStr:
|
|
71
|
+
locale: H[y],
|
|
72
|
+
formatDurationStr: W,
|
|
73
73
|
showBottomBorder: !1,
|
|
74
74
|
currentDateTime: e
|
|
75
75
|
}
|