@lax-wp/design-system 0.13.33-beta.7 → 0.13.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/dist/components/data-display/infinite-table/body/cell/ActionCell.cjs.js +1 -1
  2. package/dist/components/data-display/infinite-table/body/cell/ActionCell.cjs.js.map +1 -1
  3. package/dist/components/data-display/infinite-table/body/cell/ActionCell.es.js +11 -11
  4. package/dist/components/data-display/infinite-table/body/cell/ActionCell.es.js.map +1 -1
  5. package/dist/components/data-display/infinite-table/body/cell/CheckboxCell.cjs.js +1 -1
  6. package/dist/components/data-display/infinite-table/body/cell/CheckboxCell.cjs.js.map +1 -1
  7. package/dist/components/data-display/infinite-table/body/cell/CheckboxCell.es.js +10 -10
  8. package/dist/components/data-display/infinite-table/body/cell/CheckboxCell.es.js.map +1 -1
  9. package/dist/components/data-display/infinite-table/body/cell/DataCell.cjs.js +1 -1
  10. package/dist/components/data-display/infinite-table/body/cell/DataCell.cjs.js.map +1 -1
  11. package/dist/components/data-display/infinite-table/body/cell/DataCell.es.js +23 -23
  12. package/dist/components/data-display/infinite-table/body/cell/DataCell.es.js.map +1 -1
  13. package/dist/components/data-display/infinite-table/body/cell/LoaderCell.cjs.js +1 -1
  14. package/dist/components/data-display/infinite-table/body/cell/LoaderCell.cjs.js.map +1 -1
  15. package/dist/components/data-display/infinite-table/body/cell/LoaderCell.es.js +6 -6
  16. package/dist/components/data-display/infinite-table/body/cell/LoaderCell.es.js.map +1 -1
  17. package/dist/components/data-display/infinite-table/body/cell/PendingEditCell.cjs.js +1 -1
  18. package/dist/components/data-display/infinite-table/body/cell/PendingEditCell.cjs.js.map +1 -1
  19. package/dist/components/data-display/infinite-table/body/cell/PendingEditCell.es.js +4 -4
  20. package/dist/components/data-display/infinite-table/body/cell/PendingEditCell.es.js.map +1 -1
  21. package/dist/components/data-display/infinite-table/body/cell/RowActionCell.cjs.js +1 -1
  22. package/dist/components/data-display/infinite-table/body/cell/RowActionCell.cjs.js.map +1 -1
  23. package/dist/components/data-display/infinite-table/body/cell/RowActionCell.es.js +3 -3
  24. package/dist/components/data-display/infinite-table/body/cell/RowActionCell.es.js.map +1 -1
  25. package/dist/components/data-display/infinite-table/body/cell/RowOptionsCell.cjs.js +1 -1
  26. package/dist/components/data-display/infinite-table/body/cell/RowOptionsCell.cjs.js.map +1 -1
  27. package/dist/components/data-display/infinite-table/body/cell/RowOptionsCell.es.js +24 -24
  28. package/dist/components/data-display/infinite-table/body/cell/RowOptionsCell.es.js.map +1 -1
  29. package/dist/components/data-display/infinite-table/body/cell/SpinnerCell.cjs.js +1 -1
  30. package/dist/components/data-display/infinite-table/body/cell/SpinnerCell.cjs.js.map +1 -1
  31. package/dist/components/data-display/infinite-table/body/cell/SpinnerCell.es.js +1 -1
  32. package/dist/components/data-display/infinite-table/body/cell/SpinnerCell.es.js.map +1 -1
  33. package/dist/components/data-display/infinite-table/body/rows/index.cjs.js +1 -1
  34. package/dist/components/data-display/infinite-table/body/rows/index.cjs.js.map +1 -1
  35. package/dist/components/data-display/infinite-table/body/rows/index.es.js +104 -101
  36. package/dist/components/data-display/infinite-table/body/rows/index.es.js.map +1 -1
  37. package/dist/components/data-display/infinite-table/body/rows/row.cjs.js +1 -1
  38. package/dist/components/data-display/infinite-table/body/rows/row.cjs.js.map +1 -1
  39. package/dist/components/data-display/infinite-table/body/rows/row.es.js +2 -2
  40. package/dist/components/data-display/infinite-table/body/rows/row.es.js.map +1 -1
  41. package/dist/components/data-display/infinite-table/constants.cjs.js +1 -1
  42. package/dist/components/data-display/infinite-table/constants.cjs.js.map +1 -1
  43. package/dist/components/data-display/infinite-table/constants.d.ts +6 -0
  44. package/dist/components/data-display/infinite-table/constants.es.js +17 -16
  45. package/dist/components/data-display/infinite-table/constants.es.js.map +1 -1
  46. package/dist/components/data-display/infinite-table/head/CheckAll.cjs.js +1 -1
  47. package/dist/components/data-display/infinite-table/head/CheckAll.cjs.js.map +1 -1
  48. package/dist/components/data-display/infinite-table/head/CheckAll.es.js +1 -1
  49. package/dist/components/data-display/infinite-table/head/CheckAll.es.js.map +1 -1
  50. package/dist/components/data-display/infinite-table/head/cell/index.cjs.js +1 -1
  51. package/dist/components/data-display/infinite-table/head/cell/index.cjs.js.map +1 -1
  52. package/dist/components/data-display/infinite-table/head/cell/index.es.js +2 -2
  53. package/dist/components/data-display/infinite-table/head/cell/index.es.js.map +1 -1
  54. package/dist/components/data-display/infinite-table/head/index.cjs.js +1 -1
  55. package/dist/components/data-display/infinite-table/head/index.cjs.js.map +1 -1
  56. package/dist/components/data-display/infinite-table/head/index.es.js +20 -20
  57. package/dist/components/data-display/infinite-table/head/index.es.js.map +1 -1
  58. package/dist/components/data-display/infinite-table/index.cjs.js +1 -1
  59. package/dist/components/data-display/infinite-table/index.cjs.js.map +1 -1
  60. package/dist/components/data-display/infinite-table/index.es.js +188 -187
  61. package/dist/components/data-display/infinite-table/index.es.js.map +1 -1
  62. package/dist/components/data-display/infinite-table/useRowHeight.cjs.js +2 -0
  63. package/dist/components/data-display/infinite-table/useRowHeight.cjs.js.map +1 -0
  64. package/dist/components/data-display/infinite-table/useRowHeight.d.ts +15 -0
  65. package/dist/components/data-display/infinite-table/useRowHeight.es.js +24 -0
  66. package/dist/components/data-display/infinite-table/useRowHeight.es.js.map +1 -0
  67. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"PendingEditCell.es.js","sources":["../../../../../../src/components/data-display/infinite-table/body/cell/PendingEditCell.tsx"],"sourcesContent":["import { formatDate } from '../../../../../utils/formatters';\nimport { EditNoteOutlined } from '@mui/icons-material';\nimport cn from 'classnames';\nimport React, { useMemo, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\n\ntype TPendingEditCellProps = {\n rowId: string;\n rowIndex: number;\n pendingEdits:\n | Record<string, Record<string, { value: unknown; originalValue?: unknown; meta?: { currency_code?: string | null; [key: string]: unknown | null } | null; originalMeta?: { currency_code?: string | null; [key: string]: unknown | null } | null }>>\n | undefined;\n tableHeaders: Array<{ key?: string; Header?: string; display_name?: string }> | undefined;\n rowHasPendingEdits: boolean;\n rowHovering?: string;\n isInlineEditing?: boolean;\n is_read?: boolean;\n is_modified?: boolean;\n is_row_modified?: boolean;\n is_deleted?: boolean;\n is_added?: boolean;\n is_incomplete?: boolean;\n showNewItem?: boolean;\n onScrollToCell?: (targetRowId: string, columnKey: string, targetRowIndex: number) => void;\n};\n\nconst formatValue = (val: unknown, currencyCode?: string | null): string => {\n if (typeof val === 'boolean') return val ? 'Yes' : 'No';\n if (val === null || val === undefined || val === '') return '-';\n\n const strVal = String(val);\n const dateRegex = /^\\d{4}-\\d{2}-\\d{2}(T\\d{2}:\\d{2}(:\\d{2})?)?/;\n if (dateRegex.test(strVal)) {\n const hasTime = strVal.includes('T');\n const formatted = formatDate(strVal, { withTime: hasTime, skipTimezone: true });\n if (formatted) {\n return formatted.length > 20 ? formatted.substring(0, 20) + '...' : formatted;\n }\n }\n\n const display = strVal.length > 20 ? strVal.substring(0, 20) + '...' : strVal;\n if (currencyCode) return `${display} ${currencyCode}`;\n return display;\n};\n\nexport const PendingEditCell: React.FC<TPendingEditCellProps> = ({\n rowId,\n rowIndex,\n pendingEdits,\n tableHeaders,\n rowHasPendingEdits,\n rowHovering,\n isInlineEditing,\n is_read,\n is_modified,\n is_row_modified,\n is_deleted,\n is_added,\n is_incomplete,\n showNewItem,\n onScrollToCell,\n}) => {\n const [showTooltip, setShowTooltip] = useState(false);\n const [tooltipPosition, setTooltipPosition] = useState({ top: 0, left: 0 });\n const hideTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const iconRef = useRef<HTMLDivElement>(null);\n\n const rowPendingEdits = pendingEdits?.[rowId];\n\n const editedFields = useMemo(\n () =>\n rowPendingEdits\n ? Object.entries(rowPendingEdits).map(([columnKey, edit]) => {\n const column = tableHeaders?.find((col) => col.key === columnKey);\n const fieldName = column?.Header || column?.display_name || columnKey;\n return { columnKey, fieldName, value: edit.value, originalValue: edit.originalValue, meta: edit.meta, originalMeta: edit.originalMeta };\n })\n : [],\n [rowPendingEdits, tableHeaders],\n );\n\n const handleFieldClick = (columnKey: string) => {\n setShowTooltip(false);\n if (hideTimeoutRef.current) { clearTimeout(hideTimeoutRef.current); hideTimeoutRef.current = null; }\n onScrollToCell?.(rowId, columnKey, rowIndex);\n };\n\n const handleMouseEnter = () => {\n if (!rowHasPendingEdits) return;\n if (hideTimeoutRef.current) { clearTimeout(hideTimeoutRef.current); hideTimeoutRef.current = null; }\n if (iconRef.current) {\n const rect = iconRef.current.getBoundingClientRect();\n setTooltipPosition({ top: rect.top + rect.height / 2, left: rect.right + 8 });\n }\n setShowTooltip(true);\n };\n\n const handleMouseLeave = () => {\n hideTimeoutRef.current = setTimeout(() => { setShowTooltip(false); }, 300);\n };\n\n const bgColor = cn({\n 'bg-primary-50 dark:bg-primary-900': isInlineEditing,\n 'bg-neutral-100 dark:bg-black-600': rowHovering === rowId && !isInlineEditing && !is_deleted && !is_added,\n 'bg-error-200 dark:bg-error-900': rowHovering === rowId && !isInlineEditing && is_deleted,\n 'bg-success-100 dark:bg-success-800': rowHovering === rowId && !isInlineEditing && is_added,\n 'bg-primary-50 dark:bg-black-700': !is_incomplete && !is_read && showNewItem && rowHovering !== rowId && !isInlineEditing,\n 'bg-warning-50 dark:bg-black-500': (is_incomplete || is_modified || is_row_modified) && rowHovering !== rowId && !isInlineEditing,\n 'bg-error-100 dark:bg-error-975': is_deleted && rowHovering !== rowId && !isInlineEditing,\n 'bg-success-50 dark:bg-success-900': is_added && rowHovering !== rowId && !isInlineEditing,\n });\n\n return (\n <td className={`min-w-[28px] w-[28px] sticky left-0 z-30 ${bgColor ? bgColor : 'bg-white dark:bg-black-800'} h-10`}>\n <div ref={iconRef} className='w-full h-10 flex items-center justify-center cursor-pointer' onMouseEnter={handleMouseEnter} onMouseLeave={handleMouseLeave}>\n {rowHasPendingEdits && (\n <div className='w-5 h-5 rounded-full bg-warning-100 dark:bg-warning-900 flex items-center justify-center shadow-sm border border-warning-200 dark:border-warning-700'>\n <EditNoteOutlined sx={{ fontSize: 14 }} className='text-warning-600 dark:text-warning-400' />\n </div>\n )}\n </div>\n {showTooltip && editedFields.length > 0 &&\n createPortal(\n <div\n className='fixed bg-white dark:bg-black-700 rounded-lg shadow-xl border border-neutral-200 dark:border-black-600 py-2 min-w-[200px] max-w-[280px]'\n style={{ top: tooltipPosition.top, left: tooltipPosition.left, transform: 'translateY(-50%)', zIndex: 99999 }}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n <div className='px-3 py-1.5 text-xs font-semibold text-neutral-500 dark:text-neutral-400 uppercase tracking-wider border-b border-neutral-100 dark:border-black-600'>\n Pending Changes ({editedFields.length})\n </div>\n <div className='max-h-48 overflow-y-auto'>\n {editedFields.map((field, idx) => (\n <button key={idx} onClick={() => handleFieldClick(field.columnKey)} className='w-full px-3 py-2 text-left hover:bg-neutral-50 dark:hover:bg-black-600 transition-colors cursor-pointer'>\n <div className='text-xs font-medium text-neutral-700 dark:text-neutral-300 mb-1'>{field.fieldName}</div>\n <div className='flex items-center gap-1.5 text-xs'>\n <span className='text-neutral-400 dark:text-neutral-500 line-through truncate max-w-[80px]'>{formatValue(field.originalValue, field.originalMeta?.currency_code)}</span>\n <span className='text-neutral-400 dark:text-neutral-500 flex-shrink-0'>→</span>\n <span className='text-primary-600 dark:text-primary-400 font-medium truncate max-w-[80px]'>{formatValue(field.value, field.meta?.currency_code)}</span>\n </div>\n </button>\n ))}\n </div>\n </div>,\n document.getElementById('full-screen-container') || document.body,\n )}\n </td>\n );\n};\n"],"names":["formatValue","val","currencyCode","strVal","hasTime","formatted","formatDate","display","PendingEditCell","rowId","rowIndex","pendingEdits","tableHeaders","rowHasPendingEdits","rowHovering","isInlineEditing","is_read","is_modified","is_row_modified","is_deleted","is_added","is_incomplete","showNewItem","onScrollToCell","showTooltip","setShowTooltip","useState","tooltipPosition","setTooltipPosition","hideTimeoutRef","useRef","iconRef","rowPendingEdits","editedFields","useMemo","columnKey","edit","column","col","fieldName","handleFieldClick","handleMouseEnter","rect","handleMouseLeave","bgColor","cn","jsx","EditNoteOutlined","createPortal","jsxs","field","idx"],"mappings":";;;;;;AA0BA,MAAMA,IAAc,CAACC,GAAcC,MAAyC;AAC1E,MAAI,OAAOD,KAAQ,UAAW,QAAOA,IAAM,QAAQ;AACnD,MAAIA,KAAQ,QAA6BA,MAAQ,GAAI,QAAO;AAE5D,QAAME,IAAS,OAAOF,CAAG;AAEzB,MADkB,6CACJ,KAAKE,CAAM,GAAG;AAC1B,UAAMC,IAAUD,EAAO,SAAS,GAAG,GAC7BE,IAAYC,EAAWH,GAAQ,EAAE,UAAUC,GAAS,cAAc,IAAM;AAC9E,QAAIC;AACF,aAAOA,EAAU,SAAS,KAAKA,EAAU,UAAU,GAAG,EAAE,IAAI,QAAQA;AAAA,EAExE;AAEA,QAAME,IAAUJ,EAAO,SAAS,KAAKA,EAAO,UAAU,GAAG,EAAE,IAAI,QAAQA;AACvE,SAAID,IAAqB,GAAGK,CAAO,IAAIL,CAAY,KAC5CK;AACT,GAEaC,IAAmD,CAAC;AAAA,EAC/D,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,aAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,SAAAC;AAAA,EACA,aAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,aAAAC;AAAA,EACA,gBAAAC;AACF,MAAM;AACJ,QAAM,CAACC,GAAaC,CAAc,IAAIC,EAAS,EAAK,GAC9C,CAACC,GAAiBC,CAAkB,IAAIF,EAAS,EAAE,KAAK,GAAG,MAAM,GAAG,GACpEG,IAAiBC,EAA6C,IAAI,GAClEC,IAAUD,EAAuB,IAAI,GAErCE,IAAkBrB,IAAeF,CAAK,GAEtCwB,IAAeC;AA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CACb,UAAA;AAAA,gBAAA,gBAAAH,EAAC,QAAA,EAAK,WAAU,6EAA6E,UAAA9C,EAAYkD,EAAM,eAAeA,EAAM,cAAc,aAAa,EAAA,CAAE;AAAA,gBACjK,gBAAAJ,EAAC,QAAA,EAAK,WAAU,wDAAuD,UAAA,KAAC;AAAA,gBACxE,gBAAAA,EAAC,QAAA,EAAK,WAAU,4EAA4E,UAAA9C,EAAYkD,EAAM,OAAOA,EAAM,MAAM,aAAa,EAAA,CAAE;AAAA,cAAA,EAAA,CAClJ;AAAA,YAAA,EAAA,GANWC,CAOb,CACD,EAAA,CACH;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,MAEF,SAAS,eAAe,uBAAuB,KAAK,SAAS;AAAA,IAAA;AAAA,EAC/D,GACJ;AAEJ;"}
