@lax-wp/design-system 0.14.36 → 0.14.37

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