@elliemae/ds-data-table 3.51.0-next.1 → 3.51.0-next.11

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 (231) hide show
  1. package/dist/cjs/DSDataTableDefinitions.js +1 -1
  2. package/dist/cjs/DSDataTableDefinitions.js.map +1 -1
  3. package/dist/cjs/addons/Columns/ColumnExpand/ColumnExpand.js +15 -15
  4. package/dist/cjs/addons/Columns/ColumnExpand/ColumnExpand.js.map +2 -2
  5. package/dist/cjs/addons/Columns/ColumnSelectMultiple/ColumnSelectMultiple.js +21 -22
  6. package/dist/cjs/addons/Columns/ColumnSelectMultiple/ColumnSelectMultiple.js.map +2 -2
  7. package/dist/cjs/addons/Columns/ColumnSelectSingle/ColumnSelectSingle.js +5 -5
  8. package/dist/cjs/addons/Columns/ColumnSelectSingle/ColumnSelectSingle.js.map +2 -2
  9. package/dist/cjs/addons/Editables/ComboboxEditableCell/ComboboxEditableCell.js +3 -3
  10. package/dist/cjs/addons/Editables/ComboboxEditableCell/ComboboxEditableCell.js.map +2 -2
  11. package/dist/cjs/addons/Editables/DateEditableCell/DateEditableCell.js +2 -2
  12. package/dist/cjs/addons/Editables/DateEditableCell/DateEditableCell.js.map +2 -2
  13. package/dist/cjs/addons/Editables/TextEditableCell/TextEditableCell.js +3 -3
  14. package/dist/cjs/addons/Editables/TextEditableCell/TextEditableCell.js.map +2 -2
  15. package/dist/cjs/addons/Filters/Components/SelectFilter/BaseSelectFilter.js +2 -2
  16. package/dist/cjs/addons/Filters/Components/SelectFilter/BaseSelectFilter.js.map +2 -2
  17. package/dist/cjs/addons/Pagination/Pagination.js +5 -5
  18. package/dist/cjs/addons/Pagination/Pagination.js.map +2 -2
  19. package/dist/cjs/configs/useStore/createInternalAndPropsContext.js +40 -0
  20. package/dist/cjs/configs/useStore/createInternalAndPropsContext.js.map +7 -0
  21. package/dist/cjs/configs/useStore/index.js +5 -4
  22. package/dist/cjs/configs/useStore/index.js.map +2 -2
  23. package/dist/cjs/configs/useStore/useStore.js +7 -12
  24. package/dist/cjs/configs/useStore/useStore.js.map +2 -2
  25. package/dist/cjs/exported-related/EditableCell.js +4 -4
  26. package/dist/cjs/exported-related/EditableCell.js.map +2 -2
  27. package/dist/cjs/exported-related/FilterBar/FilterBarDropdownMenu.js +2 -2
  28. package/dist/cjs/exported-related/FilterBar/FilterBarDropdownMenu.js.map +2 -2
  29. package/dist/cjs/exported-related/FilterPopover/index.js +7 -7
  30. package/dist/cjs/exported-related/FilterPopover/index.js.map +2 -2
  31. package/dist/cjs/exported-related/FilterPopover/useGetFilterHandlers.js +4 -4
  32. package/dist/cjs/exported-related/FilterPopover/useGetFilterHandlers.js.map +2 -2
  33. package/dist/cjs/exported-related/RowRenderer/DefaultRowContentRenderer.js +11 -10
  34. package/dist/cjs/exported-related/RowRenderer/DefaultRowContentRenderer.js.map +2 -2
  35. package/dist/cjs/exported-related/RowRenderer/index.js +6 -6
  36. package/dist/cjs/exported-related/RowRenderer/index.js.map +2 -2
  37. package/dist/cjs/exported-related/RowRenderer/useRowRendererHandlers.js +12 -12
  38. package/dist/cjs/exported-related/RowRenderer/useRowRendererHandlers.js.map +2 -2
  39. package/dist/cjs/exported-related/RowRenderer/useRowRendererProperties.js +2 -2
  40. package/dist/cjs/exported-related/RowRenderer/useRowRendererProperties.js.map +2 -2
  41. package/dist/cjs/exported-related/RowRenderer/useRowStyle.js +2 -2
  42. package/dist/cjs/exported-related/RowRenderer/useRowStyle.js.map +2 -2
  43. package/dist/cjs/exported-related/Toolbar/Toolbar.js +6 -6
  44. package/dist/cjs/exported-related/Toolbar/Toolbar.js.map +2 -2
  45. package/dist/cjs/parts/Cells/Cell.js +17 -11
  46. package/dist/cjs/parts/Cells/Cell.js.map +2 -2
  47. package/dist/cjs/parts/Cells/CellFactory.js +11 -11
  48. package/dist/cjs/parts/Cells/CellFactory.js.map +2 -2
  49. package/dist/cjs/parts/Cells/index.js +2 -2
  50. package/dist/cjs/parts/Cells/index.js.map +2 -2
  51. package/dist/cjs/parts/Cells/useCellStyle.js +3 -3
  52. package/dist/cjs/parts/Cells/useCellStyle.js.map +2 -2
  53. package/dist/cjs/parts/DnDHandle.js +5 -5
  54. package/dist/cjs/parts/DnDHandle.js.map +2 -2
  55. package/dist/cjs/parts/DropIndicator.js +4 -4
  56. package/dist/cjs/parts/DropIndicator.js.map +2 -2
  57. package/dist/cjs/parts/EmptyContent.js +10 -10
  58. package/dist/cjs/parts/EmptyContent.js.map +2 -2
  59. package/dist/cjs/parts/FilterBar/DeprecatedDropdown.js +6 -1
  60. package/dist/cjs/parts/FilterBar/DeprecatedDropdown.js.map +2 -2
  61. package/dist/cjs/parts/FilterBar/FiltersBar.js +7 -7
  62. package/dist/cjs/parts/FilterBar/FiltersBar.js.map +2 -2
  63. package/dist/cjs/parts/Filters/index.js +5 -5
  64. package/dist/cjs/parts/Filters/index.js.map +2 -2
  65. package/dist/cjs/parts/Headers/EmptyChildrenGroup.js +2 -2
  66. package/dist/cjs/parts/Headers/EmptyChildrenGroup.js.map +2 -2
  67. package/dist/cjs/parts/Headers/HeaderCell.js +13 -13
  68. package/dist/cjs/parts/Headers/HeaderCell.js.map +2 -2
  69. package/dist/cjs/parts/Headers/HeaderCellGroup.js +10 -10
  70. package/dist/cjs/parts/Headers/HeaderCellGroup.js.map +2 -2
  71. package/dist/cjs/parts/Headers/HeaderResizer.js +2 -2
  72. package/dist/cjs/parts/Headers/HeaderResizer.js.map +2 -2
  73. package/dist/cjs/parts/Headers/index.js +8 -8
  74. package/dist/cjs/parts/Headers/index.js.map +2 -2
  75. package/dist/cjs/parts/Headers/useHeaderCellConfig.js +4 -4
  76. package/dist/cjs/parts/Headers/useHeaderCellConfig.js.map +2 -2
  77. package/dist/cjs/parts/Headers/useHeaderCellHandlers.js +7 -7
  78. package/dist/cjs/parts/Headers/useHeaderCellHandlers.js.map +2 -2
  79. package/dist/cjs/parts/Headers/useHeaderResizer.js +8 -8
  80. package/dist/cjs/parts/Headers/useHeaderResizer.js.map +2 -2
  81. package/dist/cjs/parts/HoC/DnDGroupContext.js +39 -0
  82. package/dist/cjs/parts/HoC/DnDGroupContext.js.map +7 -0
  83. package/dist/cjs/parts/HoC/withConditionalDnDColumnContext.js +10 -12
  84. package/dist/cjs/parts/HoC/withConditionalDnDColumnContext.js.map +2 -2
  85. package/dist/cjs/parts/HoC/withConditionalDnDRowContext.js +10 -10
  86. package/dist/cjs/parts/HoC/withConditionalDnDRowContext.js.map +2 -2
  87. package/dist/cjs/parts/HoC/withConditionalDnDSortableContext.js +2 -2
  88. package/dist/cjs/parts/HoC/withConditionalDnDSortableContext.js.map +2 -2
  89. package/dist/cjs/parts/HoC/withDnDSortableColumnContext.js +6 -6
  90. package/dist/cjs/parts/HoC/withDnDSortableColumnContext.js.map +2 -2
  91. package/dist/cjs/parts/HoC/withDnDSortableRowContext.js +3 -3
  92. package/dist/cjs/parts/HoC/withDnDSortableRowContext.js.map +2 -2
  93. package/dist/cjs/parts/Loader.js +4 -4
  94. package/dist/cjs/parts/Loader.js.map +2 -2
  95. package/dist/cjs/parts/MainContent.js +5 -5
  96. package/dist/cjs/parts/MainContent.js.map +2 -2
  97. package/dist/cjs/parts/Row.js +7 -7
  98. package/dist/cjs/parts/Row.js.map +2 -2
  99. package/dist/cjs/parts/RowVariants/RowVariantHeader.js +8 -7
  100. package/dist/cjs/parts/RowVariants/RowVariantHeader.js.map +2 -2
  101. package/dist/cjs/parts/RowVariants/index.js +2 -2
  102. package/dist/cjs/parts/RowVariants/index.js.map +2 -2
  103. package/dist/cjs/parts/Rows.js +7 -7
  104. package/dist/cjs/parts/Rows.js.map +2 -2
  105. package/dist/cjs/parts/TableContent.js +13 -13
  106. package/dist/cjs/parts/TableContent.js.map +2 -2
  107. package/dist/cjs/parts/VirtualRowsList.js +12 -12
  108. package/dist/cjs/parts/VirtualRowsList.js.map +2 -2
  109. package/dist/cjs/types/FunctionalHoC.js.map +1 -1
  110. package/dist/esm/DSDataTableDefinitions.js +1 -1
  111. package/dist/esm/DSDataTableDefinitions.js.map +1 -1
  112. package/dist/esm/addons/Columns/ColumnExpand/ColumnExpand.js +1 -1
  113. package/dist/esm/addons/Columns/ColumnExpand/ColumnExpand.js.map +1 -1
  114. package/dist/esm/addons/Columns/ColumnSelectMultiple/ColumnSelectMultiple.js +2 -3
  115. package/dist/esm/addons/Columns/ColumnSelectMultiple/ColumnSelectMultiple.js.map +2 -2
  116. package/dist/esm/addons/Columns/ColumnSelectSingle/ColumnSelectSingle.js +1 -1
  117. package/dist/esm/addons/Columns/ColumnSelectSingle/ColumnSelectSingle.js.map +1 -1
  118. package/dist/esm/addons/Editables/ComboboxEditableCell/ComboboxEditableCell.js +1 -1
  119. package/dist/esm/addons/Editables/ComboboxEditableCell/ComboboxEditableCell.js.map +1 -1
  120. package/dist/esm/addons/Editables/DateEditableCell/DateEditableCell.js +1 -1
  121. package/dist/esm/addons/Editables/DateEditableCell/DateEditableCell.js.map +1 -1
  122. package/dist/esm/addons/Editables/TextEditableCell/TextEditableCell.js +1 -1
  123. package/dist/esm/addons/Editables/TextEditableCell/TextEditableCell.js.map +1 -1
  124. package/dist/esm/addons/Filters/Components/SelectFilter/BaseSelectFilter.js +1 -1
  125. package/dist/esm/addons/Filters/Components/SelectFilter/BaseSelectFilter.js.map +1 -1
  126. package/dist/esm/addons/Pagination/Pagination.js +1 -1
  127. package/dist/esm/addons/Pagination/Pagination.js.map +1 -1
  128. package/dist/esm/configs/useStore/createInternalAndPropsContext.js +10 -0
  129. package/dist/esm/configs/useStore/createInternalAndPropsContext.js.map +7 -0
  130. package/dist/esm/configs/useStore/index.js +2 -1
  131. package/dist/esm/configs/useStore/index.js.map +2 -2
  132. package/dist/esm/configs/useStore/useStore.js +1 -6
  133. package/dist/esm/configs/useStore/useStore.js.map +2 -2
  134. package/dist/esm/exported-related/EditableCell.js +3 -3
  135. package/dist/esm/exported-related/EditableCell.js.map +2 -2
  136. package/dist/esm/exported-related/FilterBar/FilterBarDropdownMenu.js +1 -1
  137. package/dist/esm/exported-related/FilterBar/FilterBarDropdownMenu.js.map +1 -1
  138. package/dist/esm/exported-related/FilterPopover/index.js +5 -5
  139. package/dist/esm/exported-related/FilterPopover/index.js.map +2 -2
  140. package/dist/esm/exported-related/FilterPopover/useGetFilterHandlers.js +1 -1
  141. package/dist/esm/exported-related/FilterPopover/useGetFilterHandlers.js.map +2 -2
  142. package/dist/esm/exported-related/RowRenderer/DefaultRowContentRenderer.js +4 -3
  143. package/dist/esm/exported-related/RowRenderer/DefaultRowContentRenderer.js.map +2 -2
  144. package/dist/esm/exported-related/RowRenderer/index.js +4 -4
  145. package/dist/esm/exported-related/RowRenderer/index.js.map +2 -2
  146. package/dist/esm/exported-related/RowRenderer/useRowRendererHandlers.js +1 -1
  147. package/dist/esm/exported-related/RowRenderer/useRowRendererHandlers.js.map +2 -2
  148. package/dist/esm/exported-related/RowRenderer/useRowRendererProperties.js +1 -1
  149. package/dist/esm/exported-related/RowRenderer/useRowRendererProperties.js.map +2 -2
  150. package/dist/esm/exported-related/RowRenderer/useRowStyle.js +1 -1
  151. package/dist/esm/exported-related/RowRenderer/useRowStyle.js.map +2 -2
  152. package/dist/esm/exported-related/Toolbar/Toolbar.js +5 -5
  153. package/dist/esm/exported-related/Toolbar/Toolbar.js.map +2 -2
  154. package/dist/esm/parts/Cells/Cell.js +14 -8
  155. package/dist/esm/parts/Cells/Cell.js.map +2 -2
  156. package/dist/esm/parts/Cells/CellFactory.js +6 -6
  157. package/dist/esm/parts/Cells/CellFactory.js.map +2 -2
  158. package/dist/esm/parts/Cells/index.js +1 -1
  159. package/dist/esm/parts/Cells/index.js.map +2 -2
  160. package/dist/esm/parts/Cells/useCellStyle.js +2 -2
  161. package/dist/esm/parts/Cells/useCellStyle.js.map +2 -2
  162. package/dist/esm/parts/DnDHandle.js +5 -5
  163. package/dist/esm/parts/DnDHandle.js.map +2 -2
  164. package/dist/esm/parts/DropIndicator.js +3 -3
  165. package/dist/esm/parts/DropIndicator.js.map +2 -2
  166. package/dist/esm/parts/EmptyContent.js +4 -4
  167. package/dist/esm/parts/EmptyContent.js.map +2 -2
  168. package/dist/esm/parts/FilterBar/DeprecatedDropdown.js +6 -1
  169. package/dist/esm/parts/FilterBar/DeprecatedDropdown.js.map +2 -2
  170. package/dist/esm/parts/FilterBar/FiltersBar.js +1 -1
  171. package/dist/esm/parts/FilterBar/FiltersBar.js.map +1 -1
  172. package/dist/esm/parts/Filters/index.js +6 -6
  173. package/dist/esm/parts/Filters/index.js.map +2 -2
  174. package/dist/esm/parts/Headers/EmptyChildrenGroup.js +1 -1
  175. package/dist/esm/parts/Headers/EmptyChildrenGroup.js.map +2 -2
  176. package/dist/esm/parts/Headers/HeaderCell.js +1 -1
  177. package/dist/esm/parts/Headers/HeaderCell.js.map +1 -1
  178. package/dist/esm/parts/Headers/HeaderCellGroup.js +7 -7
  179. package/dist/esm/parts/Headers/HeaderCellGroup.js.map +2 -2
  180. package/dist/esm/parts/Headers/HeaderResizer.js +1 -1
  181. package/dist/esm/parts/Headers/HeaderResizer.js.map +1 -1
  182. package/dist/esm/parts/Headers/index.js +1 -1
  183. package/dist/esm/parts/Headers/index.js.map +1 -1
  184. package/dist/esm/parts/Headers/useHeaderCellConfig.js +1 -1
  185. package/dist/esm/parts/Headers/useHeaderCellConfig.js.map +1 -1
  186. package/dist/esm/parts/Headers/useHeaderCellHandlers.js +1 -1
  187. package/dist/esm/parts/Headers/useHeaderCellHandlers.js.map +1 -1
  188. package/dist/esm/parts/Headers/useHeaderResizer.js +5 -5
  189. package/dist/esm/parts/Headers/useHeaderResizer.js.map +2 -2
  190. package/dist/esm/parts/HoC/DnDGroupContext.js +9 -0
  191. package/dist/esm/parts/HoC/DnDGroupContext.js.map +7 -0
  192. package/dist/esm/parts/HoC/withConditionalDnDColumnContext.js +7 -9
  193. package/dist/esm/parts/HoC/withConditionalDnDColumnContext.js.map +2 -2
  194. package/dist/esm/parts/HoC/withConditionalDnDRowContext.js +4 -4
  195. package/dist/esm/parts/HoC/withConditionalDnDRowContext.js.map +2 -2
  196. package/dist/esm/parts/HoC/withConditionalDnDSortableContext.js +1 -1
  197. package/dist/esm/parts/HoC/withConditionalDnDSortableContext.js.map +2 -2
  198. package/dist/esm/parts/HoC/withDnDSortableColumnContext.js +4 -4
  199. package/dist/esm/parts/HoC/withDnDSortableColumnContext.js.map +2 -2
  200. package/dist/esm/parts/HoC/withDnDSortableRowContext.js +2 -2
  201. package/dist/esm/parts/HoC/withDnDSortableRowContext.js.map +2 -2
  202. package/dist/esm/parts/Loader.js +3 -3
  203. package/dist/esm/parts/Loader.js.map +2 -2
  204. package/dist/esm/parts/MainContent.js +1 -1
  205. package/dist/esm/parts/MainContent.js.map +1 -1
  206. package/dist/esm/parts/Row.js +3 -3
  207. package/dist/esm/parts/Row.js.map +2 -2
  208. package/dist/esm/parts/RowVariants/RowVariantHeader.js +5 -4
  209. package/dist/esm/parts/RowVariants/RowVariantHeader.js.map +2 -2
  210. package/dist/esm/parts/RowVariants/index.js +1 -1
  211. package/dist/esm/parts/RowVariants/index.js.map +2 -2
  212. package/dist/esm/parts/Rows.js +4 -4
  213. package/dist/esm/parts/Rows.js.map +2 -2
  214. package/dist/esm/parts/TableContent.js +3 -3
  215. package/dist/esm/parts/TableContent.js.map +2 -2
  216. package/dist/esm/parts/VirtualRowsList.js +5 -5
  217. package/dist/esm/parts/VirtualRowsList.js.map +2 -2
  218. package/dist/types/DSDataTableDefinitions.d.ts +1 -1
  219. package/dist/types/configs/useStore/createInternalAndPropsContext.d.ts +15 -0
  220. package/dist/types/configs/useStore/index.d.ts +2 -1
  221. package/dist/types/configs/useStore/useStore.d.ts +0 -13
  222. package/dist/types/exported-related/RowRenderer/index.d.ts +1 -1
  223. package/dist/types/parts/Cells/useCellStyle.d.ts +1 -1
  224. package/dist/types/parts/Headers/index.d.ts +1 -1
  225. package/dist/types/parts/HoC/DnDGroupContext.d.ts +3 -0
  226. package/dist/types/parts/HoC/withConditionalDnDColumnContext.d.ts +1 -4
  227. package/dist/types/parts/HoC/withConditionalDnDSortableContext.d.ts +1 -1
  228. package/dist/types/parts/Loader.d.ts +2 -2
  229. package/dist/types/parts/Rows.d.ts +1 -1
  230. package/dist/types/types/FunctionalHoC.d.ts +1 -1
  231. package/package.json +31 -31
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/FilterPopover/index.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable import/no-cycle */\n/* eslint-disable no-void */\n/* eslint-disable jsx-a11y/no-static-element-interactions */\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\nimport { DSButtonV2 } from '@elliemae/ds-button-v2';\nimport { DSPopperJS } from '@elliemae/ds-popperjs';\nimport type { DSPopperJST } from '@elliemae/ds-popperjs';\nimport { styled, mergeRefs } from '@elliemae/ds-system';\nimport { DATA_TESTID } from '../../configs/constants.js';\nimport { useGetFilterVisibility } from './useGetFilterVisibility.js';\nimport type { FilterPopoverProps } from './types.js';\nimport { useGetFilterHandlers } from './useGetFilterHandlers.js';\nimport { useInternalStore, usePropsStore } from '../../configs/useStore/useStore.js';\nimport { DSDataTableName, DSDataTableSlots } from '../../DSDataTableDefinitions.js';\n\nconst FilterButton = styled('span', { name: DSDataTableName, slot: DSDataTableSlots.FILTER_POPOVER_BUTTON })<{\n hide: boolean;\n}>`\n display: inline-grid;\n ${(props) => (props.hide ? 'opacity: 0; display: none; width: 0;' : '')}\n`;\n\nconst PopperContent = styled('div', { name: DSDataTableName, slot: DSDataTableSlots.FILTER_POPOVER_CONTENT })`\n background-color: #fff;\n`;\n\nconst ButtonTrap = ({ cb }: { cb: () => void }) => (\n <span\n // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex\n tabIndex={0}\n onFocus={(e: React.FocusEvent) => {\n e.stopPropagation();\n cb();\n }}\n />\n);\n\nexport const FilterPopover: React.ComponentType<FilterPopoverProps> = (props: FilterPopoverProps) => {\n const { column, customStyles, reduxHeader, menuContent, columnId, ariaLabel, triggerIcon, innerRef } = props;\n\n const filters = usePropsStore((state) => state.filters);\n const getOwnerProps = usePropsStore((store) => store.get);\n\n const patchHeader = useInternalStore((state) => state.patchHeader);\n\n const { isIconVisible, isMenuOpen } = useGetFilterVisibility(reduxHeader);\n\n const [buttonReference, setButtonReference] = useState<HTMLButtonElement | null>(null);\n\n const [isButtonFocused, setIsButtonFocused] = useState(false);\n\n const { handleTriggerClick, handleClickOutsideMenu, handleMenuOnKeyDown, handleTriggerOnFocus, handleTriggerOnBlur } =\n useGetFilterHandlers(props, isMenuOpen, buttonReference, setIsButtonFocused);\n\n const buttonTrapCallback = useCallback(() => {\n patchHeader(columnId, { hideFilterMenu: true, hideFilterButton: false });\n buttonReference?.focus();\n }, [columnId, patchHeader, buttonReference]);\n\n const actionRef: Required<DSPopperJST.Props>['actionRef'] = useRef({\n update: null,\n });\n\n useEffect(() => {\n // When the filters change, we need to update the popper position,\n // because the filter bar might push the datatable up or down, causing the popper to be misaligned\n void actionRef.current.update?.();\n }, [filters]);\n\n return (\n <div\n // This is here to prevent propagation, and not trigger the sort functionality\n onClick={(e) => e.stopPropagation()}\n onKeyDown={handleMenuOnKeyDown}\n >\n <FilterButton\n hide={!isIconVisible}\n data-testid={DATA_TESTID.DATA_TABLE_FILTER_BUTTON}\n getOwnerProps={getOwnerProps}\n >\n <DSButtonV2\n buttonType=\"icon\"\n size=\"s\"\n onClick={handleTriggerClick}\n onFocus={handleTriggerOnFocus}\n onBlur={handleTriggerOnBlur}\n innerRef={mergeRefs(isIconVisible && setButtonReference, innerRef)}\n tabIndex={reduxHeader?.withTabStops ? 0 : -1}\n aria-label={ariaLabel}\n aria-hidden={!isButtonFocused}\n data-testid={DATA_TESTID.DATA_TABLE_FILTER_BUTTON_ELEMENT}\n >\n {triggerIcon}\n </DSButtonV2>\n </FilterButton>\n {buttonReference && (\n <DSPopperJS\n actionRef={actionRef}\n referenceElement={buttonReference}\n showPopover={isMenuOpen}\n closeContextMenu={handleClickOutsideMenu}\n data-testid={DATA_TESTID.DATA_TABLE_FILTER_MENU_CONTENT}\n startPlacementPreference=\"bottom-end\"\n customOffset={[5, 4]}\n withoutArrow\n withoutAnimation\n extraPopperStyles={{\n ...customStyles,\n minWidth: column.ref?.current?.offsetWidth ?? '0px',\n }}\n placementOrderPreference={['bottom-end', 'top-end']}\n >\n <PopperContent getOwnerProps={getOwnerProps}>\n <ButtonTrap cb={buttonTrapCallback} />\n {menuContent}\n <ButtonTrap cb={buttonTrapCallback} />\n </PopperContent>\n </DSPopperJS>\n )}\n </div>\n );\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;AC2BrB,cAqFQ,YArFR;AAxBF,SAAgB,aAAa,WAAW,QAAQ,gBAAgB;AAChE,SAAS,kBAAkB;AAC3B,SAAS,kBAAkB;AAE3B,SAAS,QAAQ,iBAAiB;AAClC,SAAS,mBAAmB;AAC5B,SAAS,8BAA8B;AAEvC,SAAS,4BAA4B;AACrC,SAAS,kBAAkB,qBAAqB;AAChD,SAAS,iBAAiB,wBAAwB;AAElD,MAAM,eAAe,OAAO,QAAQ,EAAE,MAAM,iBAAiB,MAAM,iBAAiB,sBAAsB,CAAC;AAAA;AAAA,IAIvG,CAAC,UAAW,MAAM,OAAO,yCAAyC,EAAG;AAAA;AAGzE,MAAM,gBAAgB,OAAO,OAAO,EAAE,MAAM,iBAAiB,MAAM,iBAAiB,uBAAuB,CAAC;AAAA;AAAA;AAI5G,MAAM,aAAa,CAAC,EAAE,GAAG,MACvB;AAAA,EAAC;AAAA;AAAA,IAEC,UAAU;AAAA,IACV,SAAS,CAAC,MAAwB;AAChC,QAAE,gBAAgB;AAClB,SAAG;AAAA,IACL;AAAA;AACF;AAGK,MAAM,gBAAyD,CAAC,UAA8B;AACnG,QAAM,EAAE,QAAQ,cAAc,aAAa,aAAa,UAAU,WAAW,aAAa,SAAS,IAAI;AAEvG,QAAM,UAAU,cAA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A,UAAC;AAAA;AAAA,YACC;AAAA,YACA,kBAAkB;AAAA,YAClB,aAAa;AAAA,YACb,kBAAkB;AAAA,YAClB,eAAa,YAAY;AAAA,YACzB,0BAAyB;AAAA,YACzB,cAAc,CAAC,GAAG,CAAC;AAAA,YACnB,cAAY;AAAA,YACZ,kBAAgB;AAAA,YAChB,mBAAmB;AAAA,cACjB,GAAG;AAAA,cACH,UAAU,OAAO,KAAK,SAAS,eAAe;AAAA,YAChD;AAAA,YACA,0BAA0B,CAAC,cAAc,SAAS;AAAA,YAElD,+BAAC,iBAAc,eACb;AAAA,kCAAC,cAAW,IAAI,oBAAoB;AAAA,cACnC;AAAA,cACD,oBAAC,cAAW,IAAI,oBAAoB;AAAA,eACtC;AAAA;AAAA,QACF;AAAA;AAAA;AAAA,EAEJ;AAEJ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable import/no-cycle */\n/* eslint-disable no-void */\n/* eslint-disable jsx-a11y/no-static-element-interactions */\nimport { DSButtonV2 } from '@elliemae/ds-button-v2';\nimport type { DSPopperJST } from '@elliemae/ds-popperjs';\nimport { DSPopperJS } from '@elliemae/ds-popperjs';\nimport { mergeRefs, styled } from '@elliemae/ds-system';\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\nimport { DSDataTableName, DSDataTableSlots } from '../../DSDataTableDefinitions.js';\nimport { DATA_TESTID } from '../../configs/constants.js';\nimport { useInternalStore, usePropsStore } from '../../configs/useStore/createInternalAndPropsContext.js';\nimport type { FilterPopoverProps } from './types.js';\nimport { useGetFilterHandlers } from './useGetFilterHandlers.js';\nimport { useGetFilterVisibility } from './useGetFilterVisibility.js';\n\nconst FilterButton = styled('span', { name: DSDataTableName, slot: DSDataTableSlots.FILTER_POPOVER_BUTTON })<{\n hide: boolean;\n}>`\n display: inline-grid;\n ${(props) => (props.hide ? 'opacity: 0; display: none; width: 0;' : '')}\n`;\n\nconst PopperContent = styled('div', { name: DSDataTableName, slot: DSDataTableSlots.FILTER_POPOVER_CONTENT })`\n background-color: #fff;\n`;\n\nconst ButtonTrap = ({ cb }: { cb: () => void }) => (\n <span\n // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex\n tabIndex={0}\n onFocus={(e: React.FocusEvent) => {\n e.stopPropagation();\n cb();\n }}\n />\n);\n\nexport const FilterPopover: React.ComponentType<FilterPopoverProps> = (props: FilterPopoverProps) => {\n const { column, customStyles, reduxHeader, menuContent, columnId, ariaLabel, triggerIcon, innerRef } = props;\n\n const filters = usePropsStore((state) => state.filters);\n const getOwnerProps = usePropsStore((store) => store.get);\n\n const patchHeader = useInternalStore((state) => state.patchHeader);\n\n const { isIconVisible, isMenuOpen } = useGetFilterVisibility(reduxHeader);\n\n const [buttonReference, setButtonReference] = useState<HTMLButtonElement | null>(null);\n\n const [isButtonFocused, setIsButtonFocused] = useState(false);\n\n const { handleTriggerClick, handleClickOutsideMenu, handleMenuOnKeyDown, handleTriggerOnFocus, handleTriggerOnBlur } =\n useGetFilterHandlers(props, isMenuOpen, buttonReference, setIsButtonFocused);\n\n const buttonTrapCallback = useCallback(() => {\n patchHeader(columnId, { hideFilterMenu: true, hideFilterButton: false });\n buttonReference?.focus();\n }, [columnId, patchHeader, buttonReference]);\n\n const actionRef: Required<DSPopperJST.Props>['actionRef'] = useRef({\n update: null,\n });\n\n useEffect(() => {\n // When the filters change, we need to update the popper position,\n // because the filter bar might push the datatable up or down, causing the popper to be misaligned\n void actionRef.current.update?.();\n }, [filters]);\n\n return (\n <div\n // This is here to prevent propagation, and not trigger the sort functionality\n onClick={(e) => e.stopPropagation()}\n onKeyDown={handleMenuOnKeyDown}\n >\n <FilterButton\n hide={!isIconVisible}\n data-testid={DATA_TESTID.DATA_TABLE_FILTER_BUTTON}\n getOwnerProps={getOwnerProps}\n >\n <DSButtonV2\n buttonType=\"icon\"\n size=\"s\"\n onClick={handleTriggerClick}\n onFocus={handleTriggerOnFocus}\n onBlur={handleTriggerOnBlur}\n innerRef={mergeRefs(isIconVisible && setButtonReference, innerRef)}\n tabIndex={reduxHeader?.withTabStops ? 0 : -1}\n aria-label={ariaLabel}\n aria-hidden={!isButtonFocused}\n data-testid={DATA_TESTID.DATA_TABLE_FILTER_BUTTON_ELEMENT}\n >\n {triggerIcon}\n </DSButtonV2>\n </FilterButton>\n {buttonReference && (\n <DSPopperJS\n actionRef={actionRef}\n referenceElement={buttonReference}\n showPopover={isMenuOpen}\n closeContextMenu={handleClickOutsideMenu}\n data-testid={DATA_TESTID.DATA_TABLE_FILTER_MENU_CONTENT}\n startPlacementPreference=\"bottom-end\"\n customOffset={[5, 4]}\n withoutArrow\n withoutAnimation\n extraPopperStyles={{\n ...customStyles,\n minWidth: column.ref?.current?.offsetWidth ?? '0px',\n }}\n placementOrderPreference={['bottom-end', 'top-end']}\n >\n <PopperContent getOwnerProps={getOwnerProps}>\n <ButtonTrap cb={buttonTrapCallback} />\n {menuContent}\n <ButtonTrap cb={buttonTrapCallback} />\n </PopperContent>\n </DSPopperJS>\n )}\n </div>\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;AC2BrB,cAqFQ,YArFR;AAxBF,SAAS,kBAAkB;AAE3B,SAAS,kBAAkB;AAC3B,SAAS,WAAW,cAAc;AAClC,SAAgB,aAAa,WAAW,QAAQ,gBAAgB;AAChE,SAAS,iBAAiB,wBAAwB;AAClD,SAAS,mBAAmB;AAC5B,SAAS,kBAAkB,qBAAqB;AAEhD,SAAS,4BAA4B;AACrC,SAAS,8BAA8B;AAEvC,MAAM,eAAe,OAAO,QAAQ,EAAE,MAAM,iBAAiB,MAAM,iBAAiB,sBAAsB,CAAC;AAAA;AAAA,IAIvG,CAAC,UAAW,MAAM,OAAO,yCAAyC,EAAG;AAAA;AAGzE,MAAM,gBAAgB,OAAO,OAAO,EAAE,MAAM,iBAAiB,MAAM,iBAAiB,uBAAuB,CAAC;AAAA;AAAA;AAI5G,MAAM,aAAa,CAAC,EAAE,GAAG,MACvB;AAAA,EAAC;AAAA;AAAA,IA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;AAAA,gBACR,UAAU,UAAU,iBAAiB,oBAAoB,QAAQ;AAAA,gBACjE,UAAU,aAAa,eAAe,IAAI;AAAA,gBAC1C,cAAY;AAAA,gBACZ,eAAa,CAAC;AAAA,gBACd,eAAa,YAAY;AAAA,gBAExB;AAAA;AAAA,YACH;AAAA;AAAA,QACF;AAAA,QACC,mBACC;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA,kBAAkB;AAAA,YAClB,aAAa;AAAA,YACb,kBAAkB;AAAA,YAClB,eAAa,YAAY;AAAA,YACzB,0BAAyB;AAAA,YACzB,cAAc,CAAC,GAAG,CAAC;AAAA,YACnB,cAAY;AAAA,YACZ,kBAAgB;AAAA,YAChB,mBAAmB;AAAA,cACjB,GAAG;AAAA,cACH,UAAU,OAAO,KAAK,SAAS,eAAe;AAAA,YAChD;AAAA,YACA,0BAA0B,CAAC,cAAc,SAAS;AAAA,YAElD,+BAAC,iBAAc,eACb;AAAA,kCAAC,cAAW,IAAI,oBAAoB;AAAA,cACnC;AAAA,cACD,oBAAC,cAAW,IAAI,oBAAoB;AAAA,eACtC;AAAA;AAAA,QACF;AAAA;AAAA;AAAA,EAEJ;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { useCallback, useEffect, useRef } from "react";
3
- import { useInternalStore } from "../../configs/useStore/useStore.js";
3
+ import { useInternalStore } from "../../configs/useStore/createInternalAndPropsContext.js";
4
4
  const emptyFunc = () => null;
5
5
  const useIframeClickCloseWorkaround = ({
6
6
  columnId,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/FilterPopover/useGetFilterHandlers.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-params */\nimport type React from 'react';\nimport { useCallback, useEffect, useRef } from 'react';\nimport type { FilterPopoverProps } from './types.js';\nimport { useInternalStore } from '../../configs/useStore/useStore.js';\n\nconst emptyFunc = () => null;\n\n// https://jira.elliemae.io/browse/PUI-12457\nconst useIframeClickCloseWorkaround = ({\n columnId,\n isMenuOpen,\n}: {\n columnId: FilterPopoverProps['columnId'];\n isMenuOpen: boolean;\n}) => {\n // due to how browser handle events when iframes are involved we can only listen to window \"blur\" event to understand if the user clicked on any iframe\n // out of the box the filter are supposed to close when the user clicks outside of the filter contextual region\n // this helper ensure that the filter will close even if the user clicks on an iframe.\n // since we must do vanilla javascript we need to handle this with extreme care and ensure we optimize as much as possible.\n // we want to attach/detach the event listener only when the filter is open and we want to detach it as soon as the filter is closed.\n // this is to ensure that no matter how many columns have filter functionality we only pay the performance cost for the filter that would do anything with it.\n const patchHeaderFilterButtonAndMenu = useInternalStore((state) => state.patchHeaderFilterButtonAndMenu);\n\n // we only care to invoke the latest version of patchHeaderFilterButtonAndMenu\n // we do not need to reattach the event listener if pathHeaderFilterButtonAndMenu changes\n // event attachment/detachment is more expensive than a simple ref update performance wise.\n const patchRef = useRef(patchHeaderFilterButtonAndMenu);\n useEffect(() => {\n patchRef.current = patchHeaderFilterButtonAndMenu;\n }, [patchHeaderFilterButtonAndMenu]);\n\n // extremely optimized event listener attachment/detachment\n // we run this side effect strictly when required to ensure the best performance possible.\n // it's strictly required when:\n // - the filter is open ( so clicking an iframe will close it )\n // - the columnId changes ( so we close the correct filter )\n // if patchHeaderFilterButtonAndMenu changes we do not care to reattach the event listener\n // as long as the .current ref is updated in time before the close event is triggered.\n // which is guaranteed by:\n // - the fact that we update the ref in the useEffect above\n // - the fact that we invoke patchRef.current as a consquence of the user \"clicking\" on the filter button (which happens after the previous useEffect)\n useEffect(() => {\n // we declare the function locally in the closure to ensure we can detach it later\n // useEffect is run after render, useCallBack is run before render,\n // which means that using useCallback here could potentially cause a memory-leak/dangling reference/attached event listener that is never detached\n const handleBlur = () => {\n patchRef.current(columnId, true);\n };\n\n if (isMenuOpen) window.addEventListener('blur', handleBlur);\n else window.removeEventListener('blur', handleBlur);\n\n return () => {\n window.removeEventListener('blur', handleBlur);\n };\n }, [columnId, isMenuOpen]);\n};\n\nexport const useGetFilterHandlers = (\n props: FilterPopoverProps,\n isMenuOpen: boolean,\n buttonReference: HTMLButtonElement | null,\n setIsButtonFocused: React.Dispatch<React.SetStateAction<boolean>>,\n) => {\n const { columnId, onTriggerClick = emptyFunc, onClickOutsideMenu = emptyFunc } = props;\n useIframeClickCloseWorkaround({ columnId, isMenuOpen });\n\n const patchHeaderFilterButtonAndMenu = useInternalStore((state) => state.patchHeaderFilterButtonAndMenu);\n const patchHeader = useInternalStore((state) => state.patchHeader);\n\n const handleTriggerClick = useCallback(\n (e: React.MouseEvent | React.KeyboardEvent) => {\n onTriggerClick(columnId, e);\n patchHeader(columnId, { hideFilterMenu: isMenuOpen, hideFilterButton: false });\n e.stopPropagation();\n },\n [columnId, isMenuOpen, onTriggerClick, patchHeader],\n );\n\n const handleTriggerOnFocus = useCallback(() => setIsButtonFocused(true), [setIsButtonFocused]);\n const handleTriggerOnBlur = useCallback(() => setIsButtonFocused(false), [setIsButtonFocused]);\n\n const handleClickOutsideMenu = useCallback(() => {\n onClickOutsideMenu(columnId);\n if (isMenuOpen) patchHeaderFilterButtonAndMenu(columnId, true);\n }, [columnId, isMenuOpen, onClickOutsideMenu, patchHeaderFilterButtonAndMenu]);\n\n const handleMenuOnKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n e.stopPropagation();\n if (e.code === 'Escape') {\n patchHeader(columnId, { hideFilterMenu: true, hideFilterButton: false, showSortCaret: true });\n buttonReference?.focus();\n }\n // Stop propagation for some reason is not enough to prevent scrolling of the datatable\n // so we just prevent default behaviour in this case\n if (['ArrowUp', 'ArrowDown'].includes(e.code)) {\n e.preventDefault();\n }\n },\n [buttonReference, columnId, patchHeader],\n );\n\n return { handleTriggerClick, handleClickOutsideMenu, handleMenuOnKeyDown, handleTriggerOnFocus, handleTriggerOnBlur };\n};\n"],
5
- "mappings": "AAAA,YAAY,WAA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,YAAY,MAAM;AAC/C,uBAAmB,QAAQ;AAC3B,QAAI,WAAY,gCAA+B,UAAU,IAAI;AAAA,EAC/D,GAAG,CAAC,UAAU,YAAY,oBAAoB,8BAA8B,CAAC;AAE7E,QAAM,sBAAsB;AAAA,IAC1B,CAAC,MAA2B;AAC1B,QAAE,gBAAgB;AAClB,UAAI,EAAE,SAAS,UAAU;AACvB,oBAAY,UAAU,EAAE,gBAAgB,MAAM,kBAAkB,OAAO,eAAe,KAAK,CAAC;AAC5F,yBAAiB,MAAM;AAAA,MACzB;AAGA,UAAI,CAAC,WAAW,WAAW,EAAE,SAAS,EAAE,IAAI,GAAG;AAC7C,UAAE,eAAe;AAAA,MACnB;AAAA,IACF;AAAA,IACA,CAAC,iBAAiB,UAAU,WAAW;AAAA,EACzC;AAEA,SAAO,EAAE,oBAAoB,wBAAwB,qBAAqB,sBAAsB,oBAAoB;AACtH;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-params */\nimport type React from 'react';\nimport { useCallback, useEffect, useRef } from 'react';\nimport { useInternalStore } from '../../configs/useStore/createInternalAndPropsContext.js';\nimport type { FilterPopoverProps } from './types.js';\n\nconst emptyFunc = () => null;\n\n// https://jira.elliemae.io/browse/PUI-12457\nconst useIframeClickCloseWorkaround = ({\n columnId,\n isMenuOpen,\n}: {\n columnId: FilterPopoverProps['columnId'];\n isMenuOpen: boolean;\n}) => {\n // due to how browser handle events when iframes are involved we can only listen to window \"blur\" event to understand if the user clicked on any iframe\n // out of the box the filter are supposed to close when the user clicks outside of the filter contextual region\n // this helper ensure that the filter will close even if the user clicks on an iframe.\n // since we must do vanilla javascript we need to handle this with extreme care and ensure we optimize as much as possible.\n // we want to attach/detach the event listener only when the filter is open and we want to detach it as soon as the filter is closed.\n // this is to ensure that no matter how many columns have filter functionality we only pay the performance cost for the filter that would do anything with it.\n const patchHeaderFilterButtonAndMenu = useInternalStore((state) => state.patchHeaderFilterButtonAndMenu);\n\n // we only care to invoke the latest version of patchHeaderFilterButtonAndMenu\n // we do not need to reattach the event listener if pathHeaderFilterButtonAndMenu changes\n // event attachment/detachment is more expensive than a simple ref update performance wise.\n const patchRef = useRef(patchHeaderFilterButtonAndMenu);\n useEffect(() => {\n patchRef.current = patchHeaderFilterButtonAndMenu;\n }, [patchHeaderFilterButtonAndMenu]);\n\n // extremely optimized event listener attachment/detachment\n // we run this side effect strictly when required to ensure the best performance possible.\n // it's strictly required when:\n // - the filter is open ( so clicking an iframe will close it )\n // - the columnId changes ( so we close the correct filter )\n // if patchHeaderFilterButtonAndMenu changes we do not care to reattach the event listener\n // as long as the .current ref is updated in time before the close event is triggered.\n // which is guaranteed by:\n // - the fact that we update the ref in the useEffect above\n // - the fact that we invoke patchRef.current as a consquence of the user \"clicking\" on the filter button (which happens after the previous useEffect)\n useEffect(() => {\n // we declare the function locally in the closure to ensure we can detach it later\n // useEffect is run after render, useCallBack is run before render,\n // which means that using useCallback here could potentially cause a memory-leak/dangling reference/attached event listener that is never detached\n const handleBlur = () => {\n patchRef.current(columnId, true);\n };\n\n if (isMenuOpen) window.addEventListener('blur', handleBlur);\n else window.removeEventListener('blur', handleBlur);\n\n return () => {\n window.removeEventListener('blur', handleBlur);\n };\n }, [columnId, isMenuOpen]);\n};\n\nexport const useGetFilterHandlers = (\n props: FilterPopoverProps,\n isMenuOpen: boolean,\n buttonReference: HTMLButtonElement | null,\n setIsButtonFocused: React.Dispatch<React.SetStateAction<boolean>>,\n) => {\n const { columnId, onTriggerClick = emptyFunc, onClickOutsideMenu = emptyFunc } = props;\n useIframeClickCloseWorkaround({ columnId, isMenuOpen });\n\n const patchHeaderFilterButtonAndMenu = useInternalStore((state) => state.patchHeaderFilterButtonAndMenu);\n const patchHeader = useInternalStore((state) => state.patchHeader);\n\n const handleTriggerClick = useCallback(\n (e: React.MouseEvent | React.KeyboardEvent) => {\n onTriggerClick(columnId, e);\n patchHeader(columnId, { hideFilterMenu: isMenuOpen, hideFilterButton: false });\n e.stopPropagation();\n },\n [columnId, isMenuOpen, onTriggerClick, patchHeader],\n );\n\n const handleTriggerOnFocus = useCallback(() => setIsButtonFocused(true), [setIsButtonFocused]);\n const handleTriggerOnBlur = useCallback(() => setIsButtonFocused(false), [setIsButtonFocused]);\n\n const handleClickOutsideMenu = useCallback(() => {\n onClickOutsideMenu(columnId);\n if (isMenuOpen) patchHeaderFilterButtonAndMenu(columnId, true);\n }, [columnId, isMenuOpen, onClickOutsideMenu, patchHeaderFilterButtonAndMenu]);\n\n const handleMenuOnKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n e.stopPropagation();\n if (e.code === 'Escape') {\n patchHeader(columnId, { hideFilterMenu: true, hideFilterButton: false, showSortCaret: true });\n buttonReference?.focus();\n }\n // Stop propagation for some reason is not enough to prevent scrolling of the datatable\n // so we just prevent default behaviour in this case\n if (['ArrowUp', 'ArrowDown'].includes(e.code)) {\n e.preventDefault();\n }\n },\n [buttonReference, columnId, patchHeader],\n );\n\n return { handleTriggerClick, handleClickOutsideMenu, handleMenuOnKeyDown, handleTriggerOnFocus, handleTriggerOnBlur };\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,aAAa,WAAW,cAAc;AAC/C,SAAS,wBAAwB;AAGjC,MAAM,YAAY,MAAM;AAGxB,MAAM,gCAAgC,CAAC;AAAA,EACrC;AAAA,EACA;AACF,MAGM;AAOJ,QAAM,iCAAiC,iBAAiB,CAAC,UAAU,MAAM,8BAA8B;AAKvG,QAAM,WAAW,OAAO,8BAA8B;AACtD,YAAU,MAAM;AACd,aAAS,UAAU;AAAA,EACrB,GAAG,CAAC,8BAA8B,CAAC;AAYnC,YAAU,MAAM;AAId,UAAM,aAAa,MAAM;AACvB,eAAS,QAAQ,UAAU,IAAI;AAAA,IACjC;AAEA,QAAI,WAAY,QAAO,iBAAiB,QAAQ,UAAU;AAAA,QACrD,QAAO,oBAAoB,QAAQ,UAAU;AAElD,WAAO,MAAM;AACX,aAAO,oBAAoB,QAAQ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wBAAwB,qBAAqB,sBAAsB,oBAAoB;AACtH;",
6
6
  "names": []
7
7
  }
@@ -1,11 +1,11 @@
1
1
  import * as React from "react";
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
- import { useMemo, useLayoutEffect, useRef } from "react";
3
+ import { useLayoutEffect, useMemo, useRef } from "react";
4
4
  import { INTERNAL_COLUMNS } from "../../addons/Columns/index.js";
5
5
  import { DATA_TESTID, DropIndicatorPosition } from "../../configs/constants.js";
6
+ import { usePropsStore } from "../../configs/useStore/createInternalAndPropsContext.js";
6
7
  import { Cells } from "../../parts/Cells/index.js";
7
8
  import { StyledCellContainer } from "../../styled.js";
8
- import { usePropsStore } from "../../configs/useStore/useStore.js";
9
9
  const DetailsWrapper = (props) => (
10
10
  // This can be further customized
11
11
  // eslint-disable-next-line jsx-a11y/no-static-element-interactions
@@ -29,7 +29,8 @@ const getDefaultAriaLabelMessageForRow = ({
29
29
  disabled,
30
30
  expanded,
31
31
  expandable
32
- }) => `Row number ${row.realIndex + 1}${row.parentIndex !== null ? `, child of row number ${row.parentIndex + 1}` : ""}. ${selected ? "Selected. " : ""}${disabled ? "Disabled. " : "To interact with the cells press enter. "}${expandable ? expanded ? "Expanded. " : "Collapsed. " : ""}`;
32
+ }) => `Row number ${row.realIndex + 1}${row.parentIndex !== null ? `, child of row number ${row.parentIndex + 1}` : ""}. ${selected ? "Selected. " : ""}${disabled ? "Disabled. " : "To interact with the cells press enter. "}${// eslint-disable-next-line no-nested-ternary
33
+ expandable ? expanded ? "Expanded. " : "Collapsed. " : ""}`;
33
34
  const DefaultRowContentRenderer = (props) => {
34
35
  const {
35
36
  row,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/RowRenderer/DefaultRowContentRenderer.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\nimport React, { useMemo, useLayoutEffect, useRef, type PropsWithChildren } from 'react';\nimport { INTERNAL_COLUMNS } from '../../addons/Columns/index.js';\nimport { DATA_TESTID, DropIndicatorPosition } from '../../configs/constants.js';\nimport { Cells } from '../../parts/Cells/index.js';\nimport type { RowVariantProps } from '../../parts/RowVariants/types.js';\nimport { StyledCellContainer } from '../../styled.js';\nimport type { DSDataTableT } from '../../react-desc-prop-types.js';\nimport { usePropsStore } from '../../configs/useStore/useStore.js';\n\nconst DetailsWrapper: React.ComponentType<PropsWithChildren> = (props) => (\n // This can be further customized\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions\n <div\n data-role=\"detail-view\"\n style={{\n borderTop: '1px solid #EBEDF0',\n borderBottom: '1px solid #EBEDF0',\n }}\n onClick={(e) => e.stopPropagation()}\n onKeyDown={(e) => e.stopPropagation()}\n >\n {props.children}\n </div>\n);\n\nconst getDefaultAriaLabelMessageForRow = ({\n row,\n selected,\n disabled,\n expanded,\n expandable,\n}: {\n row: DSDataTableT.InternalRow;\n selected: boolean;\n disabled: boolean;\n expanded: boolean;\n expandable: boolean;\n}) =>\n `Row number ${row.realIndex + 1}${row.parentIndex !== null ? `, child of row number ${row.parentIndex + 1}` : ''}. ${\n selected ? 'Selected. ' : ''\n }${disabled ? 'Disabled. ' : 'To interact with the cells press enter. '}${\n expandable ? (expanded ? 'Expanded. ' : 'Collapsed. ') : ''\n }`;\n\nexport const DefaultRowContentRenderer: React.ComponentType<RowVariantProps> = (props) => {\n const {\n row,\n draggableProps,\n isDragOverlay,\n backgroundColor = 'neutral-000',\n dropIndicatorPosition,\n isDropValid,\n focusedRowId,\n drilldownRowId,\n compact,\n } = props;\n\n const isExpandable = usePropsStore((state) => state.isExpandable);\n const selection = usePropsStore((state) => state.selection);\n const noSelectionColumn = usePropsStore((state) => state.noSelectionColumn);\n const expandedRows = usePropsStore((state) => state.expandedRows);\n const disabledRows = usePropsStore((state) => state.disabledRows);\n const getAriaLabelForRow = usePropsStore((state) => state.getAriaLabelForRow);\n const visibleColumns = usePropsStore((state) => state.visibleColumns);\n const domIdAffix = usePropsStore((state) => state.domIdAffix);\n\n const rowRef = useRef<HTMLDivElement>(null);\n const isDndActive = draggableProps && draggableProps.active;\n const isDragging = draggableProps && draggableProps.isDragging;\n\n useLayoutEffect(() => {\n if (row.uid === focusedRowId) {\n rowRef.current?.focus();\n }\n }, [focusedRowId, row.uid]);\n\n const detailsIndent = useMemo(() => {\n let padding = 0;\n for (let i = 0; i < visibleColumns.length; i += 1) {\n if (INTERNAL_COLUMNS.includes(visibleColumns[i].id)) {\n padding += visibleColumns[i].width as number;\n } else {\n padding += row.depth * 32 + 15;\n break;\n }\n }\n return padding;\n }, [row.depth, visibleColumns]);\n\n const DetailsView = row.original.tableRowDetails;\n\n const rowAriaLabelProps = {\n row,\n selected: selection?.[row.uid] === true,\n disabled: disabledRows[row.uid],\n expandable: isExpandable,\n expanded: expandedRows[row.uid] === true,\n };\n\n return (\n <>\n <StyledCellContainer\n innerRef={rowRef}\n key={row.uid}\n tabIndex={0}\n role=\"row\"\n aria-rowindex={row.realIndex + 1}\n aria-label={(getAriaLabelForRow ?? getDefaultAriaLabelMessageForRow)(rowAriaLabelProps)}\n aria-selected={selection?.[row.uid] === true}\n aria-disabled={disabledRows[row.uid]}\n backgroundColor={backgroundColor}\n height={compact ? '24px' : 'auto'}\n minHeight={compact ? '24px' : '36px'}\n isDropIndicatorPositionInside={dropIndicatorPosition === DropIndicatorPosition.Inside}\n isDropValid={isDropValid}\n shouldDisplayHover={!isDndActive && !isDragging && !isDragOverlay}\n isDragOverlay={isDragOverlay}\n isDragging={isDragging}\n selected={noSelectionColumn && selection?.[row.uid] === true}\n isDisabled={disabledRows[row.uid]}\n data-testid={DATA_TESTID.DATA_TABLE_ROW_CONTENT}\n >\n <Cells\n row={row}\n isRowSelected={drilldownRowId === row.uid}\n isDragOverlay={isDragOverlay}\n key={row.uid}\n domIdAffix={domIdAffix}\n />\n </StyledCellContainer>\n {!isDragOverlay && isExpandable && row.isExpanded && Detail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C;AAAA,QACA,QAAQ,UAAU,SAAS;AAAA,QAC3B,WAAW,UAAU,SAAS;AAAA,QAC9B,+BAA+B,0BAA0B,sBAAsB;AAAA,QAC/E;AAAA,QACA,oBAAoB,CAAC,eAAe,CAAC,cAAc,CAAC;AAAA,QACpD;AAAA,QACA;AAAA,QACA,UAAU,qBAAqB,YAAY,IAAI,GAAG,MAAM;AAAA,QACxD,YAAY,aAAa,IAAI,GAAG;AAAA,QAChC,eAAa,YAAY;AAAA,QAEzB;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA,eAAe,mBAAmB,IAAI;AAAA,YACtC;AAAA,YAEA;AAAA;AAAA,UADK,IAAI;AAAA,QAEX;AAAA;AAAA,MAzBK,IAAI;AAAA,IA0BX;AAAA,IACC,CAAC,iBAAiB,gBAAgB,IAAI,cAAc,eACnD,oBAAC,kBACC,8BAAC,eAAY,KAAU,eAA8B,GACvD;AAAA,KAEJ;AAEJ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\nimport React, { useLayoutEffect, useMemo, useRef, type PropsWithChildren } from 'react';\nimport { INTERNAL_COLUMNS } from '../../addons/Columns/index.js';\nimport { DATA_TESTID, DropIndicatorPosition } from '../../configs/constants.js';\nimport { usePropsStore } from '../../configs/useStore/createInternalAndPropsContext.js';\nimport { Cells } from '../../parts/Cells/index.js';\nimport type { RowVariantProps } from '../../parts/RowVariants/types.js';\nimport type { DSDataTableT } from '../../react-desc-prop-types.js';\nimport { StyledCellContainer } from '../../styled.js';\n\nconst DetailsWrapper: React.ComponentType<PropsWithChildren> = (props) => (\n // This can be further customized\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions\n <div\n data-role=\"detail-view\"\n style={{\n borderTop: '1px solid #EBEDF0',\n borderBottom: '1px solid #EBEDF0',\n }}\n onClick={(e) => e.stopPropagation()}\n onKeyDown={(e) => e.stopPropagation()}\n >\n {props.children}\n </div>\n);\n\nconst getDefaultAriaLabelMessageForRow = ({\n row,\n selected,\n disabled,\n expanded,\n expandable,\n}: {\n row: DSDataTableT.InternalRow;\n selected: boolean;\n disabled: boolean;\n expanded: boolean;\n expandable: boolean;\n}) =>\n `Row number ${row.realIndex + 1}${row.parentIndex !== null ? `, child of row number ${row.parentIndex + 1}` : ''}. ${\n selected ? 'Selected. ' : ''\n }${disabled ? 'Disabled. ' : 'To interact with the cells press enter. '}${\n // eslint-disable-next-line no-nested-ternary\n expandable ? (expanded ? 'Expanded. ' : 'Collapsed. ') : ''\n }`;\n\nexport const DefaultRowContentRenderer: React.ComponentType<RowVariantProps> = (props) => {\n const {\n row,\n draggableProps,\n isDragOverlay,\n backgroundColor = 'neutral-000',\n dropIndicatorPosition,\n isDropValid,\n focusedRowId,\n drilldownRowId,\n compact,\n } = props;\n\n const isExpandable = usePropsStore((state) => state.isExpandable);\n const selection = usePropsStore((state) => state.selection);\n const noSelectionColumn = usePropsStore((state) => state.noSelectionColumn);\n const expandedRows = usePropsStore((state) => state.expandedRows);\n const disabledRows = usePropsStore((state) => state.disabledRows);\n const getAriaLabelForRow = usePropsStore((state) => state.getAriaLabelForRow);\n const visibleColumns = usePropsStore((state) => state.visibleColumns);\n const domIdAffix = usePropsStore((state) => state.domIdAffix);\n\n const rowRef = useRef<HTMLDivElement>(null);\n const isDndActive = draggableProps && draggableProps.active;\n const isDragging = draggableProps && draggableProps.isDragging;\n\n useLayoutEffect(() => {\n if (row.uid === focusedRowId) {\n rowRef.current?.focus();\n }\n }, [focusedRowId, row.uid]);\n\n const detailsIndent = useMemo(() => {\n let padding = 0;\n for (let i = 0; i < visibleColumns.length; i += 1) {\n if (INTERNAL_COLUMNS.includes(visibleColumns[i].id)) {\n padding += visibleColumns[i].width as number;\n } else {\n padding += row.depth * 32 + 15;\n break;\n }\n }\n return padding;\n }, [row.depth, visibleColumns]);\n\n const DetailsView = row.original.tableRowDetails;\n\n const rowAriaLabelProps = {\n row,\n selected: selection?.[row.uid] === true,\n disabled: disabledRows[row.uid],\n expandable: isExpandable,\n expanded: expandedRows[row.uid] === true,\n };\n\n return (\n <>\n <StyledCellContainer\n innerRef={rowRef}\n key={row.uid}\n tabIndex={0}\n role=\"row\"\n aria-rowindex={row.realIndex + 1}\n aria-label={(getAriaLabelForRow ?? getDefaultAriaLabelMessageForRow)(rowAriaLabelProps)}\n aria-selected={selection?.[row.uid] === true}\n aria-disabled={disabledRows[row.uid]}\n backgroundColor={backgroundColor}\n height={compact ? '24px' : 'auto'}\n minHeight={compact ? '24px' : '36px'}\n isDropIndicatorPositionInside={dropIndicatorPosition === DropIndicatorPosition.Inside}\n isDropValid={isDropValid}\n shouldDisplayHover={!isDndActive && !isDragging && !isDragOverlay}\n isDragOverlay={isDragOverlay}\n isDragging={isDragging}\n selected={noSelectionColumn && selection?.[row.uid] === true}\n isDisabled={disabledRows[row.uid]}\n data-testid={DATA_TESTID.DATA_TABLE_ROW_CONTENT}\n >\n <Cells\n row={row}\n isRowSelected={drilldownRowId === row.uid}\n isDragOverlay={isDragOverlay}\n key={row.uid}\n // @ts-expect-error - data-table typescript is broken\n domIdAffix={domIdAffix}\n />\n </StyledCellContainer>\n {!isDragOverlay && isExpandable && row.isExpanded && DetailsView && (\n <DetailsWrapper>\n <DetailsView row={row} detailsIndent={detailsIndent} />\n </DetailsWrapper>\n )}\n </>\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACarB,SAyFE,UAzFF,KAyFE,YAzFF;AAZF,SAAgB,iBAAiB,SAAS,cAAsC;AAChF,SAAS,wBAAwB;AACjC,SAAS,aAAa,6BAA6B;AACnD,SAAS,qBAAqB;AAC9B,SAAS,aAAa;AAGtB,SAAS,2BAA2B;AAEpC,MAAM,iBAAyD,CAAC;AAAA;AAAA;AAAA,EAG9D;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,OAAO;AAAA,QACL,WAAW;AAAA,QACX,cAAc;AAAA,MAChB;AAAA,MACA,SAAS,CAAC,MAAM,EAAE,gBAAgB;AAAA,MAClC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B,IAAI,cAAc,eACnD,oBAAC,kBACC,8BAAC,eAAY,KAAU,eAA8B,GACvD;AAAA,KAEJ;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -2,14 +2,14 @@ import * as React from "react";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { createElement } from "react";
4
4
  import { useContext } from "react";
5
+ import { DATA_TESTID } from "../../configs/constants.js";
6
+ import { usePropsStore } from "../../configs/useStore/createInternalAndPropsContext.js";
7
+ import { DropIndicator } from "../../parts/DropIndicator.js";
8
+ import { SortableItemContext } from "../../parts/HoC/SortableItemContext.js";
5
9
  import { StyledFullsizeGrid } from "../../styled.js";
6
10
  import { DefaultRowContentRenderer } from "./DefaultRowContentRenderer.js";
7
11
  import { useRowRendererHandlers } from "./useRowRendererHandlers.js";
8
12
  import { useRowRendererProperties } from "./useRowRendererProperties.js";
9
- import { DropIndicator } from "../../parts/DropIndicator.js";
10
- import { SortableItemContext } from "../../parts/HoC/SortableItemContext.js";
11
- import { DATA_TESTID } from "../../configs/constants.js";
12
- import { usePropsStore } from "../../configs/useStore/useStore.js";
13
13
  const magicDottedBorder = /* @__PURE__ */ jsx("svg", { width: "100%", height: "1px", children: /* @__PURE__ */ jsx(
14
14
  "line",
15
15
  {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/RowRenderer/index.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useContext } from 'react';\nimport type { XstyledProps } from '@elliemae/ds-props-helpers';\nimport type { RowVariantProps } from '../../parts/RowVariants/types.js';\nimport { StyledFullsizeGrid } from '../../styled.js';\nimport type { DSDataTableT } from '../../react-desc-prop-types.js';\nimport { DefaultRowContentRenderer } from './DefaultRowContentRenderer.js';\nimport { useRowRendererHandlers } from './useRowRendererHandlers.js';\nimport { useRowRendererProperties } from './useRowRendererProperties.js';\nimport { DropIndicator } from '../../parts/DropIndicator.js';\nimport { SortableItemContext } from '../../parts/HoC/SortableItemContext.js';\nimport { DATA_TESTID } from '../../configs/constants.js';\nimport { usePropsStore } from '../../configs/useStore/useStore.js';\n\ninterface RowRendererProps {\n row: DSDataTableT.InternalRow;\n compact?: boolean;\n itemIndex: number;\n isDragOverlay: boolean;\n minHeight: string;\n height: string;\n rowsLayout?: string[] | number[];\n CustomRowContentRenderer?: React.ComponentType<RowVariantProps>;\n focusedRowId: string | null;\n drilldownRowId: string | null;\n backgroundColor?: XstyledProps['backgroundColor'];\n}\n\n// CSS don't let us modify the spacing between the dots, so one solution is to use SVG\nconst magicDottedBorder = (\n <svg width=\"100%\" height=\"1px\">\n <line\n x1=\"0\"\n y1=\"0\"\n x2=\"100%\"\n y2=\"0\"\n stroke=\"#B0B9C8FF\"\n strokeWidth=\"1.5\"\n strokeDasharray=\"0, 5\"\n strokeDashoffset=\"0\"\n strokeLinecap=\"round\"\n />\n </svg>\n);\n\nconst RowRenderer: React.ComponentType<RowRendererProps> = (props) => {\n const {\n row,\n itemIndex,\n minHeight = '36px',\n height = 'auto',\n rowsLayout = [1],\n CustomRowContentRenderer,\n focusedRowId,\n drilldownRowId,\n isDragOverlay,\n } = props;\n\n const flattenedData = usePropsStore((state) => state.flattenedData);\n const { draggableProps } = useContext(SortableItemContext);\n const getOwnerProps = usePropsStore((store) => store.get);\n\n // ===========================================================================\n // Properties for the row\n // ===========================================================================\n\n const { userDataProperties, rowStyle, shouldAppendDottedBorder, dropIndicatorPosition, isDropValid } =\n useRowRendererProperties({\n row,\n });\n\n // ===========================================================================\n // Handlers\n // ===========================================================================\n\n const { handleItemClick, handleKeyDown, handleOnBlur, handleOnFocus } = useRowRendererHandlers({\n row,\n itemIndex,\n items: flattenedData,\n draggableProps,\n isDragOverlay,\n drilldownRowId,\n });\n\n const rowContentProps: RowVariantProps = {\n ...props,\n focusedRowId,\n drilldownRowId,\n draggableProps,\n dropIndicatorPosition,\n isDropValid,\n };\n\n return (\n <StyledFullsizeGrid\n data-testid={DATA_TESTID.DATA_TABLE_ROW}\n key={row.uid}\n {...userDataProperties}\n style={rowStyle}\n onClick={handleItemClick}\n onKeyDown={handleKeyDown}\n onBlur={handleOnBlur}\n onFocus={handleOnFocus}\n data-expandable={Boolean(row.original.tableRowDetails)}\n data-is-row-expanded={row.isExpanded}\n rows={rowsLayout}\n minHeight={minHeight}\n height={height}\n getOwnerProps={getOwnerProps}\n >\n {CustomRowContentRenderer ? (\n <CustomRowContentRenderer {...rowContentProps} />\n ) : (\n <DefaultRowContentRenderer {...rowContentProps} key={row.uid} />\n )}\n {shouldAppendDottedBorder && !isDragOverlay && magicDottedBorder}\n <DropIndicator\n vertical={false}\n dropIndicatorPosition={dropIndicatorPosition}\n isDropValid={isDropValid}\n isLast={row.index === flattenedData.length - 1 && draggableProps && draggableProps.isDragging}\n />\n </StyledFullsizeGrid>\n );\n};\n\nexport { RowRenderer };\n"],
5
- "mappings": "AAAA,YAAY,WAAW;AC+BnB,cA+DA,YA/DA;AAkFI;AAhHR,SAAgB,kBAAkB;AAGlC,SAAS,0BAA0B;AAEnC,SAAS,iCAAiC;AAC1C,SAAS,8BAA8B;AACvC,SAAS,gCAAgC;AACzC,SAAS,qBAAqB;AAC9B,SAAS,2BAA2B;AACpC,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAiB9B,MAAM,oBACJ,oBAAC,SAAI,OAAM,QAAO,QAAO,OACvB;AAAA,EAAC;AAAA;AAAA,IACC,IAAG;AAAA,IACH,IAAG;AAAA,IACH,IAAG;AAAA,IACH,IAAG;AAAA,IACH,QAAO;AAAA,IACP,aAAY;AAAA,IACZ,iBAAgB;AAAA,IAChB,kBAAiB;AAAA,IACjB,eAAc;AAAA;AAChB,GACF;AAGF,MAAM,cAAqD,CAAC,UAAU;AACpE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,aAAa,CAAC,CAAC;AAAA,I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-lines */\nimport type { XstyledProps } from '@elliemae/ds-props-helpers';\nimport React, { useContext } from 'react';\nimport { DATA_TESTID } from '../../configs/constants.js';\nimport { usePropsStore } from '../../configs/useStore/createInternalAndPropsContext.js';\nimport { DropIndicator } from '../../parts/DropIndicator.js';\nimport { SortableItemContext } from '../../parts/HoC/SortableItemContext.js';\nimport type { RowVariantProps } from '../../parts/RowVariants/types.js';\nimport type { DSDataTableT } from '../../react-desc-prop-types.js';\nimport { StyledFullsizeGrid } from '../../styled.js';\nimport { DefaultRowContentRenderer } from './DefaultRowContentRenderer.js';\nimport { useRowRendererHandlers } from './useRowRendererHandlers.js';\nimport { useRowRendererProperties } from './useRowRendererProperties.js';\n\ninterface RowRendererProps {\n row: DSDataTableT.InternalRow;\n compact?: boolean;\n itemIndex: number;\n isDragOverlay: boolean;\n minHeight: string;\n height: string;\n rowsLayout?: string[] | number[];\n CustomRowContentRenderer?: React.ComponentType<RowVariantProps>;\n focusedRowId: string | null;\n drilldownRowId: string | null;\n backgroundColor?: XstyledProps['backgroundColor'];\n}\n\n// CSS don't let us modify the spacing between the dots, so one solution is to use SVG\nconst magicDottedBorder = (\n <svg width=\"100%\" height=\"1px\">\n <line\n x1=\"0\"\n y1=\"0\"\n x2=\"100%\"\n y2=\"0\"\n stroke=\"#B0B9C8FF\"\n strokeWidth=\"1.5\"\n strokeDasharray=\"0, 5\"\n strokeDashoffset=\"0\"\n strokeLinecap=\"round\"\n />\n </svg>\n);\n\nconst RowRenderer: React.ComponentType<RowRendererProps> = (props) => {\n const {\n row,\n itemIndex,\n minHeight = '36px',\n height = 'auto',\n rowsLayout = [1],\n CustomRowContentRenderer,\n focusedRowId,\n drilldownRowId,\n isDragOverlay,\n } = props;\n\n const flattenedData = usePropsStore((state) => state.flattenedData);\n const { draggableProps } = useContext(SortableItemContext);\n const getOwnerProps = usePropsStore((store) => store.get);\n\n // ===========================================================================\n // Properties for the row\n // ===========================================================================\n\n const { userDataProperties, rowStyle, shouldAppendDottedBorder, dropIndicatorPosition, isDropValid } =\n useRowRendererProperties({\n row,\n });\n\n // ===========================================================================\n // Handlers\n // ===========================================================================\n\n const { handleItemClick, handleKeyDown, handleOnBlur, handleOnFocus } = useRowRendererHandlers({\n row,\n itemIndex,\n items: flattenedData,\n draggableProps,\n isDragOverlay,\n drilldownRowId,\n });\n\n const rowContentProps: RowVariantProps = {\n ...props,\n focusedRowId,\n drilldownRowId,\n draggableProps,\n dropIndicatorPosition,\n isDropValid,\n };\n\n return (\n <StyledFullsizeGrid\n data-testid={DATA_TESTID.DATA_TABLE_ROW}\n key={row.uid}\n {...userDataProperties}\n style={rowStyle}\n onClick={handleItemClick}\n onKeyDown={handleKeyDown}\n onBlur={handleOnBlur}\n onFocus={handleOnFocus}\n data-expandable={Boolean(row.original.tableRowDetails)}\n data-is-row-expanded={row.isExpanded}\n rows={rowsLayout}\n minHeight={minHeight}\n height={height}\n getOwnerProps={getOwnerProps}\n >\n {CustomRowContentRenderer ? (\n <CustomRowContentRenderer {...rowContentProps} />\n ) : (\n <DefaultRowContentRenderer {...rowContentProps} key={row.uid} />\n )}\n {shouldAppendDottedBorder && !isDragOverlay && magicDottedBorder}\n <DropIndicator\n vertical={false}\n dropIndicatorPosition={dropIndicatorPosition}\n isDropValid={isDropValid}\n isLast={row.index === flattenedData.length - 1 && draggableProps && draggableProps.isDragging}\n />\n </StyledFullsizeGrid>\n );\n};\n\nexport { RowRenderer };\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;AC+BnB,cA+DA,YA/DA;AAkFI;AA/GR,SAAgB,kBAAkB;AAClC,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAC9B,SAAS,2BAA2B;AAGpC,SAAS,0BAA0B;AACnC,SAAS,iCAAiC;AAC1C,SAAS,8BAA8B;AACvC,SAAS,gCAAgC;AAiBzC,MAAM,oBACJ,oBAAC,SAAI,OAAM,QAAO,QAAO,OACvB;AAAA,EAAC;AAAA;AAAA,IACC,IAAG;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AAK;AAAA,QAE/D,4BAA4B,CAAC,iBAAiB;AAAA,QAC/C;AAAA,UAAC;AAAA;AAAA,YACC,UAAU;AAAA,YACV;AAAA,YACA;AAAA,YACA,QAAQ,IAAI,UAAU,cAAc,SAAS,KAAK,kBAAkB,eAAe;AAAA;AAAA,QACrF;AAAA;AAAA;AAAA,IAzBK,IAAI;AAAA,EA0BX;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { useCallback } from "react";
3
- import { useInternalStore, usePropsStore } from "../../configs/useStore/useStore.js";
3
+ import { useInternalStore, usePropsStore } from "../../configs/useStore/createInternalAndPropsContext.js";
4
4
  const useRowRendererHandlers = ({
5
5
  row,
6
6
  itemIndex,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/RowRenderer/useRowRendererHandlers.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-depth */\n/* eslint-disable max-statements */\n/* eslint-disable complexity */\nimport type React from 'react';\nimport { useCallback } from 'react';\nimport type { SortableItemContextType } from '../../parts/HoC/SortableItemContext.js';\nimport type { DSDataTableT } from '../../react-desc-prop-types.js';\nimport { useInternalStore, usePropsStore } from '../../configs/useStore/useStore.js';\n\nexport const useRowRendererHandlers = ({\n row,\n itemIndex,\n items,\n draggableProps,\n isDragOverlay,\n drilldownRowId,\n}: {\n row: DSDataTableT.InternalRow;\n itemIndex: number;\n items: DSDataTableT.InternalRow[];\n draggableProps: SortableItemContextType['draggableProps'];\n isDragOverlay: boolean;\n drilldownRowId: string | null;\n}): {\n handleItemClick: React.MouseEventHandler;\n handleKeyDown: React.KeyboardEventHandler;\n handleOnBlur: React.FocusEventHandler;\n handleOnFocus: React.FocusEventHandler;\n} => {\n const onRowClick = usePropsStore((state) => state.onRowClick);\n const onSelectionChange = usePropsStore((state) => state.onSelectionChange);\n const selectSingle = usePropsStore((state) => state.selectSingle);\n const selection = usePropsStore((state) => state.selection);\n const onRowFocus = usePropsStore((state) => state.onRowFocus);\n const disabledRows = usePropsStore((state) => state.disabledRows);\n const lastSelected = usePropsStore((state) => state.lastSelected);\n const flattenedData = usePropsStore((state) => state.flattenedData);\n const { scrollToIndex } = usePropsStore((state) => state.virtualListHelpers);\n const setDrilldownRowId = useInternalStore((state) => state.setDrilldownRowId);\n const setFocusedRowId = useInternalStore((state) => state.setFocusedRowId);\n\n const findInCircularList = (\n list: DSDataTableT.InternalRow[],\n from: number,\n step = 1,\n // eslint-disable-next-line max-params\n ): number => {\n for (\n let i = (from + step + list.length) % list.length;\n i !== from && from > -1;\n i = (i + step + list.length) % list.length\n ) {\n return i;\n }\n return from; // return same item\n };\n\n const handleItemClick = useCallback(\n (e: React.MouseEvent | React.KeyboardEvent, { original, uid } = row) => {\n if (disabledRows[uid]) return;\n onRowClick(original, e, uid);\n if (selection && onSelectionChange) {\n if (selectSingle) {\n onSelectionChange({ [uid]: true }, uid, e);\n } else {\n const newSelection = { ...selection, [uid]: !selection[uid] }; // we only want true and mixed values\n if (!newSelection[uid]) delete newSelection[uid]; // if newState is false, remove from the new selection\n const now = Number.parseInt(uid, 10);\n if (e.shiftKey && lastSelected.current > -1) {\n for (let i = Math.min(lastSelected.current, now); i <= Math.max(lastSelected.current, now); i += 1) {\n const correctDataIndex = flattenedData[i]?.id;\n if (!Object.keys(disabledRows).includes(correctDataIndex))\n newSelection[correctDataIndex] = newSelection[lastSelected.current];\n if (!newSelection[correctDataIndex]) delete newSelection[correctDataIndex];\n }\n }\n lastSelected.current = now;\n\n onSelectionChange(newSelection, uid, e);\n }\n }\n onRowFocus(\n {\n itemIndex,\n scrollToItem: (\n opts: { align: 'auto' | 'start' | 'center' | 'end' } = {\n align: 'start',\n },\n ) => scrollToIndex(itemIndex, opts),\n original,\n },\n e,\n );\n },\n [\n row,\n disabledRows,\n onRowClick,\n selection,\n onSelectionChange,\n onRowFocus,\n itemIndex,\n selectSingle,\n lastSelected,\n flattenedData,\n scrollToIndex,\n ],\n );\n\n const isActive = draggableProps && draggableProps.active;\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (isDragOverlay || isActive) {\n e.preventDefault();\n return;\n }\n const { target } = e;\n const isChildEvent = (target as HTMLElement).getAttribute('role') !== 'row'; // if the event comes from a row\n\n if (e.code === 'Enter') {\n if (!isChildEvent) {\n e.preventDefault();\n if (drilldownRowId !== row.uid) {\n setDrilldownRowId(row.uid);\n setTimeout(() => {\n const focuseableCell = row.cells.find((cell) => cell.ref.current !== null);\n if (focuseableCell) focuseableCell.ref.current?.focus?.();\n });\n }\n }\n }\n if (e.code === 'Space') {\n if (!isChildEvent) {\n e.preventDefault();\n }\n handleItemClick(e, row);\n }\n if (e.code === 'ArrowDown') {\n e.preventDefault();\n e.stopPropagation();\n const next = findInCircularList(items, itemIndex);\n setFocusedRowId(items[next].uid);\n }\n if (e.code === 'ArrowUp') {\n e.preventDefault();\n const prev = findInCircularList(items, itemIndex, -1);\n setFocusedRowId(items[prev].uid);\n }\n },\n [\n isDragOverlay,\n isActive,\n drilldownRowId,\n row,\n setDrilldownRowId,\n handleItemClick,\n items,\n itemIndex,\n setFocusedRowId,\n ],\n );\n\n const handleOnBlur: React.FocusEventHandler = useCallback(\n (e) => {\n if (e.relatedTarget?.getAttribute('role') === 'row') {\n setDrilldownRowId(null);\n }\n },\n [setDrilldownRowId],\n );\n\n const handleOnFocus: React.FocusEventHandler = useCallback(\n (e) => {\n if (e.target && e.target.getAttribute('role') === 'row') {\n setFocusedRowId(row.uid);\n }\n },\n [row.uid, setFocusedRowId],\n );\n\n return { handleItemClick, handleKeyDown, handleOnBlur, handleOnFocus };\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACIvB,SAAS,mBAAmB;AAG5B,SAAS,kBAAkB,qBAAqB;AAEzC,MAAM,yBAAyB,CAAC;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAA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AI,YAAY,IAAI;AACzE,kBAAI,eAAgB,gBAAe,IAAI,SAAS,QAAQ;AAAA,YAC1D,CAAC;AAAA,UACH;AAAA,QACF;AAAA,MACF;AACA,UAAI,EAAE,SAAS,SAAS;AACtB,YAAI,CAAC,cAAc;AACjB,YAAE,eAAe;AAAA,QACnB;AACA,wBAAgB,GAAG,GAAG;AAAA,MACxB;AACA,UAAI,EAAE,SAAS,aAAa;AAC1B,UAAE,eAAe;AACjB,UAAE,gBAAgB;AAClB,cAAM,OAAO,mBAAmB,OAAO,SAAS;AAChD,wBAAgB,MAAM,IAAI,EAAE,GAAG;AAAA,MACjC;AACA,UAAI,EAAE,SAAS,WAAW;AACxB,UAAE,eAAe;AACjB,cAAM,OAAO,mBAAmB,OAAO,WAAW,EAAE;AACpD,wBAAgB,MAAM,IAAI,EAAE,GAAG;AAAA,MACjC;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,QAAM,eAAwC;AAAA,IAC5C,CAAC,MAAM;AACL,UAAI,EAAE,eAAe,aAAa,MAAM,MAAM,OAAO;AACnD,0BAAkB,IAAI;AAAA,MACxB;AAAA,IACF;AAAA,IACA,CAAC,iBAAiB;AAAA,EACpB;AAEA,QAAM,gBAAyC;AAAA,IAC7C,CAAC,MAAM;AACL,UAAI,EAAE,UAAU,EAAE,OAAO,aAAa,MAAM,MAAM,OAAO;AACvD,wBAAgB,IAAI,GAAG;AAAA,MACzB;AAAA,IACF;AAAA,IACA,CAAC,IAAI,KAAK,eAAe;AAAA,EAC3B;AAEA,SAAO,EAAE,iBAAiB,eAAe,cAAc,cAAc;AACvE;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-depth */\n/* eslint-disable max-statements */\n/* eslint-disable complexity */\nimport type React from 'react';\nimport { useCallback } from 'react';\nimport { useInternalStore, usePropsStore } from '../../configs/useStore/createInternalAndPropsContext.js';\nimport type { SortableItemContextType } from '../../parts/HoC/SortableItemContext.js';\nimport type { DSDataTableT } from '../../react-desc-prop-types.js';\n\nexport const useRowRendererHandlers = ({\n row,\n itemIndex,\n items,\n draggableProps,\n isDragOverlay,\n drilldownRowId,\n}: {\n row: DSDataTableT.InternalRow;\n itemIndex: number;\n items: DSDataTableT.InternalRow[];\n draggableProps: SortableItemContextType['draggableProps'];\n isDragOverlay: boolean;\n drilldownRowId: string | null;\n}): {\n handleItemClick: React.MouseEventHandler;\n handleKeyDown: React.KeyboardEventHandler;\n handleOnBlur: React.FocusEventHandler;\n handleOnFocus: React.FocusEventHandler;\n} => {\n const onRowClick = usePropsStore((state) => state.onRowClick);\n const onSelectionChange = usePropsStore((state) => state.onSelectionChange);\n const selectSingle = usePropsStore((state) => state.selectSingle);\n const selection = usePropsStore((state) => state.selection);\n const onRowFocus = usePropsStore((state) => state.onRowFocus);\n const disabledRows = usePropsStore((state) => state.disabledRows);\n const lastSelected = usePropsStore((state) => state.lastSelected);\n const flattenedData = usePropsStore((state) => state.flattenedData);\n const { scrollToIndex } = usePropsStore((state) => state.virtualListHelpers);\n const setDrilldownRowId = useInternalStore((state) => state.setDrilldownRowId);\n const setFocusedRowId = useInternalStore((state) => state.setFocusedRowId);\n\n const findInCircularList = (\n list: DSDataTableT.InternalRow[],\n from: number,\n step = 1,\n // eslint-disable-next-line max-params\n ): number => {\n // the following loop is dark magic, requires a PHD in math to understand what's going on, but it works so...\n // eslint-disable-next-line no-unreachable-loop\n for (\n let i = (from + step + list.length) % list.length;\n i !== from && from > -1;\n i = (i + step + list.length) % list.length\n ) {\n return i;\n }\n return from; // return same item\n };\n\n const handleItemClick = useCallback(\n (e: React.MouseEvent | React.KeyboardEvent, { original, uid } = row) => {\n if (disabledRows[uid]) return;\n onRowClick(original, e, uid);\n if (selection && onSelectionChange) {\n if (selectSingle) {\n onSelectionChange({ [uid]: true }, uid, e);\n } else {\n const newSelection = { ...selection, [uid]: !selection[uid] }; // we only want true and mixed values\n if (!newSelection[uid]) delete newSelection[uid]; // if newState is false, remove from the new selection\n const now = Number.parseInt(uid, 10);\n if (e.shiftKey && lastSelected.current > -1) {\n for (let i = Math.min(lastSelected.current, now); i <= Math.max(lastSelected.current, now); i += 1) {\n const correctDataIndex = flattenedData[i]?.id;\n if (!Object.keys(disabledRows).includes(correctDataIndex))\n newSelection[correctDataIndex] = newSelection[lastSelected.current];\n if (!newSelection[correctDataIndex]) delete newSelection[correctDataIndex];\n }\n }\n lastSelected.current = now;\n\n onSelectionChange(newSelection, uid, e);\n }\n }\n onRowFocus(\n {\n itemIndex,\n scrollToItem: (\n opts: { align: 'auto' | 'start' | 'center' | 'end' } = {\n align: 'start',\n },\n ) => scrollToIndex(itemIndex, opts),\n original,\n },\n e,\n );\n },\n [\n row,\n disabledRows,\n onRowClick,\n selection,\n onSelectionChange,\n onRowFocus,\n itemIndex,\n selectSingle,\n lastSelected,\n flattenedData,\n scrollToIndex,\n ],\n );\n\n const isActive = draggableProps && draggableProps.active;\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (isDragOverlay || isActive) {\n e.preventDefault();\n return;\n }\n const { target } = e;\n const isChildEvent = (target as HTMLElement).getAttribute('role') !== 'row'; // if the event comes from a row\n\n if (e.code === 'Enter') {\n if (!isChildEvent) {\n e.preventDefault();\n if (drilldownRowId !== row.uid) {\n setDrilldownRowId(row.uid);\n setTimeout(() => {\n const focuseableCell = row.cells.find((cell) => cell.ref.current !== null);\n if (focuseableCell) focuseableCell.ref.current?.focus?.();\n });\n }\n }\n }\n if (e.code === 'Space') {\n if (!isChildEvent) {\n e.preventDefault();\n }\n handleItemClick(e, row);\n }\n if (e.code === 'ArrowDown') {\n e.preventDefault();\n e.stopPropagation();\n const next = findInCircularList(items, itemIndex);\n setFocusedRowId(items[next].uid);\n }\n if (e.code === 'ArrowUp') {\n e.preventDefault();\n const prev = findInCircularList(items, itemIndex, -1);\n setFocusedRowId(items[prev].uid);\n }\n },\n [\n isDragOverlay,\n isActive,\n drilldownRowId,\n row,\n setDrilldownRowId,\n handleItemClick,\n items,\n itemIndex,\n setFocusedRowId,\n ],\n );\n\n const handleOnBlur: React.FocusEventHandler = useCallback(\n (e) => {\n if (e.relatedTarget?.getAttribute('role') === 'row') {\n setDrilldownRowId(null);\n }\n },\n [setDrilldownRowId],\n );\n\n const handleOnFocus: React.FocusEventHandler = useCallback(\n (e) => {\n if (e.target && e.target.getAttribute('role') === 'row') {\n setFocusedRowId(row.uid);\n }\n },\n [row.uid, setFocusedRowId],\n );\n\n return { handleItemClick, handleKeyDown, handleOnBlur, handleOnFocus };\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACIvB,SAAS,mBAAmB;AAC5B,SAAS,kBAAkB,qBAAqB;AAIzC,MAAM,yBAAyB,CAAC;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAYK;AACH,QAAM,aAAa,cAAc,CAAC,UAAU,MAAM,UAAU;AAC5D,QAAM,oBAAoB,cAAc,CAAC,UAAU,MAAM,iBAAiB;AAC1E,QAAM,eAAe,cAAc,CAAC,UAAU,MAAM,YAAY;AAChE,QAAM,YAAY,cAAc,CAAC,UAAU,MAAM,SAAS;AAC1D,QAAM,aAAa,cAAc,CAAC,UAAU,MAAM,UAAU;AAC5D,QAAM,eAAe,cAAc,CAAC,UAAU,MAAM,YAAY;AAChE,QAAM,eAAe,cAAc,CAAC,UAAU,MAAM,YAAY;AAChE,QAAM,gBAAgB,cAAc,CAAC,UAAU,MAAM,aAAa;AAClE,QAAM,EAAE,cAAc,IAAI,cAAc,CAAC,UAAU,MAAM,kBAAkB;AAC3E,QAAM,oBAAoB,iBAAiB,CAAC,UAAU,MAAM,iBAAiB;AAC7E,QAAM,kBAAkB,iBAAiB,CAAC,UAAU,MAAM,eAAe;AAEzE,QAAM,qBAAqB,CACzB,MACA,MACA,OA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,MACA;AAAA,IACF;AAAA,EACF;AAEA,QAAM,eAAwC;AAAA,IAC5C,CAAC,MAAM;AACL,UAAI,EAAE,eAAe,aAAa,MAAM,MAAM,OAAO;AACnD,0BAAkB,IAAI;AAAA,MACxB;AAAA,IACF;AAAA,IACA,CAAC,iBAAiB;AAAA,EACpB;AAEA,QAAM,gBAAyC;AAAA,IAC7C,CAAC,MAAM;AACL,UAAI,EAAE,UAAU,EAAE,OAAO,aAAa,MAAM,MAAM,OAAO;AACvD,wBAAgB,IAAI,GAAG;AAAA,MACzB;AAAA,IACF;AAAA,IACA,CAAC,IAAI,KAAK,eAAe;AAAA,EAC3B;AAEA,SAAO,EAAE,iBAAiB,eAAe,cAAc,cAAc;AACvE;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { useMemo } from "react";
3
+ import { usePropsStore } from "../../configs/useStore/createInternalAndPropsContext.js";
3
4
  import { useRowStyle } from "./useRowStyle.js";
4
- import { usePropsStore } from "../../configs/useStore/useStore.js";
5
5
  const useRowRendererProperties = ({
6
6
  row
7
7
  }) => {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/RowRenderer/useRowRendererProperties.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useMemo } from 'react';\nimport type { DSDataTableT } from '../../react-desc-prop-types.js';\nimport { useRowStyle } from './useRowStyle.js';\nimport { usePropsStore } from '../../configs/useStore/useStore.js';\n\nexport const useRowRendererProperties = ({\n row,\n}: {\n row: DSDataTableT.InternalRow;\n}): {\n userDataProperties: Record<string, unknown>;\n colsLayoutStyle: DSDataTableT.ColsLayoutStyleValues;\n} & ReturnType<typeof useRowStyle> => {\n const colsLayoutStyle = usePropsStore((state) => state.colsLayoutStyle);\n\n const userDataProperties = useMemo(\n () =>\n Object.keys(row.original).reduce(\n (acc, cur) => {\n if (cur.startsWith('data-')) acc[cur] = row.original[cur];\n return acc;\n },\n {} as Record<string, unknown>,\n ),\n [row],\n );\n\n const styleRelatedProps = useRowStyle(row);\n\n return {\n userDataProperties,\n colsLayoutStyle,\n ...styleRelatedProps,\n };\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,eAAe;AAExB,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAEvB,MAAM,2BAA2B,CAAC;AAAA,EACvC;AACF,MAKsC;AACpC,QAAM,kBAAkB,cAAc,CAAC,UAAU,MAAM,eAAe;AAEtE,QAAM,qBAAqB;AAAA,IACzB,MACE,OAAO,KAAK,IAAI,QAAQ,EAAE;AAAA,MACxB,CAAC,KAAK,QAAQ;AACZ,YAAI,IAAI,WAAW,OAAO,EAAG,KAAI,GAAG,IAAI,IAAI,SAAS,GAAG;AACxD,eAAO;AAAA,MACT;AAAA,MACA,CAAC;AAAA,IACH;AAAA,IACF,CAAC,GAAG;AAAA,EACN;AAEA,QAAM,oBAAoB,YAAY,GAAG;AAEzC,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL;AACF;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useMemo } from 'react';\nimport { usePropsStore } from '../../configs/useStore/createInternalAndPropsContext.js';\nimport type { DSDataTableT } from '../../react-desc-prop-types.js';\nimport { useRowStyle } from './useRowStyle.js';\n\nexport const useRowRendererProperties = ({\n row,\n}: {\n row: DSDataTableT.InternalRow;\n}): {\n userDataProperties: Record<string, unknown>;\n colsLayoutStyle: DSDataTableT.ColsLayoutStyleValues;\n} & ReturnType<typeof useRowStyle> => {\n const colsLayoutStyle = usePropsStore((state) => state.colsLayoutStyle);\n\n const userDataProperties = useMemo(\n () =>\n Object.keys(row.original).reduce(\n (acc, cur) => {\n if (cur.startsWith('data-')) acc[cur] = row.original[cur];\n return acc;\n },\n {} as Record<string, unknown>,\n ),\n [row],\n );\n\n const styleRelatedProps = useRowStyle(row);\n\n return {\n userDataProperties,\n colsLayoutStyle,\n ...styleRelatedProps,\n };\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,eAAe;AACxB,SAAS,qBAAqB;AAE9B,SAAS,mBAAmB;AAErB,MAAM,2BAA2B,CAAC;AAAA,EACvC;AACF,MAKsC;AACpC,QAAM,kBAAkB,cAAc,CAAC,UAAU,MAAM,eAAe;AAEtE,QAAM,qBAAqB;AAAA,IACzB,MACE,OAAO,KAAK,IAAI,QAAQ,EAAE;AAAA,MACxB,CAAC,KAAK,QAAQ;AACZ,YAAI,IAAI,WAAW,OAAO,EAAG,KAAI,GAAG,IAAI,IAAI,SAAS,GAAG;AACxD,eAAO;AAAA,MACT;AAAA,MACA,CAAC;AAAA,IACH;AAAA,IACF,CAAC,GAAG;AAAA,EACN;AAEA,QAAM,oBAAoB,YAAY,GAAG;AAEzC,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL;AACF;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { useContext, useMemo } from "react";
3
+ import { usePropsStore } from "../../configs/useStore/createInternalAndPropsContext.js";
3
4
  import { SortableItemContext } from "../../parts/HoC/SortableItemContext.js";
4
- import { usePropsStore } from "../../configs/useStore/useStore.js";
5
5
  const useRowStyle = (row) => {
6
6
  const flattenedData = usePropsStore((state) => state.flattenedData);
7
7
  const { draggableProps } = useContext(SortableItemContext);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/RowRenderer/useRowStyle.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useContext, useMemo } from 'react';\nimport { SortableItemContext } from '../../parts/HoC/SortableItemContext.js';\nimport type { DSDataTableT } from '../../react-desc-prop-types.js';\nimport { usePropsStore } from '../../configs/useStore/useStore.js';\n\nexport const useRowStyle = (\n row: DSDataTableT.InternalRow,\n): {\n rowStyle: Record<string, unknown>;\n shouldAppendDottedBorder: boolean;\n dropIndicatorPosition: false | DSDataTableT.DropIndicatorPositionValues;\n isDropValid: boolean;\n} => {\n const flattenedData = usePropsStore((state) => state.flattenedData);\n\n const { draggableProps } = useContext(SortableItemContext);\n\n // ---------------------------------------------------------------------------\n // Border calculation\n // ---------------------------------------------------------------------------\n const [borderTop, borderBottom, shouldAppendDottedBorder]: [string, string, boolean] = useMemo(() => {\n if (row.original.dimsumHeaderValue) {\n return ['none', 'none', false];\n }\n if (row.isExpanded && row.original.subRows && row.depth === 0) {\n return ['1px solid #EBEDF0', 'none', true];\n }\n\n if (row.depth >= 1) {\n if (row.realIndex < flattenedData.length - 1 && flattenedData[row.realIndex + 1].depth === 0) {\n return ['none', '2px solid #EBEDF0', false];\n }\n return ['none', 'none', true];\n }\n\n return ['none', '1px solid #EBEDF0', false];\n }, [row, flattenedData]);\n\n const rowStyle = useMemo(() => ({ borderTop, borderBottom }), [borderTop, borderBottom]);\n\n const dropIndicatorPosition =\n draggableProps && draggableProps.shouldShowDropIndicatorPosition && draggableProps.dropIndicatorPosition;\n const isDropValid = draggableProps && draggableProps.isDropValid;\n\n return {\n rowStyle,\n shouldAppendDottedBorder,\n dropIndicatorPosition,\n isDropValid,\n };\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,YAAY,eAAe;AACpC,SAAS,2BAA2B;AAEpC,SAAS,qBAAqB;AAEvB,MAAM,cAAc,CACzB,QAMG;AACH,QAAM,gBAAgB,cAAc,CAAC,UAAU,MAAM,aAAa;AAElE,QAAM,EAAE,eAAe,IAAI,WAAW,mBAAmB;AAKzD,QAAM,CAAC,WAAW,cAAc,wBAAwB,IAA+B,QAAQ,MAAM;AACnG,QAAI,IAAI,SAAS,mBAAmB;AAClC,aAAO,CAAC,QAAQ,QAAQ,KAAK;AAAA,IAC/B;AACA,QAAI,IAAI,cAAc,IAAI,SAAS,WAAW,IAAI,UAAU,GAAG;AAC7D,aAAO,CAAC,qBAAqB,QAAQ,IAAI;AAAA,IAC3C;AAEA,QAAI,IAAI,SAAS,GAAG;AAClB,UAAI,IAAI,YAAY,cAAc,SAAS,KAAK,cAAc,IAAI,YAAY,CAAC,EAAE,UAAU,GAAG;AAC5F,eAAO,CAAC,QAAQ,qBAAqB,KAAK;AAAA,MAC5C;AACA,aAAO,CAAC,QAAQ,QAAQ,IAAI;AAAA,IAC9B;AAEA,WAAO,CAAC,QAAQ,qBAAqB,KAAK;AAAA,EAC5C,GAAG,CAAC,KAAK,aAAa,CAAC;AAEvB,QAAM,WAAW,QAAQ,OAAO,EAAE,WAAW,aAAa,IAAI,CAAC,WAAW,YAAY,CAAC;AAEvF,QAAM,wBACJ,kBAAkB,eAAe,mCAAmC,eAAe;AACrF,QAAM,cAAc,kBAAkB,eAAe;AAErD,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useContext, useMemo } from 'react';\nimport { usePropsStore } from '../../configs/useStore/createInternalAndPropsContext.js';\nimport { SortableItemContext } from '../../parts/HoC/SortableItemContext.js';\nimport type { DSDataTableT } from '../../react-desc-prop-types.js';\n\nexport const useRowStyle = (\n row: DSDataTableT.InternalRow,\n): {\n rowStyle: Record<string, unknown>;\n shouldAppendDottedBorder: boolean;\n dropIndicatorPosition: false | DSDataTableT.DropIndicatorPositionValues;\n isDropValid: boolean;\n} => {\n const flattenedData = usePropsStore((state) => state.flattenedData);\n\n const { draggableProps } = useContext(SortableItemContext);\n\n // ---------------------------------------------------------------------------\n // Border calculation\n // ---------------------------------------------------------------------------\n const [borderTop, borderBottom, shouldAppendDottedBorder]: [string, string, boolean] = useMemo(() => {\n if (row.original.dimsumHeaderValue) {\n return ['none', 'none', false];\n }\n if (row.isExpanded && row.original.subRows && row.depth === 0) {\n return ['1px solid #EBEDF0', 'none', true];\n }\n\n if (row.depth >= 1) {\n if (row.realIndex < flattenedData.length - 1 && flattenedData[row.realIndex + 1].depth === 0) {\n return ['none', '2px solid #EBEDF0', false];\n }\n return ['none', 'none', true];\n }\n\n return ['none', '1px solid #EBEDF0', false];\n }, [row, flattenedData]);\n\n const rowStyle = useMemo(() => ({ borderTop, borderBottom }), [borderTop, borderBottom]);\n\n const dropIndicatorPosition =\n draggableProps && draggableProps.shouldShowDropIndicatorPosition && draggableProps.dropIndicatorPosition;\n const isDropValid = draggableProps && draggableProps.isDropValid;\n\n return {\n rowStyle,\n shouldAppendDottedBorder,\n dropIndicatorPosition,\n isDropValid,\n };\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,YAAY,eAAe;AACpC,SAAS,qBAAqB;AAC9B,SAAS,2BAA2B;AAG7B,MAAM,cAAc,CACzB,QAMG;AACH,QAAM,gBAAgB,cAAc,CAAC,UAAU,MAAM,aAAa;AAElE,QAAM,EAAE,eAAe,IAAI,WAAW,mBAAmB;AAKzD,QAAM,CAAC,WAAW,cAAc,wBAAwB,IAA+B,QAAQ,MAAM;AACnG,QAAI,IAAI,SAAS,mBAAmB;AAClC,aAAO,CAAC,QAAQ,QAAQ,KAAK;AAAA,IAC/B;AACA,QAAI,IAAI,cAAc,IAAI,SAAS,WAAW,IAAI,UAAU,GAAG;AAC7D,aAAO,CAAC,qBAAqB,QAAQ,IAAI;AAAA,IAC3C;AAEA,QAAI,IAAI,SAAS,GAAG;AAClB,UAAI,IAAI,YAAY,cAAc,SAAS,KAAK,cAAc,IAAI,YAAY,CAAC,EAAE,UAAU,GAAG;AAC5F,eAAO,CAAC,QAAQ,qBAAqB,KAAK;AAAA,MAC5C;AACA,aAAO,CAAC,QAAQ,QAAQ,IAAI;AAAA,IAC9B;AAEA,WAAO,CAAC,QAAQ,qBAAqB,KAAK;AAAA,EAC5C,GAAG,CAAC,KAAK,aAAa,CAAC;AAEvB,QAAM,WAAW,QAAQ,OAAO,EAAE,WAAW,aAAa,IAAI,CAAC,WAAW,YAAY,CAAC;AAEvF,QAAM,wBACJ,kBAAkB,eAAe,mCAAmC,eAAe;AACrF,QAAM,cAAc,kBAAkB,eAAe;AAErD,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -1,13 +1,13 @@
1
1
  import * as React from "react";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
- import { useCallback, useRef, useState } from "react";
4
- import useOnClickOutside from "use-onclickoutside";
5
- import { styled, css, mergeRefs } from "@elliemae/ds-system";
6
3
  import { DSButtonV3 } from "@elliemae/ds-button-v2";
7
4
  import { MoreOptionsVert } from "@elliemae/ds-icons";
8
- import { DATA_TESTID } from "../../configs/constants.js";
5
+ import { css, mergeRefs, styled } from "@elliemae/ds-system";
6
+ import { useCallback, useRef, useState } from "react";
7
+ import useOnClickOutside from "use-onclickoutside";
9
8
  import { DSDataTableName, DSDataTableSlots } from "../../DSDataTableDefinitions.js";
10
- import { usePropsStore } from "../../configs/useStore/useStore.js";
9
+ import { DATA_TESTID } from "../../configs/constants.js";
10
+ import { usePropsStore } from "../../configs/useStore/createInternalAndPropsContext.js";
11
11
  const ToolbarBtns = styled("div", { name: DSDataTableName, slot: DSDataTableSlots.TOOLBAR_BUTTONS_WRAPPER })``;
12
12
  const boxShadow = css`
13
13
  box-shadow:
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/Toolbar/Toolbar.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback, useRef, useState } from 'react';\nimport useOnClickOutside from 'use-onclickoutside';\nimport { styled, css, mergeRefs } from '@elliemae/ds-system';\nimport { DSButtonV3 } from '@elliemae/ds-button-v2';\nimport { MoreOptionsVert } from '@elliemae/ds-icons';\nimport { DATA_TESTID } from '../../configs/constants.js';\nimport type { DSDataTableT } from '../../react-desc-prop-types.js';\nimport { DSDataTableName, DSDataTableSlots } from '../../DSDataTableDefinitions.js';\nimport { usePropsStore } from '../../configs/useStore/useStore.js';\n\nconst ToolbarBtns = styled('div', { name: DSDataTableName, slot: DSDataTableSlots.TOOLBAR_BUTTONS_WRAPPER })``;\n\nconst boxShadow = css`\n box-shadow:\n 0 1px 2px 0 rgba(0, 0, 0, 0.13),\n 0 1px 2px 0 rgba(0, 0, 0, 0.2);\n & > .toolbar-trigger {\n border: none;\n }\n`;\n\nconst ToolbarWrapper = styled('div', { name: DSDataTableName, slot: DSDataTableSlots.TOOLBAR_WRAPPER })<{\n isOpen: boolean;\n}>`\n display: flex;\n align-items: center;\n pointer-events: all;\n\n & .toolbar-trigger:focus {\n z-index: 8;\n }\n\n ${({ isOpen }) => isOpen && boxShadow}\n`;\n\nconst StyledButton = styled(DSButtonV3, { name: DSDataTableName, slot: DSDataTableSlots.TOOLBAR_BUTTON })`\n background-color: transparent;\n`;\n\nconst ToolbarPosition = styled('div', { name: DSDataTableName, slot: DSDataTableSlots.TOOLBAR_POSITION })`\n display: flex;\n justify-content: flex-end;\n align-items: center;\n pointer-events: none;\n background: transparent;\n height: 28px;\n margin-top: 4px;\n width: 100%;\n padding-left: 2px;\n outline: none;\n &:hover {\n z-index: 1;\n }\n :after {\n content: '';\n position: absolute;\n left: 0px;\n top: 4px;\n bottom: 4px;\n width: 1px;\n background-color: neutral-080;\n z-index: 7;\n }\n`;\n\ninterface ToolbarProps {\n isRowSelected?: boolean;\n cell: DSDataTableT.Cell;\n children: React.ReactNode;\n}\n\nexport const Toolbar: React.ComponentType<ToolbarProps> = ({ isRowSelected, cell, children }) => {\n const [show, setShow] = useState(false);\n\n const toolbarRef = useRef<HTMLDivElement | null>(null);\n const toolbarTriggerRef = useRef<HTMLButtonElement | null>(null);\n\n const handleOnClickOutside = useCallback(() => setShow(false), []);\n\n const handleOnClick = useCallback(() => setShow((prev) => !prev), []);\n\n const getOwnerProps = usePropsStore((store) => store.get);\n\n const stopPropagation: React.MouseEventHandler = useCallback((e) => e.stopPropagation(), []);\n\n useOnClickOutside(toolbarRef, handleOnClickOutside);\n\n const onToolbarKeyDown = useCallback((e: React.KeyboardEvent) => {\n if (e.code === 'Escape') {\n setShow(false);\n toolbarTriggerRef.current?.focus();\n }\n e.stopPropagation();\n }, []);\n\n const handleOnBlurToolBar = useCallback(() => {\n setTimeout(() => {\n if (!toolbarRef?.current?.contains?.(document.activeElement)) {\n setShow(false);\n }\n });\n }, []);\n\n return (\n <ToolbarPosition onBlur={handleOnBlurToolBar} innerRef={toolbarRef} tabIndex={-1} getOwnerProps={getOwnerProps}>\n <ToolbarWrapper\n onKeyDown={onToolbarKeyDown}\n onClick={stopPropagation}\n isOpen={show}\n getOwnerProps={getOwnerProps}\n >\n {show && <ToolbarBtns getOwnerProps={getOwnerProps}>{children}</ToolbarBtns>}\n <StyledButton\n buttonType=\"icon\"\n className=\"toolbar-trigger\"\n data-testid={DATA_TESTID.DATA_TABLE_TOOLBAR_TRIGGER}\n innerRef={mergeRefs(toolbarTriggerRef, cell?.ref)}\n onClick={handleOnClick}\n tabIndex={isRowSelected === false ? -1 : 0}\n aria-label=\"Row actions\"\n >\n <MoreOptionsVert />\n </StyledButton>\n </ToolbarWrapper>\n </ToolbarPosition>\n );\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACyGjB,SAMW,KANX;AAzGN,SAAgB,aAAa,QAAQ,gBAAgB;AACrD,OAAO,uBAAuB;AAC9B,SAAS,QAAQ,KAAK,iBAAiB;AACvC,SAAS,kBAAkB;AAC3B,SAAS,uBAAuB;AAChC,SAAS,mBAAmB;AAE5B,SAAS,iBAAiB,wBAAwB;AAClD,SAAS,qBAAqB;AAE9B,MAAM,cAAc,OAAO,OAAO,EAAE,MAAM,iBAAiB,MAAM,iBAAiB,wBAAwB,CAAC;AAE3G,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASlB,MAAM,iBAAiB,OAAO,OAA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5D,gBAAQ,KAAK;AAAA,MACf;AAAA,IACF,CAAC;AAAA,EACH,GAAG,CAAC,CAAC;AAEL,SACE,oBAAC,mBAAgB,QAAQ,qBAAqB,UAAU,YAAY,UAAU,IAAI,eAChF;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,MACX,SAAS;AAAA,MACT,QAAQ;AAAA,MACR;AAAA,MAEC;AAAA,gBAAQ,oBAAC,eAAY,eAA+B,UAAS;AAAA,QAC9D;AAAA,UAAC;AAAA;AAAA,YACC,YAAW;AAAA,YACX,WAAU;AAAA,YACV,eAAa,YAAY;AAAA,YACzB,UAAU,UAAU,mBAAmB,MAAM,GAAG;AAAA,YAChD,SAAS;AAAA,YACT,UAAU,kBAAkB,QAAQ,KAAK;AAAA,YACzC,cAAW;AAAA,YAEX,8BAAC,mBAAgB;AAAA;AAAA,QACnB;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { DSButtonV3 } from '@elliemae/ds-button-v2';\nimport { MoreOptionsVert } from '@elliemae/ds-icons';\nimport { css, mergeRefs, styled } from '@elliemae/ds-system';\nimport React, { useCallback, useRef, useState } from 'react';\nimport useOnClickOutside from 'use-onclickoutside';\nimport { DSDataTableName, DSDataTableSlots } from '../../DSDataTableDefinitions.js';\nimport { DATA_TESTID } from '../../configs/constants.js';\nimport { usePropsStore } from '../../configs/useStore/createInternalAndPropsContext.js';\nimport type { DSDataTableT } from '../../react-desc-prop-types.js';\n\nconst ToolbarBtns = styled('div', { name: DSDataTableName, slot: DSDataTableSlots.TOOLBAR_BUTTONS_WRAPPER })``;\n\nconst boxShadow = css`\n box-shadow:\n 0 1px 2px 0 rgba(0, 0, 0, 0.13),\n 0 1px 2px 0 rgba(0, 0, 0, 0.2);\n & > .toolbar-trigger {\n border: none;\n }\n`;\n\nconst ToolbarWrapper = styled('div', { name: DSDataTableName, slot: DSDataTableSlots.TOOLBAR_WRAPPER })<{\n isOpen: boolean;\n}>`\n display: flex;\n align-items: center;\n pointer-events: all;\n\n & .toolbar-trigger:focus {\n z-index: 8;\n }\n\n ${({ isOpen }) => isOpen && boxShadow}\n`;\n\nconst StyledButton = styled(DSButtonV3, { name: DSDataTableName, slot: DSDataTableSlots.TOOLBAR_BUTTON })`\n background-color: transparent;\n`;\n\nconst ToolbarPosition = styled('div', { name: DSDataTableName, slot: DSDataTableSlots.TOOLBAR_POSITION })`\n display: flex;\n justify-content: flex-end;\n align-items: center;\n pointer-events: none;\n background: transparent;\n height: 28px;\n margin-top: 4px;\n width: 100%;\n padding-left: 2px;\n outline: none;\n &:hover {\n z-index: 1;\n }\n :after {\n content: '';\n position: absolute;\n left: 0px;\n top: 4px;\n bottom: 4px;\n width: 1px;\n background-color: neutral-080;\n z-index: 7;\n }\n`;\n\ninterface ToolbarProps {\n isRowSelected?: boolean;\n cell: DSDataTableT.Cell;\n children: React.ReactNode;\n}\n\nexport const Toolbar: React.ComponentType<ToolbarProps> = ({ isRowSelected, cell, children }) => {\n const [show, setShow] = useState(false);\n\n const toolbarRef = useRef<HTMLDivElement | null>(null);\n const toolbarTriggerRef = useRef<HTMLButtonElement | null>(null);\n\n const handleOnClickOutside = useCallback(() => setShow(false), []);\n\n const handleOnClick = useCallback(() => setShow((prev) => !prev), []);\n\n const getOwnerProps = usePropsStore((store) => store.get);\n\n const stopPropagation: React.MouseEventHandler = useCallback((e) => e.stopPropagation(), []);\n\n useOnClickOutside(toolbarRef, handleOnClickOutside);\n\n const onToolbarKeyDown = useCallback((e: React.KeyboardEvent) => {\n if (e.code === 'Escape') {\n setShow(false);\n toolbarTriggerRef.current?.focus();\n }\n e.stopPropagation();\n }, []);\n\n const handleOnBlurToolBar = useCallback(() => {\n setTimeout(() => {\n if (!toolbarRef?.current?.contains?.(document.activeElement)) {\n setShow(false);\n }\n });\n }, []);\n\n return (\n <ToolbarPosition onBlur={handleOnBlurToolBar} innerRef={toolbarRef} tabIndex={-1} getOwnerProps={getOwnerProps}>\n <ToolbarWrapper\n onKeyDown={onToolbarKeyDown}\n onClick={stopPropagation}\n isOpen={show}\n getOwnerProps={getOwnerProps}\n >\n {show && <ToolbarBtns getOwnerProps={getOwnerProps}>{children}</ToolbarBtns>}\n <StyledButton\n buttonType=\"icon\"\n className=\"toolbar-trigger\"\n data-testid={DATA_TESTID.DATA_TABLE_TOOLBAR_TRIGGER}\n innerRef={mergeRefs(toolbarTriggerRef, cell?.ref)}\n onClick={handleOnClick}\n tabIndex={isRowSelected === false ? -1 : 0}\n aria-label=\"Row actions\"\n >\n <MoreOptionsVert />\n </StyledButton>\n </ToolbarWrapper>\n </ToolbarPosition>\n );\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACyGjB,SAMW,KANX;AAzGN,SAAS,kBAAkB;AAC3B,SAAS,uBAAuB;AAChC,SAAS,KAAK,WAAW,cAAc;AACvC,SAAgB,aAAa,QAAQ,gBAAgB;AACrD,OAAO,uBAAuB;AAC9B,SAAS,iBAAiB,wBAAwB;AAClD,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAG9B,MAAM,cAAc,OAAO,OAAO,EAAE,MAAM,iBAAiB,MAAM,iBAAiB,wBAAwB,CAAC;AAE3G,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASlB,MAAM,iBAAiB,OAAO,OAAO,EAAE,MAAM,iBAAiB,MAAM,iBAAiB,gBAAgB,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAWlG,CAAC,EAAE,OAAO,MAAM,UAAU,SAAS;AAAA;AAGvC,MAAM,eAAe,OAAO,YAAY,EAAE,MAAM,iBAAiB,MAAM,iBAAiB,eAAe,CAAC;AAAA;AAAA;AAIxG,MAAM,kBAAkB,OAAO,OAAO,EAAE,MAAM,iBAAiB,MAAM,iBAAiB,iBAAiB,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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mB,MAAM,GAAG;AAAA,YAChD,SAAS;AAAA,YACT,UAAU,kBAAkB,QAAQ,KAAK;AAAA,YACzC,cAAW;AAAA,YAEX,8BAAC,mBAAgB;AAAA;AAAA,QACnB;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -1,15 +1,15 @@
1
1
  import * as React from "react";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
- import React2, { useContext, useMemo, memo } from "react";
4
- import { SimpleTruncatedTooltipText } from "@elliemae/ds-truncated-tooltip-text";
5
3
  import { Grid } from "@elliemae/ds-grid";
6
- import { StyledCell, StyledCellContent } from "../../styled.js";
7
- import { outOfTheBoxEditables } from "../../addons/Editables/index.js";
8
- import { SortableItemContext } from "../HoC/SortableItemContext.js";
4
+ import { SimpleTruncatedTooltipText } from "@elliemae/ds-truncated-tooltip-text";
5
+ import React2, { memo, useContext, useMemo } from "react";
9
6
  import { expandRowColumn } from "../../addons/Columns/index.js";
7
+ import { outOfTheBoxEditables } from "../../addons/Editables/index.js";
10
8
  import { DATA_TESTID } from "../../configs/constants.js";
9
+ import { usePropsStore } from "../../configs/useStore/createInternalAndPropsContext.js";
10
+ import { StyledCell, StyledCellContent } from "../../styled.js";
11
+ import { SortableItemContext } from "../HoC/SortableItemContext.js";
11
12
  import { useCellStyle } from "./useCellStyle.js";
12
- import { usePropsStore } from "../../configs/useStore/useStore.js";
13
13
  const PureStandardCell = memo(({ cellStyle, children, column }) => /* @__PURE__ */ jsx(StyledCell, { column, style: cellStyle, role: "cell", "data-testid": DATA_TESTID.DATA_TABLE_CELL, children }));
14
14
  const Cell = ({
15
15
  cell,
@@ -43,7 +43,13 @@ const Cell = ({
43
43
  );
44
44
  const CellComponent = cell.render;
45
45
  const textValue = useMemo(
46
- () => appliedTextWrap === "truncate" ? /* @__PURE__ */ jsx(SimpleTruncatedTooltipText, { value: /* @__PURE__ */ jsx(CellComponent, { ...cellProps }) }) : /* @__PURE__ */ jsx(CellComponent, { ...cellProps }),
46
+ () => appliedTextWrap === "truncate" ? (
47
+ // @ts-expect-error - data-table typescript is broken
48
+ /* @__PURE__ */ jsx(SimpleTruncatedTooltipText, { value: /* @__PURE__ */ jsx(CellComponent, { ...cellProps }) })
49
+ ) : (
50
+ // @ts-expect-error - data-table typescript is broken
51
+ /* @__PURE__ */ jsx(CellComponent, { ...cellProps })
52
+ ),
47
53
  [CellComponent, appliedTextWrap, cellProps]
48
54
  );
49
55
  const pureCellContent = useMemo(() => {
@@ -61,7 +67,7 @@ const Cell = ({
61
67
  );
62
68
  const EditableContentJSX = useMemo(() => {
63
69
  if (typeof column.editable === "string") {
64
- const { EditableComponent } = outOfTheBoxEditables?.[column.editable];
70
+ const { EditableComponent } = outOfTheBoxEditables?.[column.editable] ?? {};
65
71
  if (EditableComponent) return /* @__PURE__ */ jsx(EditableComponent, { ...cellProps, DefaultCellRender: DefaultCellContentJSX });
66
72
  }
67
73
  if (typeof column.editable === "function")
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/Cells/Cell.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useContext, useMemo, memo, type PropsWithChildren } from 'react';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { Grid } from '@elliemae/ds-grid';\nimport { StyledCell, StyledCellContent } from '../../styled.js';\nimport { outOfTheBoxEditables } from '../../addons/Editables/index.js';\nimport type { DSDataTableT } from '../../react-desc-prop-types.js';\nimport { SortableItemContext } from '../HoC/SortableItemContext.js';\nimport { expandRowColumn } from '../../addons/Columns/index.js';\nimport { DATA_TESTID } from '../../configs/constants.js';\nimport { useCellStyle } from './useCellStyle.js';\nimport { usePropsStore } from '../../configs/useStore/useStore.js';\n\nconst PureStandardCell = memo<\n PropsWithChildren<{ cellStyle: React.CSSProperties; column: DSDataTableT.InternalColumn }>\n>(({ cellStyle, children, column }) => (\n <StyledCell column={column} style={cellStyle} role=\"cell\" data-testid={DATA_TESTID.DATA_TABLE_CELL}>\n {children}\n </StyledCell>\n));\n\ninterface CellProps {\n cell: DSDataTableT.Cell;\n column: DSDataTableT.InternalColumn;\n row: DSDataTableT.InternalRow;\n isRowSelected: boolean;\n shouldAddExpandCell: boolean;\n isDragOverlay: boolean;\n}\n\nconst Cell: React.ComponentType<CellProps> = ({\n cell,\n column,\n row,\n isRowSelected,\n shouldAddExpandCell,\n isDragOverlay,\n}) => {\n const cellRendererProps = usePropsStore((state) => state.cellRendererProps);\n const disabledRows = usePropsStore((state) => state.disabledRows);\n const getOwnerProps = usePropsStore((store) => store.get);\n const getOwnerPropsArguments = React.useCallback(() => cell, [cell]);\n const isDisabledRow = disabledRows[row.uid];\n\n const { draggableProps } = useContext(SortableItemContext);\n\n const [appliedTextWrap, cellStyle] = useCellStyle(column, shouldAddExpandCell);\n\n const cellProps = useMemo(\n () => ({\n ...cellRendererProps,\n cell,\n row,\n isRowSelected,\n draggableProps,\n isDragOverlay,\n role: 'cell',\n cellStyle,\n column,\n isDisabledRow,\n }),\n [cellRendererProps, cell, row, isRowSelected, draggableProps, isDragOverlay, cellStyle, column, isDisabledRow],\n );\n\n const CellComponent = cell.render;\n\n const textValue = useMemo(\n () =>\n appliedTextWrap === 'truncate' ? (\n <SimpleTruncatedTooltipText value={<CellComponent {...cellProps} />} />\n ) : (\n <CellComponent {...cellProps} />\n ),\n [CellComponent, appliedTextWrap, cellProps],\n );\n const pureCellContent = useMemo(() => {\n if (shouldAddExpandCell) {\n return (\n <Grid cols={['min-content', 'auto']} alignItems=\"center\" height=\"100%\">\n {shouldAddExpandCell && expandRowColumn.Cell && <expandRowColumn.Cell {...cellProps} />}\n {textValue}\n </Grid>\n );\n }\n return textValue;\n }, [cellProps, shouldAddExpandCell, textValue]);\n const DefaultCellContentJSX = useMemo(\n () => (\n <StyledCellContent getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n {pureCellContent}\n </StyledCellContent>\n ),\n [getOwnerProps, getOwnerPropsArguments, pureCellContent],\n );\n\n const EditableContentJSX = useMemo(() => {\n if (typeof column.editable === 'string') {\n const { EditableComponent } = outOfTheBoxEditables?.[column.editable];\n if (EditableComponent) return <EditableComponent {...cellProps} DefaultCellRender={DefaultCellContentJSX} />;\n }\n if (typeof column.editable === 'function')\n return column.editable({\n DefaultCellRender: DefaultCellContentJSX,\n ...cellProps,\n }) as JSX.Element;\n\n return null;\n }, [DefaultCellContentJSX, cellProps, column]);\n\n return (\n <PureStandardCell {...cellProps}>\n {column.editable && !disabledRows[row.uid] ? EditableContentJSX : DefaultCellContentJSX}\n </PureStandardCell>\n );\n};\n\nexport { Cell };\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACgBrB,cA8DM,YA9DN;AAfF,OAAOA,UAAS,YAAY,SAAS,YAAoC;AACzE,SAAS,kCAAkC;AAC3C,SAAS,YAAY;AACrB,SAAS,YAAY,yBAAyB;AAC9C,SAAS,4BAA4B;AAErC,SAAS,2BAA2B;AACpC,SAAS,uBAAuB;AAChC,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAE9B,MAAM,mBAAmB,KAEvB,CAAC,EAAE,WAAW,UAAU,OAAO,MAC/B,oBAAC,cAAW,QAAgB,OAAO,WAAW,MAAK,QAAO,eAAa,YAAY,iBAChF,UACH,CACD;AAWD,MAAM,OAAuC,CAAC;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,oBAAoB,cAAc,CAAC,UAAU,MAAM,iBAAiB;AAC1E,QAAM,eAAe,cAAc,CAAC,UAAU,MAAM,YAAY;AAChE,QAAM,gBAAgB,cAAc,CAAC,UAAU,MAAM,GAAG;AACxD,QAAM,yBAAyBA,OAAM,YAAY,MAAM,MAAM,CAAC,IAAI,CAAC;AACnE,QAAM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AAAA,IAC5G;AACA,QAAI,OAAO,OAAO,aAAa;AAC7B,aAAO,OAAO,SAAS;AAAA,QACrB,mBAAmB;AAAA,QACnB,GAAG;AAAA,MACL,CAAC;AAEH,WAAO;AAAA,EACT,GAAG,CAAC,uBAAuB,WAAW,MAAM,CAAC;AAE7C,SACE,oBAAC,oBAAkB,GAAG,WACnB,iBAAO,YAAY,CAAC,aAAa,IAAI,GAAG,IAAI,qBAAqB,uBACpE;AAEJ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport { Grid } from '@elliemae/ds-grid';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport React, { memo, useContext, useMemo, type PropsWithChildren } from 'react';\nimport { expandRowColumn } from '../../addons/Columns/index.js';\nimport { outOfTheBoxEditables } from '../../addons/Editables/index.js';\nimport { DATA_TESTID } from '../../configs/constants.js';\nimport { usePropsStore } from '../../configs/useStore/createInternalAndPropsContext.js';\nimport type { DSDataTableT } from '../../react-desc-prop-types.js';\nimport { StyledCell, StyledCellContent } from '../../styled.js';\nimport { SortableItemContext } from '../HoC/SortableItemContext.js';\nimport { useCellStyle } from './useCellStyle.js';\n\nconst PureStandardCell = memo<\n PropsWithChildren<{ cellStyle: React.CSSProperties; column: DSDataTableT.InternalColumn }>\n>(({ cellStyle, children, column }) => (\n <StyledCell column={column} style={cellStyle} role=\"cell\" data-testid={DATA_TESTID.DATA_TABLE_CELL}>\n {children}\n </StyledCell>\n));\n\ninterface CellProps {\n cell: DSDataTableT.Cell;\n column: DSDataTableT.InternalColumn;\n row: DSDataTableT.InternalRow;\n isRowSelected: boolean;\n shouldAddExpandCell: boolean;\n isDragOverlay: boolean;\n}\n\nconst Cell: React.ComponentType<CellProps> = ({\n cell,\n column,\n row,\n isRowSelected,\n shouldAddExpandCell,\n isDragOverlay,\n}) => {\n const cellRendererProps = usePropsStore((state) => state.cellRendererProps);\n const disabledRows = usePropsStore((state) => state.disabledRows);\n const getOwnerProps = usePropsStore((store) => store.get);\n const getOwnerPropsArguments = React.useCallback(() => cell, [cell]);\n const isDisabledRow = disabledRows[row.uid];\n\n const { draggableProps } = useContext(SortableItemContext);\n\n const [appliedTextWrap, cellStyle] = useCellStyle(column, shouldAddExpandCell);\n\n const cellProps = useMemo(\n () => ({\n ...cellRendererProps,\n cell,\n row,\n isRowSelected,\n draggableProps,\n isDragOverlay,\n role: 'cell',\n cellStyle,\n column,\n isDisabledRow,\n }),\n [cellRendererProps, cell, row, isRowSelected, draggableProps, isDragOverlay, cellStyle, column, isDisabledRow],\n );\n\n const CellComponent = cell.render;\n\n const textValue = useMemo(\n () =>\n appliedTextWrap === 'truncate' ? (\n // @ts-expect-error - data-table typescript is broken\n <SimpleTruncatedTooltipText value={<CellComponent {...cellProps} />} />\n ) : (\n // @ts-expect-error - data-table typescript is broken\n <CellComponent {...cellProps} />\n ),\n [CellComponent, appliedTextWrap, cellProps],\n );\n const pureCellContent = useMemo(() => {\n if (shouldAddExpandCell) {\n return (\n <Grid cols={['min-content', 'auto']} alignItems=\"center\" height=\"100%\">\n {/* @ts-expect-error - data-table typescript is broken */}\n {shouldAddExpandCell && expandRowColumn.Cell && <expandRowColumn.Cell {...cellProps} />}\n {textValue}\n </Grid>\n );\n }\n return textValue;\n }, [cellProps, shouldAddExpandCell, textValue]);\n const DefaultCellContentJSX = useMemo(\n () => (\n <StyledCellContent getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n {pureCellContent}\n </StyledCellContent>\n ),\n [getOwnerProps, getOwnerPropsArguments, pureCellContent],\n );\n\n const EditableContentJSX = useMemo(() => {\n if (typeof column.editable === 'string') {\n const { EditableComponent } = outOfTheBoxEditables?.[column.editable] ?? {};\n // @ts-expect-error - data-table typescript is broken\n if (EditableComponent) return <EditableComponent {...cellProps} DefaultCellRender={DefaultCellContentJSX} />;\n }\n if (typeof column.editable === 'function')\n // @ts-expect-error - data-table typescript is broken\n return column.editable({\n DefaultCellRender: DefaultCellContentJSX,\n ...cellProps,\n }) as JSX.Element;\n\n return null;\n }, [DefaultCellContentJSX, cellProps, column]);\n\n return (\n <PureStandardCell {...cellProps}>\n {column.editable && !disabledRows[row.uid] ? EditableContentJSX : DefaultCellContentJSX}\n </PureStandardCell>\n );\n};\n\nexport { Cell };\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACgBrB,cAgEM,YAhEN;AAfF,SAAS,YAAY;AACrB,SAAS,kCAAkC;AAC3C,OAAOA,UAAS,MAAM,YAAY,eAAuC;AACzE,SAAS,uBAAuB;AAChC,SAAS,4BAA4B;AACrC,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAE9B,SAAS,YAAY,yBAAyB;AAC9C,SAAS,2BAA2B;AACpC,SAAS,oBAAoB;AAE7B,MAAM,mBAAmB,KAEvB,CAAC,EAAE,WAAW,UAAU,OAAO,MAC/B,oBAAC,cAAW,QAAgB,OAAO,WAAW,MAAK,QAAO,eAAa,YAAY,iBAChF,UACH,CACD;AAWD,MAAM,OAAuC,CAAC;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,oBAAoB,cAAc,CAAC,UAAU,MAAM,iBAAiB;AAC1E,QAAM,eAAe,cAAc,CAAC,UAAU,MAAM,YAAY;AAChE,QAAM,gBAAgB,cAAc,CAAC,UAAU,MAAM,GAAG;AACxD,QAAM,yBAAyBA,OAAM,YAAY,MAAM,MAAM,CAAC,IAAI,CAAC;AACnE,QAAM,gBAAgB,aAAa,IAAI,GAAG;AAE1C,QAAM,EAAE,eAAe,IAAI,WAAW,mBAAmB;AAEzD,QAAM,CAAC,iBAAiB,SAAS,IAAI,aAAa,QAAQ,mBAAmB;AAE7E,QAAM,YAAY;AAAA,IAChB,OAAO;AAAA,MACL,GAAG;AAAA,MACH;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,MAAM;AAAA,MACN;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nB,iBAAO,YAAY,CAAC,aAAa,IAAI,GAAG,IAAI,qBAAqB,uBACpE;AAEJ;",
6
6
  "names": ["React"]
7
7
  }
@@ -1,14 +1,14 @@
1
1
  import * as React from "react";
2
2
  import { jsx } from "react/jsx-runtime";
3
- import React2, { useContext, useMemo, memo } from "react";
4
3
  import { SimpleTruncatedTooltipText } from "@elliemae/ds-truncated-tooltip-text";
5
- import { StyledCell, StyledCellContent } from "../../styled.js";
6
- import { outOfTheBoxEditables } from "../../addons/Editables/index.js";
7
- import { SortableItemContext } from "../HoC/SortableItemContext.js";
4
+ import React2, { memo, useContext, useMemo } from "react";
8
5
  import { expandRowColumn } from "../../addons/Columns/index.js";
6
+ import { outOfTheBoxEditables } from "../../addons/Editables/index.js";
9
7
  import { DATA_TESTID } from "../../configs/constants.js";
8
+ import { usePropsStore } from "../../configs/useStore/createInternalAndPropsContext.js";
9
+ import { StyledCell, StyledCellContent } from "../../styled.js";
10
+ import { SortableItemContext } from "../HoC/SortableItemContext.js";
10
11
  import { useCellStyle } from "./useCellStyle.js";
11
- import { usePropsStore } from "../../configs/useStore/useStore.js";
12
12
  const PureStandardCell = memo(
13
13
  ({ column, cell, shouldAddExpandCell, cellIsNextToExpander, row, children }) => {
14
14
  const cellStyle = useCellStyle(column, shouldAddExpandCell, cellIsNextToExpander, row)[1];
@@ -49,7 +49,7 @@ const EditableCell = memo((props) => {
49
49
  const { column } = props;
50
50
  const DefaultCellContentJSX = /* @__PURE__ */ jsx(DefaultCellContent, { ...props });
51
51
  if (typeof column.editable === "string") {
52
- const { EditableComponent } = outOfTheBoxEditables?.[column.editable];
52
+ const { EditableComponent } = outOfTheBoxEditables?.[column.editable] ?? {};
53
53
  if (EditableComponent) return /* @__PURE__ */ jsx(EditableComponent, { ...props, DefaultCellRender: DefaultCellContentJSX });
54
54
  }
55
55
  if (typeof column.editable === "function") {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/Cells/CellFactory.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useContext, useMemo, memo, type PropsWithChildren } from 'react';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { StyledCell, StyledCellContent } from '../../styled.js';\nimport { outOfTheBoxEditables } from '../../addons/Editables/index.js';\nimport type { DSDataTableT } from '../../react-desc-prop-types.js';\nimport { SortableItemContext } from '../HoC/SortableItemContext.js';\nimport { expandRowColumn } from '../../addons/Columns/index.js';\nimport { DATA_TESTID } from '../../configs/constants.js';\nimport { useCellStyle } from './useCellStyle.js';\nimport { usePropsStore } from '../../configs/useStore/useStore.js';\n\nconst PureStandardCell = memo<PropsWithChildren<DSDataTableT.CellProps>>(\n ({ column, cell, shouldAddExpandCell, cellIsNextToExpander, row, children }) => {\n const cellStyle = useCellStyle(column, shouldAddExpandCell, cellIsNextToExpander, row)[1];\n const getOwnerProps = usePropsStore((store) => store.get);\n const getOwnerPropsArguments = React.useCallback(() => cell, [cell]);\n return (\n <StyledCell\n column={column}\n style={cellStyle}\n role=\"cell\"\n data-testid={DATA_TESTID.DATA_TABLE_CELL}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {children}\n </StyledCell>\n );\n },\n);\n\nconst TruncableCellContent = memo((props: DSDataTableT.CellProps) => {\n const { cell, column } = props;\n const { render: CellComponent } = cell;\n\n const textWrap = usePropsStore((state) => state.textWrap);\n const appliedTextWrap = column.textWrap || textWrap;\n if (appliedTextWrap === 'truncate') {\n return <SimpleTruncatedTooltipText value={<CellComponent {...props} />} />;\n }\n return <CellComponent {...props} />;\n});\n\nconst ExpandableCellContent = memo(\n (props: DSDataTableT.CellProps) => expandRowColumn.Cell && <expandRowColumn.Cell {...props} />,\n);\n\nconst DefaultCellContent = memo((props: DSDataTableT.CellProps) => {\n const { shouldAddExpandCell } = props;\n\n return (\n <StyledCellContent>\n {shouldAddExpandCell ? <ExpandableCellContent {...props} /> : <TruncableCellContent {...props} />}\n </StyledCellContent>\n );\n});\n\nconst EditableCell = memo((props: DSDataTableT.CellProps) => {\n const { column } = props;\n const DefaultCellContentJSX = <DefaultCellContent {...props} />;\n\n if (typeof column.editable === 'string') {\n const { EditableComponent } = outOfTheBoxEditables?.[column.editable];\n if (EditableComponent) return <EditableComponent {...props} DefaultCellRender={DefaultCellContentJSX} />;\n }\n if (typeof column.editable === 'function') {\n const ColumnEditableRenderProps = column.editable as React.ComponentType<\n DSDataTableT.CellProps & { DefaultCellRender: JSX.Element }\n >;\n return <ColumnEditableRenderProps {...props} DefaultCellRender={DefaultCellContentJSX} />;\n }\n\n return null;\n});\n\ninterface CellFactoryProps {\n cell: DSDataTableT.Cell;\n column: DSDataTableT.InternalColumn;\n row: DSDataTableT.InternalRow;\n isRowSelected: boolean;\n shouldAddExpandCell: boolean;\n cellIsNextToExpander: boolean;\n isDragOverlay: boolean;\n}\n\nconst CellFactory: React.ComponentType<CellFactoryProps> = (props) => {\n const { column, row } = props;\n const cellRendererProps = usePropsStore((state) => state.cellRendererProps);\n const disabledRows = usePropsStore((state) => state.disabledRows);\n const domIdAffix = usePropsStore((state) => state.domIdAffix);\n const isDisabledRow = disabledRows[row.uid];\n\n const { draggableProps } = useContext(SortableItemContext);\n\n const cellProps: DSDataTableT.CellProps = useMemo(\n () => ({\n ...cellRendererProps,\n ...props,\n role: 'cell',\n draggableProps,\n isDisabledRow,\n domIdAffix,\n }),\n [cellRendererProps, props, draggableProps, isDisabledRow, domIdAffix],\n );\n\n return (\n <PureStandardCell {...cellProps}>\n {column.editable && !disabledRows[row.uid] ? (\n <EditableCell {...cellProps} />\n ) : (\n <DefaultCellContent {...cellProps} />\n )}\n </PureStandardCell>\n );\n};\n\nexport { CellFactory };\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACkBjB;AAjBN,OAAOA,UAAS,YAAY,SAAS,YAAoC;AACzE,SAAS,kC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ACjG;AAEJ,CAAC;AAED,MAAM,eAAe,KAAK,CAAC,UAAkC;AAC3D,QAAM,EAAE,OAAO,IAAI;AACnB,QAAM,wBAAwB,oBAAC,sBAAoB,GAAG,OAAO;AAE7D,MAAI,OAAO,OAAO,aAAa,UAAU;AACvC,UAAM,EAAE,kBAAkB,IAAI,uBAAuB,OAAO,QAAQ;AACpE,QAAI,kBAAmB,QAAO,oBAAC,qBAAmB,GAAG,OAAO,mBAAmB,uBAAuB;AAAA,EACxG;AACA,MAAI,OAAO,OAAO,aAAa,YAAY;AACzC,UAAM,4BAA4B,OAAO;AAGzC,WAAO,oBAAC,6BAA2B,GAAG,OAAO,mBAAmB,uBAAuB;AAAA,EACzF;AAEA,SAAO;AACT,CAAC;AAYD,MAAM,cAAqD,CAAC,UAAU;AACpE,QAAM,EAAE,QAAQ,IAAI,IAAI;AACxB,QAAM,oBAAoB,cAAc,CAAC,UAAU,MAAM,iBAAiB;AAC1E,QAAM,eAAe,cAAc,CAAC,UAAU,MAAM,YAAY;AAChE,QAAM,aAAa,cAAc,CAAC,UAAU,MAAM,UAAU;AAC5D,QAAM,gBAAgB,aAAa,IAAI,GAAG;AAE1C,QAAM,EAAE,eAAe,IAAI,WAAW,mBAAmB;AAEzD,QAAM,YAAoC;AAAA,IACxC,OAAO;AAAA,MACL,GAAG;AAAA,MACH,GAAG;AAAA,MACH,MAAM;AAAA,MACN;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,mBAAmB,OAAO,gBAAgB,eAAe,UAAU;AAAA,EACtE;AAEA,SACE,oBAAC,oBAAkB,GAAG,WACnB,iBAAO,YAAY,CAAC,aAAa,IAAI,GAAG,IACvC,oBAAC,gBAAc,GAAG,WAAW,IAE7B,oBAAC,sBAAoB,GAAG,WAAW,GAEvC;AAEJ;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport React, { memo, useContext, useMemo, type PropsWithChildren } from 'react';\nimport { expandRowColumn } from '../../addons/Columns/index.js';\nimport { outOfTheBoxEditables } from '../../addons/Editables/index.js';\nimport { DATA_TESTID } from '../../configs/constants.js';\nimport { usePropsStore } from '../../configs/useStore/createInternalAndPropsContext.js';\nimport type { DSDataTableT } from '../../react-desc-prop-types.js';\nimport { StyledCell, StyledCellContent } from '../../styled.js';\nimport { SortableItemContext } from '../HoC/SortableItemContext.js';\nimport { useCellStyle } from './useCellStyle.js';\n\nconst PureStandardCell = memo<PropsWithChildren<DSDataTableT.CellProps>>(\n ({ column, cell, shouldAddExpandCell, cellIsNextToExpander, row, children }) => {\n const cellStyle = useCellStyle(column, shouldAddExpandCell, cellIsNextToExpander, row)[1];\n const getOwnerProps = usePropsStore((store) => store.get);\n const getOwnerPropsArguments = React.useCallback(() => cell, [cell]);\n return (\n <StyledCell\n column={column}\n style={cellStyle}\n role=\"cell\"\n data-testid={DATA_TESTID.DATA_TABLE_CELL}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {children}\n </StyledCell>\n );\n },\n);\n\nconst TruncableCellContent = memo((props: DSDataTableT.CellProps) => {\n const { cell, column } = props;\n const { render: CellComponent } = cell;\n\n const textWrap = usePropsStore((state) => state.textWrap);\n const appliedTextWrap = column.textWrap || textWrap;\n if (appliedTextWrap === 'truncate') {\n return <SimpleTruncatedTooltipText value={<CellComponent {...props} />} />;\n }\n return <CellComponent {...props} />;\n});\n\nconst ExpandableCellContent = memo(\n (props: DSDataTableT.CellProps) => expandRowColumn.Cell && <expandRowColumn.Cell {...props} />,\n);\n\nconst DefaultCellContent = memo((props: DSDataTableT.CellProps) => {\n const { shouldAddExpandCell } = props;\n\n return (\n <StyledCellContent>\n {shouldAddExpandCell ? <ExpandableCellContent {...props} /> : <TruncableCellContent {...props} />}\n </StyledCellContent>\n );\n});\n\nconst EditableCell = memo((props: DSDataTableT.CellProps) => {\n const { column } = props;\n const DefaultCellContentJSX = <DefaultCellContent {...props} />;\n\n if (typeof column.editable === 'string') {\n const { EditableComponent } = outOfTheBoxEditables?.[column.editable] ?? {};\n // @ts-expect-error - data-table typescript is broken\n if (EditableComponent) return <EditableComponent {...props} DefaultCellRender={DefaultCellContentJSX} />;\n }\n if (typeof column.editable === 'function') {\n const ColumnEditableRenderProps = column.editable as React.ComponentType<\n DSDataTableT.CellProps & { DefaultCellRender: JSX.Element }\n >;\n return <ColumnEditableRenderProps {...props} DefaultCellRender={DefaultCellContentJSX} />;\n }\n\n return null;\n});\n\ninterface CellFactoryProps {\n cell: DSDataTableT.Cell;\n column: DSDataTableT.InternalColumn;\n row: DSDataTableT.InternalRow;\n isRowSelected: boolean;\n shouldAddExpandCell: boolean;\n cellIsNextToExpander: boolean;\n isDragOverlay: boolean;\n}\n\nconst CellFactory: React.ComponentType<CellFactoryProps> = (props) => {\n const { column, row } = props;\n const cellRendererProps = usePropsStore((state) => state.cellRendererProps);\n const disabledRows = usePropsStore((state) => state.disabledRows);\n const domIdAffix = usePropsStore((state) => state.domIdAffix);\n const isDisabledRow = disabledRows[row.uid];\n\n const { draggableProps } = useContext(SortableItemContext);\n\n const cellProps: DSDataTableT.CellProps = useMemo(\n () => ({\n ...cellRendererProps,\n ...props,\n role: 'cell',\n draggableProps,\n isDisabledRow,\n domIdAffix,\n }),\n [cellRendererProps, props, draggableProps, isDisabledRow, domIdAffix],\n );\n\n return (\n <PureStandardCell {...cellProps}>\n {column.editable && !disabledRows[row.uid] ? (\n <EditableCell {...cellProps} />\n ) : (\n <DefaultCellContent {...cellProps} />\n )}\n </PureStandardCell>\n );\n};\n\nexport { CellFactory };\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACkBjB;AAjBN,SAAS,kCAAkC;AAC3C,OAAOA,UAAS,MAAM,YAAY,eAAuC;AACzE,SAAS,uBAAuB;AAChC,SAAS,4BAA4B;AACrC,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAE9B,SAAS,YA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