1
+ {"version":3,"file":"PendingEditCell.es.js","sources":["../../../../../../src/components/data-display/infinite-table/body/cell/PendingEditCell.tsx"],"sourcesContent":["import { formatDate } from '../../../../../utils/formatters';\nimport { EditNoteOutlined } from '@mui/icons-material';\nimport cn from 'classnames';\nimport React, { useMemo, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\n\ntype TPendingEditCellProps = {\n rowId: string;\n rowIndex: number;\n pendingEdits:\n | Record<string, Record<string, { value: unknown; originalValue?: unknown; meta?: { currency_code?: string | null; [key: string]: unknown | null } | null; originalMeta?: { currency_code?: string | null; [key: string]: unknown | null } | null }>>\n | undefined;\n tableHeaders: Array<{ key?: string; Header?: string; display_name?: string }> | undefined;\n rowHasPendingEdits: boolean;\n rowHovering?: string;\n isInlineEditing?: boolean;\n is_read?: boolean;\n is_modified?: boolean;\n is_row_modified?: boolean;\n is_deleted?: boolean;\n is_added?: boolean;\n is_incomplete?: boolean;\n showNewItem?: boolean;\n onScrollToCell?: (targetRowId: string, columnKey: string, targetRowIndex: number) => void;\n};\n\nconst formatValue = (val: unknown, currencyCode?: string | null): string => {\n if (typeof val === 'boolean') return val ? 'Yes' : 'No';\n if (val === null || val === undefined || val === '') return '-';\n\n const strVal = String(val);\n const dateRegex = /^\\d{4}-\\d{2}-\\d{2}(T\\d{2}:\\d{2}(:\\d{2})?)?/;\n if (dateRegex.test(strVal)) {\n const hasTime = strVal.includes('T');\n const formatted = formatDate(strVal, { withTime: hasTime, skipTimezone: true });\n if (formatted) {\n return formatted.length > 20 ? formatted.substring(0, 20) + '...' : formatted;\n }\n }\n\n const display = strVal.length > 20 ? strVal.substring(0, 20) + '...' : strVal;\n if (currencyCode) return `${display} ${currencyCode}`;\n return display;\n};\n\nexport const PendingEditCell: React.FC<TPendingEditCellProps> = ({\n rowId,\n rowIndex,\n pendingEdits,\n tableHeaders,\n rowHasPendingEdits,\n rowHovering,\n isInlineEditing,\n is_read,\n is_modified,\n is_row_modified,\n is_deleted,\n is_added,\n is_incomplete,\n showNewItem,\n onScrollToCell,\n}) => {\n const [showTooltip, setShowTooltip] = useState(false);\n const [tooltipPosition, setTooltipPosition] = useState({ top: 0, left: 0 });\n const hideTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const iconRef = useRef<HTMLDivElement>(null);\n\n const rowPendingEdits = pendingEdits?.[rowId];\n\n const editedFields = useMemo(\n () =>\n rowPendingEdits\n ? Object.entries(rowPendingEdits).map(([columnKey, edit]) => {\n const column = tableHeaders?.find((col) => col.key === columnKey);\n const fieldName = column?.Header || column?.display_name || columnKey;\n return { columnKey, fieldName, value: edit.value, originalValue: edit.originalValue, meta: edit.meta, originalMeta: edit.originalMeta };\n })\n : [],\n [rowPendingEdits, tableHeaders],\n );\n\n const handleFieldClick = (columnKey: string) => {\n setShowTooltip(false);\n if (hideTimeoutRef.current) { clearTimeout(hideTimeoutRef.current); hideTimeoutRef.current = null; }\n onScrollToCell?.(rowId, columnKey, rowIndex);\n };\n\n const handleMouseEnter = () => {\n if (!rowHasPendingEdits) return;\n if (hideTimeoutRef.current) { clearTimeout(hideTimeoutRef.current); hideTimeoutRef.current = null; }\n if (iconRef.current) {\n const rect = iconRef.current.getBoundingClientRect();\n setTooltipPosition({ top: rect.top + rect.height / 2, left: rect.right + 8 });\n }\n setShowTooltip(true);\n };\n\n const handleMouseLeave = () => {\n hideTimeoutRef.current = setTimeout(() => { setShowTooltip(false); }, 300);\n };\n\n const bgColor = cn({\n 'bg-primary-50 dark:bg-primary-900': isInlineEditing,\n 'bg-neutral-100 dark:bg-black-600': rowHovering === rowId && !isInlineEditing && !is_deleted && !is_added,\n 'bg-error-200 dark:bg-error-900': rowHovering === rowId && !isInlineEditing && is_deleted,\n 'bg-success-100 dark:bg-success-800': rowHovering === rowId && !isInlineEditing && is_added,\n 'bg-primary-50 dark:bg-black-700': !is_incomplete && !is_read && showNewItem && rowHovering !== rowId && !isInlineEditing,\n 'bg-warning-50 dark:bg-black-500': (is_incomplete || is_modified || is_row_modified) && rowHovering !== rowId && !isInlineEditing,\n 'bg-error-100 dark:bg-error-975': is_deleted && rowHovering !== rowId && !isInlineEditing,\n 'bg-success-50 dark:bg-success-900': is_added && rowHovering !== rowId && !isInlineEditing,\n });\n\n return (\n <td className={`min-w-[28px] w-[28px] sticky left-0 z-30 ${bgColor ? bgColor : 'bg-white dark:bg-black-800'} h-row`}>\n <div ref={iconRef} className='w-full h-row flex items-center justify-center cursor-pointer' onMouseEnter={handleMouseEnter} onMouseLeave={handleMouseLeave}>\n {rowHasPendingEdits && (\n <div className='w-5 h-5 rounded-full bg-warning-100 dark:bg-warning-900 flex items-center justify-center shadow-sm border border-warning-200 dark:border-warning-700'>\n <EditNoteOutlined sx={{ fontSize: 14 }} className='text-warning-600 dark:text-warning-400' />\n </div>\n )}\n </div>\n {showTooltip && editedFields.length > 0 &&\n createPortal(\n <div\n className='fixed bg-white dark:bg-black-700 rounded-lg shadow-xl border border-neutral-200 dark:border-black-600 py-2 min-w-[200px] max-w-[280px]'\n style={{ top: tooltipPosition.top, left: tooltipPosition.left, transform: 'translateY(-50%)', zIndex: 99999 }}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n <div className='px-3 py-1.5 text-xs font-semibold text-neutral-500 dark:text-neutral-400 uppercase tracking-wider border-b border-neutral-100 dark:border-black-600'>\n Pending Changes ({editedFields.length})\n </div>\n <div className='max-h-48 overflow-y-auto'>\n {editedFields.map((field, idx) => (\n <button key={idx} onClick={() => handleFieldClick(field.columnKey)} className='w-full px-3 py-2 text-left hover:bg-neutral-50 dark:hover:bg-black-600 transition-colors cursor-pointer'>\n <div className='text-xs font-medium text-neutral-700 dark:text-neutral-300 mb-1'>{field.fieldName}</div>\n <div className='flex items-center gap-1.5 text-xs'>\n <span className='text-neutral-400 dark:text-neutral-500 line-through truncate max-w-[80px]'>{formatValue(field.originalValue, field.originalMeta?.currency_code)}</span>\n <span className='text-neutral-400 dark:text-neutral-500 flex-shrink-0'>→</span>\n <span className='text-primary-600 dark:text-primary-400 font-medium truncate max-w-[80px]'>{formatValue(field.value, field.meta?.currency_code)}</span>\n </div>\n </button>\n ))}\n </div>\n </div>,\n document.getElementById('full-screen-container') || document.body,\n )}\n </td>\n );\n};\n"],"names":["formatValue","val","currencyCode","strVal","hasTime","formatted","formatDate","display","PendingEditCell","rowId","rowIndex","pendingEdits","tableHeaders","rowHasPendingEdits","rowHovering","isInlineEditing","is_read","is_modified","is_row_modified","is_deleted","is_added","is_incomplete","showNewItem","onScrollToCell","showTooltip","setShowTooltip","useState","tooltipPosition","setTooltipPosition","hideTimeoutRef","useRef","iconRef","rowPendingEdits","editedFields","useMemo","columnKey","edit","column","col","fieldName","handleFieldClick","handleMouseEnter","rect","handleMouseLeave","bgColor","cn","jsx","EditNoteOutlined","createPortal","jsxs","field","idx"],"mappings":";;;;;;AA0BA,MAAMA,IAAc,CAACC,GAAcC,MAAyC;AAC1E,MAAI,OAAOD,KAAQ,UAAW,QAAOA,IAAM,QAAQ;AACnD,MAAIA,KAAQ,QAA6BA,MAAQ,GAAI,QAAO;AAE5D,QAAME,IAAS,OAAOF,CAAG;AAEzB,MADkB,6CACJ,KAAKE,CAAM,GA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Ob,CACD,EAAA,CACH;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,MAEF,SAAS,eAAe,uBAAuB,KAAK,SAAS;AAAA,IAAA;AAAA,EAC/D,GACJ;AAEJ;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),q=require("../../../../tooltip/Tooltip.cjs.js"),S=require("../../../../../providers/design-system-provider/hooks.cjs.js"),j=require("../../../../../_virtual/index.cjs.js"),x=require("react"),T=({disableOptionsForRowIndex:C,tableActions:g,index:l,is_read:f,showNewItem:k,is_modified:p,is_row_modified:m,is_deleted:c,currentData:e,is_added:o,rowData:d,id:s,rowHovering:t,isDisabled:b,bgColor:n,is_incomplete:h,isInlineEditing:r,rowHasPendingEdits:a})=>{const R=S.useTableConfig()?.t?.("Save or cancel pending changes first")??"Save or cancel pending changes first",i=x.useMemo(()=>r?"bg-primary-50 dark:bg-primary-900":n||(c||e?.is_deleted?"bg-error-100 dark:bg-error-975":h||p||m||e?.is_row_modified?"bg-warning-50 dark:bg-black-500":o||e?.is_added?"bg-success-50":!f&&k&&!b?"bg-primary-50 dark:bg-black-700":"bg-white dark:bg-black-800"),[h,f,k,p,m,c,e,o,n,r,b]),y=C===l||b||a;return u.jsxs("td",{"aria-disabled":y,className:j("px-2.5 relative h-10",i,y&&"cursor-not-allowed opacity-50"),children:[g(d,l),u.jsx(q,{title:a?R:"",children:u.jsx("div",{className:j("absolute top-0 left-0 flex items-center justify-center w-full z-20",{[i]:t!==s||r},{"bg-neutral-100 dark:bg-black-600":t===s&&!r&&!(c||e?.is_deleted)&&!(o||e?.is_added)},{"bg-error-200 dark:bg-error-900":t===s&&!r&&(c||e?.is_deleted)},{"bg-success-100 dark:bg-success-800":t===s&&!r&&(o||e?.is_added)},a&&"pointer-events-none"),children:g(d,l)})})]})},v=x.memo(T);exports.RowActionCell=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),q=require("../../../../tooltip/Tooltip.cjs.js"),S=require("../../../../../providers/design-system-provider/hooks.cjs.js"),j=require("../../../../../_virtual/index.cjs.js"),x=require("react"),T=({disableOptionsForRowIndex:C,tableActions:g,index:l,is_read:f,showNewItem:k,is_modified:p,is_row_modified:m,is_deleted:c,currentData:e,is_added:o,rowData:d,id:s,rowHovering:t,isDisabled:b,bgColor:n,is_incomplete:h,isInlineEditing:r,rowHasPendingEdits:a})=>{const R=S.useTableConfig()?.t?.("Save or cancel pending changes first")??"Save or cancel pending changes first",i=x.useMemo(()=>r?"bg-primary-50 dark:bg-primary-900":n||(c||e?.is_deleted?"bg-error-100 dark:bg-error-975":h||p||m||e?.is_row_modified?"bg-warning-50 dark:bg-black-500":o||e?.is_added?"bg-success-50":!f&&k&&!b?"bg-primary-50 dark:bg-black-700":"bg-white dark:bg-black-800"),[h,f,k,p,m,c,e,o,n,r,b]),y=C===l||b||a;return u.jsxs("td",{"aria-disabled":y,className:j("px-2.5 relative h-row",i,y&&"cursor-not-allowed opacity-50"),children:[g(d,l),u.jsx(q,{title:a?R:"",children:u.jsx("div",{className:j("absolute top-0 left-0 flex items-center justify-center w-full z-20",{[i]:t!==s||r},{"bg-neutral-100 dark:bg-black-600":t===s&&!r&&!(c||e?.is_deleted)&&!(o||e?.is_added)},{"bg-error-200 dark:bg-error-900":t===s&&!r&&(c||e?.is_deleted)},{"bg-success-100 dark:bg-success-800":t===s&&!r&&(o||e?.is_added)},a&&"pointer-events-none"),children:g(d,l)})})]})},v=x.memo(T);exports.RowActionCell=v;
2
2
  //# sourceMappingURL=RowActionCell.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RowActionCell.cjs.js","sources":["../../../../../../src/components/data-display/infinite-table/body/cell/RowActionCell.tsx"],"sourcesContent":["import Tooltip from '../../../../tooltip/Tooltip';\nimport { useTableConfig } from '../../../../../providers/design-system-provider/hooks';\nimport cn from 'classnames';\nimport React, { useMemo } from 'react';\n\ntype TProps = {\n disableOptionsForRowIndex: number | null;\n tableActions: (rowData: Record<string, unknown>, index: number) => JSX.Element;\n index: number;\n is_read: boolean;\n showNewItem: boolean;\n is_modified: boolean;\n is_row_modified: boolean;\n is_deleted: boolean;\n currentData: Record<string, unknown>;\n is_added: boolean;\n rowData: Record<string, unknown>;\n id: string | number;\n rowHovering: string | number | null;\n isDisabled?: boolean;\n bgColor?: string;\n is_incomplete: boolean;\n isInlineEditing?: boolean;\n rowHasPendingEdits?: boolean;\n};\n\nconst RowActionCellInner: React.FC<TProps> = ({\n disableOptionsForRowIndex,\n tableActions,\n index,\n is_read,\n showNewItem,\n is_modified,\n is_row_modified,\n is_deleted,\n currentData,\n is_added,\n rowData,\n id,\n rowHovering,\n isDisabled,\n bgColor,\n is_incomplete,\n isInlineEditing,\n rowHasPendingEdits,\n}) => {\n const tableConfig = useTableConfig();\n const pendingEditsTooltip = tableConfig?.t?.('Save or cancel pending changes first') ?? 'Save or cancel pending changes first';\n\n const backgroundColorClass = useMemo(() => {\n if (isInlineEditing) return 'bg-primary-50 dark:bg-primary-900';\n if (bgColor) return bgColor;\n if (is_deleted || currentData?.is_deleted) return 'bg-error-100 dark:bg-error-975';\n if (is_incomplete || is_modified || is_row_modified || currentData?.is_row_modified) return 'bg-warning-50 dark:bg-black-500';\n if (is_added || currentData?.is_added) return 'bg-success-50';\n if (!is_read && showNewItem && !isDisabled) return 'bg-primary-50 dark:bg-black-700';\n return 'bg-white dark:bg-black-800';\n }, [is_incomplete, is_read, showNewItem, is_modified, is_row_modified, is_deleted, currentData, is_added, bgColor, isInlineEditing, isDisabled]);\n\n const isRowDisabled = disableOptionsForRowIndex === index || isDisabled || rowHasPendingEdits;\n\n return (\n <td aria-disabled={isRowDisabled} className={cn('px-2.5 relative h-10', backgroundColorClass, isRowDisabled && 'cursor-not-allowed opacity-50')}>\n {tableActions(rowData, index)}\n <Tooltip title={rowHasPendingEdits ? pendingEditsTooltip : ''}>\n <div\n className={cn(\n 'absolute top-0 left-0 flex items-center justify-center w-full z-20',\n { [backgroundColorClass]: rowHovering !== id || isInlineEditing },\n { 'bg-neutral-100 dark:bg-black-600': rowHovering === id && !isInlineEditing && !(is_deleted || currentData?.is_deleted) && !(is_added || currentData?.is_added) },\n { 'bg-error-200 dark:bg-error-900': rowHovering === id && !isInlineEditing && (is_deleted || currentData?.is_deleted) },\n { 'bg-success-100 dark:bg-success-800': rowHovering === id && !isInlineEditing && (is_added || currentData?.is_added) },\n rowHasPendingEdits && 'pointer-events-none',\n )}\n >\n {tableActions(rowData, index)}\n </div>\n </Tooltip>\n </td>\n );\n};\n\nexport const RowActionCell = React.memo(RowActionCellInner);\n"],"names":["RowActionCellInner","disableOptionsForRowIndex","tableActions","index","is_read","showNewItem","is_modified","is_row_modified","is_deleted","currentData","is_added","rowData","id","rowHovering","isDisabled","bgColor","is_incomplete","isInlineEditing","rowHasPendingEdits","pendingEditsTooltip","useTableConfig","backgroundColorClass","useMemo","isRowDisabled","jsxs","cn","jsx","Tooltip","RowActionCell","React"],"mappings":"oTA0BMA,EAAuC,CAAC,CAC5C,0BAAAC,EACA,aAAAC,EAAA,MACAC,EACA,QAAAC,EACA,YAAAC,EACA,YAAAC,EACA,gBAAAC,EACA,WAAAC,EACA,YAAAC,EACA,SAAAC,EACA,QAAAC,EACA,GAAAC,EACA,YAAAC,EACA,WAAAC,EACA,QAAAC,EACA,cAAAC,EACA,gBAAAC,EACA,mBAAAC,CACF,IAAM,CAEJ,MAAMC,EADcC,EAAAA,eAAA,GACqB,IAAI,sCAAsC,GAAK,uCAElFC,EAAuBC,EAAAA,QAAQ,IAC/BL,EAAwB,oCACxBF,IACAP,GAAcC,GAAa,WAAmB,iCAC9CO,GAAiBV,GAAeC,GAAmBE,GAAa,gBAAwB,kCACxFC,GAAYD,GAAa,SAAiB,gBAC1C,CAACL,GAAWC,GAAe,CAACS,EAAmB,kCAC5C,8BACN,CAACE,EAAeZ,EAASC,EAAaC,EAAaC,EAAiBC,EAAYC,EAAaC,EAAUK,EAASE,EAAiBH,CAAU,CAAC,EAEzIS,EAAgBtB,IAA8BE,GAASW,GAAcI,EAE3E,OACEM,EAAAA,KAAC,KAAA,CAAG,gBAAeD,EAAe,UAAWE,EAAG,uBAAwBJ,EAAsBE,GAAiB,+BAA+B,EAC3I,SAAA,CAAArB,EAAaS,EAASR,CAAK,EAC5BuB,EAAAA,IAACC,EAAA,CAAQ,MAAOT,EAAqBC,EAAsB,GACzD,SAAAO,EAAAA,IAAC,MAAA,CACC,UAAWD,EACT,qEACA,CAAE,CAACJ,CAAoB,EAAGR,IAAgBD,GAAMK,CAAA,EAChD,CAAE,mCAAoCJ,IAAgBD,GAAM,CAACK,GAAmB,EAAET,GAAcC,GAAa,aAAe,EAAEC,GAAYD,GAAa,SAAA,EACvJ,CAAE,iCAAkCI,IAAgBD,GAAM,CAACK,IAAoBT,GAAcC,GAAa,WAAA,EAC1G,CAAE,qCAAsCI,IAAgBD,GAAM,CAACK,IAAoBP,GAAYD,GAAa,SAAA,EAC5GS,GAAsB,qBAAA,EAGvB,SAAAhB,EAAaS,EAASR,CAAK,CAAA,CAAA,CAC9B,CACF,CAAA,EACF,CAEJ,EAEayB,EAAgBC,EAAM,KAAK7B,CAAkB"}
1
+ {"version":3,"file":"RowActionCell.cjs.js","sources":["../../../../../../src/components/data-display/infinite-table/body/cell/RowActionCell.tsx"],"sourcesContent":["import Tooltip from '../../../../tooltip/Tooltip';\nimport { useTableConfig } from '../../../../../providers/design-system-provider/hooks';\nimport cn from 'classnames';\nimport React, { useMemo } from 'react';\n\ntype TProps = {\n disableOptionsForRowIndex: number | null;\n tableActions: (rowData: Record<string, unknown>, index: number) => JSX.Element;\n index: number;\n is_read: boolean;\n showNewItem: boolean;\n is_modified: boolean;\n is_row_modified: boolean;\n is_deleted: boolean;\n currentData: Record<string, unknown>;\n is_added: boolean;\n rowData: Record<string, unknown>;\n id: string | number;\n rowHovering: string | number | null;\n isDisabled?: boolean;\n bgColor?: string;\n is_incomplete: boolean;\n isInlineEditing?: boolean;\n rowHasPendingEdits?: boolean;\n};\n\nconst RowActionCellInner: React.FC<TProps> = ({\n disableOptionsForRowIndex,\n tableActions,\n index,\n is_read,\n showNewItem,\n is_modified,\n is_row_modified,\n is_deleted,\n currentData,\n is_added,\n rowData,\n id,\n rowHovering,\n isDisabled,\n bgColor,\n is_incomplete,\n isInlineEditing,\n rowHasPendingEdits,\n}) => {\n const tableConfig = useTableConfig();\n const pendingEditsTooltip = tableConfig?.t?.('Save or cancel pending changes first') ?? 'Save or cancel pending changes first';\n\n const backgroundColorClass = useMemo(() => {\n if (isInlineEditing) return 'bg-primary-50 dark:bg-primary-900';\n if (bgColor) return bgColor;\n if (is_deleted || currentData?.is_deleted) return 'bg-error-100 dark:bg-error-975';\n if (is_incomplete || is_modified || is_row_modified || currentData?.is_row_modified) return 'bg-warning-50 dark:bg-black-500';\n if (is_added || currentData?.is_added) return 'bg-success-50';\n if (!is_read && showNewItem && !isDisabled) return 'bg-primary-50 dark:bg-black-700';\n return 'bg-white dark:bg-black-800';\n }, [is_incomplete, is_read, showNewItem, is_modified, is_row_modified, is_deleted, currentData, is_added, bgColor, isInlineEditing, isDisabled]);\n\n const isRowDisabled = disableOptionsForRowIndex === index || isDisabled || rowHasPendingEdits;\n\n return (\n <td aria-disabled={isRowDisabled} className={cn('px-2.5 relative h-row', backgroundColorClass, isRowDisabled && 'cursor-not-allowed opacity-50')}>\n {tableActions(rowData, index)}\n <Tooltip title={rowHasPendingEdits ? pendingEditsTooltip : ''}>\n <div\n className={cn(\n 'absolute top-0 left-0 flex items-center justify-center w-full z-20',\n { [backgroundColorClass]: rowHovering !== id || isInlineEditing },\n { 'bg-neutral-100 dark:bg-black-600': rowHovering === id && !isInlineEditing && !(is_deleted || currentData?.is_deleted) && !(is_added || currentData?.is_added) },\n { 'bg-error-200 dark:bg-error-900': rowHovering === id && !isInlineEditing && (is_deleted || currentData?.is_deleted) },\n { 'bg-success-100 dark:bg-success-800': rowHovering === id && !isInlineEditing && (is_added || currentData?.is_added) },\n rowHasPendingEdits && 'pointer-events-none',\n )}\n >\n {tableActions(rowData, index)}\n </div>\n </Tooltip>\n </td>\n );\n};\n\nexport const RowActionCell = React.memo(RowActionCellInner);\n"],"names":["RowActionCellInner","disableOptionsForRowIndex","tableActions","index","is_read","showNewItem","is_modified","is_row_modified","is_deleted","currentData","is_added","rowData","id","rowHovering","isDisabled","bgColor","is_incomplete","isInlineEditing","rowHasPendingEdits","pendingEditsTooltip","useTableConfig","backgroundColorClass","useMemo","isRowDisabled","jsxs","cn","jsx","Tooltip","RowActionCell","React"],"mappings":"oTA0BMA,EAAuC,CAAC,CAC5C,0BAAAC,EACA,aAAAC,EAAA,MACAC,EACA,QAAAC,EACA,YAAAC,EACA,YAAAC,EACA,gBAAAC,EACA,WAAAC,EACA,YAAAC,EACA,SAAAC,EACA,QAAAC,EACA,GAAAC,EACA,YAAAC,EACA,WAAAC,EACA,QAAAC,EACA,cAAAC,EACA,gBAAAC,EACA,mBAAAC,CACF,IAAM,CAEJ,MAAMC,EADcC,EAAAA,eAAA,GACqB,IAAI,sCAAsC,GAAK,uCAElFC,EAAuBC,EAAAA,QAAQ,IAC/BL,EAAwB,oCACxBF,IACAP,GAAcC,GAAa,WAAmB,iCAC9CO,GAAiBV,GAAeC,GAAmBE,GAAa,gBAAwB,kCACxFC,GAAYD,GAAa,SAAiB,gBAC1C,CAACL,GAAWC,GAAe,CAACS,EAAmB,kCAC5C,8BACN,CAACE,EAAeZ,EAASC,EAAaC,EAAaC,EAAiBC,EAAYC,EAAaC,EAAUK,EAASE,EAAiBH,CAAU,CAAC,EAEzIS,EAAgBtB,IAA8BE,GAASW,GAAcI,EAE3E,OACEM,EAAAA,KAAC,KAAA,CAAG,gBAAeD,EAAe,UAAWE,EAAG,wBAAyBJ,EAAsBE,GAAiB,+BAA+B,EAC5I,SAAA,CAAArB,EAAaS,EAASR,CAAK,EAC5BuB,EAAAA,IAACC,EAAA,CAAQ,MAAOT,EAAqBC,EAAsB,GACzD,SAAAO,EAAAA,IAAC,MAAA,CACC,UAAWD,EACT,qEACA,CAAE,CAACJ,CAAoB,EAAGR,IAAgBD,GAAMK,CAAA,EAChD,CAAE,mCAAoCJ,IAAgBD,GAAM,CAACK,GAAmB,EAAET,GAAcC,GAAa,aAAe,EAAEC,GAAYD,GAAa,SAAA,EACvJ,CAAE,iCAAkCI,IAAgBD,GAAM,CAACK,IAAoBT,GAAcC,GAAa,WAAA,EAC1G,CAAE,qCAAsCI,IAAgBD,GAAM,CAACK,IAAoBP,GAAYD,GAAa,SAAA,EAC5GS,GAAsB,qBAAA,EAGvB,SAAAhB,EAAaS,EAASR,CAAK,CAAA,CAAA,CAC9B,CACF,CAAA,EACF,CAEJ,EAEayB,EAAgBC,EAAM,KAAK7B,CAAkB"}
@@ -24,7 +24,7 @@ const M = ({
24
24
  rowHasPendingEdits: f
25
25
  }) => {
26
26
  const x = S()?.t?.("Save or cancel pending changes first") ?? "Save or cancel pending changes first", y = A(() => e ? "bg-primary-50 dark:bg-primary-900" : a || (o || r?.is_deleted ? "bg-error-100 dark:bg-error-975" : h || k || n || r?.is_row_modified ? "bg-warning-50 dark:bg-black-500" : c || r?.is_added ? "bg-success-50" : !m && g && !s ? "bg-primary-50 dark:bg-black-700" : "bg-white dark:bg-black-800"), [h, m, g, k, n, o, r, c, a, e, s]), C = j === t || s || f;
27
- return /* @__PURE__ */ T("td", { "aria-disabled": C, className: d("px-2.5 relative h-10", y, C && "cursor-not-allowed opacity-50"), children: [
27
+ return /* @__PURE__ */ T("td", { "aria-disabled": C, className: d("px-2.5 relative h-row", y, C && "cursor-not-allowed opacity-50"), children: [
28
28
  p(u, t),
29
29
  /* @__PURE__ */ R(v, { title: f ? x : "", children: /* @__PURE__ */ R(
30
30
  "div",
@@ -41,8 +41,8 @@ const M = ({
41
41
  }
42
42
  ) })
43
43
  ] });
44
- }, J = z.memo(M);
44
+ }, G = z.memo(M);
45
45
  export {
46
- J as RowActionCell
46
+ G as RowActionCell
47
47
  };
48
48
  //# sourceMappingURL=RowActionCell.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RowActionCell.es.js","sources":["../../../../../../src/components/data-display/infinite-table/body/cell/RowActionCell.tsx"],"sourcesContent":["import Tooltip from '../../../../tooltip/Tooltip';\nimport { useTableConfig } from '../../../../../providers/design-system-provider/hooks';\nimport cn from 'classnames';\nimport React, { useMemo } from 'react';\n\ntype TProps = {\n disableOptionsForRowIndex: number | null;\n tableActions: (rowData: Record<string, unknown>, index: number) => JSX.Element;\n index: number;\n is_read: boolean;\n showNewItem: boolean;\n is_modified: boolean;\n is_row_modified: boolean;\n is_deleted: boolean;\n currentData: Record<string, unknown>;\n is_added: boolean;\n rowData: Record<string, unknown>;\n id: string | number;\n rowHovering: string | number | null;\n isDisabled?: boolean;\n bgColor?: string;\n is_incomplete: boolean;\n isInlineEditing?: boolean;\n rowHasPendingEdits?: boolean;\n};\n\nconst RowActionCellInner: React.FC<TProps> = ({\n disableOptionsForRowIndex,\n tableActions,\n index,\n is_read,\n showNewItem,\n is_modified,\n is_row_modified,\n is_deleted,\n currentData,\n is_added,\n rowData,\n id,\n rowHovering,\n isDisabled,\n bgColor,\n is_incomplete,\n isInlineEditing,\n rowHasPendingEdits,\n}) => {\n const tableConfig = useTableConfig();\n const pendingEditsTooltip = tableConfig?.t?.('Save or cancel pending changes first') ?? 'Save or cancel pending changes first';\n\n const backgroundColorClass = useMemo(() => {\n if (isInlineEditing) return 'bg-primary-50 dark:bg-primary-900';\n if (bgColor) return bgColor;\n if (is_deleted || currentData?.is_deleted) return 'bg-error-100 dark:bg-error-975';\n if (is_incomplete || is_modified || is_row_modified || currentData?.is_row_modified) return 'bg-warning-50 dark:bg-black-500';\n if (is_added || currentData?.is_added) return 'bg-success-50';\n if (!is_read && showNewItem && !isDisabled) return 'bg-primary-50 dark:bg-black-700';\n return 'bg-white dark:bg-black-800';\n }, [is_incomplete, is_read, showNewItem, is_modified, is_row_modified, is_deleted, currentData, is_added, bgColor, isInlineEditing, isDisabled]);\n\n const isRowDisabled = disableOptionsForRowIndex === index || isDisabled || rowHasPendingEdits;\n\n return (\n <td aria-disabled={isRowDisabled} className={cn('px-2.5 relative h-10', backgroundColorClass, isRowDisabled && 'cursor-not-allowed opacity-50')}>\n {tableActions(rowData, index)}\n <Tooltip title={rowHasPendingEdits ? pendingEditsTooltip : ''}>\n <div\n className={cn(\n 'absolute top-0 left-0 flex items-center justify-center w-full z-20',\n { [backgroundColorClass]: rowHovering !== id || isInlineEditing },\n { 'bg-neutral-100 dark:bg-black-600': rowHovering === id && !isInlineEditing && !(is_deleted || currentData?.is_deleted) && !(is_added || currentData?.is_added) },\n { 'bg-error-200 dark:bg-error-900': rowHovering === id && !isInlineEditing && (is_deleted || currentData?.is_deleted) },\n { 'bg-success-100 dark:bg-success-800': rowHovering === id && !isInlineEditing && (is_added || currentData?.is_added) },\n rowHasPendingEdits && 'pointer-events-none',\n )}\n >\n {tableActions(rowData, index)}\n </div>\n </Tooltip>\n </td>\n );\n};\n\nexport const RowActionCell = React.memo(RowActionCellInner);\n"],"names":["RowActionCellInner","disableOptionsForRowIndex","tableActions","index","is_read","showNewItem","is_modified","is_row_modified","is_deleted","currentData","is_added","rowData","id","rowHovering","isDisabled","bgColor","is_incomplete","isInlineEditing","rowHasPendingEdits","pendingEditsTooltip","useTableConfig","backgroundColorClass","useMemo","isRowDisabled","jsxs","cn","jsx","Tooltip","RowActionCell","React"],"mappings":";;;;;AA0BA,MAAMA,IAAuC,CAAC;AAAA,EAC5C,2BAAAC;AAAA,EACA,cAAAC;AAAA,EACA,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,IAAAC;AAAA,EACA,aAAAC;AAAA,EACA,YAAAC;AAAA,EACA,SAAAC;AAAA,EACA,eAAAC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version":3,"file":"RowActionCell.es.js","sources":["../../../../../../src/components/data-display/infinite-table/body/cell/RowActionCell.tsx"],"sourcesContent":["import Tooltip from '../../../../tooltip/Tooltip';\nimport { useTableConfig } from '../../../../../providers/design-system-provider/hooks';\nimport cn from 'classnames';\nimport React, { useMemo } from 'react';\n\ntype TProps = {\n disableOptionsForRowIndex: number | null;\n tableActions: (rowData: Record<string, unknown>, index: number) => JSX.Element;\n index: number;\n is_read: boolean;\n showNewItem: boolean;\n is_modified: boolean;\n is_row_modified: boolean;\n is_deleted: boolean;\n currentData: Record<string, unknown>;\n is_added: boolean;\n rowData: Record<string, unknown>;\n id: string | number;\n rowHovering: string | number | null;\n isDisabled?: boolean;\n bgColor?: string;\n is_incomplete: boolean;\n isInlineEditing?: boolean;\n rowHasPendingEdits?: boolean;\n};\n\nconst RowActionCellInner: React.FC<TProps> = ({\n disableOptionsForRowIndex,\n tableActions,\n index,\n is_read,\n showNewItem,\n is_modified,\n is_row_modified,\n is_deleted,\n currentData,\n is_added,\n rowData,\n id,\n rowHovering,\n isDisabled,\n bgColor,\n is_incomplete,\n isInlineEditing,\n rowHasPendingEdits,\n}) => {\n const tableConfig = useTableConfig();\n const pendingEditsTooltip = tableConfig?.t?.('Save or cancel pending changes first') ?? 'Save or cancel pending changes first';\n\n const backgroundColorClass = useMemo(() => {\n if (isInlineEditing) return 'bg-primary-50 dark:bg-primary-900';\n if (bgColor) return bgColor;\n if (is_deleted || currentData?.is_deleted) return 'bg-error-100 dark:bg-error-975';\n if (is_incomplete || is_modified || is_row_modified || currentData?.is_row_modified) return 'bg-warning-50 dark:bg-black-500';\n if (is_added || currentData?.is_added) return 'bg-success-50';\n if (!is_read && showNewItem && !isDisabled) return 'bg-primary-50 dark:bg-black-700';\n return 'bg-white dark:bg-black-800';\n }, [is_incomplete, is_read, showNewItem, is_modified, is_row_modified, is_deleted, currentData, is_added, bgColor, isInlineEditing, isDisabled]);\n\n const isRowDisabled = disableOptionsForRowIndex === index || isDisabled || rowHasPendingEdits;\n\n return (\n <td aria-disabled={isRowDisabled} className={cn('px-2.5 relative h-row', backgroundColorClass, isRowDisabled && 'cursor-not-allowed opacity-50')}>\n {tableActions(rowData, index)}\n <Tooltip title={rowHasPendingEdits ? pendingEditsTooltip : ''}>\n <div\n className={cn(\n 'absolute top-0 left-0 flex items-center justify-center w-full z-20',\n { [backgroundColorClass]: rowHovering !== id || isInlineEditing },\n { 'bg-neutral-100 dark:bg-black-600': rowHovering === id && !isInlineEditing && !(is_deleted || currentData?.is_deleted) && !(is_added || currentData?.is_added) },\n { 'bg-error-200 dark:bg-error-900': rowHovering === id && !isInlineEditing && (is_deleted || currentData?.is_deleted) },\n { 'bg-success-100 dark:bg-success-800': rowHovering === id && !isInlineEditing && (is_added || currentData?.is_added) },\n rowHasPendingEdits && 'pointer-events-none',\n )}\n >\n {tableActions(rowData, index)}\n </div>\n </Tooltip>\n </td>\n );\n};\n\nexport const RowActionCell = React.memo(RowActionCellInner);\n"],"names":["RowActionCellInner","disableOptionsForRowIndex","tableActions","index","is_read","showNewItem","is_modified","is_row_modified","is_deleted","currentData","is_added","rowData","id","rowHovering","isDisabled","bgColor","is_incomplete","isInlineEditing","rowHasPendingEdits","pendingEditsTooltip","useTableConfig","backgroundColorClass","useMemo","isRowDisabled","jsxs","cn","jsx","Tooltip","RowActionCell","React"],"mappings":";;;;;AA0BA,MAAMA,IAAuC,CAAC;AAAA,EAC5C,2BAAAC;AAAA,EACA,cAAAC;AAAA,EACA,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,IAAAC;AAAA,EACA,aAAAC;AAAA,EACA,YAAAC;AAAA,EACA,SAAAC;AAAA,EACA,eAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,oBAAAC;AACF,MAAM;AAEJ,QAAMC,IADcC,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-runtime"),S=require("../../../../button/ButtonThreeDots.cjs.js"),X=require("../../../../tooltip/Tooltip.cjs.js"),Y=require("../../../../../providers/design-system-provider/hooks.cjs.js"),v=require("@mui/icons-material"),Z=require("antd"),$=require("../../../../../_virtual/index.cjs.js"),a=require("react"),E=require("../../context.cjs.js"),H=require("./SpinnerCell.cjs.js"),I=require("../../../skeleton/loaders/SingleLineLoader.cjs.js"),ee=({rowId:s,rowOptions:l,disableOption:g,rowHovering:r,is_read:R,showNewItem:N,is_modified:T,is_row_modified:L,currentData:o,is_deleted:i,is_added:d,isDraggingOver:F,rowAdditionalActions:x,rowData:B,index:n,bgColor:k,setRowHovering:c,is_incomplete:m,isInlineEditing:t,onConfirmEdit:P,onCancelEdit:w,rowHasPendingEdits:M})=>{const f=Y.useTableConfig(),j=$({"bg-primary-50 dark:bg-primary-900":t,"bg-neutral-100 dark:bg-black-600":r===s&&!t&&!(i||o?.is_deleted)&&!(d||o?.is_added),"bg-error-200 dark:bg-error-900":r===s&&!t&&(i||o?.is_deleted),"bg-success-100 dark:bg-success-800":r===s&&!t&&(d||o?.is_added),"bg-primary-50 dark:bg-black-700":!m&&!R&&N&&r!==s&&!t,"bg-warning-50 dark:bg-black-500":(m||T||L||o?.is_row_modified)&&r!==s&&!t,"bg-error-100 dark:bg-error-975":(i||o?.is_deleted)&&r!==s&&!t,"bg-success-50 dark:bg-success-900":(d||o?.is_added)&&r!==s&&!t,"bg-primary-50":F&&!t,...k&&!t&&{[k]:!0}}),_=a.useCallback(()=>c(s),[c,s]),A=a.useCallback(()=>c(null),[c]),{asyncRowOptionsFilter:p,disableOptionsForRowIndex:u=null,fieldOperationLoading:V}=a.useContext(E.TableContext),z=f?.t?.("Save or cancel pending changes first")??"Save or cancel pending changes first",D=f?.getRowOptionsDropdownProps?.(),b=!!V,[G,y]=a.useState(!!p),[J,C]=a.useState(l),K=l?l.filter(h=>h.isVisible!==!1).length:0,Q=async h=>{if(y(!0),h&&p)try{const O=await p(s),W=l?l.filter(q=>Object.keys(O).includes(q.key)?O[q.key]:!0):[];C(W)}catch{C([])}y(!1)},U=e.jsx("div",{className:"min-w-[140px] max-w-[200px] justify-start whitespace-nowrap items-center py-2 px-1 gap-2","aria-disabled":!0,children:e.jsx(I,{repeat:l?.length||1,lineHeight:"15px"})});return e.jsx("td",{className:`sticky left-0 right-0 z-10 ${j||"bg-white dark:bg-black-800"} h-10`,onMouseEnter:_,onMouseLeave:A,children:e.jsxs("div",{className:"h-full gap-2 top-0 font-medium font-inter overflow-hidden whitespace-nowrap text-ellipsis px-1 w-full flex items-center",children:[e.jsx("div",{className:`${u===n?"opacity-50":""}`,"aria-disabled":u===n,children:x?x(B,n,r===s):null}),t?e.jsxs("div",{className:`flex items-center gap-2 ${b?"pointer-events-none opacity-50":""}`,children:[e.jsx("div",{className:"cursor-pointer hover:bg-neutral-100 dark:hover:bg-black-600 rounded p-0.5",onClick:()=>!b&&w?.(),children:e.jsx(v.CloseRounded,{sx:{height:20,width:20,color:"#667085"}})}),e.jsx("div",{className:"cursor-pointer hover:bg-neutral-100 dark:hover:bg-black-600 rounded p-0.5",onClick:()=>!b&&P?.(),children:e.jsx(v.CheckRounded,{sx:{height:20,width:20,color:"var(--color-primary-600)"}})})]}):l?e.jsx(e.Fragment,{children:u===n?e.jsx(H.SpinnerCell,{}):M?e.jsx(X,{title:z,children:e.jsx("span",{children:e.jsx(S.ButtonThreeDots,{disabled:!0})})}):e.jsx(Z.Dropdown,{menu:{items:G?[{label:U,key:"loading"}]:J},trigger:["click"],overlayClassName:"row-option-cell table-row-option-dropdown",onOpenChange:Q,disabled:g||K===0,...D||{},children:e.jsx(S.ButtonThreeDots,{disabled:g})})}):null]})})};exports.RowOptionsCell=ee;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),S=require("../../../../button/ButtonThreeDots.cjs.js"),X=require("../../../../tooltip/Tooltip.cjs.js"),Y=require("../../../../../providers/design-system-provider/hooks.cjs.js"),v=require("@mui/icons-material"),Z=require("antd"),$=require("../../../../../_virtual/index.cjs.js"),a=require("react"),E=require("../../context.cjs.js"),H=require("./SpinnerCell.cjs.js"),I=require("../../../skeleton/loaders/SingleLineLoader.cjs.js"),ee=({rowId:s,rowOptions:l,disableOption:g,rowHovering:r,is_read:R,showNewItem:N,is_modified:T,is_row_modified:L,currentData:o,is_deleted:i,is_added:d,isDraggingOver:F,rowAdditionalActions:x,rowData:w,index:n,bgColor:k,setRowHovering:c,is_incomplete:m,isInlineEditing:t,onConfirmEdit:B,onCancelEdit:P,rowHasPendingEdits:M})=>{const f=Y.useTableConfig(),j=$({"bg-primary-50 dark:bg-primary-900":t,"bg-neutral-100 dark:bg-black-600":r===s&&!t&&!(i||o?.is_deleted)&&!(d||o?.is_added),"bg-error-200 dark:bg-error-900":r===s&&!t&&(i||o?.is_deleted),"bg-success-100 dark:bg-success-800":r===s&&!t&&(d||o?.is_added),"bg-primary-50 dark:bg-black-700":!m&&!R&&N&&r!==s&&!t,"bg-warning-50 dark:bg-black-500":(m||T||L||o?.is_row_modified)&&r!==s&&!t,"bg-error-100 dark:bg-error-975":(i||o?.is_deleted)&&r!==s&&!t,"bg-success-50 dark:bg-success-900":(d||o?.is_added)&&r!==s&&!t,"bg-primary-50":F&&!t,...k&&!t&&{[k]:!0}}),_=a.useCallback(()=>c(s),[c,s]),A=a.useCallback(()=>c(null),[c]),{asyncRowOptionsFilter:p,disableOptionsForRowIndex:u=null,fieldOperationLoading:V}=a.useContext(E.TableContext),z=f?.t?.("Save or cancel pending changes first")??"Save or cancel pending changes first",D=f?.getRowOptionsDropdownProps?.(),b=!!V,[G,y]=a.useState(!!p),[J,C]=a.useState(l),K=l?l.filter(h=>h.isVisible!==!1).length:0,Q=async h=>{if(y(!0),h&&p)try{const O=await p(s),W=l?l.filter(q=>Object.keys(O).includes(q.key)?O[q.key]:!0):[];C(W)}catch{C([])}y(!1)},U=e.jsx("div",{className:"min-w-[140px] max-w-[200px] justify-start whitespace-nowrap items-center py-2 px-1 gap-2","aria-disabled":!0,children:e.jsx(I,{repeat:l?.length||1,lineHeight:"15px"})});return e.jsx("td",{className:`sticky left-0 right-0 z-10 ${j||"bg-white dark:bg-black-800"} h-row`,onMouseEnter:_,onMouseLeave:A,children:e.jsxs("div",{className:"h-full gap-2 top-0 font-medium font-inter overflow-hidden whitespace-nowrap text-ellipsis px-1 w-full flex items-center",children:[e.jsx("div",{className:`${u===n?"opacity-50":""}`,"aria-disabled":u===n,children:x?x(w,n,r===s):null}),t?e.jsxs("div",{className:`flex items-center gap-2 ${b?"pointer-events-none opacity-50":""}`,children:[e.jsx("div",{className:"cursor-pointer hover:bg-neutral-100 dark:hover:bg-black-600 rounded p-0.5",onClick:()=>!b&&P?.(),children:e.jsx(v.CloseRounded,{sx:{height:20,width:20,color:"#667085"}})}),e.jsx("div",{className:"cursor-pointer hover:bg-neutral-100 dark:hover:bg-black-600 rounded p-0.5",onClick:()=>!b&&B?.(),children:e.jsx(v.CheckRounded,{sx:{height:20,width:20,color:"var(--color-primary-600)"}})})]}):l?e.jsx(e.Fragment,{children:u===n?e.jsx(H.SpinnerCell,{}):M?e.jsx(X,{title:z,children:e.jsx("span",{children:e.jsx(S.ButtonThreeDots,{disabled:!0})})}):e.jsx(Z.Dropdown,{menu:{items:G?[{label:U,key:"loading"}]:J},trigger:["click"],overlayClassName:"row-option-cell table-row-option-dropdown",onOpenChange:Q,disabled:g||K===0,...D||{},children:e.jsx(S.ButtonThreeDots,{disabled:g})})}):null]})})};exports.RowOptionsCell=ee;
2
2
  //# sourceMappingURL=RowOptionsCell.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RowOptionsCell.cjs.js","sources":["../../../../../../src/components/data-display/infinite-table/body/cell/RowOptionsCell.tsx"],"sourcesContent":["import { SingleLineLoader } from '../../../../data-display/skeleton/loaders';\nimport { ButtonThreeDots } from '../../../../button/ButtonThreeDots';\nimport Tooltip from '../../../../tooltip/Tooltip';\nimport { useTableConfig } from '../../../../../providers/design-system-provider/hooks';\nimport { CheckRounded, CloseRounded } from '@mui/icons-material';\nimport { Dropdown } from 'antd';\nimport cn from 'classnames';\nimport { useCallback, useContext, useState } from 'react';\n\nimport { TableContext } from '../../context';\nimport { SpinnerCell } from './SpinnerCell';\n\ntype TProps = {\n rowId: string | number;\n rowOptions: Array<{ key: string; label: React.ReactNode; isVisible?: boolean; [k: string]: unknown }>;\n disableOption: boolean;\n rowHovering: string | number | null;\n is_read: boolean;\n showNewItem: boolean;\n is_modified: boolean;\n is_row_modified: boolean;\n currentData: Record<string, unknown>;\n is_deleted: boolean;\n is_added: boolean;\n isDraggingOver: boolean;\n rowData: Record<string, unknown>;\n index: number;\n rowAdditionalActions: (rowData: Record<string, unknown>, index: number, isHovering: boolean) => React.ReactNode;\n bgColor?: string;\n setRowHovering: (rowId: string | number | null) => void;\n is_incomplete?: boolean;\n isInlineEditing?: boolean;\n onConfirmEdit?: () => void;\n onCancelEdit?: () => void;\n rowHasPendingEdits?: boolean;\n};\n\nexport const RowOptionsCell = ({\n rowId, rowOptions, disableOption, rowHovering, is_read, showNewItem, is_modified, is_row_modified, currentData,\n is_deleted, is_added, isDraggingOver, rowAdditionalActions, rowData, index, bgColor: bgColorProp, setRowHovering,\n is_incomplete, isInlineEditing, onConfirmEdit, onCancelEdit, rowHasPendingEdits,\n}: TProps) => {\n const tableConfig = useTableConfig();\n const bgColor = cn({\n 'bg-primary-50 dark:bg-primary-900': isInlineEditing,\n 'bg-neutral-100 dark:bg-black-600': rowHovering === rowId && !isInlineEditing && !(is_deleted || currentData?.is_deleted) && !(is_added || currentData?.is_added),\n 'bg-error-200 dark:bg-error-900': rowHovering === rowId && !isInlineEditing && (is_deleted || currentData?.is_deleted),\n 'bg-success-100 dark:bg-success-800': rowHovering === rowId && !isInlineEditing && (is_added || currentData?.is_added),\n 'bg-primary-50 dark:bg-black-700': !is_incomplete && !is_read && showNewItem && rowHovering !== rowId && !isInlineEditing,\n 'bg-warning-50 dark:bg-black-500': (is_incomplete || is_modified || is_row_modified || currentData?.is_row_modified) && rowHovering !== rowId && !isInlineEditing,\n 'bg-error-100 dark:bg-error-975': (is_deleted || currentData?.is_deleted) && rowHovering !== rowId && !isInlineEditing,\n 'bg-success-50 dark:bg-success-900': (is_added || currentData?.is_added) && rowHovering !== rowId && !isInlineEditing,\n 'bg-primary-50': isDraggingOver && !isInlineEditing,\n ...(bgColorProp && !isInlineEditing && { [bgColorProp]: true }),\n });\n\n const onMouseEnter = useCallback(() => setRowHovering(rowId), [setRowHovering, rowId]);\n const onMouseLeave = useCallback(() => setRowHovering(null), [setRowHovering]);\n\n const { asyncRowOptionsFilter, disableOptionsForRowIndex = null, fieldOperationLoading } = useContext(TableContext);\n const pendingEditsTooltip = tableConfig?.t?.('Save or cancel pending changes first') ?? 'Save or cancel pending changes first';\n const rowOptionsDropdownProps = tableConfig?.getRowOptionsDropdownProps?.();\n const isAnyFieldOperationLoading = Boolean(fieldOperationLoading);\n const [isOptionLoading, setIsOptionLoading] = useState(!!asyncRowOptionsFilter);\n const [filteredRowOptions, setFilteredRowOptions] = useState(rowOptions);\n const visibleRowOptions = rowOptions ? rowOptions.filter((option) => option.isVisible !== false).length : 0;\n\n const handleDropdownVisibleChange = async (visible: boolean) => {\n setIsOptionLoading(true);\n if (visible && asyncRowOptionsFilter) {\n try {\n const buttonState = await asyncRowOptionsFilter(rowId);\n const filteredOptions = rowOptions ? rowOptions.filter((option) => { const existOnAPI = Object.keys(buttonState).includes(option.key); return existOnAPI ? buttonState[option.key] : true; }) : [];\n setFilteredRowOptions(filteredOptions);\n } catch { setFilteredRowOptions([]); }\n }\n setIsOptionLoading(false);\n };\n\n const getSkeleton = (\n <div className={`min-w-[140px] max-w-[200px] justify-start whitespace-nowrap items-center py-2 px-1 gap-2`} aria-disabled={true}>\n <SingleLineLoader repeat={rowOptions?.length || 1} lineHeight='15px' />\n </div>\n );\n\n return (\n <td className={`sticky left-0 right-0 z-10 ${bgColor ? bgColor : 'bg-white dark:bg-black-800'} h-10`} onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave}>\n <div className={`h-full gap-2 top-0 font-medium font-inter overflow-hidden whitespace-nowrap text-ellipsis px-1 w-full flex items-center`}>\n <div className={`${disableOptionsForRowIndex === index ? 'opacity-50' : ''}`} aria-disabled={disableOptionsForRowIndex === index}>\n {rowAdditionalActions ? rowAdditionalActions(rowData, index, rowHovering === rowId) : null}\n </div>\n {isInlineEditing ? (\n <div className={`flex items-center gap-2 ${isAnyFieldOperationLoading ? 'pointer-events-none opacity-50' : ''}`}>\n <div className='cursor-pointer hover:bg-neutral-100 dark:hover:bg-black-600 rounded p-0.5' onClick={() => !isAnyFieldOperationLoading && onCancelEdit?.()}>\n <CloseRounded sx={{ height: 20, width: 20, color: '#667085' }} />\n </div>\n <div className='cursor-pointer hover:bg-neutral-100 dark:hover:bg-black-600 rounded p-0.5' onClick={() => !isAnyFieldOperationLoading && onConfirmEdit?.()}>\n <CheckRounded sx={{ height: 20, width: 20, color: 'var(--color-primary-600)' }} />\n </div>\n </div>\n ) : rowOptions ? (\n <>\n {disableOptionsForRowIndex === index ? (\n <SpinnerCell />\n ) : rowHasPendingEdits ? (\n <Tooltip title={pendingEditsTooltip}>\n <span><ButtonThreeDots disabled /></span>\n </Tooltip>\n ) : (\n <Dropdown\n menu={{ items: isOptionLoading ? [{ label: getSkeleton, key: 'loading' }] : filteredRowOptions }}\n trigger={['click']}\n overlayClassName='row-option-cell table-row-option-dropdown'\n onOpenChange={handleDropdownVisibleChange}\n disabled={disableOption || visibleRowOptions === 0}\n {...(rowOptionsDropdownProps || {})}\n >\n <ButtonThreeDots disabled={disableOption} />\n </Dropdown>\n )}\n </>\n ) : null}\n </div>\n </td>\n );\n};\n"],"names":["RowOptionsCell","rowId","rowOptions","disableOption","rowHovering","is_read","showNewItem","is_modified","is_row_modified","currentData","is_deleted","is_added","isDraggingOver","rowAdditionalActions","rowData","index","bgColorProp","setRowHovering","is_incomplete","isInlineEditing","onConfirmEdit","onCancelEdit","rowHasPendingEdits","tableConfig","useTableConfig","bgColor","cn","onMouseEnter","useCallback","onMouseLeave","asyncRowOptionsFilter","disableOptionsForRowIndex","fieldOperationLoading","useContext","TableContext","pendingEditsTooltip","rowOptionsDropdownProps","isAnyFieldOperationLoading","isOptionLoading","setIsOptionLoading","useState","filteredRowOptions","setFilteredRowOptions","visibleRowOptions","option","handleDropdownVisibleChange","visible","buttonState","filteredOptions","getSkeleton","jsx","SingleLineLoader","jsxs","CloseRounded","CheckRounded","Fragment","SpinnerCell","Tooltip","ButtonThreeDots","Dropdown"],"mappings":"iiBAqCaA,GAAiB,CAAC,CAC7B,MAAAC,EAAO,WAAAC,EAAY,cAAAC,EAAe,YAAAC,EAAa,QAAAC,EAAS,YAAAC,EAAa,YAAAC,EAAa,gBAAAC,EAAiB,YAAAC,EACnG,WAAAC,EAAY,SAAAC,EAAU,eAAAC,EAAgB,qBAAAC,EAAsB,QAAAC,EAAA,MAASC,EAAO,QAASC,EAAa,eAAAC,EAClG,cAAAC,EAAe,gBAAAC,EAAiB,cAAAC,EAAe,aAAAC,EAAc,mBAAAC,CAC/D,IAAc,CACZ,MAAMC,EAAcC,EAAAA,eAAA,EACdC,EAAUC,EAAG,CACjB,oCAAqCP,EACrC,mCAAoCf,IAAgBH,GAAS,CAACkB,GAAmB,EAAET,GAAcD,GAAa,aAAe,EAAEE,GAAYF,GAAa,UACxJ,iCAAkCL,IAAgBH,GAAS,CAACkB,IAAoBT,GAAcD,GAAa,YAC3G,qCAAsCL,IAAgBH,GAAS,CAACkB,IAAoBR,GAAYF,GAAa,UAC7G,kCAAmC,CAACS,GAAiB,CAACb,GAAWC,GAAeF,IAAgBH,GAAS,CAACkB,EAC1G,mCAAoCD,GAAiBX,GAAeC,GAAmBC,GAAa,kBAAoBL,IAAgBH,GAAS,CAACkB,EAClJ,kCAAmCT,GAAcD,GAAa,aAAeL,IAAgBH,GAAS,CAACkB,EACvG,qCAAsCR,GAAYF,GAAa,WAAaL,IAA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CAAe,CAAA,CAAA,EAGhD,EACE,IAAA,CAAA,CACN,CAAA,CACF,CAEJ"}
1
+ {"version":3,"file":"RowOptionsCell.cjs.js","sources":["../../../../../../src/components/data-display/infinite-table/body/cell/RowOptionsCell.tsx"],"sourcesContent":["import { SingleLineLoader } from '../../../../data-display/skeleton/loaders';\nimport { ButtonThreeDots } from '../../../../button/ButtonThreeDots';\nimport Tooltip from '../../../../tooltip/Tooltip';\nimport { useTableConfig } from '../../../../../providers/design-system-provider/hooks';\nimport { CheckRounded, CloseRounded } from '@mui/icons-material';\nimport { Dropdown } from 'antd';\nimport cn from 'classnames';\nimport { useCallback, useContext, useState } from 'react';\n\nimport { TableContext } from '../../context';\nimport { SpinnerCell } from './SpinnerCell';\n\ntype TProps = {\n rowId: string | number;\n rowOptions: Array<{ key: string; label: React.ReactNode; isVisible?: boolean; [k: string]: unknown }>;\n disableOption: boolean;\n rowHovering: string | number | null;\n is_read: boolean;\n showNewItem: boolean;\n is_modified: boolean;\n is_row_modified: boolean;\n currentData: Record<string, unknown>;\n is_deleted: boolean;\n is_added: boolean;\n isDraggingOver: boolean;\n rowData: Record<string, unknown>;\n index: number;\n rowAdditionalActions: (rowData: Record<string, unknown>, index: number, isHovering: boolean) => React.ReactNode;\n bgColor?: string;\n setRowHovering: (rowId: string | number | null) => void;\n is_incomplete?: boolean;\n isInlineEditing?: boolean;\n onConfirmEdit?: () => void;\n onCancelEdit?: () => void;\n rowHasPendingEdits?: boolean;\n};\n\nexport const RowOptionsCell = ({\n rowId, rowOptions, disableOption, rowHovering, is_read, showNewItem, is_modified, is_row_modified, currentData,\n is_deleted, is_added, isDraggingOver, rowAdditionalActions, rowData, index, bgColor: bgColorProp, setRowHovering,\n is_incomplete, isInlineEditing, onConfirmEdit, onCancelEdit, rowHasPendingEdits,\n}: TProps) => {\n const tableConfig = useTableConfig();\n const bgColor = cn({\n 'bg-primary-50 dark:bg-primary-900': isInlineEditing,\n 'bg-neutral-100 dark:bg-black-600': rowHovering === rowId && !isInlineEditing && !(is_deleted || currentData?.is_deleted) && !(is_added || currentData?.is_added),\n 'bg-error-200 dark:bg-error-900': rowHovering === rowId && !isInlineEditing && (is_deleted || currentData?.is_deleted),\n 'bg-success-100 dark:bg-success-800': rowHovering === rowId && !isInlineEditing && (is_added || currentData?.is_added),\n 'bg-primary-50 dark:bg-black-700': !is_incomplete && !is_read && showNewItem && rowHovering !== rowId && !isInlineEditing,\n 'bg-warning-50 dark:bg-black-500': (is_incomplete || is_modified || is_row_modified || currentData?.is_row_modified) && rowHovering !== rowId && !isInlineEditing,\n 'bg-error-100 dark:bg-error-975': (is_deleted || currentData?.is_deleted) && rowHovering !== rowId && !isInlineEditing,\n 'bg-success-50 dark:bg-success-900': (is_added || currentData?.is_added) && rowHovering !== rowId && !isInlineEditing,\n 'bg-primary-50': isDraggingOver && !isInlineEditing,\n ...(bgColorProp && !isInlineEditing && { [bgColorProp]: true }),\n });\n\n const onMouseEnter = useCallback(() => setRowHovering(rowId), [setRowHovering, rowId]);\n const onMouseLeave = useCallback(() => setRowHovering(null), [setRowHovering]);\n\n const { asyncRowOptionsFilter, disableOptionsForRowIndex = null, fieldOperationLoading } = useContext(TableContext);\n const pendingEditsTooltip = tableConfig?.t?.('Save or cancel pending changes first') ?? 'Save or cancel pending changes first';\n const rowOptionsDropdownProps = tableConfig?.getRowOptionsDropdownProps?.();\n const isAnyFieldOperationLoading = Boolean(fieldOperationLoading);\n const [isOptionLoading, setIsOptionLoading] = useState(!!asyncRowOptionsFilter);\n const [filteredRowOptions, setFilteredRowOptions] = useState(rowOptions);\n const visibleRowOptions = rowOptions ? rowOptions.filter((option) => option.isVisible !== false).length : 0;\n\n const handleDropdownVisibleChange = async (visible: boolean) => {\n setIsOptionLoading(true);\n if (visible && asyncRowOptionsFilter) {\n try {\n const buttonState = await asyncRowOptionsFilter(rowId);\n const filteredOptions = rowOptions ? rowOptions.filter((option) => { const existOnAPI = Object.keys(buttonState).includes(option.key); return existOnAPI ? buttonState[option.key] : true; }) : [];\n setFilteredRowOptions(filteredOptions);\n } catch { setFilteredRowOptions([]); }\n }\n setIsOptionLoading(false);\n };\n\n const getSkeleton = (\n <div className={`min-w-[140px] max-w-[200px] justify-start whitespace-nowrap items-center py-2 px-1 gap-2`} aria-disabled={true}>\n <SingleLineLoader repeat={rowOptions?.length || 1} lineHeight='15px' />\n </div>\n );\n\n return (\n <td className={`sticky left-0 right-0 z-10 ${bgColor ? bgColor : 'bg-white dark:bg-black-800'} h-row`} onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave}>\n <div className={`h-full gap-2 top-0 font-medium font-inter overflow-hidden whitespace-nowrap text-ellipsis px-1 w-full flex items-center`}>\n <div className={`${disableOptionsForRowIndex === index ? 'opacity-50' : ''}`} aria-disabled={disableOptionsForRowIndex === index}>\n {rowAdditionalActions ? rowAdditionalActions(rowData, index, rowHovering === rowId) : null}\n </div>\n {isInlineEditing ? (\n <div className={`flex items-center gap-2 ${isAnyFieldOperationLoading ? 'pointer-events-none opacity-50' : ''}`}>\n <div className='cursor-pointer hover:bg-neutral-100 dark:hover:bg-black-600 rounded p-0.5' onClick={() => !isAnyFieldOperationLoading && onCancelEdit?.()}>\n <CloseRounded sx={{ height: 20, width: 20, color: '#667085' }} />\n </div>\n <div className='cursor-pointer hover:bg-neutral-100 dark:hover:bg-black-600 rounded p-0.5' onClick={() => !isAnyFieldOperationLoading && onConfirmEdit?.()}>\n <CheckRounded sx={{ height: 20, width: 20, color: 'var(--color-primary-600)' }} />\n </div>\n </div>\n ) : rowOptions ? (\n <>\n {disableOptionsForRowIndex === index ? (\n <SpinnerCell />\n ) : rowHasPendingEdits ? (\n <Tooltip title={pendingEditsTooltip}>\n <span><ButtonThreeDots disabled /></span>\n </Tooltip>\n ) : (\n <Dropdown\n menu={{ items: isOptionLoading ? [{ label: getSkeleton, key: 'loading' }] : filteredRowOptions }}\n trigger={['click']}\n overlayClassName='row-option-cell table-row-option-dropdown'\n onOpenChange={handleDropdownVisibleChange}\n disabled={disableOption || visibleRowOptions === 0}\n {...(rowOptionsDropdownProps || {})}\n >\n <ButtonThreeDots disabled={disableOption} />\n </Dropdown>\n )}\n </>\n ) : null}\n </div>\n </td>\n );\n};\n"],"names":["RowOptionsCell","rowId","rowOptions","disableOption","rowHovering","is_read","showNewItem","is_modified","is_row_modified","currentData","is_deleted","is_added","isDraggingOver","rowAdditionalActions","rowData","index","bgColorProp","setRowHovering","is_incomplete","isInlineEditing","onConfirmEdit","onCancelEdit","rowHasPendingEdits","tableConfig","useTableConfig","bgColor","cn","onMouseEnter","useCallback","onMouseLeave","asyncRowOptionsFilter","disableOptionsForRowIndex","fieldOperationLoading","useContext","TableContext","pendingEditsTooltip","rowOptionsDropdownProps","isAnyFieldOperationLoading","isOptionLoading","setIsOptionLoading","useState","filteredRowOptions","setFilteredRowOptions","visibleRowOptions","option","handleDropdownVisibleChange","visible","buttonState","filteredOptions","getSkeleton","jsx","SingleLineLoader","jsxs","CloseRounded","CheckRounded","Fragment","SpinnerCell","Tooltip","ButtonThreeDots","Dropdown"],"mappings":"iiBAqCaA,GAAiB,CAAC,CAC7B,MAAAC,EAAO,WAAAC,EAAY,cAAAC,EAAe,YAAAC,EAAa,QAAAC,EAAS,YAAAC,EAAa,YAAAC,EAAa,gBAAAC,EAAiB,YAAAC,EACnG,WAAAC,EAAY,SAAAC,EAAU,eAAAC,EAAgB,qBAAAC,EAAsB,QAAAC,EAAA,MAASC,EAAO,QAASC,EAAa,eAAAC,EAClG,cAAAC,EAAe,gBAAAC,EAAiB,cAAAC,EAAe,aAAAC,EAAc,mBAAAC,CAC/D,IAAc,CACZ,MAAMC,EAAcC,EAAAA,eAAA,EACdC,EAAUC,EAAG,CACjB,oCAAqCP,EACrC,mCAAoCf,IAAgBH,GAAS,CAACkB,GAAmB,EAAET,GAAcD,GAAa,aAAe,EAAEE,GAAYF,GAAa,UACxJ,iCAAkCL,IAAgBH,GAAS,CAACkB,IAAoBT,GAAcD,GAAa,YAC3G,qCAAsCL,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AEAR,EAAAA,IAACS,EAAAA,SAAA,CACC,KAAM,CAAE,MAAOrB,EAAkB,CAAC,CAAE,MAAOW,EAAa,IAAK,UAAW,EAAIR,CAAA,EAC5E,QAAS,CAAC,OAAO,EACjB,iBAAiB,4CACjB,aAAcI,EACd,SAAU1C,GAAiBwC,IAAsB,EAChD,GAAIP,GAA2B,CAAA,EAEhC,SAAAc,EAAAA,IAACQ,EAAAA,gBAAA,CAAgB,SAAUvD,CAAA,CAAe,CAAA,CAAA,EAGhD,EACE,IAAA,CAAA,CACN,CAAA,CACF,CAEJ"}
@@ -5,60 +5,60 @@ import { useTableConfig as D } from "../../../../../providers/design-system-prov
5
5
  import { CloseRounded as E, CheckRounded as H } from "@mui/icons-material";
6
6
  import { Dropdown as I } from "antd";
7
7
  import ee from "../../../../../_virtual/index.es.js";
8
- import { useCallback as S, useContext as te, useState as R } from "react";
9
- import { TableContext as oe } from "../../context.es.js";
8
+ import { useCallback as S, useContext as oe, useState as R } from "react";
9
+ import { TableContext as te } from "../../context.es.js";
10
10
  import { SpinnerCell as re } from "./SpinnerCell.es.js";
11
11
  import se from "../../../skeleton/loaders/SingleLineLoader.es.js";
12
12
  const ue = ({
13
- rowId: t,
13
+ rowId: o,
14
14
  rowOptions: s,
15
15
  disableOption: h,
16
16
  rowHovering: r,
17
17
  is_read: F,
18
18
  showNewItem: T,
19
19
  is_modified: j,
20
- is_row_modified: P,
20
+ is_row_modified: w,
21
21
  currentData: a,
22
22
  is_deleted: n,
23
23
  is_added: i,
24
- isDraggingOver: _,
24
+ isDraggingOver: P,
25
25
  rowAdditionalActions: g,
26
- rowData: $,
26
+ rowData: _,
27
27
  index: l,
28
28
  bgColor: f,
29
29
  setRowHovering: c,
30
30
  is_incomplete: u,
31
- isInlineEditing: o,
32
- onConfirmEdit: w,
31
+ isInlineEditing: t,
32
+ onConfirmEdit: $,
33
33
  onCancelEdit: B,
34
34
  rowHasPendingEdits: M
35
35
  }) => {
36
36
  const k = D(), y = ee({
37
- "bg-primary-50 dark:bg-primary-900": o,
38
- "bg-neutral-100 dark:bg-black-600": r === t && !o && !(n || a?.is_deleted) && !(i || a?.is_added),
39
- "bg-error-200 dark:bg-error-900": r === t && !o && (n || a?.is_deleted),
40
- "bg-success-100 dark:bg-success-800": r === t && !o && (i || a?.is_added),
41
- "bg-primary-50 dark:bg-black-700": !u && !F && T && r !== t && !o,
42
- "bg-warning-50 dark:bg-black-500": (u || j || P || a?.is_row_modified) && r !== t && !o,
43
- "bg-error-100 dark:bg-error-975": (n || a?.is_deleted) && r !== t && !o,
44
- "bg-success-50 dark:bg-success-900": (i || a?.is_added) && r !== t && !o,
45
- "bg-primary-50": _ && !o,
46
- ...f && !o && { [f]: !0 }
47
- }), V = S(() => c(t), [c, t]), z = S(() => c(null), [c]), { asyncRowOptionsFilter: p, disableOptionsForRowIndex: d = null, fieldOperationLoading: A } = te(oe), q = k?.t?.("Save or cancel pending changes first") ?? "Save or cancel pending changes first", G = k?.getRowOptionsDropdownProps?.(), b = !!A, [J, x] = R(!!p), [K, C] = R(s), Q = s ? s.filter((m) => m.isVisible !== !1).length : 0, U = async (m) => {
37
+ "bg-primary-50 dark:bg-primary-900": t,
38
+ "bg-neutral-100 dark:bg-black-600": r === o && !t && !(n || a?.is_deleted) && !(i || a?.is_added),
39
+ "bg-error-200 dark:bg-error-900": r === o && !t && (n || a?.is_deleted),
40
+ "bg-success-100 dark:bg-success-800": r === o && !t && (i || a?.is_added),
41
+ "bg-primary-50 dark:bg-black-700": !u && !F && T && r !== o && !t,
42
+ "bg-warning-50 dark:bg-black-500": (u || j || w || a?.is_row_modified) && r !== o && !t,
43
+ "bg-error-100 dark:bg-error-975": (n || a?.is_deleted) && r !== o && !t,
44
+ "bg-success-50 dark:bg-success-900": (i || a?.is_added) && r !== o && !t,
45
+ "bg-primary-50": P && !t,
46
+ ...f && !t && { [f]: !0 }
47
+ }), V = S(() => c(o), [c, o]), z = S(() => c(null), [c]), { asyncRowOptionsFilter: p, disableOptionsForRowIndex: d = null, fieldOperationLoading: A } = oe(te), q = k?.t?.("Save or cancel pending changes first") ?? "Save or cancel pending changes first", G = k?.getRowOptionsDropdownProps?.(), b = !!A, [J, x] = R(!!p), [K, C] = R(s), Q = s ? s.filter((m) => m.isVisible !== !1).length : 0, U = async (m) => {
48
48
  if (x(!0), m && p)
49
49
  try {
50
- const O = await p(t), X = s ? s.filter((v) => Object.keys(O).includes(v.key) ? O[v.key] : !0) : [];
50
+ const O = await p(o), X = s ? s.filter((v) => Object.keys(O).includes(v.key) ? O[v.key] : !0) : [];
51
51
  C(X);
52
52
  } catch {
53
53
  C([]);
54
54
  }
55
55
  x(!1);
56
56
  }, W = /* @__PURE__ */ e("div", { className: "min-w-[140px] max-w-[200px] justify-start whitespace-nowrap items-center py-2 px-1 gap-2", "aria-disabled": !0, children: /* @__PURE__ */ e(se, { repeat: s?.length || 1, lineHeight: "15px" }) });
57
- return /* @__PURE__ */ e("td", { className: `sticky left-0 right-0 z-10 ${y || "bg-white dark:bg-black-800"} h-10`, onMouseEnter: V, onMouseLeave: z, children: /* @__PURE__ */ N("div", { className: "h-full gap-2 top-0 font-medium font-inter overflow-hidden whitespace-nowrap text-ellipsis px-1 w-full flex items-center", children: [
58
- /* @__PURE__ */ e("div", { className: `${d === l ? "opacity-50" : ""}`, "aria-disabled": d === l, children: g ? g($, l, r === t) : null }),
59
- o ? /* @__PURE__ */ N("div", { className: `flex items-center gap-2 ${b ? "pointer-events-none opacity-50" : ""}`, children: [
57
+ return /* @__PURE__ */ e("td", { className: `sticky left-0 right-0 z-10 ${y || "bg-white dark:bg-black-800"} h-row`, onMouseEnter: V, onMouseLeave: z, children: /* @__PURE__ */ N("div", { className: "h-full gap-2 top-0 font-medium font-inter overflow-hidden whitespace-nowrap text-ellipsis px-1 w-full flex items-center", children: [
58
+ /* @__PURE__ */ e("div", { className: `${d === l ? "opacity-50" : ""}`, "aria-disabled": d === l, children: g ? g(_, l, r === o) : null }),
59
+ t ? /* @__PURE__ */ N("div", { className: `flex items-center gap-2 ${b ? "pointer-events-none opacity-50" : ""}`, children: [
60
60
  /* @__PURE__ */ e("div", { className: "cursor-pointer hover:bg-neutral-100 dark:hover:bg-black-600 rounded p-0.5", onClick: () => !b && B?.(), children: /* @__PURE__ */ e(E, { sx: { height: 20, width: 20, color: "#667085" } }) }),
61
- /* @__PURE__ */ e("div", { className: "cursor-pointer hover:bg-neutral-100 dark:hover:bg-black-600 rounded p-0.5", onClick: () => !b && w?.(), children: /* @__PURE__ */ e(H, { sx: { height: 20, width: 20, color: "var(--color-primary-600)" } }) })
61
+ /* @__PURE__ */ e("div", { className: "cursor-pointer hover:bg-neutral-100 dark:hover:bg-black-600 rounded p-0.5", onClick: () => !b && $?.(), children: /* @__PURE__ */ e(H, { sx: { height: 20, width: 20, color: "var(--color-primary-600)" } }) })
62
62
  ] }) : s ? /* @__PURE__ */ e(Y, { children: d === l ? /* @__PURE__ */ e(re, {}) : M ? /* @__PURE__ */ e(Z, { title: q, children: /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(L, { disabled: !0 }) }) }) : /* @__PURE__ */ e(
63
63
  I,
64
64
  {
@@ -1 +1 @@
1
- {"version":3,"file":"RowOptionsCell.es.js","sources":["../../../../../../src/components/data-display/infinite-table/body/cell/RowOptionsCell.tsx"],"sourcesContent":["import { SingleLineLoader } from '../../../../data-display/skeleton/loaders';\nimport { ButtonThreeDots } from '../../../../button/ButtonThreeDots';\nimport Tooltip from '../../../../tooltip/Tooltip';\nimport { useTableConfig } from '../../../../../providers/design-system-provider/hooks';\nimport { CheckRounded, CloseRounded } from '@mui/icons-material';\nimport { Dropdown } from 'antd';\nimport cn from 'classnames';\nimport { useCallback, useContext, useState } from 'react';\n\nimport { TableContext } from '../../context';\nimport { SpinnerCell } from './SpinnerCell';\n\ntype TProps = {\n rowId: string | number;\n rowOptions: Array<{ key: string; label: React.ReactNode; isVisible?: boolean; [k: string]: unknown }>;\n disableOption: boolean;\n rowHovering: string | number | null;\n is_read: boolean;\n showNewItem: boolean;\n is_modified: boolean;\n is_row_modified: boolean;\n currentData: Record<string, unknown>;\n is_deleted: boolean;\n is_added: boolean;\n isDraggingOver: boolean;\n rowData: Record<string, unknown>;\n index: number;\n rowAdditionalActions: (rowData: Record<string, unknown>, index: number, isHovering: boolean) => React.ReactNode;\n bgColor?: string;\n setRowHovering: (rowId: string | number | null) => void;\n is_incomplete?: boolean;\n isInlineEditing?: boolean;\n onConfirmEdit?: () => void;\n onCancelEdit?: () => void;\n rowHasPendingEdits?: boolean;\n};\n\nexport const RowOptionsCell = ({\n rowId, rowOptions, disableOption, rowHovering, is_read, showNewItem, is_modified, is_row_modified, currentData,\n is_deleted, is_added, isDraggingOver, rowAdditionalActions, rowData, index, bgColor: bgColorProp, setRowHovering,\n is_incomplete, isInlineEditing, onConfirmEdit, onCancelEdit, rowHasPendingEdits,\n}: TProps) => {\n const tableConfig = useTableConfig();\n const bgColor = cn({\n 'bg-primary-50 dark:bg-primary-900': isInlineEditing,\n 'bg-neutral-100 dark:bg-black-600': rowHovering === rowId && !isInlineEditing && !(is_deleted || currentData?.is_deleted) && !(is_added || currentData?.is_added),\n 'bg-error-200 dark:bg-error-900': rowHovering === rowId && !isInlineEditing && (is_deleted || currentData?.is_deleted),\n 'bg-success-100 dark:bg-success-800': rowHovering === rowId && !isInlineEditing && (is_added || currentData?.is_added),\n 'bg-primary-50 dark:bg-black-700': !is_incomplete && !is_read && showNewItem && rowHovering !== rowId && !isInlineEditing,\n 'bg-warning-50 dark:bg-black-500': (is_incomplete || is_modified || is_row_modified || currentData?.is_row_modified) && rowHovering !== rowId && !isInlineEditing,\n 'bg-error-100 dark:bg-error-975': (is_deleted || currentData?.is_deleted) && rowHovering !== rowId && !isInlineEditing,\n 'bg-success-50 dark:bg-success-900': (is_added || currentData?.is_added) && rowHovering !== rowId && !isInlineEditing,\n 'bg-primary-50': isDraggingOver && !isInlineEditing,\n ...(bgColorProp && !isInlineEditing && { [bgColorProp]: true }),\n });\n\n const onMouseEnter = useCallback(() => setRowHovering(rowId), [setRowHovering, rowId]);\n const onMouseLeave = useCallback(() => setRowHovering(null), [setRowHovering]);\n\n const { asyncRowOptionsFilter, disableOptionsForRowIndex = null, fieldOperationLoading } = useContext(TableContext);\n const pendingEditsTooltip = tableConfig?.t?.('Save or cancel pending changes first') ?? 'Save or cancel pending changes first';\n const rowOptionsDropdownProps = tableConfig?.getRowOptionsDropdownProps?.();\n const isAnyFieldOperationLoading = Boolean(fieldOperationLoading);\n const [isOptionLoading, setIsOptionLoading] = useState(!!asyncRowOptionsFilter);\n const [filteredRowOptions, setFilteredRowOptions] = useState(rowOptions);\n const visibleRowOptions = rowOptions ? rowOptions.filter((option) => option.isVisible !== false).length : 0;\n\n const handleDropdownVisibleChange = async (visible: boolean) => {\n setIsOptionLoading(true);\n if (visible && asyncRowOptionsFilter) {\n try {\n const buttonState = await asyncRowOptionsFilter(rowId);\n const filteredOptions = rowOptions ? rowOptions.filter((option) => { const existOnAPI = Object.keys(buttonState).includes(option.key); return existOnAPI ? buttonState[option.key] : true; }) : [];\n setFilteredRowOptions(filteredOptions);\n } catch { setFilteredRowOptions([]); }\n }\n setIsOptionLoading(false);\n };\n\n const getSkeleton = (\n <div className={`min-w-[140px] max-w-[200px] justify-start whitespace-nowrap items-center py-2 px-1 gap-2`} aria-disabled={true}>\n <SingleLineLoader repeat={rowOptions?.length || 1} lineHeight='15px' />\n </div>\n );\n\n return (\n <td className={`sticky left-0 right-0 z-10 ${bgColor ? bgColor : 'bg-white dark:bg-black-800'} h-10`} onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave}>\n <div className={`h-full gap-2 top-0 font-medium font-inter overflow-hidden whitespace-nowrap text-ellipsis px-1 w-full flex items-center`}>\n <div className={`${disableOptionsForRowIndex === index ? 'opacity-50' : ''}`} aria-disabled={disableOptionsForRowIndex === index}>\n {rowAdditionalActions ? rowAdditionalActions(rowData, index, rowHovering === rowId) : null}\n </div>\n {isInlineEditing ? (\n <div className={`flex items-center gap-2 ${isAnyFieldOperationLoading ? 'pointer-events-none opacity-50' : ''}`}>\n <div className='cursor-pointer hover:bg-neutral-100 dark:hover:bg-black-600 rounded p-0.5' onClick={() => !isAnyFieldOperationLoading && onCancelEdit?.()}>\n <CloseRounded sx={{ height: 20, width: 20, color: '#667085' }} />\n </div>\n <div className='cursor-pointer hover:bg-neutral-100 dark:hover:bg-black-600 rounded p-0.5' onClick={() => !isAnyFieldOperationLoading && onConfirmEdit?.()}>\n <CheckRounded sx={{ height: 20, width: 20, color: 'var(--color-primary-600)' }} />\n </div>\n </div>\n ) : rowOptions ? (\n <>\n {disableOptionsForRowIndex === index ? (\n <SpinnerCell />\n ) : rowHasPendingEdits ? (\n <Tooltip title={pendingEditsTooltip}>\n <span><ButtonThreeDots disabled /></span>\n </Tooltip>\n ) : (\n <Dropdown\n menu={{ items: isOptionLoading ? [{ label: getSkeleton, key: 'loading' }] : filteredRowOptions }}\n trigger={['click']}\n overlayClassName='row-option-cell table-row-option-dropdown'\n onOpenChange={handleDropdownVisibleChange}\n disabled={disableOption || visibleRowOptions === 0}\n {...(rowOptionsDropdownProps || {})}\n >\n <ButtonThreeDots disabled={disableOption} />\n </Dropdown>\n )}\n </>\n ) : null}\n </div>\n </td>\n );\n};\n"],"names":["RowOptionsCell","rowId","rowOptions","disableOption","rowHovering","is_read","showNewItem","is_modified","is_row_modified","currentData","is_deleted","is_added","isDraggingOver","rowAdditionalActions","rowData","index","bgColorProp","setRowHovering","is_incomplete","isInlineEditing","onConfirmEdit","onCancelEdit","rowHasPendingEdits","tableConfig","useTableConfig","bgColor","cn","onMouseEnter","useCallback","onMouseLeave","asyncRowOptionsFilter","disableOptionsForRowIndex","fieldOperationLoading","useContext","TableContext","pendingEditsTooltip","rowOptionsDropdownProps","isAnyFieldOperationLoading","isOptionLoading","setIsOptionLoading","useState","filteredRowOptions","setFilteredRowOptions","visibleRowOptions","option","handleDropdownVisibleChange","visible","buttonState","filteredOptions","getSkeleton","jsx","SingleLineLoader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A,MAAA;AAAA,IAAA,GAGhD,IACE;AAAA,EAAA,EAAA,CACN,EAAA,CACF;AAEJ;"}
1
+ {"version":3,"file":"RowOptionsCell.es.js","sources":["../../../../../../src/components/data-display/infinite-table/body/cell/RowOptionsCell.tsx"],"sourcesContent":["import { SingleLineLoader } from '../../../../data-display/skeleton/loaders';\nimport { ButtonThreeDots } from '../../../../button/ButtonThreeDots';\nimport Tooltip from '../../../../tooltip/Tooltip';\nimport { useTableConfig } from '../../../../../providers/design-system-provider/hooks';\nimport { CheckRounded, CloseRounded } from '@mui/icons-material';\nimport { Dropdown } from 'antd';\nimport cn from 'classnames';\nimport { useCallback, useContext, useState } from 'react';\n\nimport { TableContext } from '../../context';\nimport { SpinnerCell } from './SpinnerCell';\n\ntype TProps = {\n rowId: string | number;\n rowOptions: Array<{ key: string; label: React.ReactNode; isVisible?: boolean; [k: string]: unknown }>;\n disableOption: boolean;\n rowHovering: string | number | null;\n is_read: boolean;\n showNewItem: boolean;\n is_modified: boolean;\n is_row_modified: boolean;\n currentData: Record<string, unknown>;\n is_deleted: boolean;\n is_added: boolean;\n isDraggingOver: boolean;\n rowData: Record<string, unknown>;\n index: number;\n rowAdditionalActions: (rowData: Record<string, unknown>, index: number, isHovering: boolean) => React.ReactNode;\n bgColor?: string;\n setRowHovering: (rowId: string | number | null) => void;\n is_incomplete?: boolean;\n isInlineEditing?: boolean;\n onConfirmEdit?: () => void;\n onCancelEdit?: () => void;\n rowHasPendingEdits?: boolean;\n};\n\nexport const RowOptionsCell = ({\n rowId, rowOptions, disableOption, rowHovering, is_read, showNewItem, is_modified, is_row_modified, currentData,\n is_deleted, is_added, isDraggingOver, rowAdditionalActions, rowData, index, bgColor: bgColorProp, setRowHovering,\n is_incomplete, isInlineEditing, onConfirmEdit, onCancelEdit, rowHasPendingEdits,\n}: TProps) => {\n const tableConfig = useTableConfig();\n const bgColor = cn({\n 'bg-primary-50 dark:bg-primary-900': isInlineEditing,\n 'bg-neutral-100 dark:bg-black-600': rowHovering === rowId && !isInlineEditing && !(is_deleted || currentData?.is_deleted) && !(is_added || currentData?.is_added),\n 'bg-error-200 dark:bg-error-900': rowHovering === rowId && !isInlineEditing && (is_deleted || currentData?.is_deleted),\n 'bg-success-100 dark:bg-success-800': rowHovering === rowId && !isInlineEditing && (is_added || currentData?.is_added),\n 'bg-primary-50 dark:bg-black-700': !is_incomplete && !is_read && showNewItem && rowHovering !== rowId && !isInlineEditing,\n 'bg-warning-50 dark:bg-black-500': (is_incomplete || is_modified || is_row_modified || currentData?.is_row_modified) && rowHovering !== rowId && !isInlineEditing,\n 'bg-error-100 dark:bg-error-975': (is_deleted || currentData?.is_deleted) && rowHovering !== rowId && !isInlineEditing,\n 'bg-success-50 dark:bg-success-900': (is_added || currentData?.is_added) && rowHovering !== rowId && !isInlineEditing,\n 'bg-primary-50': isDraggingOver && !isInlineEditing,\n ...(bgColorProp && !isInlineEditing && { [bgColorProp]: true }),\n });\n\n const onMouseEnter = useCallback(() => setRowHovering(rowId), [setRowHovering, rowId]);\n const onMouseLeave = useCallback(() => setRowHovering(null), [setRowHovering]);\n\n const { asyncRowOptionsFilter, disableOptionsForRowIndex = null, fieldOperationLoading } = useContext(TableContext);\n const pendingEditsTooltip = tableConfig?.t?.('Save or cancel pending changes first') ?? 'Save or cancel pending changes first';\n const rowOptionsDropdownProps = tableConfig?.getRowOptionsDropdownProps?.();\n const isAnyFieldOperationLoading = Boolean(fieldOperationLoading);\n const [isOptionLoading, setIsOptionLoading] = useState(!!asyncRowOptionsFilter);\n const [filteredRowOptions, setFilteredRowOptions] = useState(rowOptions);\n const visibleRowOptions = rowOptions ? rowOptions.filter((option) => option.isVisible !== false).length : 0;\n\n const handleDropdownVisibleChange = async (visible: boolean) => {\n setIsOptionLoading(true);\n if (visible && asyncRowOptionsFilter) {\n try {\n const buttonState = await asyncRowOptionsFilter(rowId);\n const filteredOptions = rowOptions ? rowOptions.filter((option) => { const existOnAPI = Object.keys(buttonState).includes(option.key); return existOnAPI ? buttonState[option.key] : true; }) : [];\n setFilteredRowOptions(filteredOptions);\n } catch { setFilteredRowOptions([]); }\n }\n setIsOptionLoading(false);\n };\n\n const getSkeleton = (\n <div className={`min-w-[140px] max-w-[200px] justify-start whitespace-nowrap items-center py-2 px-1 gap-2`} aria-disabled={true}>\n <SingleLineLoader repeat={rowOptions?.length || 1} lineHeight='15px' />\n </div>\n );\n\n return (\n <td className={`sticky left-0 right-0 z-10 ${bgColor ? bgColor : 'bg-white dark:bg-black-800'} h-row`} onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave}>\n <div className={`h-full gap-2 top-0 font-medium font-inter overflow-hidden whitespace-nowrap text-ellipsis px-1 w-full flex items-center`}>\n <div className={`${disableOptionsForRowIndex === index ? 'opacity-50' : ''}`} aria-disabled={disableOptionsForRowIndex === index}>\n {rowAdditionalActions ? rowAdditionalActions(rowData, index, rowHovering === rowId) : null}\n </div>\n {isInlineEditing ? (\n <div className={`flex items-center gap-2 ${isAnyFieldOperationLoading ? 'pointer-events-none opacity-50' : ''}`}>\n <div className='cursor-pointer hover:bg-neutral-100 dark:hover:bg-black-600 rounded p-0.5' onClick={() => !isAnyFieldOperationLoading && onCancelEdit?.()}>\n <CloseRounded sx={{ height: 20, width: 20, color: '#667085' }} />\n </div>\n <div className='cursor-pointer hover:bg-neutral-100 dark:hover:bg-black-600 rounded p-0.5' onClick={() => !isAnyFieldOperationLoading && onConfirmEdit?.()}>\n <CheckRounded sx={{ height: 20, width: 20, color: 'var(--color-primary-600)' }} />\n </div>\n </div>\n ) : rowOptions ? (\n <>\n {disableOptionsForRowIndex === index ? (\n <SpinnerCell />\n ) : rowHasPendingEdits ? (\n <Tooltip title={pendingEditsTooltip}>\n <span><ButtonThreeDots disabled /></span>\n </Tooltip>\n ) : (\n <Dropdown\n menu={{ items: isOptionLoading ? [{ label: getSkeleton, key: 'loading' }] : filteredRowOptions }}\n trigger={['click']}\n overlayClassName='row-option-cell table-row-option-dropdown'\n onOpenChange={handleDropdownVisibleChange}\n disabled={disableOption || visibleRowOptions === 0}\n {...(rowOptionsDropdownProps || {})}\n >\n <ButtonThreeDots disabled={disableOption} />\n </Dropdown>\n )}\n </>\n ) : null}\n </div>\n </td>\n );\n};\n"],"names":["RowOptionsCell","rowId","rowOptions","disableOption","rowHovering","is_read","showNewItem","is_modified","is_row_modified","currentData","is_deleted","is_added","isDraggingOver","rowAdditionalActions","rowData","index","bgColorProp","setRowHovering","is_incomplete","isInlineEditing","onConfirmEdit","onCancelEdit","rowHasPendingEdits","tableConfig","useTableConfig","bgColor","cn","onMouseEnter","useCallback","onMouseLeave","asyncRowOptionsFilter","disableOptionsForRowIndex","fieldOperationLoading","useContext","TableContext","pendingEditsTooltip","rowOptionsDropdownProps","isAnyFieldOperationLoading","isOptionLoading","setIsOptionLoading","useState","filteredRowOptions","setFilteredRowOptions","visibleRowOptions","option","handleDropdownVisibleChange","visible","buttonState","filteredOptions","getSkeleton","jsx","SingleLineLoader","jsxs","CloseRounded","CheckRounded","Fragment","SpinnerCell","Tooltip","ButtonThreeDots","Dropdown"],"mappings":";;;;;;;;;;;AAqCO,MAAMA,KAAiB,CAAC;AAAA,EAC7B,OAAAC;AAAA,EAAO,YAAAC;AAAA,EAAY,eAAAC;AAAA,EAAe,aAAAC;AAAA,EAAa,SAAAC;AAAA,EAAS,aAAAC;AAAA,EAAa,aAAAC;AAAA,EAAa,iBAAAC;AAAA,EAAiB,aAAAC;AAAA,EACnG,YAAAC;AAAA,EAAY,UAAAC;AAAA,EAAU,gBAAAC;AAAA,EAAgB,sBAAAC;AAAA,EAAsB,SAAAC;AAAA,EAAS,OAAAC;AAAA,EAAO,SAASC;AAAA,EAAa,gBAAAC;AAAA,EAClG,eAAAC;AAAA,EAAe,iBAAAC;AAAA,EAAiB,eAAAC;AAAA,EAAe,cAAAC;AAAA,EAAc,oBAAAC;AAC/D,MAAc;AACZ,QAAMC,IAAcC,EAAA,GACdC,IAAUC,GAAG;AAAA,IACjB,qCAAqCP;AAAA,IACr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AA,EAAA,CACF,IACEpD,IACF,gBAAAgD,EAAAK,GAAA,EACG,UAAAxB,MAA8BhB,IAC7B,gBAAAmC,EAACM,IAAA,CAAA,CAAY,IACXlC,IACF,gBAAA4B,EAACO,KAAQ,OAAOtB,GACd,4BAAC,QAAA,EAAK,UAAA,gBAAAe,EAACQ,KAAgB,UAAQ,GAAA,CAAC,EAAA,CAAE,EAAA,CACpC,IAEA,gBAAAR;AAAA,MAACS;AAAA,MAAA;AAAA,QACC,MAAM,EAAE,OAAOrB,IAAkB,CAAC,EAAE,OAAOW,GAAa,KAAK,WAAW,IAAIR,EAAA;AAAA,QAC5E,SAAS,CAAC,OAAO;AAAA,QACjB,kBAAiB;AAAA,QACjB,cAAcI;AAAA,QACd,UAAU1C,KAAiBwC,MAAsB;AAAA,QAChD,GAAIP,KAA2B,CAAA;AAAA,QAEhC,UAAA,gBAAAc,EAACQ,GAAA,EAAgB,UAAUvD,EAAA,CAAe;AAAA,MAAA;AAAA,IAAA,GAGhD,IACE;AAAA,EAAA,EAAA,CACN,EAAA,CACF;AAEJ;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("../../../../../_virtual/index.cjs.js"),i=require("react"),s=require("../../../../icon/icons.generated.cjs.js"),c=({width:n,size:t=24})=>e.jsx("td",{className:r("sticky left-0 right-0 bg-white dark:bg-black-800",n&&`w-[${n}px]`),children:e.jsx("div",{className:"h-10 flex items-center justify-center",children:e.jsx(s.LoadingSpinnerIcon,{size:t-4,className:"inline my-2 text-neutral-600 dark:text-white"})})}),l=i.memo(c);exports.SpinnerCell=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("../../../../../_virtual/index.cjs.js"),i=require("react"),s=require("../../../../icon/icons.generated.cjs.js"),c=({width:n,size:t=24})=>e.jsx("td",{className:r("sticky left-0 right-0 bg-white dark:bg-black-800",n&&`w-[${n}px]`),children:e.jsx("div",{className:"h-row flex items-center justify-center",children:e.jsx(s.LoadingSpinnerIcon,{size:t-4,className:"inline my-2 text-neutral-600 dark:text-white"})})}),l=i.memo(c);exports.SpinnerCell=l;
2
2
  //# sourceMappingURL=SpinnerCell.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SpinnerCell.cjs.js","sources":["../../../../../../src/components/data-display/infinite-table/body/cell/SpinnerCell.tsx"],"sourcesContent":["import cn from 'classnames';\nimport React from 'react';\nimport { LoadingSpinnerIcon } from '../../../../icon';\n\ntype TProps = {\n width?: number;\n size?: number;\n};\n\nconst _SpinnerCell = ({ width, size = 24 }: TProps) => {\n return (\n <td className={cn('sticky left-0 right-0 bg-white dark:bg-black-800', width && `w-[${width}px]`)}>\n <div className='h-10 flex items-center justify-center'>\n <LoadingSpinnerIcon size={size-4} className='inline my-2 text-neutral-600 dark:text-white' />\n </div>\n </td>\n );\n};\n\nexport const SpinnerCell = React.memo(_SpinnerCell);\n"],"names":["_SpinnerCell","width","size","jsx","cn","LoadingSpinnerIcon","SpinnerCell","React"],"mappings":"+OASMA,EAAe,CAAC,CAAE,MAAAC,EAAO,KAAAC,EAAO,MAElCC,EAAAA,IAAC,MAAG,UAAWC,EAAG,mDAAoDH,GAAS,MAAMA,CAAK,KAAK,EAC7F,SAAAE,EAAAA,IAAC,OAAI,UAAU,wCACb,eAACE,EAAAA,mBAAA,CAAmB,KAAMH,EAAK,EAAG,UAAU,8CAAA,CAA+C,CAAA,CAC7F,CAAA,CACF,EAISI,EAAcC,EAAM,KAAKP,CAAY"}
1
+ {"version":3,"file":"SpinnerCell.cjs.js","sources":["../../../../../../src/components/data-display/infinite-table/body/cell/SpinnerCell.tsx"],"sourcesContent":["import cn from 'classnames';\nimport React from 'react';\nimport { LoadingSpinnerIcon } from '../../../../icon';\n\ntype TProps = {\n width?: number;\n size?: number;\n};\n\nconst _SpinnerCell = ({ width, size = 24 }: TProps) => {\n return (\n <td className={cn('sticky left-0 right-0 bg-white dark:bg-black-800', width && `w-[${width}px]`)}>\n <div className='h-row flex items-center justify-center'>\n <LoadingSpinnerIcon size={size-4} className='inline my-2 text-neutral-600 dark:text-white' />\n </div>\n </td>\n );\n};\n\nexport const SpinnerCell = React.memo(_SpinnerCell);\n"],"names":["_SpinnerCell","width","size","jsx","cn","LoadingSpinnerIcon","SpinnerCell","React"],"mappings":"+OASMA,EAAe,CAAC,CAAE,MAAAC,EAAO,KAAAC,EAAO,MAElCC,EAAAA,IAAC,MAAG,UAAWC,EAAG,mDAAoDH,GAAS,MAAMA,CAAK,KAAK,EAC7F,SAAAE,EAAAA,IAAC,OAAI,UAAU,yCACb,eAACE,EAAAA,mBAAA,CAAmB,KAAMH,EAAK,EAAG,UAAU,8CAAA,CAA+C,CAAA,CAC7F,CAAA,CACF,EAISI,EAAcC,EAAM,KAAKP,CAAY"}
@@ -2,7 +2,7 @@ import { jsx as e } from "react/jsx-runtime";
2
2
  import i from "../../../../../_virtual/index.es.js";
3
3
  import n from "react";
4
4
  import { LoadingSpinnerIcon as m } from "../../../../icon/icons.generated.es.js";
5
- const c = ({ width: t, size: r = 24 }) => /* @__PURE__ */ e("td", { className: i("sticky left-0 right-0 bg-white dark:bg-black-800", t && `w-[${t}px]`), children: /* @__PURE__ */ e("div", { className: "h-10 flex items-center justify-center", children: /* @__PURE__ */ e(m, { size: r - 4, className: "inline my-2 text-neutral-600 dark:text-white" }) }) }), p = n.memo(c);
5
+ const o = ({ width: r, size: t = 24 }) => /* @__PURE__ */ e("td", { className: i("sticky left-0 right-0 bg-white dark:bg-black-800", r && `w-[${r}px]`), children: /* @__PURE__ */ e("div", { className: "h-row flex items-center justify-center", children: /* @__PURE__ */ e(m, { size: t - 4, className: "inline my-2 text-neutral-600 dark:text-white" }) }) }), p = n.memo(o);
6
6
  export {
7
7
  p as SpinnerCell
8
8
  };
@@ -1 +1 @@
1
- {"version":3,"file":"SpinnerCell.es.js","sources":["../../../../../../src/components/data-display/infinite-table/body/cell/SpinnerCell.tsx"],"sourcesContent":["import cn from 'classnames';\nimport React from 'react';\nimport { LoadingSpinnerIcon } from '../../../../icon';\n\ntype TProps = {\n width?: number;\n size?: number;\n};\n\nconst _SpinnerCell = ({ width, size = 24 }: TProps) => {\n return (\n <td className={cn('sticky left-0 right-0 bg-white dark:bg-black-800', width && `w-[${width}px]`)}>\n <div className='h-10 flex items-center justify-center'>\n <LoadingSpinnerIcon size={size-4} className='inline my-2 text-neutral-600 dark:text-white' />\n </div>\n </td>\n );\n};\n\nexport const SpinnerCell = React.memo(_SpinnerCell);\n"],"names":["_SpinnerCell","width","size","jsx","cn","LoadingSpinnerIcon","SpinnerCell","React"],"mappings":";;;;AASA,MAAMA,IAAe,CAAC,EAAE,OAAAC,GAAO,MAAAC,IAAO,SAElC,gBAAAC,EAAC,QAAG,WAAWC,EAAG,oDAAoDH,KAAS,MAAMA,CAAK,KAAK,GAC7F,UAAA,gBAAAE,EAAC,SAAI,WAAU,yCACb,4BAACE,GAAA,EAAmB,MAAMH,IAAK,GAAG,WAAU,+CAAA,CAA+C,EAAA,CAC7F,EAAA,CACF,GAISI,IAAcC,EAAM,KAAKP,CAAY;"}
1
+ {"version":3,"file":"SpinnerCell.es.js","sources":["../../../../../../src/components/data-display/infinite-table/body/cell/SpinnerCell.tsx"],"sourcesContent":["import cn from 'classnames';\nimport React from 'react';\nimport { LoadingSpinnerIcon } from '../../../../icon';\n\ntype TProps = {\n width?: number;\n size?: number;\n};\n\nconst _SpinnerCell = ({ width, size = 24 }: TProps) => {\n return (\n <td className={cn('sticky left-0 right-0 bg-white dark:bg-black-800', width && `w-[${width}px]`)}>\n <div className='h-row flex items-center justify-center'>\n <LoadingSpinnerIcon size={size-4} className='inline my-2 text-neutral-600 dark:text-white' />\n </div>\n </td>\n );\n};\n\nexport const SpinnerCell = React.memo(_SpinnerCell);\n"],"names":["_SpinnerCell","width","size","jsx","cn","LoadingSpinnerIcon","SpinnerCell","React"],"mappings":";;;;AASA,MAAMA,IAAe,CAAC,EAAE,OAAAC,GAAO,MAAAC,IAAO,SAElC,gBAAAC,EAAC,QAAG,WAAWC,EAAG,oDAAoDH,KAAS,MAAMA,CAAK,KAAK,GAC7F,UAAA,gBAAAE,EAAC,SAAI,WAAU,0CACb,4BAACE,GAAA,EAAmB,MAAMH,IAAK,GAAG,WAAU,+CAAA,CAA+C,EAAA,CAC7F,EAAA,CACF,GAISI,IAAcC,EAAM,KAAKP,CAAY;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),V=require("../../../../../utils/table.cjs.js"),A=require("../../../../../providers/design-system-provider/hooks.cjs.js"),D=require("../../../../layout/CustomScrollbar.cjs.js"),t=require("react"),Y=require("react-window"),H=require("../../context.cjs.js"),U=require("./row.cjs.js"),G=({onScroll:c,forwardedRef:i,style:u,children:p,dispatchEvent:f})=>{const[g,I]=t.useState(null),d=t.useCallback(h=>{const x=h;if(x){const C=x.getInstance;I(C),i(C?.view??x.view??null)}else i(null)},[i]);return t.useEffect(()=>{g&&f&&f("SET_SCROLLBAR_REF_FOR_INFINITY_TABLE",{scrollbarsInstance:g})},[g,f]),l.jsx(D.CustomScrollbar,{ref:d,style:{...u,overflow:"hidden"},onScroll:c,renderViewClassName:"!h-[calc(100%+5px)]",children:p})},J=t.forwardRef((c,i)=>{const u=A.useTableConfig();return l.jsx(G,{...c,forwardedRef:i,dispatchEvent:u?.dispatchEvent})}),K=({rows:c,prepareRow:i,isLoading:u,onScroll:p,columns:f,width:g,height:I,onScrolling:d,level:h=0,allowAstarSearch:x=!1})=>{const C=t.useRef(null),w=t.useRef(null),E=A.useTableConfig(),{tableWrapper:N,tableBodyWrapper:z,search:o,expandedRows:b,setActiveInlineEdit:T,activeInlineEdit:k,closeCurrencyDropdown:_,currencyDropdownConfig:j}=t.useContext(H.TableContext),R=t.useRef(E);R.current=E,t.useEffect(()=>{if(R.current?.onEvent)return R.current.onEvent("SET_SCROLLBAR_REF_FOR_INFINITY_TABLE",e=>{const{scrollbarsInstance:n}=e;C.current=n})},[E?.onEvent]);const S=t.useRef(null);t.useEffect(()=>{if(R.current?.onEvent)return R.current.onEvent("SCROLL_TO_TABLE_ROW",e=>{const{rowIndex:n}=e;S.current&&typeof n=="number"&&S.current.scrollToItem(n,"center")})},[E?.onEvent]);const m=t.useRef({}),v=t.useCallback((e,n)=>0,[b]),L=t.useCallback(()=>{const e={...m.current};for(const n of c){const r=n.original.id;if(b[r]?.isOpen){const y=v(r,0);e[n.index]=41*(y+1)}else e[n.index]=41}m.current=e,S.current?.resetAfterIndex(0)},[b,c,v]);t.useEffect(()=>{L()},[L]);const B=t.useCallback(e=>m.current[e]||41,[]),O=t.useCallback(e=>{u||e&&(w.current&&w.current.disconnect(),w.current=new IntersectionObserver(n=>{n[0].isIntersecting&&p&&p()},{threshold:1e-5}),w.current.observe(e))},[u,p,c.length]),F=e=>e.split(/(<span[^>]*>.*?<\/span>)/g).map((n,r)=>{if(n.startsWith("<span")){const s=n.replace(/<[^>]+>/g,"");return l.jsx("span",{className:"bg-yellow-300 dark:bg-primary-100 dark:text-black-900",children:s},r)}return l.jsx("span",{children:n},r)}),W=t.useCallback(e=>{if(!o||!e||typeof e!="string"&&typeof e!="number")return e;const n=V.escapeRegExp(o);if(o.includes("*")){const r=o.replace(/[.+?^${}()|[\]\\]/g,"\\$&");let s;if(o.startsWith("*")&&o.endsWith("*")){const a=r.slice(1,-1).replace(/\*/g,".*");s=new RegExp(`(${a})`,"gi")}else if(o.startsWith("*")){const a=r.slice(1).replace(/\*/g,".*");s=new RegExp(`(${a})$`,"gi")}else if(o.endsWith("*")){const a=r.slice(0,-1).replace(/\*/g,".*");s=new RegExp(`^(${a})`,"gi")}else{const a=r.replace(/\*/g,".*");s=new RegExp(`^(${a})$`,"gi")}const y=e?.toString().replace(s,a=>`<span class="highlight">${a}</span>`);return l.jsx("span",{children:F(y)})}else{const r=new RegExp(`(${n?.trim()})`,"gi"),s=e?.toString()?.split(r);return l.jsxs("span",{className:"overflow-clip text-ellipsis",children:[s[0],l.jsx("span",{className:"bg-yellow-300 dark:bg-primary-100 dark:text-black-900",children:s[1]}),s?.slice(2)?.join("")]})}},[o]),P=t.useCallback(({index:e,style:n})=>{const r=c[e];if(!r)return l.jsx("span",{children:"Loading"});const s=!u&&e>=c.length-6;return i(r),l.jsx(U.Row,{row:r,isLastRow:s,lastRow:O,prepareRow:i,highlightSubstring:W,index:e,style:n,rowsLength:c.length,level:h||r?.original?.__level,columns:f,expandedRows:b,rows:c})},[f,c,u,O,i,b,W,h]),$=t.useRef(k);$.current=k;const q=t.useRef(!!j);q.current=!!j;const M=t.useCallback(e=>{e.scrollUpdateWasRequested||($.current&&T?.(null),q.current&&_?.()),d&&d(e)},[d,T,_]);return l.jsx(Y.VariableSizeList,{outerElementType:J,width:g-2,height:I-2,ref:S,innerElementType:h?z:N,itemCount:c.length,itemSize:B,layout:"vertical",overscanCount:20,onScroll:M,children:P})};exports.Rows=K;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),U=require("../../../../../utils/table.cjs.js"),z=require("../../../../../providers/design-system-provider/hooks.cjs.js"),G=require("../../../../layout/CustomScrollbar.cjs.js"),t=require("react"),J=require("react-window"),K=require("../../context.cjs.js"),Q=require("./row.cjs.js"),H=require("../../useRowHeight.cjs.js"),X=({onScroll:c,forwardedRef:l,style:u,children:g,dispatchEvent:f})=>{const[p,m]=t.useState(null),h=t.useCallback(d=>{const x=d;if(x){const C=x.getInstance;m(C),l(C?.view??x.view??null)}else l(null)},[l]);return t.useEffect(()=>{p&&f&&f("SET_SCROLLBAR_REF_FOR_INFINITY_TABLE",{scrollbarsInstance:p})},[p,f]),o.jsx(G.CustomScrollbar,{ref:h,style:{...u,overflow:"hidden"},onScroll:c,renderViewClassName:"!h-[calc(100%+5px)]",children:g})},Z=t.forwardRef((c,l)=>{const u=z.useTableConfig();return o.jsx(X,{...c,forwardedRef:l,dispatchEvent:u?.dispatchEvent})}),ee=({rows:c,prepareRow:l,isLoading:u,onScroll:g,columns:f,width:p,height:m,onScrolling:h,level:d=0,allowAstarSearch:x=!1})=>{const C=t.useRef(null),E=t.useRef(null),S=z.useTableConfig(),{tableWrapper:B,tableBodyWrapper:F,search:i,expandedRows:R,setActiveInlineEdit:k,activeInlineEdit:_,closeCurrencyDropdown:j,currencyDropdownConfig:v}=t.useContext(K.TableContext),b=t.useRef(S);b.current=S,t.useEffect(()=>{if(b.current?.onEvent)return b.current.onEvent("SET_SCROLLBAR_REF_FOR_INFINITY_TABLE",e=>{const{scrollbarsInstance:n}=e;C.current=n})},[S?.onEvent]);const I=t.useRef(null);t.useEffect(()=>{if(b.current?.onEvent)return b.current.onEvent("SCROLL_TO_TABLE_ROW",e=>{const{rowIndex:n}=e;I.current&&typeof n=="number"&&I.current.scrollToItem(n,"center")})},[S?.onEvent]);const y=t.useRef({}),P=H.useRowHeight(),w=H.getRowSlotHeight(P),L=t.useRef(w);L.current=w;const O=t.useCallback((e,n)=>0,[R]),W=t.useCallback(()=>{const e={...y.current};for(const n of c){const r=n.original.id;if(R[r]?.isOpen){const T=O(r,0);e[n.index]=w*(T+1)}else e[n.index]=w*1}y.current=e,I.current?.resetAfterIndex(0)},[R,c,O,w]);t.useEffect(()=>{W()},[W]);const M=t.useCallback(e=>y.current[e]||L.current,[]),$=t.useCallback(e=>{u||e&&(E.current&&E.current.disconnect(),E.current=new IntersectionObserver(n=>{n[0].isIntersecting&&g&&g()},{threshold:1e-5}),E.current.observe(e))},[u,g,c.length]),V=e=>e.split(/(<span[^>]*>.*?<\/span>)/g).map((n,r)=>{if(n.startsWith("<span")){const s=n.replace(/<[^>]+>/g,"");return o.jsx("span",{className:"bg-yellow-300 dark:bg-primary-100 dark:text-black-900",children:s},r)}return o.jsx("span",{children:n},r)}),q=t.useCallback(e=>{if(!i||!e||typeof e!="string"&&typeof e!="number")return e;const n=U.escapeRegExp(i);if(i.includes("*")){const r=i.replace(/[.+?^${}()|[\]\\]/g,"\\$&");let s;if(i.startsWith("*")&&i.endsWith("*")){const a=r.slice(1,-1).replace(/\*/g,".*");s=new RegExp(`(${a})`,"gi")}else if(i.startsWith("*")){const a=r.slice(1).replace(/\*/g,".*");s=new RegExp(`(${a})$`,"gi")}else if(i.endsWith("*")){const a=r.slice(0,-1).replace(/\*/g,".*");s=new RegExp(`^(${a})`,"gi")}else{const a=r.replace(/\*/g,".*");s=new RegExp(`^(${a})$`,"gi")}const T=e?.toString().replace(s,a=>`<span class="highlight">${a}</span>`);return o.jsx("span",{children:V(T)})}else{const r=new RegExp(`(${n?.trim()})`,"gi"),s=e?.toString()?.split(r);return o.jsxs("span",{className:"overflow-clip text-ellipsis",children:[s[0],o.jsx("span",{className:"bg-yellow-300 dark:bg-primary-100 dark:text-black-900",children:s[1]}),s?.slice(2)?.join("")]})}},[i]),D=t.useCallback(({index:e,style:n})=>{const r=c[e];if(!r)return o.jsx("span",{children:"Loading"});const s=!u&&e>=c.length-6;return l(r),o.jsx(Q.Row,{row:r,isLastRow:s,lastRow:$,prepareRow:l,highlightSubstring:q,index:e,style:n,rowsLength:c.length,level:d||r?.original?.__level,columns:f,expandedRows:R,rows:c})},[f,c,u,$,l,R,q,d]),A=t.useRef(_);A.current=_;const N=t.useRef(!!v);N.current=!!v;const Y=t.useCallback(e=>{e.scrollUpdateWasRequested||(A.current&&k?.(null),N.current&&j?.()),h&&h(e)},[h,k,j]);return o.jsx(J.VariableSizeList,{outerElementType:Z,width:p-2,height:m-2,ref:I,innerElementType:d?F:B,itemCount:c.length,itemSize:M,layout:"vertical",overscanCount:20,onScroll:Y,children:D})};exports.Rows=ee;
2
2
  //# sourceMappingURL=index.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../../../../../../src/components/data-display/infinite-table/body/rows/index.tsx"],"sourcesContent":["import { escapeRegExp } from '../../../../../utils/table';\nimport { useTableConfig } from '../../../../../providers/design-system-provider/hooks';\nimport { CustomScrollbar } from '../../../../layout/CustomScrollbar';\nimport React, { forwardRef, useCallback, useContext, useEffect, useRef, useState } from 'react';\nimport { VariableSizeList } from 'react-window';\nimport type { ListOnScrollProps } from 'react-window';\n\nimport { TableContext } from '../../context';\nimport { Row } from './row';\n\ninterface TableRow {\n original: Record<string, unknown>;\n index: number;\n [key: string]: unknown;\n}\n\ninterface CustomScrollbarsProps {\n onScroll?: (e: React.UIEvent) => void;\n forwardedRef: (node: HTMLElement | null) => void;\n style?: React.CSSProperties;\n children?: React.ReactNode;\n dispatchEvent?: (eventName: string, payload: Record<string, unknown>) => void;\n}\n\nconst CustomScrollbars = ({ onScroll, forwardedRef, style, children, dispatchEvent }: CustomScrollbarsProps) => {\n const [scrollbarsInstance, setScrollbarInstance] = useState<unknown>(null);\n const refSetter = useCallback(\n (scrollbarsRef: unknown) => {\n const ref = scrollbarsRef as { getInstance?: { view?: HTMLElement }; view?: HTMLElement } | null;\n if (ref) {\n const instance = ref.getInstance;\n setScrollbarInstance(instance);\n forwardedRef(instance?.view ?? ref.view ?? null);\n } else {\n forwardedRef(null);\n }\n },\n [forwardedRef],\n );\n\n useEffect(() => {\n if (scrollbarsInstance && dispatchEvent) {\n dispatchEvent('SET_SCROLLBAR_REF_FOR_INFINITY_TABLE', { scrollbarsInstance });\n }\n }, [scrollbarsInstance, dispatchEvent]);\n\n return (\n <CustomScrollbar ref={refSetter} style={{ ...style, overflow: 'hidden' }} onScroll={onScroll} renderViewClassName='!h-[calc(100%+5px)]'>\n {children}\n </CustomScrollbar>\n );\n};\n\nconst CustomScrollbarsVirtualList = forwardRef((props: Record<string, unknown>, ref: React.Ref<HTMLElement>) => {\n const tableConfig = useTableConfig();\n return <CustomScrollbars {...(props as unknown as CustomScrollbarsProps)} forwardedRef={ref as (node: HTMLElement | null) => void} dispatchEvent={tableConfig?.dispatchEvent} />;\n});\n\ninterface RowsProps {\n rows: TableRow[];\n prepareRow: (row: TableRow) => void;\n isLoading: boolean;\n onScroll?: () => void;\n columns: unknown[];\n width: number;\n height: number;\n onScrolling?: (value: ListOnScrollProps) => void;\n level?: number;\n allowAstarSearch?: boolean;\n}\n\nexport const Rows = ({ rows, prepareRow, isLoading, onScroll, columns, width, height, onScrolling, level = 0, allowAstarSearch = false }: RowsProps) => {\n void allowAstarSearch;\n const scrollbarRef = useRef<unknown>(null);\n const observer = useRef<IntersectionObserver | null>(null);\n const tableConfig = useTableConfig();\n const {\n tableWrapper,\n tableBodyWrapper,\n search,\n expandedRows,\n setActiveInlineEdit,\n activeInlineEdit,\n closeCurrencyDropdown,\n currencyDropdownConfig,\n } = useContext(TableContext);\n\n const tableConfigRef = useRef(tableConfig);\n tableConfigRef.current = tableConfig;\n\n useEffect(() => {\n if (!tableConfigRef.current?.onEvent) return;\n return tableConfigRef.current.onEvent('SET_SCROLLBAR_REF_FOR_INFINITY_TABLE', (payload: unknown) => {\n const { scrollbarsInstance } = payload as { scrollbarsInstance: unknown };\n scrollbarRef.current = scrollbarsInstance;\n });\n }, [tableConfig?.onEvent]);\n\n const listRef = useRef<VariableSizeList>(null);\n\n useEffect(() => {\n if (!tableConfigRef.current?.onEvent) return;\n return tableConfigRef.current.onEvent('SCROLL_TO_TABLE_ROW', (payload: unknown) => {\n const { rowIndex } = payload as { rowIndex: number };\n if (listRef.current && typeof rowIndex === 'number') {\n listRef.current.scrollToItem(rowIndex, 'center');\n }\n });\n }, [tableConfig?.onEvent]);\n\n const sizeMap = useRef<Record<number, number>>({});\n\n const calculateRowHeightWithChildren = useCallback((rowId: string | number, rowCounts: number): number => {\n return 0;\n\n const children = expandedRows[rowId];\n if (!children?.isOpen) return rowCounts;\n if (children?.isOpen) {\n rowCounts += children.data.length;\n for (const child of children.data) {\n rowCounts = calculateRowHeightWithChildren(child.id, rowCounts);\n }\n }\n return rowCounts;\n }, [expandedRows]);\n\n const setMultipleRowSize = useCallback(() => {\n const newSizeMap: Record<number, number> = { ...sizeMap.current };\n\n for (const row of rows) {\n const rowId = row.original.id as string | number;\n const children = expandedRows[rowId];\n if (children?.isOpen) {\n const additionalRowCounts = calculateRowHeightWithChildren(rowId, 0);\n newSizeMap[row.index] = (40 + 1) * (additionalRowCounts + 1);\n } else {\n newSizeMap[row.index] = (40 + 1) * 1;\n }\n }\n\n sizeMap.current = newSizeMap;\n listRef.current?.resetAfterIndex(0);\n }, [expandedRows, rows, calculateRowHeightWithChildren]);\n\n useEffect(() => {\n setMultipleRowSize();\n }, [setMultipleRowSize]);\n\n const getSize = useCallback((index: number) => {\n return sizeMap.current[index] || 40 + 1;\n }, []);\n\n const lastRow = useCallback(\n (node: HTMLElement | null) => {\n if (isLoading) return;\n if (!node) return;\n if (observer.current) observer.current.disconnect();\n observer.current = new IntersectionObserver(\n (entries) => {\n if (entries[0].isIntersecting) {\n if (onScroll) onScroll();\n }\n },\n { threshold: 0.00001 },\n );\n observer.current.observe(node);\n },\n [isLoading, onScroll, rows.length],\n );\n\n const parseString = (input: string) =>\n input.split(/(<span[^>]*>.*?<\\/span>)/g).map((segment: string, index: number) => {\n if (segment.startsWith('<span')) {\n const value = segment.replace(/<[^>]+>/g, '');\n return (\n <span key={index} className='bg-yellow-300 dark:bg-primary-100 dark:text-black-900'>\n {value}\n </span>\n );\n }\n return <span key={index}>{segment}</span>;\n });\n\n const highlightSubstring = useCallback((value: string | number | null | undefined): JSX.Element | string | number | null | undefined => {\n if (!search) return value;\n if (!value || (typeof value !== 'string' && typeof value !== 'number')) return value;\n const escapedSearch = escapeRegExp(search);\n\n if (search.includes('*')) {\n const escapedPattern = search.replace(/[.+?^${}()|[\\]\\\\]/g, '\\\\$&');\n let regex;\n if (search.startsWith('*') && search.endsWith('*')) {\n const middlePattern = escapedPattern.slice(1, -1).replace(/\\*/g, '.*');\n regex = new RegExp(`(${middlePattern})`, 'gi');\n } else if (search.startsWith('*')) {\n const endPattern = escapedPattern.slice(1).replace(/\\*/g, '.*');\n regex = new RegExp(`(${endPattern})$`, 'gi');\n } else if (search.endsWith('*')) {\n const startPattern = escapedPattern.slice(0, -1).replace(/\\*/g, '.*');\n regex = new RegExp(`^(${startPattern})`, 'gi');\n } else {\n const exactPattern = escapedPattern.replace(/\\*/g, '.*');\n regex = new RegExp(`^(${exactPattern})$`, 'gi');\n }\n\n const highlightedText = value?.toString().replace(regex, (match) => `<span class=\"highlight\">${match}</span>`);\n return <span>{parseString(highlightedText)}</span>;\n } else {\n const regex = new RegExp(`(${escapedSearch?.trim()})`, 'gi');\n const searchValue = value?.toString()?.split(regex);\n return (\n <span className='overflow-clip text-ellipsis'>\n {searchValue[0]}\n <span className='bg-yellow-300 dark:bg-primary-100 dark:text-black-900'>{searchValue[1]}</span>\n {searchValue?.slice(2)?.join('')}\n </span>\n );\n }\n }, [search]);\n\n const RenderRow = useCallback(\n ({ index, style }: { index: number; style: React.CSSProperties }) => {\n const row = rows[index];\n if (!row) return <span>Loading</span>;\n const isLastRow = !isLoading && index >= rows.length - 6;\n prepareRow(row);\n\n return (\n <Row\n {...({\n row,\n isLastRow,\n lastRow,\n prepareRow,\n highlightSubstring,\n index,\n style,\n rowsLength: rows.length,\n level: level || row?.original?.__level,\n columns,\n expandedRows,\n rows,\n } as unknown as React.ComponentProps<typeof Row>)}\n />\n );\n },\n [columns, rows, isLoading, lastRow, prepareRow, expandedRows, highlightSubstring, level],\n );\n\n const activeInlineEditRef = useRef(activeInlineEdit);\n activeInlineEditRef.current = activeInlineEdit;\n\n const currencyDropdownOpenRef = useRef(!!currencyDropdownConfig);\n currencyDropdownOpenRef.current = !!currencyDropdownConfig;\n\n const handleScroll = useCallback(\n (value: ListOnScrollProps) => {\n if (!value.scrollUpdateWasRequested) {\n if (activeInlineEditRef.current) setActiveInlineEdit?.(null);\n if (currencyDropdownOpenRef.current) closeCurrencyDropdown?.();\n }\n if (onScrolling) onScrolling(value);\n },\n [onScrolling, setActiveInlineEdit, closeCurrencyDropdown],\n );\n\n return (\n <VariableSizeList\n outerElementType={CustomScrollbarsVirtualList}\n width={width - 2}\n height={height - 2}\n ref={listRef}\n innerElementType={level ? tableBodyWrapper : tableWrapper}\n itemCount={rows.length}\n itemSize={getSize}\n layout='vertical'\n overscanCount={20}\n onScroll={handleScroll}\n >\n {RenderRow}\n </VariableSizeList>\n );\n};\n"],"names":["CustomScrollbars","onScroll","forwardedRef","style","children","dispatchEvent","scrollbarsInstance","setScrollbarInstance","useState","refSetter","useCallback","scrollbarsRef","ref","instance","useEffect","jsx","CustomScrollbar","CustomScrollbarsVirtualList","forwardRef","props","tableConfig","useTableConfig","Rows","rows","prepareRow","isLoading","columns","width","height","onScrolling","level","allowAstarSearch","scrollbarRef","useRef","observer","tableWrapper","tableBodyWrapper","search","expandedRows","setActiveInlineEdit","activeInlineEdit","closeCurrencyDropdown","currencyDropdownConfig","useContext","TableContext","tableConfigRef","payload","listRef","rowIndex","sizeMap","calculateRowHeightWithChildren","rowId","rowCounts","setMultipleRowSize","newSizeMap","row","additionalRowCounts","getSize","index","lastRow","node","entries","parseString","input","segment","value","highlightSubstring","escapedSearch","escapeRegExp","escapedPattern","regex","middlePattern","endPattern","startPattern","exactPattern","highlightedText","match","searchValue","jsxs","RenderRow","isLastRow","Row","activeInlineEditRef","currencyDropdownOpenRef","handleScroll","VariableSizeList"],"mappings":"8YAwBMA,EAAmB,CAAC,CAAE,SAAAC,EAAU,aAAAC,EAAc,MAAAC,EAAO,SAAAC,EAAU,cAAAC,KAA2C,CAC9G,KAAM,CAACC,EAAoBC,CAAoB,EAAIC,EAAAA,SAAkB,IAAI,EACnEC,EAAYC,EAAAA,YACfC,GAA2B,CAC1B,MAAMC,EAAMD,EACZ,GAAIC,EAAK,CACP,MAAMC,EAAWD,EAAI,YACrBL,EAAqBM,CAAQ,EAC7BX,EAAaW,GAAU,MAAQD,EAAI,MAAQ,IAAI,CACjD,MACEV,EAAa,IAAI,CAErB,EACA,CAACA,CAAY,CAAA,EAGfY,OAAAA,EAAAA,UAAU,IAAM,CACVR,GAAsBD,GACxBA,EAAc,uCAAwC,CAAE,mBAAAC,EAAo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,IAAI,EACvD4C,EAAwB,SAAS1C,IAAA,GAEnCZ,KAAyBoC,CAAK,CACpC,EACA,CAACpC,EAAaU,EAAqBE,CAAqB,CAAA,EAG1D,OACE1B,EAAAA,IAACsE,EAAAA,iBAAA,CACC,iBAAkBpE,EAClB,MAAOU,EAAQ,EACf,OAAQC,EAAS,EACjB,IAAKmB,EACL,iBAAkBjB,EAAQM,EAAmBD,EAC7C,UAAWZ,EAAK,OAChB,SAAUkC,EACV,OAAO,WACP,cAAe,GACf,SAAU2B,EAET,SAAAL,CAAA,CAAA,CAGP"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../../../../../../src/components/data-display/infinite-table/body/rows/index.tsx"],"sourcesContent":["import { escapeRegExp } from '../../../../../utils/table';\nimport { useTableConfig } from '../../../../../providers/design-system-provider/hooks';\nimport { CustomScrollbar } from '../../../../layout/CustomScrollbar';\nimport React, { forwardRef, useCallback, useContext, useEffect, useRef, useState } from 'react';\nimport { VariableSizeList } from 'react-window';\nimport type { ListOnScrollProps } from 'react-window';\n\nimport { TableContext } from '../../context';\nimport { Row } from './row';\nimport { getRowSlotHeight, useRowHeight } from '../../useRowHeight';\n\ninterface TableRow {\n original: Record<string, unknown>;\n index: number;\n [key: string]: unknown;\n}\n\ninterface CustomScrollbarsProps {\n onScroll?: (e: React.UIEvent) => void;\n forwardedRef: (node: HTMLElement | null) => void;\n style?: React.CSSProperties;\n children?: React.ReactNode;\n dispatchEvent?: (eventName: string, payload: Record<string, unknown>) => void;\n}\n\nconst CustomScrollbars = ({ onScroll, forwardedRef, style, children, dispatchEvent }: CustomScrollbarsProps) => {\n const [scrollbarsInstance, setScrollbarInstance] = useState<unknown>(null);\n const refSetter = useCallback(\n (scrollbarsRef: unknown) => {\n const ref = scrollbarsRef as { getInstance?: { view?: HTMLElement }; view?: HTMLElement } | null;\n if (ref) {\n const instance = ref.getInstance;\n setScrollbarInstance(instance);\n forwardedRef(instance?.view ?? ref.view ?? null);\n } else {\n forwardedRef(null);\n }\n },\n [forwardedRef],\n );\n\n useEffect(() => {\n if (scrollbarsInstance && dispatchEvent) {\n dispatchEvent('SET_SCROLLBAR_REF_FOR_INFINITY_TABLE', { scrollbarsInstance });\n }\n }, [scrollbarsInstance, dispatchEvent]);\n\n return (\n <CustomScrollbar ref={refSetter} style={{ ...style, overflow: 'hidden' }} onScroll={onScroll} renderViewClassName='!h-[calc(100%+5px)]'>\n {children}\n </CustomScrollbar>\n );\n};\n\nconst CustomScrollbarsVirtualList = forwardRef((props: Record<string, unknown>, ref: React.Ref<HTMLElement>) => {\n const tableConfig = useTableConfig();\n return <CustomScrollbars {...(props as unknown as CustomScrollbarsProps)} forwardedRef={ref as (node: HTMLElement | null) => void} dispatchEvent={tableConfig?.dispatchEvent} />;\n});\n\ninterface RowsProps {\n rows: TableRow[];\n prepareRow: (row: TableRow) => void;\n isLoading: boolean;\n onScroll?: () => void;\n columns: unknown[];\n width: number;\n height: number;\n onScrolling?: (value: ListOnScrollProps) => void;\n level?: number;\n allowAstarSearch?: boolean;\n}\n\nexport const Rows = ({ rows, prepareRow, isLoading, onScroll, columns, width, height, onScrolling, level = 0, allowAstarSearch = false }: RowsProps) => {\n void allowAstarSearch;\n const scrollbarRef = useRef<unknown>(null);\n const observer = useRef<IntersectionObserver | null>(null);\n const tableConfig = useTableConfig();\n const {\n tableWrapper,\n tableBodyWrapper,\n search,\n expandedRows,\n setActiveInlineEdit,\n activeInlineEdit,\n closeCurrencyDropdown,\n currencyDropdownConfig,\n } = useContext(TableContext);\n\n const tableConfigRef = useRef(tableConfig);\n tableConfigRef.current = tableConfig;\n\n useEffect(() => {\n if (!tableConfigRef.current?.onEvent) return;\n return tableConfigRef.current.onEvent('SET_SCROLLBAR_REF_FOR_INFINITY_TABLE', (payload: unknown) => {\n const { scrollbarsInstance } = payload as { scrollbarsInstance: unknown };\n scrollbarRef.current = scrollbarsInstance;\n });\n }, [tableConfig?.onEvent]);\n\n const listRef = useRef<VariableSizeList>(null);\n\n useEffect(() => {\n if (!tableConfigRef.current?.onEvent) return;\n return tableConfigRef.current.onEvent('SCROLL_TO_TABLE_ROW', (payload: unknown) => {\n const { rowIndex } = payload as { rowIndex: number };\n if (listRef.current && typeof rowIndex === 'number') {\n listRef.current.scrollToItem(rowIndex, 'center');\n }\n });\n }, [tableConfig?.onEvent]);\n\n const sizeMap = useRef<Record<number, number>>({});\n\n // Row height tracks the `h-row` viewport clamp; keep a ref so `getSize` (stable\n // identity for react-window) always reads the latest measured value.\n const rowHeight = useRowHeight();\n const rowSlotHeight = getRowSlotHeight(rowHeight);\n const rowSlotHeightRef = useRef(rowSlotHeight);\n rowSlotHeightRef.current = rowSlotHeight;\n\n const calculateRowHeightWithChildren = useCallback((rowId: string | number, rowCounts: number): number => {\n return 0;\n\n const children = expandedRows[rowId];\n if (!children?.isOpen) return rowCounts;\n if (children?.isOpen) {\n rowCounts += children.data.length;\n for (const child of children.data) {\n rowCounts = calculateRowHeightWithChildren(child.id, rowCounts);\n }\n }\n return rowCounts;\n }, [expandedRows]);\n\n const setMultipleRowSize = useCallback(() => {\n const newSizeMap: Record<number, number> = { ...sizeMap.current };\n\n for (const row of rows) {\n const rowId = row.original.id as string | number;\n const children = expandedRows[rowId];\n if (children?.isOpen) {\n const additionalRowCounts = calculateRowHeightWithChildren(rowId, 0);\n newSizeMap[row.index] = rowSlotHeight * (additionalRowCounts + 1);\n } else {\n newSizeMap[row.index] = rowSlotHeight * 1;\n }\n }\n\n sizeMap.current = newSizeMap;\n listRef.current?.resetAfterIndex(0);\n }, [expandedRows, rows, calculateRowHeightWithChildren, rowSlotHeight]);\n\n useEffect(() => {\n setMultipleRowSize();\n }, [setMultipleRowSize]);\n\n const getSize = useCallback((index: number) => {\n return sizeMap.current[index] || rowSlotHeightRef.current;\n }, []);\n\n const lastRow = useCallback(\n (node: HTMLElement | null) => {\n if (isLoading) return;\n if (!node) return;\n if (observer.current) observer.current.disconnect();\n observer.current = new IntersectionObserver(\n (entries) => {\n if (entries[0].isIntersecting) {\n if (onScroll) onScroll();\n }\n },\n { threshold: 0.00001 },\n );\n observer.current.observe(node);\n },\n [isLoading, onScroll, rows.length],\n );\n\n const parseString = (input: string) =>\n input.split(/(<span[^>]*>.*?<\\/span>)/g).map((segment: string, index: number) => {\n if (segment.startsWith('<span')) {\n const value = segment.replace(/<[^>]+>/g, '');\n return (\n <span key={index} className='bg-yellow-300 dark:bg-primary-100 dark:text-black-900'>\n {value}\n </span>\n );\n }\n return <span key={index}>{segment}</span>;\n });\n\n const highlightSubstring = useCallback((value: string | number | null | undefined): JSX.Element | string | number | null | undefined => {\n if (!search) return value;\n if (!value || (typeof value !== 'string' && typeof value !== 'number')) return value;\n const escapedSearch = escapeRegExp(search);\n\n if (search.includes('*')) {\n const escapedPattern = search.replace(/[.+?^${}()|[\\]\\\\]/g, '\\\\$&');\n let regex;\n if (search.startsWith('*') && search.endsWith('*')) {\n const middlePattern = escapedPattern.slice(1, -1).replace(/\\*/g, '.*');\n regex = new RegExp(`(${middlePattern})`, 'gi');\n } else if (search.startsWith('*')) {\n const endPattern = escapedPattern.slice(1).replace(/\\*/g, '.*');\n regex = new RegExp(`(${endPattern})$`, 'gi');\n } else if (search.endsWith('*')) {\n const startPattern = escapedPattern.slice(0, -1).replace(/\\*/g, '.*');\n regex = new RegExp(`^(${startPattern})`, 'gi');\n } else {\n const exactPattern = escapedPattern.replace(/\\*/g, '.*');\n regex = new RegExp(`^(${exactPattern})$`, 'gi');\n }\n\n const highlightedText = value?.toString().replace(regex, (match) => `<span class=\"highlight\">${match}</span>`);\n return <span>{parseString(highlightedText)}</span>;\n } else {\n const regex = new RegExp(`(${escapedSearch?.trim()})`, 'gi');\n const searchValue = value?.toString()?.split(regex);\n return (\n <span className='overflow-clip text-ellipsis'>\n {searchValue[0]}\n <span className='bg-yellow-300 dark:bg-primary-100 dark:text-black-900'>{searchValue[1]}</span>\n {searchValue?.slice(2)?.join('')}\n </span>\n );\n }\n }, [search]);\n\n const RenderRow = useCallback(\n ({ index, style }: { index: number; style: React.CSSProperties }) => {\n const row = rows[index];\n if (!row) return <span>Loading</span>;\n const isLastRow = !isLoading && index >= rows.length - 6;\n prepareRow(row);\n\n return (\n <Row\n {...({\n row,\n isLastRow,\n lastRow,\n prepareRow,\n highlightSubstring,\n index,\n style,\n rowsLength: rows.length,\n level: level || row?.original?.__level,\n columns,\n expandedRows,\n rows,\n } as unknown as React.ComponentProps<typeof Row>)}\n />\n );\n },\n [columns, rows, isLoading, lastRow, prepareRow, expandedRows, highlightSubstring, level],\n );\n\n const activeInlineEditRef = useRef(activeInlineEdit);\n activeInlineEditRef.current = activeInlineEdit;\n\n const currencyDropdownOpenRef = useRef(!!currencyDropdownConfig);\n currencyDropdownOpenRef.current = !!currencyDropdownConfig;\n\n const handleScroll = useCallback(\n (value: ListOnScrollProps) => {\n if (!value.scrollUpdateWasRequested) {\n if (activeInlineEditRef.current) setActiveInlineEdit?.(null);\n if (currencyDropdownOpenRef.current) closeCurrencyDropdown?.();\n }\n if (onScrolling) onScrolling(value);\n },\n [onScrolling, setActiveInlineEdit, closeCurrencyDropdown],\n );\n\n return (\n <VariableSizeList\n outerElementType={CustomScrollbarsVirtualList}\n width={width - 2}\n height={height - 2}\n ref={listRef}\n innerElementType={level ? tableBodyWrapper : tableWrapper}\n itemCount={rows.length}\n itemSize={getSize}\n layout='vertical'\n overscanCount={20}\n onScroll={handleScroll}\n >\n {RenderRow}\n </VariableSizeList>\n );\n};\n"],"names":["CustomScrollbars","onScroll","forwardedRef","style","children","dispatchEvent","scrollbarsInstance","setScrollbarInstance","useState","refSetter","useCallback","scrollbarsRef","ref","instance","useEffect","jsx","CustomScrollbar","CustomScrollbarsVirtualList","forwardRef","props","tableConfig","useTableConfig","Rows","rows","prepareRow","isLoading","columns","width","height","onScrolling","level","allowAstarSearch","scrollbarRef","useRef","observer","tableWrapper","tableBodyWrapper","search","expandedRows","setActiveInlineEdit","activeInlineEdit","closeCurrencyDropdown","currencyDropdownConfig","useContext","TableContext","tableConfigRef","payload","listRef","rowIndex","sizeMap","rowHeight","useRowHeight","rowSlotHeight","getRowSlotHeight","rowSlotHeightRef","calculateRowHeightWithChildren","rowId","rowCounts","setMultipleRowSize","newSizeMap","row","additionalRowCounts","getSize","index","lastRow","node","entries","parseString","input","segment","value","highlightSubstring","escapedSearch","escapeRegExp","escapedPattern","regex","middlePattern","endPattern","startPattern","exactPattern","highlightedText","match","searchValue","jsxs","RenderRow","isLastRow","Row","activeInlineEditRef","currencyDropdownOpenRef","handleScroll","VariableSizeList"],"mappings":"qbAyBMA,EAAmB,CAAC,CAAE,SAAAC,EAAU,aAAAC,EAAc,MAAAC,EAAO,SAAAC,EAAU,cAAAC,KAA2C,CAC9G,KAAM,CAACC,EAAoBC,CAAoB,EAAIC,EAAAA,SAAkB,IAAI,EACnEC,EAAYC,EAAAA,YACfC,GAA2B,CAC1B,MAAMC,EAAMD,EACZ,GAAIC,EAAK,CACP,MAAMC,EAAWD,EAAI,YACrBL,EAAqBM,CAAQ,EAC7BX,EAAaW,GAAU,MAAQD,EAAI,MAAQ,IAAI,CACjD,MACEV,EAAa,IAAI,CAErB,EACA,CAACA,CAAY,CAAA,EAGfY,OAAAA,EAAAA,UAAU,IAAM,CACVR,GAAsBD,GACxBA,EAAc,uCAAwC,CAAE,mBAAAC,EAAoB,CAEhF,EAAG,CAACA,EAAoBD,CAAa,CAAC,EAGpCU,EAAAA,IAACC,EAAAA,gBAAA,CAAgB,IAAKP,EAAW,MAAO,CAAE,GAAGN,EAAO,SAAU,QAAA,EAAY,SAAAF,EAAoB,oBAAoB,sBAC/G,SAAAG,EACH,CAEJ,EAEMa,EAA8BC,EAAAA,WAAW,CAACC,EAAgCP,IAAgC,CAC9G,MAAMQ,EAAcC,EAAAA,eAAA,EACpB,OAAON,EAAAA,IAACf,GAAkB,GAAImB,EAA4C,aAAcP,EAA2C,cAAeQ,GAAa,cAAe,CAChL,CAAC,EAeYE,GAAO,CAAC,CAAE,KAAAC,EAAM,WAAAC,EAAY,UAAAC,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