@lax-wp/design-system 0.13.28 → 0.13.29
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/infinite-table/body/cell/DataCell.cjs.js +1 -1
- package/dist/components/data-display/infinite-table/body/cell/DataCell.cjs.js.map +1 -1
- package/dist/components/data-display/infinite-table/body/cell/DataCell.es.js +135 -133
- package/dist/components/data-display/infinite-table/body/cell/DataCell.es.js.map +1 -1
- package/dist/components/data-display/infinite-table/body/rows/row.cjs.js +1 -1
- package/dist/components/data-display/infinite-table/body/rows/row.cjs.js.map +1 -1
- package/dist/components/data-display/infinite-table/body/rows/row.es.js +301 -296
- package/dist/components/data-display/infinite-table/body/rows/row.es.js.map +1 -1
- package/dist/components/data-display/infinite-table/context.cjs.js.map +1 -1
- package/dist/components/data-display/infinite-table/context.d.ts +1 -0
- package/dist/components/data-display/infinite-table/context.es.js.map +1 -1
- package/dist/components/data-display/infinite-table/index.cjs.js +1 -1
- package/dist/components/data-display/infinite-table/index.cjs.js.map +1 -1
- package/dist/components/data-display/infinite-table/index.d.ts +1 -1
- package/dist/components/data-display/infinite-table/index.es.js +211 -208
- package/dist/components/data-display/infinite-table/index.es.js.map +1 -1
- package/dist/components/data-display/infinite-table/types.d.ts +22 -0
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,119 +1,121 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useTheme as
|
|
3
|
-
import { formatDate as
|
|
4
|
-
import { getTableRowBgClassNamesByStatus as
|
|
5
|
-
import { useTableConfig as
|
|
6
|
-
import
|
|
7
|
-
import { Typography as
|
|
8
|
-
import { OpenInNewRounded as
|
|
1
|
+
import { jsxs as L, jsx as t, Fragment as Ke } from "react/jsx-runtime";
|
|
2
|
+
import { useTheme as Ae } from "../../../../../hooks/useTheme.es.js";
|
|
3
|
+
import { formatDate as q, formatCurrency as ue } from "../../../../../utils/formatters.es.js";
|
|
4
|
+
import { getTableRowBgClassNamesByStatus as We } from "../../../../../constants/table.es.js";
|
|
5
|
+
import { useTableConfig as Ue } from "../../../../../providers/design-system-provider/hooks.es.js";
|
|
6
|
+
import G from "../../../../tooltip/Tooltip.es.js";
|
|
7
|
+
import { Typography as Be } from "../../../typography/Typography.es.js";
|
|
8
|
+
import { OpenInNewRounded as Ye } from "@mui/icons-material";
|
|
9
9
|
import x from "../../../../../_virtual/index.es.js";
|
|
10
|
-
import g, { useContext as
|
|
11
|
-
import { Link as
|
|
12
|
-
import { TableContext as
|
|
13
|
-
import { InlineEditField as
|
|
14
|
-
import { LoadingSpinnerIcon as
|
|
15
|
-
let
|
|
10
|
+
import g, { useContext as qe, useCallback as S, useState as D, useRef as J, useEffect as y } from "react";
|
|
11
|
+
import { Link as Ge } from "react-router-dom";
|
|
12
|
+
import { TableContext as Je } from "../../context.es.js";
|
|
13
|
+
import { InlineEditField as Qe } from "./InlineEditField.es.js";
|
|
14
|
+
import { LoadingSpinnerIcon as Q, KeyboardArrowDownIcon as Xe, KeyboardArrowRightFilledIcon as Ze, LinkIcon as He } from "../../../../icon/icons.generated.es.js";
|
|
15
|
+
let X;
|
|
16
16
|
const ie = (e) => {
|
|
17
17
|
const o = Number(e);
|
|
18
18
|
if (Number.isNaN(o) || e === null || e === void 0)
|
|
19
19
|
return "0ms";
|
|
20
20
|
if (o >= 864e5) {
|
|
21
|
-
const p = Math.floor(o / 864e5),
|
|
22
|
-
return `${p}d ${
|
|
21
|
+
const p = Math.floor(o / 864e5), d = Math.floor(o % 864e5 / 36e5), u = Math.floor(o % 36e5 / 6e4), h = Math.floor(o % 6e4 / 1e3);
|
|
22
|
+
return `${p}d ${d}h ${u}m ${h}s`;
|
|
23
23
|
}
|
|
24
24
|
if (o >= 36e5) {
|
|
25
|
-
const p = Math.floor(o / 36e5),
|
|
26
|
-
return `${p}h ${
|
|
25
|
+
const p = Math.floor(o / 36e5), d = Math.floor(o % 36e5 / 6e4), u = Math.floor(o % 6e4 / 1e3);
|
|
26
|
+
return `${p}h ${d}m ${u}s`;
|
|
27
27
|
}
|
|
28
28
|
if (o >= 6e4) {
|
|
29
|
-
const p = Math.floor(o / 6e4),
|
|
30
|
-
return `${p}m ${
|
|
29
|
+
const p = Math.floor(o / 6e4), d = Math.floor(o % 6e4 / 1e3);
|
|
30
|
+
return `${p}m ${d}s`;
|
|
31
31
|
}
|
|
32
32
|
return o >= 1e3 ? `${(o / 1e3).toFixed(2)}s` : `${o}ms`;
|
|
33
|
-
},
|
|
33
|
+
}, Pe = ({ children: e, withLink: o, linkTo: p, rowData: d, disableRowClick: u }) => o && !u ? /* @__PURE__ */ t(Ge, { to: p?.(d?.id, d) || "", children: e }) : e, Ee = ({
|
|
34
34
|
cell: e,
|
|
35
35
|
id: o,
|
|
36
36
|
nextWidthSum: p,
|
|
37
|
-
isLastCell:
|
|
38
|
-
rowHovering:
|
|
37
|
+
isLastCell: d,
|
|
38
|
+
rowHovering: u,
|
|
39
39
|
index: h,
|
|
40
|
-
isFirstStickyCell:
|
|
41
|
-
handleCellClick:
|
|
40
|
+
isFirstStickyCell: le,
|
|
41
|
+
handleCellClick: ce,
|
|
42
42
|
currentData: v,
|
|
43
|
-
highlightSubstring:
|
|
44
|
-
is_read:
|
|
45
|
-
is_modified:
|
|
46
|
-
is_row_modified:
|
|
43
|
+
highlightSubstring: O,
|
|
44
|
+
is_read: me,
|
|
45
|
+
is_modified: de,
|
|
46
|
+
is_row_modified: fe,
|
|
47
47
|
is_deleted: z,
|
|
48
|
-
is_added:
|
|
48
|
+
is_added: R,
|
|
49
49
|
level: b,
|
|
50
50
|
inlineEditing: k,
|
|
51
|
-
isInlineEditing:
|
|
52
|
-
setRowHovering:
|
|
53
|
-
handleCellValueChange:
|
|
54
|
-
cellRef:
|
|
55
|
-
handleUpdateCellData:
|
|
56
|
-
registerValidation:
|
|
57
|
-
loadingExpand:
|
|
58
|
-
toggleRowExpand:
|
|
59
|
-
isDraggingOver:
|
|
60
|
-
isLoading:
|
|
61
|
-
is_incomplete:
|
|
51
|
+
isInlineEditing: l,
|
|
52
|
+
setRowHovering: V,
|
|
53
|
+
handleCellValueChange: pe,
|
|
54
|
+
cellRef: we,
|
|
55
|
+
handleUpdateCellData: he,
|
|
56
|
+
registerValidation: be,
|
|
57
|
+
loadingExpand: ye,
|
|
58
|
+
toggleRowExpand: Z,
|
|
59
|
+
isDraggingOver: ve,
|
|
60
|
+
isLoading: C,
|
|
61
|
+
is_incomplete: H,
|
|
62
62
|
pendingEdit: a,
|
|
63
|
-
hasPendingEdit:
|
|
64
|
-
pendingValidationError:
|
|
63
|
+
hasPendingEdit: i,
|
|
64
|
+
pendingValidationError: ke
|
|
65
65
|
}) => {
|
|
66
66
|
const {
|
|
67
|
-
cascadingTableConfig:
|
|
68
|
-
originalsOnly:
|
|
69
|
-
maxLevel:
|
|
70
|
-
showNewItem:
|
|
71
|
-
expandedRows:
|
|
72
|
-
rowLinkConfig:
|
|
73
|
-
multiSelectConfig:
|
|
67
|
+
cascadingTableConfig: P,
|
|
68
|
+
originalsOnly: xe,
|
|
69
|
+
maxLevel: Te,
|
|
70
|
+
showNewItem: ge,
|
|
71
|
+
expandedRows: Ce,
|
|
72
|
+
rowLinkConfig: j,
|
|
73
|
+
multiSelectConfig: Ne,
|
|
74
74
|
cellEditing: F,
|
|
75
75
|
cellEditingValue: I,
|
|
76
|
-
allowInlineEdit:
|
|
77
|
-
fieldOperationLoading:
|
|
78
|
-
pendingEdits:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}, []), B = L((r) => {
|
|
76
|
+
allowInlineEdit: E,
|
|
77
|
+
fieldOperationLoading: _e,
|
|
78
|
+
pendingEdits: $e,
|
|
79
|
+
selectedRowId: K
|
|
80
|
+
} = qe(Je), Me = K != null && String(K) === String(o), Le = Ue(), A = (e?.column?.key ? e?.row?.original?.__cellMetadata?.[e.column.key] : void 0)?.is_locked ?? e?.column?.is_locked, W = (e?.column?.key ? $e?.[o]?.[e.column.key]?.validationError : null) || ke || null, ee = k === e.column.key && e?.column?.canEdit && !A && !e?.column?.is_disabled, Se = _e === `${o}-${e?.column?.id}`, { theme: De } = Ae(), Oe = De === "dark", Ve = S(() => V(o), [V, o]), ze = S(() => V(null), [V]), N = Le?.formatDuration, [n, f] = D(
|
|
81
|
+
e?.column?.dataType === "duration" && e?.value ? N ? N(e.value) : ie(e.value) : e.value
|
|
82
|
+
), [w, oe] = D(null), [U, Re] = D(!1), [je, te] = D(!1), [Fe, re] = D(!1), _ = J(null), $ = J(), M = J(), { selectedColumnIds: ae = [] } = Ne || {}, ne = !Object.prototype.hasOwnProperty.call(e?.column?.meta ?? {}, "shouldHighlight") || e?.column?.meta?.shouldHighlight, se = S(() => {
|
|
83
|
+
_.current && Re(_.current.scrollWidth > _.current.clientWidth);
|
|
84
|
+
}, []), B = S((r) => {
|
|
86
85
|
$.current && clearTimeout($.current), r ? te(!0) : $.current = setTimeout(() => te(!1), 200);
|
|
86
|
+
}, []), Y = S((r) => {
|
|
87
|
+
M.current && clearTimeout(M.current), r ? re(!0) : M.current = setTimeout(() => re(!1), 200);
|
|
87
88
|
}, []), T = x({
|
|
88
|
-
"bg-amber-100 dark:bg-amber-900/30":
|
|
89
|
-
"bg-neutral-100 dark:bg-black-600":
|
|
90
|
-
"bg-error-200 dark:bg-error-900":
|
|
91
|
-
"bg-success-100 dark:bg-success-800":
|
|
92
|
-
"bg-primary-50 dark:bg-black-700": !
|
|
93
|
-
"bg-warning-50 dark:bg-black-500": (
|
|
94
|
-
"bg-error-100 dark:bg-error-975": (z || v?.is_deleted) && !
|
|
95
|
-
"bg-success-50 dark:bg-success-900": (
|
|
96
|
-
"bg-primary-50 dark:bg-primary-900": (
|
|
97
|
-
"bg-primary-50 dark:bg-primary-800":
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
89
|
+
"bg-amber-100 dark:bg-amber-900/30": i,
|
|
90
|
+
"bg-neutral-100 dark:bg-black-600": u === o && !l && !i && !(z || v?.is_deleted) && !(R || v?.is_added),
|
|
91
|
+
"bg-error-200 dark:bg-error-900": u === o && !l && !i && (z || v?.is_deleted),
|
|
92
|
+
"bg-success-100 dark:bg-success-800": u === o && !l && !i && (R || v?.is_added),
|
|
93
|
+
"bg-primary-50 dark:bg-black-700": !H && !me && ge && !C && u !== o && !l && !i,
|
|
94
|
+
"bg-warning-50 dark:bg-black-500": (H || de || fe || v?.is_row_modified) && !C && u !== o && !l && !i,
|
|
95
|
+
"bg-error-100 dark:bg-error-975": (z || v?.is_deleted) && !C && u !== o && !l && !i,
|
|
96
|
+
"bg-success-50 dark:bg-success-900": (R || v?.is_added) && !C && u !== o && !l && !i,
|
|
97
|
+
"bg-primary-50 dark:bg-primary-900": (ve || l) && !i,
|
|
98
|
+
"bg-primary-50 dark:bg-primary-800": ae?.includes(e.column.id) && !l && !i,
|
|
99
|
+
"bg-primary-100 dark:bg-primary-950": Me && u !== o && !l && !i && !C,
|
|
100
|
+
[We[e?.row?.original?.__rowBgStatus]]: e?.row?.original?.__rowBgStatus && !l && !i
|
|
101
|
+
}), Ie = (r) => {
|
|
102
|
+
e.column?.disableRowClick || ce(r);
|
|
101
103
|
};
|
|
102
|
-
y(() => (e?.row?.original?.status === "running" && e.column?.dataType === "duration" && (
|
|
103
|
-
const s = new Date(
|
|
104
|
-
f(
|
|
104
|
+
y(() => (e?.row?.original?.status === "running" && e.column?.dataType === "duration" && (X = setInterval(() => {
|
|
105
|
+
const s = new Date(q(e?.row?.original?.created_at || e?.row?.original?.executed_on, { withTime: !0, format: "yyyy-MM-dd HH:mm:ss" })), m = Math.abs((/* @__PURE__ */ new Date()).getTime() - new Date(s).getTime());
|
|
106
|
+
f(N ? N(m) : ie(m));
|
|
105
107
|
}, 500)), () => {
|
|
106
|
-
|
|
107
|
-
}), [n, e.value, e?.row?.original?.created_at, e?.row?.original?.executed_on, e?.row?.original?.status, e.column?.dataType,
|
|
108
|
-
(e?.column?.tooltipCellKey || e?.column?.type?.toLowerCase() === "url") && (e?.column?.type?.toLowerCase() === "url" ?
|
|
108
|
+
X && clearInterval(X);
|
|
109
|
+
}), [n, e.value, e?.row?.original?.created_at, e?.row?.original?.executed_on, e?.row?.original?.status, e.column?.dataType, N]), y(() => {
|
|
110
|
+
(e?.column?.tooltipCellKey || e?.column?.type?.toLowerCase() === "url") && (e?.column?.type?.toLowerCase() === "url" ? oe(e?.value) : oe(e?.row?.original?.[String(e?.column?.tooltipCellKey)]));
|
|
109
111
|
}, [e?.column?.tooltipCellKey, e?.row?.original, e?.column?.type, e?.value]), y(() => {
|
|
110
112
|
if (e?.column?.type?.toLowerCase() === "currency")
|
|
111
113
|
if (a?.value !== void 0) {
|
|
112
|
-
const r = e?.row?.original?.__rawData, s = e?.column?.Header,
|
|
113
|
-
f(
|
|
114
|
+
const r = e?.row?.original?.__rawData, s = e?.column?.Header, m = a?.meta?.currency_code || r?.[s]?.currency_code || "USD";
|
|
115
|
+
f(ue(a.value, m));
|
|
114
116
|
} else {
|
|
115
117
|
const r = e?.row?.original?.__rawData, s = e?.column?.Header;
|
|
116
|
-
f(
|
|
118
|
+
f(ue(e?.value, r?.[s]?.currency_code || "USD"));
|
|
117
119
|
}
|
|
118
120
|
}, [e?.value, e?.column?.type, e?.column?.Header, e?.row?.original?.__rawData, a?.value, a?.meta?.currency_code]), y(() => {
|
|
119
121
|
e?.column?.type?.toLowerCase() === "percentage" && (a?.value !== void 0 ? f(a.value?.toString() + "%" || "") : f(e?.value?.toString() + "%" || ""));
|
|
@@ -121,94 +123,94 @@ const ie = (e) => {
|
|
|
121
123
|
const r = e?.column?.type?.toLowerCase() || "";
|
|
122
124
|
if (["date", "datetime"].includes(r))
|
|
123
125
|
if (a?.value !== void 0) {
|
|
124
|
-
const s = r === "datetime",
|
|
125
|
-
f(
|
|
126
|
+
const s = r === "datetime", m = q(a.value, { withTime: s, skipTimezone: !0 });
|
|
127
|
+
f(m || a.value);
|
|
126
128
|
} else f(e.value);
|
|
127
129
|
}, [e?.value, e?.column?.type, a?.value]), y(() => {
|
|
128
130
|
const r = e?.column?.type?.toLowerCase() || "";
|
|
129
131
|
["currency", "percentage", "duration", "boolean", "date", "datetime"].includes(r) || (a?.value !== void 0 ? f(a.value) : e?.column?.dataType !== "duration" && f(e.value));
|
|
130
132
|
}, [e?.value, e?.column?.type, e?.column?.dataType, a?.value]), y(() => {
|
|
131
|
-
if (e?.column?.type?.toLowerCase() === "boolean" &&
|
|
133
|
+
if (e?.column?.type?.toLowerCase() === "boolean" && E) {
|
|
132
134
|
const r = a?.value !== void 0 ? a.value : e?.value;
|
|
133
135
|
f(r === !0 || r === "true" || r === "True" || r === "Yes" || r === 1 ? "Yes" : "No");
|
|
134
136
|
}
|
|
135
|
-
}, [e?.value, e?.column?.type,
|
|
136
|
-
|
|
137
|
+
}, [e?.value, e?.column?.type, E, a?.value]), y(() => () => {
|
|
138
|
+
$.current && clearTimeout($.current), M.current && clearTimeout(M.current);
|
|
137
139
|
}, []);
|
|
138
|
-
const
|
|
139
|
-
return /* @__PURE__ */
|
|
140
|
+
const c = g.isValidElement(n);
|
|
141
|
+
return /* @__PURE__ */ L(
|
|
140
142
|
"td",
|
|
141
143
|
{
|
|
142
144
|
id: e.value,
|
|
143
145
|
"data-column-key": e?.column?.key,
|
|
144
146
|
...e.getCellProps(),
|
|
145
|
-
onClick:
|
|
147
|
+
onClick: j?.isEnabled ? void 0 : Ie,
|
|
146
148
|
className: x(
|
|
147
149
|
"h-row",
|
|
148
150
|
{
|
|
149
151
|
"sticky left-0": e?.column?.sticky,
|
|
150
152
|
relative: !e?.column?.sticky,
|
|
151
|
-
"w-full":
|
|
153
|
+
"w-full": d,
|
|
152
154
|
"overflow-visible": k === e.column.key,
|
|
153
155
|
/** Chips/badges: avoid vertical clip from overflow-x-hidden + truncate (see isUiElementCell branch below) */
|
|
154
|
-
"overflow-x-hidden overflow-y-visible": k !== e.column.key &&
|
|
155
|
-
"overflow-hidden": k !== e.column.key && !
|
|
156
|
+
"overflow-x-hidden overflow-y-visible": k !== e.column.key && c,
|
|
157
|
+
"overflow-hidden": k !== e.column.key && !c
|
|
156
158
|
},
|
|
157
|
-
|
|
159
|
+
W && !ee ? "outline outline-2 outline-error-500 -outline-offset-2 z-[5]" : "",
|
|
158
160
|
`${T || "bg-white dark:bg-black-800"}`
|
|
159
161
|
),
|
|
160
162
|
style: { minWidth: `${e.column.width}px`, maxWidth: `${e.column.width}px`, right: e?.column?.sticky ? `${p}px` : "0px", paddingLeft: b > 0 && h === 0 ? `${b * 16}px` : void 0 },
|
|
161
|
-
onMouseEnter:
|
|
162
|
-
onMouseLeave:
|
|
163
|
+
onMouseEnter: Ve,
|
|
164
|
+
onMouseLeave: ze,
|
|
163
165
|
children: [
|
|
164
|
-
/* @__PURE__ */ t(
|
|
166
|
+
/* @__PURE__ */ t(Pe, { withLink: j?.isEnabled, linkTo: j?.linkTo || void 0, rowData: e?.row?.original, disableRowClick: e?.column?.disableRowClick, children: (Array.isArray(F) ? F.includes(`${o}-${e?.column?.id}`) : F === `${o}-${e?.column?.id}`) ? /* @__PURE__ */ L("div", { className: "h-row top-0 font-medium font-inter w-full absolute flex items-center px-4", children: [
|
|
165
167
|
/* @__PURE__ */ t("span", { className: "text-neutral-400 dark:text-black-400 truncate", children: (() => {
|
|
166
|
-
const r = `${o}-${e?.column?.id}`, s = typeof I == "object" ? I?.[r] : I,
|
|
167
|
-
return
|
|
168
|
+
const r = `${o}-${e?.column?.id}`, s = typeof I == "object" ? I?.[r] : I, m = e?.column?.type?.toLowerCase();
|
|
169
|
+
return m === "boolean" ? s === !0 || s === "true" || s === "True" ? "Yes" : "No" : (m === "date" || m === "datetime") && s ? q(s, { withTime: m === "datetime", skipTimezone: !0 }) || String(s) : s != null ? String(s) : n;
|
|
168
170
|
})() }),
|
|
169
|
-
/* @__PURE__ */ t("div", { className: "ml-2 flex items-center gap-1.5", children: /* @__PURE__ */ t(
|
|
170
|
-
] }) : k === e.column.key && e?.column?.canEdit && !
|
|
171
|
+
/* @__PURE__ */ t("div", { className: "ml-2 flex items-center gap-1.5", children: /* @__PURE__ */ t(Q, { className: "spinner text-neutral-600 dark:text-white", size: 12 }) })
|
|
172
|
+
] }) : k === e.column.key && e?.column?.canEdit && !A && !e?.column?.is_disabled ? /* @__PURE__ */ t("div", { className: "h-row w-full absolute top-0 left-0 flex items-center", style: { marginLeft: b > 0 && h === 0 ? `-${b * 16}px` : void 0, width: b > 0 && h === 0 ? `calc(100% + ${b * 16}px)` : "100%" }, children: /* @__PURE__ */ t(Qe, { cell: e, id: o, inlineEditing: k, cellRef: we, handleCellValueChange: pe, handleUpdateCellData: he, registerValidation: be }) }) : /* @__PURE__ */ L(Ke, { children: [
|
|
171
173
|
b > 0 && h === 0 && /* @__PURE__ */ t("div", { className: "h-row border-l border-neutral-300 dark:border-black-600 ml-2" }),
|
|
172
174
|
/* @__PURE__ */ t("div", { className: "min-h-6", children: /* @__PURE__ */ t(
|
|
173
|
-
|
|
175
|
+
G,
|
|
174
176
|
{
|
|
175
177
|
title: w && e?.column?.type?.toLowerCase() !== "url" ? w : void 0,
|
|
176
178
|
hideTooltip: !w || e?.column?.type?.toLowerCase() === "url",
|
|
177
179
|
delayShow: !0,
|
|
178
180
|
placement: "top",
|
|
179
|
-
children: /* @__PURE__ */
|
|
181
|
+
children: /* @__PURE__ */ L(
|
|
180
182
|
"div",
|
|
181
183
|
{
|
|
182
|
-
className: x(`h-row top-0 font-medium font-inter overflow-index-auto whitespace-nowrap text-ellipsis dark:text-black-200 w-full absolute flex items-center ${T || "bg-white dark:bg-black-800"}`,
|
|
183
|
-
style: e?.column?.sticky &&
|
|
184
|
+
className: x(`h-row top-0 font-medium font-inter overflow-index-auto whitespace-nowrap text-ellipsis dark:text-black-200 w-full absolute flex items-center ${T || "bg-white dark:bg-black-800"}`, c ? "overflow-x-hidden overflow-y-visible" : "overflow-x-hidden", { "border border-b-0 border-t-0 border-primary-600 dark:border-blue-800": ae?.includes(e.column.id) }),
|
|
185
|
+
style: e?.column?.sticky && le ? { boxShadow: `${Oe ? "-8px 0px 8px 0px rgba(255, 255, 255, 0.01)" : "-8px 0px 8px 0px rgba(0, 0, 0, 0.02)"}` } : {},
|
|
184
186
|
children: [
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
} }) : /* @__PURE__ */ t(
|
|
188
|
-
|
|
187
|
+
P?.isCascading && !xe && h === 0 && /* @__PURE__ */ t("div", { className: x("w-[22px] h-row flex items-center px-4", `${T || "bg-white dark:bg-black-800"}`), id: "cascading", children: Te > b && (e?.row?.original?.__has_children || P?.showAllDropdown) && /* @__PURE__ */ t("div", { children: ye ? /* @__PURE__ */ t(Q, { className: "text-neutral-600 dark:text-white", size: 8 }) : /* @__PURE__ */ t("div", { children: Ce?.[o]?.isOpen ? /* @__PURE__ */ t(Xe, { size: 20, className: "text-neutral-400 dark:text-neutral-400", onClick: (r) => {
|
|
188
|
+
Z(), r.stopPropagation();
|
|
189
|
+
} }) : /* @__PURE__ */ t(Ze, { size: 20, className: "text-neutral-400 dark:text-neutral-400", onClick: (r) => {
|
|
190
|
+
Z(), r.stopPropagation();
|
|
189
191
|
} }) }) }) }),
|
|
190
192
|
e?.column?.type?.toLowerCase() === "url" && w ? /* @__PURE__ */ t(
|
|
191
|
-
|
|
193
|
+
G,
|
|
192
194
|
{
|
|
193
|
-
title: /* @__PURE__ */ t("div", { onMouseEnter: () =>
|
|
194
|
-
/* @__PURE__ */ t("div", { className: "w-4 h-4", children: /* @__PURE__ */ t(
|
|
195
|
-
/* @__PURE__ */ t(
|
|
196
|
-
/* @__PURE__ */ t(
|
|
195
|
+
title: /* @__PURE__ */ t("div", { onMouseEnter: () => B(!0), onMouseLeave: () => B(!1), children: /* @__PURE__ */ t("a", { href: w, target: "_blank", rel: "noopener noreferrer", onClick: (r) => r.stopPropagation(), children: /* @__PURE__ */ L("div", { className: "flex gap-1 items-center w-full", children: [
|
|
196
|
+
/* @__PURE__ */ t("div", { className: "w-4 h-4", children: /* @__PURE__ */ t(He, { height: 16, width: 16 }) }),
|
|
197
|
+
/* @__PURE__ */ t(Be, { variant: "medium", size: "small", className: "truncate", appearance: "custom", children: w }),
|
|
198
|
+
/* @__PURE__ */ t(Ye, { sx: { height: "16px", width: "16px", color: "#016DCF" } })
|
|
197
199
|
] }) }) }),
|
|
198
200
|
placement: "top",
|
|
199
|
-
open:
|
|
200
|
-
onOpenChange:
|
|
201
|
+
open: je,
|
|
202
|
+
onOpenChange: B,
|
|
201
203
|
className: "block w-full min-w-0 overflow-hidden",
|
|
202
|
-
children: /* @__PURE__ */ t("div", { className: "w-full h-full flex items-center px-4 min-w-0 overflow-hidden text-primary-400", children: /* @__PURE__ */ t("span", { ref:
|
|
204
|
+
children: /* @__PURE__ */ t("div", { className: "w-full h-full flex items-center px-4 min-w-0 overflow-hidden text-primary-400", children: /* @__PURE__ */ t("span", { ref: _, onMouseEnter: se, className: "truncate w-full", children: O && ne && !g.isValidElement(n) && typeof n != "object" ? O(n) : n }) })
|
|
203
205
|
}
|
|
204
206
|
) : /* @__PURE__ */ t(
|
|
205
|
-
|
|
207
|
+
G,
|
|
206
208
|
{
|
|
207
|
-
title:
|
|
209
|
+
title: U && n && !c ? /* @__PURE__ */ t(
|
|
208
210
|
"div",
|
|
209
211
|
{
|
|
210
|
-
onMouseEnter: () =>
|
|
211
|
-
onMouseLeave: () =>
|
|
212
|
+
onMouseEnter: () => Y(!0),
|
|
213
|
+
onMouseLeave: () => Y(!1),
|
|
212
214
|
className: "max-h-96 overflow-y-auto whitespace-pre-wrap break-words no-scroll",
|
|
213
215
|
children: String(n)
|
|
214
216
|
}
|
|
@@ -216,16 +218,16 @@ const ie = (e) => {
|
|
|
216
218
|
placement: "top",
|
|
217
219
|
delayShow: !0,
|
|
218
220
|
hideTooltip: !!w,
|
|
219
|
-
open:
|
|
220
|
-
onOpenChange:
|
|
221
|
-
className: x("block w-full min-w-0",
|
|
222
|
-
children: /* @__PURE__ */ t("div", { className: x("w-full h-full flex items-center px-4 min-w-0",
|
|
221
|
+
open: U && !w && !c ? Fe : void 0,
|
|
222
|
+
onOpenChange: U && !w && !c ? Y : void 0,
|
|
223
|
+
className: x("block w-full min-w-0", c ? "overflow-x-hidden overflow-y-visible" : "overflow-hidden"),
|
|
224
|
+
children: /* @__PURE__ */ t("div", { className: x("w-full h-full flex items-center px-4 min-w-0", c ? "overflow-x-hidden overflow-y-visible" : "overflow-hidden"), children: /* @__PURE__ */ t(
|
|
223
225
|
"span",
|
|
224
226
|
{
|
|
225
|
-
ref:
|
|
226
|
-
onMouseEnter:
|
|
227
|
-
className: x(
|
|
228
|
-
children:
|
|
227
|
+
ref: c ? void 0 : _,
|
|
228
|
+
onMouseEnter: c ? void 0 : se,
|
|
229
|
+
className: x(c ? "flex min-w-0 max-w-full items-center justify-start gap-1" : "truncate w-full"),
|
|
230
|
+
children: O && ne && !g.isValidElement(n) && typeof n != "object" ? O(n) : g.isValidElement(n) ? typeof n.type == "string" ? n : g.cloneElement(n, {
|
|
229
231
|
...n.props,
|
|
230
232
|
containerWidth: e.column.width
|
|
231
233
|
}) : n
|
|
@@ -239,14 +241,14 @@ const ie = (e) => {
|
|
|
239
241
|
}
|
|
240
242
|
) })
|
|
241
243
|
] }) }),
|
|
242
|
-
|
|
243
|
-
|
|
244
|
+
W && !ee && /* @__PURE__ */ t("div", { className: "absolute bottom-0 left-0 right-0 h-row flex items-end pointer-events-none z-[5]", children: /* @__PURE__ */ t("div", { className: "w-full bg-error-50 dark:bg-error-975 px-1.5 py-0.5 truncate", children: /* @__PURE__ */ t("span", { className: "text-error-600 text-[10px] font-medium leading-none", children: W }) }) }),
|
|
245
|
+
Se && !(k === e.column.key && e?.column?.canEdit && !A && !e?.column?.is_disabled) && /* @__PURE__ */ t("div", { className: "absolute top-0 right-0 bg-white dark:bg-black-800 rounded-full w-5 h-5 flex items-center justify-center border border-primary-300 dark:border-primary-600 shadow-sm z-10", children: /* @__PURE__ */ t(Q, { className: "text-primary-600 dark:text-white", size: 8 }) })
|
|
244
246
|
]
|
|
245
247
|
},
|
|
246
248
|
h
|
|
247
249
|
);
|
|
248
|
-
},
|
|
250
|
+
}, bo = g.memo(Ee);
|
|
249
251
|
export {
|
|
250
|
-
|
|
252
|
+
bo as DataCell
|
|
251
253
|
};
|
|
252
254
|
//# sourceMappingURL=DataCell.es.js.map
|