@elliemae/ds-data-table 3.13.1 → 3.13.2
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/DataTableContext.js +0 -2
- package/dist/cjs/DataTableContext.js.map +2 -2
- package/dist/cjs/addons/Columns/ColumnDragHandle/ColumnDragHandle.js +2 -2
- package/dist/cjs/addons/Columns/ColumnDragHandle/ColumnDragHandle.js.map +2 -2
- package/dist/cjs/configs/useDatatableConfig.js +1 -1
- package/dist/cjs/configs/useDatatableConfig.js.map +2 -2
- package/dist/cjs/configs/useTableColsWithAddons.js +0 -2
- package/dist/cjs/configs/useTableColsWithAddons.js.map +2 -2
- package/dist/cjs/exported-related/FilterPopover/index.js +2 -2
- package/dist/cjs/exported-related/FilterPopover/index.js.map +3 -3
- package/dist/cjs/exported-related/FilterPopover/useGetFilterHandlers.js +2 -2
- package/dist/cjs/exported-related/FilterPopover/useGetFilterHandlers.js.map +3 -3
- package/dist/cjs/exported-related/RowRenderer/DefaultRowContentRenderer.js +1 -0
- package/dist/cjs/exported-related/RowRenderer/DefaultRowContentRenderer.js.map +2 -2
- package/dist/cjs/exported-related/RowRenderer/index.js +1 -3
- package/dist/cjs/exported-related/RowRenderer/index.js.map +2 -2
- package/dist/cjs/exported-related/RowRenderer/useRowRendererProperties.js +1 -3
- package/dist/cjs/exported-related/RowRenderer/useRowRendererProperties.js.map +2 -2
- package/dist/cjs/exported-related/RowRenderer/useRowStyle.js +2 -2
- package/dist/cjs/exported-related/RowRenderer/useRowStyle.js.map +3 -3
- package/dist/cjs/parts/Cells/Cell.js +1 -3
- package/dist/cjs/parts/Cells/Cell.js.map +2 -2
- package/dist/cjs/parts/Cells/index.js +1 -3
- package/dist/cjs/parts/Cells/index.js.map +2 -2
- package/dist/cjs/parts/DnDHandle.js +1 -2
- package/dist/cjs/parts/DnDHandle.js.map +2 -2
- package/dist/cjs/parts/DropIndicator.js +1 -3
- package/dist/cjs/parts/DropIndicator.js.map +2 -2
- package/dist/cjs/parts/EmptyContent.js +1 -3
- package/dist/cjs/parts/EmptyContent.js.map +2 -2
- package/dist/cjs/parts/Filters/index.js +2 -2
- package/dist/cjs/parts/Filters/index.js.map +3 -3
- package/dist/cjs/parts/Headers/HeaderCell.js +2 -2
- package/dist/cjs/parts/Headers/HeaderCell.js.map +2 -2
- package/dist/cjs/parts/Headers/HeaderCellGroup.js +3 -5
- package/dist/cjs/parts/Headers/HeaderCellGroup.js.map +3 -3
- package/dist/cjs/parts/Headers/index.js +4 -14
- package/dist/cjs/parts/Headers/index.js.map +2 -2
- package/dist/cjs/parts/Headers/useHeaderCellConfig.js +2 -2
- package/dist/cjs/parts/Headers/useHeaderCellConfig.js.map +3 -3
- package/dist/cjs/parts/Headers/useHeaderCellHandlers.js +2 -2
- package/dist/cjs/parts/Headers/useHeaderCellHandlers.js.map +3 -3
- package/dist/cjs/parts/Loader.js +1 -3
- package/dist/cjs/parts/Loader.js.map +2 -2
- package/dist/cjs/parts/Row.js +3 -5
- package/dist/cjs/parts/Row.js.map +3 -3
- package/dist/cjs/parts/Rows.js +25 -31
- package/dist/cjs/parts/Rows.js.map +2 -2
- package/dist/cjs/parts/TableContent.js +26 -32
- package/dist/cjs/parts/TableContent.js.map +3 -3
- package/dist/cjs/parts/VirtualRowsList.js +1 -3
- package/dist/cjs/parts/VirtualRowsList.js.map +2 -2
- package/dist/cjs/styled.js +3 -3
- package/dist/cjs/styled.js.map +2 -2
- package/dist/cjs/types/props.js.map +1 -1
- package/dist/esm/DataTableContext.js +0 -2
- package/dist/esm/DataTableContext.js.map +2 -2
- package/dist/esm/addons/Columns/ColumnDragHandle/ColumnDragHandle.js +2 -2
- package/dist/esm/addons/Columns/ColumnDragHandle/ColumnDragHandle.js.map +2 -2
- package/dist/esm/configs/useDatatableConfig.js +1 -1
- package/dist/esm/configs/useDatatableConfig.js.map +2 -2
- package/dist/esm/configs/useTableColsWithAddons.js +0 -2
- package/dist/esm/configs/useTableColsWithAddons.js.map +2 -2
- package/dist/esm/exported-related/FilterPopover/index.js +1 -1
- package/dist/esm/exported-related/FilterPopover/index.js.map +2 -2
- package/dist/esm/exported-related/FilterPopover/useGetFilterHandlers.js +1 -1
- package/dist/esm/exported-related/FilterPopover/useGetFilterHandlers.js.map +2 -2
- package/dist/esm/exported-related/RowRenderer/DefaultRowContentRenderer.js +1 -0
- package/dist/esm/exported-related/RowRenderer/DefaultRowContentRenderer.js.map +2 -2
- package/dist/esm/exported-related/RowRenderer/index.js +1 -3
- package/dist/esm/exported-related/RowRenderer/index.js.map +2 -2
- package/dist/esm/exported-related/RowRenderer/useRowRendererProperties.js +1 -3
- package/dist/esm/exported-related/RowRenderer/useRowRendererProperties.js.map +2 -2
- package/dist/esm/exported-related/RowRenderer/useRowStyle.js +1 -1
- package/dist/esm/exported-related/RowRenderer/useRowStyle.js.map +2 -2
- package/dist/esm/parts/Cells/Cell.js +1 -3
- package/dist/esm/parts/Cells/Cell.js.map +2 -2
- package/dist/esm/parts/Cells/index.js +1 -3
- package/dist/esm/parts/Cells/index.js.map +2 -2
- package/dist/esm/parts/DnDHandle.js +1 -2
- package/dist/esm/parts/DnDHandle.js.map +2 -2
- package/dist/esm/parts/DropIndicator.js +1 -3
- package/dist/esm/parts/DropIndicator.js.map +2 -2
- package/dist/esm/parts/EmptyContent.js +1 -3
- package/dist/esm/parts/EmptyContent.js.map +2 -2
- package/dist/esm/parts/Filters/index.js +1 -1
- package/dist/esm/parts/Filters/index.js.map +2 -2
- package/dist/esm/parts/Headers/HeaderCell.js +2 -2
- package/dist/esm/parts/Headers/HeaderCell.js.map +2 -2
- package/dist/esm/parts/Headers/HeaderCellGroup.js +2 -4
- package/dist/esm/parts/Headers/HeaderCellGroup.js.map +2 -2
- package/dist/esm/parts/Headers/index.js +5 -15
- package/dist/esm/parts/Headers/index.js.map +2 -2
- package/dist/esm/parts/Headers/useHeaderCellConfig.js +1 -1
- package/dist/esm/parts/Headers/useHeaderCellConfig.js.map +2 -2
- package/dist/esm/parts/Headers/useHeaderCellHandlers.js +1 -1
- package/dist/esm/parts/Headers/useHeaderCellHandlers.js.map +2 -2
- package/dist/esm/parts/Loader.js +1 -3
- package/dist/esm/parts/Loader.js.map +2 -2
- package/dist/esm/parts/Row.js +2 -4
- package/dist/esm/parts/Row.js.map +2 -2
- package/dist/esm/parts/Rows.js +26 -32
- package/dist/esm/parts/Rows.js.map +2 -2
- package/dist/esm/parts/TableContent.js +26 -32
- package/dist/esm/parts/TableContent.js.map +2 -2
- package/dist/esm/parts/VirtualRowsList.js +1 -3
- package/dist/esm/parts/VirtualRowsList.js.map +2 -2
- package/dist/esm/styled.js +3 -3
- package/dist/esm/styled.js.map +2 -2
- package/dist/esm/types/props.js.map +1 -1
- package/dist/types/DataTableContext.d.ts +0 -1
- package/dist/types/configs/useTableColsWithAddons.d.ts +0 -1
- package/dist/types/exported-related/RowRenderer/index.d.ts +0 -1
- package/dist/types/exported-related/RowRenderer/useRowRendererProperties.d.ts +0 -1
- package/dist/types/parts/Cells/Cell.d.ts +0 -1
- package/dist/types/parts/Cells/index.d.ts +0 -1
- package/dist/types/parts/DnDHandle.d.ts +1 -2
- package/dist/types/parts/DropIndicator.d.ts +0 -1
- package/dist/types/parts/EmptyContent.d.ts +0 -1
- package/dist/types/parts/Headers/HeaderCellGroup.d.ts +1 -1
- package/dist/types/parts/Headers/index.d.ts +0 -1
- package/dist/types/parts/Loader.d.ts +0 -1
- package/dist/types/parts/Row.d.ts +0 -1
- package/dist/types/parts/Rows.d.ts +0 -1
- package/dist/types/parts/TableContent.d.ts +0 -1
- package/dist/types/parts/VirtualRowsList.d.ts +0 -1
- package/dist/types/styled.d.ts +3 -3
- package/dist/types/types/props.d.ts +1 -1
- package/package.json +18 -18
- package/dist/cjs/parts/index.js +0 -40
- package/dist/cjs/parts/index.js.map +0 -7
- package/dist/esm/parts/index.js +0 -14
- package/dist/esm/parts/index.js.map +0 -7
- package/dist/types/parts/index.d.ts +0 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/Headers/HeaderCellGroup.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\nimport React, { useContext } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { styled } from '@elliemae/ds-system';\nimport { HeaderCell } from './HeaderCell';\nimport { SortableItemContext } from '../HoC/SortableItemContext';\nimport { withDnDSortableColumnContext } from '../internal';\nimport { DropIndicator } from '../DropIndicator';\nimport { SortableHeaderCell } from '../SortableHeaderCell';\nimport type { 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} isDropValid />\n </StyledWrapper>\n );\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
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACyDnB,SAUE,KAVF;AAxDJ,SAAgB,kBAAkB;AAClC,SAAS,YAAY;AACrB,SAAS,cAAc;AACvB,SAAS,kBAAkB;AAC3B,SAAS,2BAA2B;AACpC,SAAS,oCAAoC;AAC7C,SAAS,qBAAqB;AAC9B,SAAS,0BAA0B;AAEnC,SAAS,0BAA0B;AACnC,SAAS,mBAAmB;AAC5B,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\nimport React, { useContext } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { styled } from '@elliemae/ds-system';\nimport { HeaderCell } from './HeaderCell';\nimport { SortableItemContext } from '../HoC/SortableItemContext';\nimport { withDnDSortableColumnContext } from '../internal';\nimport { DropIndicator } from '../DropIndicator';\nimport { SortableHeaderCell } from '../SortableHeaderCell';\nimport type { 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} isDropValid />\n </StyledWrapper>\n );\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"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACyDnB,SAUE,KAVF;AAxDJ,SAAgB,kBAAkB;AAClC,SAAS,YAAY;AACrB,SAAS,cAAc;AACvB,SAAS,kBAAkB;AAC3B,SAAS,2BAA2B;AACpC,SAAS,oCAAoC;AAC7C,SAAS,qBAAqB;AAC9B,SAAS,0BAA0B;AAEnC,SAAS,0BAA0B;AACnC,S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AQ,QAAQ,eAA8B,SAAkB;AAAA,QAC3E,CAAC,CAAC,UAAU,UAAU,CAAC,iBACtB,oBAAC,sBAAmB,SAAO,MAAC,OAAO,UAAU,eAC1C,mBAAS,IAAI,CAAC,GAAG,UAChB;AAAA,UAAC;AAAA;AAAA,YAEC,QAAQ;AAAA,YACR;AAAA,YACA,kBAAkB;AAAA,YAClB,QAAQ,UAAU,SAAS,SAAS;AAAA,YACpC,SAAS,UAAU;AAAA,YACnB,OAAO,QAAQ;AAAA;AAAA,UANV,EAAE;AAAA,QAOT,CACD,GACH;AAAA,QAED,UAAU,UAAU,iBAAiB,oBAAC,sBAAmB;AAAA,QAC1D,oBAAC,iBAAc,UAAQ,MAAC,uBAA8C,QAAQ,UAAU,YAAY,aAAW,MAAC;AAAA;AAAA;AAAA,EAClH;AAEJ;AAIO,MAAM,kBAAkB;AAExB,MAAM,0BAA0B,6BAA6B,mBAAmB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { useContext
|
|
3
|
+
import { useContext } from "react";
|
|
4
4
|
import { StyledHeadWrapper, StyledHeadTr } from "../../styled";
|
|
5
5
|
import { DataTableContext } from "../../DataTableContext";
|
|
6
6
|
import { withConditionalDnDColumnContext } from "../HoC/withConditionalDnDColumnContext";
|
|
@@ -10,23 +10,13 @@ const HeadersComp = () => {
|
|
|
10
10
|
const {
|
|
11
11
|
tableProps: { isExpandable, colsLayoutStyle },
|
|
12
12
|
layoutHelpers: { gridLayout, totalColumnsWidth },
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
visibleColumns,
|
|
14
|
+
columnHeaderRef
|
|
15
15
|
} = useContext(DataTableContext);
|
|
16
|
-
|
|
17
|
-
() => /* @__PURE__ */ jsx(SortableHeaderCell, { items: visibleColumns, children: /* @__PURE__ */ jsx(StyledHeadTr, { role: "row", cols: gridLayout, colsLayoutStyle, isExpandable, children: visibleColumns.map((h, index) => /* @__PURE__ */ jsx(HeaderCellGroupSortable, { header: h, isLast: index === visibleColumns.length - 1 }, h.id)) }) }),
|
|
18
|
-
[isExpandable, visibleColumns, gridLayout, colsLayoutStyle]
|
|
19
|
-
);
|
|
20
|
-
const PureHeaders = useMemo(
|
|
21
|
-
() => /* @__PURE__ */ jsx(StyledHeadWrapper, { totalColumnsWidth, colsLayoutStyle, ref: columnHeaderRef, children: HeadersCells }),
|
|
22
|
-
[totalColumnsWidth, colsLayoutStyle, columnHeaderRef, HeadersCells]
|
|
23
|
-
);
|
|
24
|
-
return PureHeaders;
|
|
16
|
+
return /* @__PURE__ */ jsx(StyledHeadWrapper, { totalColumnsWidth, colsLayoutStyle, ref: columnHeaderRef, children: /* @__PURE__ */ jsx(SortableHeaderCell, { items: visibleColumns, children: /* @__PURE__ */ jsx(StyledHeadTr, { role: "row", cols: gridLayout, colsLayoutStyle, isExpandable, children: visibleColumns.map((h, index) => /* @__PURE__ */ jsx(HeaderCellGroupSortable, { header: h, isLast: index === visibleColumns.length - 1 }, h.id)) }) }) });
|
|
25
17
|
};
|
|
26
18
|
const Headers = withConditionalDnDColumnContext(HeadersComp);
|
|
27
|
-
var Headers_default = Headers;
|
|
28
19
|
export {
|
|
29
|
-
Headers
|
|
30
|
-
Headers_default as default
|
|
20
|
+
Headers
|
|
31
21
|
};
|
|
32
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/Headers/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport { StyledHeadWrapper, StyledHeadTr } from '../../styled';\nimport { DataTableContext } from '../../DataTableContext';\nimport { withConditionalDnDColumnContext } from '../HoC/withConditionalDnDColumnContext';\nimport { HeaderCellGroupSortable } from './HeaderCellGroup';\nimport { SortableHeaderCell } from '../SortableHeaderCell';\nimport type { TypescriptColumn } from '../../types/props';\n\nconst HeadersComp = (): JSX.Element => {\n const {\n tableProps: { isExpandable, colsLayoutStyle },\n layoutHelpers: { gridLayout, totalColumnsWidth },\n visibleColumns,\n columnHeaderRef,\n } = useContext(DataTableContext);\n\n return (\n <StyledHeadWrapper totalColumnsWidth={totalColumnsWidth} colsLayoutStyle={colsLayoutStyle} ref={columnHeaderRef}>\n <SortableHeaderCell items={visibleColumns}>\n <StyledHeadTr role=\"row\" cols={gridLayout} colsLayoutStyle={colsLayoutStyle} isExpandable={isExpandable}>\n {visibleColumns.map((h: TypescriptColumn, index) => (\n <HeaderCellGroupSortable header={h} key={h.id} isLast={index === visibleColumns.length - 1} />\n ))}\n </StyledHeadTr>\n </SortableHeaderCell>\n </StyledHeadWrapper>\n );\n};\n\nexport const Headers = withConditionalDnDColumnContext(HeadersComp);\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACqBX;AArBZ,SAAgB,kBAAkB;AAClC,SAAS,mBAAmB,oBAAoB;AAChD,SAAS,wBAAwB;AACjC,SAAS,uCAAuC;AAChD,SAAS,+BAA+B;AACxC,SAAS,0BAA0B;AAGnC,MAAM,cAAc,MAAmB;AACrC,QAAM;AAAA,IACJ,YAAY,EAAE,cAAc,gBAAgB;AAAA,IAC5C,eAAe,EAAE,YAAY,kBAAkB;AAAA,IAC/C;AAAA,IACA;AAAA,EACF,IAAI,WAAW,gBAAgB;AAE/B,SACE,oBAAC,qBAAkB,mBAAsC,iBAAkC,KAAK,iBAC9F,8BAAC,sBAAmB,OAAO,gBACzB,8BAAC,gBAAa,MAAK,OAAM,MAAM,YAAY,iBAAkC,cAC1E,yBAAe,IAAI,CAAC,GAAqB,UACxC,oBAAC,2BAAwB,QAAQ,GAAc,QAAQ,UAAU,eAAe,SAAS,KAAhD,EAAE,EAAiD,CAC7F,GACH,GACF,GACF;AAEJ;AAEO,MAAM,UAAU,gCAAgC,WAAW;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { useContext, useMemo } from "react";
|
|
3
|
-
import DataTableContext from "../../DataTableContext";
|
|
3
|
+
import { DataTableContext } from "../../DataTableContext";
|
|
4
4
|
import { SortableItemContext } from "../HoC/SortableItemContext";
|
|
5
5
|
const useHeaderCellConfig = ({ column, isDragOverlay }) => {
|
|
6
6
|
const {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/Headers/useHeaderCellConfig.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\nimport { useContext, useMemo } from 'react';\nimport DataTableContext from '../../DataTableContext';\nimport { SortableItemContext } from '../HoC/SortableItemContext';\nimport type { InternalTypescriptColumn } from '../../types/props';\n\ntype UseHeaderCellConfigType = (args: { column: InternalTypescriptColumn; isDragOverlay: boolean }) => {\n hasFilter: boolean;\n hasDnD: boolean;\n hasSortingCaret: boolean;\n hasRightIcons: boolean;\n isDragging: boolean;\n shouldShowDnD: boolean;\n hCols: string[];\n};\n\nexport const useHeaderCellConfig: UseHeaderCellConfigType = ({ column, isDragOverlay }) => {\n const {\n tableProps: { dragAndDropColumns },\n reduxHeaders,\n } = useContext(DataTableContext);\n\n const { draggableProps } = useContext(SortableItemContext);\n\n const reduxHeader = useMemo(() => reduxHeaders[column.id], [reduxHeaders, column]);\n\n const hasFilter = !!(column.filter || column.Filter);\n\n const hasDnD = dragAndDropColumns && !column.disableDnD;\n\n const hasSortingCaret = column.canSort && typeof column.isSortedDesc === 'boolean';\n\n const hasRightIcons = !isDragOverlay && (hasSortingCaret || hasFilter);\n\n const isDragging = draggableProps && draggableProps.isDragging;\n\n const shouldShowDnD =\n hasDnD &&\n ((reduxHeader?.showDnDHandle && draggableProps && !draggableProps.active) ||\n (draggableProps && draggableProps.isDragging) ||\n isDragOverlay);\n\n // Column definition\n const hCols = ['auto'];\n if (hasRightIcons) hCols.push('min-content');\n if (shouldShowDnD) hCols.unshift('min-content');\n\n return {\n hasFilter,\n hasDnD,\n hasSortingCaret,\n hasRightIcons,\n isDragging,\n hCols,\n shouldShowDnD,\n };\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,YAAY,eAAe;AACpC,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\nimport { useContext, useMemo } from 'react';\nimport { DataTableContext } from '../../DataTableContext';\nimport { SortableItemContext } from '../HoC/SortableItemContext';\nimport type { InternalTypescriptColumn } from '../../types/props';\n\ntype UseHeaderCellConfigType = (args: { column: InternalTypescriptColumn; isDragOverlay: boolean }) => {\n hasFilter: boolean;\n hasDnD: boolean;\n hasSortingCaret: boolean;\n hasRightIcons: boolean;\n isDragging: boolean;\n shouldShowDnD: boolean;\n hCols: string[];\n};\n\nexport const useHeaderCellConfig: UseHeaderCellConfigType = ({ column, isDragOverlay }) => {\n const {\n tableProps: { dragAndDropColumns },\n reduxHeaders,\n } = useContext(DataTableContext);\n\n const { draggableProps } = useContext(SortableItemContext);\n\n const reduxHeader = useMemo(() => reduxHeaders[column.id], [reduxHeaders, column]);\n\n const hasFilter = !!(column.filter || column.Filter);\n\n const hasDnD = dragAndDropColumns && !column.disableDnD;\n\n const hasSortingCaret = column.canSort && typeof column.isSortedDesc === 'boolean';\n\n const hasRightIcons = !isDragOverlay && (hasSortingCaret || hasFilter);\n\n const isDragging = draggableProps && draggableProps.isDragging;\n\n const shouldShowDnD =\n hasDnD &&\n ((reduxHeader?.showDnDHandle && draggableProps && !draggableProps.active) ||\n (draggableProps && draggableProps.isDragging) ||\n isDragOverlay);\n\n // Column definition\n const hCols = ['auto'];\n if (hasRightIcons) hCols.push('min-content');\n if (shouldShowDnD) hCols.unshift('min-content');\n\n return {\n hasFilter,\n hasDnD,\n hasSortingCaret,\n hasRightIcons,\n isDragging,\n hCols,\n shouldShowDnD,\n };\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,YAAY,eAAe;AACpC,SAAS,wBAAwB;AACjC,SAAS,2BAA2B;AAa7B,MAAM,sBAA+C,CAAC,EAAE,QAAQ,cAAc,MAAM;AACzF,QAAM;AAAA,IACJ,YAAY,EAAE,mBAAmB;AAAA,IACjC;AAAA,EACF,IAAI,WAAW,gBAAgB;AAE/B,QAAM,EAAE,eAAe,IAAI,WAAW,mBAAmB;AAEzD,QAAM,cAAc,QAAQ,MAAM,aAAa,OAAO,KAAK,CAAC,cAAc,MAAM,CAAC;AAEjF,QAAM,YAAY,CAAC,EAAE,OAAO,UAAU,OAAO;AAE7C,QAAM,SAAS,sBAAsB,CAAC,OAAO;AAE7C,QAAM,kBAAkB,OAAO,WAAW,OAAO,OAAO,iBAAiB;AAEzE,QAAM,gBAAgB,CAAC,kBAAkB,mBAAmB;AAE5D,QAAM,aAAa,kBAAkB,eAAe;AAEpD,QAAM,gBACJ,WACE,aAAa,iBAAiB,kBAAkB,CAAC,eAAe,UAC/D,kBAAkB,eAAe,cAClC;AAGJ,QAAM,QAAQ,CAAC,MAAM;AACrB,MAAI;AAAe,UAAM,KAAK,aAAa;AAC3C,MAAI;AAAe,UAAM,QAAQ,aAAa;AAE9C,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { useCallback, useContext, useMemo } from "react";
|
|
3
|
-
import DataTableContext from "../../DataTableContext";
|
|
3
|
+
import { DataTableContext } from "../../DataTableContext";
|
|
4
4
|
const buildNextHeader = (reduxHeader, value, hasFilter, hasDnD, withTabStops = false) => ({
|
|
5
5
|
hideFilterMenu: true,
|
|
6
6
|
...reduxHeader,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/Headers/useHeaderCellHandlers.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-params */\nimport { useCallback, useContext, useMemo } from 'react';\nimport DataTableContext from '../../DataTableContext';\nimport type { InternalTypescriptColumn, ReduxHeader } from '../../types/props';\n\ntype UseHeaderCellHandlersType = (args: {\n hasFilter: boolean;\n column: InternalTypescriptColumn;\n hasDnD: boolean;\n dragHandleRef: React.MutableRefObject<HTMLDivElement | null>;\n filterIconRef: React.MutableRefObject<HTMLDivElement | null>;\n}) => {\n onMouseEnter: React.MouseEventHandler;\n onMouseLeave: React.MouseEventHandler;\n onClick: React.MouseEventHandler;\n onKeyDown: React.KeyboardEventHandler;\n onFocus: React.FocusEventHandler;\n onBlur: React.FocusEventHandler;\n};\n\nconst buildNextHeader = (\n reduxHeader: ReduxHeader,\n value: boolean,\n hasFilter: boolean,\n hasDnD: boolean,\n withTabStops = false,\n) => ({\n hideFilterMenu: true, // Do this to overwrite it if it exists\n ...reduxHeader,\n hideFilterButton: !(hasFilter && value),\n showDnDHandle: hasDnD && value,\n withTabStops,\n});\n\nconst getNextSortedVisibleColumns = (\n visibleColumns: InternalTypescriptColumn<HTMLElement>[],\n columnId: string,\n isSortedDesc: boolean,\n) => {\n const doit = (columns: InternalTypescriptColumn<HTMLElement>[]) =>\n columns.map((col) => {\n const newCol = { ...col };\n delete newCol.isSortedDesc;\n if (col.id === columnId) {\n newCol.isSortedDesc = isSortedDesc;\n }\n if (newCol.columns) {\n newCol.columns = doit(newCol.columns);\n }\n return newCol;\n });\n return doit(visibleColumns);\n};\n\nexport const useHeaderCellHandlers: UseHeaderCellHandlersType = ({\n hasFilter,\n column,\n hasDnD,\n dragHandleRef,\n filterIconRef,\n}) => {\n const {\n tableProps: { onColumnSortChange, onColumnSort },\n patchHeader,\n reduxHeaders,\n visibleColumns,\n } = useContext(DataTableContext);\n\n const reduxHeader = useMemo(() => reduxHeaders[column.id], [reduxHeaders, column]);\n\n const headerRef = column.ref;\n\n const onMouseEnter: React.MouseEventHandler = useCallback(() => {\n patchHeader(column.id, buildNextHeader(reduxHeader, true, hasFilter, hasDnD));\n }, [column.id, hasDnD, hasFilter, patchHeader, reduxHeader]);\n\n const onMouseLeave: React.MouseEventHandler = useCallback(() => {\n if (!headerRef?.current?.contains(document.activeElement)) {\n patchHeader(column.id, buildNextHeader(reduxHeader, false, hasFilter, hasDnD));\n }\n }, [column.id, hasDnD, hasFilter, headerRef, patchHeader, reduxHeader]);\n\n const onClick: React.MouseEventHandler = useCallback(() => {\n if (column.canSort) {\n onColumnSortChange?.({\n column: column.id,\n direction: column.isSortedDesc ? 'ASC' : 'DESC',\n });\n onColumnSort(\n getNextSortedVisibleColumns(visibleColumns, column.id, !column.isSortedDesc),\n column.id,\n column.isSortedDesc ? 'ASC' : 'DESC',\n );\n }\n }, [column.canSort, column.id, column.isSortedDesc, onColumnSort, onColumnSortChange, visibleColumns]);\n\n const onKeyDown: React.KeyboardEventHandler = useCallback(\n (e) => {\n if (e.code === 'ArrowDown' && column.canSort) {\n e.preventDefault();\n onColumnSortChange?.({\n column: column.id,\n direction: 'DESC',\n });\n onColumnSort(getNextSortedVisibleColumns(visibleColumns, column.id, true), column.id, 'DESC');\n } else if (e.code === 'ArrowUp' && column.canSort) {\n e.preventDefault();\n onColumnSortChange?.({\n column: column.id,\n direction: 'ASC',\n });\n onColumnSort(getNextSortedVisibleColumns(visibleColumns, column.id, false), column.id, 'ASC');\n } else if (['Enter', 'Space'].includes(e.code)) {\n patchHeader(column.id, buildNextHeader(reduxHeader, true, hasFilter, hasDnD, true));\n // Elements don't not yet exist\n setTimeout(() => {\n if (dragHandleRef.current) dragHandleRef.current.focus();\n else if (filterIconRef.current) filterIconRef.current.focus();\n });\n }\n },\n [\n column.canSort,\n column.id,\n onColumnSortChange,\n onColumnSort,\n visibleColumns,\n patchHeader,\n reduxHeader,\n hasFilter,\n hasDnD,\n dragHandleRef,\n filterIconRef,\n ],\n );\n\n const onFocus: React.FocusEventHandler = useCallback(\n (e) => {\n // Don't do anything if focus wasn't placed in the element (bubling issues)\n if (e.target === headerRef?.current) {\n patchHeader(column.id, buildNextHeader(reduxHeader, true, hasFilter, hasDnD));\n }\n },\n [column.id, hasDnD, hasFilter, headerRef, patchHeader, reduxHeader],\n );\n\n const onBlur: React.FocusEventHandler = useCallback(\n (e) => {\n // Don't do anything if blur was caused by going to a child\n if (e.relatedTarget === dragHandleRef.current) return;\n if (e.relatedTarget === filterIconRef.current) return;\n patchHeader(column.id, buildNextHeader(reduxHeader, false, hasFilter, hasDnD));\n },\n [dragHandleRef, filterIconRef, patchHeader, column.id, reduxHeader, hasFilter, hasDnD],\n );\n\n return { onMouseEnter, onMouseLeave, onClick, onKeyDown, onBlur, onFocus };\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,aAAa,YAAY,eAAe;AACjD,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-params */\nimport { useCallback, useContext, useMemo } from 'react';\nimport { DataTableContext } from '../../DataTableContext';\nimport type { InternalTypescriptColumn, ReduxHeader } from '../../types/props';\n\ntype UseHeaderCellHandlersType = (args: {\n hasFilter: boolean;\n column: InternalTypescriptColumn;\n hasDnD: boolean;\n dragHandleRef: React.MutableRefObject<HTMLDivElement | null>;\n filterIconRef: React.MutableRefObject<HTMLDivElement | null>;\n}) => {\n onMouseEnter: React.MouseEventHandler;\n onMouseLeave: React.MouseEventHandler;\n onClick: React.MouseEventHandler;\n onKeyDown: React.KeyboardEventHandler;\n onFocus: React.FocusEventHandler;\n onBlur: React.FocusEventHandler;\n};\n\nconst buildNextHeader = (\n reduxHeader: ReduxHeader,\n value: boolean,\n hasFilter: boolean,\n hasDnD: boolean,\n withTabStops = false,\n) => ({\n hideFilterMenu: true, // Do this to overwrite it if it exists\n ...reduxHeader,\n hideFilterButton: !(hasFilter && value),\n showDnDHandle: hasDnD && value,\n withTabStops,\n});\n\nconst getNextSortedVisibleColumns = (\n visibleColumns: InternalTypescriptColumn<HTMLElement>[],\n columnId: string,\n isSortedDesc: boolean,\n) => {\n const doit = (columns: InternalTypescriptColumn<HTMLElement>[]) =>\n columns.map((col) => {\n const newCol = { ...col };\n delete newCol.isSortedDesc;\n if (col.id === columnId) {\n newCol.isSortedDesc = isSortedDesc;\n }\n if (newCol.columns) {\n newCol.columns = doit(newCol.columns);\n }\n return newCol;\n });\n return doit(visibleColumns);\n};\n\nexport const useHeaderCellHandlers: UseHeaderCellHandlersType = ({\n hasFilter,\n column,\n hasDnD,\n dragHandleRef,\n filterIconRef,\n}) => {\n const {\n tableProps: { onColumnSortChange, onColumnSort },\n patchHeader,\n reduxHeaders,\n visibleColumns,\n } = useContext(DataTableContext);\n\n const reduxHeader = useMemo(() => reduxHeaders[column.id], [reduxHeaders, column]);\n\n const headerRef = column.ref;\n\n const onMouseEnter: React.MouseEventHandler = useCallback(() => {\n patchHeader(column.id, buildNextHeader(reduxHeader, true, hasFilter, hasDnD));\n }, [column.id, hasDnD, hasFilter, patchHeader, reduxHeader]);\n\n const onMouseLeave: React.MouseEventHandler = useCallback(() => {\n if (!headerRef?.current?.contains(document.activeElement)) {\n patchHeader(column.id, buildNextHeader(reduxHeader, false, hasFilter, hasDnD));\n }\n }, [column.id, hasDnD, hasFilter, headerRef, patchHeader, reduxHeader]);\n\n const onClick: React.MouseEventHandler = useCallback(() => {\n if (column.canSort) {\n onColumnSortChange?.({\n column: column.id,\n direction: column.isSortedDesc ? 'ASC' : 'DESC',\n });\n onColumnSort(\n getNextSortedVisibleColumns(visibleColumns, column.id, !column.isSortedDesc),\n column.id,\n column.isSortedDesc ? 'ASC' : 'DESC',\n );\n }\n }, [column.canSort, column.id, column.isSortedDesc, onColumnSort, onColumnSortChange, visibleColumns]);\n\n const onKeyDown: React.KeyboardEventHandler = useCallback(\n (e) => {\n if (e.code === 'ArrowDown' && column.canSort) {\n e.preventDefault();\n onColumnSortChange?.({\n column: column.id,\n direction: 'DESC',\n });\n onColumnSort(getNextSortedVisibleColumns(visibleColumns, column.id, true), column.id, 'DESC');\n } else if (e.code === 'ArrowUp' && column.canSort) {\n e.preventDefault();\n onColumnSortChange?.({\n column: column.id,\n direction: 'ASC',\n });\n onColumnSort(getNextSortedVisibleColumns(visibleColumns, column.id, false), column.id, 'ASC');\n } else if (['Enter', 'Space'].includes(e.code)) {\n patchHeader(column.id, buildNextHeader(reduxHeader, true, hasFilter, hasDnD, true));\n // Elements don't not yet exist\n setTimeout(() => {\n if (dragHandleRef.current) dragHandleRef.current.focus();\n else if (filterIconRef.current) filterIconRef.current.focus();\n });\n }\n },\n [\n column.canSort,\n column.id,\n onColumnSortChange,\n onColumnSort,\n visibleColumns,\n patchHeader,\n reduxHeader,\n hasFilter,\n hasDnD,\n dragHandleRef,\n filterIconRef,\n ],\n );\n\n const onFocus: React.FocusEventHandler = useCallback(\n (e) => {\n // Don't do anything if focus wasn't placed in the element (bubling issues)\n if (e.target === headerRef?.current) {\n patchHeader(column.id, buildNextHeader(reduxHeader, true, hasFilter, hasDnD));\n }\n },\n [column.id, hasDnD, hasFilter, headerRef, patchHeader, reduxHeader],\n );\n\n const onBlur: React.FocusEventHandler = useCallback(\n (e) => {\n // Don't do anything if blur was caused by going to a child\n if (e.relatedTarget === dragHandleRef.current) return;\n if (e.relatedTarget === filterIconRef.current) return;\n patchHeader(column.id, buildNextHeader(reduxHeader, false, hasFilter, hasDnD));\n },\n [dragHandleRef, filterIconRef, patchHeader, column.id, reduxHeader, hasFilter, hasDn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AA,QAC9D,CAAC;AAAA,MACH;AAAA,IACF;AAAA,IACA;AAAA,MACE,OAAO;AAAA,MACP,OAAO;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,QAAM,UAAmC;AAAA,IACvC,CAAC,MAAM;AAEL,UAAI,EAAE,WAAW,WAAW,SAAS;AACnC,oBAAY,OAAO,IAAI,gBAAgB,aAAa,MAAM,WAAW,MAAM,CAAC;AAAA,MAC9E;AAAA,IACF;AAAA,IACA,CAAC,OAAO,IAAI,QAAQ,WAAW,WAAW,aAAa,WAAW;AAAA,EACpE;AAEA,QAAM,SAAkC;AAAA,IACtC,CAAC,MAAM;AAEL,UAAI,EAAE,kBAAkB,cAAc;AAAS;AAC/C,UAAI,EAAE,kBAAkB,cAAc;AAAS;AAC/C,kBAAY,OAAO,IAAI,gBAAgB,aAAa,OAAO,WAAW,MAAM,CAAC;AAAA,IAC/E;AAAA,IACA,CAAC,eAAe,eAAe,aAAa,OAAO,IAAI,aAAa,WAAW,MAAM;AAAA,EACvF;AAEA,SAAO,EAAE,cAAc,cAAc,SAAS,WAAW,QAAQ,QAAQ;AAC3E;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/parts/Loader.js
CHANGED
|
@@ -11,9 +11,7 @@ const StyledLoaderWrapper = styled(Grid)`
|
|
|
11
11
|
`;
|
|
12
12
|
const Loader = () => /* @__PURE__ */ jsx(StyledLoaderWrapper, { "aria-live": "polite", children: /* @__PURE__ */ jsx(DSCircularProgressIndicator, { size: "xl", loading: true, showLabel: true, waiting: false, showTooltip: false }) });
|
|
13
13
|
const MemoizedLoader = memo(Loader);
|
|
14
|
-
var Loader_default = MemoizedLoader;
|
|
15
14
|
export {
|
|
16
|
-
MemoizedLoader
|
|
17
|
-
Loader_default as default
|
|
15
|
+
MemoizedLoader
|
|
18
16
|
};
|
|
19
17
|
//# sourceMappingURL=Loader.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/Loader.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { memo } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSCircularProgressIndicator } from '@elliemae/ds-circular-progress-indicator';\nimport { styled } from '@elliemae/ds-system';\n\nconst StyledLoaderWrapper = styled(Grid)`\n place-items: center;\n z-index: 0;\n background-color: white;\n`;\n\nconst Loader = () => (\n <StyledLoaderWrapper aria-live=\"polite\">\n <DSCircularProgressIndicator size=\"xl\" loading showLabel waiting={false} showTooltip={false} />\n </StyledLoaderWrapper>\n);\n\nexport const MemoizedLoader = memo(Loader);\
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACanB;AAbJ,SAAgB,YAAY;AAC5B,SAAS,YAAY;AACrB,SAAS,mCAAmC;AAC5C,SAAS,cAAc;AAEvB,MAAM,sBAAsB,OAAO,IAAI;AAAA;AAAA;AAAA;AAAA;AAMvC,MAAM,SAAS,MACb,oBAAC,uBAAoB,aAAU,UAC7B,8BAAC,+BAA4B,MAAK,MAAK,SAAO,MAAC,WAAS,MAAC,SAAS,OAAO,aAAa,OAAO,GAC/F;AAGK,MAAM,iBAAiB,KAAK,MAAM;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { memo } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSCircularProgressIndicator } from '@elliemae/ds-circular-progress-indicator';\nimport { styled } from '@elliemae/ds-system';\n\nconst StyledLoaderWrapper = styled(Grid)`\n place-items: center;\n z-index: 0;\n background-color: white;\n`;\n\nconst Loader = () => (\n <StyledLoaderWrapper aria-live=\"polite\">\n <DSCircularProgressIndicator size=\"xl\" loading showLabel waiting={false} showTooltip={false} />\n </StyledLoaderWrapper>\n);\n\nexport const MemoizedLoader = memo(Loader);\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACanB;AAbJ,SAAgB,YAAY;AAC5B,SAAS,YAAY;AACrB,SAAS,mCAAmC;AAC5C,SAAS,cAAc;AAEvB,MAAM,sBAAsB,OAAO,IAAI;AAAA;AAAA;AAAA;AAAA;AAMvC,MAAM,SAAS,MACb,oBAAC,uBAAoB,aAAU,UAC7B,8BAAC,+BAA4B,MAAK,MAAK,SAAO,MAAC,WAAS,MAAC,SAAS,OAAO,aAAa,OAAO,GAC/F;AAGK,MAAM,iBAAiB,KAAK,MAAM;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/parts/Row.js
CHANGED
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useContext } from "react";
|
|
4
4
|
import { styled } from "@elliemae/ds-system";
|
|
5
|
-
import DataTableContext from "../DataTableContext";
|
|
5
|
+
import { DataTableContext } from "../DataTableContext";
|
|
6
6
|
import { setMultipleRefs } from "../helpers";
|
|
7
7
|
import { SortableItemContext } from "./HoC/SortableItemContext";
|
|
8
8
|
import { withDnDSortableRowContext } from "./HoC/withDnDSortableRowContext";
|
|
@@ -49,10 +49,8 @@ const Row = (props) => {
|
|
|
49
49
|
);
|
|
50
50
|
};
|
|
51
51
|
const RowWithContext = withDnDSortableRowContext(Row);
|
|
52
|
-
var Row_default = RowWithContext;
|
|
53
52
|
export {
|
|
54
53
|
Row,
|
|
55
|
-
RowWithContext
|
|
56
|
-
Row_default as default
|
|
54
|
+
RowWithContext
|
|
57
55
|
};
|
|
58
56
|
//# sourceMappingURL=Row.js.map
|
|
@@ -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", "import 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: ${({ isDisabled }) => (isDisabled ? '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 isDisabled={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 };\
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACuCjB;AAvCN,SAAgB,kBAAkB;AAClC,SAAS,cAAc;AACvB,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import 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: ${({ isDisabled }) => (isDisabled ? '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 isDisabled={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 };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACuCjB;AAvCN,SAAgB,kBAAkB;AAClC,SAAS,cAAc;AACvB,SAAS,wBAAwB;AACjC,SAAS,uBAAuB;AAChC,SAAS,2BAA2B;AACpC,SAAS,iCAAiC;AAC1C,SAAS,yBAAyB;AAKlC,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,WAAW,MAAO,aAAa,gBAAgB;AAAA;AAGvD,MAAM,MAAM,CAAC,UAAU;AAC5B,QAAM,EAAE,KAAK,YAAY,kBAAkB,cAAc,IAAI;AAE7D,QAAM,MAAM,WAAW,gBAAgB;AACvC,QAAM;AAAA,IACJ,YAAY,EAAE,aAAa;AAAA,IAC3B;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM,EAAE,eAAe,IAAI,WAAW,mBAAmB;AACzD,QAAM,eAAe,kBAAkB,eAAe;AACtD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,YAAY,aAAa,IAAI;AAAA,MAC7B,OAAO,CAAC,gBAAgB,mBAAmB,CAAC;AAAA,MAC5C,KAAK,CAAC,QAAQ,YAAY,YAAY,cAAc,GAAG;AAAA,MAEvD;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA,WAAW,IAAI;AAAA,UACf;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA;AAAA,MACF;AAAA;AAAA,EACF;AAEJ;AAEA,MAAM,iBAAiB,0BAA0B,GAAG;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/parts/Rows.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
3
|
-
import { useContext
|
|
3
|
+
import { useContext } from "react";
|
|
4
4
|
import { RowWithContext as Row } from "./Row";
|
|
5
5
|
import { DataTableContext } from "../DataTableContext";
|
|
6
6
|
import { withConditionalDnDRowContext } from "./HoC/withConditionalDnDRowContext";
|
|
@@ -9,44 +9,38 @@ import { addCellData } from "../helpers";
|
|
|
9
9
|
const Rows = () => {
|
|
10
10
|
const {
|
|
11
11
|
virtualListHelpers: { virtualItems },
|
|
12
|
-
layoutHelpers: { totalColumnsWidth },
|
|
13
12
|
flattenedData,
|
|
14
|
-
visibleColumns
|
|
13
|
+
visibleColumns,
|
|
14
|
+
layoutHelpers: { totalColumnsWidth }
|
|
15
15
|
} = useContext(DataTableContext);
|
|
16
16
|
const ctx = useContext(DnDTreeContext);
|
|
17
17
|
const items = ctx?.visibleItems || flattenedData;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}) }),
|
|
41
|
-
[virtualItems, items, visibleColumns, totalColumnsWidth]
|
|
42
|
-
);
|
|
43
|
-
return PureVirtualizedRows;
|
|
18
|
+
return /* @__PURE__ */ jsx(Fragment, { children: virtualItems.map((virtualItem) => {
|
|
19
|
+
const { index, measureRef, start } = virtualItem;
|
|
20
|
+
const row = items[index];
|
|
21
|
+
if (!row)
|
|
22
|
+
return null;
|
|
23
|
+
addCellData(row, visibleColumns);
|
|
24
|
+
const style = {
|
|
25
|
+
position: "absolute",
|
|
26
|
+
top: `${start}px`,
|
|
27
|
+
left: 0,
|
|
28
|
+
width: totalColumnsWidth
|
|
29
|
+
};
|
|
30
|
+
const rowProps = {
|
|
31
|
+
key: `ds-table-row-${row.uid}`,
|
|
32
|
+
row,
|
|
33
|
+
measureRef,
|
|
34
|
+
index,
|
|
35
|
+
itemIndex: index,
|
|
36
|
+
itemWrapperStyle: style
|
|
37
|
+
};
|
|
38
|
+
return /* @__PURE__ */ jsx(Row, { ...rowProps });
|
|
39
|
+
}) });
|
|
44
40
|
};
|
|
45
41
|
Rows.propTypes = {};
|
|
46
42
|
const RowsWithContext = withConditionalDnDRowContext(Rows);
|
|
47
|
-
var Rows_default = RowsWithContext;
|
|
48
43
|
export {
|
|
49
|
-
RowsWithContext
|
|
50
|
-
Rows_default as default
|
|
44
|
+
RowsWithContext
|
|
51
45
|
};
|
|
52
46
|
//# sourceMappingURL=Rows.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/Rows.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-underscore-dangle */\nimport React, { useContext, useMemo } from 'react';\n\nimport { RowWithContext as Row } from './Row';\nimport { DataTableContext } from '../DataTableContext';\nimport { withConditionalDnDRowContext } from './HoC/withConditionalDnDRowContext';\nimport { DnDTreeContext } from './HoC/DnDTreeContext';\nimport { addCellData } from '../helpers';\n\nconst Rows = (): JSX.Element => {\n const {\n virtualListHelpers: { virtualItems },\n layoutHelpers: { totalColumnsWidth },\n
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-underscore-dangle */\nimport React, { useContext, useMemo } from 'react';\n\nimport { RowWithContext as Row } from './Row';\nimport { DataTableContext } from '../DataTableContext';\nimport { withConditionalDnDRowContext } from './HoC/withConditionalDnDRowContext';\nimport { DnDTreeContext } from './HoC/DnDTreeContext';\nimport { addCellData } from '../helpers';\n\nconst Rows = (): JSX.Element => {\n const {\n virtualListHelpers: { virtualItems },\n flattenedData,\n visibleColumns,\n layoutHelpers: { totalColumnsWidth },\n } = useContext(DataTableContext);\n\n const ctx = useContext(DnDTreeContext);\n\n const items = ctx?.visibleItems || flattenedData;\n\n return (\n <>\n {virtualItems.map((virtualItem) => {\n const { index, measureRef, start } = virtualItem;\n const row = items[index];\n if (!row) return null;\n addCellData(row, visibleColumns);\n const style = {\n position: 'absolute',\n top: `${start}px`,\n left: 0,\n width: totalColumnsWidth,\n };\n const rowProps = {\n key: `ds-table-row-${row.uid}`,\n row,\n measureRef,\n index, // this is consumed by the DnD HOC\n itemIndex: index,\n itemWrapperStyle: style,\n };\n return <Row {...rowProps} />;\n })}\n </>\n );\n};\n\nRows.propTypes = {};\n\nexport const RowsWithContext = withConditionalDnDRowContext(Rows);\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACsBnB,mBAoBW,WApBX;AArBJ,SAAgB,kBAA2B;AAE3C,SAAS,kBAAkB,WAAW;AACtC,SAAS,wBAAwB;AACjC,SAAS,oCAAoC;AAC7C,SAAS,sBAAsB;AAC/B,SAAS,mBAAmB;AAE5B,MAAM,OAAO,MAAmB;AAC9B,QAAM;AAAA,IACJ,oBAAoB,EAAE,aAAa;AAAA,IACnC;AAAA,IACA;AAAA,IACA,eAAe,EAAE,kBAAkB;AAAA,EACrC,IAAI,WAAW,gBAAgB;AAE/B,QAAM,MAAM,WAAW,cAAc;AAErC,QAAM,QAAQ,KAAK,gBAAgB;AAEnC,SACE,gCACG,uBAAa,IAAI,CAAC,gBAAgB;AACjC,UAAM,EAAE,OAAO,YAAY,MAAM,IAAI;AACrC,UAAM,MAAM,MAAM;AAClB,QAAI,CAAC;AAAK,aAAO;AACjB,gBAAY,KAAK,cAAc;AAC/B,UAAM,QAAQ;AAAA,MACZ,UAAU;AAAA,MACV,KAAK,GAAG;AAAA,MACR,MAAM;AAAA,MACN,OAAO;AAAA,IACT;AACA,UAAM,WAAW;AAAA,MACf,KAAK,gBAAgB,IAAI;AAAA,MACzB;AAAA,MACA;AAAA,MACA;AAAA,MACA,WAAW;AAAA,MACX,kBAAkB;AAAA,IACpB;AACA,WAAO,oBAAC,OAAK,GAAG,UAAU;AAAA,EAC5B,CAAC,GACH;AAEJ;AAEA,KAAK,YAAY,CAAC;AAEX,MAAM,kBAAkB,6BAA6B,IAAI;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useContext,
|
|
3
|
+
import { useContext, useCallback } from "react";
|
|
4
4
|
import { StyledTableWrapper, StyledDataTableContentWrapper } from "../styled";
|
|
5
|
-
import DataTableContext from "../DataTableContext";
|
|
5
|
+
import { DataTableContext } from "../DataTableContext";
|
|
6
6
|
import { Pagination } from "../addons/Pagination";
|
|
7
7
|
import { VirtualRowsList } from "./VirtualRowsList";
|
|
8
8
|
import { DATA_TESTID } from "../configs/constants";
|
|
@@ -21,38 +21,32 @@ const TableContent = () => {
|
|
|
21
21
|
[setIsShiftPressed]
|
|
22
22
|
);
|
|
23
23
|
const handleOnKeyUp = useCallback(() => setIsShiftPressed(false), [setIsShiftPressed]);
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
),
|
|
49
|
-
[isShiftPressed, handleOnKeyDown, handleOnKeyUp, pagination, allDataFlattened.length, visibleColumns.length]
|
|
24
|
+
return /* @__PURE__ */ jsxs(
|
|
25
|
+
StyledDataTableContentWrapper,
|
|
26
|
+
{
|
|
27
|
+
"data-testid": DATA_TESTID.DATA_TABLE_CONTENT_WRAPPER,
|
|
28
|
+
noSelectionAllowed: isShiftPressed,
|
|
29
|
+
onKeyDown: handleOnKeyDown,
|
|
30
|
+
onKeyUp: handleOnKeyUp,
|
|
31
|
+
rows: pagination ? ["1fr", "auto"] : ["auto"],
|
|
32
|
+
cols: ["100%"],
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ jsx(
|
|
35
|
+
StyledTableWrapper,
|
|
36
|
+
{
|
|
37
|
+
role: "table",
|
|
38
|
+
"aria-rowcount": allDataFlattened.length,
|
|
39
|
+
"aria-colcount": visibleColumns.length,
|
|
40
|
+
"data-testid": DATA_TESTID.DATA_TABLE_TABLE,
|
|
41
|
+
children: /* @__PURE__ */ jsx(VirtualRowsList, {})
|
|
42
|
+
}
|
|
43
|
+
),
|
|
44
|
+
pagination ? /* @__PURE__ */ jsx(Pagination, {}) : null
|
|
45
|
+
]
|
|
46
|
+
}
|
|
50
47
|
);
|
|
51
|
-
return PureTableContent;
|
|
52
48
|
};
|
|
53
|
-
var TableContent_default = TableContent;
|
|
54
49
|
export {
|
|
55
|
-
TableContent
|
|
56
|
-
TableContent_default as default
|
|
50
|
+
TableContent
|
|
57
51
|
};
|
|
58
52
|
//# sourceMappingURL=TableContent.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/TableContent.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext,
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext, useCallback } 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\nexport const TableContent = () => {\n const {\n tableProps: { pagination },\n allDataFlattened,\n visibleColumns,\n isShiftPressed,\n setIsShiftPressed,\n } = useContext(DataTableContext);\n\n const handleOnKeyDown: React.KeyboardEventHandler = useCallback(\n (e) => {\n setIsShiftPressed(e.shiftKey);\n },\n [setIsShiftPressed],\n );\n\n const handleOnKeyUp = useCallback(() => setIsShiftPressed(false), [setIsShiftPressed]);\n\n return (\n <StyledDataTableContentWrapper\n data-testid={DATA_TESTID.DATA_TABLE_CONTENT_WRAPPER}\n noSelectionAllowed={isShiftPressed}\n onKeyDown={handleOnKeyDown}\n onKeyUp={handleOnKeyUp}\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};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC2BnB,SAcI,KAdJ;AA3BJ,SAAgB,YAAY,mBAAmB;AAE/C,SAAS,oBAAoB,qCAAqC;AAClE,SAAS,wBAAwB;AACjC,SAAS,kBAAkB;AAC3B,SAAS,uBAAuB;AAChC,SAAS,mBAAmB;AAErB,MAAM,eAAe,MAAM;AAChC,QAAM;AAAA,IACJ,YAAY,EAAE,WAAW;AAAA,IACzB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,gBAAgB;AAE/B,QAAM,kBAA8C;AAAA,IAClD,CAAC,MAAM;AACL,wBAAkB,EAAE,QAAQ;AAAA,IAC9B;AAAA,IACA,CAAC,iBAAiB;AAAA,EACpB;AAEA,QAAM,gBAAgB,YAAY,MAAM,kBAAkB,KAAK,GAAG,CAAC,iBAAiB,CAAC;AAErF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAa,YAAY;AAAA,MACzB,oBAAoB;AAAA,MACpB,WAAW;AAAA,MACX,SAAS;AAAA,MACT,MAAM,aAAa,CAAC,OAAO,MAAM,IAAI,CAAC,MAAM;AAAA,MAC5C,MAAM,CAAC,MAAM;AAAA,MAEb;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,MAAK;AAAA,YACL,iBAAe,iBAAiB;AAAA,YAChC,iBAAe,eAAe;AAAA,YAC9B,eAAa,YAAY;AAAA,YAEzB,8BAAC,mBAAgB;AAAA;AAAA,QACnB;AAAA,QACC,aAAa,oBAAC,cAAW,IAAK;AAAA;AAAA;AAAA,EACjC;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/VirtualRowsList.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext, useMemo, useCallback } from 'react';\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 { DataTableContext } from '../DataTableContext';\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 },\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 const tableContentWrapperHeight = useMemo(\n () => (isEmptyContent || isLoading ? '100%' : totalSize),\n [isEmptyContent, isLoading, totalSize],\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={tableContentWrapperHeight} rows={['min-content', 'auto']}>\n <Headers />\n {isEmptyContent && <EmptyContent width={totalColumnsWidth} />}\n {isLoading ? <Loader /> : null}\n {!isLoading && !isEmptyContent && <Rows />}\n </StyledTableContentWrapper>\n </StyledVirtualListWrapper>\n );\n};\n
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;AC+CjB,SACE,KADF;AA/CN,SAAgB,YAAY,SAAS,mBAAmB;AACxD,SAAS,oBAAoB;AAC7B,SAAS,mBAAmB,YAAY;AACxC,SAAS,eAAe;AACxB,SAAS,wBAAwB;AACjC,SAAS,0BAA0B,iCAAiC;AACpE,SAAS,kBAAkB,cAAc;AACzC,SAAS,mBAAmB;AAErB,MAAM,kBAAkB,MAAM;AACnC,QAAM;AAAA,IACJ;AAAA,IACA,YAAY,EAAE,UAAU;AAAA,IACxB;AAAA,IACA,eAAe,EAAE,kBAAkB;AAAA,IACnC;AAAA,IACA;AAAA,EACF,IAAI,WAAW,gBAAgB;AAC/B,QAAM,EAAE,WAAW,cAAc,IAAI;AAErC,QAAM,iBAAiB,QAAQ,MAAM,CAAC,aAAa,cAAc,WAAW,GAAG,CAAC,WAAW,cAAc,MAAM,CAAC;AAEhH,QAAM,YAAY;AAAA,IAChB,CAAC,MAA2B;AAC1B,UAAI,EAAE,WAAW,EAAE,SAAS,OAAO;AACjC,sBAAc,cAAc,SAAS,CAAC;AACtC,wBAAgB,cAAc,cAAc,SAAS,GAAG,GAAG;AAAA,MAC7D,WAAW,EAAE,WAAW,EAAE,SAAS,QAAQ;AACzC,sBAAc,GAAG,EAAE,OAAO,SAAS,CAAC;AACpC,wBAAgB,cAAc,GAAG,GAAG;AAAA,MACtC;AAAA,IACF;AAAA,IACA,CAAC,eAAe,iBAAiB,aAAa;AAAA,EAChD;AAEA,QAAM,4BAA4B;AAAA,IAChC,MAAO,kBAAkB,YAAY,SAAS;AAAA,IAC9C,CAAC,gBAAgB,WAAW,SAAS;AAAA,EACvC;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,KAAK;AAAA,MACL,eAAa,YAAY;AAAA,MACzB;AAAA,MACA,UAAU;AAAA,MAEV,+BAAC,6BAA0B,MAAK,YAAW,QAAQ,2BAA2B,MAAM,CAAC,eAAe,MAAM,GACxG;AAAA,4BAAC,WAAQ;AAAA,QACR,kBAAkB,oBAAC,gBAAa,OAAO,mBAAmB;AAAA,QAC1D,YAAY,oBAAC,UAAO,IAAK;AAAA,QACzB,CAAC,aAAa,CAAC,kBAAkB,oBAAC,QAAK;AAAA,SAC1C;AAAA;AAAA,EACF;AAEJ;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext, useMemo, useCallback } from 'react';\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 { DataTableContext } from '../DataTableContext';\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 },\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 const tableContentWrapperHeight = useMemo(\n () => (isEmptyContent || isLoading ? '100%' : totalSize),\n [isEmptyContent, isLoading, totalSize],\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={tableContentWrapperHeight} rows={['min-content', 'auto']}>\n <Headers />\n {isEmptyContent && <EmptyContent width={totalColumnsWidth} />}\n {isLoading ? <Loader /> : null}\n {!isLoading && !isEmptyContent && <Rows />}\n </StyledTableContentWrapper>\n </StyledVirtualListWrapper>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC+CjB,SACE,KADF;AA/CN,SAAgB,YAAY,SAAS,mBAAmB;AACxD,SAAS,oBAAoB;AAC7B,SAAS,mBAAmB,YAAY;AACxC,SAAS,eAAe;AACxB,SAAS,wBAAwB;AACjC,SAAS,0BAA0B,iCAAiC;AACpE,SAAS,kBAAkB,cAAc;AACzC,SAAS,mBAAmB;AAErB,MAAM,kBAAkB,MAAM;AACnC,QAAM;AAAA,IACJ;AAAA,IACA,YAAY,EAAE,UAAU;AAAA,IACxB;AAAA,IACA,eAAe,EAAE,kBAAkB;AAAA,IACnC;AAAA,IACA;AAAA,EACF,IAAI,WAAW,gBAAgB;AAC/B,QAAM,EAAE,WAAW,cAAc,IAAI;AAErC,QAAM,iBAAiB,QAAQ,MAAM,CAAC,aAAa,cAAc,WAAW,GAAG,CAAC,WAAW,cAAc,MAAM,CAAC;AAEhH,QAAM,YAAY;AAAA,IAChB,CAAC,MAA2B;AAC1B,UAAI,EAAE,WAAW,EAAE,SAAS,OAAO;AACjC,sBAAc,cAAc,SAAS,CAAC;AACtC,wBAAgB,cAAc,cAAc,SAAS,GAAG,GAAG;AAAA,MAC7D,WAAW,EAAE,WAAW,EAAE,SAAS,QAAQ;AACzC,sBAAc,GAAG,EAAE,OAAO,SAAS,CAAC;AACpC,wBAAgB,cAAc,GAAG,GAAG;AAAA,MACtC;AAAA,IACF;AAAA,IACA,CAAC,eAAe,iBAAiB,aAAa;AAAA,EAChD;AAEA,QAAM,4BAA4B;AAAA,IAChC,MAAO,kBAAkB,YAAY,SAAS;AAAA,IAC9C,CAAC,gBAAgB,WAAW,SAAS;AAAA,EACvC;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,KAAK;AAAA,MACL,eAAa,YAAY;AAAA,MACzB;AAAA,MACA,UAAU;AAAA,MAEV,+BAAC,6BAA0B,MAAK,YAAW,QAAQ,2BAA2B,MAAM,CAAC,eAAe,MAAM,GACxG;AAAA,4BAAC,WAAQ;AAAA,QACR,kBAAkB,oBAAC,gBAAa,OAAO,mBAAmB;AAAA,QAC1D,YAAY,oBAAC,UAAO,IAAK;AAAA,QACzB,CAAC,aAAa,CAAC,kBAAkB,oBAAC,QAAK;AAAA,SAC1C;AAAA;AAAA,EACF;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/styled.js
CHANGED
|
@@ -45,7 +45,7 @@ const StyledTableContentWrapper = styled(Grid)`
|
|
|
45
45
|
height: ${sizeToCss(height)};
|
|
46
46
|
`}
|
|
47
47
|
`;
|
|
48
|
-
const StyledVirtualListWrapper = styled
|
|
48
|
+
const StyledVirtualListWrapper = styled(Grid)`
|
|
49
49
|
overflow: auto;
|
|
50
50
|
height: 100%;
|
|
51
51
|
width: 100%;
|
|
@@ -62,7 +62,7 @@ const getGridTemplateColumnsStyle = ({
|
|
|
62
62
|
}
|
|
63
63
|
return `grid-template-columns: ${cols.map((col) => `minmax(0, ${col})`).join(" ")}`;
|
|
64
64
|
};
|
|
65
|
-
const StyledHeadWrapper = styled
|
|
65
|
+
const StyledHeadWrapper = styled(Grid)`
|
|
66
66
|
position: relative; /* ie11 fallback */
|
|
67
67
|
position: sticky;
|
|
68
68
|
top: 0;
|
|
@@ -219,7 +219,7 @@ const StyledCellContainer = styled(Grid)`
|
|
|
219
219
|
min-height: ${(props) => props.minHeight || "36px"};
|
|
220
220
|
height: ${(props) => props.height || "auto"};
|
|
221
221
|
|
|
222
|
-
width:
|
|
222
|
+
width: 100%;
|
|
223
223
|
${(props) => props.isDragOverlay ? "width: fit-content;" : ""};
|
|
224
224
|
${(props) => getGridTemplateColumnsStyle({
|
|
225
225
|
cols: props.cols,
|
package/dist/esm/styled.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/styled.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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 }, color?: string) => `\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 ${color ?? 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)<
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,cAAc;AACvB,SAAS,YAAY;AACrB,SAAS,kBAAkB;AAC3B,SAAS,WAAW,aAAa,qBAAqB;AACtD,SAAS,uBAAuB;AAChC,SAAS,uBAAuB;AAOhC,MAAM,iBAAiB,CAAC,EAAE,MAAM,GAAG,UAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAShC,SAAS,MAAM,OAAO,MAAM;AAAA;AAAA,aAErC,gBAAgB;AAAA;AAGtB,MAAM,oBAAoB,OAAO,IAAI;AAAA;AAAA,MAEtC,CAAC,UAAW,MAAM,YAAY,KAAK,eAAe,KAAK;AAAA;AAAA;AAItD,MAAM,yBAAyB,OAAO,IAAI;AAAA,WACtC,CAAC,UAAU,UAAU,MAAM,SAAS,OAAO;AAAA,YAC1C,CAAC,UAAU,UAAU,MAAM,UAAU,OAAO;AAAA;AAGjD,MAAM,gCAAgC,OAAO,IAAI;AAAA,iBACvC,CAAC,EAAE,mBAAmB,MAAO,qBAAqB,SAAS;AAAA;AAAA;AAIrE,MAAM,qBAAqB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQlC,MAAM,4BAA4B,OAAO,IAAI;AAAA;AAAA,IAEhD,CAAC,EAAE,SAAS,OAAO,MAAM;AAAA,YACjB,UAAU,MAAM;AAAA;AAAA;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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 }, color?: string) => `\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 ${color ?? 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)<{ 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(Grid)<WidthAndHeight>`\n position: relative;\n ${({ height = 'auto' }) => `\n height: ${sizeToCss(height)};\n `}\n`;\n\nexport const StyledVirtualListWrapper = styled(Grid)`\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(Grid)<{\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)<{ isExpandable: boolean; colsLayoutStyle: ColsLayoutStyle }>`\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 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`;\n\nexport const GroupHeaderContainer = styled(Grid)<{ paddingLeft: string }>`\n position: relative;\n background-color: ${({ theme }) => theme.colors.brand[200]};\n align-items: center;\n padding-left: ${(props) => props.paddingLeft};\n border-top: 1px solid ${({ theme }) => theme.colors.brand[300]};\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)<{ backgroundColor?: string }>`\n position: relative;\n z-index: 2;\n\n min-height: ${(props) => props.minHeight || '36px'};\n height: ${(props) => props.height || 'auto'};\n\n width: 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, isDropValid, theme }) => {\n if (!isDropIndicatorPositionInside) return '';\n return styledFocusCss({ theme }, isDropValid ? theme.colors.brand[700] : theme.colors.danger[900]);\n }}\n\n ${({ shouldDisplayHover, theme, isDisabled }) =>\n shouldDisplayHover && !isDisabled\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 ${GroupHeaderTitle} {\n color: ${(props) => (props.isDisabled ? props.theme.colors.neutral['200'] : props.theme.colors.neutral['700'])};\n }\n color: ${(props) => (props.isDisabled ? props.theme.colors.neutral['200'] : '#333333')};\n\n svg {\n fill: ${(props) => (props.isDisabled ? props.theme.colors.neutral['200'] : props.theme.colors.brand['800'])};\n }\n`;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,cAAc;AACvB,SAAS,YAAY;AACrB,SAAS,kBAAkB;AAC3B,SAAS,WAAW,aAAa,qBAAqB;AACtD,SAAS,uBAAuB;AAChC,SAAS,uBAAuB;AAOhC,MAAM,iBAAiB,CAAC,EAAE,MAAM,GAAG,UAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAShC,SAAS,MAAM,OAAO,MAAM;AAAA;AAAA,aAErC,gBAAgB;AAAA;AAGtB,MAAM,oBAAoB,OAAO,IAAI;AAAA;AAAA,MAEtC,CAAC,UAAW,MAAM,YAAY,KAAK,eAAe,KAAK;AA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