@elliemae/ds-data-table 3.0.0-next.53 → 3.0.0-next.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/DataTable.js +2 -8
- package/dist/cjs/DataTable.js.map +2 -2
- package/dist/cjs/addons/Filters/Components/CurrencyRangeFilter/index.js +2 -2
- package/dist/cjs/addons/Filters/Components/CurrencyRangeFilter/index.js.map +2 -2
- package/dist/cjs/addons/Filters/Components/NumberRangeFilter/index.js +2 -2
- package/dist/cjs/addons/Filters/Components/NumberRangeFilter/index.js.map +2 -2
- package/dist/cjs/addons/Filters/Components/SelectFilter/BaseSelectFilter.js +2 -2
- package/dist/cjs/addons/Filters/Components/SelectFilter/BaseSelectFilter.js.map +2 -2
- package/dist/cjs/configs/useDatatableConfig.js +20 -3
- package/dist/cjs/configs/useDatatableConfig.js.map +2 -2
- package/dist/cjs/{redux/reducers/headersReducers/logic.js → configs/useInternalStateConfig.js} +38 -12
- package/dist/cjs/configs/useInternalStateConfig.js.map +7 -0
- package/dist/cjs/exported-related/FilterPopover.js +2 -2
- package/dist/cjs/exported-related/FilterPopover.js.map +2 -2
- package/dist/cjs/exported-related/RowRenderer/DefaultRowContentRenderer.js +3 -3
- package/dist/cjs/exported-related/RowRenderer/DefaultRowContentRenderer.js.map +2 -2
- package/dist/cjs/exported-related/RowRenderer/index.js +3 -3
- package/dist/cjs/exported-related/RowRenderer/index.js.map +1 -1
- package/dist/cjs/exported-related/RowRenderer/useRowRendererHandlers.js +10 -10
- package/dist/cjs/exported-related/RowRenderer/useRowRendererHandlers.js.map +2 -2
- package/dist/cjs/parts/Filters/index.js +2 -2
- package/dist/cjs/parts/Filters/index.js.map +2 -2
- package/dist/cjs/parts/Headers/HeaderCell.js +6 -13
- package/dist/cjs/parts/Headers/HeaderCell.js.map +2 -2
- package/dist/cjs/parts/Row.js +6 -10
- package/dist/cjs/parts/Row.js.map +2 -2
- package/dist/cjs/parts/RowVariants/RowVariantHeader.js +4 -4
- package/dist/cjs/parts/RowVariants/RowVariantHeader.js.map +2 -2
- package/dist/cjs/parts/RowVariants/RowVariantPrimary.js +2 -2
- package/dist/cjs/parts/RowVariants/RowVariantPrimary.js.map +1 -1
- package/dist/cjs/parts/RowVariants/RowVariantSecondary.js +2 -2
- package/dist/cjs/parts/RowVariants/RowVariantSecondary.js.map +1 -1
- package/dist/cjs/parts/RowVariants/RowVariantSkeleton.js +2 -2
- package/dist/cjs/parts/RowVariants/RowVariantSkeleton.js.map +2 -2
- package/dist/cjs/parts/RowVariants/index.js.map +1 -1
- package/dist/cjs/parts/RowVariants/types.js.map +1 -1
- package/dist/cjs/parts/TableContent.js +1 -6
- package/dist/cjs/parts/TableContent.js.map +2 -2
- package/dist/cjs/parts/VirtualRowsList.js +3 -11
- package/dist/cjs/parts/VirtualRowsList.js.map +2 -2
- package/dist/cjs/types/props.js.map +1 -1
- package/dist/esm/DataTable.js +3 -9
- package/dist/esm/DataTable.js.map +2 -2
- package/dist/esm/addons/Filters/Components/CurrencyRangeFilter/index.js +3 -3
- package/dist/esm/addons/Filters/Components/CurrencyRangeFilter/index.js.map +2 -2
- package/dist/esm/addons/Filters/Components/NumberRangeFilter/index.js +3 -3
- package/dist/esm/addons/Filters/Components/NumberRangeFilter/index.js.map +2 -2
- package/dist/esm/addons/Filters/Components/SelectFilter/BaseSelectFilter.js +3 -3
- package/dist/esm/addons/Filters/Components/SelectFilter/BaseSelectFilter.js.map +2 -2
- package/dist/esm/configs/useDatatableConfig.js +22 -3
- package/dist/esm/configs/useDatatableConfig.js.map +2 -2
- package/dist/esm/configs/useInternalStateConfig.js +55 -0
- package/dist/esm/configs/useInternalStateConfig.js.map +7 -0
- package/dist/esm/exported-related/FilterPopover.js +3 -3
- package/dist/esm/exported-related/FilterPopover.js.map +2 -2
- package/dist/esm/exported-related/RowRenderer/DefaultRowContentRenderer.js +3 -3
- package/dist/esm/exported-related/RowRenderer/DefaultRowContentRenderer.js.map +2 -2
- package/dist/esm/exported-related/RowRenderer/index.js +3 -3
- package/dist/esm/exported-related/RowRenderer/index.js.map +1 -1
- package/dist/esm/exported-related/RowRenderer/useRowRendererHandlers.js +10 -10
- package/dist/esm/exported-related/RowRenderer/useRowRendererHandlers.js.map +2 -2
- package/dist/esm/parts/Filters/index.js +3 -3
- package/dist/esm/parts/Filters/index.js.map +2 -2
- package/dist/esm/parts/Headers/HeaderCell.js +6 -13
- package/dist/esm/parts/Headers/HeaderCell.js.map +2 -2
- package/dist/esm/parts/Row.js +6 -10
- package/dist/esm/parts/Row.js.map +2 -2
- package/dist/esm/parts/RowVariants/RowVariantHeader.js +4 -4
- package/dist/esm/parts/RowVariants/RowVariantHeader.js.map +2 -2
- package/dist/esm/parts/RowVariants/RowVariantPrimary.js +2 -2
- package/dist/esm/parts/RowVariants/RowVariantPrimary.js.map +1 -1
- package/dist/esm/parts/RowVariants/RowVariantSecondary.js +2 -2
- package/dist/esm/parts/RowVariants/RowVariantSecondary.js.map +1 -1
- package/dist/esm/parts/RowVariants/RowVariantSkeleton.js +2 -2
- package/dist/esm/parts/RowVariants/RowVariantSkeleton.js.map +2 -2
- package/dist/esm/parts/RowVariants/index.js.map +1 -1
- package/dist/esm/parts/TableContent.js +1 -6
- package/dist/esm/parts/TableContent.js.map +2 -2
- package/dist/esm/parts/VirtualRowsList.js +3 -11
- package/dist/esm/parts/VirtualRowsList.js.map +2 -2
- package/package.json +1 -1
- package/dist/cjs/redux/reducers/headersReducers/defaults.js +0 -28
- package/dist/cjs/redux/reducers/headersReducers/defaults.js.map +0 -7
- package/dist/cjs/redux/reducers/headersReducers/headersReducers.js +0 -50
- package/dist/cjs/redux/reducers/headersReducers/headersReducers.js.map +0 -7
- package/dist/cjs/redux/reducers/headersReducers/index.js +0 -23
- package/dist/cjs/redux/reducers/headersReducers/index.js.map +0 -7
- package/dist/cjs/redux/reducers/headersReducers/logic.js.map +0 -7
- package/dist/cjs/redux/reducers/headersReducers/useDispatchHeadersActions.js +0 -39
- package/dist/cjs/redux/reducers/headersReducers/useDispatchHeadersActions.js.map +0 -7
- package/dist/cjs/redux/reducers/index.js +0 -40
- package/dist/cjs/redux/reducers/index.js.map +0 -7
- package/dist/cjs/redux/reducers/rowsReducers/actions_types.js +0 -40
- package/dist/cjs/redux/reducers/rowsReducers/actions_types.js.map +0 -7
- package/dist/cjs/redux/reducers/rowsReducers/defaults.js +0 -48
- package/dist/cjs/redux/reducers/rowsReducers/defaults.js.map +0 -7
- package/dist/cjs/redux/reducers/rowsReducers/index.js +0 -23
- package/dist/cjs/redux/reducers/rowsReducers/index.js.map +0 -7
- package/dist/cjs/redux/reducers/rowsReducers/logic.js +0 -58
- package/dist/cjs/redux/reducers/rowsReducers/logic.js.map +0 -7
- package/dist/cjs/redux/reducers/rowsReducers/rowsReducer.js +0 -80
- package/dist/cjs/redux/reducers/rowsReducers/rowsReducer.js.map +0 -7
- package/dist/cjs/redux/reducers/rowsReducers/useDispatchRowsActions.js +0 -54
- package/dist/cjs/redux/reducers/rowsReducers/useDispatchRowsActions.js.map +0 -7
- package/dist/cjs/redux/storeConfig.js +0 -31
- package/dist/cjs/redux/storeConfig.js.map +0 -7
- package/dist/esm/redux/reducers/headersReducers/defaults.js +0 -6
- package/dist/esm/redux/reducers/headersReducers/defaults.js.map +0 -7
- package/dist/esm/redux/reducers/headersReducers/headersReducers.js +0 -28
- package/dist/esm/redux/reducers/headersReducers/headersReducers.js.map +0 -7
- package/dist/esm/redux/reducers/headersReducers/index.js +0 -4
- package/dist/esm/redux/reducers/headersReducers/index.js.map +0 -7
- package/dist/esm/redux/reducers/headersReducers/logic.js +0 -29
- package/dist/esm/redux/reducers/headersReducers/logic.js.map +0 -7
- package/dist/esm/redux/reducers/headersReducers/useDispatchHeadersActions.js +0 -17
- package/dist/esm/redux/reducers/headersReducers/useDispatchHeadersActions.js.map +0 -7
- package/dist/esm/redux/reducers/index.js +0 -18
- package/dist/esm/redux/reducers/index.js.map +0 -7
- package/dist/esm/redux/reducers/rowsReducers/actions_types.js +0 -18
- package/dist/esm/redux/reducers/rowsReducers/actions_types.js.map +0 -7
- package/dist/esm/redux/reducers/rowsReducers/defaults.js +0 -26
- package/dist/esm/redux/reducers/rowsReducers/defaults.js.map +0 -7
- package/dist/esm/redux/reducers/rowsReducers/index.js +0 -4
- package/dist/esm/redux/reducers/rowsReducers/index.js.map +0 -7
- package/dist/esm/redux/reducers/rowsReducers/logic.js +0 -36
- package/dist/esm/redux/reducers/rowsReducers/logic.js.map +0 -7
- package/dist/esm/redux/reducers/rowsReducers/rowsReducer.js +0 -67
- package/dist/esm/redux/reducers/rowsReducers/rowsReducer.js.map +0 -7
- package/dist/esm/redux/reducers/rowsReducers/useDispatchRowsActions.js +0 -41
- package/dist/esm/redux/reducers/rowsReducers/useDispatchRowsActions.js.map +0 -7
- package/dist/esm/redux/storeConfig.js +0 -9
- package/dist/esm/redux/storeConfig.js.map +0 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/RowRenderer/DefaultRowContentRenderer.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\n/* eslint-disable max-lines */\n/* eslint-disable react/prop-types */\nimport React, { useMemo, useCallback, useLayoutEffect, useRef } from 'react';\nimport { INTERNAL_COLUMNS } from '../../addons/Columns';\nimport { DATA_TESTID } from '../../configs/constants';\nimport { Cells } from '../../parts/Cells';\nimport { DropIndicatorPosition } from '../../parts/HoC/SortableItemContext';\nimport { RowVariantProps } from '../../parts/RowVariants/types';\nimport { StyledCellContainer } from '../../styled';\nimport { TypescriptRow } from '../../types/props';\n\nconst DetailsWrapper = (props) => (\n // This can be further customized\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions\n <div\n data-role=\"detail-view\"\n style={{\n borderTop: '1px solid #EBEDF0',\n borderBottom: '1px solid #EBEDF0',\n }}\n onClick={(e) => e.stopPropagation()}\n onKeyDown={(e) => e.stopPropagation()}\n >\n {props.children}\n </div>\n);\n\nconst ariaLabelMessage = (row: TypescriptRow, selected: boolean) =>\n `Row number ${row.realIndex + 1}${row.parentIndex !== null ? `, child of row number ${row.parentIndex + 1}` : ''}. ${\n selected ? 'Selected. ' : ''\n }To interact with the cells press enter`;\n\nexport const DefaultRowContentRenderer: React.ComponentType<RowVariantProps> = (props) => {\n const {\n row,\n ctx: {\n tableProps: { isExpandable, colsLayoutStyle, selection, noSelectionColumn, expandedRows, disabledRows },\n layoutHelpers: { gridLayout },\n visibleColumns,\n },\n draggableProps,\n isDragOverlay,\n backgroundColor = 'white',\n dropIndicatorPosition,\n focusedRowId,\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACGA;AACA;AACA;AACA;AACA;AAEA;AAGA,MAAM,iBAAiB,CAAC,UAGtB,qCAAC;AAAA,EACC,aAAU;AAAA,EACV,OAAO;AAAA,IACL,WAAW;AAAA,IACX,cAAc;AAAA,EAChB;AAAA,EACA,SAAS,CAAC,MAAM,EAAE,gBAAgB;AAAA,EAClC,WAAW,CAAC,MAAM,EAAE,gBAAgB;AAAA,GAEnC,MAAM,QACT;AAGF,MAAM,mBAAmB,CAAC,KAAoB,aAC5C,cAAc,IAAI,YAAY,IAAI,IAAI,gBAAgB,OAAO,yBAAyB,IAAI,cAAc,MAAM,OAC5G,WAAW,eAAe;AAGvB,MAAM,4BAAkE,CAAC,UAAU;AACxF,QAAM;AAAA,IACJ;AAAA,IACA,KAAK;AAAA,MACH,YAAY,EAAE,cAAc,iBAAiB,WAAW,mBAAmB,cAAc;AAAA,MACzF,eAAe,EAAE;AAAA,MACjB;AAAA;AAAA,IAEF;AAAA,IACA;AAAA,IACA,kBAAkB;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACE;AAEJ,QAAM,SAAS,OAAuB,IAAI;AAC1C,QAAM,cAAc,kBAAkB,eAAe;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,iBAAe,aAAa,IAAI;AAAA,OAC5B,uBAXL;AAAA,MAYC;AAAA,MACA,QAAQ,UAAU,SAAS;AAAA,MAC3B,WAAW,UAAU,SAAS;AAAA,MAC9B,+BAA+B,0BAA0B,sBAAsB;AAAA,MAC/E,oBAAoB,CAAC,eAAe,CAAC,cAAc,CAAC;AAAA,MACpD;AAAA,MACA;AAAA,MACA,UAAU,qBAAqB,YAAY,IAAI,SAAS;AAAA,MACxD,UAAU,aAAa,IAAI;AAAA,MAC3B,eAAa,YAAY;AAAA,MACzB,aAAa;AAAA,QAEb,qCAAC;AAAA,MAAM;AAAA,MAAU,eAAe,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\n/* eslint-disable max-lines */\n/* eslint-disable react/prop-types */\nimport React, { useMemo, useCallback, useLayoutEffect, useRef } from 'react';\nimport { INTERNAL_COLUMNS } from '../../addons/Columns';\nimport { DATA_TESTID } from '../../configs/constants';\nimport { Cells } from '../../parts/Cells';\nimport { DropIndicatorPosition } from '../../parts/HoC/SortableItemContext';\nimport { RowVariantProps } from '../../parts/RowVariants/types';\nimport { StyledCellContainer } from '../../styled';\nimport { TypescriptRow } from '../../types/props';\n\nconst DetailsWrapper = (props) => (\n // This can be further customized\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions\n <div\n data-role=\"detail-view\"\n style={{\n borderTop: '1px solid #EBEDF0',\n borderBottom: '1px solid #EBEDF0',\n }}\n onClick={(e) => e.stopPropagation()}\n onKeyDown={(e) => e.stopPropagation()}\n >\n {props.children}\n </div>\n);\n\nconst ariaLabelMessage = (row: TypescriptRow, selected: boolean) =>\n `Row number ${row.realIndex + 1}${row.parentIndex !== null ? `, child of row number ${row.parentIndex + 1}` : ''}. ${\n selected ? 'Selected. ' : ''\n }To interact with the cells press enter`;\n\nexport const DefaultRowContentRenderer: React.ComponentType<RowVariantProps> = (props) => {\n const {\n row,\n ctx: {\n tableProps: { isExpandable, colsLayoutStyle, selection, noSelectionColumn, expandedRows, disabledRows },\n layoutHelpers: { gridLayout },\n visibleColumns,\n },\n draggableProps,\n isDragOverlay,\n backgroundColor = 'white',\n dropIndicatorPosition,\n focusedRowId,\n drilldownRowId,\n compact,\n } = props;\n\n const rowRef = useRef<HTMLDivElement>(null);\n const isDndActive = draggableProps && draggableProps.active;\n const isDragging = draggableProps && draggableProps.isDragging;\n\n useLayoutEffect(() => {\n if (row.uid === focusedRowId) {\n rowRef.current?.focus();\n }\n }, [focusedRowId, row.uid]);\n\n const gridTemplateColProps = useMemo(\n () => ({\n cols: isDragOverlay ? ['24px', 'auto'] : gridLayout,\n isExpandable,\n colLayoutStyle: colsLayoutStyle,\n }),\n [isDragOverlay, gridLayout, colsLayoutStyle, isExpandable],\n );\n\n const detailsIndent = useMemo(() => {\n let padding = 0;\n for (let i = 0; i < visibleColumns.length; i += 1) {\n if (INTERNAL_COLUMNS.includes(visibleColumns[i].id)) {\n padding += visibleColumns[i].width;\n } else {\n padding += row.depth * 32 + 15;\n break;\n }\n }\n return padding;\n }, [row.depth, visibleColumns]);\n\n const handleSelectDisableRow = useCallback(\n (e) => {\n if (disabledRows[row.uid]) {\n e.preventDefault();\n e.stopPropagation();\n }\n },\n [disabledRows, row.uid],\n );\n const PureRowContent = useMemo(() => {\n const DetailsView = row.original.tableRowDetails;\n return (\n <>\n <StyledCellContainer\n ref={rowRef}\n key={row.uid}\n tabIndex={disabledRows[row.uid] ? -1 : 0}\n role=\"row\"\n aria-rowindex={row.realIndex + 1}\n aria-label={ariaLabelMessage(row, selection?.[row.uid] === true)}\n aria-level={row.depth + 1}\n aria-selected={selection?.[row.uid] === true}\n aria-expanded={isExpandable ? expandedRows[row.uid] === true : undefined}\n aria-disabled={disabledRows[row.uid]}\n {...gridTemplateColProps}\n backgroundColor={backgroundColor}\n height={compact ? '24px' : 'auto'}\n minHeight={compact ? '24px' : '36px'}\n isDropIndicatorPositionInside={dropIndicatorPosition === DropIndicatorPosition.Inside}\n shouldDisplayHover={!isDndActive && !isDragging && !isDragOverlay}\n isDragOverlay={isDragOverlay}\n isDragging={isDragging}\n selected={noSelectionColumn && selection?.[row.uid] === true}\n disabled={disabledRows[row.uid]}\n data-testid={DATA_TESTID.DATA_TABLE_ROW_CONTENT}\n onMouseDown={handleSelectDisableRow}\n >\n <Cells row={row} isRowSelected={drilldownRowId === row.uid} isDragOverlay={isDragOverlay} key={row.uid} />\n </StyledCellContainer>\n {isExpandable && row.isExpanded && DetailsView && (\n <DetailsWrapper>\n <DetailsView row={row} detailsIndent={detailsIndent} />\n </DetailsWrapper>\n )}\n </>\n );\n }, [\n row,\n disabledRows,\n selection,\n isExpandable,\n expandedRows,\n gridTemplateColProps,\n backgroundColor,\n compact,\n dropIndicatorPosition,\n isDndActive,\n isDragging,\n isDragOverlay,\n noSelectionColumn,\n handleSelectDisableRow,\n drilldownRowId,\n detailsIndent,\n ]);\n\n return PureRowContent;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACGA;AACA;AACA;AACA;AACA;AAEA;AAGA,MAAM,iBAAiB,CAAC,UAGtB,qCAAC;AAAA,EACC,aAAU;AAAA,EACV,OAAO;AAAA,IACL,WAAW;AAAA,IACX,cAAc;AAAA,EAChB;AAAA,EACA,SAAS,CAAC,MAAM,EAAE,gBAAgB;AAAA,EAClC,WAAW,CAAC,MAAM,EAAE,gBAAgB;AAAA,GAEnC,MAAM,QACT;AAGF,MAAM,mBAAmB,CAAC,KAAoB,aAC5C,cAAc,IAAI,YAAY,IAAI,IAAI,gBAAgB,OAAO,yBAAyB,IAAI,cAAc,MAAM,OAC5G,WAAW,eAAe;AAGvB,MAAM,4BAAkE,CAAC,UAAU;AACxF,QAAM;AAAA,IACJ;AAAA,IACA,KAAK;AAAA,MACH,YAAY,EAAE,cAAc,iBAAiB,WAAW,mBAAmB,cAAc;AAAA,MACzF,eAAe,EAAE;AAAA,MACjB;AAAA;AAAA,IAEF;AAAA,IACA;AAAA,IACA,kBAAk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AC/D,cAAY,IAAI,QAAQ;AAAA,MACxB,iBAAe,YAAY,IAAI,SAAS;AAAA,MACxC,iBAAe,eAAe,aAAa,IAAI,SAAS,OAAO;AAAA,MAC/D,iBAAe,aAAa,IAAI;AAAA,OAC5B,uBAXL;AAAA,MAYC;AAAA,MACA,QAAQ,UAAU,SAAS;AAAA,MAC3B,WAAW,UAAU,SAAS;AAAA,MAC9B,+BAA+B,0BAA0B,sBAAsB;AAAA,MAC/E,oBAAoB,CAAC,eAAe,CAAC,cAAc,CAAC;AAAA,MACpD;AAAA,MACA;AAAA,MACA,UAAU,qBAAqB,YAAY,IAAI,SAAS;AAAA,MACxD,UAAU,aAAa,IAAI;AAAA,MAC3B,eAAa,YAAY;AAAA,MACzB,aAAa;AAAA,QAEb,qCAAC;AAAA,MAAM;AAAA,MAAU,eAAe,mBAAmB,IAAI;AAAA,MAAK;AAAA,MAA8B,KAAK,IAAI;AAAA,KAAK,CAC1G,GACC,gBAAgB,IAAI,cAAc,eACjC,qCAAC,sBACC,qCAAC;AAAA,MAAY;AAAA,MAAU;AAAA,KAA8B,CACvD,CAEJ;AAAA,EAEJ,GAAG;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -50,7 +50,7 @@ const RowRenderer = (props) => {
|
|
|
50
50
|
rowsLayout = [1],
|
|
51
51
|
CustomRowContentRenderer,
|
|
52
52
|
focusedRowId,
|
|
53
|
-
|
|
53
|
+
drilldownRowId,
|
|
54
54
|
isDragOverlay
|
|
55
55
|
} = props;
|
|
56
56
|
const ctx = useContext(DataTableContext);
|
|
@@ -72,12 +72,12 @@ const RowRenderer = (props) => {
|
|
|
72
72
|
items: flattenedData,
|
|
73
73
|
draggableProps,
|
|
74
74
|
isDragOverlay,
|
|
75
|
-
|
|
75
|
+
drilldownRowId
|
|
76
76
|
});
|
|
77
77
|
const rowContentProps = __spreadProps(__spreadValues({}, props), {
|
|
78
78
|
ctx,
|
|
79
79
|
focusedRowId,
|
|
80
|
-
|
|
80
|
+
drilldownRowId,
|
|
81
81
|
draggableProps,
|
|
82
82
|
dropIndicatorPosition
|
|
83
83
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/RowRenderer/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable react/prop-types */\nimport React, { useContext } from 'react';\nimport { DataTableContext } from '../../DataTableContext';\nimport { RowVariantProps } from '../../parts/RowVariants/types';\nimport { StyledFullsizeGrid } from '../../styled';\nimport { TypescriptRow } from '../../types/props';\nimport { DefaultRowContentRenderer } from './DefaultRowContentRenderer';\nimport { useRowRendererHandlers } from './useRowRendererHandlers';\nimport { useRowRendererProperties } from './useRowRendererProperties';\nimport { DropIndicator } from '../../parts/DropIndicator';\nimport { SortableItemContext } from '../../parts/HoC/SortableItemContext';\nimport { DATA_TESTID } from '../../configs/constants';\n\ninterface RowRendererProps {\n row: TypescriptRow;\n compact
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable react/prop-types */\nimport React, { useContext } from 'react';\nimport { DataTableContext } from '../../DataTableContext';\nimport { RowVariantProps } from '../../parts/RowVariants/types';\nimport { StyledFullsizeGrid } from '../../styled';\nimport { TypescriptRow } from '../../types/props';\nimport { DefaultRowContentRenderer } from './DefaultRowContentRenderer';\nimport { useRowRendererHandlers } from './useRowRendererHandlers';\nimport { useRowRendererProperties } from './useRowRendererProperties';\nimport { DropIndicator } from '../../parts/DropIndicator';\nimport { SortableItemContext } from '../../parts/HoC/SortableItemContext';\nimport { DATA_TESTID } from '../../configs/constants';\n\ninterface RowRendererProps {\n row: TypescriptRow;\n compact?: boolean;\n itemIndex: number;\n isDragOverlay: boolean;\n minHeight: string;\n height: string;\n rowsLayout?: (string | number)[];\n colsLayout?: (string | number)[];\n CustomRowContentRenderer?: React.ComponentType<RowVariantProps>;\n focusedRowId: string | null;\n drilldownRowId: string | null;\n backgroundColor?: string;\n}\n\n// CSS don't let us modify the spacing between the dots, so one solution is to use SVG\nconst magicDottedBorder = (\n <svg width=\"100%\" height=\"1px\">\n <line\n x1=\"0\"\n y1=\"0\"\n x2=\"100%\"\n y2=\"0\"\n stroke=\"#B0B9C8FF\"\n strokeWidth=\"1.5\"\n strokeDasharray=\"0, 5\"\n strokeDashoffset=\"0\"\n strokeLinecap=\"round\"\n />\n </svg>\n);\n\nconst RowRenderer: React.ComponentType<RowRendererProps> = (props) => {\n const {\n row,\n itemIndex,\n minHeight = '36px',\n height = 'auto',\n rowsLayout = [1],\n CustomRowContentRenderer,\n focusedRowId,\n drilldownRowId,\n isDragOverlay,\n } = props;\n\n const ctx = useContext(DataTableContext);\n const { draggableProps } = useContext(SortableItemContext);\n const { flattenedData } = ctx;\n\n // ===========================================================================\n // Properties for the row\n // ===========================================================================\n\n const {\n userDataProperties,\n colsLayoutStyle,\n totalColumnsWidth,\n rowStyle,\n shouldAppendDottedBorder,\n dropIndicatorPosition,\n } = useRowRendererProperties({\n row,\n });\n\n // ===========================================================================\n // Handlers\n // ===========================================================================\n\n const { handleItemClick, handleKeyDown, handleOnBlur, handleOnFocus } = useRowRendererHandlers({\n row,\n itemIndex,\n items: flattenedData,\n draggableProps,\n isDragOverlay,\n drilldownRowId,\n });\n\n const rowContentProps: RowVariantProps = {\n ...props,\n ctx,\n focusedRowId,\n drilldownRowId,\n draggableProps,\n dropIndicatorPosition,\n };\n\n return (\n <StyledFullsizeGrid\n data-testid={DATA_TESTID.DATA_TABLE_ROW}\n key={row.uid}\n colsLayoutStyle={colsLayoutStyle}\n {...userDataProperties}\n totalColumnsWidth={totalColumnsWidth}\n style={rowStyle}\n onClick={handleItemClick}\n onKeyDown={handleKeyDown}\n onBlur={handleOnBlur}\n onFocus={handleOnFocus}\n data-expandable={Boolean(row.original.tableRowDetails)}\n data-is-row-expanded={row.isExpanded}\n rows={rowsLayout}\n minHeight={minHeight}\n height={height}\n >\n {CustomRowContentRenderer ? (\n <CustomRowContentRenderer {...rowContentProps} />\n ) : (\n <DefaultRowContentRenderer {...rowContentProps} key={row.uid} />\n )}\n {shouldAppendDottedBorder && magicDottedBorder}\n <DropIndicator\n vertical={false}\n dropIndicatorPosition={dropIndicatorPosition}\n isLast={row.index === flattenedData.length - 1 && draggableProps && draggableProps.isDragging}\n />\n </StyledFullsizeGrid>\n );\n};\n\nexport { RowRenderer };\nexport default RowRenderer;\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACEA;AACA;AAEA;AAEA;AACA;AACA;AACA;AACA;AACA;AAkBA,MAAM,oBACJ,qCAAC;AAAA,EAAI,OAAM;AAAA,EAAO,QAAO;AAAA,GACvB,qCAAC;AAAA,EACC,IAAG;AAAA,EACH,IAAG;AAAA,EACH,IAAG;AAAA,EACH,IAAG;AAAA,EACH,QAAO;AAAA,EACP,aAAY;AAAA,EACZ,iBAAgB;AAAA,EAChB,kBAAiB;AAAA,EACjB,eAAc;AAAA,CAChB,CACF;AAGF,MAAM,cAAqD,CAAC,UAAU;AACpE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,aAAa,CAAC,CAAC;AAAA,IACf;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACE;AAEJ,QAAM,MAAM,WAAW,gBAAgB;AACvC,QAAM,EAAE,mBAAmB,WAAW,mBAAmB;AACzD,QAAM,EAAE,kBAAkB;AAM1B,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACE,yBAAyB;AAAA,IAC3B;AAAA,EACF,CAAC;AAMD,QAAM,EAAE,iBAAiB,eAAe,cAAc,kBAAkB,uBAAuB;AAAA,IAC7F;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,QAAM,kBAAmC,iCACpC,QADoC;AAAA,IAEvC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,SACE,qCAAC;AAAA,IACC,eAAa,YAAY;AAAA,IACzB,KAAK,IAAI;AAAA,IACT;AAAA,KACI,qBAJL;AAAA,IAKC;AAAA,IACA,OAAO;AAAA,IACP,SAAS;AAAA,IACT,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,mBAAiB,QAAQ,IAAI,SAAS,eAAe;AAAA,IACrD,wBAAsB,IAAI;AAAA,IAC1B,MAAM;AAAA,IACN;AAAA,IACA;AAAA,MAEC,2BACC,qCAAC,6CAA6B,gBAAiB,IAE/C,qCAAC,4DAA8B,kBAA9B;AAAA,IAA+C,KAAK,IAAI;AAAA,IAAK,GAE/D,4BAA4B,mBAC7B,qCAAC;AAAA,IACC,UAAU;AAAA,IACV;AAAA,IACA,QAAQ,IAAI,UAAU,cAAc,SAAS,KAAK,kBAAkB,eAAe;AAAA,GACrF,CACF;AAEJ;AAGA,IAAO,sBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,18 +2,19 @@ import * as React from "react";
|
|
|
2
2
|
import { useCallback, useContext } from "react";
|
|
3
3
|
import { DATA_TESTID } from "../../configs/constants";
|
|
4
4
|
import { DataTableContext } from "../../DataTableContext";
|
|
5
|
-
import { useDispatchRowsActions } from "../../redux/reducers";
|
|
6
5
|
const useRowRendererHandlers = ({
|
|
7
6
|
row,
|
|
8
7
|
itemIndex,
|
|
9
8
|
items,
|
|
10
9
|
draggableProps,
|
|
11
10
|
isDragOverlay,
|
|
12
|
-
|
|
11
|
+
drilldownRowId
|
|
13
12
|
}) => {
|
|
14
13
|
const {
|
|
15
14
|
tableProps: { onRowClick, onRowFocus, disabledRows },
|
|
16
|
-
virtualListHelpers: { scrollToIndex }
|
|
15
|
+
virtualListHelpers: { scrollToIndex },
|
|
16
|
+
setDrilldownRowId,
|
|
17
|
+
setFocusedRowId
|
|
17
18
|
} = useContext(DataTableContext);
|
|
18
19
|
const isOptionFocuseable = (opt) => !disabledRows[opt.uid];
|
|
19
20
|
const findInCircularList = (list, from, criteria, step = 1) => {
|
|
@@ -23,7 +24,6 @@ const useRowRendererHandlers = ({
|
|
|
23
24
|
}
|
|
24
25
|
return from;
|
|
25
26
|
};
|
|
26
|
-
const { setSelectedRowId, setFocusedRowId } = useDispatchRowsActions();
|
|
27
27
|
const handleItemClick = useCallback((e, { original, uid } = row) => {
|
|
28
28
|
if (disabledRows[uid])
|
|
29
29
|
return;
|
|
@@ -44,8 +44,8 @@ const useRowRendererHandlers = ({
|
|
|
44
44
|
}
|
|
45
45
|
if (e.code === "Enter") {
|
|
46
46
|
e.preventDefault();
|
|
47
|
-
if (
|
|
48
|
-
|
|
47
|
+
if (drilldownRowId !== row.uid) {
|
|
48
|
+
setDrilldownRowId(row.uid);
|
|
49
49
|
setTimeout(() => {
|
|
50
50
|
const focuseableCell = row.cells.find((cell) => cell.ref.current !== null);
|
|
51
51
|
if (focuseableCell)
|
|
@@ -71,9 +71,9 @@ const useRowRendererHandlers = ({
|
|
|
71
71
|
}, [
|
|
72
72
|
isDragOverlay,
|
|
73
73
|
isActive,
|
|
74
|
-
|
|
74
|
+
drilldownRowId,
|
|
75
75
|
row,
|
|
76
|
-
|
|
76
|
+
setDrilldownRowId,
|
|
77
77
|
handleItemClick,
|
|
78
78
|
items,
|
|
79
79
|
itemIndex,
|
|
@@ -82,9 +82,9 @@ const useRowRendererHandlers = ({
|
|
|
82
82
|
]);
|
|
83
83
|
const handleOnBlur = useCallback((e) => {
|
|
84
84
|
if (e.relatedTarget?.getAttribute("data-testid") === "data-table-row-content") {
|
|
85
|
-
|
|
85
|
+
setDrilldownRowId(null);
|
|
86
86
|
}
|
|
87
|
-
}, [
|
|
87
|
+
}, [setDrilldownRowId]);
|
|
88
88
|
const handleOnFocus = useCallback((e) => {
|
|
89
89
|
if (!disabledRows[row.uid] && e.target && e.target.getAttribute("data-testid") === DATA_TESTID.DATA_TABLE_ROW_CONTENT) {
|
|
90
90
|
setFocusedRowId(row.uid);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/RowRenderer/useRowRendererHandlers.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\nimport React, { useCallback, useContext } from 'react';\nimport { DATA_TESTID } from '../../configs/constants';\nimport { DataTableContext } from '../../DataTableContext';\nimport { SortableItemContextType } from '../../parts/HoC/SortableItemContext';\nimport {
|
|
5
|
-
"mappings": "AAAA;ACCA;AACA;AACA;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\nimport React, { useCallback, useContext } from 'react';\nimport { DATA_TESTID } from '../../configs/constants';\nimport { DataTableContext } from '../../DataTableContext';\nimport { SortableItemContextType } from '../../parts/HoC/SortableItemContext';\nimport { TypescriptRow } from '../../types/props';\n\nexport const useRowRendererHandlers = ({\n row,\n itemIndex,\n items,\n draggableProps,\n isDragOverlay,\n drilldownRowId,\n}: {\n row: TypescriptRow;\n itemIndex: number;\n items: TypescriptRow[];\n draggableProps: SortableItemContextType['draggableProps'];\n isDragOverlay: boolean;\n drilldownRowId: string | null;\n}): {\n handleItemClick: React.MouseEventHandler;\n handleKeyDown: React.KeyboardEventHandler;\n handleOnBlur: React.FocusEventHandler;\n handleOnFocus: React.FocusEventHandler;\n} => {\n const {\n tableProps: { onRowClick, onRowFocus, disabledRows },\n virtualListHelpers: { scrollToIndex },\n setDrilldownRowId,\n setFocusedRowId,\n } = useContext(DataTableContext);\n\n const isOptionFocuseable = (opt): boolean => !disabledRows[opt.uid];\n\n const findInCircularList = (\n list,\n from: number,\n criteria: (item) => boolean,\n step = 1,\n // eslint-disable-next-line max-params\n ): number => {\n for (\n let i = (from + step + list.length) % list.length;\n i !== from && from > -1;\n i = (i + step + list.length) % list.length\n ) {\n if (criteria(list[i])) return i;\n }\n return from; // return same item\n };\n\n const handleItemClick = useCallback(\n (e, { original, uid } = row) => {\n if (disabledRows[uid]) return;\n onRowClick(original, e, uid);\n onRowFocus(\n {\n itemIndex,\n scrollToItem: (\n opts: { align: 'auto' | 'start' | 'center' | 'end' } = {\n align: 'start',\n },\n ) => scrollToIndex(itemIndex, opts),\n original,\n },\n e,\n );\n },\n [row, disabledRows, onRowClick, onRowFocus, itemIndex, scrollToIndex],\n );\n\n const isActive = draggableProps && draggableProps.active;\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (isDragOverlay || isActive) {\n e.preventDefault();\n return;\n }\n if (e.code === 'Enter') {\n e.preventDefault();\n if (drilldownRowId !== row.uid) {\n setDrilldownRowId(row.uid);\n setTimeout(() => {\n const focuseableCell = row.cells.find((cell) => cell.ref.current !== null);\n if (focuseableCell) focuseableCell.ref.current.focus();\n });\n }\n }\n if (e.code === 'Space') {\n e.preventDefault();\n handleItemClick(e, row);\n }\n if (e.code === 'ArrowDown') {\n e.preventDefault();\n e.stopPropagation();\n const next = findInCircularList(items, itemIndex, isOptionFocuseable);\n setFocusedRowId(items[next].uid);\n }\n if (e.code === 'ArrowUp') {\n e.preventDefault();\n const prev = findInCircularList(items, itemIndex, isOptionFocuseable, -1);\n setFocusedRowId(items[prev].uid);\n }\n },\n [\n isDragOverlay,\n isActive,\n drilldownRowId,\n row,\n setDrilldownRowId,\n handleItemClick,\n items,\n itemIndex,\n isOptionFocuseable,\n setFocusedRowId,\n ],\n );\n\n const handleOnBlur = useCallback(\n (e) => {\n if (e.relatedTarget?.getAttribute('data-testid') === 'data-table-row-content') {\n setDrilldownRowId(null);\n }\n },\n [setDrilldownRowId],\n );\n\n const handleOnFocus: React.FocusEventHandler = useCallback(\n (e) => {\n if (\n !disabledRows[row.uid] &&\n e.target &&\n e.target.getAttribute('data-testid') === DATA_TESTID.DATA_TABLE_ROW_CONTENT\n ) {\n setFocusedRowId(row.uid);\n }\n },\n [row.uid, setFocusedRowId, disabledRows],\n );\n\n return { handleItemClick, handleKeyDown, handleOnBlur, handleOnFocus };\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACCA;AACA;AACA;AAIO,MAAM,yBAAyB,CAAC;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,MAaG;AACH,QAAM;AAAA,IACJ,YAAY,EAAE,YAAY,YAAY;AAAA,IACtC,oBAAoB,EAAE;AAAA,IACtB;AAAA,IACA;AAAA,MACE,WAAW,gBAAgB;AAE/B,QAAM,qBAAqB,CAAC,QAAiB,CAAC,aAAa,IAAI;AAE/D,QAAM,qBAAqB,CACzB,MACA,MACA,UACA,OAAO,MAEI;AACX,aACM,IAAK,QAAO,OAAO,KAAK,UAAU,KAAK,QAC3C,MAAM,QAAQ,OAAO,IACrB,IAAK,KAAI,OAAO,KAAK,UAAU,KAAK,QACpC;AACA,UAAI,SAAS,KAAK,EAAE;AAAG,eAAO;AAAA,IAChC;AACA,WAAO;AAAA,EACT;AAEA,QAAM,kBAAkB,YACtB,CAAC,GAAG,EAAE,UAAU,QAAQ,QAAQ;AAC9B,QAAI,aAAa;AAAM;AACvB,eAAW,UAAU,GAAG,GAAG;AAC3B,eACE;AAAA,MACE;AAAA,MACA,cAAc,CACZ,OAAuD;AAAA,QACrD,OAAO;AAAA,MACT,MACG,cAAc,WAAW,IAAI;AAAA,MAClC;AAAA,IACF,GACA,CACF;AAAA,EACF,GACA,CAAC,KAA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AE,OAAO,aAAa,aAAa,MAAM,YAAY,wBACrD;AACA,sBAAgB,IAAI,GAAG;AAAA,IACzB;AAAA,EACF,GACA,CAAC,IAAI,KAAK,iBAAiB,YAAY,CACzC;AAEA,SAAO,EAAE,iBAAiB,eAAe,cAAc,cAAc;AACvE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
import * as React from "react";
|
|
21
|
-
import React2, { useCallback } from "react";
|
|
21
|
+
import React2, { useCallback, useContext } from "react";
|
|
22
22
|
import {
|
|
23
23
|
DateRangeFilter,
|
|
24
24
|
DateSwitcherFilter,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
CurrencyRangeFilter
|
|
30
30
|
} from "../../addons/Filters";
|
|
31
31
|
import { FILTER_TYPES } from "../../exported-related";
|
|
32
|
-
import
|
|
32
|
+
import DataTableContext from "../../DataTableContext";
|
|
33
33
|
const FilterMapper = {
|
|
34
34
|
[FILTER_TYPES.SELECT]: SingleSelectFilter,
|
|
35
35
|
[FILTER_TYPES.MULTI_SELECT]: MultiSelectFilter,
|
|
@@ -41,7 +41,7 @@ const FilterMapper = {
|
|
|
41
41
|
};
|
|
42
42
|
const FilterMapItem = (props) => {
|
|
43
43
|
const { column, filterValue: filters, onFiltersChange } = props;
|
|
44
|
-
const { patchHeaderFilterButtonAndMenu, patchHeader } =
|
|
44
|
+
const { patchHeaderFilterButtonAndMenu, patchHeader } = useContext(DataTableContext);
|
|
45
45
|
const filterValue = filters.find((filter) => filter.id === column.id);
|
|
46
46
|
const onValueChange = useCallback((type, newValue) => {
|
|
47
47
|
const filterIndex = filters.findIndex((filter) => filter.id === column.id);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/Filters/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/indent */\n/* eslint-disable react/prop-types */\nimport React, { useCallback } from 'react';\nimport {\n DateRangeFilter,\n DateSwitcherFilter,\n NumberRangeFilter,\n MultiSelectFilter,\n SingleSelectFilter,\n SingleDateFilter,\n CurrencyRangeFilter,\n} from '../../addons/Filters';\nimport { FILTER_TYPES } from '../../exported-related';\nimport
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACEA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA;AACA;AAGA,MAAM,eAAiE;AAAA,GACpE,aAAa,SAAS;AAAA,GACtB,aAAa,eAAe;AAAA,GAC5B,aAAa,cAAc;AAAA,GAC3B,aAAa,aAAa;AAAA,GAC1B,aAAa,gBAAgB;AAAA,GAC7B,aAAa,eAAe;AAAA,GAC5B,aAAa,iBAAiB;AACjC;AACO,MAAM,gBAET,CAAC,UAAU;AACb,QAAM,EAAE,QAAQ,aAAa,SAAS,oBAAoB;AAE1D,QAAM,EAAE,gCAAgC,gBAAgB,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/indent */\n/* eslint-disable react/prop-types */\nimport React, { useCallback, useContext } from 'react';\nimport {\n DateRangeFilter,\n DateSwitcherFilter,\n NumberRangeFilter,\n MultiSelectFilter,\n SingleSelectFilter,\n SingleDateFilter,\n CurrencyRangeFilter,\n} from '../../addons/Filters';\nimport { FILTER_TYPES } from '../../exported-related';\nimport DataTableContext from '../../DataTableContext';\nimport { FilterProps } from '../../types/props';\n\nconst FilterMapper: Record<string, React.ComponentType<FilterProps>> = {\n [FILTER_TYPES.SELECT]: SingleSelectFilter,\n [FILTER_TYPES.MULTI_SELECT]: MultiSelectFilter,\n [FILTER_TYPES.SINGLE_DATE]: SingleDateFilter,\n [FILTER_TYPES.DATE_RANGE]: DateRangeFilter,\n [FILTER_TYPES.DATE_SWITCHER]: DateSwitcherFilter,\n [FILTER_TYPES.NUMBER_RANGE]: NumberRangeFilter,\n [FILTER_TYPES.CURRENCY_RANGE]: CurrencyRangeFilter,\n};\nexport const FilterMapItem: React.ComponentType<\n Omit<FilterProps, 'patchHeaderFilterButtonAndMenu' | 'patchHeader' | 'onValueChange'>\n> = (props) => {\n const { column, filterValue: filters, onFiltersChange } = props;\n\n const { patchHeaderFilterButtonAndMenu, patchHeader } = useContext(DataTableContext);\n\n const filterValue = filters.find((filter) => filter.id === column.id);\n\n const onValueChange = useCallback(\n (type: string, newValue: any) => {\n const filterIndex = filters.findIndex((filter) => filter.id === column.id);\n if (newValue === undefined) {\n const newFilters = filters.filter((filter) => filter.id !== column.id);\n onFiltersChange(newFilters);\n } else if (filterIndex === -1) {\n onFiltersChange([...filters, { id: column.id, type, value: newValue }]);\n } else {\n const newFilters = [...filters];\n newFilters[filterIndex].type = type;\n newFilters[filterIndex].value = newValue;\n onFiltersChange(newFilters);\n }\n },\n [column.id, filters, onFiltersChange],\n );\n\n const filterProps = {\n ...props,\n filterValue: filterValue?.value,\n onValueChange,\n patchHeader,\n patchHeaderFilterButtonAndMenu,\n };\n\n if (typeof column.filter === 'string') {\n if (!(column.filter in FilterMapper)) {\n throw new Error(`column.filter must be a supported out-of-the-box filter in ${column}`);\n }\n const FilterComp = FilterMapper[column.filter];\n return <FilterComp {...filterProps} />;\n }\n\n if (column.Filter) {\n if (typeof column.Filter !== 'function') {\n throw new Error(`column.Filter must be a component`);\n }\n const FilterComp = column.Filter;\n return <FilterComp {...filterProps} />;\n }\n\n // Column doesn't have any filters\n return null;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACEA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA;AACA;AAGA,MAAM,eAAiE;AAAA,GACpE,aAAa,SAAS;AAAA,GACtB,aAA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YAAY;AACvC,YAAM,IAAI,MAAM,mCAAmC;AAAA,IACrD;AACA,UAAM,aAAa,OAAO;AAC1B,WAAO,qCAAC,+BAAe,YAAa;AAAA,EACtC;AAGA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -19,9 +19,7 @@ var __spreadValues = (a, b) => {
|
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
import * as React from "react";
|
|
21
21
|
import React2, { useContext, useMemo, useRef } from "react";
|
|
22
|
-
import { connect } from "react-redux";
|
|
23
22
|
import { Grid } from "@elliemae/ds-grid";
|
|
24
|
-
import { useDispatchHeadersActions } from "../../redux/reducers";
|
|
25
23
|
import { StyledHeadTh, StyledHeaderRightIconsWrapper, StyledFocusWithin } from "../../styled";
|
|
26
24
|
import { DataTableContext } from "../../DataTableContext";
|
|
27
25
|
import { SortByCaret } from "../SortByCaret";
|
|
@@ -46,20 +44,16 @@ const buildScreenReaderInstructions = (colSpan, draggable, filterable, sortable)
|
|
|
46
44
|
}
|
|
47
45
|
return `${preffix}${message}`;
|
|
48
46
|
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
reduxHeader: state.headers?.[ownProps.column.id]
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
const connector = connect(mapStateToProps);
|
|
55
|
-
const HeaderCellComp = (props) => {
|
|
56
|
-
const { reduxHeader, column, isDragOverlay, colSpan } = props;
|
|
47
|
+
const HeaderCell = (props) => {
|
|
48
|
+
const { column, isDragOverlay, colSpan } = props;
|
|
57
49
|
const ctx = useContext(DataTableContext);
|
|
58
50
|
const {
|
|
59
51
|
tableProps: { isResizeable, onColumnSortChange, dragAndDropColumns, onFiltersChange, filters, textWrap },
|
|
60
|
-
flattenedData
|
|
52
|
+
flattenedData,
|
|
53
|
+
reduxHeaders,
|
|
54
|
+
patchHeader
|
|
61
55
|
} = ctx;
|
|
62
|
-
const
|
|
56
|
+
const reduxHeader = useMemo(() => reduxHeaders[column.id], [reduxHeaders, column]);
|
|
63
57
|
const dragHandleRef = useRef(null);
|
|
64
58
|
const filterIconRef = useRef(null);
|
|
65
59
|
const { draggableProps } = useContext(SortableItemContext);
|
|
@@ -139,7 +133,6 @@ const HeaderCellComp = (props) => {
|
|
|
139
133
|
"aria-hidden": "false"
|
|
140
134
|
}, buildScreenReaderInstructions(colSpan, dragAndDropColumns && column.disableDnD !== true, hasFilter, column.canSort)));
|
|
141
135
|
};
|
|
142
|
-
const HeaderCell = connector(HeaderCellComp);
|
|
143
136
|
export {
|
|
144
137
|
HeaderCell
|
|
145
138
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/Headers/HeaderCell.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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 {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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 hasFil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O,cAAc,SAAS,qCAAC;AAAA,IAAc;AAAA,GAAgB,CAChF,GACA,qCAAC;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;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/parts/Row.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import React2, { useContext } from "react";
|
|
3
|
-
import { connect } from "react-redux";
|
|
4
3
|
import { styled } from "@elliemae/ds-system";
|
|
5
4
|
import DataTableContext from "../DataTableContext";
|
|
6
5
|
import { setMultipleRefs } from "../helpers";
|
|
@@ -18,11 +17,13 @@ const setItemRefs = (measureRef, draggableRef, ref) => {
|
|
|
18
17
|
const StyledRow = styled("div")`
|
|
19
18
|
cursor: ${({ disabled }) => disabled ? "not-allowed" : "normal"};
|
|
20
19
|
`;
|
|
21
|
-
const
|
|
22
|
-
const { row, measureRef, itemWrapperStyle, isDragOverlay
|
|
20
|
+
const Row = (props) => {
|
|
21
|
+
const { row, measureRef, itemWrapperStyle, isDragOverlay } = props;
|
|
23
22
|
const ctx = useContext(DataTableContext);
|
|
24
23
|
const {
|
|
25
|
-
tableProps: { disabledRows }
|
|
24
|
+
tableProps: { disabledRows },
|
|
25
|
+
focusedRowId,
|
|
26
|
+
drilldownRowId
|
|
26
27
|
} = ctx;
|
|
27
28
|
const { draggableProps } = useContext(SortableItemContext);
|
|
28
29
|
const draggableRef = draggableProps && draggableProps.setNodeRef;
|
|
@@ -36,14 +37,9 @@ const RowComp = (props) => {
|
|
|
36
37
|
isDragOverlay,
|
|
37
38
|
ctx,
|
|
38
39
|
focusedRowId,
|
|
39
|
-
|
|
40
|
+
drilldownRowId
|
|
40
41
|
}));
|
|
41
42
|
};
|
|
42
|
-
const mapStateToProps = (state) => ({
|
|
43
|
-
focusedRowId: state.rows.focusedRowId,
|
|
44
|
-
selectedRowId: state.rows.selectedRowId
|
|
45
|
-
});
|
|
46
|
-
const Row = connect(mapStateToProps)(RowComp);
|
|
47
43
|
const RowWithContext = withDnDSortableRowContext(Row);
|
|
48
44
|
var Row_default = RowWithContext;
|
|
49
45
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/Row.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React, { useContext } from 'react';\nimport {
|
|
5
|
-
"mappings": "AAAA;ACCA;AACA;AACA;AACA;AACA;AACA;AACA;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React, { useContext } from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport DataTableContext from '../DataTableContext';\nimport { setMultipleRefs } from '../helpers';\nimport { SortableItemContext } from './HoC/SortableItemContext';\nimport { withDnDSortableRowContext } from './HoC/withDnDSortableRowContext';\nimport { RowVariantMapItem } from './RowVariants';\n\n// Sortable Items needs to update\n// - the virtual list ref (for react-virtual requirement)\n// - (conditionally) draggableProps.setNodeRef for drag and drop of rows\nconst setItemRefs = (measureRef, draggableRef, ref) => {\n const refsToSet = [];\n if (measureRef) refsToSet.push(measureRef);\n if (draggableRef) refsToSet.push(draggableRef);\n setMultipleRefs(...refsToSet)(ref);\n};\n\nconst StyledRow = styled('div')`\n cursor: ${({ disabled }) => (disabled ? 'not-allowed' : 'normal')};\n`;\n\nexport const Row = (props) => {\n const { row, measureRef, itemWrapperStyle, isDragOverlay } = props;\n\n const ctx = useContext(DataTableContext);\n const {\n tableProps: { disabledRows },\n focusedRowId,\n drilldownRowId,\n } = ctx;\n const { draggableProps } = useContext(SortableItemContext);\n const draggableRef = draggableProps && draggableProps.setNodeRef;\n return (\n <StyledRow\n disabled={disabledRows[row.uid]}\n style={!isDragOverlay ? itemWrapperStyle : {}}\n ref={(ref) => setItemRefs(measureRef, draggableRef, ref)}\n >\n <RowVariantMapItem\n row={row}\n itemIndex={row.realIndex}\n isDragOverlay={isDragOverlay}\n ctx={ctx}\n focusedRowId={focusedRowId}\n drilldownRowId={drilldownRowId}\n />\n </StyledRow>\n );\n};\n\nconst RowWithContext = withDnDSortableRowContext(Row);\nexport { RowWithContext };\nexport default RowWithContext;\n"],
|
|
5
|
+
"mappings": "AAAA;ACCA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA,MAAM,cAAc,CAAC,YAAY,cAAc,QAAQ;AACrD,QAAM,YAAY,CAAC;AACnB,MAAI;AAAY,cAAU,KAAK,UAAU;AACzC,MAAI;AAAc,cAAU,KAAK,YAAY;AAC7C,kBAAgB,GAAG,SAAS,EAAE,GAAG;AACnC;AAEA,MAAM,YAAY,OAAO,KAAK;AAAA,YAClB,CAAC,EAAE,eAAgB,WAAW,gBAAgB;AAAA;AAGnD,MAAM,MAAM,CAAC,UAAU;AAC5B,QAAM,EAAE,KAAK,YAAY,kBAAkB,kBAAkB;AAE7D,QAAM,MAAM,WAAW,gBAAgB;AACvC,QAAM;AAAA,IACJ,YAAY,EAAE;AAAA,IACd;AAAA,IACA;AAAA,MACE;AACJ,QAAM,EAAE,mBAAmB,WAAW,mBAAmB;AACzD,QAAM,eAAe,kBAAkB,eAAe;AACtD,SACE,qCAAC;AAAA,IACC,UAAU,aAAa,IAAI;AAAA,IAC3B,OAAO,CAAC,gBAAgB,mBAAmB,CAAC;AAAA,IAC5C,KAAK,CAAC,QAAQ,YAAY,YAAY,cAAc,GAAG;AAAA,KAEvD,qCAAC;AAAA,IACC;AAAA,IACA,WAAW,IAAI;AAAA,IACf;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,GACF,CACF;AAEJ;AAEA,MAAM,iBAAiB,0BAA0B,GAAG;AAEpD,IAAO,cAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -14,7 +14,7 @@ const RowContent = (props) => {
|
|
|
14
14
|
},
|
|
15
15
|
backgroundColor = "white",
|
|
16
16
|
focusedRowId,
|
|
17
|
-
|
|
17
|
+
drilldownRowId
|
|
18
18
|
} = props;
|
|
19
19
|
const rowRef = useRef(null);
|
|
20
20
|
const hasExpandCell = useMemo(() => row.original.subRows && row.cells.find((cell) => cell.column.accessor === "expandRowColumn"), [row]);
|
|
@@ -42,7 +42,7 @@ const RowContent = (props) => {
|
|
|
42
42
|
}, hasExpandCell ? /* @__PURE__ */ React2.createElement(expandRowColumn.Cell, {
|
|
43
43
|
row,
|
|
44
44
|
cell: row.cells[0],
|
|
45
|
-
isRowSelected:
|
|
45
|
+
isRowSelected: drilldownRowId === row.uid,
|
|
46
46
|
ctx,
|
|
47
47
|
draggableProps: {}
|
|
48
48
|
}) : /* @__PURE__ */ React2.createElement(Grid, {
|
|
@@ -54,7 +54,7 @@ const RowVariantHeader = ({
|
|
|
54
54
|
itemIndex,
|
|
55
55
|
isDragOverlay,
|
|
56
56
|
focusedRowId,
|
|
57
|
-
|
|
57
|
+
drilldownRowId
|
|
58
58
|
}) => /* @__PURE__ */ React2.createElement(RowRenderer, {
|
|
59
59
|
row,
|
|
60
60
|
itemIndex,
|
|
@@ -63,7 +63,7 @@ const RowVariantHeader = ({
|
|
|
63
63
|
height: "24px",
|
|
64
64
|
CustomRowContentRenderer: RowContent,
|
|
65
65
|
focusedRowId,
|
|
66
|
-
|
|
66
|
+
drilldownRowId
|
|
67
67
|
});
|
|
68
68
|
export {
|
|
69
69
|
RowVariantHeader
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/RowVariants/RowVariantHeader.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React, { useLayoutEffect, useMemo, useRef } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { RowRenderer } from '../../exported-related/RowRenderer';\nimport { GroupHeaderContainer, GroupHeaderTitle, StyledCellContainer } from '../../styled';\nimport { RowVariantProps } from './types';\nimport { expandRowColumn } from '../../addons/Columns';\nimport { DATA_TESTID } from '../../configs/constants';\n\nconst RowContent: React.ComponentType<RowVariantProps> = (props) => {\n const {\n row,\n ctx,\n ctx: {\n tableProps: { groupedRowsRenderHeader },\n },\n backgroundColor = 'white',\n focusedRowId,\n
|
|
5
|
-
"mappings": "AAAA;ACCA;AACA;AACA;AACA;AAEA;AACA;AAEA,MAAM,aAAmD,CAAC,UAAU;AAClE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,KAAK;AAAA,MACH,YAAY,EAAE;AAAA;AAAA,IAEhB,kBAAkB;AAAA,IAClB;AAAA,IACA;AAAA,MACE;AAEJ,QAAM,SAAS,OAAuB,IAAI;AAE1C,QAAM,gBAAgB,QACpB,MAAM,IAAI,SAAS,WAAW,IAAI,MAAM,KAAK,CAAC,SAAS,KAAK,OAAO,aAAa,iBAAiB,GACjG,CAAC,GAAG,CACN;AAEA,QAAM,eAAe,QAAQ,MAAM;AACjC,QAAI,OAAO,4BAA4B,YAAY;AACjD,aAAO,wBAAwB,IAAI,SAAS,mBAAmB,IAAI,SAAS,OAAO;AAAA,IACrF;AACA,WAAO,IAAI,SAAS;AAAA,EACtB,GAAG,CAAC,yBAAyB,GAAG,CAAC;AAEjC,kBAAgB,MAAM;AACpB,QAAI,IAAI,QAAQ,cAAc;AAC5B,aAAO,QAAQ,MAAM;AAAA,IACvB;AAAA,EACF,GAAG,CAAC,cAAc,IAAI,GAAG,CAAC;AAE1B,SACE,qCAAC;AAAA,IACC,KAAK;AAAA,IACL,WAAU;AAAA,IACV,UAAU;AAAA,IACV;AAAA,IACA,eAAa,YAAY;AAAA,KAEzB,qCAAC;AAAA,IACC,eAAa,YAAY;AAAA,IACzB,MAAM,gBAAgB,CAAC,eAAe,MAAM,IAAI,CAAC,MAAM;AAAA,IACvD,SAAS,gBAAgB,QAAQ;AAAA,KAEhC,gBACC,qCAAC,gBAAgB,MAAhB;AAAA,IACC;AAAA,IACA,MAAM,IAAI,MAAM;AAAA,IAChB,eAAe,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React, { useLayoutEffect, useMemo, useRef } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { RowRenderer } from '../../exported-related/RowRenderer';\nimport { GroupHeaderContainer, GroupHeaderTitle, StyledCellContainer } from '../../styled';\nimport { RowVariantProps } from './types';\nimport { expandRowColumn } from '../../addons/Columns';\nimport { DATA_TESTID } from '../../configs/constants';\n\nconst RowContent: React.ComponentType<RowVariantProps> = (props) => {\n const {\n row,\n ctx,\n ctx: {\n tableProps: { groupedRowsRenderHeader },\n },\n backgroundColor = 'white',\n focusedRowId,\n drilldownRowId,\n } = props;\n\n const rowRef = useRef<HTMLDivElement>(null);\n\n const hasExpandCell = useMemo(\n () => row.original.subRows && row.cells.find((cell) => cell.column.accessor === 'expandRowColumn'),\n [row],\n );\n\n const titleContent = useMemo(() => {\n if (typeof groupedRowsRenderHeader === 'function') {\n return groupedRowsRenderHeader(row.original.dimsumHeaderValue, row.original.subRows);\n }\n return row.original.dimsumHeaderValue;\n }, [groupedRowsRenderHeader, row]);\n\n useLayoutEffect(() => {\n if (row.uid === focusedRowId) {\n rowRef.current.focus();\n }\n }, [focusedRowId, row.uid]);\n\n return (\n <StyledCellContainer\n ref={rowRef}\n minHeight=\"0px\"\n tabIndex={0}\n backgroundColor={backgroundColor}\n data-testid={DATA_TESTID.DATA_TABLE_ROW_HEADER_CONTENT}\n >\n <GroupHeaderContainer\n data-testid={DATA_TESTID.DATA_TABLE_ROW_GROUP_HEADER}\n cols={hasExpandCell ? ['min-content', 'auto'] : ['auto']}\n padding={hasExpandCell ? '4px' : '16px'}\n >\n {hasExpandCell ? (\n <expandRowColumn.Cell\n row={row}\n cell={row.cells[0]}\n isRowSelected={drilldownRowId === row.uid}\n ctx={ctx}\n draggableProps={{}}\n />\n ) : (\n <Grid width=\"16px\" />\n )}\n <GroupHeaderTitle>{titleContent}</GroupHeaderTitle>\n </GroupHeaderContainer>\n </StyledCellContainer>\n );\n};\n\nexport const RowVariantHeader: React.ComponentType<RowVariantProps> = ({\n row,\n itemIndex,\n isDragOverlay,\n focusedRowId,\n drilldownRowId,\n}) => (\n <RowRenderer\n row={row}\n itemIndex={itemIndex}\n isDragOverlay={isDragOverlay}\n minHeight=\"0px\"\n height=\"24px\"\n CustomRowContentRenderer={RowContent}\n focusedRowId={focusedRowId}\n drilldownRowId={drilldownRowId}\n />\n);\n"],
|
|
5
|
+
"mappings": "AAAA;ACCA;AACA;AACA;AACA;AAEA;AACA;AAEA,MAAM,aAAmD,CAAC,UAAU;AAClE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,KAAK;AAAA,MACH,YAAY,EAAE;AAAA;AAAA,IAEhB,kBAAkB;AAAA,IAClB;AAAA,IACA;AAAA,MACE;AAEJ,QAAM,SAAS,OAAuB,IAAI;AAE1C,QAAM,gBAAgB,QACpB,MAAM,IAAI,SAAS,WAAW,IAAI,MAAM,KAAK,CAAC,SAAS,KAAK,OAAO,aAAa,iBAAiB,GACjG,CAAC,GAAG,CACN;AAEA,QAAM,eAAe,QAAQ,MAAM;AACjC,QAAI,OAAO,4BAA4B,YAAY;AACjD,aAAO,wBAAwB,IAAI,SAAS,mBAAmB,IAAI,SAAS,OAAO;AAAA,IACrF;AACA,WAAO,IAAI,SAAS;AAAA,EACtB,GAAG,CAAC,yBAAyB,GAAG,CAAC;AAEjC,kBAAgB,MAAM;AACpB,QAAI,IAAI,QAAQ,cAAc;AAC5B,aAAO,QAAQ,MAAM;AAAA,IACvB;AAAA,EACF,GAAG,CAAC,cAAc,IAAI,GAAG,CAAC;AAE1B,SACE,qCAAC;AAAA,IACC,KAAK;AAAA,IACL,WAAU;AAAA,IACV,UAAU;AAAA,IACV;AAAA,IACA,eAAa,YAAY;AAAA,KAEzB,qCAAC;AAAA,IACC,eAAa,YAAY;AAAA,IACzB,MAAM,gBAAgB,CAAC,eAAe,MAAM,IAAI,CAAC,MAAM;AAAA,IACvD,SAAS,gBAAgB,QAAQ;AAAA,KAEhC,gBACC,qCAAC,gBAAgB,MAAhB;AAAA,IACC;AAAA,IACA,MAAM,IAAI,MAAM;AAAA,IAChB,eAAe,mBAAmB,IAAI;AAAA,IACtC;AAAA,IACA,gBAAgB,CAAC;AAAA,GACnB,IAEA,qCAAC;AAAA,IAAK,OAAM;AAAA,GAAO,GAErB,qCAAC,wBAAkB,YAAa,CAClC,CACF;AAEJ;AAEO,MAAM,mBAAyD,CAAC;AAAA,EACrE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,MAEA,qCAAC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAU;AAAA,EACV,QAAO;AAAA,EACP,0BAA0B;AAAA,EAC1B;AAAA,EACA;AAAA,CACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -7,7 +7,7 @@ const RowVariantPrimary = ({
|
|
|
7
7
|
isDragOverlay,
|
|
8
8
|
ctx,
|
|
9
9
|
focusedRowId,
|
|
10
|
-
|
|
10
|
+
drilldownRowId,
|
|
11
11
|
compact
|
|
12
12
|
}) => {
|
|
13
13
|
const {
|
|
@@ -23,7 +23,7 @@ const RowVariantPrimary = ({
|
|
|
23
23
|
colsLayout: row.isExpanded ? void 0 : gridLayout,
|
|
24
24
|
rowsLayout: row.isExpanded ? ["auto", "auto"] : [1],
|
|
25
25
|
focusedRowId,
|
|
26
|
-
|
|
26
|
+
drilldownRowId
|
|
27
27
|
});
|
|
28
28
|
};
|
|
29
29
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/RowVariants/RowVariantPrimary.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React from 'react';\nimport { RowVariantProps } from './types';\nimport { RowRenderer } from '../../exported-related/RowRenderer';\n\nexport const RowVariantPrimary: React.ComponentType<RowVariantProps> = ({\n row,\n itemIndex,\n isDragOverlay,\n ctx,\n focusedRowId,\n
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React from 'react';\nimport { RowVariantProps } from './types';\nimport { RowRenderer } from '../../exported-related/RowRenderer';\n\nexport const RowVariantPrimary: React.ComponentType<RowVariantProps> = ({\n row,\n itemIndex,\n isDragOverlay,\n ctx,\n focusedRowId,\n drilldownRowId,\n compact,\n}) => {\n const {\n layoutHelpers: { gridLayout },\n } = ctx;\n\n return (\n <RowRenderer\n row={row}\n itemIndex={itemIndex}\n isDragOverlay={isDragOverlay}\n compact={compact}\n height={compact ? '24px' : 'auto'}\n minHeight={compact ? '24px' : '36px'}\n colsLayout={row.isExpanded ? undefined : gridLayout}\n rowsLayout={row.isExpanded ? ['auto', 'auto'] : [1]}\n focusedRowId={focusedRowId}\n drilldownRowId={drilldownRowId}\n />\n );\n};\n"],
|
|
5
5
|
"mappings": "AAAA;ACCA;AAEA;AAEO,MAAM,oBAA0D,CAAC;AAAA,EACtE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,MACI;AACJ,QAAM;AAAA,IACJ,eAAe,EAAE;AAAA,MACf;AAEJ,SACE,qCAAC;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ,UAAU,SAAS;AAAA,IAC3B,WAAW,UAAU,SAAS;AAAA,IAC9B,YAAY,IAAI,aAAa,SAAY;AAAA,IACzC,YAAY,IAAI,aAAa,CAAC,QAAQ,MAAM,IAAI,CAAC,CAAC;AAAA,IAClD;AAAA,IACA;AAAA,GACF;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -7,7 +7,7 @@ const RowVariantSecondary = ({
|
|
|
7
7
|
isDragOverlay,
|
|
8
8
|
ctx,
|
|
9
9
|
focusedRowId,
|
|
10
|
-
|
|
10
|
+
drilldownRowId,
|
|
11
11
|
compact
|
|
12
12
|
}) => {
|
|
13
13
|
const {
|
|
@@ -24,7 +24,7 @@ const RowVariantSecondary = ({
|
|
|
24
24
|
rowsLayout: row.isExpanded ? ["auto", "auto"] : [1],
|
|
25
25
|
backgroundColor: "#F6F7F9",
|
|
26
26
|
focusedRowId,
|
|
27
|
-
|
|
27
|
+
drilldownRowId
|
|
28
28
|
});
|
|
29
29
|
};
|
|
30
30
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/RowVariants/RowVariantSecondary.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React from 'react';\nimport { RowVariantProps } from './types';\nimport { RowRenderer } from '../../exported-related/RowRenderer';\n\nexport const RowVariantSecondary: React.ComponentType<RowVariantProps> = ({\n row,\n itemIndex,\n isDragOverlay,\n ctx,\n focusedRowId,\n
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React from 'react';\nimport { RowVariantProps } from './types';\nimport { RowRenderer } from '../../exported-related/RowRenderer';\n\nexport const RowVariantSecondary: React.ComponentType<RowVariantProps> = ({\n row,\n itemIndex,\n isDragOverlay,\n ctx,\n focusedRowId,\n drilldownRowId,\n compact,\n}) => {\n const {\n layoutHelpers: { gridLayout },\n } = ctx;\n\n return (\n <RowRenderer\n row={row}\n itemIndex={itemIndex}\n isDragOverlay={isDragOverlay}\n compact={compact}\n height={compact ? '24px' : 'auto'}\n minHeight={compact ? '24px' : '36px'}\n colsLayout={row.isExpanded ? undefined : gridLayout}\n rowsLayout={row.isExpanded ? ['auto', 'auto'] : [1]}\n backgroundColor=\"#F6F7F9\"\n focusedRowId={focusedRowId}\n drilldownRowId={drilldownRowId}\n />\n );\n};\n"],
|
|
5
5
|
"mappings": "AAAA;ACCA;AAEA;AAEO,MAAM,sBAA4D,CAAC;AAAA,EACxE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,MACI;AACJ,QAAM;AAAA,IACJ,eAAe,EAAE;AAAA,MACf;AAEJ,SACE,qCAAC;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ,UAAU,SAAS;AAAA,IAC3B,WAAW,UAAU,SAAS;AAAA,IAC9B,YAAY,IAAI,aAAa,SAAY;AAAA,IACzC,YAAY,IAAI,aAAa,CAAC,QAAQ,MAAM,IAAI,CAAC,CAAC;AAAA,IAClD,iBAAgB;AAAA,IAChB;AAAA,IACA;AAAA,GACF;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -33,7 +33,7 @@ const RowVariantSkeleton = ({
|
|
|
33
33
|
itemIndex,
|
|
34
34
|
isDragOverlay,
|
|
35
35
|
focusedRowId,
|
|
36
|
-
|
|
36
|
+
drilldownRowId
|
|
37
37
|
}) => {
|
|
38
38
|
const newCells = row.cells.map((cell) => __spreadProps(__spreadValues({}, cell), {
|
|
39
39
|
render: RandomSkeleton
|
|
@@ -45,7 +45,7 @@ const RowVariantSkeleton = ({
|
|
|
45
45
|
minHeight: "0px",
|
|
46
46
|
height: "36px",
|
|
47
47
|
focusedRowId,
|
|
48
|
-
|
|
48
|
+
drilldownRowId
|
|
49
49
|
});
|
|
50
50
|
};
|
|
51
51
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/RowVariants/RowVariantSkeleton.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useMemo } from 'react';\nimport { DSSkeleton } from '@elliemae/ds-skeleton';\nimport { RowRenderer } from '../../exported-related/RowRenderer';\nimport { RowVariantProps } from './types';\n\nconst RandomSkeleton = () => {\n const randomPercentage = useMemo(() => Math.floor(Math.random() * 70 + 30), []);\n return <DSSkeleton w={`${randomPercentage}%`} h=\"90%\" />;\n};\n\nexport const RowVariantSkeleton: React.ComponentType<RowVariantProps> = ({\n row,\n itemIndex,\n isDragOverlay,\n focusedRowId,\n drilldownRowId,\n}) => {\n const newCells = row.cells.map((cell) => ({\n ...cell,\n render: RandomSkeleton,\n }));\n\n return (\n <RowRenderer\n row={{ ...row, cells: newCells }}\n itemIndex={itemIndex}\n isDragOverlay={isDragOverlay}\n minHeight=\"0px\"\n height=\"36px\"\n focusedRowId={focusedRowId}\n drilldownRowId={drilldownRowId}\n />\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AAGA,MAAM,iBAAiB,MAAM;AAC3B,QAAM,mBAAmB,QAAQ,MAAM,KAAK,MAAM,KAAK,OAAO,IAAI,KAAK,EAAE,GAAG,CAAC,CAAC;AAC9E,SAAO,qCAAC;AAAA,IAAW,GAAG,GAAG;AAAA,IAAqB,GAAE;AAAA,GAAM;AACxD;AAEO,MAAM,qBAA2D,CAAC;AAAA,EACvE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,MACI;AACJ,QAAM,WAAW,IAAI,MAAM,IAAI,CAAC,SAAU,iCACrC,OADqC;AAAA,IAExC,QAAQ;AAAA,EACV,EAAE;AAEF,SACE,qCAAC;AAAA,IACC,KAAK,iCAAK,MAAL,EAAU,OAAO,SAAS;AAAA,IAC/B;AAAA,IACA;AAAA,IACA,WAAU;AAAA,IACV,QAAO;AAAA,IACP;AAAA,IACA;AAAA,GACF;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/RowVariants/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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;\n
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;AAAA;ACCA;AACA;AAEA;AACA;AACA;AACA;AACA;AAGA,MAAM,mBAAyE;AAAA,GAC5E,aAAa,eAAe;AAAA,GAC5B,aAAa,UAAU;AAAA,GACvB,aAAa,YAAY;AAAA,GACzB,aAAa,kBAAkB,CAAC,UAAU,qCAAC;AAAA,IAAkB,SAAO;AAAA,KAAK,MAAO;AAAA,GAChF,aAAa,oBAAoB,CAAC,UAAU,qCAAC;AAAA,IAAoB,SAAO;AAAA,KAAK,MAAO;AAAA,GACpF,aAAa,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,KAAK;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,qCAAC,8BAAc,MAAO;AAC/B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|