@lax-wp/design-system 0.14.49 → 0.14.51
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/components/data-display/datatype-icon/LabelValueDataTypeIcon.cjs.js +2 -0
- package/dist/components/data-display/datatype-icon/LabelValueDataTypeIcon.cjs.js.map +1 -0
- package/dist/components/data-display/datatype-icon/LabelValueDataTypeIcon.d.ts +29 -0
- package/dist/components/data-display/datatype-icon/LabelValueDataTypeIcon.es.js +82 -0
- package/dist/components/data-display/datatype-icon/LabelValueDataTypeIcon.es.js.map +1 -0
- package/dist/components/data-display/datatype-icon/index.d.ts +2 -0
- package/dist/components/data-display/label-value/LabelValue.cjs.js +1 -1
- package/dist/components/data-display/label-value/LabelValue.cjs.js.map +1 -1
- package/dist/components/data-display/label-value/LabelValue.d.ts +4 -0
- package/dist/components/data-display/label-value/LabelValue.es.js +196 -182
- package/dist/components/data-display/label-value/LabelValue.es.js.map +1 -1
- package/dist/design-system.css +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.es.js +310 -305
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,165 +1,178 @@
|
|
|
1
|
-
import { jsxs as i, jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
import { HelpIcon as
|
|
5
|
-
import { SearchIcon as
|
|
6
|
-
import { Typography as
|
|
7
|
-
import { decodeHTMLEntities as
|
|
1
|
+
import { jsxs as i, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as Ie, useState as w, useRef as Ee, useEffect as _e } from "react";
|
|
3
|
+
import p from "../../../_virtual/index.es.js";
|
|
4
|
+
import { HelpIcon as ze } from "../../icons/HelpIcon.es.js";
|
|
5
|
+
import { SearchIcon as De } from "../../icons/SearchIcon.es.js";
|
|
6
|
+
import { Typography as E } from "../typography/Typography.es.js";
|
|
7
|
+
import { decodeHTMLEntities as Me, formatCurrency as _, formatBooleanValue as q, formatDate as N, isISODateString as Re } from "../../../utils/formatters.es.js";
|
|
8
8
|
import { CURRENCIES as $e } from "../../forms/currency-input/currency.constant.es.js";
|
|
9
|
-
import { Label as
|
|
10
|
-
import { motion as
|
|
11
|
-
import { BoltOutlined as
|
|
12
|
-
import
|
|
9
|
+
import { Label as Ae } from "../label/Label.es.js";
|
|
10
|
+
import { motion as je } from "framer-motion";
|
|
11
|
+
import { BoltOutlined as Oe, ArrowUpwardRounded as Ue, ArrowDownwardRounded as Be, OpenInNew as Pe } from "@mui/icons-material";
|
|
12
|
+
import T from "../../tooltip/Tooltip.es.js";
|
|
13
13
|
import { AIExtractedIndicator as He } from "../../icons/AIExtractedIndicator.es.js";
|
|
14
14
|
import { AIStarIcon as Ze } from "../../icons/AIStarIcon.es.js";
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
17
|
-
import {
|
|
18
|
-
|
|
15
|
+
import { APP_DATA_TYPES as m } from "../datatype-icon/DataTypeIcon.es.js";
|
|
16
|
+
import { LabelValueDataTypeIcon as Ye } from "../datatype-icon/LabelValueDataTypeIcon.es.js";
|
|
17
|
+
import { shouldShowConfidenceScore as Fe, getConfidenceScoreBadgeFill as Ke, getConfidenceScoreBadgeColor as Ge, getConfidenceScoreBadgeHoverClass as qe } from "../../../utils/confidenceScoreUtils.es.js";
|
|
18
|
+
import J from "dayjs";
|
|
19
|
+
import { ContentCopyIcon as Je, CheckFilledIcon as Qe } from "../../icon/icons.generated.es.js";
|
|
20
|
+
const We = {
|
|
21
|
+
string: { dataType: m.STRING },
|
|
22
|
+
number: { dataType: m.NUMBER },
|
|
23
|
+
boolean: { dataType: m.BOOLEAN },
|
|
24
|
+
currency: { dataType: m.CURRENCY },
|
|
25
|
+
date: { dataType: m.DATE },
|
|
26
|
+
datetime: { dataType: m.DATETIME },
|
|
27
|
+
percentage: { dataType: m.NUMBER, label: "Percentage" },
|
|
28
|
+
url: { dataType: m.STRING, label: "URL" }
|
|
29
|
+
}, Xe = Ie(
|
|
19
30
|
({
|
|
20
|
-
id:
|
|
31
|
+
id: Q,
|
|
21
32
|
label: l,
|
|
22
33
|
value: e,
|
|
23
|
-
className:
|
|
34
|
+
className: W,
|
|
24
35
|
type: o = "string",
|
|
25
|
-
tags:
|
|
26
|
-
tooltip:
|
|
36
|
+
tags: X,
|
|
37
|
+
tooltip: z,
|
|
27
38
|
items: s,
|
|
28
|
-
isModified:
|
|
29
|
-
isChanged:
|
|
30
|
-
size:
|
|
31
|
-
isHighlighted:
|
|
39
|
+
isModified: v = !1,
|
|
40
|
+
isChanged: V = !1,
|
|
41
|
+
size: k = "medium",
|
|
42
|
+
isHighlighted: ee = !1,
|
|
32
43
|
deletedValue: n,
|
|
33
|
-
highlightColor:
|
|
34
|
-
isSearchActive:
|
|
35
|
-
originalValue:
|
|
36
|
-
showDiff:
|
|
37
|
-
isLiveField:
|
|
38
|
-
isAiExtracted:
|
|
39
|
-
confidenceScore:
|
|
40
|
-
confidenceType:
|
|
41
|
-
confidenceTooltip:
|
|
42
|
-
sourceMeta:
|
|
43
|
-
onConfidenceScoreClick:
|
|
44
|
-
deltaChange:
|
|
45
|
-
theme:
|
|
46
|
-
onUpload:
|
|
47
|
-
acceptsUpload:
|
|
48
|
-
MasterDataModal:
|
|
49
|
-
riskDetails:
|
|
50
|
-
isRiskAnalysisOpen:
|
|
51
|
-
RiskDetailsCard:
|
|
52
|
-
"aria-label":
|
|
53
|
-
decodeEntities:
|
|
54
|
-
onAiExtractedIndicatorClick:
|
|
55
|
-
copyOnHover:
|
|
56
|
-
urlAlias:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
44
|
+
highlightColor: re = "warning",
|
|
45
|
+
isSearchActive: te = !1,
|
|
46
|
+
originalValue: D = !1,
|
|
47
|
+
showDiff: M = !1,
|
|
48
|
+
isLiveField: oe = !1,
|
|
49
|
+
isAiExtracted: ae = !1,
|
|
50
|
+
confidenceScore: ne,
|
|
51
|
+
confidenceType: b = "high",
|
|
52
|
+
confidenceTooltip: se,
|
|
53
|
+
sourceMeta: ie = [],
|
|
54
|
+
onConfidenceScoreClick: ce,
|
|
55
|
+
deltaChange: f,
|
|
56
|
+
theme: ve = "light",
|
|
57
|
+
onUpload: R,
|
|
58
|
+
acceptsUpload: le = !1,
|
|
59
|
+
MasterDataModal: $,
|
|
60
|
+
riskDetails: u,
|
|
61
|
+
isRiskAnalysisOpen: A = !1,
|
|
62
|
+
RiskDetailsCard: j,
|
|
63
|
+
"aria-label": de,
|
|
64
|
+
decodeEntities: me = !0,
|
|
65
|
+
onAiExtractedIndicatorClick: pe,
|
|
66
|
+
copyOnHover: fe = !1,
|
|
67
|
+
urlAlias: O,
|
|
68
|
+
showTypeIcon: ue = !1,
|
|
69
|
+
dataType: U,
|
|
70
|
+
allowTimezoneConversion: he = !1
|
|
71
|
+
}, ye) => {
|
|
72
|
+
const [c, ge] = w(!0), [we, B] = w(!1), [be, P] = w(null), [H, S] = w(!1), [x, Z] = w(!1), g = Ee(null);
|
|
73
|
+
_e(() => () => {
|
|
61
74
|
g.current && clearTimeout(g.current);
|
|
62
75
|
}, []);
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
},
|
|
76
|
+
const d = (t) => me ? Me(t) : t, h = 100, L = U ? { dataType: U } : We[String(o).toLowerCase()], xe = k === "small" ? 14 : k === "large" ? 18 : 16, Y = () => {
|
|
77
|
+
ge(!c);
|
|
78
|
+
}, I = () => /* @__PURE__ */ r(
|
|
66
79
|
"button",
|
|
67
80
|
{
|
|
68
81
|
id: `btn-label-value-${c ? "Show more" : "Show less"}`,
|
|
69
82
|
className: "text-primary-400 text-sm hover:text-primary-500 cursor-pointer whitespace-nowrap",
|
|
70
|
-
onClick:
|
|
71
|
-
onKeyDown: (
|
|
72
|
-
(
|
|
83
|
+
onClick: Y,
|
|
84
|
+
onKeyDown: (t) => {
|
|
85
|
+
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), Y());
|
|
73
86
|
},
|
|
74
87
|
"aria-label": c ? "Show more content" : "Show less content",
|
|
75
88
|
type: "button",
|
|
76
89
|
children: c ? "Show more" : "Show less"
|
|
77
90
|
}
|
|
78
|
-
), F = (
|
|
79
|
-
if (
|
|
91
|
+
), F = (t) => {
|
|
92
|
+
if (O)
|
|
80
93
|
return /* @__PURE__ */ i(
|
|
81
94
|
"a",
|
|
82
95
|
{
|
|
83
|
-
href:
|
|
96
|
+
href: t,
|
|
84
97
|
target: "_blank",
|
|
85
98
|
rel: "noopener noreferrer",
|
|
86
99
|
className: "inline-flex items-center gap-1 font-semibold text-neutral-900 dark:text-white hover:text-primary-600 dark:hover:text-primary-400 transition-colors",
|
|
87
100
|
children: [
|
|
88
|
-
|
|
89
|
-
/* @__PURE__ */
|
|
101
|
+
O,
|
|
102
|
+
/* @__PURE__ */ r(Pe, { sx: { fontSize: 16 }, className: "text-primary-600 dark:text-primary-400" })
|
|
90
103
|
]
|
|
91
104
|
}
|
|
92
105
|
);
|
|
93
|
-
const a =
|
|
94
|
-
return a.length <=
|
|
95
|
-
/* @__PURE__ */
|
|
106
|
+
const a = d(t);
|
|
107
|
+
return a.length <= h ? /* @__PURE__ */ r("a", { href: t, className: "text-primary-600 truncate", children: a }) : /* @__PURE__ */ i("p", { children: [
|
|
108
|
+
/* @__PURE__ */ r("a", { href: t, className: "text-primary-600 break-all", children: a.slice(0, c ? h : a.length) }),
|
|
96
109
|
c ? "... " : " ",
|
|
97
|
-
|
|
110
|
+
I()
|
|
98
111
|
] });
|
|
99
|
-
},
|
|
100
|
-
|
|
101
|
-
},
|
|
102
|
-
|
|
103
|
-
},
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
|
|
112
|
+
}, K = (t) => {
|
|
113
|
+
B(!0), P({ ...t, value: e });
|
|
114
|
+
}, Ce = () => {
|
|
115
|
+
B(!1), P(null);
|
|
116
|
+
}, Ne = () => {
|
|
117
|
+
const t = e == null || typeof e == "object" ? "" : String(e);
|
|
118
|
+
t && navigator.clipboard?.writeText(t).then(() => {
|
|
119
|
+
Z(!0), g.current && clearTimeout(g.current), g.current = setTimeout(() => Z(!1), 1500);
|
|
107
120
|
}).catch(() => {
|
|
108
121
|
});
|
|
109
|
-
},
|
|
110
|
-
const a =
|
|
111
|
-
a &&
|
|
112
|
-
},
|
|
113
|
-
const
|
|
114
|
-
if (
|
|
122
|
+
}, Te = (t) => {
|
|
123
|
+
const a = t.target.files?.[0];
|
|
124
|
+
a && R && R(a), t.target.value = "";
|
|
125
|
+
}, C = () => {
|
|
126
|
+
const t = typeof e == "string" && Re(e);
|
|
127
|
+
if (te && typeof e == "object")
|
|
115
128
|
return e;
|
|
116
129
|
if (e || o?.toLowerCase() === "boolean" && e === 0 || o?.toLowerCase() === "currency" && Number(e) >= 0) {
|
|
117
|
-
if ((e === !0 || e === "True") && !
|
|
130
|
+
if ((e === !0 || e === "True") && !D && o?.toLowerCase() !== "choice")
|
|
118
131
|
return "Yes";
|
|
119
|
-
if ((e === !1 || e === "False") && !
|
|
132
|
+
if ((e === !1 || e === "False") && !D && o?.toLowerCase() !== "choice")
|
|
120
133
|
return "No";
|
|
121
134
|
if (o?.toLowerCase() === "url")
|
|
122
135
|
return F(e);
|
|
123
136
|
if (o?.toLowerCase() === "boolean")
|
|
124
|
-
return
|
|
137
|
+
return q(e);
|
|
125
138
|
if (o?.toLowerCase() === "currency") {
|
|
126
|
-
const a =
|
|
127
|
-
return
|
|
139
|
+
const a = _(e, s?.currency_code) || "-", y = s?.currency_code ? $e.find((Le) => Le.value === s.currency_code)?.label : void 0, Se = y ? `${s.currency_code} — ${y}` : s?.currency_code ?? "";
|
|
140
|
+
return y ? /* @__PURE__ */ r(T, { title: Se, placement: "top", children: /* @__PURE__ */ r("span", { children: a }) }) : a;
|
|
128
141
|
} else if (o?.toLowerCase() === "datetime") {
|
|
129
142
|
const a = typeof e == "string" && e.includes("Z") ? e.replace(/\.000Z$/, "Z") : e;
|
|
130
|
-
return
|
|
131
|
-
skipTimezone: !
|
|
143
|
+
return N(a, {
|
|
144
|
+
skipTimezone: !he,
|
|
132
145
|
withTime: !0
|
|
133
146
|
});
|
|
134
|
-
} else if (o?.toLowerCase() === "date" ||
|
|
147
|
+
} else if (o?.toLowerCase() === "date" || t) {
|
|
135
148
|
let a = e;
|
|
136
149
|
if (typeof e == "string" && e.includes("Z"))
|
|
137
150
|
a = e.replace(/\.000Z$/, "Z");
|
|
138
151
|
else if (typeof e == "string" && !e.includes("Z")) {
|
|
139
|
-
const
|
|
140
|
-
a =
|
|
152
|
+
const y = J(e);
|
|
153
|
+
a = J(y).isValid() ? y.toString() : e;
|
|
141
154
|
}
|
|
142
|
-
return
|
|
155
|
+
return N(a, {
|
|
143
156
|
skipTimezone: !0,
|
|
144
157
|
withTime: !1
|
|
145
158
|
});
|
|
146
159
|
} else {
|
|
147
160
|
if (o?.toLowerCase() === "percentage")
|
|
148
161
|
return `${e}%`;
|
|
149
|
-
if (typeof e == "string" && e.length >
|
|
150
|
-
const a =
|
|
162
|
+
if (typeof e == "string" && e.length > h) {
|
|
163
|
+
const a = d(e);
|
|
151
164
|
return /* @__PURE__ */ i("p", { children: [
|
|
152
|
-
a.slice(0, c ?
|
|
165
|
+
a.slice(0, c ? h : a.length),
|
|
153
166
|
c ? "... " : " ",
|
|
154
|
-
|
|
167
|
+
I()
|
|
155
168
|
] });
|
|
156
169
|
} else
|
|
157
|
-
return typeof e == "string" ?
|
|
170
|
+
return typeof e == "string" ? d(e) : e;
|
|
158
171
|
}
|
|
159
172
|
}
|
|
160
173
|
return "-";
|
|
161
|
-
},
|
|
162
|
-
switch (
|
|
174
|
+
}, G = () => {
|
|
175
|
+
switch (k) {
|
|
163
176
|
case "small":
|
|
164
177
|
return "extra-small";
|
|
165
178
|
case "large":
|
|
@@ -167,8 +180,8 @@ const Pe = Ne(
|
|
|
167
180
|
default:
|
|
168
181
|
return "small";
|
|
169
182
|
}
|
|
170
|
-
},
|
|
171
|
-
switch (
|
|
183
|
+
}, ke = () => {
|
|
184
|
+
switch (re) {
|
|
172
185
|
case "success":
|
|
173
186
|
return "bg-success-100";
|
|
174
187
|
case "warning":
|
|
@@ -184,94 +197,95 @@ const Pe = Ne(
|
|
|
184
197
|
return /* @__PURE__ */ i(
|
|
185
198
|
"div",
|
|
186
199
|
{
|
|
187
|
-
id:
|
|
188
|
-
ref:
|
|
189
|
-
className:
|
|
200
|
+
id: Q || "",
|
|
201
|
+
ref: ye,
|
|
202
|
+
className: p(
|
|
190
203
|
"font-medium relative",
|
|
191
|
-
|
|
204
|
+
W
|
|
192
205
|
),
|
|
193
|
-
onMouseEnter: () =>
|
|
194
|
-
onMouseLeave: () =>
|
|
195
|
-
"aria-label":
|
|
206
|
+
onMouseEnter: () => S(!0),
|
|
207
|
+
onMouseLeave: () => S(!1),
|
|
208
|
+
"aria-label": de || `Label: ${l}, Value: ${e}`,
|
|
196
209
|
children: [
|
|
197
210
|
/* @__PURE__ */ i(
|
|
198
|
-
|
|
211
|
+
E,
|
|
199
212
|
{
|
|
200
213
|
variant: "medium",
|
|
201
|
-
size:
|
|
214
|
+
size: G(),
|
|
202
215
|
className: "flex gap-1 items-center flex-wrap",
|
|
203
216
|
appearance: "subtitle",
|
|
204
217
|
children: [
|
|
205
|
-
|
|
218
|
+
ue && L && /* @__PURE__ */ r(Ye, { dataType: L.dataType, tooltip: L.label, size: xe }),
|
|
219
|
+
typeof l == "string" ? d(l) : l,
|
|
206
220
|
" ",
|
|
207
|
-
/* @__PURE__ */
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
221
|
+
/* @__PURE__ */ r(Ae, { labels: X?.map((t) => ({ ...t, color: t.color || "primary" })) }),
|
|
222
|
+
oe && /* @__PURE__ */ r(Oe, { sx: { fontSize: 16, color: "var(--color-primary-600)", rotate: "15deg" } }),
|
|
223
|
+
ae && (Fe(ne) && b ? /* @__PURE__ */ r(
|
|
224
|
+
T,
|
|
211
225
|
{
|
|
212
226
|
placement: "top",
|
|
213
|
-
title:
|
|
227
|
+
title: se || "",
|
|
214
228
|
className: "cursor-pointer",
|
|
215
|
-
children: /* @__PURE__ */
|
|
229
|
+
children: /* @__PURE__ */ r(
|
|
216
230
|
"div",
|
|
217
231
|
{
|
|
218
|
-
className:
|
|
219
|
-
onClick: () =>
|
|
220
|
-
children: /* @__PURE__ */
|
|
232
|
+
className: p("cursor-pointer w-3 h-3 flex items-center justify-center rounded-full", qe(b)),
|
|
233
|
+
onClick: () => ce?.(ie),
|
|
234
|
+
children: /* @__PURE__ */ r(
|
|
221
235
|
Ze,
|
|
222
236
|
{
|
|
223
237
|
size: 12,
|
|
224
|
-
fill:
|
|
225
|
-
fillSecondary:
|
|
238
|
+
fill: Ge(b),
|
|
239
|
+
fillSecondary: Ke(b)
|
|
226
240
|
}
|
|
227
241
|
)
|
|
228
242
|
}
|
|
229
243
|
)
|
|
230
244
|
}
|
|
231
|
-
) : /* @__PURE__ */
|
|
232
|
-
|
|
233
|
-
|
|
245
|
+
) : /* @__PURE__ */ r(He, { onClick: () => pe?.(C()) })),
|
|
246
|
+
z && /* @__PURE__ */ r(
|
|
247
|
+
T,
|
|
234
248
|
{
|
|
235
249
|
placement: "top",
|
|
236
|
-
title:
|
|
250
|
+
title: z,
|
|
237
251
|
whiteSpace: "pre-wrap",
|
|
238
|
-
children: /* @__PURE__ */
|
|
252
|
+
children: /* @__PURE__ */ r(
|
|
239
253
|
"div",
|
|
240
254
|
{
|
|
241
255
|
className: "cursor-pointer",
|
|
242
256
|
role: "button",
|
|
243
257
|
tabIndex: 0,
|
|
244
|
-
onKeyDown: (
|
|
245
|
-
(
|
|
258
|
+
onKeyDown: (t) => {
|
|
259
|
+
(t.key === "Enter" || t.key === " ") && t.preventDefault();
|
|
246
260
|
},
|
|
247
|
-
children: /* @__PURE__ */
|
|
261
|
+
children: /* @__PURE__ */ r(ze, { size: 14 })
|
|
248
262
|
}
|
|
249
263
|
)
|
|
250
264
|
}
|
|
251
265
|
),
|
|
252
|
-
|
|
266
|
+
fe && H && /* @__PURE__ */ r(T, { title: x ? "Copied" : `Copy ${l ?? "value"}`, placement: "top", whiteSpace: "pre-wrap", children: /* @__PURE__ */ r(
|
|
253
267
|
"button",
|
|
254
268
|
{
|
|
255
269
|
type: "button",
|
|
256
|
-
onClick:
|
|
270
|
+
onClick: Ne,
|
|
257
271
|
"aria-label": x ? `Copied ${l ?? "value"}` : `Copy ${l ?? "value"}`,
|
|
258
272
|
className: "p-1 flex items-center justify-center rounded text-neutral-500 hover:!text-primary-600 hover:bg-neutral-100 dark:text-primary-400 dark:hover:!text-primary-600 dark:hover:bg-neutral-800 cursor-pointer",
|
|
259
273
|
children: /* @__PURE__ */ i("span", { className: "relative inline-flex h-4 w-4 items-center justify-center", children: [
|
|
260
|
-
/* @__PURE__ */
|
|
261
|
-
|
|
274
|
+
/* @__PURE__ */ r(
|
|
275
|
+
Je,
|
|
262
276
|
{
|
|
263
277
|
size: 16,
|
|
264
|
-
className:
|
|
278
|
+
className: p(
|
|
265
279
|
"absolute inset-0 text-primary-600 dark:text-primary-500 transition-all duration-200 ease-out",
|
|
266
280
|
x ? "opacity-0 scale-50 rotate-[-90deg]" : "opacity-100 scale-100 rotate-0"
|
|
267
281
|
)
|
|
268
282
|
}
|
|
269
283
|
),
|
|
270
|
-
/* @__PURE__ */
|
|
271
|
-
|
|
284
|
+
/* @__PURE__ */ r(
|
|
285
|
+
Qe,
|
|
272
286
|
{
|
|
273
287
|
size: 16,
|
|
274
|
-
className:
|
|
288
|
+
className: p(
|
|
275
289
|
"absolute inset-0 text-primary-600 dark:text-primary-500 transition-all duration-200 ease-out",
|
|
276
290
|
x ? "opacity-100 scale-100 rotate-0" : "opacity-0 scale-50 rotate-90"
|
|
277
291
|
)
|
|
@@ -284,55 +298,55 @@ const Pe = Ne(
|
|
|
284
298
|
}
|
|
285
299
|
),
|
|
286
300
|
/* @__PURE__ */ i(
|
|
287
|
-
|
|
301
|
+
E,
|
|
288
302
|
{
|
|
289
303
|
variant: "medium",
|
|
290
|
-
size:
|
|
291
|
-
className:
|
|
304
|
+
size: G(),
|
|
305
|
+
className: p(
|
|
292
306
|
"text-- whitespace-normal break-all flex gap-1 pt-0.5",
|
|
293
|
-
|
|
294
|
-
|
|
307
|
+
v && "bg-neutral-50 dark:bg-black-700 p-1 rounded",
|
|
308
|
+
A && u?.color && `bg-${u.color}-50 border-${u.color}-300 px-0.5 rounded-lg`
|
|
295
309
|
),
|
|
296
310
|
appearance: "body",
|
|
297
311
|
children: [
|
|
298
|
-
|
|
299
|
-
/* @__PURE__ */
|
|
300
|
-
/* @__PURE__ */
|
|
301
|
-
] }) :
|
|
302
|
-
o?.toLowerCase() === "currency" &&
|
|
303
|
-
|
|
312
|
+
M && n && e ? /* @__PURE__ */ i("div", { className: "flex gap-2", children: [
|
|
313
|
+
/* @__PURE__ */ r("span", { className: "line-through", children: d(n) }),
|
|
314
|
+
/* @__PURE__ */ r("span", { children: C() })
|
|
315
|
+
] }) : V || ee ? /* @__PURE__ */ r("mark", { className: p("rounded-md py-0.5 px-1", ke()), children: C() }) : C(),
|
|
316
|
+
o?.toLowerCase() === "currency" && f !== 0 && f !== void 0 && f !== null && /* @__PURE__ */ i(
|
|
317
|
+
je.span,
|
|
304
318
|
{
|
|
305
319
|
initial: { opacity: 0, y: 2 },
|
|
306
320
|
animate: { opacity: 1, y: 0 },
|
|
307
321
|
transition: { duration: 0.25 },
|
|
308
|
-
className:
|
|
322
|
+
className: p(
|
|
309
323
|
"inline-flex items-center gap-1 ml-1.5 text-xs font-medium",
|
|
310
|
-
|
|
324
|
+
f > 0 ? "text-emerald-600 dark:text-emerald-400" : "text-red-600 dark:text-red-400"
|
|
311
325
|
),
|
|
312
326
|
children: [
|
|
313
|
-
/* @__PURE__ */
|
|
314
|
-
/* @__PURE__ */
|
|
327
|
+
/* @__PURE__ */ r("span", { className: "flex items-center justify-center w-4 h-4", children: f > 0 ? /* @__PURE__ */ r(Ue, { sx: { fontSize: 16 }, className: "text-emerald-600 dark:text-emerald-400" }) : /* @__PURE__ */ r(Be, { sx: { fontSize: 16 }, className: "text-red-600 dark:text-red-400" }) }),
|
|
328
|
+
/* @__PURE__ */ r("span", { children: _(Math.abs(f), s?.currency_code || "USD") })
|
|
315
329
|
]
|
|
316
330
|
}
|
|
317
331
|
),
|
|
318
|
-
s?.is_master_data && s?.reference && e && /* @__PURE__ */
|
|
332
|
+
s?.is_master_data && s?.reference && e && /* @__PURE__ */ r(
|
|
319
333
|
"button",
|
|
320
334
|
{
|
|
321
|
-
onClick: () =>
|
|
322
|
-
onKeyDown: (
|
|
323
|
-
(
|
|
335
|
+
onClick: () => K(s),
|
|
336
|
+
onKeyDown: (t) => {
|
|
337
|
+
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), K(s));
|
|
324
338
|
},
|
|
325
339
|
"aria-label": `Search master data for ${l}`,
|
|
326
340
|
type: "button",
|
|
327
341
|
className: "cursor-pointer",
|
|
328
|
-
children: /* @__PURE__ */
|
|
342
|
+
children: /* @__PURE__ */ r(De, { width: 20, height: 20 })
|
|
329
343
|
}
|
|
330
344
|
),
|
|
331
|
-
|
|
345
|
+
le && /* @__PURE__ */ r(
|
|
332
346
|
"input",
|
|
333
347
|
{
|
|
334
348
|
type: "file",
|
|
335
|
-
onChange:
|
|
349
|
+
onChange: Te,
|
|
336
350
|
className: "absolute inset-0 w-full h-full opacity-0 cursor-pointer",
|
|
337
351
|
"aria-label": `Upload file for ${l}`
|
|
338
352
|
}
|
|
@@ -340,49 +354,49 @@ const Pe = Ne(
|
|
|
340
354
|
]
|
|
341
355
|
}
|
|
342
356
|
),
|
|
343
|
-
n &&
|
|
344
|
-
|
|
357
|
+
n && !M && /* @__PURE__ */ r(
|
|
358
|
+
E,
|
|
345
359
|
{
|
|
346
360
|
variant: "medium",
|
|
347
361
|
size: "extra-small",
|
|
348
362
|
className: "pt-0.5",
|
|
349
363
|
appearance: "body",
|
|
350
|
-
children: /* @__PURE__ */
|
|
364
|
+
children: /* @__PURE__ */ r("mark", { className: "rounded-md py-0.5 px-1 bg-error-100", children: /* @__PURE__ */ r("del", { children: n || o?.toLowerCase() === "boolean" && n === "0" ? n === "True" && o?.toLowerCase() !== "choice" ? "Yes" : n === "False" && o?.toLowerCase() !== "choice" ? "No" : o?.toLowerCase() === "boolean" ? q(n) : o?.toLowerCase() === "currency" ? _(n, s?.currency_code) : o?.toLowerCase() === "date" ? N(n, {
|
|
351
365
|
skipTimezone: !0,
|
|
352
366
|
withTime: !1
|
|
353
|
-
}) : o?.toLowerCase() === "datetime" ?
|
|
367
|
+
}) : o?.toLowerCase() === "datetime" ? N(n, {
|
|
354
368
|
skipTimezone: !0,
|
|
355
369
|
withTime: !0
|
|
356
|
-
}) : o?.toLowerCase() === "percentage" ? `${n}%` : o?.toLowerCase() === "url" ? F(n) : n.length >
|
|
357
|
-
|
|
370
|
+
}) : o?.toLowerCase() === "percentage" ? `${n}%` : o?.toLowerCase() === "url" ? F(n) : n.length > h ? /* @__PURE__ */ i("p", { children: [
|
|
371
|
+
d(n).slice(0, c ? h : d(n).length),
|
|
358
372
|
c ? "... " : " ",
|
|
359
|
-
|
|
360
|
-
] }) :
|
|
373
|
+
I()
|
|
374
|
+
] }) : d(n) : "-" }) })
|
|
361
375
|
}
|
|
362
376
|
),
|
|
363
|
-
|
|
364
|
-
|
|
377
|
+
$ && /* @__PURE__ */ r(
|
|
378
|
+
$,
|
|
365
379
|
{
|
|
366
|
-
isVisible:
|
|
367
|
-
onClose:
|
|
368
|
-
masterdataInfo:
|
|
380
|
+
isVisible: we,
|
|
381
|
+
onClose: Ce,
|
|
382
|
+
masterdataInfo: be
|
|
369
383
|
}
|
|
370
384
|
),
|
|
371
|
-
|
|
385
|
+
H && u && A && /* @__PURE__ */ r(
|
|
372
386
|
"div",
|
|
373
387
|
{
|
|
374
388
|
className: "absolute left-0 right-0 top-[95%] mt-1 z-50 bg-white dark:bg-black-600 rounded-xl",
|
|
375
|
-
onClick: (
|
|
376
|
-
onMouseDown: (
|
|
377
|
-
onKeyDown: (
|
|
378
|
-
|
|
389
|
+
onClick: (t) => t.stopPropagation(),
|
|
390
|
+
onMouseDown: (t) => t.preventDefault(),
|
|
391
|
+
onKeyDown: (t) => {
|
|
392
|
+
t.key === "Escape" && S(!1);
|
|
379
393
|
},
|
|
380
394
|
role: "tooltip",
|
|
381
395
|
"aria-label": "Risk analysis details",
|
|
382
396
|
tabIndex: 0,
|
|
383
|
-
children:
|
|
384
|
-
/* @__PURE__ */
|
|
385
|
-
/* @__PURE__ */
|
|
397
|
+
children: j ? /* @__PURE__ */ r(j, { riskDetails: u }) : /* @__PURE__ */ r("div", { className: "shadow-lg p-4", children: /* @__PURE__ */ i("div", { className: "text-sm", children: [
|
|
398
|
+
/* @__PURE__ */ r("h4", { className: "font-semibold mb-2", children: "Risk Details" }),
|
|
399
|
+
/* @__PURE__ */ r("p", { className: "text-neutral-600 dark:text-neutral-300", children: u.description || "Risk analysis information" })
|
|
386
400
|
] }) })
|
|
387
401
|
}
|
|
388
402
|
)
|
|
@@ -391,8 +405,8 @@ const Pe = Ne(
|
|
|
391
405
|
);
|
|
392
406
|
}
|
|
393
407
|
);
|
|
394
|
-
|
|
408
|
+
Xe.displayName = "LabelValue";
|
|
395
409
|
export {
|
|
396
|
-
|
|
410
|
+
Xe as LabelValue
|
|
397
411
|
};
|
|
398
412
|
//# sourceMappingURL=LabelValue.es.js.map
|