@pega/lists-react 8.0.0-build.30.2 → 8.0.0-build.31.0
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/lib/Core/Components/GroupRenderer.d.ts.map +1 -1
- package/lib/Core/Components/GroupRenderer.js +13 -0
- package/lib/Core/Components/GroupRenderer.js.map +1 -1
- package/lib/Core/Components/Toolbar/hooks/useSort/useSort.js +2 -2
- package/lib/Core/Components/Toolbar/hooks/useSort/useSort.js.map +1 -1
- package/lib/Core/Components/Virtualise/Pagination.js +1 -1
- package/lib/Core/Components/Virtualise/Pagination.js.map +1 -1
- package/lib/Core/Components/Virtualise/VirtualizeInfinite.js +10 -2
- package/lib/Core/Components/Virtualise/VirtualizeInfinite.js.map +1 -1
- package/lib/Core/Components/Virtualise/index.js +10 -2
- package/lib/Core/Components/Virtualise/index.js.map +1 -1
- package/lib/Core/Views/Table/Body.d.ts.map +1 -1
- package/lib/Core/Views/Table/Body.js +6 -0
- package/lib/Core/Views/Table/Body.js.map +1 -1
- package/lib/Core/Views/Table/SkeletonRows.d.ts +4 -0
- package/lib/Core/Views/Table/SkeletonRows.d.ts.map +1 -0
- package/lib/Core/Views/Table/SkeletonRows.js +61 -0
- package/lib/Core/Views/Table/SkeletonRows.js.map +1 -0
- package/lib/Core/Views/Table/StyledTableContainer.d.ts.map +1 -1
- package/lib/Core/Views/Table/StyledTableContainer.js +62 -8
- package/lib/Core/Views/Table/StyledTableContainer.js.map +1 -1
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupRenderer.d.ts","sourceRoot":"","sources":["../../../Core/Components/GroupRenderer.jsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GroupRenderer.d.ts","sourceRoot":"","sources":["../../../Core/Components/GroupRenderer.jsx"],"names":[],"mappings":"AA8MA;;;mDAyGC;;;;;;;;;;sBAvTqB,YAAY"}
|
|
@@ -21,6 +21,7 @@ const StyledGroupHeader = styled.div `
|
|
|
21
21
|
--group-left: ${props => groupheaderleftdisplacement(props.groupHeader)};
|
|
22
22
|
--group-bg-color: ${props => props.theme.base.palette['secondary-background']};
|
|
23
23
|
background-color: var(--group-bg-color);
|
|
24
|
+
filter: ${props => props.theme.base.shadow['low-filter']};
|
|
24
25
|
|
|
25
26
|
&.row.sticky-group-header {
|
|
26
27
|
position: sticky;
|
|
@@ -84,6 +85,7 @@ const StyledGroupHeader = styled.div `
|
|
|
84
85
|
align-items: center;
|
|
85
86
|
background-color: var(--group-bg-color);
|
|
86
87
|
padding-left: var(--group-left);
|
|
88
|
+
margin-inline-start: 0.25rem;
|
|
87
89
|
z-index: 30;
|
|
88
90
|
cursor: pointer;
|
|
89
91
|
white-space: nowrap;
|
|
@@ -110,6 +112,17 @@ const StyledGroupHeader = styled.div `
|
|
|
110
112
|
div.group-header.cell-fixed {
|
|
111
113
|
background-color: var(--group-bg-color);
|
|
112
114
|
}
|
|
115
|
+
|
|
116
|
+
&::before {
|
|
117
|
+
content: '';
|
|
118
|
+
position: absolute;
|
|
119
|
+
inset-block-start: 0;
|
|
120
|
+
inset-inline-start: 0;
|
|
121
|
+
width: 0.25rem;
|
|
122
|
+
height: 100%;
|
|
123
|
+
background-color: ${props => props.groupHeader.colorIndicator};
|
|
124
|
+
z-index: 12;
|
|
125
|
+
}
|
|
113
126
|
`;
|
|
114
127
|
/**
|
|
115
128
|
* Returns label for interval grouping based on interval and boundaries
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupRenderer.js","sourceRoot":"","sources":["../../../Core/Components/GroupRenderer.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC/B,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,UAAU,MAAM,0DAA0D,CAAC;A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,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;IACpD,WAAW,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;CAC1D,CAAC","sourcesContent":["import PropTypes from 'prop-types';\nimport { useRef } from 'react';\nimport styled from 'styled-components';\n\nimport { Icon } from '@pega/cosmos-react-core';\nimport BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';\nimport { getGroupFromKey } from 'pega-ui-list-data-apis';\n\nimport { createClassName as cx } from '../Utils';\nimport useTranslate from '../Hooks/useTranslate';\nimport { customFunctions, intervalGroupingBoundaries } from '../constants';\n\nimport AggregatorCell from './AggregatorCell';\nimport RenderingEngine from './RenderingEngine/RenderCell';\nimport DateValueDisplay from './DateValueDisplay';\nimport TestIdConstants from './TestIdConstants';\n\nconst groupheaderleftdisplacement = headerLevel => `${(headerLevel.level + 1) * 0.5}rem`;\n/**\n * TODO: remove currentColor style after cosmos fixes the issue\n * Cosmos yet to handle dark theme on BareButton\n */\n\nconst StyledGroupHeader = styled.div`\n --group-left: ${props => groupheaderleftdisplacement(props.groupHeader)};\n --group-bg-color: ${props => props.theme.base.palette['secondary-background']};\n background-color: var(--group-bg-color);\n\n &.row.sticky-group-header {\n position: sticky;\n display: block;\n top: calc(\n ${props =>\n props.groupHeader.isLeafNode && props.groupHeader.level !== 0\n ? 'calc(var(--row-height) + var(--group-header-height))'\n : 'var(--row-height)'}\n );\n\n /* z-index starting from 8 because freeze-line has z-index 7 */\n z-index: ${props => `${8 + props.groupHeader.index}`};\n > .cell-action,\n .cell-fixed {\n background-color: var(--group-bg-color);\n }\n }\n\n .group-label {\n width: 0.437rem;\n display: inline-block;\n flex-shrink: 0;\n }\n\n .group-header-groupby {\n font-weight: ${props => props.theme.base['font-weight'].normal};\n }\n\n .group-context-count {\n font-weight: ${props => props.theme.base['font-weight'].bold};\n }\n\n &.row.group-header-row {\n height: auto;\n border-bottom: ${props => (!props.isAggregationApplied ? 'var(--border-style)' : 'none')};\n\n .group-header-aggregation-row {\n display: flex;\n\n /* Using height 0 so that the aggregations aren't visible when not applied but the cells can take the width and stretch the group header to the full width */\n height: ${props => (props.isAggregationApplied ? 'var(--group-header-height)' : 0)};\n }\n }\n\n &.group-header-row .stickyGroupHeader {\n position: sticky;\n left: 0;\n width: 0;\n z-index: 10;\n height: var(--group-header-height);\n\n > button {\n color: currentColor;\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n width: max-content;\n max-width: var(--container-width);\n display: flex;\n align-items: center;\n background-color: var(--group-bg-color);\n padding-left: var(--group-left);\n z-index: 30;\n cursor: pointer;\n white-space: nowrap;\n text-align: inherit;\n\n > .group-wrapper {\n margin-inline-start: ${({ groupHeader, theme }) =>\n groupHeader.count === 0 ? `calc(${theme.base.spacing} * 2.25)` : 'unset'};\n }\n\n .cell-content {\n max-height: var(--group-header-height);\n padding: 0;\n }\n }\n button:focus {\n box-shadow: ${({ theme }) => theme.base.shadow['focus-inset']};\n }\n }\n .group-header.cell {\n left: 0;\n padding-left: var(--group-left);\n }\n\n div.group-header.cell-fixed {\n background-color: var(--group-bg-color);\n }\n`;\n\n/**\n * Returns label for interval grouping based on interval and boundaries\n Response data depends on boundary settings.\n Ex: For sample data of profit\n profit --> cases(count)\n {'0': 10, 1': 100, '2':30, '10': 35, '15':45, '20':2}\n For Interval 10\n If the boundary is 'include-lower-only',\n and value is 10 then label -> 10 to 20\n\n If boundary is 'include-upper-only',\n and value is 10 then label -> 0 to 10\n * */\nfunction buildIntervalGroupingLabel(value, customFunction, translate) {\n const { interval, boundaries } = customFunction;\n // To restrict the decimals in labels\n const intervalDecimalLength = (interval.toString().split('.')[1] || '').length;\n value = Number(value);\n // In case of 'include-lower-only'\n let lowerValue = value.toFixed(intervalDecimalLength);\n let upperValue = (value + interval).toFixed(intervalDecimalLength);\n // In case of boundary 'include-upper-only'\n if (boundaries === intervalGroupingBoundaries.includeUpperOnly) {\n lowerValue = (value - interval).toFixed(intervalDecimalLength);\n upperValue = value.toFixed(intervalDecimalLength);\n }\n return `${lowerValue} ${translate('to')} ${upperValue}`;\n}\n\nfunction GroupName({ view, column, groupHeader, dateFunction, customFunction }) {\n const [translate] = useTranslate();\n const { locale, timezone } = view.meta;\n const isRangeGrouping = customFunction?.type === customFunctions.RANGE_GROUPING;\n const isIntervalGrouping = customFunction?.type === customFunctions.INTERVAL_GROUPING;\n\n if (dateFunction) {\n return (\n <DateValueDisplay\n value={groupHeader.name}\n dateFunction={dateFunction}\n locale={locale}\n timezone={timezone}\n />\n );\n }\n\n if (isRangeGrouping) {\n /** If custom range grouping applied on number field , we need to show group name as text instead of number */\n return groupHeader.name;\n }\n\n if (isIntervalGrouping) {\n /** If custom range grouping applied on number , we need to show group name based on value and custom function details like interval and boundaries */\n return buildIntervalGroupingLabel(groupHeader.name, customFunction, translate);\n }\n\n column.setExecutionContext(null); // If null is not set then it will execute on the previous row context and facing issues when cell is edited. Based on column.editMode and current context renderer varies (it can be cellEditRenderer)\n\n const columnRendererProps = {\n ...column.getRenderingEngineProps(),\n context: {\n getValue: () => groupHeader.name,\n getExecutionContext: () => {\n return { getValue: () => groupHeader.data, name: 'groupHeader' };\n }\n }\n };\n\n return <RenderingEngine {...columnRendererProps} />;\n}\n\n// NOTE: While making any changes in GroupRenderer.jsx, also make similar changes in HierarchicalGroupRenderer.jsx file if applicable\n\nexport default function GroupHeader({ groupHeader, columns }) {\n const buttonRef = useRef();\n\n // TODO: This we are adding temporary to show freeze border until we make group header rendering change\n // when we will pick up aggregation.\n if (!groupHeader.isVisible) return null;\n\n const view = columns[0].parent;\n // If grouping by a regular column (i.e. without a dateFunction), determine props for the renderer\n const { columnId, dateFunction, customFunction } =\n getGroupFromKey(groupHeader.groupBy, view.state.groups) ?? {};\n // if state.groups is not yet prepared/updated, then getGroupFromKey will return undefined\n if (!columnId) {\n return null;\n }\n\n const column = columns.find(c => c.field.id === columnId);\n const formatter = view.getFormatterByKey('Integer');\n const { locale } = view.meta;\n const groupCountFormatted = formatter\n ? formatter(groupHeader.count, { locale })\n : groupHeader.count;\n const isAggregationApplied = columns.filter(c => !c.hidden).some(c => c.aggregated);\n\n return (\n <StyledGroupHeader\n groupHeader={groupHeader}\n className={cx('row group-header-row sticky-group-header')}\n data-test-id='groupHeader'\n data-testid={TestIdConstants.groupHeader}\n isAggregationApplied={isAggregationApplied}\n role='row'\n onFocus={e => {\n if (buttonRef.current && !e.currentTarget.contains(e.relatedTarget)) {\n e.preventDefault();\n buttonRef.current.focus();\n }\n }}\n >\n <div className='stickyGroupHeader'>\n <BareButton\n ref={buttonRef}\n aria-label={`${\n column.field.hideGroupColumnNameLabel ? '' : groupHeader.label\n } ${groupHeader.name}, ${groupCountFormatted} items`}\n aria-expanded={!!groupHeader.isExpanded}\n style={{\n paddingRight: 'var(--group-left)'\n }}\n onClick={() => groupHeader.count > 0 && view.type.toggleGroupExpansion({ groupHeader })}\n tabIndex={-1}\n >\n {groupHeader.count > 0 &&\n (groupHeader.isExpanded ? <Icon name='caret-down' /> : <Icon name='caret-right' />)}\n <div className='group-wrapper'>\n <div className='group-label' />\n {!column.field.hideGroupColumnNameLabel && (\n <span\n className='group-header-groupby'\n data-test-id={groupHeader.groupBy}\n data-testid={`${TestIdConstants.groupHeaderGroupBy}-${groupHeader.groupBy}`}\n >\n {groupHeader.label}:\n </span>\n )}\n <div className='group-label' />\n <span\n className='group-context-count'\n style={{ display: 'inline-flex' }}\n data-test-id='groupHeader'\n data-testid={TestIdConstants.groupHeaderCount}\n >\n <GroupName\n view={view}\n column={column}\n groupHeader={groupHeader}\n dateFunction={dateFunction}\n customFunction={customFunction}\n />\n {/* adding whitespace pre to preserve the space at the begining of count text */}\n <span style={{ whiteSpace: 'pre' }}>{` (${groupCountFormatted})`}</span>\n </span>\n </div>\n </BareButton>\n </div>\n <div className='group-header-aggregation-row'>\n {columns.map(c => {\n const cxt = {\n getValue: () =>\n groupHeader?.aggregation?.[c.field.name]?.[c.aggregationType?.toLowerCase()]\n };\n return (\n <AggregatorCell\n key={c.field.id}\n column={c}\n context={cxt}\n className={cx('cell', {\n 'cell-fixed': column.frozen\n })}\n />\n );\n })}\n </div>\n </StyledGroupHeader>\n );\n}\n\nGroupHeader.propTypes = {\n columns: PropTypes.arrayOf(PropTypes.any).isRequired,\n groupHeader: PropTypes.objectOf(PropTypes.any).isRequired\n};\n"]}
|
|
1
|
+
{"version":3,"file":"GroupRenderer.js","sourceRoot":"","sources":["../../../Core/Components/GroupRenderer.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC/B,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,UAAU,MAAM,0DAA0D,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EAAE,eAAe,IAAI,EAAE,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,YAAY,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAE3E,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAC3D,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAEhD,MAAM,2BAA2B,GAAG,WAAW,CAAC,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,GAAG,KAAK,CAAC;AACzF;;;GAGG;AAEH,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAA;kBAClB,KAAK,CAAC,EAAE,CAAC,2BAA2B,CAAC,KAAK,CAAC,WAAW,CAAC;sBACnD,KAAK,CAAC,EAAE,CAAC,KAAK,CAA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AAY,EAC1B,cAAc,EAAE,cAAc,GAC9B,EAEF,eAAM,KAAK,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,YAAG,KAAK,mBAAmB,GAAG,GAAQ,IACnE,IACH,IACK,GACT,EACN,cAAK,SAAS,EAAC,8BAA8B,YAC1C,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;oBACf,MAAM,GAAG,GAAG;wBACV,QAAQ,EAAE,GAAG,EAAE,CACb,WAAW,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,eAAe,EAAE,WAAW,EAAE,CAAC;qBAC/E,CAAC;oBACF,OAAO,CACL,KAAC,cAAc,IAEb,MAAM,EAAE,CAAC,EACT,OAAO,EAAE,GAAG,EACZ,SAAS,EAAE,EAAE,CAAC,MAAM,EAAE;4BACpB,YAAY,EAAE,MAAM,CAAC,MAAM;yBAC5B,CAAC,IALG,CAAC,CAAC,KAAK,CAAC,EAAE,CAMf,CACH,CAAC;gBACJ,CAAC,CAAC,GACE,IACY,CACrB,CAAC;AACJ,CAAC;AAED,WAAW,CAAC,SAAS,GAAG;IACtB,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;IACpD,WAAW,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;CAC1D,CAAC","sourcesContent":["import PropTypes from 'prop-types';\nimport { useRef } from 'react';\nimport styled from 'styled-components';\n\nimport { Icon } from '@pega/cosmos-react-core';\nimport BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';\nimport { getGroupFromKey } from 'pega-ui-list-data-apis';\n\nimport { createClassName as cx } from '../Utils';\nimport useTranslate from '../Hooks/useTranslate';\nimport { customFunctions, intervalGroupingBoundaries } from '../constants';\n\nimport AggregatorCell from './AggregatorCell';\nimport RenderingEngine from './RenderingEngine/RenderCell';\nimport DateValueDisplay from './DateValueDisplay';\nimport TestIdConstants from './TestIdConstants';\n\nconst groupheaderleftdisplacement = headerLevel => `${(headerLevel.level + 1) * 0.5}rem`;\n/**\n * TODO: remove currentColor style after cosmos fixes the issue\n * Cosmos yet to handle dark theme on BareButton\n */\n\nconst StyledGroupHeader = styled.div`\n --group-left: ${props => groupheaderleftdisplacement(props.groupHeader)};\n --group-bg-color: ${props => props.theme.base.palette['secondary-background']};\n background-color: var(--group-bg-color);\n filter: ${props => props.theme.base.shadow['low-filter']};\n\n &.row.sticky-group-header {\n position: sticky;\n display: block;\n top: calc(\n ${props =>\n props.groupHeader.isLeafNode && props.groupHeader.level !== 0\n ? 'calc(var(--row-height) + var(--group-header-height))'\n : 'var(--row-height)'}\n );\n\n /* z-index starting from 8 because freeze-line has z-index 7 */\n z-index: ${props => `${8 + props.groupHeader.index}`};\n > .cell-action,\n .cell-fixed {\n background-color: var(--group-bg-color);\n }\n }\n\n .group-label {\n width: 0.437rem;\n display: inline-block;\n flex-shrink: 0;\n }\n\n .group-header-groupby {\n font-weight: ${props => props.theme.base['font-weight'].normal};\n }\n\n .group-context-count {\n font-weight: ${props => props.theme.base['font-weight'].bold};\n }\n\n &.row.group-header-row {\n height: auto;\n border-bottom: ${props => (!props.isAggregationApplied ? 'var(--border-style)' : 'none')};\n\n .group-header-aggregation-row {\n display: flex;\n\n /* Using height 0 so that the aggregations aren't visible when not applied but the cells can take the width and stretch the group header to the full width */\n height: ${props => (props.isAggregationApplied ? 'var(--group-header-height)' : 0)};\n }\n }\n\n &.group-header-row .stickyGroupHeader {\n position: sticky;\n left: 0;\n width: 0;\n z-index: 10;\n height: var(--group-header-height);\n\n > button {\n color: currentColor;\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n width: max-content;\n max-width: var(--container-width);\n display: flex;\n align-items: center;\n background-color: var(--group-bg-color);\n padding-left: var(--group-left);\n margin-inline-start: 0.25rem;\n z-index: 30;\n cursor: pointer;\n white-space: nowrap;\n text-align: inherit;\n\n > .group-wrapper {\n margin-inline-start: ${({ groupHeader, theme }) =>\n groupHeader.count === 0 ? `calc(${theme.base.spacing} * 2.25)` : 'unset'};\n }\n\n .cell-content {\n max-height: var(--group-header-height);\n padding: 0;\n }\n }\n button:focus {\n box-shadow: ${({ theme }) => theme.base.shadow['focus-inset']};\n }\n }\n .group-header.cell {\n left: 0;\n padding-left: var(--group-left);\n }\n\n div.group-header.cell-fixed {\n background-color: var(--group-bg-color);\n }\n\n &::before {\n content: '';\n position: absolute;\n inset-block-start: 0;\n inset-inline-start: 0;\n width: 0.25rem;\n height: 100%;\n background-color: ${props => props.groupHeader.colorIndicator};\n z-index: 12;\n }\n`;\n\n/**\n * Returns label for interval grouping based on interval and boundaries\n Response data depends on boundary settings.\n Ex: For sample data of profit\n profit --> cases(count)\n {'0': 10, 1': 100, '2':30, '10': 35, '15':45, '20':2}\n For Interval 10\n If the boundary is 'include-lower-only',\n and value is 10 then label -> 10 to 20\n\n If boundary is 'include-upper-only',\n and value is 10 then label -> 0 to 10\n * */\nfunction buildIntervalGroupingLabel(value, customFunction, translate) {\n const { interval, boundaries } = customFunction;\n // To restrict the decimals in labels\n const intervalDecimalLength = (interval.toString().split('.')[1] || '').length;\n value = Number(value);\n // In case of 'include-lower-only'\n let lowerValue = value.toFixed(intervalDecimalLength);\n let upperValue = (value + interval).toFixed(intervalDecimalLength);\n // In case of boundary 'include-upper-only'\n if (boundaries === intervalGroupingBoundaries.includeUpperOnly) {\n lowerValue = (value - interval).toFixed(intervalDecimalLength);\n upperValue = value.toFixed(intervalDecimalLength);\n }\n return `${lowerValue} ${translate('to')} ${upperValue}`;\n}\n\nfunction GroupName({ view, column, groupHeader, dateFunction, customFunction }) {\n const [translate] = useTranslate();\n const { locale, timezone } = view.meta;\n const isRangeGrouping = customFunction?.type === customFunctions.RANGE_GROUPING;\n const isIntervalGrouping = customFunction?.type === customFunctions.INTERVAL_GROUPING;\n\n if (dateFunction) {\n return (\n <DateValueDisplay\n value={groupHeader.name}\n dateFunction={dateFunction}\n locale={locale}\n timezone={timezone}\n />\n );\n }\n\n if (isRangeGrouping) {\n /** If custom range grouping applied on number field , we need to show group name as text instead of number */\n return groupHeader.name;\n }\n\n if (isIntervalGrouping) {\n /** If custom range grouping applied on number , we need to show group name based on value and custom function details like interval and boundaries */\n return buildIntervalGroupingLabel(groupHeader.name, customFunction, translate);\n }\n\n column.setExecutionContext(null); // If null is not set then it will execute on the previous row context and facing issues when cell is edited. Based on column.editMode and current context renderer varies (it can be cellEditRenderer)\n\n const columnRendererProps = {\n ...column.getRenderingEngineProps(),\n context: {\n getValue: () => groupHeader.name,\n getExecutionContext: () => {\n return { getValue: () => groupHeader.data, name: 'groupHeader' };\n }\n }\n };\n\n return <RenderingEngine {...columnRendererProps} />;\n}\n\n// NOTE: While making any changes in GroupRenderer.jsx, also make similar changes in HierarchicalGroupRenderer.jsx file if applicable\n\nexport default function GroupHeader({ groupHeader, columns }) {\n const buttonRef = useRef();\n\n // TODO: This we are adding temporary to show freeze border until we make group header rendering change\n // when we will pick up aggregation.\n if (!groupHeader.isVisible) return null;\n\n const view = columns[0].parent;\n // If grouping by a regular column (i.e. without a dateFunction), determine props for the renderer\n const { columnId, dateFunction, customFunction } =\n getGroupFromKey(groupHeader.groupBy, view.state.groups) ?? {};\n // if state.groups is not yet prepared/updated, then getGroupFromKey will return undefined\n if (!columnId) {\n return null;\n }\n\n const column = columns.find(c => c.field.id === columnId);\n const formatter = view.getFormatterByKey('Integer');\n const { locale } = view.meta;\n const groupCountFormatted = formatter\n ? formatter(groupHeader.count, { locale })\n : groupHeader.count;\n const isAggregationApplied = columns.filter(c => !c.hidden).some(c => c.aggregated);\n\n return (\n <StyledGroupHeader\n groupHeader={groupHeader}\n className={cx('row group-header-row sticky-group-header')}\n data-test-id='groupHeader'\n data-testid={TestIdConstants.groupHeader}\n isAggregationApplied={isAggregationApplied}\n role='row'\n onFocus={e => {\n if (buttonRef.current && !e.currentTarget.contains(e.relatedTarget)) {\n e.preventDefault();\n buttonRef.current.focus();\n }\n }}\n >\n <div className='stickyGroupHeader'>\n <BareButton\n ref={buttonRef}\n aria-label={`${\n column.field.hideGroupColumnNameLabel ? '' : groupHeader.label\n } ${groupHeader.name}, ${groupCountFormatted} items`}\n aria-expanded={!!groupHeader.isExpanded}\n style={{\n paddingRight: 'var(--group-left)'\n }}\n onClick={() => groupHeader.count > 0 && view.type.toggleGroupExpansion({ groupHeader })}\n tabIndex={-1}\n >\n {groupHeader.count > 0 &&\n (groupHeader.isExpanded ? <Icon name='caret-down' /> : <Icon name='caret-right' />)}\n <div className='group-wrapper'>\n <div className='group-label' />\n {!column.field.hideGroupColumnNameLabel && (\n <span\n className='group-header-groupby'\n data-test-id={groupHeader.groupBy}\n data-testid={`${TestIdConstants.groupHeaderGroupBy}-${groupHeader.groupBy}`}\n >\n {groupHeader.label}:\n </span>\n )}\n <div className='group-label' />\n <span\n className='group-context-count'\n style={{ display: 'inline-flex' }}\n data-test-id='groupHeader'\n data-testid={TestIdConstants.groupHeaderCount}\n >\n <GroupName\n view={view}\n column={column}\n groupHeader={groupHeader}\n dateFunction={dateFunction}\n customFunction={customFunction}\n />\n {/* adding whitespace pre to preserve the space at the begining of count text */}\n <span style={{ whiteSpace: 'pre' }}>{` (${groupCountFormatted})`}</span>\n </span>\n </div>\n </BareButton>\n </div>\n <div className='group-header-aggregation-row'>\n {columns.map(c => {\n const cxt = {\n getValue: () =>\n groupHeader?.aggregation?.[c.field.name]?.[c.aggregationType?.toLowerCase()]\n };\n return (\n <AggregatorCell\n key={c.field.id}\n column={c}\n context={cxt}\n className={cx('cell', {\n 'cell-fixed': column.frozen\n })}\n />\n );\n })}\n </div>\n </StyledGroupHeader>\n );\n}\n\nGroupHeader.propTypes = {\n columns: PropTypes.arrayOf(PropTypes.any).isRequired,\n groupHeader: PropTypes.objectOf(PropTypes.any).isRequired\n};\n"]}
|
|
@@ -19,8 +19,8 @@ const useSort = ({ view }) => {
|
|
|
19
19
|
applySorting(finalSortItems);
|
|
20
20
|
}, [sortItems, applySorting]);
|
|
21
21
|
const onCancel = useCallback(() => {
|
|
22
|
-
|
|
23
|
-
}, [
|
|
22
|
+
updateSortItems(deepCopy(convertSortingOrderToSortItems(sortingOrder)));
|
|
23
|
+
}, [sortingOrder]);
|
|
24
24
|
const prevSortingOrder = usePrevious(sortingOrder);
|
|
25
25
|
useEffect(() => {
|
|
26
26
|
if (!deepEqual(sortingOrder, prevSortingOrder)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSort.js","sourceRoot":"","sources":["../../../../../../Core/Components/Toolbar/hooks/useSort/useSort.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,EAAE,SAAS,EAAyB,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAIxF,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAM1C,MAAM,8BAA8B,GAAG,CAAC,YAAoB,EAAE,EAAE,CAC9D,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC;AAE3D,MAAM,OAAO,GAAG,CAAC,EAAE,IAAI,EAA8B,EAA4B,EAAE;IACjF,MAAM,EACJ,OAAO,GAAG,EAAE,EACZ,KAAK,EAAE,EAAE,YAAY,GAAG,EAAE,EAAE,GAAG,EAAE,EACjC,IAAI,EAAE,EAAE,YAAY,EAAE,EACvB,GAAG,IAAI,CAAC;IACT,MAAM,WAAW,GAAG,IAAI,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACrE,MAAM,CAAC,SAAS,EAAE,eAAe,CAAC,GAAG,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GAAG,WAAW,CAAC,YAAY,CAAC,CAAC;IACnD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,gBAAgB,CAAC,EAAE,CAAC;YAC/C,eAAe,CAAC,QAAQ,CAAC,8BAA8B,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QAC1E,CAAC;IACH,CAAC,EAAE,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAErC,IAAI,CAAC,WAAW;QAAE,OAAO;IAEzB,OAAO;QACL,KAAK,EAAE,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;QAChE,QAAQ,EAAE,YAAY;QACtB,aAAa,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,EAAE;QACtD,QAAQ;QACR,QAAQ;KACT,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC","sourcesContent":["import { useCallback, useEffect, useState } from 'react';\n\nimport { createUID, type ListToolbarProps, usePrevious } from '@pega/cosmos-react-core';\nimport type { RsCoreTypes } from 'pega-repeating-structures-core';\nimport type { Sort } from 'pega-repeating-structures-core/types/State.types';\n\nimport { TOOLBAR_FEATURES } from '../../../../constants';\nimport { deepCopy, deepEqual } from '../../../../Utils/index';\n\nimport SortRenderer from './SortRenderer';\n\nexport interface SortItem extends Sort {\n id: string;\n}\n\nconst convertSortingOrderToSortItems = (sortingOrder: Sort[]) =>\n sortingOrder.map(sort => ({ ...sort, id: createUID() }));\n\nconst useSort = ({ view }: { view: RsCoreTypes.View }): ListToolbarProps['sort'] => {\n const {\n columns = [],\n state: { sortingOrder = [] } = {},\n type: { applySorting }\n } = view;\n const displaySort = view.shouldDisplayFeature(TOOLBAR_FEATURES.SORT);\n const [sortItems, updateSortItems] = useState<SortItem[]>([]);\n\n const onSubmit = useCallback(() => {\n const finalSortItems = sortItems\n .sort((a, b) => a.sequence - b.sequence)\n .filter(ele => ele.columnId && ele.order)\n .map((item, index) => {\n const { id, ...rest } = item;\n return { ...rest, sequence: index + 1 };\n });\n applySorting(finalSortItems);\n }, [sortItems, applySorting]);\n\n const onCancel = useCallback(() => {\n updateSortItems(deepCopy(convertSortingOrderToSortItems(sortingOrder)));\n }, [sortingOrder]);\n\n const prevSortingOrder = usePrevious(sortingOrder);\n useEffect(() => {\n if (!deepEqual(sortingOrder, prevSortingOrder)) {\n updateSortItems(deepCopy(convertSortingOrderToSortItems(sortingOrder)));\n }\n }, [sortingOrder, prevSortingOrder]);\n\n if (!displaySort) return;\n\n return {\n count: sortingOrder.length > 0 ? sortingOrder.length : undefined,\n renderer: SortRenderer,\n rendererProps: { sortItems, columns, updateSortItems },\n onSubmit,\n onCancel\n };\n};\n\nexport default useSort;\n"]}
|
|
@@ -185,7 +185,7 @@ function getOptimalInfo(target, rowHeight, rContainer, bufferContainer, oldEleme
|
|
|
185
185
|
// A safe check when count is not known in advance.
|
|
186
186
|
topBufferIndex = 0;
|
|
187
187
|
currentRowIndex = 0;
|
|
188
|
-
bottomBufferIndex = buffer *
|
|
188
|
+
bottomBufferIndex = buffer * 5;
|
|
189
189
|
}
|
|
190
190
|
// Safe edge check when indexes goes out of range.
|
|
191
191
|
if (topBufferIndex < 0)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.js","sourceRoot":"","sources":["../../../../Core/Components/Virtualise/Pagination.js"],"names":[],"mappings":"AAAA,MAAM,iBAAiB,GAAG,YAAY,CAAC;AACvC,MAAM,CAAC,MAAM,iBAAiB,GAAG,qBAAqB,CAAC;AAEvD,SAAS,yBAAyB,CAAC,GAAG;IACpC,IAAI,CAAC,GAAG;QAAE,OAAO;IACjB,OAAO,CAAC,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,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AAC,EAAE,CAAC,SAAS,CAAC;IACtE,MAAM,8BAA8B,GAClC,EAAE,CAAC,kBAAkB,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,kBAAkB,CAAC;IAClE,OAAO,cAAc,CACnB,MAAM,EACN,EAAE,CAAC,UAAU,EACb,EAAE,CAAC,UAAU,EACb,EAAE,CAAC,UAAU,EACb,eAAe,EACf,8BAA8B,EAC9B,YAAY,EACZ,EAAE,CAAC,gBAAgB,EACnB,SAAS,EACT,gBAAgB,CACjB,CAAC;AACJ,CAAC","sourcesContent":["const RowIndexAttribute = 'data-index';\nexport const StickyGroupHeader = 'sticky-group-header';\n\nfunction getKeyWithMaxValueFromMap(map) {\n if (!map) return;\n return [...map.entries()].reduce((a, b) => (b[1] > a[1] ? b : a))[0];\n}\n\n// Find nearest element to view.\n// It always find nearest element from top left of container.\nfunction getNearestElementTo(rContainer, targetBoundingBox) {\n const elements = Array.from(rContainer.childNodes);\n const itemCoords = [];\n const items = [];\n const overlappingGroupHeadersCountMap = new Map();\n\n elements.forEach(item => {\n const rect = item.getBoundingClientRect();\n const inHorizontalBoundaries =\n rect.right >= targetBoundingBox.left && rect.left <= targetBoundingBox.right;\n // considering only those items which are in view area.\n if (\n (rect.top >= targetBoundingBox.top &&\n rect.top <= targetBoundingBox.bottom &&\n inHorizontalBoundaries) ||\n (rect.bottom >= targetBoundingBox.top &&\n rect.bottom <= targetBoundingBox.bottom &&\n inHorizontalBoundaries)\n ) {\n itemCoords.push([rect.left, rect.bottom]);\n items.push(item);\n }\n });\n const distances = [];\n itemCoords.forEach((itemCoord, index) => {\n const distance = Math.hypot(\n itemCoord[0] - targetBoundingBox.left,\n itemCoord[1] - targetBoundingBox.top\n );\n const parsedDistance = parseInt(distance, 10);\n distances.push(parsedDistance);\n\n // Keeping track of group header distances to identify the overlap due to sticky position.\n // The distance with max count will represent the sub-group user is actually seeing.\n if (items[index]?.classList?.contains(StickyGroupHeader)) {\n overlappingGroupHeadersCountMap.set(\n parsedDistance,\n (overlappingGroupHeadersCountMap.get(parsedDistance) || 0) + 1\n );\n }\n });\n\n if (distances.length) {\n // BUG-740809 The closest item to view in case of sticky-group-header is first visible sticky-group-header\n const closestItemIndexFromTop = distances.lastIndexOf(Math.min(...distances));\n\n let closestItemFromTop = items[closestItemIndexFromTop];\n /**\n * BUG-81875: Considering sticky sub-group headers\n * When nested grouping is applied and groups have sticky position, the parent group will always be on the top and nested group headers will come after that.\n * Due to this, the nearest element will always be the parent group header even though user might have scrolled down some sub-group header.\n * Actual nearest element should be the sub-group visible to the user.\n */\n if (closestItemFromTop.classList?.contains(StickyGroupHeader)) {\n const topVisibleGroupKey = getKeyWithMaxValueFromMap(overlappingGroupHeadersCountMap);\n closestItemFromTop = items[distances.lastIndexOf(topVisibleGroupKey)];\n }\n const closestItemIndexFromBottom = distances.lastIndexOf(Math.max(...distances));\n\n if (targetBoundingBox.height === 0) {\n closestItemFromTop = elements[0];\n }\n return [closestItemFromTop, items[closestItemIndexFromBottom]];\n }\n return [];\n}\n\n// When element is present in view , find which direction has\n// enough count as we need to get record in another direction.\n// direction 1 - up, -1 - down\n// Nearest element is one which lies in view boundary.\n\nfunction getDirectionWhereCountIsEnough(nearestViewElement, currentRowIndex, targetBoundingBox) {\n let previousSiblingsCountAboveView = 0;\n let nextSiblingsCountBelowView = 0;\n let startElement = nearestViewElement;\n let dir = 1;\n if (currentRowIndex !== 0 && !startElement.previousElementSibling) dir = -1;\n else {\n while (startElement.previousElementSibling) {\n // BUG-740809 in case of overlapped sticky-group-header the previousElementSibling are at same 'top' location\n if (startElement.previousElementSibling.classList.contains(StickyGroupHeader)) {\n previousSiblingsCountAboveView += 1;\n } else {\n const itemCoords = startElement.previousElementSibling.getBoundingClientRect();\n if (itemCoords.bottom < targetBoundingBox.top) previousSiblingsCountAboveView += 1;\n }\n startElement = startElement.previousElementSibling;\n }\n if (nearestViewElement.classList.contains(StickyGroupHeader))\n previousSiblingsCountAboveView -= 1;\n if (parseInt(startElement.getAttribute(RowIndexAttribute), 10) === 0) dir = 1;\n else {\n startElement = nearestViewElement;\n while (startElement.nextElementSibling) {\n const itemCoords = startElement.nextElementSibling.getBoundingClientRect();\n if (itemCoords.top > targetBoundingBox.bottom) nextSiblingsCountBelowView += 1;\n startElement = startElement.nextElementSibling;\n }\n // iterate in either direction where count is more\n // until you find top element whose left match with nearest view element match.\n // and matched index will be either top or bottom buffer index.\n if (currentRowIndex !== 0 && nextSiblingsCountBelowView >= previousSiblingsCountAboveView)\n dir = -1;\n }\n }\n return dir;\n}\n\n// Get start and end index which view represent at any monument.\n// Add extra information as well to adjust virtualiser position.\n\nfunction getOptimalInfo(\n target,\n rowHeight,\n rContainer,\n bufferContainer,\n oldElementCount,\n heightComposingOldElementCount,\n totalRecords,\n bufferMultiplier,\n isRefresh,\n isInfiniteScroll\n) {\n let currentRowIndex;\n let topRowIndex = 0;\n let topBufferIndex = -1;\n let bottomBufferIndex = -1;\n let existingItemBoundingBox;\n\n // Estimated buffer count based on view height and row container count.\n // Increase in buffer count can improve performance.\n // A safeguard value which will apply on initial load.\n const INITIAL_BUFFER = 10;\n const buffer = INITIAL_BUFFER * bufferMultiplier;\n const scrollDirectionBuffer = buffer * 2;\n const scrollOppositeDirectionBuffer = buffer;\n\n let rowsInView = heightComposingOldElementCount\n ? Math.floor((oldElementCount / heightComposingOldElementCount) * target.offsetHeight)\n : 0;\n rowsInView = Number.isNaN(rowsInView) ? 0 : rowsInView;\n\n if (totalRecords > 0) {\n const targetBoundingBox = target.getBoundingClientRect();\n const rowConBoundingBox = rContainer.getBoundingClientRect();\n\n // Check if any element exist in current view. Calculation will change the required index\n // As we have to fix the container to not show any flicker.\n const [nearestViewElementFromTop, nearestViewElementFromBottom] = getNearestElementTo(\n rContainer,\n targetBoundingBox\n );\n if (nearestViewElementFromTop) {\n currentRowIndex = parseInt(nearestViewElementFromTop.getAttribute(RowIndexAttribute), 10);\n existingItemBoundingBox = nearestViewElementFromTop.getBoundingClientRect();\n\n // check how long this nearest item is from top of view.\n // to estimate top row index ( What could be possible index on view top.)\n const spaceInMid = existingItemBoundingBox.top - targetBoundingBox.top;\n const elementsInMid = Math.floor(\n (oldElementCount / heightComposingOldElementCount) * spaceInMid\n );\n topRowIndex = elementsInMid < 0 ? currentRowIndex : currentRowIndex - elementsInMid;\n } else {\n currentRowIndex =\n Math.floor((target.scrollTop / heightComposingOldElementCount) * oldElementCount) || 0;\n topRowIndex = currentRowIndex;\n }\n\n // If element exist in current view, traverse dom elements\n // to find top buffer index or bottom buffer index\n // where left match to not change layout.\n if (existingItemBoundingBox) {\n let dir = 1;\n\n // We will consider direction 1 always in case of refresh as item count might have been changed.\n // change in item count is always from downside.\n if (!isRefresh)\n dir = getDirectionWhereCountIsEnough(\n nearestViewElementFromTop,\n currentRowIndex,\n targetBoundingBox\n );\n\n // We will iterate either upside or downside and pick that element\n // which we can select as either top buffer or botton buffer and don't\n // change layout as well and go for max iteration of buffer.\n let maxIteration = buffer;\n let startElement = dir === 1 ? nearestViewElementFromTop : nearestViewElementFromBottom;\n while (startElement && maxIteration > 0) {\n const e = dir === 1 ? startElement.previousElementSibling : startElement.nextElementSibling;\n if (\n e &&\n rowConBoundingBox.left ===\n e.getBoundingClientRect().left - parseInt(window.getComputedStyle(e).marginLeft, 10)\n ) {\n if (dir === 1) topBufferIndex = parseInt(e.getAttribute(RowIndexAttribute), 10);\n else bottomBufferIndex = parseInt(e.getAttribute(RowIndexAttribute), 10);\n }\n startElement = e;\n maxIteration -= 1;\n }\n\n if (dir === 1) bottomBufferIndex = currentRowIndex + rowsInView + scrollDirectionBuffer;\n else topBufferIndex = topRowIndex - scrollDirectionBuffer;\n } else {\n // if user jumps the scroll and there is no overlapping with the previous records\n topBufferIndex = currentRowIndex - scrollOppositeDirectionBuffer;\n bottomBufferIndex = currentRowIndex + rowsInView + scrollDirectionBuffer;\n }\n } else if (!totalRecords && totalRecords !== 0) {\n // A safe check when count is not known in advance.\n topBufferIndex = 0;\n currentRowIndex = 0;\n bottomBufferIndex = buffer * 4;\n }\n\n // Safe edge check when indexes goes out of range.\n if (topBufferIndex < 0) topBufferIndex = 0;\n // As safari does elastic scroll, so currentRowIndex and topRowIndex can go negative , fallback these to zero.\n if (currentRowIndex < 0) currentRowIndex = 0;\n if (topRowIndex < 0) topRowIndex = 0;\n if (\n !isInfiniteScroll &&\n bottomBufferIndex > totalRecords &&\n totalRecords !== null &&\n totalRecords !== undefined\n )\n bottomBufferIndex = totalRecords - 1;\n\n // When we get start index 0 from scrolling then , on edge case we might get whitespace\n // As we always adjust row container top to show previous item in place.\n // To solve this, make sure top index is also 0 when start index is zero to avoid white space\n // otherwise we will make start index to 1 if it is zero.\n // if (topBufferIndex === 0 && topRowIndex !== 0) topBufferIndex = 1;\n\n // before pagination is in progress, put scroll node coords here\n // to track how much user scrolled while pagination is in progress.\n const bufferOldCords = bufferContainer.getBoundingClientRect();\n return {\n existingItemBoundingBox, // coordinates of current row index.\n currentRowIndex, // common visible item in view before and after paint (previous and next paint)\n topRowIndex, // What could be possible index on view top.\n bufferOldCords, // buffer coordinates while pagination.\n bufferNewCords: bufferOldCords, // buffer coordinates while pagination is in progress and user scroll.\n view: {\n startIndex: Math.floor(topBufferIndex),\n endIndex: Math.floor(bottomBufferIndex)\n }\n };\n}\n\nexport default function getPaginationInfo(\n target,\n totalRecords,\n vi,\n isRefresh = false,\n isInfiniteScroll = false\n) {\n const oldElementCount = vi.itemCount === undefined ? 0 : vi.itemCount;\n const heightComposingOldElementCount =\n vi.rowContainerHeight === undefined ? 0 : vi.rowContainerHeight;\n return getOptimalInfo(\n target,\n vi.itemHeight,\n vi.rContainer,\n vi.bContainer,\n oldElementCount,\n heightComposingOldElementCount,\n totalRecords,\n vi.bufferMultiplier,\n isRefresh,\n isInfiniteScroll\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Pagination.js","sourceRoot":"","sources":["../../../../Core/Components/Virtualise/Pagination.js"],"names":[],"mappings":"AAA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K,CAAC,cAAc,CAAC;YACtC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC;SACxC;KACF,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,OAAO,UAAU,iBAAiB,CACvC,MAAM,EACN,YAAY,EACZ,EAAE,EACF,SAAS,GAAG,KAAK,EACjB,gBAAgB,GAAG,KAAK;IAExB,MAAM,eAAe,GAAG,EAAE,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC;IACtE,MAAM,8BAA8B,GAClC,EAAE,CAAC,kBAAkB,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,kBAAkB,CAAC;IAClE,OAAO,cAAc,CACnB,MAAM,EACN,EAAE,CAAC,UAAU,EACb,EAAE,CAAC,UAAU,EACb,EAAE,CAAC,UAAU,EACb,eAAe,EACf,8BAA8B,EAC9B,YAAY,EACZ,EAAE,CAAC,gBAAgB,EACnB,SAAS,EACT,gBAAgB,CACjB,CAAC;AACJ,CAAC","sourcesContent":["const RowIndexAttribute = 'data-index';\nexport const StickyGroupHeader = 'sticky-group-header';\n\nfunction getKeyWithMaxValueFromMap(map) {\n if (!map) return;\n return [...map.entries()].reduce((a, b) => (b[1] > a[1] ? b : a))[0];\n}\n\n// Find nearest element to view.\n// It always find nearest element from top left of container.\nfunction getNearestElementTo(rContainer, targetBoundingBox) {\n const elements = Array.from(rContainer.childNodes);\n const itemCoords = [];\n const items = [];\n const overlappingGroupHeadersCountMap = new Map();\n\n elements.forEach(item => {\n const rect = item.getBoundingClientRect();\n const inHorizontalBoundaries =\n rect.right >= targetBoundingBox.left && rect.left <= targetBoundingBox.right;\n // considering only those items which are in view area.\n if (\n (rect.top >= targetBoundingBox.top &&\n rect.top <= targetBoundingBox.bottom &&\n inHorizontalBoundaries) ||\n (rect.bottom >= targetBoundingBox.top &&\n rect.bottom <= targetBoundingBox.bottom &&\n inHorizontalBoundaries)\n ) {\n itemCoords.push([rect.left, rect.bottom]);\n items.push(item);\n }\n });\n const distances = [];\n itemCoords.forEach((itemCoord, index) => {\n const distance = Math.hypot(\n itemCoord[0] - targetBoundingBox.left,\n itemCoord[1] - targetBoundingBox.top\n );\n const parsedDistance = parseInt(distance, 10);\n distances.push(parsedDistance);\n\n // Keeping track of group header distances to identify the overlap due to sticky position.\n // The distance with max count will represent the sub-group user is actually seeing.\n if (items[index]?.classList?.contains(StickyGroupHeader)) {\n overlappingGroupHeadersCountMap.set(\n parsedDistance,\n (overlappingGroupHeadersCountMap.get(parsedDistance) || 0) + 1\n );\n }\n });\n\n if (distances.length) {\n // BUG-740809 The closest item to view in case of sticky-group-header is first visible sticky-group-header\n const closestItemIndexFromTop = distances.lastIndexOf(Math.min(...distances));\n\n let closestItemFromTop = items[closestItemIndexFromTop];\n /**\n * BUG-81875: Considering sticky sub-group headers\n * When nested grouping is applied and groups have sticky position, the parent group will always be on the top and nested group headers will come after that.\n * Due to this, the nearest element will always be the parent group header even though user might have scrolled down some sub-group header.\n * Actual nearest element should be the sub-group visible to the user.\n */\n if (closestItemFromTop.classList?.contains(StickyGroupHeader)) {\n const topVisibleGroupKey = getKeyWithMaxValueFromMap(overlappingGroupHeadersCountMap);\n closestItemFromTop = items[distances.lastIndexOf(topVisibleGroupKey)];\n }\n const closestItemIndexFromBottom = distances.lastIndexOf(Math.max(...distances));\n\n if (targetBoundingBox.height === 0) {\n closestItemFromTop = elements[0];\n }\n return [closestItemFromTop, items[closestItemIndexFromBottom]];\n }\n return [];\n}\n\n// When element is present in view , find which direction has\n// enough count as we need to get record in another direction.\n// direction 1 - up, -1 - down\n// Nearest element is one which lies in view boundary.\n\nfunction getDirectionWhereCountIsEnough(nearestViewElement, currentRowIndex, targetBoundingBox) {\n let previousSiblingsCountAboveView = 0;\n let nextSiblingsCountBelowView = 0;\n let startElement = nearestViewElement;\n let dir = 1;\n if (currentRowIndex !== 0 && !startElement.previousElementSibling) dir = -1;\n else {\n while (startElement.previousElementSibling) {\n // BUG-740809 in case of overlapped sticky-group-header the previousElementSibling are at same 'top' location\n if (startElement.previousElementSibling.classList.contains(StickyGroupHeader)) {\n previousSiblingsCountAboveView += 1;\n } else {\n const itemCoords = startElement.previousElementSibling.getBoundingClientRect();\n if (itemCoords.bottom < targetBoundingBox.top) previousSiblingsCountAboveView += 1;\n }\n startElement = startElement.previousElementSibling;\n }\n if (nearestViewElement.classList.contains(StickyGroupHeader))\n previousSiblingsCountAboveView -= 1;\n if (parseInt(startElement.getAttribute(RowIndexAttribute), 10) === 0) dir = 1;\n else {\n startElement = nearestViewElement;\n while (startElement.nextElementSibling) {\n const itemCoords = startElement.nextElementSibling.getBoundingClientRect();\n if (itemCoords.top > targetBoundingBox.bottom) nextSiblingsCountBelowView += 1;\n startElement = startElement.nextElementSibling;\n }\n // iterate in either direction where count is more\n // until you find top element whose left match with nearest view element match.\n // and matched index will be either top or bottom buffer index.\n if (currentRowIndex !== 0 && nextSiblingsCountBelowView >= previousSiblingsCountAboveView)\n dir = -1;\n }\n }\n return dir;\n}\n\n// Get start and end index which view represent at any monument.\n// Add extra information as well to adjust virtualiser position.\n\nfunction getOptimalInfo(\n target,\n rowHeight,\n rContainer,\n bufferContainer,\n oldElementCount,\n heightComposingOldElementCount,\n totalRecords,\n bufferMultiplier,\n isRefresh,\n isInfiniteScroll\n) {\n let currentRowIndex;\n let topRowIndex = 0;\n let topBufferIndex = -1;\n let bottomBufferIndex = -1;\n let existingItemBoundingBox;\n\n // Estimated buffer count based on view height and row container count.\n // Increase in buffer count can improve performance.\n // A safeguard value which will apply on initial load.\n const INITIAL_BUFFER = 10;\n const buffer = INITIAL_BUFFER * bufferMultiplier;\n const scrollDirectionBuffer = buffer * 2;\n const scrollOppositeDirectionBuffer = buffer;\n\n let rowsInView = heightComposingOldElementCount\n ? Math.floor((oldElementCount / heightComposingOldElementCount) * target.offsetHeight)\n : 0;\n rowsInView = Number.isNaN(rowsInView) ? 0 : rowsInView;\n\n if (totalRecords > 0) {\n const targetBoundingBox = target.getBoundingClientRect();\n const rowConBoundingBox = rContainer.getBoundingClientRect();\n\n // Check if any element exist in current view. Calculation will change the required index\n // As we have to fix the container to not show any flicker.\n const [nearestViewElementFromTop, nearestViewElementFromBottom] = getNearestElementTo(\n rContainer,\n targetBoundingBox\n );\n if (nearestViewElementFromTop) {\n currentRowIndex = parseInt(nearestViewElementFromTop.getAttribute(RowIndexAttribute), 10);\n existingItemBoundingBox = nearestViewElementFromTop.getBoundingClientRect();\n\n // check how long this nearest item is from top of view.\n // to estimate top row index ( What could be possible index on view top.)\n const spaceInMid = existingItemBoundingBox.top - targetBoundingBox.top;\n const elementsInMid = Math.floor(\n (oldElementCount / heightComposingOldElementCount) * spaceInMid\n );\n topRowIndex = elementsInMid < 0 ? currentRowIndex : currentRowIndex - elementsInMid;\n } else {\n currentRowIndex =\n Math.floor((target.scrollTop / heightComposingOldElementCount) * oldElementCount) || 0;\n topRowIndex = currentRowIndex;\n }\n\n // If element exist in current view, traverse dom elements\n // to find top buffer index or bottom buffer index\n // where left match to not change layout.\n if (existingItemBoundingBox) {\n let dir = 1;\n\n // We will consider direction 1 always in case of refresh as item count might have been changed.\n // change in item count is always from downside.\n if (!isRefresh)\n dir = getDirectionWhereCountIsEnough(\n nearestViewElementFromTop,\n currentRowIndex,\n targetBoundingBox\n );\n\n // We will iterate either upside or downside and pick that element\n // which we can select as either top buffer or botton buffer and don't\n // change layout as well and go for max iteration of buffer.\n let maxIteration = buffer;\n let startElement = dir === 1 ? nearestViewElementFromTop : nearestViewElementFromBottom;\n while (startElement && maxIteration > 0) {\n const e = dir === 1 ? startElement.previousElementSibling : startElement.nextElementSibling;\n if (\n e &&\n rowConBoundingBox.left ===\n e.getBoundingClientRect().left - parseInt(window.getComputedStyle(e).marginLeft, 10)\n ) {\n if (dir === 1) topBufferIndex = parseInt(e.getAttribute(RowIndexAttribute), 10);\n else bottomBufferIndex = parseInt(e.getAttribute(RowIndexAttribute), 10);\n }\n startElement = e;\n maxIteration -= 1;\n }\n\n if (dir === 1) bottomBufferIndex = currentRowIndex + rowsInView + scrollDirectionBuffer;\n else topBufferIndex = topRowIndex - scrollDirectionBuffer;\n } else {\n // if user jumps the scroll and there is no overlapping with the previous records\n topBufferIndex = currentRowIndex - scrollOppositeDirectionBuffer;\n bottomBufferIndex = currentRowIndex + rowsInView + scrollDirectionBuffer;\n }\n } else if (!totalRecords && totalRecords !== 0) {\n // A safe check when count is not known in advance.\n topBufferIndex = 0;\n currentRowIndex = 0;\n bottomBufferIndex = buffer * 5;\n }\n\n // Safe edge check when indexes goes out of range.\n if (topBufferIndex < 0) topBufferIndex = 0;\n // As safari does elastic scroll, so currentRowIndex and topRowIndex can go negative , fallback these to zero.\n if (currentRowIndex < 0) currentRowIndex = 0;\n if (topRowIndex < 0) topRowIndex = 0;\n if (\n !isInfiniteScroll &&\n bottomBufferIndex > totalRecords &&\n totalRecords !== null &&\n totalRecords !== undefined\n )\n bottomBufferIndex = totalRecords - 1;\n\n // When we get start index 0 from scrolling then , on edge case we might get whitespace\n // As we always adjust row container top to show previous item in place.\n // To solve this, make sure top index is also 0 when start index is zero to avoid white space\n // otherwise we will make start index to 1 if it is zero.\n // if (topBufferIndex === 0 && topRowIndex !== 0) topBufferIndex = 1;\n\n // before pagination is in progress, put scroll node coords here\n // to track how much user scrolled while pagination is in progress.\n const bufferOldCords = bufferContainer.getBoundingClientRect();\n return {\n existingItemBoundingBox, // coordinates of current row index.\n currentRowIndex, // common visible item in view before and after paint (previous and next paint)\n topRowIndex, // What could be possible index on view top.\n bufferOldCords, // buffer coordinates while pagination.\n bufferNewCords: bufferOldCords, // buffer coordinates while pagination is in progress and user scroll.\n view: {\n startIndex: Math.floor(topBufferIndex),\n endIndex: Math.floor(bottomBufferIndex)\n }\n };\n}\n\nexport default function getPaginationInfo(\n target,\n totalRecords,\n vi,\n isRefresh = false,\n isInfiniteScroll = false\n) {\n const oldElementCount = vi.itemCount === undefined ? 0 : vi.itemCount;\n const heightComposingOldElementCount =\n vi.rowContainerHeight === undefined ? 0 : vi.rowContainerHeight;\n return getOptimalInfo(\n target,\n vi.itemHeight,\n vi.rContainer,\n vi.bContainer,\n oldElementCount,\n heightComposingOldElementCount,\n totalRecords,\n vi.bufferMultiplier,\n isRefresh,\n isInfiniteScroll\n );\n}\n"]}
|
|
@@ -2,9 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef, memo, useEffect, useRef, useCallback, useImperativeHandle, useMemo, useLayoutEffect, useState } from 'react';
|
|
3
3
|
import Styled from 'styled-components';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
|
-
import { Progress, usePrevious } from '@pega/cosmos-react-core';
|
|
5
|
+
import { defaultThemeProp, Progress, usePrevious } from '@pega/cosmos-react-core';
|
|
6
6
|
import EmptyContainer from '../DefaultComponents/EmptyContainer';
|
|
7
7
|
import useTranslate from '../../Hooks/useTranslate';
|
|
8
|
+
import { StyledSkeletonRow } from '../../Views/Table/SkeletonRows';
|
|
8
9
|
import getPaginationInfo from './Pagination';
|
|
9
10
|
import useScroll from './UseScroll';
|
|
10
11
|
import { getCurrentEstimation, getRecordCountForLayoutPaint, getValueWithUnit, getMaxHeight, isPaginationRequestCompleted, isViewNotFilled, setAttributesOnItems, updateRowContainerTop } from './utility';
|
|
@@ -19,12 +20,19 @@ const StyledPContainer = Styled.div `
|
|
|
19
20
|
width: ${props => props.$style.width};
|
|
20
21
|
height: ${props => props.$style.height};
|
|
21
22
|
min-height: ${props => props.$style.minHeight};
|
|
23
|
+
border-radius: ${props => props.theme.base['border-radius']};
|
|
24
|
+
|
|
25
|
+
&:has(${StyledSkeletonRow}) {
|
|
26
|
+
overflow: hidden;
|
|
27
|
+
}
|
|
22
28
|
|
|
23
29
|
.bContainer {
|
|
24
30
|
position: relative;
|
|
25
31
|
min-height: ${props => getBContainerMinHeight(props)};
|
|
32
|
+
border-radius: inherit;
|
|
26
33
|
}
|
|
27
34
|
`;
|
|
35
|
+
StyledPContainer.defaultProps = defaultThemeProp;
|
|
28
36
|
const StyledLoader = Styled.div `
|
|
29
37
|
display: flex;
|
|
30
38
|
justify-content: center;
|
|
@@ -308,7 +316,7 @@ VirtualizeInfinite.propTypes = {
|
|
|
308
316
|
countUpdateCallback: PropTypes.func
|
|
309
317
|
};
|
|
310
318
|
VirtualizeInfinite.defaultProps = {
|
|
311
|
-
bufferMultiplier:
|
|
319
|
+
bufferMultiplier: 2,
|
|
312
320
|
callback: () => { },
|
|
313
321
|
rowContainerClass: '',
|
|
314
322
|
viewHeight: 400,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VirtualizeInfinite.js","sourceRoot":"","sources":["../../../../Core/Components/Virtualise/VirtualizeInfinite.jsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EACV,IAAI,EACJ,SAAS,EACT,MAAM,EACN,WAAW,EACX,mBAAmB,EACnB,OAAO,EACP,eAAe,EACf,QAAQ,EACT,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,cAAc,MAAM,qCAAqC,CAAC;AACjE,OAAO,YAAY,MAAM,0BAA0B,CAAC;AAEpD,OAAO,iBAAiB,MAAM,cAAc,CAAC;AAC7C,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,EACL,oBAAoB,EACpB,4BAA4B,EAC5B,gBAAgB,EAChB,YAAY,EACZ,4BAA4B,EAC5B,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,WAAW,CAAC;AACnB,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AAEpD,SAAS,sBAAsB,CAAC,KAAK;IACnC,OAAO,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,C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AY,EAAE,IAAI;IAClB,KAAK,EAAE,SAAS;IAChB,YAAY,EAAE,SAAS;IACvB,aAAa,EAAE,SAAS;IACxB,oBAAoB,EAAE,KAAK;IAC3B,UAAU,EAAE,KAAK;IACjB,mBAAmB,EAAE,GAAG,EAAE,GAAE,CAAC;CAC9B,CAAC;AAEF,kBAAkB,CAAC,WAAW,GAAG,oBAAoB,CAAC;AAEtD,eAAe,IAAI,CAAC,kBAAkB,CAAC,CAAC","sourcesContent":["import {\n forwardRef,\n memo,\n useEffect,\n useRef,\n useCallback,\n useImperativeHandle,\n useMemo,\n useLayoutEffect,\n useState\n} from 'react';\nimport Styled from 'styled-components';\nimport PropTypes from 'prop-types';\n\nimport { Progress, usePrevious } from '@pega/cosmos-react-core';\n\nimport EmptyContainer from '../DefaultComponents/EmptyContainer';\nimport useTranslate from '../../Hooks/useTranslate';\n\nimport getPaginationInfo from './Pagination';\nimport useScroll from './UseScroll';\nimport {\n getCurrentEstimation,\n getRecordCountForLayoutPaint,\n getValueWithUnit,\n getMaxHeight,\n isPaginationRequestCompleted,\n isViewNotFilled,\n setAttributesOnItems,\n updateRowContainerTop\n} from './utility';\nimport useResizeObserver from './UseResizeObserver';\n\nfunction getBContainerMinHeight(props) {\n return props.$style.renderFooter ? `calc(100% - ${2 * props.$style.itemHeight + 1}px) ` : '0';\n}\n\nconst StyledPContainer = Styled.div`\n position: relative;\n overflow: auto;\n max-height: ${props => props.$style.maxHeight};\n width: ${props => props.$style.width};\n height: ${props => props.$style.height};\n min-height: ${props => props.$style.minHeight};\n\n .bContainer {\n position: relative;\n min-height: ${props => getBContainerMinHeight(props)};\n }\n`;\n\nconst StyledLoader = Styled.div`\n display: flex;\n justify-content: center;\n padding: 0.5rem;\n position: absolute;\n width: 100%;\n top: ${props => props.$style.top};\n bottom: ${props => props.$style.bottom};\n`;\n\nconst VirtualizeInfinite = forwardRef(\n (\n {\n id,\n viewHeight,\n viewWidth,\n itemHeight,\n callback,\n rowContainerClass,\n children,\n renderHeader,\n renderFooter,\n state,\n bufferMultiplier,\n basicMode,\n numberOfRows,\n viewMaxHeight,\n showLoadingIndicator,\n resetCount,\n countUpdateCallback\n },\n inputRef\n ) => {\n const rowBuffer = 5;\n\n const previousChildren = usePrevious(children);\n\n const [rContainerDimensionUpdate, setRContainerDimensionUpdate] = useState();\n const [isFetching, setIsFetching] = useState(false);\n const [loadingIndicatorInfo, setLoadingIndicatorInfo] = useState({});\n const [translate] = useTranslate();\n\n // Create ref to store virtualize related data.\n const vi = useRef({\n itemHeight,\n bufferMultiplier,\n pInfo: {},\n hasEndReached: false,\n totalRowsLoaded: undefined\n }).current;\n\n const getTotalRowsIncludingBuffer = useCallback(() => {\n if (vi.totalRowsLoaded !== null && vi.totalRowsLoaded !== undefined) {\n return vi.hasEndReached || isFetching ? vi.totalRowsLoaded : vi.totalRowsLoaded + rowBuffer;\n }\n return undefined;\n }, [vi, isFetching]);\n\n const getRowContainer = useCallback(() => vi.rContainer, [vi.rContainer]);\n const getPContainer = useCallback(() => vi.pContainer, [vi.pContainer]);\n const getBContainer = useCallback(() => vi.bContainer, [vi.bContainer]);\n\n // API used when user want to scroll to top programmatically.\n // Though component auto scroll to top if no element is in view.\n // But calling this API upfront might save one extra call to Fetch API.\n const scrollToTop = useCallback(\n cb => {\n if (!state) return;\n getPContainer().scrollTop = 0;\n vi.pInfo = getPaginationInfo(\n getPContainer(),\n getRecordCountForLayoutPaint(getTotalRowsIncludingBuffer()),\n vi,\n false,\n true\n );\n setIsFetching(true);\n cb({ ...vi.pInfo.view, id }, { takeLatestAction: true });\n },\n [id, vi, state, getPContainer]\n );\n\n // expose APIs and properties here to help client to communicate.\n useImperativeHandle(inputRef, () => ({\n getParentContainer: getPContainer,\n scrollToTop,\n vi,\n id\n }));\n\n const { width, height } = useMemo(\n () => ({\n width: getValueWithUnit(viewWidth, basicMode, numberOfRows),\n height: getValueWithUnit(viewHeight, basicMode, numberOfRows)\n }),\n [viewWidth, viewHeight, basicMode, numberOfRows]\n );\n\n const maxHeight = useMemo(\n () => getMaxHeight(viewMaxHeight, basicMode),\n [basicMode, viewMaxHeight]\n );\n\n // Calculate the pagination indexes and notify callback.\n // resetIsFetchingWhenNoNewIndexes - flag specific for isViewNotFilled\n // If view is not filled, we want to call this but resting isFetch to false\n // goes to this method when callback is note fired.\n const getPagination = useCallback(\n (isRefresh = false, resetIsFetchingWhenNoNewIndexes = false) => {\n if (!isFetching || resetIsFetchingWhenNoNewIndexes) {\n const pInfo = getPaginationInfo(\n getPContainer(),\n getRecordCountForLayoutPaint(getTotalRowsIncludingBuffer()),\n vi,\n isRefresh,\n true\n );\n const { startIndex, endIndex } = pInfo.view;\n // if new indexes are subset of existing state indexes, no need to update the consumer.\n if (\n isRefresh ||\n !state ||\n !(startIndex >= state.startIndex && endIndex <= state.endIndex)\n ) {\n vi.pInfo = pInfo;\n setIsFetching(true);\n if (state) {\n const { startIndex: oldStartIndex, endIndex: oldEndIndex } = state;\n if (startIndex < oldStartIndex) {\n setLoadingIndicatorInfo(info => {\n return { ...info, isScrollingUp: true };\n });\n }\n if (endIndex > oldEndIndex) {\n setLoadingIndicatorInfo(info => {\n return { ...info, isScrollingDown: true };\n });\n }\n }\n\n callback({ ...vi.pInfo.view, id });\n } else if (resetIsFetchingWhenNoNewIndexes) {\n setIsFetching(false);\n setLoadingIndicatorInfo({});\n }\n }\n },\n [isFetching, getPContainer, getTotalRowsIncludingBuffer, vi, state, callback, id]\n );\n\n // update average stats for next calculation.\n const updateAvarageInVirtualizeInstance = useCallback(\n currentEstimation => {\n const { itemCount, rowContainerHeight, averageNumberOfItemsInARow, averageRowHeight } =\n currentEstimation;\n Object.assign(vi, {\n itemCount: (itemCount + vi.itemCount || itemCount) / 2,\n rowContainerHeight:\n (rowContainerHeight + vi.rowContainerHeight || rowContainerHeight) / 2,\n averageNumberOfItemsInARow:\n (averageNumberOfItemsInARow + vi.averageNumberOfItemsInARow ||\n averageNumberOfItemsInARow) / 2,\n averageRowHeight: (averageRowHeight + vi.averageRowHeight || averageRowHeight) / 2\n });\n },\n [vi]\n );\n\n const getBufferHeight = useCallback(\n currentEstimation => {\n const { itemCount, rowContainerHeight } = currentEstimation;\n let h = 0;\n if (itemCount > 0)\n h =\n (getRecordCountForLayoutPaint(getTotalRowsIncludingBuffer()) / itemCount) *\n rowContainerHeight;\n return h;\n },\n [getTotalRowsIncludingBuffer]\n );\n\n const getScrollTop = useCallback(\n currentEstimation => {\n const { itemCount, rowContainerHeight } = currentEstimation;\n let scrollTop = 0;\n if (itemCount > 0) {\n const scrollNodeTopChange =\n // eslint-disable-next-line no-unsafe-optional-chaining\n vi.pInfo?.bufferNewCords?.top - vi.pInfo?.bufferOldCords?.top || 0;\n scrollTop = (vi.pInfo.topRowIndex / itemCount) * rowContainerHeight - scrollNodeTopChange;\n }\n return scrollTop;\n },\n [vi]\n );\n\n const onRowContainerDimensionChange = useCallback(() => {\n const { height: rowContainerHeight, width: rowContainerWidth } =\n getRowContainer()?.getBoundingClientRect() ?? {};\n // trigger virtualizer operations only when row container has some height and width\n if (!isFetching && rowContainerHeight && rowContainerWidth) setRContainerDimensionUpdate({});\n }, [isFetching]);\n\n useResizeObserver(getRowContainer, onRowContainerDimensionChange);\n\n const [updateScrollTop] = useScroll(\n getPagination,\n getPContainer,\n vi,\n getTotalRowsIncludingBuffer(),\n renderHeader,\n isFetching,\n viewHeight\n );\n\n useLayoutEffect(() => {\n const rContainer = getRowContainer();\n if (state && state.startIndex >= 0 && vi && rContainer) {\n setAttributesOnItems(state, rContainer);\n }\n });\n\n useLayoutEffect(() => {\n if (!state || !isPaginationRequestCompleted(vi, state) || children === previousChildren)\n return;\n\n // if count updated, reset the calculations\n if (resetCount) {\n vi.totalRowsLoaded = 0;\n vi.hasEndReached = false;\n }\n\n const rowElements = Array.from(getRowContainer().children || []).filter(a =>\n a.hasAttribute('data-key')\n );\n\n // if fetching is not happening and there are no rows on DOM means there are no more records\n // And it is possible that, due to intermediate render, we have the state but data fetching isn't completed and rows are still not painted on dom,\n // hence we can't decide virtualizer has reached end (hence do not set \"hasEndReached\" to true here)\n if (!isFetching && !rowElements.length) {\n vi.totalRowsLoaded = 0;\n countUpdateCallback(vi.totalRowsLoaded);\n return;\n }\n\n if (rowElements.length) {\n const lastRow = rowElements[rowElements.length - 1];\n const lastRowDataIndex = parseInt(lastRow.getAttribute('data-index'), 10);\n const newCount = vi.hasEndReached ? lastRowDataIndex + 1 : lastRowDataIndex + 1 + rowBuffer;\n\n // if user is scrolling up/down within the already encountered records, the record count shouldn't update\n if (newCount < getTotalRowsIncludingBuffer() && !resetCount) return;\n\n // Using vi.totalRowsLoaded === undefined and !vi.direction checks for initial load\n if (\n (vi.totalRowsLoaded === undefined || lastRowDataIndex >= vi.totalRowsLoaded - 1) &&\n lastRowDataIndex < state.endIndex &&\n (vi.direction === 1 || !vi.direction || resetCount)\n ) {\n vi.hasEndReached = true;\n }\n\n vi.totalRowsLoaded = lastRowDataIndex + 1;\n countUpdateCallback(vi.totalRowsLoaded);\n }\n }, [\n vi,\n state,\n children,\n isFetching,\n resetCount,\n previousChildren,\n countUpdateCallback,\n rContainerDimensionUpdate,\n getRowContainer,\n getTotalRowsIncludingBuffer\n ]);\n\n // Get estimate and update buffer height\n useLayoutEffect(() => {\n if (\n state &&\n getTotalRowsIncludingBuffer() !== undefined &&\n getTotalRowsIncludingBuffer() !== null\n ) {\n vi.currentEstimation = getCurrentEstimation(getRowContainer(), true);\n updateAvarageInVirtualizeInstance(vi.currentEstimation);\n const h = getBufferHeight(vi.currentEstimation);\n getBContainer().style.height = `${h}px`;\n }\n }, [\n vi,\n state,\n children,\n rContainerDimensionUpdate,\n getBContainer,\n getBufferHeight,\n getRowContainer,\n getTotalRowsIncludingBuffer,\n updateAvarageInVirtualizeInstance\n ]);\n\n useLayoutEffect(() => {\n if (\n getTotalRowsIncludingBuffer() !== undefined &&\n getTotalRowsIncludingBuffer() !== null &&\n isPaginationRequestCompleted(vi, state)\n ) {\n const pContainer = getPContainer();\n const scrollTop = getScrollTop(vi.currentEstimation);\n if (vi.pInfo.view.startIndex !== 0) pContainer.scrollTop = scrollTop;\n\n // Setting scrollTop from pContainer.scrollTop as getScrollTop can return value with higher decimal accuracy.\n // but scrollTop attribute from HTML element will round it automatically.\n updateScrollTop(pContainer.scrollTop);\n updateRowContainerTop(\n vi,\n getRecordCountForLayoutPaint(getTotalRowsIncludingBuffer()),\n state,\n pContainer,\n pContainer.scrollTop\n );\n }\n }, [vi, state, getScrollTop, getPContainer, updateScrollTop, getTotalRowsIncludingBuffer]);\n\n // On mount that means state is not initialized yet, trigger pagination.\n // or whenever count changes or width /height of view port changes, if view is not filled with data, get indexes again.\n useEffect(() => {\n if (state && isPaginationRequestCompleted(vi, state)) {\n if (\n getTotalRowsIncludingBuffer() !== undefined &&\n getTotalRowsIncludingBuffer() !== null &&\n isViewNotFilled(\n getRecordCountForLayoutPaint(getTotalRowsIncludingBuffer()),\n vi,\n getPContainer(),\n renderHeader\n )\n ) {\n getPagination(false, true);\n } else {\n setIsFetching(false);\n setLoadingIndicatorInfo({});\n }\n } else if (!state || !Object.keys(vi.pInfo).length) {\n getPagination(true);\n }\n }, [\n vi,\n state,\n children,\n viewWidth,\n viewHeight,\n renderHeader,\n rContainerDimensionUpdate,\n getPagination,\n getPContainer,\n getTotalRowsIncludingBuffer\n ]);\n\n return (\n <StyledPContainer\n $style={{\n maxHeight,\n minHeight: basicMode && vi.totalRowsLoaded === 0 ? '100px' : 'auto',\n renderFooter,\n itemHeight,\n height,\n width\n }}\n data-total-records={vi.totalRowsLoaded}\n className='pContainer'\n ref={c => {\n vi.pContainer = c;\n }}\n >\n {renderHeader && renderHeader()}\n <div\n className='bContainer'\n ref={c => {\n vi.bContainer = c;\n }}\n >\n <div\n className={`${rowContainerClass} row-container`}\n ref={c => {\n vi.rContainer = c;\n }}\n role='rowgroup'\n >\n {showLoadingIndicator && isFetching && loadingIndicatorInfo.isScrollingUp && (\n <StyledLoader $style={{ bottom: '100%' }}>\n <Progress\n className='above-loader'\n placement='block'\n tabIndex={0}\n aria-label={translate('Loading more results')}\n />\n </StyledLoader>\n )}\n {children}\n {showLoadingIndicator && isFetching && loadingIndicatorInfo.isScrollingDown && (\n <StyledLoader $style={{ top: '100%' }}>\n <Progress\n className='below-loader'\n placement='block'\n tabIndex={0}\n aria-label={translate('Loading more results')}\n />\n </StyledLoader>\n )}\n </div>\n </div>\n {vi.totalRowsLoaded === 0 ? <EmptyContainer /> : null}\n {renderFooter && renderFooter()}\n </StyledPContainer>\n );\n }\n);\n\nVirtualizeInfinite.propTypes = {\n id: PropTypes.string.isRequired,\n viewHeight: PropTypes.number,\n viewWidth: PropTypes.number,\n itemHeight: PropTypes.number,\n callback: PropTypes.func,\n rowContainerClass: PropTypes.string,\n children: PropTypes.oneOfType([PropTypes.object, PropTypes.array]).isRequired,\n renderHeader: PropTypes.func,\n renderFooter: PropTypes.func,\n state: PropTypes.shape({\n startIndex: PropTypes.number,\n endIndex: PropTypes.number\n }),\n bufferMultiplier: PropTypes.number,\n basicMode: PropTypes.bool.isRequired,\n numberOfRows: PropTypes.number,\n viewMaxHeight: PropTypes.string,\n showLoadingIndicator: PropTypes.bool,\n resetCount: PropTypes.bool,\n countUpdateCallback: PropTypes.func\n};\n\nVirtualizeInfinite.defaultProps = {\n bufferMultiplier: 1,\n callback: () => {},\n rowContainerClass: '',\n viewHeight: 400,\n viewWidth: 0,\n itemHeight: 40,\n renderHeader: null,\n renderFooter: null,\n state: undefined,\n numberOfRows: undefined,\n viewMaxHeight: undefined,\n showLoadingIndicator: false,\n resetCount: false,\n countUpdateCallback: () => {}\n};\n\nVirtualizeInfinite.displayName = 'VirtualizeInfinite';\n\nexport default memo(VirtualizeInfinite);\n"]}
|
|
1
|
+
{"version":3,"file":"VirtualizeInfinite.js","sourceRoot":"","sources":["../../../../Core/Components/Virtualise/VirtualizeInfinite.jsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EACV,IAAI,EACJ,SAAS,EACT,MAAM,EACN,WA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Effect,\n useState\n} from 'react';\nimport Styled from 'styled-components';\nimport PropTypes from 'prop-types';\n\nimport { defaultThemeProp, Progress, usePrevious } from '@pega/cosmos-react-core';\n\nimport EmptyContainer from '../DefaultComponents/EmptyContainer';\nimport useTranslate from '../../Hooks/useTranslate';\nimport { StyledSkeletonRow } from '../../Views/Table/SkeletonRows';\n\nimport getPaginationInfo from './Pagination';\nimport useScroll from './UseScroll';\nimport {\n getCurrentEstimation,\n getRecordCountForLayoutPaint,\n getValueWithUnit,\n getMaxHeight,\n isPaginationRequestCompleted,\n isViewNotFilled,\n setAttributesOnItems,\n updateRowContainerTop\n} from './utility';\nimport useResizeObserver from './UseResizeObserver';\n\nfunction getBContainerMinHeight(props) {\n return props.$style.renderFooter ? `calc(100% - ${2 * props.$style.itemHeight + 1}px) ` : '0';\n}\n\nconst StyledPContainer = Styled.div`\n position: relative;\n overflow: auto;\n max-height: ${props => props.$style.maxHeight};\n width: ${props => props.$style.width};\n height: ${props => props.$style.height};\n min-height: ${props => props.$style.minHeight};\n border-radius: ${props => props.theme.base['border-radius']};\n\n &:has(${StyledSkeletonRow}) {\n overflow: hidden;\n }\n\n .bContainer {\n position: relative;\n min-height: ${props => getBContainerMinHeight(props)};\n border-radius: inherit;\n }\n`;\n\nStyledPContainer.defaultProps = defaultThemeProp;\n\nconst StyledLoader = Styled.div`\n display: flex;\n justify-content: center;\n padding: 0.5rem;\n position: absolute;\n width: 100%;\n top: ${props => props.$style.top};\n bottom: ${props => props.$style.bottom};\n`;\n\nconst VirtualizeInfinite = forwardRef(\n (\n {\n id,\n viewHeight,\n viewWidth,\n itemHeight,\n callback,\n rowContainerClass,\n children,\n renderHeader,\n renderFooter,\n state,\n bufferMultiplier,\n basicMode,\n numberOfRows,\n viewMaxHeight,\n showLoadingIndicator,\n resetCount,\n countUpdateCallback\n },\n inputRef\n ) => {\n const rowBuffer = 5;\n\n const previousChildren = usePrevious(children);\n\n const [rContainerDimensionUpdate, setRContainerDimensionUpdate] = useState();\n const [isFetching, setIsFetching] = useState(false);\n const [loadingIndicatorInfo, setLoadingIndicatorInfo] = useState({});\n const [translate] = useTranslate();\n\n // Create ref to store virtualize related data.\n const vi = useRef({\n itemHeight,\n bufferMultiplier,\n pInfo: {},\n hasEndReached: false,\n totalRowsLoaded: undefined\n }).current;\n\n const getTotalRowsIncludingBuffer = useCallback(() => {\n if (vi.totalRowsLoaded !== null && vi.totalRowsLoaded !== undefined) {\n return vi.hasEndReached || isFetching ? vi.totalRowsLoaded : vi.totalRowsLoaded + rowBuffer;\n }\n return undefined;\n }, [vi, isFetching]);\n\n const getRowContainer = useCallback(() => vi.rContainer, [vi.rContainer]);\n const getPContainer = useCallback(() => vi.pContainer, [vi.pContainer]);\n const getBContainer = useCallback(() => vi.bContainer, [vi.bContainer]);\n\n // API used when user want to scroll to top programmatically.\n // Though component auto scroll to top if no element is in view.\n // But calling this API upfront might save one extra call to Fetch API.\n const scrollToTop = useCallback(\n cb => {\n if (!state) return;\n getPContainer().scrollTop = 0;\n vi.pInfo = getPaginationInfo(\n getPContainer(),\n getRecordCountForLayoutPaint(getTotalRowsIncludingBuffer()),\n vi,\n false,\n true\n );\n setIsFetching(true);\n cb({ ...vi.pInfo.view, id }, { takeLatestAction: true });\n },\n [id, vi, state, getPContainer]\n );\n\n // expose APIs and properties here to help client to communicate.\n useImperativeHandle(inputRef, () => ({\n getParentContainer: getPContainer,\n scrollToTop,\n vi,\n id\n }));\n\n const { width, height } = useMemo(\n () => ({\n width: getValueWithUnit(viewWidth, basicMode, numberOfRows),\n height: getValueWithUnit(viewHeight, basicMode, numberOfRows)\n }),\n [viewWidth, viewHeight, basicMode, numberOfRows]\n );\n\n const maxHeight = useMemo(\n () => getMaxHeight(viewMaxHeight, basicMode),\n [basicMode, viewMaxHeight]\n );\n\n // Calculate the pagination indexes and notify callback.\n // resetIsFetchingWhenNoNewIndexes - flag specific for isViewNotFilled\n // If view is not filled, we want to call this but resting isFetch to false\n // goes to this method when callback is note fired.\n const getPagination = useCallback(\n (isRefresh = false, resetIsFetchingWhenNoNewIndexes = false) => {\n if (!isFetching || resetIsFetchingWhenNoNewIndexes) {\n const pInfo = getPaginationInfo(\n getPContainer(),\n getRecordCountForLayoutPaint(getTotalRowsIncludingBuffer()),\n vi,\n isRefresh,\n true\n );\n const { startIndex, endIndex } = pInfo.view;\n // if new indexes are subset of existing state indexes, no need to update the consumer.\n if (\n isRefresh ||\n !state ||\n !(startIndex >= state.startIndex && endIndex <= state.endIndex)\n ) {\n vi.pInfo = pInfo;\n setIsFetching(true);\n if (state) {\n const { startIndex: oldStartIndex, endIndex: oldEndIndex } = state;\n if (startIndex < oldStartIndex) {\n setLoadingIndicatorInfo(info => {\n return { ...info, isScrollingUp: true };\n });\n }\n if (endIndex > oldEndIndex) {\n setLoadingIndicatorInfo(info => {\n return { ...info, isScrollingDown: true };\n });\n }\n }\n\n callback({ ...vi.pInfo.view, id });\n } else if (resetIsFetchingWhenNoNewIndexes) {\n setIsFetching(false);\n setLoadingIndicatorInfo({});\n }\n }\n },\n [isFetching, getPContainer, getTotalRowsIncludingBuffer, vi, state, callback, id]\n );\n\n // update average stats for next calculation.\n const updateAvarageInVirtualizeInstance = useCallback(\n currentEstimation => {\n const { itemCount, rowContainerHeight, averageNumberOfItemsInARow, averageRowHeight } =\n currentEstimation;\n Object.assign(vi, {\n itemCount: (itemCount + vi.itemCount || itemCount) / 2,\n rowContainerHeight:\n (rowContainerHeight + vi.rowContainerHeight || rowContainerHeight) / 2,\n averageNumberOfItemsInARow:\n (averageNumberOfItemsInARow + vi.averageNumberOfItemsInARow ||\n averageNumberOfItemsInARow) / 2,\n averageRowHeight: (averageRowHeight + vi.averageRowHeight || averageRowHeight) / 2\n });\n },\n [vi]\n );\n\n const getBufferHeight = useCallback(\n currentEstimation => {\n const { itemCount, rowContainerHeight } = currentEstimation;\n let h = 0;\n if (itemCount > 0)\n h =\n (getRecordCountForLayoutPaint(getTotalRowsIncludingBuffer()) / itemCount) *\n rowContainerHeight;\n return h;\n },\n [getTotalRowsIncludingBuffer]\n );\n\n const getScrollTop = useCallback(\n currentEstimation => {\n const { itemCount, rowContainerHeight } = currentEstimation;\n let scrollTop = 0;\n if (itemCount > 0) {\n const scrollNodeTopChange =\n // eslint-disable-next-line no-unsafe-optional-chaining\n vi.pInfo?.bufferNewCords?.top - vi.pInfo?.bufferOldCords?.top || 0;\n scrollTop = (vi.pInfo.topRowIndex / itemCount) * rowContainerHeight - scrollNodeTopChange;\n }\n return scrollTop;\n },\n [vi]\n );\n\n const onRowContainerDimensionChange = useCallback(() => {\n const { height: rowContainerHeight, width: rowContainerWidth } =\n getRowContainer()?.getBoundingClientRect() ?? {};\n // trigger virtualizer operations only when row container has some height and width\n if (!isFetching && rowContainerHeight && rowContainerWidth) setRContainerDimensionUpdate({});\n }, [isFetching]);\n\n useResizeObserver(getRowContainer, onRowContainerDimensionChange);\n\n const [updateScrollTop] = useScroll(\n getPagination,\n getPContainer,\n vi,\n getTotalRowsIncludingBuffer(),\n renderHeader,\n isFetching,\n viewHeight\n );\n\n useLayoutEffect(() => {\n const rContainer = getRowContainer();\n if (state && state.startIndex >= 0 && vi && rContainer) {\n setAttributesOnItems(state, rContainer);\n }\n });\n\n useLayoutEffect(() => {\n if (!state || !isPaginationRequestCompleted(vi, state) || children === previousChildren)\n return;\n\n // if count updated, reset the calculations\n if (resetCount) {\n vi.totalRowsLoaded = 0;\n vi.hasEndReached = false;\n }\n\n const rowElements = Array.from(getRowContainer().children || []).filter(a =>\n a.hasAttribute('data-key')\n );\n\n // if fetching is not happening and there are no rows on DOM means there are no more records\n // And it is possible that, due to intermediate render, we have the state but data fetching isn't completed and rows are still not painted on dom,\n // hence we can't decide virtualizer has reached end (hence do not set \"hasEndReached\" to true here)\n if (!isFetching && !rowElements.length) {\n vi.totalRowsLoaded = 0;\n countUpdateCallback(vi.totalRowsLoaded);\n return;\n }\n\n if (rowElements.length) {\n const lastRow = rowElements[rowElements.length - 1];\n const lastRowDataIndex = parseInt(lastRow.getAttribute('data-index'), 10);\n const newCount = vi.hasEndReached ? lastRowDataIndex + 1 : lastRowDataIndex + 1 + rowBuffer;\n\n // if user is scrolling up/down within the already encountered records, the record count shouldn't update\n if (newCount < getTotalRowsIncludingBuffer() && !resetCount) return;\n\n // Using vi.totalRowsLoaded === undefined and !vi.direction checks for initial load\n if (\n (vi.totalRowsLoaded === undefined || lastRowDataIndex >= vi.totalRowsLoaded - 1) &&\n lastRowDataIndex < state.endIndex &&\n (vi.direction === 1 || !vi.direction || resetCount)\n ) {\n vi.hasEndReached = true;\n }\n\n vi.totalRowsLoaded = lastRowDataIndex + 1;\n countUpdateCallback(vi.totalRowsLoaded);\n }\n }, [\n vi,\n state,\n children,\n isFetching,\n resetCount,\n previousChildren,\n countUpdateCallback,\n rContainerDimensionUpdate,\n getRowContainer,\n getTotalRowsIncludingBuffer\n ]);\n\n // Get estimate and update buffer height\n useLayoutEffect(() => {\n if (\n state &&\n getTotalRowsIncludingBuffer() !== undefined &&\n getTotalRowsIncludingBuffer() !== null\n ) {\n vi.currentEstimation = getCurrentEstimation(getRowContainer(), true);\n updateAvarageInVirtualizeInstance(vi.currentEstimation);\n const h = getBufferHeight(vi.currentEstimation);\n getBContainer().style.height = `${h}px`;\n }\n }, [\n vi,\n state,\n children,\n rContainerDimensionUpdate,\n getBContainer,\n getBufferHeight,\n getRowContainer,\n getTotalRowsIncludingBuffer,\n updateAvarageInVirtualizeInstance\n ]);\n\n useLayoutEffect(() => {\n if (\n getTotalRowsIncludingBuffer() !== undefined &&\n getTotalRowsIncludingBuffer() !== null &&\n isPaginationRequestCompleted(vi, state)\n ) {\n const pContainer = getPContainer();\n const scrollTop = getScrollTop(vi.currentEstimation);\n if (vi.pInfo.view.startIndex !== 0) pContainer.scrollTop = scrollTop;\n\n // Setting scrollTop from pContainer.scrollTop as getScrollTop can return value with higher decimal accuracy.\n // but scrollTop attribute from HTML element will round it automatically.\n updateScrollTop(pContainer.scrollTop);\n updateRowContainerTop(\n vi,\n getRecordCountForLayoutPaint(getTotalRowsIncludingBuffer()),\n state,\n pContainer,\n pContainer.scrollTop\n );\n }\n }, [vi, state, getScrollTop, getPContainer, updateScrollTop, getTotalRowsIncludingBuffer]);\n\n // On mount that means state is not initialized yet, trigger pagination.\n // or whenever count changes or width /height of view port changes, if view is not filled with data, get indexes again.\n useEffect(() => {\n if (state && isPaginationRequestCompleted(vi, state)) {\n if (\n getTotalRowsIncludingBuffer() !== undefined &&\n getTotalRowsIncludingBuffer() !== null &&\n isViewNotFilled(\n getRecordCountForLayoutPaint(getTotalRowsIncludingBuffer()),\n vi,\n getPContainer(),\n renderHeader\n )\n ) {\n getPagination(false, true);\n } else {\n setIsFetching(false);\n setLoadingIndicatorInfo({});\n }\n } else if (!state || !Object.keys(vi.pInfo).length) {\n getPagination(true);\n }\n }, [\n vi,\n state,\n children,\n viewWidth,\n viewHeight,\n renderHeader,\n rContainerDimensionUpdate,\n getPagination,\n getPContainer,\n getTotalRowsIncludingBuffer\n ]);\n\n return (\n <StyledPContainer\n $style={{\n maxHeight,\n minHeight: basicMode && vi.totalRowsLoaded === 0 ? '100px' : 'auto',\n renderFooter,\n itemHeight,\n height,\n width\n }}\n data-total-records={vi.totalRowsLoaded}\n className='pContainer'\n ref={c => {\n vi.pContainer = c;\n }}\n >\n {renderHeader && renderHeader()}\n <div\n className='bContainer'\n ref={c => {\n vi.bContainer = c;\n }}\n >\n <div\n className={`${rowContainerClass} row-container`}\n ref={c => {\n vi.rContainer = c;\n }}\n role='rowgroup'\n >\n {showLoadingIndicator && isFetching && loadingIndicatorInfo.isScrollingUp && (\n <StyledLoader $style={{ bottom: '100%' }}>\n <Progress\n className='above-loader'\n placement='block'\n tabIndex={0}\n aria-label={translate('Loading more results')}\n />\n </StyledLoader>\n )}\n {children}\n {showLoadingIndicator && isFetching && loadingIndicatorInfo.isScrollingDown && (\n <StyledLoader $style={{ top: '100%' }}>\n <Progress\n className='below-loader'\n placement='block'\n tabIndex={0}\n aria-label={translate('Loading more results')}\n />\n </StyledLoader>\n )}\n </div>\n </div>\n {vi.totalRowsLoaded === 0 ? <EmptyContainer /> : null}\n {renderFooter && renderFooter()}\n </StyledPContainer>\n );\n }\n);\n\nVirtualizeInfinite.propTypes = {\n id: PropTypes.string.isRequired,\n viewHeight: PropTypes.number,\n viewWidth: PropTypes.number,\n itemHeight: PropTypes.number,\n callback: PropTypes.func,\n rowContainerClass: PropTypes.string,\n children: PropTypes.oneOfType([PropTypes.object, PropTypes.array]).isRequired,\n renderHeader: PropTypes.func,\n renderFooter: PropTypes.func,\n state: PropTypes.shape({\n startIndex: PropTypes.number,\n endIndex: PropTypes.number\n }),\n bufferMultiplier: PropTypes.number,\n basicMode: PropTypes.bool.isRequired,\n numberOfRows: PropTypes.number,\n viewMaxHeight: PropTypes.string,\n showLoadingIndicator: PropTypes.bool,\n resetCount: PropTypes.bool,\n countUpdateCallback: PropTypes.func\n};\n\nVirtualizeInfinite.defaultProps = {\n bufferMultiplier: 2,\n callback: () => {},\n rowContainerClass: '',\n viewHeight: 400,\n viewWidth: 0,\n itemHeight: 40,\n renderHeader: null,\n renderFooter: null,\n state: undefined,\n numberOfRows: undefined,\n viewMaxHeight: undefined,\n showLoadingIndicator: false,\n resetCount: false,\n countUpdateCallback: () => {}\n};\n\nVirtualizeInfinite.displayName = 'VirtualizeInfinite';\n\nexport default memo(VirtualizeInfinite);\n"]}
|
|
@@ -2,10 +2,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef, memo, useEffect, useRef, useCallback, useImperativeHandle, useMemo, useLayoutEffect, useState } from 'react';
|
|
3
3
|
import Styled from 'styled-components';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
|
-
import { Progress } from '@pega/cosmos-react-core';
|
|
5
|
+
import { defaultThemeProp, Progress } from '@pega/cosmos-react-core';
|
|
6
6
|
import { isEmpty } from 'pega-repeating-structures-core';
|
|
7
7
|
import EmptyContainer from '../DefaultComponents/EmptyContainer';
|
|
8
8
|
import useTranslate from '../../Hooks/useTranslate';
|
|
9
|
+
import { StyledSkeletonRow } from '../../Views/Table/SkeletonRows';
|
|
9
10
|
import getPaginationInfo from './Pagination';
|
|
10
11
|
import useScroll from './UseScroll';
|
|
11
12
|
import { getCurrentEstimation, isPaginationRequestCompleted, updateRowContainerTop, setAttributesOnItems, isViewNotFilled, getRecordCountForLayoutPaint, getPContainerClientWidth, getValueWithUnit, getMaxHeight } from './utility';
|
|
@@ -20,6 +21,11 @@ const StyledPContainer = Styled.div `
|
|
|
20
21
|
width: ${props => props.$style.width};
|
|
21
22
|
height: ${props => props.$style.height};
|
|
22
23
|
min-height: ${props => props.$style.minHeight};
|
|
24
|
+
border-radius: ${props => props.theme.base['border-radius']};
|
|
25
|
+
|
|
26
|
+
&:has(${StyledSkeletonRow}) {
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
}
|
|
23
29
|
|
|
24
30
|
/**
|
|
25
31
|
* When height and maxHeight is auto, virtualization is not going to happen and the scroll jump on row deletion scenario is not going to happen.
|
|
@@ -31,8 +37,10 @@ const StyledPContainer = Styled.div `
|
|
|
31
37
|
: 'sticky'};
|
|
32
38
|
width: 0;
|
|
33
39
|
min-height: ${props => getBContainerMinHeight(props)};
|
|
40
|
+
border-radius: inherit;
|
|
34
41
|
}
|
|
35
42
|
`;
|
|
43
|
+
StyledPContainer.defaultProps = defaultThemeProp;
|
|
36
44
|
const StyledLoader = Styled.div `
|
|
37
45
|
display: flex;
|
|
38
46
|
justify-content: center;
|
|
@@ -294,7 +302,7 @@ Virtualize.propTypes = {
|
|
|
294
302
|
showLoadingIndicator: PropTypes.bool
|
|
295
303
|
};
|
|
296
304
|
Virtualize.defaultProps = {
|
|
297
|
-
bufferMultiplier:
|
|
305
|
+
bufferMultiplier: 2,
|
|
298
306
|
callback: () => { },
|
|
299
307
|
rowContainerClass: '',
|
|
300
308
|
viewHeight: 400,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":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AAK,EAAE,SAAS;IAChB,gBAAgB,EAAE,SAAS;IAC3B,YAAY,EAAE,SAAS;IACvB,aAAa,EAAE,SAAS;IACxB,oBAAoB,EAAE,KAAK;CAC5B,CAAC;AAEF,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC;AAEtC,eAAe,IAAI,CAAC,UAAU,CAAC,CAAC","sourcesContent":["import {\n forwardRef,\n memo,\n useEffect,\n useRef,\n useCallback,\n useImperativeHandle,\n useMemo,\n useLayoutEffect,\n useState\n} from 'react';\nimport Styled from 'styled-components';\nimport PropTypes from 'prop-types';\n\nimport { Progress } from '@pega/cosmos-react-core';\nimport { isEmpty } from 'pega-repeating-structures-core';\n\nimport EmptyContainer from '../DefaultComponents/EmptyContainer';\nimport useTranslate from '../../Hooks/useTranslate';\n\nimport getPaginationInfo from './Pagination';\nimport useScroll from './UseScroll';\nimport {\n getCurrentEstimation,\n isPaginationRequestCompleted,\n updateRowContainerTop,\n setAttributesOnItems,\n isViewNotFilled,\n getRecordCountForLayoutPaint,\n getPContainerClientWidth,\n getValueWithUnit,\n getMaxHeight\n} from './utility';\nimport useResizeObserver from './UseResizeObserver';\n\nfunction getBContainerMinHeight(props) {\n return props.$style.renderFooter ? `calc(100% - ${2 * props.$style.itemHeight + 1}px) ` : '0';\n}\n\nconst StyledPContainer = Styled.div`\n position: relative;\n overflow: auto;\n max-height: ${props => props.$style.maxHeight};\n width: ${props => props.$style.width};\n height: ${props => props.$style.height};\n min-height: ${props => props.$style.minHeight};\n\n /**\n * When height and maxHeight is auto, virtualization is not going to happen and the scroll jump on row deletion scenario is not going to happen.\n * In such cases, using relative position as sticky was used to fix scroll jump in firefox during virtualization.\n */\n .bContainer {\n position: ${props =>\n props.$style.maxHeight?.startsWith('auto') && props.$style.height?.startsWith('auto')\n ? 'relative'\n : 'sticky'};\n width: 0;\n min-height: ${props => getBContainerMinHeight(props)};\n }\n`;\n\nconst StyledLoader = Styled.div`\n display: flex;\n justify-content: center;\n padding: 0.5rem;\n position: absolute;\n width: var(--container-width);\n left: ${props => `var(${props.$style.left})`};\n top: ${props => `var(${props.$style.top})`};\n`;\n\nconst Virtualize = forwardRef(\n (\n {\n id,\n viewHeight,\n viewWidth,\n totalRecordCount,\n itemHeight,\n callback,\n rowContainerClass,\n children,\n renderHeader,\n renderFooter,\n state,\n bufferMultiplier,\n basicMode,\n numberOfRows,\n viewMaxHeight,\n showLoadingIndicator\n },\n inputRef\n ) => {\n const [rContainerDimensionUpdate, setRContainerDimensionUpdate] = useState();\n const [isFetching, setIsFetching] = useState(false);\n const [loadingIndicatorInfo, setLoadingIndicatorInfo] = useState({});\n const [translate] = useTranslate();\n // Create ref to store virtualize related data.\n const vi = useRef({\n itemHeight,\n bufferMultiplier,\n pInfo: {}\n }).current;\n\n const getRowContainer = useCallback(() => vi.rContainer, [vi.rContainer]);\n const getPContainer = useCallback(() => vi.pContainer, [vi.pContainer]);\n const getBContainer = useCallback(() => vi.bContainer, [vi.bContainer]);\n\n // API used when user want to scroll to top programmatically.\n // Though component auto scroll to top if no element is in view.\n // But calling this API upfront might save one extra call to Fetch API.\n const scrollToTop = useCallback(\n cb => {\n if (!state) return;\n getPContainer().scrollTop = 0;\n vi.pInfo = getPaginationInfo(\n getPContainer(),\n getRecordCountForLayoutPaint(totalRecordCount),\n vi,\n false,\n true\n );\n setIsFetching(true);\n cb({ ...vi.pInfo.view, id }, { takeLatestAction: true });\n },\n [id, vi, state, getPContainer]\n );\n\n // expose APIs and properties here to help client to communicate.\n useImperativeHandle(inputRef, () => ({\n getParentContainer: getPContainer,\n scrollToTop,\n vi,\n id\n }));\n\n const { width, height } = useMemo(\n () => ({\n width: getValueWithUnit(viewWidth, basicMode, numberOfRows),\n height: getValueWithUnit(viewHeight, basicMode, numberOfRows)\n }),\n [viewWidth, viewHeight, basicMode, numberOfRows]\n );\n\n const maxHeight = useMemo(\n () => getMaxHeight(viewMaxHeight, basicMode),\n [basicMode, viewMaxHeight]\n );\n\n const minHeight = useMemo(() => {\n if (basicMode && totalRecordCount === 0) {\n return '100px';\n }\n return 'auto';\n }, [basicMode, totalRecordCount]);\n\n // Calculate the pagination indexes and notify callback.\n // resetIsFetchingWhenNoNewIndexes - flag specific for isViewNotFilled\n // If view is not filled, we want to call this but restting isFetch to false\n // goes to this methid when callback is note fired.\n const getPagination = useCallback(\n (isRefresh = false, resetIsFetchingWhenNoNewIndexes = false) => {\n if (resetIsFetchingWhenNoNewIndexes) {\n setIsFetching(false);\n setLoadingIndicatorInfo({});\n }\n const pInfo = getPaginationInfo(\n getPContainer(),\n getRecordCountForLayoutPaint(totalRecordCount),\n vi,\n isRefresh\n );\n const { startIndex, endIndex } = pInfo.view;\n // if new indexes are subset of existing state indexes, no need to update the consumer.\n if (!state || !(startIndex >= state.startIndex && endIndex <= state.endIndex)) {\n vi.pInfo = pInfo;\n setIsFetching(true);\n if (state) {\n const { startIndex: oldStartIndex, endIndex: oldEndIndex } = state;\n if (startIndex < oldStartIndex) {\n setLoadingIndicatorInfo(info => {\n return { ...info, isScrollingUp: true };\n });\n }\n if (endIndex > oldEndIndex) {\n setLoadingIndicatorInfo(info => {\n return { ...info, isScrollingDown: true };\n });\n }\n }\n callback({ ...vi.pInfo.view, id }, { takeLatestAction: true });\n }\n },\n [vi, totalRecordCount, state, callback, id, getPContainer]\n );\n\n // update average stats for next calculation.\n const updateAverageInVirtualizeInstance = useCallback(\n currentEstimation => {\n const { itemCount, rowContainerHeight, averageNumberOfItemsInARow, averageRowHeight } =\n currentEstimation;\n Object.assign(vi, {\n itemCount: (itemCount + vi.itemCount || itemCount) / 2,\n rowContainerHeight:\n (rowContainerHeight + vi.rowContainerHeight || rowContainerHeight) / 2,\n averageNumberOfItemsInARow:\n (averageNumberOfItemsInARow + vi.averageNumberOfItemsInARow ||\n averageNumberOfItemsInARow) / 2,\n averageRowHeight: (averageRowHeight + vi.averageRowHeight || averageRowHeight) / 2\n });\n },\n [vi]\n );\n\n const getBufferHeight = useCallback(\n currentEstimation => {\n const { itemCount, rowContainerHeight } = currentEstimation;\n let h = 0;\n if (itemCount > 0)\n h = (getRecordCountForLayoutPaint(totalRecordCount) / itemCount) * rowContainerHeight;\n return h;\n },\n [totalRecordCount]\n );\n\n const getScrollTop = useCallback(\n currentEstimation => {\n const { itemCount, rowContainerHeight } = currentEstimation;\n let scrollTop = 0;\n if (itemCount > 0) {\n const scrollNodeTopChange =\n // eslint-disable-next-line no-unsafe-optional-chaining\n vi.pInfo?.bufferNewCords?.top - vi.pInfo?.bufferOldCords?.top || 0;\n scrollTop = (vi.pInfo.topRowIndex / itemCount) * rowContainerHeight - scrollNodeTopChange;\n }\n return scrollTop;\n },\n [vi]\n );\n\n const onRowContainerDimensionChange = useCallback(() => {\n const { height: rowContainerHeight, width: rowContainerWidth } =\n getRowContainer()?.getBoundingClientRect() ?? {};\n // trigger virtualizer operations only when row container has some height and width\n if (!isFetching && rowContainerHeight && rowContainerWidth) setRContainerDimensionUpdate({});\n }, [isFetching]);\n\n // observe on row container to adjust the buffer container height.\n useResizeObserver(getRowContainer, onRowContainerDimensionChange);\n\n const [updateScrollTop] = useScroll(\n getPagination,\n getPContainer,\n vi,\n totalRecordCount,\n renderHeader,\n isFetching,\n viewHeight\n );\n\n useLayoutEffect(() => {\n const rContainer = getRowContainer();\n if (state && state.startIndex >= 0 && vi && rContainer) {\n setAttributesOnItems(state, rContainer);\n }\n });\n\n // Get estimate and update buffer height\n useLayoutEffect(() => {\n if (state && !isEmpty(totalRecordCount)) {\n vi.currentEstimation = getCurrentEstimation(getRowContainer());\n updateAverageInVirtualizeInstance(vi.currentEstimation);\n const h = Math.floor(getBufferHeight(vi.currentEstimation));\n const previousHeight = getBContainer().offsetHeight;\n\n getBContainer().style.height = `${h}px`;\n vi.bContainerHeight = h;\n\n // if there was no previous height, then keep the scrolltop to 0 by default\n if (h !== previousHeight && previousHeight) {\n const pContainer = getPContainer();\n const scrollTop = getScrollTop(vi.currentEstimation);\n pContainer.scrollTop = scrollTop;\n }\n }\n }, [\n rContainerDimensionUpdate,\n getBContainer,\n getBufferHeight,\n getRowContainer,\n state,\n totalRecordCount,\n updateAverageInVirtualizeInstance,\n vi,\n getPContainer,\n getScrollTop\n ]);\n\n // update parent scroll top and row container top.\n useLayoutEffect(() => {\n if (state && !isEmpty(totalRecordCount)) {\n const pContainer = getPContainer();\n\n // Setting scrollTop from pContainer.scrollTop as getScrollTop can return value with higher decimal accuracy.\n // but scrollTop attribute from HTML element will round it automatically.\n updateScrollTop(pContainer.scrollTop);\n updateRowContainerTop(\n vi,\n getRecordCountForLayoutPaint(totalRecordCount),\n state,\n pContainer,\n pContainer.scrollTop\n );\n\n const topLoaderHeight = 80;\n let top = getRowContainer().style.top;\n if (!top) {\n top = 0;\n }\n getBContainer().style.setProperty(\n '--above-loader-top',\n `${parseInt(top, 10) - topLoaderHeight}px`\n );\n\n getBContainer().style.setProperty(\n '--below-loader-top',\n `${parseInt(top, 10) + getRowContainer().offsetHeight}px`\n );\n }\n }, [\n getPContainer,\n getScrollTop,\n state,\n updateScrollTop,\n vi,\n rContainerDimensionUpdate,\n totalRecordCount,\n getRowContainer,\n getBContainer\n ]);\n\n // setting pContainer's width whenever pContainer dimension updates,\n // because bContainer has 0 width and row-container's width doesn't changes in sync with pContainer\n const onPContainerDimensionUpdate = useCallback(() => {\n getPContainer()?.style.setProperty(\n '--container-width',\n `${getPContainerClientWidth(getPContainer())}px`\n );\n }, [getPContainer]);\n\n // observe on pContainer to adjust the width of row container.\n useResizeObserver(getPContainer, onPContainerDimensionUpdate);\n\n // On mount that means state is not initialized yet, trigger pagination.\n // or whenever count changes or width /height of view port changes, if view is not filled with data, get indexes again.\n useEffect(() => {\n if (state && isPaginationRequestCompleted(vi, state) && !isEmpty(totalRecordCount)) {\n if (\n isViewNotFilled(\n getRecordCountForLayoutPaint(totalRecordCount),\n vi,\n getPContainer(),\n renderHeader\n )\n )\n getPagination(false, true);\n else {\n setIsFetching(false);\n setLoadingIndicatorInfo({});\n }\n } else if (!state || !Object.keys(vi.pInfo).length) getPagination(true);\n }, [\n rContainerDimensionUpdate,\n state,\n vi,\n totalRecordCount,\n viewHeight,\n viewWidth,\n renderHeader,\n getPagination,\n getPContainer\n ]);\n\n useEffect(() => {\n if (!isFetching) return;\n getBContainer().style.setProperty('--loader-left', `${getPContainer().scrollLeft}px`);\n }, [isFetching, getPContainer()?.scrollLeft]);\n\n return (\n <StyledPContainer\n $style={{\n maxHeight,\n minHeight,\n renderFooter,\n itemHeight,\n height,\n width\n }}\n data-total-records={totalRecordCount}\n className='pContainer'\n ref={c => {\n vi.pContainer = c;\n }}\n >\n {renderHeader && renderHeader()}\n <div\n className='bContainer'\n ref={c => {\n vi.bContainer = c;\n }}\n >\n {showLoadingIndicator && isFetching && loadingIndicatorInfo.isScrollingUp && (\n <StyledLoader\n $style={{\n top: '--above-loader-top',\n left: '--loader-left'\n }}\n >\n <Progress\n className='above-loader'\n placement='block'\n tabIndex={0}\n aria-label={translate('Loading more results')}\n />\n </StyledLoader>\n )}\n <div\n className={`${rowContainerClass} row-container`}\n ref={c => {\n vi.rContainer = c;\n }}\n style={{ width: 'var(--container-width)' }}\n role='rowgroup'\n >\n {/** Do not add any other element in row-container apart from the rows as it will generate incorrect estimations */}\n {children}\n </div>\n {showLoadingIndicator && isFetching && loadingIndicatorInfo.isScrollingDown && (\n <StyledLoader\n $style={{\n top: '--below-loader-top',\n left: '--loader-left'\n }}\n >\n <Progress\n className='below-loader'\n placement='block'\n tabIndex={0}\n aria-label={translate('Loading more results')}\n />\n </StyledLoader>\n )}\n </div>\n {totalRecordCount === 0 ? <EmptyContainer /> : null}\n {renderFooter && renderFooter()}\n </StyledPContainer>\n );\n }\n);\n\nVirtualize.propTypes = {\n id: PropTypes.string.isRequired,\n viewHeight: PropTypes.number,\n viewWidth: PropTypes.number,\n totalRecordCount: PropTypes.number,\n itemHeight: PropTypes.number,\n callback: PropTypes.func,\n rowContainerClass: PropTypes.string,\n children: PropTypes.oneOfType([PropTypes.object, PropTypes.array]).isRequired,\n renderHeader: PropTypes.func,\n renderFooter: PropTypes.func,\n state: PropTypes.shape({\n startIndex: PropTypes.number,\n endIndex: PropTypes.number\n }),\n bufferMultiplier: PropTypes.number,\n basicMode: PropTypes.bool.isRequired,\n numberOfRows: PropTypes.number,\n viewMaxHeight: PropTypes.string,\n showLoadingIndicator: PropTypes.bool\n};\n\nVirtualize.defaultProps = {\n bufferMultiplier: 1,\n callback: () => {},\n rowContainerClass: '',\n viewHeight: 400,\n viewWidth: 0,\n itemHeight: 40,\n renderHeader: null,\n renderFooter: null,\n state: undefined,\n totalRecordCount: undefined,\n numberOfRows: undefined,\n viewMaxHeight: undefined,\n showLoadingIndicator: false\n};\n\nVirtualize.displayName = 'Virtualize';\n\nexport default memo(Virtualize);\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../Core/Components/Virtualise/index.jsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EACV,IAAI,EACJ,SAAS,EACT,MAAM,EACN,WAAW,EACX,mBAAmB,EACnB,OAAO,EACP,eAAe,EACf,QAAQ,EACT,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAEzD,OAAO,cAAc,MAAM,qCAAqC,CAAC;AACjE,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAEnE,OAAO,iBAAiB,MAAM,cAAc,CAAC;AAC7C,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,EACL,oBAAoB,EACpB,4BAA4B,EAC5B,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,4BAA4B,EAC5B,wBAAwB,EACxB,gBAAgB,EAChB,YAAY,EACb,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,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU;IAC7E,YAAY,EAAE,SAAS,CAAC,IAAI;IAC5B,YAAY,EAAE,SAAS,CAAC,IAAI;IAC5B,KAAK,EAAE,SAAS,CAAC,KAAK,CAAC;QACrB,UAAU,EAAE,SAAS,CAAC,MAAM;QAC5B,QAAQ,EAAE,SAAS,CAAC,MAAM;KAC3B,CAAC;IACF,gBAAgB,EAAE,SAAS,CAAC,MAAM;IAClC,SAAS,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACpC,YAAY,EAAE,SAAS,CAAC,MAAM;IAC9B,aAAa,EAAE,SAAS,CAAC,MAAM;IAC/B,oBAAoB,EAAE,SAAS,CAAC,IAAI;CACrC,CAAC;AAEF,UAAU,CAAC,YAAY,GAAG;IACxB,gBAAgB,EAAE,CAAC;IACnB,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC;IAClB,iBAAiB,EAAE,EAAE;IACrB,UAAU,EAAE,GAAG;IACf,SAAS,EAAE,CAAC;IACZ,UAAU,EAAE,EAAE;IACd,YAAY,EAAE,IAAI;IAClB,YAAY,EAAE,IAAI;IAClB,KAAK,EAAE,SAAS;IAChB,gBAAgB,EAAE,SAAS;IAC3B,YAAY,EAAE,SAAS;IACvB,aAAa,EAAE,SAAS;IACxB,oBAAoB,EAAE,KAAK;CAC5B,CAAC;AAEF,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC;AAEtC,eAAe,IAAI,CAAC,UAAU,CAAC,CAAC","sourcesContent":["import {\n forwardRef,\n memo,\n useEffect,\n useRef,\n useCallback,\n useImperativeHandle,\n useMemo,\n useLayoutEffect,\n useState\n} from 'react';\nimport Styled from 'styled-components';\nimport PropTypes from 'prop-types';\n\nimport { defaultThemeProp, Progress } from '@pega/cosmos-react-core';\nimport { isEmpty } from 'pega-repeating-structures-core';\n\nimport EmptyContainer from '../DefaultComponents/EmptyContainer';\nimport useTranslate from '../../Hooks/useTranslate';\nimport { StyledSkeletonRow } from '../../Views/Table/SkeletonRows';\n\nimport getPaginationInfo from './Pagination';\nimport useScroll from './UseScroll';\nimport {\n getCurrentEstimation,\n isPaginationRequestCompleted,\n updateRowContainerTop,\n setAttributesOnItems,\n isViewNotFilled,\n getRecordCountForLayoutPaint,\n getPContainerClientWidth,\n getValueWithUnit,\n getMaxHeight\n} from './utility';\nimport useResizeObserver from './UseResizeObserver';\n\nfunction getBContainerMinHeight(props) {\n return props.$style.renderFooter ? `calc(100% - ${2 * props.$style.itemHeight + 1}px) ` : '0';\n}\n\nconst StyledPContainer = Styled.div`\n position: relative;\n overflow: auto;\n max-height: ${props => props.$style.maxHeight};\n width: ${props => props.$style.width};\n height: ${props => props.$style.height};\n min-height: ${props => props.$style.minHeight};\n border-radius: ${props => props.theme.base['border-radius']};\n\n &:has(${StyledSkeletonRow}) {\n overflow: hidden;\n }\n\n /**\n * When height and maxHeight is auto, virtualization is not going to happen and the scroll jump on row deletion scenario is not going to happen.\n * In such cases, using relative position as sticky was used to fix scroll jump in firefox during virtualization.\n */\n .bContainer {\n position: ${props =>\n props.$style.maxHeight?.startsWith('auto') && props.$style.height?.startsWith('auto')\n ? 'relative'\n : 'sticky'};\n width: 0;\n min-height: ${props => getBContainerMinHeight(props)};\n border-radius: inherit;\n }\n`;\n\nStyledPContainer.defaultProps = defaultThemeProp;\n\nconst StyledLoader = Styled.div`\n display: flex;\n justify-content: center;\n padding: 0.5rem;\n position: absolute;\n width: var(--container-width);\n left: ${props => `var(${props.$style.left})`};\n top: ${props => `var(${props.$style.top})`};\n`;\n\nconst Virtualize = forwardRef(\n (\n {\n id,\n viewHeight,\n viewWidth,\n totalRecordCount,\n itemHeight,\n callback,\n rowContainerClass,\n children,\n renderHeader,\n renderFooter,\n state,\n bufferMultiplier,\n basicMode,\n numberOfRows,\n viewMaxHeight,\n showLoadingIndicator\n },\n inputRef\n ) => {\n const [rContainerDimensionUpdate, setRContainerDimensionUpdate] = useState();\n const [isFetching, setIsFetching] = useState(false);\n const [loadingIndicatorInfo, setLoadingIndicatorInfo] = useState({});\n const [translate] = useTranslate();\n // Create ref to store virtualize related data.\n const vi = useRef({\n itemHeight,\n bufferMultiplier,\n pInfo: {}\n }).current;\n\n const getRowContainer = useCallback(() => vi.rContainer, [vi.rContainer]);\n const getPContainer = useCallback(() => vi.pContainer, [vi.pContainer]);\n const getBContainer = useCallback(() => vi.bContainer, [vi.bContainer]);\n\n // API used when user want to scroll to top programmatically.\n // Though component auto scroll to top if no element is in view.\n // But calling this API upfront might save one extra call to Fetch API.\n const scrollToTop = useCallback(\n cb => {\n if (!state) return;\n getPContainer().scrollTop = 0;\n vi.pInfo = getPaginationInfo(\n getPContainer(),\n getRecordCountForLayoutPaint(totalRecordCount),\n vi,\n false,\n true\n );\n setIsFetching(true);\n cb({ ...vi.pInfo.view, id }, { takeLatestAction: true });\n },\n [id, vi, state, getPContainer]\n );\n\n // expose APIs and properties here to help client to communicate.\n useImperativeHandle(inputRef, () => ({\n getParentContainer: getPContainer,\n scrollToTop,\n vi,\n id\n }));\n\n const { width, height } = useMemo(\n () => ({\n width: getValueWithUnit(viewWidth, basicMode, numberOfRows),\n height: getValueWithUnit(viewHeight, basicMode, numberOfRows)\n }),\n [viewWidth, viewHeight, basicMode, numberOfRows]\n );\n\n const maxHeight = useMemo(\n () => getMaxHeight(viewMaxHeight, basicMode),\n [basicMode, viewMaxHeight]\n );\n\n const minHeight = useMemo(() => {\n if (basicMode && totalRecordCount === 0) {\n return '100px';\n }\n return 'auto';\n }, [basicMode, totalRecordCount]);\n\n // Calculate the pagination indexes and notify callback.\n // resetIsFetchingWhenNoNewIndexes - flag specific for isViewNotFilled\n // If view is not filled, we want to call this but restting isFetch to false\n // goes to this methid when callback is note fired.\n const getPagination = useCallback(\n (isRefresh = false, resetIsFetchingWhenNoNewIndexes = false) => {\n if (resetIsFetchingWhenNoNewIndexes) {\n setIsFetching(false);\n setLoadingIndicatorInfo({});\n }\n const pInfo = getPaginationInfo(\n getPContainer(),\n getRecordCountForLayoutPaint(totalRecordCount),\n vi,\n isRefresh\n );\n const { startIndex, endIndex } = pInfo.view;\n // if new indexes are subset of existing state indexes, no need to update the consumer.\n if (!state || !(startIndex >= state.startIndex && endIndex <= state.endIndex)) {\n vi.pInfo = pInfo;\n setIsFetching(true);\n if (state) {\n const { startIndex: oldStartIndex, endIndex: oldEndIndex } = state;\n if (startIndex < oldStartIndex) {\n setLoadingIndicatorInfo(info => {\n return { ...info, isScrollingUp: true };\n });\n }\n if (endIndex > oldEndIndex) {\n setLoadingIndicatorInfo(info => {\n return { ...info, isScrollingDown: true };\n });\n }\n }\n callback({ ...vi.pInfo.view, id }, { takeLatestAction: true });\n }\n },\n [vi, totalRecordCount, state, callback, id, getPContainer]\n );\n\n // update average stats for next calculation.\n const updateAverageInVirtualizeInstance = useCallback(\n currentEstimation => {\n const { itemCount, rowContainerHeight, averageNumberOfItemsInARow, averageRowHeight } =\n currentEstimation;\n Object.assign(vi, {\n itemCount: (itemCount + vi.itemCount || itemCount) / 2,\n rowContainerHeight:\n (rowContainerHeight + vi.rowContainerHeight || rowContainerHeight) / 2,\n averageNumberOfItemsInARow:\n (averageNumberOfItemsInARow + vi.averageNumberOfItemsInARow ||\n averageNumberOfItemsInARow) / 2,\n averageRowHeight: (averageRowHeight + vi.averageRowHeight || averageRowHeight) / 2\n });\n },\n [vi]\n );\n\n const getBufferHeight = useCallback(\n currentEstimation => {\n const { itemCount, rowContainerHeight } = currentEstimation;\n let h = 0;\n if (itemCount > 0)\n h = (getRecordCountForLayoutPaint(totalRecordCount) / itemCount) * rowContainerHeight;\n return h;\n },\n [totalRecordCount]\n );\n\n const getScrollTop = useCallback(\n currentEstimation => {\n const { itemCount, rowContainerHeight } = currentEstimation;\n let scrollTop = 0;\n if (itemCount > 0) {\n const scrollNodeTopChange =\n // eslint-disable-next-line no-unsafe-optional-chaining\n vi.pInfo?.bufferNewCords?.top - vi.pInfo?.bufferOldCords?.top || 0;\n scrollTop = (vi.pInfo.topRowIndex / itemCount) * rowContainerHeight - scrollNodeTopChange;\n }\n return scrollTop;\n },\n [vi]\n );\n\n const onRowContainerDimensionChange = useCallback(() => {\n const { height: rowContainerHeight, width: rowContainerWidth } =\n getRowContainer()?.getBoundingClientRect() ?? {};\n // trigger virtualizer operations only when row container has some height and width\n if (!isFetching && rowContainerHeight && rowContainerWidth) setRContainerDimensionUpdate({});\n }, [isFetching]);\n\n // observe on row container to adjust the buffer container height.\n useResizeObserver(getRowContainer, onRowContainerDimensionChange);\n\n const [updateScrollTop] = useScroll(\n getPagination,\n getPContainer,\n vi,\n totalRecordCount,\n renderHeader,\n isFetching,\n viewHeight\n );\n\n useLayoutEffect(() => {\n const rContainer = getRowContainer();\n if (state && state.startIndex >= 0 && vi && rContainer) {\n setAttributesOnItems(state, rContainer);\n }\n });\n\n // Get estimate and update buffer height\n useLayoutEffect(() => {\n if (state && !isEmpty(totalRecordCount)) {\n vi.currentEstimation = getCurrentEstimation(getRowContainer());\n updateAverageInVirtualizeInstance(vi.currentEstimation);\n const h = Math.floor(getBufferHeight(vi.currentEstimation));\n const previousHeight = getBContainer().offsetHeight;\n\n getBContainer().style.height = `${h}px`;\n vi.bContainerHeight = h;\n\n // if there was no previous height, then keep the scrolltop to 0 by default\n if (h !== previousHeight && previousHeight) {\n const pContainer = getPContainer();\n const scrollTop = getScrollTop(vi.currentEstimation);\n pContainer.scrollTop = scrollTop;\n }\n }\n }, [\n rContainerDimensionUpdate,\n getBContainer,\n getBufferHeight,\n getRowContainer,\n state,\n totalRecordCount,\n updateAverageInVirtualizeInstance,\n vi,\n getPContainer,\n getScrollTop\n ]);\n\n // update parent scroll top and row container top.\n useLayoutEffect(() => {\n if (state && !isEmpty(totalRecordCount)) {\n const pContainer = getPContainer();\n\n // Setting scrollTop from pContainer.scrollTop as getScrollTop can return value with higher decimal accuracy.\n // but scrollTop attribute from HTML element will round it automatically.\n updateScrollTop(pContainer.scrollTop);\n updateRowContainerTop(\n vi,\n getRecordCountForLayoutPaint(totalRecordCount),\n state,\n pContainer,\n pContainer.scrollTop\n );\n\n const topLoaderHeight = 80;\n let top = getRowContainer().style.top;\n if (!top) {\n top = 0;\n }\n getBContainer().style.setProperty(\n '--above-loader-top',\n `${parseInt(top, 10) - topLoaderHeight}px`\n );\n\n getBContainer().style.setProperty(\n '--below-loader-top',\n `${parseInt(top, 10) + getRowContainer().offsetHeight}px`\n );\n }\n }, [\n getPContainer,\n getScrollTop,\n state,\n updateScrollTop,\n vi,\n rContainerDimensionUpdate,\n totalRecordCount,\n getRowContainer,\n getBContainer\n ]);\n\n // setting pContainer's width whenever pContainer dimension updates,\n // because bContainer has 0 width and row-container's width doesn't changes in sync with pContainer\n const onPContainerDimensionUpdate = useCallback(() => {\n getPContainer()?.style.setProperty(\n '--container-width',\n `${getPContainerClientWidth(getPContainer())}px`\n );\n }, [getPContainer]);\n\n // observe on pContainer to adjust the width of row container.\n useResizeObserver(getPContainer, onPContainerDimensionUpdate);\n\n // On mount that means state is not initialized yet, trigger pagination.\n // or whenever count changes or width /height of view port changes, if view is not filled with data, get indexes again.\n useEffect(() => {\n if (state && isPaginationRequestCompleted(vi, state) && !isEmpty(totalRecordCount)) {\n if (\n isViewNotFilled(\n getRecordCountForLayoutPaint(totalRecordCount),\n vi,\n getPContainer(),\n renderHeader\n )\n )\n getPagination(false, true);\n else {\n setIsFetching(false);\n setLoadingIndicatorInfo({});\n }\n } else if (!state || !Object.keys(vi.pInfo).length) getPagination(true);\n }, [\n rContainerDimensionUpdate,\n state,\n vi,\n totalRecordCount,\n viewHeight,\n viewWidth,\n renderHeader,\n getPagination,\n getPContainer\n ]);\n\n useEffect(() => {\n if (!isFetching) return;\n getBContainer().style.setProperty('--loader-left', `${getPContainer().scrollLeft}px`);\n }, [isFetching, getPContainer()?.scrollLeft]);\n\n return (\n <StyledPContainer\n $style={{\n maxHeight,\n minHeight,\n renderFooter,\n itemHeight,\n height,\n width\n }}\n data-total-records={totalRecordCount}\n className='pContainer'\n ref={c => {\n vi.pContainer = c;\n }}\n >\n {renderHeader && renderHeader()}\n <div\n className='bContainer'\n ref={c => {\n vi.bContainer = c;\n }}\n >\n {showLoadingIndicator && isFetching && loadingIndicatorInfo.isScrollingUp && (\n <StyledLoader\n $style={{\n top: '--above-loader-top',\n left: '--loader-left'\n }}\n >\n <Progress\n className='above-loader'\n placement='block'\n tabIndex={0}\n aria-label={translate('Loading more results')}\n />\n </StyledLoader>\n )}\n <div\n className={`${rowContainerClass} row-container`}\n ref={c => {\n vi.rContainer = c;\n }}\n style={{ width: 'var(--container-width)' }}\n role='rowgroup'\n >\n {/** Do not add any other element in row-container apart from the rows as it will generate incorrect estimations */}\n {children}\n </div>\n {showLoadingIndicator && isFetching && loadingIndicatorInfo.isScrollingDown && (\n <StyledLoader\n $style={{\n top: '--below-loader-top',\n left: '--loader-left'\n }}\n >\n <Progress\n className='below-loader'\n placement='block'\n tabIndex={0}\n aria-label={translate('Loading more results')}\n />\n </StyledLoader>\n )}\n </div>\n {totalRecordCount === 0 ? <EmptyContainer /> : null}\n {renderFooter && renderFooter()}\n </StyledPContainer>\n );\n }\n);\n\nVirtualize.propTypes = {\n id: PropTypes.string.isRequired,\n viewHeight: PropTypes.number,\n viewWidth: PropTypes.number,\n totalRecordCount: PropTypes.number,\n itemHeight: PropTypes.number,\n callback: PropTypes.func,\n rowContainerClass: PropTypes.string,\n children: PropTypes.oneOfType([PropTypes.object, PropTypes.array]).isRequired,\n renderHeader: PropTypes.func,\n renderFooter: PropTypes.func,\n state: PropTypes.shape({\n startIndex: PropTypes.number,\n endIndex: PropTypes.number\n }),\n bufferMultiplier: PropTypes.number,\n basicMode: PropTypes.bool.isRequired,\n numberOfRows: PropTypes.number,\n viewMaxHeight: PropTypes.string,\n showLoadingIndicator: PropTypes.bool\n};\n\nVirtualize.defaultProps = {\n bufferMultiplier: 2,\n callback: () => {},\n rowContainerClass: '',\n viewHeight: 400,\n viewWidth: 0,\n itemHeight: 40,\n renderHeader: null,\n renderFooter: null,\n state: undefined,\n totalRecordCount: undefined,\n numberOfRows: undefined,\n viewMaxHeight: undefined,\n showLoadingIndicator: false\n};\n\nVirtualize.displayName = 'Virtualize';\n\nexport default memo(Virtualize);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Body.d.ts","sourceRoot":"","sources":["../../../../Core/Views/Table/Body.jsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Body.d.ts","sourceRoot":"","sources":["../../../../Core/Views/Table/Body.jsx"],"names":[],"mappings":";AAYA;;;;4CAyDC;;;;;;;;;;;;;;;;sBArEqB,YAAY"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { Fragment, useRef, useEffect } from 'react';
|
|
4
|
+
import { nlpColors } from '@pega/cosmos-react-core';
|
|
4
5
|
import GroupHeader from '../../Components/GroupRenderer';
|
|
5
6
|
import { HierarchicalGroupHeader, resetCounter } from '../../Components/HierarchicalGroupRenderer';
|
|
6
7
|
import HierarchicalGroupFooters from '../../Components/HierarchicalGroupFooters';
|
|
@@ -17,6 +18,7 @@ function Body({ groupHeaders, columns, hierarchicalGroupEnabled }) {
|
|
|
17
18
|
resetCounter();
|
|
18
19
|
}
|
|
19
20
|
});
|
|
21
|
+
let numParentGroups = -1;
|
|
20
22
|
return (_jsx(_Fragment, { children: groupHeaders &&
|
|
21
23
|
groupHeaders.map((header, idx) => {
|
|
22
24
|
let dataMap = null;
|
|
@@ -27,6 +29,10 @@ function Body({ groupHeaders, columns, hierarchicalGroupEnabled }) {
|
|
|
27
29
|
rows &&
|
|
28
30
|
rows.map(row => (_jsx(Row, { row: row, columns: columns, level: header.level + 1 }, row.reactKey)));
|
|
29
31
|
}
|
|
32
|
+
if (header.level === 0) {
|
|
33
|
+
numParentGroups += 1;
|
|
34
|
+
}
|
|
35
|
+
header.colorIndicator = nlpColors[numParentGroups % nlpColors.length];
|
|
30
36
|
return (_jsxs(Fragment, { children: [header.isHierarchical ? (_jsx(HierarchicalGroupHeader, { groupHeader: header, columns: columns })) : (_jsx(GroupHeader, { groupHeader: header, columns: columns })), dataMap, header.isHierarchical ? (_jsx(HierarchicalGroupFooters, { groupHeaders: groupHeaders, columns: columns, headerIndex: idx, hierarchicalGroupInfoRef: hierarchicalInfo })) : null] }, groupHeaderKey));
|
|
31
37
|
}) }));
|
|
32
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Body.js","sourceRoot":"","sources":["../../../../Core/Views/Table/Body.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,WAAW,MAAM,gCAAgC,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AACnG,OAAO,wBAAwB,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,GAAG,MAAM,OAAO,CAAC;AAExB,SAAS,IAAI,CAAC,EAAE,YAAY,EAAE,OAAO,EAAE,wBAAwB,EAAE;IAC/D,MAAM,gBAAgB,GAAG,MAAM,CAAC;QAC9B,SAAS,EAAE,CAAC;QACZ,kBAAkB,EAAE,EAAE;KACvB,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACb,8EAA8E;QAC9E,IAAI,wBAAwB,EAAE,CAAC;YAC7B,YAAY,EAAE,CAAC;QACjB,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,CACL,4BACG,YAAY;YACX,YAAY,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE;gBAC/B,IAAI,OAAO,GAAG,IAAI,CAAC;gBACnB,MAAM,cAAc,GAAG,OAAO,CAAC,GAAG,MAAM,C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IACX,wBAAwB,EAAE,KAAK;CAChC,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import PropTypes from 'prop-types';\nimport { Fragment, useRef, useEffect } from 'react';\n\nimport GroupHeader from '../../Components/GroupRenderer';\nimport { HierarchicalGroupHeader, resetCounter } from '../../Components/HierarchicalGroupRenderer';\nimport HierarchicalGroupFooters from '../../Components/HierarchicalGroupFooters';\nimport { keyFrom } from '../../Utils';\n\nimport Row from './Row';\n\nfunction Body({ groupHeaders, columns, hierarchicalGroupEnabled }) {\n const hierarchicalInfo = useRef({\n prevLevel: 0,\n parentGroupFooters: {}\n });\n\n useEffect(() => {\n // Reset counter which was used to calculate hierarchical group header z-index\n if (hierarchicalGroupEnabled) {\n resetCounter();\n }\n });\n\n return (\n <>\n {groupHeaders &&\n groupHeaders.map((header, idx) => {\n let dataMap = null;\n const groupHeaderKey = keyFrom(...header.hierarchy);\n\n if (header.isLeafNode && header.isExpanded) {\n const rows = header.getRows();\n dataMap =\n rows &&\n rows.map(row => (\n <Row key={row.reactKey} row={row} columns={columns} level={header.level + 1} />\n ));\n }\n\n return (\n <Fragment key={groupHeaderKey}>\n {header.isHierarchical ? (\n <HierarchicalGroupHeader groupHeader={header} columns={columns} />\n ) : (\n <GroupHeader groupHeader={header} columns={columns} />\n )}\n {dataMap}\n {header.isHierarchical ? (\n <HierarchicalGroupFooters\n groupHeaders={groupHeaders}\n columns={columns}\n headerIndex={idx}\n hierarchicalGroupInfoRef={hierarchicalInfo}\n />\n ) : null}\n </Fragment>\n );\n })}\n </>\n );\n}\n\nBody.propTypes = {\n groupHeaders: PropTypes.arrayOf(PropTypes.any),\n columns: PropTypes.arrayOf(PropTypes.any),\n hierarchicalGroupEnabled: PropTypes.bool\n};\n\nBody.defaultProps = {\n groupHeaders: [],\n columns: [],\n hierarchicalGroupEnabled: false\n};\n\nexport default Body;\n"]}
|
|
1
|
+
{"version":3,"file":"Body.js","sourceRoot":"","sources":["../../../../Core/Views/Table/Body.jsx"],"names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ef, useEffect } from 'react';\n\nimport { nlpColors } from '@pega/cosmos-react-core';\n\nimport GroupHeader from '../../Components/GroupRenderer';\nimport { HierarchicalGroupHeader, resetCounter } from '../../Components/HierarchicalGroupRenderer';\nimport HierarchicalGroupFooters from '../../Components/HierarchicalGroupFooters';\nimport { keyFrom } from '../../Utils';\n\nimport Row from './Row';\n\nfunction Body({ groupHeaders, columns, hierarchicalGroupEnabled }) {\n const hierarchicalInfo = useRef({\n prevLevel: 0,\n parentGroupFooters: {}\n });\n\n useEffect(() => {\n // Reset counter which was used to calculate hierarchical group header z-index\n if (hierarchicalGroupEnabled) {\n resetCounter();\n }\n });\n\n let numParentGroups = -1;\n\n return (\n <>\n {groupHeaders &&\n groupHeaders.map((header, idx) => {\n let dataMap = null;\n const groupHeaderKey = keyFrom(...header.hierarchy);\n\n if (header.isLeafNode && header.isExpanded) {\n const rows = header.getRows();\n dataMap =\n rows &&\n rows.map(row => (\n <Row key={row.reactKey} row={row} columns={columns} level={header.level + 1} />\n ));\n }\n\n if (header.level === 0) {\n numParentGroups += 1;\n }\n header.colorIndicator = nlpColors[numParentGroups % nlpColors.length];\n\n return (\n <Fragment key={groupHeaderKey}>\n {header.isHierarchical ? (\n <HierarchicalGroupHeader groupHeader={header} columns={columns} />\n ) : (\n <GroupHeader groupHeader={header} columns={columns} />\n )}\n {dataMap}\n {header.isHierarchical ? (\n <HierarchicalGroupFooters\n groupHeaders={groupHeaders}\n columns={columns}\n headerIndex={idx}\n hierarchicalGroupInfoRef={hierarchicalInfo}\n />\n ) : null}\n </Fragment>\n );\n })}\n </>\n );\n}\n\nBody.propTypes = {\n groupHeaders: PropTypes.arrayOf(PropTypes.any),\n columns: PropTypes.arrayOf(PropTypes.any),\n hierarchicalGroupEnabled: PropTypes.bool\n};\n\nBody.defaultProps = {\n groupHeaders: [],\n columns: [],\n hierarchicalGroupEnabled: false\n};\n\nexport default Body;\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const StyledSkeletonRow: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
2
|
+
declare const SkeletonRows: () => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default SkeletonRows;
|
|
4
|
+
//# sourceMappingURL=SkeletonRows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SkeletonRows.d.ts","sourceRoot":"","sources":["../../../../Core/Views/Table/SkeletonRows.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,iBAAiB,yGAsD5B,CAAC;AAIH,QAAA,MAAM,YAAY,+CAQjB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
import { getLuminance, mix, transparentize } from 'polished';
|
|
4
|
+
import { defaultThemeProp } from '@pega/cosmos-react-core';
|
|
5
|
+
export const StyledSkeletonRow = styled.div(({ theme }) => {
|
|
6
|
+
const oddRowBackgroundColor = getLuminance(theme.components.table.body['secondary-background-color']) > 0.5
|
|
7
|
+
? theme.components.table.body['secondary-background-color']
|
|
8
|
+
: mix(0.75, theme.components.table.body['background-color'], theme.components.table.body['secondary-background-color']);
|
|
9
|
+
const lightenedOddRowBackgroundColor = transparentize(0.7, oddRowBackgroundColor);
|
|
10
|
+
return css `
|
|
11
|
+
width: 100%;
|
|
12
|
+
height: var(--data-row-height);
|
|
13
|
+
|
|
14
|
+
@keyframes gradient {
|
|
15
|
+
0% {
|
|
16
|
+
background-position: 100% 0%;
|
|
17
|
+
}
|
|
18
|
+
100% {
|
|
19
|
+
background-position: 0% 100%;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&[data-index$='1']:not(.group-header-row):not(.header),
|
|
24
|
+
&[data-index$='3']:not(.group-header-row):not(.header),
|
|
25
|
+
&[data-index$='5']:not(.group-header-row):not(.header),
|
|
26
|
+
&[data-index$='7']:not(.group-header-row):not(.header),
|
|
27
|
+
&[data-index$='9']:not(.group-header-row):not(.header) {
|
|
28
|
+
background: linear-gradient(
|
|
29
|
+
-45deg,
|
|
30
|
+
${oddRowBackgroundColor},
|
|
31
|
+
${oddRowBackgroundColor},
|
|
32
|
+
${lightenedOddRowBackgroundColor},
|
|
33
|
+
${oddRowBackgroundColor},
|
|
34
|
+
${oddRowBackgroundColor}
|
|
35
|
+
);
|
|
36
|
+
background-size: 500% 500%;
|
|
37
|
+
animation: gradient 4s ease infinite;
|
|
38
|
+
|
|
39
|
+
.cell-fixed {
|
|
40
|
+
background: linear-gradient(
|
|
41
|
+
-45deg,
|
|
42
|
+
${oddRowBackgroundColor},
|
|
43
|
+
${oddRowBackgroundColor},
|
|
44
|
+
${lightenedOddRowBackgroundColor},
|
|
45
|
+
${oddRowBackgroundColor},
|
|
46
|
+
${oddRowBackgroundColor}
|
|
47
|
+
);
|
|
48
|
+
background-size: 500% 500%;
|
|
49
|
+
animation: gradient 4s ease-in-out infinite;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
`;
|
|
53
|
+
});
|
|
54
|
+
StyledSkeletonRow.defaultProps = defaultThemeProp;
|
|
55
|
+
const SkeletonRows = () => {
|
|
56
|
+
return (_jsx(_Fragment, { children: Array.from({ length: 100 }, (_, index) => {
|
|
57
|
+
return _jsx(StyledSkeletonRow, {}, index);
|
|
58
|
+
}) }));
|
|
59
|
+
};
|
|
60
|
+
export default SkeletonRows;
|
|
61
|
+
//# sourceMappingURL=SkeletonRows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SkeletonRows.js","sourceRoot":"","sources":["../../../../Core/Views/Table/SkeletonRows.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,UAAU,CAA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ance, mix, transparentize } from 'polished';\n\nimport { defaultThemeProp } from '@pega/cosmos-react-core';\n\nexport const StyledSkeletonRow = styled.div(({ theme }) => {\n const oddRowBackgroundColor =\n getLuminance(theme.components.table.body['secondary-background-color']) > 0.5\n ? theme.components.table.body['secondary-background-color']\n : mix(\n 0.75,\n theme.components.table.body['background-color'],\n theme.components.table.body['secondary-background-color']\n );\n const lightenedOddRowBackgroundColor = transparentize(0.7, oddRowBackgroundColor);\n\n return css`\n width: 100%;\n height: var(--data-row-height);\n\n @keyframes gradient {\n 0% {\n background-position: 100% 0%;\n }\n 100% {\n background-position: 0% 100%;\n }\n }\n\n &[data-index$='1']:not(.group-header-row):not(.header),\n &[data-index$='3']:not(.group-header-row):not(.header),\n &[data-index$='5']:not(.group-header-row):not(.header),\n &[data-index$='7']:not(.group-header-row):not(.header),\n &[data-index$='9']:not(.group-header-row):not(.header) {\n background: linear-gradient(\n -45deg,\n ${oddRowBackgroundColor},\n ${oddRowBackgroundColor},\n ${lightenedOddRowBackgroundColor},\n ${oddRowBackgroundColor},\n ${oddRowBackgroundColor}\n );\n background-size: 500% 500%;\n animation: gradient 4s ease infinite;\n\n .cell-fixed {\n background: linear-gradient(\n -45deg,\n ${oddRowBackgroundColor},\n ${oddRowBackgroundColor},\n ${lightenedOddRowBackgroundColor},\n ${oddRowBackgroundColor},\n ${oddRowBackgroundColor}\n );\n background-size: 500% 500%;\n animation: gradient 4s ease-in-out infinite;\n }\n }\n `;\n});\n\nStyledSkeletonRow.defaultProps = defaultThemeProp;\n\nconst SkeletonRows = () => {\n return (\n <>\n {Array.from({ length: 100 }, (_, index) => {\n return <StyledSkeletonRow key={index} />;\n })}\n </>\n );\n};\n\nexport default SkeletonRows;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StyledTableContainer.d.ts","sourceRoot":"","sources":["../../../../Core/Views/Table/StyledTableContainer.jsx"],"names":[],"mappings":";AAUA,
|
|
1
|
+
{"version":3,"file":"StyledTableContainer.d.ts","sourceRoot":"","sources":["../../../../Core/Views/Table/StyledTableContainer.jsx"],"names":[],"mappings":";AAUA,oNAq7BG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import styled, { css } from 'styled-components';
|
|
4
|
-
import {
|
|
4
|
+
import { getLuminance, meetsContrastGuidelines, mix, readableColor } from 'polished';
|
|
5
5
|
import { StyledStatus } from '@pega/cosmos-react-core/lib/components/Badges/Status';
|
|
6
6
|
import { StyledRadioCheck } from '@pega/cosmos-react-core/lib/components/RadioCheck/RadioCheck';
|
|
7
7
|
import { StyledLabel, calculateFontSize, tryCatch } from '@pega/cosmos-react-core';
|
|
@@ -12,12 +12,20 @@ const StyledTableContainer = styled(forwardRef((props, ref) => _jsx("div", { ref
|
|
|
12
12
|
const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);
|
|
13
13
|
const selectedRowColor = tryCatch(() => mix(0.85, theme.base.palette['primary-background'], theme.base.palette.interactive));
|
|
14
14
|
const lightGreyColor = theme.base.colors.gray['extra-light'];
|
|
15
|
-
const oddRowBackgroundColor = getLuminance(theme.
|
|
16
|
-
?
|
|
17
|
-
:
|
|
15
|
+
const oddRowBackgroundColor = getLuminance(theme.components.table.body['secondary-background-color']) > 0.5
|
|
16
|
+
? theme.components.table.body['secondary-background-color']
|
|
17
|
+
: mix(0.75, theme.components.table.body['background-color'], theme.components.table.body['secondary-background-color']);
|
|
18
|
+
const headerForegroundContrast = meetsContrastGuidelines(theme.components.table.header['foreground-color'], theme.components.table.header['background-color']).AA;
|
|
19
|
+
const usableHeaderForeground = headerForegroundContrast
|
|
20
|
+
? theme.components.table.header['foreground-color']
|
|
21
|
+
: readableColor(theme.components.table.header['foreground-color'], theme.components.table.header['background-color']);
|
|
22
|
+
const oddRowContrast = meetsContrastGuidelines(theme.components.table.body['foreground-color'], oddRowBackgroundColor).AA;
|
|
23
|
+
const useableOddRowForeground = oddRowContrast
|
|
24
|
+
? theme.components.table.body['foreground-color']
|
|
25
|
+
: readableColor(theme.components.table.body['foreground-color'], oddRowBackgroundColor);
|
|
18
26
|
return css `
|
|
19
27
|
--primary-background: ${theme.base.palette['primary-background']};
|
|
20
|
-
--secondary-background: ${theme.
|
|
28
|
+
--secondary-background: ${theme.components.table.header['background-color']};
|
|
21
29
|
--forground-color: ${theme.base.palette['foreground-color']};
|
|
22
30
|
--interactive: ${theme.base.palette.interactive};
|
|
23
31
|
--medium-blue: ${theme.base.colors.blue.medium};
|
|
@@ -32,6 +40,7 @@ const StyledTableContainer = styled(forwardRef((props, ref) => _jsx("div", { ref
|
|
|
32
40
|
--header-cell-padding: 0 0.12rem 0 var(--cell-padding);
|
|
33
41
|
--header-cell-right-align-padding: 0 var(--cell-padding) 0 0.12rem;
|
|
34
42
|
--header-bg-color: var(--secondary-background);
|
|
43
|
+
--header-fg-color: ${usableHeaderForeground};
|
|
35
44
|
--aggregation-footer-bg-color: color-mix(
|
|
36
45
|
in sRGB,
|
|
37
46
|
var(--header-bg-color) 66%,
|
|
@@ -53,6 +62,7 @@ const StyledTableContainer = styled(forwardRef((props, ref) => _jsx("div", { ref
|
|
|
53
62
|
|
|
54
63
|
.container {
|
|
55
64
|
border: var(--border-style);
|
|
65
|
+
border-radius: calc(${theme.base['border-radius']} * 1.1);
|
|
56
66
|
position: relative;
|
|
57
67
|
letter-spacing: var(--letter-spacing);
|
|
58
68
|
font-stretch: var(--font-stretch);
|
|
@@ -134,6 +144,7 @@ const StyledTableContainer = styled(forwardRef((props, ref) => _jsx("div", { ref
|
|
|
134
144
|
.fallback-footer {
|
|
135
145
|
height: var(--row-height);
|
|
136
146
|
background-color: var(--header-bg-color);
|
|
147
|
+
color: var(--header-fg-color);
|
|
137
148
|
position: absolute;
|
|
138
149
|
width: 100%;
|
|
139
150
|
z-index: -1;
|
|
@@ -155,6 +166,8 @@ const StyledTableContainer = styled(forwardRef((props, ref) => _jsx("div", { ref
|
|
|
155
166
|
position: sticky;
|
|
156
167
|
top: 0;
|
|
157
168
|
z-index: 6;
|
|
169
|
+
border-start-start-radius: inherit;
|
|
170
|
+
border-start-end-radius: inherit;
|
|
158
171
|
}
|
|
159
172
|
|
|
160
173
|
.cell {
|
|
@@ -328,6 +341,21 @@ const StyledTableContainer = styled(forwardRef((props, ref) => _jsx("div", { ref
|
|
|
328
341
|
&.click {
|
|
329
342
|
cursor: pointer;
|
|
330
343
|
}
|
|
344
|
+
|
|
345
|
+
&:last-child {
|
|
346
|
+
border-end-start-radius: inherit;
|
|
347
|
+
border-end-end-radius: inherit;
|
|
348
|
+
|
|
349
|
+
> .cell {
|
|
350
|
+
&:first-child {
|
|
351
|
+
border-end-start-radius: inherit;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
&:last-child {
|
|
355
|
+
border-end-end-radius: inherit;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}
|
|
331
359
|
}
|
|
332
360
|
.row:not(.row-error):not(.group-header-row):not(.header) {
|
|
333
361
|
.cell-fixed {
|
|
@@ -343,8 +371,10 @@ const StyledTableContainer = styled(forwardRef((props, ref) => _jsx("div", { ref
|
|
|
343
371
|
.row[data-index$='7']:not(.group-header-row):not(.header),
|
|
344
372
|
.row[data-index$='9']:not(.group-header-row):not(.header) {
|
|
345
373
|
background: ${oddRowBackgroundColor};
|
|
374
|
+
color: ${useableOddRowForeground};
|
|
346
375
|
.cell-fixed {
|
|
347
376
|
background: ${oddRowBackgroundColor};
|
|
377
|
+
color: ${useableOddRowForeground};
|
|
348
378
|
}
|
|
349
379
|
}
|
|
350
380
|
`}
|
|
@@ -423,19 +453,21 @@ const StyledTableContainer = styled(forwardRef((props, ref) => _jsx("div", { ref
|
|
|
423
453
|
|
|
424
454
|
&.show-expand-collapse-all {
|
|
425
455
|
.row > .cell-first {
|
|
426
|
-
padding-left: calc(var(--expand-collapse-all-width) + var(--cell-padding));
|
|
456
|
+
padding-left: calc(var(--expand-collapse-all-width) + var(--cell-padding) + 0.25rem);
|
|
427
457
|
&.row-reorder-handle,
|
|
428
458
|
&.row-error-column {
|
|
429
459
|
padding: 0;
|
|
430
460
|
}
|
|
431
461
|
&.row-select-handle {
|
|
432
|
-
padding-left: calc(var(--expand-collapse-all-width));
|
|
462
|
+
padding-left: calc(var(--expand-collapse-all-width) + 0.5rem);
|
|
433
463
|
}
|
|
434
464
|
}
|
|
435
465
|
|
|
436
466
|
.row-container .row > .cell-first {
|
|
437
467
|
&.row-select-handle {
|
|
438
|
-
padding-inline-start: calc(
|
|
468
|
+
padding-inline-start: calc(
|
|
469
|
+
var(--expand-collapse-all-width) - var(--cell-padding) + 0.25rem
|
|
470
|
+
);
|
|
439
471
|
}
|
|
440
472
|
}
|
|
441
473
|
|
|
@@ -446,8 +478,11 @@ const StyledTableContainer = styled(forwardRef((props, ref) => _jsx("div", { ref
|
|
|
446
478
|
z-index: 10;
|
|
447
479
|
height: var(--row-height);
|
|
448
480
|
background-color: var(--header-bg-color);
|
|
481
|
+
color: var(--header-fg-color);
|
|
449
482
|
border-right: var(--border-style);
|
|
450
483
|
border-bottom: var(--border-style);
|
|
484
|
+
border-start-start-radius: ${theme.base['border-radius']};
|
|
485
|
+
margin-inline-start: 0.25rem;
|
|
451
486
|
display: flex;
|
|
452
487
|
align-items: center;
|
|
453
488
|
justify-content: center;
|
|
@@ -479,6 +514,9 @@ const StyledTableContainer = styled(forwardRef((props, ref) => _jsx("div", { ref
|
|
|
479
514
|
.header {
|
|
480
515
|
font-weight: var(--font-weight-semi-bold);
|
|
481
516
|
position: relative; /* This is required to position .border-fix element */
|
|
517
|
+
border-start-start-radius: inherit;
|
|
518
|
+
border-start-end-radius: inherit;
|
|
519
|
+
|
|
482
520
|
> .cell.row-error-column {
|
|
483
521
|
border-right: 0;
|
|
484
522
|
}
|
|
@@ -490,11 +528,20 @@ const StyledTableContainer = styled(forwardRef((props, ref) => _jsx("div", { ref
|
|
|
490
528
|
position: relative;
|
|
491
529
|
cursor: pointer;
|
|
492
530
|
background-color: var(--header-bg-color);
|
|
531
|
+
color: var(--header-fg-color);
|
|
493
532
|
font-weight: ${theme.base['font-weight'].bold};
|
|
494
533
|
font-size: ${fontSize.xxs};
|
|
495
534
|
border-right: var(--border-style);
|
|
496
535
|
padding: var(--header-cell-padding);
|
|
497
536
|
|
|
537
|
+
&:first-child {
|
|
538
|
+
border-start-start-radius: inherit;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
&:last-child {
|
|
542
|
+
border-start-end-radius: inherit;
|
|
543
|
+
}
|
|
544
|
+
|
|
498
545
|
.header-lable-container {
|
|
499
546
|
display: inline-flex;
|
|
500
547
|
overflow: hidden;
|
|
@@ -527,6 +574,10 @@ const StyledTableContainer = styled(forwardRef((props, ref) => _jsx("div", { ref
|
|
|
527
574
|
height: auto;
|
|
528
575
|
width: auto;
|
|
529
576
|
display: grid;
|
|
577
|
+
|
|
578
|
+
.button-more {
|
|
579
|
+
color: var(--header-fg-color);
|
|
580
|
+
}
|
|
530
581
|
}
|
|
531
582
|
|
|
532
583
|
.button-more {
|
|
@@ -609,6 +660,9 @@ const StyledTableContainer = styled(forwardRef((props, ref) => _jsx("div", { ref
|
|
|
609
660
|
&:not(.full-content-height) > .row:not(.group-header-row) {
|
|
610
661
|
height: var(--data-row-height);
|
|
611
662
|
}
|
|
663
|
+
border-end-start-radius: inherit;
|
|
664
|
+
border-end-end-radius: inherit;
|
|
665
|
+
|
|
612
666
|
& > .row .cell-content {
|
|
613
667
|
/*
|
|
614
668
|
* Using box sizing content-box so that the padding is not considered for the alignment of the cell content.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StyledTableContainer.js","sourceRoot":"","sources":["../../../../Core/Views/Table/StyledTableContainer.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACh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;;;;iBA+BjB,KAAK,CAAC,IAAI,CAAC,OAAO;;;;;;;;;;;;;;;;0BAgBT,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+BAyDlB,oBAAoB;QAC3C,CAAC,CAAC,oCAAoC;QACtC,CAAC,CAAC,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA8C1B,YAAY;;;;;;QAMZ,gBAAgB,IAAI,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAmC3B,QAAQ;;;;;;;;;;;;+BAYW,oBAAoB;QAC3C,CAAC,CAAC,oCAAoC;QACtC,CAAC,CAAC,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA8BrB,QAAQ;;;;;;;;;;;;;;;;;;;;mBAoBD,QAAQ,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;4BAqBD,gBAAgB;;;;;8BAKd,gBAAgB;;;;4BAIlB,cAAc;;;;;;;;8BAQZ,cAAc;;;;;wBAKpB,cAAc;;;;;;;;;uBASf,KAAK,CAAC,IAAI,CAAC,OAAO;;;;;uBAKlB,KAAK,CAAC,IAAI,CAAC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DtC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,oBAAoB,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport styled, { css } from 'styled-components';\nimport { mix, lighten, darken, getLuminance } from 'polished';\n\nimport { StyledStatus } from '@pega/cosmos-react-core/lib/components/Badges/Status';\nimport { StyledRadioCheck } from '@pega/cosmos-react-core/lib/components/RadioCheck/RadioCheck';\nimport { StyledLabel, calculateFontSize, tryCatch } from '@pega/cosmos-react-core';\n\nimport { CellIcon } from './CellWrapper';\n\nconst StyledTableContainer = styled(forwardRef((props, ref) => <div ref={ref} {...props} />))(({\n theme,\n style,\n view\n}) => {\n const isAggregationApplied = view.columns?.filter(c => !c.hidden).some(c => c.aggregated);\n const freezeMarginTop = `-${style['--row-height']}`;\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n const selectedRowColor = tryCatch(() =>\n mix(0.85, theme.base.palette['primary-background'], theme.base.palette.interactive)\n );\n const lightGreyColor = theme.base.colors.gray['extra-light'];\n const oddRowBackgroundColor =\n getLuminance(theme.base.palette['secondary-background']) > 0.5\n ? lighten(0.01, theme.base.palette['secondary-background'])\n : darken(0.1, theme.base.palette['secondary-background']);\n\n return css`\n --primary-background: ${theme.base.palette['primary-background']};\n --secondary-background: ${theme.base.palette['secondary-background']};\n --forground-color: ${theme.base.palette['foreground-color']};\n --interactive: ${theme.base.palette.interactive};\n --medium-blue: ${theme.base.colors.blue.medium};\n --border-color: ${theme.base.palette['border-line']};\n --border-color-freeze: #a5a5a5;\n --border-width: 0.062rem;\n --border-style: var(--border-width) solid var(--border-color);\n --font-stretch: ${theme.components.table.typography['font-stretch']};\n --letter-spacing: ${theme.components.table.typography['letter-spacing']};\n --cell-padding: ${theme.base.spacing};\n --cell-vertical-padding: calc(${theme.base.spacing} * 0.5);\n --header-cell-padding: 0 0.12rem 0 var(--cell-padding);\n --header-cell-right-align-padding: 0 var(--cell-padding) 0 0.12rem;\n --header-bg-color: var(--secondary-background);\n --aggregation-footer-bg-color: color-mix(\n in sRGB,\n var(--header-bg-color) 66%,\n ${theme.base.colors.gray.light} 33%\n );\n --default-group-header-height: 1.5rem;\n --group-header-height: var(--default-group-header-height);\n --box-sizing: content-box;\n --animation-ease: ${theme.base.animation.timing.ease};\n --font-weight-semi-bold: ${theme.base['font-weight']['semi-bold']};\n --row-height-multiplier: 1.125;\n --cell-fixed-position: sticky;\n position: relative;\n border-radius: ${theme.base['border-radius']};\n\n .small-screen-table {\n --cell-fixed-position: static;\n }\n\n .container {\n border: var(--border-style);\n position: relative;\n letter-spacing: var(--letter-spacing);\n font-stretch: var(--font-stretch);\n }\n\n .hide-rows-till-ready .row[aria-rowindex] {\n visibility: hidden;\n }\n\n .table-drag-proxy {\n background: rgba(0, 0, 0, 0.21);\n position: absolute;\n top: 0;\n bottom: 0;\n z-index: 6;\n pointer-events: none;\n display: none;\n }\n\n .table-drag-line {\n background: #999999;\n position: absolute;\n top: 0;\n bottom: 0;\n width: 0.12rem;\n z-index: 6;\n pointer-events: none;\n display: none;\n }\n\n .freeze-line {\n /* stylelint-disable unit-allowed-list */\n border-right: solid 1px var(--border-color-freeze);\n position: sticky;\n top: 0;\n bottom: 0;\n width: 1px;\n z-index: 7; /* Footer has 6 z-index so this needs to be more than that */\n pointer-events: none;\n height: 100%;\n float: left;\n margin-top: ${freezeMarginTop};\n }\n\n .freeze-line.freeze-line-hide {\n display: none;\n }\n\n .horizontally-scrolled {\n .freeze-line {\n box-shadow: 2px 0 0 1px rgba(165, 165, 165, 0.2);\n transition: 0.5s;\n }\n }\n\n .cell-fixed {\n z-index: 1;\n }\n\n .group-wrapper {\n overflow: hidden;\n display: inline-flex;\n line-height: var(--group-header-height);\n\n .group-context-count {\n display: inline-flex;\n overflow: hidden;\n }\n }\n\n /* In review mode(Ex: Tabs) cosmos components are rendered and mark up is not compatible with\n group-wrapper cell. Overridden css in group-header when dl exists inside that class which indicates\n mark up is generated from cosmos which differentiates from normal table cell markup */\n .group-wrapper .group-context-count dl {\n grid-template-columns: auto;\n }\n\n .fallback,\n .fallback-footer {\n height: var(--row-height);\n background-color: var(--header-bg-color);\n position: absolute;\n width: 100%;\n z-index: -1;\n box-sizing: var(--box-sizing);\n }\n\n .fallback {\n top: -1px;\n border-bottom: var(--border-style);\n }\n\n .fallback-footer {\n top: 0;\n border-top: var(--border-style);\n }\n\n .sticky-header {\n display: grid;\n position: sticky;\n top: 0;\n z-index: 6;\n }\n\n .cell {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n\n .icons-ph {\n min-width: 1rem;\n }\n\n &.custom-item {\n width: 10em;\n }\n }\n\n .cell:focus {\n outline: 0.125rem auto var(--medium-blue);\n }\n\n .cell.selection-border:focus,\n .cell.editable-cell:focus {\n outline: none 0;\n }\n\n .editable-cell > span {\n height: 100%;\n display: flex;\n padding: 0 6px;\n align-items: center;\n }\n\n .row {\n display: inline-flex;\n height: var(--row-height);\n outline: none 0;\n transition: transform 0.5s var(--animation-ease);\n box-sizing: var(--box-sizing);\n position: relative;\n\n > .cell,\n .group-header-aggregation-row > .cell {\n transition: transform 0.5s var(--animation-ease);\n border-right: var(--border-style);\n ${!theme.components.table['striped-rows'] &&\n css`\n border-bottom: var(--border-style);\n `}\n display: flex;\n align-items: center;\n\n &::after {\n opacity: 1;\n transition: opacity 0.1s var(--animation-ease);\n }\n\n /* stylelint-disable selector-max-class */\n .row-action-menu {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n &.cell-action {\n position: sticky;\n z-index: 4;\n right: 0;\n border-right: 0;\n min-width: 32px;\n justify-content: center;\n border-left: var(--border-style);\n\n .cell-content {\n padding: 0;\n overflow: visible;\n }\n\n /* The below styles are needed to avoid ellipses in safari when no text is present\n and to hide the 'Actions' label */\n\n /* stylelint-disable max-nesting-depth */\n\n div.header-label {\n text-overflow: unset;\n span {\n visibility: hidden;\n }\n }\n }\n &.aggregateCell {\n background-color: var(--aggregation-footer-bg-color);\n }\n }\n\n /** Adds bottom border to the last row of a group, when striped-rows are enabled */\n &:has(+ .group-header-row) > .cell {\n ${theme.components.table['striped-rows'] &&\n css`\n border-bottom: var(--border-style);\n `}\n }\n &.header > .cell {\n border-bottom: var(--border-style);\n }\n .group-header-aggregation-row {\n > .cell {\n &.cell-action {\n overflow: initial;\n\n /* extending border on the top left of row action cell as we need to show border for at the end group label value when row actions are present */\n &::before {\n content: '';\n position: absolute;\n inline-size: 0;\n inset-inline-start: calc(var(--border-width) * -1);\n inset-block-start: calc(var(--group-header-height) * -1);\n block-size: var(--group-header-height);\n border-inline-start: var(--border-style);\n }\n }\n }\n }\n\n > .cell-action {\n background-color: var(--primary-background);\n }\n\n > .row-reorder-handle {\n padding: 0;\n border-right: 0 !important;\n justify-content: center;\n cursor: move;\n }\n\n > .row-select-handle {\n display: flex;\n justify-content: center;\n &:active {\n outline: none;\n }\n\n > .header-lable-container {\n min-width: 20px;\n }\n }\n\n .aggregateCell.cell {\n border-right: none;\n }\n\n > .cell.cell-fixed,\n .group-header-aggregation-row > .cell-fixed {\n position: var(--cell-fixed-position);\n z-index: 4;\n\n /* As the row select column and row dragDrop column always have to be frozen */\n &[data-col-id='RowSelect'],\n &[data-col-id='RowDragDrop'],\n &[data-col-id='RowError'] {\n position: sticky;\n flex-shrink: 0;\n z-index: 5;\n }\n }\n\n > .cell.cell-fixed:focus-within,\n .group-header-aggregation-row > .cell-fixed {\n z-index: 6;\n }\n\n &.click {\n cursor: pointer;\n }\n }\n .row:not(.row-error):not(.group-header-row):not(.header) {\n .cell-fixed {\n background: var(--primary-background);\n }\n }\n ${theme.components.table['striped-rows'] &&\n css`\n /* Targets rows with an odd data-index attribute, excluding group header rows */\n .row[data-index$='1']:not(.group-header-row):not(.header),\n .row[data-index$='3']:not(.group-header-row):not(.header),\n .row[data-index$='5']:not(.group-header-row):not(.header),\n .row[data-index$='7']:not(.group-header-row):not(.header),\n .row[data-index$='9']:not(.group-header-row):not(.header) {\n background: ${oddRowBackgroundColor};\n .cell-fixed {\n background: ${oddRowBackgroundColor};\n }\n }\n `}\n\n .row-error {\n background: ${mix(\n 0.1,\n theme.components['form-field'].error['status-color'],\n theme.base.palette['primary-background']\n )};\n\n /* stylelint-disable no-descending-specificity */\n .cell-fixed,\n .cell-action {\n background: inherit;\n }\n\n > .cell:not(.cell-fixed):not(.cell-action) {\n background: none;\n }\n }\n\n .sort-info-container {\n margin-left: 0.312rem;\n\n .sort-sequence {\n font-size: 0.625rem;\n color: ${theme.base.colors.gray['extra-dark']};\n }\n }\n\n .filter-info-container {\n display: flex;\n justify-content: center;\n align-items: center;\n margin: 0 0 0 0.312rem;\n\n svg {\n width: 14px;\n height: 14px;\n }\n }\n\n .cell.row-error-column {\n padding: 0;\n border-right: 0;\n text-align: right;\n outline: none;\n\n /* Focus handling will be done as part of interation 2: EPIC-88751 */\n\n svg {\n color: ${theme.base.colors.red.medium};\n }\n }\n\n .cell-right-align .filter-info-container svg {\n margin: 0 0.312rem 0 0;\n }\n\n .editable-cell {\n padding: 0;\n border: 2px solid ${theme.base.palette.interactive} !important;\n box-shadow: 0 0 1px 1px rgba(0, 118, 209) !important;\n }\n\n .editable-cell input {\n border: none;\n outline: none;\n min-width: calc(100%);\n min-height: 0;\n max-height: 100%;\n box-shadow: none !important;\n border-radius: 0;\n }\n\n .editable-cell.align-right input {\n justify-content: right;\n }\n\n &.show-expand-collapse-all {\n .row > .cell-first {\n padding-left: calc(var(--expand-collapse-all-width) + var(--cell-padding));\n &.row-reorder-handle,\n &.row-error-column {\n padding: 0;\n }\n &.row-select-handle {\n padding-left: calc(var(--expand-collapse-all-width));\n }\n }\n\n .row-container .row > .cell-first {\n &.row-select-handle {\n padding-inline-start: calc(var(--expand-collapse-all-width) - var(--cell-padding));\n }\n }\n\n /* stylelint-enable selector-max-class */\n .expand-collapse-all {\n position: absolute;\n width: var(--expand-collapse-all-width);\n z-index: 10;\n height: var(--row-height);\n background-color: var(--header-bg-color);\n border-right: var(--border-style);\n border-bottom: var(--border-style);\n display: flex;\n align-items: center;\n justify-content: center;\n\n > button {\n color: var(--forground-color);\n :focus {\n box-shadow: ${theme.base.shadow.focus};\n }\n }\n }\n .no-border-right {\n border-right: 0;\n }\n }\n\n /* stylelint-disable selector-max-class */\n\n .scroll-end {\n &.row-container > .row:last-child {\n & > .cell,\n & .group-header-aggregation-row > .cell {\n border-bottom: 0;\n }\n }\n }\n\n /* stylelint-enable selector-max-class */\n .header {\n font-weight: var(--font-weight-semi-bold);\n position: relative; /* This is required to position .border-fix element */\n > .cell.row-error-column {\n border-right: 0;\n }\n > .cell {\n display: flex;\n justify-content: space-between;\n align-items: center;\n z-index: 2;\n position: relative;\n cursor: pointer;\n background-color: var(--header-bg-color);\n font-weight: ${theme.base['font-weight'].bold};\n font-size: ${fontSize.xxs};\n border-right: var(--border-style);\n padding: var(--header-cell-padding);\n\n .header-lable-container {\n display: inline-flex;\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: ${fontSize.xs};\n font-weight: var(--font-weight-semi-bold);\n align-items: center;\n }\n\n .header-label {\n overflow: hidden;\n text-overflow: ellipsis;\n\n /* To avoid browser tooltip when we get ellipsis in safari */\n &::after {\n content: '';\n display: block;\n }\n\n /* To utilize smart tooltip making it as a non-box element */\n /* stylelint-disable selector-max-class */\n .cell-content {\n display: contents;\n }\n }\n\n .header-menu {\n margin-left: auto;\n min-width: 1rem;\n height: auto;\n width: auto;\n display: grid;\n }\n\n .button-more {\n gap: ${theme.base.spacing};\n flex-shrink: 0;\n white-space: nowrap;\n border: none;\n background: none !important;\n height: auto;\n width: auto;\n display: grid;\n padding: 2px;\n min-height: 18px;\n min-width: 18px;\n margin-right: 0;\n margin-inline-end: 0.125rem;\n color: var(--forground-color);\n :focus,\n :hover {\n box-shadow: ${theme.base.shadow.focus};\n }\n }\n }\n\n > .row-reorder-handle {\n padding: 0;\n }\n\n > .cell-fixed:last-child {\n border-right: var(--border-style);\n }\n\n > .row-select-handle {\n padding-inline-start: calc(var(--cell-padding) / 4);\n justify-content: center;\n }\n\n > .cell-right-align {\n padding: var(--header-cell-right-align-padding);\n justify-content: end;\n\n .header-lable-container {\n flex-direction: row-reverse;\n }\n\n .sort-info-container {\n margin-left: 0;\n margin-right: 0.312rem;\n }\n }\n\n > .cell-first {\n padding: 0 var(--cell-padding);\n }\n\n .row {\n border-bottom: none;\n }\n }\n\n /* 4 selectors required as aggregateCell of only footer need this effect */\n\n .pContainer:not(.pContainerScroll) .footer .aggregateCell.cell {\n border-bottom: none;\n }\n\n /* stylelint-enable selector-max-class */\n .row .cell.cell-last {\n border-right: 0;\n flex-grow: 1;\n }\n\n .row-container {\n --data-row-height: calc(\n var(--hit-area) * var(--row-height-multiplier) + var(--cell-vertical-padding)\n );\n --group-header-height: ${isAggregationApplied\n ? 'var(--default-group-header-height)'\n : 'var(--data-row-height)'};\n &:not(.full-content-height) > .row:not(.group-header-row) {\n height: var(--data-row-height);\n }\n & > .row .cell-content {\n /*\n * Using box sizing content-box so that the padding is not considered for the alignment of the cell content.\n * Vertical alignment is done using flex and max-height below even though the .cell-content might overflow due to padding + content size.\n */\n box-sizing: content-box;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n word-break: break-all;\n flex-grow: 1;\n\n /* Adding padding on .cell-content so that focus rings can appear properly and doesn't clip due to overflow: hidden */\n padding: var(--cell-vertical-padding) var(--cell-padding);\n\n /* setting max-height so that the elements with more height like RTL, align with the row density height */\n max-height: var(--data-row-height);\n\n /* hiding scroll bar in case the cell render introduces scrollbar based on its implementation */\n & * {\n scrollbar-width: none;\n }\n\n /* in case of combine columns, removing padding from parent cell-content as children already have the padding */\n &:has(.combined-cell) {\n padding: 0;\n\n /* stylelint-disable-next-line selector-max-class */\n .cell-content {\n flex-grow: unset;\n }\n }\n }\n }\n\n .row .aggregateCell .cell-content {\n line-height: initial;\n padding: 0;\n }\n\n .short-height,\n .medium-height {\n ${StyledStatus} {\n white-space: nowrap;\n }\n }\n\n .short-height {\n ${StyledRadioCheck} ${StyledLabel} {\n min-height: auto;\n }\n }\n\n .medium-height {\n --row-height-multiplier: 4 / 3;\n }\n\n .tall-height {\n --row-height-multiplier: calc(4 / 3 + 0.5);\n > .row:not(.group-header-row) {\n > .cell {\n display: inline-grid;\n align-items: start;\n white-space: normal;\n word-break: break-all;\n grid-auto-flow: column;\n\n :has(> :nth-child(n + 2)) {\n /* Adds space between if more than 1 item in cell container */\n justify-content: space-between;\n }\n\n /* stylelint-disable selector-max-class */\n /* stylelint-disable-next-line selector-max-compound-selectors */\n > .cell-content > .combined-cell > .combined-cell-content,\n > .cell-content {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n white-space: inherit;\n word-break: inherit;\n }\n\n ${CellIcon} {\n margin-block-start: 0.375rem;\n }\n }\n }\n }\n\n .full-content-height {\n --row-height-multiplier: 4 / 3;\n --row-min-height: calc(\n var(--hit-area) * var(--row-height-multiplier) + var(--cell-vertical-padding) * 2\n );\n --group-header-height: ${isAggregationApplied\n ? 'var(--default-group-header-height)'\n : 'var(--row-min-height)'};\n\n > .row:not(.group-header-row) {\n height: auto;\n min-height: var(--row-min-height);\n > .cell {\n white-space: normal;\n\n /* -- For BUG-625508 -- */\n word-break: break-word;\n display: inline-grid;\n align-items: start;\n padding-top: var(--cell-vertical-padding);\n padding-bottom: var(--cell-vertical-padding);\n grid-auto-flow: column;\n\n :has(> :nth-child(n + 2)) {\n /* Adds space between if more than 1 item in cell container */\n justify-content: space-between;\n }\n\n /* stylelint-disable-next-line selector-max-compound-selectors */\n > .cell-content > .combined-cell > .combined-cell-content,\n > .cell-content {\n /* for full-content, the row cells should adjust according to content */\n max-height: none;\n white-space: inherit;\n word-break: inherit;\n }\n\n ${CellIcon} {\n margin-block-start: 0.375rem;\n }\n }\n }\n }\n\n .footer {\n .row {\n .cell {\n padding: 0;\n }\n }\n }\n\n /* stylelint-disable no-duplicate-selectors */\n .row-container {\n position: absolute;\n display: grid;\n width: 100%;\n font-size: ${fontSize.s};\n\n > .group-header-row,\n .hierarchical-group-footer-row {\n height: var(--group-header-height);\n .cell {\n padding: 0;\n border-right-width: 0;\n }\n }\n\n > .hierarchical-group-header-row {\n height: var(--group-header-height);\n }\n input.checkbox-on-hover + label {\n opacity: 0;\n }\n input.checkbox-on-hover:checked + label {\n opacity: 1;\n }\n .row.selected-row {\n background-color: ${selectedRowColor};\n\n > .cell,\n .cell-fixed,\n .cell-action {\n background-color: ${selectedRowColor};\n }\n }\n .row-on-hover:hover {\n background-color: ${lightGreyColor};\n input.checkbox-on-hover + label {\n opacity: 1;\n }\n\n > .cell,\n .cell-fixed,\n .cell-action {\n background-color: ${lightGreyColor};\n }\n }\n .row.hierarchical-group-footer-row {\n .cell-fixed {\n background: ${lightGreyColor};\n }\n }\n }\n\n /* stylelint-enable selector-max-class */\n\n .toolbar-button-applied {\n padding: 0 8px;\n margin: 0 calc(${theme.base.spacing} / 4);\n }\n\n .toolbar-button {\n padding: 0 8px;\n margin: 0 calc(${theme.base.spacing} / 4);\n }\n\n .column-resizer {\n cursor: col-resize;\n position: absolute;\n top: 0;\n right: 0;\n z-index: 3;\n width: 0.25rem;\n height: 100%;\n }\n\n .column-resizer:hover,\n .column-resizer:active {\n background: var(--interactive);\n }\n\n .align-right {\n justify-content: right;\n\n .cell-content {\n text-align: right;\n }\n }\n\n .align-left {\n justify-content: left;\n\n .cell-content {\n text-align: left;\n }\n }\n\n .align-center {\n justify-content: center;\n\n .cell-content {\n text-align: center;\n }\n }\n\n .selection-border {\n border: 0.125rem solid var(--medium-blue) !important;\n }\n\n .disable-select {\n user-select: none; /* supported by Chrome and Firefox */\n -webkit-user-select: none; /* Safari */\n }\n\n .popper {\n div.row {\n display: flex;\n vertical-align: middle;\n line-height: unset;\n border-bottom: none;\n outline: none 0;\n height: auto;\n }\n }\n `;\n});\n\nexport default StyledTableContainer;\n"]}
|
|
1
|
+
{"version":3,"file":"StyledTableContainer.js","sourceRoot":"","sources":["../../../../Core/Views/Table/StyledTableContainer.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAErF,OAAO,EAAE,YAAY,EAAE,MAAM,sDAAsD,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,8DAA8D,CAAC;AAChG,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM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AAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAmC3B,QAAQ;;;;;;;;;;;;+BAYW,oBAAoB;QAC3C,CAAC,CAAC,oCAAoC;QACtC,CAAC,CAAC,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA8BrB,QAAQ;;;;;;;;;;;;;;;;;;;;mBAoBD,QAAQ,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;4BAqBD,gBAAgB;;;;;8BAKd,gBAAgB;;;;4BAIlB,cAAc;;;;;;;;8BAQZ,cAAc;;;;;wBAKpB,cAAc;;;;;;;;;uBASf,KAAK,CAAC,IAAI,CAAC,OAAO;;;;;uBAKlB,KAAK,CAAC,IAAI,CAAC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DtC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,oBAAoB,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport styled, { css } from 'styled-components';\nimport { getLuminance, meetsContrastGuidelines, mix, readableColor } from 'polished';\n\nimport { StyledStatus } from '@pega/cosmos-react-core/lib/components/Badges/Status';\nimport { StyledRadioCheck } from '@pega/cosmos-react-core/lib/components/RadioCheck/RadioCheck';\nimport { StyledLabel, calculateFontSize, tryCatch } from '@pega/cosmos-react-core';\n\nimport { CellIcon } from './CellWrapper';\n\nconst StyledTableContainer = styled(forwardRef((props, ref) => <div ref={ref} {...props} />))(({\n theme,\n style,\n view\n}) => {\n const isAggregationApplied = view.columns?.filter(c => !c.hidden).some(c => c.aggregated);\n const freezeMarginTop = `-${style['--row-height']}`;\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n const selectedRowColor = tryCatch(() =>\n mix(0.85, theme.base.palette['primary-background'], theme.base.palette.interactive)\n );\n const lightGreyColor = theme.base.colors.gray['extra-light'];\n const oddRowBackgroundColor =\n getLuminance(theme.components.table.body['secondary-background-color']) > 0.5\n ? theme.components.table.body['secondary-background-color']\n : mix(\n 0.75,\n theme.components.table.body['background-color'],\n theme.components.table.body['secondary-background-color']\n );\n\n const headerForegroundContrast = meetsContrastGuidelines(\n theme.components.table.header['foreground-color'],\n theme.components.table.header['background-color']\n ).AA;\n const usableHeaderForeground = headerForegroundContrast\n ? theme.components.table.header['foreground-color']\n : readableColor(\n theme.components.table.header['foreground-color'],\n theme.components.table.header['background-color']\n );\n const oddRowContrast = meetsContrastGuidelines(\n theme.components.table.body['foreground-color'],\n oddRowBackgroundColor\n ).AA;\n const useableOddRowForeground = oddRowContrast\n ? theme.components.table.body['foreground-color']\n : readableColor(theme.components.table.body['foreground-color'], oddRowBackgroundColor);\n\n return css`\n --primary-background: ${theme.base.palette['primary-background']};\n --secondary-background: ${theme.components.table.header['background-color']};\n --forground-color: ${theme.base.palette['foreground-color']};\n --interactive: ${theme.base.palette.interactive};\n --medium-blue: ${theme.base.colors.blue.medium};\n --border-color: ${theme.base.palette['border-line']};\n --border-color-freeze: #a5a5a5;\n --border-width: 0.062rem;\n --border-style: var(--border-width) solid var(--border-color);\n --font-stretch: ${theme.components.table.typography['font-stretch']};\n --letter-spacing: ${theme.components.table.typography['letter-spacing']};\n --cell-padding: ${theme.base.spacing};\n --cell-vertical-padding: calc(${theme.base.spacing} * 0.5);\n --header-cell-padding: 0 0.12rem 0 var(--cell-padding);\n --header-cell-right-align-padding: 0 var(--cell-padding) 0 0.12rem;\n --header-bg-color: var(--secondary-background);\n --header-fg-color: ${usableHeaderForeground};\n --aggregation-footer-bg-color: color-mix(\n in sRGB,\n var(--header-bg-color) 66%,\n ${theme.base.colors.gray.light} 33%\n );\n --default-group-header-height: 1.5rem;\n --group-header-height: var(--default-group-header-height);\n --box-sizing: content-box;\n --animation-ease: ${theme.base.animation.timing.ease};\n --font-weight-semi-bold: ${theme.base['font-weight']['semi-bold']};\n --row-height-multiplier: 1.125;\n --cell-fixed-position: sticky;\n position: relative;\n border-radius: ${theme.base['border-radius']};\n\n .small-screen-table {\n --cell-fixed-position: static;\n }\n\n .container {\n border: var(--border-style);\n border-radius: calc(${theme.base['border-radius']} * 1.1);\n position: relative;\n letter-spacing: var(--letter-spacing);\n font-stretch: var(--font-stretch);\n }\n\n .hide-rows-till-ready .row[aria-rowindex] {\n visibility: hidden;\n }\n\n .table-drag-proxy {\n background: rgba(0, 0, 0, 0.21);\n position: absolute;\n top: 0;\n bottom: 0;\n z-index: 6;\n pointer-events: none;\n display: none;\n }\n\n .table-drag-line {\n background: #999999;\n position: absolute;\n top: 0;\n bottom: 0;\n width: 0.12rem;\n z-index: 6;\n pointer-events: none;\n display: none;\n }\n\n .freeze-line {\n /* stylelint-disable unit-allowed-list */\n border-right: solid 1px var(--border-color-freeze);\n position: sticky;\n top: 0;\n bottom: 0;\n width: 1px;\n z-index: 7; /* Footer has 6 z-index so this needs to be more than that */\n pointer-events: none;\n height: 100%;\n float: left;\n margin-top: ${freezeMarginTop};\n }\n\n .freeze-line.freeze-line-hide {\n display: none;\n }\n\n .horizontally-scrolled {\n .freeze-line {\n box-shadow: 2px 0 0 1px rgba(165, 165, 165, 0.2);\n transition: 0.5s;\n }\n }\n\n .cell-fixed {\n z-index: 1;\n }\n\n .group-wrapper {\n overflow: hidden;\n display: inline-flex;\n line-height: var(--group-header-height);\n\n .group-context-count {\n display: inline-flex;\n overflow: hidden;\n }\n }\n\n /* In review mode(Ex: Tabs) cosmos components are rendered and mark up is not compatible with\n group-wrapper cell. Overridden css in group-header when dl exists inside that class which indicates\n mark up is generated from cosmos which differentiates from normal table cell markup */\n .group-wrapper .group-context-count dl {\n grid-template-columns: auto;\n }\n\n .fallback,\n .fallback-footer {\n height: var(--row-height);\n background-color: var(--header-bg-color);\n color: var(--header-fg-color);\n position: absolute;\n width: 100%;\n z-index: -1;\n box-sizing: var(--box-sizing);\n }\n\n .fallback {\n top: -1px;\n border-bottom: var(--border-style);\n }\n\n .fallback-footer {\n top: 0;\n border-top: var(--border-style);\n }\n\n .sticky-header {\n display: grid;\n position: sticky;\n top: 0;\n z-index: 6;\n border-start-start-radius: inherit;\n border-start-end-radius: inherit;\n }\n\n .cell {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n\n .icons-ph {\n min-width: 1rem;\n }\n\n &.custom-item {\n width: 10em;\n }\n }\n\n .cell:focus {\n outline: 0.125rem auto var(--medium-blue);\n }\n\n .cell.selection-border:focus,\n .cell.editable-cell:focus {\n outline: none 0;\n }\n\n .editable-cell > span {\n height: 100%;\n display: flex;\n padding: 0 6px;\n align-items: center;\n }\n\n .row {\n display: inline-flex;\n height: var(--row-height);\n outline: none 0;\n transition: transform 0.5s var(--animation-ease);\n box-sizing: var(--box-sizing);\n position: relative;\n\n > .cell,\n .group-header-aggregation-row > .cell {\n transition: transform 0.5s var(--animation-ease);\n border-right: var(--border-style);\n ${!theme.components.table['striped-rows'] &&\n css`\n border-bottom: var(--border-style);\n `}\n display: flex;\n align-items: center;\n\n &::after {\n opacity: 1;\n transition: opacity 0.1s var(--animation-ease);\n }\n\n /* stylelint-disable selector-max-class */\n .row-action-menu {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n &.cell-action {\n position: sticky;\n z-index: 4;\n right: 0;\n border-right: 0;\n min-width: 32px;\n justify-content: center;\n border-left: var(--border-style);\n\n .cell-content {\n padding: 0;\n overflow: visible;\n }\n\n /* The below styles are needed to avoid ellipses in safari when no text is present\n and to hide the 'Actions' label */\n\n /* stylelint-disable max-nesting-depth */\n\n div.header-label {\n text-overflow: unset;\n span {\n visibility: hidden;\n }\n }\n }\n &.aggregateCell {\n background-color: var(--aggregation-footer-bg-color);\n }\n }\n\n /** Adds bottom border to the last row of a group, when striped-rows are enabled */\n &:has(+ .group-header-row) > .cell {\n ${theme.components.table['striped-rows'] &&\n css`\n border-bottom: var(--border-style);\n `}\n }\n &.header > .cell {\n border-bottom: var(--border-style);\n }\n .group-header-aggregation-row {\n > .cell {\n &.cell-action {\n overflow: initial;\n\n /* extending border on the top left of row action cell as we need to show border for at the end group label value when row actions are present */\n &::before {\n content: '';\n position: absolute;\n inline-size: 0;\n inset-inline-start: calc(var(--border-width) * -1);\n inset-block-start: calc(var(--group-header-height) * -1);\n block-size: var(--group-header-height);\n border-inline-start: var(--border-style);\n }\n }\n }\n }\n\n > .cell-action {\n background-color: var(--primary-background);\n }\n\n > .row-reorder-handle {\n padding: 0;\n border-right: 0 !important;\n justify-content: center;\n cursor: move;\n }\n\n > .row-select-handle {\n display: flex;\n justify-content: center;\n &:active {\n outline: none;\n }\n\n > .header-lable-container {\n min-width: 20px;\n }\n }\n\n .aggregateCell.cell {\n border-right: none;\n }\n\n > .cell.cell-fixed,\n .group-header-aggregation-row > .cell-fixed {\n position: var(--cell-fixed-position);\n z-index: 4;\n\n /* As the row select column and row dragDrop column always have to be frozen */\n &[data-col-id='RowSelect'],\n &[data-col-id='RowDragDrop'],\n &[data-col-id='RowError'] {\n position: sticky;\n flex-shrink: 0;\n z-index: 5;\n }\n }\n\n > .cell.cell-fixed:focus-within,\n .group-header-aggregation-row > .cell-fixed {\n z-index: 6;\n }\n\n &.click {\n cursor: pointer;\n }\n\n &:last-child {\n border-end-start-radius: inherit;\n border-end-end-radius: inherit;\n\n > .cell {\n &:first-child {\n border-end-start-radius: inherit;\n }\n\n &:last-child {\n border-end-end-radius: inherit;\n }\n }\n }\n }\n .row:not(.row-error):not(.group-header-row):not(.header) {\n .cell-fixed {\n background: var(--primary-background);\n }\n }\n ${theme.components.table['striped-rows'] &&\n css`\n /* Targets rows with an odd data-index attribute, excluding group header rows */\n .row[data-index$='1']:not(.group-header-row):not(.header),\n .row[data-index$='3']:not(.group-header-row):not(.header),\n .row[data-index$='5']:not(.group-header-row):not(.header),\n .row[data-index$='7']:not(.group-header-row):not(.header),\n .row[data-index$='9']:not(.group-header-row):not(.header) {\n background: ${oddRowBackgroundColor};\n color: ${useableOddRowForeground};\n .cell-fixed {\n background: ${oddRowBackgroundColor};\n color: ${useableOddRowForeground};\n }\n }\n `}\n\n .row-error {\n background: ${mix(\n 0.1,\n theme.components['form-field'].error['status-color'],\n theme.base.palette['primary-background']\n )};\n\n /* stylelint-disable no-descending-specificity */\n .cell-fixed,\n .cell-action {\n background: inherit;\n }\n\n > .cell:not(.cell-fixed):not(.cell-action) {\n background: none;\n }\n }\n\n .sort-info-container {\n margin-left: 0.312rem;\n\n .sort-sequence {\n font-size: 0.625rem;\n color: ${theme.base.colors.gray['extra-dark']};\n }\n }\n\n .filter-info-container {\n display: flex;\n justify-content: center;\n align-items: center;\n margin: 0 0 0 0.312rem;\n\n svg {\n width: 14px;\n height: 14px;\n }\n }\n\n .cell.row-error-column {\n padding: 0;\n border-right: 0;\n text-align: right;\n outline: none;\n\n /* Focus handling will be done as part of interation 2: EPIC-88751 */\n\n svg {\n color: ${theme.base.colors.red.medium};\n }\n }\n\n .cell-right-align .filter-info-container svg {\n margin: 0 0.312rem 0 0;\n }\n\n .editable-cell {\n padding: 0;\n border: 2px solid ${theme.base.palette.interactive} !important;\n box-shadow: 0 0 1px 1px rgba(0, 118, 209) !important;\n }\n\n .editable-cell input {\n border: none;\n outline: none;\n min-width: calc(100%);\n min-height: 0;\n max-height: 100%;\n box-shadow: none !important;\n border-radius: 0;\n }\n\n .editable-cell.align-right input {\n justify-content: right;\n }\n\n &.show-expand-collapse-all {\n .row > .cell-first {\n padding-left: calc(var(--expand-collapse-all-width) + var(--cell-padding) + 0.25rem);\n &.row-reorder-handle,\n &.row-error-column {\n padding: 0;\n }\n &.row-select-handle {\n padding-left: calc(var(--expand-collapse-all-width) + 0.5rem);\n }\n }\n\n .row-container .row > .cell-first {\n &.row-select-handle {\n padding-inline-start: calc(\n var(--expand-collapse-all-width) - var(--cell-padding) + 0.25rem\n );\n }\n }\n\n /* stylelint-enable selector-max-class */\n .expand-collapse-all {\n position: absolute;\n width: var(--expand-collapse-all-width);\n z-index: 10;\n height: var(--row-height);\n background-color: var(--header-bg-color);\n color: var(--header-fg-color);\n border-right: var(--border-style);\n border-bottom: var(--border-style);\n border-start-start-radius: ${theme.base['border-radius']};\n margin-inline-start: 0.25rem;\n display: flex;\n align-items: center;\n justify-content: center;\n\n > button {\n color: var(--forground-color);\n :focus {\n box-shadow: ${theme.base.shadow.focus};\n }\n }\n }\n .no-border-right {\n border-right: 0;\n }\n }\n\n /* stylelint-disable selector-max-class */\n\n .scroll-end {\n &.row-container > .row:last-child {\n & > .cell,\n & .group-header-aggregation-row > .cell {\n border-bottom: 0;\n }\n }\n }\n\n /* stylelint-enable selector-max-class */\n .header {\n font-weight: var(--font-weight-semi-bold);\n position: relative; /* This is required to position .border-fix element */\n border-start-start-radius: inherit;\n border-start-end-radius: inherit;\n\n > .cell.row-error-column {\n border-right: 0;\n }\n > .cell {\n display: flex;\n justify-content: space-between;\n align-items: center;\n z-index: 2;\n position: relative;\n cursor: pointer;\n background-color: var(--header-bg-color);\n color: var(--header-fg-color);\n font-weight: ${theme.base['font-weight'].bold};\n font-size: ${fontSize.xxs};\n border-right: var(--border-style);\n padding: var(--header-cell-padding);\n\n &:first-child {\n border-start-start-radius: inherit;\n }\n\n &:last-child {\n border-start-end-radius: inherit;\n }\n\n .header-lable-container {\n display: inline-flex;\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: ${fontSize.xs};\n font-weight: var(--font-weight-semi-bold);\n align-items: center;\n }\n\n .header-label {\n overflow: hidden;\n text-overflow: ellipsis;\n\n /* To avoid browser tooltip when we get ellipsis in safari */\n &::after {\n content: '';\n display: block;\n }\n\n /* To utilize smart tooltip making it as a non-box element */\n /* stylelint-disable selector-max-class */\n .cell-content {\n display: contents;\n }\n }\n\n .header-menu {\n margin-left: auto;\n min-width: 1rem;\n height: auto;\n width: auto;\n display: grid;\n\n .button-more {\n color: var(--header-fg-color);\n }\n }\n\n .button-more {\n gap: ${theme.base.spacing};\n flex-shrink: 0;\n white-space: nowrap;\n border: none;\n background: none !important;\n height: auto;\n width: auto;\n display: grid;\n padding: 2px;\n min-height: 18px;\n min-width: 18px;\n margin-right: 0;\n margin-inline-end: 0.125rem;\n color: var(--forground-color);\n :focus,\n :hover {\n box-shadow: ${theme.base.shadow.focus};\n }\n }\n }\n\n > .row-reorder-handle {\n padding: 0;\n }\n\n > .cell-fixed:last-child {\n border-right: var(--border-style);\n }\n\n > .row-select-handle {\n padding-inline-start: calc(var(--cell-padding) / 4);\n justify-content: center;\n }\n\n > .cell-right-align {\n padding: var(--header-cell-right-align-padding);\n justify-content: end;\n\n .header-lable-container {\n flex-direction: row-reverse;\n }\n\n .sort-info-container {\n margin-left: 0;\n margin-right: 0.312rem;\n }\n }\n\n > .cell-first {\n padding: 0 var(--cell-padding);\n }\n\n .row {\n border-bottom: none;\n }\n }\n\n /* 4 selectors required as aggregateCell of only footer need this effect */\n\n .pContainer:not(.pContainerScroll) .footer .aggregateCell.cell {\n border-bottom: none;\n }\n\n /* stylelint-enable selector-max-class */\n .row .cell.cell-last {\n border-right: 0;\n flex-grow: 1;\n }\n\n .row-container {\n --data-row-height: calc(\n var(--hit-area) * var(--row-height-multiplier) + var(--cell-vertical-padding)\n );\n --group-header-height: ${isAggregationApplied\n ? 'var(--default-group-header-height)'\n : 'var(--data-row-height)'};\n &:not(.full-content-height) > .row:not(.group-header-row) {\n height: var(--data-row-height);\n }\n border-end-start-radius: inherit;\n border-end-end-radius: inherit;\n\n & > .row .cell-content {\n /*\n * Using box sizing content-box so that the padding is not considered for the alignment of the cell content.\n * Vertical alignment is done using flex and max-height below even though the .cell-content might overflow due to padding + content size.\n */\n box-sizing: content-box;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n word-break: break-all;\n flex-grow: 1;\n\n /* Adding padding on .cell-content so that focus rings can appear properly and doesn't clip due to overflow: hidden */\n padding: var(--cell-vertical-padding) var(--cell-padding);\n\n /* setting max-height so that the elements with more height like RTL, align with the row density height */\n max-height: var(--data-row-height);\n\n /* hiding scroll bar in case the cell render introduces scrollbar based on its implementation */\n & * {\n scrollbar-width: none;\n }\n\n /* in case of combine columns, removing padding from parent cell-content as children already have the padding */\n &:has(.combined-cell) {\n padding: 0;\n\n /* stylelint-disable-next-line selector-max-class */\n .cell-content {\n flex-grow: unset;\n }\n }\n }\n }\n\n .row .aggregateCell .cell-content {\n line-height: initial;\n padding: 0;\n }\n\n .short-height,\n .medium-height {\n ${StyledStatus} {\n white-space: nowrap;\n }\n }\n\n .short-height {\n ${StyledRadioCheck} ${StyledLabel} {\n min-height: auto;\n }\n }\n\n .medium-height {\n --row-height-multiplier: 4 / 3;\n }\n\n .tall-height {\n --row-height-multiplier: calc(4 / 3 + 0.5);\n > .row:not(.group-header-row) {\n > .cell {\n display: inline-grid;\n align-items: start;\n white-space: normal;\n word-break: break-all;\n grid-auto-flow: column;\n\n :has(> :nth-child(n + 2)) {\n /* Adds space between if more than 1 item in cell container */\n justify-content: space-between;\n }\n\n /* stylelint-disable selector-max-class */\n /* stylelint-disable-next-line selector-max-compound-selectors */\n > .cell-content > .combined-cell > .combined-cell-content,\n > .cell-content {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n white-space: inherit;\n word-break: inherit;\n }\n\n ${CellIcon} {\n margin-block-start: 0.375rem;\n }\n }\n }\n }\n\n .full-content-height {\n --row-height-multiplier: 4 / 3;\n --row-min-height: calc(\n var(--hit-area) * var(--row-height-multiplier) + var(--cell-vertical-padding) * 2\n );\n --group-header-height: ${isAggregationApplied\n ? 'var(--default-group-header-height)'\n : 'var(--row-min-height)'};\n\n > .row:not(.group-header-row) {\n height: auto;\n min-height: var(--row-min-height);\n > .cell {\n white-space: normal;\n\n /* -- For BUG-625508 -- */\n word-break: break-word;\n display: inline-grid;\n align-items: start;\n padding-top: var(--cell-vertical-padding);\n padding-bottom: var(--cell-vertical-padding);\n grid-auto-flow: column;\n\n :has(> :nth-child(n + 2)) {\n /* Adds space between if more than 1 item in cell container */\n justify-content: space-between;\n }\n\n /* stylelint-disable-next-line selector-max-compound-selectors */\n > .cell-content > .combined-cell > .combined-cell-content,\n > .cell-content {\n /* for full-content, the row cells should adjust according to content */\n max-height: none;\n white-space: inherit;\n word-break: inherit;\n }\n\n ${CellIcon} {\n margin-block-start: 0.375rem;\n }\n }\n }\n }\n\n .footer {\n .row {\n .cell {\n padding: 0;\n }\n }\n }\n\n /* stylelint-disable no-duplicate-selectors */\n .row-container {\n position: absolute;\n display: grid;\n width: 100%;\n font-size: ${fontSize.s};\n\n > .group-header-row,\n .hierarchical-group-footer-row {\n height: var(--group-header-height);\n .cell {\n padding: 0;\n border-right-width: 0;\n }\n }\n\n > .hierarchical-group-header-row {\n height: var(--group-header-height);\n }\n input.checkbox-on-hover + label {\n opacity: 0;\n }\n input.checkbox-on-hover:checked + label {\n opacity: 1;\n }\n .row.selected-row {\n background-color: ${selectedRowColor};\n\n > .cell,\n .cell-fixed,\n .cell-action {\n background-color: ${selectedRowColor};\n }\n }\n .row-on-hover:hover {\n background-color: ${lightGreyColor};\n input.checkbox-on-hover + label {\n opacity: 1;\n }\n\n > .cell,\n .cell-fixed,\n .cell-action {\n background-color: ${lightGreyColor};\n }\n }\n .row.hierarchical-group-footer-row {\n .cell-fixed {\n background: ${lightGreyColor};\n }\n }\n }\n\n /* stylelint-enable selector-max-class */\n\n .toolbar-button-applied {\n padding: 0 8px;\n margin: 0 calc(${theme.base.spacing} / 4);\n }\n\n .toolbar-button {\n padding: 0 8px;\n margin: 0 calc(${theme.base.spacing} / 4);\n }\n\n .column-resizer {\n cursor: col-resize;\n position: absolute;\n top: 0;\n right: 0;\n z-index: 3;\n width: 0.25rem;\n height: 100%;\n }\n\n .column-resizer:hover,\n .column-resizer:active {\n background: var(--interactive);\n }\n\n .align-right {\n justify-content: right;\n\n .cell-content {\n text-align: right;\n }\n }\n\n .align-left {\n justify-content: left;\n\n .cell-content {\n text-align: left;\n }\n }\n\n .align-center {\n justify-content: center;\n\n .cell-content {\n text-align: center;\n }\n }\n\n .selection-border {\n border: 0.125rem solid var(--medium-blue) !important;\n }\n\n .disable-select {\n user-select: none; /* supported by Chrome and Firefox */\n -webkit-user-select: none; /* Safari */\n }\n\n .popper {\n div.row {\n display: flex;\n vertical-align: middle;\n line-height: unset;\n border-bottom: none;\n outline: none 0;\n height: auto;\n }\n }\n `;\n});\n\nexport default StyledTableContainer;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/lists-react",
|
|
3
|
-
"version": "8.0.0-build.
|
|
3
|
+
"version": "8.0.0-build.31.0",
|
|
4
4
|
"description": "Repeating view structures such as Table, Gallery(Repeating layouts), Kanban etc.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "Pegasystems",
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"build": "tsc -b tsconfig.build.json"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@pega/cosmos-react-condition-builder": "8.0.0-build.
|
|
18
|
-
"@pega/cosmos-react-core": "8.0.0-build.
|
|
19
|
-
"@pega/cosmos-react-rte": "8.0.0-build.
|
|
20
|
-
"@pega/cosmos-react-work": "8.0.0-build.
|
|
17
|
+
"@pega/cosmos-react-condition-builder": "8.0.0-build.31.0",
|
|
18
|
+
"@pega/cosmos-react-core": "8.0.0-build.31.0",
|
|
19
|
+
"@pega/cosmos-react-rte": "8.0.0-build.31.0",
|
|
20
|
+
"@pega/cosmos-react-work": "8.0.0-build.31.0",
|
|
21
21
|
"@types/lodash.get": "^4.4.9",
|
|
22
22
|
"@types/react": "^17.0.62 || ^18.3.3",
|
|
23
23
|
"@types/react-dom": "^17.0.20 || ^18.3.0",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"dayjs": "^1.11.10",
|
|
26
26
|
"fast-deep-equal": "^3.1.3",
|
|
27
27
|
"lodash.get": "^4.4.2",
|
|
28
|
-
"pega-repeating-structures-core": "npm:@pega/lists-core@8.0.0-build.
|
|
29
|
-
"pega-ui-list-data-apis": "npm:@pega/lists-core-utils@8.0.0-build.
|
|
28
|
+
"pega-repeating-structures-core": "npm:@pega/lists-core@8.0.0-build.31.0",
|
|
29
|
+
"pega-ui-list-data-apis": "npm:@pega/lists-core-utils@8.0.0-build.31.0",
|
|
30
30
|
"polished": "^4.1.0",
|
|
31
31
|
"prop-types": "^15.8.1",
|
|
32
32
|
"react": "^17.0.0 || ^18.0.0",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@testing-library/react": "^16.0.0",
|
|
46
46
|
"@testing-library/user-event": "^14.5.1",
|
|
47
47
|
"jest-axe": "^8.0.0",
|
|
48
|
-
"srs-utils": "8.0.0-build.
|
|
48
|
+
"srs-utils": "8.0.0-build.31.0",
|
|
49
49
|
"typescript": "~5.5.4"
|
|
50
50
|
}
|
|
51
51
|
}
|