@lax-wp/design-system 0.13.33-beta.7 → 0.13.33
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/button/Button.cjs.js +5 -5
- package/dist/components/button/Button.cjs.js.map +1 -1
- package/dist/components/button/Button.es.js +18 -18
- package/dist/components/button/Button.es.js.map +1 -1
- package/dist/components/button/IconButton.cjs.js +1 -1
- package/dist/components/button/IconButton.cjs.js.map +1 -1
- package/dist/components/button/IconButton.es.js +8 -8
- package/dist/components/button/IconButton.es.js.map +1 -1
- package/dist/components/buttons/option-button/OptionButton.cjs.js +1 -1
- package/dist/components/buttons/option-button/OptionButton.cjs.js.map +1 -1
- package/dist/components/buttons/option-button/OptionButton.es.js +1 -1
- package/dist/components/buttons/option-button/OptionButton.es.js.map +1 -1
- package/dist/components/data-display/comparison/components/Header.cjs.js +1 -1
- package/dist/components/data-display/comparison/components/Header.cjs.js.map +1 -1
- package/dist/components/data-display/comparison/components/Header.es.js +13 -13
- package/dist/components/data-display/comparison/components/Header.es.js.map +1 -1
- package/dist/components/data-display/infinite-table/body/cell/ActionCell.cjs.js +1 -1
- package/dist/components/data-display/infinite-table/body/cell/ActionCell.cjs.js.map +1 -1
- package/dist/components/data-display/infinite-table/body/cell/ActionCell.es.js +11 -11
- package/dist/components/data-display/infinite-table/body/cell/ActionCell.es.js.map +1 -1
- package/dist/components/data-display/infinite-table/body/cell/CheckboxCell.cjs.js +1 -1
- package/dist/components/data-display/infinite-table/body/cell/CheckboxCell.cjs.js.map +1 -1
- package/dist/components/data-display/infinite-table/body/cell/CheckboxCell.es.js +10 -10
- package/dist/components/data-display/infinite-table/body/cell/CheckboxCell.es.js.map +1 -1
- 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 +23 -23
- package/dist/components/data-display/infinite-table/body/cell/DataCell.es.js.map +1 -1
- package/dist/components/data-display/infinite-table/body/cell/LoaderCell.cjs.js +1 -1
- package/dist/components/data-display/infinite-table/body/cell/LoaderCell.cjs.js.map +1 -1
- package/dist/components/data-display/infinite-table/body/cell/LoaderCell.es.js +6 -6
- package/dist/components/data-display/infinite-table/body/cell/LoaderCell.es.js.map +1 -1
- package/dist/components/data-display/infinite-table/body/cell/PendingEditCell.cjs.js +1 -1
- package/dist/components/data-display/infinite-table/body/cell/PendingEditCell.cjs.js.map +1 -1
- package/dist/components/data-display/infinite-table/body/cell/PendingEditCell.es.js +4 -4
- package/dist/components/data-display/infinite-table/body/cell/PendingEditCell.es.js.map +1 -1
- package/dist/components/data-display/infinite-table/body/cell/RowActionCell.cjs.js +1 -1
- package/dist/components/data-display/infinite-table/body/cell/RowActionCell.cjs.js.map +1 -1
- package/dist/components/data-display/infinite-table/body/cell/RowActionCell.es.js +3 -3
- package/dist/components/data-display/infinite-table/body/cell/RowActionCell.es.js.map +1 -1
- package/dist/components/data-display/infinite-table/body/cell/RowOptionsCell.cjs.js +1 -1
- package/dist/components/data-display/infinite-table/body/cell/RowOptionsCell.cjs.js.map +1 -1
- package/dist/components/data-display/infinite-table/body/cell/RowOptionsCell.es.js +24 -24
- package/dist/components/data-display/infinite-table/body/cell/RowOptionsCell.es.js.map +1 -1
- package/dist/components/data-display/infinite-table/body/cell/SpinnerCell.cjs.js +1 -1
- package/dist/components/data-display/infinite-table/body/cell/SpinnerCell.cjs.js.map +1 -1
- package/dist/components/data-display/infinite-table/body/cell/SpinnerCell.es.js +1 -1
- package/dist/components/data-display/infinite-table/body/cell/SpinnerCell.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 +2 -2
- package/dist/components/data-display/infinite-table/body/rows/row.es.js.map +1 -1
- package/dist/components/data-display/infinite-table/head/CheckAll.cjs.js +1 -1
- package/dist/components/data-display/infinite-table/head/CheckAll.cjs.js.map +1 -1
- package/dist/components/data-display/infinite-table/head/CheckAll.es.js +1 -1
- package/dist/components/data-display/infinite-table/head/CheckAll.es.js.map +1 -1
- package/dist/components/data-display/infinite-table/head/cell/index.cjs.js +1 -1
- package/dist/components/data-display/infinite-table/head/cell/index.cjs.js.map +1 -1
- package/dist/components/data-display/infinite-table/head/cell/index.es.js +2 -2
- package/dist/components/data-display/infinite-table/head/cell/index.es.js.map +1 -1
- package/dist/components/data-display/infinite-table/head/index.cjs.js +1 -1
- package/dist/components/data-display/infinite-table/head/index.cjs.js.map +1 -1
- package/dist/components/data-display/infinite-table/head/index.es.js +20 -20
- package/dist/components/data-display/infinite-table/head/index.es.js.map +1 -1
- package/dist/components/data-display/tag/Tag.cjs.js +1 -1
- package/dist/components/data-display/tag/Tag.cjs.js.map +1 -1
- package/dist/components/data-display/tag/Tag.es.js +9 -11
- package/dist/components/data-display/tag/Tag.es.js.map +1 -1
- package/dist/components/floating-bar/FloatingBar.cjs.js +1 -1
- package/dist/components/floating-bar/FloatingBar.cjs.js.map +1 -1
- package/dist/components/floating-bar/FloatingBar.es.js +9 -9
- package/dist/components/floating-bar/FloatingBar.es.js.map +1 -1
- package/dist/components/forms/base-input-field/BaseInputField.cjs.js +2 -2
- package/dist/components/forms/base-input-field/BaseInputField.cjs.js.map +1 -1
- package/dist/components/forms/base-input-field/BaseInputField.es.js +42 -40
- package/dist/components/forms/base-input-field/BaseInputField.es.js.map +1 -1
- package/dist/components/forms/creatable-select/CreatableSelect.cjs.js +1 -1
- package/dist/components/forms/creatable-select/CreatableSelect.cjs.js.map +1 -1
- package/dist/components/forms/creatable-select/CreatableSelect.es.js +15 -14
- package/dist/components/forms/creatable-select/CreatableSelect.es.js.map +1 -1
- package/dist/components/forms/currency-input/CurrencyInputField.cjs.js +1 -1
- package/dist/components/forms/currency-input/CurrencyInputField.cjs.js.map +1 -1
- package/dist/components/forms/currency-input/CurrencyInputField.es.js +65 -57
- package/dist/components/forms/currency-input/CurrencyInputField.es.js.map +1 -1
- package/dist/components/forms/date-time-field/DateTimeField.cjs.js +1 -1
- package/dist/components/forms/date-time-field/DateTimeField.cjs.js.map +1 -1
- package/dist/components/forms/date-time-field/DateTimeField.es.js +33 -33
- package/dist/components/forms/date-time-field/DateTimeField.es.js.map +1 -1
- package/dist/components/forms/debounce-input/DebounceInputField.cjs.js +1 -1
- package/dist/components/forms/debounce-input/DebounceInputField.cjs.js.map +1 -1
- package/dist/components/forms/debounce-input/DebounceInputField.es.js +2 -2
- package/dist/components/forms/debounce-input/DebounceInputField.es.js.map +1 -1
- package/dist/components/forms/dynamic-data-input/DynamicDataInput.cjs.js +1 -1
- package/dist/components/forms/dynamic-data-input/DynamicDataInput.cjs.js.map +1 -1
- package/dist/components/forms/dynamic-data-input/DynamicDataInput.es.js +7 -7
- package/dist/components/forms/dynamic-data-input/DynamicDataInput.es.js.map +1 -1
- package/dist/components/forms/dynamic-data-input/DynamicDataInputField.cjs.js +1 -1
- package/dist/components/forms/dynamic-data-input/DynamicDataInputField.cjs.js.map +1 -1
- package/dist/components/forms/dynamic-data-input/DynamicDataInputField.es.js +19 -17
- package/dist/components/forms/dynamic-data-input/DynamicDataInputField.es.js.map +1 -1
- package/dist/components/forms/field-options/Item.cjs.js +1 -1
- package/dist/components/forms/field-options/Item.cjs.js.map +1 -1
- package/dist/components/forms/field-options/Item.es.js +5 -5
- package/dist/components/forms/field-options/Item.es.js.map +1 -1
- package/dist/components/forms/formula-input/FormulaInput.cjs.js +1 -1
- package/dist/components/forms/formula-input/FormulaInput.cjs.js.map +1 -1
- package/dist/components/forms/formula-input/FormulaInput.es.js +10 -10
- package/dist/components/forms/formula-input/FormulaInput.es.js.map +1 -1
- package/dist/components/forms/icon-picker/IconPicker.cjs.js +1 -1
- package/dist/components/forms/icon-picker/IconPicker.cjs.js.map +1 -1
- package/dist/components/forms/icon-picker/IconPicker.es.js +57 -42
- package/dist/components/forms/icon-picker/IconPicker.es.js.map +1 -1
- package/dist/components/forms/input-field/InputField.cjs.js.map +1 -1
- package/dist/components/forms/input-field/InputField.es.js.map +1 -1
- package/dist/components/forms/master-data-input/MasterDataInputField.cjs.js +1 -1
- package/dist/components/forms/master-data-input/MasterDataInputField.cjs.js.map +1 -1
- package/dist/components/forms/master-data-input/MasterDataInputField.es.js +60 -54
- package/dist/components/forms/master-data-input/MasterDataInputField.es.js.map +1 -1
- package/dist/components/forms/md-input/RichMarkdownInput.cjs.js +3 -3
- package/dist/components/forms/md-input/RichMarkdownInput.cjs.js.map +1 -1
- package/dist/components/forms/md-input/RichMarkdownInput.es.js +63 -63
- package/dist/components/forms/md-input/RichMarkdownInput.es.js.map +1 -1
- package/dist/components/forms/number-input-field/NumberInputField.cjs.js +1 -1
- package/dist/components/forms/number-input-field/NumberInputField.cjs.js.map +1 -1
- package/dist/components/forms/number-input-field/NumberInputField.es.js +5 -5
- package/dist/components/forms/number-input-field/NumberInputField.es.js.map +1 -1
- package/dist/components/forms/percentage-input/PercentageInputField.cjs.js +2 -2
- package/dist/components/forms/percentage-input/PercentageInputField.cjs.js.map +1 -1
- package/dist/components/forms/percentage-input/PercentageInputField.es.js +20 -20
- package/dist/components/forms/percentage-input/PercentageInputField.es.js.map +1 -1
- package/dist/components/forms/search-bar/SearchBar.cjs.js +1 -1
- package/dist/components/forms/search-bar/SearchBar.cjs.js.map +1 -1
- package/dist/components/forms/search-bar/SearchBar.es.js +16 -16
- package/dist/components/forms/search-bar/SearchBar.es.js.map +1 -1
- package/dist/components/forms/select-field/SelectField.cjs.js +2 -2
- package/dist/components/forms/select-field/SelectField.cjs.js.map +1 -1
- package/dist/components/forms/select-field/SelectField.d.ts +0 -4
- package/dist/components/forms/select-field/SelectField.es.js +203 -202
- package/dist/components/forms/select-field/SelectField.es.js.map +1 -1
- package/dist/components/forms/text-area-field/TextAreaField.cjs.js +1 -1
- package/dist/components/forms/text-area-field/TextAreaField.cjs.js.map +1 -1
- package/dist/components/forms/text-area-field/TextAreaField.es.js +14 -14
- package/dist/components/forms/text-area-field/TextAreaField.es.js.map +1 -1
- package/dist/components/forms/toggle/Toggle.cjs.js +1 -1
- package/dist/components/forms/toggle/Toggle.cjs.js.map +1 -1
- package/dist/components/forms/toggle/Toggle.es.js +59 -65
- package/dist/components/forms/toggle/Toggle.es.js.map +1 -1
- package/dist/components/navigation/accordion/Accordion.cjs.js +1 -1
- package/dist/components/navigation/accordion/Accordion.cjs.js.map +1 -1
- package/dist/components/navigation/accordion/Accordion.es.js +5 -5
- package/dist/components/navigation/accordion/Accordion.es.js.map +1 -1
- package/dist/components/navigation/stepper/Stepper.cjs.js +1 -1
- package/dist/components/navigation/stepper/Stepper.cjs.js.map +1 -1
- package/dist/components/navigation/stepper/Stepper.es.js +1 -1
- package/dist/components/navigation/stepper/Stepper.es.js.map +1 -1
- package/dist/components/navigation/tabs/TabOptions.cjs.js +1 -1
- package/dist/components/navigation/tabs/TabOptions.cjs.js.map +1 -1
- package/dist/components/navigation/tabs/TabOptions.es.js +15 -15
- package/dist/components/navigation/tabs/TabOptions.es.js.map +1 -1
- package/dist/components/navigation/tabs/TabSwitch.cjs.js +1 -1
- package/dist/components/navigation/tabs/TabSwitch.cjs.js.map +1 -1
- package/dist/components/navigation/tabs/TabSwitch.es.js +7 -7
- package/dist/components/navigation/tabs/TabSwitch.es.js.map +1 -1
- package/dist/components/navigation/tabs/Tabs.cjs.js +1 -1
- package/dist/components/navigation/tabs/Tabs.cjs.js.map +1 -1
- package/dist/components/navigation/tabs/Tabs.es.js +1 -1
- package/dist/components/navigation/tabs/Tabs.es.js.map +1 -1
- package/dist/components/tooltip/Tooltip.cjs.js +1 -1
- package/dist/components/tooltip/Tooltip.cjs.js.map +1 -1
- package/dist/components/tooltip/Tooltip.es.js +19 -19
- package/dist/components/tooltip/Tooltip.es.js.map +1 -1
- package/dist/components/user-avatar/UserAvatar.cjs.js +1 -1
- package/dist/components/user-avatar/UserAvatar.cjs.js.map +1 -1
- package/dist/components/user-avatar/UserAvatar.d.ts +1 -1
- package/dist/components/user-avatar/UserAvatar.es.js +38 -40
- package/dist/components/user-avatar/UserAvatar.es.js.map +1 -1
- package/dist/components/user-avatar/constants.cjs.js +1 -1
- package/dist/components/user-avatar/constants.cjs.js.map +1 -1
- package/dist/components/user-avatar/constants.d.ts +0 -1
- package/dist/components/user-avatar/constants.es.js +9 -10
- package/dist/components/user-avatar/constants.es.js.map +1 -1
- package/dist/design-system.css +1 -1
- package/package.json +3 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as l, jsxs as
|
|
2
|
-
import { Tooltip as
|
|
1
|
+
import { jsx as l, jsxs as O } from "react/jsx-runtime";
|
|
2
|
+
import { Tooltip as $ } from "antd";
|
|
3
3
|
import { useTableConfig as E } from "../../../../../providers/design-system-provider/hooks.es.js";
|
|
4
4
|
import K from "../../../../../_virtual/index.es.js";
|
|
5
5
|
import k from "react";
|
|
@@ -24,13 +24,13 @@ const z = ({
|
|
|
24
24
|
hasPendingEditsColumn: N,
|
|
25
25
|
rowHasPendingEdits: x
|
|
26
26
|
}) => {
|
|
27
|
-
const j = E()?.t?.("Save or cancel pending changes first") ?? "Save or cancel pending changes first", o = k.useRef(null),
|
|
27
|
+
const j = E()?.t?.("Save or cancel pending changes first") ?? "Save or cancel pending changes first", o = k.useRef(null), w = (s) => {
|
|
28
28
|
if (s.key !== "Enter") return;
|
|
29
29
|
s.preventDefault();
|
|
30
30
|
const h = s.currentTarget.form;
|
|
31
31
|
if (!h) return;
|
|
32
|
-
const
|
|
33
|
-
h.dispatchEvent(
|
|
32
|
+
const B = new Event("submit", { bubbles: !0, cancelable: !0 });
|
|
33
|
+
h.dispatchEvent(B);
|
|
34
34
|
const g = h.querySelector('button[type="submit"]');
|
|
35
35
|
g && g.click();
|
|
36
36
|
}, y = typeof r?.checkboxMetadata == "object" && r?.checkboxMetadata !== null && r?.checkboxMetadata.checkedIds?.includes(e) || r?.checkedIds?.includes(e), p = C || x || r?.checkboxMetadata?.checkedIds?.includes(e);
|
|
@@ -52,16 +52,16 @@ const z = ({
|
|
|
52
52
|
return /* @__PURE__ */ l(
|
|
53
53
|
"td",
|
|
54
54
|
{
|
|
55
|
-
className: `min-w-[40px] sticky right-0 z-30 ${m || "bg-white dark:bg-black-800"} h-
|
|
55
|
+
className: `min-w-[40px] sticky right-0 z-30 ${m || "bg-white dark:bg-black-800"} h-row`,
|
|
56
56
|
style: { left: N ? R : "0" },
|
|
57
|
-
children: /* @__PURE__ */
|
|
57
|
+
children: /* @__PURE__ */ O(
|
|
58
58
|
"div",
|
|
59
59
|
{
|
|
60
|
-
className: "absolute w-full px-2.5 h-
|
|
60
|
+
className: "absolute w-full px-2.5 h-row z-30 flex items-center",
|
|
61
61
|
style: { boxShadow: "8px 0px 8px 0px rgba(0, 0, 0, 0.02)" },
|
|
62
62
|
children: [
|
|
63
63
|
/* @__PURE__ */ l(
|
|
64
|
-
|
|
64
|
+
$,
|
|
65
65
|
{
|
|
66
66
|
title: x ? j : r?.checkboxMetadata?.tooltip && r?.checkboxMetadata?.checkedIds?.includes(e) ? r?.checkboxMetadata?.tooltip : "",
|
|
67
67
|
children: /* @__PURE__ */ l(
|
|
@@ -72,7 +72,7 @@ const z = ({
|
|
|
72
72
|
type: "checkbox",
|
|
73
73
|
className: `w-4 h-4 text-primary-600 appearance-none border border-gray-400 dark:border-neutral-400 rounded-[4px] checked:appearance-auto focus:ring-primary-500 dark:focus:ring-primary-600 focus:ring-2 cursor-pointer ${m}`,
|
|
74
74
|
onChange: (s) => r?.onItemCheck(s, e),
|
|
75
|
-
onKeyDown:
|
|
75
|
+
onKeyDown: w,
|
|
76
76
|
onFocus: () => {
|
|
77
77
|
b = e;
|
|
78
78
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxCell.es.js","sources":["../../../../../../src/components/data-display/infinite-table/body/cell/CheckboxCell.tsx"],"sourcesContent":["import { Tooltip } from 'antd';\nimport { useTableConfig } from '../../../../../providers/design-system-provider/hooks';\nimport cn from 'classnames';\nimport React from 'react';\n\nimport { CHECKBOX_PENDING_EDITS_LEFT_OFFSET } from '../../constants';\n\ntype HighlightType = 'SUCCESS' | 'WARNING' | 'ERROR';\n\ntype CheckboxMetadata = {\n checkedIds: string[];\n tooltip: string;\n highlight: HighlightType;\n};\n\ntype TCheckboxCellProps = {\n checkboxConfig: {\n checkboxMetadata: CheckboxMetadata;\n checkedIds: string[];\n selectionDisabledRowIds: CheckboxMetadata;\n onItemCheck: (event: React.ChangeEvent<HTMLInputElement>, id: string) => void;\n };\n id: string;\n rowHovering?: string;\n isDisabled?: boolean;\n is_read?: boolean;\n is_modified?: boolean;\n is_row_modified?: boolean;\n is_deleted?: boolean;\n is_added?: boolean;\n isDraggingOver?: boolean;\n showNewItem?: boolean;\n currentData?: Record<string, unknown>;\n bgColor?: string;\n is_incomplete?: boolean;\n isInlineEditing?: boolean;\n hasPendingEditsColumn?: boolean;\n rowHasPendingEdits?: boolean;\n};\n\nlet lastFocusedCheckboxId: string | null = null;\n\nconst CheckboxCellBase = ({\n checkboxConfig,\n id,\n rowHovering,\n isDisabled,\n is_read,\n is_modified,\n is_row_modified,\n is_deleted,\n is_added,\n isDraggingOver,\n showNewItem,\n currentData,\n bgColor: bgColorProp,\n is_incomplete,\n isInlineEditing,\n hasPendingEditsColumn,\n rowHasPendingEdits,\n}: TCheckboxCellProps) => {\n const tableConfig = useTableConfig();\n const pendingEditsTooltip = tableConfig?.t?.('Save or cancel pending changes first') ?? 'Save or cancel pending changes first';\n const inputRef = React.useRef<HTMLInputElement>(null);\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key !== 'Enter') return;\n event.preventDefault();\n const formEl = event.currentTarget.form;\n if (!formEl) return;\n\n const submitEvent = new Event('submit', { bubbles: true, cancelable: true });\n formEl.dispatchEvent(submitEvent);\n\n const submitBtn = formEl.querySelector<HTMLButtonElement>('button[type=\"submit\"]');\n if (submitBtn) {\n submitBtn.click();\n }\n };\n\n const isCheckedObject = typeof checkboxConfig?.checkboxMetadata === 'object' && checkboxConfig?.checkboxMetadata !== null;\n const checkedValue = (isCheckedObject && checkboxConfig?.checkboxMetadata.checkedIds?.includes(id)) || checkboxConfig?.checkedIds?.includes(id);\n const isInputDisabled = isDisabled || rowHasPendingEdits || checkboxConfig?.checkboxMetadata?.checkedIds?.includes(id);\n\n React.useLayoutEffect(() => {\n if (lastFocusedCheckboxId !== id || isInputDisabled) return;\n if (inputRef.current && document.activeElement !== inputRef.current) {\n inputRef.current.focus({ preventScroll: true });\n }\n }, [id, isInputDisabled, checkedValue]);\n\n const bgColor = cn({\n 'bg-primary-50 dark:bg-primary-900': isInlineEditing,\n 'bg-neutral-100 dark:bg-black-600': rowHovering === id && !isInlineEditing && !(is_deleted || currentData?.is_deleted) && !(is_added || currentData?.is_added),\n 'bg-error-200 dark:bg-error-900': rowHovering === id && !isInlineEditing && (is_deleted || currentData?.is_deleted),\n 'bg-success-100 dark:bg-success-800': rowHovering === id && !isInlineEditing && (is_added || currentData?.is_added),\n 'bg-primary-50 dark:bg-black-700': !is_incomplete && !is_read && showNewItem && rowHovering !== id && !isInlineEditing,\n 'bg-warning-50 dark:bg-black-500':\n (is_incomplete || is_modified || is_row_modified || currentData?.is_row_modified) && rowHovering !== id && !isInlineEditing,\n 'bg-error-100 dark:bg-error-975': (is_deleted || currentData?.is_deleted) && rowHovering !== id && !isInlineEditing,\n 'bg-success-50 dark:bg-success-900': (is_added || currentData?.is_added) && rowHovering !== id && !isInlineEditing,\n 'bg-primary-50': isDraggingOver && !isInlineEditing,\n ...(bgColorProp && !isInlineEditing && { [bgColorProp]: true }),\n });\n\n return (\n <td\n className={`min-w-[40px] sticky right-0 z-30 ${bgColor ? bgColor : 'bg-white dark:bg-black-800'} h-
|
|
1
|
+
{"version":3,"file":"CheckboxCell.es.js","sources":["../../../../../../src/components/data-display/infinite-table/body/cell/CheckboxCell.tsx"],"sourcesContent":["import { Tooltip } from 'antd';\nimport { useTableConfig } from '../../../../../providers/design-system-provider/hooks';\nimport cn from 'classnames';\nimport React from 'react';\n\nimport { CHECKBOX_PENDING_EDITS_LEFT_OFFSET } from '../../constants';\n\ntype HighlightType = 'SUCCESS' | 'WARNING' | 'ERROR';\n\ntype CheckboxMetadata = {\n checkedIds: string[];\n tooltip: string;\n highlight: HighlightType;\n};\n\ntype TCheckboxCellProps = {\n checkboxConfig: {\n checkboxMetadata: CheckboxMetadata;\n checkedIds: string[];\n selectionDisabledRowIds: CheckboxMetadata;\n onItemCheck: (event: React.ChangeEvent<HTMLInputElement>, id: string) => void;\n };\n id: string;\n rowHovering?: string;\n isDisabled?: boolean;\n is_read?: boolean;\n is_modified?: boolean;\n is_row_modified?: boolean;\n is_deleted?: boolean;\n is_added?: boolean;\n isDraggingOver?: boolean;\n showNewItem?: boolean;\n currentData?: Record<string, unknown>;\n bgColor?: string;\n is_incomplete?: boolean;\n isInlineEditing?: boolean;\n hasPendingEditsColumn?: boolean;\n rowHasPendingEdits?: boolean;\n};\n\nlet lastFocusedCheckboxId: string | null = null;\n\nconst CheckboxCellBase = ({\n checkboxConfig,\n id,\n rowHovering,\n isDisabled,\n is_read,\n is_modified,\n is_row_modified,\n is_deleted,\n is_added,\n isDraggingOver,\n showNewItem,\n currentData,\n bgColor: bgColorProp,\n is_incomplete,\n isInlineEditing,\n hasPendingEditsColumn,\n rowHasPendingEdits,\n}: TCheckboxCellProps) => {\n const tableConfig = useTableConfig();\n const pendingEditsTooltip = tableConfig?.t?.('Save or cancel pending changes first') ?? 'Save or cancel pending changes first';\n const inputRef = React.useRef<HTMLInputElement>(null);\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key !== 'Enter') return;\n event.preventDefault();\n const formEl = event.currentTarget.form;\n if (!formEl) return;\n\n const submitEvent = new Event('submit', { bubbles: true, cancelable: true });\n formEl.dispatchEvent(submitEvent);\n\n const submitBtn = formEl.querySelector<HTMLButtonElement>('button[type=\"submit\"]');\n if (submitBtn) {\n submitBtn.click();\n }\n };\n\n const isCheckedObject = typeof checkboxConfig?.checkboxMetadata === 'object' && checkboxConfig?.checkboxMetadata !== null;\n const checkedValue = (isCheckedObject && checkboxConfig?.checkboxMetadata.checkedIds?.includes(id)) || checkboxConfig?.checkedIds?.includes(id);\n const isInputDisabled = isDisabled || rowHasPendingEdits || checkboxConfig?.checkboxMetadata?.checkedIds?.includes(id);\n\n React.useLayoutEffect(() => {\n if (lastFocusedCheckboxId !== id || isInputDisabled) return;\n if (inputRef.current && document.activeElement !== inputRef.current) {\n inputRef.current.focus({ preventScroll: true });\n }\n }, [id, isInputDisabled, checkedValue]);\n\n const bgColor = cn({\n 'bg-primary-50 dark:bg-primary-900': isInlineEditing,\n 'bg-neutral-100 dark:bg-black-600': rowHovering === id && !isInlineEditing && !(is_deleted || currentData?.is_deleted) && !(is_added || currentData?.is_added),\n 'bg-error-200 dark:bg-error-900': rowHovering === id && !isInlineEditing && (is_deleted || currentData?.is_deleted),\n 'bg-success-100 dark:bg-success-800': rowHovering === id && !isInlineEditing && (is_added || currentData?.is_added),\n 'bg-primary-50 dark:bg-black-700': !is_incomplete && !is_read && showNewItem && rowHovering !== id && !isInlineEditing,\n 'bg-warning-50 dark:bg-black-500':\n (is_incomplete || is_modified || is_row_modified || currentData?.is_row_modified) && rowHovering !== id && !isInlineEditing,\n 'bg-error-100 dark:bg-error-975': (is_deleted || currentData?.is_deleted) && rowHovering !== id && !isInlineEditing,\n 'bg-success-50 dark:bg-success-900': (is_added || currentData?.is_added) && rowHovering !== id && !isInlineEditing,\n 'bg-primary-50': isDraggingOver && !isInlineEditing,\n ...(bgColorProp && !isInlineEditing && { [bgColorProp]: true }),\n });\n\n return (\n <td\n className={`min-w-[40px] sticky right-0 z-30 ${bgColor ? bgColor : 'bg-white dark:bg-black-800'} h-row`}\n style={{ left: hasPendingEditsColumn ? CHECKBOX_PENDING_EDITS_LEFT_OFFSET : '0' }}\n >\n <div\n className={`absolute w-full px-2.5 h-row z-30 flex items-center`}\n style={{ boxShadow: '8px 0px 8px 0px rgba(0, 0, 0, 0.02)' }}\n >\n <Tooltip\n title={\n rowHasPendingEdits\n ? pendingEditsTooltip\n : checkboxConfig?.checkboxMetadata?.tooltip && checkboxConfig?.checkboxMetadata?.checkedIds?.includes(id)\n ? checkboxConfig?.checkboxMetadata?.tooltip\n : ''\n }\n >\n <input\n ref={inputRef}\n key={`checkbox-table-search-${id}`}\n id={`checkbox-table-search-${id}`}\n type='checkbox'\n className={`w-4 h-4 text-primary-600 appearance-none border border-gray-400 dark:border-neutral-400 rounded-[4px] checked:appearance-auto focus:ring-primary-500 dark:focus:ring-primary-600 focus:ring-2 cursor-pointer ${bgColor}`}\n onChange={(event) => checkboxConfig?.onItemCheck(event, id)}\n onKeyDown={handleKeyDown}\n onFocus={() => { lastFocusedCheckboxId = id; }}\n onBlur={() => { if (lastFocusedCheckboxId === id) lastFocusedCheckboxId = null; }}\n checked={checkedValue}\n disabled={isInputDisabled}\n />\n </Tooltip>\n <label htmlFor='checkbox-table-search-1' className='sr-only dark:text-neutral-200'>\n {'checkbox'}\n </label>\n </div>\n </td>\n );\n};\n\nexport const CheckboxCell = React.memo(CheckboxCellBase);\n"],"names":["lastFocusedCheckboxId","CheckboxCellBase","checkboxConfig","id","rowHovering","isDisabled","is_read","is_modified","is_row_modified","is_deleted","is_added","isDraggingOver","showNewItem","currentData","bgColorProp","is_incomplete","isInlineEditing","hasPendingEditsColumn","rowHasPendingEdits","pendingEditsTooltip","useTableConfig","inputRef","React","handleKeyDown","event","formEl","submitEvent","submitBtn","checkedValue","isInputDisabled","bgColor","cn","jsx","CHECKBOX_PENDING_EDITS_LEFT_OFFSET","jsxs","Tooltip","CheckboxCell"],"mappings":";;;;;;AAwCA,IAAIA,IAAuC;AAE3C,MAAMC,IAAmB,CAAC;AAAA,EACxB,gBAAAC;AAAA,EACA,IAAAC;AAAA,EACA,aAAAC;AAAA,EACA,YAAAC;AAAA,EACA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B,IAAwBG;AAAA,oBAAI;AAAA,oBAC7C,QAAQ,MAAM;AAAE,sBAAIH,MAA0BG,MAAIH,IAAwB;AAAA,oBAAM;AAAA,oBAChF,SAAS4B;AAAA,oBACT,UAAUC;AAAA,kBAAA;AAAA,kBATL,yBAAyB1B,CAAE;AAAA,gBAAA;AAAA,cAUlC;AAAA,YAAA;AAAA,8BAED,SAAA,EAAM,SAAQ,2BAA0B,WAAU,iCAChD,UAAA,WAAA,CACH;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN,GAEaiC,IAAed,EAAM,KAAKrB,CAAgB;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),Oe=require("../../../../../hooks/useTheme.cjs.js"),D=require("../../../../../utils/formatters.cjs.js"),Ve=require("../../../../../constants/table.cjs.js"),qe=require("../../../../../providers/design-system-provider/hooks.cjs.js"),U=require("../../../../tooltip/Tooltip.cjs.js"),ze=require("../../../typography/Typography.cjs.js"),Ae=require("@mui/icons-material"),k=require("../../../../../_virtual/index.cjs.js"),a=require("react"),Fe=require("react-router-dom"),Ee=require("../../context.cjs.js"),Ke=require("./InlineEditField.cjs.js"),C=require("../../constants.cjs.js"),g=require("../../../../icon/icons.generated.cjs.js");let Y;const re=e=>{const t=Number(e);if(Number.isNaN(t)||e===null||e===void 0)return"0ms";if(t>=864e5){const h=Math.floor(t/864e5),f=Math.floor(t%864e5/36e5),i=Math.floor(t%36e5/6e4),b=Math.floor(t%6e4/1e3);return`${h}d ${f}h ${i}m ${b}s`}if(t>=36e5){const h=Math.floor(t/36e5),f=Math.floor(t%36e5/6e4),i=Math.floor(t%6e4/1e3);return`${h}h ${f}m ${i}s`}if(t>=6e4){const h=Math.floor(t/6e4),f=Math.floor(t%6e4/1e3);return`${h}m ${f}s`}return t>=1e3?`${(t/1e3).toFixed(2)}s`:`${t}ms`},We=({children:e,withLink:t,linkTo:h,rowData:f,disableRowClick:i})=>t&&!i?o.jsx(Fe.Link,{to:h?.(f?.id,f)||"",children:e}):e,Ue=({cell:e,id:t,nextWidthSum:h,isLastCell:f,rowHovering:i,index:b,isFirstStickyCell:ae,handleCellClick:se,currentData:x,highlightSubstring:M,is_read:ne,is_modified:ue,is_row_modified:ie,is_deleted:R,is_added:I,level:y,inlineEditing:v,isInlineEditing:c,setRowHovering:$,handleCellValueChange:le,cellRef:ce,handleUpdateCellData:me,registerValidation:de,loadingExpand:fe,toggleRowExpand:B,isDraggingOver:pe,isLoading:_,is_incomplete:X,pendingEdit:s,hasPendingEdit:l,pendingValidationError:he})=>{const{cascadingTableConfig:G,originalsOnly:we,maxLevel:be,showNewItem:ye,expandedRows:xe,rowLinkConfig:O,multiSelectConfig:ve,cellEditing:V,cellEditingValue:q,allowInlineEdit:H,fieldOperationLoading:ke,pendingEdits:Te,selectedRowId:z}=a.useContext(Ee.TableContext),Ce=z!=null&&String(z)===String(t),ge=qe.useTableConfig(),A=(e?.column?.key?e?.row?.original?.__cellMetadata?.[e.column.key]:void 0)?.is_locked??e?.column?.is_locked,F=(e?.column?.key?Te?.[t]?.[e.column.key]?.validationError:null)||he||null,P=v===e.column.key&&e?.column?.canEdit&&!A&&!e?.column?.is_disabled,_e=ke===`${t}-${e?.column?.id}`,{theme:je}=Oe.useTheme(),Ne=je==="dark",Le=a.useCallback(()=>$(t),[$,t]),Se=a.useCallback(()=>$(null),[$]),j=ge?.formatDuration,[n,p]=a.useState(e?.column?.dataType==="duration"&&e?.value?j?j(e.value):re(e.value):e.value),[w,J]=a.useState(null),[E,De]=a.useState(!1),[Me,Q]=a.useState(!1),[$e,Z]=a.useState(!1),N=a.useRef(null),L=a.useRef(),S=a.useRef(),{selectedColumnIds:ee=[]}=ve||{},oe=!Object.prototype.hasOwnProperty.call(e?.column?.meta??{},"shouldHighlight")||e?.column?.meta?.shouldHighlight,te=a.useCallback(()=>{N.current&&De(N.current.scrollWidth>N.current.clientWidth)},[]),K=a.useCallback(r=>{L.current&&clearTimeout(L.current),r?Q(!0):L.current=setTimeout(()=>Q(!1),200)},[]),W=a.useCallback(r=>{S.current&&clearTimeout(S.current),r?Z(!0):S.current=setTimeout(()=>Z(!1),200)},[]),T=k({"bg-amber-100 dark:bg-amber-900/30":l,"bg-neutral-100 dark:bg-black-600":i===t&&!c&&!l&&!(R||x?.is_deleted)&&!(I||x?.is_added),"bg-error-200 dark:bg-error-900":i===t&&!c&&!l&&(R||x?.is_deleted),"bg-success-100 dark:bg-success-800":i===t&&!c&&!l&&(I||x?.is_added),"bg-primary-50 dark:bg-black-700":!X&&!ne&&ye&&!_&&i!==t&&!c&&!l,"bg-warning-50 dark:bg-black-500":(X||ue||ie||x?.is_row_modified)&&!_&&i!==t&&!c&&!l,"bg-error-100 dark:bg-error-975":(R||x?.is_deleted)&&!_&&i!==t&&!c&&!l,"bg-success-50 dark:bg-success-900":(I||x?.is_added)&&!_&&i!==t&&!c&&!l,"bg-primary-50 dark:bg-primary-900":(pe||c)&&!l,"bg-primary-50 dark:bg-primary-800":ee?.includes(e.column.id)&&!c&&!l,"bg-primary-100 dark:bg-primary-950":Ce&&i!==t&&!c&&!l&&!_,[Ve.getTableRowBgClassNamesByStatus[e?.row?.original?.__rowBgStatus]]:e?.row?.original?.__rowBgStatus&&!c&&!l}),Re=r=>{e.column?.disableRowClick||se(r)};a.useEffect(()=>(e?.row?.original?.status==="running"&&e.column?.dataType==="duration"&&(Y=setInterval(()=>{const u=new Date(D.formatDate(e?.row?.original?.created_at||e?.row?.original?.executed_on,{withTime:!0,format:"yyyy-MM-dd HH:mm:ss"})),d=Math.abs(new Date().getTime()-new Date(u).getTime());p(j?j(d):re(d))},500)),()=>{Y&&clearInterval(Y)}),[n,e.value,e?.row?.original?.created_at,e?.row?.original?.executed_on,e?.row?.original?.status,e.column?.dataType,j]),a.useEffect(()=>{(e?.column?.tooltipCellKey||e?.column?.type?.toLowerCase()==="url")&&(e?.column?.type?.toLowerCase()==="url"?J(e?.value):J(e?.row?.original?.[String(e?.column?.tooltipCellKey)]))},[e?.column?.tooltipCellKey,e?.row?.original,e?.column?.type,e?.value]),a.useEffect(()=>{if(e?.column?.type?.toLowerCase()==="currency")if(s?.value!==void 0){const r=e?.row?.original?.__rawData,u=e?.column?.Header,d=s?.meta?.currency_code||r?.[u]?.currency_code||"USD";p(D.formatCurrency(s.value,d))}else{const r=e?.row?.original?.__rawData,u=e?.column?.Header;p(D.formatCurrency(e?.value,r?.[u]?.currency_code||"USD"))}},[e?.value,e?.column?.type,e?.column?.Header,e?.row?.original?.__rawData,s?.value,s?.meta?.currency_code]),a.useEffect(()=>{e?.column?.type?.toLowerCase()==="percentage"&&(s?.value!==void 0?p(s.value?.toString()+"%"||""):p(e?.value?.toString()+"%"||""))},[e?.value,e?.column?.type,s?.value]),a.useEffect(()=>{const r=e?.column?.type?.toLowerCase()||"";if(["date","datetime"].includes(r))if(s?.value!==void 0){const u=r==="datetime",d=D.formatDate(s.value,{withTime:u,skipTimezone:!0});p(d||s.value)}else p(e.value)},[e?.value,e?.column?.type,s?.value]),a.useEffect(()=>{const r=e?.column?.type?.toLowerCase()||"";["currency","percentage","duration","boolean","date","datetime"].includes(r)||(s?.value!==void 0?p(s.value):e?.column?.dataType!=="duration"&&p(e.value))},[e?.value,e?.column?.type,e?.column?.dataType,s?.value]),a.useEffect(()=>{if(e?.column?.type?.toLowerCase()==="boolean"&&H){const r=s?.value!==void 0?s.value:e?.value;p(r===!0||r==="true"||r==="True"||r==="Yes"||r===1?"Yes":"No")}},[e?.value,e?.column?.type,H,s?.value]),a.useEffect(()=>()=>{L.current&&clearTimeout(L.current),S.current&&clearTimeout(S.current)},[]);const m=a.isValidElement(n);return o.jsxs("td",{id:e.value,"data-column-key":e?.column?.key,...e.getCellProps(),onClick:O?.isEnabled?void 0:Re,className:k("h-10",{"sticky left-0":e?.column?.sticky,relative:!e?.column?.sticky,"w-full":f,"overflow-visible":v===e.column.key,"overflow-x-hidden overflow-y-visible":v!==e.column.key&&m,"overflow-hidden":v!==e.column.key&&!m},F&&!P?"outline outline-2 outline-error-500 -outline-offset-2 z-[5]":"",`${T||"bg-white dark:bg-black-800"}`),style:{minWidth:`${e.column.width}px`,maxWidth:`${e.column.width}px`,right:e?.column?.sticky?`${h}px`:C.CELL_DEFAULT_RIGHT_OFFSET,paddingLeft:y>0&&b===0?`${y*C.CELL_INDENT_PER_LEVEL_PX}px`:void 0},onMouseEnter:Le,onMouseLeave:Se,children:[o.jsx(We,{withLink:O?.isEnabled,linkTo:O?.linkTo||void 0,rowData:e?.row?.original,disableRowClick:e?.column?.disableRowClick,children:(Array.isArray(V)?V.includes(`${t}-${e?.column?.id}`):V===`${t}-${e?.column?.id}`)?o.jsxs("div",{className:"h-10 top-0 font-medium font-inter w-full absolute flex items-center px-4",children:[o.jsx("span",{className:"text-neutral-400 dark:text-black-400 truncate",children:(()=>{const r=`${t}-${e?.column?.id}`,u=typeof q=="object"?q?.[r]:q,d=e?.column?.type?.toLowerCase();if(d==="boolean")return u===!0||u==="true"||u==="True"?"Yes":"No";if((d==="date"||d==="datetime")&&u){const Ie=d==="datetime";return D.formatDate(u,{withTime:Ie,skipTimezone:!0})||String(u)}return u!=null?String(u):n})()}),o.jsx("div",{className:"ml-2 flex items-center gap-1.5",children:o.jsx(g.LoadingSpinnerIcon,{className:"spinner text-neutral-600 dark:text-white",size:12})})]}):v===e.column.key&&e?.column?.canEdit&&!A&&!e?.column?.is_disabled?o.jsx("div",{className:"h-10 w-full absolute top-0 left-0 flex items-center",style:{marginLeft:y>0&&b===0?`-${y*C.CELL_INDENT_PER_LEVEL_PX}px`:void 0,width:y>0&&b===0?`calc(100% + ${y*C.CELL_INDENT_PER_LEVEL_PX}px)`:"100%"},children:o.jsx(Ke.InlineEditField,{cell:e,id:t,inlineEditing:v,cellRef:ce,handleCellValueChange:le,handleUpdateCellData:me,registerValidation:de})}):o.jsxs(o.Fragment,{children:[y>0&&b===0&&o.jsx("div",{className:"h-10 border-l border-neutral-300 dark:border-black-600 ml-2"}),o.jsx("div",{className:"min-h-6",children:o.jsx(U,{title:w&&e?.column?.type?.toLowerCase()!=="url"?w:void 0,hideTooltip:!w||e?.column?.type?.toLowerCase()==="url",delayShow:!0,placement:"top",children:o.jsxs("div",{className:k(`h-10 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"}`,m?"overflow-x-hidden overflow-y-visible":"overflow-x-hidden",{"border border-b-0 border-t-0 border-primary-600 dark:border-blue-800":ee?.includes(e.column.id)}),style:e?.column?.sticky&&ae?{boxShadow:Ne?C.CELL_STICKY_SHADOW_DARK:C.CELL_STICKY_SHADOW_LIGHT}:{},children:[G?.isCascading&&!we&&b===0&&o.jsx("div",{className:k("w-[22px] h-10 flex items-center px-4",`${T||"bg-white dark:bg-black-800"}`),id:"cascading",children:be>y&&(e?.row?.original?.__has_children||G?.showAllDropdown)&&o.jsx("div",{children:fe?o.jsx(g.LoadingSpinnerIcon,{className:"text-neutral-600 dark:text-white",size:8}):o.jsx("div",{children:xe?.[t]?.isOpen?o.jsx(g.KeyboardArrowDownIcon,{size:20,className:"text-neutral-400 dark:text-neutral-400",onClick:r=>{B(),r.stopPropagation()}}):o.jsx(g.KeyboardArrowRightFilledIcon,{size:20,className:"text-neutral-400 dark:text-neutral-400",onClick:r=>{B(),r.stopPropagation()}})})})}),e?.column?.type?.toLowerCase()==="url"&&w?o.jsx(U,{title:o.jsx("div",{onMouseEnter:()=>K(!0),onMouseLeave:()=>K(!1),children:o.jsx("a",{href:w,target:"_blank",rel:"noopener noreferrer",onClick:r=>r.stopPropagation(),children:o.jsxs("div",{className:"flex gap-1 items-center w-full",children:[o.jsx("div",{className:"w-4 h-4",children:o.jsx(g.LinkIcon,{height:16,width:16})}),o.jsx(ze.Typography,{variant:"medium",size:"small",className:"truncate",appearance:"custom",children:w}),o.jsx(Ae.OpenInNewRounded,{sx:{height:"16px",width:"16px",color:"#016DCF"}})]})})}),placement:"top",open:Me,onOpenChange:K,className:"block w-full min-w-0 overflow-hidden",children:o.jsx("div",{className:"w-full h-full flex items-center px-4 min-w-0 overflow-hidden text-primary-400",children:o.jsx("span",{ref:N,onMouseEnter:te,className:"truncate w-full",children:M&&oe&&!a.isValidElement(n)&&typeof n!="object"?M(n):n})})}):o.jsx(U,{title:E&&n&&!m?o.jsx("div",{onMouseEnter:()=>W(!0),onMouseLeave:()=>W(!1),className:"max-h-96 overflow-y-auto whitespace-pre-wrap break-words no-scroll",children:String(n)}):void 0,placement:"top",delayShow:!0,hideTooltip:!!w,open:E&&!w&&!m?$e:void 0,onOpenChange:E&&!w&&!m?W:void 0,className:k("block w-full min-w-0",m?"overflow-x-hidden overflow-y-visible":"overflow-hidden"),children:o.jsx("div",{className:k("w-full h-full flex items-center px-4 min-w-0",m?"overflow-x-hidden overflow-y-visible":"overflow-hidden"),children:o.jsx("span",{ref:m?void 0:N,onMouseEnter:m?void 0:te,className:k(m?"flex min-w-0 max-w-full items-center justify-start gap-1":"truncate w-full"),children:M&&oe&&!a.isValidElement(n)&&typeof n!="object"?M(n):a.isValidElement(n)?typeof n.type=="string"?n:a.cloneElement(n,{...n.props,containerWidth:e.column.width}):n})})})]})})})]})}),F&&!P&&o.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-10 flex items-end pointer-events-none z-[5]",children:o.jsx("div",{className:"w-full bg-error-50 dark:bg-error-975 px-1.5 py-0.5 truncate",children:o.jsx("span",{className:"text-error-600 text-2xs font-medium leading-none",children:F})})}),_e&&!(v===e.column.key&&e?.column?.canEdit&&!A&&!e?.column?.is_disabled)&&o.jsx("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:o.jsx(g.LoadingSpinnerIcon,{className:"text-primary-600 dark:text-white",size:8})})]},b)},Ye=a.memo(Ue);exports.DataCell=Ye;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),Oe=require("../../../../../hooks/useTheme.cjs.js"),D=require("../../../../../utils/formatters.cjs.js"),Ve=require("../../../../../constants/table.cjs.js"),qe=require("../../../../../providers/design-system-provider/hooks.cjs.js"),U=require("../../../../tooltip/Tooltip.cjs.js"),ze=require("../../../typography/Typography.cjs.js"),Ae=require("@mui/icons-material"),k=require("../../../../../_virtual/index.cjs.js"),a=require("react"),Fe=require("react-router-dom"),Ee=require("../../context.cjs.js"),Ke=require("./InlineEditField.cjs.js"),C=require("../../constants.cjs.js"),g=require("../../../../icon/icons.generated.cjs.js");let Y;const re=e=>{const t=Number(e);if(Number.isNaN(t)||e===null||e===void 0)return"0ms";if(t>=864e5){const w=Math.floor(t/864e5),f=Math.floor(t%864e5/36e5),i=Math.floor(t%36e5/6e4),b=Math.floor(t%6e4/1e3);return`${w}d ${f}h ${i}m ${b}s`}if(t>=36e5){const w=Math.floor(t/36e5),f=Math.floor(t%36e5/6e4),i=Math.floor(t%6e4/1e3);return`${w}h ${f}m ${i}s`}if(t>=6e4){const w=Math.floor(t/6e4),f=Math.floor(t%6e4/1e3);return`${w}m ${f}s`}return t>=1e3?`${(t/1e3).toFixed(2)}s`:`${t}ms`},We=({children:e,withLink:t,linkTo:w,rowData:f,disableRowClick:i})=>t&&!i?o.jsx(Fe.Link,{to:w?.(f?.id,f)||"",children:e}):e,Ue=({cell:e,id:t,nextWidthSum:w,isLastCell:f,rowHovering:i,index:b,isFirstStickyCell:ae,handleCellClick:se,currentData:x,highlightSubstring:M,is_read:ne,is_modified:ue,is_row_modified:ie,is_deleted:R,is_added:I,level:y,inlineEditing:v,isInlineEditing:c,setRowHovering:$,handleCellValueChange:le,cellRef:ce,handleUpdateCellData:me,registerValidation:de,loadingExpand:fe,toggleRowExpand:B,isDraggingOver:pe,isLoading:_,is_incomplete:X,pendingEdit:s,hasPendingEdit:l,pendingValidationError:we})=>{const{cascadingTableConfig:G,originalsOnly:he,maxLevel:be,showNewItem:ye,expandedRows:xe,rowLinkConfig:O,multiSelectConfig:ve,cellEditing:V,cellEditingValue:q,allowInlineEdit:H,fieldOperationLoading:ke,pendingEdits:Te,selectedRowId:z}=a.useContext(Ee.TableContext),Ce=z!=null&&String(z)===String(t),ge=qe.useTableConfig(),A=(e?.column?.key?e?.row?.original?.__cellMetadata?.[e.column.key]:void 0)?.is_locked??e?.column?.is_locked,F=(e?.column?.key?Te?.[t]?.[e.column.key]?.validationError:null)||we||null,P=v===e.column.key&&e?.column?.canEdit&&!A&&!e?.column?.is_disabled,_e=ke===`${t}-${e?.column?.id}`,{theme:je}=Oe.useTheme(),Ne=je==="dark",Le=a.useCallback(()=>$(t),[$,t]),Se=a.useCallback(()=>$(null),[$]),j=ge?.formatDuration,[n,p]=a.useState(e?.column?.dataType==="duration"&&e?.value?j?j(e.value):re(e.value):e.value),[h,J]=a.useState(null),[E,De]=a.useState(!1),[Me,Q]=a.useState(!1),[$e,Z]=a.useState(!1),N=a.useRef(null),L=a.useRef(),S=a.useRef(),{selectedColumnIds:ee=[]}=ve||{},oe=!Object.prototype.hasOwnProperty.call(e?.column?.meta??{},"shouldHighlight")||e?.column?.meta?.shouldHighlight,te=a.useCallback(()=>{N.current&&De(N.current.scrollWidth>N.current.clientWidth)},[]),K=a.useCallback(r=>{L.current&&clearTimeout(L.current),r?Q(!0):L.current=setTimeout(()=>Q(!1),200)},[]),W=a.useCallback(r=>{S.current&&clearTimeout(S.current),r?Z(!0):S.current=setTimeout(()=>Z(!1),200)},[]),T=k({"bg-amber-100 dark:bg-amber-900/30":l,"bg-neutral-100 dark:bg-black-600":i===t&&!c&&!l&&!(R||x?.is_deleted)&&!(I||x?.is_added),"bg-error-200 dark:bg-error-900":i===t&&!c&&!l&&(R||x?.is_deleted),"bg-success-100 dark:bg-success-800":i===t&&!c&&!l&&(I||x?.is_added),"bg-primary-50 dark:bg-black-700":!X&&!ne&&ye&&!_&&i!==t&&!c&&!l,"bg-warning-50 dark:bg-black-500":(X||ue||ie||x?.is_row_modified)&&!_&&i!==t&&!c&&!l,"bg-error-100 dark:bg-error-975":(R||x?.is_deleted)&&!_&&i!==t&&!c&&!l,"bg-success-50 dark:bg-success-900":(I||x?.is_added)&&!_&&i!==t&&!c&&!l,"bg-primary-50 dark:bg-primary-900":(pe||c)&&!l,"bg-primary-50 dark:bg-primary-800":ee?.includes(e.column.id)&&!c&&!l,"bg-primary-100 dark:bg-primary-950":Ce&&i!==t&&!c&&!l&&!_,[Ve.getTableRowBgClassNamesByStatus[e?.row?.original?.__rowBgStatus]]:e?.row?.original?.__rowBgStatus&&!c&&!l}),Re=r=>{e.column?.disableRowClick||se(r)};a.useEffect(()=>(e?.row?.original?.status==="running"&&e.column?.dataType==="duration"&&(Y=setInterval(()=>{const u=new Date(D.formatDate(e?.row?.original?.created_at||e?.row?.original?.executed_on,{withTime:!0,format:"yyyy-MM-dd HH:mm:ss"})),d=Math.abs(new Date().getTime()-new Date(u).getTime());p(j?j(d):re(d))},500)),()=>{Y&&clearInterval(Y)}),[n,e.value,e?.row?.original?.created_at,e?.row?.original?.executed_on,e?.row?.original?.status,e.column?.dataType,j]),a.useEffect(()=>{(e?.column?.tooltipCellKey||e?.column?.type?.toLowerCase()==="url")&&(e?.column?.type?.toLowerCase()==="url"?J(e?.value):J(e?.row?.original?.[String(e?.column?.tooltipCellKey)]))},[e?.column?.tooltipCellKey,e?.row?.original,e?.column?.type,e?.value]),a.useEffect(()=>{if(e?.column?.type?.toLowerCase()==="currency")if(s?.value!==void 0){const r=e?.row?.original?.__rawData,u=e?.column?.Header,d=s?.meta?.currency_code||r?.[u]?.currency_code||"USD";p(D.formatCurrency(s.value,d))}else{const r=e?.row?.original?.__rawData,u=e?.column?.Header;p(D.formatCurrency(e?.value,r?.[u]?.currency_code||"USD"))}},[e?.value,e?.column?.type,e?.column?.Header,e?.row?.original?.__rawData,s?.value,s?.meta?.currency_code]),a.useEffect(()=>{e?.column?.type?.toLowerCase()==="percentage"&&(s?.value!==void 0?p(s.value?.toString()+"%"||""):p(e?.value?.toString()+"%"||""))},[e?.value,e?.column?.type,s?.value]),a.useEffect(()=>{const r=e?.column?.type?.toLowerCase()||"";if(["date","datetime"].includes(r))if(s?.value!==void 0){const u=r==="datetime",d=D.formatDate(s.value,{withTime:u,skipTimezone:!0});p(d||s.value)}else p(e.value)},[e?.value,e?.column?.type,s?.value]),a.useEffect(()=>{const r=e?.column?.type?.toLowerCase()||"";["currency","percentage","duration","boolean","date","datetime"].includes(r)||(s?.value!==void 0?p(s.value):e?.column?.dataType!=="duration"&&p(e.value))},[e?.value,e?.column?.type,e?.column?.dataType,s?.value]),a.useEffect(()=>{if(e?.column?.type?.toLowerCase()==="boolean"&&H){const r=s?.value!==void 0?s.value:e?.value;p(r===!0||r==="true"||r==="True"||r==="Yes"||r===1?"Yes":"No")}},[e?.value,e?.column?.type,H,s?.value]),a.useEffect(()=>()=>{L.current&&clearTimeout(L.current),S.current&&clearTimeout(S.current)},[]);const m=a.isValidElement(n);return o.jsxs("td",{id:e.value,"data-column-key":e?.column?.key,...e.getCellProps(),onClick:O?.isEnabled?void 0:Re,className:k("h-row",{"sticky left-0":e?.column?.sticky,relative:!e?.column?.sticky,"w-full":f,"overflow-visible":v===e.column.key,"overflow-x-hidden overflow-y-visible":v!==e.column.key&&m,"overflow-hidden":v!==e.column.key&&!m},F&&!P?"outline outline-2 outline-error-500 -outline-offset-2 z-[5]":"",`${T||"bg-white dark:bg-black-800"}`),style:{minWidth:`${e.column.width}px`,maxWidth:`${e.column.width}px`,right:e?.column?.sticky?`${w}px`:C.CELL_DEFAULT_RIGHT_OFFSET,paddingLeft:y>0&&b===0?`${y*C.CELL_INDENT_PER_LEVEL_PX}px`:void 0},onMouseEnter:Le,onMouseLeave:Se,children:[o.jsx(We,{withLink:O?.isEnabled,linkTo:O?.linkTo||void 0,rowData:e?.row?.original,disableRowClick:e?.column?.disableRowClick,children:(Array.isArray(V)?V.includes(`${t}-${e?.column?.id}`):V===`${t}-${e?.column?.id}`)?o.jsxs("div",{className:"h-row top-0 font-medium font-inter w-full absolute flex items-center px-4",children:[o.jsx("span",{className:"text-neutral-400 dark:text-black-400 truncate",children:(()=>{const r=`${t}-${e?.column?.id}`,u=typeof q=="object"?q?.[r]:q,d=e?.column?.type?.toLowerCase();if(d==="boolean")return u===!0||u==="true"||u==="True"?"Yes":"No";if((d==="date"||d==="datetime")&&u){const Ie=d==="datetime";return D.formatDate(u,{withTime:Ie,skipTimezone:!0})||String(u)}return u!=null?String(u):n})()}),o.jsx("div",{className:"ml-2 flex items-center gap-1.5",children:o.jsx(g.LoadingSpinnerIcon,{className:"spinner text-neutral-600 dark:text-white",size:12})})]}):v===e.column.key&&e?.column?.canEdit&&!A&&!e?.column?.is_disabled?o.jsx("div",{className:"h-row w-full absolute top-0 left-0 flex items-center",style:{marginLeft:y>0&&b===0?`-${y*C.CELL_INDENT_PER_LEVEL_PX}px`:void 0,width:y>0&&b===0?`calc(100% + ${y*C.CELL_INDENT_PER_LEVEL_PX}px)`:"100%"},children:o.jsx(Ke.InlineEditField,{cell:e,id:t,inlineEditing:v,cellRef:ce,handleCellValueChange:le,handleUpdateCellData:me,registerValidation:de})}):o.jsxs(o.Fragment,{children:[y>0&&b===0&&o.jsx("div",{className:"h-row border-l border-neutral-300 dark:border-black-600 ml-2"}),o.jsx("div",{className:"min-h-6",children:o.jsx(U,{title:h&&e?.column?.type?.toLowerCase()!=="url"?h:void 0,hideTooltip:!h||e?.column?.type?.toLowerCase()==="url",delayShow:!0,placement:"top",children:o.jsxs("div",{className:k(`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"}`,m?"overflow-x-hidden overflow-y-visible":"overflow-x-hidden",{"border border-b-0 border-t-0 border-primary-600 dark:border-blue-800":ee?.includes(e.column.id)}),style:e?.column?.sticky&&ae?{boxShadow:Ne?C.CELL_STICKY_SHADOW_DARK:C.CELL_STICKY_SHADOW_LIGHT}:{},children:[G?.isCascading&&!he&&b===0&&o.jsx("div",{className:k("w-[22px] h-row flex items-center px-4",`${T||"bg-white dark:bg-black-800"}`),id:"cascading",children:be>y&&(e?.row?.original?.__has_children||G?.showAllDropdown)&&o.jsx("div",{children:fe?o.jsx(g.LoadingSpinnerIcon,{className:"text-neutral-600 dark:text-white",size:8}):o.jsx("div",{children:xe?.[t]?.isOpen?o.jsx(g.KeyboardArrowDownIcon,{size:20,className:"text-neutral-400 dark:text-neutral-400",onClick:r=>{B(),r.stopPropagation()}}):o.jsx(g.KeyboardArrowRightFilledIcon,{size:20,className:"text-neutral-400 dark:text-neutral-400",onClick:r=>{B(),r.stopPropagation()}})})})}),e?.column?.type?.toLowerCase()==="url"&&h?o.jsx(U,{title:o.jsx("div",{onMouseEnter:()=>K(!0),onMouseLeave:()=>K(!1),children:o.jsx("a",{href:h,target:"_blank",rel:"noopener noreferrer",onClick:r=>r.stopPropagation(),children:o.jsxs("div",{className:"flex gap-1 items-center w-full",children:[o.jsx("div",{className:"w-4 h-4",children:o.jsx(g.LinkIcon,{height:16,width:16})}),o.jsx(ze.Typography,{variant:"medium",size:"small",className:"truncate",appearance:"custom",children:h}),o.jsx(Ae.OpenInNewRounded,{sx:{height:"16px",width:"16px",color:"#016DCF"}})]})})}),placement:"top",open:Me,onOpenChange:K,className:"block w-full min-w-0 overflow-hidden",children:o.jsx("div",{className:"w-full h-full flex items-center px-4 min-w-0 overflow-hidden text-primary-400",children:o.jsx("span",{ref:N,onMouseEnter:te,className:"truncate w-full",children:M&&oe&&!a.isValidElement(n)&&typeof n!="object"?M(n):n})})}):o.jsx(U,{title:E&&n&&!m?o.jsx("div",{onMouseEnter:()=>W(!0),onMouseLeave:()=>W(!1),className:"max-h-96 overflow-y-auto whitespace-pre-wrap break-words no-scroll",children:String(n)}):void 0,placement:"top",delayShow:!0,hideTooltip:!!h,open:E&&!h&&!m?$e:void 0,onOpenChange:E&&!h&&!m?W:void 0,className:k("block w-full min-w-0",m?"overflow-x-hidden overflow-y-visible":"overflow-hidden"),children:o.jsx("div",{className:k("w-full h-full flex items-center px-4 min-w-0",m?"overflow-x-hidden overflow-y-visible":"overflow-hidden"),children:o.jsx("span",{ref:m?void 0:N,onMouseEnter:m?void 0:te,className:k(m?"flex min-w-0 max-w-full items-center justify-start gap-1":"truncate w-full"),children:M&&oe&&!a.isValidElement(n)&&typeof n!="object"?M(n):a.isValidElement(n)?typeof n.type=="string"?n:a.cloneElement(n,{...n.props,containerWidth:e.column.width}):n})})})]})})})]})}),F&&!P&&o.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-row flex items-end pointer-events-none z-[5]",children:o.jsx("div",{className:"w-full bg-error-50 dark:bg-error-975 px-1.5 py-0.5 truncate",children:o.jsx("span",{className:"text-error-600 text-[10px] font-medium leading-none",children:F})})}),_e&&!(v===e.column.key&&e?.column?.canEdit&&!A&&!e?.column?.is_disabled)&&o.jsx("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:o.jsx(g.LoadingSpinnerIcon,{className:"text-primary-600 dark:text-white",size:8})})]},b)},Ye=a.memo(Ue);exports.DataCell=Ye;
|
|
2
2
|
//# sourceMappingURL=DataCell.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataCell.cjs.js","sources":["../../../../../../src/components/data-display/infinite-table/body/cell/DataCell.tsx"],"sourcesContent":["import { useTheme } from '../../../../../hooks/useTheme';\nimport { formatCurrency } from '../../../../../utils/formatters';\nimport { formatDate } from '../../../../../utils/formatters';\nimport { getTableRowBgClassNamesByStatus } from '../../../../../constants/table';\nimport type { ICell, IPendingEdit, ValidateAndSaveResult } from '../../types';\nimport { useTableConfig } from '../../../../../providers/design-system-provider/hooks';\nimport Tooltip from '../../../../tooltip/Tooltip';\nimport { Typography } from '../../../../data-display/typography/Typography';\nimport { KeyboardArrowDownIcon, KeyboardArrowRightFilledIcon, LinkIcon, LoadingSpinnerIcon } from '../../../../icon';\nimport { OpenInNewRounded } from '@mui/icons-material';\nimport cn from 'classnames';\nimport React, { useCallback, useContext, useEffect, useRef, useState } from 'react';\nimport { Link } from 'react-router-dom';\n\nimport { TableContext } from '../../context';\nimport { InlineEditField } from './InlineEditField';\nimport { CELL_DEFAULT_RIGHT_OFFSET, CELL_INDENT_PER_LEVEL_PX, CELL_STICKY_SHADOW_DARK, CELL_STICKY_SHADOW_LIGHT } from '../../constants';\n\ntype CellProps = {\n cell: ICell;\n id: string | number;\n nextWidthSum: number;\n isLastCell: boolean;\n rowHovering: string | number | null;\n index: number;\n isFirstStickyCell: boolean;\n handleCellClick: (e?: React.MouseEvent) => void | null;\n currentData: { is_row_modified?: boolean; is_deleted?: boolean; is_added?: boolean };\n highlightSubstring?: (value: string) => JSX.Element;\n is_read: boolean;\n is_modified: boolean;\n is_row_modified: boolean;\n is_deleted: boolean;\n is_added: boolean;\n level: number;\n inlineEditing: string | null;\n isInlineEditing?: boolean;\n setRowHovering: (id: string | number | null) => void;\n handleCellValueChange: (event: React.ChangeEvent<HTMLInputElement>) => void;\n cellRef: React.RefObject<HTMLDivElement>;\n handleUpdateCellData: (directValue?: string | boolean | null, meta?: { currency_code?: string | null; reference?: unknown | null;[key: string]: unknown | null } | null) => void;\n registerValidation?: (validateFn: () => ValidateAndSaveResult) => void;\n loadingExpand: boolean;\n toggleRowExpand: () => void;\n isDraggingOver?: boolean;\n isLoading?: boolean;\n is_incomplete?: boolean;\n pendingEdit?: IPendingEdit;\n hasPendingEdit?: boolean;\n pendingValidationError?: string | null;\n};\n\nlet interval: ReturnType<typeof setInterval> | undefined;\n\nconst formatDurationFallback = (duration: unknown): string => {\n const durationInMs = Number(duration);\n\n if (Number.isNaN(durationInMs) || duration === null || duration === undefined) {\n return '0ms';\n }\n\n if (durationInMs >= 86400000) {\n const days = Math.floor(durationInMs / 86400000);\n const hours = Math.floor((durationInMs % 86400000) / 3600000);\n const minutes = Math.floor((durationInMs % 3600000) / 60000);\n const seconds = Math.floor((durationInMs % 60000) / 1000);\n return `${days}d ${hours}h ${minutes}m ${seconds}s`;\n }\n\n if (durationInMs >= 3600000) {\n const hours = Math.floor(durationInMs / 3600000);\n const minutes = Math.floor((durationInMs % 3600000) / 60000);\n const seconds = Math.floor((durationInMs % 60000) / 1000);\n return `${hours}h ${minutes}m ${seconds}s`;\n }\n\n if (durationInMs >= 60000) {\n const minutes = Math.floor(durationInMs / 60000);\n const seconds = Math.floor((durationInMs % 60000) / 1000);\n return `${minutes}m ${seconds}s`;\n }\n\n if (durationInMs >= 1000) {\n return `${(durationInMs / 1000).toFixed(2)}s`;\n }\n\n return `${durationInMs}ms`;\n};\n\nconst CellWrapper = ({ children, withLink, linkTo, rowData, disableRowClick }: { children: React.ReactNode; withLink?: boolean; linkTo?: (id: string, _rowData?: Record<string, unknown>) => string; rowData?: Record<string, unknown>; disableRowClick?: boolean }) => {\n return withLink && !disableRowClick ? <Link to={linkTo?.(rowData?.id as string, rowData) || ''}>{children}</Link> : children;\n};\n\nconst DataCellInner: React.FC<CellProps> = ({\n cell, id, nextWidthSum, isLastCell, rowHovering, index, isFirstStickyCell, handleCellClick, currentData, highlightSubstring,\n is_read, is_modified, is_row_modified, is_deleted, is_added, level, inlineEditing, isInlineEditing, setRowHovering,\n handleCellValueChange, cellRef, handleUpdateCellData, registerValidation, loadingExpand, toggleRowExpand,\n isDraggingOver, isLoading, is_incomplete, pendingEdit, hasPendingEdit, pendingValidationError,\n}) => {\n const {\n cascadingTableConfig, originalsOnly, maxLevel, showNewItem, expandedRows, rowLinkConfig, multiSelectConfig,\n cellEditing, cellEditingValue, allowInlineEdit, fieldOperationLoading, pendingEdits: contextPendingEdits,\n selectedRowId,\n } = useContext(TableContext);\n\n const isSelectedRow =\n selectedRowId !== null && selectedRowId !== undefined && String(selectedRowId) === String(id);\n\n const tableConfig = useTableConfig();\n\n const rowCellMeta = cell?.column?.key ? (cell?.row?.original?.__cellMetadata as Record<string, Record<string, unknown>> | undefined)?.[cell.column.key] : undefined;\n const isLocked = rowCellMeta?.is_locked ?? cell?.column?.is_locked;\n const cellValidationError = (cell?.column?.key ? contextPendingEdits?.[id]?.[cell.column.key]?.validationError : null) || pendingValidationError || null;\n const isActuallyInlineEditing = inlineEditing === cell.column.key && cell?.column?.canEdit && !isLocked && !cell?.column?.is_disabled;\n const isFieldOperationLoading = fieldOperationLoading === `${id}-${cell?.column?.id}`;\n const { theme } = useTheme();\n const isDark = theme === 'dark';\n const onMouseEnter = useCallback(() => setRowHovering(id), [setRowHovering, id]);\n const onMouseLeave = useCallback(() => setRowHovering(null), [setRowHovering]);\n\n const getNodeExecutionDuration = tableConfig?.formatDuration;\n const [cellValue, setCellValue] = useState(\n cell?.column?.dataType === 'duration' && cell?.value\n ? getNodeExecutionDuration\n ? getNodeExecutionDuration(cell.value)\n : formatDurationFallback(cell.value)\n : cell.value,\n );\n const [tooltipText, setTooltipText] = useState<string | null>(null);\n const [isTruncated, setIsTruncated] = useState(false);\n const [urlTooltipOpen, setUrlTooltipOpen] = useState(false);\n const [truncateTooltipOpen, setTruncateTooltipOpen] = useState(false);\n const textRef = useRef<HTMLSpanElement>(null);\n const urlTooltipTimer = useRef<ReturnType<typeof setTimeout>>();\n const truncateTooltipTimer = useRef<ReturnType<typeof setTimeout>>();\n const { selectedColumnIds = [] } = multiSelectConfig || {};\n const shouldHighlight = !Object.prototype.hasOwnProperty.call(cell?.column?.meta ?? {}, 'shouldHighlight') || cell?.column?.meta?.shouldHighlight;\n\n const checkTruncation = useCallback(() => {\n if (textRef.current) {\n setIsTruncated(textRef.current.scrollWidth > textRef.current.clientWidth);\n }\n }, []);\n\n const handleUrlTooltipChange = useCallback((open: boolean) => {\n if (urlTooltipTimer.current) {\n clearTimeout(urlTooltipTimer.current);\n }\n\n if (open) {\n setUrlTooltipOpen(true);\n } else {\n urlTooltipTimer.current = setTimeout(() => setUrlTooltipOpen(false), 200);\n }\n }, []);\n\n const handleTruncateTooltipChange = useCallback((open: boolean) => {\n if (truncateTooltipTimer.current) {\n clearTimeout(truncateTooltipTimer.current);\n }\n\n if (open) {\n setTruncateTooltipOpen(true);\n } else {\n truncateTooltipTimer.current = setTimeout(() => setTruncateTooltipOpen(false), 200);\n }\n }, []);\n\n const bgColor = cn({\n 'bg-amber-100 dark:bg-amber-900/30': hasPendingEdit,\n 'bg-neutral-100 dark:bg-black-600': rowHovering === id && !isInlineEditing && !hasPendingEdit && !(is_deleted || currentData?.is_deleted) && !(is_added || currentData?.is_added),\n 'bg-error-200 dark:bg-error-900': rowHovering === id && !isInlineEditing && !hasPendingEdit && (is_deleted || currentData?.is_deleted),\n 'bg-success-100 dark:bg-success-800': rowHovering === id && !isInlineEditing && !hasPendingEdit && (is_added || currentData?.is_added),\n 'bg-primary-50 dark:bg-black-700': !is_incomplete && !is_read && showNewItem && !isLoading && rowHovering !== id && !isInlineEditing && !hasPendingEdit,\n 'bg-warning-50 dark:bg-black-500': (is_incomplete || is_modified || is_row_modified || currentData?.is_row_modified) && !isLoading && rowHovering !== id && !isInlineEditing && !hasPendingEdit,\n 'bg-error-100 dark:bg-error-975': (is_deleted || currentData?.is_deleted) && !isLoading && rowHovering !== id && !isInlineEditing && !hasPendingEdit,\n 'bg-success-50 dark:bg-success-900': (is_added || currentData?.is_added) && !isLoading && rowHovering !== id && !isInlineEditing && !hasPendingEdit,\n 'bg-primary-50 dark:bg-primary-900': (isDraggingOver || isInlineEditing) && !hasPendingEdit,\n 'bg-primary-50 dark:bg-primary-800': selectedColumnIds?.includes(cell.column.id) && !isInlineEditing && !hasPendingEdit,\n 'bg-primary-100 dark:bg-primary-950': isSelectedRow && rowHovering !== id && !isInlineEditing && !hasPendingEdit && !isLoading,\n [getTableRowBgClassNamesByStatus[cell?.row?.original?.__rowBgStatus as string]]: cell?.row?.original?.__rowBgStatus && !isInlineEditing && !hasPendingEdit,\n });\n\n const onClick = (e: React.MouseEvent) => { if (cell.column?.disableRowClick) return; handleCellClick(e); };\n\n useEffect(() => {\n const isRunning = cell?.row?.original?.status === 'running';\n if (isRunning && cell.column?.dataType === 'duration') {\n interval = setInterval(() => {\n const startedTime = new Date(formatDate((cell?.row?.original?.created_at || cell?.row?.original?.executed_on) as string | undefined, { withTime: true, format: 'yyyy-MM-dd HH:mm:ss' }) as unknown as Date);\n const timeDiff = Math.abs(new Date().getTime() - new Date(startedTime).getTime());\n setCellValue(getNodeExecutionDuration ? getNodeExecutionDuration(timeDiff) : formatDurationFallback(timeDiff));\n }, 500);\n }\n return () => { if (interval) clearInterval(interval); };\n }, [cellValue, cell.value, cell?.row?.original?.created_at, cell?.row?.original?.executed_on, cell?.row?.original?.status, cell.column?.dataType, getNodeExecutionDuration]);\n\n useEffect(() => {\n if (cell?.column?.tooltipCellKey || cell?.column?.type?.toLowerCase() === 'url') {\n if (cell?.column?.type?.toLowerCase() === 'url') setTooltipText(cell?.value as string | null);\n else setTooltipText(cell?.row?.original?.[String(cell?.column?.tooltipCellKey)] as string | null);\n }\n }, [cell?.column?.tooltipCellKey, cell?.row?.original, cell?.column?.type, cell?.value]);\n\n useEffect(() => {\n if (cell?.column?.type?.toLowerCase() === 'currency') {\n if (pendingEdit?.value !== undefined) {\n const rawData = cell?.row?.original?.__rawData as Record<string, Record<string, unknown>> | undefined;\n const headerKey = cell?.column?.Header as unknown as string;\n const currencyCode = pendingEdit?.meta?.currency_code || rawData?.[headerKey]?.currency_code || 'USD';\n setCellValue(formatCurrency(pendingEdit.value, currencyCode as string));\n } else {\n const rawData = cell?.row?.original?.__rawData as Record<string, Record<string, unknown>> | undefined;\n const headerKey = cell?.column?.Header as unknown as string;\n setCellValue(formatCurrency(cell?.value, (rawData?.[headerKey]?.currency_code as string) || 'USD'));\n }\n }\n }, [cell?.value, cell?.column?.type, cell?.column?.Header, cell?.row?.original?.__rawData, pendingEdit?.value, pendingEdit?.meta?.currency_code]);\n\n useEffect(() => {\n if (cell?.column?.type?.toLowerCase() === 'percentage') {\n if (pendingEdit?.value !== undefined) setCellValue(pendingEdit.value?.toString() + '%' || '');\n else setCellValue(cell?.value?.toString() + '%' || '');\n }\n }, [cell?.value, cell?.column?.type, pendingEdit?.value]);\n\n useEffect(() => {\n const columnType = cell?.column?.type?.toLowerCase() || '';\n if (['date', 'datetime'].includes(columnType)) {\n if (pendingEdit?.value !== undefined) {\n const hasTime = columnType === 'datetime';\n const formattedValue = formatDate(pendingEdit.value as string, { withTime: hasTime, skipTimezone: true });\n setCellValue(formattedValue || pendingEdit.value);\n } else setCellValue(cell.value);\n }\n }, [cell?.value, cell?.column?.type, pendingEdit?.value]);\n\n useEffect(() => {\n const columnType = cell?.column?.type?.toLowerCase() || '';\n if (['currency', 'percentage', 'duration', 'boolean', 'date', 'datetime'].includes(columnType)) return;\n if (pendingEdit?.value !== undefined) setCellValue(pendingEdit.value);\n else if (cell?.column?.dataType !== 'duration') setCellValue(cell.value);\n }, [cell?.value, cell?.column?.type, cell?.column?.dataType, pendingEdit?.value]);\n\n useEffect(() => {\n if (cell?.column?.type?.toLowerCase() === 'boolean' && allowInlineEdit) {\n const rawValue = pendingEdit?.value !== undefined ? pendingEdit.value : cell?.value;\n const booleanValue = rawValue === true || rawValue === 'true' || rawValue === 'True' || rawValue === 'Yes' || rawValue === 1;\n setCellValue(booleanValue ? 'Yes' : 'No');\n }\n }, [cell?.value, cell?.column?.type, allowInlineEdit, pendingEdit?.value]);\n\n useEffect(() => {\n return () => {\n if (urlTooltipTimer.current) {\n clearTimeout(urlTooltipTimer.current);\n }\n if (truncateTooltipTimer.current) {\n clearTimeout(truncateTooltipTimer.current);\n }\n };\n }, []);\n\n const isUiElementCell = React.isValidElement(cellValue);\n\n return (\n <td\n key={index} id={cell.value as string | undefined} data-column-key={cell?.column?.key} {...cell.getCellProps()}\n onClick={rowLinkConfig?.isEnabled ? undefined : onClick}\n className={cn('h-10', {\n 'sticky left-0': cell?.column?.sticky,\n relative: !cell?.column?.sticky,\n 'w-full': isLastCell,\n 'overflow-visible': inlineEditing === cell.column.key,\n /** Chips/badges: avoid vertical clip from overflow-x-hidden + truncate (see isUiElementCell branch below) */\n 'overflow-x-hidden overflow-y-visible': inlineEditing !== cell.column.key && isUiElementCell,\n 'overflow-hidden': inlineEditing !== cell.column.key && !isUiElementCell,\n },\n cellValidationError && !isActuallyInlineEditing ? 'outline outline-2 outline-error-500 -outline-offset-2 z-[5]' : '',\n `${bgColor ? bgColor : 'bg-white dark:bg-black-800'}`,\n )}\n style={{ minWidth: `${cell.column.width}px`, maxWidth: `${cell.column.width}px`, right: cell?.column?.sticky ? `${nextWidthSum}px` : CELL_DEFAULT_RIGHT_OFFSET, paddingLeft: level > 0 && index === 0 ? `${level * CELL_INDENT_PER_LEVEL_PX}px` : undefined }}\n onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave}\n >\n <CellWrapper withLink={rowLinkConfig?.isEnabled} linkTo={rowLinkConfig?.linkTo || undefined} rowData={cell?.row?.original} disableRowClick={cell?.column?.disableRowClick}>\n {(Array.isArray(cellEditing) ? cellEditing.includes(`${id}-${cell?.column?.id}`) : cellEditing === `${id}-${cell?.column?.id}`) ? (\n <div className='h-10 top-0 font-medium font-inter w-full absolute flex items-center px-4'>\n <span className='text-neutral-400 dark:text-black-400 truncate'>\n {(() => {\n const currentCellId = `${id}-${cell?.column?.id}`;\n const editValue = typeof cellEditingValue === 'object' ? cellEditingValue?.[currentCellId] : cellEditingValue;\n const columnType = cell?.column?.type?.toLowerCase();\n\n if (columnType === 'boolean') {\n return (editValue as unknown) === true || editValue === 'true' || editValue === 'True' ? 'Yes' : 'No';\n }\n\n if ((columnType === 'date' || columnType === 'datetime') && editValue) {\n const hasTime = columnType === 'datetime';\n return formatDate(editValue as string, { withTime: hasTime, skipTimezone: true }) || String(editValue);\n }\n\n return editValue !== undefined && editValue !== null ? String(editValue) : (cellValue as React.ReactNode);\n })()}\n </span>\n <div className='ml-2 flex items-center gap-1.5'><LoadingSpinnerIcon className='spinner text-neutral-600 dark:text-white' size={12} /></div>\n </div>\n ) : inlineEditing === cell.column.key && cell?.column?.canEdit && !isLocked && !cell?.column?.is_disabled ? (\n <div className='h-10 w-full absolute top-0 left-0 flex items-center' style={{ marginLeft: level > 0 && index === 0 ? `-${level * CELL_INDENT_PER_LEVEL_PX}px` : undefined, width: level > 0 && index === 0 ? `calc(100% + ${level * CELL_INDENT_PER_LEVEL_PX}px)` : '100%' }}>\n <InlineEditField cell={cell} id={id} inlineEditing={inlineEditing} cellRef={cellRef} handleCellValueChange={handleCellValueChange} handleUpdateCellData={handleUpdateCellData} registerValidation={registerValidation} />\n </div>\n ) : (\n <>\n {level > 0 && index === 0 && <div className='h-10 border-l border-neutral-300 dark:border-black-600 ml-2' />}\n <div className='min-h-6'>\n <Tooltip\n title={tooltipText && cell?.column?.type?.toLowerCase() !== 'url' ? tooltipText : undefined}\n hideTooltip={!tooltipText || cell?.column?.type?.toLowerCase() === 'url'}\n delayShow\n placement='top'\n >\n <div className={cn(`h-10 top-0 font-medium font-inter overflow-index-auto whitespace-nowrap text-ellipsis dark:text-black-200 w-full absolute flex items-center ${bgColor ? bgColor : 'bg-white dark:bg-black-800'}`, isUiElementCell ? 'overflow-x-hidden overflow-y-visible' : 'overflow-x-hidden', { 'border border-b-0 border-t-0 border-primary-600 dark:border-blue-800': selectedColumnIds?.includes(cell.column.id) })}\n style={cell?.column?.sticky && isFirstStickyCell ? { boxShadow: isDark ? CELL_STICKY_SHADOW_DARK : CELL_STICKY_SHADOW_LIGHT } : {}}>\n {cascadingTableConfig?.isCascading && !originalsOnly && index === 0 && (\n <div className={cn('w-[22px] h-10 flex items-center px-4', `${bgColor ? bgColor : 'bg-white dark:bg-black-800'}`)} id='cascading'>\n {maxLevel! > level && (cell?.row?.original?.__has_children || cascadingTableConfig?.showAllDropdown) && (\n <div>{loadingExpand ? <LoadingSpinnerIcon className='text-neutral-600 dark:text-white' size={8} /> : <div>{expandedRows?.[id]?.isOpen ? <KeyboardArrowDownIcon size={20} className='text-neutral-400 dark:text-neutral-400' onClick={(e) => { toggleRowExpand(); e.stopPropagation(); }} /> : <KeyboardArrowRightFilledIcon size={20} className='text-neutral-400 dark:text-neutral-400' onClick={(e) => { toggleRowExpand(); e.stopPropagation(); }} />}</div>}</div>\n )}\n </div>\n )}\n\n {cell?.column?.type?.toLowerCase() === 'url' && tooltipText ? (\n <Tooltip\n title={(\n <div onMouseEnter={() => handleUrlTooltipChange(true)} onMouseLeave={() => handleUrlTooltipChange(false)}>\n <a href={tooltipText} target='_blank' rel='noopener noreferrer' onClick={(e) => e.stopPropagation()}>\n <div className='flex gap-1 items-center w-full'>\n <div className='w-4 h-4'>\n <LinkIcon height={16} width={16} />\n </div>\n <Typography variant='medium' size='small' className='truncate' appearance='custom'>{tooltipText}</Typography>\n <OpenInNewRounded sx={{ height: '16px', width: '16px', color: '#016DCF' }} />\n </div>\n </a>\n </div>\n )}\n placement='top'\n open={urlTooltipOpen}\n onOpenChange={handleUrlTooltipChange}\n className='block w-full min-w-0 overflow-hidden'\n >\n <div className='w-full h-full flex items-center px-4 min-w-0 overflow-hidden text-primary-400'>\n <span ref={textRef} onMouseEnter={checkTruncation} className='truncate w-full'>\n {highlightSubstring && shouldHighlight && !React.isValidElement(cellValue) && typeof cellValue !== 'object'\n ? highlightSubstring(cellValue as string)\n : cellValue as React.ReactNode}\n </span>\n </div>\n </Tooltip>\n ) : (\n <Tooltip\n title={\n isTruncated && cellValue && !isUiElementCell ? (\n <div\n onMouseEnter={() => handleTruncateTooltipChange(true)}\n onMouseLeave={() => handleTruncateTooltipChange(false)}\n className='max-h-96 overflow-y-auto whitespace-pre-wrap break-words no-scroll'\n >\n {String(cellValue)}\n </div>\n ) : undefined\n }\n placement='top'\n delayShow\n hideTooltip={!!tooltipText}\n open={isTruncated && !tooltipText && !isUiElementCell ? truncateTooltipOpen : undefined}\n onOpenChange={isTruncated && !tooltipText && !isUiElementCell ? handleTruncateTooltipChange : undefined}\n className={cn('block w-full min-w-0', isUiElementCell ? 'overflow-x-hidden overflow-y-visible' : 'overflow-hidden')}\n >\n <div className={cn('w-full h-full flex items-center px-4 min-w-0', isUiElementCell ? 'overflow-x-hidden overflow-y-visible' : 'overflow-hidden')}>\n <span\n ref={isUiElementCell ? undefined : textRef}\n onMouseEnter={isUiElementCell ? undefined : checkTruncation}\n className={cn(isUiElementCell ? 'flex min-w-0 max-w-full items-center justify-start gap-1' : 'truncate w-full')}\n >\n {highlightSubstring && shouldHighlight && !React.isValidElement(cellValue) && typeof cellValue !== 'object'\n ? highlightSubstring(cellValue as string)\n : React.isValidElement(cellValue)\n ? (typeof (cellValue as React.ReactElement<Record<string, unknown>>).type === 'string'\n ? cellValue\n : React.cloneElement(cellValue as React.ReactElement<Record<string, unknown>>, {\n ...((cellValue as React.ReactElement<Record<string, unknown>>).props as Record<string, unknown>),\n containerWidth: cell.column.width,\n }))\n : cellValue as React.ReactNode}\n </span>\n </div>\n </Tooltip>\n )}\n </div>\n </Tooltip>\n </div>\n </>\n )}\n </CellWrapper>\n {cellValidationError && !isActuallyInlineEditing && (\n <div className='absolute bottom-0 left-0 right-0 h-10 flex items-end pointer-events-none z-[5]'>\n <div className='w-full bg-error-50 dark:bg-error-975 px-1.5 py-0.5 truncate'><span className='text-error-600 text-2xs font-medium leading-none'>{cellValidationError}</span></div>\n </div>\n )}\n {isFieldOperationLoading && !(inlineEditing === cell.column.key && cell?.column?.canEdit && !isLocked && !cell?.column?.is_disabled) && (\n <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'>\n <LoadingSpinnerIcon className='text-primary-600 dark:text-white' size={8} />\n </div>\n )}\n </td>\n );\n};\n\nexport const DataCell = React.memo(DataCellInner);\n"],"names":["interval","formatDurationFallback","duration","durationInMs","days","hours","minutes","seconds","CellWrapper","children","withLink","linkTo","rowData","disableRowClick","jsx","Link","DataCellInner","cell","id","nextWidthSum","isLastCell","rowHovering","index","isFirstStickyCell","handleCellClick","currentData","highlightSubstring","is_read","is_modified","is_row_modified","is_deleted","is_added","level","inlineEditing","isInlineEditing","setRowHovering","handleCellValueChange","cellRef","handleUpdateCellData","registerValidation","loadingExpand","toggleRowExpand","isDraggingOver","isLoading","is_incomplete","pendingEdit","hasPendingEdit","pendingValidationError","cascadingTableConfig","originalsOnly","maxLevel","showNewItem","expandedRows","rowLinkConfig","multiSelectConfig","cellEditing","cellEditingValue","allowInlineEdit","fieldOperationLoading","contextPendingEdits","selectedRowId","useContext","TableContext","isSelectedRow","tableConfig","useTableConfig","isLocked","cellValidationError","isActuallyInlineEditing","isFieldOperationLoading","theme","useTheme","isDark","onMouseEnter","useCallback","onMouseLeave","getNodeExecutionDuration","cellValue","setCellValue","useState","tooltipText","setTooltipText","isTruncated","setIsTruncated","urlTooltipOpen","setUrlTooltipOpen","truncateTooltipOpen","setTruncateTooltipOpen","textRef","useRef","urlTooltipTimer","truncateTooltipTimer","selectedColumnIds","shouldHighlight","checkTruncation","handleUrlTooltipChange","open","handleTruncateTooltipChange","bgColor","cn","getTableRowBgClassNamesByStatus","onClick","e","useEffect","startedTime","formatDate","timeDiff","rawData","headerKey","currencyCode","formatCurrency","columnType","hasTime","formattedValue","rawValue","isUiElementCell","React","jsxs","CELL_DEFAULT_RIGHT_OFFSET","CELL_INDENT_PER_LEVEL_PX","currentCellId","editValue","LoadingSpinnerIcon","InlineEditField","Fragment","Tooltip","CELL_STICKY_SHADOW_DARK","CELL_STICKY_SHADOW_LIGHT","KeyboardArrowDownIcon","KeyboardArrowRightFilledIcon","LinkIcon","Typography","OpenInNewRounded","DataCell"],"mappings":"wuBAoDA,IAAIA,EAEJ,MAAMC,GAA0BC,GAA8B,CAC5D,MAAMC,EAAe,OAAOD,CAAQ,EAEpC,GAAI,OAAO,MAAMC,CAAY,GAAKD,IAAa,MAAQA,IAAa,OAClE,MAAO,MAGT,GAAIC,GAAgB,MAAU,CAC5B,MAAMC,EAAO,KAAK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AAU,mCAAmC,KAAM,CAAA,CAAG,CAAA,CAC5E,CAAA,CAAA,EAlJGpG,CAAA,CAsJX,EAEa+G,GAAWjB,EAAM,KAAKpG,EAAa"}
|
|
1
|
+
{"version":3,"file":"DataCell.cjs.js","sources":["../../../../../../src/components/data-display/infinite-table/body/cell/DataCell.tsx"],"sourcesContent":["import { useTheme } from '../../../../../hooks/useTheme';\nimport { formatCurrency } from '../../../../../utils/formatters';\nimport { formatDate } from '../../../../../utils/formatters';\nimport { getTableRowBgClassNamesByStatus } from '../../../../../constants/table';\nimport type { ICell, IPendingEdit, ValidateAndSaveResult } from '../../types';\nimport { useTableConfig } from '../../../../../providers/design-system-provider/hooks';\nimport Tooltip from '../../../../tooltip/Tooltip';\nimport { Typography } from '../../../../data-display/typography/Typography';\nimport { KeyboardArrowDownIcon, KeyboardArrowRightFilledIcon, LinkIcon, LoadingSpinnerIcon } from '../../../../icon';\nimport { OpenInNewRounded } from '@mui/icons-material';\nimport cn from 'classnames';\nimport React, { useCallback, useContext, useEffect, useRef, useState } from 'react';\nimport { Link } from 'react-router-dom';\n\nimport { TableContext } from '../../context';\nimport { InlineEditField } from './InlineEditField';\nimport { CELL_DEFAULT_RIGHT_OFFSET, CELL_INDENT_PER_LEVEL_PX, CELL_STICKY_SHADOW_DARK, CELL_STICKY_SHADOW_LIGHT } from '../../constants';\n\ntype CellProps = {\n cell: ICell;\n id: string | number;\n nextWidthSum: number;\n isLastCell: boolean;\n rowHovering: string | number | null;\n index: number;\n isFirstStickyCell: boolean;\n handleCellClick: (e?: React.MouseEvent) => void | null;\n currentData: { is_row_modified?: boolean; is_deleted?: boolean; is_added?: boolean };\n highlightSubstring?: (value: string) => JSX.Element;\n is_read: boolean;\n is_modified: boolean;\n is_row_modified: boolean;\n is_deleted: boolean;\n is_added: boolean;\n level: number;\n inlineEditing: string | null;\n isInlineEditing?: boolean;\n setRowHovering: (id: string | number | null) => void;\n handleCellValueChange: (event: React.ChangeEvent<HTMLInputElement>) => void;\n cellRef: React.RefObject<HTMLDivElement>;\n handleUpdateCellData: (directValue?: string | boolean | null, meta?: { currency_code?: string | null; reference?: unknown | null;[key: string]: unknown | null } | null) => void;\n registerValidation?: (validateFn: () => ValidateAndSaveResult) => void;\n loadingExpand: boolean;\n toggleRowExpand: () => void;\n isDraggingOver?: boolean;\n isLoading?: boolean;\n is_incomplete?: boolean;\n pendingEdit?: IPendingEdit;\n hasPendingEdit?: boolean;\n pendingValidationError?: string | null;\n};\n\nlet interval: ReturnType<typeof setInterval> | undefined;\n\nconst formatDurationFallback = (duration: unknown): string => {\n const durationInMs = Number(duration);\n\n if (Number.isNaN(durationInMs) || duration === null || duration === undefined) {\n return '0ms';\n }\n\n if (durationInMs >= 86400000) {\n const days = Math.floor(durationInMs / 86400000);\n const hours = Math.floor((durationInMs % 86400000) / 3600000);\n const minutes = Math.floor((durationInMs % 3600000) / 60000);\n const seconds = Math.floor((durationInMs % 60000) / 1000);\n return `${days}d ${hours}h ${minutes}m ${seconds}s`;\n }\n\n if (durationInMs >= 3600000) {\n const hours = Math.floor(durationInMs / 3600000);\n const minutes = Math.floor((durationInMs % 3600000) / 60000);\n const seconds = Math.floor((durationInMs % 60000) / 1000);\n return `${hours}h ${minutes}m ${seconds}s`;\n }\n\n if (durationInMs >= 60000) {\n const minutes = Math.floor(durationInMs / 60000);\n const seconds = Math.floor((durationInMs % 60000) / 1000);\n return `${minutes}m ${seconds}s`;\n }\n\n if (durationInMs >= 1000) {\n return `${(durationInMs / 1000).toFixed(2)}s`;\n }\n\n return `${durationInMs}ms`;\n};\n\nconst CellWrapper = ({ children, withLink, linkTo, rowData, disableRowClick }: { children: React.ReactNode; withLink?: boolean; linkTo?: (id: string, _rowData?: Record<string, unknown>) => string; rowData?: Record<string, unknown>; disableRowClick?: boolean }) => {\n return withLink && !disableRowClick ? <Link to={linkTo?.(rowData?.id as string, rowData) || ''}>{children}</Link> : children;\n};\n\nconst DataCellInner: React.FC<CellProps> = ({\n cell, id, nextWidthSum, isLastCell, rowHovering, index, isFirstStickyCell, handleCellClick, currentData, highlightSubstring,\n is_read, is_modified, is_row_modified, is_deleted, is_added, level, inlineEditing, isInlineEditing, setRowHovering,\n handleCellValueChange, cellRef, handleUpdateCellData, registerValidation, loadingExpand, toggleRowExpand,\n isDraggingOver, isLoading, is_incomplete, pendingEdit, hasPendingEdit, pendingValidationError,\n}) => {\n const {\n cascadingTableConfig, originalsOnly, maxLevel, showNewItem, expandedRows, rowLinkConfig, multiSelectConfig,\n cellEditing, cellEditingValue, allowInlineEdit, fieldOperationLoading, pendingEdits: contextPendingEdits,\n selectedRowId,\n } = useContext(TableContext);\n\n const isSelectedRow =\n selectedRowId !== null && selectedRowId !== undefined && String(selectedRowId) === String(id);\n\n const tableConfig = useTableConfig();\n\n const rowCellMeta = cell?.column?.key ? (cell?.row?.original?.__cellMetadata as Record<string, Record<string, unknown>> | undefined)?.[cell.column.key] : undefined;\n const isLocked = rowCellMeta?.is_locked ?? cell?.column?.is_locked;\n const cellValidationError = (cell?.column?.key ? contextPendingEdits?.[id]?.[cell.column.key]?.validationError : null) || pendingValidationError || null;\n const isActuallyInlineEditing = inlineEditing === cell.column.key && cell?.column?.canEdit && !isLocked && !cell?.column?.is_disabled;\n const isFieldOperationLoading = fieldOperationLoading === `${id}-${cell?.column?.id}`;\n const { theme } = useTheme();\n const isDark = theme === 'dark';\n const onMouseEnter = useCallback(() => setRowHovering(id), [setRowHovering, id]);\n const onMouseLeave = useCallback(() => setRowHovering(null), [setRowHovering]);\n\n const getNodeExecutionDuration = tableConfig?.formatDuration;\n const [cellValue, setCellValue] = useState(\n cell?.column?.dataType === 'duration' && cell?.value\n ? getNodeExecutionDuration\n ? getNodeExecutionDuration(cell.value)\n : formatDurationFallback(cell.value)\n : cell.value,\n );\n const [tooltipText, setTooltipText] = useState<string | null>(null);\n const [isTruncated, setIsTruncated] = useState(false);\n const [urlTooltipOpen, setUrlTooltipOpen] = useState(false);\n const [truncateTooltipOpen, setTruncateTooltipOpen] = useState(false);\n const textRef = useRef<HTMLSpanElement>(null);\n const urlTooltipTimer = useRef<ReturnType<typeof setTimeout>>();\n const truncateTooltipTimer = useRef<ReturnType<typeof setTimeout>>();\n const { selectedColumnIds = [] } = multiSelectConfig || {};\n const shouldHighlight = !Object.prototype.hasOwnProperty.call(cell?.column?.meta ?? {}, 'shouldHighlight') || cell?.column?.meta?.shouldHighlight;\n\n const checkTruncation = useCallback(() => {\n if (textRef.current) {\n setIsTruncated(textRef.current.scrollWidth > textRef.current.clientWidth);\n }\n }, []);\n\n const handleUrlTooltipChange = useCallback((open: boolean) => {\n if (urlTooltipTimer.current) {\n clearTimeout(urlTooltipTimer.current);\n }\n\n if (open) {\n setUrlTooltipOpen(true);\n } else {\n urlTooltipTimer.current = setTimeout(() => setUrlTooltipOpen(false), 200);\n }\n }, []);\n\n const handleTruncateTooltipChange = useCallback((open: boolean) => {\n if (truncateTooltipTimer.current) {\n clearTimeout(truncateTooltipTimer.current);\n }\n\n if (open) {\n setTruncateTooltipOpen(true);\n } else {\n truncateTooltipTimer.current = setTimeout(() => setTruncateTooltipOpen(false), 200);\n }\n }, []);\n\n const bgColor = cn({\n 'bg-amber-100 dark:bg-amber-900/30': hasPendingEdit,\n 'bg-neutral-100 dark:bg-black-600': rowHovering === id && !isInlineEditing && !hasPendingEdit && !(is_deleted || currentData?.is_deleted) && !(is_added || currentData?.is_added),\n 'bg-error-200 dark:bg-error-900': rowHovering === id && !isInlineEditing && !hasPendingEdit && (is_deleted || currentData?.is_deleted),\n 'bg-success-100 dark:bg-success-800': rowHovering === id && !isInlineEditing && !hasPendingEdit && (is_added || currentData?.is_added),\n 'bg-primary-50 dark:bg-black-700': !is_incomplete && !is_read && showNewItem && !isLoading && rowHovering !== id && !isInlineEditing && !hasPendingEdit,\n 'bg-warning-50 dark:bg-black-500': (is_incomplete || is_modified || is_row_modified || currentData?.is_row_modified) && !isLoading && rowHovering !== id && !isInlineEditing && !hasPendingEdit,\n 'bg-error-100 dark:bg-error-975': (is_deleted || currentData?.is_deleted) && !isLoading && rowHovering !== id && !isInlineEditing && !hasPendingEdit,\n 'bg-success-50 dark:bg-success-900': (is_added || currentData?.is_added) && !isLoading && rowHovering !== id && !isInlineEditing && !hasPendingEdit,\n 'bg-primary-50 dark:bg-primary-900': (isDraggingOver || isInlineEditing) && !hasPendingEdit,\n 'bg-primary-50 dark:bg-primary-800': selectedColumnIds?.includes(cell.column.id) && !isInlineEditing && !hasPendingEdit,\n 'bg-primary-100 dark:bg-primary-950': isSelectedRow && rowHovering !== id && !isInlineEditing && !hasPendingEdit && !isLoading,\n [getTableRowBgClassNamesByStatus[cell?.row?.original?.__rowBgStatus as string]]: cell?.row?.original?.__rowBgStatus && !isInlineEditing && !hasPendingEdit,\n });\n\n const onClick = (e: React.MouseEvent) => { if (cell.column?.disableRowClick) return; handleCellClick(e); };\n\n useEffect(() => {\n const isRunning = cell?.row?.original?.status === 'running';\n if (isRunning && cell.column?.dataType === 'duration') {\n interval = setInterval(() => {\n const startedTime = new Date(formatDate((cell?.row?.original?.created_at || cell?.row?.original?.executed_on) as string | undefined, { withTime: true, format: 'yyyy-MM-dd HH:mm:ss' }) as unknown as Date);\n const timeDiff = Math.abs(new Date().getTime() - new Date(startedTime).getTime());\n setCellValue(getNodeExecutionDuration ? getNodeExecutionDuration(timeDiff) : formatDurationFallback(timeDiff));\n }, 500);\n }\n return () => { if (interval) clearInterval(interval); };\n }, [cellValue, cell.value, cell?.row?.original?.created_at, cell?.row?.original?.executed_on, cell?.row?.original?.status, cell.column?.dataType, getNodeExecutionDuration]);\n\n useEffect(() => {\n if (cell?.column?.tooltipCellKey || cell?.column?.type?.toLowerCase() === 'url') {\n if (cell?.column?.type?.toLowerCase() === 'url') setTooltipText(cell?.value as string | null);\n else setTooltipText(cell?.row?.original?.[String(cell?.column?.tooltipCellKey)] as string | null);\n }\n }, [cell?.column?.tooltipCellKey, cell?.row?.original, cell?.column?.type, cell?.value]);\n\n useEffect(() => {\n if (cell?.column?.type?.toLowerCase() === 'currency') {\n if (pendingEdit?.value !== undefined) {\n const rawData = cell?.row?.original?.__rawData as Record<string, Record<string, unknown>> | undefined;\n const headerKey = cell?.column?.Header as unknown as string;\n const currencyCode = pendingEdit?.meta?.currency_code || rawData?.[headerKey]?.currency_code || 'USD';\n setCellValue(formatCurrency(pendingEdit.value, currencyCode as string));\n } else {\n const rawData = cell?.row?.original?.__rawData as Record<string, Record<string, unknown>> | undefined;\n const headerKey = cell?.column?.Header as unknown as string;\n setCellValue(formatCurrency(cell?.value, (rawData?.[headerKey]?.currency_code as string) || 'USD'));\n }\n }\n }, [cell?.value, cell?.column?.type, cell?.column?.Header, cell?.row?.original?.__rawData, pendingEdit?.value, pendingEdit?.meta?.currency_code]);\n\n useEffect(() => {\n if (cell?.column?.type?.toLowerCase() === 'percentage') {\n if (pendingEdit?.value !== undefined) setCellValue(pendingEdit.value?.toString() + '%' || '');\n else setCellValue(cell?.value?.toString() + '%' || '');\n }\n }, [cell?.value, cell?.column?.type, pendingEdit?.value]);\n\n useEffect(() => {\n const columnType = cell?.column?.type?.toLowerCase() || '';\n if (['date', 'datetime'].includes(columnType)) {\n if (pendingEdit?.value !== undefined) {\n const hasTime = columnType === 'datetime';\n const formattedValue = formatDate(pendingEdit.value as string, { withTime: hasTime, skipTimezone: true });\n setCellValue(formattedValue || pendingEdit.value);\n } else setCellValue(cell.value);\n }\n }, [cell?.value, cell?.column?.type, pendingEdit?.value]);\n\n useEffect(() => {\n const columnType = cell?.column?.type?.toLowerCase() || '';\n if (['currency', 'percentage', 'duration', 'boolean', 'date', 'datetime'].includes(columnType)) return;\n if (pendingEdit?.value !== undefined) setCellValue(pendingEdit.value);\n else if (cell?.column?.dataType !== 'duration') setCellValue(cell.value);\n }, [cell?.value, cell?.column?.type, cell?.column?.dataType, pendingEdit?.value]);\n\n useEffect(() => {\n if (cell?.column?.type?.toLowerCase() === 'boolean' && allowInlineEdit) {\n const rawValue = pendingEdit?.value !== undefined ? pendingEdit.value : cell?.value;\n const booleanValue = rawValue === true || rawValue === 'true' || rawValue === 'True' || rawValue === 'Yes' || rawValue === 1;\n setCellValue(booleanValue ? 'Yes' : 'No');\n }\n }, [cell?.value, cell?.column?.type, allowInlineEdit, pendingEdit?.value]);\n\n useEffect(() => {\n return () => {\n if (urlTooltipTimer.current) {\n clearTimeout(urlTooltipTimer.current);\n }\n if (truncateTooltipTimer.current) {\n clearTimeout(truncateTooltipTimer.current);\n }\n };\n }, []);\n\n const isUiElementCell = React.isValidElement(cellValue);\n\n return (\n <td\n key={index} id={cell.value as string | undefined} data-column-key={cell?.column?.key} {...cell.getCellProps()}\n onClick={rowLinkConfig?.isEnabled ? undefined : onClick}\n className={cn('h-row', {\n 'sticky left-0': cell?.column?.sticky,\n relative: !cell?.column?.sticky,\n 'w-full': isLastCell,\n 'overflow-visible': inlineEditing === cell.column.key,\n /** Chips/badges: avoid vertical clip from overflow-x-hidden + truncate (see isUiElementCell branch below) */\n 'overflow-x-hidden overflow-y-visible': inlineEditing !== cell.column.key && isUiElementCell,\n 'overflow-hidden': inlineEditing !== cell.column.key && !isUiElementCell,\n },\n cellValidationError && !isActuallyInlineEditing ? 'outline outline-2 outline-error-500 -outline-offset-2 z-[5]' : '',\n `${bgColor ? bgColor : 'bg-white dark:bg-black-800'}`,\n )}\n style={{ minWidth: `${cell.column.width}px`, maxWidth: `${cell.column.width}px`, right: cell?.column?.sticky ? `${nextWidthSum}px` : CELL_DEFAULT_RIGHT_OFFSET, paddingLeft: level > 0 && index === 0 ? `${level * CELL_INDENT_PER_LEVEL_PX}px` : undefined }}\n onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave}\n >\n <CellWrapper withLink={rowLinkConfig?.isEnabled} linkTo={rowLinkConfig?.linkTo || undefined} rowData={cell?.row?.original} disableRowClick={cell?.column?.disableRowClick}>\n {(Array.isArray(cellEditing) ? cellEditing.includes(`${id}-${cell?.column?.id}`) : cellEditing === `${id}-${cell?.column?.id}`) ? (\n <div className='h-row top-0 font-medium font-inter w-full absolute flex items-center px-4'>\n <span className='text-neutral-400 dark:text-black-400 truncate'>\n {(() => {\n const currentCellId = `${id}-${cell?.column?.id}`;\n const editValue = typeof cellEditingValue === 'object' ? cellEditingValue?.[currentCellId] : cellEditingValue;\n const columnType = cell?.column?.type?.toLowerCase();\n\n if (columnType === 'boolean') {\n return (editValue as unknown) === true || editValue === 'true' || editValue === 'True' ? 'Yes' : 'No';\n }\n\n if ((columnType === 'date' || columnType === 'datetime') && editValue) {\n const hasTime = columnType === 'datetime';\n return formatDate(editValue as string, { withTime: hasTime, skipTimezone: true }) || String(editValue);\n }\n\n return editValue !== undefined && editValue !== null ? String(editValue) : (cellValue as React.ReactNode);\n })()}\n </span>\n <div className='ml-2 flex items-center gap-1.5'><LoadingSpinnerIcon className='spinner text-neutral-600 dark:text-white' size={12} /></div>\n </div>\n ) : inlineEditing === cell.column.key && cell?.column?.canEdit && !isLocked && !cell?.column?.is_disabled ? (\n <div className='h-row w-full absolute top-0 left-0 flex items-center' style={{ marginLeft: level > 0 && index === 0 ? `-${level * CELL_INDENT_PER_LEVEL_PX}px` : undefined, width: level > 0 && index === 0 ? `calc(100% + ${level * CELL_INDENT_PER_LEVEL_PX}px)` : '100%' }}>\n <InlineEditField cell={cell} id={id} inlineEditing={inlineEditing} cellRef={cellRef} handleCellValueChange={handleCellValueChange} handleUpdateCellData={handleUpdateCellData} registerValidation={registerValidation} />\n </div>\n ) : (\n <>\n {level > 0 && index === 0 && <div className='h-row border-l border-neutral-300 dark:border-black-600 ml-2' />}\n <div className='min-h-6'>\n <Tooltip\n title={tooltipText && cell?.column?.type?.toLowerCase() !== 'url' ? tooltipText : undefined}\n hideTooltip={!tooltipText || cell?.column?.type?.toLowerCase() === 'url'}\n delayShow\n placement='top'\n >\n <div className={cn(`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 ${bgColor ? bgColor : 'bg-white dark:bg-black-800'}`, isUiElementCell ? 'overflow-x-hidden overflow-y-visible' : 'overflow-x-hidden', { 'border border-b-0 border-t-0 border-primary-600 dark:border-blue-800': selectedColumnIds?.includes(cell.column.id) })}\n style={cell?.column?.sticky && isFirstStickyCell ? { boxShadow: isDark ? CELL_STICKY_SHADOW_DARK : CELL_STICKY_SHADOW_LIGHT } : {}}>\n {cascadingTableConfig?.isCascading && !originalsOnly && index === 0 && (\n <div className={cn('w-[22px] h-row flex items-center px-4', `${bgColor ? bgColor : 'bg-white dark:bg-black-800'}`)} id='cascading'>\n {maxLevel! > level && (cell?.row?.original?.__has_children || cascadingTableConfig?.showAllDropdown) && (\n <div>{loadingExpand ? <LoadingSpinnerIcon className='text-neutral-600 dark:text-white' size={8} /> : <div>{expandedRows?.[id]?.isOpen ? <KeyboardArrowDownIcon size={20} className='text-neutral-400 dark:text-neutral-400' onClick={(e) => { toggleRowExpand(); e.stopPropagation(); }} /> : <KeyboardArrowRightFilledIcon size={20} className='text-neutral-400 dark:text-neutral-400' onClick={(e) => { toggleRowExpand(); e.stopPropagation(); }} />}</div>}</div>\n )}\n </div>\n )}\n\n {cell?.column?.type?.toLowerCase() === 'url' && tooltipText ? (\n <Tooltip\n title={(\n <div onMouseEnter={() => handleUrlTooltipChange(true)} onMouseLeave={() => handleUrlTooltipChange(false)}>\n <a href={tooltipText} target='_blank' rel='noopener noreferrer' onClick={(e) => e.stopPropagation()}>\n <div className='flex gap-1 items-center w-full'>\n <div className='w-4 h-4'>\n <LinkIcon height={16} width={16} />\n </div>\n <Typography variant='medium' size='small' className='truncate' appearance='custom'>{tooltipText}</Typography>\n <OpenInNewRounded sx={{ height: '16px', width: '16px', color: '#016DCF' }} />\n </div>\n </a>\n </div>\n )}\n placement='top'\n open={urlTooltipOpen}\n onOpenChange={handleUrlTooltipChange}\n className='block w-full min-w-0 overflow-hidden'\n >\n <div className='w-full h-full flex items-center px-4 min-w-0 overflow-hidden text-primary-400'>\n <span ref={textRef} onMouseEnter={checkTruncation} className='truncate w-full'>\n {highlightSubstring && shouldHighlight && !React.isValidElement(cellValue) && typeof cellValue !== 'object'\n ? highlightSubstring(cellValue as string)\n : cellValue as React.ReactNode}\n </span>\n </div>\n </Tooltip>\n ) : (\n <Tooltip\n title={\n isTruncated && cellValue && !isUiElementCell ? (\n <div\n onMouseEnter={() => handleTruncateTooltipChange(true)}\n onMouseLeave={() => handleTruncateTooltipChange(false)}\n className='max-h-96 overflow-y-auto whitespace-pre-wrap break-words no-scroll'\n >\n {String(cellValue)}\n </div>\n ) : undefined\n }\n placement='top'\n delayShow\n hideTooltip={!!tooltipText}\n open={isTruncated && !tooltipText && !isUiElementCell ? truncateTooltipOpen : undefined}\n onOpenChange={isTruncated && !tooltipText && !isUiElementCell ? handleTruncateTooltipChange : undefined}\n className={cn('block w-full min-w-0', isUiElementCell ? 'overflow-x-hidden overflow-y-visible' : 'overflow-hidden')}\n >\n <div className={cn('w-full h-full flex items-center px-4 min-w-0', isUiElementCell ? 'overflow-x-hidden overflow-y-visible' : 'overflow-hidden')}>\n <span\n ref={isUiElementCell ? undefined : textRef}\n onMouseEnter={isUiElementCell ? undefined : checkTruncation}\n className={cn(isUiElementCell ? 'flex min-w-0 max-w-full items-center justify-start gap-1' : 'truncate w-full')}\n >\n {highlightSubstring && shouldHighlight && !React.isValidElement(cellValue) && typeof cellValue !== 'object'\n ? highlightSubstring(cellValue as string)\n : React.isValidElement(cellValue)\n ? (typeof (cellValue as React.ReactElement<Record<string, unknown>>).type === 'string'\n ? cellValue\n : React.cloneElement(cellValue as React.ReactElement<Record<string, unknown>>, {\n ...((cellValue as React.ReactElement<Record<string, unknown>>).props as Record<string, unknown>),\n containerWidth: cell.column.width,\n }))\n : cellValue as React.ReactNode}\n </span>\n </div>\n </Tooltip>\n )}\n </div>\n </Tooltip>\n </div>\n </>\n )}\n </CellWrapper>\n {cellValidationError && !isActuallyInlineEditing && (\n <div className='absolute bottom-0 left-0 right-0 h-row flex items-end pointer-events-none z-[5]'>\n <div className='w-full bg-error-50 dark:bg-error-975 px-1.5 py-0.5 truncate'><span className='text-error-600 text-[10px] font-medium leading-none'>{cellValidationError}</span></div>\n </div>\n )}\n {isFieldOperationLoading && !(inlineEditing === cell.column.key && cell?.column?.canEdit && !isLocked && !cell?.column?.is_disabled) && (\n <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'>\n <LoadingSpinnerIcon className='text-primary-600 dark:text-white' size={8} />\n </div>\n )}\n </td>\n );\n};\n\nexport const DataCell = React.memo(DataCellInner);\n"],"names":["interval","formatDurationFallback","duration","durationInMs","days","hours","minutes","seconds","CellWrapper","children","withLink","linkTo","rowData","disableRowClick","jsx","Link","DataCellInner","cell","id","nextWidthSum","isLastCell","rowHovering","index","isFirstStickyCell","handleCellClick","currentData","highlightSubstring","is_read","is_modified","is_row_modified","is_deleted","is_added","level","inlineEditing","isInlineEditing","setRowHovering","handleCellValueChange","cellRef","handleUpdateCellData","registerValidation","loadingExpand","toggleRowExpand","isDraggingOver","isLoading","is_incomplete","pendingEdit","hasPendingEdit","pendingValidationError","cascadingTableConfig","originalsOnly","maxLevel","showNewItem","expandedRows","rowLinkConfig","multiSelectConfig","cellEditing","cellEditingValue","allowInlineEdit","fieldOperationLoading","contextPendingEdits","selectedRowId","useContext","TableContext","isSelectedRow","tableConfig","useTableConfig","isLocked","cellValidationError","isActuallyInlineEditing","isFieldOperationLoading","theme","useTheme","isDark","onMouseEnter","useCallback","onMouseLeave","getNodeExecutionDuration","cellValue","setCellValue","useState","tooltipText","setTooltipText","isTruncated","setIsTruncated","urlTooltipOpen","setUrlTooltipOpen","truncateTooltipOpen","setTruncateTooltipOpen","textRef","useRef","urlTooltipTimer","truncateTooltipTimer","selectedColumnIds","shouldHighlight","checkTruncation","handleUrlTooltipChange","open","handleTruncateTooltipChange","bgColor","cn","getTableRowBgClassNamesByStatus","onClick","e","useEffect","startedTime","formatDate","timeDiff","rawData","headerKey","currencyCode","formatCurrency","columnType","hasTime","formattedValue","rawValue","isUiElementCell","React","jsxs","CELL_DEFAULT_RIGHT_OFFSET","CELL_INDENT_PER_LEVEL_PX","currentCellId","editValue","LoadingSpinnerIcon","InlineEditField","Fragment","Tooltip","CELL_STICKY_SHADOW_DARK","CELL_STICKY_SHADOW_LIGHT","KeyboardArrowDownIcon","KeyboardArrowRightFilledIcon","LinkIcon","Typography","OpenInNewRounded","DataCell"],"mappings":"wuBAoDA,IAAIA,EAEJ,MAAMC,GAA0BC,GAA8B,CAC5D,MAAMC,EAAe,OAAOD,CAAQ,EAEpC,GAAI,OAAO,MAAMC,CAAY,GAAKD,IAAa,MAAQA,IAAa,OAClE,MAAO,MAGT,GAAIC,GAAgB,MAAU,CAC5B,MAAMC,EAAO,KAAK,MAAMD,EAAe,KAAQ,EACzCE,EAAQ,KAAK,MAAOF,EAAe,MAAY,IAAO,EACtDG,EAAU,KAAK,MAAOH,EAAe,KAAW,GAAK,EACrDI,EAAU,KAAK,MAAOJ,EAAe,IAAS,GAAI,EACxD,MAAO,GAAGC,CAAI,KAAKC,CAAK,KAAKC,CAAO,KAAKC,CAAO,GAClD,CAEA,GAAIJ,GAAgB,KAAS,CAC3B,MAAME,EAAQ,KAAK,MAAMF,EAAe,IAAO,EACzCG,EAAU,KAAK,MAAOH,EAAe,KAAW,GAAK,EACrDI,EAAU,KAAK,MAAOJ,EAAe,IAAS,GAAI,EACxD,MAAO,GAAGE,CAAK,KAAKC,CAAO,KAAKC,CAAO,GACzC,CAEA,GAAIJ,GAAgB,IAAO,CACzB,MAAMG,EAAU,KAAK,MAAMH,EAAe,GAAK,EACzCI,EAAU,KAAK,MAAOJ,EAAe,IAAS,GAAI,EACxD,MAAO,GAAGG,CAAO,KAAKC,CAAO,GAC/B,CAEA,OAAIJ,GAAgB,IACX,IAAIA,EAAe,KAAM,QAAQ,CAAC,CAAC,IAGrC,GAAGA,CAAY,IACxB,EAEMK,GAAc,CAAC,CAAE,SAAAC,EAAU,SAAAC,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,CAAA,CACR,CACF,CAAA,CAAA,CACF,CAAA,CAAA,CAEJ,CAAA,CACF,CACF,CAAA,CAAA,CACF,CAAA,CAEJ,EACCV,GAAuB,CAACC,GACvBtD,EAAAA,IAAC,MAAA,CAAI,UAAU,kFACb,SAAAA,MAAC,MAAA,CAAI,UAAU,8DAA8D,SAAAA,EAAAA,IAAC,OAAA,CAAK,UAAU,sDAAuD,SAAAqD,CAAA,CAAoB,EAAO,EACjL,EAEDE,IAA2B,EAAEpC,IAAkBhB,EAAK,OAAO,KAAOA,GAAM,QAAQ,SAAW,CAACiD,GAAY,CAACjD,GAAM,QAAQ,cACtHH,EAAAA,IAAC,MAAA,CAAI,UAAU,2KACb,SAAAA,EAAAA,IAAC4G,EAAAA,mBAAA,CAAmB,UAAU,mCAAmC,KAAM,CAAA,CAAG,CAAA,CAC5E,CAAA,CAAA,EAlJGpG,CAAA,CAsJX,EAEa+G,GAAWjB,EAAM,KAAKpG,EAAa"}
|
|
@@ -19,8 +19,8 @@ const le = (e) => {
|
|
|
19
19
|
if (Number.isNaN(o) || e === null || e === void 0)
|
|
20
20
|
return "0ms";
|
|
21
21
|
if (o >= 864e5) {
|
|
22
|
-
const p = Math.floor(o / 864e5), d = Math.floor(o % 864e5 / 36e5), u = Math.floor(o % 36e5 / 6e4),
|
|
23
|
-
return `${p}d ${d}h ${u}m ${
|
|
22
|
+
const p = Math.floor(o / 864e5), d = Math.floor(o % 864e5 / 36e5), u = Math.floor(o % 36e5 / 6e4), h = Math.floor(o % 6e4 / 1e3);
|
|
23
|
+
return `${p}d ${d}h ${u}m ${h}s`;
|
|
24
24
|
}
|
|
25
25
|
if (o >= 36e5) {
|
|
26
26
|
const p = Math.floor(o / 36e5), d = Math.floor(o % 36e5 / 6e4), u = Math.floor(o % 6e4 / 1e3);
|
|
@@ -37,7 +37,7 @@ const le = (e) => {
|
|
|
37
37
|
nextWidthSum: p,
|
|
38
38
|
isLastCell: d,
|
|
39
39
|
rowHovering: u,
|
|
40
|
-
index:
|
|
40
|
+
index: h,
|
|
41
41
|
isFirstStickyCell: ce,
|
|
42
42
|
handleCellClick: me,
|
|
43
43
|
currentData: v,
|
|
@@ -51,8 +51,8 @@ const le = (e) => {
|
|
|
51
51
|
inlineEditing: k,
|
|
52
52
|
isInlineEditing: l,
|
|
53
53
|
setRowHovering: V,
|
|
54
|
-
handleCellValueChange:
|
|
55
|
-
cellRef:
|
|
54
|
+
handleCellValueChange: we,
|
|
55
|
+
cellRef: he,
|
|
56
56
|
handleUpdateCellData: ye,
|
|
57
57
|
registerValidation: be,
|
|
58
58
|
loadingExpand: ve,
|
|
@@ -80,7 +80,7 @@ const le = (e) => {
|
|
|
80
80
|
selectedRowId: K
|
|
81
81
|
} = He(qe), Me = K != null && String(K) === String(o), Se = Ye(), j = (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) || xe || null, oe = k === e.column.key && e?.column?.canEdit && !j && !e?.column?.is_disabled, De = Le === `${o}-${e?.column?.id}`, { theme: Oe } = We(), Ve = Oe === "dark", Re = S(() => V(o), [V, o]), Ie = S(() => V(null), [V]), _ = Se?.formatDuration, [n, f] = D(
|
|
82
82
|
e?.column?.dataType === "duration" && e?.value ? _ ? _(e.value) : le(e.value) : e.value
|
|
83
|
-
), [
|
|
83
|
+
), [w, te] = D(null), [U, ze] = D(!1), [Ae, re] = D(!1), [Fe, ae] = D(!1), N = X(null), L = X(), $ = X(), { selectedColumnIds: ne = [] } = Ne || {}, se = !Object.prototype.hasOwnProperty.call(e?.column?.meta ?? {}, "shouldHighlight") || e?.column?.meta?.shouldHighlight, ue = S(() => {
|
|
84
84
|
N.current && ze(N.current.scrollWidth > N.current.clientWidth);
|
|
85
85
|
}, []), Y = S((r) => {
|
|
86
86
|
L.current && clearTimeout(L.current), r ? re(!0) : L.current = setTimeout(() => re(!1), 200);
|
|
@@ -147,7 +147,7 @@ const le = (e) => {
|
|
|
147
147
|
...e.getCellProps(),
|
|
148
148
|
onClick: z?.isEnabled ? void 0 : Ke,
|
|
149
149
|
className: x(
|
|
150
|
-
"h-
|
|
150
|
+
"h-row",
|
|
151
151
|
{
|
|
152
152
|
"sticky left-0": e?.column?.sticky,
|
|
153
153
|
relative: !e?.column?.sticky,
|
|
@@ -160,42 +160,42 @@ const le = (e) => {
|
|
|
160
160
|
W && !oe ? "outline outline-2 outline-error-500 -outline-offset-2 z-[5]" : "",
|
|
161
161
|
`${T || "bg-white dark:bg-black-800"}`
|
|
162
162
|
),
|
|
163
|
-
style: { minWidth: `${e.column.width}px`, maxWidth: `${e.column.width}px`, right: e?.column?.sticky ? `${p}px` : Qe, paddingLeft: y > 0 &&
|
|
163
|
+
style: { minWidth: `${e.column.width}px`, maxWidth: `${e.column.width}px`, right: e?.column?.sticky ? `${p}px` : Qe, paddingLeft: y > 0 && h === 0 ? `${y * q}px` : void 0 },
|
|
164
164
|
onMouseEnter: Re,
|
|
165
165
|
onMouseLeave: Ie,
|
|
166
166
|
children: [
|
|
167
|
-
/* @__PURE__ */ t(to, { 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__ */ M("div", { className: "h-
|
|
167
|
+
/* @__PURE__ */ t(to, { 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__ */ M("div", { className: "h-row top-0 font-medium font-inter w-full absolute flex items-center px-4", children: [
|
|
168
168
|
/* @__PURE__ */ t("span", { className: "text-neutral-400 dark:text-black-400 truncate", children: (() => {
|
|
169
169
|
const r = `${o}-${e?.column?.id}`, s = typeof F == "object" ? F?.[r] : F, m = e?.column?.type?.toLowerCase();
|
|
170
170
|
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;
|
|
171
171
|
})() }),
|
|
172
172
|
/* @__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 }) })
|
|
173
|
-
] }) : k === e.column.key && e?.column?.canEdit && !j && !e?.column?.is_disabled ? /* @__PURE__ */ t("div", { className: "h-
|
|
174
|
-
y > 0 &&
|
|
173
|
+
] }) : 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: y > 0 && h === 0 ? `-${y * q}px` : void 0, width: y > 0 && h === 0 ? `calc(100% + ${y * q}px)` : "100%" }, children: /* @__PURE__ */ t(Je, { cell: e, id: o, inlineEditing: k, cellRef: he, handleCellValueChange: we, handleUpdateCellData: ye, registerValidation: be }) }) : /* @__PURE__ */ M(je, { children: [
|
|
174
|
+
y > 0 && h === 0 && /* @__PURE__ */ t("div", { className: "h-row border-l border-neutral-300 dark:border-black-600 ml-2" }),
|
|
175
175
|
/* @__PURE__ */ t("div", { className: "min-h-6", children: /* @__PURE__ */ t(
|
|
176
176
|
H,
|
|
177
177
|
{
|
|
178
|
-
title:
|
|
179
|
-
hideTooltip: !
|
|
178
|
+
title: w && e?.column?.type?.toLowerCase() !== "url" ? w : void 0,
|
|
179
|
+
hideTooltip: !w || e?.column?.type?.toLowerCase() === "url",
|
|
180
180
|
delayShow: !0,
|
|
181
181
|
placement: "top",
|
|
182
182
|
children: /* @__PURE__ */ M(
|
|
183
183
|
"div",
|
|
184
184
|
{
|
|
185
|
-
className: x(`h-
|
|
185
|
+
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": ne?.includes(e.column.id) }),
|
|
186
186
|
style: e?.column?.sticky && ce ? { boxShadow: Ve ? Ze : Pe } : {},
|
|
187
187
|
children: [
|
|
188
|
-
E?.isCascading && !Te &&
|
|
188
|
+
E?.isCascading && !Te && 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: Ce > y && (e?.row?.original?.__has_children || E?.showAllDropdown) && /* @__PURE__ */ t("div", { children: ve ? /* @__PURE__ */ t(J, { className: "text-neutral-600 dark:text-white", size: 8 }) : /* @__PURE__ */ t("div", { children: _e?.[o]?.isOpen ? /* @__PURE__ */ t(Ee, { size: 20, className: "text-neutral-400 dark:text-neutral-400", onClick: (r) => {
|
|
189
189
|
Z(), r.stopPropagation();
|
|
190
190
|
} }) : /* @__PURE__ */ t(eo, { size: 20, className: "text-neutral-400 dark:text-neutral-400", onClick: (r) => {
|
|
191
191
|
Z(), r.stopPropagation();
|
|
192
192
|
} }) }) }) }),
|
|
193
|
-
e?.column?.type?.toLowerCase() === "url" &&
|
|
193
|
+
e?.column?.type?.toLowerCase() === "url" && w ? /* @__PURE__ */ t(
|
|
194
194
|
H,
|
|
195
195
|
{
|
|
196
|
-
title: /* @__PURE__ */ t("div", { onMouseEnter: () => Y(!0), onMouseLeave: () => Y(!1), children: /* @__PURE__ */ t("a", { href:
|
|
196
|
+
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__ */ M("div", { className: "flex gap-1 items-center w-full", children: [
|
|
197
197
|
/* @__PURE__ */ t("div", { className: "w-4 h-4", children: /* @__PURE__ */ t(oo, { height: 16, width: 16 }) }),
|
|
198
|
-
/* @__PURE__ */ t(Be, { variant: "medium", size: "small", className: "truncate", appearance: "custom", children:
|
|
198
|
+
/* @__PURE__ */ t(Be, { variant: "medium", size: "small", className: "truncate", appearance: "custom", children: w }),
|
|
199
199
|
/* @__PURE__ */ t(Ge, { sx: { height: "16px", width: "16px", color: "#016DCF" } })
|
|
200
200
|
] }) }) }),
|
|
201
201
|
placement: "top",
|
|
@@ -218,9 +218,9 @@ const le = (e) => {
|
|
|
218
218
|
) : void 0,
|
|
219
219
|
placement: "top",
|
|
220
220
|
delayShow: !0,
|
|
221
|
-
hideTooltip: !!
|
|
222
|
-
open: U && !
|
|
223
|
-
onOpenChange: U && !
|
|
221
|
+
hideTooltip: !!w,
|
|
222
|
+
open: U && !w && !c ? Fe : void 0,
|
|
223
|
+
onOpenChange: U && !w && !c ? B : void 0,
|
|
224
224
|
className: x("block w-full min-w-0", c ? "overflow-x-hidden overflow-y-visible" : "overflow-hidden"),
|
|
225
225
|
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(
|
|
226
226
|
"span",
|
|
@@ -242,11 +242,11 @@ const le = (e) => {
|
|
|
242
242
|
}
|
|
243
243
|
) })
|
|
244
244
|
] }) }),
|
|
245
|
-
W && !oe && /* @__PURE__ */ t("div", { className: "absolute bottom-0 left-0 right-0 h-
|
|
245
|
+
W && !oe && /* @__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 }) }) }),
|
|
246
246
|
De && !(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 }) })
|
|
247
247
|
]
|
|
248
248
|
},
|
|
249
|
-
|
|
249
|
+
h
|
|
250
250
|
);
|
|
251
251
|
}, To = C.memo(ro);
|
|
252
252
|
export {
|