@lax-wp/design-system 0.13.61 → 0.13.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/data-display/infinite-table/body/cell/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 +17 -17
- package/dist/components/data-display/infinite-table/body/cell/RowActionCell.es.js.map +1 -1
- package/dist/components/data-display/infinite-table/index.cjs.js +1 -1
- package/dist/components/data-display/infinite-table/index.cjs.js.map +1 -1
- package/dist/components/data-display/infinite-table/index.d.ts +2 -2
- package/dist/components/data-display/infinite-table/index.es.js +467 -159
- package/dist/components/data-display/infinite-table/index.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.es.js +30 -28
- package/dist/components/user-avatar/UserAvatar.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),q=require("../../../../tooltip/Tooltip.cjs.js"),S=require("../../../../../providers/design-system-provider/hooks.cjs.js"),j=require("../../../../../_virtual/index.cjs.js"),x=require("react"),T=({disableOptionsForRowIndex:C,tableActions:g,index:l,is_read:f,showNewItem:k,is_modified:p,is_row_modified:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),q=require("../../../../tooltip/Tooltip.cjs.js"),S=require("../../../../../providers/design-system-provider/hooks.cjs.js"),j=require("../../../../../_virtual/index.cjs.js"),x=require("react"),T=({disableOptionsForRowIndex:C,tableActions:g,index:l,is_read:f,showNewItem:k,is_modified:p,is_row_modified:d,is_deleted:c,currentData:e,is_added:o,rowData:m,id:s,rowHovering:t,isDisabled:b,bgColor:n,is_incomplete:h,isInlineEditing:r,rowHasPendingEdits:a})=>{const R=S.useTableConfig()?.t?.("Save or cancel pending changes first")??"Save or cancel pending changes first",i=x.useMemo(()=>r?"bg-primary-50 dark:bg-primary-900":n||(c||e?.is_deleted?"bg-error-100 dark:bg-error-975":h||p||d||e?.is_row_modified?"bg-warning-50 dark:bg-black-500":o||e?.is_added?"bg-success-50 dark:bg-success-900":!f&&k&&!b?"bg-primary-50 dark:bg-black-700":"bg-white dark:bg-black-800"),[h,f,k,p,d,c,e,o,n,r,b]),y=C===l||b||a;return u.jsxs("td",{"aria-disabled":y,className:j("px-2.5 relative h-row",i,y&&"cursor-not-allowed opacity-50"),children:[g(m,l),u.jsx(q,{title:a?R:"",children:u.jsx("div",{className:j("absolute top-0 left-0 flex items-center justify-center w-full z-20",{[i]:t!==s||r},{"bg-neutral-100 dark:bg-black-600":t===s&&!r&&!(c||e?.is_deleted)&&!(o||e?.is_added)},{"bg-error-200 dark:bg-error-900":t===s&&!r&&(c||e?.is_deleted)},{"bg-success-100 dark:bg-success-800":t===s&&!r&&(o||e?.is_added)},a&&"pointer-events-none"),children:g(m,l)})})]})},v=x.memo(T);exports.RowActionCell=v;
|
|
2
2
|
//# sourceMappingURL=RowActionCell.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RowActionCell.cjs.js","sources":["../../../../../../src/components/data-display/infinite-table/body/cell/RowActionCell.tsx"],"sourcesContent":["import Tooltip from '../../../../tooltip/Tooltip';\nimport { useTableConfig } from '../../../../../providers/design-system-provider/hooks';\nimport cn from 'classnames';\nimport React, { useMemo } from 'react';\n\ntype TProps = {\n disableOptionsForRowIndex: number | null;\n tableActions: (rowData: Record<string, unknown>, index: number) => JSX.Element;\n index: number;\n is_read: boolean;\n showNewItem: boolean;\n is_modified: boolean;\n is_row_modified: boolean;\n is_deleted: boolean;\n currentData: Record<string, unknown>;\n is_added: boolean;\n rowData: Record<string, unknown>;\n id: string | number;\n rowHovering: string | number | null;\n isDisabled?: boolean;\n bgColor?: string;\n is_incomplete: boolean;\n isInlineEditing?: boolean;\n rowHasPendingEdits?: boolean;\n};\n\nconst RowActionCellInner: React.FC<TProps> = ({\n disableOptionsForRowIndex,\n tableActions,\n index,\n is_read,\n showNewItem,\n is_modified,\n is_row_modified,\n is_deleted,\n currentData,\n is_added,\n rowData,\n id,\n rowHovering,\n isDisabled,\n bgColor,\n is_incomplete,\n isInlineEditing,\n rowHasPendingEdits,\n}) => {\n const tableConfig = useTableConfig();\n const pendingEditsTooltip = tableConfig?.t?.('Save or cancel pending changes first') ?? 'Save or cancel pending changes first';\n\n const backgroundColorClass = useMemo(() => {\n if (isInlineEditing) return 'bg-primary-50 dark:bg-primary-900';\n if (bgColor) return bgColor;\n if (is_deleted || currentData?.is_deleted) return 'bg-error-100 dark:bg-error-975';\n if (is_incomplete || is_modified || is_row_modified || currentData?.is_row_modified) return 'bg-warning-50 dark:bg-black-500';\n if (is_added || currentData?.is_added) return 'bg-success-50';\n if (!is_read && showNewItem && !isDisabled) return 'bg-primary-50 dark:bg-black-700';\n return 'bg-white dark:bg-black-800';\n }, [is_incomplete, is_read, showNewItem, is_modified, is_row_modified, is_deleted, currentData, is_added, bgColor, isInlineEditing, isDisabled]);\n\n const isRowDisabled = disableOptionsForRowIndex === index || isDisabled || rowHasPendingEdits;\n\n return (\n <td aria-disabled={isRowDisabled} className={cn('px-2.5 relative h-row', backgroundColorClass, isRowDisabled && 'cursor-not-allowed opacity-50')}>\n {tableActions(rowData, index)}\n <Tooltip title={rowHasPendingEdits ? pendingEditsTooltip : ''}>\n <div\n className={cn(\n 'absolute top-0 left-0 flex items-center justify-center w-full z-20',\n { [backgroundColorClass]: rowHovering !== id || 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 rowHasPendingEdits && 'pointer-events-none',\n )}\n >\n {tableActions(rowData, index)}\n </div>\n </Tooltip>\n </td>\n );\n};\n\nexport const RowActionCell = React.memo(RowActionCellInner);\n"],"names":["RowActionCellInner","disableOptionsForRowIndex","tableActions","index","is_read","showNewItem","is_modified","is_row_modified","is_deleted","currentData","is_added","rowData","id","rowHovering","isDisabled","bgColor","is_incomplete","isInlineEditing","rowHasPendingEdits","pendingEditsTooltip","useTableConfig","backgroundColorClass","useMemo","isRowDisabled","jsxs","cn","jsx","Tooltip","RowActionCell","React"],"mappings":"oTA0BMA,EAAuC,CAAC,CAC5C,0BAAAC,EACA,aAAAC,EAAA,MACAC,EACA,QAAAC,EACA,YAAAC,EACA,YAAAC,EACA,gBAAAC,EACA,WAAAC,EACA,YAAAC,EACA,SAAAC,EACA,QAAAC,EACA,GAAAC,EACA,YAAAC,EACA,WAAAC,EACA,QAAAC,EACA,cAAAC,EACA,gBAAAC,EACA,mBAAAC,CACF,IAAM,CAEJ,MAAMC,EADcC,EAAAA,eAAA,GACqB,IAAI,sCAAsC,GAAK,uCAElFC,EAAuBC,EAAAA,QAAQ,IAC/BL,EAAwB,oCACxBF,IACAP,GAAcC,GAAa,WAAmB,iCAC9CO,GAAiBV,GAAeC,GAAmBE,GAAa,gBAAwB,kCACxFC,GAAYD,GAAa,SAAiB,
|
|
1
|
+
{"version":3,"file":"RowActionCell.cjs.js","sources":["../../../../../../src/components/data-display/infinite-table/body/cell/RowActionCell.tsx"],"sourcesContent":["import Tooltip from '../../../../tooltip/Tooltip';\nimport { useTableConfig } from '../../../../../providers/design-system-provider/hooks';\nimport cn from 'classnames';\nimport React, { useMemo } from 'react';\n\ntype TProps = {\n disableOptionsForRowIndex: number | null;\n tableActions: (rowData: Record<string, unknown>, index: number) => JSX.Element;\n index: number;\n is_read: boolean;\n showNewItem: boolean;\n is_modified: boolean;\n is_row_modified: boolean;\n is_deleted: boolean;\n currentData: Record<string, unknown>;\n is_added: boolean;\n rowData: Record<string, unknown>;\n id: string | number;\n rowHovering: string | number | null;\n isDisabled?: boolean;\n bgColor?: string;\n is_incomplete: boolean;\n isInlineEditing?: boolean;\n rowHasPendingEdits?: boolean;\n};\n\nconst RowActionCellInner: React.FC<TProps> = ({\n disableOptionsForRowIndex,\n tableActions,\n index,\n is_read,\n showNewItem,\n is_modified,\n is_row_modified,\n is_deleted,\n currentData,\n is_added,\n rowData,\n id,\n rowHovering,\n isDisabled,\n bgColor,\n is_incomplete,\n isInlineEditing,\n rowHasPendingEdits,\n}) => {\n const tableConfig = useTableConfig();\n const pendingEditsTooltip = tableConfig?.t?.('Save or cancel pending changes first') ?? 'Save or cancel pending changes first';\n\n const backgroundColorClass = useMemo(() => {\n if (isInlineEditing) return 'bg-primary-50 dark:bg-primary-900';\n if (bgColor) return bgColor;\n if (is_deleted || currentData?.is_deleted) return 'bg-error-100 dark:bg-error-975';\n if (is_incomplete || is_modified || is_row_modified || currentData?.is_row_modified) return 'bg-warning-50 dark:bg-black-500';\n if (is_added || currentData?.is_added) return 'bg-success-50 dark:bg-success-900';\n if (!is_read && showNewItem && !isDisabled) return 'bg-primary-50 dark:bg-black-700';\n return 'bg-white dark:bg-black-800';\n }, [is_incomplete, is_read, showNewItem, is_modified, is_row_modified, is_deleted, currentData, is_added, bgColor, isInlineEditing, isDisabled]);\n\n const isRowDisabled = disableOptionsForRowIndex === index || isDisabled || rowHasPendingEdits;\n\n return (\n <td aria-disabled={isRowDisabled} className={cn('px-2.5 relative h-row', backgroundColorClass, isRowDisabled && 'cursor-not-allowed opacity-50')}>\n {tableActions(rowData, index)}\n <Tooltip title={rowHasPendingEdits ? pendingEditsTooltip : ''}>\n <div\n className={cn(\n 'absolute top-0 left-0 flex items-center justify-center w-full z-20',\n { [backgroundColorClass]: rowHovering !== id || 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 rowHasPendingEdits && 'pointer-events-none',\n )}\n >\n {tableActions(rowData, index)}\n </div>\n </Tooltip>\n </td>\n );\n};\n\nexport const RowActionCell = React.memo(RowActionCellInner);\n"],"names":["RowActionCellInner","disableOptionsForRowIndex","tableActions","index","is_read","showNewItem","is_modified","is_row_modified","is_deleted","currentData","is_added","rowData","id","rowHovering","isDisabled","bgColor","is_incomplete","isInlineEditing","rowHasPendingEdits","pendingEditsTooltip","useTableConfig","backgroundColorClass","useMemo","isRowDisabled","jsxs","cn","jsx","Tooltip","RowActionCell","React"],"mappings":"oTA0BMA,EAAuC,CAAC,CAC5C,0BAAAC,EACA,aAAAC,EAAA,MACAC,EACA,QAAAC,EACA,YAAAC,EACA,YAAAC,EACA,gBAAAC,EACA,WAAAC,EACA,YAAAC,EACA,SAAAC,EACA,QAAAC,EACA,GAAAC,EACA,YAAAC,EACA,WAAAC,EACA,QAAAC,EACA,cAAAC,EACA,gBAAAC,EACA,mBAAAC,CACF,IAAM,CAEJ,MAAMC,EADcC,EAAAA,eAAA,GACqB,IAAI,sCAAsC,GAAK,uCAElFC,EAAuBC,EAAAA,QAAQ,IAC/BL,EAAwB,oCACxBF,IACAP,GAAcC,GAAa,WAAmB,iCAC9CO,GAAiBV,GAAeC,GAAmBE,GAAa,gBAAwB,kCACxFC,GAAYD,GAAa,SAAiB,oCAC1C,CAACL,GAAWC,GAAe,CAACS,EAAmB,kCAC5C,8BACN,CAACE,EAAeZ,EAASC,EAAaC,EAAaC,EAAiBC,EAAYC,EAAaC,EAAUK,EAASE,EAAiBH,CAAU,CAAC,EAEzIS,EAAgBtB,IAA8BE,GAASW,GAAcI,EAE3E,OACEM,EAAAA,KAAC,KAAA,CAAG,gBAAeD,EAAe,UAAWE,EAAG,wBAAyBJ,EAAsBE,GAAiB,+BAA+B,EAC5I,SAAA,CAAArB,EAAaS,EAASR,CAAK,EAC5BuB,EAAAA,IAACC,EAAA,CAAQ,MAAOT,EAAqBC,EAAsB,GACzD,SAAAO,EAAAA,IAAC,MAAA,CACC,UAAWD,EACT,qEACA,CAAE,CAACJ,CAAoB,EAAGR,IAAgBD,GAAMK,CAAA,EAChD,CAAE,mCAAoCJ,IAAgBD,GAAM,CAACK,GAAmB,EAAET,GAAcC,GAAa,aAAe,EAAEC,GAAYD,GAAa,SAAA,EACvJ,CAAE,iCAAkCI,IAAgBD,GAAM,CAACK,IAAoBT,GAAcC,GAAa,WAAA,EAC1G,CAAE,qCAAsCI,IAAgBD,GAAM,CAACK,IAAoBP,GAAYD,GAAa,SAAA,EAC5GS,GAAsB,qBAAA,EAGvB,SAAAhB,EAAaS,EAASR,CAAK,CAAA,CAAA,CAC9B,CACF,CAAA,EACF,CAEJ,EAEayB,EAAgBC,EAAM,KAAK7B,CAAkB"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsxs as T, jsx as
|
|
1
|
+
import { jsxs as T, jsx as d } from "react/jsx-runtime";
|
|
2
2
|
import v from "../../../../tooltip/Tooltip.es.js";
|
|
3
3
|
import { useTableConfig as S } from "../../../../../providers/design-system-provider/hooks.es.js";
|
|
4
|
-
import
|
|
4
|
+
import R from "../../../../../_virtual/index.es.js";
|
|
5
5
|
import z, { useMemo as A } from "react";
|
|
6
6
|
const M = ({
|
|
7
7
|
disableOptionsForRowIndex: j,
|
|
8
8
|
tableActions: p,
|
|
9
|
-
index:
|
|
10
|
-
is_read:
|
|
11
|
-
showNewItem:
|
|
9
|
+
index: l,
|
|
10
|
+
is_read: g,
|
|
11
|
+
showNewItem: m,
|
|
12
12
|
is_modified: k,
|
|
13
13
|
is_row_modified: n,
|
|
14
14
|
is_deleted: o,
|
|
@@ -16,28 +16,28 @@ const M = ({
|
|
|
16
16
|
is_added: c,
|
|
17
17
|
rowData: u,
|
|
18
18
|
id: b,
|
|
19
|
-
rowHovering:
|
|
20
|
-
isDisabled:
|
|
19
|
+
rowHovering: s,
|
|
20
|
+
isDisabled: t,
|
|
21
21
|
bgColor: a,
|
|
22
22
|
is_incomplete: h,
|
|
23
23
|
isInlineEditing: e,
|
|
24
24
|
rowHasPendingEdits: f
|
|
25
25
|
}) => {
|
|
26
|
-
const x = S()?.t?.("Save or cancel pending changes first") ?? "Save or cancel pending changes first", y = A(() => e ? "bg-primary-50 dark:bg-primary-900" : a || (o || r?.is_deleted ? "bg-error-100 dark:bg-error-975" : h || k || n || r?.is_row_modified ? "bg-warning-50 dark:bg-black-500" : c || r?.is_added ? "bg-success-50" : !
|
|
27
|
-
return /* @__PURE__ */ T("td", { "aria-disabled": C, className:
|
|
28
|
-
p(u,
|
|
29
|
-
/* @__PURE__ */
|
|
26
|
+
const x = S()?.t?.("Save or cancel pending changes first") ?? "Save or cancel pending changes first", y = A(() => e ? "bg-primary-50 dark:bg-primary-900" : a || (o || r?.is_deleted ? "bg-error-100 dark:bg-error-975" : h || k || n || r?.is_row_modified ? "bg-warning-50 dark:bg-black-500" : c || r?.is_added ? "bg-success-50 dark:bg-success-900" : !g && m && !t ? "bg-primary-50 dark:bg-black-700" : "bg-white dark:bg-black-800"), [h, g, m, k, n, o, r, c, a, e, t]), C = j === l || t || f;
|
|
27
|
+
return /* @__PURE__ */ T("td", { "aria-disabled": C, className: R("px-2.5 relative h-row", y, C && "cursor-not-allowed opacity-50"), children: [
|
|
28
|
+
p(u, l),
|
|
29
|
+
/* @__PURE__ */ d(v, { title: f ? x : "", children: /* @__PURE__ */ d(
|
|
30
30
|
"div",
|
|
31
31
|
{
|
|
32
|
-
className:
|
|
32
|
+
className: R(
|
|
33
33
|
"absolute top-0 left-0 flex items-center justify-center w-full z-20",
|
|
34
|
-
{ [y]:
|
|
35
|
-
{ "bg-neutral-100 dark:bg-black-600":
|
|
36
|
-
{ "bg-error-200 dark:bg-error-900":
|
|
37
|
-
{ "bg-success-100 dark:bg-success-800":
|
|
34
|
+
{ [y]: s !== b || e },
|
|
35
|
+
{ "bg-neutral-100 dark:bg-black-600": s === b && !e && !(o || r?.is_deleted) && !(c || r?.is_added) },
|
|
36
|
+
{ "bg-error-200 dark:bg-error-900": s === b && !e && (o || r?.is_deleted) },
|
|
37
|
+
{ "bg-success-100 dark:bg-success-800": s === b && !e && (c || r?.is_added) },
|
|
38
38
|
f && "pointer-events-none"
|
|
39
39
|
),
|
|
40
|
-
children: p(u,
|
|
40
|
+
children: p(u, l)
|
|
41
41
|
}
|
|
42
42
|
) })
|
|
43
43
|
] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RowActionCell.es.js","sources":["../../../../../../src/components/data-display/infinite-table/body/cell/RowActionCell.tsx"],"sourcesContent":["import Tooltip from '../../../../tooltip/Tooltip';\nimport { useTableConfig } from '../../../../../providers/design-system-provider/hooks';\nimport cn from 'classnames';\nimport React, { useMemo } from 'react';\n\ntype TProps = {\n disableOptionsForRowIndex: number | null;\n tableActions: (rowData: Record<string, unknown>, index: number) => JSX.Element;\n index: number;\n is_read: boolean;\n showNewItem: boolean;\n is_modified: boolean;\n is_row_modified: boolean;\n is_deleted: boolean;\n currentData: Record<string, unknown>;\n is_added: boolean;\n rowData: Record<string, unknown>;\n id: string | number;\n rowHovering: string | number | null;\n isDisabled?: boolean;\n bgColor?: string;\n is_incomplete: boolean;\n isInlineEditing?: boolean;\n rowHasPendingEdits?: boolean;\n};\n\nconst RowActionCellInner: React.FC<TProps> = ({\n disableOptionsForRowIndex,\n tableActions,\n index,\n is_read,\n showNewItem,\n is_modified,\n is_row_modified,\n is_deleted,\n currentData,\n is_added,\n rowData,\n id,\n rowHovering,\n isDisabled,\n bgColor,\n is_incomplete,\n isInlineEditing,\n rowHasPendingEdits,\n}) => {\n const tableConfig = useTableConfig();\n const pendingEditsTooltip = tableConfig?.t?.('Save or cancel pending changes first') ?? 'Save or cancel pending changes first';\n\n const backgroundColorClass = useMemo(() => {\n if (isInlineEditing) return 'bg-primary-50 dark:bg-primary-900';\n if (bgColor) return bgColor;\n if (is_deleted || currentData?.is_deleted) return 'bg-error-100 dark:bg-error-975';\n if (is_incomplete || is_modified || is_row_modified || currentData?.is_row_modified) return 'bg-warning-50 dark:bg-black-500';\n if (is_added || currentData?.is_added) return 'bg-success-50';\n if (!is_read && showNewItem && !isDisabled) return 'bg-primary-50 dark:bg-black-700';\n return 'bg-white dark:bg-black-800';\n }, [is_incomplete, is_read, showNewItem, is_modified, is_row_modified, is_deleted, currentData, is_added, bgColor, isInlineEditing, isDisabled]);\n\n const isRowDisabled = disableOptionsForRowIndex === index || isDisabled || rowHasPendingEdits;\n\n return (\n <td aria-disabled={isRowDisabled} className={cn('px-2.5 relative h-row', backgroundColorClass, isRowDisabled && 'cursor-not-allowed opacity-50')}>\n {tableActions(rowData, index)}\n <Tooltip title={rowHasPendingEdits ? pendingEditsTooltip : ''}>\n <div\n className={cn(\n 'absolute top-0 left-0 flex items-center justify-center w-full z-20',\n { [backgroundColorClass]: rowHovering !== id || 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 rowHasPendingEdits && 'pointer-events-none',\n )}\n >\n {tableActions(rowData, index)}\n </div>\n </Tooltip>\n </td>\n );\n};\n\nexport const RowActionCell = React.memo(RowActionCellInner);\n"],"names":["RowActionCellInner","disableOptionsForRowIndex","tableActions","index","is_read","showNewItem","is_modified","is_row_modified","is_deleted","currentData","is_added","rowData","id","rowHovering","isDisabled","bgColor","is_incomplete","isInlineEditing","rowHasPendingEdits","pendingEditsTooltip","useTableConfig","backgroundColorClass","useMemo","isRowDisabled","jsxs","cn","jsx","Tooltip","RowActionCell","React"],"mappings":";;;;;AA0BA,MAAMA,IAAuC,CAAC;AAAA,EAC5C,2BAAAC;AAAA,EACA,cAAAC;AAAA,EACA,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,IAAAC;AAAA,EACA,aAAAC;AAAA,EACA,YAAAC;AAAA,EACA,SAAAC;AAAA,EACA,eAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,oBAAAC;AACF,MAAM;AAEJ,QAAMC,IADcC,EAAA,GACqB,IAAI,sCAAsC,KAAK,wCAElFC,IAAuBC,EAAQ,MAC/BL,IAAwB,sCACxBF,MACAP,KAAcC,GAAa,aAAmB,mCAC9CO,KAAiBV,KAAeC,KAAmBE,GAAa,kBAAwB,oCACxFC,KAAYD,GAAa,WAAiB,
|
|
1
|
+
{"version":3,"file":"RowActionCell.es.js","sources":["../../../../../../src/components/data-display/infinite-table/body/cell/RowActionCell.tsx"],"sourcesContent":["import Tooltip from '../../../../tooltip/Tooltip';\nimport { useTableConfig } from '../../../../../providers/design-system-provider/hooks';\nimport cn from 'classnames';\nimport React, { useMemo } from 'react';\n\ntype TProps = {\n disableOptionsForRowIndex: number | null;\n tableActions: (rowData: Record<string, unknown>, index: number) => JSX.Element;\n index: number;\n is_read: boolean;\n showNewItem: boolean;\n is_modified: boolean;\n is_row_modified: boolean;\n is_deleted: boolean;\n currentData: Record<string, unknown>;\n is_added: boolean;\n rowData: Record<string, unknown>;\n id: string | number;\n rowHovering: string | number | null;\n isDisabled?: boolean;\n bgColor?: string;\n is_incomplete: boolean;\n isInlineEditing?: boolean;\n rowHasPendingEdits?: boolean;\n};\n\nconst RowActionCellInner: React.FC<TProps> = ({\n disableOptionsForRowIndex,\n tableActions,\n index,\n is_read,\n showNewItem,\n is_modified,\n is_row_modified,\n is_deleted,\n currentData,\n is_added,\n rowData,\n id,\n rowHovering,\n isDisabled,\n bgColor,\n is_incomplete,\n isInlineEditing,\n rowHasPendingEdits,\n}) => {\n const tableConfig = useTableConfig();\n const pendingEditsTooltip = tableConfig?.t?.('Save or cancel pending changes first') ?? 'Save or cancel pending changes first';\n\n const backgroundColorClass = useMemo(() => {\n if (isInlineEditing) return 'bg-primary-50 dark:bg-primary-900';\n if (bgColor) return bgColor;\n if (is_deleted || currentData?.is_deleted) return 'bg-error-100 dark:bg-error-975';\n if (is_incomplete || is_modified || is_row_modified || currentData?.is_row_modified) return 'bg-warning-50 dark:bg-black-500';\n if (is_added || currentData?.is_added) return 'bg-success-50 dark:bg-success-900';\n if (!is_read && showNewItem && !isDisabled) return 'bg-primary-50 dark:bg-black-700';\n return 'bg-white dark:bg-black-800';\n }, [is_incomplete, is_read, showNewItem, is_modified, is_row_modified, is_deleted, currentData, is_added, bgColor, isInlineEditing, isDisabled]);\n\n const isRowDisabled = disableOptionsForRowIndex === index || isDisabled || rowHasPendingEdits;\n\n return (\n <td aria-disabled={isRowDisabled} className={cn('px-2.5 relative h-row', backgroundColorClass, isRowDisabled && 'cursor-not-allowed opacity-50')}>\n {tableActions(rowData, index)}\n <Tooltip title={rowHasPendingEdits ? pendingEditsTooltip : ''}>\n <div\n className={cn(\n 'absolute top-0 left-0 flex items-center justify-center w-full z-20',\n { [backgroundColorClass]: rowHovering !== id || 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 rowHasPendingEdits && 'pointer-events-none',\n )}\n >\n {tableActions(rowData, index)}\n </div>\n </Tooltip>\n </td>\n );\n};\n\nexport const RowActionCell = React.memo(RowActionCellInner);\n"],"names":["RowActionCellInner","disableOptionsForRowIndex","tableActions","index","is_read","showNewItem","is_modified","is_row_modified","is_deleted","currentData","is_added","rowData","id","rowHovering","isDisabled","bgColor","is_incomplete","isInlineEditing","rowHasPendingEdits","pendingEditsTooltip","useTableConfig","backgroundColorClass","useMemo","isRowDisabled","jsxs","cn","jsx","Tooltip","RowActionCell","React"],"mappings":";;;;;AA0BA,MAAMA,IAAuC,CAAC;AAAA,EAC5C,2BAAAC;AAAA,EACA,cAAAC;AAAA,EACA,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,IAAAC;AAAA,EACA,aAAAC;AAAA,EACA,YAAAC;AAAA,EACA,SAAAC;AAAA,EACA,eAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,oBAAAC;AACF,MAAM;AAEJ,QAAMC,IADcC,EAAA,GACqB,IAAI,sCAAsC,KAAK,wCAElFC,IAAuBC,EAAQ,MAC/BL,IAAwB,sCACxBF,MACAP,KAAcC,GAAa,aAAmB,mCAC9CO,KAAiBV,KAAeC,KAAmBE,GAAa,kBAAwB,oCACxFC,KAAYD,GAAa,WAAiB,sCAC1C,CAACL,KAAWC,KAAe,CAACS,IAAmB,oCAC5C,+BACN,CAACE,GAAeZ,GAASC,GAAaC,GAAaC,GAAiBC,GAAYC,GAAaC,GAAUK,GAASE,GAAiBH,CAAU,CAAC,GAEzIS,IAAgBtB,MAA8BE,KAASW,KAAcI;AAE3E,SACE,gBAAAM,EAAC,MAAA,EAAG,iBAAeD,GAAe,WAAWE,EAAG,yBAAyBJ,GAAsBE,KAAiB,+BAA+B,GAC5I,UAAA;AAAA,IAAArB,EAAaS,GAASR,CAAK;AAAA,IAC5B,gBAAAuB,EAACC,GAAA,EAAQ,OAAOT,IAAqBC,IAAsB,IACzD,UAAA,gBAAAO;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWD;AAAA,UACT;AAAA,UACA,EAAE,CAACJ,CAAoB,GAAGR,MAAgBD,KAAMK,EAAA;AAAA,UAChD,EAAE,oCAAoCJ,MAAgBD,KAAM,CAACK,KAAmB,EAAET,KAAcC,GAAa,eAAe,EAAEC,KAAYD,GAAa,UAAA;AAAA,UACvJ,EAAE,kCAAkCI,MAAgBD,KAAM,CAACK,MAAoBT,KAAcC,GAAa,YAAA;AAAA,UAC1G,EAAE,sCAAsCI,MAAgBD,KAAM,CAACK,MAAoBP,KAAYD,GAAa,UAAA;AAAA,UAC5GS,KAAsB;AAAA,QAAA;AAAA,QAGvB,UAAAhB,EAAaS,GAASR,CAAK;AAAA,MAAA;AAAA,IAAA,EAC9B,CACF;AAAA,EAAA,GACF;AAEJ,GAEayB,IAAgBC,EAAM,KAAK7B,CAAkB;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),ws=require("../../../hooks/useCheckbox.cjs.js"),ps=require("../../../providers/design-system-provider/hooks.cjs.js"),We=require("../../../utils/table.cjs.js"),At=require("../../button/Button.cjs.js"),Fs=require("../../floating-bar/FloatingBar.cjs.js"),we=require("../typography/Typography.cjs.js"),k=require("@dnd-kit/core"),l=require("react"),Ts=require("react-virtualized-auto-sizer"),Os=require("react-dom"),Dt=require("react-table"),ys=require("./body/index.cjs.js"),_t=require("./validateCell.cjs.js"),Rs=require("./body/rows/row.cjs.js"),js=require("./context.cjs.js"),Es=require("./CurrencyDropdownPortal.cjs.js"),ks=require("./head/index.cjs.js"),Ns=require("./PendingEditsFloatingBar.cjs.js"),h=require("./constants.cjs.js"),Mt=require("./useRowHeight.cjs.js"),As=require("../empty-state/NoDataFoundWidgets.cjs.js"),Ds=require("../empty-state/NoDataFound.cjs.js"),_s=require("../../icon/icons.generated.cjs.js"),Ms=Ts.AutoSizer,Lt="Create Column",Ls=(M,T)=>`button-admin-${M.toLowerCase().trim().replace(/\s+/g,"-").replace(/[^a-z0-9-_]/g,"")||T}`,gs=l.memo(({tableKey:M,searchConfig:T={search:"",handleSearch:()=>null,allowAStarSearch:!1},filterConfig:a={columnFilters:[],onFilter:()=>null,onRemoveFilter:()=>null,onClearFilter:()=>null,onResetFilter:()=>Promise.resolve({}),asyncRowOptionsFilter:()=>Promise.resolve({})},sortConfig:m={onSort:()=>null,columnSort:{field:"",order:""},onRemoveSort:()=>null},headerConfig:u={showExportButton:null,showFilters:!0,showSorts:!0,showSearch:!0,showTableView:!0,showTableViewAsModal:!1,content:null,postContent:null,preContent:null,isLoading:!1,showDivider:!1},hoverConfig:gt=null,columns:y,modelName:G,enableMasterDataEnumSuggestions:X=!1,agreementCategoryId:Y,agreementDomainId:Z,agreementId:Q,modificationId:K,lineItemRowId:ee,enumSuggestionsData:te,data:f=[],onRowClick:It,showHeader:pe,tableActions:He,rowOptions:q,hideRowOptionWidth:$e,checkboxUtilities:L,isLoading:le=!1,onScroll:Vt,onScrolling:Bt,isColumnConfigurable:se,onAddColumnClick:re,emptyMessage:ze,noDataWidget:Ue,buttons:Je,onEditColumnClick:Ge,onDeleteColumnClick:Xe,onRowTooltipClick:Pt,tooltiptext:Ct,cascadingTableConfig:qt,originalsOnly:Wt,disableOptionsForRowIndex:Ht,tableHeightClass:ne="h-[calc(100vh-220px)]",getFullRowDataOnClick:$t,selectedRowId:zt=null,onRowEdit:N,onBulkRowEdit:g,inlineEditColumns:Ut,isResizable:Jt=!0,paginationConfig:ae,dndSortableUtils:ce,multipleContexts:Ye,withSortable:Fe,withDraggable:Gt,enableRootDrag:Xt,pageSize:Yt=h.DEFAULT_PAGE_SIZE,onCascadingRowExpand:Zt,totalItems:Ze,showRecordCount:Te=!1,getInnerRowData:Qt,maxLevel:Kt,expandedRows:el={},setExpandedRows:tl,showNewItem:ll,rawData:Qe,dragConfig:sl,isOverlayLoading:rl,style:nl={},floatingBarConfig:Oe,rowWrapper:al,rowLinkConfig:cl,isCellClickDisabled:ol,setHeaderOnParent:ye,optimizeTable:il=!1,multiSelectConfig:ul,headerContextOptions:dl,showHeaderContextOptions:hl,setShowHeaderContextOptions:ml,showDataTypeIcon:fl=!1,rowAdditionalActions:oe,rowAdditionalActionsWidth:Re,setVisibleHeaders:je,cellEditing:vl=null,cellEditingValue:xl=null,allowInlineEdit:Sl=!1,onFieldOperationFlow:bl,fieldOperationLoading:I=null,onTableActionsReady:Ee,onPendingEditsChange:Ke,onCancelPendingEdits:V})=>{const o=ps.useTableConfig(),wl=Mt.getRowSlotHeight(Mt.useRowHeight()),pl=!!T?.search,et=a?.columnFilters?.length>0,W=pl||et,Fl=!!L,O=o?.getTableView?.(M)??null,[p,H]=l.useState(O||null),A=!We.canEditTableView(p,o?.getUserId?.()),[ke,Ne]=l.useState(!1),[Ae,tt]=l.useState(!1),[Tl,lt]=l.useState(null),[S,De]=l.useState(y),st=(f.length===0||!S.length)&&!le,[rt,ie]=l.useState(null),[Ol,yl]=l.useState(!1),[Rl,jl]=l.useState(null),[El,kl]=l.useState(!1),[Nl,ue]=l.useState(null),[Al,de]=l.useState(null),[Dl,nt]=l.useState({}),[$,_e]=l.useState(null),[_l,at]=l.useState(!1),[R,Ml]=l.useState(0),Me=l.useRef(null),Le=l.useRef(null),[ct,Ll]=l.useState({width:0,height:0}),[gl,B]=l.useState(null),[j,ot]=l.useState(null),[Il,it]=l.useState(null),[ut,dt]=l.useState(null),[ge,z]=l.useState({}),Ie=l.useRef(!1),he=l.useRef(!1),Ve=l.useRef(p);Ve.current=p;const ht=l.useRef(o);ht.current=o;const mt=l.useRef(y);mt.current=y;const me=l.useRef(a);me.current=a;const ft=l.useRef(null),vt=l.useRef(()=>({})),xt=l.useRef(()=>({})),[d,E]=l.useState({}),Be=l.useCallback((e,t,r)=>{E(n=>{const c=n[e]?.[t];let i=r.validationError;if(i===void 0){const b=S.find(v=>v.key===t);if(b){const v=_t.validateCellValue(r.value,b);i=v.isValid?null:v.error||"Invalid"}else i=c?.validationError??null}return{...n,[e]:{...n[e]||{},[t]:{...r,validationError:i??null}}}})},[S]),St=l.useCallback(()=>Object.values(d).some(e=>Object.keys(e).length>0),[d]);l.useEffect(()=>{Ee&&Ee({addPendingEdit:Be,hasPendingEdits:St})},[Ee,Be,St]);const Vl=l.useCallback((e,t)=>{E(r=>{const n={...r};if(n[e]){const{[t]:c,...i}=n[e];Object.keys(i).length===0?delete n[e]:n[e]=i}return n})},[]),Bl=l.useCallback((e,t)=>d[e]?.[t],[d]),Pl=l.useCallback((e,t)=>!!d[e]?.[t],[d]),bt=l.useCallback(()=>{I||(V&&Object.keys(d).length>0&&V(d),E({}),z({}),B(null))},[I,V,d]),P=l.useCallback((e,t,r)=>{setTimeout(()=>{o?.dispatchEvent?.("SCROLL_TO_TABLE_ROW",{rowIndex:r});const n=S.findIndex(c=>c.key===t);setTimeout(()=>{const c=document.querySelector(`[${h.DATA_ROW_ID_ATTR}="${e}"] [${h.DATA_COLUMN_KEY_ATTR}="${t}"]`);if(c)c.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});else if(n>0){const i=document.querySelector(h.OS_VIEWPORT_SELECTOR);if(i){let b=0;for(let v=0;v<n;v++){const F=S[v];F?.sticky||(b+=F?.width||h.SCROLL_TO_CELL_COLUMN_WIDTH_FALLBACK)}b=Math.max(0,b-h.SCROLL_TO_CELL_LEFT_OFFSET),i.scrollTo({left:b,behavior:"smooth"})}}B({rowId:e,columnKey:t})},350)},100)},[S,o]),U=l.useCallback(e=>{let t=!1,r=null;const n={},c=new Set;return Object.entries(e).forEach(([i,b])=>{n[i]={},Object.entries(b).forEach(([v,F])=>{const _=S.find(w=>w.key===v),x=_t.validateCellValue(F.value,_);x.isValid?n[i][v]={...F,validationError:null}:(t=!0,x.error&&c.add(x.error),r||(r={rowId:i,columnKey:v}),n[i][v]={...F,validationError:x.error})})}),{hasErrors:t,updatedEdits:n,firstError:r,errorTypes:c}},[S]),fe=l.useCallback(e=>{const t=e.has("Field required"),r=e.size>(t?1:0);return t&&r?"Missing required field(s) and invalid format detected. Please review highlighted field(s).":t?"Missing required field(s). Please review highlighted field(s).":"Invalid field value(s). Please review highlighted field(s)."},[]),wt=l.useCallback(()=>{const{hasErrors:e,updatedEdits:t,firstError:r,errorTypes:n}=U(d);if(e){if(E(t),o?.showNotification?.("error",fe(n)),r){const i=f.findIndex(b=>b.id===r.rowId);P(r.rowId,r.columnKey,i)}return}const c=[];Object.entries(d).forEach(([i,b])=>{const v=f.find(F=>F.id===i);if(v){const F={...v},_={};Object.entries(b).forEach(([x,w])=>{F[x]=w.value,_[x]={value:w.value,meta:w.meta}}),c.push({...F,__editedFields:_})}}),c.length>0&&(g?g(c):N&&N(null,null,null,null,null,{isBulk:!0,rows:c})),E({}),z({}),B(null)},[d,f,N,g,U,fe,P,o]),Cl=l.useCallback(e=>{if(I)return;const t=d[e];t&&V&&V({[e]:t}),E(r=>{const n={...r};return delete n[e],n}),z(r=>{const n={...r};return Object.keys(n).forEach(c=>{c.startsWith(`${e}-`)&&delete n[c]}),n}),B(null)},[I,V,d]),ql=l.useCallback(e=>{const t=d[e];if(!t||Object.keys(t).length===0)return;const{hasErrors:r,updatedEdits:n,firstError:c,errorTypes:i}=U({[e]:t});if(r){if(E(x=>({...x,[e]:n[e]})),o?.showNotification?.("error",fe(i)),c){const x=f.findIndex(w=>w.id===c.rowId);P(c.rowId,c.columnKey,x)}return}const b=f.find(x=>x.id===e);if(!b)return;const v={...b},F={};Object.entries(t).forEach(([x,w])=>{v[x]=w.value,F[x]={value:w.value,meta:w.meta}});const _={...v,__editedFields:F};g?g([_]):N&&N(null,null,null,null,null,{isBulk:!0,rows:[_]}),E(x=>{const w={...x};return delete w[e],w}),z(x=>{const w={...x};return Object.keys(w).forEach(Nt=>{Nt.startsWith(`${e}-`)&&delete w[Nt]}),w}),B(null)},[d,f,N,g,U,fe,P,o]),C=l.useMemo(()=>Object.values(d).reduce((e,t)=>e+Object.keys(t).length,0),[d]);l.useEffect(()=>{Ke?.(C>0,C)},[C,Ke]);const Wl=l.useMemo(()=>{const e=[];return Object.entries(d).forEach(([t,r])=>{const n=f.findIndex(c=>c.id===t);Object.entries(r).forEach(([c,i])=>{const b=S.find(v=>v.key===c);e.push({rowId:t,columnKey:c,fieldName:b?.Header||b?.display_name||c,value:i.value,originalValue:i.originalValue,meta:i.meta,originalMeta:i.originalMeta,rowIndex:n})})}),e},[d,S,f]),Hl=l.useMemo(()=>{const e=new Map;return Object.entries(d).forEach(([t,r])=>{const n=f.findIndex(c=>c.id===t);e.set(t,{rowId:t,rowIndex:n,editCount:Object.keys(r).length})}),Array.from(e.values()).sort((t,r)=>t.rowIndex-r.rowIndex)},[d,f]),$l=l.useCallback(e=>ot(e),[]),ve=l.useCallback(()=>ot(null),[]),zl=l.useCallback((e,t)=>{it({value:e,reference:t}),j?.onSelected&&j.onSelected(e,t),ve()},[j,ve]),Ul=l.useCallback(()=>it(null),[]),Jl=l.useCallback(e=>dt(e),[]),pt=l.useCallback(()=>dt(null),[]),Gl=l.useCallback((e,t)=>{z(r=>({...r,[e]:t}))},[]),Xl=l.useCallback(e=>ge[e],[ge]),Yl=l.useMemo(()=>{const e=ne.match(/h-\[(\d+px)\]/);if(e)return e[1];const t=ne.match(/h-\[(calc\(.+\))\]/);if(t)return t[1].replace(/([+-])/g," $1 ").replace(/\s+/g," ")},[ne]),Zl={isEmpty:st,isFilters:W,isColumnConfigurable:se,handleOnClick:re,emptyMessage:ze,buttons:Je,noDataWidget:Ue},Ql=o?.t?.(Lt)??Lt,xe=W?"No Results Found":ze||"No Data Found",Kl=typeof xe=="string"?o?.t?.(xe)??xe:xe,Ft={__isLoading:!0},es=new Array(1).fill(Ft),ts=new Array(Yt).fill(Ft),J=l.useMemo(()=>S.filter(e=>!!e?.visible),[S]),ls=Dt.useTable({columns:il?J:S,data:[...f,...le?f?.length?es:ts:[]],defaultColumn:{minWidth:h.DEFAULT_COLUMN_MIN_WIDTH,width:h.DEFAULT_COLUMN_WIDTH,maxWidth:h.DEFAULT_COLUMN_MAX_WIDTH}},Dt.useResizeColumns),{getTableProps:Tt,getTableBodyProps:Ot,headerGroups:Se,prepareRow:yt,rows:D}=ls;ft.current=Se;const ss=JSON.stringify(Se[0]?.headers?.map(e=>e?.Header));l.useEffect(()=>{if(je){const e=ft.current;je?.(e?.[0]?.headers?.map(t=>t?.Header)??[])}},[ss,je]);const{checkboxConfig:Rt}=ws.useCheckbox({rows:D,checkedIds:L?.checkedIds,isCheckAllDisabled:L?.isCheckAllDisabled,selectionDisabledRowIds:L?.selectionDisabledRowIds,rawData:Qe,onAllChecked:kl,setCheckedIds:L?.setCheckedIds,checkboxMetadata:L?.checkboxMetadata}),rs=k.useSensors(k.useSensor(k.MouseSensor,{activationConstraint:{distance:h.DND_ACTIVATION_DISTANCE}}),k.useSensor(k.TouchSensor,{activationConstraint:{distance:h.DND_ACTIVATION_DISTANCE}})),ns={easing:h.DROP_ANIMATION_EASING,duration:h.DROP_ANIMATION_DURATION};function as(){return!Ye?.length||!Fe?D:Ye.reduce((e,t)=>(e[t]=D.filter(r=>r.original?.type===t),e),{})}xt.current=as;const cs=e=>{const{active:t}=e;_e(D.find(r=>r.original?.id===t?.id)??null)},os=e=>{const{active:t,over:r}=e;r&&(ce?.checkDndDragEnd&&ce.checkDndDragEnd(t,r,Dl,n=>{nt(n),at(!0),ce.onDragSuccess?.({draggedId:t.id,droppedId:r.id,draggedType:t.data.current?.type,droppedType:r.data.current?.type,updatedList:n,cb:()=>at(!1)})}),_e(null))},is=()=>_e(null),us=e=>{!m?.onSort&&!a?.onFilter||ie(rt===e?null:e)},ds=e=>{jl(e),yl(!Ol),ie(null)},Pe=l.useCallback(()=>{m?.onRemoveSort?m.onRemoveSort():m?.onSort&&m.onSort("","")},[m]),be=l.useCallback((e=null)=>{lt(e),Ne(t=>e?!0:!t)},[]),Ce=l.useCallback(()=>tt(e=>!e),[]),hs=()=>{const e=Se[0]?.headers?.filter(t=>t?.visible!==!1);for(let t=0;t<e.length;t++)if(e[t].sticky)return t-1;return e.length-1},ms=l.useCallback(e=>{let t=0;for(let r=e+1;r<J.length;r++)J[r].visible!==!1&&(t+=J[r].width??0);return oe&&(t+=Re||h.ROW_ADDITIONAL_ACTIONS_DEFAULT_WIDTH),q&&(t+=$e?0:h.ROW_OPTIONS_COLUMN_WIDTH),t},[J,Re,$e,oe,q]),jt=()=>{const e=o?.getUserId?.();return{...p||{},name:p?.name||"Untitled View",created_by:p?.created_by||e,filters:p?.filters||a?.columnFilters,id:p?.id||"untitled-view",table_key:p?.table_key||M,columns:p?.columns||y?.map((t,r)=>({name:t.Header,width:t.width,visible:t.visible,sticky:t.sticky,order:r+1,display_name:t.Header,sequence:r+1,Header:t.Header}))}};vt.current=jt;const fs=(e,t)=>{if(A)return;const r=jt();H({...r,columns:r?.columns?.map(n=>n.name===e?{...n,width:t}:n),unsaved:!0})};l.useEffect(()=>{if(a?.columnFilters?.length>0&&Ne(!0),A)return;const e=Ve.current;if(JSON.stringify(e?.filters||[])!==JSON.stringify(a?.columnFilters||[])){const t=(e?.filters?.length??0)>0,r=a?.columnFilters?.length>0;if(!(t&&!r&&!he.current)){const c=vt.current();H({...c,filters:JSON.parse(JSON.stringify(a?.columnFilters||[])),unsaved:!0})}he.current=!1}},[a?.columnFilters,A]);const vs=l.useCallback(e=>{he.current=!0,a?.onRemoveFilter?.(e)},[a?.onRemoveFilter]),xs=l.useCallback(()=>{he.current=!0,a?.onClearFilter?.()},[a?.onClearFilter]);l.useEffect(()=>{m?.columnSort?.field?(tt(!0),m.columnSort.order==="asc"?(ue(m.columnSort.field),de(null)):m.columnSort.order==="desc"&&(de(m.columnSort.field),ue(null))):(ue(null),de(null))},[m?.columnSort?.field,m?.columnSort?.order]),l.useEffect(()=>{De(We.mergeViewColumnsWithTableColumns(Ve.current?.columns||[],y))},[y]),l.useEffect(()=>{p?.unsaved&&ht.current?.persistTableView?.(p)},[p]),l.useEffect(()=>{nt(xt.current())},[D.length]),l.useEffect(()=>{H(O||null),O?.columns&&De(We.mergeViewColumnsWithTableColumns(O?.columns||[],mt.current)),O?.filters&&O.filters.length>0&&!Ie.current?(requestAnimationFrame(()=>{me.current?.onFilter?.(O.filters)}),Ie.current=!0):O?.filters&&Ie.current&&JSON.stringify(O.filters)!==JSON.stringify(me.current?.columnFilters)&&me.current?.onFilter?.(O.filters)},[O]),l.useEffect(()=>{if(Me.current){const e=new ResizeObserver(t=>Ml(t[0].contentRect.width));return e.observe(Me.current),()=>e.disconnect()}},[]),l.useEffect(()=>{if(!Le.current)return;const e=new ResizeObserver(t=>{const{width:r,height:n}=t[0].contentRect;Ll({width:r,height:n})});return e.observe(Le.current),()=>e.disconnect()},[]);const Et=s.jsx(ks.Head,{isResizable:Jt,headerGroups:Se,isCheckbox:Fl,checkboxConfig:Rt,isAllChecked:El,showHeaderOptions:rt??"",setShowHeaderOptions:ie,isShowSortArrowAsc:Nl,isShowSortArrowDesc:Al,onSort:m?.onSort,onFilter:a?.onFilter,toggleHeaderOption:us,setIsShowSortArrowAsc:ue,setIsShowSortArrowDesc:de,toggleDataFilterModal:be,rowOptions:Array.isArray(q)?q:[],isColumnConfigurable:se??!1,onAddColumnClick:re,onEditColumnClick:Ge,onDeleteColumnClick:Xe,tableActions:He||null,isLoading:le,rowAdditionalActions:oe??null,showPendingEditsColumn:C>0}),kt=s.jsxs(s.Fragment,{children:[_l||rl?s.jsx("div",{className:"absolute left-0 top-0 w-full h-full z-40 flex items-center justify-center bg-neutral-100 dark:bg-black-700"}):null,s.jsx("div",{...Tt(),className:"w-full text-sm text-left text-neutral-500 dark:text-neutral-200 h-full bg-white dark:bg-black-800",children:st?s.jsxs("div",{className:"z-10",children:[Et,s.jsx("div",{className:"absolute w-full",children:o?.renderEmpty?o.renderEmpty(Zl):s.jsxs("div",{className:"flex flex-col items-center justify-center w-full h-[12rem] text-neutral-900 dark:text-neutral-200 mt-8",children:[Ue&&!W?s.jsx(As.NoDataFoundWidgets,{widgetType:"TABLE"}):s.jsx(Ds.NoDataFound,{text:Kl}),se&&!W?s.jsx("div",{className:"my-4",children:s.jsxs(At,{id:"btn-table-shell-create-column",status:"primary",appearance:"ghost",onClick:re,children:[s.jsx(_s.Add2Icon,{className:"text-white dark:text-white"})," ",Ql]})}):null,!W&&Je?.map((e,t)=>s.jsx(At,{status:"secondary",id:Ls(e.label,t),onClick:e.onClick,children:o?.t?.(e.label)??e.label},`${e.label}-${t}`))]})})]}):s.jsx(Ms,{style:{width:"100%",height:"100%"},renderProp:({width:e,height:t})=>{const r=e>0?e:ct.width,n=t>0?t:ct.height;return r>0&&n>0?s.jsx(ys.Body,{getTableBodyProps:Ot,rows:D,prepareRow:yt,isLoading:le,onScroll:Vt,onScrolling:Bt,columns:y,width:r,height:n,withSortable:Fe,allowAstarSearch:T?.allowAStarSearch||!1}):null}})})]}),Ss=l.forwardRef((e,t)=>s.jsxs("div",{className:"h-full w-full",...e,ref:t,children:[Et,s.jsx("div",{className:"relative w-full h-full",children:e?.children})]})),bs=l.forwardRef((e,t)=>s.jsx("div",{className:"h-full w-full",...e,ref:t,children:s.jsx("div",{className:"relative w-full h-full",children:e?.children})})),qe=l.useMemo(()=>o?.renderTableHeader?o.renderTableHeader({tableKey:M,search:T?.search,handleSearch:T?.handleSearch,toggleShowFilters:be,toggleShowSorts:Ce,filterCounts:a?.columnFilters?.length,columns:y,columnFilters:a?.columnFilters,setSelectedTableView:H,selectedTableView:p,enableTableView:u?.showTableView,modelName:G,enableMasterDataEnumSuggestions:X,onRemoveFilter:a?.onRemoveFilter,onClearFilter:a?.onClearFilter,onFilter:a?.onFilter,data:te??f,tableHeaders:S,showTableViewAsModal:u?.showTableViewAsModal,additionalOptions:u?.additionalOptions,inlineActions:u?.inlineActions,showFilters:u?.showFilters,showSorts:u?.showSorts,showSearch:u?.showSearch,isLoading:!!u?.isLoading,setTableHeaders:De,allowAStarSearch:!!T?.allowAStarSearch,withContent:!!u?.content,setShowFilters:Ne,sort:m?.columnSort,onSort:m?.onSort,onRemoveSort:Pe,showExportButton:u?.showExportButton,agreementCategoryId:Y,agreementDomainId:Z,agreementId:Q,modificationId:K,lineItemRowId:ee}):null,[M,T?.search,T?.handleSearch,be,Ce,a?.columnFilters,y,H,p,u,G,a?.onRemoveFilter,a?.onClearFilter,a?.onFilter,f,te,S,m?.columnSort,m?.onSort,Pe,o,T?.allowAStarSearch,X,Y,Z,Q,K,ee]);return l.useEffect(()=>{ye&&ye(qe)},[qe,ye]),s.jsxs(js.TableContext.Provider,{value:{tableWrapper:Ss,tableBodyWrapper:bs,lastNonStickyColumnIndex:hs,search:T?.search,columnFilters:a?.columnFilters,onRowClick:It,onSort:m?.onSort,onFilter:a?.onFilter,toggleShowFilters:be,toggleShowSorts:Ce,onRemoveFilter:a?.onRemoveFilter,onClearFilter:a?.onClearFilter,rowOptions:q,checkboxConfig:Rt,onResetFilter:a?.onResetFilter,isColumnConfigurable:se,onAddColumnClick:re,onEditColumnClick:Ge,onDeleteColumnClick:Xe,onRowTooltipClick:Pt,tooltiptext:Ct,cascadingTableConfig:qt,activeInlineEdit:gl,setActiveInlineEdit:B,originalsOnly:Wt,disableOptionsForRowIndex:Ht,getFullRowDataOnClick:$t,selectedRowId:zt,getSumOfNextVisibleColumnWidth:ms,onRowEdit:N,inlineEditColumns:Ut,tableActions:He,dndSortableUtils:ce,withSortable:Fe,withDraggable:Gt,onCascadingRowExpand:Zt,getInnerRowData:Qt,tableHeaders:S,maxLevel:Kt,expandedRows:el,setExpandedRows:tl,showNewItem:ll,rawData:Qe,dragConfig:sl,rowWrapper:al,rowLinkConfig:cl,isCellClickDisabled:ol,asyncRowOptionsFilter:a?.asyncRowOptionsFilter,handleUpdateColumnWidth:fs,isTableViewReadOnly:A,multiSelectConfig:ul,headerContextOptions:dl,showHeaderContextOptions:hl,setShowHeaderContextOptions:ml,headerDivWidth:R,showDataTypeIcon:fl,rowAdditionalActions:oe,hoverConfig:gt,rowAdditionalActionsWidth:Re,cellEditing:vl,cellEditingValue:xl,openMasterDataModal:$l,closeMasterDataModal:ve,selectedMasterData:Il,clearSelectedMasterData:Ul,allowInlineEdit:Sl,openCurrencyDropdown:Jl,closeCurrencyDropdown:pt,currencyDropdownConfig:ut,selectedCurrenciesMap:ge,setCurrencyForCell:Gl,getCurrencyForCell:Xl,pendingEdits:d,addPendingEdit:Be,removePendingEdit:Vl,getPendingEdit:Bl,hasPendingEdit:Pl,clearAllPendingEdits:bt,saveAllPendingEdits:wt,clearRowPendingEdits:Cl,saveRowPendingEdits:ql,pendingEditsCount:C,scrollToCell:P,onFieldOperationFlow:bl,fieldOperationLoading:I,validateAllPendingEdits:U},children:[pe?s.jsxs("div",{ref:Me,className:`mb-2 flex w-full min-w-0 gap-2 dark:bg-black-800 ${R<h.TOOLBAR_FIRST_BREAKPOINT?"flex-col items-stretch":"flex-row items-center"}`,children:[s.jsxs("div",{className:`flex items-center gap-x-2 gap-y-1 ${R<h.TOOLBAR_FIRST_BREAKPOINT?"w-full flex-wrap":""} ${u?.content?"min-w-0 flex-1":"shrink-0"}`,children:[u?.content?s.jsx("div",{className:`min-w-0 ${R<h.TOOLBAR_FIRST_BREAKPOINT?"w-full":"flex-1"}`,children:u.content}):null,Te?s.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-neutral-500 dark:text-neutral-400 flex-shrink-0","aria-hidden":!0,children:[s.jsx("ellipse",{cx:"12",cy:"5",rx:"9",ry:"3"}),s.jsx("path",{d:"M3 5v4c0 1.66 4.03 3 9 3s9-1.34 9-3V5"}),s.jsx("path",{d:"M3 9v4c0 1.66 4.03 3 9 3s9-1.34 9-3V9"}),s.jsx("path",{d:"M3 13v4c0 1.66 4.03 3 9 3s9-1.34 9-3v-4"})]}),s.jsx(we.Typography,{size:"small",variant:"semibold",appearance:"title",children:(Ze??f.length).toLocaleString()}),s.jsx(we.Typography,{size:"small",variant:"regular",appearance:"subtitle",children:"total records"})]}):u?.preContent?s.jsx("div",{className:"flex min-w-0 shrink-0 justify-start items-center",children:u.preContent}):null]}),s.jsxs("div",{className:`flex min-w-0 items-center justify-end ${R<h.TOOLBAR_FIRST_BREAKPOINT?"w-full":u?.content?"shrink-0":"flex-1"} ${R<h.TOOLBAR_SECOND_BREAKPOINT?"flex-col":"flex-row"} ${u?.postContent?"gap-2":""}`,children:[Te&&u?.preContent?s.jsx("div",{className:"flex w-full justify-start items-center",children:u.preContent}):null,s.jsx("div",{className:`flex justify-end items-center min-w-0 ${R<h.TOOLBAR_SECOND_BREAKPOINT||R<h.TOOLBAR_FIRST_BREAKPOINT?"w-full":""}`,children:qe}),u?.postContent?s.jsx("div",{className:`flex justify-end items-center ${R<h.TOOLBAR_SECOND_BREAKPOINT?"w-full":""}`,children:u.postContent}):null]})]}):null,u?.showDivider?s.jsx("div",{className:"border-b pb-2 w-full dark:bg-black-800"}):null,ke||Ae?s.jsx("div",{className:"flex justify-between items-center pb-4 dark:bg-black-800",children:s.jsxs("div",{className:"flex gap-2 items-center",children:[Ae&&o?.renderSortItem?o.renderSortItem({sort:m?.columnSort,onRemoveSort:Pe,onSort:m?.onSort,tableHeaders:S,data:f,disabled:A}):null,ke&&Ae&&m?.columnSort?.field!==""?s.jsx("div",{className:"h-8 w-[1px] flex-shrink-0 bg-neutral-200"}):null,ke?s.jsxs("div",{className:"flex gap-2 items-center",children:[(et||a?.onResetFilter)&&o?.renderActiveFilters&&o.renderActiveFilters({filters:a?.columnFilters,onRemoveFilter:vs,onClearFilter:xs,onResetFilter:a?.onResetFilter,onFilter:a?.onFilter,tableHeaders:S,columnFilters:a?.columnFilters,modelName:G,enableMasterDataEnumSuggestions:X,noSpacing:!0,notionStyle:a?.notionStyle,context:a?.context,data:te??f,agreementCategoryId:Y,agreementDomainId:Z,agreementId:Q,modificationId:K,lineItemRowId:ee,disabled:A}),o?.renderFilterButtons&&o.renderFilterButtons({onClearFilter:a?.onClearFilter,onClose:ds,modelName:G,enableMasterDataEnumSuggestions:X,defaultFilterColumn:Tl,resetDefaultFilterColumn:()=>lt(null),column:Rl,onFilter:a?.onFilter,tableHeaders:S,columnFilters:a?.columnFilters,data:te??f,notionStyle:a?.notionStyle,context:a?.context,agreementCategoryId:Y,agreementDomainId:Z,agreementId:Q,modificationId:K,lineItemRowId:ee,disabled:A})]}):null]})}):null,Oe&&Object.keys(Oe).length?s.jsx(Fs.FloatingBar,{...Oe}):null,!pe&&Te?s.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-neutral-500 dark:text-neutral-400 flex-shrink-0","aria-hidden":!0,children:[s.jsx("ellipse",{cx:"12",cy:"5",rx:"9",ry:"3"}),s.jsx("path",{d:"M3 5v4c0 1.66 4.03 3 9 3s9-1.34 9-3V5"}),s.jsx("path",{d:"M3 9v4c0 1.66 4.03 3 9 3s9-1.34 9-3V9"}),s.jsx("path",{d:"M3 13v4c0 1.66 4.03 3 9 3s9-1.34 9-3v-4"})]}),s.jsx(we.Typography,{size:"small",variant:"semibold",appearance:"title",children:(Ze??f.length).toLocaleString()}),s.jsx(we.Typography,{size:"small",variant:"regular",appearance:"subtitle",children:"total records"})]}):!pe&&u?.preContent?s.jsx("div",{className:"flex items-center mb-2",children:u.preContent}):null,s.jsx("div",{ref:Le,className:`w-full ${ae?"h-auto":ne} rounded-lg relative border overflow-x-hidden`,style:{...ae?{height:f?.length>0?`${(f?.length+1)*wl+4}px`:"350px"}:{height:Yl},...nl},children:Xt?kt:s.jsxs(k.DndContext,{sensors:rs,onDragEnd:os,onDragStart:cs,onDragCancel:is,collisionDetection:k.closestCorners,children:[kt,$?Os.createPortal(s.jsx(k.DragOverlay,{adjustScale:!0,dropAnimation:ns,children:s.jsx("table",{...Tt(),className:"w-full text-sm text-left text-neutral-500 dark:text-neutral-200 bg-white dark:bg-black-700 table-auto border-collapse",children:s.jsxs("tbody",{...Ot(),className:"bg-transparent divide-y divide-neutral-200",children:[void yt($),s.jsx(Rs.Row,{row:$,index:D?.findIndex(e=>e.id===$.original.id)},$.original.id)]})})}),document.getElementById("full-screen-container")||document.body):null]})}),ae&&o?.renderPagination?o.renderPagination(ae):null,o?.renderMasterDataModal&&o.renderMasterDataModal({isVisible:!!j,onSelected:zl,onClose:ve,masterDataColumnName:j?.masterDataColumnName,masterDataFilters:j?.masterDataFilters,masterDataName:j?.masterDataName,masterDataId:j?.masterDataName,showFilters:!0}),s.jsx(Es.CurrencyDropdownPortal,{config:ut,onClose:pt}),s.jsx(Ns.PendingEditsFloatingBar,{pendingEditsCount:C,pendingEditsList:Wl,rowsWithPendingEdits:Hl,fieldOperationLoading:I,onClearAll:bt,onSaveAll:wt,onScrollToCell:P})]})});exports.InfiniteTable=gs;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),ws=require("../../../hooks/useCheckbox.cjs.js"),ps=require("../../../providers/design-system-provider/hooks.cjs.js"),We=require("../../../utils/table.cjs.js"),At=require("../../button/Button.cjs.js"),Fs=require("../../floating-bar/FloatingBar.cjs.js"),we=require("../typography/Typography.cjs.js"),k=require("@dnd-kit/core"),l=require("react"),Ts=require("react-virtualized-auto-sizer"),Os=require("react-dom"),Dt=require("react-table"),ys=require("./body/index.cjs.js"),_t=require("./validateCell.cjs.js"),Rs=require("./body/rows/row.cjs.js"),js=require("./context.cjs.js"),Es=require("./CurrencyDropdownPortal.cjs.js"),ks=require("./head/index.cjs.js"),Ns=require("./PendingEditsFloatingBar.cjs.js"),h=require("./constants.cjs.js"),Mt=require("./useRowHeight.cjs.js"),As=require("../empty-state/NoDataFoundWidgets.cjs.js"),Ds=require("../empty-state/NoDataFound.cjs.js"),_s=require("../../icon/icons.generated.cjs.js"),Ms=Ts.AutoSizer,Lt="Create Column",Ls=(M,T)=>`button-admin-${M.toLowerCase().trim().replace(/\s+/g,"-").replace(/[^a-z0-9-_]/g,"")||T}`,gs=l.memo(({tableKey:M,searchConfig:T={search:"",handleSearch:()=>null,allowAStarSearch:!1},filterConfig:a={columnFilters:[],onFilter:()=>null,onRemoveFilter:()=>null,onClearFilter:()=>null,onResetFilter:()=>Promise.resolve({}),asyncRowOptionsFilter:()=>Promise.resolve({})},sortConfig:m={onSort:()=>null,columnSort:{field:"",order:""},onRemoveSort:()=>null},headerConfig:u={showExportButton:null,showFilters:!0,showSorts:!0,showSearch:!0,showTableView:!0,showTableViewAsModal:!1,content:null,postContent:null,preContent:null,isLoading:!1,showDivider:!1},hoverConfig:gt=null,columns:y,modelName:G,enableMasterDataEnumSuggestions:X=!1,agreementCategoryId:Y,agreementDomainId:Z,agreementId:Q,modificationId:K,lineItemRowId:ee,enumSuggestionsData:te,data:f=[],onRowClick:It,showHeader:pe,tableActions:He,rowOptions:q,hideRowOptionWidth:$e,checkboxUtilities:L,isLoading:le=!1,onScroll:Vt,onScrolling:Bt,isColumnConfigurable:se,onAddColumnClick:re,emptyMessage:ze,noDataWidget:Ue,buttons:Je,onEditColumnClick:Ge,onDeleteColumnClick:Xe,onRowTooltipClick:Pt,tooltiptext:Ct,cascadingTableConfig:qt,originalsOnly:Wt,disableOptionsForRowIndex:Ht,tableHeightClass:ne="h-[calc(100vh-220px)]",getFullRowDataOnClick:$t,selectedRowId:zt=null,onRowEdit:N,onBulkRowEdit:g,inlineEditColumns:Ut,isResizable:Jt=!0,paginationConfig:ae,dndSortableUtils:ce,multipleContexts:Ye,withSortable:Fe,withDraggable:Gt,enableRootDrag:Xt,pageSize:Yt=h.DEFAULT_PAGE_SIZE,onCascadingRowExpand:Zt,totalItems:Ze,showRecordCount:Te=!1,getInnerRowData:Qt,maxLevel:Kt,expandedRows:el={},setExpandedRows:tl,showNewItem:ll,rawData:Qe,dragConfig:sl,isOverlayLoading:rl,style:nl={},floatingBarConfig:Oe,rowWrapper:al,rowLinkConfig:cl,isCellClickDisabled:ol,setHeaderOnParent:ye,optimizeTable:il=!1,multiSelectConfig:ul,headerContextOptions:dl,showHeaderContextOptions:hl,setShowHeaderContextOptions:ml,showDataTypeIcon:fl=!1,rowAdditionalActions:oe,rowAdditionalActionsWidth:Re,setVisibleHeaders:je,cellEditing:vl=null,cellEditingValue:xl=null,allowInlineEdit:Sl=!1,onFieldOperationFlow:bl,fieldOperationLoading:I=null,onTableActionsReady:Ee,onPendingEditsChange:Ke,onCancelPendingEdits:V})=>{const o=ps.useTableConfig(),wl=Mt.getRowSlotHeight(Mt.useRowHeight()),pl=!!T?.search,et=a?.columnFilters?.length>0,W=pl||et,Fl=!!L,O=o?.getTableView?.(M)??null,[p,H]=l.useState(O||null),A=!We.canEditTableView(p,o?.getUserId?.()),[ke,Ne]=l.useState(!1),[Ae,tt]=l.useState(!1),[Tl,lt]=l.useState(null),[S,De]=l.useState(y),st=(f.length===0||!S.length)&&!le,[rt,ie]=l.useState(null),[Ol,yl]=l.useState(!1),[Rl,jl]=l.useState(null),[El,kl]=l.useState(!1),[Nl,ue]=l.useState(null),[Al,de]=l.useState(null),[Dl,nt]=l.useState({}),[$,_e]=l.useState(null),[_l,at]=l.useState(!1),[R,Ml]=l.useState(0),Me=l.useRef(null),Le=l.useRef(null),[ct,Ll]=l.useState({width:0,height:0}),[gl,B]=l.useState(null),[j,ot]=l.useState(null),[Il,it]=l.useState(null),[ut,dt]=l.useState(null),[ge,z]=l.useState({}),Ie=l.useRef(!1),he=l.useRef(!1),Ve=l.useRef(p);Ve.current=p;const ht=l.useRef(o);ht.current=o;const mt=l.useRef(y);mt.current=y;const me=l.useRef(a);me.current=a;const ft=l.useRef(null),vt=l.useRef(()=>({})),xt=l.useRef(()=>({})),[d,E]=l.useState({}),Be=l.useCallback((e,t,r)=>{E(n=>{const c=n[e]?.[t];let i=r.validationError;if(i===void 0){const b=S.find(v=>v.key===t);if(b){const v=_t.validateCellValue(r.value,b);i=v.isValid?null:v.error||"Invalid"}else i=c?.validationError??null}return{...n,[e]:{...n[e]||{},[t]:{...r,validationError:i??null}}}})},[S]),St=l.useCallback(()=>Object.values(d).some(e=>Object.keys(e).length>0),[d]);l.useEffect(()=>{Ee&&Ee({addPendingEdit:Be,hasPendingEdits:St})},[Ee,Be,St]);const Vl=l.useCallback((e,t)=>{E(r=>{const n={...r};if(n[e]){const{[t]:c,...i}=n[e];Object.keys(i).length===0?delete n[e]:n[e]=i}return n})},[]),Bl=l.useCallback((e,t)=>d[e]?.[t],[d]),Pl=l.useCallback((e,t)=>!!d[e]?.[t],[d]),bt=l.useCallback(()=>{I||(V&&Object.keys(d).length>0&&V(d),E({}),z({}),B(null))},[I,V,d]),P=l.useCallback((e,t,r)=>{setTimeout(()=>{o?.dispatchEvent?.("SCROLL_TO_TABLE_ROW",{rowIndex:r});const n=S.findIndex(c=>c.key===t);setTimeout(()=>{const c=document.querySelector(`[${h.DATA_ROW_ID_ATTR}="${e}"] [${h.DATA_COLUMN_KEY_ATTR}="${t}"]`);if(c)c.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});else if(n>0){const i=document.querySelector(h.OS_VIEWPORT_SELECTOR);if(i){let b=0;for(let v=0;v<n;v++){const F=S[v];F?.sticky||(b+=F?.width||h.SCROLL_TO_CELL_COLUMN_WIDTH_FALLBACK)}b=Math.max(0,b-h.SCROLL_TO_CELL_LEFT_OFFSET),i.scrollTo({left:b,behavior:"smooth"})}}B({rowId:e,columnKey:t})},350)},100)},[S,o]),U=l.useCallback(e=>{let t=!1,r=null;const n={},c=new Set;return Object.entries(e).forEach(([i,b])=>{n[i]={},Object.entries(b).forEach(([v,F])=>{const _=S.find(w=>w.key===v),x=_t.validateCellValue(F.value,_);x.isValid?n[i][v]={...F,validationError:null}:(t=!0,x.error&&c.add(x.error),r||(r={rowId:i,columnKey:v}),n[i][v]={...F,validationError:x.error})})}),{hasErrors:t,updatedEdits:n,firstError:r,errorTypes:c}},[S]),fe=l.useCallback(e=>{const t=e.has("Field required"),r=e.size>(t?1:0);return t&&r?"Missing required field(s) and invalid format detected. Please review highlighted field(s).":t?"Missing required field(s). Please review highlighted field(s).":"Invalid field value(s). Please review highlighted field(s)."},[]),wt=l.useCallback(()=>{const{hasErrors:e,updatedEdits:t,firstError:r,errorTypes:n}=U(d);if(e){if(E(t),o?.showNotification?.("error",fe(n)),r){const i=f.findIndex(b=>b.id===r.rowId);P(r.rowId,r.columnKey,i)}return}const c=[];Object.entries(d).forEach(([i,b])=>{const v=f.find(F=>F.id===i);if(v){const F={...v},_={};Object.entries(b).forEach(([x,w])=>{F[x]=w.value,_[x]={value:w.value,meta:w.meta}}),c.push({...F,__editedFields:_})}}),c.length>0&&(g?g(c):N&&N(null,null,null,null,null,{isBulk:!0,rows:c})),E({}),z({}),B(null)},[d,f,N,g,U,fe,P,o]),Cl=l.useCallback(e=>{if(I)return;const t=d[e];t&&V&&V({[e]:t}),E(r=>{const n={...r};return delete n[e],n}),z(r=>{const n={...r};return Object.keys(n).forEach(c=>{c.startsWith(`${e}-`)&&delete n[c]}),n}),B(null)},[I,V,d]),ql=l.useCallback(e=>{const t=d[e];if(!t||Object.keys(t).length===0)return;const{hasErrors:r,updatedEdits:n,firstError:c,errorTypes:i}=U({[e]:t});if(r){if(E(x=>({...x,[e]:n[e]})),o?.showNotification?.("error",fe(i)),c){const x=f.findIndex(w=>w.id===c.rowId);P(c.rowId,c.columnKey,x)}return}const b=f.find(x=>x.id===e);if(!b)return;const v={...b},F={};Object.entries(t).forEach(([x,w])=>{v[x]=w.value,F[x]={value:w.value,meta:w.meta}});const _={...v,__editedFields:F};g?g([_]):N&&N(null,null,null,null,null,{isBulk:!0,rows:[_]}),E(x=>{const w={...x};return delete w[e],w}),z(x=>{const w={...x};return Object.keys(w).forEach(Nt=>{Nt.startsWith(`${e}-`)&&delete w[Nt]}),w}),B(null)},[d,f,N,g,U,fe,P,o]),C=l.useMemo(()=>Object.values(d).reduce((e,t)=>e+Object.keys(t).length,0),[d]);l.useEffect(()=>{Ke?.(C>0,C)},[C,Ke]);const Wl=l.useMemo(()=>{const e=[];return Object.entries(d).forEach(([t,r])=>{const n=f.findIndex(c=>c.id===t);Object.entries(r).forEach(([c,i])=>{const b=S.find(v=>v.key===c);e.push({rowId:t,columnKey:c,fieldName:b?.Header||b?.display_name||c,value:i.value,originalValue:i.originalValue,meta:i.meta,originalMeta:i.originalMeta,rowIndex:n})})}),e},[d,S,f]),Hl=l.useMemo(()=>{const e=new Map;return Object.entries(d).forEach(([t,r])=>{const n=f.findIndex(c=>c.id===t);e.set(t,{rowId:t,rowIndex:n,editCount:Object.keys(r).length})}),Array.from(e.values()).sort((t,r)=>t.rowIndex-r.rowIndex)},[d,f]),$l=l.useCallback(e=>ot(e),[]),ve=l.useCallback(()=>ot(null),[]),zl=l.useCallback((e,t)=>{it({value:e,reference:t}),j?.onSelected&&j.onSelected(e,t),ve()},[j,ve]),Ul=l.useCallback(()=>it(null),[]),Jl=l.useCallback(e=>dt(e),[]),pt=l.useCallback(()=>dt(null),[]),Gl=l.useCallback((e,t)=>{z(r=>({...r,[e]:t}))},[]),Xl=l.useCallback(e=>ge[e],[ge]),Yl=l.useMemo(()=>{const e=ne.match(/h-\[(\d+px)\]/);if(e)return e[1];const t=ne.match(/h-\[(calc\(.+\))\]/);if(t)return t[1].replace(/([+-])/g," $1 ").replace(/\s+/g," ")},[ne]),Zl={isEmpty:st,isFilters:W,isColumnConfigurable:se,handleOnClick:re,emptyMessage:ze,buttons:Je,noDataWidget:Ue},Ql=o?.t?.(Lt)??Lt,xe=W?"No Results Found":ze||"No Data Found",Kl=typeof xe=="string"?o?.t?.(xe)??xe:xe,Ft={__isLoading:!0},es=new Array(1).fill(Ft),ts=new Array(Yt).fill(Ft),J=l.useMemo(()=>S.filter(e=>!!e?.visible),[S]),ls=Dt.useTable({columns:il?J:S,data:[...f,...le?f?.length?es:ts:[]],defaultColumn:{minWidth:h.DEFAULT_COLUMN_MIN_WIDTH,width:h.DEFAULT_COLUMN_WIDTH,maxWidth:h.DEFAULT_COLUMN_MAX_WIDTH}},Dt.useResizeColumns),{getTableProps:Tt,getTableBodyProps:Ot,headerGroups:Se,prepareRow:yt,rows:D}=ls;ft.current=Se;const ss=JSON.stringify(Se[0]?.headers?.map(e=>e?.Header));l.useEffect(()=>{if(je){const e=ft.current;je?.(e?.[0]?.headers?.map(t=>t?.Header)??[])}},[ss,je]);const{checkboxConfig:Rt}=ws.useCheckbox({rows:D,checkedIds:L?.checkedIds,isCheckAllDisabled:L?.isCheckAllDisabled,selectionDisabledRowIds:L?.selectionDisabledRowIds,rawData:Qe,onAllChecked:kl,setCheckedIds:L?.setCheckedIds,checkboxMetadata:L?.checkboxMetadata}),rs=k.useSensors(k.useSensor(k.MouseSensor,{activationConstraint:{distance:h.DND_ACTIVATION_DISTANCE}}),k.useSensor(k.TouchSensor,{activationConstraint:{distance:h.DND_ACTIVATION_DISTANCE}})),ns={easing:h.DROP_ANIMATION_EASING,duration:h.DROP_ANIMATION_DURATION};function as(){return!Ye?.length||!Fe?D:Ye.reduce((e,t)=>(e[t]=D.filter(r=>r.original?.type===t),e),{})}xt.current=as;const cs=e=>{const{active:t}=e;_e(D.find(r=>r.original?.id===t?.id)??null)},os=e=>{const{active:t,over:r}=e;r&&(ce?.checkDndDragEnd&&ce.checkDndDragEnd(t,r,Dl,n=>{nt(n),at(!0),ce.onDragSuccess?.({draggedId:t.id,droppedId:r.id,draggedType:t.data.current?.type,droppedType:r.data.current?.type,updatedList:n,cb:()=>at(!1)})}),_e(null))},is=()=>_e(null),us=e=>{!m?.onSort&&!a?.onFilter||ie(rt===e?null:e)},ds=e=>{jl(e),yl(!Ol),ie(null)},Pe=l.useCallback(()=>{m?.onRemoveSort?m.onRemoveSort():m?.onSort&&m.onSort("","")},[m]),be=l.useCallback((e=null)=>{lt(e),Ne(t=>e?!0:!t)},[]),Ce=l.useCallback(()=>tt(e=>!e),[]),hs=()=>{const e=Se[0]?.headers?.filter(t=>t?.visible!==!1);for(let t=0;t<e.length;t++)if(e[t].sticky)return t-1;return e.length-1},ms=l.useCallback(e=>{let t=0;for(let r=e+1;r<J.length;r++)J[r].visible!==!1&&(t+=J[r].width??0);return oe&&(t+=Re||h.ROW_ADDITIONAL_ACTIONS_DEFAULT_WIDTH),q&&(t+=$e?0:h.ROW_OPTIONS_COLUMN_WIDTH),t},[J,Re,$e,oe,q]),jt=()=>{const e=o?.getUserId?.();return{...p||{},name:p?.name||"Untitled View",created_by:p?.created_by||e,filters:p?.filters||a?.columnFilters,id:p?.id||"untitled-view",table_key:p?.table_key||M,columns:p?.columns||y?.map((t,r)=>({name:t.Header,width:t.width,visible:t.visible,sticky:t.sticky,order:r+1,display_name:t.Header,sequence:r+1,Header:t.Header}))}};vt.current=jt;const fs=(e,t)=>{if(A)return;const r=jt();H({...r,columns:r?.columns?.map(n=>n.name===e?{...n,width:t}:n),unsaved:!0})};l.useEffect(()=>{if(a?.columnFilters?.length>0&&Ne(!0),A)return;const e=Ve.current;if(JSON.stringify(e?.filters||[])!==JSON.stringify(a?.columnFilters||[])){const t=(e?.filters?.length??0)>0,r=a?.columnFilters?.length>0;if(!(t&&!r&&!he.current)){const c=vt.current();H({...c,filters:JSON.parse(JSON.stringify(a?.columnFilters||[])),unsaved:!0})}he.current=!1}},[a?.columnFilters,A]);const vs=l.useCallback(e=>{he.current=!0,a?.onRemoveFilter?.(e)},[a?.onRemoveFilter]),xs=l.useCallback(()=>{he.current=!0,a?.onClearFilter?.()},[a?.onClearFilter]);l.useEffect(()=>{m?.columnSort?.field?(tt(!0),m.columnSort.order==="asc"?(ue(m.columnSort.field),de(null)):m.columnSort.order==="desc"&&(de(m.columnSort.field),ue(null))):(ue(null),de(null))},[m?.columnSort?.field,m?.columnSort?.order]),l.useEffect(()=>{De(We.mergeViewColumnsWithTableColumns(Ve.current?.columns||[],y))},[y]),l.useEffect(()=>{p?.unsaved&&ht.current?.persistTableView?.(p)},[p]),l.useEffect(()=>{nt(xt.current())},[D.length]),l.useEffect(()=>{H(O||null),O?.columns&&De(We.mergeViewColumnsWithTableColumns(O?.columns||[],mt.current)),O?.filters&&O.filters.length>0&&!Ie.current?(requestAnimationFrame(()=>{me.current?.onFilter?.(O.filters)}),Ie.current=!0):O?.filters&&Ie.current&&JSON.stringify(O.filters)!==JSON.stringify(me.current?.columnFilters)&&me.current?.onFilter?.(O.filters)},[O]),l.useEffect(()=>{if(Me.current){const e=new ResizeObserver(t=>Ml(t[0].contentRect.width));return e.observe(Me.current),()=>e.disconnect()}},[]),l.useEffect(()=>{if(!Le.current)return;const e=new ResizeObserver(t=>{const{width:r,height:n}=t[0].contentRect;Ll({width:r,height:n})});return e.observe(Le.current),()=>e.disconnect()},[]);const Et=s.jsx(ks.Head,{isResizable:Jt,headerGroups:Se,isCheckbox:Fl,checkboxConfig:Rt,isAllChecked:El,showHeaderOptions:rt??"",setShowHeaderOptions:ie,isShowSortArrowAsc:Nl,isShowSortArrowDesc:Al,onSort:m?.onSort,onFilter:a?.onFilter,toggleHeaderOption:us,setIsShowSortArrowAsc:ue,setIsShowSortArrowDesc:de,toggleDataFilterModal:be,rowOptions:Array.isArray(q)?q:[],isColumnConfigurable:se??!1,onAddColumnClick:re,onEditColumnClick:Ge,onDeleteColumnClick:Xe,tableActions:He||null,isLoading:le,rowAdditionalActions:oe??null,showPendingEditsColumn:C>0}),kt=s.jsxs(s.Fragment,{children:[_l||rl?s.jsx("div",{className:"absolute left-0 top-0 w-full h-full z-40 flex items-center justify-center bg-neutral-100 dark:bg-black-700"}):null,s.jsx("div",{...Tt(),className:"w-full text-sm text-left text-neutral-500 dark:text-neutral-200 h-full bg-white dark:bg-black-800",children:st?s.jsxs("div",{className:"z-10",children:[Et,s.jsx("div",{className:"absolute w-full",children:o?.renderEmpty?o.renderEmpty(Zl):s.jsxs("div",{className:"flex flex-col items-center justify-center w-full h-[12rem] text-neutral-900 dark:text-neutral-200 mt-8",children:[Ue&&!W?s.jsx(As.NoDataFoundWidgets,{widgetType:"TABLE"}):s.jsx(Ds.NoDataFound,{text:Kl}),se&&!W?s.jsx("div",{className:"my-4",children:s.jsxs(At,{id:"btn-table-shell-create-column",status:"primary",appearance:"ghost",onClick:re,children:[s.jsx(_s.Add2Icon,{className:"text-white dark:text-white"})," ",Ql]})}):null,!W&&Je?.map((e,t)=>s.jsx(At,{status:"secondary",id:Ls(e.label,t),onClick:e.onClick,children:o?.t?.(e.label)??e.label},`${e.label}-${t}`))]})})]}):s.jsx(Ms,{style:{width:"100%",height:"100%"},renderProp:({width:e,height:t})=>{const r=e>0?e:ct.width,n=t>0?t:ct.height;return r>0&&n>0?s.jsx(ys.Body,{getTableBodyProps:Ot,rows:D,prepareRow:yt,isLoading:le,onScroll:Vt,onScrolling:Bt,columns:y,width:r,height:n,withSortable:Fe,allowAstarSearch:T?.allowAStarSearch||!1}):null}})})]}),Ss=l.forwardRef((e,t)=>s.jsxs("div",{className:"h-full w-full",...e,ref:t,children:[Et,s.jsx("div",{className:"relative w-full h-full",children:e?.children})]})),bs=l.forwardRef((e,t)=>s.jsx("div",{className:"h-full w-full",...e,ref:t,children:s.jsx("div",{className:"relative w-full h-full",children:e?.children})})),qe=l.useMemo(()=>o?.renderTableHeader?o.renderTableHeader({tableKey:M,search:T?.search,handleSearch:T?.handleSearch,toggleShowFilters:be,toggleShowSorts:Ce,filterCounts:a?.columnFilters?.length,columns:y,columnFilters:a?.columnFilters,setSelectedTableView:H,selectedTableView:p,enableTableView:u?.showTableView,modelName:G,enableMasterDataEnumSuggestions:X,onRemoveFilter:a?.onRemoveFilter,onClearFilter:a?.onClearFilter,onFilter:a?.onFilter,data:te??f,tableHeaders:S,showTableViewAsModal:u?.showTableViewAsModal,additionalOptions:u?.additionalOptions,inlineActions:u?.inlineActions,showFilters:u?.showFilters,showSorts:u?.showSorts,showSearch:u?.showSearch,isLoading:!!u?.isLoading,setTableHeaders:De,allowAStarSearch:!!T?.allowAStarSearch,withContent:!!u?.content,setShowFilters:Ne,sort:m?.columnSort,onSort:m?.onSort,onRemoveSort:Pe,showExportButton:u?.showExportButton,agreementCategoryId:Y,agreementDomainId:Z,agreementId:Q,modificationId:K,lineItemRowId:ee}):null,[M,T?.search,T?.handleSearch,be,Ce,a?.columnFilters,y,H,p,u,G,a?.onRemoveFilter,a?.onClearFilter,a?.onFilter,f,te,S,m?.columnSort,m?.onSort,Pe,o,T?.allowAStarSearch,X,Y,Z,Q,K,ee]);return l.useEffect(()=>{ye&&ye(qe)},[qe,ye]),s.jsxs(js.TableContext.Provider,{value:{tableWrapper:Ss,tableBodyWrapper:bs,lastNonStickyColumnIndex:hs,search:T?.search,columnFilters:a?.columnFilters,onRowClick:It,onSort:m?.onSort,onFilter:a?.onFilter,toggleShowFilters:be,toggleShowSorts:Ce,onRemoveFilter:a?.onRemoveFilter,onClearFilter:a?.onClearFilter,rowOptions:q,checkboxConfig:Rt,onResetFilter:a?.onResetFilter,isColumnConfigurable:se,onAddColumnClick:re,onEditColumnClick:Ge,onDeleteColumnClick:Xe,onRowTooltipClick:Pt,tooltiptext:Ct,cascadingTableConfig:qt,activeInlineEdit:gl,setActiveInlineEdit:B,originalsOnly:Wt,disableOptionsForRowIndex:Ht,getFullRowDataOnClick:$t,selectedRowId:zt,getSumOfNextVisibleColumnWidth:ms,onRowEdit:N,inlineEditColumns:Ut,tableActions:He,dndSortableUtils:ce,withSortable:Fe,withDraggable:Gt,onCascadingRowExpand:Zt,getInnerRowData:Qt,tableHeaders:S,maxLevel:Kt,expandedRows:el,setExpandedRows:tl,showNewItem:ll,rawData:Qe,dragConfig:sl,rowWrapper:al,rowLinkConfig:cl,isCellClickDisabled:ol,asyncRowOptionsFilter:a?.asyncRowOptionsFilter,handleUpdateColumnWidth:fs,isTableViewReadOnly:A,multiSelectConfig:ul,headerContextOptions:dl,showHeaderContextOptions:hl,setShowHeaderContextOptions:ml,headerDivWidth:R,showDataTypeIcon:fl,rowAdditionalActions:oe,hoverConfig:gt,rowAdditionalActionsWidth:Re,cellEditing:vl,cellEditingValue:xl,openMasterDataModal:$l,closeMasterDataModal:ve,selectedMasterData:Il,clearSelectedMasterData:Ul,allowInlineEdit:Sl,openCurrencyDropdown:Jl,closeCurrencyDropdown:pt,currencyDropdownConfig:ut,selectedCurrenciesMap:ge,setCurrencyForCell:Gl,getCurrencyForCell:Xl,pendingEdits:d,addPendingEdit:Be,removePendingEdit:Vl,getPendingEdit:Bl,hasPendingEdit:Pl,clearAllPendingEdits:bt,saveAllPendingEdits:wt,clearRowPendingEdits:Cl,saveRowPendingEdits:ql,pendingEditsCount:C,scrollToCell:P,onFieldOperationFlow:bl,fieldOperationLoading:I,validateAllPendingEdits:U},children:[pe?s.jsxs("div",{ref:Me,className:`mb-2 flex w-full min-w-0 gap-2 dark:bg-black-800 ${R<h.TOOLBAR_FIRST_BREAKPOINT?"flex-col items-stretch":"flex-row items-center"}`,children:[s.jsxs("div",{className:`flex items-center gap-x-2 gap-y-1 ${R<h.TOOLBAR_FIRST_BREAKPOINT?"w-full flex-wrap":""} ${u?.content?"min-w-0 flex-1":"shrink-0"}`,children:[u?.content?s.jsx("div",{className:`min-w-0 ${R<h.TOOLBAR_FIRST_BREAKPOINT?"w-full":"flex-1"}`,children:u.content}):null,Te?s.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-neutral-500 dark:text-neutral-400 flex-shrink-0","aria-hidden":!0,children:[s.jsx("ellipse",{cx:"12",cy:"5",rx:"9",ry:"3"}),s.jsx("path",{d:"M3 5v4c0 1.66 4.03 3 9 3s9-1.34 9-3V5"}),s.jsx("path",{d:"M3 9v4c0 1.66 4.03 3 9 3s9-1.34 9-3V9"}),s.jsx("path",{d:"M3 13v4c0 1.66 4.03 3 9 3s9-1.34 9-3v-4"})]}),s.jsx(we.Typography,{size:"small",variant:"semibold",appearance:"title",children:(Ze??f.length).toLocaleString()}),s.jsx(we.Typography,{size:"small",variant:"regular",appearance:"subtitle",children:"total records"})]}):u?.preContent?s.jsx("div",{className:"flex min-w-0 shrink-0 justify-start items-center",children:u.preContent}):null]}),s.jsxs("div",{className:`flex min-w-0 items-center justify-end ${R<h.TOOLBAR_FIRST_BREAKPOINT?"w-full":u?.content?"shrink-0":"flex-1"} ${R<h.TOOLBAR_SECOND_BREAKPOINT?"flex-col":"flex-row"} ${u?.postContent?"gap-2":""}`,children:[Te&&u?.preContent?s.jsx("div",{className:"flex w-full justify-start items-center",children:u.preContent}):null,s.jsx("div",{className:`flex justify-end items-center min-w-0 ${R<h.TOOLBAR_SECOND_BREAKPOINT||R<h.TOOLBAR_FIRST_BREAKPOINT?"w-full":""}`,children:qe}),u?.postContent?s.jsx("div",{className:`flex justify-end items-center ${R<h.TOOLBAR_SECOND_BREAKPOINT?"w-full":""}`,children:u.postContent}):null]})]}):null,u?.showDivider?s.jsx("div",{className:"border-b pb-2 w-full dark:bg-black-800"}):null,ke||Ae?s.jsx("div",{className:"flex justify-between items-center pb-4 dark:bg-black-800",children:s.jsxs("div",{className:"flex gap-2 items-center",children:[Ae&&o?.renderSortItem?o.renderSortItem({sort:m?.columnSort,onRemoveSort:Pe,onSort:m?.onSort,tableHeaders:S,data:f,disabled:A}):null,ke&&Ae&&m?.columnSort?.field!==""?s.jsx("div",{className:"h-8 w-[1px] flex-shrink-0 bg-neutral-200"}):null,ke?s.jsxs("div",{className:"flex gap-2 items-center",children:[(et||a?.onResetFilter)&&o?.renderActiveFilters&&o.renderActiveFilters({filters:a?.columnFilters,onRemoveFilter:vs,onClearFilter:xs,onResetFilter:a?.onResetFilter,onFilter:a?.onFilter,tableHeaders:S,columnFilters:a?.columnFilters,modelName:G,enableMasterDataEnumSuggestions:X,noSpacing:!0,notionStyle:a?.notionStyle,context:a?.context,data:te??f,agreementCategoryId:Y,agreementDomainId:Z,agreementId:Q,modificationId:K,lineItemRowId:ee,disabled:A}),o?.renderFilterButtons&&o.renderFilterButtons({onClearFilter:a?.onClearFilter,onClose:ds,modelName:G,enableMasterDataEnumSuggestions:X,defaultFilterColumn:Tl,resetDefaultFilterColumn:()=>lt(null),column:Rl,onFilter:a?.onFilter,tableHeaders:S,columnFilters:a?.columnFilters,data:te??f,notionStyle:a?.notionStyle,context:a?.context,agreementCategoryId:Y,agreementDomainId:Z,agreementId:Q,modificationId:K,lineItemRowId:ee,disabled:A})]}):null]})}):null,Oe&&Object.keys(Oe).length?s.jsx(Fs.FloatingBar,{...Oe}):null,!pe&&Te?s.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-neutral-500 dark:text-neutral-400 flex-shrink-0","aria-hidden":!0,children:[s.jsx("ellipse",{cx:"12",cy:"5",rx:"9",ry:"3"}),s.jsx("path",{d:"M3 5v4c0 1.66 4.03 3 9 3s9-1.34 9-3V5"}),s.jsx("path",{d:"M3 9v4c0 1.66 4.03 3 9 3s9-1.34 9-3V9"}),s.jsx("path",{d:"M3 13v4c0 1.66 4.03 3 9 3s9-1.34 9-3v-4"})]}),s.jsx(we.Typography,{size:"small",variant:"semibold",appearance:"title",children:(Ze??f.length).toLocaleString()}),s.jsx(we.Typography,{size:"small",variant:"regular",appearance:"subtitle",children:"total records"})]}):!pe&&u?.preContent?s.jsx("div",{className:"flex items-center mb-2",children:u.preContent}):null,s.jsx("div",{ref:Le,className:`w-full ${ae?"h-auto":ne} rounded-lg relative border overflow-x-hidden`,style:{...ae?{height:f?.length>0?`${(f?.length+1)*wl+4}px`:"350px"}:{height:Yl},...nl},children:Xt?kt:s.jsxs(k.DndContext,{sensors:rs,onDragEnd:os,onDragStart:cs,onDragCancel:is,collisionDetection:k.closestCorners,children:[kt,$?Os.createPortal(s.jsx(k.DragOverlay,{adjustScale:!0,dropAnimation:ns,children:s.jsx("table",{...Tt(),className:"w-full text-sm text-left text-neutral-500 dark:text-neutral-200 bg-white dark:bg-black-700 table-auto border-collapse",children:s.jsxs("tbody",{...Ot(),className:"bg-transparent divide-y divide-neutral-200",children:[void yt($),s.jsx(Rs.Row,{row:$,index:D?.findIndex(e=>e.id===$.original.id)},$.original.id)]})})}),document.getElementById("full-screen-container")||document.body):null]})}),ae&&o?.renderPagination?o.renderPagination(ae):null,o?.renderMasterDataModal&&o.renderMasterDataModal({isVisible:!!j,onSelected:zl,onClose:ve,masterDataColumnName:j?.masterDataColumnName,masterDataFormula:j?.masterDataFormula,masterDataFilters:j?.masterDataFilters,masterDataName:j?.masterDataName,masterDataId:j?.masterDataName,showFilters:!0}),s.jsx(Es.CurrencyDropdownPortal,{config:ut,onClose:pt}),s.jsx(Ns.PendingEditsFloatingBar,{pendingEditsCount:C,pendingEditsList:Wl,rowsWithPendingEdits:Hl,fieldOperationLoading:I,onClearAll:bt,onSaveAll:wt,onScrollToCell:P})]})});exports.InfiniteTable=gs;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|