@elliemae/ds-data-table 3.6.0-next.5 → 3.6.0-next.6
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/parts/Cells/useCellStyle.js +2 -2
- package/dist/cjs/parts/Cells/useCellStyle.js.map +2 -2
- package/dist/cjs/styled.js +0 -2
- package/dist/cjs/styled.js.map +2 -2
- package/dist/cjs/types/props.js.map +2 -2
- package/dist/esm/parts/Cells/useCellStyle.js +2 -2
- package/dist/esm/parts/Cells/useCellStyle.js.map +2 -2
- package/dist/esm/styled.js +0 -2
- package/dist/esm/styled.js.map +2 -2
- package/dist/esm/types/props.js.map +2 -2
- package/package.json +18 -18
|
@@ -53,8 +53,8 @@ const useCellStyle = (column, shouldAddExpandCell) => {
|
|
|
53
53
|
newStyle.gridColumn = `span 2`;
|
|
54
54
|
newStyle.padding = `0 16px 0 2px`;
|
|
55
55
|
}
|
|
56
|
-
return newStyle;
|
|
57
|
-
}, [appliedTextWrap, shouldAddExpandCell]);
|
|
56
|
+
return { ...newStyle, ...column.cellStyle ?? {} };
|
|
57
|
+
}, [appliedTextWrap, column.cellStyle, shouldAddExpandCell]);
|
|
58
58
|
return [appliedTextWrap, cellStyle];
|
|
59
59
|
};
|
|
60
60
|
//# sourceMappingURL=useCellStyle.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/Cells/useCellStyle.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { useContext, useMemo, type CSSProperties } from 'react';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAwD;AAExD,8BAAiC;AAE1B,MAAM,eAAe,
|
|
4
|
+
"sourcesContent": ["import { useContext, useMemo, type CSSProperties } from 'react';\nimport { InternalTypescriptColumn } from '../../types/props';\nimport { DataTableContext } from '../../DataTableContext';\n\nexport const useCellStyle = (\n column: InternalTypescriptColumn,\n shouldAddExpandCell: boolean,\n): [string, CSSProperties] => {\n const {\n tableProps: { textWrap },\n } = useContext(DataTableContext);\n\n const appliedTextWrap = column.textWrap || textWrap;\n\n const cellStyle = useMemo(() => {\n const newStyle: CSSProperties = {};\n switch (appliedTextWrap) {\n case 'wrap-all':\n newStyle.wordBreak = 'break-all';\n break;\n case 'truncate':\n newStyle.whiteSpace = 'nowrap';\n break;\n case 'wrap':\n default:\n newStyle.whiteSpace = 'normal';\n break;\n }\n if (shouldAddExpandCell) {\n newStyle.gridColumn = `span 2`;\n newStyle.padding = `0 16px 0 2px`;\n }\n return { ...newStyle, ...(column.cellStyle ?? {}) };\n }, [appliedTextWrap, column.cellStyle, shouldAddExpandCell]);\n\n return [appliedTextWrap, cellStyle];\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAwD;AAExD,8BAAiC;AAE1B,MAAM,eAAe,CAC1B,QACA,wBAC4B;AAC5B,QAAM;AAAA,IACJ,YAAY,EAAE,SAAS;AAAA,EACzB,QAAI,yBAAW,wCAAgB;AAE/B,QAAM,kBAAkB,OAAO,YAAY;AAE3C,QAAM,gBAAY,sBAAQ,MAAM;AAC9B,UAAM,WAA0B,CAAC;AACjC,YAAQ;AAAA,WACD;AACH,iBAAS,YAAY;AACrB;AAAA,WACG;AACH,iBAAS,aAAa;AACtB;AAAA,WACG;AAAA;AAEH,iBAAS,aAAa;AACtB;AAAA;AAEJ,QAAI,qBAAqB;AACvB,eAAS,aAAa;AACtB,eAAS,UAAU;AAAA,IACrB;AACA,WAAO,EAAE,GAAG,UAAU,GAAI,OAAO,aAAa,CAAC,EAAG;AAAA,EACpD,GAAG,CAAC,iBAAiB,OAAO,WAAW,mBAAmB,CAAC;AAE3D,SAAO,CAAC,iBAAiB,SAAS;AACpC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/styled.js
CHANGED
|
@@ -207,8 +207,6 @@ const StyledActionCell = import_ds_system.styled.div`
|
|
|
207
207
|
`;
|
|
208
208
|
const StyledCell = import_ds_system.styled.div`
|
|
209
209
|
${import_helpers.cellPadding}
|
|
210
|
-
/* border-bottom: 1px solid #ebedf0; */
|
|
211
|
-
/* box-sizing: border-box; */
|
|
212
210
|
display: flex;
|
|
213
211
|
align-items: center;
|
|
214
212
|
width: 100%;
|
package/dist/cjs/styled.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/styled.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\nimport { styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { EditPencil } from '@elliemae/ds-icons';\nimport { sizeToCss, cellPadding, columnPadding } from './helpers';\nimport { ZIndexDataTable } from './configs/zIndexInternalConfig';\nimport { ColsLayoutStyle } from './configs/constants';\n\ninterface WidthAndHeight {\n width?: string | number;\n height?: string | number;\n}\n\nconst styledFocusCss = ({ theme }) => `\n&:after {\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 2px solid ${theme.colors.brand[700]};\n pointer-events: none;\n z-index: ${ZIndexDataTable.FOCUS_BORDER};\n}`;\n\nexport const StyledFocusWithin = styled(Grid)`\n :focus-within {\n ${(props) => (props.hideFocus ? '' : styledFocusCss(props))}\n }\n`;\n\nexport const StyledDataTableWrapper = styled(Grid)<WidthAndHeight>`\n width: ${(props) => sizeToCss(props.width ?? ' 100%')};\n height: ${(props) => sizeToCss(props.height ?? ' 100%')};\n`;\n\nexport const StyledDataTableContentWrapper = styled(Grid)<WidthAndHeight & { noSelectionAllowed: boolean }>`\n user-select: ${({ noSelectionAllowed }) => (noSelectionAllowed ? 'none' : 'auto')};\n width: 100%;\n`;\n\nexport const StyledTableWrapper = styled.div<WidthAndHeight>`\n display: inline-block;\n border-spacing: 0;\n z-index: 0;\n position: relative;\n width: 100%;\n height: 100%;\n`;\nexport const StyledTableContentWrapper = styled.div<WidthAndHeight>`\n position: relative;\n ${({ height = 'auto' }) => `\n height: ${sizeToCss(height)};\n `}\n`;\nexport const StyledVirtualListWrapper = styled.div<WidthAndHeight>`\n overflow: auto;\n height: 100%;\n width: 100%;\n`;\n\n/**\n * HEADER\n */\ntype gridTemplateColumnStyleProps = {\n cols: string[];\n isExpandable: boolean;\n colsLayoutStyle: ColsLayoutStyle;\n};\nconst getGridTemplateColumnsStyle = ({\n cols,\n colsLayoutStyle = ColsLayoutStyle.Auto,\n}: gridTemplateColumnStyleProps) => {\n if (!cols) return '';\n if (colsLayoutStyle === 'fixed') {\n const widthAttr = cols.map((col) => `minmax(0, ${col})`).join(' ');\n return `grid-template-columns: ${widthAttr}`;\n }\n\n return `grid-template-columns: ${cols.map((col) => `minmax(0, ${col})`).join(' ')}`;\n};\n\nexport const StyledHeadWrapper = styled.div<{\n colsLayoutStyle: string;\n totalColumnsWidth: number | string;\n}>`\n position: relative; /* ie11 fallback */\n position: sticky;\n top: 0;\n z-index: 4;\n background: white;\n width: ${(props) => (props.colsLayoutStyle === ColsLayoutStyle.Fixed ? sizeToCss(props.totalColumnsWidth) : '100%')};\n`;\n\nexport const StyledHeadTr = styled(Grid)`\n ${(props) => (props.colsLayoutStyle === ColsLayoutStyle.Auto ? 'width:100%' : '')};\n ${(props) =>\n getGridTemplateColumnsStyle({\n cols: props.cols,\n isExpandable: props.isExpandable,\n colsLayoutStyle: props.colsLayoutStyle,\n })};\n border-right: 1px solid ${(props) => props.theme.colors.neutral['080']};\n border-bottom: 1px solid ${(props) => props.theme.colors.neutral['080']};\n grid-auto-flow: column;\n`;\n\nexport const StyledHeadTh = styled.div<any>`\n min-height: 24px;\n line-height: normal;\n font-weight: 600;\n text-transform: uppercase;\n font-size: 0.923rem;\n text-align: left;\n ${columnPadding}\n color: #353c46;\n min-height: 1.84615rem;\n position: sticky;\n z-index: ${ZIndexDataTable.HEADER_ROW};\n display: flex;\n justify-content: space-between;\n box-sizing: border-box;\n outline: none;\n ${(props) =>\n props.isDraggingActive\n ? ''\n : `:hover {\n &:after {\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border-bottom: 1px solid ${props.theme.colors.brand[700]};\n pointer-events: none;\n z-index: ${ZIndexDataTable.FOCUS_BORDER};\n }\n cursor: pointer;\n }`}\n\n :focus {\n &:after {\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 2px solid ${(props) => props.theme.colors.brand[700]};\n pointer-events: none;\n z-index: ${ZIndexDataTable.FOCUS_BORDER};\n }\n }\n`;\n\nexport const StyledHeaderRightIconsWrapper = styled.div`\n height: 100%;\n display: flex;\n align-items: center;\n max-height: 24px;\n`;\n\nexport const StyledResizer = styled.div<{ isResizing: boolean }>`\n display: inline-block;\n background: transparent;\n width: 4px;\n height: 100%;\n position: absolute;\n right: 0;\n top: 0;\n z-index: 1;\n\n // prevents from scrolling while dragging on touch devices\n touch-action: none;\n\n cursor: col-resize;\n`;\n\n// CELL ***********************************************************************/\nexport const StyledActionCell = styled.div`\n position: relative; /* ie11 fallback */\n position: sticky;\n display: inline-block;\n right: 0;\n /* border-bottom: 1px solid #ebedf0; */\n background: white;\n`;\n\nexport const StyledCell = styled.div`\n ${cellPadding}\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,uBAAuB;A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ae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { EditPencil } from '@elliemae/ds-icons';\nimport { sizeToCss, cellPadding, columnPadding } from './helpers';\nimport { ZIndexDataTable } from './configs/zIndexInternalConfig';\nimport { ColsLayoutStyle } from './configs/constants';\n\ninterface WidthAndHeight {\n width?: string | number;\n height?: string | number;\n}\n\nconst styledFocusCss = ({ theme }) => `\n&:after {\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 2px solid ${theme.colors.brand[700]};\n pointer-events: none;\n z-index: ${ZIndexDataTable.FOCUS_BORDER};\n}`;\n\nexport const StyledFocusWithin = styled(Grid)`\n :focus-within {\n ${(props) => (props.hideFocus ? '' : styledFocusCss(props))}\n }\n`;\n\nexport const StyledDataTableWrapper = styled(Grid)<WidthAndHeight>`\n width: ${(props) => sizeToCss(props.width ?? ' 100%')};\n height: ${(props) => sizeToCss(props.height ?? ' 100%')};\n`;\n\nexport const StyledDataTableContentWrapper = styled(Grid)<WidthAndHeight & { noSelectionAllowed: boolean }>`\n user-select: ${({ noSelectionAllowed }) => (noSelectionAllowed ? 'none' : 'auto')};\n width: 100%;\n`;\n\nexport const StyledTableWrapper = styled.div<WidthAndHeight>`\n display: inline-block;\n border-spacing: 0;\n z-index: 0;\n position: relative;\n width: 100%;\n height: 100%;\n`;\nexport const StyledTableContentWrapper = styled.div<WidthAndHeight>`\n position: relative;\n ${({ height = 'auto' }) => `\n height: ${sizeToCss(height)};\n `}\n`;\nexport const StyledVirtualListWrapper = styled.div<WidthAndHeight>`\n overflow: auto;\n height: 100%;\n width: 100%;\n`;\n\n/**\n * HEADER\n */\ntype gridTemplateColumnStyleProps = {\n cols: string[];\n isExpandable: boolean;\n colsLayoutStyle: ColsLayoutStyle;\n};\nconst getGridTemplateColumnsStyle = ({\n cols,\n colsLayoutStyle = ColsLayoutStyle.Auto,\n}: gridTemplateColumnStyleProps) => {\n if (!cols) return '';\n if (colsLayoutStyle === 'fixed') {\n const widthAttr = cols.map((col) => `minmax(0, ${col})`).join(' ');\n return `grid-template-columns: ${widthAttr}`;\n }\n\n return `grid-template-columns: ${cols.map((col) => `minmax(0, ${col})`).join(' ')}`;\n};\n\nexport const StyledHeadWrapper = styled.div<{\n colsLayoutStyle: string;\n totalColumnsWidth: number | string;\n}>`\n position: relative; /* ie11 fallback */\n position: sticky;\n top: 0;\n z-index: 4;\n background: white;\n width: ${(props) => (props.colsLayoutStyle === ColsLayoutStyle.Fixed ? sizeToCss(props.totalColumnsWidth) : '100%')};\n`;\n\nexport const StyledHeadTr = styled(Grid)`\n ${(props) => (props.colsLayoutStyle === ColsLayoutStyle.Auto ? 'width:100%' : '')};\n ${(props) =>\n getGridTemplateColumnsStyle({\n cols: props.cols,\n isExpandable: props.isExpandable,\n colsLayoutStyle: props.colsLayoutStyle,\n })};\n border-right: 1px solid ${(props) => props.theme.colors.neutral['080']};\n border-bottom: 1px solid ${(props) => props.theme.colors.neutral['080']};\n grid-auto-flow: column;\n`;\n\nexport const StyledHeadTh = styled.div<any>`\n min-height: 24px;\n line-height: normal;\n font-weight: 600;\n text-transform: uppercase;\n font-size: 0.923rem;\n text-align: left;\n ${columnPadding}\n color: #353c46;\n min-height: 1.84615rem;\n position: sticky;\n z-index: ${ZIndexDataTable.HEADER_ROW};\n display: flex;\n justify-content: space-between;\n box-sizing: border-box;\n outline: none;\n ${(props) =>\n props.isDraggingActive\n ? ''\n : `:hover {\n &:after {\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border-bottom: 1px solid ${props.theme.colors.brand[700]};\n pointer-events: none;\n z-index: ${ZIndexDataTable.FOCUS_BORDER};\n }\n cursor: pointer;\n }`}\n\n :focus {\n &:after {\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 2px solid ${(props) => props.theme.colors.brand[700]};\n pointer-events: none;\n z-index: ${ZIndexDataTable.FOCUS_BORDER};\n }\n }\n`;\n\nexport const StyledHeaderRightIconsWrapper = styled.div`\n height: 100%;\n display: flex;\n align-items: center;\n max-height: 24px;\n`;\n\nexport const StyledResizer = styled.div<{ isResizing: boolean }>`\n display: inline-block;\n background: transparent;\n width: 4px;\n height: 100%;\n position: absolute;\n right: 0;\n top: 0;\n z-index: 1;\n\n // prevents from scrolling while dragging on touch devices\n touch-action: none;\n\n cursor: col-resize;\n`;\n\n// CELL ***********************************************************************/\nexport const StyledActionCell = styled.div`\n position: relative; /* ie11 fallback */\n position: sticky;\n display: inline-block;\n right: 0;\n /* border-bottom: 1px solid #ebedf0; */\n background: white;\n`;\n\nexport const StyledCell = styled.div`\n ${cellPadding}\n display: flex;\n align-items: center;\n width: 100%;\n position: relative;\n`;\n\nexport const StyledCellContent = styled.div`\n display: grid;\n justify-self: flex-end;\n flex: 1 1 auto;\n width: 100%;\n height: 100%;\n align-items: center;\n`;\n\nexport const StyledPencilIcon = styled(EditPencil)``;\n\nexport const StyledEditableContainer = styled(Grid)<{ shouldDisplayEditIcon: string }>`\n width: 100%;\n height: 100%;\n align-items: center;\n & ${StyledPencilIcon} {\n display: ${({ shouldDisplayEditIcon }) => (shouldDisplayEditIcon ? 'block' : 'none')};\n }\n &:hover {\n ${StyledPencilIcon} {\n display: block;\n }\n }\n &:focus {\n ${styledFocusCss}\n ${StyledPencilIcon} {\n display: block;\n }\n }\n outline: none;\n`;\n\n// ROW ************************************************************************/\nexport const StyledFullsizeGrid = styled(Grid)`\n position: relative;\n z-index: ${ZIndexDataTable.ROW};\n\n min-height: ${(props) => props.minHeight || '36px'};\n height: ${(props) => props.height || 'auto'};\n /* width: ${(props) =>\n props.colsLayoutStyle === ColsLayoutStyle.Fixed ? sizeToCss(props.totalColumnsWidth) : '100%'}; */\n`;\n\nexport const GroupHeaderContainer = styled(Grid)<{ padding: string }>`\n position: relative;\n background-color: ${({ theme }) => theme.colors.brand[200]};\n align-items: center;\n padding: 0 ${(props) => props.padding};\n border-top: 1px solid ${({ theme }) => theme.colors.brand[300]};\n grid-template-columns: min-content 1fr;\n`;\n\nexport const GroupHeaderTitle = styled.span`\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n font-size: 12px;\n color: ${(props) => props.theme.colors.neutral[700]};\n`;\n\nexport const StyledCellContainer = styled(Grid)`\n position: relative;\n z-index: 2;\n\n min-height: ${(props) => props.minHeight || '36px'};\n height: ${(props) => props.height || 'auto'};\n\n width: ${(props) => (props.colLayoutStyle === ColsLayoutStyle.Fixed ? sizeToCss(props.totalColumnsWidth) : '100%')};\n ${(props) => (props.isDragOverlay ? 'width: fit-content;' : '')};\n ${(props) =>\n getGridTemplateColumnsStyle({\n cols: props.cols,\n colsLayoutStyle: props.colLayoutStyle,\n isExpandable: props.isExpandable,\n })};\n background-color: ${({ backgroundColor, isDragging, theme }) =>\n isDragging ? theme.colors.neutral[100] : backgroundColor || 'white'};\n\n outline: none;\n\n :focus {\n ${(props) => (props.isDragOverlay ? '' : styledFocusCss(props))}\n }\n\n ${({ isDropIndicatorPositionInside, theme }) => {\n if (!isDropIndicatorPositionInside) return '';\n return styledFocusCss({ theme });\n }}\n\n ${({ shouldDisplayHover, theme, disabled }) =>\n shouldDisplayHover && !disabled\n ? `:hover {\n background-color: ${theme.colors.brand[200]};\n }`\n : ''}\n\n box-shadow: 0 2px 4px 0 ${(props) => (props.isDragOverlay ? 'rgba(0,0,0,0.5)' : 'transparent')};\n\n opacity: ${(props) => (props.isDragging ? 0.8 : 1)};\n\n ${(props) =>\n !props.selected\n ? ''\n : `\n background-color: ${props.theme.colors.brand[200]};\n border: 1px solid ${props.theme.colors.brand[500]};\n `}\n\n color: ${(props) => (props.disabled ? props.theme.colors.neutral['500'] : '#333333')};\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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MAAM,MAAM;AAAA,EACZ,iBAAiB,MAAM;AAAA,EACvB,cAAc,MAAM;AACtB,CAAC;AAAA,sBACiB,CAAC,EAAE,iBAAiB,YAAY,MAAM,MACxD,aAAa,MAAM,OAAO,QAAQ,OAAO,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAAA,MAK1D,CAAC,UAAW,MAAM,gBAAgB,KAAK,eAAe,KAAK;AAAA;AAAA;AAAA,IAG7D,CAAC,EAAE,+BAA+B,MAAM,MAAM;AAC9C,MAAI,CAAC;AAA+B,WAAO;AAC3C,SAAO,eAAe,EAAE,MAAM,CAAC;AACjC;AAAA;AAAA,IAEE,CAAC,EAAE,oBAAoB,OAAO,SAAS,MACvC,sBAAsB,CAAC,WACnB;AAAA,gCACwB,MAAM,OAAO,MAAM;AAAA,eAE3C;AAAA;AAAA,4BAEoB,CAAC,UAAW,MAAM,gBAAgB,oBAAoB;AAAA;AAAA,aAErE,CAAC,UAAW,MAAM,aAAa,MAAM;AAAA;AAAA,IAE9C,CAAC,UACD,CAAC,MAAM,WACH,KACA;AAAA,wBACgB,MAAM,MAAM,OAAO,MAAM;AAAA,wBACzB,MAAM,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA,WAGtC,CAAC,UAAW,MAAM,WAAW,MAAM,MAAM,OAAO,QAAQ,SAAS;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/types/props.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\nimport React, { MutableRefObject } from 'react';\nimport { useVirtual } from 'react-virtual/types';\nimport { useSortable } from '@elliemae/ds-drag-and-drop';\nimport { ColsLayoutStyle } from '../configs/constants';\n\nexport type TypescriptGenericFunc = (...args: unknown[]) => unknown;\ninterface FilterOptionT {\n dsId: string;\n type: string;\n value: string;\n label: string;\n}\n\ninterface HeaderComponentProps {\n ctx: TypescriptContext;\n}\n\nexport type DraggablePropsT =\n | false\n | (ReturnType<typeof useSortable> & {\n dropIndicatorPosition: DropIndicatorPosition;\n shouldShowDropIndicatorPosition: boolean;\n lastActiveId?: string;\n setLastActiveId?: React.Dispatch<React.SetStateAction<string>>;\n });\n\ninterface CellComponentProps<T = HTMLElement> {\n ctx: TypescriptContext;\n isRowSelected: boolean;\n row: InternalTypescriptRow;\n cell: TypescriptCell<T>;\n draggableProps: DraggablePropsT;\n isDragOverlay: boolean;\n}\n\nexport enum DropIndicatorPosition {\n None = 0,\n Before = 1,\n After = 2,\n Inside = 3,\n}\n\nexport interface TypescriptColumn<T extends HTMLElement = HTMLElement> {\n id?: string;\n Header: string | React.ComponentType<HeaderComponentProps>;\n accessor?: string;\n filter?: string;\n filterOptions?: FilterOptionT[] | (() => FilterOptionT[]);\n filterMinWidth?: number | string;\n Filter?: React.ComponentType<FilterProps>;\n Cell?: React.ComponentType<CellComponentProps<T>>;\n editable?: string | TypescriptGenericFunc;\n disableDnD?: boolean;\n width?: number;\n minWidth?: number;\n maxWidth?: number;\n padding?: number;\n columns?: TypescriptColumn[];\n canSort?: boolean;\n isSortedDesc?: boolean;\n canResize?: boolean;\n isFocuseable?: boolean;\n textWrap?: 'wrap' | 'wrap-all' | 'truncate';\n ref?: React.MutableRefObject<HTMLTableColElement>;\n required?: boolean;\n alwaysDisplayEditIcon?: boolean;\n}\n\nexport interface InternalTypescriptColumn<T extends HTMLElement = HTMLElement> extends TypescriptColumn<T> {\n id: string;\n}\n\nexport interface TypescriptCell<T = HTMLElement> {\n column: TypescriptColumn;\n value: any;\n render: React.ComponentType<CellComponentProps>;\n row: InternalTypescriptRow;\n ref: React.RefObject<T>;\n id: string;\n}\n\nexport interface TypescriptRow {\n [key: string]: any;\n subRows: TypescriptRow[];\n tableRowDetails: React.ComponentType<any>;\n dimsumHeaderValue: string;\n}\n\nexport interface InternalTypescriptRow {\n id: string;\n uid: string;\n index: number;\n realIndex: number;\n parentId: string | null;\n parentIndex: number | null;\n depth: number;\n isExpanded: boolean;\n subRows: TypescriptRow[];\n childrenCount: number;\n original: TypescriptRow;\n cells: TypescriptCell[];\n}\n\nexport type RowVariant = 'ds-header-group-row' | 'ds-primary-row' | 'ds-secondary-row';\n\nexport type TypescriptRenderRowActionsConfig = {\n columnWidth: number;\n renderer: (...args: any[]) => JSX.Element;\n};\n\nexport type TypescriptRenderRowActions = false | TypescriptRenderRowActionsConfig;\n\nexport type TypescriptAppliedFilter = {\n id: string;\n type: string;\n value: any;\n};\n\nexport type TypescriptPagination = {\n page?: any[];\n pageIndex?: number;\n canPreviousPage?: boolean;\n canNextPage?: boolean;\n pageSize?: number;\n dataIsPage?: boolean;\n showPerPageSelector?: boolean;\n perPageOptions?: number[];\n perPageStep?: number;\n minPerPage?: number;\n maxPerPage?: number;\n onPageSizeChange?: (pageSize: number) => void;\n onPreviousPage?: () => void;\n onNextPage?: () => void;\n onPageChange?: (page: number) => void;\n pageCount?: number;\n pageDetails?: string[];\n pageDetailsTitle?: string;\n};\n\nexport type TypescriptSortBy = {\n id: string;\n desc: boolean;\n};\n\nexport type TypescriptSelectionItem = boolean | 'mixed';\n\nexport type TypescriptSelection = Record<string | number, TypescriptSelectionItem>;\n\nexport type UniqueRowAccessorType = string | string[] | ((row: TypescriptRow) => string) | undefined;\n\nexport interface ReduxHeader {\n hideFilterMenu: boolean;\n hideFilterButton: boolean;\n showDnDHandle: boolean;\n withTabStops: boolean;\n}\n\ninterface DataTableFilter {\n id: string;\n type: string;\n value: any;\n}\n\ninterface PropsWithDefault {\n height: string;\n width: string;\n renderRowActions: boolean;\n getRowVariant: (\n row: TypescriptRow,\n defaultCellRenderer: React.ComponentType<any>,\n ) => RowVariant | React.ComponentType<any>;\n withFilterBar: boolean;\n isExpandable: boolean;\n expandedRows: Record<string, boolean>;\n disabledRows: Record<string, boolean>;\n isResizeable: boolean;\n isLoading: boolean;\n pagination: false | TypescriptPagination;\n filters: DataTableFilter[];\n colsLayoutStyle: ColsLayoutStyle;\n hiddenColumns: string[];\n noResultsMessage: string;\n dragAndDropRows: boolean;\n maxDragAndDropLevel: number;\n onRowsReorder: (\n newData: TypescriptRow[],\n indexes: { targetIndex: number; fromIndex: number },\n considerExpanding: string,\n ) => void;\n dragAndDropColumns: boolean;\n onColumnsReorder: (newData: TypescriptColumn[], indexes: { targetIndex: number; fromIndex: number }) => void;\n onColumnResize: (headerId: string, width: number) => void;\n onColumnSizeChange: (newColumns: TypescriptColumn[], headerId: string, width: number) => void;\n onRowClick: TypescriptGenericFunc;\n onRowFocus: TypescriptGenericFunc;\n noSelectionColumn: boolean;\n selectSingle: boolean;\n onSelectionChange: (newSelection: TypescriptSelection, selectedControl: string, event: React.ChangeEvent) => void;\n textWrap: 'wrap' | 'wrap-all' | 'truncate';\n onCellValueChange: (cellChange: { value: any; property: any; rowIndex: number }) => void;\n onFiltersChange: TypescriptGenericFunc;\n onPageChanged: TypescriptGenericFunc;\n onRowExpand: (expandedRows: Record<string, boolean>, toggledRow: string) => void;\n onColumnSortChange: (newSortRequest: { column: any; direction: any }) => void;\n onColumnSort: (newColumns: TypescriptColumn[], headerId: string, direction: 'ASC' | 'DESC') => void;\n}\n\ninterface PropsRequired {\n columns: TypescriptColumn[];\n data: TypescriptRow[];\n}\n\ninterface PropsOptional {\n uniqueRowAccessor?: UniqueRowAccessorType;\n cellRendererProps?: Record<string, any>;\n selection?: TypescriptSelection;\n groupedRowsRenderHeader?: TypescriptGenericFunc | string;\n filterBarProps?: {\n filterBarAddonRenderer?: React.ComponentType<any>;\n customPillRenderer?: React.ComponentType<any>;\n extraOptions?: { type: string; id: string; label: string; onClick?: TypescriptGenericFunc }[];\n };\n actionRef?: React.RefObject<any>;\n noResultsSecondaryMessage?: string;\n noResultsButtonLabel?: string;\n noResultsPlaceholder?: TypescriptGenericFunc;\n onNoResultsButtonClick?: TypescriptGenericFunc;\n}\n\nexport interface TypescriptProps extends Partial<PropsWithDefault>, PropsRequired, PropsOptional {}\nexport interface InternalTypescriptProps extends PropsWithDefault, PropsRequired, PropsOptional {}\n\nexport interface FilterProps {\n column: TypescriptColumn;\n ctx: TypescriptContext;\n onFiltersChange?: (filters: DataTableFilter[]) => void;\n onValueChange: (type: string, value: any) => void;\n patchHeaderFilterButtonAndMenu: (headerId: string, newState: any) => void;\n patchHeader: (headerId: string, newHeader: any) => void;\n filterValue?: any;\n reduxHeader?: any;\n innerRef: MutableRefObject<HTMLDivElement | null>;\n}\n\nexport type TypescriptContext = {\n tableProps: InternalTypescriptProps;\n virtualListRef: React.RefObject<HTMLDivElement>;\n columnHeaderRef: React.RefObject<HTMLDivElement>;\n flattenedData: InternalTypescriptRow[];\n allDataFlattened: InternalTypescriptRow[];\n visibleColumns: TypescriptColumn[];\n virtualListHelpers?: ReturnType<typeof useVirtual>;\n layoutHelpers: {\n totalColumnsWidth?: number | string;\n gridLayout: string[];\n setGridLayout: React.Dispatch<React.SetStateAction<string[]>>;\n };\n paginationHelpers: TypescriptPagination;\n drilldownRowId: string | null;\n setDrilldownRowId: React.Dispatch<React.SetStateAction<string | null>>;\n focusedRowId: string | null;\n setFocusedRowId: React.Dispatch<React.SetStateAction<string | null>>;\n reduxHeaders: Record<string, ReduxHeader>;\n patchHeader: (headerId: string, newHeader: ReduxHeader) => void;\n patchHeaderFilterButtonAndMenu: (headerId: string, value: boolean) => void;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\nimport React, { MutableRefObject } from 'react';\nimport { useVirtual } from 'react-virtual/types';\nimport { useSortable } from '@elliemae/ds-drag-and-drop';\nimport { ColsLayoutStyle } from '../configs/constants';\nimport { CSSProperties } from 'styled-components';\n\nexport type TypescriptGenericFunc = (...args: unknown[]) => unknown;\ninterface FilterOptionT {\n dsId: string;\n type: string;\n value: string;\n label: string;\n}\n\ninterface HeaderComponentProps {\n ctx: TypescriptContext;\n}\n\nexport type DraggablePropsT =\n | false\n | (ReturnType<typeof useSortable> & {\n dropIndicatorPosition: DropIndicatorPosition;\n shouldShowDropIndicatorPosition: boolean;\n lastActiveId?: string;\n setLastActiveId?: React.Dispatch<React.SetStateAction<string>>;\n });\n\ninterface CellComponentProps<T = HTMLElement> {\n ctx: TypescriptContext;\n isRowSelected: boolean;\n row: InternalTypescriptRow;\n cell: TypescriptCell<T>;\n draggableProps: DraggablePropsT;\n isDragOverlay: boolean;\n}\n\nexport enum DropIndicatorPosition {\n None = 0,\n Before = 1,\n After = 2,\n Inside = 3,\n}\n\nexport interface TypescriptColumn<T extends HTMLElement = HTMLElement> {\n id?: string;\n Header: string | React.ComponentType<HeaderComponentProps>;\n accessor?: string;\n filter?: string;\n filterOptions?: FilterOptionT[] | (() => FilterOptionT[]);\n filterMinWidth?: number | string;\n Filter?: React.ComponentType<FilterProps>;\n Cell?: React.ComponentType<CellComponentProps<T>>;\n editable?: string | TypescriptGenericFunc;\n disableDnD?: boolean;\n width?: number;\n minWidth?: number;\n maxWidth?: number;\n padding?: number;\n columns?: TypescriptColumn[];\n canSort?: boolean;\n isSortedDesc?: boolean;\n canResize?: boolean;\n isFocuseable?: boolean;\n textWrap?: 'wrap' | 'wrap-all' | 'truncate';\n ref?: React.MutableRefObject<HTMLTableColElement>;\n required?: boolean;\n cellStyle?: CSSProperties;\n alwaysDisplayEditIcon?: boolean;\n}\n\nexport interface InternalTypescriptColumn<T extends HTMLElement = HTMLElement> extends TypescriptColumn<T> {\n id: string;\n}\n\nexport interface TypescriptCell<T = HTMLElement> {\n column: TypescriptColumn;\n value: any;\n render: React.ComponentType<CellComponentProps>;\n row: InternalTypescriptRow;\n ref: React.RefObject<T>;\n id: string;\n}\n\nexport interface TypescriptRow {\n [key: string]: any;\n subRows: TypescriptRow[];\n tableRowDetails: React.ComponentType<any>;\n dimsumHeaderValue: string;\n}\n\nexport interface InternalTypescriptRow {\n id: string;\n uid: string;\n index: number;\n realIndex: number;\n parentId: string | null;\n parentIndex: number | null;\n depth: number;\n isExpanded: boolean;\n subRows: TypescriptRow[];\n childrenCount: number;\n original: TypescriptRow;\n cells: TypescriptCell[];\n}\n\nexport type RowVariant = 'ds-header-group-row' | 'ds-primary-row' | 'ds-secondary-row';\n\nexport type TypescriptRenderRowActionsConfig = {\n columnWidth: number;\n renderer: (...args: any[]) => JSX.Element;\n};\n\nexport type TypescriptRenderRowActions = false | TypescriptRenderRowActionsConfig;\n\nexport type TypescriptAppliedFilter = {\n id: string;\n type: string;\n value: any;\n};\n\nexport type TypescriptPagination = {\n page?: any[];\n pageIndex?: number;\n canPreviousPage?: boolean;\n canNextPage?: boolean;\n pageSize?: number;\n dataIsPage?: boolean;\n showPerPageSelector?: boolean;\n perPageOptions?: number[];\n perPageStep?: number;\n minPerPage?: number;\n maxPerPage?: number;\n onPageSizeChange?: (pageSize: number) => void;\n onPreviousPage?: () => void;\n onNextPage?: () => void;\n onPageChange?: (page: number) => void;\n pageCount?: number;\n pageDetails?: string[];\n pageDetailsTitle?: string;\n};\n\nexport type TypescriptSortBy = {\n id: string;\n desc: boolean;\n};\n\nexport type TypescriptSelectionItem = boolean | 'mixed';\n\nexport type TypescriptSelection = Record<string | number, TypescriptSelectionItem>;\n\nexport type UniqueRowAccessorType = string | string[] | ((row: TypescriptRow) => string) | undefined;\n\nexport interface ReduxHeader {\n hideFilterMenu: boolean;\n hideFilterButton: boolean;\n showDnDHandle: boolean;\n withTabStops: boolean;\n}\n\ninterface DataTableFilter {\n id: string;\n type: string;\n value: any;\n}\n\ninterface PropsWithDefault {\n height: string;\n width: string;\n renderRowActions: boolean;\n getRowVariant: (\n row: TypescriptRow,\n defaultCellRenderer: React.ComponentType<any>,\n ) => RowVariant | React.ComponentType<any>;\n withFilterBar: boolean;\n isExpandable: boolean;\n expandedRows: Record<string, boolean>;\n disabledRows: Record<string, boolean>;\n isResizeable: boolean;\n isLoading: boolean;\n pagination: false | TypescriptPagination;\n filters: DataTableFilter[];\n colsLayoutStyle: ColsLayoutStyle;\n hiddenColumns: string[];\n noResultsMessage: string;\n dragAndDropRows: boolean;\n maxDragAndDropLevel: number;\n onRowsReorder: (\n newData: TypescriptRow[],\n indexes: { targetIndex: number; fromIndex: number },\n considerExpanding: string,\n ) => void;\n dragAndDropColumns: boolean;\n onColumnsReorder: (newData: TypescriptColumn[], indexes: { targetIndex: number; fromIndex: number }) => void;\n onColumnResize: (headerId: string, width: number) => void;\n onColumnSizeChange: (newColumns: TypescriptColumn[], headerId: string, width: number) => void;\n onRowClick: TypescriptGenericFunc;\n onRowFocus: TypescriptGenericFunc;\n noSelectionColumn: boolean;\n selectSingle: boolean;\n onSelectionChange: (newSelection: TypescriptSelection, selectedControl: string, event: React.ChangeEvent) => void;\n textWrap: 'wrap' | 'wrap-all' | 'truncate';\n onCellValueChange: (cellChange: { value: any; property: any; rowIndex: number }) => void;\n onFiltersChange: TypescriptGenericFunc;\n onPageChanged: TypescriptGenericFunc;\n onRowExpand: (expandedRows: Record<string, boolean>, toggledRow: string) => void;\n onColumnSortChange: (newSortRequest: { column: any; direction: any }) => void;\n onColumnSort: (newColumns: TypescriptColumn[], headerId: string, direction: 'ASC' | 'DESC') => void;\n}\n\ninterface PropsRequired {\n columns: TypescriptColumn[];\n data: TypescriptRow[];\n}\n\ninterface PropsOptional {\n uniqueRowAccessor?: UniqueRowAccessorType;\n cellRendererProps?: Record<string, any>;\n selection?: TypescriptSelection;\n groupedRowsRenderHeader?: TypescriptGenericFunc | string;\n filterBarProps?: {\n filterBarAddonRenderer?: React.ComponentType<any>;\n customPillRenderer?: React.ComponentType<any>;\n extraOptions?: { type: string; id: string; label: string; onClick?: TypescriptGenericFunc }[];\n };\n actionRef?: React.RefObject<any>;\n noResultsSecondaryMessage?: string;\n noResultsButtonLabel?: string;\n noResultsPlaceholder?: TypescriptGenericFunc;\n onNoResultsButtonClick?: TypescriptGenericFunc;\n}\n\nexport interface TypescriptProps extends Partial<PropsWithDefault>, PropsRequired, PropsOptional {}\nexport interface InternalTypescriptProps extends PropsWithDefault, PropsRequired, PropsOptional {}\n\nexport interface FilterProps {\n column: TypescriptColumn;\n ctx: TypescriptContext;\n onFiltersChange?: (filters: DataTableFilter[]) => void;\n onValueChange: (type: string, value: any) => void;\n patchHeaderFilterButtonAndMenu: (headerId: string, newState: any) => void;\n patchHeader: (headerId: string, newHeader: any) => void;\n filterValue?: any;\n reduxHeader?: any;\n innerRef: MutableRefObject<HTMLDivElement | null>;\n}\n\nexport type TypescriptContext = {\n tableProps: InternalTypescriptProps;\n virtualListRef: React.RefObject<HTMLDivElement>;\n columnHeaderRef: React.RefObject<HTMLDivElement>;\n flattenedData: InternalTypescriptRow[];\n allDataFlattened: InternalTypescriptRow[];\n visibleColumns: TypescriptColumn[];\n virtualListHelpers?: ReturnType<typeof useVirtual>;\n layoutHelpers: {\n totalColumnsWidth?: number | string;\n gridLayout: string[];\n setGridLayout: React.Dispatch<React.SetStateAction<string[]>>;\n };\n paginationHelpers: TypescriptPagination;\n drilldownRowId: string | null;\n setDrilldownRowId: React.Dispatch<React.SetStateAction<string | null>>;\n focusedRowId: string | null;\n setFocusedRowId: React.Dispatch<React.SetStateAction<string | null>>;\n reduxHeaders: Record<string, ReduxHeader>;\n patchHeader: (headerId: string, newHeader: ReduxHeader) => void;\n patchHeaderFilterButtonAndMenu: (headerId: string, value: boolean) => void;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADqChB,IAAK,wBAAL,kBAAKA,2BAAL;AACL,EAAAA,8CAAA,UAAO,KAAP;AACA,EAAAA,8CAAA,YAAS,KAAT;AACA,EAAAA,8CAAA,WAAQ,KAAR;AACA,EAAAA,8CAAA,YAAS,KAAT;AAJU,SAAAA;AAAA,GAAA;",
|
|
6
6
|
"names": ["DropIndicatorPosition"]
|
|
7
7
|
}
|
|
@@ -24,8 +24,8 @@ const useCellStyle = (column, shouldAddExpandCell) => {
|
|
|
24
24
|
newStyle.gridColumn = `span 2`;
|
|
25
25
|
newStyle.padding = `0 16px 0 2px`;
|
|
26
26
|
}
|
|
27
|
-
return newStyle;
|
|
28
|
-
}, [appliedTextWrap, shouldAddExpandCell]);
|
|
27
|
+
return { ...newStyle, ...column.cellStyle ?? {} };
|
|
28
|
+
}, [appliedTextWrap, column.cellStyle, shouldAddExpandCell]);
|
|
29
29
|
return [appliedTextWrap, cellStyle];
|
|
30
30
|
};
|
|
31
31
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/Cells/useCellStyle.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useContext, useMemo, type CSSProperties } from 'react';\nimport {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,YAAY,eAAmC;AAExD,SAAS,wBAAwB;AAE1B,MAAM,eAAe,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useContext, useMemo, type CSSProperties } from 'react';\nimport { InternalTypescriptColumn } from '../../types/props';\nimport { DataTableContext } from '../../DataTableContext';\n\nexport const useCellStyle = (\n column: InternalTypescriptColumn,\n shouldAddExpandCell: boolean,\n): [string, CSSProperties] => {\n const {\n tableProps: { textWrap },\n } = useContext(DataTableContext);\n\n const appliedTextWrap = column.textWrap || textWrap;\n\n const cellStyle = useMemo(() => {\n const newStyle: CSSProperties = {};\n switch (appliedTextWrap) {\n case 'wrap-all':\n newStyle.wordBreak = 'break-all';\n break;\n case 'truncate':\n newStyle.whiteSpace = 'nowrap';\n break;\n case 'wrap':\n default:\n newStyle.whiteSpace = 'normal';\n break;\n }\n if (shouldAddExpandCell) {\n newStyle.gridColumn = `span 2`;\n newStyle.padding = `0 16px 0 2px`;\n }\n return { ...newStyle, ...(column.cellStyle ?? {}) };\n }, [appliedTextWrap, column.cellStyle, shouldAddExpandCell]);\n\n return [appliedTextWrap, cellStyle];\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,YAAY,eAAmC;AAExD,SAAS,wBAAwB;AAE1B,MAAM,eAAe,CAC1B,QACA,wBAC4B;AAC5B,QAAM;AAAA,IACJ,YAAY,EAAE,SAAS;AAAA,EACzB,IAAI,WAAW,gBAAgB;AAE/B,QAAM,kBAAkB,OAAO,YAAY;AAE3C,QAAM,YAAY,QAAQ,MAAM;AAC9B,UAAM,WAA0B,CAAC;AACjC,YAAQ;AAAA,WACD;AACH,iBAAS,YAAY;AACrB;AAAA,WACG;AACH,iBAAS,aAAa;AACtB;AAAA,WACG;AAAA;AAEH,iBAAS,aAAa;AACtB;AAAA;AAEJ,QAAI,qBAAqB;AACvB,eAAS,aAAa;AACtB,eAAS,UAAU;AAAA,IACrB;AACA,WAAO,EAAE,GAAG,UAAU,GAAI,OAAO,aAAa,CAAC,EAAG;AAAA,EACpD,GAAG,CAAC,iBAAiB,OAAO,WAAW,mBAAmB,CAAC;AAE3D,SAAO,CAAC,iBAAiB,SAAS;AACpC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/styled.js
CHANGED
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 }) => `\n&:after {\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 2px solid ${theme.colors.brand[700]};\n pointer-events: none;\n z-index: ${ZIndexDataTable.FOCUS_BORDER};\n}`;\n\nexport const StyledFocusWithin = styled(Grid)`\n :focus-within {\n ${(props) => (props.hideFocus ? '' : styledFocusCss(props))}\n }\n`;\n\nexport const StyledDataTableWrapper = styled(Grid)<WidthAndHeight>`\n width: ${(props) => sizeToCss(props.width ?? ' 100%')};\n height: ${(props) => sizeToCss(props.height ?? ' 100%')};\n`;\n\nexport const StyledDataTableContentWrapper = styled(Grid)<WidthAndHeight & { noSelectionAllowed: boolean }>`\n user-select: ${({ noSelectionAllowed }) => (noSelectionAllowed ? 'none' : 'auto')};\n width: 100%;\n`;\n\nexport const StyledTableWrapper = styled.div<WidthAndHeight>`\n display: inline-block;\n border-spacing: 0;\n z-index: 0;\n position: relative;\n width: 100%;\n height: 100%;\n`;\nexport const StyledTableContentWrapper = styled.div<WidthAndHeight>`\n position: relative;\n ${({ height = 'auto' }) => `\n height: ${sizeToCss(height)};\n `}\n`;\nexport const StyledVirtualListWrapper = styled.div<WidthAndHeight>`\n overflow: auto;\n height: 100%;\n width: 100%;\n`;\n\n/**\n * HEADER\n */\ntype gridTemplateColumnStyleProps = {\n cols: string[];\n isExpandable: boolean;\n colsLayoutStyle: ColsLayoutStyle;\n};\nconst getGridTemplateColumnsStyle = ({\n cols,\n colsLayoutStyle = ColsLayoutStyle.Auto,\n}: gridTemplateColumnStyleProps) => {\n if (!cols) return '';\n if (colsLayoutStyle === 'fixed') {\n const widthAttr = cols.map((col) => `minmax(0, ${col})`).join(' ');\n return `grid-template-columns: ${widthAttr}`;\n }\n\n return `grid-template-columns: ${cols.map((col) => `minmax(0, ${col})`).join(' ')}`;\n};\n\nexport const StyledHeadWrapper = styled.div<{\n colsLayoutStyle: string;\n totalColumnsWidth: number | string;\n}>`\n position: relative; /* ie11 fallback */\n position: sticky;\n top: 0;\n z-index: 4;\n background: white;\n width: ${(props) => (props.colsLayoutStyle === ColsLayoutStyle.Fixed ? sizeToCss(props.totalColumnsWidth) : '100%')};\n`;\n\nexport const StyledHeadTr = styled(Grid)`\n ${(props) => (props.colsLayoutStyle === ColsLayoutStyle.Auto ? 'width:100%' : '')};\n ${(props) =>\n getGridTemplateColumnsStyle({\n cols: props.cols,\n isExpandable: props.isExpandable,\n colsLayoutStyle: props.colsLayoutStyle,\n })};\n border-right: 1px solid ${(props) => props.theme.colors.neutral['080']};\n border-bottom: 1px solid ${(props) => props.theme.colors.neutral['080']};\n grid-auto-flow: column;\n`;\n\nexport const StyledHeadTh = styled.div<any>`\n min-height: 24px;\n line-height: normal;\n font-weight: 600;\n text-transform: uppercase;\n font-size: 0.923rem;\n text-align: left;\n ${columnPadding}\n color: #353c46;\n min-height: 1.84615rem;\n position: sticky;\n z-index: ${ZIndexDataTable.HEADER_ROW};\n display: flex;\n justify-content: space-between;\n box-sizing: border-box;\n outline: none;\n ${(props) =>\n props.isDraggingActive\n ? ''\n : `:hover {\n &:after {\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border-bottom: 1px solid ${props.theme.colors.brand[700]};\n pointer-events: none;\n z-index: ${ZIndexDataTable.FOCUS_BORDER};\n }\n cursor: pointer;\n }`}\n\n :focus {\n &:after {\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 2px solid ${(props) => props.theme.colors.brand[700]};\n pointer-events: none;\n z-index: ${ZIndexDataTable.FOCUS_BORDER};\n }\n }\n`;\n\nexport const StyledHeaderRightIconsWrapper = styled.div`\n height: 100%;\n display: flex;\n align-items: center;\n max-height: 24px;\n`;\n\nexport const StyledResizer = styled.div<{ isResizing: boolean }>`\n display: inline-block;\n background: transparent;\n width: 4px;\n height: 100%;\n position: absolute;\n right: 0;\n top: 0;\n z-index: 1;\n\n // prevents from scrolling while dragging on touch devices\n touch-action: none;\n\n cursor: col-resize;\n`;\n\n// CELL ***********************************************************************/\nexport const StyledActionCell = styled.div`\n position: relative; /* ie11 fallback */\n position: sticky;\n display: inline-block;\n right: 0;\n /* border-bottom: 1px solid #ebedf0; */\n background: white;\n`;\n\nexport const StyledCell = styled.div`\n ${cellPadding}\n
|
|
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,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAShB,MAAM,OAAO,MAAM;AAAA;AAAA,aAE5B,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;AAAA;AAAA,IAE5C,CAAC,EAAE,SAAS,OAAO,MAAM;AAAA,YACjB,UAAU,MAAM;AAAA;AAAA;AAGrB,MAAM,2BAA2B,OAAO;AAAA;AAAA;AAAA;AAAA;AAc/C,MAAM,8BAA8B,CAAC;AAAA,EACnC;AAAA,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AAgC,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAO7C,MAAM,gBAAgB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiB7B,MAAM,mBAAmB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAShC,MAAM,aAAa,OAAO;AAAA,IAC7B;AAAA;AAAA;AAAA;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 }) => `\n&:after {\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 2px solid ${theme.colors.brand[700]};\n pointer-events: none;\n z-index: ${ZIndexDataTable.FOCUS_BORDER};\n}`;\n\nexport const StyledFocusWithin = styled(Grid)`\n :focus-within {\n ${(props) => (props.hideFocus ? '' : styledFocusCss(props))}\n }\n`;\n\nexport const StyledDataTableWrapper = styled(Grid)<WidthAndHeight>`\n width: ${(props) => sizeToCss(props.width ?? ' 100%')};\n height: ${(props) => sizeToCss(props.height ?? ' 100%')};\n`;\n\nexport const StyledDataTableContentWrapper = styled(Grid)<WidthAndHeight & { noSelectionAllowed: boolean }>`\n user-select: ${({ noSelectionAllowed }) => (noSelectionAllowed ? 'none' : 'auto')};\n width: 100%;\n`;\n\nexport const StyledTableWrapper = styled.div<WidthAndHeight>`\n display: inline-block;\n border-spacing: 0;\n z-index: 0;\n position: relative;\n width: 100%;\n height: 100%;\n`;\nexport const StyledTableContentWrapper = styled.div<WidthAndHeight>`\n position: relative;\n ${({ height = 'auto' }) => `\n height: ${sizeToCss(height)};\n `}\n`;\nexport const StyledVirtualListWrapper = styled.div<WidthAndHeight>`\n overflow: auto;\n height: 100%;\n width: 100%;\n`;\n\n/**\n * HEADER\n */\ntype gridTemplateColumnStyleProps = {\n cols: string[];\n isExpandable: boolean;\n colsLayoutStyle: ColsLayoutStyle;\n};\nconst getGridTemplateColumnsStyle = ({\n cols,\n colsLayoutStyle = ColsLayoutStyle.Auto,\n}: gridTemplateColumnStyleProps) => {\n if (!cols) return '';\n if (colsLayoutStyle === 'fixed') {\n const widthAttr = cols.map((col) => `minmax(0, ${col})`).join(' ');\n return `grid-template-columns: ${widthAttr}`;\n }\n\n return `grid-template-columns: ${cols.map((col) => `minmax(0, ${col})`).join(' ')}`;\n};\n\nexport const StyledHeadWrapper = styled.div<{\n colsLayoutStyle: string;\n totalColumnsWidth: number | string;\n}>`\n position: relative; /* ie11 fallback */\n position: sticky;\n top: 0;\n z-index: 4;\n background: white;\n width: ${(props) => (props.colsLayoutStyle === ColsLayoutStyle.Fixed ? sizeToCss(props.totalColumnsWidth) : '100%')};\n`;\n\nexport const StyledHeadTr = styled(Grid)`\n ${(props) => (props.colsLayoutStyle === ColsLayoutStyle.Auto ? 'width:100%' : '')};\n ${(props) =>\n getGridTemplateColumnsStyle({\n cols: props.cols,\n isExpandable: props.isExpandable,\n colsLayoutStyle: props.colsLayoutStyle,\n })};\n border-right: 1px solid ${(props) => props.theme.colors.neutral['080']};\n border-bottom: 1px solid ${(props) => props.theme.colors.neutral['080']};\n grid-auto-flow: column;\n`;\n\nexport const StyledHeadTh = styled.div<any>`\n min-height: 24px;\n line-height: normal;\n font-weight: 600;\n text-transform: uppercase;\n font-size: 0.923rem;\n text-align: left;\n ${columnPadding}\n color: #353c46;\n min-height: 1.84615rem;\n position: sticky;\n z-index: ${ZIndexDataTable.HEADER_ROW};\n display: flex;\n justify-content: space-between;\n box-sizing: border-box;\n outline: none;\n ${(props) =>\n props.isDraggingActive\n ? ''\n : `:hover {\n &:after {\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border-bottom: 1px solid ${props.theme.colors.brand[700]};\n pointer-events: none;\n z-index: ${ZIndexDataTable.FOCUS_BORDER};\n }\n cursor: pointer;\n }`}\n\n :focus {\n &:after {\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 2px solid ${(props) => props.theme.colors.brand[700]};\n pointer-events: none;\n z-index: ${ZIndexDataTable.FOCUS_BORDER};\n }\n }\n`;\n\nexport const StyledHeaderRightIconsWrapper = styled.div`\n height: 100%;\n display: flex;\n align-items: center;\n max-height: 24px;\n`;\n\nexport const StyledResizer = styled.div<{ isResizing: boolean }>`\n display: inline-block;\n background: transparent;\n width: 4px;\n height: 100%;\n position: absolute;\n right: 0;\n top: 0;\n z-index: 1;\n\n // prevents from scrolling while dragging on touch devices\n touch-action: none;\n\n cursor: col-resize;\n`;\n\n// CELL ***********************************************************************/\nexport const StyledActionCell = styled.div`\n position: relative; /* ie11 fallback */\n position: sticky;\n display: inline-block;\n right: 0;\n /* border-bottom: 1px solid #ebedf0; */\n background: white;\n`;\n\nexport const StyledCell = styled.div`\n ${cellPadding}\n display: flex;\n align-items: center;\n width: 100%;\n position: relative;\n`;\n\nexport const StyledCellContent = styled.div`\n display: grid;\n justify-self: flex-end;\n flex: 1 1 auto;\n width: 100%;\n height: 100%;\n align-items: center;\n`;\n\nexport const StyledPencilIcon = styled(EditPencil)``;\n\nexport const StyledEditableContainer = styled(Grid)<{ shouldDisplayEditIcon: string }>`\n width: 100%;\n height: 100%;\n align-items: center;\n & ${StyledPencilIcon} {\n display: ${({ shouldDisplayEditIcon }) => (shouldDisplayEditIcon ? 'block' : 'none')};\n }\n &:hover {\n ${StyledPencilIcon} {\n display: block;\n }\n }\n &:focus {\n ${styledFocusCss}\n ${StyledPencilIcon} {\n display: block;\n }\n }\n outline: none;\n`;\n\n// ROW ************************************************************************/\nexport const StyledFullsizeGrid = styled(Grid)`\n position: relative;\n z-index: ${ZIndexDataTable.ROW};\n\n min-height: ${(props) => props.minHeight || '36px'};\n height: ${(props) => props.height || 'auto'};\n /* width: ${(props) =>\n props.colsLayoutStyle === ColsLayoutStyle.Fixed ? sizeToCss(props.totalColumnsWidth) : '100%'}; */\n`;\n\nexport const GroupHeaderContainer = styled(Grid)<{ padding: string }>`\n position: relative;\n background-color: ${({ theme }) => theme.colors.brand[200]};\n align-items: center;\n padding: 0 ${(props) => props.padding};\n border-top: 1px solid ${({ theme }) => theme.colors.brand[300]};\n grid-template-columns: min-content 1fr;\n`;\n\nexport const GroupHeaderTitle = styled.span`\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n font-size: 12px;\n color: ${(props) => props.theme.colors.neutral[700]};\n`;\n\nexport const StyledCellContainer = styled(Grid)`\n position: relative;\n z-index: 2;\n\n min-height: ${(props) => props.minHeight || '36px'};\n height: ${(props) => props.height || 'auto'};\n\n width: ${(props) => (props.colLayoutStyle === ColsLayoutStyle.Fixed ? sizeToCss(props.totalColumnsWidth) : '100%')};\n ${(props) => (props.isDragOverlay ? 'width: fit-content;' : '')};\n ${(props) =>\n getGridTemplateColumnsStyle({\n cols: props.cols,\n colsLayoutStyle: props.colLayoutStyle,\n isExpandable: props.isExpandable,\n })};\n background-color: ${({ backgroundColor, isDragging, theme }) =>\n isDragging ? theme.colors.neutral[100] : backgroundColor || 'white'};\n\n outline: none;\n\n :focus {\n ${(props) => (props.isDragOverlay ? '' : styledFocusCss(props))}\n }\n\n ${({ isDropIndicatorPositionInside, theme }) => {\n if (!isDropIndicatorPositionInside) return '';\n return styledFocusCss({ theme });\n }}\n\n ${({ shouldDisplayHover, theme, disabled }) =>\n shouldDisplayHover && !disabled\n ? `:hover {\n background-color: ${theme.colors.brand[200]};\n }`\n : ''}\n\n box-shadow: 0 2px 4px 0 ${(props) => (props.isDragOverlay ? 'rgba(0,0,0,0.5)' : 'transparent')};\n\n opacity: ${(props) => (props.isDragging ? 0.8 : 1)};\n\n ${(props) =>\n !props.selected\n ? ''\n : `\n background-color: ${props.theme.colors.brand[200]};\n border: 1px solid ${props.theme.colors.brand[500]};\n `}\n\n color: ${(props) => (props.disabled ? props.theme.colors.neutral['500'] : '#333333')};\n`;\n"],
|
|
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,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAShB,MAAM,OAAO,MAAM;AAAA;AAAA,aAE5B,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;AAAA;AAAA,IAE5C,CAAC,EAAE,SAAS,OAAO,MAAM;AAAA,YACjB,UAAU,MAAM;AAAA;AAAA;AAGrB,MAAM,2BAA2B,OAAO;AAAA;AAAA;AAAA;AAAA;AAc/C,MAAM,8BAA8B,CAAC;AAAA,EACnC;AAAA,EACA,kBAAkB,gBAAgB;AACpC,MAAoC;AAClC,MAAI,CAAC;AAAM,WAAO;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AAAA;AAAA,WAE5B,CAAC,UAAW,MAAM,mBAAmB,gBAAgB,QAAQ,UAAU,MAAM,iBAAiB,IAAI;AAAA,IACzG,CAAC,UAAW,MAAM,gBAAgB,wBAAwB;AAAA,IAC1D,CAAC,UACD,4BAA4B;AAAA,EAC1B,MAAM,MAAM;AAAA,EACZ,iBAAiB,MAAM;AAAA,EACvB,cAAc,MAAM;AACtB,CAAC;AAAA,sBACiB,CAAC,EAAE,iBAAiB,YAAY,MAAM,MACxD,aAAa,MAAM,OAAO,QAAQ,OAAO,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAAA,MAK1D,CAAC,UAAW,MAAM,gBAAgB,KAAK,eAAe,KAAK;AAAA;AAAA;AAAA,IAG7D,CAAC,EAAE,+BAA+B,MAAM,MAAM;AAC9C,MAAI,CAAC;AAA+B,WAAO;AAC3C,SAAO,eAAe,EAAE,MAAM,CAAC;AACjC;AAAA;AAAA,IAEE,CAAC,EAAE,oBAAoB,OAAO,SAAS,MACvC,sBAAsB,CAAC,WACnB;AAAA,gCACwB,MAAM,OAAO,MAAM;AAAA,eAE3C;AAAA;AAAA,4BAEoB,CAAC,UAAW,MAAM,gBAAgB,oBAAoB;AAAA;AAAA,aAErE,CAAC,UAAW,MAAM,aAAa,MAAM;AAAA;AAAA,IAE9C,CAAC,UACD,CAAC,MAAM,WACH,KACA;AAAA,wBACgB,MAAM,MAAM,OAAO,MAAM;AAAA,wBACzB,MAAM,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA,WAGtC,CAAC,UAAW,MAAM,WAAW,MAAM,MAAM,OAAO,QAAQ,SAAS;AAAA;",
|
|
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/types/props.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { MutableRefObject } from 'react';\nimport { useVirtual } from 'react-virtual/types';\nimport { useSortable } from '@elliemae/ds-drag-and-drop';\nimport { ColsLayoutStyle } from '../configs/constants';\n\nexport type TypescriptGenericFunc = (...args: unknown[]) => unknown;\ninterface FilterOptionT {\n dsId: string;\n type: string;\n value: string;\n label: string;\n}\n\ninterface HeaderComponentProps {\n ctx: TypescriptContext;\n}\n\nexport type DraggablePropsT =\n | false\n | (ReturnType<typeof useSortable> & {\n dropIndicatorPosition: DropIndicatorPosition;\n shouldShowDropIndicatorPosition: boolean;\n lastActiveId?: string;\n setLastActiveId?: React.Dispatch<React.SetStateAction<string>>;\n });\n\ninterface CellComponentProps<T = HTMLElement> {\n ctx: TypescriptContext;\n isRowSelected: boolean;\n row: InternalTypescriptRow;\n cell: TypescriptCell<T>;\n draggableProps: DraggablePropsT;\n isDragOverlay: boolean;\n}\n\nexport enum DropIndicatorPosition {\n None = 0,\n Before = 1,\n After = 2,\n Inside = 3,\n}\n\nexport interface TypescriptColumn<T extends HTMLElement = HTMLElement> {\n id?: string;\n Header: string | React.ComponentType<HeaderComponentProps>;\n accessor?: string;\n filter?: string;\n filterOptions?: FilterOptionT[] | (() => FilterOptionT[]);\n filterMinWidth?: number | string;\n Filter?: React.ComponentType<FilterProps>;\n Cell?: React.ComponentType<CellComponentProps<T>>;\n editable?: string | TypescriptGenericFunc;\n disableDnD?: boolean;\n width?: number;\n minWidth?: number;\n maxWidth?: number;\n padding?: number;\n columns?: TypescriptColumn[];\n canSort?: boolean;\n isSortedDesc?: boolean;\n canResize?: boolean;\n isFocuseable?: boolean;\n textWrap?: 'wrap' | 'wrap-all' | 'truncate';\n ref?: React.MutableRefObject<HTMLTableColElement>;\n required?: boolean;\n alwaysDisplayEditIcon?: boolean;\n}\n\nexport interface InternalTypescriptColumn<T extends HTMLElement = HTMLElement> extends TypescriptColumn<T> {\n id: string;\n}\n\nexport interface TypescriptCell<T = HTMLElement> {\n column: TypescriptColumn;\n value: any;\n render: React.ComponentType<CellComponentProps>;\n row: InternalTypescriptRow;\n ref: React.RefObject<T>;\n id: string;\n}\n\nexport interface TypescriptRow {\n [key: string]: any;\n subRows: TypescriptRow[];\n tableRowDetails: React.ComponentType<any>;\n dimsumHeaderValue: string;\n}\n\nexport interface InternalTypescriptRow {\n id: string;\n uid: string;\n index: number;\n realIndex: number;\n parentId: string | null;\n parentIndex: number | null;\n depth: number;\n isExpanded: boolean;\n subRows: TypescriptRow[];\n childrenCount: number;\n original: TypescriptRow;\n cells: TypescriptCell[];\n}\n\nexport type RowVariant = 'ds-header-group-row' | 'ds-primary-row' | 'ds-secondary-row';\n\nexport type TypescriptRenderRowActionsConfig = {\n columnWidth: number;\n renderer: (...args: any[]) => JSX.Element;\n};\n\nexport type TypescriptRenderRowActions = false | TypescriptRenderRowActionsConfig;\n\nexport type TypescriptAppliedFilter = {\n id: string;\n type: string;\n value: any;\n};\n\nexport type TypescriptPagination = {\n page?: any[];\n pageIndex?: number;\n canPreviousPage?: boolean;\n canNextPage?: boolean;\n pageSize?: number;\n dataIsPage?: boolean;\n showPerPageSelector?: boolean;\n perPageOptions?: number[];\n perPageStep?: number;\n minPerPage?: number;\n maxPerPage?: number;\n onPageSizeChange?: (pageSize: number) => void;\n onPreviousPage?: () => void;\n onNextPage?: () => void;\n onPageChange?: (page: number) => void;\n pageCount?: number;\n pageDetails?: string[];\n pageDetailsTitle?: string;\n};\n\nexport type TypescriptSortBy = {\n id: string;\n desc: boolean;\n};\n\nexport type TypescriptSelectionItem = boolean | 'mixed';\n\nexport type TypescriptSelection = Record<string | number, TypescriptSelectionItem>;\n\nexport type UniqueRowAccessorType = string | string[] | ((row: TypescriptRow) => string) | undefined;\n\nexport interface ReduxHeader {\n hideFilterMenu: boolean;\n hideFilterButton: boolean;\n showDnDHandle: boolean;\n withTabStops: boolean;\n}\n\ninterface DataTableFilter {\n id: string;\n type: string;\n value: any;\n}\n\ninterface PropsWithDefault {\n height: string;\n width: string;\n renderRowActions: boolean;\n getRowVariant: (\n row: TypescriptRow,\n defaultCellRenderer: React.ComponentType<any>,\n ) => RowVariant | React.ComponentType<any>;\n withFilterBar: boolean;\n isExpandable: boolean;\n expandedRows: Record<string, boolean>;\n disabledRows: Record<string, boolean>;\n isResizeable: boolean;\n isLoading: boolean;\n pagination: false | TypescriptPagination;\n filters: DataTableFilter[];\n colsLayoutStyle: ColsLayoutStyle;\n hiddenColumns: string[];\n noResultsMessage: string;\n dragAndDropRows: boolean;\n maxDragAndDropLevel: number;\n onRowsReorder: (\n newData: TypescriptRow[],\n indexes: { targetIndex: number; fromIndex: number },\n considerExpanding: string,\n ) => void;\n dragAndDropColumns: boolean;\n onColumnsReorder: (newData: TypescriptColumn[], indexes: { targetIndex: number; fromIndex: number }) => void;\n onColumnResize: (headerId: string, width: number) => void;\n onColumnSizeChange: (newColumns: TypescriptColumn[], headerId: string, width: number) => void;\n onRowClick: TypescriptGenericFunc;\n onRowFocus: TypescriptGenericFunc;\n noSelectionColumn: boolean;\n selectSingle: boolean;\n onSelectionChange: (newSelection: TypescriptSelection, selectedControl: string, event: React.ChangeEvent) => void;\n textWrap: 'wrap' | 'wrap-all' | 'truncate';\n onCellValueChange: (cellChange: { value: any; property: any; rowIndex: number }) => void;\n onFiltersChange: TypescriptGenericFunc;\n onPageChanged: TypescriptGenericFunc;\n onRowExpand: (expandedRows: Record<string, boolean>, toggledRow: string) => void;\n onColumnSortChange: (newSortRequest: { column: any; direction: any }) => void;\n onColumnSort: (newColumns: TypescriptColumn[], headerId: string, direction: 'ASC' | 'DESC') => void;\n}\n\ninterface PropsRequired {\n columns: TypescriptColumn[];\n data: TypescriptRow[];\n}\n\ninterface PropsOptional {\n uniqueRowAccessor?: UniqueRowAccessorType;\n cellRendererProps?: Record<string, any>;\n selection?: TypescriptSelection;\n groupedRowsRenderHeader?: TypescriptGenericFunc | string;\n filterBarProps?: {\n filterBarAddonRenderer?: React.ComponentType<any>;\n customPillRenderer?: React.ComponentType<any>;\n extraOptions?: { type: string; id: string; label: string; onClick?: TypescriptGenericFunc }[];\n };\n actionRef?: React.RefObject<any>;\n noResultsSecondaryMessage?: string;\n noResultsButtonLabel?: string;\n noResultsPlaceholder?: TypescriptGenericFunc;\n onNoResultsButtonClick?: TypescriptGenericFunc;\n}\n\nexport interface TypescriptProps extends Partial<PropsWithDefault>, PropsRequired, PropsOptional {}\nexport interface InternalTypescriptProps extends PropsWithDefault, PropsRequired, PropsOptional {}\n\nexport interface FilterProps {\n column: TypescriptColumn;\n ctx: TypescriptContext;\n onFiltersChange?: (filters: DataTableFilter[]) => void;\n onValueChange: (type: string, value: any) => void;\n patchHeaderFilterButtonAndMenu: (headerId: string, newState: any) => void;\n patchHeader: (headerId: string, newHeader: any) => void;\n filterValue?: any;\n reduxHeader?: any;\n innerRef: MutableRefObject<HTMLDivElement | null>;\n}\n\nexport type TypescriptContext = {\n tableProps: InternalTypescriptProps;\n virtualListRef: React.RefObject<HTMLDivElement>;\n columnHeaderRef: React.RefObject<HTMLDivElement>;\n flattenedData: InternalTypescriptRow[];\n allDataFlattened: InternalTypescriptRow[];\n visibleColumns: TypescriptColumn[];\n virtualListHelpers?: ReturnType<typeof useVirtual>;\n layoutHelpers: {\n totalColumnsWidth?: number | string;\n gridLayout: string[];\n setGridLayout: React.Dispatch<React.SetStateAction<string[]>>;\n };\n paginationHelpers: TypescriptPagination;\n drilldownRowId: string | null;\n setDrilldownRowId: React.Dispatch<React.SetStateAction<string | null>>;\n focusedRowId: string | null;\n setFocusedRowId: React.Dispatch<React.SetStateAction<string | null>>;\n reduxHeaders: Record<string, ReduxHeader>;\n patchHeader: (headerId: string, newHeader: ReduxHeader) => void;\n patchHeaderFilterButtonAndMenu: (headerId: string, value: boolean) => void;\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { MutableRefObject } from 'react';\nimport { useVirtual } from 'react-virtual/types';\nimport { useSortable } from '@elliemae/ds-drag-and-drop';\nimport { ColsLayoutStyle } from '../configs/constants';\nimport { CSSProperties } from 'styled-components';\n\nexport type TypescriptGenericFunc = (...args: unknown[]) => unknown;\ninterface FilterOptionT {\n dsId: string;\n type: string;\n value: string;\n label: string;\n}\n\ninterface HeaderComponentProps {\n ctx: TypescriptContext;\n}\n\nexport type DraggablePropsT =\n | false\n | (ReturnType<typeof useSortable> & {\n dropIndicatorPosition: DropIndicatorPosition;\n shouldShowDropIndicatorPosition: boolean;\n lastActiveId?: string;\n setLastActiveId?: React.Dispatch<React.SetStateAction<string>>;\n });\n\ninterface CellComponentProps<T = HTMLElement> {\n ctx: TypescriptContext;\n isRowSelected: boolean;\n row: InternalTypescriptRow;\n cell: TypescriptCell<T>;\n draggableProps: DraggablePropsT;\n isDragOverlay: boolean;\n}\n\nexport enum DropIndicatorPosition {\n None = 0,\n Before = 1,\n After = 2,\n Inside = 3,\n}\n\nexport interface TypescriptColumn<T extends HTMLElement = HTMLElement> {\n id?: string;\n Header: string | React.ComponentType<HeaderComponentProps>;\n accessor?: string;\n filter?: string;\n filterOptions?: FilterOptionT[] | (() => FilterOptionT[]);\n filterMinWidth?: number | string;\n Filter?: React.ComponentType<FilterProps>;\n Cell?: React.ComponentType<CellComponentProps<T>>;\n editable?: string | TypescriptGenericFunc;\n disableDnD?: boolean;\n width?: number;\n minWidth?: number;\n maxWidth?: number;\n padding?: number;\n columns?: TypescriptColumn[];\n canSort?: boolean;\n isSortedDesc?: boolean;\n canResize?: boolean;\n isFocuseable?: boolean;\n textWrap?: 'wrap' | 'wrap-all' | 'truncate';\n ref?: React.MutableRefObject<HTMLTableColElement>;\n required?: boolean;\n cellStyle?: CSSProperties;\n alwaysDisplayEditIcon?: boolean;\n}\n\nexport interface InternalTypescriptColumn<T extends HTMLElement = HTMLElement> extends TypescriptColumn<T> {\n id: string;\n}\n\nexport interface TypescriptCell<T = HTMLElement> {\n column: TypescriptColumn;\n value: any;\n render: React.ComponentType<CellComponentProps>;\n row: InternalTypescriptRow;\n ref: React.RefObject<T>;\n id: string;\n}\n\nexport interface TypescriptRow {\n [key: string]: any;\n subRows: TypescriptRow[];\n tableRowDetails: React.ComponentType<any>;\n dimsumHeaderValue: string;\n}\n\nexport interface InternalTypescriptRow {\n id: string;\n uid: string;\n index: number;\n realIndex: number;\n parentId: string | null;\n parentIndex: number | null;\n depth: number;\n isExpanded: boolean;\n subRows: TypescriptRow[];\n childrenCount: number;\n original: TypescriptRow;\n cells: TypescriptCell[];\n}\n\nexport type RowVariant = 'ds-header-group-row' | 'ds-primary-row' | 'ds-secondary-row';\n\nexport type TypescriptRenderRowActionsConfig = {\n columnWidth: number;\n renderer: (...args: any[]) => JSX.Element;\n};\n\nexport type TypescriptRenderRowActions = false | TypescriptRenderRowActionsConfig;\n\nexport type TypescriptAppliedFilter = {\n id: string;\n type: string;\n value: any;\n};\n\nexport type TypescriptPagination = {\n page?: any[];\n pageIndex?: number;\n canPreviousPage?: boolean;\n canNextPage?: boolean;\n pageSize?: number;\n dataIsPage?: boolean;\n showPerPageSelector?: boolean;\n perPageOptions?: number[];\n perPageStep?: number;\n minPerPage?: number;\n maxPerPage?: number;\n onPageSizeChange?: (pageSize: number) => void;\n onPreviousPage?: () => void;\n onNextPage?: () => void;\n onPageChange?: (page: number) => void;\n pageCount?: number;\n pageDetails?: string[];\n pageDetailsTitle?: string;\n};\n\nexport type TypescriptSortBy = {\n id: string;\n desc: boolean;\n};\n\nexport type TypescriptSelectionItem = boolean | 'mixed';\n\nexport type TypescriptSelection = Record<string | number, TypescriptSelectionItem>;\n\nexport type UniqueRowAccessorType = string | string[] | ((row: TypescriptRow) => string) | undefined;\n\nexport interface ReduxHeader {\n hideFilterMenu: boolean;\n hideFilterButton: boolean;\n showDnDHandle: boolean;\n withTabStops: boolean;\n}\n\ninterface DataTableFilter {\n id: string;\n type: string;\n value: any;\n}\n\ninterface PropsWithDefault {\n height: string;\n width: string;\n renderRowActions: boolean;\n getRowVariant: (\n row: TypescriptRow,\n defaultCellRenderer: React.ComponentType<any>,\n ) => RowVariant | React.ComponentType<any>;\n withFilterBar: boolean;\n isExpandable: boolean;\n expandedRows: Record<string, boolean>;\n disabledRows: Record<string, boolean>;\n isResizeable: boolean;\n isLoading: boolean;\n pagination: false | TypescriptPagination;\n filters: DataTableFilter[];\n colsLayoutStyle: ColsLayoutStyle;\n hiddenColumns: string[];\n noResultsMessage: string;\n dragAndDropRows: boolean;\n maxDragAndDropLevel: number;\n onRowsReorder: (\n newData: TypescriptRow[],\n indexes: { targetIndex: number; fromIndex: number },\n considerExpanding: string,\n ) => void;\n dragAndDropColumns: boolean;\n onColumnsReorder: (newData: TypescriptColumn[], indexes: { targetIndex: number; fromIndex: number }) => void;\n onColumnResize: (headerId: string, width: number) => void;\n onColumnSizeChange: (newColumns: TypescriptColumn[], headerId: string, width: number) => void;\n onRowClick: TypescriptGenericFunc;\n onRowFocus: TypescriptGenericFunc;\n noSelectionColumn: boolean;\n selectSingle: boolean;\n onSelectionChange: (newSelection: TypescriptSelection, selectedControl: string, event: React.ChangeEvent) => void;\n textWrap: 'wrap' | 'wrap-all' | 'truncate';\n onCellValueChange: (cellChange: { value: any; property: any; rowIndex: number }) => void;\n onFiltersChange: TypescriptGenericFunc;\n onPageChanged: TypescriptGenericFunc;\n onRowExpand: (expandedRows: Record<string, boolean>, toggledRow: string) => void;\n onColumnSortChange: (newSortRequest: { column: any; direction: any }) => void;\n onColumnSort: (newColumns: TypescriptColumn[], headerId: string, direction: 'ASC' | 'DESC') => void;\n}\n\ninterface PropsRequired {\n columns: TypescriptColumn[];\n data: TypescriptRow[];\n}\n\ninterface PropsOptional {\n uniqueRowAccessor?: UniqueRowAccessorType;\n cellRendererProps?: Record<string, any>;\n selection?: TypescriptSelection;\n groupedRowsRenderHeader?: TypescriptGenericFunc | string;\n filterBarProps?: {\n filterBarAddonRenderer?: React.ComponentType<any>;\n customPillRenderer?: React.ComponentType<any>;\n extraOptions?: { type: string; id: string; label: string; onClick?: TypescriptGenericFunc }[];\n };\n actionRef?: React.RefObject<any>;\n noResultsSecondaryMessage?: string;\n noResultsButtonLabel?: string;\n noResultsPlaceholder?: TypescriptGenericFunc;\n onNoResultsButtonClick?: TypescriptGenericFunc;\n}\n\nexport interface TypescriptProps extends Partial<PropsWithDefault>, PropsRequired, PropsOptional {}\nexport interface InternalTypescriptProps extends PropsWithDefault, PropsRequired, PropsOptional {}\n\nexport interface FilterProps {\n column: TypescriptColumn;\n ctx: TypescriptContext;\n onFiltersChange?: (filters: DataTableFilter[]) => void;\n onValueChange: (type: string, value: any) => void;\n patchHeaderFilterButtonAndMenu: (headerId: string, newState: any) => void;\n patchHeader: (headerId: string, newHeader: any) => void;\n filterValue?: any;\n reduxHeader?: any;\n innerRef: MutableRefObject<HTMLDivElement | null>;\n}\n\nexport type TypescriptContext = {\n tableProps: InternalTypescriptProps;\n virtualListRef: React.RefObject<HTMLDivElement>;\n columnHeaderRef: React.RefObject<HTMLDivElement>;\n flattenedData: InternalTypescriptRow[];\n allDataFlattened: InternalTypescriptRow[];\n visibleColumns: TypescriptColumn[];\n virtualListHelpers?: ReturnType<typeof useVirtual>;\n layoutHelpers: {\n totalColumnsWidth?: number | string;\n gridLayout: string[];\n setGridLayout: React.Dispatch<React.SetStateAction<string[]>>;\n };\n paginationHelpers: TypescriptPagination;\n drilldownRowId: string | null;\n setDrilldownRowId: React.Dispatch<React.SetStateAction<string | null>>;\n focusedRowId: string | null;\n setFocusedRowId: React.Dispatch<React.SetStateAction<string | null>>;\n reduxHeaders: Record<string, ReduxHeader>;\n patchHeader: (headerId: string, newHeader: ReduxHeader) => void;\n patchHeaderFilterButtonAndMenu: (headerId: string, value: boolean) => void;\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACqChB,IAAK,wBAAL,kBAAKA,2BAAL;AACL,EAAAA,8CAAA,UAAO,KAAP;AACA,EAAAA,8CAAA,YAAS,KAAT;AACA,EAAAA,8CAAA,WAAQ,KAAR;AACA,EAAAA,8CAAA,YAAS,KAAT;AAJU,SAAAA;AAAA,GAAA;",
|
|
6
6
|
"names": ["DropIndicatorPosition"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-data-table",
|
|
3
|
-
"version": "3.6.0-next.
|
|
3
|
+
"version": "3.6.0-next.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Data Table",
|
|
6
6
|
"files": [
|
|
@@ -571,23 +571,23 @@
|
|
|
571
571
|
"indent": 4
|
|
572
572
|
},
|
|
573
573
|
"dependencies": {
|
|
574
|
-
"@elliemae/ds-button": "3.6.0-next.
|
|
575
|
-
"@elliemae/ds-circular-progress-indicator": "3.6.0-next.
|
|
576
|
-
"@elliemae/ds-controlled-form": "3.6.0-next.
|
|
577
|
-
"@elliemae/ds-drag-and-drop": "3.6.0-next.
|
|
578
|
-
"@elliemae/ds-dropdownmenu": "3.6.0-next.
|
|
579
|
-
"@elliemae/ds-form": "3.6.0-next.
|
|
580
|
-
"@elliemae/ds-form-layout-blocks": "3.6.0-next.
|
|
581
|
-
"@elliemae/ds-grid": "3.6.0-next.
|
|
582
|
-
"@elliemae/ds-icons": "3.6.0-next.
|
|
583
|
-
"@elliemae/ds-pagination": "3.6.0-next.
|
|
584
|
-
"@elliemae/ds-pills": "3.6.0-next.
|
|
585
|
-
"@elliemae/ds-popperjs": "3.6.0-next.
|
|
586
|
-
"@elliemae/ds-skeleton": "3.6.0-next.
|
|
587
|
-
"@elliemae/ds-system": "3.6.0-next.
|
|
588
|
-
"@elliemae/ds-toolbar": "3.6.0-next.
|
|
589
|
-
"@elliemae/ds-truncated-tooltip-text": "3.6.0-next.
|
|
590
|
-
"@elliemae/ds-utilities": "3.6.0-next.
|
|
574
|
+
"@elliemae/ds-button": "3.6.0-next.6",
|
|
575
|
+
"@elliemae/ds-circular-progress-indicator": "3.6.0-next.6",
|
|
576
|
+
"@elliemae/ds-controlled-form": "3.6.0-next.6",
|
|
577
|
+
"@elliemae/ds-drag-and-drop": "3.6.0-next.6",
|
|
578
|
+
"@elliemae/ds-dropdownmenu": "3.6.0-next.6",
|
|
579
|
+
"@elliemae/ds-form": "3.6.0-next.6",
|
|
580
|
+
"@elliemae/ds-form-layout-blocks": "3.6.0-next.6",
|
|
581
|
+
"@elliemae/ds-grid": "3.6.0-next.6",
|
|
582
|
+
"@elliemae/ds-icons": "3.6.0-next.6",
|
|
583
|
+
"@elliemae/ds-pagination": "3.6.0-next.6",
|
|
584
|
+
"@elliemae/ds-pills": "3.6.0-next.6",
|
|
585
|
+
"@elliemae/ds-popperjs": "3.6.0-next.6",
|
|
586
|
+
"@elliemae/ds-skeleton": "3.6.0-next.6",
|
|
587
|
+
"@elliemae/ds-system": "3.6.0-next.6",
|
|
588
|
+
"@elliemae/ds-toolbar": "3.6.0-next.6",
|
|
589
|
+
"@elliemae/ds-truncated-tooltip-text": "3.6.0-next.6",
|
|
590
|
+
"@elliemae/ds-utilities": "3.6.0-next.6",
|
|
591
591
|
"react-virtual": "~2.10.4",
|
|
592
592
|
"uid": "~2.0.0"
|
|
593
593
|
},
|