@lax-wp/design-system 0.13.28 → 0.13.32

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.
@@ -1 +1 @@
1
- {"version":3,"file":"row.es.js","sources":["../../../../../../src/components/data-display/infinite-table/body/rows/row.tsx"],"sourcesContent":["import { getTableRowBgClassNamesByStatus } from '../../../../../constants/table';\nimport { useTableConfig } from '../../../../../providers/design-system-provider/hooks';\nimport { useDraggable, useDroppable } from '@dnd-kit/core';\nimport { useSortable } from '@dnd-kit/sortable';\nimport { CSS } from '@dnd-kit/utilities';\nimport { SubdirectoryArrowLeftRounded } from '@mui/icons-material';\nimport AddRounded from '@mui/icons-material/AddRounded';\nimport cn from 'classnames';\nimport React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\n\nimport { TableContext } from '../../context';\nimport { ActionCell } from '../cell/ActionCell';\nimport { CheckboxCell } from '../cell/CheckboxCell';\nimport { DataCell } from '../cell/DataCell';\nimport { validateCellValue } from '../../validateCell';\nimport { LoaderCell } from '../cell/LoaderCell';\nimport { PendingEditCell } from '../cell/PendingEditCell';\nimport { RowActionCell } from '../cell/RowActionCell';\nimport { RowOptionsCell } from '../cell/RowOptionsCell';\n\ntype TRowMetadata = {\n is_modified: object;\n is_new: boolean;\n is_deleted: boolean;\n is_added: boolean;\n __is_modified?: boolean;\n __is_edited?: boolean;\n __is_deleted?: boolean;\n __is_new?: boolean;\n __is_added?: boolean;\n};\n\ninterface TableCell {\n column: {\n key?: string;\n visible?: boolean;\n width?: number;\n sticky?: boolean;\n Header?: string;\n type?: string;\n is_required?: boolean;\n meta?: Record<string, unknown>;\n [key: string]: unknown;\n };\n value?: unknown;\n [key: string]: unknown;\n}\n\ninterface RowOriginal {\n id: string | number;\n is_read?: boolean;\n is_modified?: boolean;\n is_row_modified?: boolean;\n is_deleted?: boolean;\n is_added?: boolean;\n status?: string;\n type?: string;\n __isLoading?: boolean;\n __level?: number;\n __rowBgStatus?: string;\n __rowMetadata?: { __is_modified?: boolean };\n isDefinedActionRow?: boolean;\n isRoot?: boolean;\n name?: string | { props?: { text?: string } };\n onClick?: () => void;\n uploadCell?: boolean;\n disabled?: boolean;\n disabledTooltip?: string;\n [key: string]: unknown;\n}\n\ninterface TableRowData {\n original: RowOriginal;\n cells: TableCell[];\n getRowProps: () => Record<string, unknown>;\n index: number;\n [key: string]: unknown;\n}\n\ntype TRowOption = {\n key: string;\n label: React.ReactNode;\n isVisible?: boolean;\n [k: string]: unknown;\n};\n\ntype TProps = {\n row: TableRowData;\n isLastRow?: boolean;\n lastRow?: unknown;\n getSubRows?: () => unknown;\n prepareRow?: (row: unknown) => void;\n highlightSubstring?: (value: string) => JSX.Element;\n index: number;\n style?: Record<string, unknown>;\n visibleSubRowIds?: Record<string, unknown>;\n rowsLength?: number;\n level?: number;\n columns?: Record<string, unknown>;\n expandedRows?: Record<string, { isOpen: boolean }>;\n rows?: Array<{ original: unknown }>;\n};\n\nexport const Row = ({ row, isLastRow, lastRow, highlightSubstring, index, style, level = 0, expandedRows, rows }: TProps) => {\n const {\n lastNonStickyColumnIndex,\n checkboxConfig,\n onRowClick,\n rowOptions,\n disableOptionsForRowIndex = null,\n getSumOfNextVisibleColumnWidth,\n onRowEdit,\n inlineEditColumns,\n tableActions,\n dndSortableUtils,\n withSortable,\n withDraggable,\n getInnerRowData,\n showNewItem,\n rawData,\n dragConfig,\n getFullRowDataOnClick,\n rowWrapper: RowWrapper,\n isCellClickDisabled,\n rowAdditionalActions,\n hoverConfig,\n addPendingEdit,\n removePendingEdit,\n fieldOperationLoading,\n clearRowPendingEdits,\n saveRowPendingEdits,\n pendingEdits: contextPendingEdits,\n } = useContext(TableContext);\n\n const tableConfig = useTableConfig();\n\n const isCheckbox = Boolean(checkboxConfig);\n const { activeInlineEdit, setActiveInlineEdit } = useContext(TableContext);\n const inlineEditing = activeInlineEdit?.rowId === row.original.id ? activeInlineEdit?.columnKey : null;\n const isInlineEditing = Boolean(inlineEditing);\n const setInlineEditing = (columnKey: string | null) => {\n if (columnKey === null) setActiveInlineEdit?.(null);\n else setActiveInlineEdit?.({ rowId: String(row.original.id), columnKey });\n };\n const [rowHovering, setRowHovering] = useState<string | number | null>(null);\n const [editedCellValue, setEditedCellValue] = useState<string | null>(null);\n const [currentData, setCurrentData] = useState<Record<string, unknown> | null>(null);\n const [loadingExpand, setLoadingExpand] = useState(false);\n const [isDraggingFile, setIsDraggingFile] = useState(false);\n\n const prevInlineEditingRef = useRef<string | null>(null);\n useEffect(() => {\n const wasEditing = prevInlineEditingRef.current;\n const isNowEditing = inlineEditing;\n\n if (wasEditing && !isNowEditing) {\n const pendingEdit = contextPendingEdits?.[row.original.id]?.[wasEditing];\n if (pendingEdit) {\n const currentCell = row.cells?.find((c: TableCell) => c.column?.key === wasEditing);\n if (currentCell) {\n const result = validateCellValue(pendingEdit.value, currentCell.column as { type?: string; is_required?: boolean });\n if (!result.isValid && addPendingEdit) {\n addPendingEdit(String(row.original.id), wasEditing, {\n ...pendingEdit,\n validationError: result.error,\n });\n }\n }\n }\n }\n\n prevInlineEditingRef.current = isNowEditing ?? null;\n }, [inlineEditing, row.original.id, row.cells, contextPendingEdits, addPendingEdit]);\n\n useEffect(() => {\n if (rawData) {\n const idKey = String(row?.original?.id);\n setCurrentData(rawData[idKey]?.[row?.cells[0].column.Header as string] || rawData[idKey]?.[0]);\n }\n }, [rawData, row?.original?.id, row?.cells]);\n\n const sortableResult = useSortable({ id: row.original.id, data: { ...row.original }, disabled: !withSortable });\n const draggableResult = useDraggable({ id: row.original.id, data: { ...row.original }, disabled: !!withSortable });\n const { listeners, transform, setNodeRef, isDragging, attributes, active, over, ...rest } = withSortable\n ? sortableResult\n : draggableResult;\n\n const { setNodeRef: setDroppableNodeRef } = useDroppable({\n id: `table-file-dropzone-${row?.original?.id}`,\n data: { type: 'table-file-dropzone', folderId: row?.original?.id, isFolder: row?.original?.type === 'folder' },\n });\n\n const dndStyles = {\n transform: CSS.Transform.toString(transform),\n transition: withSortable ? (rest as { transition?: string }).transition : undefined,\n cursor: isDragging ? 'grabbing' : 'grab',\n opacity: isDragging ? '0.5' : '1',\n };\n\n const isOverOtherContext = (): boolean => {\n if (!active || !over || !withSortable) return false;\n if (dndSortableUtils?.checkOverEachItem) return dndSortableUtils.checkOverEachItem(active, over) && Boolean(over);\n return active.data.current?.type !== over.data.current?.type && Boolean(over);\n };\n\n const handleCellValueChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n setEditedCellValue(e.target.value);\n };\n\n const handleCloseEdit = () => {\n if (fieldOperationLoading) return;\n setInlineEditing(null);\n };\n\n const validationRef = useRef<(() => { isValid: boolean; value?: string | boolean | null; meta?: Record<string, unknown> | null }) | null>(null);\n\n const registerValidation = useCallback(\n (validateFn: () => { isValid: boolean; value?: string | boolean | null; meta?: Record<string, unknown> | null }) => {\n validationRef.current = validateFn;\n },\n [],\n );\n\n const tableConfigRef = useRef(tableConfig);\n tableConfigRef.current = tableConfig;\n\n const handleRowCancelEdit = useCallback(() => {\n if (clearRowPendingEdits) clearRowPendingEdits(String(row.original.id));\n }, [clearRowPendingEdits, row.original.id]);\n\n const handleRowConfirmEdit = useCallback(() => {\n if (validationRef.current) {\n const result = validationRef.current();\n if (!result.isValid) return;\n if (inlineEditing && result.value !== undefined && addPendingEdit) {\n addPendingEdit(String(row.original.id), inlineEditing, {\n value: result.value,\n originalValue: row.original[inlineEditing],\n meta: result.meta || undefined,\n });\n }\n } else if (inlineEditing) {\n const currentCell = row.cells?.find((c: TableCell) => c.column?.key === inlineEditing);\n if (currentCell) {\n const pendingValue = contextPendingEdits?.[row.original.id]?.[inlineEditing]?.value;\n const valueToValidate = pendingValue !== undefined ? pendingValue : currentCell.value;\n const result = validateCellValue(valueToValidate as string | boolean | null | undefined, currentCell.column as { type?: string; is_required?: boolean });\n if (!result.isValid) {\n tableConfigRef.current?.showNotification?.('error', result.error || 'Validation failed');\n return;\n }\n }\n }\n\n if (saveRowPendingEdits) saveRowPendingEdits(String(row.original.id));\n }, [saveRowPendingEdits, row.original, row.cells, inlineEditing, addPendingEdit, contextPendingEdits]);\n\n const handleUpdateCellData = (\n directValue?: string | boolean | null,\n meta?: { currency_code?: string | null; reference?: unknown | null;[key: string]: unknown | null } | null,\n ) => {\n const _item = { ...row.original };\n const updatedValue = directValue !== undefined ? directValue : editedCellValue;\n if (inlineEditing && updatedValue !== undefined) {\n _item[inlineEditing] = updatedValue;\n if (onRowEdit) onRowEdit(_item, index, inlineEditing, updatedValue, meta);\n if (removePendingEdit) removePendingEdit(String(row.original.id), inlineEditing);\n }\n handleCloseEdit();\n };\n\n const ref = useRef<HTMLElement>(null);\n\n const handleCellClick = (event: React.MouseEvent, data: string | Record<string, unknown>, idx: number, key: string) => {\n if (isCellClickDisabled) return;\n event?.stopPropagation();\n if (inlineEditing === key) return;\n\n if (onRowEdit) {\n if (inlineEditColumns?.includes(key)) {\n setInlineEditing(key);\n setEditedCellValue(String(row.original[key]));\n } else {\n const msg = tableConfig?.getSystemMessage?.('notAllowedInlineEdit') || 'Inline Edit is not allowed for this column';\n tableConfig?.showNotification?.('error', msg);\n }\n return;\n }\n\n if (onRowClick) {\n onRowClick(data, idx, row.original, rows?.map((_row: { original: unknown }) => _row.original) || []);\n } else if (!onRowClick && checkboxConfig) {\n const _id = row.original.id;\n const checkEvent = { target: { checked: !checkboxConfig.checkedIds.includes(_id) } };\n checkboxConfig.onItemCheck(checkEvent, _id);\n }\n };\n\n const toggleRowExpand = async () => {\n setLoadingExpand(true);\n if (getInnerRowData) {\n await getInnerRowData(row?.original?.id, row?.original, !(expandedRows?.[row?.original?.id as string]?.isOpen ?? false), row?.original?.__level || 0);\n }\n setLoadingExpand(false);\n };\n\n\n\n\n const totalWidth = useMemo(() => {\n return row.cells.filter((c: TableCell) => c.column?.visible).map((c: TableCell) => c.column?.width ?? 0).reduce((a: number, b: number) => a + b, 0);\n }, [row.cells]);\n\n const isDraggingOver = useMemo(() => {\n return dragConfig?.draggingOver && dragConfig?.draggingOver === row?.original?.id;\n }, [dragConfig, row?.original?.id]);\n\n const dropPosition = useMemo(() => {\n if (!isDraggingOver) return null;\n return dragConfig?.dropPosition || 'inside';\n }, [isDraggingOver, dragConfig?.dropPosition]);\n\n const isDraggingOverInside = Boolean(isDraggingOver && dropPosition === 'inside');\n\n const _meta = (row?.original?.__rowMetadata as TRowMetadata) || (row?.original?._meta as TRowMetadata | undefined);\n const _notHovering = rowHovering !== row?.original?.id;\n const _notLoading = !row?.original?.__isLoading;\n const _isNewRow = !!(\n _meta?.__is_new ||\n _meta?.__is_added ||\n row?.original?.is_added ||\n (currentData?.is_added as boolean) ||\n _meta?.is_added ||\n _meta?.is_new\n );\n const _isDeletedRow = !!(row?.original?.is_deleted || _meta?.__is_deleted || (currentData?.is_deleted as boolean) || _meta?.is_deleted);\n const _isModifiedRow =\n !!(\n row?.original?.is_modified ||\n row?.original?.is_row_modified ||\n _meta?.__is_modified ||\n _meta?.__is_edited ||\n (currentData?.is_row_modified as boolean) ||\n _meta?.is_modified\n ) && !_isNewRow;\n\n const bgColor = cn({\n 'bg-neutral-100 dark:bg-black-600': rowHovering === row?.original?.id && !isInlineEditing,\n 'bg-primary-50 dark:bg-black-700': !row?.original?.is_read && showNewItem && !row?.original?.__isLoading && _notHovering && !isInlineEditing,\n // 'bg-white dark:bg-black-700': cell.column.sticky && rowHovering !== id,\n 'bg-warning-50 dark:bg-warning-975': _isModifiedRow && _notLoading && _notHovering && !isInlineEditing,\n 'bg-error-50 dark:bg-error-975': _isDeletedRow && _notLoading && _notHovering && !isInlineEditing,\n 'bg-success-50 dark:bg-success-975': _isNewRow && _notLoading && _notHovering && !isInlineEditing,\n 'bg-primary-50 dark:bg-primary-900': isInlineEditing,\n [getTableRowBgClassNamesByStatus[row?.original?.__rowBgStatus as string]]: row?.original?.__rowBgStatus && !isInlineEditing,\n });\n\n return (\n <tr\n {...row.getRowProps()}\n ref={withDraggable || withSortable ? setNodeRef : null}\n key={row.original.id}\n data-row-id={row.original.id}\n className={cn(\n `text-neutral-900 dark:text-white cursor-pointer min-w-full relative ${checkboxConfig?.selectionDisabledRowIds?.includes(row?.original?.id) ? 'opacity-50' : ''} border-t`,\n isDragging ? 'z-40' : '',\n isOverOtherContext() ? 'shadow-dnd-drop' : '',\n withDraggable && over && over?.data?.current?.type === 'table-file-dropzone' && over?.data?.current?.folderId === row?.original?.id && row?.original?.type === 'folder' ? 'bg-primary-50' : '',\n row?.original?.isDefinedActionRow ? 'bg-primary-50' : '',\n isDraggingOverInside ? 'z-50' : '',\n bgColor ? bgColor : 'bg-white dark:bg-black-800',\n )}\n style={{ ...style, ...(withSortable ? dndStyles : {}), width: 'max-content' }}\n {...(withDraggable || withSortable ? attributes : {})}\n {...(withDraggable || withSortable ? listeners : {})}\n >\n {isDraggingOverInside && dragConfig?.dragOperation ? (\n <div className='absolute right-2 h-row flex items-center z-20 pointer-events-none'>\n <div className='bg-primary-200 px-2 py-1 rounded'>\n {dragConfig?.dragOperation === 'COPY' ? (\n <AddRounded sx={{ fontSize: 12 }} className='text-primary-700' />\n ) : (\n <SubdirectoryArrowLeftRounded sx={{ fontSize: 12 }} className='text-primary-700' />\n )}\n </div>\n </div>\n ) : null}\n {isDraggingOverInside && !dragConfig?.dragOperation ? (\n <div className='absolute right-2 h-row flex items-center z-20 pointer-events-none'>\n <SubdirectoryArrowLeftRounded sx={{ fontSize: 16 }} className='text-primary-500' />\n </div>\n ) : null}\n {isDraggingOver && dropPosition === 'before' && !row?.original?.isDefinedActionRow ? (\n <div className='absolute -top-[1px] left-0 right-0 h-[2px] bg-primary-500 z-20 pointer-events-none'>\n <div className='absolute left-0 top-1/2 -translate-y-1/2 w-2 h-2 rounded-full bg-primary-500' />\n </div>\n ) : null}\n {isDraggingOver && dropPosition === 'after' && !row?.original?.isDefinedActionRow ? (\n <div className='absolute -bottom-[1px] left-0 right-0 h-[2px] bg-primary-500 z-20 pointer-events-none'>\n <div className='absolute left-0 top-1/2 -translate-y-1/2 w-2 h-2 rounded-full bg-primary-500' />\n </div>\n ) : null}\n\n {row?.original?.isDefinedActionRow ? (\n <ActionCell\n cells={row.cells}\n id={row?.original?.id}\n isCheckbox={checkboxConfig}\n level={level}\n name={row?.original?.name as string}\n onClick={row?.original?.onClick as () => void}\n rowHovering={rowHovering || ''}\n isRoot={row?.original?.isRoot as boolean}\n totalWidth={totalWidth}\n row={row.original as Record<string, unknown>}\n uploadCell={row?.original?.uploadCell as boolean}\n disabled={row?.original?.disabled as boolean}\n disabledTooltip={row?.original?.disabledTooltip as string}\n />\n ) : RowWrapper ? (\n <RowWrapper data={row.original} setIsDraggingFile={setIsDraggingFile}>\n <RowContent\n isDraggingOver={isDraggingOverInside}\n level={level}\n withDraggable={withDraggable}\n setDroppableNodeRef={setDroppableNodeRef}\n isLastRow={isLastRow}\n lastRow={lastRow}\n isCheckbox={isCheckbox}\n checkboxConfig={checkboxConfig}\n row={row}\n rowHovering={rowHovering}\n tableActions={tableActions}\n disableOptionsForRowIndex={disableOptionsForRowIndex}\n index={index}\n showNewItem={showNewItem}\n currentData={currentData}\n lastNonStickyColumnIndex={lastNonStickyColumnIndex}\n getSumOfNextVisibleColumnWidth={getSumOfNextVisibleColumnWidth}\n toggleRowExpand={toggleRowExpand}\n loadingExpand={loadingExpand}\n cellRef={ref}\n handleCellClick={handleCellClick}\n getFullRowDataOnClick={getFullRowDataOnClick}\n handleCellValueChange={handleCellValueChange}\n handleUpdateCellData={handleUpdateCellData}\n handleRowCancelEdit={handleRowCancelEdit}\n handleRowConfirmEdit={handleRowConfirmEdit}\n registerValidation={registerValidation}\n inlineEditing={inlineEditing}\n isInlineEditing={isInlineEditing}\n setRowHovering={setRowHovering}\n highlightSubstring={highlightSubstring}\n rowOptions={rowOptions}\n isDraggingFile={isDraggingFile}\n rowAdditionalActions={rowAdditionalActions}\n hoverConfig={hoverConfig}\n />\n </RowWrapper>\n ) : (\n <RowContent\n level={level}\n withDraggable={withDraggable}\n setDroppableNodeRef={setDroppableNodeRef}\n isLastRow={isLastRow}\n lastRow={lastRow}\n isCheckbox={isCheckbox}\n checkboxConfig={checkboxConfig}\n row={row}\n rowHovering={rowHovering}\n tableActions={tableActions}\n disableOptionsForRowIndex={disableOptionsForRowIndex}\n index={index}\n showNewItem={showNewItem}\n currentData={currentData}\n lastNonStickyColumnIndex={lastNonStickyColumnIndex}\n getSumOfNextVisibleColumnWidth={getSumOfNextVisibleColumnWidth}\n toggleRowExpand={toggleRowExpand}\n loadingExpand={loadingExpand}\n cellRef={ref}\n handleCellClick={handleCellClick}\n getFullRowDataOnClick={getFullRowDataOnClick}\n handleCellValueChange={handleCellValueChange}\n handleUpdateCellData={handleUpdateCellData}\n handleRowCancelEdit={handleRowCancelEdit}\n handleRowConfirmEdit={handleRowConfirmEdit}\n registerValidation={registerValidation}\n inlineEditing={inlineEditing}\n isInlineEditing={isInlineEditing}\n setRowHovering={setRowHovering}\n highlightSubstring={highlightSubstring}\n rowOptions={rowOptions}\n isDraggingFile={isDraggingFile}\n isDraggingOver={isDraggingOverInside}\n rowAdditionalActions={rowAdditionalActions}\n hoverConfig={hoverConfig}\n />\n )}\n </tr>\n );\n};\n\ninterface RowContentProps {\n withDraggable?: boolean;\n setDroppableNodeRef: (node: HTMLElement | null) => void;\n isLastRow?: boolean;\n lastRow?: unknown;\n isCheckbox: boolean;\n checkboxConfig: Record<string, unknown> | null;\n row: TableRowData;\n rowHovering: string | number | null;\n tableActions?: ((rowData: Record<string, unknown>, index: number) => React.ReactNode) | null;\n disableOptionsForRowIndex?: number | null;\n index: number;\n showNewItem?: boolean;\n currentData: Record<string, unknown> | null;\n lastNonStickyColumnIndex?: (() => number | null) | null;\n getSumOfNextVisibleColumnWidth?: (index: number) => number | null;\n toggleRowExpand: () => Promise<void>;\n loadingExpand: boolean;\n cellRef: React.RefObject<HTMLElement | null>;\n handleCellClick: (event: React.MouseEvent, data: string | Record<string, unknown>, idx: number, key: string) => void;\n getFullRowDataOnClick?: boolean;\n handleCellValueChange: (e: React.ChangeEvent<HTMLInputElement>) => void;\n handleUpdateCellData: (directValue?: string | boolean | null, meta?: Record<string, unknown> | null) => void;\n handleRowCancelEdit: () => void;\n handleRowConfirmEdit: () => void;\n registerValidation: (fn: () => { isValid: boolean; value?: string | boolean | null; meta?: Record<string, unknown> | null }) => void;\n inlineEditing: string | null;\n isInlineEditing: boolean;\n setRowHovering: (id: string | number | null) => void;\n highlightSubstring?: (value: string) => React.ReactNode;\n rowOptions?: TRowOption[] | ((rowData: Record<string, unknown>) => TRowOption[] | null) | null;\n level?: number;\n isDraggingFile?: boolean;\n isDraggingOver?: boolean;\n rowAdditionalActions?: unknown;\n hoverConfig?: { onHover?: (data: Record<string, unknown>) => React.ReactNode };\n}\n\nconst RowContent = ({\n withDraggable,\n setDroppableNodeRef,\n isLastRow,\n lastRow,\n isCheckbox,\n checkboxConfig,\n row,\n rowHovering,\n tableActions,\n disableOptionsForRowIndex,\n index,\n showNewItem,\n currentData,\n lastNonStickyColumnIndex,\n getSumOfNextVisibleColumnWidth,\n toggleRowExpand,\n loadingExpand,\n cellRef,\n handleCellClick,\n getFullRowDataOnClick,\n handleCellValueChange,\n handleUpdateCellData,\n handleRowCancelEdit,\n handleRowConfirmEdit,\n registerValidation,\n inlineEditing,\n isInlineEditing,\n setRowHovering,\n highlightSubstring,\n rowOptions,\n level,\n isDraggingFile,\n isDraggingOver,\n rowAdditionalActions,\n hoverConfig,\n}: RowContentProps) => {\n const [isRowContentHovering, setIsRowContentHovering] = useState(false);\n const {\n getPendingEdit: getPendingEditFn,\n hasPendingEdit: hasPendingEditFn,\n pendingEdits,\n tableHeaders,\n pendingEditsCount,\n scrollToCell,\n } = useContext(TableContext);\n const rowHasPendingEdits = pendingEdits?.[row.original.id] && Object.keys(pendingEdits[row.original.id]).length > 0;\n const tableHasAnyPendingEdits = (pendingEditsCount ?? 0) > 0;\n const resolvedRowOptions = useMemo<TRowOption[]>(() => {\n if (Array.isArray(rowOptions)) return rowOptions;\n if (typeof rowOptions === 'function') {\n const options = rowOptions({ ...row.original, rowIndex: index });\n return Array.isArray(options) ? options : [];\n }\n return [];\n }, [rowOptions, row.original, index]);\n\n\n const _meta = (row?.original?.__rowMetadata as TRowMetadata | undefined) || (row?.original?._meta as TRowMetadata | undefined);\n const _notHovering = rowHovering !== row?.original?.id;\n const _notLoading = !row?.original?.__isLoading;\n const _isNewRow = !!(\n _meta?.__is_new ||\n _meta?.__is_added ||\n row?.original?.is_added ||\n (currentData?.is_added as boolean) ||\n _meta?.is_added ||\n _meta?.is_new\n );\n const _isDeletedRow = !!(row?.original?.is_deleted || _meta?.__is_deleted || (currentData?.is_deleted as boolean) || _meta?.is_deleted);\n const _isModifiedRow =\n !!(\n row?.original?.is_modified ||\n row?.original?.is_row_modified ||\n _meta?.__is_modified ||\n _meta?.__is_edited ||\n (currentData?.is_row_modified as boolean) ||\n _meta?.is_deleted\n ) && !_isNewRow;\n\n const statusBorderClass = cn({\n 'border-l-[3px] border-l-success-400 dark:border-l-success-500': _isNewRow && _notLoading && _notHovering && !isInlineEditing,\n 'border-l-[3px] border-l-error-400 dark:border-l-error-500': _isDeletedRow && _notLoading && _notHovering && !isInlineEditing,\n 'border-l-[3px] border-l-warning-400 dark:border-l-warning-500': _isModifiedRow && _notLoading && _notHovering && !isInlineEditing,\n });\n\n return (\n <div\n ref={withDraggable ? setDroppableNodeRef : null}\n className={isDraggingOver ? 'border-2 border-primary-400 dark:border-primary-500 rounded-sm' : ''}\n >\n <div className={cn('flex', statusBorderClass)} ref={isLastRow ? (lastRow as React.Ref<HTMLDivElement>) : null}>\n {tableHasAnyPendingEdits && (\n <PendingEditCell\n rowId={String(row.original.id)}\n rowIndex={index}\n pendingEdits={pendingEdits}\n tableHeaders={tableHeaders}\n rowHasPendingEdits={!!rowHasPendingEdits}\n rowHovering={rowHovering != null ? String(rowHovering) : undefined}\n isInlineEditing={isInlineEditing}\n is_read={!!row.original.is_read}\n is_modified={_isModifiedRow}\n is_row_modified={!!row.original.is_row_modified}\n is_deleted={_isDeletedRow}\n is_added={_isNewRow}\n is_incomplete={row?.original?.status === 'Incomplete'}\n showNewItem={showNewItem}\n onScrollToCell={scrollToCell}\n />\n )}\n\n {isCheckbox && (\n <CheckboxCell\n checkboxConfig={checkboxConfig as never}\n id={String(row.original.id)}\n rowHovering={rowHovering != null ? String(rowHovering) : undefined}\n isDisabled={!!row?.original?.__isLoading}\n isDraggingOver={isDraggingOver}\n is_added={_isNewRow}\n is_deleted={_isDeletedRow}\n is_incomplete={row?.original?.status === 'Incomplete'}\n is_modified={_isModifiedRow}\n is_read={!!row.original.is_read}\n is_row_modified={!!row.original.is_row_modified}\n showNewItem={showNewItem}\n currentData={currentData ?? {}}\n bgColor={row?.original?.__rowBgStatus ? getTableRowBgClassNamesByStatus[row?.original?.__rowBgStatus as string] : undefined}\n isInlineEditing={isInlineEditing}\n hasPendingEditsColumn={tableHasAnyPendingEdits}\n rowHasPendingEdits={rowHasPendingEdits}\n />\n )}\n\n {tableActions ? (\n <RowActionCell\n tableActions={tableActions as (rowData: Record<string, unknown>, index: number) => JSX.Element}\n disableOptionsForRowIndex={disableOptionsForRowIndex ?? null}\n id={String(row.original.id)}\n index={index}\n is_read={!!row?.original?.is_read}\n is_incomplete={row?.original?.status === 'Incomplete'}\n showNewItem={!!showNewItem}\n is_modified={_isModifiedRow}\n is_row_modified={!!row?.original?.is_row_modified}\n is_deleted={_isDeletedRow}\n currentData={currentData ?? {}}\n is_added={_isNewRow}\n rowData={row.original as Record<string, unknown>}\n rowHovering={rowHovering}\n isDisabled={!!row?.original?.__isLoading}\n bgColor={isDraggingFile ? 'bg-primary-50' : row?.original?.__rowBgStatus ? getTableRowBgClassNamesByStatus[row?.original?.__rowBgStatus as string] : undefined}\n isInlineEditing={isInlineEditing}\n rowHasPendingEdits={rowHasPendingEdits}\n />\n ) : null}\n\n <div\n className='relative flex-1'\n id={`row-${row.original.id}`}\n onMouseEnter={() => setIsRowContentHovering(true)}\n onMouseLeave={() => setIsRowContentHovering(false)}\n >\n {row.cells\n .filter((cell: TableCell) => cell?.column?.visible !== false)\n .map((cell: TableCell, y: number) => {\n const isLastCell = y === lastNonStickyColumnIndex?.();\n const isFirstStickyCell = y === (lastNonStickyColumnIndex?.() ?? -1) + 1;\n const nextWidthSum = cell?.column?.sticky ? (getSumOfNextVisibleColumnWidth?.(y) ?? 0) : 0;\n\n if (row.original?.__isLoading) {\n return (\n <LoaderCell cell={cell as unknown as { column: { width: number; sticky?: boolean; sequence?: number } }} id={y} nextWidthSum={nextWidthSum} isLastCell={isLastCell} rowHovering={rowHovering} index={y} key={y} isFirstStickyCell={isFirstStickyCell} />\n );\n }\n\n const pendingEdit = getPendingEditFn?.(String(row.original.id), cell?.column?.key || '');\n const hasPending = hasPendingEditFn?.(String(row.original.id), cell?.column?.key || '');\n\n return (\n <DataCell\n cell={cell as unknown as import('../../types').ICell}\n rowHovering={rowHovering}\n isFirstStickyCell={isFirstStickyCell}\n level={level ?? 0}\n toggleRowExpand={toggleRowExpand}\n loadingExpand={loadingExpand}\n key={cell?.column?.key}\n index={y}\n cellRef={cellRef as React.RefObject<HTMLDivElement>}\n currentData={currentData as { is_row_modified?: boolean; is_deleted?: boolean; is_added?: boolean }}\n handleCellClick={(e?: React.MouseEvent) => { if (e) handleCellClick(e, getFullRowDataOnClick ? row.original : String(row.original.id), y, cell?.column?.key || ''); }}\n handleCellValueChange={handleCellValueChange}\n handleUpdateCellData={handleUpdateCellData}\n registerValidation={registerValidation}\n id={row.original.id}\n inlineEditing={inlineEditing}\n isInlineEditing={isInlineEditing}\n isLastCell={isLastCell}\n is_incomplete={row?.original?.status === 'Incomplete'}\n is_added={_isNewRow}\n is_deleted={_isDeletedRow}\n is_modified={_isModifiedRow}\n is_read={!!row.original.is_read}\n is_row_modified={!!row.original.is_row_modified}\n nextWidthSum={nextWidthSum}\n setRowHovering={setRowHovering}\n highlightSubstring={highlightSubstring as ((value: string) => JSX.Element) | undefined}\n isDraggingOver={isDraggingOver}\n isLoading={!!row?.original?.__isLoading}\n pendingEdit={pendingEdit}\n hasPendingEdit={hasPending}\n pendingValidationError={pendingEdit?.validationError}\n />\n );\n })}\n\n {hoverConfig?.onHover &&\n isRowContentHovering &&\n createPortal(\n <div className='absolute top-full left-10 z-50 bg-white dark:bg-black-800 rounded-xl'>{hoverConfig.onHover(row.original) as React.ReactNode}</div>,\n document.getElementById(`row-${row.original.id}`) as HTMLElement,\n )}\n </div>\n\n {(resolvedRowOptions.length > 0 || !!rowAdditionalActions) && (\n <RowOptionsCell\n rowId={row.original.id}\n rowOptions={resolvedRowOptions}\n disableOption={disableOptionsForRowIndex !== null || !!row?.original?.__isLoading}\n rowHovering={rowHovering}\n setRowHovering={setRowHovering}\n is_read={!!row.original.is_read}\n showNewItem={!!showNewItem}\n is_modified={_isModifiedRow}\n is_row_modified={!!row.original.is_row_modified}\n is_incomplete={row?.original?.status === 'Incomplete'}\n currentData={currentData ?? {}}\n is_deleted={_isDeletedRow}\n is_added={_isNewRow}\n isDraggingOver={!!isDraggingOver}\n rowAdditionalActions={rowAdditionalActions as (rowData: Record<string, unknown>, index: number, isHovering: boolean) => React.ReactNode}\n rowData={row.original as Record<string, unknown>}\n index={index}\n bgColor={row?.original?.__rowBgStatus ? getTableRowBgClassNamesByStatus[row?.original?.__rowBgStatus as string] : undefined}\n isInlineEditing={isInlineEditing}\n onConfirmEdit={handleRowConfirmEdit}\n onCancelEdit={handleRowCancelEdit}\n rowHasPendingEdits={rowHasPendingEdits}\n />\n )}\n </div>\n </div>\n );\n};\n"],"names":["Row","row","isLastRow","lastRow","highlightSubstring","index","style","level","expandedRows","rows","lastNonStickyColumnIndex","checkboxConfig","onRowClick","rowOptions","disableOptionsForRowIndex","getSumOfNextVisibleColumnWidth","onRowEdit","inlineEditColumns","tableActions","dndSortableUtils","withSortable","withDraggable","getInnerRowData","showNewItem","rawData","dragConfig","getFullRowDataOnClick","RowWrapper","isCellClickDisabled","rowAdditionalActions","hoverConfig","addPendingEdit","removePendingEdit","fieldOperationLoading","clearRowPendingEdits","saveRowPendingEdits","contextPendingEdits","useContext","TableContext","tableConfig","useTableConfig","isCheckbox","activeInlineEdit","setActiveInlineEdit","inlineEditing","isInlineEditing","setInlineEditing","columnKey","rowHovering","setRowHovering","useState","editedCellValue","setEditedCellValue","currentData","setCurrentData","loadingExpand","setLoadingExpand","isDraggingFile","setIsDraggingFile","prevInlineEditingRef","useRef","useEffect","wasEditing","isNowEditing","pendingEdit","currentCell","c","result","validateCellValue","idKey","sortableResult","useSortable","draggableResult","useDraggable","listeners","transform","setNodeRef","isDragging","attributes","active","over","rest","setDroppableNodeRef","useDroppable","dndStyles","CSS","isOverOtherContext","handleCellValueChange","e","handleCloseEdit","validationRef","registerValidation","useCallback","validateFn","tableConfigRef","handleRowCancelEdit","handleRowConfirmEdit","pendingValue","valueToValidate","handleUpdateCellData","directValue","meta","_item","updatedValue","ref","handleCellClick","event","data","idx","key","msg","_row","_id","checkEvent","toggleRowExpand","totalWidth","useMemo","a","b","isDraggingOver","dropPosition","isDraggingOverInside","_meta","_notHovering","_notLoading","_isNewRow","_isDeletedRow","_isModifiedRow","bgColor","cn","getTableRowBgClassNamesByStatus","createElement","jsx","AddRounded","SubdirectoryArrowLeftRounded","ActionCell","RowContent","cellRef","isRowContentHovering","setIsRowContentHovering","getPendingEditFn","hasPendingEditFn","pendingEdits","tableHeaders","pendingEditsCount","scrollToCell","rowHasPendingEdits","tableHasAnyPendingEdits","resolvedRowOptions","options","statusBorderClass","jsxs","PendingEditCell","CheckboxCell","RowActionCell","cell","y","isLastCell","isFirstStickyCell","nextWidthSum","LoaderCell","hasPending","DataCell","createPortal","RowOptionsCell"],"mappings":";;;;;;;;;;;;;;;;;;;;AAwGO,MAAMA,KAAM,CAAC,EAAE,KAAAC,GAAK,WAAAC,GAAW,SAAAC,GAAS,oBAAAC,GAAoB,OAAAC,GAAO,OAAAC,IAAO,OAAAC,IAAQ,GAAG,cAAAC,GAAc,MAAAC,QAAmB;AAC3H,QAAM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BAAAC;AAAA,YACA,SAAS,CAAC,CAAChD,EAAI,SAAS;AAAA,YACxB,aAAa,CAAC,CAACsB;AAAA,YACf,aAAawG;AAAA,YACb,iBAAiB,CAAC,CAAC9H,EAAI,SAAS;AAAA,YAChC,eAAeA,GAAK,UAAU,WAAW;AAAA,YACzC,aAAaoD,KAAe,CAAA;AAAA,YAC5B,YAAYyE;AAAA,YACZ,UAAUD;AAAA,YACV,gBAAgB,CAAC,CAACN;AAAA,YAClB,sBAAA1F;AAAA,YACA,SAAS5B,EAAI;AAAA,YACb,OAAAI;AAAA,YACA,SAASJ,GAAK,UAAU,gBAAgBiI,GAAgCjI,GAAK,UAAU,aAAuB,IAAI;AAAA,YAClH,iBAAA4C;AAAA,YACA,eAAemD;AAAA,YACf,cAAcD;AAAA,YACd,oBAAAmD;AAAA,UAAA;AAAA,QAAA;AAAA,MACF,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"row.es.js","sources":["../../../../../../src/components/data-display/infinite-table/body/rows/row.tsx"],"sourcesContent":["import { getTableRowBgClassNamesByStatus } from '../../../../../constants/table';\nimport { useTableConfig } from '../../../../../providers/design-system-provider/hooks';\nimport { useDraggable, useDroppable } from '@dnd-kit/core';\nimport { useSortable } from '@dnd-kit/sortable';\nimport { CSS } from '@dnd-kit/utilities';\nimport { SubdirectoryArrowLeftRounded } from '@mui/icons-material';\nimport AddRounded from '@mui/icons-material/AddRounded';\nimport cn from 'classnames';\nimport React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\n\nimport { TableContext } from '../../context';\nimport { ActionCell } from '../cell/ActionCell';\nimport { CheckboxCell } from '../cell/CheckboxCell';\nimport { DataCell } from '../cell/DataCell';\nimport { validateCellValue } from '../../validateCell';\nimport { LoaderCell } from '../cell/LoaderCell';\nimport { PendingEditCell } from '../cell/PendingEditCell';\nimport { RowActionCell } from '../cell/RowActionCell';\nimport { RowOptionsCell } from '../cell/RowOptionsCell';\n\ntype TRowMetadata = {\n is_modified: object;\n is_new: boolean;\n is_deleted: boolean;\n is_added: boolean;\n __is_modified?: boolean;\n __is_edited?: boolean;\n __is_deleted?: boolean;\n __is_new?: boolean;\n __is_added?: boolean;\n};\n\ninterface TableCell {\n column: {\n key?: string;\n visible?: boolean;\n width?: number;\n sticky?: boolean;\n Header?: string;\n type?: string;\n is_required?: boolean;\n meta?: Record<string, unknown>;\n [key: string]: unknown;\n };\n value?: unknown;\n [key: string]: unknown;\n}\n\ninterface RowOriginal {\n id: string | number;\n is_read?: boolean;\n is_modified?: boolean;\n is_row_modified?: boolean;\n is_deleted?: boolean;\n is_added?: boolean;\n status?: string;\n type?: string;\n __isLoading?: boolean;\n __level?: number;\n __rowBgStatus?: string;\n __rowMetadata?: { __is_modified?: boolean };\n isDefinedActionRow?: boolean;\n isRoot?: boolean;\n name?: string | { props?: { text?: string } };\n onClick?: () => void;\n uploadCell?: boolean;\n disabled?: boolean;\n disabledTooltip?: string;\n [key: string]: unknown;\n}\n\ninterface TableRowData {\n original: RowOriginal;\n cells: TableCell[];\n getRowProps: () => Record<string, unknown>;\n index: number;\n [key: string]: unknown;\n}\n\ntype TRowOption = {\n key: string;\n label: React.ReactNode;\n isVisible?: boolean;\n [k: string]: unknown;\n};\n\ntype TProps = {\n row: TableRowData;\n isLastRow?: boolean;\n lastRow?: unknown;\n getSubRows?: () => unknown;\n prepareRow?: (row: unknown) => void;\n highlightSubstring?: (value: string) => JSX.Element;\n index: number;\n style?: Record<string, unknown>;\n visibleSubRowIds?: Record<string, unknown>;\n rowsLength?: number;\n level?: number;\n columns?: Record<string, unknown>;\n expandedRows?: Record<string, { isOpen: boolean }>;\n rows?: Array<{ original: unknown }>;\n};\n\nexport const Row = ({ row, isLastRow, lastRow, highlightSubstring, index, style, level = 0, expandedRows, rows }: TProps) => {\n const {\n lastNonStickyColumnIndex,\n checkboxConfig,\n onRowClick,\n rowOptions,\n disableOptionsForRowIndex = null,\n getSumOfNextVisibleColumnWidth,\n onRowEdit,\n inlineEditColumns,\n tableActions,\n dndSortableUtils,\n withSortable,\n withDraggable,\n getInnerRowData,\n showNewItem,\n rawData,\n dragConfig,\n getFullRowDataOnClick,\n selectedRowId,\n rowWrapper: RowWrapper,\n isCellClickDisabled,\n rowAdditionalActions,\n hoverConfig,\n addPendingEdit,\n removePendingEdit,\n fieldOperationLoading,\n clearRowPendingEdits,\n saveRowPendingEdits,\n pendingEdits: contextPendingEdits,\n } = useContext(TableContext);\n\n const tableConfig = useTableConfig();\n\n const isCheckbox = Boolean(checkboxConfig);\n const { activeInlineEdit, setActiveInlineEdit } = useContext(TableContext);\n const inlineEditing = activeInlineEdit?.rowId === row.original.id ? activeInlineEdit?.columnKey : null;\n const isInlineEditing = Boolean(inlineEditing);\n const setInlineEditing = (columnKey: string | null) => {\n if (columnKey === null) setActiveInlineEdit?.(null);\n else setActiveInlineEdit?.({ rowId: String(row.original.id), columnKey });\n };\n const [rowHovering, setRowHovering] = useState<string | number | null>(null);\n const [editedCellValue, setEditedCellValue] = useState<string | null>(null);\n const [currentData, setCurrentData] = useState<Record<string, unknown> | null>(null);\n const [loadingExpand, setLoadingExpand] = useState(false);\n const [isDraggingFile, setIsDraggingFile] = useState(false);\n\n const prevInlineEditingRef = useRef<string | null>(null);\n useEffect(() => {\n const wasEditing = prevInlineEditingRef.current;\n const isNowEditing = inlineEditing;\n\n if (wasEditing && !isNowEditing) {\n const pendingEdit = contextPendingEdits?.[row.original.id]?.[wasEditing];\n if (pendingEdit) {\n const currentCell = row.cells?.find((c: TableCell) => c.column?.key === wasEditing);\n if (currentCell) {\n const result = validateCellValue(pendingEdit.value, currentCell.column as { type?: string; is_required?: boolean });\n if (!result.isValid && addPendingEdit) {\n addPendingEdit(String(row.original.id), wasEditing, {\n ...pendingEdit,\n validationError: result.error,\n });\n }\n }\n }\n }\n\n prevInlineEditingRef.current = isNowEditing ?? null;\n }, [inlineEditing, row.original.id, row.cells, contextPendingEdits, addPendingEdit]);\n\n useEffect(() => {\n if (rawData) {\n const idKey = String(row?.original?.id);\n setCurrentData(rawData[idKey]?.[row?.cells[0].column.Header as string] || rawData[idKey]?.[0]);\n }\n }, [rawData, row?.original?.id, row?.cells]);\n\n const sortableResult = useSortable({ id: row.original.id, data: { ...row.original }, disabled: !withSortable });\n const draggableResult = useDraggable({ id: row.original.id, data: { ...row.original }, disabled: !!withSortable });\n const { listeners, transform, setNodeRef, isDragging, attributes, active, over, ...rest } = withSortable\n ? sortableResult\n : draggableResult;\n\n const { setNodeRef: setDroppableNodeRef } = useDroppable({\n id: `table-file-dropzone-${row?.original?.id}`,\n data: { type: 'table-file-dropzone', folderId: row?.original?.id, isFolder: row?.original?.type === 'folder' },\n });\n\n const dndStyles = {\n transform: CSS.Transform.toString(transform),\n transition: withSortable ? (rest as { transition?: string }).transition : undefined,\n cursor: isDragging ? 'grabbing' : 'grab',\n opacity: isDragging ? '0.5' : '1',\n };\n\n const isOverOtherContext = (): boolean => {\n if (!active || !over || !withSortable) return false;\n if (dndSortableUtils?.checkOverEachItem) return dndSortableUtils.checkOverEachItem(active, over) && Boolean(over);\n return active.data.current?.type !== over.data.current?.type && Boolean(over);\n };\n\n const handleCellValueChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n setEditedCellValue(e.target.value);\n };\n\n const handleCloseEdit = () => {\n if (fieldOperationLoading) return;\n setInlineEditing(null);\n };\n\n const validationRef = useRef<(() => { isValid: boolean; value?: string | boolean | null; meta?: Record<string, unknown> | null }) | null>(null);\n\n const registerValidation = useCallback(\n (validateFn: () => { isValid: boolean; value?: string | boolean | null; meta?: Record<string, unknown> | null }) => {\n validationRef.current = validateFn;\n },\n [],\n );\n\n const tableConfigRef = useRef(tableConfig);\n tableConfigRef.current = tableConfig;\n\n const handleRowCancelEdit = useCallback(() => {\n if (clearRowPendingEdits) clearRowPendingEdits(String(row.original.id));\n }, [clearRowPendingEdits, row.original.id]);\n\n const handleRowConfirmEdit = useCallback(() => {\n if (validationRef.current) {\n const result = validationRef.current();\n if (!result.isValid) return;\n if (inlineEditing && result.value !== undefined && addPendingEdit) {\n addPendingEdit(String(row.original.id), inlineEditing, {\n value: result.value,\n originalValue: row.original[inlineEditing],\n meta: result.meta || undefined,\n });\n }\n } else if (inlineEditing) {\n const currentCell = row.cells?.find((c: TableCell) => c.column?.key === inlineEditing);\n if (currentCell) {\n const pendingValue = contextPendingEdits?.[row.original.id]?.[inlineEditing]?.value;\n const valueToValidate = pendingValue !== undefined ? pendingValue : currentCell.value;\n const result = validateCellValue(valueToValidate as string | boolean | null | undefined, currentCell.column as { type?: string; is_required?: boolean });\n if (!result.isValid) {\n tableConfigRef.current?.showNotification?.('error', result.error || 'Validation failed');\n return;\n }\n }\n }\n\n if (saveRowPendingEdits) saveRowPendingEdits(String(row.original.id));\n }, [saveRowPendingEdits, row.original, row.cells, inlineEditing, addPendingEdit, contextPendingEdits]);\n\n const handleUpdateCellData = (\n directValue?: string | boolean | null,\n meta?: { currency_code?: string | null; reference?: unknown | null;[key: string]: unknown | null } | null,\n ) => {\n const _item = { ...row.original };\n const updatedValue = directValue !== undefined ? directValue : editedCellValue;\n if (inlineEditing && updatedValue !== undefined) {\n _item[inlineEditing] = updatedValue;\n if (onRowEdit) onRowEdit(_item, index, inlineEditing, updatedValue, meta);\n if (removePendingEdit) removePendingEdit(String(row.original.id), inlineEditing);\n }\n handleCloseEdit();\n };\n\n const ref = useRef<HTMLElement>(null);\n\n const handleCellClick = (event: React.MouseEvent, data: string | Record<string, unknown>, idx: number, key: string) => {\n if (isCellClickDisabled) return;\n event?.stopPropagation();\n if (inlineEditing === key) return;\n\n if (onRowEdit) {\n if (inlineEditColumns?.includes(key)) {\n setInlineEditing(key);\n setEditedCellValue(String(row.original[key]));\n } else {\n const msg = tableConfig?.getSystemMessage?.('notAllowedInlineEdit') || 'Inline Edit is not allowed for this column';\n tableConfig?.showNotification?.('error', msg);\n }\n return;\n }\n\n if (onRowClick) {\n onRowClick(data, idx, row.original, rows?.map((_row: { original: unknown }) => _row.original) || []);\n } else if (!onRowClick && checkboxConfig) {\n const _id = row.original.id;\n const checkEvent = { target: { checked: !checkboxConfig.checkedIds.includes(_id) } };\n checkboxConfig.onItemCheck(checkEvent, _id);\n }\n };\n\n const toggleRowExpand = async () => {\n setLoadingExpand(true);\n if (getInnerRowData) {\n await getInnerRowData(row?.original?.id, row?.original, !(expandedRows?.[row?.original?.id as string]?.isOpen ?? false), row?.original?.__level || 0);\n }\n setLoadingExpand(false);\n };\n\n\n\n\n const totalWidth = useMemo(() => {\n return row.cells.filter((c: TableCell) => c.column?.visible).map((c: TableCell) => c.column?.width ?? 0).reduce((a: number, b: number) => a + b, 0);\n }, [row.cells]);\n\n const isDraggingOver = useMemo(() => {\n return dragConfig?.draggingOver && dragConfig?.draggingOver === row?.original?.id;\n }, [dragConfig, row?.original?.id]);\n\n const dropPosition = useMemo(() => {\n if (!isDraggingOver) return null;\n return dragConfig?.dropPosition || 'inside';\n }, [isDraggingOver, dragConfig?.dropPosition]);\n\n const isDraggingOverInside = Boolean(isDraggingOver && dropPosition === 'inside');\n\n const _meta = (row?.original?.__rowMetadata as TRowMetadata) || (row?.original?._meta as TRowMetadata | undefined);\n const _notHovering = rowHovering !== row?.original?.id;\n const _notLoading = !row?.original?.__isLoading;\n const _isNewRow = !!(\n _meta?.__is_new ||\n _meta?.__is_added ||\n row?.original?.is_added ||\n (currentData?.is_added as boolean) ||\n _meta?.is_added ||\n _meta?.is_new\n );\n const _isDeletedRow = !!(row?.original?.is_deleted || _meta?.__is_deleted || (currentData?.is_deleted as boolean) || _meta?.is_deleted);\n const _isModifiedRow =\n !!(\n row?.original?.is_modified ||\n row?.original?.is_row_modified ||\n _meta?.__is_modified ||\n _meta?.__is_edited ||\n (currentData?.is_row_modified as boolean) ||\n _meta?.is_modified\n ) && !_isNewRow;\n\n const isSelected =\n selectedRowId !== null && selectedRowId !== undefined && String(selectedRowId) === String(row?.original?.id);\n\n const bgColor = cn({\n 'bg-neutral-100 dark:bg-black-600': rowHovering === row?.original?.id && !isInlineEditing,\n 'bg-primary-100 dark:bg-primary-950': isSelected && _notHovering && !isInlineEditing,\n 'bg-primary-50 dark:bg-black-700': !row?.original?.is_read && showNewItem && !row?.original?.__isLoading && _notHovering && !isInlineEditing,\n // 'bg-white dark:bg-black-700': cell.column.sticky && rowHovering !== id,\n 'bg-warning-50 dark:bg-warning-975': _isModifiedRow && _notLoading && _notHovering && !isInlineEditing,\n 'bg-error-50 dark:bg-error-975': _isDeletedRow && _notLoading && _notHovering && !isInlineEditing,\n 'bg-success-50 dark:bg-success-975': _isNewRow && _notLoading && _notHovering && !isInlineEditing,\n 'bg-primary-50 dark:bg-primary-900': isInlineEditing,\n [getTableRowBgClassNamesByStatus[row?.original?.__rowBgStatus as string]]: row?.original?.__rowBgStatus && !isInlineEditing,\n });\n\n return (\n <tr\n {...row.getRowProps()}\n ref={withDraggable || withSortable ? setNodeRef : null}\n key={row.original.id}\n data-row-id={row.original.id}\n className={cn(\n `text-neutral-900 dark:text-white cursor-pointer min-w-full relative ${checkboxConfig?.selectionDisabledRowIds?.includes(row?.original?.id) ? 'opacity-50' : ''} border-t`,\n isDragging ? 'z-40' : '',\n isOverOtherContext() ? 'shadow-dnd-drop' : '',\n withDraggable && over && over?.data?.current?.type === 'table-file-dropzone' && over?.data?.current?.folderId === row?.original?.id && row?.original?.type === 'folder' ? 'bg-primary-50' : '',\n row?.original?.isDefinedActionRow ? 'bg-primary-50' : '',\n isDraggingOverInside ? 'z-50' : '',\n bgColor ? bgColor : 'bg-white dark:bg-black-800',\n )}\n style={{ ...style, ...(withSortable ? dndStyles : {}), width: 'max-content' }}\n {...(withDraggable || withSortable ? attributes : {})}\n {...(withDraggable || withSortable ? listeners : {})}\n >\n {isDraggingOverInside && dragConfig?.dragOperation ? (\n <div className='absolute right-2 h-row flex items-center z-20 pointer-events-none'>\n <div className='bg-primary-200 px-2 py-1 rounded'>\n {dragConfig?.dragOperation === 'COPY' ? (\n <AddRounded sx={{ fontSize: 12 }} className='text-primary-700' />\n ) : (\n <SubdirectoryArrowLeftRounded sx={{ fontSize: 12 }} className='text-primary-700' />\n )}\n </div>\n </div>\n ) : null}\n {isDraggingOverInside && !dragConfig?.dragOperation ? (\n <div className='absolute right-2 h-row flex items-center z-20 pointer-events-none'>\n <SubdirectoryArrowLeftRounded sx={{ fontSize: 16 }} className='text-primary-500' />\n </div>\n ) : null}\n {isDraggingOver && dropPosition === 'before' && !row?.original?.isDefinedActionRow ? (\n <div className='absolute -top-[1px] left-0 right-0 h-[2px] bg-primary-500 z-20 pointer-events-none'>\n <div className='absolute left-0 top-1/2 -translate-y-1/2 w-2 h-2 rounded-full bg-primary-500' />\n </div>\n ) : null}\n {isDraggingOver && dropPosition === 'after' && !row?.original?.isDefinedActionRow ? (\n <div className='absolute -bottom-[1px] left-0 right-0 h-[2px] bg-primary-500 z-20 pointer-events-none'>\n <div className='absolute left-0 top-1/2 -translate-y-1/2 w-2 h-2 rounded-full bg-primary-500' />\n </div>\n ) : null}\n\n {row?.original?.isDefinedActionRow ? (\n <ActionCell\n cells={row.cells}\n id={row?.original?.id}\n isCheckbox={checkboxConfig}\n level={level}\n name={row?.original?.name as string}\n onClick={row?.original?.onClick as () => void}\n rowHovering={rowHovering || ''}\n isRoot={row?.original?.isRoot as boolean}\n totalWidth={totalWidth}\n row={row.original as Record<string, unknown>}\n uploadCell={row?.original?.uploadCell as boolean}\n disabled={row?.original?.disabled as boolean}\n disabledTooltip={row?.original?.disabledTooltip as string}\n />\n ) : RowWrapper ? (\n <RowWrapper data={row.original} setIsDraggingFile={setIsDraggingFile}>\n <RowContent\n isDraggingOver={isDraggingOverInside}\n level={level}\n withDraggable={withDraggable}\n setDroppableNodeRef={setDroppableNodeRef}\n isLastRow={isLastRow}\n lastRow={lastRow}\n isCheckbox={isCheckbox}\n checkboxConfig={checkboxConfig}\n row={row}\n rowHovering={rowHovering}\n tableActions={tableActions}\n disableOptionsForRowIndex={disableOptionsForRowIndex}\n index={index}\n showNewItem={showNewItem}\n currentData={currentData}\n lastNonStickyColumnIndex={lastNonStickyColumnIndex}\n getSumOfNextVisibleColumnWidth={getSumOfNextVisibleColumnWidth}\n toggleRowExpand={toggleRowExpand}\n loadingExpand={loadingExpand}\n cellRef={ref}\n handleCellClick={handleCellClick}\n getFullRowDataOnClick={getFullRowDataOnClick}\n handleCellValueChange={handleCellValueChange}\n handleUpdateCellData={handleUpdateCellData}\n handleRowCancelEdit={handleRowCancelEdit}\n handleRowConfirmEdit={handleRowConfirmEdit}\n registerValidation={registerValidation}\n inlineEditing={inlineEditing}\n isInlineEditing={isInlineEditing}\n setRowHovering={setRowHovering}\n highlightSubstring={highlightSubstring}\n rowOptions={rowOptions}\n isDraggingFile={isDraggingFile}\n rowAdditionalActions={rowAdditionalActions}\n hoverConfig={hoverConfig}\n isSelected={isSelected}\n />\n </RowWrapper>\n ) : (\n <RowContent\n level={level}\n withDraggable={withDraggable}\n setDroppableNodeRef={setDroppableNodeRef}\n isLastRow={isLastRow}\n lastRow={lastRow}\n isCheckbox={isCheckbox}\n checkboxConfig={checkboxConfig}\n row={row}\n rowHovering={rowHovering}\n tableActions={tableActions}\n disableOptionsForRowIndex={disableOptionsForRowIndex}\n index={index}\n showNewItem={showNewItem}\n currentData={currentData}\n lastNonStickyColumnIndex={lastNonStickyColumnIndex}\n getSumOfNextVisibleColumnWidth={getSumOfNextVisibleColumnWidth}\n toggleRowExpand={toggleRowExpand}\n loadingExpand={loadingExpand}\n cellRef={ref}\n handleCellClick={handleCellClick}\n getFullRowDataOnClick={getFullRowDataOnClick}\n handleCellValueChange={handleCellValueChange}\n handleUpdateCellData={handleUpdateCellData}\n handleRowCancelEdit={handleRowCancelEdit}\n handleRowConfirmEdit={handleRowConfirmEdit}\n registerValidation={registerValidation}\n inlineEditing={inlineEditing}\n isInlineEditing={isInlineEditing}\n setRowHovering={setRowHovering}\n highlightSubstring={highlightSubstring}\n rowOptions={rowOptions}\n isDraggingFile={isDraggingFile}\n isDraggingOver={isDraggingOverInside}\n rowAdditionalActions={rowAdditionalActions}\n hoverConfig={hoverConfig}\n isSelected={isSelected}\n />\n )}\n </tr>\n );\n};\n\ninterface RowContentProps {\n withDraggable?: boolean;\n setDroppableNodeRef: (node: HTMLElement | null) => void;\n isLastRow?: boolean;\n lastRow?: unknown;\n isCheckbox: boolean;\n checkboxConfig: Record<string, unknown> | null;\n row: TableRowData;\n rowHovering: string | number | null;\n tableActions?: ((rowData: Record<string, unknown>, index: number) => React.ReactNode) | null;\n disableOptionsForRowIndex?: number | null;\n index: number;\n showNewItem?: boolean;\n currentData: Record<string, unknown> | null;\n lastNonStickyColumnIndex?: (() => number | null) | null;\n getSumOfNextVisibleColumnWidth?: (index: number) => number | null;\n toggleRowExpand: () => Promise<void>;\n loadingExpand: boolean;\n cellRef: React.RefObject<HTMLElement | null>;\n handleCellClick: (event: React.MouseEvent, data: string | Record<string, unknown>, idx: number, key: string) => void;\n getFullRowDataOnClick?: boolean;\n handleCellValueChange: (e: React.ChangeEvent<HTMLInputElement>) => void;\n handleUpdateCellData: (directValue?: string | boolean | null, meta?: Record<string, unknown> | null) => void;\n handleRowCancelEdit: () => void;\n handleRowConfirmEdit: () => void;\n registerValidation: (fn: () => { isValid: boolean; value?: string | boolean | null; meta?: Record<string, unknown> | null }) => void;\n inlineEditing: string | null;\n isInlineEditing: boolean;\n setRowHovering: (id: string | number | null) => void;\n highlightSubstring?: (value: string) => React.ReactNode;\n rowOptions?: TRowOption[] | ((rowData: Record<string, unknown>) => TRowOption[] | null) | null;\n level?: number;\n isDraggingFile?: boolean;\n isDraggingOver?: boolean;\n rowAdditionalActions?: unknown;\n hoverConfig?: { onHover?: (data: Record<string, unknown>) => React.ReactNode };\n isSelected?: boolean;\n}\n\nconst RowContent = ({\n withDraggable,\n setDroppableNodeRef,\n isLastRow,\n lastRow,\n isCheckbox,\n checkboxConfig,\n row,\n rowHovering,\n tableActions,\n disableOptionsForRowIndex,\n index,\n showNewItem,\n currentData,\n lastNonStickyColumnIndex,\n getSumOfNextVisibleColumnWidth,\n toggleRowExpand,\n loadingExpand,\n cellRef,\n handleCellClick,\n getFullRowDataOnClick,\n handleCellValueChange,\n handleUpdateCellData,\n handleRowCancelEdit,\n handleRowConfirmEdit,\n registerValidation,\n inlineEditing,\n isInlineEditing,\n setRowHovering,\n highlightSubstring,\n rowOptions,\n level,\n isDraggingFile,\n isDraggingOver,\n rowAdditionalActions,\n hoverConfig,\n isSelected,\n}: RowContentProps) => {\n const [isRowContentHovering, setIsRowContentHovering] = useState(false);\n const {\n getPendingEdit: getPendingEditFn,\n hasPendingEdit: hasPendingEditFn,\n pendingEdits,\n tableHeaders,\n pendingEditsCount,\n scrollToCell,\n } = useContext(TableContext);\n const rowHasPendingEdits = pendingEdits?.[row.original.id] && Object.keys(pendingEdits[row.original.id]).length > 0;\n const tableHasAnyPendingEdits = (pendingEditsCount ?? 0) > 0;\n const resolvedRowOptions = useMemo<TRowOption[]>(() => {\n if (Array.isArray(rowOptions)) return rowOptions;\n if (typeof rowOptions === 'function') {\n const options = rowOptions({ ...row.original, rowIndex: index });\n return Array.isArray(options) ? options : [];\n }\n return [];\n }, [rowOptions, row.original, index]);\n\n\n const _meta = (row?.original?.__rowMetadata as TRowMetadata | undefined) || (row?.original?._meta as TRowMetadata | undefined);\n const _notHovering = rowHovering !== row?.original?.id;\n const _notLoading = !row?.original?.__isLoading;\n const _isNewRow = !!(\n _meta?.__is_new ||\n _meta?.__is_added ||\n row?.original?.is_added ||\n (currentData?.is_added as boolean) ||\n _meta?.is_added ||\n _meta?.is_new\n );\n const _isDeletedRow = !!(row?.original?.is_deleted || _meta?.__is_deleted || (currentData?.is_deleted as boolean) || _meta?.is_deleted);\n const _isModifiedRow =\n !!(\n row?.original?.is_modified ||\n row?.original?.is_row_modified ||\n _meta?.__is_modified ||\n _meta?.__is_edited ||\n (currentData?.is_row_modified as boolean) ||\n _meta?.is_deleted\n ) && !_isNewRow;\n\n // Only apply the selected background when the row is not being hovered, so on hover the icon cells\n // (checkbox, actions, options) fall back to the same gray hover background as the data cells.\n const selectedBg =\n isSelected && !isInlineEditing && rowHovering !== row?.original?.id ? 'bg-primary-100 dark:bg-primary-950' : undefined;\n\n const statusBorderClass = cn({\n 'border-l-[3px] border-l-success-400 dark:border-l-success-500': _isNewRow && _notLoading && _notHovering && !isInlineEditing,\n 'border-l-[3px] border-l-error-400 dark:border-l-error-500': _isDeletedRow && _notLoading && _notHovering && !isInlineEditing,\n 'border-l-[3px] border-l-warning-400 dark:border-l-warning-500': _isModifiedRow && _notLoading && _notHovering && !isInlineEditing,\n });\n\n return (\n <div\n ref={withDraggable ? setDroppableNodeRef : null}\n className={isDraggingOver ? 'border-2 border-primary-400 dark:border-primary-500 rounded-sm' : ''}\n >\n <div className={cn('flex', statusBorderClass)} ref={isLastRow ? (lastRow as React.Ref<HTMLDivElement>) : null}>\n {tableHasAnyPendingEdits && (\n <PendingEditCell\n rowId={String(row.original.id)}\n rowIndex={index}\n pendingEdits={pendingEdits}\n tableHeaders={tableHeaders}\n rowHasPendingEdits={!!rowHasPendingEdits}\n rowHovering={rowHovering != null ? String(rowHovering) : undefined}\n isInlineEditing={isInlineEditing}\n is_read={!!row.original.is_read}\n is_modified={_isModifiedRow}\n is_row_modified={!!row.original.is_row_modified}\n is_deleted={_isDeletedRow}\n is_added={_isNewRow}\n is_incomplete={row?.original?.status === 'Incomplete'}\n showNewItem={showNewItem}\n onScrollToCell={scrollToCell}\n />\n )}\n\n {isCheckbox && (\n <CheckboxCell\n checkboxConfig={checkboxConfig as never}\n id={String(row.original.id)}\n rowHovering={rowHovering != null ? String(rowHovering) : undefined}\n isDisabled={!!row?.original?.__isLoading}\n isDraggingOver={isDraggingOver}\n is_added={_isNewRow}\n is_deleted={_isDeletedRow}\n is_incomplete={row?.original?.status === 'Incomplete'}\n is_modified={_isModifiedRow}\n is_read={!!row.original.is_read}\n is_row_modified={!!row.original.is_row_modified}\n showNewItem={showNewItem}\n currentData={currentData ?? {}}\n bgColor={row?.original?.__rowBgStatus ? getTableRowBgClassNamesByStatus[row?.original?.__rowBgStatus as string] : selectedBg}\n isInlineEditing={isInlineEditing}\n hasPendingEditsColumn={tableHasAnyPendingEdits}\n rowHasPendingEdits={rowHasPendingEdits}\n />\n )}\n\n {tableActions ? (\n <RowActionCell\n tableActions={tableActions as (rowData: Record<string, unknown>, index: number) => JSX.Element}\n disableOptionsForRowIndex={disableOptionsForRowIndex ?? null}\n id={String(row.original.id)}\n index={index}\n is_read={!!row?.original?.is_read}\n is_incomplete={row?.original?.status === 'Incomplete'}\n showNewItem={!!showNewItem}\n is_modified={_isModifiedRow}\n is_row_modified={!!row?.original?.is_row_modified}\n is_deleted={_isDeletedRow}\n currentData={currentData ?? {}}\n is_added={_isNewRow}\n rowData={row.original as Record<string, unknown>}\n rowHovering={rowHovering}\n isDisabled={!!row?.original?.__isLoading}\n bgColor={isDraggingFile ? 'bg-primary-50' : row?.original?.__rowBgStatus ? getTableRowBgClassNamesByStatus[row?.original?.__rowBgStatus as string] : selectedBg}\n isInlineEditing={isInlineEditing}\n rowHasPendingEdits={rowHasPendingEdits}\n />\n ) : null}\n\n <div\n className='relative flex-1'\n id={`row-${row.original.id}`}\n onMouseEnter={() => setIsRowContentHovering(true)}\n onMouseLeave={() => setIsRowContentHovering(false)}\n >\n {row.cells\n .filter((cell: TableCell) => cell?.column?.visible !== false)\n .map((cell: TableCell, y: number) => {\n const isLastCell = y === lastNonStickyColumnIndex?.();\n const isFirstStickyCell = y === (lastNonStickyColumnIndex?.() ?? -1) + 1;\n const nextWidthSum = cell?.column?.sticky ? (getSumOfNextVisibleColumnWidth?.(y) ?? 0) : 0;\n\n if (row.original?.__isLoading) {\n return (\n <LoaderCell cell={cell as unknown as { column: { width: number; sticky?: boolean; sequence?: number } }} id={y} nextWidthSum={nextWidthSum} isLastCell={isLastCell} rowHovering={rowHovering} index={y} key={y} isFirstStickyCell={isFirstStickyCell} />\n );\n }\n\n const pendingEdit = getPendingEditFn?.(String(row.original.id), cell?.column?.key || '');\n const hasPending = hasPendingEditFn?.(String(row.original.id), cell?.column?.key || '');\n\n return (\n <DataCell\n cell={cell as unknown as import('../../types').ICell}\n rowHovering={rowHovering}\n isFirstStickyCell={isFirstStickyCell}\n level={level ?? 0}\n toggleRowExpand={toggleRowExpand}\n loadingExpand={loadingExpand}\n key={cell?.column?.key}\n index={y}\n cellRef={cellRef as React.RefObject<HTMLDivElement>}\n currentData={currentData as { is_row_modified?: boolean; is_deleted?: boolean; is_added?: boolean }}\n handleCellClick={(e?: React.MouseEvent) => { if (e) handleCellClick(e, getFullRowDataOnClick ? row.original : String(row.original.id), y, cell?.column?.key || ''); }}\n handleCellValueChange={handleCellValueChange}\n handleUpdateCellData={handleUpdateCellData}\n registerValidation={registerValidation}\n id={row.original.id}\n inlineEditing={inlineEditing}\n isInlineEditing={isInlineEditing}\n isLastCell={isLastCell}\n is_incomplete={row?.original?.status === 'Incomplete'}\n is_added={_isNewRow}\n is_deleted={_isDeletedRow}\n is_modified={_isModifiedRow}\n is_read={!!row.original.is_read}\n is_row_modified={!!row.original.is_row_modified}\n nextWidthSum={nextWidthSum}\n setRowHovering={setRowHovering}\n highlightSubstring={highlightSubstring as ((value: string) => JSX.Element) | undefined}\n isDraggingOver={isDraggingOver}\n isLoading={!!row?.original?.__isLoading}\n pendingEdit={pendingEdit}\n hasPendingEdit={hasPending}\n pendingValidationError={pendingEdit?.validationError}\n />\n );\n })}\n\n {hoverConfig?.onHover &&\n isRowContentHovering &&\n createPortal(\n <div className='absolute top-full left-10 z-50 bg-white dark:bg-black-800 rounded-xl'>{hoverConfig.onHover(row.original) as React.ReactNode}</div>,\n document.getElementById(`row-${row.original.id}`) as HTMLElement,\n )}\n </div>\n\n {(resolvedRowOptions.length > 0 || !!rowAdditionalActions) && (\n <RowOptionsCell\n rowId={row.original.id}\n rowOptions={resolvedRowOptions}\n disableOption={disableOptionsForRowIndex !== null || !!row?.original?.__isLoading}\n rowHovering={rowHovering}\n setRowHovering={setRowHovering}\n is_read={!!row.original.is_read}\n showNewItem={!!showNewItem}\n is_modified={_isModifiedRow}\n is_row_modified={!!row.original.is_row_modified}\n is_incomplete={row?.original?.status === 'Incomplete'}\n currentData={currentData ?? {}}\n is_deleted={_isDeletedRow}\n is_added={_isNewRow}\n isDraggingOver={!!isDraggingOver}\n rowAdditionalActions={rowAdditionalActions as (rowData: Record<string, unknown>, index: number, isHovering: boolean) => React.ReactNode}\n rowData={row.original as Record<string, unknown>}\n index={index}\n bgColor={row?.original?.__rowBgStatus ? getTableRowBgClassNamesByStatus[row?.original?.__rowBgStatus as string] : selectedBg}\n isInlineEditing={isInlineEditing}\n onConfirmEdit={handleRowConfirmEdit}\n onCancelEdit={handleRowCancelEdit}\n rowHasPendingEdits={rowHasPendingEdits}\n />\n )}\n </div>\n </div>\n );\n};\n"],"names":["Row","row","isLastRow","lastRow","highlightSubstring","index","style","level","expandedRows","rows","lastNonStickyColumnIndex","checkboxConfig","onRowClick","rowOptions","disableOptionsForRowIndex","getSumOfNextVisibleColumnWidth","onRowEdit","inlineEditColumns","tableActions","dndSortableUtils","withSortable","withDraggable","getInnerRowData","showNewItem","rawData","dragConfig","getFullRowDataOnClick","selectedRowId","RowWrapper","isCellClickDisabled","rowAdditionalActions","hoverConfig","addPendingEdit","removePendingEdit","fieldOperationLoading","clearRowPendingEdits","saveRowPendingEdits","contextPendingEdits","useContext","TableContext","tableConfig","useTableConfig","isCheckbox","activeInlineEdit","setActiveInlineEdit","inlineEditing","isInlineEditing","setInlineEditing","columnKey","rowHovering","setRowHovering","useState","editedCellValue","setEditedCellValue","currentData","setCurrentData","loadingExpand","setLoadingExpand","isDraggingFile","setIsDraggingFile","prevInlineEditingRef","useRef","useEffect","wasEditing","isNowEditing","pendingEdit","currentCell","c","result","validateCellValue","idKey","sortableResult","useSortable","draggableResult","useDraggable","listeners","transform","setNodeRef","isDragging","attributes","active","over","rest","setDroppableNodeRef","useDroppable","dndStyles","CSS","isOverOtherContext","handleCellValueChange","e","handleCloseEdit","validationRef","registerValidation","useCallback","validateFn","tableConfigRef","handleRowCancelEdit","handleRowConfirmEdit","pendingValue","valueToValidate","handleUpdateCellData","directValue","meta","_item","updatedValue","ref","handleCellClick","event","data","idx","key","msg","_row","_id","checkEvent","toggleRowExpand","totalWidth","useMemo","a","b","isDraggingOver","dropPosition","isDraggingOverInside","_meta","_notHovering","_notLoading","_isNewRow","_isDeletedRow","_isModifiedRow","isSelected","bgColor","cn","getTableRowBgClassNamesByStatus","createElement","jsx","AddRounded","SubdirectoryArrowLeftRounded","ActionCell","RowContent","cellRef","isRowContentHovering","setIsRowContentHovering","getPendingEditFn","hasPendingEditFn","pendingEdits","tableHeaders","pendingEditsCount","scrollToCell","rowHasPendingEdits","tableHasAnyPendingEdits","resolvedRowOptions","options","selectedBg","statusBorderClass","jsxs","PendingEditCell","CheckboxCell","RowActionCell","cell","y","isLastCell","isFirstStickyCell","nextWidthSum","LoaderCell","hasPending","DataCell","createPortal","RowOptionsCell"],"mappings":";;;;;;;;;;;;;;;;;;;;AAwGO,MAAMA,KAAM,CAAC,EAAE,KAAAC,GAAK,WAAAC,GAAW,SAAAC,GAAS,oBAAAC,IAAoB,OAAAC,GAAO,OAAAC,IAAO,OAAAC,IAAQ,GAAG,cAAAC,GAAc,MAAAC,SAAmB;AAC3H,QAAM;AAAA,IACJ,0BAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,YAAAC;AAAA,IACA,2BAAAC,IAA4B;AAAA,IAC5B,gCAAAC;AAAA,IACA,WAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,eAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,SAAAC;AAAA,IACA,YAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,eAAAC;AAAA,IACA,YAAYC;AAAA,IACZ,qBAAAC;AAAA,IACA,sBAAAC;AA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C/H,EAAI,SAAS;AAAA,YAChC,eAAeA,GAAK,UAAU,WAAW;AAAA,YACzC,aAAaqD,KAAe,CAAA;AAAA,YAC5B,YAAYyE;AAAA,YACZ,UAAUD;AAAA,YACV,gBAAgB,CAAC,CAACN;AAAA,YAClB,sBAAA1F;AAAA,YACA,SAAS7B,EAAI;AAAA,YACb,OAAAI;AAAA,YACA,SAASJ,GAAK,UAAU,gBAAgBmI,GAAgCnI,GAAK,UAAU,aAAuB,IAAIuJ;AAAA,YAClH,iBAAA1G;AAAA,YACA,eAAemD;AAAA,YACf,cAAcD;AAAA,YACd,oBAAAoD;AAAA,UAAA;AAAA,QAAA;AAAA,MACF,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -1 +1 @@
1
- {"version":3,"file":"context.cjs.js","sources":["../../../../src/components/data-display/infinite-table/context.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { createContext } from 'react';\nimport type { ICurrencyDropdownConfig, IMasterDataModalConfig, IMultiSelectConfig, IPendingEdit, PendingEditsMap } from './types';\n\nexport interface ITableContext {\n tableWrapper?: any;\n tableBodyWrapper?: any;\n lastNonStickyColumnIndex?: () => number | null;\n search?: string | null;\n columnFilters?: any[];\n onRowClick?: any;\n onSort?: any;\n onFilter?: any;\n toggleShowFilters?: any;\n toggleShowSorts?: any;\n onRemoveFilter?: any;\n onClearFilter?: any;\n rowOptions?: any;\n checkboxConfig?: any;\n onResetFilter?: any;\n isColumnConfigurable?: boolean;\n onAddColumnClick?: any;\n onEditColumnClick?: any;\n onDeleteColumnClick?: any;\n onRowTooltipClick?: any;\n tooltiptext?: any;\n cascadingTableConfig?: any;\n originalsOnly?: boolean;\n disableOptionsForRowIndex?: any;\n getFullRowDataOnClick?: boolean;\n getSumOfNextVisibleColumnWidth?: (currentIndex: number) => number | null;\n onRowEdit?: any;\n inlineEditColumns?: string[];\n tableActions?: any;\n dndSortableUtils?: any;\n withSortable?: boolean;\n withDraggable?: boolean;\n onCascadingRowExpand?: any;\n getInnerRowData?: any;\n tableHeaders?: any[];\n maxLevel?: number;\n expandedRows?: any;\n setExpandedRows?: any;\n showNewItem?: boolean;\n rawData?: any;\n dragConfig?: any;\n rowWrapper?: any;\n asyncRowOptionsFilter?: any;\n rowLinkConfig?: {\n isEnabled: boolean;\n linkTo: any;\n };\n isCellClickDisabled?: boolean;\n activeInlineEdit?: { rowId: string; columnKey: string } | null;\n setActiveInlineEdit?: (value: { rowId: string; columnKey: string } | null) => void;\n handleUpdateColumnWidth?: (columnName: string, width: number) => void;\n multiSelectConfig?: IMultiSelectConfig | null;\n headerContextOptions?: React.ReactNode;\n showHeaderContextOptions?: string | null;\n setShowHeaderContextOptions?: (value: string | null) => void;\n headerDivWidth?: number;\n showDataTypeIcon?: boolean;\n rowAdditionalActions?: any;\n rowAdditionalActionsWidth?: number;\n hoverConfig?: any;\n cellEditing?: string | string[] | null;\n cellEditingValue?: string | Record<string, string> | null;\n openMasterDataModal?: (config: IMasterDataModalConfig) => void;\n closeMasterDataModal?: () => void;\n selectedMasterData?: { value: any; reference: any } | null;\n clearSelectedMasterData?: () => void;\n allowInlineEdit?: boolean;\n openCurrencyDropdown?: (config: ICurrencyDropdownConfig) => void;\n closeCurrencyDropdown?: () => void;\n currencyDropdownConfig?: ICurrencyDropdownConfig | null;\n selectedCurrenciesMap?: Record<string, string>;\n setCurrencyForCell?: (cellKey: string, currency: string) => void;\n getCurrencyForCell?: (cellKey: string) => string | undefined;\n pendingEdits?: PendingEditsMap;\n addPendingEdit?: (rowId: string, columnKey: string, edit: IPendingEdit) => void;\n removePendingEdit?: (rowId: string, columnKey: string) => void;\n getPendingEdit?: (rowId: string, columnKey: string) => IPendingEdit | undefined;\n hasPendingEdit?: (rowId: string, columnKey: string) => boolean;\n clearAllPendingEdits?: () => void;\n saveAllPendingEdits?: () => void;\n clearRowPendingEdits?: (rowId: string) => void;\n saveRowPendingEdits?: (rowId: string) => void;\n pendingEditsCount?: number;\n scrollToCell?: (rowId: string, columnKey: string, rowIndex: number) => void;\n onFieldOperationFlow?: (params: {\n value: unknown;\n fieldId: string;\n rowId: string;\n rowData: any;\n columnKey: string;\n flowName?: string;\n isLiveField?: boolean;\n meta?: { reference?: unknown; currency_code?: string };\n }) => Promise<void>;\n fieldOperationLoading?: string | null;\n validateAllPendingEdits?: any;\n}\n\nexport const TableContext = createContext<ITableContext>({\n tableWrapper: null,\n tableBodyWrapper: null,\n lastNonStickyColumnIndex: () => null,\n search: null,\n columnFilters: [],\n onRowClick: null,\n onSort: null,\n onFilter: null,\n onRemoveFilter: null,\n onClearFilter: null,\n rowOptions: null,\n checkboxConfig: null,\n onResetFilter: null,\n isColumnConfigurable: false,\n onAddColumnClick: null,\n onEditColumnClick: null,\n onDeleteColumnClick: null,\n toggleShowFilters: null,\n toggleShowSorts: null,\n onRowTooltipClick: null,\n tooltiptext: null,\n cascadingTableConfig: null,\n originalsOnly: false,\n disableOptionsForRowIndex: null,\n getFullRowDataOnClick: false,\n getSumOfNextVisibleColumnWidth: () => null,\n onRowEdit: null,\n inlineEditColumns: [],\n tableActions: null,\n dndSortableUtils: null,\n withSortable: false,\n withDraggable: false,\n onCascadingRowExpand: null,\n getInnerRowData: null,\n tableHeaders: null as any,\n maxLevel: 0,\n expandedRows: {},\n setExpandedRows: null,\n showNewItem: false,\n rawData: null,\n dragConfig: null,\n rowWrapper: null,\n asyncRowOptionsFilter: null,\n rowLinkConfig: {\n isEnabled: false,\n linkTo: null,\n },\n isCellClickDisabled: false,\n activeInlineEdit: null,\n setActiveInlineEdit: undefined,\n handleUpdateColumnWidth: () => undefined,\n multiSelectConfig: null,\n headerContextOptions: null,\n showHeaderContextOptions: null,\n setShowHeaderContextOptions: undefined,\n showDataTypeIcon: false,\n rowAdditionalActions: null,\n rowAdditionalActionsWidth: 0,\n hoverConfig: null,\n openMasterDataModal: undefined,\n closeMasterDataModal: undefined,\n selectedMasterData: null,\n clearSelectedMasterData: undefined,\n openCurrencyDropdown: undefined,\n closeCurrencyDropdown: undefined,\n currencyDropdownConfig: null,\n selectedCurrenciesMap: {},\n setCurrencyForCell: undefined,\n getCurrencyForCell: undefined,\n});\n"],"names":["TableContext","createContext"],"mappings":"yGAuGaA,EAAeC,EAAAA,cAA6B,CACvD,aAAc,KACd,iBAAkB,KAClB,yBAA0B,IAAM,KAChC,OAAQ,KACR,cAAe,CAAA,EACf,WAAY,KACZ,OAAQ,KACR,SAAU,KACV,eAAgB,KAChB,cAAe,KACf,WAAY,KACZ,eAAgB,KAChB,cAAe,KACf,qBAAsB,GACtB,iBAAkB,KAClB,kBAAmB,KACnB,oBAAqB,KACrB,kBAAmB,KACnB,gBAAiB,KACjB,kBAAmB,KACnB,YAAa,KACb,qBAAsB,KACtB,cAAe,GACf,0BAA2B,KAC3B,sBAAuB,GACvB,+BAAgC,IAAM,KACtC,UAAW,KACX,kBAAmB,CAAA,EACnB,aAAc,KACd,iBAAkB,KAClB,aAAc,GACd,cAAe,GACf,qBAAsB,KACtB,gBAAiB,KACjB,aAAc,KACd,SAAU,EACV,aAAc,CAAA,EACd,gBAAiB,KACjB,YAAa,GACb,QAAS,KACT,WAAY,KACZ,WAAY,KACZ,sBAAuB,KACvB,cAAe,CACb,UAAW,GACX,OAAQ,IAAA,EAEV,oBAAqB,GACrB,iBAAkB,KAClB,oBAAqB,OACrB,wBAAyB,IAAA,GACzB,kBAAmB,KACnB,qBAAsB,KACtB,yBAA0B,KAC1B,4BAA6B,OAC7B,iBAAkB,GAClB,qBAAsB,KACtB,0BAA2B,EAC3B,YAAa,KACb,oBAAqB,OACrB,qBAAsB,OACtB,mBAAoB,KACpB,wBAAyB,OACzB,qBAAsB,OACtB,sBAAuB,OACvB,uBAAwB,KACxB,sBAAuB,CAAA,EACvB,mBAAoB,OACpB,mBAAoB,MACtB,CAAC"}
1
+ {"version":3,"file":"context.cjs.js","sources":["../../../../src/components/data-display/infinite-table/context.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { createContext } from 'react';\nimport type { ICurrencyDropdownConfig, IMasterDataModalConfig, IMultiSelectConfig, IPendingEdit, PendingEditsMap } from './types';\n\nexport interface ITableContext {\n tableWrapper?: any;\n tableBodyWrapper?: any;\n lastNonStickyColumnIndex?: () => number | null;\n search?: string | null;\n columnFilters?: any[];\n onRowClick?: any;\n onSort?: any;\n onFilter?: any;\n toggleShowFilters?: any;\n toggleShowSorts?: any;\n onRemoveFilter?: any;\n onClearFilter?: any;\n rowOptions?: any;\n checkboxConfig?: any;\n onResetFilter?: any;\n isColumnConfigurable?: boolean;\n onAddColumnClick?: any;\n onEditColumnClick?: any;\n onDeleteColumnClick?: any;\n onRowTooltipClick?: any;\n tooltiptext?: any;\n cascadingTableConfig?: any;\n originalsOnly?: boolean;\n disableOptionsForRowIndex?: any;\n getFullRowDataOnClick?: boolean;\n selectedRowId?: string | number | null;\n getSumOfNextVisibleColumnWidth?: (currentIndex: number) => number | null;\n onRowEdit?: any;\n inlineEditColumns?: string[];\n tableActions?: any;\n dndSortableUtils?: any;\n withSortable?: boolean;\n withDraggable?: boolean;\n onCascadingRowExpand?: any;\n getInnerRowData?: any;\n tableHeaders?: any[];\n maxLevel?: number;\n expandedRows?: any;\n setExpandedRows?: any;\n showNewItem?: boolean;\n rawData?: any;\n dragConfig?: any;\n rowWrapper?: any;\n asyncRowOptionsFilter?: any;\n rowLinkConfig?: {\n isEnabled: boolean;\n linkTo: any;\n };\n isCellClickDisabled?: boolean;\n activeInlineEdit?: { rowId: string; columnKey: string } | null;\n setActiveInlineEdit?: (value: { rowId: string; columnKey: string } | null) => void;\n handleUpdateColumnWidth?: (columnName: string, width: number) => void;\n multiSelectConfig?: IMultiSelectConfig | null;\n headerContextOptions?: React.ReactNode;\n showHeaderContextOptions?: string | null;\n setShowHeaderContextOptions?: (value: string | null) => void;\n headerDivWidth?: number;\n showDataTypeIcon?: boolean;\n rowAdditionalActions?: any;\n rowAdditionalActionsWidth?: number;\n hoverConfig?: any;\n cellEditing?: string | string[] | null;\n cellEditingValue?: string | Record<string, string> | null;\n openMasterDataModal?: (config: IMasterDataModalConfig) => void;\n closeMasterDataModal?: () => void;\n selectedMasterData?: { value: any; reference: any } | null;\n clearSelectedMasterData?: () => void;\n allowInlineEdit?: boolean;\n openCurrencyDropdown?: (config: ICurrencyDropdownConfig) => void;\n closeCurrencyDropdown?: () => void;\n currencyDropdownConfig?: ICurrencyDropdownConfig | null;\n selectedCurrenciesMap?: Record<string, string>;\n setCurrencyForCell?: (cellKey: string, currency: string) => void;\n getCurrencyForCell?: (cellKey: string) => string | undefined;\n pendingEdits?: PendingEditsMap;\n addPendingEdit?: (rowId: string, columnKey: string, edit: IPendingEdit) => void;\n removePendingEdit?: (rowId: string, columnKey: string) => void;\n getPendingEdit?: (rowId: string, columnKey: string) => IPendingEdit | undefined;\n hasPendingEdit?: (rowId: string, columnKey: string) => boolean;\n clearAllPendingEdits?: () => void;\n saveAllPendingEdits?: () => void;\n clearRowPendingEdits?: (rowId: string) => void;\n saveRowPendingEdits?: (rowId: string) => void;\n pendingEditsCount?: number;\n scrollToCell?: (rowId: string, columnKey: string, rowIndex: number) => void;\n onFieldOperationFlow?: (params: {\n value: unknown;\n fieldId: string;\n rowId: string;\n rowData: any;\n columnKey: string;\n flowName?: string;\n isLiveField?: boolean;\n meta?: { reference?: unknown; currency_code?: string };\n }) => Promise<void>;\n fieldOperationLoading?: string | null;\n validateAllPendingEdits?: any;\n}\n\nexport const TableContext = createContext<ITableContext>({\n tableWrapper: null,\n tableBodyWrapper: null,\n lastNonStickyColumnIndex: () => null,\n search: null,\n columnFilters: [],\n onRowClick: null,\n onSort: null,\n onFilter: null,\n onRemoveFilter: null,\n onClearFilter: null,\n rowOptions: null,\n checkboxConfig: null,\n onResetFilter: null,\n isColumnConfigurable: false,\n onAddColumnClick: null,\n onEditColumnClick: null,\n onDeleteColumnClick: null,\n toggleShowFilters: null,\n toggleShowSorts: null,\n onRowTooltipClick: null,\n tooltiptext: null,\n cascadingTableConfig: null,\n originalsOnly: false,\n disableOptionsForRowIndex: null,\n getFullRowDataOnClick: false,\n getSumOfNextVisibleColumnWidth: () => null,\n onRowEdit: null,\n inlineEditColumns: [],\n tableActions: null,\n dndSortableUtils: null,\n withSortable: false,\n withDraggable: false,\n onCascadingRowExpand: null,\n getInnerRowData: null,\n tableHeaders: null as any,\n maxLevel: 0,\n expandedRows: {},\n setExpandedRows: null,\n showNewItem: false,\n rawData: null,\n dragConfig: null,\n rowWrapper: null,\n asyncRowOptionsFilter: null,\n rowLinkConfig: {\n isEnabled: false,\n linkTo: null,\n },\n isCellClickDisabled: false,\n activeInlineEdit: null,\n setActiveInlineEdit: undefined,\n handleUpdateColumnWidth: () => undefined,\n multiSelectConfig: null,\n headerContextOptions: null,\n showHeaderContextOptions: null,\n setShowHeaderContextOptions: undefined,\n showDataTypeIcon: false,\n rowAdditionalActions: null,\n rowAdditionalActionsWidth: 0,\n hoverConfig: null,\n openMasterDataModal: undefined,\n closeMasterDataModal: undefined,\n selectedMasterData: null,\n clearSelectedMasterData: undefined,\n openCurrencyDropdown: undefined,\n closeCurrencyDropdown: undefined,\n currencyDropdownConfig: null,\n selectedCurrenciesMap: {},\n setCurrencyForCell: undefined,\n getCurrencyForCell: undefined,\n});\n"],"names":["TableContext","createContext"],"mappings":"yGAwGaA,EAAeC,EAAAA,cAA6B,CACvD,aAAc,KACd,iBAAkB,KAClB,yBAA0B,IAAM,KAChC,OAAQ,KACR,cAAe,CAAA,EACf,WAAY,KACZ,OAAQ,KACR,SAAU,KACV,eAAgB,KAChB,cAAe,KACf,WAAY,KACZ,eAAgB,KAChB,cAAe,KACf,qBAAsB,GACtB,iBAAkB,KAClB,kBAAmB,KACnB,oBAAqB,KACrB,kBAAmB,KACnB,gBAAiB,KACjB,kBAAmB,KACnB,YAAa,KACb,qBAAsB,KACtB,cAAe,GACf,0BAA2B,KAC3B,sBAAuB,GACvB,+BAAgC,IAAM,KACtC,UAAW,KACX,kBAAmB,CAAA,EACnB,aAAc,KACd,iBAAkB,KAClB,aAAc,GACd,cAAe,GACf,qBAAsB,KACtB,gBAAiB,KACjB,aAAc,KACd,SAAU,EACV,aAAc,CAAA,EACd,gBAAiB,KACjB,YAAa,GACb,QAAS,KACT,WAAY,KACZ,WAAY,KACZ,sBAAuB,KACvB,cAAe,CACb,UAAW,GACX,OAAQ,IAAA,EAEV,oBAAqB,GACrB,iBAAkB,KAClB,oBAAqB,OACrB,wBAAyB,IAAA,GACzB,kBAAmB,KACnB,qBAAsB,KACtB,yBAA0B,KAC1B,4BAA6B,OAC7B,iBAAkB,GAClB,qBAAsB,KACtB,0BAA2B,EAC3B,YAAa,KACb,oBAAqB,OACrB,qBAAsB,OACtB,mBAAoB,KACpB,wBAAyB,OACzB,qBAAsB,OACtB,sBAAuB,OACvB,uBAAwB,KACxB,sBAAuB,CAAA,EACvB,mBAAoB,OACpB,mBAAoB,MACtB,CAAC"}
@@ -25,6 +25,7 @@ export interface ITableContext {
25
25
  originalsOnly?: boolean;
26
26
  disableOptionsForRowIndex?: any;
27
27
  getFullRowDataOnClick?: boolean;
28
+ selectedRowId?: string | number | null;
28
29
  getSumOfNextVisibleColumnWidth?: (currentIndex: number) => number | null;
29
30
  onRowEdit?: any;
30
31
  inlineEditColumns?: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"context.es.js","sources":["../../../../src/components/data-display/infinite-table/context.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { createContext } from 'react';\nimport type { ICurrencyDropdownConfig, IMasterDataModalConfig, IMultiSelectConfig, IPendingEdit, PendingEditsMap } from './types';\n\nexport interface ITableContext {\n tableWrapper?: any;\n tableBodyWrapper?: any;\n lastNonStickyColumnIndex?: () => number | null;\n search?: string | null;\n columnFilters?: any[];\n onRowClick?: any;\n onSort?: any;\n onFilter?: any;\n toggleShowFilters?: any;\n toggleShowSorts?: any;\n onRemoveFilter?: any;\n onClearFilter?: any;\n rowOptions?: any;\n checkboxConfig?: any;\n onResetFilter?: any;\n isColumnConfigurable?: boolean;\n onAddColumnClick?: any;\n onEditColumnClick?: any;\n onDeleteColumnClick?: any;\n onRowTooltipClick?: any;\n tooltiptext?: any;\n cascadingTableConfig?: any;\n originalsOnly?: boolean;\n disableOptionsForRowIndex?: any;\n getFullRowDataOnClick?: boolean;\n getSumOfNextVisibleColumnWidth?: (currentIndex: number) => number | null;\n onRowEdit?: any;\n inlineEditColumns?: string[];\n tableActions?: any;\n dndSortableUtils?: any;\n withSortable?: boolean;\n withDraggable?: boolean;\n onCascadingRowExpand?: any;\n getInnerRowData?: any;\n tableHeaders?: any[];\n maxLevel?: number;\n expandedRows?: any;\n setExpandedRows?: any;\n showNewItem?: boolean;\n rawData?: any;\n dragConfig?: any;\n rowWrapper?: any;\n asyncRowOptionsFilter?: any;\n rowLinkConfig?: {\n isEnabled: boolean;\n linkTo: any;\n };\n isCellClickDisabled?: boolean;\n activeInlineEdit?: { rowId: string; columnKey: string } | null;\n setActiveInlineEdit?: (value: { rowId: string; columnKey: string } | null) => void;\n handleUpdateColumnWidth?: (columnName: string, width: number) => void;\n multiSelectConfig?: IMultiSelectConfig | null;\n headerContextOptions?: React.ReactNode;\n showHeaderContextOptions?: string | null;\n setShowHeaderContextOptions?: (value: string | null) => void;\n headerDivWidth?: number;\n showDataTypeIcon?: boolean;\n rowAdditionalActions?: any;\n rowAdditionalActionsWidth?: number;\n hoverConfig?: any;\n cellEditing?: string | string[] | null;\n cellEditingValue?: string | Record<string, string> | null;\n openMasterDataModal?: (config: IMasterDataModalConfig) => void;\n closeMasterDataModal?: () => void;\n selectedMasterData?: { value: any; reference: any } | null;\n clearSelectedMasterData?: () => void;\n allowInlineEdit?: boolean;\n openCurrencyDropdown?: (config: ICurrencyDropdownConfig) => void;\n closeCurrencyDropdown?: () => void;\n currencyDropdownConfig?: ICurrencyDropdownConfig | null;\n selectedCurrenciesMap?: Record<string, string>;\n setCurrencyForCell?: (cellKey: string, currency: string) => void;\n getCurrencyForCell?: (cellKey: string) => string | undefined;\n pendingEdits?: PendingEditsMap;\n addPendingEdit?: (rowId: string, columnKey: string, edit: IPendingEdit) => void;\n removePendingEdit?: (rowId: string, columnKey: string) => void;\n getPendingEdit?: (rowId: string, columnKey: string) => IPendingEdit | undefined;\n hasPendingEdit?: (rowId: string, columnKey: string) => boolean;\n clearAllPendingEdits?: () => void;\n saveAllPendingEdits?: () => void;\n clearRowPendingEdits?: (rowId: string) => void;\n saveRowPendingEdits?: (rowId: string) => void;\n pendingEditsCount?: number;\n scrollToCell?: (rowId: string, columnKey: string, rowIndex: number) => void;\n onFieldOperationFlow?: (params: {\n value: unknown;\n fieldId: string;\n rowId: string;\n rowData: any;\n columnKey: string;\n flowName?: string;\n isLiveField?: boolean;\n meta?: { reference?: unknown; currency_code?: string };\n }) => Promise<void>;\n fieldOperationLoading?: string | null;\n validateAllPendingEdits?: any;\n}\n\nexport const TableContext = createContext<ITableContext>({\n tableWrapper: null,\n tableBodyWrapper: null,\n lastNonStickyColumnIndex: () => null,\n search: null,\n columnFilters: [],\n onRowClick: null,\n onSort: null,\n onFilter: null,\n onRemoveFilter: null,\n onClearFilter: null,\n rowOptions: null,\n checkboxConfig: null,\n onResetFilter: null,\n isColumnConfigurable: false,\n onAddColumnClick: null,\n onEditColumnClick: null,\n onDeleteColumnClick: null,\n toggleShowFilters: null,\n toggleShowSorts: null,\n onRowTooltipClick: null,\n tooltiptext: null,\n cascadingTableConfig: null,\n originalsOnly: false,\n disableOptionsForRowIndex: null,\n getFullRowDataOnClick: false,\n getSumOfNextVisibleColumnWidth: () => null,\n onRowEdit: null,\n inlineEditColumns: [],\n tableActions: null,\n dndSortableUtils: null,\n withSortable: false,\n withDraggable: false,\n onCascadingRowExpand: null,\n getInnerRowData: null,\n tableHeaders: null as any,\n maxLevel: 0,\n expandedRows: {},\n setExpandedRows: null,\n showNewItem: false,\n rawData: null,\n dragConfig: null,\n rowWrapper: null,\n asyncRowOptionsFilter: null,\n rowLinkConfig: {\n isEnabled: false,\n linkTo: null,\n },\n isCellClickDisabled: false,\n activeInlineEdit: null,\n setActiveInlineEdit: undefined,\n handleUpdateColumnWidth: () => undefined,\n multiSelectConfig: null,\n headerContextOptions: null,\n showHeaderContextOptions: null,\n setShowHeaderContextOptions: undefined,\n showDataTypeIcon: false,\n rowAdditionalActions: null,\n rowAdditionalActionsWidth: 0,\n hoverConfig: null,\n openMasterDataModal: undefined,\n closeMasterDataModal: undefined,\n selectedMasterData: null,\n clearSelectedMasterData: undefined,\n openCurrencyDropdown: undefined,\n closeCurrencyDropdown: undefined,\n currencyDropdownConfig: null,\n selectedCurrenciesMap: {},\n setCurrencyForCell: undefined,\n getCurrencyForCell: undefined,\n});\n"],"names":["TableContext","createContext"],"mappings":";AAuGO,MAAMA,IAAeC,EAA6B;AAAA,EACvD,cAAc;AAAA,EACd,kBAAkB;AAAA,EAClB,0BAA0B,MAAM;AAAA,EAChC,QAAQ;AAAA,EACR,eAAe,CAAA;AAAA,EACf,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,YAAY;AAAA,EACZ,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,sBAAsB;AAAA,EACtB,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,qBAAqB;AAAA,EACrB,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,mBAAmB;AAAA,EACnB,aAAa;AAAA,EACb,sBAAsB;AAAA,EACtB,eAAe;AAAA,EACf,2BAA2B;AAAA,EAC3B,uBAAuB;AAAA,EACvB,gCAAgC,MAAM;AAAA,EACtC,WAAW;AAAA,EACX,mBAAmB,CAAA;AAAA,EACnB,cAAc;AAAA,EACd,kBAAkB;AAAA,EAClB,cAAc;AAAA,EACd,eAAe;AAAA,EACf,sBAAsB;AAAA,EACtB,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,UAAU;AAAA,EACV,cAAc,CAAA;AAAA,EACd,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,uBAAuB;AAAA,EACvB,eAAe;AAAA,IACb,WAAW;AAAA,IACX,QAAQ;AAAA,EAAA;AAAA,EAEV,qBAAqB;AAAA,EACrB,kBAAkB;AAAA,EAClB,qBAAqB;AAAA,EACrB,yBAAyB,MAAA;AAAA;AAAA,EACzB,mBAAmB;AAAA,EACnB,sBAAsB;AAAA,EACtB,0BAA0B;AAAA,EAC1B,6BAA6B;AAAA,EAC7B,kBAAkB;AAAA,EAClB,sBAAsB;AAAA,EACtB,2BAA2B;AAAA,EAC3B,aAAa;AAAA,EACb,qBAAqB;AAAA,EACrB,sBAAsB;AAAA,EACtB,oBAAoB;AAAA,EACpB,yBAAyB;AAAA,EACzB,sBAAsB;AAAA,EACtB,uBAAuB;AAAA,EACvB,wBAAwB;AAAA,EACxB,uBAAuB,CAAA;AAAA,EACvB,oBAAoB;AAAA,EACpB,oBAAoB;AACtB,CAAC;"}
1
+ {"version":3,"file":"context.es.js","sources":["../../../../src/components/data-display/infinite-table/context.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { createContext } from 'react';\nimport type { ICurrencyDropdownConfig, IMasterDataModalConfig, IMultiSelectConfig, IPendingEdit, PendingEditsMap } from './types';\n\nexport interface ITableContext {\n tableWrapper?: any;\n tableBodyWrapper?: any;\n lastNonStickyColumnIndex?: () => number | null;\n search?: string | null;\n columnFilters?: any[];\n onRowClick?: any;\n onSort?: any;\n onFilter?: any;\n toggleShowFilters?: any;\n toggleShowSorts?: any;\n onRemoveFilter?: any;\n onClearFilter?: any;\n rowOptions?: any;\n checkboxConfig?: any;\n onResetFilter?: any;\n isColumnConfigurable?: boolean;\n onAddColumnClick?: any;\n onEditColumnClick?: any;\n onDeleteColumnClick?: any;\n onRowTooltipClick?: any;\n tooltiptext?: any;\n cascadingTableConfig?: any;\n originalsOnly?: boolean;\n disableOptionsForRowIndex?: any;\n getFullRowDataOnClick?: boolean;\n selectedRowId?: string | number | null;\n getSumOfNextVisibleColumnWidth?: (currentIndex: number) => number | null;\n onRowEdit?: any;\n inlineEditColumns?: string[];\n tableActions?: any;\n dndSortableUtils?: any;\n withSortable?: boolean;\n withDraggable?: boolean;\n onCascadingRowExpand?: any;\n getInnerRowData?: any;\n tableHeaders?: any[];\n maxLevel?: number;\n expandedRows?: any;\n setExpandedRows?: any;\n showNewItem?: boolean;\n rawData?: any;\n dragConfig?: any;\n rowWrapper?: any;\n asyncRowOptionsFilter?: any;\n rowLinkConfig?: {\n isEnabled: boolean;\n linkTo: any;\n };\n isCellClickDisabled?: boolean;\n activeInlineEdit?: { rowId: string; columnKey: string } | null;\n setActiveInlineEdit?: (value: { rowId: string; columnKey: string } | null) => void;\n handleUpdateColumnWidth?: (columnName: string, width: number) => void;\n multiSelectConfig?: IMultiSelectConfig | null;\n headerContextOptions?: React.ReactNode;\n showHeaderContextOptions?: string | null;\n setShowHeaderContextOptions?: (value: string | null) => void;\n headerDivWidth?: number;\n showDataTypeIcon?: boolean;\n rowAdditionalActions?: any;\n rowAdditionalActionsWidth?: number;\n hoverConfig?: any;\n cellEditing?: string | string[] | null;\n cellEditingValue?: string | Record<string, string> | null;\n openMasterDataModal?: (config: IMasterDataModalConfig) => void;\n closeMasterDataModal?: () => void;\n selectedMasterData?: { value: any; reference: any } | null;\n clearSelectedMasterData?: () => void;\n allowInlineEdit?: boolean;\n openCurrencyDropdown?: (config: ICurrencyDropdownConfig) => void;\n closeCurrencyDropdown?: () => void;\n currencyDropdownConfig?: ICurrencyDropdownConfig | null;\n selectedCurrenciesMap?: Record<string, string>;\n setCurrencyForCell?: (cellKey: string, currency: string) => void;\n getCurrencyForCell?: (cellKey: string) => string | undefined;\n pendingEdits?: PendingEditsMap;\n addPendingEdit?: (rowId: string, columnKey: string, edit: IPendingEdit) => void;\n removePendingEdit?: (rowId: string, columnKey: string) => void;\n getPendingEdit?: (rowId: string, columnKey: string) => IPendingEdit | undefined;\n hasPendingEdit?: (rowId: string, columnKey: string) => boolean;\n clearAllPendingEdits?: () => void;\n saveAllPendingEdits?: () => void;\n clearRowPendingEdits?: (rowId: string) => void;\n saveRowPendingEdits?: (rowId: string) => void;\n pendingEditsCount?: number;\n scrollToCell?: (rowId: string, columnKey: string, rowIndex: number) => void;\n onFieldOperationFlow?: (params: {\n value: unknown;\n fieldId: string;\n rowId: string;\n rowData: any;\n columnKey: string;\n flowName?: string;\n isLiveField?: boolean;\n meta?: { reference?: unknown; currency_code?: string };\n }) => Promise<void>;\n fieldOperationLoading?: string | null;\n validateAllPendingEdits?: any;\n}\n\nexport const TableContext = createContext<ITableContext>({\n tableWrapper: null,\n tableBodyWrapper: null,\n lastNonStickyColumnIndex: () => null,\n search: null,\n columnFilters: [],\n onRowClick: null,\n onSort: null,\n onFilter: null,\n onRemoveFilter: null,\n onClearFilter: null,\n rowOptions: null,\n checkboxConfig: null,\n onResetFilter: null,\n isColumnConfigurable: false,\n onAddColumnClick: null,\n onEditColumnClick: null,\n onDeleteColumnClick: null,\n toggleShowFilters: null,\n toggleShowSorts: null,\n onRowTooltipClick: null,\n tooltiptext: null,\n cascadingTableConfig: null,\n originalsOnly: false,\n disableOptionsForRowIndex: null,\n getFullRowDataOnClick: false,\n getSumOfNextVisibleColumnWidth: () => null,\n onRowEdit: null,\n inlineEditColumns: [],\n tableActions: null,\n dndSortableUtils: null,\n withSortable: false,\n withDraggable: false,\n onCascadingRowExpand: null,\n getInnerRowData: null,\n tableHeaders: null as any,\n maxLevel: 0,\n expandedRows: {},\n setExpandedRows: null,\n showNewItem: false,\n rawData: null,\n dragConfig: null,\n rowWrapper: null,\n asyncRowOptionsFilter: null,\n rowLinkConfig: {\n isEnabled: false,\n linkTo: null,\n },\n isCellClickDisabled: false,\n activeInlineEdit: null,\n setActiveInlineEdit: undefined,\n handleUpdateColumnWidth: () => undefined,\n multiSelectConfig: null,\n headerContextOptions: null,\n showHeaderContextOptions: null,\n setShowHeaderContextOptions: undefined,\n showDataTypeIcon: false,\n rowAdditionalActions: null,\n rowAdditionalActionsWidth: 0,\n hoverConfig: null,\n openMasterDataModal: undefined,\n closeMasterDataModal: undefined,\n selectedMasterData: null,\n clearSelectedMasterData: undefined,\n openCurrencyDropdown: undefined,\n closeCurrencyDropdown: undefined,\n currencyDropdownConfig: null,\n selectedCurrenciesMap: {},\n setCurrencyForCell: undefined,\n getCurrencyForCell: undefined,\n});\n"],"names":["TableContext","createContext"],"mappings":";AAwGO,MAAMA,IAAeC,EAA6B;AAAA,EACvD,cAAc;AAAA,EACd,kBAAkB;AAAA,EAClB,0BAA0B,MAAM;AAAA,EAChC,QAAQ;AAAA,EACR,eAAe,CAAA;AAAA,EACf,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,YAAY;AAAA,EACZ,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,sBAAsB;AAAA,EACtB,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,qBAAqB;AAAA,EACrB,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,mBAAmB;AAAA,EACnB,aAAa;AAAA,EACb,sBAAsB;AAAA,EACtB,eAAe;AAAA,EACf,2BAA2B;AAAA,EAC3B,uBAAuB;AAAA,EACvB,gCAAgC,MAAM;AAAA,EACtC,WAAW;AAAA,EACX,mBAAmB,CAAA;AAAA,EACnB,cAAc;AAAA,EACd,kBAAkB;AAAA,EAClB,cAAc;AAAA,EACd,eAAe;AAAA,EACf,sBAAsB;AAAA,EACtB,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,UAAU;AAAA,EACV,cAAc,CAAA;AAAA,EACd,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,uBAAuB;AAAA,EACvB,eAAe;AAAA,IACb,WAAW;AAAA,IACX,QAAQ;AAAA,EAAA;AAAA,EAEV,qBAAqB;AAAA,EACrB,kBAAkB;AAAA,EAClB,qBAAqB;AAAA,EACrB,yBAAyB,MAAA;AAAA;AAAA,EACzB,mBAAmB;AAAA,EACnB,sBAAsB;AAAA,EACtB,0BAA0B;AAAA,EAC1B,6BAA6B;AAAA,EAC7B,kBAAkB;AAAA,EAClB,sBAAsB;AAAA,EACtB,2BAA2B;AAAA,EAC3B,aAAa;AAAA,EACb,qBAAqB;AAAA,EACrB,sBAAsB;AAAA,EACtB,oBAAoB;AAAA,EACpB,yBAAyB;AAAA,EACzB,sBAAsB;AAAA,EACtB,uBAAuB;AAAA,EACvB,wBAAwB;AAAA,EACxB,uBAAuB,CAAA;AAAA,EACvB,oBAAoB;AAAA,EACpB,oBAAoB;AACtB,CAAC;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),xs=require("../../../hooks/useCheckbox.cjs.js"),bs=require("../../../providers/design-system-provider/hooks.cjs.js"),Dt=require("../../../utils/table.cjs.js"),Mt=require("../../button/Button.cjs.js"),ps=require("../../floating-bar/FloatingBar.cjs.js"),pe=require("../typography/Typography.cjs.js"),R=require("@dnd-kit/core"),l=require("react"),ws=require("react-virtualized-auto-sizer"),Ss=require("react-dom"),gt=require("react-table"),Fs=require("./body/index.cjs.js"),Ot=require("./validateCell.cjs.js"),js=require("./body/rows/row.cjs.js"),ys=require("./context.cjs.js"),ks=require("./CurrencyDropdownPortal.cjs.js"),Es=require("./head/index.cjs.js"),Ns=require("./PendingEditsFloatingBar.cjs.js"),Rs=require("../empty-state/NoDataFoundWidgets.cjs.js"),Ts=require("../empty-state/NoDataFound.cjs.js"),Ds=require("../../icon/icons.generated.cjs.js"),Ms=ws.AutoSizer,J=700,ze=430,At="Create Column",gs=(g,F)=>`button-admin-${g.toLowerCase().trim().replace(/\s+/g,"-").replace(/[^a-z0-9-_]/g,"")||F}`,Os=l.memo(({tableKey:g,searchConfig:F={search:"",handleSearch:()=>null,allowAStarSearch:!1},filterConfig:a={columnFilters:[],onFilter:()=>null,onRemoveFilter:()=>null,onClearFilter:()=>null,onResetFilter:()=>Promise.resolve({}),asyncRowOptionsFilter:()=>Promise.resolve({})},sortConfig:h={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:Vt=null,columns:y,modelName:G,enableMasterDataEnumSuggestions:Q=!1,agreementCategoryId:X,agreementDomainId:Y,agreementId:Z,modificationId:U,lineItemRowId:K,enumSuggestionsData:ee,data:m=[],onRowClick:qt,showHeader:we,tableActions:Ce,rowOptions:_,hideRowOptionWidth:We,checkboxUtilities:O,isLoading:te=!1,onScroll:Bt,onScrolling:Pt,isColumnConfigurable:le,onAddColumnClick:se,emptyMessage:He,noDataWidget:Ie,buttons:Je,onEditColumnClick:Ge,onDeleteColumnClick:Qe,onRowTooltipClick:Lt,tooltiptext:_t,cascadingTableConfig:$t,originalsOnly:zt,disableOptionsForRowIndex:Ct,tableHeightClass:re="h-[calc(100vh-220px)]",getFullRowDataOnClick:Wt,onRowEdit:T,onBulkRowEdit:A,inlineEditColumns:Ht,isResizable:It=!0,paginationConfig:ne,dndSortableUtils:ae,multipleContexts:Xe,withSortable:Se,withDraggable:Jt,enableRootDrag:Gt,pageSize:Qt=10,onCascadingRowExpand:Xt,totalItems:Ye,showRecordCount:Fe=!1,getInnerRowData:Yt,maxLevel:Zt,expandedRows:Ut={},setExpandedRows:Kt,showNewItem:el,rawData:Ze,dragConfig:tl,isOverlayLoading:ll,style:sl={},floatingBarConfig:je,rowWrapper:rl,rowLinkConfig:nl,isCellClickDisabled:al,setHeaderOnParent:ye,optimizeTable:cl=!1,multiSelectConfig:ol,headerContextOptions:il,showHeaderContextOptions:ul,setShowHeaderContextOptions:dl,showDataTypeIcon:hl=!1,rowAdditionalActions:ce,rowAdditionalActionsWidth:ke,setVisibleHeaders:Ee,cellEditing:ml=null,cellEditingValue:fl=null,allowInlineEdit:vl=!1,onFieldOperationFlow:xl,fieldOperationLoading:V=null,onTableActionsReady:Ne,onPendingEditsChange:Ue,onCancelPendingEdits:q})=>{const o=bs.useTableConfig(),bl=!!F?.search,Ke=a?.columnFilters?.length>0,$=bl||Ke,pl=!!O,j=o?.getTableView?.(g)??null,[w,z]=l.useState(j||null),[Re,Te]=l.useState(!1),[De,et]=l.useState(!1),[wl,tt]=l.useState(null),[x,Me]=l.useState(y),lt=(m.length===0||!x.length)&&!te,[st,oe]=l.useState(null),[Sl,Fl]=l.useState(!1),[jl,yl]=l.useState(null),[kl,El]=l.useState(!1),[Nl,ie]=l.useState(null),[Rl,ue]=l.useState(null),[Tl,rt]=l.useState({}),[C,ge]=l.useState(null),[Dl,nt]=l.useState(!1),[k,Ml]=l.useState(0),Oe=l.useRef(null),Ae=l.useRef(null),[at,gl]=l.useState({width:0,height:0}),[Ol,B]=l.useState(null),[E,ct]=l.useState(null),[Al,ot]=l.useState(null),[it,ut]=l.useState(null),[Ve,W]=l.useState({}),qe=l.useRef(!1),de=l.useRef(!1),Be=l.useRef(w);Be.current=w;const dt=l.useRef(o);dt.current=o;const ht=l.useRef(y);ht.current=y;const he=l.useRef(a);he.current=a;const mt=l.useRef(null),ft=l.useRef(()=>({})),vt=l.useRef(()=>({})),[d,N]=l.useState({}),Pe=l.useCallback((e,t,r)=>{N(n=>{const c=n[e]?.[t];let i=r.validationError;if(i===void 0){const b=x.find(f=>f.key===t);if(b){const f=Ot.validateCellValue(r.value,b);i=f.isValid?null:f.error||"Invalid"}else i=c?.validationError??null}return{...n,[e]:{...n[e]||{},[t]:{...r,validationError:i??null}}}})},[x]),xt=l.useCallback(()=>Object.values(d).some(e=>Object.keys(e).length>0),[d]);l.useEffect(()=>{Ne&&Ne({addPendingEdit:Pe,hasPendingEdits:xt})},[Ne,Pe,xt]);const Vl=l.useCallback((e,t)=>{N(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})},[]),ql=l.useCallback((e,t)=>d[e]?.[t],[d]),Bl=l.useCallback((e,t)=>!!d[e]?.[t],[d]),bt=l.useCallback(()=>{V||(q&&Object.keys(d).length>0&&q(d),N({}),W({}),B(null))},[V,q,d]),P=l.useCallback((e,t,r)=>{setTimeout(()=>{o?.dispatchEvent?.("SCROLL_TO_TABLE_ROW",{rowIndex:r});const n=x.findIndex(c=>c.key===t);setTimeout(()=>{const c=document.querySelector(`[data-row-id="${e}"] [data-column-key="${t}"]`);if(c)c.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});else if(n>0){const i=document.querySelector(".os-viewport");if(i){let b=0;for(let f=0;f<n;f++){const S=x[f];S?.sticky||(b+=S?.width||200)}b=Math.max(0,b-200),i.scrollTo({left:b,behavior:"smooth"})}}B({rowId:e,columnKey:t})},350)},100)},[x,o]),H=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(([f,S])=>{const M=x.find(p=>p.key===f),v=Ot.validateCellValue(S.value,M);v.isValid?n[i][f]={...S,validationError:null}:(t=!0,v.error&&c.add(v.error),r||(r={rowId:i,columnKey:f}),n[i][f]={...S,validationError:v.error})})}),{hasErrors:t,updatedEdits:n,firstError:r,errorTypes:c}},[x]),me=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)."},[]),pt=l.useCallback(()=>{const{hasErrors:e,updatedEdits:t,firstError:r,errorTypes:n}=H(d);if(e){if(N(t),o?.showNotification?.("error",me(n)),r){const i=m.findIndex(b=>b.id===r.rowId);P(r.rowId,r.columnKey,i)}return}const c=[];Object.entries(d).forEach(([i,b])=>{const f=m.find(S=>S.id===i);if(f){const S={...f},M={};Object.entries(b).forEach(([v,p])=>{S[v]=p.value,M[v]={value:p.value,meta:p.meta}}),c.push({...S,__editedFields:M})}}),c.length>0&&(A?A(c):T&&T(null,null,null,null,null,{isBulk:!0,rows:c})),N({}),W({}),B(null)},[d,m,T,A,H,me,P,o]),Pl=l.useCallback(e=>{if(V)return;const t=d[e];t&&q&&q({[e]:t}),N(r=>{const n={...r};return delete n[e],n}),W(r=>{const n={...r};return Object.keys(n).forEach(c=>{c.startsWith(`${e}-`)&&delete n[c]}),n}),B(null)},[V,q,d]),Ll=l.useCallback(e=>{const t=d[e];if(!t||Object.keys(t).length===0)return;const{hasErrors:r,updatedEdits:n,firstError:c,errorTypes:i}=H({[e]:t});if(r){if(N(v=>({...v,[e]:n[e]})),o?.showNotification?.("error",me(i)),c){const v=m.findIndex(p=>p.id===c.rowId);P(c.rowId,c.columnKey,v)}return}const b=m.find(v=>v.id===e);if(!b)return;const f={...b},S={};Object.entries(t).forEach(([v,p])=>{f[v]=p.value,S[v]={value:p.value,meta:p.meta}});const M={...f,__editedFields:S};A?A([M]):T&&T(null,null,null,null,null,{isBulk:!0,rows:[M]}),N(v=>{const p={...v};return delete p[e],p}),W(v=>{const p={...v};return Object.keys(p).forEach(Tt=>{Tt.startsWith(`${e}-`)&&delete p[Tt]}),p}),B(null)},[d,m,T,A,H,me,P,o]),L=l.useMemo(()=>Object.values(d).reduce((e,t)=>e+Object.keys(t).length,0),[d]);l.useEffect(()=>{Ue?.(L>0,L)},[L,Ue]);const _l=l.useMemo(()=>{const e=[];return Object.entries(d).forEach(([t,r])=>{const n=m.findIndex(c=>c.id===t);Object.entries(r).forEach(([c,i])=>{const b=x.find(f=>f.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,x,m]),$l=l.useMemo(()=>{const e=new Map;return Object.entries(d).forEach(([t,r])=>{const n=m.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,m]),zl=l.useCallback(e=>ct(e),[]),fe=l.useCallback(()=>ct(null),[]),Cl=l.useCallback((e,t)=>{ot({value:e,reference:t}),E?.onSelected&&E.onSelected(e,t),fe()},[E,fe]),Wl=l.useCallback(()=>ot(null),[]),Hl=l.useCallback(e=>ut(e),[]),wt=l.useCallback(()=>ut(null),[]),Il=l.useCallback((e,t)=>{W(r=>({...r,[e]:t}))},[]),Jl=l.useCallback(e=>Ve[e],[Ve]),Gl=l.useMemo(()=>{const e=re.match(/h-\[(\d+px)\]/);if(e)return e[1];const t=re.match(/h-\[(calc\(.+\))\]/);if(t)return t[1].replace(/([+-])/g," $1 ").replace(/\s+/g," ")},[re]),Ql={isEmpty:lt,isFilters:$,isColumnConfigurable:le,handleOnClick:se,emptyMessage:He,buttons:Je,noDataWidget:Ie},Xl=o?.t?.(At)??At,ve=$?"No Results Found":He||"No Data Found",Yl=typeof ve=="string"?o?.t?.(ve)??ve:ve,St={__isLoading:!0},Zl=new Array(1).fill(St),Ul=new Array(Qt).fill(St),I=l.useMemo(()=>x.filter(e=>!!e?.visible),[x]),Kl=gt.useTable({columns:cl?I:x,data:[...m,...te?m?.length?Zl:Ul:[]],defaultColumn:{minWidth:100,width:200,maxWidth:999999}},gt.useResizeColumns),{getTableProps:Ft,getTableBodyProps:jt,headerGroups:xe,prepareRow:yt,rows:D}=Kl;mt.current=xe;const es=JSON.stringify(xe[0]?.headers?.map(e=>e?.Header));l.useEffect(()=>{if(Ee){const e=mt.current;Ee?.(e?.[0]?.headers?.map(t=>t?.Header)??[])}},[es,Ee]);const{checkboxConfig:kt}=xs.useCheckbox({rows:D,checkedIds:O?.checkedIds,isCheckAllDisabled:O?.isCheckAllDisabled,selectionDisabledRowIds:O?.selectionDisabledRowIds,rawData:Ze,onAllChecked:El,setCheckedIds:O?.setCheckedIds,checkboxMetadata:O?.checkboxMetadata}),ts=R.useSensors(R.useSensor(R.MouseSensor,{activationConstraint:{distance:5}}),R.useSensor(R.TouchSensor,{activationConstraint:{distance:5}})),ls={easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)",duration:20};function ss(){return!Xe?.length||!Se?D:Xe.reduce((e,t)=>(e[t]=D.filter(r=>r.original?.type===t),e),{})}vt.current=ss;const rs=e=>{const{active:t}=e;ge(D.find(r=>r.original?.id===t?.id)??null)},ns=e=>{const{active:t,over:r}=e;r&&(ae?.checkDndDragEnd&&ae.checkDndDragEnd(t,r,Tl,n=>{rt(n),nt(!0),ae.onDragSuccess?.({draggedId:t.id,droppedId:r.id,draggedType:t.data.current?.type,droppedType:r.data.current?.type,updatedList:n,cb:()=>nt(!1)})}),ge(null))},as=()=>ge(null),cs=e=>{!h?.onSort&&!a?.onFilter||oe(st===e?null:e)},os=e=>{yl(e),Fl(!Sl),oe(null)},Le=l.useCallback(()=>{h?.onRemoveSort?h.onRemoveSort():h?.onSort&&h.onSort("","")},[h]),be=l.useCallback((e=null)=>{tt(e),Te(t=>e?!0:!t)},[]),_e=l.useCallback(()=>et(e=>!e),[]),is=()=>{const e=xe[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},us=l.useCallback(e=>{let t=0;for(let r=e+1;r<I.length;r++)I[r].visible!==!1&&(t+=I[r].width??0);return ce&&(t+=ke||40),_&&(t+=We?0:28),t},[I,ke,We,ce,_]),Et=()=>{const e=o?.getUserId?.();return{...w||{},name:w?.name||"Untitled View",created_by:w?.created_by||e,filters:w?.filters||a?.columnFilters,id:w?.id||"untitled-view",table_key:w?.table_key||g,columns:w?.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}))}};ft.current=Et;const ds=(e,t)=>{const r=Et();z({...r,columns:r?.columns?.map(n=>n.name===e?{...n,width:t}:n),unsaved:!0})};l.useEffect(()=>{a?.columnFilters?.length>0&&Te(!0);const e=Be.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&&!de.current)){const c=ft.current();z({...c,filters:JSON.parse(JSON.stringify(a?.columnFilters||[])),unsaved:!0})}de.current=!1}},[a?.columnFilters]);const hs=l.useCallback(e=>{de.current=!0,a?.onRemoveFilter?.(e)},[a?.onRemoveFilter]),ms=l.useCallback(()=>{de.current=!0,a?.onClearFilter?.()},[a?.onClearFilter]);l.useEffect(()=>{h?.columnSort?.field?(et(!0),h.columnSort.order==="asc"?(ie(h.columnSort.field),ue(null)):h.columnSort.order==="desc"&&(ue(h.columnSort.field),ie(null))):(ie(null),ue(null))},[h?.columnSort?.field,h?.columnSort?.order]),l.useEffect(()=>{Me(Dt.mergeViewColumnsWithTableColumns(Be.current?.columns||[],y))},[y]),l.useEffect(()=>{w?.unsaved&&dt.current?.persistTableView?.(w)},[w]),l.useEffect(()=>{rt(vt.current())},[D.length]),l.useEffect(()=>{z(j||null),j?.columns&&Me(Dt.mergeViewColumnsWithTableColumns(j?.columns||[],ht.current)),j?.filters&&j.filters.length>0&&!qe.current?(requestAnimationFrame(()=>{he.current?.onFilter?.(j.filters)}),qe.current=!0):j?.filters&&qe.current&&JSON.stringify(j.filters)!==JSON.stringify(he.current?.columnFilters)&&he.current?.onFilter?.(j.filters)},[j]),l.useEffect(()=>{if(Oe.current){const e=new ResizeObserver(t=>Ml(t[0].contentRect.width));return e.observe(Oe.current),()=>e.disconnect()}},[]),l.useEffect(()=>{if(!Ae.current)return;const e=new ResizeObserver(t=>{const{width:r,height:n}=t[0].contentRect;gl({width:r,height:n})});return e.observe(Ae.current),()=>e.disconnect()},[]);const Nt=s.jsx(Es.Head,{isResizable:It,headerGroups:xe,isCheckbox:pl,checkboxConfig:kt,isAllChecked:kl,showHeaderOptions:st??"",setShowHeaderOptions:oe,isShowSortArrowAsc:Nl,isShowSortArrowDesc:Rl,onSort:h?.onSort,onFilter:a?.onFilter,toggleHeaderOption:cs,setIsShowSortArrowAsc:ie,setIsShowSortArrowDesc:ue,toggleDataFilterModal:be,rowOptions:Array.isArray(_)?_:[],isColumnConfigurable:le??!1,onAddColumnClick:se,onEditColumnClick:Ge,onDeleteColumnClick:Qe,tableActions:Ce||null,isLoading:te,rowAdditionalActions:ce??null,showPendingEditsColumn:L>0}),Rt=s.jsxs(s.Fragment,{children:[Dl||ll?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",{...Ft(),className:"w-full text-sm text-left text-neutral-500 dark:text-neutral-200 h-full bg-white dark:bg-black-800",children:lt?s.jsxs("div",{className:"z-10",children:[Nt,s.jsx("div",{className:"absolute w-full",children:o?.renderEmpty?o.renderEmpty(Ql):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:[Ie&&!$?s.jsx(Rs.NoDataFoundWidgets,{widgetType:"TABLE"}):s.jsx(Ts.NoDataFound,{text:Yl}),le&&!$?s.jsx("div",{className:"my-4",children:s.jsxs(Mt,{id:"btn-table-shell-create-column",status:"primary",appearance:"ghost",onClick:se,children:[s.jsx(Ds.Add2Icon,{className:"text-white dark:text-white"})," ",Xl]})}):null,!$&&Je?.map((e,t)=>s.jsx(Mt,{status:"secondary",id:gs(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:at.width,n=t>0?t:at.height;return r>0&&n>0?s.jsx(Fs.Body,{getTableBodyProps:jt,rows:D,prepareRow:yt,isLoading:te,onScroll:Bt,onScrolling:Pt,columns:y,width:r,height:n,withSortable:Se,allowAstarSearch:F?.allowAStarSearch||!1}):null}})})]}),fs=l.forwardRef((e,t)=>s.jsxs("div",{className:"h-full w-full",...e,ref:t,children:[Nt,s.jsx("div",{className:"relative w-full h-full",children:e?.children})]})),vs=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})})),$e=l.useMemo(()=>o?.renderTableHeader?o.renderTableHeader({tableKey:g,search:F?.search,handleSearch:F?.handleSearch,toggleShowFilters:be,toggleShowSorts:_e,filterCounts:a?.columnFilters?.length,columns:y,columnFilters:a?.columnFilters,setSelectedTableView:z,selectedTableView:w,enableTableView:u?.showTableView,modelName:G,enableMasterDataEnumSuggestions:Q,onRemoveFilter:a?.onRemoveFilter,onClearFilter:a?.onClearFilter,onFilter:a?.onFilter,data:ee??m,tableHeaders:x,showTableViewAsModal:u?.showTableViewAsModal,additionalOptions:u?.additionalOptions,showFilters:u?.showFilters,showSorts:u?.showSorts,showSearch:u?.showSearch,isLoading:!!u?.isLoading,setTableHeaders:Me,allowAStarSearch:!!F?.allowAStarSearch,withContent:!!u?.content,setShowFilters:Te,sort:h?.columnSort,onSort:h?.onSort,onRemoveSort:Le,showExportButton:u?.showExportButton,agreementCategoryId:X,agreementDomainId:Y,agreementId:Z,modificationId:U,lineItemRowId:K}):null,[g,F?.search,F?.handleSearch,be,_e,a?.columnFilters,y,z,w,u,G,a?.onRemoveFilter,a?.onClearFilter,a?.onFilter,m,ee,x,h?.columnSort,h?.onSort,Le,o,F?.allowAStarSearch,Q,X,Y,Z,U,K]);return l.useEffect(()=>{ye&&ye($e)},[$e,ye]),s.jsxs(ys.TableContext.Provider,{value:{tableWrapper:fs,tableBodyWrapper:vs,lastNonStickyColumnIndex:is,search:F?.search,columnFilters:a?.columnFilters,onRowClick:qt,onSort:h?.onSort,onFilter:a?.onFilter,toggleShowFilters:be,toggleShowSorts:_e,onRemoveFilter:a?.onRemoveFilter,onClearFilter:a?.onClearFilter,rowOptions:_,checkboxConfig:kt,onResetFilter:a?.onResetFilter,isColumnConfigurable:le,onAddColumnClick:se,onEditColumnClick:Ge,onDeleteColumnClick:Qe,onRowTooltipClick:Lt,tooltiptext:_t,cascadingTableConfig:$t,activeInlineEdit:Ol,setActiveInlineEdit:B,originalsOnly:zt,disableOptionsForRowIndex:Ct,getFullRowDataOnClick:Wt,getSumOfNextVisibleColumnWidth:us,onRowEdit:T,inlineEditColumns:Ht,tableActions:Ce,dndSortableUtils:ae,withSortable:Se,withDraggable:Jt,onCascadingRowExpand:Xt,getInnerRowData:Yt,tableHeaders:x,maxLevel:Zt,expandedRows:Ut,setExpandedRows:Kt,showNewItem:el,rawData:Ze,dragConfig:tl,rowWrapper:rl,rowLinkConfig:nl,isCellClickDisabled:al,asyncRowOptionsFilter:a?.asyncRowOptionsFilter,handleUpdateColumnWidth:ds,multiSelectConfig:ol,headerContextOptions:il,showHeaderContextOptions:ul,setShowHeaderContextOptions:dl,headerDivWidth:k,showDataTypeIcon:hl,rowAdditionalActions:ce,hoverConfig:Vt,rowAdditionalActionsWidth:ke,cellEditing:ml,cellEditingValue:fl,openMasterDataModal:zl,closeMasterDataModal:fe,selectedMasterData:Al,clearSelectedMasterData:Wl,allowInlineEdit:vl,openCurrencyDropdown:Hl,closeCurrencyDropdown:wt,currencyDropdownConfig:it,selectedCurrenciesMap:Ve,setCurrencyForCell:Il,getCurrencyForCell:Jl,pendingEdits:d,addPendingEdit:Pe,removePendingEdit:Vl,getPendingEdit:ql,hasPendingEdit:Bl,clearAllPendingEdits:bt,saveAllPendingEdits:pt,clearRowPendingEdits:Pl,saveRowPendingEdits:Ll,pendingEditsCount:L,scrollToCell:P,onFieldOperationFlow:xl,fieldOperationLoading:V,validateAllPendingEdits:H},children:[we?s.jsxs("div",{ref:Oe,className:`mb-2 flex w-full min-w-0 gap-2 dark:bg-black-800 ${k<J?"flex-col items-stretch":"flex-row items-center"}`,children:[s.jsxs("div",{className:`flex items-center gap-x-2 gap-y-1 ${k<J?"w-full flex-wrap":""} ${u?.content?"min-w-0 flex-1":"shrink-0"}`,children:[u?.content?s.jsx("div",{className:`min-w-0 ${k<J?"w-full":"flex-1"}`,children:u.content}):null,Fe?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(pe.Typography,{size:"small",variant:"semibold",appearance:"title",children:(Ye??m.length).toLocaleString()}),s.jsx(pe.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 ${k<J?"w-full":u?.content?"shrink-0":"flex-1"} ${k<ze?"flex-col":"flex-row"} ${u?.postContent?"gap-2":""}`,children:[Fe&&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 ${k<ze||k<J?"w-full":""}`,children:$e}),u?.postContent?s.jsx("div",{className:`flex justify-end items-center ${k<ze?"w-full":""}`,children:u.postContent}):null]})]}):null,u?.showDivider?s.jsx("div",{className:"border-b pb-2 w-full dark:bg-black-800"}):null,Re||De?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:[De&&o?.renderSortItem?o.renderSortItem({sort:h?.columnSort,onRemoveSort:Le,onSort:h?.onSort,tableHeaders:x,data:m}):null,Re&&De&&h?.columnSort?.field!==""?s.jsx("div",{className:"h-8 w-[1px] flex-shrink-0 bg-neutral-200"}):null,Re?s.jsxs("div",{className:"flex gap-2 items-center",children:[(Ke||a?.onResetFilter)&&o?.renderActiveFilters&&o.renderActiveFilters({filters:a?.columnFilters,onRemoveFilter:hs,onClearFilter:ms,onResetFilter:a?.onResetFilter,onFilter:a?.onFilter,tableHeaders:x,columnFilters:a?.columnFilters,modelName:G,enableMasterDataEnumSuggestions:Q,noSpacing:!0,notionStyle:a?.notionStyle,context:a?.context,data:ee??m,agreementCategoryId:X,agreementDomainId:Y,agreementId:Z,modificationId:U,lineItemRowId:K}),o?.renderFilterButtons&&o.renderFilterButtons({onClearFilter:a?.onClearFilter,onClose:os,modelName:G,enableMasterDataEnumSuggestions:Q,defaultFilterColumn:wl,resetDefaultFilterColumn:()=>tt(null),column:jl,onFilter:a?.onFilter,tableHeaders:x,columnFilters:a?.columnFilters,data:ee??m,notionStyle:a?.notionStyle,context:a?.context,agreementCategoryId:X,agreementDomainId:Y,agreementId:Z,modificationId:U,lineItemRowId:K})]}):null]})}):null,je&&Object.keys(je).length?s.jsx(ps.FloatingBar,{...je}):null,!we&&Fe?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(pe.Typography,{size:"small",variant:"semibold",appearance:"title",children:(Ye??m.length).toLocaleString()}),s.jsx(pe.Typography,{size:"small",variant:"regular",appearance:"subtitle",children:"total records"})]}):!we&&u?.preContent?s.jsx("div",{className:"flex items-center mb-2",children:u.preContent}):null,s.jsx("div",{ref:Ae,className:`w-full ${ne?"h-auto":re} rounded-lg relative border overflow-x-hidden`,style:{...ne?{height:m?.length>0?`${(m?.length+1)*41+4}px`:"350px"}:{height:Gl},...sl},children:Gt?Rt:s.jsxs(R.DndContext,{sensors:ts,onDragEnd:ns,onDragStart:rs,onDragCancel:as,collisionDetection:R.closestCorners,children:[Rt,C?Ss.createPortal(s.jsx(R.DragOverlay,{adjustScale:!0,dropAnimation:ls,children:s.jsx("table",{...Ft(),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",{...jt(),className:"bg-transparent divide-y divide-neutral-200",children:[void yt(C),s.jsx(js.Row,{row:C,index:D?.findIndex(e=>e.id===C.original.id)},C.original.id)]})})}),document.getElementById("full-screen-container")||document.body):null]})}),ne&&o?.renderPagination?o.renderPagination(ne):null,o?.renderMasterDataModal&&o.renderMasterDataModal({isVisible:!!E,onSelected:Cl,onClose:fe,masterDataColumnName:E?.masterDataColumnName,masterDataFilters:E?.masterDataFilters,masterDataName:E?.masterDataName,masterDataId:E?.masterDataName,showFilters:!0}),s.jsx(ks.CurrencyDropdownPortal,{config:it,onClose:wt}),s.jsx(Ns.PendingEditsFloatingBar,{pendingEditsCount:L,pendingEditsList:_l,rowsWithPendingEdits:$l,fieldOperationLoading:V,onClearAll:bt,onSaveAll:pt,onScrollToCell:P})]})});exports.InfiniteTable=Os;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),bs=require("../../../hooks/useCheckbox.cjs.js"),ps=require("../../../providers/design-system-provider/hooks.cjs.js"),Dt=require("../../../utils/table.cjs.js"),Mt=require("../../button/Button.cjs.js"),ws=require("../../floating-bar/FloatingBar.cjs.js"),pe=require("../typography/Typography.cjs.js"),R=require("@dnd-kit/core"),l=require("react"),Ss=require("react-virtualized-auto-sizer"),Fs=require("react-dom"),gt=require("react-table"),js=require("./body/index.cjs.js"),At=require("./validateCell.cjs.js"),ys=require("./body/rows/row.cjs.js"),ks=require("./context.cjs.js"),Es=require("./CurrencyDropdownPortal.cjs.js"),Ns=require("./head/index.cjs.js"),Rs=require("./PendingEditsFloatingBar.cjs.js"),Ts=require("../empty-state/NoDataFoundWidgets.cjs.js"),Ds=require("../empty-state/NoDataFound.cjs.js"),Ms=require("../../icon/icons.generated.cjs.js"),gs=Ss.AutoSizer,J=700,ze=430,Ot="Create Column",As=(g,F)=>`button-admin-${g.toLowerCase().trim().replace(/\s+/g,"-").replace(/[^a-z0-9-_]/g,"")||F}`,Os=l.memo(({tableKey:g,searchConfig:F={search:"",handleSearch:()=>null,allowAStarSearch:!1},filterConfig:a={columnFilters:[],onFilter:()=>null,onRemoveFilter:()=>null,onClearFilter:()=>null,onResetFilter:()=>Promise.resolve({}),asyncRowOptionsFilter:()=>Promise.resolve({})},sortConfig:h={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:Vt=null,columns:y,modelName:G,enableMasterDataEnumSuggestions:Q=!1,agreementCategoryId:X,agreementDomainId:Y,agreementId:Z,modificationId:U,lineItemRowId:K,enumSuggestionsData:ee,data:m=[],onRowClick:qt,showHeader:we,tableActions:Ce,rowOptions:_,hideRowOptionWidth:We,checkboxUtilities:A,isLoading:te=!1,onScroll:Bt,onScrolling:Pt,isColumnConfigurable:le,onAddColumnClick:se,emptyMessage:He,noDataWidget:Ie,buttons:Je,onEditColumnClick:Ge,onDeleteColumnClick:Qe,onRowTooltipClick:Lt,tooltiptext:_t,cascadingTableConfig:$t,originalsOnly:zt,disableOptionsForRowIndex:Ct,tableHeightClass:re="h-[calc(100vh-220px)]",getFullRowDataOnClick:Wt,selectedRowId:Ht=null,onRowEdit:T,onBulkRowEdit:O,inlineEditColumns:It,isResizable:Jt=!0,paginationConfig:ne,dndSortableUtils:ae,multipleContexts:Xe,withSortable:Se,withDraggable:Gt,enableRootDrag:Qt,pageSize:Xt=10,onCascadingRowExpand:Yt,totalItems:Ye,showRecordCount:Fe=!1,getInnerRowData:Zt,maxLevel:Ut,expandedRows:Kt={},setExpandedRows:el,showNewItem:tl,rawData:Ze,dragConfig:ll,isOverlayLoading:sl,style:rl={},floatingBarConfig:je,rowWrapper:nl,rowLinkConfig:al,isCellClickDisabled:cl,setHeaderOnParent:ye,optimizeTable:ol=!1,multiSelectConfig:il,headerContextOptions:ul,showHeaderContextOptions:dl,setShowHeaderContextOptions:hl,showDataTypeIcon:ml=!1,rowAdditionalActions:ce,rowAdditionalActionsWidth:ke,setVisibleHeaders:Ee,cellEditing:fl=null,cellEditingValue:vl=null,allowInlineEdit:xl=!1,onFieldOperationFlow:bl,fieldOperationLoading:V=null,onTableActionsReady:Ne,onPendingEditsChange:Ue,onCancelPendingEdits:q})=>{const o=ps.useTableConfig(),pl=!!F?.search,Ke=a?.columnFilters?.length>0,$=pl||Ke,wl=!!A,j=o?.getTableView?.(g)??null,[w,z]=l.useState(j||null),[Re,Te]=l.useState(!1),[De,et]=l.useState(!1),[Sl,tt]=l.useState(null),[x,Me]=l.useState(y),lt=(m.length===0||!x.length)&&!te,[st,oe]=l.useState(null),[Fl,jl]=l.useState(!1),[yl,kl]=l.useState(null),[El,Nl]=l.useState(!1),[Rl,ie]=l.useState(null),[Tl,ue]=l.useState(null),[Dl,rt]=l.useState({}),[C,ge]=l.useState(null),[Ml,nt]=l.useState(!1),[k,gl]=l.useState(0),Ae=l.useRef(null),Oe=l.useRef(null),[at,Al]=l.useState({width:0,height:0}),[Ol,B]=l.useState(null),[E,ct]=l.useState(null),[Vl,ot]=l.useState(null),[it,ut]=l.useState(null),[Ve,W]=l.useState({}),qe=l.useRef(!1),de=l.useRef(!1),Be=l.useRef(w);Be.current=w;const dt=l.useRef(o);dt.current=o;const ht=l.useRef(y);ht.current=y;const he=l.useRef(a);he.current=a;const mt=l.useRef(null),ft=l.useRef(()=>({})),vt=l.useRef(()=>({})),[d,N]=l.useState({}),Pe=l.useCallback((e,t,r)=>{N(n=>{const c=n[e]?.[t];let i=r.validationError;if(i===void 0){const b=x.find(f=>f.key===t);if(b){const f=At.validateCellValue(r.value,b);i=f.isValid?null:f.error||"Invalid"}else i=c?.validationError??null}return{...n,[e]:{...n[e]||{},[t]:{...r,validationError:i??null}}}})},[x]),xt=l.useCallback(()=>Object.values(d).some(e=>Object.keys(e).length>0),[d]);l.useEffect(()=>{Ne&&Ne({addPendingEdit:Pe,hasPendingEdits:xt})},[Ne,Pe,xt]);const ql=l.useCallback((e,t)=>{N(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(()=>{V||(q&&Object.keys(d).length>0&&q(d),N({}),W({}),B(null))},[V,q,d]),P=l.useCallback((e,t,r)=>{setTimeout(()=>{o?.dispatchEvent?.("SCROLL_TO_TABLE_ROW",{rowIndex:r});const n=x.findIndex(c=>c.key===t);setTimeout(()=>{const c=document.querySelector(`[data-row-id="${e}"] [data-column-key="${t}"]`);if(c)c.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});else if(n>0){const i=document.querySelector(".os-viewport");if(i){let b=0;for(let f=0;f<n;f++){const S=x[f];S?.sticky||(b+=S?.width||200)}b=Math.max(0,b-200),i.scrollTo({left:b,behavior:"smooth"})}}B({rowId:e,columnKey:t})},350)},100)},[x,o]),H=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(([f,S])=>{const M=x.find(p=>p.key===f),v=At.validateCellValue(S.value,M);v.isValid?n[i][f]={...S,validationError:null}:(t=!0,v.error&&c.add(v.error),r||(r={rowId:i,columnKey:f}),n[i][f]={...S,validationError:v.error})})}),{hasErrors:t,updatedEdits:n,firstError:r,errorTypes:c}},[x]),me=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)."},[]),pt=l.useCallback(()=>{const{hasErrors:e,updatedEdits:t,firstError:r,errorTypes:n}=H(d);if(e){if(N(t),o?.showNotification?.("error",me(n)),r){const i=m.findIndex(b=>b.id===r.rowId);P(r.rowId,r.columnKey,i)}return}const c=[];Object.entries(d).forEach(([i,b])=>{const f=m.find(S=>S.id===i);if(f){const S={...f},M={};Object.entries(b).forEach(([v,p])=>{S[v]=p.value,M[v]={value:p.value,meta:p.meta}}),c.push({...S,__editedFields:M})}}),c.length>0&&(O?O(c):T&&T(null,null,null,null,null,{isBulk:!0,rows:c})),N({}),W({}),B(null)},[d,m,T,O,H,me,P,o]),Ll=l.useCallback(e=>{if(V)return;const t=d[e];t&&q&&q({[e]:t}),N(r=>{const n={...r};return delete n[e],n}),W(r=>{const n={...r};return Object.keys(n).forEach(c=>{c.startsWith(`${e}-`)&&delete n[c]}),n}),B(null)},[V,q,d]),_l=l.useCallback(e=>{const t=d[e];if(!t||Object.keys(t).length===0)return;const{hasErrors:r,updatedEdits:n,firstError:c,errorTypes:i}=H({[e]:t});if(r){if(N(v=>({...v,[e]:n[e]})),o?.showNotification?.("error",me(i)),c){const v=m.findIndex(p=>p.id===c.rowId);P(c.rowId,c.columnKey,v)}return}const b=m.find(v=>v.id===e);if(!b)return;const f={...b},S={};Object.entries(t).forEach(([v,p])=>{f[v]=p.value,S[v]={value:p.value,meta:p.meta}});const M={...f,__editedFields:S};O?O([M]):T&&T(null,null,null,null,null,{isBulk:!0,rows:[M]}),N(v=>{const p={...v};return delete p[e],p}),W(v=>{const p={...v};return Object.keys(p).forEach(Tt=>{Tt.startsWith(`${e}-`)&&delete p[Tt]}),p}),B(null)},[d,m,T,O,H,me,P,o]),L=l.useMemo(()=>Object.values(d).reduce((e,t)=>e+Object.keys(t).length,0),[d]);l.useEffect(()=>{Ue?.(L>0,L)},[L,Ue]);const $l=l.useMemo(()=>{const e=[];return Object.entries(d).forEach(([t,r])=>{const n=m.findIndex(c=>c.id===t);Object.entries(r).forEach(([c,i])=>{const b=x.find(f=>f.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,x,m]),zl=l.useMemo(()=>{const e=new Map;return Object.entries(d).forEach(([t,r])=>{const n=m.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,m]),Cl=l.useCallback(e=>ct(e),[]),fe=l.useCallback(()=>ct(null),[]),Wl=l.useCallback((e,t)=>{ot({value:e,reference:t}),E?.onSelected&&E.onSelected(e,t),fe()},[E,fe]),Hl=l.useCallback(()=>ot(null),[]),Il=l.useCallback(e=>ut(e),[]),wt=l.useCallback(()=>ut(null),[]),Jl=l.useCallback((e,t)=>{W(r=>({...r,[e]:t}))},[]),Gl=l.useCallback(e=>Ve[e],[Ve]),Ql=l.useMemo(()=>{const e=re.match(/h-\[(\d+px)\]/);if(e)return e[1];const t=re.match(/h-\[(calc\(.+\))\]/);if(t)return t[1].replace(/([+-])/g," $1 ").replace(/\s+/g," ")},[re]),Xl={isEmpty:lt,isFilters:$,isColumnConfigurable:le,handleOnClick:se,emptyMessage:He,buttons:Je,noDataWidget:Ie},Yl=o?.t?.(Ot)??Ot,ve=$?"No Results Found":He||"No Data Found",Zl=typeof ve=="string"?o?.t?.(ve)??ve:ve,St={__isLoading:!0},Ul=new Array(1).fill(St),Kl=new Array(Xt).fill(St),I=l.useMemo(()=>x.filter(e=>!!e?.visible),[x]),es=gt.useTable({columns:ol?I:x,data:[...m,...te?m?.length?Ul:Kl:[]],defaultColumn:{minWidth:100,width:200,maxWidth:999999}},gt.useResizeColumns),{getTableProps:Ft,getTableBodyProps:jt,headerGroups:xe,prepareRow:yt,rows:D}=es;mt.current=xe;const ts=JSON.stringify(xe[0]?.headers?.map(e=>e?.Header));l.useEffect(()=>{if(Ee){const e=mt.current;Ee?.(e?.[0]?.headers?.map(t=>t?.Header)??[])}},[ts,Ee]);const{checkboxConfig:kt}=bs.useCheckbox({rows:D,checkedIds:A?.checkedIds,isCheckAllDisabled:A?.isCheckAllDisabled,selectionDisabledRowIds:A?.selectionDisabledRowIds,rawData:Ze,onAllChecked:Nl,setCheckedIds:A?.setCheckedIds,checkboxMetadata:A?.checkboxMetadata}),ls=R.useSensors(R.useSensor(R.MouseSensor,{activationConstraint:{distance:5}}),R.useSensor(R.TouchSensor,{activationConstraint:{distance:5}})),ss={easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)",duration:20};function rs(){return!Xe?.length||!Se?D:Xe.reduce((e,t)=>(e[t]=D.filter(r=>r.original?.type===t),e),{})}vt.current=rs;const ns=e=>{const{active:t}=e;ge(D.find(r=>r.original?.id===t?.id)??null)},as=e=>{const{active:t,over:r}=e;r&&(ae?.checkDndDragEnd&&ae.checkDndDragEnd(t,r,Dl,n=>{rt(n),nt(!0),ae.onDragSuccess?.({draggedId:t.id,droppedId:r.id,draggedType:t.data.current?.type,droppedType:r.data.current?.type,updatedList:n,cb:()=>nt(!1)})}),ge(null))},cs=()=>ge(null),os=e=>{!h?.onSort&&!a?.onFilter||oe(st===e?null:e)},is=e=>{kl(e),jl(!Fl),oe(null)},Le=l.useCallback(()=>{h?.onRemoveSort?h.onRemoveSort():h?.onSort&&h.onSort("","")},[h]),be=l.useCallback((e=null)=>{tt(e),Te(t=>e?!0:!t)},[]),_e=l.useCallback(()=>et(e=>!e),[]),us=()=>{const e=xe[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},ds=l.useCallback(e=>{let t=0;for(let r=e+1;r<I.length;r++)I[r].visible!==!1&&(t+=I[r].width??0);return ce&&(t+=ke||40),_&&(t+=We?0:28),t},[I,ke,We,ce,_]),Et=()=>{const e=o?.getUserId?.();return{...w||{},name:w?.name||"Untitled View",created_by:w?.created_by||e,filters:w?.filters||a?.columnFilters,id:w?.id||"untitled-view",table_key:w?.table_key||g,columns:w?.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}))}};ft.current=Et;const hs=(e,t)=>{const r=Et();z({...r,columns:r?.columns?.map(n=>n.name===e?{...n,width:t}:n),unsaved:!0})};l.useEffect(()=>{a?.columnFilters?.length>0&&Te(!0);const e=Be.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&&!de.current)){const c=ft.current();z({...c,filters:JSON.parse(JSON.stringify(a?.columnFilters||[])),unsaved:!0})}de.current=!1}},[a?.columnFilters]);const ms=l.useCallback(e=>{de.current=!0,a?.onRemoveFilter?.(e)},[a?.onRemoveFilter]),fs=l.useCallback(()=>{de.current=!0,a?.onClearFilter?.()},[a?.onClearFilter]);l.useEffect(()=>{h?.columnSort?.field?(et(!0),h.columnSort.order==="asc"?(ie(h.columnSort.field),ue(null)):h.columnSort.order==="desc"&&(ue(h.columnSort.field),ie(null))):(ie(null),ue(null))},[h?.columnSort?.field,h?.columnSort?.order]),l.useEffect(()=>{Me(Dt.mergeViewColumnsWithTableColumns(Be.current?.columns||[],y))},[y]),l.useEffect(()=>{w?.unsaved&&dt.current?.persistTableView?.(w)},[w]),l.useEffect(()=>{rt(vt.current())},[D.length]),l.useEffect(()=>{z(j||null),j?.columns&&Me(Dt.mergeViewColumnsWithTableColumns(j?.columns||[],ht.current)),j?.filters&&j.filters.length>0&&!qe.current?(requestAnimationFrame(()=>{he.current?.onFilter?.(j.filters)}),qe.current=!0):j?.filters&&qe.current&&JSON.stringify(j.filters)!==JSON.stringify(he.current?.columnFilters)&&he.current?.onFilter?.(j.filters)},[j]),l.useEffect(()=>{if(Ae.current){const e=new ResizeObserver(t=>gl(t[0].contentRect.width));return e.observe(Ae.current),()=>e.disconnect()}},[]),l.useEffect(()=>{if(!Oe.current)return;const e=new ResizeObserver(t=>{const{width:r,height:n}=t[0].contentRect;Al({width:r,height:n})});return e.observe(Oe.current),()=>e.disconnect()},[]);const Nt=s.jsx(Ns.Head,{isResizable:Jt,headerGroups:xe,isCheckbox:wl,checkboxConfig:kt,isAllChecked:El,showHeaderOptions:st??"",setShowHeaderOptions:oe,isShowSortArrowAsc:Rl,isShowSortArrowDesc:Tl,onSort:h?.onSort,onFilter:a?.onFilter,toggleHeaderOption:os,setIsShowSortArrowAsc:ie,setIsShowSortArrowDesc:ue,toggleDataFilterModal:be,rowOptions:Array.isArray(_)?_:[],isColumnConfigurable:le??!1,onAddColumnClick:se,onEditColumnClick:Ge,onDeleteColumnClick:Qe,tableActions:Ce||null,isLoading:te,rowAdditionalActions:ce??null,showPendingEditsColumn:L>0}),Rt=s.jsxs(s.Fragment,{children:[Ml||sl?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",{...Ft(),className:"w-full text-sm text-left text-neutral-500 dark:text-neutral-200 h-full bg-white dark:bg-black-800",children:lt?s.jsxs("div",{className:"z-10",children:[Nt,s.jsx("div",{className:"absolute w-full",children:o?.renderEmpty?o.renderEmpty(Xl):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:[Ie&&!$?s.jsx(Ts.NoDataFoundWidgets,{widgetType:"TABLE"}):s.jsx(Ds.NoDataFound,{text:Zl}),le&&!$?s.jsx("div",{className:"my-4",children:s.jsxs(Mt,{id:"btn-table-shell-create-column",status:"primary",appearance:"ghost",onClick:se,children:[s.jsx(Ms.Add2Icon,{className:"text-white dark:text-white"})," ",Yl]})}):null,!$&&Je?.map((e,t)=>s.jsx(Mt,{status:"secondary",id:As(e.label,t),onClick:e.onClick,children:o?.t?.(e.label)??e.label},`${e.label}-${t}`))]})})]}):s.jsx(gs,{style:{width:"100%",height:"100%"},renderProp:({width:e,height:t})=>{const r=e>0?e:at.width,n=t>0?t:at.height;return r>0&&n>0?s.jsx(js.Body,{getTableBodyProps:jt,rows:D,prepareRow:yt,isLoading:te,onScroll:Bt,onScrolling:Pt,columns:y,width:r,height:n,withSortable:Se,allowAstarSearch:F?.allowAStarSearch||!1}):null}})})]}),vs=l.forwardRef((e,t)=>s.jsxs("div",{className:"h-full w-full",...e,ref:t,children:[Nt,s.jsx("div",{className:"relative w-full h-full",children:e?.children})]})),xs=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})})),$e=l.useMemo(()=>o?.renderTableHeader?o.renderTableHeader({tableKey:g,search:F?.search,handleSearch:F?.handleSearch,toggleShowFilters:be,toggleShowSorts:_e,filterCounts:a?.columnFilters?.length,columns:y,columnFilters:a?.columnFilters,setSelectedTableView:z,selectedTableView:w,enableTableView:u?.showTableView,modelName:G,enableMasterDataEnumSuggestions:Q,onRemoveFilter:a?.onRemoveFilter,onClearFilter:a?.onClearFilter,onFilter:a?.onFilter,data:ee??m,tableHeaders:x,showTableViewAsModal:u?.showTableViewAsModal,additionalOptions:u?.additionalOptions,inlineActions:u?.inlineActions,showFilters:u?.showFilters,showSorts:u?.showSorts,showSearch:u?.showSearch,isLoading:!!u?.isLoading,setTableHeaders:Me,allowAStarSearch:!!F?.allowAStarSearch,withContent:!!u?.content,setShowFilters:Te,sort:h?.columnSort,onSort:h?.onSort,onRemoveSort:Le,showExportButton:u?.showExportButton,agreementCategoryId:X,agreementDomainId:Y,agreementId:Z,modificationId:U,lineItemRowId:K}):null,[g,F?.search,F?.handleSearch,be,_e,a?.columnFilters,y,z,w,u,G,a?.onRemoveFilter,a?.onClearFilter,a?.onFilter,m,ee,x,h?.columnSort,h?.onSort,Le,o,F?.allowAStarSearch,Q,X,Y,Z,U,K]);return l.useEffect(()=>{ye&&ye($e)},[$e,ye]),s.jsxs(ks.TableContext.Provider,{value:{tableWrapper:vs,tableBodyWrapper:xs,lastNonStickyColumnIndex:us,search:F?.search,columnFilters:a?.columnFilters,onRowClick:qt,onSort:h?.onSort,onFilter:a?.onFilter,toggleShowFilters:be,toggleShowSorts:_e,onRemoveFilter:a?.onRemoveFilter,onClearFilter:a?.onClearFilter,rowOptions:_,checkboxConfig:kt,onResetFilter:a?.onResetFilter,isColumnConfigurable:le,onAddColumnClick:se,onEditColumnClick:Ge,onDeleteColumnClick:Qe,onRowTooltipClick:Lt,tooltiptext:_t,cascadingTableConfig:$t,activeInlineEdit:Ol,setActiveInlineEdit:B,originalsOnly:zt,disableOptionsForRowIndex:Ct,getFullRowDataOnClick:Wt,selectedRowId:Ht,getSumOfNextVisibleColumnWidth:ds,onRowEdit:T,inlineEditColumns:It,tableActions:Ce,dndSortableUtils:ae,withSortable:Se,withDraggable:Gt,onCascadingRowExpand:Yt,getInnerRowData:Zt,tableHeaders:x,maxLevel:Ut,expandedRows:Kt,setExpandedRows:el,showNewItem:tl,rawData:Ze,dragConfig:ll,rowWrapper:nl,rowLinkConfig:al,isCellClickDisabled:cl,asyncRowOptionsFilter:a?.asyncRowOptionsFilter,handleUpdateColumnWidth:hs,multiSelectConfig:il,headerContextOptions:ul,showHeaderContextOptions:dl,setShowHeaderContextOptions:hl,headerDivWidth:k,showDataTypeIcon:ml,rowAdditionalActions:ce,hoverConfig:Vt,rowAdditionalActionsWidth:ke,cellEditing:fl,cellEditingValue:vl,openMasterDataModal:Cl,closeMasterDataModal:fe,selectedMasterData:Vl,clearSelectedMasterData:Hl,allowInlineEdit:xl,openCurrencyDropdown:Il,closeCurrencyDropdown:wt,currencyDropdownConfig:it,selectedCurrenciesMap:Ve,setCurrencyForCell:Jl,getCurrencyForCell:Gl,pendingEdits:d,addPendingEdit:Pe,removePendingEdit:ql,getPendingEdit:Bl,hasPendingEdit:Pl,clearAllPendingEdits:bt,saveAllPendingEdits:pt,clearRowPendingEdits:Ll,saveRowPendingEdits:_l,pendingEditsCount:L,scrollToCell:P,onFieldOperationFlow:bl,fieldOperationLoading:V,validateAllPendingEdits:H},children:[we?s.jsxs("div",{ref:Ae,className:`mb-2 flex w-full min-w-0 gap-2 dark:bg-black-800 ${k<J?"flex-col items-stretch":"flex-row items-center"}`,children:[s.jsxs("div",{className:`flex items-center gap-x-2 gap-y-1 ${k<J?"w-full flex-wrap":""} ${u?.content?"min-w-0 flex-1":"shrink-0"}`,children:[u?.content?s.jsx("div",{className:`min-w-0 ${k<J?"w-full":"flex-1"}`,children:u.content}):null,Fe?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(pe.Typography,{size:"small",variant:"semibold",appearance:"title",children:(Ye??m.length).toLocaleString()}),s.jsx(pe.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 ${k<J?"w-full":u?.content?"shrink-0":"flex-1"} ${k<ze?"flex-col":"flex-row"} ${u?.postContent?"gap-2":""}`,children:[Fe&&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 ${k<ze||k<J?"w-full":""}`,children:$e}),u?.postContent?s.jsx("div",{className:`flex justify-end items-center ${k<ze?"w-full":""}`,children:u.postContent}):null]})]}):null,u?.showDivider?s.jsx("div",{className:"border-b pb-2 w-full dark:bg-black-800"}):null,Re||De?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:[De&&o?.renderSortItem?o.renderSortItem({sort:h?.columnSort,onRemoveSort:Le,onSort:h?.onSort,tableHeaders:x,data:m}):null,Re&&De&&h?.columnSort?.field!==""?s.jsx("div",{className:"h-8 w-[1px] flex-shrink-0 bg-neutral-200"}):null,Re?s.jsxs("div",{className:"flex gap-2 items-center",children:[(Ke||a?.onResetFilter)&&o?.renderActiveFilters&&o.renderActiveFilters({filters:a?.columnFilters,onRemoveFilter:ms,onClearFilter:fs,onResetFilter:a?.onResetFilter,onFilter:a?.onFilter,tableHeaders:x,columnFilters:a?.columnFilters,modelName:G,enableMasterDataEnumSuggestions:Q,noSpacing:!0,notionStyle:a?.notionStyle,context:a?.context,data:ee??m,agreementCategoryId:X,agreementDomainId:Y,agreementId:Z,modificationId:U,lineItemRowId:K}),o?.renderFilterButtons&&o.renderFilterButtons({onClearFilter:a?.onClearFilter,onClose:is,modelName:G,enableMasterDataEnumSuggestions:Q,defaultFilterColumn:Sl,resetDefaultFilterColumn:()=>tt(null),column:yl,onFilter:a?.onFilter,tableHeaders:x,columnFilters:a?.columnFilters,data:ee??m,notionStyle:a?.notionStyle,context:a?.context,agreementCategoryId:X,agreementDomainId:Y,agreementId:Z,modificationId:U,lineItemRowId:K})]}):null]})}):null,je&&Object.keys(je).length?s.jsx(ws.FloatingBar,{...je}):null,!we&&Fe?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(pe.Typography,{size:"small",variant:"semibold",appearance:"title",children:(Ye??m.length).toLocaleString()}),s.jsx(pe.Typography,{size:"small",variant:"regular",appearance:"subtitle",children:"total records"})]}):!we&&u?.preContent?s.jsx("div",{className:"flex items-center mb-2",children:u.preContent}):null,s.jsx("div",{ref:Oe,className:`w-full ${ne?"h-auto":re} rounded-lg relative border overflow-x-hidden`,style:{...ne?{height:m?.length>0?`${(m?.length+1)*41+4}px`:"350px"}:{height:Ql},...rl},children:Qt?Rt:s.jsxs(R.DndContext,{sensors:ls,onDragEnd:as,onDragStart:ns,onDragCancel:cs,collisionDetection:R.closestCorners,children:[Rt,C?Fs.createPortal(s.jsx(R.DragOverlay,{adjustScale:!0,dropAnimation:ss,children:s.jsx("table",{...Ft(),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",{...jt(),className:"bg-transparent divide-y divide-neutral-200",children:[void yt(C),s.jsx(ys.Row,{row:C,index:D?.findIndex(e=>e.id===C.original.id)},C.original.id)]})})}),document.getElementById("full-screen-container")||document.body):null]})}),ne&&o?.renderPagination?o.renderPagination(ne):null,o?.renderMasterDataModal&&o.renderMasterDataModal({isVisible:!!E,onSelected:Wl,onClose:fe,masterDataColumnName:E?.masterDataColumnName,masterDataFilters:E?.masterDataFilters,masterDataName:E?.masterDataName,masterDataId:E?.masterDataName,showFilters:!0}),s.jsx(Es.CurrencyDropdownPortal,{config:it,onClose:wt}),s.jsx(Rs.PendingEditsFloatingBar,{pendingEditsCount:L,pendingEditsList:$l,rowsWithPendingEdits:zl,fieldOperationLoading:V,onClearAll:bt,onSaveAll:pt,onScrollToCell:P})]})});exports.InfiniteTable=Os;
2
2
  //# sourceMappingURL=index.cjs.js.map