@elliemae/ds-data-table 3.1.4 → 3.1.5-rc.12

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 (75) hide show
  1. package/dist/cjs/DataTable.js +3 -1
  2. package/dist/cjs/DataTable.js.map +2 -2
  3. package/dist/cjs/addons/Columns/ColumnSelectMultiple/ColumnSelectMultiple.js.map +1 -1
  4. package/dist/cjs/addons/Columns/ColumnSelectSingle/ColumnSelectSingle.js.map +1 -1
  5. package/dist/cjs/addons/Filters/Components/DateSwitcherFilter/index.js +3 -1
  6. package/dist/cjs/addons/Filters/Components/DateSwitcherFilter/index.js.map +2 -2
  7. package/dist/cjs/configs/constants.js +1 -0
  8. package/dist/cjs/configs/constants.js.map +2 -2
  9. package/dist/cjs/configs/useDatatableConfig.js +6 -1
  10. package/dist/cjs/configs/useDatatableConfig.js.map +2 -2
  11. package/dist/cjs/exported-related/Filters/applyOutOfTheBoxFilters.js.map +1 -1
  12. package/dist/cjs/exported-related/RowRenderer/DefaultRowContentRenderer.js +1 -1
  13. package/dist/cjs/exported-related/RowRenderer/DefaultRowContentRenderer.js.map +2 -2
  14. package/dist/cjs/exported-related/Toolbar/Toolbar.js +28 -5
  15. package/dist/cjs/exported-related/Toolbar/Toolbar.js.map +2 -2
  16. package/dist/cjs/parts/EmptyContent.js +4 -4
  17. package/dist/cjs/parts/EmptyContent.js.map +2 -2
  18. package/dist/cjs/parts/FilterBar/FiltersBar.js +7 -1
  19. package/dist/cjs/parts/FilterBar/FiltersBar.js.map +2 -2
  20. package/dist/cjs/parts/Filters/index.js.map +1 -1
  21. package/dist/cjs/parts/Headers/HeaderCell.js +1 -1
  22. package/dist/cjs/parts/Headers/HeaderCell.js.map +2 -2
  23. package/dist/cjs/parts/Headers/HeaderCellGroup.js +1 -0
  24. package/dist/cjs/parts/Headers/HeaderCellGroup.js.map +2 -2
  25. package/dist/cjs/parts/Headers/HeaderResizer.js +16 -7
  26. package/dist/cjs/parts/Headers/HeaderResizer.js.map +2 -2
  27. package/dist/cjs/parts/HoC/withConditionalDnDRowContext.js +3 -2
  28. package/dist/cjs/parts/HoC/withConditionalDnDRowContext.js.map +2 -2
  29. package/dist/cjs/parts/RowVariants/index.js.map +1 -1
  30. package/dist/cjs/parts/SortableHeaderCell.js +9 -3
  31. package/dist/cjs/parts/SortableHeaderCell.js.map +2 -2
  32. package/dist/cjs/parts/TableContent.js +6 -8
  33. package/dist/cjs/parts/TableContent.js.map +2 -2
  34. package/dist/cjs/parts/VirtualRowsList.js +1 -9
  35. package/dist/cjs/parts/VirtualRowsList.js.map +2 -2
  36. package/dist/cjs/styled.js +6 -11
  37. package/dist/cjs/styled.js.map +2 -2
  38. package/dist/esm/DataTable.js +3 -1
  39. package/dist/esm/DataTable.js.map +2 -2
  40. package/dist/esm/addons/Columns/ColumnSelectMultiple/ColumnSelectMultiple.js.map +1 -1
  41. package/dist/esm/addons/Columns/ColumnSelectSingle/ColumnSelectSingle.js.map +1 -1
  42. package/dist/esm/addons/Filters/Components/DateSwitcherFilter/index.js +3 -1
  43. package/dist/esm/addons/Filters/Components/DateSwitcherFilter/index.js.map +2 -2
  44. package/dist/esm/configs/constants.js +1 -0
  45. package/dist/esm/configs/constants.js.map +2 -2
  46. package/dist/esm/configs/useDatatableConfig.js +6 -1
  47. package/dist/esm/configs/useDatatableConfig.js.map +2 -2
  48. package/dist/esm/exported-related/Filters/applyOutOfTheBoxFilters.js.map +1 -1
  49. package/dist/esm/exported-related/RowRenderer/DefaultRowContentRenderer.js +1 -1
  50. package/dist/esm/exported-related/RowRenderer/DefaultRowContentRenderer.js.map +2 -2
  51. package/dist/esm/exported-related/Toolbar/Toolbar.js +28 -5
  52. package/dist/esm/exported-related/Toolbar/Toolbar.js.map +2 -2
  53. package/dist/esm/parts/EmptyContent.js +4 -4
  54. package/dist/esm/parts/EmptyContent.js.map +2 -2
  55. package/dist/esm/parts/FilterBar/FiltersBar.js +7 -1
  56. package/dist/esm/parts/FilterBar/FiltersBar.js.map +2 -2
  57. package/dist/esm/parts/Filters/index.js.map +1 -1
  58. package/dist/esm/parts/Headers/HeaderCell.js +1 -1
  59. package/dist/esm/parts/Headers/HeaderCell.js.map +2 -2
  60. package/dist/esm/parts/Headers/HeaderCellGroup.js +1 -0
  61. package/dist/esm/parts/Headers/HeaderCellGroup.js.map +2 -2
  62. package/dist/esm/parts/Headers/HeaderResizer.js +16 -7
  63. package/dist/esm/parts/Headers/HeaderResizer.js.map +2 -2
  64. package/dist/esm/parts/HoC/withConditionalDnDRowContext.js +3 -2
  65. package/dist/esm/parts/HoC/withConditionalDnDRowContext.js.map +2 -2
  66. package/dist/esm/parts/RowVariants/index.js.map +1 -1
  67. package/dist/esm/parts/SortableHeaderCell.js +9 -3
  68. package/dist/esm/parts/SortableHeaderCell.js.map +2 -2
  69. package/dist/esm/parts/TableContent.js +6 -8
  70. package/dist/esm/parts/TableContent.js.map +2 -2
  71. package/dist/esm/parts/VirtualRowsList.js +1 -9
  72. package/dist/esm/parts/VirtualRowsList.js.map +2 -2
  73. package/dist/esm/styled.js +6 -11
  74. package/dist/esm/styled.js.map +2 -2
  75. package/package.json +19 -19
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/parts/Headers/HeaderCell.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable max-params */\n/* eslint-disable max-lines */\n/* eslint-disable complexity */\n/* eslint-disable react/prop-types */\nimport React, { useContext, useMemo, useRef } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { StyledHeadTh, StyledHeaderRightIconsWrapper, StyledFocusWithin } from '../../styled';\nimport { DataTableContext } from '../../DataTableContext';\nimport { SortByCaret } from '../SortByCaret';\nimport { DnDHandle } from '..';\nimport { SortableItemContext } from '../HoC/SortableItemContext';\nimport { FilterMapItem } from '../Filters';\nimport { HeaderResizer } from './HeaderResizer';\nimport { TypescriptColumn } from '../../types/props';\nimport { useHeaderCellHandlers } from './useHeaderCellHandlers';\nimport { useHeaderCellConfig } from './useHeaderCellConfig';\nimport { useRecoverFocusCol } from '../../hooks/useRecoverFocusCol';\nimport { DATA_TESTID } from '../../configs/constants';\nimport { HeaderCellTitle } from './HeaderCellTitle';\n\nconst buildScreenReaderInstructions = (colSpan: number, draggable: boolean, filterable: boolean, sortable: boolean) => {\n const preffix = colSpan === 1 ? '' : 'Column Group. ';\n if (!draggable && !filterable && !sortable) return preffix;\n\n let message = sortable\n ? 'You can sort the data ascendingly/descendingly by this column. Use the up / down arrows keys to do so'\n : '';\n if (draggable && filterable) {\n message = `This column is draggable and filterable. To enable these interactions press the enter key. ${message}`;\n } else if (draggable || filterable) {\n message = `This column is ${\n draggable ? 'draggable' : 'filterable'\n }. To enable this interaction press the enter key. ${message}`;\n }\n return `${preffix}${message}`;\n};\n\ninterface HeaderCellCompProps {\n column: TypescriptColumn;\n isDragOverlay: boolean;\n colSpan: number;\n}\n\nexport const HeaderCell: React.ComponentType<HeaderCellCompProps> = (props) => {\n const { column, isDragOverlay, colSpan } = props;\n const ctx = useContext(DataTableContext);\n const {\n tableProps: { isResizeable, onColumnSortChange, dragAndDropColumns, onFiltersChange, filters, textWrap },\n flattenedData,\n reduxHeaders,\n patchHeader,\n } = ctx;\n const reduxHeader = useMemo(() => reduxHeaders[column.id], [reduxHeaders, column]);\n const dragHandleRef = useRef<HTMLDivElement>(null);\n const filterIconRef = useRef<HTMLDivElement>(null);\n\n const { draggableProps } = useContext(SortableItemContext);\n\n const { hasFilter, hasDnD, hasSortingCaret, hasRightIcons, shouldShowDnD, hCols, isDragging } = useHeaderCellConfig({\n column,\n dragAndDropColumns,\n draggableProps,\n reduxHeader,\n isDragOverlay,\n });\n\n useRecoverFocusCol(isDragging, dragHandleRef);\n\n const rightIcons = useMemo(() => {\n if (!hasRightIcons) return null;\n return (\n <StyledHeaderRightIconsWrapper>\n <FilterMapItem\n column={column}\n ctx={ctx}\n onFiltersChange={onFiltersChange}\n reduxHeader={reduxHeader}\n filterValue={filters}\n innerRef={filterIconRef}\n />\n {hasSortingCaret && <SortByCaret isSortedDesc={column.isSortedDesc} />}\n </StyledHeaderRightIconsWrapper>\n );\n }, [hasRightIcons, column, ctx, onFiltersChange, reduxHeader, filters, hasSortingCaret]);\n\n const DnDHandleComponent = useMemo(\n () => (\n <Grid mr=\"2px\" alignItems=\"center\" style={{ position: 'relative' }}>\n <StyledFocusWithin hideFocus={isDragging}>\n <DnDHandle\n key={column.id}\n innerRef={dragHandleRef}\n isReachable={reduxHeader?.withTabStops}\n id={column.id}\n isDragOverlay={isDragOverlay}\n />\n </StyledFocusWithin>\n </Grid>\n ),\n [column.id, isDragOverlay, isDragging, reduxHeader?.withTabStops],\n );\n\n const handlers = useHeaderCellHandlers({\n hasFilter,\n patchHeader,\n column,\n reduxHeader,\n hasDnD,\n onColumnSortChange,\n dragHandleRef,\n filterIconRef,\n headerRef: column.ref,\n });\n\n return (\n <StyledHeadTh\n column={column}\n {...handlers}\n role={colSpan === 1 ? 'columnheader' : 'group'}\n colSpan={colSpan}\n aria-describedby={`${column.id}-instructions`}\n // eslint-disable-next-line no-nested-ternary\n aria-sort={hasSortingCaret ? (column.isSortedDesc ? 'descending' : 'ascending') : 'none'}\n data-testid={DATA_TESTID.DATA_TABLE_HEADER}\n isFirstRowGroup={!!flattenedData[0]?.original?.dimsumHeaderValue}\n tabIndex={column.isFocuseable === false ? -1 : 0}\n isDragOverlay={isDragOverlay}\n isDraggingActive={draggableProps && draggableProps.active}\n shouldShowDnD={shouldShowDnD}\n ref={column.ref}\n >\n <Grid width=\"100%\" cols={hCols}>\n {shouldShowDnD && DnDHandleComponent}\n <HeaderCellTitle column={column} ctx={ctx} draggableProps={draggableProps} textWrap={textWrap} />\n {rightIcons}\n {isResizeable && column.canResize !== false && <HeaderResizer column={column} />}\n </Grid>\n <span id={`${column.id}-instructions`} style={{ display: 'none' }} aria-hidden=\"false\">\n {buildScreenReaderInstructions(\n colSpan,\n dragAndDropColumns && column.disableDnD !== true,\n hasFilter,\n column.canSort,\n )}\n </span>\n </StyledHeadTh>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADIvB,mBAAmD;AACnD,qBAAqB;AACrB,oBAA+E;AAC/E,8BAAiC;AACjC,yBAA4B;AAC5B,eAA0B;AAC1B,iCAAoC;AACpC,qBAA8B;AAC9B,2BAA8B;AAE9B,mCAAsC;AACtC,iCAAoC;AACpC,gCAAmC;AACnC,uBAA4B;AAC5B,6BAAgC;AAEhC,MAAM,gCAAgC,CAAC,SAAiB,WAAoB,YAAqB,aAAsB;AACrH,QAAM,UAAU,YAAY,IAAI,KAAK;AACrC,MAAI,CAAC,aAAa,CAAC,cAAc,CAAC;AAAU,WAAO;AAEnD,MAAI,UAAU,WACV,0GACA;AACJ,MAAI,aAAa,YAAY;AAC3B,cAAU,8FAA8F;AAAA,EAC1G,WAAW,aAAa,YAAY;AAClC,cAAU,kBACR,YAAY,cAAc,iEACyB;AAAA,EACvD;AACA,SAAO,GAAG,UAAU;AACtB;AAQO,MAAM,aAAuD,CAAC,UAAU;AAC7E,QAAM,EAAE,QAAQ,eAAe,YAAY;AAC3C,QAAM,MAAM,6BAAW,wCAAgB;AACvC,QAAM;AAAA,IACJ,YAAY,EAAE,cAAc,oBAAoB,oBAAoB,iBAAiB,SAAS;AAAA,IAC9F;AAAA,IACA;AAAA,IACA;AAAA,MACE;AACJ,QAAM,cAAc,0BAAQ,MAAM,aAAa,OAAO,KAAK,CAAC,cAAc,MAAM,CAAC;AACjF,QAAM,gBAAgB,yBAAuB,IAAI;AACjD,QAAM,gBAAgB,yBAAuB,IAAI;AAEjD,QAAM,EAAE,mBAAmB,6BAAW,8CAAmB;AAEzD,QAAM,EAAE,WAAW,QAAQ,iBAAiB,eAAe,eAAe,OAAO,eAAe,oDAAoB;AA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AC/C;AAAA,IACA,kBAAkB,kBAAkB,eAAe;AAAA,IACnD;AAAA,IACA,KAAK,OAAO;AAAA,MAEZ,mDAAC;AAAA,IAAK,OAAM;AAAA,IAAO,MAAM;AAAA,KACtB,iBAAiB,oBAClB,mDAAC;AAAA,IAAgB;AAAA,IAAgB;AAAA,IAAU;AAAA,IAAgC;AAAA,GAAoB,GAC9F,YACA,gBAAgB,OAAO,cAAc,SAAS,mDAAC;AAAA,IAAc;AAAA,GAAgB,CAChF,GACA,mDAAC;AAAA,IAAK,IAAI,GAAG,OAAO;AAAA,IAAmB,OAAO,EAAE,SAAS,OAAO;AAAA,IAAG,eAAY;AAAA,KAC5E,8BACC,SACA,sBAAsB,OAAO,eAAe,MAC5C,WACA,OAAO,OACT,CACF,CACF;AAEJ;",
4
+ "sourcesContent": ["/* eslint-disable max-params */\n/* eslint-disable max-lines */\n/* eslint-disable complexity */\n/* eslint-disable react/prop-types */\nimport React, { useContext, useMemo, useRef } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { StyledHeadTh, StyledHeaderRightIconsWrapper, StyledFocusWithin } from '../../styled';\nimport { DataTableContext } from '../../DataTableContext';\nimport { SortByCaret } from '../SortByCaret';\nimport { DnDHandle } from '..';\nimport { SortableItemContext } from '../HoC/SortableItemContext';\nimport { FilterMapItem } from '../Filters';\nimport { HeaderResizer } from './HeaderResizer';\nimport { TypescriptColumn } from '../../types/props';\nimport { useHeaderCellHandlers } from './useHeaderCellHandlers';\nimport { useHeaderCellConfig } from './useHeaderCellConfig';\nimport { useRecoverFocusCol } from '../../hooks/useRecoverFocusCol';\nimport { DATA_TESTID } from '../../configs/constants';\nimport { HeaderCellTitle } from './HeaderCellTitle';\n\nconst buildScreenReaderInstructions = (colSpan: number, draggable: boolean, filterable: boolean, sortable: boolean) => {\n const preffix = colSpan === 1 ? '' : 'Column Group. ';\n if (!draggable && !filterable && !sortable) return preffix;\n\n let message = sortable\n ? 'You can sort the data ascendingly/descendingly by this column. Use the up / down arrows keys to do so'\n : '';\n if (draggable && filterable) {\n message = `This column is draggable and filterable. To enable these interactions press the enter key. ${message}`;\n } else if (draggable || filterable) {\n message = `This column is ${\n draggable ? 'draggable' : 'filterable'\n }. To enable this interaction press the enter key. ${message}`;\n }\n return `${preffix}${message}`;\n};\n\ninterface HeaderCellCompProps {\n column: TypescriptColumn;\n isDragOverlay: boolean;\n colSpan: number;\n}\n\nexport const HeaderCell: React.ComponentType<HeaderCellCompProps> = (props) => {\n const { column, isDragOverlay, colSpan } = props;\n const ctx = useContext(DataTableContext);\n const {\n tableProps: { isResizeable, onColumnSortChange, dragAndDropColumns, onFiltersChange, filters, textWrap },\n flattenedData,\n reduxHeaders,\n patchHeader,\n } = ctx;\n const reduxHeader = useMemo(() => reduxHeaders[column.id], [reduxHeaders, column]);\n const dragHandleRef = useRef<HTMLDivElement>(null);\n const filterIconRef = useRef<HTMLDivElement>(null);\n\n const { draggableProps } = useContext(SortableItemContext);\n\n const { hasFilter, hasDnD, hasSortingCaret, hasRightIcons, shouldShowDnD, hCols, isDragging } = useHeaderCellConfig({\n column,\n dragAndDropColumns,\n draggableProps,\n reduxHeader,\n isDragOverlay,\n });\n\n useRecoverFocusCol(isDragging, dragHandleRef);\n\n const rightIcons = useMemo(() => {\n if (!hasRightIcons) return null;\n return (\n <StyledHeaderRightIconsWrapper>\n <FilterMapItem\n column={column}\n ctx={ctx}\n onFiltersChange={onFiltersChange}\n reduxHeader={reduxHeader}\n filterValue={filters}\n innerRef={filterIconRef}\n />\n {hasSortingCaret && <SortByCaret isSortedDesc={column.isSortedDesc} />}\n </StyledHeaderRightIconsWrapper>\n );\n }, [hasRightIcons, column, ctx, onFiltersChange, reduxHeader, filters, hasSortingCaret]);\n\n const DnDHandleComponent = useMemo(\n () => (\n <Grid mr=\"2px\" alignItems=\"center\" style={{ position: 'relative' }}>\n <StyledFocusWithin hideFocus={isDragging}>\n <DnDHandle\n key={column.id}\n innerRef={dragHandleRef}\n isReachable={reduxHeader?.withTabStops}\n id={column.id}\n isDragOverlay={isDragOverlay}\n />\n </StyledFocusWithin>\n </Grid>\n ),\n [column.id, isDragOverlay, isDragging, reduxHeader?.withTabStops],\n );\n\n const handlers = useHeaderCellHandlers({\n hasFilter,\n patchHeader,\n column,\n reduxHeader,\n hasDnD,\n onColumnSortChange,\n dragHandleRef,\n filterIconRef,\n headerRef: column.ref,\n });\n\n return (\n <StyledHeadTh\n column={column}\n {...handlers}\n role={colSpan === 1 ? 'columnheader' : 'group'}\n colSpan={colSpan}\n aria-describedby={`${column.id}-instructions`}\n // eslint-disable-next-line no-nested-ternary\n aria-sort={hasSortingCaret ? (column.isSortedDesc ? 'descending' : 'ascending') : 'none'}\n data-testid={DATA_TESTID.DATA_TABLE_HEADER}\n isFirstRowGroup={!!flattenedData[0]?.original?.dimsumHeaderValue}\n tabIndex={column.isFocuseable === false ? -1 : 0}\n isDragOverlay={isDragOverlay}\n isDraggingActive={draggableProps && draggableProps.active}\n shouldShowDnD={shouldShowDnD}\n ref={column.ref}\n >\n <Grid width=\"100%\" cols={hCols}>\n {shouldShowDnD && DnDHandleComponent}\n <HeaderCellTitle column={column} ctx={ctx} draggableProps={draggableProps} textWrap={textWrap} />\n {rightIcons}\n {isResizeable && column.canResize !== false && !column.columns && <HeaderResizer column={column} />}\n </Grid>\n <span id={`${column.id}-instructions`} style={{ display: 'none' }} aria-hidden=\"false\">\n {buildScreenReaderInstructions(\n colSpan,\n dragAndDropColumns && column.disableDnD !== true,\n hasFilter,\n column.canSort,\n )}\n </span>\n </StyledHeadTh>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADIvB,mBAAmD;AACnD,qBAAqB;AACrB,oBAA+E;AAC/E,8BAAiC;AACjC,yBAA4B;AAC5B,eAA0B;AAC1B,iCAAoC;AACpC,qBAA8B;AAC9B,2BAA8B;A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AAA,IAAK,IAAI,GAAG,OAAO;AAAA,IAAmB,OAAO,EAAE,SAAS,OAAO;AAAA,IAAG,eAAY;AAAA,KAC5E,8BACC,SACA,sBAAsB,OAAO,eAAe,MAC5C,WACA,OAAO,OACT,CACF,CACF;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -78,6 +78,7 @@ const HeaderCellGroupComp = ({
78
78
  isDragOverlay,
79
79
  colSpan
80
80
  }), !!children?.length && !isDragOverlay && /* @__PURE__ */ import_react.default.createElement(import_SortableHeaderCell.SortableHeaderCell, {
81
+ isGroup: true,
81
82
  items: children,
82
83
  isDragOverlay
83
84
  }, children.map((h, index) => /* @__PURE__ */ import_react.default.createElement(ChildGroup, {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/parts/Headers/HeaderCellGroup.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable complexity */\nimport React, { useContext } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { styled } from '@elliemae/ds-system';\nimport PropTypes from 'prop-types';\nimport { HeaderCell } from './HeaderCell';\nimport { SortableItemContext } from '../HoC/SortableItemContext';\nimport { withDnDSortableColumnContext } from '../internal';\nimport { DropIndicator } from '../DropIndicator';\nimport { SortableHeaderCell } from '../SortableHeaderCell';\nimport { TypescriptColumn } from '../../types/props';\nimport { EmptyChildrenGroup } from './EmptyChildrenGroup';\nimport { DATA_TESTID } from '../../configs';\nimport DataTableContext from '../../DataTableContext';\n\nconst StyledWrapper = styled(Grid)`\n position: relative;\n ${({ shouldDropOneLevel, isDragOverlay }) => (shouldDropOneLevel && !isDragOverlay ? `top: 50%; height: 50%;` : '')}\n width: ${(props) => (props.isDragOverlay ? 'fit-content' : '100%')};\n grid-column: ${(props) => props.gridColumn};\n background: ${(props) => (props.isDragging ? props.theme.colors.neutral['080'] : 'white')};\n opacity: ${(props) => (props.isDragging ? 0.8 : 1)};\n box-shadow: 0 2px 4px 0 ${(props) => (props.isDragOverlay ? 'rgba(0,0,0,0.5)' : 'transparent')};\n border-left: ${({ isFirst }) => (isFirst ? '0px' : '1px')} solid ${(props) => props.theme.colors.neutral['080']};\n`;\n\ninterface HeaderCellGroupCompProps {\n header: TypescriptColumn;\n isDragOverlay?: boolean;\n isDraggingParent?: boolean;\n isLast?: boolean;\n isFirst?: boolean;\n level?: number;\n}\n\nconst HeaderCellGroupComp: React.ComponentType<HeaderCellGroupCompProps> = ({\n header,\n isDragOverlay,\n isDraggingParent,\n isLast,\n isFirst,\n level = 0,\n}) => {\n const { visibleColumns } = useContext(DataTableContext);\n const { draggableProps } = useContext(SortableItemContext);\n\n const isMultiLevel = visibleColumns.some((col) => !!col.columns);\n\n const children = header.columns;\n\n const isDragging = (draggableProps && draggableProps.isDragging) || isDraggingParent;\n const dropIndicatorPosition =\n draggableProps && draggableProps.shouldShowDropIndicatorPosition && draggableProps.dropIndicatorPosition;\n\n const ChildGroup = isDragOverlay ? HeaderCellGroup : HeaderCellGroupSortable;\n\n const colSpan = children?.length ?? 1;\n return (\n <StyledWrapper\n ref={draggableProps ? draggableProps.setNodeRef : null}\n gridColumn={isDragOverlay ? 'auto' : `span ${colSpan}`}\n isDragOverlay={isDragOverlay}\n isDragging={isDragging}\n cols={['auto']}\n data-testid={isDragOverlay ? DATA_TESTID.DATA_TABLE_COLUMN_DRAG_OVERLAY : undefined}\n isFirst={isFirst}\n shouldDropOneLevel={isMultiLevel && level === 0 && !children}\n >\n <HeaderCell column={header} isDragOverlay={isDragOverlay} colSpan={colSpan} />\n {!!children?.length && !isDragOverlay && (\n <SortableHeaderCell items={children} isDragOverlay={isDragOverlay}>\n {children.map((h, index) => (\n <ChildGroup\n key={h.id}\n header={h}\n isDragOverlay={isDragOverlay}\n isDraggingParent={isDragging}\n isLast={index === children.length - 1}\n isFirst={index === 0}\n level={level + 1}\n />\n ))}\n </SortableHeaderCell>\n )}\n {children?.length && isDragOverlay && <EmptyChildrenGroup />}\n <DropIndicator vertical dropIndicatorPosition={dropIndicatorPosition} isLast={isLast && isDragging} />\n </StyledWrapper>\n );\n};\n\nHeaderCellGroupComp.propTypes = {\n header: PropTypes.any,\n isDragOverlay: PropTypes.bool,\n isDraggingParent: PropTypes.bool,\n isLast: PropTypes.bool,\n isFirst: PropTypes.bool,\n level: PropTypes.number,\n};\n\n// We need to declare this because we MUST avoid the useSortable call in the recursive calls of the function\n\nexport const HeaderCellGroup = HeaderCellGroupComp;\n\nexport const HeaderCellGroupSortable = withDnDSortableColumnContext(HeaderCellGroupComp);\n\nexport default HeaderCellGroupSortable;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAkC;AAClC,qBAAqB;AACrB,uBAAuB;AACvB,wBAAsB;AACtB,wBAA2B;AAC3B,iCAAoC;AACpC,sBAA6C;AAC7C,2BAA8B;AAC9B,gCAAmC;AAEnC,gCAAmC;AACnC,qBAA4B;AAC5B,8BAA6B;AAE7B,MAAM,gBAAgB,6BAAO,mBAAI;AAAA;AAAA,IAE7B,CAAC,EAAE,oBAAoB,oBAAqB,sBAAsB,CAAC,gBAAgB,2BAA2B;AAAA,WACvG,CAAC,UAAW,MAAM,gBAAgB,gBAAgB;AAAA,iBAC5C,CAAC,UAAU,MAAM;AAAA,gBAClB,CAAC,UAAW,MAAM,aAAa,MAAM,MAAM,OAAO,QAAQ,SAAS;AAAA,aACtE,CAAC,UAAW,MAAM,aAAa,MAAM;AAAA,4BACtB,CAAC,UAAW,MAAM,gBAAgB,oBAAoB;AAAA,iBACjE,CAAC,EAAE,cAAe,UAAU,QAAQ,eAAgB,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAY3G,MAAM,sBAAqE,CAAC;AAAA,EAC1E;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,MACJ;AAC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;AAAA,EAClB,SAAS,0BAAU;AAAA,EACnB,OAAO,0BAAU;AACnB;AAIO,MAAM,kBAAkB;AAExB,MAAM,0BAA0B,kDAA6B,mBAAmB;AAEvF,IAAO,0BAAQ;",
4
+ "sourcesContent": ["/* eslint-disable complexity */\nimport React, { useContext } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { styled } from '@elliemae/ds-system';\nimport PropTypes from 'prop-types';\nimport { HeaderCell } from './HeaderCell';\nimport { SortableItemContext } from '../HoC/SortableItemContext';\nimport { withDnDSortableColumnContext } from '../internal';\nimport { DropIndicator } from '../DropIndicator';\nimport { SortableHeaderCell } from '../SortableHeaderCell';\nimport { TypescriptColumn } from '../../types/props';\nimport { EmptyChildrenGroup } from './EmptyChildrenGroup';\nimport { DATA_TESTID } from '../../configs';\nimport DataTableContext from '../../DataTableContext';\n\nconst StyledWrapper = styled(Grid)`\n position: relative;\n ${({ shouldDropOneLevel, isDragOverlay }) => (shouldDropOneLevel && !isDragOverlay ? `top: 50%; height: 50%;` : '')}\n width: ${(props) => (props.isDragOverlay ? 'fit-content' : '100%')};\n grid-column: ${(props) => props.gridColumn};\n background: ${(props) => (props.isDragging ? props.theme.colors.neutral['080'] : 'white')};\n opacity: ${(props) => (props.isDragging ? 0.8 : 1)};\n box-shadow: 0 2px 4px 0 ${(props) => (props.isDragOverlay ? 'rgba(0,0,0,0.5)' : 'transparent')};\n border-left: ${({ isFirst }) => (isFirst ? '0px' : '1px')} solid ${(props) => props.theme.colors.neutral['080']};\n`;\n\ninterface HeaderCellGroupCompProps {\n header: TypescriptColumn;\n isDragOverlay?: boolean;\n isDraggingParent?: boolean;\n isLast?: boolean;\n isFirst?: boolean;\n level?: number;\n}\n\nconst HeaderCellGroupComp: React.ComponentType<HeaderCellGroupCompProps> = ({\n header,\n isDragOverlay,\n isDraggingParent,\n isLast,\n isFirst,\n level = 0,\n}) => {\n const { visibleColumns } = useContext(DataTableContext);\n const { draggableProps } = useContext(SortableItemContext);\n\n const isMultiLevel = visibleColumns.some((col) => !!col.columns);\n\n const children = header.columns;\n\n const isDragging = (draggableProps && draggableProps.isDragging) || isDraggingParent;\n const dropIndicatorPosition =\n draggableProps && draggableProps.shouldShowDropIndicatorPosition && draggableProps.dropIndicatorPosition;\n\n const ChildGroup = isDragOverlay ? HeaderCellGroup : HeaderCellGroupSortable;\n\n const colSpan = children?.length ?? 1;\n return (\n <StyledWrapper\n ref={draggableProps ? draggableProps.setNodeRef : null}\n gridColumn={isDragOverlay ? 'auto' : `span ${colSpan}`}\n isDragOverlay={isDragOverlay}\n isDragging={isDragging}\n cols={['auto']}\n data-testid={isDragOverlay ? DATA_TESTID.DATA_TABLE_COLUMN_DRAG_OVERLAY : undefined}\n isFirst={isFirst}\n shouldDropOneLevel={isMultiLevel && level === 0 && !children}\n >\n <HeaderCell column={header} isDragOverlay={isDragOverlay} colSpan={colSpan} />\n {!!children?.length && !isDragOverlay && (\n <SortableHeaderCell isGroup items={children} isDragOverlay={isDragOverlay}>\n {children.map((h, index) => (\n <ChildGroup\n key={h.id}\n header={h}\n isDragOverlay={isDragOverlay}\n isDraggingParent={isDragging}\n isLast={index === children.length - 1}\n isFirst={index === 0}\n level={level + 1}\n />\n ))}\n </SortableHeaderCell>\n )}\n {children?.length && isDragOverlay && <EmptyChildrenGroup />}\n <DropIndicator vertical dropIndicatorPosition={dropIndicatorPosition} isLast={isLast && isDragging} />\n </StyledWrapper>\n );\n};\n\nHeaderCellGroupComp.propTypes = {\n header: PropTypes.any,\n isDragOverlay: PropTypes.bool,\n isDraggingParent: PropTypes.bool,\n isLast: PropTypes.bool,\n isFirst: PropTypes.bool,\n level: PropTypes.number,\n};\n\n// We need to declare this because we MUST avoid the useSortable call in the recursive calls of the function\n\nexport const HeaderCellGroup = HeaderCellGroupComp;\n\nexport const HeaderCellGroupSortable = withDnDSortableColumnContext(HeaderCellGroupComp);\n\nexport default HeaderCellGroupSortable;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;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AAS,QAAQ;AAAA,IAC7C;AAAA,IACA;AAAA,IACA,MAAM,CAAC,MAAM;AAAA,IACb,eAAa,gBAAgB,2BAAY,iCAAiC;AAAA,IAC1E;AAAA,IACA,oBAAoB,gBAAgB,UAAU,KAAK,CAAC;AAAA,KAEpD,mDAAC;AAAA,IAAW,QAAQ;AAAA,IAAQ;AAAA,IAA8B;AAAA,GAAkB,GAC3E,CAAC,CAAC,UAAU,UAAU,CAAC,iBACtB,mDAAC;AAAA,IAAmB,SAAO;AAAA,IAAC,OAAO;AAAA,IAAU;AAAA,KAC1C,SAAS,IAAI,CAAC,GAAG,UAChB,mDAAC;AAAA,IACC,KAAK,EAAE;AAAA,IACP,QAAQ;AAAA,IACR;AAAA,IACA,kBAAkB;AAAA,IAClB,QAAQ,UAAU,SAAS,SAAS;AAAA,IACpC,SAAS,UAAU;AAAA,IACnB,OAAO,QAAQ;AAAA,GACjB,CACD,CACH,GAED,UAAU,UAAU,iBAAiB,mDAAC,kDAAmB,GAC1D,mDAAC;AAAA,IAAc,UAAQ;AAAA,IAAC;AAAA,IAA8C,QAAQ,UAAU;AAAA,GAAY,CACtG;AAEJ;AAEA,oBAAoB,YAAY;AAAA,EAC9B,QAAQ,0BAAU;AAAA,EAClB,eAAe,0BAAU;AAAA,EACzB,kBAAkB,0BAAU;AAAA,EAC5B,QAAQ,0BAAU;AAAA,EAClB,SAAS,0BAAU;AAAA,EACnB,OAAO,0BAAU;AACnB;AAIO,MAAM,kBAAkB;AAExB,MAAM,0BAA0B,kDAA6B,mBAAmB;AAEvF,IAAO,0BAAQ;",
6
6
  "names": []
7
7
  }
@@ -52,11 +52,18 @@ const HeaderResizer = ({ column }) => {
52
52
  } = (0, import_react.useContext)(import_DataTableContext.DataTableContext);
53
53
  const [isResizing, setIsResizing] = (0, import_react.useState)(false);
54
54
  const [nextWidth, setNextWidth] = (0, import_react.useState)(column.width ?? 150);
55
- const visibleColumnsCopy = (0, import_react.useMemo)(() => visibleColumns.map((col) => __spreadValues({}, col)), [visibleColumns]);
55
+ const visibleColumnsCopy = (0, import_react.useMemo)(() => visibleColumns.reduce((acc, col) => {
56
+ if (col.columns) {
57
+ return [...acc, ...col.columns];
58
+ }
59
+ return [...acc, __spreadValues({}, col)];
60
+ }, []), [visibleColumns]);
56
61
  (0, import_react.useEffect)(() => {
57
62
  const realColumnIndex = visibleColumnsCopy.findIndex((visibleColumn) => visibleColumn.id === column.id);
58
- visibleColumnsCopy[realColumnIndex].width = nextWidth;
59
- setGridLayout((0, import_helpers.columnsToGrid)(visibleColumnsCopy, import_constants.ColsLayoutStyle.Fixed));
63
+ if (realColumnIndex > -1) {
64
+ visibleColumnsCopy[realColumnIndex].width = nextWidth;
65
+ setGridLayout((0, import_helpers.columnsToGrid)(visibleColumnsCopy, import_constants.ColsLayoutStyle.Fixed));
66
+ }
60
67
  }, [column.id, nextWidth, setGridLayout, visibleColumnsCopy]);
61
68
  const ref = (0, import_react.useRef)(null);
62
69
  const onResizeStart = (0, import_react.useCallback)(() => {
@@ -65,16 +72,18 @@ const HeaderResizer = ({ column }) => {
65
72
  const onResizeHandler = (0, import_react.useCallback)((e) => {
66
73
  const delta = ("clientX" in e ? e.clientX : e.touches[0].clientX) - (ref.current?.getBoundingClientRect().x ?? 0);
67
74
  const realColumnIndex = visibleColumnsCopy.findIndex((visibleColumn) => visibleColumn.id === column.id);
68
- const widthWithDelta = narrow(nextWidth + delta, visibleColumnsCopy[realColumnIndex].minWidth, visibleColumnsCopy[realColumnIndex].maxWidth);
69
- setNextWidth(widthWithDelta);
75
+ if (realColumnIndex > -1) {
76
+ const widthWithDelta = narrow(nextWidth + delta, visibleColumnsCopy[realColumnIndex].minWidth, visibleColumnsCopy[realColumnIndex].maxWidth);
77
+ setNextWidth(widthWithDelta);
78
+ }
70
79
  e.preventDefault();
71
80
  e.stopPropagation();
72
81
  }, [column.id, nextWidth, visibleColumnsCopy]);
73
82
  const onResizeEnd = (0, import_react.useCallback)(() => {
74
- setGridLayout((0, import_helpers.columnsToGrid)(visibleColumns, import_constants.ColsLayoutStyle.Fixed));
83
+ setGridLayout((0, import_helpers.columnsToGrid)(visibleColumnsCopy, import_constants.ColsLayoutStyle.Fixed));
75
84
  setIsResizing(false);
76
85
  onColumnResize(column.id, nextWidth);
77
- }, [onColumnResize, column.id, nextWidth, setGridLayout, visibleColumns]);
86
+ }, [onColumnResize, column.id, nextWidth, setGridLayout, visibleColumnsCopy]);
78
87
  (0, import_react.useEffect)(() => {
79
88
  const debouncedResizeHandler = onResizeHandler;
80
89
  const debouncedResizeEnd = onResizeEnd;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/parts/Headers/HeaderResizer.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable react/prop-types */\nimport React, { useState, useCallback, useContext, useRef, useEffect, useMemo } from 'react';\nimport { ColsLayoutStyle } from '../../configs/constants';\nimport { DataTableContext } from '../../DataTableContext';\nimport { columnsToGrid } from '../../helpers';\nimport { StyledResizer } from '../../styled';\nimport { TypescriptColumn } from '../../types/props';\n\nconst narrow = (value: number, min: number | undefined, max: number | undefined): number =>\n Math.min(Math.max(value, min ?? 30), max ?? Infinity);\n\nexport const HeaderResizer: React.ComponentType<{\n column: TypescriptColumn;\n}> = ({ column }) => {\n const {\n layoutHelpers: { setGridLayout },\n visibleColumns,\n tableProps: { onColumnResize },\n } = useContext(DataTableContext);\n\n const [isResizing, setIsResizing] = useState(false);\n const [nextWidth, setNextWidth] = useState(column.width ?? 150);\n\n const visibleColumnsCopy = useMemo(() => visibleColumns.map((col) => ({ ...col })), [visibleColumns]);\n\n useEffect(() => {\n const realColumnIndex = visibleColumnsCopy.findIndex((visibleColumn) => visibleColumn.id === column.id);\n\n visibleColumnsCopy[realColumnIndex].width = nextWidth;\n setGridLayout(columnsToGrid(visibleColumnsCopy, ColsLayoutStyle.Fixed));\n }, [column.id, nextWidth, setGridLayout, visibleColumnsCopy]);\n\n const ref = useRef<HTMLDivElement>(null);\n\n const onResizeStart = useCallback(() => {\n setIsResizing(true);\n }, []);\n\n const onResizeHandler = useCallback(\n (e: MouseEvent | TouchEvent) => {\n const delta = ('clientX' in e ? e.clientX : e.touches[0].clientX) - (ref.current?.getBoundingClientRect().x ?? 0); // delta in pixels\n\n const realColumnIndex = visibleColumnsCopy.findIndex((visibleColumn) => visibleColumn.id === column.id);\n\n const widthWithDelta = narrow(\n nextWidth + delta,\n visibleColumnsCopy[realColumnIndex].minWidth,\n visibleColumnsCopy[realColumnIndex].maxWidth,\n );\n\n setNextWidth(widthWithDelta);\n\n // To prevent text selection\n e.preventDefault();\n e.stopPropagation();\n },\n [column.id, nextWidth, visibleColumnsCopy],\n );\n\n const onResizeEnd = useCallback(() => {\n setGridLayout(columnsToGrid(visibleColumns, ColsLayoutStyle.Fixed));\n setIsResizing(false);\n onColumnResize(column.id, nextWidth);\n }, [onColumnResize, column.id, nextWidth, setGridLayout, visibleColumns]);\n\n useEffect(() => {\n const debouncedResizeHandler = onResizeHandler;\n const debouncedResizeEnd = onResizeEnd;\n const addEvents = () => {\n document.addEventListener('mousemove', debouncedResizeHandler);\n document.addEventListener('touchmove', debouncedResizeHandler);\n document.addEventListener('mouseup', debouncedResizeEnd);\n document.addEventListener('touchend', debouncedResizeEnd);\n };\n const removeEvents = () => {\n document.removeEventListener('mousemove', debouncedResizeHandler);\n document.removeEventListener('touchmove', debouncedResizeHandler);\n document.removeEventListener('mouseup', debouncedResizeEnd);\n document.removeEventListener('touchend', debouncedResizeEnd);\n };\n\n if (isResizing) addEvents();\n else removeEvents();\n\n // just in case the component is unmounted\n return removeEvents;\n }, [isResizing, onResizeHandler, onResizeEnd]);\n\n return (\n <StyledResizer\n ref={ref}\n role=\"separator\"\n draggable={false}\n isResizing={isResizing}\n onMouseDown={onResizeStart}\n onTouchStart={onResizeStart}\n onMouseUp={onResizeEnd}\n onTouchEnd={onResizeEnd}\n onClick={(e) => e.stopPropagation()}\n />\n );\n};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AiB,OACrB,YAAY,OACZ,mBAAmB,iBAAiB,UACpC,mBAAmB,iBAAiB,QACtC;AAEA,iBAAa,cAAc;AAG3B,MAAE,eAAe;AACjB,MAAE,gBAAgB;AAAA,EACpB,GACA,CAAC,OAAO,IAAI,WAAW,kBAAkB,CAC3C;AAEA,QAAM,cAAc,8BAAY,MAAM;AACpC,kBAAc,kCAAc,gBAAgB,iCAAgB,KAAK,CAAC;AAClE,kBAAc,KAAK;AACnB,mBAAe,OAAO,IAAI,SAAS;AAAA,EACrC,GAAG,CAAC,gBAAgB,OAAO,IAAI,WAAW,eAAe,cAAc,CAAC;AAExE,8BAAU,MAAM;AACd,UAAM,yBAAyB;AAC/B,UAAM,qBAAqB;AAC3B,UAAM,YAAY,MAAM;AACtB,eAAS,iBAAiB,aAAa,sBAAsB;AAC7D,eAAS,iBAAiB,aAAa,sBAAsB;AAC7D,eAAS,iBAAiB,WAAW,kBAAkB;AACvD,eAAS,iBAAiB,YAAY,kBAAkB;AAAA,IAC1D;AACA,UAAM,eAAe,MAAM;AACzB,eAAS,oBAAoB,aAAa,sBAAsB;AAChE,eAAS,oBAAoB,aAAa,sBAAsB;AAChE,eAAS,oBAAoB,WAAW,kBAAkB;AAC1D,eAAS,oBAAoB,YAAY,kBAAkB;AAAA,IAC7D;AAEA,QAAI;AAAY,gBAAU;AAAA;AACrB,mBAAa;AAGlB,WAAO;AAAA,EACT,GAAG,CAAC,YAAY,iBAAiB,WAAW,CAAC;AAE7C,SACE,mDAAC;AAAA,IACC;AAAA,IACA,MAAK;AAAA,IACL,WAAW;AAAA,IACX;AAAA,IACA,aAAa;AAAA,IACb,cAAc;AAAA,IACd,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,SAAS,CAAC,MAAM,EAAE,gBAAgB;AAAA,GACpC;AAEJ;",
4
+ "sourcesContent": ["/* eslint-disable react/prop-types */\nimport React, { useState, useCallback, useContext, useRef, useEffect, useMemo } from 'react';\nimport { ColsLayoutStyle } from '../../configs/constants';\nimport { DataTableContext } from '../../DataTableContext';\nimport { columnsToGrid } from '../../helpers';\nimport { StyledResizer } from '../../styled';\nimport { TypescriptColumn } from '../../types/props';\n\nconst narrow = (value: number, min: number | undefined, max: number | undefined): number =>\n Math.min(Math.max(value, min ?? 30), max ?? Infinity);\n\nexport const HeaderResizer: React.ComponentType<{\n column: TypescriptColumn;\n}> = ({ column }) => {\n const {\n layoutHelpers: { setGridLayout },\n visibleColumns,\n tableProps: { onColumnResize },\n } = useContext(DataTableContext);\n\n const [isResizing, setIsResizing] = useState(false);\n const [nextWidth, setNextWidth] = useState(column.width ?? 150);\n const visibleColumnsCopy = useMemo(\n () =>\n visibleColumns.reduce((acc, col) => {\n if (col.columns) {\n return [...acc, ...col.columns];\n }\n return [...acc, { ...col }];\n }, [] as TypescriptColumn[]),\n [visibleColumns],\n );\n\n useEffect(() => {\n const realColumnIndex = visibleColumnsCopy.findIndex((visibleColumn) => visibleColumn.id === column.id);\n if (realColumnIndex > -1) {\n visibleColumnsCopy[realColumnIndex].width = nextWidth;\n setGridLayout(columnsToGrid(visibleColumnsCopy, ColsLayoutStyle.Fixed));\n }\n }, [column.id, nextWidth, setGridLayout, visibleColumnsCopy]);\n\n const ref = useRef<HTMLDivElement>(null);\n\n const onResizeStart = useCallback(() => {\n setIsResizing(true);\n }, []);\n\n const onResizeHandler = useCallback(\n (e: MouseEvent | TouchEvent) => {\n const delta = ('clientX' in e ? e.clientX : e.touches[0].clientX) - (ref.current?.getBoundingClientRect().x ?? 0); // delta in pixels\n\n const realColumnIndex = visibleColumnsCopy.findIndex((visibleColumn) => visibleColumn.id === column.id);\n if (realColumnIndex > -1) {\n const widthWithDelta = narrow(\n nextWidth + delta,\n visibleColumnsCopy[realColumnIndex].minWidth,\n visibleColumnsCopy[realColumnIndex].maxWidth,\n );\n setNextWidth(widthWithDelta);\n }\n // To prevent text selection\n e.preventDefault();\n e.stopPropagation();\n },\n [column.id, nextWidth, visibleColumnsCopy],\n );\n\n const onResizeEnd = useCallback(() => {\n setGridLayout(columnsToGrid(visibleColumnsCopy, ColsLayoutStyle.Fixed));\n setIsResizing(false);\n onColumnResize(column.id, nextWidth);\n }, [onColumnResize, column.id, nextWidth, setGridLayout, visibleColumnsCopy]);\n\n useEffect(() => {\n const debouncedResizeHandler = onResizeHandler;\n const debouncedResizeEnd = onResizeEnd;\n const addEvents = () => {\n document.addEventListener('mousemove', debouncedResizeHandler);\n document.addEventListener('touchmove', debouncedResizeHandler);\n document.addEventListener('mouseup', debouncedResizeEnd);\n document.addEventListener('touchend', debouncedResizeEnd);\n };\n const removeEvents = () => {\n document.removeEventListener('mousemove', debouncedResizeHandler);\n document.removeEventListener('touchmove', debouncedResizeHandler);\n document.removeEventListener('mouseup', debouncedResizeEnd);\n document.removeEventListener('touchend', debouncedResizeEnd);\n };\n\n if (isResizing) addEvents();\n else removeEvents();\n\n // just in case the component is unmounted\n return removeEvents;\n }, [isResizing, onResizeHandler, onResizeEnd]);\n\n return (\n <StyledResizer\n ref={ref}\n role=\"separator\"\n draggable={false}\n isResizing={isResizing}\n onMouseDown={onResizeStart}\n onTouchStart={onResizeStart}\n onMouseUp={onResizeEnd}\n onTouchEnd={onResizeEnd}\n onClick={(e) => e.stopPropagation()}\n />\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAqF;AACrF,uBAAgC;AAChC,8BAAiC;AACjC,qBAA8B;AAC9B,oBAA8B;AAG9B,MAAM,SAAS,CAAC,OAAe,KAAyB,QACtD,KAAK,IAAI,KAAK,IAAI,OAAO,OAAO,EAAE,GAAG,OAAO,QAAQ;AAE/C,MAAM,gBAER,CAAC,EAAE,aAAa;AACnB,QAAM;AAAA,IACJ,eAAe,EAAE;AAAA,IACjB;AAAA,IACA,YAAY,EAAE;AAAA,MACZ,6BAAW,wCAAgB;AAE/B,QAAM,CAAC,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AoB,iCAAgB,KAAK,CAAC;AACtE,kBAAc,KAAK;AACnB,mBAAe,OAAO,IAAI,SAAS;AAAA,EACrC,GAAG,CAAC,gBAAgB,OAAO,IAAI,WAAW,eAAe,kBAAkB,CAAC;AAE5E,8BAAU,MAAM;AACd,UAAM,yBAAyB;AAC/B,UAAM,qBAAqB;AAC3B,UAAM,YAAY,MAAM;AACtB,eAAS,iBAAiB,aAAa,sBAAsB;AAC7D,eAAS,iBAAiB,aAAa,sBAAsB;AAC7D,eAAS,iBAAiB,WAAW,kBAAkB;AACvD,eAAS,iBAAiB,YAAY,kBAAkB;AAAA,IAC1D;AACA,UAAM,eAAe,MAAM;AACzB,eAAS,oBAAoB,aAAa,sBAAsB;AAChE,eAAS,oBAAoB,aAAa,sBAAsB;AAChE,eAAS,oBAAoB,WAAW,kBAAkB;AAC1D,eAAS,oBAAoB,YAAY,kBAAkB;AAAA,IAC7D;AAEA,QAAI;AAAY,gBAAU;AAAA;AACrB,mBAAa;AAGlB,WAAO;AAAA,EACT,GAAG,CAAC,YAAY,iBAAiB,WAAW,CAAC;AAE7C,SACE,mDAAC;AAAA,IACC;AAAA,IACA,MAAK;AAAA,IACL,WAAW;AAAA,IACX;AAAA,IACA,aAAa;AAAA,IACb,cAAc;AAAA,IACd,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,SAAS,CAAC,MAAM,EAAE,gBAAgB;AAAA,GACpC;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -46,6 +46,7 @@ var import_DataTableContext = require("../../DataTableContext");
46
46
  var import_ds_drag_and_drop = require("@elliemae/ds-drag-and-drop");
47
47
  var import_SortableItemContext = require("./SortableItemContext");
48
48
  var import_Row = require("../Row");
49
+ var import_react_dom = require("react-dom");
49
50
  const DnDTreeContext = (0, import_react.createContext)({
50
51
  depth: void 0,
51
52
  activeIndex: void 0,
@@ -100,12 +101,12 @@ const withConditionalDnDRowContext = (Component) => (props) => {
100
101
  lastActiveId,
101
102
  setLastActiveId
102
103
  }
103
- }, /* @__PURE__ */ import_react.default.createElement(Component, __spreadValues({}, props)))), /* @__PURE__ */ import_react.default.createElement(import_core.DragOverlay, {
104
+ }, /* @__PURE__ */ import_react.default.createElement(Component, __spreadValues({}, props)))), (0, import_react_dom.createPortal)(/* @__PURE__ */ import_react.default.createElement(import_core.DragOverlay, {
104
105
  style: { width: "auto" }
105
106
  }, activeId ? /* @__PURE__ */ import_react.default.createElement(import_Row.Row, {
106
107
  row: flattenedData.find((row) => row.uid === activeId),
107
108
  isDragOverlay: true
108
- }) : null));
109
+ }) : null), document.body));
109
110
  return /* @__PURE__ */ import_react.default.createElement(Component, __spreadValues({}, props));
110
111
  };
111
112
  //# sourceMappingURL=withConditionalDnDRowContext.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/parts/HoC/withConditionalDnDRowContext.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import React, { createContext, useCallback } from 'react';\nimport { DndContext, DragOverlay } from '@dnd-kit/core';\nimport { SortableContext } from '@dnd-kit/sortable';\nimport { DataTableContext } from '../../DataTableContext';\nimport { FunctionalHOC } from '../../types/FunctionalHoC';\nimport { useTreeDndkitConfig } from '@elliemae/ds-drag-and-drop';\nimport { Item } from '../../helpers/dndkit/tree/types';\nimport { DropIndicatorPosition } from './SortableItemContext';\nimport { Row } from '../Row';\n\ntype DnDTreeContextType = {\n depth: number;\n activeIndex: number;\n visibleItems: unknown[];\n dropIndicatorPosition: DropIndicatorPosition;\n lastActiveId: string;\n setLastActiveId: React.Dispatch<React.SetStateAction<string>>;\n};\n\nexport const DnDTreeContext = createContext<DnDTreeContextType>({\n depth: undefined,\n activeIndex: undefined,\n visibleItems: undefined,\n dropIndicatorPosition: DropIndicatorPosition.None,\n lastActiveId: undefined,\n setLastActiveId: undefined,\n});\n\n// only wraps in \"DnDContext\" and \"DnDTreeContext\" if any Drag and Drop functionality is requested\nexport const withConditionalDnDRowContext: FunctionalHOC = (Component) => (props) => {\n const {\n tableProps: { dragAndDropRows, isExpandable, onRowsReorder, maxDragAndDropLevel },\n flattenedData,\n allDataFlattened,\n } = React.useContext(DataTableContext);\n\n const [lastActiveId, setLastActiveId] = React.useState<string>(null);\n\n const onReorder = useCallback(\n (newData: Item[], indexes: { targetIndex: number; fromIndex: number }, considerExpanding: string) => {\n // Pull the row's original data into an object\n const nodes = {};\n newData.forEach((row) => {\n delete row.original.subRows;\n nodes[row.uid] = row.original;\n });\n const newUserData = [];\n newData.forEach((row) => {\n // If row has parent, insert it to it's subrows\n // otherwise append it to the new user data\n if (row.parentId) {\n const parentNode = nodes[row.parentId];\n if (parentNode?.subRows) parentNode.subRows.push(row.original);\n else parentNode.subRows = [row.original];\n } else newUserData.push(row.original);\n });\n // Tell the user that the order has change, he can chose to commit it or not\n onRowsReorder(newUserData, indexes, considerExpanding);\n },\n [onRowsReorder],\n );\n\n const { dndContextProps, sortableContextProps, activeId, activeIndex, depth, dropIndicatorPosition, visibleItems } =\n useTreeDndkitConfig({\n flattenedItems: allDataFlattened,\n visibleItems: flattenedData,\n isHorizontalDnD: false,\n isExpandable,\n onReorder,\n maxDragAndDropLevel,\n });\n\n if (lastActiveId !== activeId && activeId) setLastActiveId(activeId);\n\n if (dragAndDropRows)\n return (\n <DndContext {...dndContextProps}>\n <SortableContext {...sortableContextProps}>\n <DnDTreeContext.Provider\n value={{\n activeIndex,\n depth,\n visibleItems,\n dropIndicatorPosition,\n lastActiveId,\n setLastActiveId,\n }}\n >\n <Component {...props} />\n </DnDTreeContext.Provider>\n </SortableContext>\n <DragOverlay style={{ width: 'auto' }}>\n {activeId ? <Row row={flattenedData.find((row) => row.uid === activeId)} isDragOverlay /> : null}\n </DragOverlay>\n </DndContext>\n );\n return <Component {...props} />;\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAA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AgB,QAAQ;AAEnE,MAAI;AACF,WACE,mDAAC,2CAAe,kBACd,mDAAC,oDAAoB,uBACnB,mDAAC,eAAe,UAAf;AAAA,MACC,OAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,OAEA,mDAAC,8BAAc,MAAO,CACxB,CACF,GACA,mDAAC;AAAA,MAAY,OAAO,EAAE,OAAO,OAAO;AAAA,OACjC,WAAW,mDAAC;AAAA,MAAI,KAAK,cAAc,KAAK,CAAC,QAAQ,IAAI,QAAQ,QAAQ;AAAA,MAAG,eAAa;AAAA,KAAC,IAAK,IAC9F,CACF;AAEJ,SAAO,mDAAC,8BAAc,MAAO;AAC/B;",
4
+ "sourcesContent": ["import React, { createContext, useCallback } from 'react';\nimport { DndContext, DragOverlay } from '@dnd-kit/core';\nimport { SortableContext } from '@dnd-kit/sortable';\nimport { DataTableContext } from '../../DataTableContext';\nimport { FunctionalHOC } from '../../types/FunctionalHoC';\nimport { useTreeDndkitConfig } from '@elliemae/ds-drag-and-drop';\nimport { Item } from '../../helpers/dndkit/tree/types';\nimport { DropIndicatorPosition } from './SortableItemContext';\nimport { Row } from '../Row';\nimport { createPortal } from 'react-dom';\n\ntype DnDTreeContextType = {\n depth: number;\n activeIndex: number;\n visibleItems: unknown[];\n dropIndicatorPosition: DropIndicatorPosition;\n lastActiveId: string;\n setLastActiveId: React.Dispatch<React.SetStateAction<string>>;\n};\n\nexport const DnDTreeContext = createContext<DnDTreeContextType>({\n depth: undefined,\n activeIndex: undefined,\n visibleItems: undefined,\n dropIndicatorPosition: DropIndicatorPosition.None,\n lastActiveId: undefined,\n setLastActiveId: undefined,\n});\n\n// only wraps in \"DnDContext\" and \"DnDTreeContext\" if any Drag and Drop functionality is requested\nexport const withConditionalDnDRowContext: FunctionalHOC = (Component) => (props) => {\n const {\n tableProps: { dragAndDropRows, isExpandable, onRowsReorder, maxDragAndDropLevel },\n flattenedData,\n allDataFlattened,\n } = React.useContext(DataTableContext);\n\n const [lastActiveId, setLastActiveId] = React.useState<string>(null);\n\n const onReorder = useCallback(\n (newData: Item[], indexes: { targetIndex: number; fromIndex: number }, considerExpanding: string) => {\n // Pull the row's original data into an object\n const nodes = {};\n newData.forEach((row) => {\n delete row.original.subRows;\n nodes[row.uid] = row.original;\n });\n const newUserData = [];\n newData.forEach((row) => {\n // If row has parent, insert it to it's subrows\n // otherwise append it to the new user data\n if (row.parentId) {\n const parentNode = nodes[row.parentId];\n if (parentNode?.subRows) parentNode.subRows.push(row.original);\n else parentNode.subRows = [row.original];\n } else newUserData.push(row.original);\n });\n // Tell the user that the order has change, he can chose to commit it or not\n onRowsReorder(newUserData, indexes, considerExpanding);\n },\n [onRowsReorder],\n );\n\n const { dndContextProps, sortableContextProps, activeId, activeIndex, depth, dropIndicatorPosition, visibleItems } =\n useTreeDndkitConfig({\n flattenedItems: allDataFlattened,\n visibleItems: flattenedData,\n isHorizontalDnD: false,\n isExpandable,\n onReorder,\n maxDragAndDropLevel,\n });\n\n if (lastActiveId !== activeId && activeId) setLastActiveId(activeId);\n\n if (dragAndDropRows)\n return (\n <DndContext {...dndContextProps}>\n <SortableContext {...sortableContextProps}>\n <DnDTreeContext.Provider\n value={{\n activeIndex,\n depth,\n visibleItems,\n dropIndicatorPosition,\n lastActiveId,\n setLastActiveId,\n }}\n >\n <Component {...props} />\n </DnDTreeContext.Provider>\n </SortableContext>\n {createPortal(\n <DragOverlay style={{ width: 'auto' }}>\n {activeId ? <Row row={flattenedData.find((row) => row.uid === activeId)} isDragOverlay /> : null}\n </DragOverlay>,\n document.body,\n )}\n </DndContext>\n );\n return <Component {...props} />;\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkD;AAClD,kBAAwC;AACxC,sBAAgC;AAChC,8BAAiC;AA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kBACd,mDAAC,oDAAoB,uBACnB,mDAAC,eAAe,UAAf;AAAA,MACC,OAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,OAEA,mDAAC,8BAAc,MAAO,CACxB,CACF,GACC,mCACC,mDAAC;AAAA,MAAY,OAAO,EAAE,OAAO,OAAO;AAAA,OACjC,WAAW,mDAAC;AAAA,MAAI,KAAK,cAAc,KAAK,CAAC,QAAQ,IAAI,QAAQ,QAAQ;AAAA,MAAG,eAAa;AAAA,KAAC,IAAK,IAC9F,GACA,SAAS,IACX,CACF;AAEJ,SAAO,mDAAC,8BAAc,MAAO;AAC/B;",
6
6
  "names": []
7
7
  }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/parts/RowVariants/index.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["/* eslint-disable react/prop-types */\nimport React from 'react';\nimport { ROW_VARIANTS } from '../../exported-related';\nimport { TypescriptContext, TypescriptRow } from '../../types/props';\nimport { Cells } from '../Cells';\nimport { RowVariantHeader } from './RowVariantHeader';\nimport { RowVariantPrimary } from './RowVariantPrimary';\nimport { RowVariantSecondary } from './RowVariantSecondary';\nimport { RowVariantSkeleton } from './RowVariantSkeleton';\nimport { RowVariantProps } from './types';\n\nconst RowVariantMapper: Record<string, React.ComponentType<RowVariantProps>> = {\n [ROW_VARIANTS.HEADER_GROUP]: RowVariantHeader,\n [ROW_VARIANTS.PRIMARY]: RowVariantPrimary,\n [ROW_VARIANTS.SECONDARY]: RowVariantSecondary,\n [ROW_VARIANTS.COMPACT_PRIMARY]: (props) => <RowVariantPrimary compact {...props} />,\n [ROW_VARIANTS.COMPACT_SECONDARY]: (props) => <RowVariantSecondary compact {...props} />,\n [ROW_VARIANTS.SKELETON]: RowVariantSkeleton,\n};\n\ninterface RowVariantMapItemProps {\n row: TypescriptRow;\n itemIndex: number;\n isDragOverlay: boolean;\n ctx: TypescriptContext;\n focusedRowId: string | null;\n drilldownRowId: string | null;\n}\n\nexport const RowVariantMapItem: React.ComponentType<RowVariantMapItemProps> = (props) => {\n const {\n row,\n ctx: {\n tableProps: { getRowVariant },\n },\n } = props;\n\n const variant = getRowVariant(row, Cells);\n\n let Component: React.ComponentType<any>;\n\n if (typeof variant === 'string') {\n if (!(variant in RowVariantMapper)) {\n throw new Error(`${variant} is not an out-of-the-box row variant`);\n }\n Component = RowVariantMapper[variant];\n } else {\n Component = variant;\n }\n\n return <Component {...props} />;\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAkB;AAClB,8BAA6B;AAE7B,mBAAsB;AACtB,8BAAiC;AACjC,+BAAkC;AAClC,iCAAoC;AACpC,gCAAmC;AAGnC,MAAM,mBAAyE;AAAA,GAC5E,qCAAa,eAAe;AAAA,GAC5B,qCAAa,UAAU;AAAA,GACvB,qCAAa,YAAY;AAAA,GACzB,qCAAa,kBAAkB,CAAC,UAAU,mDAAC;AAAA,IAAkB,SAAO;AAAA,KAAK,MAAO;AAAA,GAChF,qCAAa,oBAAoB,CAAC,UAAU,mDAAC;AAAA,IAAoB,SAAO;AAAA,KAAK,MAAO;AAAA,GACpF,qCAAa,WAAW;AAC3B;AAWO,MAAM,oBAAiE,CAAC,UAAU;AACvF,QAAM;AAAA,IACJ;AAAA,IACA,KAAK;AAAA,MACH,YAAY,EAAE;AAAA;AAAA,MAEd;AAEJ,QAAM,UAAU,cAAc,KAAK,kBAAK;AAExC,MAAI;AAEJ,MAAI,OAAO,YAAY,UAAU;AAC/B,QAAI,CAAE,YAAW,mBAAmB;AAClC,YAAM,IAAI,MAAM,GAAG,8CAA8C;AAAA,IACnE;AACA,gBAAY,iBAAiB;AAAA,EAC/B,OAAO;AACL,gBAAY;AAAA,EACd;AAEA,SAAO,mDAAC,8BAAc,MAAO;AAC/B;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAkB;AAClB,8BAA6B;AAE7B,mBAAsB;AACtB,8BAAiC;AACjC,+BAAkC;AAClC,iCAAoC;AACpC,gCAAmC;AAGnC,MAAM,mBAAyE;AAAA,EAC7E,CAAC,qCAAa,eAAe;AAAA,EAC7B,CAAC,qCAAa,UAAU;AAAA,EACxB,CAAC,qCAAa,YAAY;AAAA,EAC1B,CAAC,qCAAa,kBAAkB,CAAC,UAAU,mDAAC;AAAA,IAAkB,SAAO;AAAA,KAAK,MAAO;AAAA,EACjF,CAAC,qCAAa,oBAAoB,CAAC,UAAU,mDAAC;AAAA,IAAoB,SAAO;AAAA,KAAK,MAAO;AAAA,EACrF,CAAC,qCAAa,WAAW;AAC3B;AAWO,MAAM,oBAAiE,CAAC,UAAU;AACvF,QAAM;AAAA,IACJ;AAAA,IACA,KAAK;AAAA,MACH,YAAY,EAAE;AAAA;AAAA,MAEd;AAEJ,QAAM,UAAU,cAAc,KAAK,kBAAK;AAExC,MAAI;AAEJ,MAAI,OAAO,YAAY,UAAU;AAC/B,QAAI,CAAE,YAAW,mBAAmB;AAClC,YAAM,IAAI,MAAM,GAAG,8CAA8C;AAAA,IACnE;AACA,gBAAY,iBAAiB;AAAA,EAC/B,OAAO;AACL,gBAAY;AAAA,EACd;AAEA,SAAO,mDAAC,8BAAc,MAAO;AAC/B;",
6
6
  "names": []
7
7
  }
@@ -55,16 +55,22 @@ module.exports = __toCommonJS(SortableHeaderCell_exports);
55
55
  var React = __toESM(require("react"));
56
56
  var import_ds_grid = require("@elliemae/ds-grid");
57
57
  var import_withConditionalDnDSortableContext = require("./HoC/withConditionalDnDSortableContext");
58
+ var import_helpers = require("../helpers");
58
59
  const SortableHeaderCell = (_a) => {
59
60
  var _b = _a, {
60
61
  items,
61
- isDragOverlay = false
62
+ isDragOverlay = false,
63
+ isGroup = false
62
64
  } = _b, rest = __objRest(_b, [
63
65
  "items",
64
- "isDragOverlay"
66
+ "isDragOverlay",
67
+ "isGroup"
65
68
  ]);
66
69
  return (0, import_withConditionalDnDSortableContext.withConditionalDnDSortableContext)(items, isDragOverlay)(import_ds_grid.Grid)(__spreadProps(__spreadValues({}, rest), {
67
- style: { display: "flex" }
70
+ cols: isGroup && items.map((col) => (0, import_helpers.sizeToCss)(col.width ?? 150)),
71
+ style: isGroup ? {
72
+ gridAutoFlow: "column"
73
+ } : { display: "flex" }
68
74
  }));
69
75
  };
70
76
  //# sourceMappingURL=SortableHeaderCell.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/parts/SortableHeaderCell.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { Grid } from '@elliemae/ds-grid';\nimport { TypescriptColumn } from '../types/props';\nimport { withConditionalDnDSortableContext } from './HoC/withConditionalDnDSortableContext';\n\nexport const SortableHeaderCell = ({\n items,\n isDragOverlay = false,\n ...rest\n}: {\n items: TypescriptColumn[];\n isDragOverlay?: boolean;\n children: JSX.Element | JSX.Element[];\n}): JSX.Element =>\n withConditionalDnDSortableContext(items, isDragOverlay)(Grid)({\n ...rest,\n style: { display: 'flex' },\n });\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,qBAAqB;AAErB,+CAAkD;AAE3C,MAAM,qBAAqB,CAAC,OAQnB;AARmB,eACjC;AAAA;AAAA,IACA,gBAAgB;AAAA,MAFiB,IAG9B,iBAH8B,IAG9B;AAAA,IAFH;AAAA,IACA;AAAA;AAOA,yFAAkC,OAAO,aAAa,EAAE,mBAAI,EAAE,iCACzD,OADyD;AAAA,IAE5D,OAAO,EAAE,SAAS,OAAO;AAAA,EAC3B,EAAC;AAAA;",
4
+ "sourcesContent": ["import { Grid } from '@elliemae/ds-grid';\nimport { TypescriptColumn } from '../types/props';\nimport { withConditionalDnDSortableContext } from './HoC/withConditionalDnDSortableContext';\nimport { sizeToCss } from '../helpers';\n\nexport const SortableHeaderCell = ({\n items,\n isDragOverlay = false,\n isGroup = false,\n ...rest\n}: {\n items: TypescriptColumn[];\n isDragOverlay?: boolean;\n isGroup: boolean;\n children: JSX.Element | JSX.Element[];\n}): JSX.Element =>\n withConditionalDnDSortableContext(items, isDragOverlay)(Grid)({\n ...rest,\n cols: isGroup && items.map((col) => sizeToCss(col.width ?? 150)),\n style: isGroup\n ? {\n gridAutoFlow: 'column',\n }\n : { display: 'flex' },\n });\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,qBAAqB;AAErB,+CAAkD;AAClD,qBAA0B;AAEnB,MAAM,qBAAqB,CAAC,OAUnB;AAVmB,eACjC;AAAA;AAAA,IACA,gBAAgB;AAAA,IAChB,UAAU;AAAA,MAHuB,IAI9B,iBAJ8B,IAI9B;AAAA,IAHH;AAAA,IACA;AAAA,IACA;AAAA;AAQA,yFAAkC,OAAO,aAAa,EAAE,mBAAI,EAAE,iCACzD,OADyD;AAAA,IAE5D,MAAM,WAAW,MAAM,IAAI,CAAC,QAAQ,8BAAU,IAAI,SAAS,GAAG,CAAC;AAAA,IAC/D,OAAO,UACH;AAAA,MACE,cAAc;AAAA,IAChB,IACA,EAAE,SAAS,OAAO;AAAA,EACxB,EAAC;AAAA;",
6
6
  "names": []
7
7
  }
@@ -51,27 +51,25 @@ var import_constants = require("../configs/constants");
51
51
  const TableContentComponent = (props) => {
52
52
  const { forwardedRef } = props;
53
53
  const {
54
- tableProps: { height, width, pagination },
54
+ tableProps: { pagination },
55
55
  allDataFlattened,
56
56
  visibleColumns
57
57
  } = (0, import_react.useContext)(import_DataTableContext.default);
58
58
  const [shiftKeyPressed, setShiftKeyPressed] = (0, import_react.useState)(false);
59
59
  const PureTableContent = (0, import_react.useMemo)(() => /* @__PURE__ */ import_react.default.createElement(import_styled.StyledDataTableContentWrapper, {
60
60
  "data-testid": import_constants.DATA_TESTID.DATA_TABLE_CONTENT_WRAPPER,
61
- height,
62
- width,
63
61
  ref: forwardedRef,
64
62
  noSelectionAllowed: shiftKeyPressed,
65
63
  onKeyDown: (e) => setShiftKeyPressed((prevShiftKeyPressed) => prevShiftKeyPressed || e.shiftKey),
66
- onKeyUp: (e) => setShiftKeyPressed((prevShiftKeyPressed) => prevShiftKeyPressed && e.code !== "Shift")
64
+ onKeyUp: (e) => setShiftKeyPressed((prevShiftKeyPressed) => prevShiftKeyPressed && e.code !== "Shift"),
65
+ rows: pagination ? ["1fr", "auto"] : ["auto"],
66
+ cols: ["100%"]
67
67
  }, /* @__PURE__ */ import_react.default.createElement(import_styled.StyledTableWrapper, {
68
68
  role: "table",
69
69
  "aria-rowcount": allDataFlattened.length,
70
70
  "aria-colcount": visibleColumns.length,
71
- "data-testid": import_constants.DATA_TESTID.DATA_TABLE_TABLE,
72
- height,
73
- width
74
- }, /* @__PURE__ */ import_react.default.createElement(import_VirtualRowsList.VirtualRowsList, null)), pagination ? /* @__PURE__ */ import_react.default.createElement(import_Pagination.Pagination, null) : null), [height, width, forwardedRef, allDataFlattened.length, visibleColumns.length, pagination, shiftKeyPressed]);
71
+ "data-testid": import_constants.DATA_TESTID.DATA_TABLE_TABLE
72
+ }, /* @__PURE__ */ import_react.default.createElement(import_VirtualRowsList.VirtualRowsList, null)), pagination ? /* @__PURE__ */ import_react.default.createElement(import_Pagination.Pagination, null) : null), [forwardedRef, allDataFlattened.length, visibleColumns.length, pagination, shiftKeyPressed]);
75
73
  return PureTableContent;
76
74
  };
77
75
  const TableContent = import_react.default.forwardRef((props, ref) => /* @__PURE__ */ import_react.default.createElement(TableContentComponent, __spreadProps(__spreadValues({}, props), {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/parts/TableContent.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import React, { useContext, useMemo, useState } from 'react';\n\nimport { StyledTableWrapper, StyledDataTableContentWrapper } from '../styled';\nimport DataTableContext from '../DataTableContext';\nimport { Pagination } from '../addons/Pagination';\nimport { VirtualRowsList } from './VirtualRowsList';\nimport { DATA_TESTID } from '../configs/constants';\n\ntype TableContentProps = {\n forwardedRef: React.ForwardedRef<HTMLDivElement>;\n};\n\nconst TableContentComponent = (props: TableContentProps) => {\n const { forwardedRef } = props;\n const {\n tableProps: { height, width, pagination },\n allDataFlattened,\n visibleColumns,\n } = useContext(DataTableContext);\n\n const [shiftKeyPressed, setShiftKeyPressed] = useState(false);\n\n const PureTableContent = useMemo(\n () => (\n <StyledDataTableContentWrapper\n data-testid={DATA_TESTID.DATA_TABLE_CONTENT_WRAPPER}\n height={height}\n width={width}\n ref={forwardedRef}\n noSelectionAllowed={shiftKeyPressed}\n onKeyDown={(e) => setShiftKeyPressed((prevShiftKeyPressed) => prevShiftKeyPressed || e.shiftKey)}\n onKeyUp={(e) => setShiftKeyPressed((prevShiftKeyPressed) => prevShiftKeyPressed && e.code !== 'Shift')}\n >\n <StyledTableWrapper\n role=\"table\"\n aria-rowcount={allDataFlattened.length}\n aria-colcount={visibleColumns.length}\n data-testid={DATA_TESTID.DATA_TABLE_TABLE}\n height={height}\n width={width}\n >\n <VirtualRowsList />\n </StyledTableWrapper>\n {pagination ? <Pagination /> : null}\n </StyledDataTableContentWrapper>\n ),\n [height, width, forwardedRef, allDataFlattened.length, visibleColumns.length, pagination, shiftKeyPressed],\n );\n\n return PureTableContent;\n};\n\nexport const TableContent = React.forwardRef<HTMLDivElement>((props, ref) => (\n <TableContentComponent {...props} forwardedRef={ref} />\n));\n\nexport default TableContent;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAqD;AAErD,oBAAkE;AAClE,8BAA6B;AAC7B,wBAA2B;AAC3B,6BAAgC;AAChC,uBAA4B;AAM5B,MAAM,wBAAwB,CAAC,UAA6B;AAC1D,QAAM,EAAE,iBAAiB;AACzB,QAAM;AAAA,IACJ,YAAY,EAAE,QAAQ,OAAO;AAAA,IAC7B;AAAA,IACA;AAAA,MACE,6BAAW,+BAAgB;AAE/B,QAAM,CAAC,iBAAiB,sBAAsB,2BAAS,KAAK;AAE5D,QAAM,mBAAmB,0BACvB,MACE,mDAAC;AAAA,IACC,eAAa,6BAAY;AAAA,IACzB;AAAA,IACA;AAAA,IACA,KAAK;AAAA,IACL,oBAAoB;AAAA,IACpB,WAAW,CAAC,MAAM,mBAAmB,CAAC,wBAAwB,uBAAuB,EAAE,QAAQ;AAAA,IAC/F,SAAS,CAAC,MAAM,mBAAmB,CAAC,wBAAwB,uBAAuB,EAAE,SAAS,OAAO;AAAA,KAErG,mDAAC;AAAA,IACC,MAAK;AAAA,IACL,iBAAe,iBAAiB;AAAA,IAChC,iBAAe,eAAe;AAAA,IAC9B,eAAa,6BAAY;AAAA,IACzB;AAAA,IACA;AAAA,KAEA,mDAAC,4CAAgB,CACnB,GACC,aAAa,mDAAC,kCAAW,IAAK,IACjC,GAEF,CAAC,QAAQ,OAAO,cAAc,iBAAiB,QAAQ,eAAe,QAAQ,YAAY,eAAe,CAC3G;AAEA,SAAO;AACT;AAEO,MAAM,eAAe,qBAAM,WAA2B,CAAC,OAAO,QACnE,mDAAC,wDAA0B,QAA1B;AAAA,EAAiC,cAAc;AAAA,EAAK,CACtD;AAED,IAAO,uBAAQ;",
4
+ "sourcesContent": ["import React, { useContext, useMemo, useState } from 'react';\n\nimport { StyledTableWrapper, StyledDataTableContentWrapper } from '../styled';\nimport DataTableContext from '../DataTableContext';\nimport { Pagination } from '../addons/Pagination';\nimport { VirtualRowsList } from './VirtualRowsList';\nimport { DATA_TESTID } from '../configs/constants';\n\ntype TableContentProps = {\n forwardedRef: React.ForwardedRef<HTMLDivElement>;\n};\n\nconst TableContentComponent = (props: TableContentProps) => {\n const { forwardedRef } = props;\n const {\n tableProps: { pagination },\n allDataFlattened,\n visibleColumns,\n } = useContext(DataTableContext);\n\n const [shiftKeyPressed, setShiftKeyPressed] = useState(false);\n\n const PureTableContent = useMemo(\n () => (\n <StyledDataTableContentWrapper\n data-testid={DATA_TESTID.DATA_TABLE_CONTENT_WRAPPER}\n ref={forwardedRef}\n noSelectionAllowed={shiftKeyPressed}\n onKeyDown={(e) => setShiftKeyPressed((prevShiftKeyPressed) => prevShiftKeyPressed || e.shiftKey)}\n onKeyUp={(e) => setShiftKeyPressed((prevShiftKeyPressed) => prevShiftKeyPressed && e.code !== 'Shift')}\n rows={pagination ? ['1fr', 'auto'] : ['auto']}\n cols={['100%']}\n >\n <StyledTableWrapper\n role=\"table\"\n aria-rowcount={allDataFlattened.length}\n aria-colcount={visibleColumns.length}\n data-testid={DATA_TESTID.DATA_TABLE_TABLE}\n >\n <VirtualRowsList />\n </StyledTableWrapper>\n {pagination ? <Pagination /> : null}\n </StyledDataTableContentWrapper>\n ),\n [forwardedRef, allDataFlattened.length, visibleColumns.length, pagination, shiftKeyPressed],\n );\n\n return PureTableContent;\n};\n\nexport const TableContent = React.forwardRef<HTMLDivElement>((props, ref) => (\n <TableContentComponent {...props} forwardedRef={ref} />\n));\n\nexport default TableContent;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAqD;AAErD,oBAAkE;AAClE,8BAA6B;AAC7B,wBAA2B;AAC3B,6BAAgC;AAChC,uBAA4B;AAM5B,MAAM,wBAAwB,CAAC,UAA6B;AAC1D,QAAM,EAAE,iBAAiB;AACzB,QAAM;AAAA,IACJ,YAAY,EAAE;AAAA,IACd;AAAA,IACA;AAAA,MACE,6BAAW,+BAAgB;AAE/B,QAAM,CAAC,iBAAiB,sBAAsB,2BAAS,KAAK;AAE5D,QAAM,mBAAmB,0BACvB,MACE,mDAAC;AAAA,IACC,eAAa,6BAAY;AAAA,IACzB,KAAK;AAAA,IACL,oBAAoB;AAAA,IACpB,WAAW,CAAC,MAAM,mBAAmB,CAAC,wBAAwB,uBAAuB,EAAE,QAAQ;AAAA,IAC/F,SAAS,CAAC,MAAM,mBAAmB,CAAC,wBAAwB,uBAAuB,EAAE,SAAS,OAAO;AAAA,IACrG,MAAM,aAAa,CAAC,OAAO,MAAM,IAAI,CAAC,MAAM;AAAA,IAC5C,MAAM,CAAC,MAAM;AAAA,KAEb,mDAAC;AAAA,IACC,MAAK;AAAA,IACL,iBAAe,iBAAiB;AAAA,IAChC,iBAAe,eAAe;AAAA,IAC9B,eAAa,6BAAY;AAAA,KAEzB,mDAAC,4CAAgB,CACnB,GACC,aAAa,mDAAC,kCAAW,IAAK,IACjC,GAEF,CAAC,cAAc,iBAAiB,QAAQ,eAAe,QAAQ,YAAY,eAAe,CAC5F;AAEA,SAAO;AACT;AAEO,MAAM,eAAe,qBAAM,WAA2B,CAAC,OAAO,QACnE,mDAAC,wDAA0B,QAA1B;AAAA,EAAiC,cAAc;AAAA,EAAK,CACtD;AAED,IAAO,uBAAQ;",
6
6
  "names": []
7
7
  }
@@ -32,14 +32,13 @@ var import_Rows = require("./Rows");
32
32
  var import_Headers = require("./Headers");
33
33
  var import_Footer = require("./Footer");
34
34
  var import_DataTableContext = require("../DataTableContext");
35
- var import_fixedSizes = require("../configs/fixedSizes");
36
35
  var import_styled = require("../styled");
37
36
  var import_Loader = require("./Loader");
38
37
  var import_constants = require("../configs/constants");
39
38
  const VirtualRowsList = () => {
40
39
  const {
41
40
  virtualListRef,
42
- tableProps: { height, width, isLoading, isLoadingAppended },
41
+ tableProps: { isLoading, isLoadingAppended },
43
42
  virtualListHelpers,
44
43
  layoutHelpers: { totalColumnsWidth },
45
44
  flattenedData,
@@ -47,11 +46,6 @@ const VirtualRowsList = () => {
47
46
  } = (0, import_react.useContext)(import_DataTableContext.DataTableContext);
48
47
  const { totalSize, scrollToIndex } = virtualListHelpers;
49
48
  const isEmptyContent = (0, import_react.useMemo)(() => !isLoading && flattenedData.length === 0, [isLoading, flattenedData.length]);
50
- const tableHeight = (0, import_react.useMemo)(() => {
51
- if (typeof height === "string")
52
- return height.includes("%") ? height : Number.parseInt(height, 10) - import_fixedSizes.FIXED_SIZES.PAGINATION_HEIGHT;
53
- return height;
54
- }, [height]);
55
49
  const onKeyDown = (0, import_react.useCallback)((e) => {
56
50
  if (e.ctrlKey && e.code === "End") {
57
51
  scrollToIndex(flattenedData.length - 1);
@@ -63,8 +57,6 @@ const VirtualRowsList = () => {
63
57
  }, [scrollToIndex, setFocusedRowId, flattenedData]);
64
58
  return /* @__PURE__ */ import_react.default.createElement(import_styled.StyledVirtualListWrapper, {
65
59
  ref: virtualListRef,
66
- height: tableHeight,
67
- width,
68
60
  "data-testid": import_constants.DATA_TESTID.DATA_TABLE_SCROLLABLE_CONTAINER,
69
61
  onKeyDown,
70
62
  tabIndex: -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/parts/VirtualRowsList.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import React, { useContext, useMemo, useCallback } from 'react';\nimport { RowLoading } from './RowLoading'; // imported this way to avoid circular dependencies\nimport { EmptyContent } from './EmptyContent'; // imported this way to avoid circular dependencies\nimport { RowsWithContext as Rows } from './Rows'; // imported this way to avoid circular dependencies\nimport { Headers } from './Headers'; // imported this way to avoid circular dependencies\nimport { Footer } from './Footer'; // imported this way to avoid circular dependencies\nimport { DataTableContext } from '../DataTableContext';\nimport { FIXED_SIZES } from '../configs/fixedSizes';\nimport { StyledVirtualListWrapper, StyledTableContentWrapper } from '../styled';\nimport { MemoizedLoader as Loader } from './Loader';\nimport { DATA_TESTID } from '../configs/constants';\n\nexport const VirtualRowsList = () => {\n const {\n virtualListRef,\n tableProps: { height, width, isLoading, isLoadingAppended },\n virtualListHelpers,\n layoutHelpers: { totalColumnsWidth },\n flattenedData,\n setFocusedRowId,\n } = useContext(DataTableContext);\n const { totalSize, scrollToIndex } = virtualListHelpers;\n\n const isEmptyContent = useMemo(() => !isLoading && flattenedData.length === 0, [isLoading, flattenedData.length]);\n\n const tableHeight = useMemo(() => {\n if (typeof height === 'string')\n return height.includes('%') ? height : Number.parseInt(height, 10) - FIXED_SIZES.PAGINATION_HEIGHT;\n return height;\n }, [height]);\n\n const onKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.ctrlKey && e.code === 'End') {\n scrollToIndex(flattenedData.length - 1);\n setFocusedRowId(flattenedData[flattenedData.length - 1].uid);\n } else if (e.ctrlKey && e.code === 'Home') {\n scrollToIndex(0, { align: 'center' });\n setFocusedRowId(flattenedData[0].uid);\n }\n },\n [scrollToIndex, setFocusedRowId, flattenedData],\n );\n\n return (\n <StyledVirtualListWrapper\n ref={virtualListRef}\n height={tableHeight}\n width={width}\n data-testid={DATA_TESTID.DATA_TABLE_SCROLLABLE_CONTAINER}\n onKeyDown={onKeyDown}\n tabIndex={-1}\n >\n <StyledTableContentWrapper role=\"rowgroup\" height={totalSize || '100%'}>\n <Headers />\n {isEmptyContent && <EmptyContent width={totalColumnsWidth} />}\n {isLoading ? <Loader /> : null}\n {!isLoading && !isEmptyContent && (\n <>\n <Rows />\n <Footer />\n {isLoadingAppended && <RowLoading />}\n </>\n )}\n </StyledTableContentWrapper>\n </StyledVirtualListWrapper>\n );\n};\n\nexport default VirtualRowsList;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAwD;AACx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,GAAmB,GAC1D,YAAY,mDAAC,kCAAO,IAAK,MACzB,CAAC,aAAa,CAAC,kBACd,wFACE,mDAAC,iCAAK,GACN,mDAAC,0BAAO,GACP,qBAAqB,mDAAC,kCAAW,CACpC,CAEJ,CACF;AAEJ;AAEA,IAAO,0BAAQ;",
4
+ "sourcesContent": ["import React, { useContext, useMemo, useCallback } from 'react';\nimport { RowLoading } from './RowLoading'; // imported this way to avoid circular dependencies\nimport { EmptyContent } from './EmptyContent'; // imported this way to avoid circular dependencies\nimport { RowsWithContext as Rows } from './Rows'; // imported this way to avoid circular dependencies\nimport { Headers } from './Headers'; // imported this way to avoid circular dependencies\nimport { Footer } from './Footer'; // imported this way to avoid circular dependencies\nimport { DataTableContext } from '../DataTableContext';\nimport { FIXED_SIZES } from '../configs/fixedSizes';\nimport { StyledVirtualListWrapper, StyledTableContentWrapper } from '../styled';\nimport { MemoizedLoader as Loader } from './Loader';\nimport { DATA_TESTID } from '../configs/constants';\n\nexport const VirtualRowsList = () => {\n const {\n virtualListRef,\n tableProps: { isLoading, isLoadingAppended },\n virtualListHelpers,\n layoutHelpers: { totalColumnsWidth },\n flattenedData,\n setFocusedRowId,\n } = useContext(DataTableContext);\n const { totalSize, scrollToIndex } = virtualListHelpers;\n\n const isEmptyContent = useMemo(() => !isLoading && flattenedData.length === 0, [isLoading, flattenedData.length]);\n\n const onKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.ctrlKey && e.code === 'End') {\n scrollToIndex(flattenedData.length - 1);\n setFocusedRowId(flattenedData[flattenedData.length - 1].uid);\n } else if (e.ctrlKey && e.code === 'Home') {\n scrollToIndex(0, { align: 'center' });\n setFocusedRowId(flattenedData[0].uid);\n }\n },\n [scrollToIndex, setFocusedRowId, flattenedData],\n );\n\n return (\n <StyledVirtualListWrapper\n ref={virtualListRef}\n data-testid={DATA_TESTID.DATA_TABLE_SCROLLABLE_CONTAINER}\n onKeyDown={onKeyDown}\n tabIndex={-1}\n >\n <StyledTableContentWrapper role=\"rowgroup\" height={totalSize || '100%'}>\n <Headers />\n {isEmptyContent && <EmptyContent width={totalColumnsWidth} />}\n {isLoading ? <Loader /> : null}\n {!isLoading && !isEmptyContent && (\n <>\n <Rows />\n <Footer />\n {isLoadingAppended && <RowLoading />}\n </>\n )}\n </StyledTableContentWrapper>\n </StyledVirtualListWrapper>\n );\n};\n\nexport default VirtualRowsList;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAwD;AACxD,wBAA2B;AAC3B,0BAA6B;AAC7B,kBAAwC;AACxC,qBAAwB;AACxB,oBAAuB;AACvB,8BAAiC;AAEjC,oBAAoE;AACpE,oBAAyC;AACzC,uBAA4B;AAErB,MAAM,kBAAkB,MAAM;AACnC,QAAM;AAAA,IACJ;AAAA,IACA,YAAY,EAAE,WAAW;AAAA,IACzB;AAAA,IACA,eAAe,EAAE;AAAA,IACjB;AAAA,IACA;AAAA,MACE,6BAAW,wCAAgB;AAC/B,QAAM,EAAE,WAAW,kBAAkB;AAErC,QAAM,iBAAiB,0BAAQ,MAAM,CAAC,aAAa,cAAc,WAAW,GAAG,CAAC,WAAW,cAAc,MAAM,CAAC;AAEhH,QAAM,YAAY,8BAChB,CAAC,MAA2B;AAC1B,QAAI,EAAE,WAAW,EAAE,SAAS,OAAO;AACjC,oBAAc,cAAc,SAAS,CAAC;AACtC,sBAAgB,cAAc,cAAc,SAAS,GAAG,GAAG;AAAA,IAC7D,WAAW,EAAE,WAAW,EAAE,SAAS,QAAQ;AACzC,oBAAc,GAAG,EAAE,OAAO,SAAS,CAAC;AACpC,sBAAgB,cAAc,GAAG,GAAG;AAAA,IACtC;AAAA,EACF,GACA,CAAC,eAAe,iBAAiB,aAAa,CAChD;AAEA,SACE,mDAAC;AAAA,IACC,KAAK;AAAA,IACL,eAAa,6BAAY;AAAA,IACzB;AAAA,IACA,UAAU;AAAA,KAEV,mDAAC;AAAA,IAA0B,MAAK;AAAA,IAAW,QAAQ,aAAa;AAAA,KAC9D,mDAAC,4BAAQ,GACR,kBAAkB,mDAAC;AAAA,IAAa,OAAO;AAAA,GAAmB,GAC1D,YAAY,mDAAC,kCAAO,IAAK,MACzB,CAAC,aAAa,CAAC,kBACd,wFACE,mDAAC,iCAAK,GACN,mDAAC,0BAAO,GACP,qBAAqB,mDAAC,kCAAW,CACpC,CAEJ,CACF;AAEJ;AAEA,IAAO,0BAAQ;",
6
6
  "names": []
7
7
  }
@@ -67,24 +67,21 @@ const StyledFocusWithin = (0, import_ds_system.styled)(import_ds_grid.Grid)`
67
67
  ${(props) => props.hideFocus ? "" : styledFocusCss(props)}
68
68
  }
69
69
  `;
70
- const StyledDataTableWrapper = import_ds_system.styled.div`
70
+ const StyledDataTableWrapper = (0, import_ds_system.styled)(import_ds_grid.Grid)`
71
71
  width: ${(props) => (0, import_helpers.sizeToCss)(props.width ?? " 100%")};
72
72
  height: ${(props) => (0, import_helpers.sizeToCss)(props.height ?? " 100%")};
73
73
  `;
74
- const StyledDataTableContentWrapper = import_ds_system.styled.div`
74
+ const StyledDataTableContentWrapper = (0, import_ds_system.styled)(import_ds_grid.Grid)`
75
75
  user-select: ${({ noSelectionAllowed }) => noSelectionAllowed ? "none" : "auto"};
76
76
  width: 100%;
77
- height: 100%;
78
77
  `;
79
78
  const StyledTableWrapper = import_ds_system.styled.div`
80
79
  display: inline-block;
81
80
  border-spacing: 0;
82
81
  z-index: 0;
83
82
  position: relative;
84
- ${({ width = "100%", height = "100%" }) => `
85
- width: ${(0, import_helpers.sizeToCss)(width)};
86
- height: ${(0, import_helpers.sizeToCss)(height)};
87
- `}
83
+ width: 100%;
84
+ height: 100%;
88
85
  `;
89
86
  const StyledTableContentWrapper = import_ds_system.styled.div`
90
87
  position: relative;
@@ -94,10 +91,8 @@ const StyledTableContentWrapper = import_ds_system.styled.div`
94
91
  `;
95
92
  const StyledVirtualListWrapper = import_ds_system.styled.div`
96
93
  overflow: auto;
97
- ${({ height = "auto", width = "100%" }) => `
98
- height: ${(0, import_helpers.sizeToCss)(height)};
99
- width: ${(0, import_helpers.sizeToCss)(width)};
100
- `}
94
+ height: 100%;
95
+ width: 100%;
101
96
  `;
102
97
  const getGridTemplateColumnsStyle = ({
103
98
  cols,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/styled.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable max-lines */\nimport { styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { EditPencil } from '@elliemae/ds-icons';\nimport { sizeToCss, cellPadding, columnPadding } from './helpers';\nimport { ZIndexDataTable } from './configs/zIndexInternalConfig';\nimport { ColsLayoutStyle } from './configs/constants';\n\ninterface WidthAndHeight {\n width?: string | number;\n height?: string | number;\n}\n\nconst styledFocusCss = ({ theme }) => `\n&:after {\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 2px solid ${theme.colors.brand[700]};\n pointer-events: none;\n z-index: ${ZIndexDataTable.FOCUS_BORDER};\n}`;\n\nexport const StyledFocusWithin = styled(Grid)`\n :focus-within {\n ${(props) => (props.hideFocus ? '' : styledFocusCss(props))}\n }\n`;\n\nexport const StyledDataTableWrapper = styled.div<WidthAndHeight>`\n width: ${(props) => sizeToCss(props.width ?? ' 100%')};\n height: ${(props) => sizeToCss(props.height ?? ' 100%')};\n`;\n\nexport const StyledDataTableContentWrapper = styled.div<WidthAndHeight & { noSelectionAllowed: boolean }>`\n user-select: ${({ noSelectionAllowed }) => (noSelectionAllowed ? 'none' : 'auto')};\n width: 100%;\n height: 100%;\n`;\nexport const StyledTableWrapper = styled.div<WidthAndHeight>`\n display: inline-block;\n border-spacing: 0;\n z-index: 0;\n position: relative;\n ${({ width = '100%', height = '100%' }) => `\n width: ${sizeToCss(width)};\n height: ${sizeToCss(height)};\n `}\n`;\nexport const StyledTableContentWrapper = styled.div<WidthAndHeight>`\n position: relative;\n ${({ height = 'auto' }) => `\n height: ${sizeToCss(height)};\n `}\n`;\nexport const StyledVirtualListWrapper = styled.div<WidthAndHeight>`\n overflow: auto;\n ${({ height = 'auto', width = '100%' }) => `\n height: ${sizeToCss(height)};\n width: ${sizeToCss(width)};\n `}\n`;\n\n/**\n * HEADER\n */\ntype gridTemplateColumnStyleProps = {\n cols: string[];\n isExpandable: boolean;\n colsLayoutStyle: ColsLayoutStyle;\n};\nconst getGridTemplateColumnsStyle = ({\n cols,\n colsLayoutStyle = ColsLayoutStyle.Auto,\n}: gridTemplateColumnStyleProps) => {\n if (!cols) return '';\n if (colsLayoutStyle === 'fixed') {\n const widthAttr = cols.map((col) => `minmax(0, ${col})`).join(' ');\n return `grid-template-columns: ${widthAttr}`;\n }\n\n return `grid-template-columns: ${cols.map((col) => `minmax(0, ${col})`).join(' ')}`;\n};\n\nexport const StyledHeadWrapper = styled.div<{\n colsLayoutStyle: string;\n totalColumnsWidth: number | string;\n}>`\n position: relative; /* ie11 fallback */\n position: sticky;\n top: 0;\n z-index: 4;\n background: white;\n width: ${(props) => (props.colsLayoutStyle === ColsLayoutStyle.Fixed ? sizeToCss(props.totalColumnsWidth) : '100%')};\n`;\n\nexport const StyledHeadTr = styled(Grid)`\n ${(props) => (props.colsLayoutStyle === ColsLayoutStyle.Auto ? 'width:100%' : '')};\n ${(props) =>\n getGridTemplateColumnsStyle({\n cols: props.cols,\n isExpandable: props.isExpandable,\n colsLayoutStyle: props.colsLayoutStyle,\n })};\n border-right: 1px solid ${(props) => props.theme.colors.neutral['080']};\n border-bottom: 1px solid ${(props) => props.theme.colors.neutral['080']};\n grid-auto-flow: column;\n`;\n\nexport const StyledHeadTh = styled.div<any>`\n min-height: 24px;\n line-height: normal;\n font-weight: 600;\n text-transform: uppercase;\n font-size: 0.923rem;\n text-align: left;\n ${columnPadding}\n color: #353c46;\n min-height: 1.84615rem;\n position: sticky;\n z-index: ${ZIndexDataTable.HEADER_ROW};\n display: flex;\n justify-content: space-between;\n box-sizing: border-box;\n outline: none;\n ${(props) =>\n props.isDraggingActive\n ? ''\n : `:hover {\n &:after {\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border-bottom: 1px solid ${props.theme.colors.brand[700]};\n pointer-events: none;\n z-index: ${ZIndexDataTable.FOCUS_BORDER};\n }\n cursor: pointer;\n }`}\n\n :focus {\n &:after {\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 2px solid ${(props) => props.theme.colors.brand[700]};\n pointer-events: none;\n z-index: ${ZIndexDataTable.FOCUS_BORDER};\n }\n }\n`;\n\nexport const StyledHeaderRightIconsWrapper = styled.div`\n height: 100%;\n display: flex;\n align-items: center;\n max-height: 24px;\n`;\n\nexport const StyledResizer = styled.div<{ isResizing: boolean }>`\n display: inline-block;\n background: transparent;\n width: 4px;\n height: 100%;\n position: absolute;\n right: 0;\n top: 0;\n z-index: 1;\n\n // prevents from scrolling while dragging on touch devices\n touch-action: none;\n\n cursor: col-resize;\n`;\n\n// CELL ***********************************************************************/\nexport const StyledActionCell = styled.div`\n position: relative; /* ie11 fallback */\n position: sticky;\n display: inline-block;\n right: 0;\n /* border-bottom: 1px solid #ebedf0; */\n background: white;\n`;\n\nexport const StyledCell = styled.div`\n ${cellPadding}\n /* border-bottom: 1px solid #ebedf0; */\n /* box-sizing: border-box; */\n display: flex;\n align-items: center;\n width: 100%;\n position: relative;\n`;\n\nexport const StyledCellContent = styled.div`\n display: grid;\n justify-self: flex-end;\n flex: 1 1 auto;\n width: 100%;\n height: 100%;\n align-items: center;\n`;\n\nexport const StyledPencilIcon = styled(EditPencil)``;\n\nexport const StyledEditableContainer = styled(Grid)<{ shouldDisplayEditIcon: string }>`\n width: 100%;\n height: 100%;\n align-items: center;\n & ${StyledPencilIcon} {\n display: ${({ shouldDisplayEditIcon }) => (shouldDisplayEditIcon ? 'block' : 'none')};\n }\n &:hover {\n ${StyledPencilIcon} {\n display: block;\n }\n }\n &:focus {\n ${styledFocusCss}\n ${StyledPencilIcon} {\n display: block;\n }\n }\n outline: none;\n`;\n\n// ROW ************************************************************************/\nexport const StyledFullsizeGrid = styled(Grid)`\n position: relative;\n z-index: ${ZIndexDataTable.ROW};\n\n min-height: ${(props) => props.minHeight || '36px'};\n height: ${(props) => props.height || 'auto'};\n /* width: ${(props) =>\n props.colsLayoutStyle === ColsLayoutStyle.Fixed ? sizeToCss(props.totalColumnsWidth) : '100%'}; */\n`;\n\nexport const GroupHeaderContainer = styled(Grid)<{ padding: string }>`\n position: relative;\n background-color: ${({ theme }) => theme.colors.brand[200]};\n align-items: center;\n padding: 0 ${(props) => props.padding};\n border-top: 1px solid ${({ theme }) => theme.colors.brand[300]};\n grid-template-columns: min-content 1fr;\n`;\n\nexport const GroupHeaderTitle = styled.span`\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n font-size: 12px;\n color: ${(props) => props.theme.colors.neutral[700]};\n`;\n\nexport const StyledCellContainer = styled(Grid)`\n position: relative;\n z-index: 2;\n\n min-height: ${(props) => props.minHeight || '36px'};\n height: ${(props) => props.height || 'auto'};\n\n width: ${(props) => (props.colLayoutStyle === ColsLayoutStyle.Fixed ? sizeToCss(props.totalColumnsWidth) : '100%')};\n ${(props) => (props.isDragOverlay ? 'width: fit-content;' : '')};\n ${(props) =>\n getGridTemplateColumnsStyle({\n cols: props.cols,\n colsLayoutStyle: props.colLayoutStyle,\n isExpandable: props.isExpandable,\n })};\n background-color: ${({ backgroundColor, isDragging, theme }) =>\n isDragging ? theme.colors.neutral[100] : backgroundColor || 'white'};\n\n outline: none;\n\n :focus {\n ${(props) => (props.isDragOverlay ? '' : styledFocusCss(props))}\n }\n\n ${({ isDropIndicatorPositionInside, theme }) => {\n if (!isDropIndicatorPositionInside) return '';\n return styledFocusCss({ theme });\n }}\n\n ${({ shouldDisplayHover, theme, disabled }) =>\n shouldDisplayHover && !disabled\n ? `:hover {\n background-color: ${theme.colors.brand[200]};\n }`\n : ''}\n\n box-shadow: 0 2px 4px 0 ${(props) => (props.isDragOverlay ? 'rgba(0,0,0,0.5)' : 'transparent')};\n\n opacity: ${(props) => (props.isDragging ? 0.8 : 1)};\n\n ${(props) =>\n !props.selected\n ? ''\n : `\n background-color: ${props.theme.colors.brand[200]};\n border: 1px solid ${props.theme.colors.brand[500]};\n `}\n\n color: ${(props) => (props.disabled ? props.theme.colors.neutral['500'] : '#333333')};\n`;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,uBAAuB;AACvB,qBAAqB;AACrB,sBAA2B;AAC3B,qBAAsD;AACtD,kCAAgC;AAChC,uBAAgC;AAOhC,MAAM,iBAAiB,CAAC,EAAE,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAShB,MAAM,OAAO,MAAM;AAAA;AAAA,aAE5B,4CAAgB;AAAA;AAGtB,MAAM,oBAAoB,6BAAO,mBAAI;AAAA;AAAA,MAEtC,CAAC,UAAW,MAAM,YAAY,KAAK,eAAe,KAAK;AAAA;AAAA;AAItD,MAAM,yBAAyB,wBAAO;AAAA,WAClC,CAAC,UAAU,8BAAU,MAAM,SAAS,OAAO;AAAA,YAC1C,CAAC,UAAU,8BAAU,MAAM,UAAU,OAAO;AAAA;AAGjD,MAAM,gCAAgC,wBAAO;AAAA,iBACnC,CAAC,EAAE,yBAA0B,qBAAqB,SAAS;AAAA;AAAA;AAAA;AAIrE,MAAM,qBAAqB,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA,IAKrC,CAAC,EAAE,QAAQ,QAAQ,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AAA;AAAA,IAE9C,CAAC,UACD,CAAC,MAAM,WACH,KACA;AAAA,wBACgB,MAAM,MAAM,OAAO,MAAM;AAAA,wBACzB,MAAM,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA,WAGtC,CAAC,UAAW,MAAM,WAAW,MAAM,MAAM,OAAO,QAAQ,SAAS;AAAA;",
4
+ "sourcesContent": ["/* eslint-disable max-lines */\nimport { styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { EditPencil } from '@elliemae/ds-icons';\nimport { sizeToCss, cellPadding, columnPadding } from './helpers';\nimport { ZIndexDataTable } from './configs/zIndexInternalConfig';\nimport { ColsLayoutStyle } from './configs/constants';\n\ninterface WidthAndHeight {\n width?: string | number;\n height?: string | number;\n}\n\nconst styledFocusCss = ({ theme }) => `\n&:after {\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 2px solid ${theme.colors.brand[700]};\n pointer-events: none;\n z-index: ${ZIndexDataTable.FOCUS_BORDER};\n}`;\n\nexport const StyledFocusWithin = styled(Grid)`\n :focus-within {\n ${(props) => (props.hideFocus ? '' : styledFocusCss(props))}\n }\n`;\n\nexport const StyledDataTableWrapper = styled(Grid)<WidthAndHeight>`\n width: ${(props) => sizeToCss(props.width ?? ' 100%')};\n height: ${(props) => sizeToCss(props.height ?? ' 100%')};\n`;\n\nexport const StyledDataTableContentWrapper = styled(Grid)<WidthAndHeight & { noSelectionAllowed: boolean }>`\n user-select: ${({ noSelectionAllowed }) => (noSelectionAllowed ? 'none' : 'auto')};\n width: 100%;\n`;\n\nexport const StyledTableWrapper = styled.div<WidthAndHeight>`\n display: inline-block;\n border-spacing: 0;\n z-index: 0;\n position: relative;\n width: 100%;\n height: 100%;\n`;\nexport const StyledTableContentWrapper = styled.div<WidthAndHeight>`\n position: relative;\n ${({ height = 'auto' }) => `\n height: ${sizeToCss(height)};\n `}\n`;\nexport const StyledVirtualListWrapper = styled.div<WidthAndHeight>`\n overflow: auto;\n height: 100%;\n width: 100%;\n`;\n\n/**\n * HEADER\n */\ntype gridTemplateColumnStyleProps = {\n cols: string[];\n isExpandable: boolean;\n colsLayoutStyle: ColsLayoutStyle;\n};\nconst getGridTemplateColumnsStyle = ({\n cols,\n colsLayoutStyle = ColsLayoutStyle.Auto,\n}: gridTemplateColumnStyleProps) => {\n if (!cols) return '';\n if (colsLayoutStyle === 'fixed') {\n const widthAttr = cols.map((col) => `minmax(0, ${col})`).join(' ');\n return `grid-template-columns: ${widthAttr}`;\n }\n\n return `grid-template-columns: ${cols.map((col) => `minmax(0, ${col})`).join(' ')}`;\n};\n\nexport const StyledHeadWrapper = styled.div<{\n colsLayoutStyle: string;\n totalColumnsWidth: number | string;\n}>`\n position: relative; /* ie11 fallback */\n position: sticky;\n top: 0;\n z-index: 4;\n background: white;\n width: ${(props) => (props.colsLayoutStyle === ColsLayoutStyle.Fixed ? sizeToCss(props.totalColumnsWidth) : '100%')};\n`;\n\nexport const StyledHeadTr = styled(Grid)`\n ${(props) => (props.colsLayoutStyle === ColsLayoutStyle.Auto ? 'width:100%' : '')};\n ${(props) =>\n getGridTemplateColumnsStyle({\n cols: props.cols,\n isExpandable: props.isExpandable,\n colsLayoutStyle: props.colsLayoutStyle,\n })};\n border-right: 1px solid ${(props) => props.theme.colors.neutral['080']};\n border-bottom: 1px solid ${(props) => props.theme.colors.neutral['080']};\n grid-auto-flow: column;\n`;\n\nexport const StyledHeadTh = styled.div<any>`\n min-height: 24px;\n line-height: normal;\n font-weight: 600;\n text-transform: uppercase;\n font-size: 0.923rem;\n text-align: left;\n ${columnPadding}\n color: #353c46;\n min-height: 1.84615rem;\n position: sticky;\n z-index: ${ZIndexDataTable.HEADER_ROW};\n display: flex;\n justify-content: space-between;\n box-sizing: border-box;\n outline: none;\n ${(props) =>\n props.isDraggingActive\n ? ''\n : `:hover {\n &:after {\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border-bottom: 1px solid ${props.theme.colors.brand[700]};\n pointer-events: none;\n z-index: ${ZIndexDataTable.FOCUS_BORDER};\n }\n cursor: pointer;\n }`}\n\n :focus {\n &:after {\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 2px solid ${(props) => props.theme.colors.brand[700]};\n pointer-events: none;\n z-index: ${ZIndexDataTable.FOCUS_BORDER};\n }\n }\n`;\n\nexport const StyledHeaderRightIconsWrapper = styled.div`\n height: 100%;\n display: flex;\n align-items: center;\n max-height: 24px;\n`;\n\nexport const StyledResizer = styled.div<{ isResizing: boolean }>`\n display: inline-block;\n background: transparent;\n width: 4px;\n height: 100%;\n position: absolute;\n right: 0;\n top: 0;\n z-index: 1;\n\n // prevents from scrolling while dragging on touch devices\n touch-action: none;\n\n cursor: col-resize;\n`;\n\n// CELL ***********************************************************************/\nexport const StyledActionCell = styled.div`\n position: relative; /* ie11 fallback */\n position: sticky;\n display: inline-block;\n right: 0;\n /* border-bottom: 1px solid #ebedf0; */\n background: white;\n`;\n\nexport const StyledCell = styled.div`\n ${cellPadding}\n /* border-bottom: 1px solid #ebedf0; */\n /* box-sizing: border-box; */\n display: flex;\n align-items: center;\n width: 100%;\n position: relative;\n`;\n\nexport const StyledCellContent = styled.div`\n display: grid;\n justify-self: flex-end;\n flex: 1 1 auto;\n width: 100%;\n height: 100%;\n align-items: center;\n`;\n\nexport const StyledPencilIcon = styled(EditPencil)``;\n\nexport const StyledEditableContainer = styled(Grid)<{ shouldDisplayEditIcon: string }>`\n width: 100%;\n height: 100%;\n align-items: center;\n & ${StyledPencilIcon} {\n display: ${({ shouldDisplayEditIcon }) => (shouldDisplayEditIcon ? 'block' : 'none')};\n }\n &:hover {\n ${StyledPencilIcon} {\n display: block;\n }\n }\n &:focus {\n ${styledFocusCss}\n ${StyledPencilIcon} {\n display: block;\n }\n }\n outline: none;\n`;\n\n// ROW ************************************************************************/\nexport const StyledFullsizeGrid = styled(Grid)`\n position: relative;\n z-index: ${ZIndexDataTable.ROW};\n\n min-height: ${(props) => props.minHeight || '36px'};\n height: ${(props) => props.height || 'auto'};\n /* width: ${(props) =>\n props.colsLayoutStyle === ColsLayoutStyle.Fixed ? sizeToCss(props.totalColumnsWidth) : '100%'}; */\n`;\n\nexport const GroupHeaderContainer = styled(Grid)<{ padding: string }>`\n position: relative;\n background-color: ${({ theme }) => theme.colors.brand[200]};\n align-items: center;\n padding: 0 ${(props) => props.padding};\n border-top: 1px solid ${({ theme }) => theme.colors.brand[300]};\n grid-template-columns: min-content 1fr;\n`;\n\nexport const GroupHeaderTitle = styled.span`\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n font-size: 12px;\n color: ${(props) => props.theme.colors.neutral[700]};\n`;\n\nexport const StyledCellContainer = styled(Grid)`\n position: relative;\n z-index: 2;\n\n min-height: ${(props) => props.minHeight || '36px'};\n height: ${(props) => props.height || 'auto'};\n\n width: ${(props) => (props.colLayoutStyle === ColsLayoutStyle.Fixed ? sizeToCss(props.totalColumnsWidth) : '100%')};\n ${(props) => (props.isDragOverlay ? 'width: fit-content;' : '')};\n ${(props) =>\n getGridTemplateColumnsStyle({\n cols: props.cols,\n colsLayoutStyle: props.colLayoutStyle,\n isExpandable: props.isExpandable,\n })};\n background-color: ${({ backgroundColor, isDragging, theme }) =>\n isDragging ? theme.colors.neutral[100] : backgroundColor || 'white'};\n\n outline: none;\n\n :focus {\n ${(props) => (props.isDragOverlay ? '' : styledFocusCss(props))}\n }\n\n ${({ isDropIndicatorPositionInside, theme }) => {\n if (!isDropIndicatorPositionInside) return '';\n return styledFocusCss({ theme });\n }}\n\n ${({ shouldDisplayHover, theme, disabled }) =>\n shouldDisplayHover && !disabled\n ? `:hover {\n background-color: ${theme.colors.brand[200]};\n }`\n : ''}\n\n box-shadow: 0 2px 4px 0 ${(props) => (props.isDragOverlay ? 'rgba(0,0,0,0.5)' : 'transparent')};\n\n opacity: ${(props) => (props.isDragging ? 0.8 : 1)};\n\n ${(props) =>\n !props.selected\n ? ''\n : `\n background-color: ${props.theme.colors.brand[200]};\n border: 1px solid ${props.theme.colors.brand[500]};\n `}\n\n color: ${(props) => (props.disabled ? props.theme.colors.neutral['500'] : '#333333')};\n`;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,uBAAuB;AACvB,qBAAqB;AACrB,sBAA2B;AAC3B,qBAAsD;AACtD,kCAAgC;AAChC,uBAAgC;AAOhC,MAAM,iBAAiB,CAAC,EAAE,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAShB,MAAM,OAAO,MAAM;AAAA;AAAA,aAE5B,4CAAgB;AAAA;AAGtB,MAAM,oBAAoB,6BAAO,mBAAI;AAAA;AAAA,MAEtC,CAAC,UAAW,MAAM,YAAY,KAAK,eAAe,KAAK;AAAA;AAAA;AAItD,MAAM,yBAAyB,6BAAO,mBAAI;AAAA,WACtC,CAAC,UAAU,8BAAU,MAAM,SAAS,OAAO;AAAA,YAC1C,CAAC,UAAU,8BAAU,MAAM,UAAU,OAAO;AAAA;AAGjD,MAAM,gCAAgC,6BAAO,mBAAI;AAAA,iBACvC,CAAC,EAAE,yBAA0B,qBAAqB,SAAS;AAAA;AAAA;AAIrE,MAAM,qBAAqB,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQlC,MAAM,4BAA4B,wBAAO;AAAA;AAAA,IAE5C,CAAC,EAAE,SAAS,aAAa;AAAA,YACjB,8BAAU,MAAM;AAAA;AAAA;AAGrB,MAAM,2BAA2B,wBAAO;AAAA;AAAA;AAAA;AAAA;AAc/C,MAAM,8BAA8B,CAAC;AAAA,EACnC;AA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
43
+ rows: withFilterBar ? ["auto", "1fr"] : ["1fr"]
42
44
  }, withFilterBar ? /* @__PURE__ */ React2.createElement(FiltersBar, null) : null, /* @__PURE__ */ React2.createElement(TableContent, {
43
45
  ref: tableContentWrapperRef
44
46
  })));
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DataTable.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useRef } from 'react';\nimport { describe } from '@elliemae/ds-utilities';\nimport { TableContent } from './parts/TableContent';\nimport { TypescriptProps } from './types/props';\nimport { DataTableContext, defaultProps } from './DataTableContext';\nimport { DATA_TESTID } from './configs/constants';\nimport { useDatatableConfig } from './configs/useDatatableConfig';\nimport { FiltersBar } from './parts/FilterBar/FiltersBar';\nimport { DataTableSchema } from './DataTableSchema';\nimport { StyledDataTableWrapper } from './styled';\n\nexport const DataTable = (props: TypescriptProps): JSX.Element => {\n const { withFilterBar } = props;\n\n const tableWrapperRef = useRef();\n const tableContentWrapperRef = useRef();\n\n const ctx = useDatatableConfig(props);\n\n const {\n tableProps: { height, width },\n } = ctx;\n\n return (\n <DataTableContext.Provider value={ctx}>\n <StyledDataTableWrapper\n ref={tableWrapperRef}\n data-testid={DATA_TESTID.DATA_TABLE_WRAPPER}\n height={height}\n width={width}\n >\n {withFilterBar ? <FiltersBar /> : null}\n <TableContent ref={tableContentWrapperRef} />\n </StyledDataTableWrapper>\n </DataTableContext.Provider>\n );\n};\n\nDataTable.propTypes = DataTableSchema;\nDataTable.defaultProps = { ...defaultProps };\nDataTable.displayName = 'DataTable';\nexport const DataTableWithSchema = describe(DataTable).description('Data Table');\nDataTableWithSchema.propTypes = DataTableSchema;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEO,MAAM,YAAY,CAAC,UAAwC;AAChE,QAAM,EAAE,kBAAkB;AAE1B,QAAM,kBAAkB,OAAO;AAC/B,QAAM,yBAAyB,OAAO;AAEtC,QAAM,MAAM,mBAAmB,KAAK;AAEpC,QAAM;AAAA,IACJ,YAAY,EAAE,QAAQ;AAAA,MACpB;AAEJ,SACE,qCAAC,iBAAiB,UAAjB;AAAA,IAA0B,OAAO;AAAA,KAChC,qCAAC;AAAA,IACC,KAAK;AAAA,IACL,eAAa,YAAY;AAAA,IACzB;AAAA,IACA;AAAA,KAEC,gBAAgB,qCAAC,gBAAW,IAAK,MAClC,qCAAC;AAAA,IAAa,KAAK;AAAA,GAAwB,CAC7C,CACF;AAEJ;AAEA,UAAU,YAAY;AACtB,UAAU,eAAe,mBAAK;AAC9B,UAAU,cAAc;AACjB,MAAM,sBAAsB,SAAS,SAAS,EAAE,YAAY,YAAY;AAC/E,oBAAoB,YAAY;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useRef } from 'react';\nimport { describe } from '@elliemae/ds-utilities';\nimport { TableContent } from './parts/TableContent';\nimport { TypescriptProps } from './types/props';\nimport { DataTableContext, defaultProps } from './DataTableContext';\nimport { DATA_TESTID } from './configs/constants';\nimport { useDatatableConfig } from './configs/useDatatableConfig';\nimport { FiltersBar } from './parts/FilterBar/FiltersBar';\nimport { DataTableSchema } from './DataTableSchema';\nimport { StyledDataTableWrapper } from './styled';\n\nexport const DataTable = (props: TypescriptProps): JSX.Element => {\n const { withFilterBar } = props;\n\n const tableWrapperRef = useRef();\n const tableContentWrapperRef = useRef();\n\n const ctx = useDatatableConfig(props);\n\n const {\n tableProps: { height, width },\n } = ctx;\n\n return (\n <DataTableContext.Provider value={ctx}>\n <StyledDataTableWrapper\n ref={tableWrapperRef}\n data-testid={DATA_TESTID.DATA_TABLE_WRAPPER}\n height={height}\n width={width}\n cols={['100%']}\n rows={withFilterBar ? ['auto', '1fr'] : ['1fr']}\n >\n {withFilterBar ? <FiltersBar /> : null}\n <TableContent ref={tableContentWrapperRef} />\n </StyledDataTableWrapper>\n </DataTableContext.Provider>\n );\n};\n\nDataTable.propTypes = DataTableSchema;\nDataTable.defaultProps = { ...defaultProps };\nDataTable.displayName = 'DataTable';\nexport const DataTableWithSchema = describe(DataTable).description('Data Table');\nDataTableWithSchema.propTypes = DataTableSchema;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEO,MAAM,YAAY,CAAC,UAAwC;AAChE,QAAM,EAAE,kBAAkB;AAE1B,QAAM,kBAAkB,OAAO;AAC/B,QAAM,yBAAyB,OAAO;AAEtC,QAAM,MAAM,mBAAmB,KAAK;AAEpC,QAAM;AAAA,IACJ,YAAY,EAAE,QAAQ;AAAA,MACpB;AAEJ,SACE,qCAAC,iBAAiB,UAAjB;AAAA,IAA0B,OAAO;AAAA,KAChC,qCAAC;AAAA,IACC,KAAK;AAAA,IACL,eAAa,YAAY;AAAA,IACzB;AAAA,IACA;AAAA,IACA,MAAM,CAAC,MAAM;AAAA,IACb,MAAM,gBAAgB,CAAC,QAAQ,KAAK,IAAI,CAAC,KAAK;AAAA,KAE7C,gBAAgB,qCAAC,gBAAW,IAAK,MAClC,qCAAC;AAAA,IAAa,KAAK;AAAA,GAAwB,CAC7C,CACF;AAEJ;AAEA,UAAU,YAAY;AACtB,UAAU,eAAe,mBAAK;AAC9B,UAAU,cAAc;AACjB,MAAM,sBAAsB,SAAS,SAAS,EAAE,YAAY,YAAY;AAC/E,oBAAoB,YAAY;",
6
6
  "names": []
7
7
  }