@pega/lists-react 10.0.0-build.4.0 → 10.0.0-build.4.10
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/README.md +284 -83
- package/lib/Core/Components/Card/CardFieldValue.d.ts +8 -0
- package/lib/Core/Components/Card/CardFieldValue.d.ts.map +1 -0
- package/lib/Core/Components/Card/CardFieldValue.js +8 -0
- package/lib/Core/Components/Card/CardFieldValue.js.map +1 -0
- package/lib/Core/Components/Card/CardHeader.d.ts +8 -0
- package/lib/Core/Components/Card/CardHeader.d.ts.map +1 -0
- package/lib/Core/{Views/Gallery/Components/GalleryHeader.js → Components/Card/CardHeader.js} +4 -4
- package/lib/Core/Components/Card/CardHeader.js.map +1 -0
- package/lib/Core/{Views/Gallery/utils.d.ts → Components/Card/cardData.d.ts} +16 -14
- package/lib/Core/Components/Card/cardData.d.ts.map +1 -0
- package/lib/Core/{Views/Gallery/utils.js → Components/Card/cardData.js} +35 -50
- package/lib/Core/Components/Card/cardData.js.map +1 -0
- package/lib/Core/Components/Card/hooks/useRowActions.d.ts.map +1 -0
- package/lib/Core/Components/Card/hooks/useRowActions.js.map +1 -0
- package/lib/Core/Components/Card/index.d.ts +5 -0
- package/lib/Core/Components/Card/index.d.ts.map +1 -0
- package/lib/Core/Components/Card/index.js +5 -0
- package/lib/Core/Components/Card/index.js.map +1 -0
- package/lib/Core/Components/DefaultComponents/EmptyContainer.d.ts +2 -1
- package/lib/Core/Components/DefaultComponents/EmptyContainer.d.ts.map +1 -1
- package/lib/Core/Components/DefaultComponents/EmptyContainer.js +3 -3
- package/lib/Core/Components/DefaultComponents/EmptyContainer.js.map +1 -1
- package/lib/Core/Components/DefaultComponents/index.d.ts +2 -1
- package/lib/Core/Components/DefaultComponents/index.d.ts.map +1 -1
- package/lib/Core/Components/GroupRenderer/index.d.ts.map +1 -1
- package/lib/Core/Components/GroupRenderer/index.js +7 -2
- package/lib/Core/Components/GroupRenderer/index.js.map +1 -1
- package/lib/Core/Components/RSWrapper/index.d.ts.map +1 -1
- package/lib/Core/Components/RSWrapper/index.js +4 -0
- package/lib/Core/Components/RSWrapper/index.js.map +1 -1
- package/lib/Core/Components/Toolbar/utils/utils.d.ts.map +1 -1
- package/lib/Core/Components/Toolbar/utils/utils.js +10 -4
- package/lib/Core/Components/Toolbar/utils/utils.js.map +1 -1
- package/lib/Core/Views/Gallery/Components/GalleryCard.d.ts.map +1 -1
- package/lib/Core/Views/Gallery/Components/GalleryCard.js +3 -3
- package/lib/Core/Views/Gallery/Components/GalleryCard.js.map +1 -1
- package/lib/Core/Views/Gallery/Components/GalleryCheckboxCard.d.ts.map +1 -1
- package/lib/Core/Views/Gallery/Components/GalleryCheckboxCard.js +3 -3
- package/lib/Core/Views/Gallery/Components/GalleryCheckboxCard.js.map +1 -1
- package/lib/Core/Views/Gallery/GalleryContainer.d.ts.map +1 -1
- package/lib/Core/Views/Gallery/GalleryContainer.js +1 -1
- package/lib/Core/Views/Gallery/GalleryContainer.js.map +1 -1
- package/lib/Core/Views/Gallery/index.d.ts.map +1 -1
- package/lib/Core/Views/Gallery/index.js +3 -1
- package/lib/Core/Views/Gallery/index.js.map +1 -1
- package/lib/Core/Views/Kanban/Kanban.styles.d.ts +13 -0
- package/lib/Core/Views/Kanban/Kanban.styles.d.ts.map +1 -0
- package/lib/Core/Views/Kanban/Kanban.styles.js +47 -0
- package/lib/Core/Views/Kanban/Kanban.styles.js.map +1 -0
- package/lib/Core/Views/Kanban/Kanban.types.d.ts +8 -0
- package/lib/Core/Views/Kanban/Kanban.types.d.ts.map +1 -0
- package/lib/Core/Views/Kanban/Kanban.types.js +2 -0
- package/lib/Core/Views/Kanban/Kanban.types.js.map +1 -0
- package/lib/Core/Views/Kanban/KanbanCard.d.ts +4 -0
- package/lib/Core/Views/Kanban/KanbanCard.d.ts.map +1 -0
- package/lib/Core/Views/Kanban/KanbanCard.js +19 -0
- package/lib/Core/Views/Kanban/KanbanCard.js.map +1 -0
- package/lib/Core/Views/Kanban/KanbanLane.d.ts +20 -0
- package/lib/Core/Views/Kanban/KanbanLane.d.ts.map +1 -0
- package/lib/Core/Views/Kanban/KanbanLane.js +23 -0
- package/lib/Core/Views/Kanban/KanbanLane.js.map +1 -0
- package/lib/Core/Views/Kanban/KanbanLaneHeader.d.ts +11 -0
- package/lib/Core/Views/Kanban/KanbanLaneHeader.d.ts.map +1 -0
- package/lib/Core/Views/Kanban/KanbanLaneHeader.js +15 -0
- package/lib/Core/Views/Kanban/KanbanLaneHeader.js.map +1 -0
- package/lib/Core/Views/Kanban/index.d.ts +9 -0
- package/lib/Core/Views/Kanban/index.d.ts.map +1 -0
- package/lib/Core/Views/Kanban/index.js +63 -0
- package/lib/Core/Views/Kanban/index.js.map +1 -0
- package/lib/Core/templateFeatureSupport.js +2 -2
- package/lib/Core/templateFeatureSupport.js.map +1 -1
- package/package.json +8 -8
- package/lib/Core/Views/Gallery/Components/GalleryFieldValue.d.ts +0 -8
- package/lib/Core/Views/Gallery/Components/GalleryFieldValue.d.ts.map +0 -1
- package/lib/Core/Views/Gallery/Components/GalleryFieldValue.js +0 -8
- package/lib/Core/Views/Gallery/Components/GalleryFieldValue.js.map +0 -1
- package/lib/Core/Views/Gallery/Components/GalleryHeader.d.ts +0 -8
- package/lib/Core/Views/Gallery/Components/GalleryHeader.d.ts.map +0 -1
- package/lib/Core/Views/Gallery/Components/GalleryHeader.js.map +0 -1
- package/lib/Core/Views/Gallery/hooks/useRowActions.d.ts.map +0 -1
- package/lib/Core/Views/Gallery/hooks/useRowActions.js.map +0 -1
- package/lib/Core/Views/Gallery/utils.d.ts.map +0 -1
- package/lib/Core/Views/Gallery/utils.js.map +0 -1
- /package/lib/Core/{Views/Gallery → Components/Card}/hooks/useRowActions.d.ts +0 -0
- /package/lib/Core/{Views/Gallery → Components/Card}/hooks/useRowActions.js +0 -0
package/lib/Core/{Views/Gallery/Components/GalleryHeader.js → Components/Card/CardHeader.js}
RENAMED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
-
import RenderingEngine from '
|
|
3
|
+
import RenderingEngine from '../RenderingEngine/RenderCell';
|
|
4
4
|
const StyledHeaderContainer = styled.div `
|
|
5
5
|
word-break: break-word;
|
|
6
6
|
`;
|
|
7
|
-
function
|
|
7
|
+
function CardHeader({ headerColumn, row }) {
|
|
8
8
|
if (!headerColumn) {
|
|
9
9
|
return null;
|
|
10
10
|
}
|
|
11
11
|
headerColumn?.setExecutionContext(row);
|
|
12
12
|
return (_jsx(StyledHeaderContainer, { children: _jsx(RenderingEngine, { ...headerColumn.getRenderingEngineProps() }) }));
|
|
13
13
|
}
|
|
14
|
-
export default
|
|
15
|
-
//# sourceMappingURL=
|
|
14
|
+
export default CardHeader;
|
|
15
|
+
//# sourceMappingURL=CardHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CardHeader.js","sourceRoot":"","sources":["../../../../Core/Components/Card/CardHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAIvC,OAAO,eAAe,MAAM,+BAA+B,CAAC;AAO5D,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAAA;;CAEvC,CAAC;AAEF,SAAS,UAAU,CAAC,EAAE,YAAY,EAAE,GAAG,EAAmB;IACxD,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,YAAY,EAAE,mBAAmB,CAAC,GAAG,CAAC,CAAC;IAEvC,OAAO,CACL,KAAC,qBAAqB,cACpB,KAAC,eAAe,OAAK,YAAY,CAAC,uBAAuB,EAAE,GAAI,GACzC,CACzB,CAAC;AACJ,CAAC;AAED,eAAe,UAAU,CAAC","sourcesContent":["import styled from 'styled-components';\n\nimport type { RsCoreTypes } from 'pega-repeating-structures-core';\n\nimport RenderingEngine from '../RenderingEngine/RenderCell';\n\ntype CardHeaderProps = {\n headerColumn?: RsCoreTypes.Column;\n row: RsCoreTypes.Row;\n};\n\nconst StyledHeaderContainer = styled.div`\n word-break: break-word;\n`;\n\nfunction CardHeader({ headerColumn, row }: CardHeaderProps) {\n if (!headerColumn) {\n return null;\n }\n\n headerColumn?.setExecutionContext(row);\n\n return (\n <StyledHeaderContainer>\n <RenderingEngine {...headerColumn.getRenderingEngineProps()} />\n </StyledHeaderContainer>\n );\n}\n\nexport default CardHeader;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type RsCoreTypes } from 'pega-repeating-structures-core';
|
|
2
|
+
import type { CardConfig } from 'pega-repeating-structures-core/types/Meta.types';
|
|
2
3
|
import type { ImageSize, SelectionCardDisplayProps } from '@pega/cosmos-react-core';
|
|
3
|
-
import type { GalleryCardProps } from './Gallery.types';
|
|
4
4
|
export declare const GALLERY_IMAGE_PLACEMENT_MAP: {
|
|
5
5
|
readonly left: "inline-start";
|
|
6
6
|
readonly right: "inline-end";
|
|
@@ -9,18 +9,6 @@ export declare const GALLERY_IMAGE_PLACEMENT_MAP: {
|
|
|
9
9
|
export declare const DEFAULT_IMAGE_PLACEMENT: RsCoreTypes.HeroImagePlacement;
|
|
10
10
|
export declare const DEFAULT_IMAGE_SIZE: ImageSize;
|
|
11
11
|
export declare const isInlinePlacement: (placement: RsCoreTypes.HeroImagePlacement) => placement is Extract<RsCoreTypes.HeroImagePlacement, "left" | "right">;
|
|
12
|
-
/**
|
|
13
|
-
* Generates the data required to display a card in the gallery view.
|
|
14
|
-
*
|
|
15
|
-
* @param props - The properties required to generate the card data.
|
|
16
|
-
* @param props.row - The data for the current row.
|
|
17
|
-
* @param props.visibleColumns - The columns that are visible in the gallery.
|
|
18
|
-
* @param props.meta - Metadata including gallery configuration.
|
|
19
|
-
* @param props.headerColumn - The column used for the card header.
|
|
20
|
-
* @param props.actionColumn - The column used for card actions.
|
|
21
|
-
* @returns An object containing the card's label, image, footer, and fields to be displayed.
|
|
22
|
-
*/
|
|
23
|
-
export declare function getCardData({ row, visibleColumns, meta, headerColumn }: GalleryCardProps): Pick<SelectionCardDisplayProps, 'label' | 'image' | 'fields' | 'aria-label' | 'footer'>;
|
|
24
12
|
/**
|
|
25
13
|
* Extracts UI-related props from a row for card components.
|
|
26
14
|
*
|
|
@@ -33,4 +21,18 @@ export declare function getCardUIProps({ row }: {
|
|
|
33
21
|
}): {
|
|
34
22
|
'data-key': string;
|
|
35
23
|
};
|
|
36
|
-
|
|
24
|
+
interface CardDataProps {
|
|
25
|
+
row: RsCoreTypes.Row;
|
|
26
|
+
visibleColumns: RsCoreTypes.Column[];
|
|
27
|
+
cardConfig?: Pick<CardConfig, 'heroImage' | 'tile' | 'showFieldLabels' | 'renderCardFooter'>;
|
|
28
|
+
headerColumn?: RsCoreTypes.Column;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Generates SelectionCardDisplay data from card content configuration.
|
|
32
|
+
*
|
|
33
|
+
* @param props - Card data dependencies.
|
|
34
|
+
* @returns Data used to render a selection card.
|
|
35
|
+
*/
|
|
36
|
+
export declare function getCardData({ row, visibleColumns, cardConfig, headerColumn }: CardDataProps): Pick<SelectionCardDisplayProps, 'label' | 'image' | 'fields' | 'aria-label' | 'footer'>;
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=cardData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cardData.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Card/cardData.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iDAAiD,CAAC;AAClF,OAAO,KAAK,EAAkB,SAAS,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAKpG,eAAO,MAAM,2BAA2B;;;;CAImC,CAAC;AAG5E,eAAO,MAAM,uBAAuB,EAAE,WAAW,CAAC,kBAA2B,CAAC;AAC9E,eAAO,MAAM,kBAAkB,EAAE,SAAsB,CAAC;AAExD,eAAO,MAAM,iBAAiB,GAC5B,WAAW,WAAW,CAAC,kBAAkB,KACxC,SAAS,IAAI,OAAO,CAAC,WAAW,CAAC,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAEvE,CAAC;AA+BF;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,EAAE,GAAG,EAAE,EAAE;IAAE,GAAG,EAAE,WAAW,CAAC,GAAG,CAAA;CAAE;;EAK/D;AAED,UAAU,aAAa;IACrB,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC;IACrB,cAAc,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC;IACrC,UAAU,CAAC,EAAE,IAAI,CAAC,UAAU,EAAE,WAAW,GAAG,MAAM,GAAG,iBAAiB,GAAG,kBAAkB,CAAC,CAAC;IAC7F,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC;CACnC;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,EAC1B,GAAG,EACH,cAAc,EACd,UAAU,EACV,YAAY,EACb,EAAE,aAAa,GAAG,IAAI,CACrB,yBAAyB,EACzB,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,YAAY,GAAG,QAAQ,CACvD,CAgEA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { isEmpty } from 'pega-repeating-structures-core';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import CardFieldValue from './CardFieldValue';
|
|
4
|
+
import CardHeader from './CardHeader';
|
|
5
5
|
export const GALLERY_IMAGE_PLACEMENT_MAP = {
|
|
6
6
|
left: 'inline-start',
|
|
7
7
|
right: 'inline-end',
|
|
@@ -14,18 +14,10 @@ export const isInlinePlacement = (placement) => {
|
|
|
14
14
|
return INLINE_PLACEMENTS.includes(placement);
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
|
-
* Extracts image data from
|
|
18
|
-
*
|
|
19
|
-
* @param meta - The metadata object containing gallery configuration.
|
|
20
|
-
* @param row - The row object providing context and data values.
|
|
21
|
-
* @returns An object containing:
|
|
22
|
-
* - `src`: The image source URL.
|
|
23
|
-
* - `alt`: The alternative text for the image.
|
|
24
|
-
* - `placement`: The placement of the image within the gallery.
|
|
25
|
-
* - `size`: The size of the image.
|
|
17
|
+
* Extracts image data from a HeroImage config and row context.
|
|
26
18
|
*/
|
|
27
|
-
function
|
|
28
|
-
const {
|
|
19
|
+
function getHeroImageData(heroImage, row) {
|
|
20
|
+
const { source, altText, placement, size } = heroImage;
|
|
29
21
|
const rowData = row.getContext().getValue();
|
|
30
22
|
let altTextValue = '';
|
|
31
23
|
if (altText && 'field' in altText) {
|
|
@@ -40,33 +32,39 @@ function getImageData(meta, row) {
|
|
|
40
32
|
return { src: imageUrl, alt: altTextValue, placement: imagePlacement, size: imageSize };
|
|
41
33
|
}
|
|
42
34
|
/**
|
|
43
|
-
*
|
|
35
|
+
* Extracts UI-related props from a row for card components.
|
|
36
|
+
*
|
|
37
|
+
* @param props - The properties containing the row.
|
|
38
|
+
* @param props.row - The data row.
|
|
39
|
+
* @returns An object containing card-safe row metadata.
|
|
40
|
+
*/
|
|
41
|
+
export function getCardUIProps({ row }) {
|
|
42
|
+
const uiProps = row.getUIProps();
|
|
43
|
+
return {
|
|
44
|
+
'data-key': uiProps['data-key']
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Generates SelectionCardDisplay data from card content configuration.
|
|
44
49
|
*
|
|
45
|
-
* @param props -
|
|
46
|
-
* @
|
|
47
|
-
* @param props.visibleColumns - The columns that are visible in the gallery.
|
|
48
|
-
* @param props.meta - Metadata including gallery configuration.
|
|
49
|
-
* @param props.headerColumn - The column used for the card header.
|
|
50
|
-
* @param props.actionColumn - The column used for card actions.
|
|
51
|
-
* @returns An object containing the card's label, image, footer, and fields to be displayed.
|
|
50
|
+
* @param props - Card data dependencies.
|
|
51
|
+
* @returns Data used to render a selection card.
|
|
52
52
|
*/
|
|
53
|
-
export function getCardData({ row, visibleColumns,
|
|
54
|
-
const {
|
|
55
|
-
// Must set execution context for each column to ensure correct value retrieval
|
|
53
|
+
export function getCardData({ row, visibleColumns, cardConfig, headerColumn }) {
|
|
54
|
+
const { heroImage, tile: tileConfig, showFieldLabels = true, renderCardFooter } = cardConfig ?? {};
|
|
56
55
|
visibleColumns.forEach(col => col.setExecutionContext(row));
|
|
57
56
|
const rowData = row.getContext().getValue();
|
|
58
57
|
const fields = visibleColumns.map(col => ({
|
|
59
58
|
id: col.field.id,
|
|
60
59
|
...(showFieldLabels && { name: col.getContext()?.getLabel() }),
|
|
61
60
|
...(col.field.layoutMode && { variant: col.field.layoutMode }),
|
|
62
|
-
// TODO: Add truncation for non-tile cards once `truncate` is typed at
|
|
63
|
-
// the field-level API.
|
|
64
61
|
...(!heroImage && tileConfig
|
|
65
62
|
? { value: String(rowData[col.field.id] ?? ''), truncate: true }
|
|
66
|
-
: { value: _jsx(
|
|
63
|
+
: { value: _jsx(CardFieldValue, { column: col, row: row }) })
|
|
67
64
|
}));
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
let image = heroImage
|
|
66
|
+
? getHeroImageData(heroImage, row)
|
|
67
|
+
: undefined;
|
|
70
68
|
if (!heroImage && tileConfig) {
|
|
71
69
|
const foregroundColor = tileConfig.foregroundColor.field in rowData
|
|
72
70
|
? String(rowData[tileConfig.foregroundColor.field])
|
|
@@ -81,10 +79,7 @@ export function getCardData({ row, visibleColumns, meta, headerColumn }) {
|
|
|
81
79
|
const tileText = tileConfig.text && tileConfig.text.field in rowData
|
|
82
80
|
? String(rowData[tileConfig.text.field]) || undefined
|
|
83
81
|
: undefined;
|
|
84
|
-
const tileBase = {
|
|
85
|
-
foregroundColor,
|
|
86
|
-
backgroundColor
|
|
87
|
-
};
|
|
82
|
+
const tileBase = { foregroundColor, backgroundColor };
|
|
88
83
|
if (tileName) {
|
|
89
84
|
image = { ...tileBase, icon: tileName };
|
|
90
85
|
}
|
|
@@ -93,23 +88,13 @@ export function getCardData({ row, visibleColumns, meta, headerColumn }) {
|
|
|
93
88
|
}
|
|
94
89
|
}
|
|
95
90
|
}
|
|
96
|
-
const footer =
|
|
97
|
-
const label = _jsx(
|
|
91
|
+
const footer = renderCardFooter?.(rowData) ?? null;
|
|
92
|
+
const label = _jsx(CardHeader, { headerColumn: headerColumn, row: row });
|
|
98
93
|
const headerValue = row.getContext()?.getRowHeader()?.getValue();
|
|
99
|
-
|
|
94
|
+
let ariaLabel;
|
|
95
|
+
if (!headerColumn && !isEmpty(headerValue)) {
|
|
96
|
+
ariaLabel = String(headerValue);
|
|
97
|
+
}
|
|
100
98
|
return { fields, image, footer, label, 'aria-label': ariaLabel };
|
|
101
99
|
}
|
|
102
|
-
|
|
103
|
-
* Extracts UI-related props from a row for card components.
|
|
104
|
-
*
|
|
105
|
-
* @param props - The properties containing the row.
|
|
106
|
-
* @param props.row - The data row.
|
|
107
|
-
* @returns An object containing card-safe row metadata.
|
|
108
|
-
*/
|
|
109
|
-
export function getCardUIProps({ row }) {
|
|
110
|
-
const uiProps = row.getUIProps();
|
|
111
|
-
return {
|
|
112
|
-
'data-key': uiProps['data-key']
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
//# sourceMappingURL=utils.js.map
|
|
100
|
+
//# sourceMappingURL=cardData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cardData.js","sourceRoot":"","sources":["../../../../Core/Components/Card/cardData.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAoB,MAAM,gCAAgC,CAAC;AAI3E,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,YAAY;IACnB,GAAG,EAAE,aAAa;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D,IAAI,QAAQ,EAAE,CAAC;gBACb,KAAK,GAAG,EAAE,GAAG,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;YAC1C,CAAC;iBAAM,IAAI,QAAQ,EAAE,CAAC;gBACpB,KAAK,GAAG,EAAE,GAAG,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;YAC1C,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM,MAAM,GAAG,gBAAgB,EAAE,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC;IACnD,MAAM,KAAK,GAAG,KAAC,UAAU,IAAC,YAAY,EAAE,YAAY,EAAE,GAAG,EAAE,GAAG,GAAI,CAAC;IACnE,MAAM,WAAW,GAAG,GAAG,CAAC,UAAU,EAAE,EAAE,YAAY,EAAE,EAAE,QAAQ,EAAE,CAAC;IACjE,IAAI,SAA6B,CAAC;IAClC,IAAI,CAAC,YAAY,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;QAC3C,SAAS,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;IAClC,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC;AACnE,CAAC","sourcesContent":["import { isEmpty, type RsCoreTypes } from 'pega-repeating-structures-core';\nimport type { CardConfig } from 'pega-repeating-structures-core/types/Meta.types';\nimport type { ImagePlacement, ImageSize, SelectionCardDisplayProps } from '@pega/cosmos-react-core';\n\nimport CardFieldValue from './CardFieldValue';\nimport CardHeader from './CardHeader';\n\nexport const GALLERY_IMAGE_PLACEMENT_MAP = {\n left: 'inline-start',\n right: 'inline-end',\n top: 'block-start'\n} as const satisfies Record<RsCoreTypes.HeroImagePlacement, ImagePlacement>;\n\nconst INLINE_PLACEMENTS: RsCoreTypes.HeroImagePlacement[] = ['left', 'right'] as const;\nexport const DEFAULT_IMAGE_PLACEMENT: RsCoreTypes.HeroImagePlacement = 'left';\nexport const DEFAULT_IMAGE_SIZE: ImageSize = 'flexible';\n\nexport const isInlinePlacement = (\n placement: RsCoreTypes.HeroImagePlacement\n): placement is Extract<RsCoreTypes.HeroImagePlacement, 'left' | 'right'> => {\n return INLINE_PLACEMENTS.includes(placement);\n};\n\n/**\n * Extracts image data from a HeroImage config and row context.\n */\nfunction getHeroImageData(\n heroImage: RsCoreTypes.HeroImage,\n row: RsCoreTypes.Row\n): {\n src: string;\n alt: string;\n placement: ImagePlacement;\n size: ImageSize;\n} {\n const { source, altText, placement, size } = heroImage;\n const rowData = row.getContext().getValue();\n\n let altTextValue = '';\n if (altText && 'field' in altText) {\n altTextValue = altText.field in rowData ? String(rowData[altText.field]) : '';\n } else if (altText && 'value' in altText) {\n altTextValue = altText.value;\n }\n\n const imageUrl = source?.field && source?.field in rowData ? String(rowData[source.field]) : '';\n const imagePlacement = GALLERY_IMAGE_PLACEMENT_MAP[placement ?? DEFAULT_IMAGE_PLACEMENT];\n const imageSize = size || DEFAULT_IMAGE_SIZE;\n\n return { src: imageUrl, alt: altTextValue, placement: imagePlacement, size: imageSize };\n}\n\n/**\n * Extracts UI-related props from a row for card components.\n *\n * @param props - The properties containing the row.\n * @param props.row - The data row.\n * @returns An object containing card-safe row metadata.\n */\nexport function getCardUIProps({ row }: { row: RsCoreTypes.Row }) {\n const uiProps = row.getUIProps();\n return {\n 'data-key': uiProps['data-key']\n };\n}\n\ninterface CardDataProps {\n row: RsCoreTypes.Row;\n visibleColumns: RsCoreTypes.Column[];\n cardConfig?: Pick<CardConfig, 'heroImage' | 'tile' | 'showFieldLabels' | 'renderCardFooter'>;\n headerColumn?: RsCoreTypes.Column;\n}\n\n/**\n * Generates SelectionCardDisplay data from card content configuration.\n *\n * @param props - Card data dependencies.\n * @returns Data used to render a selection card.\n */\nexport function getCardData({\n row,\n visibleColumns,\n cardConfig,\n headerColumn\n}: CardDataProps): Pick<\n SelectionCardDisplayProps,\n 'label' | 'image' | 'fields' | 'aria-label' | 'footer'\n> {\n const {\n heroImage,\n tile: tileConfig,\n showFieldLabels = true,\n renderCardFooter\n } = cardConfig ?? {};\n\n visibleColumns.forEach(col => col.setExecutionContext(row));\n\n const rowData = row.getContext().getValue();\n\n const fields = visibleColumns.map(col => ({\n id: col.field.id,\n ...(showFieldLabels && { name: col.getContext()?.getLabel() }),\n ...(col.field.layoutMode && { variant: col.field.layoutMode }),\n ...(!heroImage && tileConfig\n ? { value: String(rowData[col.field.id] ?? ''), truncate: true }\n : { value: <CardFieldValue column={col} row={row} /> })\n }));\n\n let image: SelectionCardDisplayProps['image'] = heroImage\n ? getHeroImageData(heroImage, row)\n : undefined;\n\n if (!heroImage && tileConfig) {\n const foregroundColor =\n tileConfig.foregroundColor.field in rowData\n ? String(rowData[tileConfig.foregroundColor.field])\n : undefined;\n const backgroundColor =\n tileConfig.backgroundColor.field in rowData\n ? String(rowData[tileConfig.backgroundColor.field])\n : undefined;\n\n if (foregroundColor && backgroundColor) {\n const tileName =\n tileConfig.iconName && tileConfig.iconName.field in rowData\n ? String(rowData[tileConfig.iconName.field]) || undefined\n : undefined;\n const tileText =\n tileConfig.text && tileConfig.text.field in rowData\n ? String(rowData[tileConfig.text.field]) || undefined\n : undefined;\n\n const tileBase = { foregroundColor, backgroundColor };\n\n if (tileName) {\n image = { ...tileBase, icon: tileName };\n } else if (tileText) {\n image = { ...tileBase, text: tileText };\n }\n }\n }\n\n const footer = renderCardFooter?.(rowData) ?? null;\n const label = <CardHeader headerColumn={headerColumn} row={row} />;\n const headerValue = row.getContext()?.getRowHeader()?.getValue();\n let ariaLabel: string | undefined;\n if (!headerColumn && !isEmpty(headerValue)) {\n ariaLabel = String(headerValue);\n }\n\n return { fields, image, footer, label, 'aria-label': ariaLabel };\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRowActions.d.ts","sourceRoot":"","sources":["../../../../../Core/Components/Card/hooks/useRowActions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,W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C,QAAQ,EAAE,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;YAC/D,CAAC;SACF,CAAC,CAAC,CAAC;IACN,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IAE3B,OAAO,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC;AAClE,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { useCallback } from 'react';\n\nimport type { RsCoreTypes } from 'pega-repeating-structures-core';\nimport type { Action } from '@pega/cosmos-react-core';\n\ninterface UseRowActionsProps {\n row: RsCoreTypes.Row;\n meta: RsCoreTypes.Meta;\n}\n\nconst useRowActions = ({\n row,\n meta\n}: UseRowActionsProps): (() => Promise<Action[]>) | undefined => {\n const fetchActions = useCallback(async (): Promise<Action[]> => {\n const rowContext = row.getContext();\n let allActions = meta.rowActions ?? [];\n\n try {\n const dynamicActions = await rowContext.getRowActionDetails(rowContext.getValue());\n if (Array.isArray(dynamicActions)) {\n allActions = [...dynamicActions, ...allActions];\n }\n } catch (error) {\n // On error, fall back to static actions only\n }\n\n return allActions.map(action => ({\n ...action,\n onClick: () => {\n action.onClick(rowContext.getValue(), rowContext.refreshRow);\n }\n }));\n }, [row, meta.rowActions]);\n\n return meta.editing || meta.deleting ? fetchActions : undefined;\n};\n\nexport default useRowActions;\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as CardHeader } from './CardHeader';
|
|
2
|
+
export { default as CardFieldValue } from './CardFieldValue';
|
|
3
|
+
export { default as useRowActions } from './hooks/useRowActions';
|
|
4
|
+
export { getCardUIProps, getCardData, GALLERY_IMAGE_PLACEMENT_MAP, DEFAULT_IMAGE_PLACEMENT, DEFAULT_IMAGE_SIZE, isInlinePlacement } from './cardData';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../Core/Components/Card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EACL,cAAc,EACd,WAAW,EACX,2BAA2B,EAC3B,uBAAuB,EACvB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as CardHeader } from './CardHeader';
|
|
2
|
+
export { default as CardFieldValue } from './CardFieldValue';
|
|
3
|
+
export { default as useRowActions } from './hooks/useRowActions';
|
|
4
|
+
export { getCardUIProps, getCardData, GALLERY_IMAGE_PLACEMENT_MAP, DEFAULT_IMAGE_PLACEMENT, DEFAULT_IMAGE_SIZE, isInlinePlacement } from './cardData';
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../Core/Components/Card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EACL,cAAc,EACd,WAAW,EACX,2BAA2B,EAC3B,uBAAuB,EACvB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,YAAY,CAAC","sourcesContent":["export { default as CardHeader } from './CardHeader';\nexport { default as CardFieldValue } from './CardFieldValue';\nexport { default as useRowActions } from './hooks/useRowActions';\nexport {\n getCardUIProps,\n getCardData,\n GALLERY_IMAGE_PLACEMENT_MAP,\n DEFAULT_IMAGE_PLACEMENT,\n DEFAULT_IMAGE_SIZE,\n isInlinePlacement\n} from './cardData';\n"]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export default EmptyContainer;
|
|
2
|
-
declare function EmptyContainer({ message, shouldAnnounce, domContainer }: {
|
|
2
|
+
declare function EmptyContainer({ message, shouldAnnounce, domContainer, transparent }: {
|
|
3
3
|
message: any;
|
|
4
4
|
shouldAnnounce: any;
|
|
5
5
|
domContainer: any;
|
|
6
|
+
transparent?: boolean | undefined;
|
|
6
7
|
}): import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
//# sourceMappingURL=EmptyContainer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyContainer.d.ts","sourceRoot":"","sources":["../../../../Core/Components/DefaultComponents/EmptyContainer.jsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"EmptyContainer.d.ts","sourceRoot":"","sources":["../../../../Core/Components/DefaultComponents/EmptyContainer.jsx"],"names":[],"mappings":";AAwBA;;;;;4CAsBC"}
|
|
@@ -13,11 +13,11 @@ const EmptyContainerStyle = styled.div `
|
|
|
13
13
|
left: 0;
|
|
14
14
|
right: 0;
|
|
15
15
|
bottom: 0;
|
|
16
|
-
background: ${
|
|
16
|
+
background: ${({ theme, $transparent }) => $transparent ? 'transparent' : theme.base.palette['primary-background']};
|
|
17
17
|
overflow: hidden;
|
|
18
18
|
`;
|
|
19
19
|
EmptyContainerStyle.defaultProps = defaultThemeProp;
|
|
20
|
-
const EmptyContainer = ({ message, shouldAnnounce, domContainer }) => {
|
|
20
|
+
const EmptyContainer = ({ message, shouldAnnounce, domContainer, transparent = false }) => {
|
|
21
21
|
const { announcePolite } = useLiveLog();
|
|
22
22
|
useEffect(() => {
|
|
23
23
|
if (shouldAnnounce &&
|
|
@@ -26,7 +26,7 @@ const EmptyContainer = ({ message, shouldAnnounce, domContainer }) => {
|
|
|
26
26
|
announcePolite({ message });
|
|
27
27
|
}
|
|
28
28
|
}, [shouldAnnounce, message, announcePolite, domContainer]);
|
|
29
|
-
return (_jsx(EmptyContainerStyle, { "data-test-id": TestIdConstants.noRecords, "data-testid": TestIdConstants.noRecords, children: _jsx(EmptyState, { message: message }) }));
|
|
29
|
+
return (_jsx(EmptyContainerStyle, { "$transparent": transparent, "data-test-id": TestIdConstants.noRecords, "data-testid": TestIdConstants.noRecords, children: _jsx(EmptyState, { message: message }) }));
|
|
30
30
|
};
|
|
31
31
|
export default EmptyContainer;
|
|
32
32
|
//# sourceMappingURL=EmptyContainer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyContainer.js","sourceRoot":"","sources":["../../../../Core/Components/DefaultComponents/EmptyContainer.jsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAEnF,OAAO,eAAe,MAAM,oBAAoB,CAAC;AAEjD,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;gBAUtB,KAAK,
|
|
1
|
+
{"version":3,"file":"EmptyContainer.js","sourceRoot":"","sources":["../../../../Core/Components/DefaultComponents/EmptyContainer.jsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAEnF,OAAO,eAAe,MAAM,oBAAoB,CAAC;AAEjD,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;gBAUtB,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE,EAAE,CACxC,YAAY,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,CAAC;;CAE1E,CAAC;AAEF,mBAAmB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEpD,MAAM,cAAc,GAAG,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,WAAW,GAAG,KAAK,EAAE,EAAE,EAAE;IACxF,MAAM,EAAE,cAAc,EAAE,GAAG,UAAU,EAAE,CAAC;IAExC,SAAS,CAAC,GAAG,EAAE;QACb,IACE,cAAc;YACd,OAAO,QAAQ,KAAK,WAAW;YAC/B,YAAY,EAAE,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC,EAC9C,CAAC;YACD,cAAc,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC,EAAE,CAAC,cAAc,EAAE,OAAO,EAAE,cAAc,EAAE,YAAY,CAAC,CAAC,CAAC;IAE5D,OAAO,CACL,KAAC,mBAAmB,oBACJ,WAAW,kBACX,eAAe,CAAC,SAAS,iBAC1B,eAAe,CAAC,SAAS,YAEtC,KAAC,UAAU,IAAC,OAAO,EAAE,OAAO,GAAI,GACZ,CACvB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import styled from 'styled-components';\nimport { useEffect } from 'react';\n\nimport { defaultThemeProp, EmptyState, useLiveLog } from '@pega/cosmos-react-core';\n\nimport TestIdConstants from '../TestIdConstants';\n\nconst EmptyContainerStyle = styled.div`\n position: absolute;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n top: var(--row-height, 0);\n left: 0;\n right: 0;\n bottom: 0;\n background: ${({ theme, $transparent }) =>\n $transparent ? 'transparent' : theme.base.palette['primary-background']};\n overflow: hidden;\n`;\n\nEmptyContainerStyle.defaultProps = defaultThemeProp;\n\nconst EmptyContainer = ({ message, shouldAnnounce, domContainer, transparent = false }) => {\n const { announcePolite } = useLiveLog();\n\n useEffect(() => {\n if (\n shouldAnnounce &&\n typeof document !== 'undefined' &&\n domContainer?.contains(document.activeElement)\n ) {\n announcePolite({ message });\n }\n }, [shouldAnnounce, message, announcePolite, domContainer]);\n\n return (\n <EmptyContainerStyle\n $transparent={transparent}\n data-test-id={TestIdConstants.noRecords}\n data-testid={TestIdConstants.noRecords}\n >\n <EmptyState message={message} />\n </EmptyContainerStyle>\n );\n};\n\nexport default EmptyContainer;\n"]}
|
|
@@ -63,10 +63,11 @@ declare const _default: {
|
|
|
63
63
|
sortRenderer: typeof sort;
|
|
64
64
|
filterRenderer: typeof Filter;
|
|
65
65
|
headerCellRenderer: typeof HeaderCell;
|
|
66
|
-
emptyContainerRenderer: ({ message, shouldAnnounce, domContainer }: {
|
|
66
|
+
emptyContainerRenderer: ({ message, shouldAnnounce, domContainer, transparent }: {
|
|
67
67
|
message: any;
|
|
68
68
|
shouldAnnounce: any;
|
|
69
69
|
domContainer: any;
|
|
70
|
+
transparent?: boolean | undefined;
|
|
70
71
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
71
72
|
loadingIndicator: typeof LoadingIndicator;
|
|
72
73
|
rowHeightRenderer: typeof RowHeightRenderer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../Core/Components/DefaultComponents/index.jsx"],"names":[],"mappings":"AA4BA,uGAKC;;;;;;;;;;AAUD,mGASC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../Core/Components/DefaultComponents/index.jsx"],"names":[],"mappings":"AA4BA,uGAKC;;;;;;;;;;AAUD,mGASC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBApDqB,YAAY;iBAEjB,QAAQ;mBACN,UAAU;uBAEN,cAAc;6BAER,oBAAoB;8BACnB,aAAa;4CAEC,2BAA2B;8CACzB,6BAA6B;8BAC7C,qBAAqB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../Core/Components/GroupRenderer/index.jsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../Core/Components/GroupRenderer/index.jsx"],"names":[],"mappings":"AA+RA;;;;;;QAwCC;AA8GD;;;mDAoJC;;;;;;;;;;sBAzkBqB,YAAY"}
|
|
@@ -224,6 +224,11 @@ const StyledMetaList = styled(MetaList) `
|
|
|
224
224
|
const GroupAdditionalInfoSeparator = styled.span `
|
|
225
225
|
margin-inline-start: 0.3rem;
|
|
226
226
|
`;
|
|
227
|
+
const StyledGroupName = styled.span `
|
|
228
|
+
min-width: 0;
|
|
229
|
+
overflow: hidden;
|
|
230
|
+
text-overflow: ellipsis;
|
|
231
|
+
`;
|
|
227
232
|
/**
|
|
228
233
|
* Generates unique ARIA label IDs for accessibility.
|
|
229
234
|
* - groupLabelId: for the group label (e.g., "Status:")
|
|
@@ -325,7 +330,7 @@ function GroupHeaderLabel({ column, groupHeader }) {
|
|
|
325
330
|
? formatter(groupHeader.count, { locale })
|
|
326
331
|
: groupHeader.count;
|
|
327
332
|
const { groupLabelId, groupNameId } = getAriaLabelIds(groupHeader.uniqueId);
|
|
328
|
-
return (_jsxs(_Fragment, { children: [_jsx("div", { className: 'group-label' }), !column.field.hideGroupColumnNameLabel && (_jsxs("span", { className: 'group-header-groupby', "data-test-id": groupHeader.groupBy, "data-testid": `${TestIdConstants.groupHeaderGroupBy}-${groupHeader.groupBy}`, id: groupLabelId, children: [groupHeader.label, ":"] })), _jsx("div", { className: 'group-label' }), _jsxs("span", { className: 'group-context-count', style: { display: 'inline-flex' }, "data-test-id": 'groupHeader', "data-testid": TestIdConstants.groupHeaderCount, id: groupNameId, children: [_jsx(GroupName, { view: view, column: column, groupHeader: groupHeader, dateFunction: dateFunction, customFunction: customFunction }), _jsx("span", { className: 'group-count', children: ` (${groupCountFormatted})` }), _jsx(VisuallyHiddenText, { children: " items" })] })] }));
|
|
333
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: 'group-label' }), !column.field.hideGroupColumnNameLabel && (_jsxs("span", { className: 'group-header-groupby', "data-test-id": groupHeader.groupBy, "data-testid": `${TestIdConstants.groupHeaderGroupBy}-${groupHeader.groupBy}`, id: groupLabelId, children: [groupHeader.label, ":"] })), _jsx("div", { className: 'group-label' }), _jsxs("span", { className: 'group-context-count', style: { display: 'inline-flex' }, "data-test-id": 'groupHeader', "data-testid": TestIdConstants.groupHeaderCount, id: groupNameId, children: [_jsx(StyledGroupName, { children: _jsx(GroupName, { view: view, column: column, groupHeader: groupHeader, dateFunction: dateFunction, customFunction: customFunction }) }), _jsx("span", { className: 'group-count', children: ` (${groupCountFormatted})` }), _jsx(VisuallyHiddenText, { children: " items" })] })] }));
|
|
329
334
|
}
|
|
330
335
|
// NOTE: While making any changes in GroupRenderer.jsx, also make similar changes in HierarchicalGroupRenderer.jsx file if applicable
|
|
331
336
|
export default function GroupHeader({ groupHeader, columns }) {
|
|
@@ -367,7 +372,7 @@ export default function GroupHeader({ groupHeader, columns }) {
|
|
|
367
372
|
e.preventDefault();
|
|
368
373
|
buttonRef.current.focus();
|
|
369
374
|
}
|
|
370
|
-
}, children: _jsxs(Flex, { container: true, children: [_jsx(ColorBadge, { colorIndicator: groupHeader.colorIndicator }), _jsxs(
|
|
375
|
+
}, children: _jsxs(Flex, { container: true, children: [_jsx(ColorBadge, { colorIndicator: groupHeader.colorIndicator }), _jsxs(Flex, { item: { grow: 1 }, container: { direction: 'column' }, children: [_jsxs("div", { className: 'stickyGroupHeader', children: [_jsxs(BareButton, { ref: buttonRef, "data-testid": `${TestIdConstants.groupHeaderButton}-${groupHeader.label}-${groupHeader.name}`, "aria-labelledby": [groupLabelId, groupNameId, ...additionalInfoIds].join(' '), "aria-expanded": !!groupHeader.isExpanded, style: {
|
|
371
376
|
paddingRight: 'var(--group-left)'
|
|
372
377
|
}, onClick: () => toggleGroup(), onKeyDown: event => {
|
|
373
378
|
if (event.key === 'Enter') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../Core/Components/GroupRenderer/index.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAClG,OAAO,UAAU,MAAM,0DAA0D,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EAAE,eAAe,IAAI,EAAE,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAC9E,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAC/C,OAAO,eAAe,MAAM,+BAA+B,CAAC;AAC5D,OAAO,gBAAgB,MAAM,qBAAqB,CAAC;AACnD,OAAO,eAAe,MAAM,oBAAoB,CAAC;AAEjD,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AAExD,MAAM,2BAA2B,GAAG,WAAW,CAAC,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,GAAG,KAAK,CAAC;AAEzF,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE;IAC1D,MAAM,mBAAmB,GAAG,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;IAE5E,OAAO,GAAG,CAAA;;;;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AmB,GAAI,IAC/D,CACJ,IACG,IACK,EAEZ,SAAS,CAAC,OAAO,IAAI,CACpB,KAAC,kBAAkB,IACjB,MAAM,EAAE,SAAS,CAAC,OAAO,EACzB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,EAChB,gBAAgB,EAAE,gBAAgB,GAClC,CACH,IACG,EACN,cAAK,SAAS,EAAC,8BAA8B,YAC1C,CAAC,GAAG,OAAO,CAAC;iCACV,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;iCAC7C,GAAG,CAAC,CAAC,CAAC,EAAE;gCACP,MAAM,GAAG,GAAG;oCACV,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;iCAC/E,CAAC;gCACF,OAAO,CACL,KAAC,cAAc,IAEb,MAAM,EAAE,CAAC,EACT,OAAO,EAAE,GAAG,EACZ,SAAS,EAAE,EAAE,CAAC,MAAM,EAAE;wCACpB,YAAY,EAAE,MAAM,CAAC,MAAM;qCAC5B,CAAC,IALG,CAAC,CAAC,KAAK,CAAC,EAAE,CAMf,CACH,CAAC;4BACJ,CAAC,CAAC,GACA,IACF,IACD,GACW,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, useCallback } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Icon, Text, MetaList, Tooltip, VisuallyHiddenText, Flex } 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';\nimport AggregatorCell from '../AggregatorCell';\nimport RenderingEngine from '../RenderingEngine/RenderCell';\nimport DateValueDisplay from '../DateValueDisplay';\nimport TestIdConstants from '../TestIdConstants';\n\nimport GroupAdditionalInfo from './GroupAdditionalInfo';\n\nconst groupheaderleftdisplacement = headerLevel => `${(headerLevel.level + 1) * 0.5}rem`;\n\nconst ColorBadge = styled.div(({ theme, colorIndicator }) => {\n const borderVerticalOuter = theme.components.table.border['vertical-outer'];\n\n return css`\n position: sticky;\n inset-inline-start: 0;\n z-index: 10;\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: ${colorIndicator};\n z-index: 12;\n\n /* Apply border radius to group header when table vertical outer border was disabled */\n ${!borderVerticalOuter &&\n css`\n border-top-left-radius: min(${theme.base['border-radius']}, 0.25rem);\n border-bottom-left-radius: min(${theme.base['border-radius']}, 0.25rem);\n `}\n }\n `;\n});\n\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(({ theme, isAggregationApplied, groupHeader }) => {\n const borderVerticalOuter = theme.components.table.border['vertical-outer'];\n const borderHorizontalInner = theme.components.table.border['horizontal-inner'];\n\n return css`\n --group-left: ${groupheaderleftdisplacement(groupHeader)};\n background-color: var(--group-bg-color);\n\n /* On scroll-state-stuck shadow will be removed on all group-header-row. Below shadow will be applied only to the first group-header-row. */\n &.group-header-row:nth-child(${groupHeader.level + 1}) {\n filter: ${theme.base.shadow['low-filter']};\n }\n\n &:has(button[aria-expanded='true']) {\n > div {\n box-shadow: ${theme.base.shadow.low};\n }\n }\n\n ${!borderHorizontalInner &&\n css`\n > div {\n /* On scroll-state-stuck this shadow will be removed */\n box-shadow: ${theme.base.shadow.low};\n }\n `}\n\n &.row.sticky-group-header {\n position: sticky;\n\n /* Declare as a scroll-state container so descendants can query the stuck state */\n @supports (container-type: scroll-state) {\n container-name: group-header-container;\n container-type: scroll-state;\n }\n display: block;\n top: calc(\n ${groupHeader.isLeafNode && 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: ${`${8 + 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: ${theme.base['font-weight'].normal};\n }\n\n .group-context-count .group-count {\n font-weight: ${theme.base['font-weight'].bold};\n white-space: pre;\n }\n\n &.row.group-header-row {\n height: auto;\n border-bottom: ${!isAggregationApplied && borderHorizontalInner\n ? 'var(--border-style)'\n : '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: ${isAggregationApplied ? 'var(--group-header-height)' : 0};\n }\n }\n\n /* Apply border radius to group header when table vertical outer border was disabled */\n ${!borderVerticalOuter &&\n css`\n /* consider three group-header-rows stacked vertically, the first and second group headers have RULE 2 AND RULE 3 applied, the third group-header has only RULE 3 applied */\n &.group-header-row {\n /* RULE 1- if there are no adjacent group-headers, apply border-radius to all corners */\n border-radius: min(${theme.base['border-radius']}, 0.25rem);\n\n /* RULE-2- if there is an adjacent group-header below, remove bottom border-radius */\n &:has(+ .group-header-row) {\n border-radius: 0;\n\n & ${ColorBadge}::before {\n border-radius: 0;\n }\n }\n\n /*RULE 3- if there is an adjacent group-header, go to the adjacent group header and remove top border-radius */\n &:has(+ .group-header-row) + .group-header-row {\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n\n & ${ColorBadge}::before {\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n }\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 font-stretch: inherit;\n\n > .group-wrapper {\n margin-inline-start: ${groupHeader.count === 0\n ? `calc(${theme.base.spacing} * 2.25)`\n : 'unset'};\n align-items: baseline;\n }\n\n .cell-content {\n max-height: var(--group-header-height);\n padding: 0;\n }\n }\n button:focus {\n box-shadow: ${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 /* When the group header is stuck to the top (overlapped by another group header),\n remove the expanded-state box-shadow and add a top border for visual separation */\n @supports (container-type: scroll-state) {\n @container group-header-container scroll-state(stuck: top) {\n &:has(button[aria-expanded='true']) > div {\n box-shadow: none;\n }\n }\n }\n `;\n});\n\nconst StyledMetaList = styled(MetaList)`\n margin-inline-start: 0;\n\n /* Overrides default MetaList padding and margin which was causing text-overflow issues */\n margin: 0;\n padding: 0 0.3rem;\n`;\nconst GroupAdditionalInfoSeparator = styled.span`\n margin-inline-start: 0.3rem;\n`;\n\n/**\n * Generates unique ARIA label IDs for accessibility.\n * - groupLabelId: for the group label (e.g., \"Status:\")\n * - groupNameId: for the group value (e.g., \"Open\")\n * - additionalInfoIds: for any additional fields shown in the group header\n * These IDs are used in aria-labelledby to improve screen reader support.\n */\nconst getAriaLabelIds = (uniqueId, additionalFields) => {\n const groupLabelId = `group-label-${uniqueId}`;\n const groupNameId = `group-name-${uniqueId}`;\n const additionalInfoIds = additionalFields?.map(\n additionalField =>\n `group-additional-info-${uniqueId}-${additionalField.id}` /* used in aria-labelledby */\n );\n return { groupLabelId, groupNameId, additionalInfoIds };\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\nexport function 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/**\n * Tooltip content for the group header.\n * Shows the group label, value, and any additional fields.\n * Used for hover/focus tooltips on the group header button.\n */\nfunction GroupHeaderToolTip({ column, groupHeader, columns, additionalFields, target }) {\n const view = column.parent;\n const { dateFunction, customFunction } =\n getGroupFromKey(groupHeader.groupBy, view.state.groups) ?? {};\n const formatter = view.getFormatterByKey('Integer');\n const { locale } = view.meta;\n const groupCountFormatted = formatter\n ? formatter(groupHeader.count, { locale })\n : groupHeader.count;\n\n return (\n <Tooltip smart target={target} showDelay='short' hideDelay='none' describeTarget={false}>\n <Text>{!column.field.hideGroupColumnNameLabel && groupHeader.label}: </Text>\n <Text>\n <GroupName\n view={view}\n column={column}\n groupHeader={groupHeader}\n dateFunction={dateFunction}\n customFunction={customFunction}\n />\n <Text>{` (${groupCountFormatted})`}</Text>\n </Text>\n {!!(groupHeader.additionalFieldsData?.length && additionalFields.length) && (\n <>\n {groupHeader.additionalFieldsData?.map(additionalFieldData => {\n return (\n <>\n {' • '}\n <GroupAdditionalInfo\n groupHeader={groupHeader}\n additionalField={additionalFields.find(\n additionalField => additionalField.id === additionalFieldData.id\n )}\n columns={columns}\n additionalFieldData={additionalFieldData}\n rendererContext='GroupHeaderTooltip'\n />\n </>\n );\n })}\n </>\n )}\n </Tooltip>\n );\n}\n\n/**\n * Renders the main group header label and count.\n * - Shows the group label (e.g., \"Status:\") unless hidden by column config.\n * - Shows the group value and item count.\n * - Uses ARIA IDs for accessibility.\n */\nfunction GroupHeaderLabel({ column, groupHeader }) {\n const view = column.parent;\n const { dateFunction, customFunction } =\n getGroupFromKey(groupHeader.groupBy, view.state.groups) ?? {};\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 { groupLabelId, groupNameId } = getAriaLabelIds(groupHeader.uniqueId);\n return (\n <>\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 id={groupLabelId}\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 id={groupNameId}\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 className='group-count'>{` (${groupCountFormatted})`}</span>\n <VisuallyHiddenText> items</VisuallyHiddenText>\n </span>\n </>\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 const view = columns[0].parent;\n const toggleGroup = useCallback(() => {\n if (groupHeader.count > 0) {\n view.type.toggleGroupExpansion({ groupHeader });\n }\n }, [groupHeader, view]);\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 // If grouping by a regular column (i.e. without a dateFunction), determine props for the renderer\n const { columnId, additionalFields = [] } =\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 isAggregationApplied = columns.filter(c => !c.hidden).some(c => c.aggregated);\n\n // Generate unique ARIA label IDs for accessibility\n const {\n groupLabelId,\n groupNameId,\n additionalInfoIds = []\n } = getAriaLabelIds(groupHeader.uniqueId, additionalFields);\n let groupAdditionalInfo;\n\n // Prepare additional info components if present\n if (groupHeader.additionalFieldsData?.length && additionalFields.length) {\n groupAdditionalInfo = groupHeader.additionalFieldsData.reduce(\n (acc, additionalFieldData, idx) => {\n const additionalField = additionalFields.find(field => field.id === additionalFieldData.id);\n if (additionalField) {\n acc.push(\n <Flex container={{ gap: 0.5 }} id={additionalInfoIds[idx]}>\n <GroupAdditionalInfo\n additionalFieldData={additionalFieldData}\n additionalField={additionalField}\n columns={columns}\n groupHeader={groupHeader}\n rendererContext='GroupHeader'\n />\n </Flex>\n );\n }\n return acc;\n },\n []\n );\n }\n\n // FIXME: Import rather than COPY, i would rather\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}-${groupHeader.label}-${groupHeader.name}`}\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 <Flex container>\n <ColorBadge colorIndicator={groupHeader.colorIndicator} />\n <div>\n <div className='stickyGroupHeader'>\n <BareButton\n ref={buttonRef}\n data-testid={`${TestIdConstants.groupHeaderButton}-${groupHeader.label}-${groupHeader.name}`}\n // ARIA labels for accessibility, includes additional info if present\n aria-labelledby={[groupLabelId, groupNameId, ...additionalInfoIds].join(' ')}\n aria-expanded={!!groupHeader.isExpanded}\n style={{\n paddingRight: 'var(--group-left)'\n }}\n onClick={() => toggleGroup()}\n onKeyDown={event => {\n if (event.key === 'Enter') {\n // Prevent capturing of group header toggle click to its child renderers.\n event.preventDefault();\n event.stopPropagation();\n toggleGroup();\n }\n }}\n tabIndex={-1}\n icon\n >\n {groupHeader.count > 0 &&\n (groupHeader.isExpanded ? <Icon name='caret-down' /> : <Icon name='caret-right' />)}\n <div className='group-wrapper'>\n {/* Main group label and count */}\n <GroupHeaderLabel column={column} groupHeader={groupHeader} />\n {/* Render additional info if present */}\n {groupAdditionalInfo && (\n <>\n <Text variant='secondary' as={GroupAdditionalInfoSeparator}>\n •\n </Text>\n <StyledMetaList wrapItems={false} items={groupAdditionalInfo} />\n </>\n )}\n </div>\n </BareButton>\n {/* Tooltip for group header, shown on hover/focus */}\n {buttonRef.current && (\n <GroupHeaderToolTip\n target={buttonRef.current}\n column={column}\n groupHeader={groupHeader}\n columns={columns}\n additionalFields={additionalFields}\n />\n )}\n </div>\n <div className='group-header-aggregation-row'>\n {[...columns]\n .sort((colA, colB) => colA.order - colB.order)\n .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 </div>\n </Flex>\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":"index.js","sourceRoot":"","sources":["../../../../Core/Components/GroupRenderer/index.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAClG,OAAO,UAAU,MAAM,0DAA0D,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EAAE,eAAe,IAAI,EAAE,EAAE,MAAM,aAAa,CAA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,IAAI,CAAC,KAAK,CAAC;iCAC7C,GAAG,CAAC,CAAC,CAAC,EAAE;gCACP,MAAM,GAAG,GAAG;oCACV,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;iCAC/E,CAAC;gCACF,OAAO,CACL,KAAC,cAAc,IAEb,MAAM,EAAE,CAAC,EACT,OAAO,EAAE,GAAG,EACZ,SAAS,EAAE,EAAE,CAAC,MAAM,EAAE;wCACpB,YAAY,EAAE,MAAM,CAAC,MAAM;qCAC5B,CAAC,IALG,CAAC,CAAC,KAAK,CAAC,EAAE,CAMf,CACH,CAAC;4BACJ,CAAC,CAAC,GACA,IACD,IACF,GACW,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, useCallback } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { Icon, Text, MetaList, Tooltip, VisuallyHiddenText, Flex } 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';\nimport AggregatorCell from '../AggregatorCell';\nimport RenderingEngine from '../RenderingEngine/RenderCell';\nimport DateValueDisplay from '../DateValueDisplay';\nimport TestIdConstants from '../TestIdConstants';\n\nimport GroupAdditionalInfo from './GroupAdditionalInfo';\n\nconst groupheaderleftdisplacement = headerLevel => `${(headerLevel.level + 1) * 0.5}rem`;\n\nconst ColorBadge = styled.div(({ theme, colorIndicator }) => {\n const borderVerticalOuter = theme.components.table.border['vertical-outer'];\n\n return css`\n position: sticky;\n inset-inline-start: 0;\n z-index: 10;\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: ${colorIndicator};\n z-index: 12;\n\n /* Apply border radius to group header when table vertical outer border was disabled */\n ${!borderVerticalOuter &&\n css`\n border-top-left-radius: min(${theme.base['border-radius']}, 0.25rem);\n border-bottom-left-radius: min(${theme.base['border-radius']}, 0.25rem);\n `}\n }\n `;\n});\n\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(({ theme, isAggregationApplied, groupHeader }) => {\n const borderVerticalOuter = theme.components.table.border['vertical-outer'];\n const borderHorizontalInner = theme.components.table.border['horizontal-inner'];\n\n return css`\n --group-left: ${groupheaderleftdisplacement(groupHeader)};\n background-color: var(--group-bg-color);\n\n /* On scroll-state-stuck shadow will be removed on all group-header-row. Below shadow will be applied only to the first group-header-row. */\n &.group-header-row:nth-child(${groupHeader.level + 1}) {\n filter: ${theme.base.shadow['low-filter']};\n }\n\n &:has(button[aria-expanded='true']) {\n > div {\n box-shadow: ${theme.base.shadow.low};\n }\n }\n\n ${!borderHorizontalInner &&\n css`\n > div {\n /* On scroll-state-stuck this shadow will be removed */\n box-shadow: ${theme.base.shadow.low};\n }\n `}\n\n &.row.sticky-group-header {\n position: sticky;\n\n /* Declare as a scroll-state container so descendants can query the stuck state */\n @supports (container-type: scroll-state) {\n container-name: group-header-container;\n container-type: scroll-state;\n }\n display: block;\n top: calc(\n ${groupHeader.isLeafNode && 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: ${`${8 + 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: ${theme.base['font-weight'].normal};\n }\n\n .group-context-count .group-count {\n font-weight: ${theme.base['font-weight'].bold};\n white-space: pre;\n }\n\n &.row.group-header-row {\n height: auto;\n border-bottom: ${!isAggregationApplied && borderHorizontalInner\n ? 'var(--border-style)'\n : '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: ${isAggregationApplied ? 'var(--group-header-height)' : 0};\n }\n }\n\n /* Apply border radius to group header when table vertical outer border was disabled */\n ${!borderVerticalOuter &&\n css`\n /* consider three group-header-rows stacked vertically, the first and second group headers have RULE 2 AND RULE 3 applied, the third group-header has only RULE 3 applied */\n &.group-header-row {\n /* RULE 1- if there are no adjacent group-headers, apply border-radius to all corners */\n border-radius: min(${theme.base['border-radius']}, 0.25rem);\n\n /* RULE-2- if there is an adjacent group-header below, remove bottom border-radius */\n &:has(+ .group-header-row) {\n border-radius: 0;\n\n & ${ColorBadge}::before {\n border-radius: 0;\n }\n }\n\n /*RULE 3- if there is an adjacent group-header, go to the adjacent group header and remove top border-radius */\n &:has(+ .group-header-row) + .group-header-row {\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n\n & ${ColorBadge}::before {\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n }\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 font-stretch: inherit;\n\n > .group-wrapper {\n margin-inline-start: ${groupHeader.count === 0\n ? `calc(${theme.base.spacing} * 2.25)`\n : 'unset'};\n align-items: baseline;\n }\n\n .cell-content {\n max-height: var(--group-header-height);\n padding: 0;\n }\n }\n button:focus {\n box-shadow: ${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 /* When the group header is stuck to the top (overlapped by another group header),\n remove the expanded-state box-shadow and add a top border for visual separation */\n @supports (container-type: scroll-state) {\n @container group-header-container scroll-state(stuck: top) {\n &:has(button[aria-expanded='true']) > div {\n box-shadow: none;\n }\n }\n }\n `;\n});\n\nconst StyledMetaList = styled(MetaList)`\n margin-inline-start: 0;\n\n /* Overrides default MetaList padding and margin which was causing text-overflow issues */\n margin: 0;\n padding: 0 0.3rem;\n`;\nconst GroupAdditionalInfoSeparator = styled.span`\n margin-inline-start: 0.3rem;\n`;\n\nconst StyledGroupName = styled.span`\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n\n/**\n * Generates unique ARIA label IDs for accessibility.\n * - groupLabelId: for the group label (e.g., \"Status:\")\n * - groupNameId: for the group value (e.g., \"Open\")\n * - additionalInfoIds: for any additional fields shown in the group header\n * These IDs are used in aria-labelledby to improve screen reader support.\n */\nconst getAriaLabelIds = (uniqueId, additionalFields) => {\n const groupLabelId = `group-label-${uniqueId}`;\n const groupNameId = `group-name-${uniqueId}`;\n const additionalInfoIds = additionalFields?.map(\n additionalField =>\n `group-additional-info-${uniqueId}-${additionalField.id}` /* used in aria-labelledby */\n );\n return { groupLabelId, groupNameId, additionalInfoIds };\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\nexport function 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/**\n * Tooltip content for the group header.\n * Shows the group label, value, and any additional fields.\n * Used for hover/focus tooltips on the group header button.\n */\nfunction GroupHeaderToolTip({ column, groupHeader, columns, additionalFields, target }) {\n const view = column.parent;\n const { dateFunction, customFunction } =\n getGroupFromKey(groupHeader.groupBy, view.state.groups) ?? {};\n const formatter = view.getFormatterByKey('Integer');\n const { locale } = view.meta;\n const groupCountFormatted = formatter\n ? formatter(groupHeader.count, { locale })\n : groupHeader.count;\n\n return (\n <Tooltip smart target={target} showDelay='short' hideDelay='none' describeTarget={false}>\n <Text>{!column.field.hideGroupColumnNameLabel && groupHeader.label}: </Text>\n <Text>\n <GroupName\n view={view}\n column={column}\n groupHeader={groupHeader}\n dateFunction={dateFunction}\n customFunction={customFunction}\n />\n <Text>{` (${groupCountFormatted})`}</Text>\n </Text>\n {!!(groupHeader.additionalFieldsData?.length && additionalFields.length) && (\n <>\n {groupHeader.additionalFieldsData?.map(additionalFieldData => {\n return (\n <>\n {' • '}\n <GroupAdditionalInfo\n groupHeader={groupHeader}\n additionalField={additionalFields.find(\n additionalField => additionalField.id === additionalFieldData.id\n )}\n columns={columns}\n additionalFieldData={additionalFieldData}\n rendererContext='GroupHeaderTooltip'\n />\n </>\n );\n })}\n </>\n )}\n </Tooltip>\n );\n}\n\n/**\n * Renders the main group header label and count.\n * - Shows the group label (e.g., \"Status:\") unless hidden by column config.\n * - Shows the group value and item count.\n * - Uses ARIA IDs for accessibility.\n */\nfunction GroupHeaderLabel({ column, groupHeader }) {\n const view = column.parent;\n const { dateFunction, customFunction } =\n getGroupFromKey(groupHeader.groupBy, view.state.groups) ?? {};\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 { groupLabelId, groupNameId } = getAriaLabelIds(groupHeader.uniqueId);\n return (\n <>\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 id={groupLabelId}\n >\n {groupHeader.label}:\n </span>\n )}\n {/* TODO: refactor this to a flex based DOM instead of empty div containers for spacing */}\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 id={groupNameId}\n >\n <StyledGroupName>\n <GroupName\n view={view}\n column={column}\n groupHeader={groupHeader}\n dateFunction={dateFunction}\n customFunction={customFunction}\n />\n </StyledGroupName>\n {/* adding whitespace pre to preserve the space at the begining of count text */}\n <span className='group-count'>{` (${groupCountFormatted})`}</span>\n <VisuallyHiddenText> items</VisuallyHiddenText>\n </span>\n </>\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 const view = columns[0].parent;\n const toggleGroup = useCallback(() => {\n if (groupHeader.count > 0) {\n view.type.toggleGroupExpansion({ groupHeader });\n }\n }, [groupHeader, view]);\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 // If grouping by a regular column (i.e. without a dateFunction), determine props for the renderer\n const { columnId, additionalFields = [] } =\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 isAggregationApplied = columns.filter(c => !c.hidden).some(c => c.aggregated);\n\n // Generate unique ARIA label IDs for accessibility\n const {\n groupLabelId,\n groupNameId,\n additionalInfoIds = []\n } = getAriaLabelIds(groupHeader.uniqueId, additionalFields);\n let groupAdditionalInfo;\n\n // Prepare additional info components if present\n if (groupHeader.additionalFieldsData?.length && additionalFields.length) {\n groupAdditionalInfo = groupHeader.additionalFieldsData.reduce(\n (acc, additionalFieldData, idx) => {\n const additionalField = additionalFields.find(field => field.id === additionalFieldData.id);\n if (additionalField) {\n acc.push(\n <Flex container={{ gap: 0.5 }} id={additionalInfoIds[idx]}>\n <GroupAdditionalInfo\n additionalFieldData={additionalFieldData}\n additionalField={additionalField}\n columns={columns}\n groupHeader={groupHeader}\n rendererContext='GroupHeader'\n />\n </Flex>\n );\n }\n return acc;\n },\n []\n );\n }\n\n // FIXME: Import rather than COPY, i would rather\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}-${groupHeader.label}-${groupHeader.name}`}\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 <Flex container>\n <ColorBadge colorIndicator={groupHeader.colorIndicator} />\n <Flex item={{ grow: 1 }} container={{ direction: 'column' }}>\n <div className='stickyGroupHeader'>\n <BareButton\n ref={buttonRef}\n data-testid={`${TestIdConstants.groupHeaderButton}-${groupHeader.label}-${groupHeader.name}`}\n // ARIA labels for accessibility, includes additional info if present\n aria-labelledby={[groupLabelId, groupNameId, ...additionalInfoIds].join(' ')}\n aria-expanded={!!groupHeader.isExpanded}\n style={{\n paddingRight: 'var(--group-left)'\n }}\n onClick={() => toggleGroup()}\n onKeyDown={event => {\n if (event.key === 'Enter') {\n // Prevent capturing of group header toggle click to its child renderers.\n event.preventDefault();\n event.stopPropagation();\n toggleGroup();\n }\n }}\n tabIndex={-1}\n icon\n >\n {groupHeader.count > 0 &&\n (groupHeader.isExpanded ? <Icon name='caret-down' /> : <Icon name='caret-right' />)}\n <div className='group-wrapper'>\n {/* Main group label and count */}\n <GroupHeaderLabel column={column} groupHeader={groupHeader} />\n {/* Render additional info if present */}\n {groupAdditionalInfo && (\n <>\n <Text variant='secondary' as={GroupAdditionalInfoSeparator}>\n •\n </Text>\n <StyledMetaList wrapItems={false} items={groupAdditionalInfo} />\n </>\n )}\n </div>\n </BareButton>\n {/* Tooltip for group header, shown on hover/focus */}\n {buttonRef.current && (\n <GroupHeaderToolTip\n target={buttonRef.current}\n column={column}\n groupHeader={groupHeader}\n columns={columns}\n additionalFields={additionalFields}\n />\n )}\n </div>\n <div className='group-header-aggregation-row'>\n {[...columns]\n .sort((colA, colB) => colA.order - colB.order)\n .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 </Flex>\n </Flex>\n </StyledGroupHeader>\n );\n}\n\nGroupHeader.propTypes = {\n columns: PropTypes.arrayOf(PropTypes.any).isRequired,\n groupHeader: PropTypes.objectOf(PropTypes.any).isRequired\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../Core/Components/RSWrapper/index.jsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../Core/Components/RSWrapper/index.jsx"],"names":[],"mappings":"AAgCO;;4CAEN"}
|
|
@@ -7,6 +7,7 @@ import { REPEATING_STRUCTURE_TEMPLATES } from 'pega-repeating-structures-core';
|
|
|
7
7
|
import styles from '../../Views/rs-styles';
|
|
8
8
|
import Table from '../../Views/Table';
|
|
9
9
|
import Gallery from '../../Views/Gallery';
|
|
10
|
+
import Kanban from '../../Views/Kanban';
|
|
10
11
|
import Timeline from '../../Views/Timeline';
|
|
11
12
|
import Map from '../../Views/Map';
|
|
12
13
|
import repeatComponent from '../../index';
|
|
@@ -36,6 +37,9 @@ const RSWrapper = ({ view }) => {
|
|
|
36
37
|
case REPEATING_STRUCTURE_TEMPLATES.GALLERY:
|
|
37
38
|
Component = Gallery;
|
|
38
39
|
break;
|
|
40
|
+
case REPEATING_STRUCTURE_TEMPLATES.KANBAN:
|
|
41
|
+
Component = Kanban;
|
|
42
|
+
break;
|
|
39
43
|
case REPEATING_STRUCTURE_TEMPLATES.TIMELINE:
|
|
40
44
|
Component = Timeline;
|
|
41
45
|
break;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../Core/Components/RSWrapper/index.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAE/E,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAC3C,OAAO,KAAK,MAAM,mBAAmB,CAAC;AACtC,OAAO,OAAO,MAAM,qBAAqB,CAAC;AAC1C,OAAO,QAAQ,MAAM,sBAAsB,CAAC;AAC5C,OAAO,GAAG,MAAM,iBAAiB,CAAC;AAClC,OAAO,eAAe,MAAM,aAAa,CAAC;AAC1C,OAAO,oBAAoB,MAAM,kCAAkC,CAAC;AACpE,OAAO,cAAc,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAEzE,MAAM,iBAAiB,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,cAAK,GAAG,EAAE,GAAG,KAAM,KAAK,GAAI,CAAC,CAAC,CAAC,GAAG,EAAE;IAC9F,MAAM,UAAU,GAAG,oBAAoB,EAAE,CAAC;IAE1C,OAAO,GAAG,CAAA;MACN,MAAM;;MAEN,UAAU;QACZ,UAAU,CAAC,CAAC,CAAC;QACb,GAAG,CAAA;;KAEF;GACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,C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AAC;IAEtC,OAAO,CACL,KAAC,eAAe,cACd,KAAC,iBAAiB,IAChB,GAAG,EAAE,CAAC,CAAC,EAAE;gBACP,eAAe,CAAC,CAAC,CAAC,CAAC;gBACnB,eAAe,CAAC,OAAO,GAAG,CAAC,CAAC;YAC9B,CAAC,EACD,KAAK,EAAE,YAAY,EACnB,SAAS,EAAC,YAAY,YAEtB,KAAC,SAAS,IAAC,IAAI,EAAE,IAAI,GAAI,GACP,GACJ,CACnB,CAAC;AACJ,CAAC,CAAC;AAEF,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC;AAEpC,SAAS,CAAC,SAAS,GAAG;IACpB,IAAI,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;CACnD,CAAC;AAEF,MAAM,eAAe,GAAG,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAErE,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACtC,OAAO,CACL,KAAC,oBAAoB,cACnB,KAAC,eAAe,OAAK,KAAK,EAAE,GAAG,EAAE,GAAG,GAAI,GACnB,CACxB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC","sourcesContent":["import { forwardRef, memo, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport styled, { css } from 'styled-components';\n\nimport { Fullscreen, useFullscreenContext } from '@pega/cosmos-react-core';\nimport { REPEATING_STRUCTURE_TEMPLATES } from 'pega-repeating-structures-core';\n\nimport styles from '../../Views/rs-styles';\nimport Table from '../../Views/Table';\nimport Gallery from '../../Views/Gallery';\nimport Timeline from '../../Views/Timeline';\nimport Map from '../../Views/Map';\nimport repeatComponent from '../../index';\nimport useConfirmationModal from '../../Hooks/useConfirmationModal';\nimport useSmallScreen from '../../Hooks/useSmallScreen';\nimport { LocalizationProvider } from '../../Context/LocalizationContext';\n\nconst StyledRSContainer = styled(forwardRef((props, ref) => <div ref={ref} {...props} />))(() => {\n const fullscreen = useFullscreenContext();\n\n return css`\n ${styles}\n\n ${fullscreen &&\n fullscreen[0] &&\n css`\n height: 100%;\n `}\n `;\n});\n\nexport const CosmosProviders = ({ children }) => {\n return <Fullscreen>{children}</Fullscreen>;\n};\n\nconst RSWrapper = ({ view }) => {\n /** Read template from view, as changeTemplate feature can mutate the template */\n const { template, setDomContainer, columns } = view;\n\n let Component;\n switch (template) {\n case REPEATING_STRUCTURE_TEMPLATES.GALLERY:\n Component = Gallery;\n break;\n case REPEATING_STRUCTURE_TEMPLATES.TIMELINE:\n Component = Timeline;\n break;\n case REPEATING_STRUCTURE_TEMPLATES.MAP:\n Component = Map;\n break;\n default:\n Component = Table;\n }\n\n useConfirmationModal({ view });\n\n /**\n * Adding all column level styles into columnStyles on DOMContainer.\n * Since domContainer is the only ref available across the features.\n * If some feature want to override something (say Resize the width), that only refelects if we add styles here.\n * Other wise fall into specificity/precedence of local CSS variables.\n * This won't effect other RS views, since these styles are generated through features.\n * If a feature is not applicable it won't add styles to this object.\n */\n const columnStyles = columns?.reduce((acc, column) => {\n const { style, field, hidden } = column;\n if (hidden) return acc;\n Object.entries(style).forEach(([s, v]) => {\n acc[`--col-${s}-${field.idHash}`] = v;\n });\n return acc;\n }, {});\n\n const domContainerRef = useRef();\n useSmallScreen(view, domContainerRef);\n\n return (\n <CosmosProviders>\n <StyledRSContainer\n ref={r => {\n setDomContainer(r);\n domContainerRef.current = r;\n }}\n style={columnStyles}\n className='rs-wrapper'\n >\n <Component view={view} />\n </StyledRSContainer>\n </CosmosProviders>\n );\n};\n\nRSWrapper.displayName = 'RSWrapper';\n\nRSWrapper.propTypes = {\n view: PropTypes.objectOf(PropTypes.any).isRequired\n};\n\nconst RepeatComponent = memo(forwardRef(repeatComponent(RSWrapper)));\n\nconst WithLocalization = (props, ref) => {\n return (\n <LocalizationProvider>\n <RepeatComponent {...props} ref={ref} />\n </LocalizationProvider>\n );\n};\n\nexport default memo(forwardRef(WithLocalization));\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../Core/Components/RSWrapper/index.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAE/E,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAC3C,OAAO,KAAK,MAAM,mBAAmB,CAAC;AACtC,OAAO,OAAO,MAAM,qBAAqB,CAAC;AAC1C,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,QAAQ,MAAM,sBAAsB,CAAC;AAC5C,OAAO,GAAG,MAAM,iBAAiB,CAAC;AAClC,OAAO,eAAe,MAAM,aAAa,CAAC;AAC1C,OAAO,oBAAoB,MAAM,kCAAkC,CAAC;AACpE,OAAO,cAAc,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAEzE,MAAM,iBAAiB,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,cAAK,GAAG,EAAE,GAAG,KAAM,KAAK,GAAI,CAAC,CAAC,CAAC,GAAG,EAAE;IAC9F,MAAM,UAAU,GAAG,oBAAoB,EAAE,CAAC;IAE1C,OAAO,GAAG,CAAA;MACN,MAAM;;MAEN,UAAU;QACZ,UAAU,CAAC,CAAC,CAAC;QACb,GAAG,CAAA;;KAEF;GACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,E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IACjC,cAAc,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;IAEtC,OAAO,CACL,KAAC,eAAe,cACd,KAAC,iBAAiB,IAChB,GAAG,EAAE,CAAC,CAAC,EAAE;gBACP,eAAe,CAAC,CAAC,CAAC,CAAC;gBACnB,eAAe,CAAC,OAAO,GAAG,CAAC,CAAC;YAC9B,CAAC,EACD,KAAK,EAAE,YAAY,EACnB,SAAS,EAAC,YAAY,YAEtB,KAAC,SAAS,IAAC,IAAI,EAAE,IAAI,GAAI,GACP,GACJ,CACnB,CAAC;AACJ,CAAC,CAAC;AAEF,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC;AAEpC,SAAS,CAAC,SAAS,GAAG;IACpB,IAAI,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,UAAU;CACnD,CAAC;AAEF,MAAM,eAAe,GAAG,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAErE,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACtC,OAAO,CACL,KAAC,oBAAoB,cACnB,KAAC,eAAe,OAAK,KAAK,EAAE,GAAG,EAAE,GAAG,GAAI,GACnB,CACxB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC","sourcesContent":["import { forwardRef, memo, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport styled, { css } from 'styled-components';\n\nimport { Fullscreen, useFullscreenContext } from '@pega/cosmos-react-core';\nimport { REPEATING_STRUCTURE_TEMPLATES } from 'pega-repeating-structures-core';\n\nimport styles from '../../Views/rs-styles';\nimport Table from '../../Views/Table';\nimport Gallery from '../../Views/Gallery';\nimport Kanban from '../../Views/Kanban';\nimport Timeline from '../../Views/Timeline';\nimport Map from '../../Views/Map';\nimport repeatComponent from '../../index';\nimport useConfirmationModal from '../../Hooks/useConfirmationModal';\nimport useSmallScreen from '../../Hooks/useSmallScreen';\nimport { LocalizationProvider } from '../../Context/LocalizationContext';\n\nconst StyledRSContainer = styled(forwardRef((props, ref) => <div ref={ref} {...props} />))(() => {\n const fullscreen = useFullscreenContext();\n\n return css`\n ${styles}\n\n ${fullscreen &&\n fullscreen[0] &&\n css`\n height: 100%;\n `}\n `;\n});\n\nexport const CosmosProviders = ({ children }) => {\n return <Fullscreen>{children}</Fullscreen>;\n};\n\nconst RSWrapper = ({ view }) => {\n /** Read template from view, as changeTemplate feature can mutate the template */\n const { template, setDomContainer, columns } = view;\n\n let Component;\n switch (template) {\n case REPEATING_STRUCTURE_TEMPLATES.GALLERY:\n Component = Gallery;\n break;\n case REPEATING_STRUCTURE_TEMPLATES.KANBAN:\n Component = Kanban;\n break;\n case REPEATING_STRUCTURE_TEMPLATES.TIMELINE:\n Component = Timeline;\n break;\n case REPEATING_STRUCTURE_TEMPLATES.MAP:\n Component = Map;\n break;\n default:\n Component = Table;\n }\n\n useConfirmationModal({ view });\n\n /**\n * Adding all column level styles into columnStyles on DOMContainer.\n * Since domContainer is the only ref available across the features.\n * If some feature want to override something (say Resize the width), that only refelects if we add styles here.\n * Other wise fall into specificity/precedence of local CSS variables.\n * This won't effect other RS views, since these styles are generated through features.\n * If a feature is not applicable it won't add styles to this object.\n */\n const columnStyles = columns?.reduce((acc, column) => {\n const { style, field, hidden } = column;\n if (hidden) return acc;\n Object.entries(style).forEach(([s, v]) => {\n acc[`--col-${s}-${field.idHash}`] = v;\n });\n return acc;\n }, {});\n\n const domContainerRef = useRef();\n useSmallScreen(view, domContainerRef);\n\n return (\n <CosmosProviders>\n <StyledRSContainer\n ref={r => {\n setDomContainer(r);\n domContainerRef.current = r;\n }}\n style={columnStyles}\n className='rs-wrapper'\n >\n <Component view={view} />\n </StyledRSContainer>\n </CosmosProviders>\n );\n};\n\nRSWrapper.displayName = 'RSWrapper';\n\nRSWrapper.propTypes = {\n view: PropTypes.objectOf(PropTypes.any).isRequired\n};\n\nconst RepeatComponent = memo(forwardRef(repeatComponent(RSWrapper)));\n\nconst WithLocalization = (props, ref) => {\n return (\n <LocalizationProvider>\n <RepeatComponent {...props} ref={ref} />\n </LocalizationProvider>\n );\n};\n\nexport default memo(forwardRef(WithLocalization));\n"]}
|