@lax-wp/design-system 0.14.40 → 0.14.42

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