@pega/lists-react 9.0.0-build.11.3 → 9.0.0-build.11.5

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.
Files changed (24) hide show
  1. package/lib/Core/Components/GroupRenderer/GroupAdditionalFieldDataModal.d.ts +12 -0
  2. package/lib/Core/Components/GroupRenderer/GroupAdditionalFieldDataModal.d.ts.map +1 -0
  3. package/lib/Core/Components/GroupRenderer/GroupAdditionalFieldDataModal.js +62 -0
  4. package/lib/Core/Components/GroupRenderer/GroupAdditionalFieldDataModal.js.map +1 -0
  5. package/lib/Core/Components/GroupRenderer/GroupAdditionalInfo.d.ts +33 -0
  6. package/lib/Core/Components/GroupRenderer/GroupAdditionalInfo.d.ts.map +1 -0
  7. package/lib/Core/Components/GroupRenderer/GroupAdditionalInfo.js +110 -0
  8. package/lib/Core/Components/GroupRenderer/GroupAdditionalInfo.js.map +1 -0
  9. package/lib/Core/Components/GroupRenderer/index.d.ts +22 -0
  10. package/lib/Core/Components/GroupRenderer/index.d.ts.map +1 -0
  11. package/lib/Core/Components/{GroupRenderer.js → GroupRenderer/index.js} +85 -125
  12. package/lib/Core/Components/GroupRenderer/index.js.map +1 -0
  13. package/lib/Core/Components/Virtualise/index.js +7 -1
  14. package/lib/Core/Components/Virtualise/index.js.map +1 -1
  15. package/lib/Core/Context/LocalizationContext.d.ts +1 -1
  16. package/lib/Core/Context/LocalizationContext.d.ts.map +1 -1
  17. package/lib/Core/Context/LocalizationContext.js.map +1 -1
  18. package/lib/types.d.ts +2 -0
  19. package/lib/types.d.ts.map +1 -1
  20. package/lib/types.js.map +1 -1
  21. package/package.json +7 -7
  22. package/lib/Core/Components/GroupRenderer.d.ts +0 -31
  23. package/lib/Core/Components/GroupRenderer.d.ts.map +0 -1
  24. package/lib/Core/Components/GroupRenderer.js.map +0 -1
@@ -0,0 +1,12 @@
1
+ import { FieldType, type RsCoreTypes } from 'pega-repeating-structures-core';
2
+ export type GroupAdditionalFieldData = RsCoreTypes.GroupGenerator['additionalFieldsData'][0];
3
+ export type GetAdditionalDataResponse = NonNullable<Awaited<ReturnType<RsCoreTypes.GroupGenerator['getAdditionalFieldData']>>>;
4
+ type FieldTypes = (typeof FieldType)[keyof typeof FieldType];
5
+ export declare const isDateLikeField: (type: FieldTypes) => type is typeof FieldType.DATE | typeof FieldType.DATE_TIME | typeof FieldType.DATE_ONLY;
6
+ declare const GroupAdditionalFieldDataModal: ({ groupHeader, additionalField, column }: {
7
+ groupHeader: RsCoreTypes.GroupGenerator;
8
+ additionalField: RsCoreTypes.GroupAdditionalField;
9
+ column: RsCoreTypes.Column;
10
+ }) => import("react/jsx-runtime").JSX.Element;
11
+ export default GroupAdditionalFieldDataModal;
12
+ //# sourceMappingURL=GroupAdditionalFieldDataModal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GroupAdditionalFieldDataModal.d.ts","sourceRoot":"","sources":["../../../../Core/Components/GroupRenderer/GroupAdditionalFieldDataModal.tsx"],"names":[],"mappings":"AAGA,OAAO,EAGL,SAAS,EACT,KAAK,WAAW,EACjB,MAAM,gCAAgC,CAAC;AASxC,MAAM,MAAM,wBAAwB,GAAG,WAAW,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7F,MAAM,MAAM,yBAAyB,GAAG,WAAW,CACjD,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,cAAc,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAC1E,CAAC;AACF,KAAK,UAAU,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;AAK7D,eAAO,MAAM,eAAe,GAC1B,MAAM,UAAU,KACf,IAAI,IAAI,OAAO,SAAS,CAAC,IAAI,GAAG,OAAO,SAAS,CAAC,SAAS,GAAG,OAAO,SAAS,CAAC,SAEhF,CAAC;AAwEF,QAAA,MAAM,6BAA6B,GAAI,0CAIpC;IACD,WAAW,EAAE,WAAW,CAAC,cAAc,CAAC;IACxC,eAAe,EAAE,WAAW,CAAC,oBAAoB,CAAC;IAClD,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC;CAC5B,4CAyEA,CAAC;AAEF,eAAe,6BAA6B,CAAC"}
@@ -0,0 +1,62 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { memo, useCallback, useEffect, useState } from 'react';
3
+ import { Flex, Modal, UnorderedList } from '@pega/cosmos-react-core';
4
+ import { dateFunctionLabels, getGroupFromKey, FieldType } from 'pega-repeating-structures-core';
5
+ import useTranslate from '../../Hooks/useTranslate';
6
+ import { useFormattedAdditionalFieldData } from './GroupAdditionalInfo';
7
+ import { GroupName } from '.';
8
+ const DATE_TYPES = [FieldType.DATE, FieldType.DATE_TIME, FieldType.DATE_ONLY];
9
+ const ADDITIONAL_FIELDS_DATA_INITIAL_LIMIT = 10;
10
+ export const isDateLikeField = (type) => {
11
+ return DATE_TYPES.includes(type);
12
+ };
13
+ const GroupAdditionalFieldDataModalHeading = memo(({ groupHeader, column, view, dateFunction }) => {
14
+ const { label: groupHeaderLabel, groupBy } = groupHeader;
15
+ const { type: additionalFieldType } = column.field;
16
+ const { columns, state: { groups } } = view;
17
+ const [translate] = useTranslate();
18
+ const group = getGroupFromKey(groupBy, groups);
19
+ const groupHeaderColumn = columns?.find(c => c.field.id === group?.columnId);
20
+ // compute additional field label
21
+ const additionalFieldLabel = dateFunction && isDateLikeField(additionalFieldType)
22
+ ? `${column.label} (${translate(dateFunctionLabels[dateFunction])})`
23
+ : column.label;
24
+ return (_jsxs(Flex, { container: { alignItems: 'center', gap: 1 }, "data-testid": 'group-additional-field-data-modal-heading', children: [_jsx("span", { children: `${groupHeaderLabel}:` }), _jsxs("span", { children: [_jsx(GroupName, { view: view, column: groupHeaderColumn, groupHeader: groupHeader, dateFunction: group?.dateFunction, customFunction: group?.customFunction }), ","] }), _jsx("span", { children: additionalFieldLabel })] }));
25
+ });
26
+ const AdditionalFieldItemRenderer = ({ value, additionalField, column, groupHeader }) => {
27
+ const { renderer } = useFormattedAdditionalFieldData({ value, count: 1, id: additionalField.id }, additionalField, { column, meta: column.parent.meta, groupHeader }, 'GroupHeader');
28
+ return renderer;
29
+ };
30
+ const GroupAdditionalFieldDataModal = ({ groupHeader, additionalField, column }) => {
31
+ const view = column.parent;
32
+ const { getAdditionalFieldData } = groupHeader;
33
+ const [limit, setLimit] = useState(ADDITIONAL_FIELDS_DATA_INITIAL_LIMIT);
34
+ const [additionalFieldData, setAdditionalFieldData] = useState(null);
35
+ // Fetch additional field data once on mount
36
+ useEffect(() => {
37
+ let isActive = true;
38
+ (async () => {
39
+ const data = await getAdditionalFieldData(additionalField);
40
+ if (isActive && data) {
41
+ setAdditionalFieldData({ values: data.values, hasMore: data.hasMore });
42
+ }
43
+ else if (!data) {
44
+ setAdditionalFieldData({ values: [], hasMore: false });
45
+ }
46
+ })();
47
+ return () => {
48
+ isActive = false;
49
+ };
50
+ }, [groupHeader, additionalField]);
51
+ // Toggle between showing limited and all additional field values in unordered list.
52
+ const handleToggleShow = useCallback(() => {
53
+ setLimit(prev => prev === ADDITIONAL_FIELDS_DATA_INITIAL_LIMIT && additionalFieldData
54
+ ? additionalFieldData.values.length
55
+ : ADDITIONAL_FIELDS_DATA_INITIAL_LIMIT);
56
+ }, [additionalFieldData]);
57
+ const values = additionalFieldData?.values ?? [];
58
+ const hasMore = additionalFieldData?.hasMore ?? false;
59
+ return (_jsx(Modal, { autoWidth: true, heading: _jsx(GroupAdditionalFieldDataModalHeading, { column: column, dateFunction: 'dateFunction' in additionalField ? additionalField.dateFunction : undefined, groupHeader: groupHeader, view: view }), progress: !additionalFieldData, count: additionalFieldData ? { value: values.length, hasMore } : undefined, "data-testid": 'group-additional-field-data-modal', children: additionalFieldData && (_jsx(UnorderedList, { "data-testid": 'group-additional-field-data-modal-list', onToggleShow: values.length > ADDITIONAL_FIELDS_DATA_INITIAL_LIMIT ? handleToggleShow : undefined, count: values.length > ADDITIONAL_FIELDS_DATA_INITIAL_LIMIT ? values.length : undefined, items: values.slice(0, limit).map(value => (_jsx(AdditionalFieldItemRenderer, { value: value, additionalField: additionalField, column: column, groupHeader: groupHeader }))) })) }));
60
+ };
61
+ export default GroupAdditionalFieldDataModal;
62
+ //# sourceMappingURL=GroupAdditionalFieldDataModal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GroupAdditionalFieldDataModal.js","sourceRoot":"","sources":["../../../../Core/Components/GroupRenderer/GroupAdditionalFieldDataModal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,aAAa,EAAsB,MAAM,yBAAyB,CAAC;AACzF,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,SAAS,EAEV,MAAM,gCAAgC,CAAC;AAGxC,OAAO,YAAY,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EAAE,+BAA+B,EAAE,MAAM,uBAAuB,CAAC;AAExE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,CAAC;AAQ9B,MAAM,UAAU,GAAsB,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;AACjG,MAAM,oCAAoC,GAAG,EAAE,CAAC;AAEhD,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,IAAgB,EACyE,EAAE;IAC3F,OAAO,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AACnC,CAAC,CAAC;AAEF,MAAM,oCAAoC,GAAG,IAAI,CAC/C,CAAC,EACC,WAAW,EACX,MAAM,EACN,IAAI,EACJ,YAAY,EAMb,EAAE,EAAE;IACH,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,OAAO,EAAE,GAAG,WAAW,CAAC;IACzD,MAAM,EAAE,IAAI,EAAE,mBAAmB,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,EAAE,WAAW,GACxB,CACH,CAAC,GACF,CACH,GACK,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,6BAA6B,CAAC","sourcesContent":["import { memo, useCallback, useEffect, useState } from 'react';\n\nimport { Flex, Modal, UnorderedList, type ExcludeStrict } from '@pega/cosmos-react-core';\nimport {\n dateFunctionLabels,\n getGroupFromKey,\n FieldType,\n type RsCoreTypes\n} from 'pega-repeating-structures-core';\nimport type { DateFunction } from '@pega/cosmos-react-condition-builder/lib/components/ConditionBuilder/core/types';\n\nimport useTranslate from '../../Hooks/useTranslate';\n\nimport { useFormattedAdditionalFieldData } from './GroupAdditionalInfo';\n\nimport { GroupName } from '.';\n\nexport type GroupAdditionalFieldData = RsCoreTypes.GroupGenerator['additionalFieldsData'][0];\nexport type GetAdditionalDataResponse = NonNullable<\n Awaited<ReturnType<RsCoreTypes.GroupGenerator['getAdditionalFieldData']>>\n>;\ntype FieldTypes = (typeof FieldType)[keyof typeof FieldType];\n\nconst DATE_TYPES: readonly string[] = [FieldType.DATE, FieldType.DATE_TIME, FieldType.DATE_ONLY];\nconst ADDITIONAL_FIELDS_DATA_INITIAL_LIMIT = 10;\n\nexport const isDateLikeField = (\n type: FieldTypes\n): type is typeof FieldType.DATE | typeof FieldType.DATE_TIME | typeof FieldType.DATE_ONLY => {\n return DATE_TYPES.includes(type);\n};\n\nconst GroupAdditionalFieldDataModalHeading = memo(\n ({\n groupHeader,\n column,\n view,\n dateFunction\n }: {\n groupHeader: RsCoreTypes.GroupGenerator;\n column: RsCoreTypes.Column;\n view: RsCoreTypes.View;\n dateFunction: ExcludeStrict<DateFunction, 'SECONDS'> | undefined;\n }) => {\n const { label: groupHeaderLabel, groupBy } = groupHeader;\n const { type: additionalFieldType } = column.field;\n const {\n columns,\n state: { groups }\n } = view;\n const [translate] = useTranslate();\n\n const group = getGroupFromKey(groupBy, groups);\n const groupHeaderColumn = columns?.find(c => c.field.id === group?.columnId);\n // compute additional field label\n const additionalFieldLabel =\n dateFunction && isDateLikeField(additionalFieldType)\n ? `${column.label} (${translate(dateFunctionLabels[dateFunction])})`\n : column.label;\n\n return (\n <Flex\n container={{ alignItems: 'center', gap: 1 }}\n data-testid='group-additional-field-data-modal-heading'\n >\n <span>{`${groupHeaderLabel}:`}</span>\n <span>\n <GroupName\n view={view}\n column={groupHeaderColumn}\n groupHeader={groupHeader}\n dateFunction={group?.dateFunction}\n customFunction={group?.customFunction}\n />\n ,\n </span>\n <span>{additionalFieldLabel}</span>\n </Flex>\n );\n }\n);\n\nconst AdditionalFieldItemRenderer = ({\n value,\n additionalField,\n column,\n groupHeader\n}: {\n value: GroupAdditionalFieldData['value'];\n additionalField: RsCoreTypes.GroupAdditionalField;\n column: RsCoreTypes.Column;\n groupHeader: RsCoreTypes.GroupGenerator;\n}) => {\n const { renderer } = useFormattedAdditionalFieldData(\n { value, count: 1, id: additionalField.id },\n additionalField,\n { column, meta: column.parent.meta, groupHeader },\n 'GroupHeader'\n );\n return renderer;\n};\n\nconst GroupAdditionalFieldDataModal = ({\n groupHeader,\n additionalField,\n column\n}: {\n groupHeader: RsCoreTypes.GroupGenerator;\n additionalField: RsCoreTypes.GroupAdditionalField;\n column: RsCoreTypes.Column;\n}) => {\n const view = column.parent;\n const { getAdditionalFieldData } = groupHeader;\n\n const [limit, setLimit] = useState(ADDITIONAL_FIELDS_DATA_INITIAL_LIMIT);\n const [additionalFieldData, setAdditionalFieldData] = useState<GetAdditionalDataResponse | null>(\n null\n );\n\n // Fetch additional field data once on mount\n useEffect(() => {\n let isActive = true;\n (async () => {\n const data = await getAdditionalFieldData(additionalField);\n if (isActive && data) {\n setAdditionalFieldData({ values: data.values, hasMore: data.hasMore });\n } else if (!data) {\n setAdditionalFieldData({ values: [], hasMore: false });\n }\n })();\n return () => {\n isActive = false;\n };\n }, [groupHeader, additionalField]);\n\n // Toggle between showing limited and all additional field values in unordered list.\n const handleToggleShow = useCallback(() => {\n setLimit(prev =>\n prev === ADDITIONAL_FIELDS_DATA_INITIAL_LIMIT && additionalFieldData\n ? additionalFieldData.values.length\n : ADDITIONAL_FIELDS_DATA_INITIAL_LIMIT\n );\n }, [additionalFieldData]);\n\n const values = additionalFieldData?.values ?? [];\n const hasMore = additionalFieldData?.hasMore ?? false;\n\n return (\n <Modal\n autoWidth\n heading={\n <GroupAdditionalFieldDataModalHeading\n column={column}\n dateFunction={\n 'dateFunction' in additionalField ? additionalField.dateFunction : undefined\n }\n groupHeader={groupHeader}\n view={view}\n />\n }\n progress={!additionalFieldData}\n count={additionalFieldData ? { value: values.length, hasMore } : undefined}\n data-testid='group-additional-field-data-modal'\n >\n {additionalFieldData && (\n <UnorderedList\n data-testid='group-additional-field-data-modal-list'\n onToggleShow={\n values.length > ADDITIONAL_FIELDS_DATA_INITIAL_LIMIT ? handleToggleShow : undefined\n }\n count={values.length > ADDITIONAL_FIELDS_DATA_INITIAL_LIMIT ? values.length : undefined}\n items={values.slice(0, limit).map(value => (\n <AdditionalFieldItemRenderer\n value={value}\n additionalField={additionalField}\n column={column}\n groupHeader={groupHeader}\n />\n ))}\n />\n )}\n </Modal>\n );\n};\n\nexport default GroupAdditionalFieldDataModal;\n"]}
@@ -0,0 +1,33 @@
1
+ import { type RsCoreTypes } from 'pega-repeating-structures-core';
2
+ import { type GroupAdditionalFieldData } from './GroupAdditionalFieldDataModal';
3
+ type AdditionalFieldRendererContext = 'GroupHeader' | 'GroupHeaderTooltip';
4
+ type GroupAdditionalInfoProps = {
5
+ additionalFieldData: GroupAdditionalFieldData;
6
+ columns: RsCoreTypes.Column[];
7
+ groupHeader: RsCoreTypes.GroupGenerator;
8
+ additionalField: RsCoreTypes.GroupAdditionalField;
9
+ rendererContext: AdditionalFieldRendererContext;
10
+ };
11
+ export declare const useFormattedAdditionalFieldData: (additionalFieldData: GroupAdditionalFieldData, additionalField: RsCoreTypes.GroupAdditionalField, { column, meta, groupHeader }: {
12
+ column: RsCoreTypes.Column | null;
13
+ meta: RsCoreTypes.Meta | null;
14
+ groupHeader: RsCoreTypes.GroupGenerator;
15
+ }, rendererContext: AdditionalFieldRendererContext) => {
16
+ label: null;
17
+ renderer: null;
18
+ } | {
19
+ label: string;
20
+ renderer: string | number | null;
21
+ } | {
22
+ label: string;
23
+ renderer: import("react/jsx-runtime").JSX.Element | null;
24
+ } | {
25
+ label: string;
26
+ renderer: import("react/jsx-runtime").JSX.Element | "Multiple";
27
+ } | {
28
+ label: string | undefined;
29
+ renderer: import("react/jsx-runtime").JSX.Element;
30
+ };
31
+ declare const GroupAdditionalInfo: ({ additionalFieldData, columns, groupHeader, additionalField, rendererContext }: GroupAdditionalInfoProps) => import("react/jsx-runtime").JSX.Element | null;
32
+ export default GroupAdditionalInfo;
33
+ //# sourceMappingURL=GroupAdditionalInfo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GroupAdditionalInfo.d.ts","sourceRoot":"","sources":["../../../../Core/Components/GroupRenderer/GroupAdditionalInfo.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAiC,KAAK,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAcjG,OAAsC,EAEpC,KAAK,wBAAwB,EAC9B,MAAM,iCAAiC,CAAC;AAEzC,KAAK,8BAA8B,GAAG,aAAa,GAAG,oBAAoB,CAAC;AAC3E,KAAK,wBAAwB,GAAG;IAC9B,mBAAmB,EAAE,wBAAwB,CAAC;IAC9C,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC;IAC9B,WAAW,EAAE,WAAW,CAAC,cAAc,CAAC;IACxC,eAAe,EAAE,WAAW,CAAC,oBAAoB,CAAC;IAClD,eAAe,EAAE,8BAA8B,CAAC;CACjD,CAAC;AAgCF,eAAO,MAAM,+BAA+B,GAC1C,qBAAqB,wBAAwB,EAC7C,iBAAiB,WAAW,CAAC,oBAAoB,EACjD,+BAIG;IACD,MAAM,EAAE,WAAW,CAAC,MAAM,GAAG,IAAI,CAAC;IAClC,IAAI,EAAE,WAAW,CAAC,IAAI,GAAG,IAAI,CAAC;IAC9B,WAAW,EAAE,WAAW,CAAC,cAAc,CAAC;CACzC,EACD,iBAAiB,8BAA8B;;;;;;;;;;;;;;;CAyGhD,CAAC;AAEF,QAAA,MAAM,mBAAmB,GAAI,iFAM1B,wBAAwB,mDAqC1B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,110 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useMemo } from 'react';
3
+ import styled from 'styled-components';
4
+ import { Text, useModalManager, Button, VisuallyHiddenText } from '@pega/cosmos-react-core';
5
+ import { dateFunctionLabels, FieldType } from 'pega-repeating-structures-core';
6
+ import { ellipsisOverflow } from '@pega/cosmos-react-core/lib/styles/mixins';
7
+ import useTranslate from '../../Hooks/useTranslate';
8
+ import { getFormattedAggregationValue } from '../AggregateMenu';
9
+ import DateValueDisplay from '../DateValueDisplay';
10
+ import RenderingEngine from '../RenderingEngine/RenderCell';
11
+ import { resolveCellComponent, resolveViewComponent } from '../RenderingEngine/ComponentResolverFactory';
12
+ import GlobalContext from '../../Context/GlobalContext';
13
+ import GroupAdditionalFieldDataModal, { isDateLikeField } from './GroupAdditionalFieldDataModal';
14
+ const isAdditionalFieldWithDateFunction = (additionalField) => {
15
+ return 'dateFunction' in additionalField && Boolean(additionalField.dateFunction);
16
+ };
17
+ const ConditionalEllipsisText = styled(Text) `
18
+ ${({ ellipsis }) => ellipsis && ellipsisOverflow}
19
+ display: inline-flex;
20
+ min-width: 0;
21
+ `;
22
+ function withGlobalContext(Component) {
23
+ return function WithGlobalContext(props) {
24
+ const globalContext = useMemo(() => ({
25
+ resolveCellComponent,
26
+ resolveViewComponent
27
+ }), []);
28
+ return (_jsx(GlobalContext.Provider, { value: globalContext, children: _jsx(Component, { ...props }) }));
29
+ };
30
+ }
31
+ export const useFormattedAdditionalFieldData = (additionalFieldData, additionalField, { column, meta, groupHeader }, rendererContext) => {
32
+ const [translate] = useTranslate();
33
+ const { create } = useModalManager();
34
+ if (!column || !meta) {
35
+ return { label: null, renderer: null };
36
+ }
37
+ const { isInstantRender } = column.parent;
38
+ if (isInstantRender) {
39
+ return { label: null, renderer: null };
40
+ }
41
+ const { value, count = 0 } = additionalFieldData || {};
42
+ const { locale, timezone } = meta;
43
+ const { label, field: { type, name: additionalFieldName } } = column;
44
+ const isDateFieldWithDateFunction = isDateLikeField(type) && isAdditionalFieldWithDateFunction(additionalField);
45
+ const dateFunctionLabel = isDateFieldWithDateFunction
46
+ ? translate(dateFunctionLabels[additionalField.dateFunction])
47
+ : null;
48
+ // Additional field as aggregation
49
+ if ('aggregation' in additionalField &&
50
+ additionalField.aggregation &&
51
+ type === FieldType.NUMBER) {
52
+ return {
53
+ label: `${label}(${translate(additionalField.aggregation)})`,
54
+ renderer: typeof value === 'string' || typeof value === 'number'
55
+ ? getFormattedAggregationValue(value, additionalField.aggregation, column)
56
+ : null
57
+ };
58
+ }
59
+ // Additional field as Date part
60
+ if (count === 1 && isDateFieldWithDateFunction) {
61
+ return {
62
+ label: `${label}${dateFunctionLabel ? ` (${dateFunctionLabel})` : ''}`,
63
+ renderer: (typeof value === 'string' || typeof value === 'number') && locale && timezone ? (_jsx(DateValueDisplay, { value: value, dateFunction: additionalField.dateFunction, locale: locale, timezone: timezone })) : null
64
+ };
65
+ }
66
+ // Additional field as normal field but with multiple values.
67
+ if (count > 1) {
68
+ return {
69
+ label: `${label}${dateFunctionLabel ? ` (${dateFunctionLabel})` : ''}`,
70
+ renderer: rendererContext === 'GroupHeader' ? (_jsx(Button, { variant: 'link', onClick: (event) => {
71
+ create(withGlobalContext(GroupAdditionalFieldDataModal), {
72
+ groupHeader,
73
+ additionalField,
74
+ column
75
+ });
76
+ // Stop propagation to avoid group expand/collapse on button click
77
+ event.stopPropagation();
78
+ }, children: translate('Multiple') })) : (translate('Multiple'))
79
+ };
80
+ }
81
+ // Additional field as normal field.
82
+ column.setExecutionContext(null);
83
+ return {
84
+ label,
85
+ renderer: (_jsx(RenderingEngine, { ...column.getRenderingEngineProps(),
86
+ context: {
87
+ ...column.getContext(),
88
+ name: 'GroupAdditionalField',
89
+ getValue: () => value,
90
+ getExecutionContext: () => {
91
+ return {
92
+ getValue: () => ({ ...groupHeader.data, [additionalFieldName]: value }),
93
+ name: 'groupHeader'
94
+ };
95
+ }
96
+ } }))
97
+ };
98
+ };
99
+ const GroupAdditionalInfo = ({ additionalFieldData, columns, groupHeader, additionalField, rendererContext }) => {
100
+ const { id: fieldId } = additionalFieldData;
101
+ const column = columns.find(c => c.field.id === fieldId);
102
+ const { label, renderer } = useFormattedAdditionalFieldData(additionalFieldData, additionalField, { column: column ?? null, meta: column ? column.parent.meta : null, groupHeader }, rendererContext);
103
+ if (!column || !label || !renderer) {
104
+ return null;
105
+ }
106
+ const isGroupHeaderContext = rendererContext === 'GroupHeader';
107
+ return (_jsxs(_Fragment, { children: [_jsx(VisuallyHiddenText, { children: ', ' }), _jsxs(ConditionalEllipsisText, { ellipsis: isGroupHeaderContext, variant: isGroupHeaderContext ? 'secondary' : undefined, "data-testid": 'additional-field-label', children: [label, ":"] }), _jsx(ConditionalEllipsisText, { ellipsis: isGroupHeaderContext, variant: isGroupHeaderContext ? 'secondary' : undefined, "data-testid": 'additional-field-renderer', children: renderer })] }));
108
+ };
109
+ export default GroupAdditionalInfo;
110
+ //# sourceMappingURL=GroupAdditionalInfo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GroupAdditionalInfo.js","sourceRoot":"","sources":["../../../../Core/Components/GroupRenderer/GroupAdditionalInfo.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAA8C,MAAM,OAAO,CAAC;AAC5E,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC5F,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAoB,MAAM,gCAAgC,CAAC;AACjG,OAAO,EAAE,g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,IAAI,GAAsB,EAC/C,MAAC,uBAAuB,IACtB,QAAQ,EAAE,oBAAoB,EAC9B,OAAO,EAAE,oBAAoB,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,iBAC3C,wBAAwB,aAEnC,KAAK,SACkB,EAC1B,KAAC,uBAAuB,IACtB,QAAQ,EAAE,oBAAoB,EAC9B,OAAO,EAAE,oBAAoB,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,iBAC3C,2BAA2B,YAEtC,QAAQ,GACe,IACzB,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,mBAAmB,CAAC","sourcesContent":["import { useMemo, type ComponentType, type PropsWithChildren } from 'react';\nimport styled from 'styled-components';\n\nimport { Text, useModalManager, Button, VisuallyHiddenText } from '@pega/cosmos-react-core';\nimport { dateFunctionLabels, FieldType, type RsCoreTypes } from 'pega-repeating-structures-core';\nimport { ellipsisOverflow } from '@pega/cosmos-react-core/lib/styles/mixins';\nimport type { DateGroupAdditionalField } from 'pega-repeating-structures-core/lib/types/State.types';\n\nimport useTranslate from '../../Hooks/useTranslate';\nimport { getFormattedAggregationValue } from '../AggregateMenu';\nimport DateValueDisplay from '../DateValueDisplay';\nimport RenderingEngine from '../RenderingEngine/RenderCell';\nimport {\n resolveCellComponent,\n resolveViewComponent\n} from '../RenderingEngine/ComponentResolverFactory';\nimport GlobalContext from '../../Context/GlobalContext';\n\nimport GroupAdditionalFieldDataModal, {\n isDateLikeField,\n type GroupAdditionalFieldData\n} from './GroupAdditionalFieldDataModal';\n\ntype AdditionalFieldRendererContext = 'GroupHeader' | 'GroupHeaderTooltip';\ntype GroupAdditionalInfoProps = {\n additionalFieldData: GroupAdditionalFieldData;\n columns: RsCoreTypes.Column[];\n groupHeader: RsCoreTypes.GroupGenerator;\n additionalField: RsCoreTypes.GroupAdditionalField;\n rendererContext: AdditionalFieldRendererContext;\n};\n\nconst isAdditionalFieldWithDateFunction = (\n additionalField: RsCoreTypes.GroupAdditionalField\n): additionalField is Required<DateGroupAdditionalField> => {\n return 'dateFunction' in additionalField && Boolean(additionalField.dateFunction);\n};\n\nconst ConditionalEllipsisText = styled(Text)<{ ellipsis: boolean }>`\n ${({ ellipsis }) => ellipsis && ellipsisOverflow}\n display: inline-flex;\n min-width: 0;\n`;\n\nfunction withGlobalContext<P>(Component: ComponentType<P>) {\n return function WithGlobalContext(props: PropsWithChildren<P>) {\n const globalContext = useMemo(\n () => ({\n resolveCellComponent,\n resolveViewComponent\n }),\n []\n );\n\n return (\n <GlobalContext.Provider value={globalContext}>\n <Component {...props} />\n </GlobalContext.Provider>\n );\n };\n}\n\nexport const useFormattedAdditionalFieldData = (\n additionalFieldData: GroupAdditionalFieldData,\n additionalField: RsCoreTypes.GroupAdditionalField,\n {\n column,\n meta,\n groupHeader\n }: {\n column: RsCoreTypes.Column | null;\n meta: RsCoreTypes.Meta | null;\n groupHeader: RsCoreTypes.GroupGenerator;\n },\n rendererContext: AdditionalFieldRendererContext\n) => {\n const [translate] = useTranslate();\n const { create } = useModalManager();\n if (!column || !meta) {\n return { label: null, renderer: null };\n }\n\n const { isInstantRender } = column.parent;\n\n if (isInstantRender) {\n return { label: null, renderer: null };\n }\n\n const { value, count = 0 } = additionalFieldData || {};\n const { locale, timezone } = meta;\n const {\n label,\n field: { type, name: additionalFieldName }\n } = column;\n const isDateFieldWithDateFunction =\n isDateLikeField(type) && isAdditionalFieldWithDateFunction(additionalField);\n const dateFunctionLabel = isDateFieldWithDateFunction\n ? translate(dateFunctionLabels[additionalField.dateFunction])\n : null;\n // Additional field as aggregation\n if (\n 'aggregation' in additionalField &&\n additionalField.aggregation &&\n type === FieldType.NUMBER\n ) {\n return {\n label: `${label}(${translate(additionalField.aggregation)})`,\n renderer:\n typeof value === 'string' || typeof value === 'number'\n ? getFormattedAggregationValue(value, additionalField.aggregation, column)\n : null\n };\n }\n\n // Additional field as Date part\n if (count === 1 && isDateFieldWithDateFunction) {\n return {\n label: `${label}${dateFunctionLabel ? ` (${dateFunctionLabel})` : ''}`,\n renderer:\n (typeof value === 'string' || typeof value === 'number') && locale && timezone ? (\n <DateValueDisplay\n value={value}\n dateFunction={additionalField.dateFunction}\n locale={locale}\n timezone={timezone}\n />\n ) : null\n };\n }\n\n // Additional field as normal field but with multiple values.\n if (count > 1) {\n return {\n label: `${label}${dateFunctionLabel ? ` (${dateFunctionLabel})` : ''}`,\n renderer:\n rendererContext === 'GroupHeader' ? (\n <Button\n variant='link'\n onClick={(event: MouseEvent) => {\n create(withGlobalContext(GroupAdditionalFieldDataModal), {\n groupHeader,\n additionalField,\n column\n });\n // Stop propagation to avoid group expand/collapse on button click\n event.stopPropagation();\n }}\n >\n {translate('Multiple')}\n </Button>\n ) : (\n translate('Multiple')\n )\n };\n }\n\n // Additional field as normal field.\n column.setExecutionContext(null);\n return {\n label,\n renderer: (\n <RenderingEngine\n {...{\n ...column.getRenderingEngineProps(),\n context: {\n ...column.getContext(),\n name: 'GroupAdditionalField',\n getValue: () => value,\n getExecutionContext: () => {\n return {\n getValue: () => ({ ...groupHeader.data, [additionalFieldName]: value }),\n name: 'groupHeader'\n };\n }\n }\n }}\n />\n )\n };\n};\n\nconst GroupAdditionalInfo = ({\n additionalFieldData,\n columns,\n groupHeader,\n additionalField,\n rendererContext\n}: GroupAdditionalInfoProps) => {\n const { id: fieldId } = additionalFieldData;\n const column = columns.find(c => c.field.id === fieldId);\n\n const { label, renderer } = useFormattedAdditionalFieldData(\n additionalFieldData,\n additionalField,\n { column: column ?? null, meta: column ? column.parent.meta : null, groupHeader },\n rendererContext\n );\n\n if (!column || !label || !renderer) {\n return null;\n }\n\n const isGroupHeaderContext = rendererContext === 'GroupHeader';\n\n return (\n <>\n {/* For screen readers. */}\n <VisuallyHiddenText>{', '}</VisuallyHiddenText>\n <ConditionalEllipsisText\n ellipsis={isGroupHeaderContext}\n variant={isGroupHeaderContext ? 'secondary' : undefined}\n data-testid='additional-field-label'\n >\n {label}:\n </ConditionalEllipsisText>\n <ConditionalEllipsisText\n ellipsis={isGroupHeaderContext}\n variant={isGroupHeaderContext ? 'secondary' : undefined}\n data-testid='additional-field-renderer'\n >\n {renderer}\n </ConditionalEllipsisText>\n </>\n );\n};\n\nexport default GroupAdditionalInfo;\n"]}
@@ -0,0 +1,22 @@
1
+ export function GroupName({ view, column, groupHeader, dateFunction, customFunction }: {
2
+ view: any;
3
+ column: any;
4
+ groupHeader: any;
5
+ dateFunction: any;
6
+ customFunction: any;
7
+ }): any;
8
+ declare function GroupHeader({ groupHeader, columns }: {
9
+ groupHeader: any;
10
+ columns: any;
11
+ }): import("react/jsx-runtime").JSX.Element | null;
12
+ declare namespace GroupHeader {
13
+ namespace propTypes {
14
+ let columns: PropTypes.Validator<any[]>;
15
+ let groupHeader: PropTypes.Validator<{
16
+ [x: string]: any;
17
+ }>;
18
+ }
19
+ }
20
+ export default GroupHeader;
21
+ import PropTypes from 'prop-types';
22
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../Core/Components/GroupRenderer/index.jsx"],"names":[],"mappings":"AA+MA;;;;;;QAwCC;AA2GD;;;mDAqIC;;;;;;;;;;sBAveqB,YAAY"}
@@ -1,20 +1,19 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import PropTypes from 'prop-types';
3
- import { useRef } from 'react';
3
+ import { useRef, useCallback } from 'react';
4
4
  import styled from 'styled-components';
5
- import { Flex, Icon, Tooltip, useElement, Text, MetaList } from '@pega/cosmos-react-core';
5
+ import { Icon, Text, MetaList, Tooltip, VisuallyHiddenText, Flex } from '@pega/cosmos-react-core';
6
6
  import BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';
7
7
  import { getGroupFromKey } from 'pega-ui-list-data-apis';
8
- import { dateFunctionLabels, FieldType } from 'pega-repeating-structures-core';
9
8
  import { StyledMetaListItem } from '@pega/cosmos-react-core/lib/components/MetaList/MetaList';
10
- import { createClassName as cx } from '../Utils';
11
- import useTranslate from '../Hooks/useTranslate';
12
- import { customFunctions, intervalGroupingBoundaries } from '../constants';
13
- import AggregatorCell from './AggregatorCell';
14
- import RenderingEngine from './RenderingEngine/RenderCell';
15
- import DateValueDisplay from './DateValueDisplay';
16
- import TestIdConstants from './TestIdConstants';
17
- import { getFormattedAggregationValue } from './AggregateMenu';
9
+ import { createClassName as cx } from '../../Utils';
10
+ import useTranslate from '../../Hooks/useTranslate';
11
+ import { customFunctions, intervalGroupingBoundaries } from '../../constants';
12
+ import AggregatorCell from '../AggregatorCell';
13
+ import RenderingEngine from '../RenderingEngine/RenderCell';
14
+ import DateValueDisplay from '../DateValueDisplay';
15
+ import TestIdConstants from '../TestIdConstants';
16
+ import GroupAdditionalInfo from './GroupAdditionalInfo';
18
17
  const groupheaderleftdisplacement = headerLevel => `${(headerLevel.level + 1) * 0.5}rem`;
19
18
  /**
20
19
  * TODO: remove currentColor style after cosmos fixes the issue
@@ -143,113 +142,28 @@ const StyledGroupHeader = styled.div `
143
142
  background-color: var(--group-bg-color);
144
143
  }
145
144
  `;
146
- const StyledText = styled(Text) `
147
- display: inline-flex;
148
- white-space: nowrap;
149
- text-overflow: ellipsis;
150
- overflow: hidden;
151
- min-width: 0;
152
- `;
153
145
  const StyledMetaList = styled(MetaList) `
154
146
  margin-inline-start: 0;
147
+
148
+ /* Overrides default MetaList padding and margin which was causing text-overflow issues */
149
+ margin: 0;
150
+ padding: 0 0.3rem;
155
151
  `;
156
152
  const GroupAdditionalInfoSeparator = styled(StyledMetaListItem) `
157
153
  margin-inline-start: 0.3rem;
158
154
  `;
159
155
  /**
160
- * For
161
- * @param {*} additionalFieldData
162
- * @param {*} additionalField
163
- * @param {*} param2
164
- * @returns
156
+ * Generates unique ARIA label IDs for accessibility.
157
+ * - groupLabelId: for the group label (e.g., "Status:")
158
+ * - groupNameId: for the group value (e.g., "Open")
159
+ * - additionalInfoIds: for any additional fields shown in the group header
160
+ * These IDs are used in aria-labelledby to improve screen reader support.
165
161
  */
166
- /**
167
- * Formats additional field data based on its type and properties.
168
- *
169
- * @typedef {NonNullable<
170
- * Awaited<
171
- * ReturnType<
172
- * NonNullable<
173
- * import('pega-repeating-structures-core').RsCoreTypes.ApiContext['fetchGroupedInfo']
174
- * >
175
- * >
176
- * >[number]['additionalFieldsData']
177
- * >[number]} AdditionalFieldData
178
- *
179
- * @typedef {import('pega-repeating-structures-core').RsCoreTypes.Column} Column
180
- * @typedef {import('pega-repeating-structures-core').RsCoreTypes.Meta} Meta
181
- * @typedef {import('pega-repeating-structures-core').RsCoreTypes.GroupGenerator} GroupGenerator
182
- *
183
- * @param {AdditionalFieldData} additionalFieldData - The data for the additional field.
184
- * @param {import('pega-repeating-structures-core').RsCoreTypes.GroupAdditionalField} additionalField - The configuration for the additional field.
185
- * @param {{column: Column, meta: Meta, groupHeader: GroupGenerator}} config - Additional config for formatting.
186
- * @param {Column} config.column - The column configuration.
187
- * @param {Meta} config.meta - RS Meta.
188
- * @param {GroupGenerator} config.groupHeader - The group header data.
189
- *
190
- * @returns {{label: string, renderer: ReactNode | string}} An object containing the formatted label and renderer.
191
- * @returns {string} returns.label - The formatted label for the additional field.
192
- * @returns {ReactNode | string} returns.renderer - The React component or value to render.
193
- */
194
- const getFormattedAdditionalFieldData = (additionalFieldData, additionalField, { column, meta, groupHeader, translate }) => {
195
- const { value, count = 0 } = additionalFieldData || {};
196
- const { aggregation, dateFunction } = additionalField || {};
197
- const { locale, timezone } = meta;
198
- const { label, field: { type } } = column;
199
- // Additional field as aggregation
200
- if (aggregation && type === FieldType.NUMBER) {
201
- return {
202
- label: `${label}(${translate(aggregation)})`,
203
- renderer: getFormattedAggregationValue(value, aggregation, column)
204
- };
205
- }
206
- // Additional field as Date part
207
- if (count <= 1 &&
208
- dateFunction &&
209
- [FieldType.DATE, FieldType.DATE_TIME, FieldType.DATE_ONLY].includes(type)) {
210
- return {
211
- label: `${label}(${translate(dateFunctionLabels[dateFunction])})`,
212
- renderer: (_jsx(DateValueDisplay, { value: value, dateFunction: dateFunction, locale: locale, timezone: timezone }))
213
- };
214
- }
215
- // Additional field as normal field but with multiple values.
216
- if (count > 1) {
217
- return {
218
- label: `${label}${dateFunction && [FieldType.DATE, FieldType.DATE_TIME, FieldType.DATE_ONLY].includes(type)
219
- ? `(${translate(dateFunctionLabels[dateFunction])})`
220
- : ''}`,
221
- renderer: translate('Multiple')
222
- };
223
- }
224
- // Additional field as normal field.
225
- column.setExecutionContext(null);
226
- return {
227
- label,
228
- renderer: (_jsx(RenderingEngine, { ...column.getRenderingEngineProps(),
229
- context: {
230
- ...column.getContext(),
231
- name: 'GroupAdditionalField',
232
- getValue: () => value,
233
- getExecutionContext: () => {
234
- return { getValue: () => groupHeader.data, name: 'groupHeader' };
235
- }
236
- } }))
237
- };
238
- };
239
- const GroupAdditionalInfo = ({ additionalFieldData, columns, groupHeader, additionalField }) => {
240
- const [infoRef, setInfoRef] = useElement(null);
241
- const [translate] = useTranslate();
242
- const { id } = additionalFieldData;
243
- const column = columns.find(c => c.field.id === id);
244
- if (!column)
245
- return null;
246
- const { meta, isInstantRender } = column.parent;
247
- //
248
- if (isInstantRender) {
249
- return null;
250
- }
251
- const { label, renderer } = getFormattedAdditionalFieldData(additionalFieldData, additionalField, { column, meta, groupHeader, translate });
252
- return (_jsxs(_Fragment, { children: [_jsxs(Flex, { container: { gap: 0.5 }, ref: setInfoRef, children: [_jsxs(StyledText, { variant: 'secondary', "data-testid": 'additional-field-label', children: [label, ":"] }), _jsx(StyledText, { variant: 'secondary', "data-testid": 'additional-field-renderer', children: renderer })] }), _jsxs(Tooltip, { smart: true, target: infoRef, showDelay: 'short', hideDelay: 'none', children: [_jsx(Text, { children: `${label}: ` }), _jsx(Text, { children: renderer })] })] }));
162
+ const getAriaLabelIds = (uniqueId, additionalFields) => {
163
+ const groupLabelId = `group-label-${uniqueId}`;
164
+ const groupNameId = `group-name-${uniqueId}`;
165
+ const additionalInfoIds = additionalFields?.map(additionalField => `group-additional-info-${uniqueId}-${additionalField.id}` /* used in aria-labelledby */);
166
+ return { groupLabelId, groupNameId, additionalInfoIds };
253
167
  };
254
168
  /**
255
169
  * Returns label for interval grouping based on interval and boundaries
@@ -279,7 +193,7 @@ function buildIntervalGroupingLabel(value, customFunction, translate) {
279
193
  }
280
194
  return `${lowerValue} ${translate('to')} ${upperValue}`;
281
195
  }
282
- function GroupName({ view, column, groupHeader, dateFunction, customFunction }) {
196
+ export function GroupName({ view, column, groupHeader, dateFunction, customFunction }) {
283
197
  const [translate] = useTranslate();
284
198
  const { locale, timezone } = view.meta;
285
199
  const isRangeGrouping = customFunction?.type === customFunctions.RANGE_GROUPING;
@@ -307,39 +221,85 @@ function GroupName({ view, column, groupHeader, dateFunction, customFunction })
307
221
  };
308
222
  return _jsx(RenderingEngine, { ...columnRendererProps });
309
223
  }
224
+ /**
225
+ * Tooltip content for the group header.
226
+ * Shows the group label, value, and any additional fields.
227
+ * Used for hover/focus tooltips on the group header button.
228
+ */
229
+ function GroupHeaderToolTip({ column, groupHeader, columns, additionalFields, target }) {
230
+ const view = column.parent;
231
+ const { dateFunction, customFunction } = getGroupFromKey(groupHeader.groupBy, view.state.groups) ?? {};
232
+ const formatter = view.getFormatterByKey('Integer');
233
+ const { locale } = view.meta;
234
+ const groupCountFormatted = formatter
235
+ ? formatter(groupHeader.count, { locale })
236
+ : groupHeader.count;
237
+ return (_jsxs(Tooltip, { smart: true, target: target, showDelay: 'short', hideDelay: 'none', describeTarget: false, children: [_jsxs(Text, { children: [!column.field.hideGroupColumnNameLabel && groupHeader.label, ": "] }), _jsxs(Text, { children: [_jsx(GroupName, { view: view, column: column, groupHeader: groupHeader, dateFunction: dateFunction, customFunction: customFunction }), _jsx(Text, { children: ` (${groupCountFormatted})` })] }), !!(groupHeader.additionalFieldsData?.length && additionalFields.length) && (_jsx(_Fragment, { children: groupHeader.additionalFieldsData?.map(additionalFieldData => {
238
+ return (_jsxs(_Fragment, { children: [' • ', _jsx(GroupAdditionalInfo, { groupHeader: groupHeader, additionalField: additionalFields.find(additionalField => additionalField.id === additionalFieldData.id), columns: columns, additionalFieldData: additionalFieldData, rendererContext: 'GroupHeaderTooltip' })] }));
239
+ }) }))] }));
240
+ }
241
+ /**
242
+ * Renders the main group header label and count.
243
+ * - Shows the group label (e.g., "Status:") unless hidden by column config.
244
+ * - Shows the group value and item count.
245
+ * - Uses ARIA IDs for accessibility.
246
+ */
247
+ function GroupHeaderLabel({ column, groupHeader }) {
248
+ const view = column.parent;
249
+ const { dateFunction, customFunction } = getGroupFromKey(groupHeader.groupBy, view.state.groups) ?? {};
250
+ const formatter = view.getFormatterByKey('Integer');
251
+ const { locale } = view.meta;
252
+ const groupCountFormatted = formatter
253
+ ? formatter(groupHeader.count, { locale })
254
+ : groupHeader.count;
255
+ const { groupLabelId, groupNameId } = getAriaLabelIds(groupHeader.uniqueId);
256
+ 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" })] })] }));
257
+ }
310
258
  // NOTE: While making any changes in GroupRenderer.jsx, also make similar changes in HierarchicalGroupRenderer.jsx file if applicable
311
259
  export default function GroupHeader({ groupHeader, columns }) {
312
260
  const buttonRef = useRef();
261
+ const view = columns[0].parent;
262
+ const toggleGroup = useCallback(() => {
263
+ if (groupHeader.count > 0) {
264
+ view.type.toggleGroupExpansion({ groupHeader });
265
+ }
266
+ }, [groupHeader, view]);
313
267
  // TODO: This we are adding temporary to show freeze border until we make group header rendering change
314
268
  // when we will pick up aggregation.
315
269
  if (!groupHeader.isVisible)
316
270
  return null;
317
- const view = columns[0].parent;
318
271
  // If grouping by a regular column (i.e. without a dateFunction), determine props for the renderer
319
- const { columnId, dateFunction, customFunction, additionalFields = [] } = getGroupFromKey(groupHeader.groupBy, view.state.groups) ?? {};
272
+ const { columnId, additionalFields = [] } = getGroupFromKey(groupHeader.groupBy, view.state.groups) ?? {};
320
273
  // if state.groups is not yet prepared/updated, then getGroupFromKey will return undefined
321
274
  if (!columnId) {
322
275
  return null;
323
276
  }
324
277
  const column = columns.find(c => c.field.id === columnId);
325
- const formatter = view.getFormatterByKey('Integer');
326
- const { locale } = view.meta;
327
- const groupCountFormatted = formatter
328
- ? formatter(groupHeader.count, { locale })
329
- : groupHeader.count;
330
278
  const isAggregationApplied = columns.filter(c => !c.hidden).some(c => c.aggregated);
279
+ // Generate unique ARIA label IDs for accessibility
280
+ const { groupLabelId, groupNameId, additionalInfoIds = [] } = getAriaLabelIds(groupHeader.uniqueId, additionalFields);
281
+ let groupAdditionalInfo;
282
+ // Prepare additional info components if present
283
+ if (groupHeader.additionalFieldsData?.length && additionalFields.length) {
284
+ groupAdditionalInfo = groupHeader.additionalFieldsData.map((additionalFieldsData, idx) => (_jsx(Flex, { container: { gap: 0.5 }, id: additionalInfoIds[idx], children: _jsx(GroupAdditionalInfo, { additionalFieldData: additionalFieldsData, additionalField: additionalFields.find(additionalField => additionalField.id === additionalFieldsData.id), columns: columns, groupHeader: groupHeader, rendererContext: 'GroupHeader' }) })));
285
+ }
331
286
  // FIXME: Import rather than COPY, i would rather
332
287
  return (_jsxs(StyledGroupHeader, { groupHeader: groupHeader, className: cx('row group-header-row sticky-group-header'), "data-test-id": 'groupHeader', "data-testid": TestIdConstants.groupHeader, isAggregationApplied: isAggregationApplied, role: 'row', onFocus: e => {
333
288
  if (buttonRef.current && !e.currentTarget.contains(e.relatedTarget)) {
334
289
  e.preventDefault();
335
290
  buttonRef.current.focus();
336
291
  }
337
- }, children: [_jsx("div", { className: 'stickyGroupHeader', children: _jsxs(BareButton, { ref: buttonRef, "aria-label": `${column.field.hideGroupColumnNameLabel ? '' : groupHeader.label} ${groupHeader.name}, ${groupCountFormatted} items`, "aria-expanded": !!groupHeader.isExpanded, style: {
338
- paddingRight: 'var(--group-left)'
339
- }, onClick: () => groupHeader.count > 0 && view.type.toggleGroupExpansion({ groupHeader }), tabIndex: -1, icon: true, children: [groupHeader.count > 0 &&
340
- (groupHeader.isExpanded ? _jsx(Icon, { name: 'caret-down' }) : _jsx(Icon, { name: 'caret-right' })), _jsxs("div", { className: 'group-wrapper', 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}`, 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, children: [_jsx(GroupName, { view: view, column: column, groupHeader: groupHeader, dateFunction: dateFunction, customFunction: customFunction }), _jsx("span", { className: 'group-count', children: ` (${groupCountFormatted})` })] }), !!(groupHeader.additionalFieldsData?.length && additionalFields.length) && (_jsxs(_Fragment, { children: [_jsx(Text, { "aria-hidden": true, variant: 'secondary', as: GroupAdditionalInfoSeparator, children: "\u2022" }), _jsx(StyledMetaList, { wrapItems: false, items: [
341
- ...groupHeader.additionalFieldsData.map(additionalFieldsData => (_jsx(GroupAdditionalInfo, { additionalFieldData: additionalFieldsData, additionalField: additionalFields.find(additionalField => additionalField.id === additionalFieldsData.id), columns: columns, groupHeader: groupHeader })))
342
- ] })] }))] })] }) }), _jsx("div", { className: 'group-header-aggregation-row', children: columns.map(c => {
292
+ }, children: [_jsxs("div", { className: 'stickyGroupHeader', children: [_jsxs(BareButton, { ref: buttonRef, "aria-labelledby": [groupLabelId, groupNameId, ...additionalInfoIds].join(' '), "aria-expanded": !!groupHeader.isExpanded, style: {
293
+ paddingRight: 'var(--group-left)'
294
+ }, onClick: () => toggleGroup(), onKeyDown: event => {
295
+ if (event.key === 'Enter') {
296
+ // Prevent capturing of group header toggle click to its child renderers.
297
+ event.preventDefault();
298
+ event.stopPropagation();
299
+ toggleGroup();
300
+ }
301
+ }, tabIndex: -1, icon: true, children: [groupHeader.count > 0 &&
302
+ (groupHeader.isExpanded ? _jsx(Icon, { name: 'caret-down' }) : _jsx(Icon, { name: 'caret-right' })), _jsxs("div", { className: 'group-wrapper', children: [_jsx(GroupHeaderLabel, { column: column, groupHeader: groupHeader }), groupAdditionalInfo && (_jsxs(_Fragment, { children: [_jsx(Text, { variant: 'secondary', as: GroupAdditionalInfoSeparator, children: "\u2022" }), _jsx(StyledMetaList, { wrapItems: false, items: groupAdditionalInfo })] }))] })] }), buttonRef.current && (_jsx(GroupHeaderToolTip, { target: buttonRef.current, column: column, groupHeader: groupHeader, columns: columns, additionalFields: additionalFields }))] }), _jsx("div", { className: 'group-header-aggregation-row', children: columns.map(c => {
343
303
  const cxt = {
344
304
  getValue: () => groupHeader?.aggregation?.[c.field.name]?.[c.aggregationType?.toLowerCase()]
345
305
  };
@@ -352,4 +312,4 @@ GroupHeader.propTypes = {
352
312
  columns: PropTypes.arrayOf(PropTypes.any).isRequired,
353
313
  groupHeader: PropTypes.objectOf(PropTypes.any).isRequired
354
314
  };
355
- //# sourceMappingURL=GroupRenderer.js.map
315
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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;AAC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GAAI,EAE7D,mBAAmB,IAAI,CACtB,8BACE,KAAC,IAAI,IAAC,OAAO,EAAC,WAAW,EAAC,EAAE,EAAE,4BAA4B,uBAEnD,EACP,KAAC,cAAc,IAAC,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,mBAAmB,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,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, useCallback } from 'react';\nimport styled 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';\nimport { StyledMetaListItem } from '@pega/cosmos-react-core/lib/components/MetaList/MetaList';\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/**\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 &:has(button[aria-expanded='true']) {\n filter: ${props => props.theme.base.shadow['low-filter']};\n }\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 .group-count {\n font-weight: ${props => props.theme.base['font-weight'].bold};\n white-space: pre;\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 &::before {\n content: '';\n position: sticky;\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 &.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, theme }) =>\n groupHeader.count === 0 ? `calc(${theme.base.spacing} * 2.25)` : '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 }) => theme.base.shadow['focus-inset']};\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 .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\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(StyledMetaListItem)`\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.map((additionalFieldsData, idx) => (\n <Flex container={{ gap: 0.5 }} id={additionalInfoIds[idx]}>\n <GroupAdditionalInfo\n additionalFieldData={additionalFieldsData}\n additionalField={additionalFields.find(\n additionalField => additionalField.id === additionalFieldsData.id\n )}\n columns={columns}\n groupHeader={groupHeader}\n rendererContext='GroupHeader'\n />\n </Flex>\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}\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 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.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"]}
@@ -8,7 +8,7 @@ import useTranslate from '../../Hooks/useTranslate';
8
8
  import { StyledSkeletonRow } from '../../Views/Table/SkeletonRows';
9
9
  import getPaginationInfo from './Pagination';
10
10
  import useScroll from './UseScroll';
11
- import { getCurrentEstimation, updateRowContainerTop, setAttributesOnItems, isViewNotFilled, getRecordCountForLayoutPaint, getValueWithUnit, getMaxHeight } from './utility';
11
+ import { getCurrentEstimation, updateRowContainerTop, setAttributesOnItems, isViewNotFilled, getRecordCountForLayoutPaint, getValueWithUnit, getMaxHeight, getPContainerClientWidth } from './utility';
12
12
  import useResizeObserver from './UseResizeObserver';
13
13
  function getBContainerMinHeight(props) {
14
14
  return props.$style.renderFooter ? `calc(100% - ${2 * props.$style.itemHeight + 1}px) ` : '0';
@@ -214,6 +214,12 @@ const Virtualize = forwardRef(({ id, viewHeight, viewWidth, totalRecordCount, it
214
214
  getRowContainer,
215
215
  getBContainer
216
216
  ]);
217
+ // Added this block to overcome clipping issue for group header.
218
+ const onPContainerDimensionUpdate = useCallback(() => {
219
+ getPContainer()?.style.setProperty('--container-width', `${getPContainerClientWidth(getPContainer())}px`);
220
+ }, [getPContainer]);
221
+ // observe on pContainer to adjust the width of row container.
222
+ useResizeObserver(getPContainer, onPContainerDimensionUpdate);
217
223
  // On mount that means state is not initialized yet, trigger pagination.
218
224
  // or whenever count changes or width /height of view port changes, if view is not filled with data, get indexes again.
219
225
  useEffect(() => {
@@ -1 +1 @@
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,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,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,4BAA4B,EAC5B,gBAAgB,EAChB,YAAY,EACb,MAAM,WAAW,CAAC;AACnB,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AAEpD,SAAS,sBAAsB,CAAC,KAAK;IACnC,OAAO,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,eAAe,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,UAAU,GAAG,CAAC,MAAM,CAA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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 useTranslate from '../../Hooks/useTranslate';\nimport { StyledSkeletonRow } from '../../Views/Table/SkeletonRows';\n\nimport getPaginationInfo from './Pagination';\nimport useScroll from './UseScroll';\nimport {\n getCurrentEstimation,\n updateRowContainerTop,\n setAttributesOnItems,\n isViewNotFilled,\n getRecordCountForLayoutPaint,\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 &: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') &&\n props.$style.height?.startsWith?.('auto')\n ? 'relative'\n : 'sticky'};\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 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 isFetching,\n rowContainerClass,\n children,\n renderHeader,\n renderFooter,\n state,\n bufferMultiplier,\n viewMaxHeight,\n showLoadingIndicator,\n renderEmptyRecords\n },\n inputRef\n ) => {\n const [rContainerDimensionUpdate, setRContainerDimensionUpdate] = useState();\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 if (!state) return;\n getPContainer().scrollTop = 0;\n vi.pInfo = getPaginationInfo(\n getPContainer(),\n getRecordCountForLayoutPaint(totalRecordCount),\n vi,\n false,\n true\n );\n callback({ ...vi.pInfo.view, id }, { takeLatestAction: true });\n }, [id, vi, state, getPContainer]);\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, '100%'),\n height: getValueWithUnit(viewHeight, 'auto')\n }),\n [viewWidth, viewHeight]\n );\n\n const maxHeight = useMemo(() => getMaxHeight(viewMaxHeight), [viewMaxHeight]);\n\n const minHeight = useMemo(\n () => (totalRecordCount === 0 ? '100px' : 'auto'),\n [totalRecordCount]\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 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 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 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 (rowContainerHeight && rowContainerWidth) setRContainerDimensionUpdate({});\n }, [getRowContainer]);\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 if (scrollTop >= 0) {\n pContainer.scrollTop = scrollTop;\n }\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 // 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 && !isFetching && !isEmpty(totalRecordCount)) {\n if (\n isViewNotFilled(\n getRecordCountForLayoutPaint(totalRecordCount),\n vi,\n getPContainer(),\n renderHeader\n )\n )\n getPagination(false, true);\n else {\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 role='rowgroup'\n >\n {/** Do not add any other element in row-container apart from the rows as it will generate incorrect estimations */}\n {totalRecordCount === 0 && !isFetching ? null : 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 ? renderEmptyRecords && renderEmptyRecords() : 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 isFetching: PropTypes.bool,\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 viewMaxHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n showLoadingIndicator: PropTypes.bool,\n renderEmptyRecords: PropTypes.func\n};\n\nVirtualize.defaultProps = {\n bufferMultiplier: 2,\n callback: () => {},\n isFetching: false,\n rowContainerClass: '',\n viewWidth: 0,\n itemHeight: 40,\n renderHeader: null,\n renderFooter: null,\n state: undefined,\n totalRecordCount: undefined,\n viewMaxHeight: undefined,\n showLoadingIndicator: false,\n renderEmptyRecords: null\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,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,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,4BAA4B,EAC5B,gBAAgB,EAChB,YAAY,EACZ,wBAAwB,EACzB,MAAM,WAAW,CAAC;AACnB,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AAEpD,SAAS,sBAAsB,CAAC,KAAK;IACnC,OAAO,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,eAAe,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,UAAU,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC;AAChG,CAAC;AAED,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAA;;;wBAGX,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS;mBACpC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK;oBAC1B,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM;wBACxB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AAC;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 useTranslate from '../../Hooks/useTranslate';\nimport { StyledSkeletonRow } from '../../Views/Table/SkeletonRows';\n\nimport getPaginationInfo from './Pagination';\nimport useScroll from './UseScroll';\nimport {\n getCurrentEstimation,\n updateRowContainerTop,\n setAttributesOnItems,\n isViewNotFilled,\n getRecordCountForLayoutPaint,\n getValueWithUnit,\n getMaxHeight,\n getPContainerClientWidth\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 &: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') &&\n props.$style.height?.startsWith?.('auto')\n ? 'relative'\n : 'sticky'};\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 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 isFetching,\n rowContainerClass,\n children,\n renderHeader,\n renderFooter,\n state,\n bufferMultiplier,\n viewMaxHeight,\n showLoadingIndicator,\n renderEmptyRecords\n },\n inputRef\n ) => {\n const [rContainerDimensionUpdate, setRContainerDimensionUpdate] = useState();\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 if (!state) return;\n getPContainer().scrollTop = 0;\n vi.pInfo = getPaginationInfo(\n getPContainer(),\n getRecordCountForLayoutPaint(totalRecordCount),\n vi,\n false,\n true\n );\n callback({ ...vi.pInfo.view, id }, { takeLatestAction: true });\n }, [id, vi, state, getPContainer]);\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, '100%'),\n height: getValueWithUnit(viewHeight, 'auto')\n }),\n [viewWidth, viewHeight]\n );\n\n const maxHeight = useMemo(() => getMaxHeight(viewMaxHeight), [viewMaxHeight]);\n\n const minHeight = useMemo(\n () => (totalRecordCount === 0 ? '100px' : 'auto'),\n [totalRecordCount]\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 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 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 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\n // trigger virtualizer operations only when row container has some height and width\n if (rowContainerHeight && rowContainerWidth) setRContainerDimensionUpdate({});\n }, [getRowContainer]);\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 if (scrollTop >= 0) {\n pContainer.scrollTop = scrollTop;\n }\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 // Added this block to overcome clipping issue for group header.\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 && !isFetching && !isEmpty(totalRecordCount)) {\n if (\n isViewNotFilled(\n getRecordCountForLayoutPaint(totalRecordCount),\n vi,\n getPContainer(),\n renderHeader\n )\n )\n getPagination(false, true);\n else {\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 role='rowgroup'\n >\n {/** Do not add any other element in row-container apart from the rows as it will generate incorrect estimations */}\n {totalRecordCount === 0 && !isFetching ? null : 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 ? renderEmptyRecords && renderEmptyRecords() : 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 isFetching: PropTypes.bool,\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 viewMaxHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n showLoadingIndicator: PropTypes.bool,\n renderEmptyRecords: PropTypes.func\n};\n\nVirtualize.defaultProps = {\n bufferMultiplier: 2,\n callback: () => {},\n isFetching: false,\n rowContainerClass: '',\n viewWidth: 0,\n itemHeight: 40,\n renderHeader: null,\n renderFooter: null,\n state: undefined,\n totalRecordCount: undefined,\n viewMaxHeight: undefined,\n showLoadingIndicator: false,\n renderEmptyRecords: null\n};\n\nVirtualize.displayName = 'Virtualize';\n\nexport default memo(Virtualize);\n"]}
@@ -1,7 +1,7 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import defaultTranslations from '../Localization/defaultTranslations';
3
3
  export type RepeatingStructureTranslationPack = Readonly<typeof defaultTranslations>;
4
- interface LocalizationContextValue {
4
+ export interface LocalizationContextValue {
5
5
  translate: <T extends string | string[]>(rawString: T) => T;
6
6
  }
7
7
  declare const LocalizationContext: import("react").Context<LocalizationContextValue>;
@@ -1 +1 @@
1
- {"version":3,"file":"LocalizationContext.d.ts","sourceRoot":"","sources":["../../../Core/Context/LocalizationContext.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,OAAO,mBAAmB,MAAM,qCAAqC,CAAC;AAEtE,MAAM,MAAM,iCAAiC,GAAG,QAAQ,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACrF,UAAU,wBAAwB;IAChC,SAAS,EAAE,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,EAAE,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC;CAC7D;AAED,QAAA,MAAM,mBAAmB,mDAEvB,CAAC;AACH,eAAe,mBAAmB,CAAC;AAEnC,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,2CA6BzE"}
1
+ {"version":3,"file":"LocalizationContext.d.ts","sourceRoot":"","sources":["../../../Core/Context/LocalizationContext.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,OA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CAAC,GAA8C,CAAC;QAC/E,CAAC,CAAC,GAAG,CAAC;IAEV,MAAM,SAAS,GAAG,WAAW,CAC3B,CAA8B,SAAY,EAAK,EAAE;QAC/C,OAAO,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;YAC7B,CAAC,CAAE,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,eAAe,CAAC,GAAG,CAAC,CAAO;YACnD,CAAC,CAAE,eAAe,CAAC,SAAS,CAAO,CAAC;IACxC,CAAC,EACD,CAAC,6BAA6B,CAAC,CAChC,CAAC;IAEF,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAClE,OAAO,CACL,KAAC,mBAAmB,CAAC,QAAQ,IAAC,KAAK,EAAE,aAAa,YAAG,QAAQ,GAAgC,CAC9F,CAAC;AACJ,CAAC","sourcesContent":["import { createContext, useCallback, useMemo } from 'react';\nimport type { ReactNode } from 'react';\n\nimport { useConfiguration } from '@pega/cosmos-react-core';\n\nimport defaultTranslations from '../Localization/defaultTranslations';\n\nexport type RepeatingStructureTranslationPack = Readonly<typeof defaultTranslations>;\ninterface LocalizationContextValue {\n translate: <T extends string | string[]>(rawString: T) => T;\n}\n\nconst LocalizationContext = createContext<LocalizationContextValue>({\n translate: <T extends string | string[]>(rawString: T) => rawString\n});\nexport default LocalizationContext;\n\nexport function LocalizationProvider({ children }: { children: ReactNode }) {\n const { translations } = useConfiguration();\n const repeatingStructureTranslation = useMemo(\n () => ({\n ...defaultTranslations,\n // TODO: until translations pack is updated to have lists key specific to lists-lib static translations, we have to type cast.\n ...('lists' in translations && (translations.lists as RepeatingStructureTranslationPack))\n }),\n []\n );\n\n const translateString = (str: string): string =>\n str in repeatingStructureTranslation\n ? repeatingStructureTranslation[str as keyof RepeatingStructureTranslationPack]\n : str;\n\n const translate = useCallback(\n <T extends string | string[]>(rawString: T): T => {\n return Array.isArray(rawString)\n ? (rawString.map(str => translateString(str)) as T)\n : (translateString(rawString) as T);\n },\n [repeatingStructureTranslation]\n );\n\n const providerValue = useMemo(() => ({ translate }), [translate]);\n return (\n <LocalizationContext.Provider value={providerValue}>{children}</LocalizationContext.Provider>\n );\n}\n"]}
1
+ {"version":3,"file":"LocalizationContext.js","sourceRoot":"","sources":["../../../Core/Context/LocalizationContext.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAG5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,mBAAmB,MAAM,qCAAqC,CAAC;AAOtE,MAAM,mBAAmB,GAAG,aAAa,CAA2B;IAClE,SAAS,EAAE,CAA8B,SAAY,EAAE,EAAE,CAAC,SAAS;CACpE,CAAC,CAAC;AACH,eAAe,mBAAmB,CAAC;AAEnC,MAAM,UAAU,oBAAoB,CAAC,EAAE,QAAQ,EAA2B;IACxE,MAAM,EAAE,YAAY,EAAE,GAAG,gBAAgB,EAAE,CAAC;IAC5C,MAAM,6BAA6B,GAAG,OAAO,CAC3C,GAAG,EAAE,CAAC,CAAC;QACL,GAAG,mBAAmB;QACtB,8HAA8H;QAC9H,GAAG,CAAC,OAAO,IAAI,YAAY,IAAK,YAAY,CAAC,KAA2C,CAAC;KAC1F,CAAC,EACF,EAAE,CACH,CAAC;IAEF,MAAM,eAAe,GAAG,CAAC,GAAW,EAAU,EAAE,CAC9C,GAAG,IAAI,6BAA6B;QAClC,CAAC,CAAC,6BAA6B,CAAC,GAA8C,CAAC;QAC/E,CAAC,CAAC,GAAG,CAAC;IAEV,MAAM,SAAS,GAAG,WAAW,CAC3B,CAA8B,SAAY,EAAK,EAAE;QAC/C,OAAO,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC;YAC7B,CAAC,CAAE,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,eAAe,CAAC,GAAG,CAAC,CAAO;YACnD,CAAC,CAAE,eAAe,CAAC,SAAS,CAAO,CAAC;IACxC,CAAC,EACD,CAAC,6BAA6B,CAAC,CAChC,CAAC;IAEF,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAClE,OAAO,CACL,KAAC,mBAAmB,CAAC,QAAQ,IAAC,KAAK,EAAE,aAAa,YAAG,QAAQ,GAAgC,CAC9F,CAAC;AACJ,CAAC","sourcesContent":["import { createContext, useCallback, useMemo } from 'react';\nimport type { ReactNode } from 'react';\n\nimport { useConfiguration } from '@pega/cosmos-react-core';\n\nimport defaultTranslations from '../Localization/defaultTranslations';\n\nexport type RepeatingStructureTranslationPack = Readonly<typeof defaultTranslations>;\nexport interface LocalizationContextValue {\n translate: <T extends string | string[]>(rawString: T) => T;\n}\n\nconst LocalizationContext = createContext<LocalizationContextValue>({\n translate: <T extends string | string[]>(rawString: T) => rawString\n});\nexport default LocalizationContext;\n\nexport function LocalizationProvider({ children }: { children: ReactNode }) {\n const { translations } = useConfiguration();\n const repeatingStructureTranslation = useMemo(\n () => ({\n ...defaultTranslations,\n // TODO: until translations pack is updated to have lists key specific to lists-lib static translations, we have to type cast.\n ...('lists' in translations && (translations.lists as RepeatingStructureTranslationPack))\n }),\n []\n );\n\n const translateString = (str: string): string =>\n str in repeatingStructureTranslation\n ? repeatingStructureTranslation[str as keyof RepeatingStructureTranslationPack]\n : str;\n\n const translate = useCallback(\n <T extends string | string[]>(rawString: T): T => {\n return Array.isArray(rawString)\n ? (rawString.map(str => translateString(str)) as T)\n : (translateString(rawString) as T);\n },\n [repeatingStructureTranslation]\n );\n\n const providerValue = useMemo(() => ({ translate }), [translate]);\n return (\n <LocalizationContext.Provider value={providerValue}>{children}</LocalizationContext.Provider>\n );\n}\n"]}
package/lib/types.d.ts CHANGED
@@ -3,6 +3,8 @@ import type { RepeatingStructuresProps, RsStyleFormat as RsStyleFormatType } fro
3
3
  export declare namespace RSTypes {
4
4
  /** Group configuration on repeating structure state */
5
5
  type Group = RsCoreTypes.Group;
6
+ /** Group Additional field configuration for a group. */
7
+ type GroupAdditionalField = RsCoreTypes.GroupAdditionalField;
6
8
  /** Metadata for field */
7
9
  type FieldDef = RsCoreTypes.FieldDef;
8
10
  /** Group filter from the repeating structure state */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAElE,OAAO,KAAK,EACV,wBAAwB,EACxB,aAAa,IAAI,iBAAiB,EACnC,MAAM,uCAAuC,CAAC;AAE/C,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAE/B,uDAAuD;IACvD,KAAY,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC;IAEtC,yBAAyB;IACzB,KAAY,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC;IAE5C,sDAAsD;IACtD,KAAY,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAE5E,sDAAsD;IACtD,KAAY,IAAI,GAAG,WAAW,CAAC,WAAW,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAErE,wBAAwB;IACxB,KAAY,eAAe,GAAG,WAAW,CAAC,WAAW,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAE3F,mDAAmD;IACnD,KAAY,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAE/E,sEAAsE;IACtE,KAAY,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC;IAEpC;OACG;IACH,KAAY,UAAU,GAAG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G,WAAW,CAAC,WAAW,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAE3F,mDAAmD;IACnD,KAAY,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAE/E,sEAAsE;IACtE,KAAY,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC;IAEpC;OACG;IACH,KAAY,UAAU,GAAG,WAAW,CAAC,UAAU,CAAC;IAEhD;;OAEG;IACH,KAAY,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC;IAExC;;OAEG;IACH,KAAY,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC;IACtC;;OAEG;IACH,KAAY,iBAAiB,GAAG,WAAW,CAAC,iBAAiB,CAAC;IAC9D,yEAAyE;IACzE,KAAY,OAAO,GAAG,WAAW,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;IAE5D,2FAA2F;IAC3F,KAAY,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC;IAEtC,+CAA+C;IAC/C,KAAY,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC;IAE1C,KAAY,2BAA2B,GAAG,wBAAwB,CAAC;IAEnE,KAAY,aAAa,GAAG,iBAAiB,CAAC;CAC/C"}
package/lib/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../types.ts"],"names":[],"mappings":"","sourcesContent":["import type { RsCoreTypes } from 'pega-repeating-structures-core';\n\nimport type {\n RepeatingStructuresProps,\n RsStyleFormat as RsStyleFormatType\n} from './types/RepeatingStructuresBoot.types';\n\nexport declare namespace RSTypes {\n // Exported members\n /** Group configuration on repeating structure state */\n export type Group = RsCoreTypes.Group;\n\n /** Metadata for field */\n export type FieldDef = RsCoreTypes.FieldDef;\n\n /** Group filter from the repeating structure state */\n export type GroupFilter = NonNullable<RsCoreTypes.State['groupFilters']>[0];\n\n /** Sort configuration on repeating structure state */\n export type Sort = NonNullable<RsCoreTypes.State['sortingOrder']>[0];\n\n /** Aggregation types */\n export type AggregationType = NonNullable<RsCoreTypes.State['aggregationInfo']>[0]['type'];\n\n /** Aggregation state on the repeating structure */\n export type Aggregation = NonNullable<RsCoreTypes.State['aggregationInfo']>[0];\n\n /** A meta data object to provide definition of repeating structure */\n export type Meta = RsCoreTypes.Meta;\n\n /** A set of api's to communicate b/w repeating structure and its consumer (e.g. providing data to repeating structure)\n */\n export type ApiContext = RsCoreTypes.ApiContext;\n\n /**\n * Error object from the repeating structure\n */\n export type Errors = RsCoreTypes.Errors;\n\n /**\n * State object from the repeating structure\n */\n export type State = RsCoreTypes.State;\n /**\n * Personalized state object from the repeating structure. This state is generally shared to consumer.\n */\n export type PersonalizedState = RsCoreTypes.PersonalizedState;\n /** An array of multiple variants of metadata of repeating structures. */\n export type Presets = RsCoreTypes.RsCoreInitArgs['presets'];\n\n /** The set of methods exposed to consumers for communicating with repeating structure. */\n export type RsApi = RsCoreTypes.RsApi;\n\n /** Represents a row in Repeating structures */\n export type RowData = RsCoreTypes.RowData;\n\n export type RepeatingStructuresInitArgs = RepeatingStructuresProps;\n\n export type RsStyleFormat = RsStyleFormatType;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../types.ts"],"names":[],"mappings":"","sourcesContent":["import type { RsCoreTypes } from 'pega-repeating-structures-core';\n\nimport type {\n RepeatingStructuresProps,\n RsStyleFormat as RsStyleFormatType\n} from './types/RepeatingStructuresBoot.types';\n\nexport declare namespace RSTypes {\n // Exported members\n /** Group configuration on repeating structure state */\n export type Group = RsCoreTypes.Group;\n\n /** Group Additional field configuration for a group. */\n export type GroupAdditionalField = RsCoreTypes.GroupAdditionalField;\n\n /** Metadata for field */\n export type FieldDef = RsCoreTypes.FieldDef;\n\n /** Group filter from the repeating structure state */\n export type GroupFilter = NonNullable<RsCoreTypes.State['groupFilters']>[0];\n\n /** Sort configuration on repeating structure state */\n export type Sort = NonNullable<RsCoreTypes.State['sortingOrder']>[0];\n\n /** Aggregation types */\n export type AggregationType = NonNullable<RsCoreTypes.State['aggregationInfo']>[0]['type'];\n\n /** Aggregation state on the repeating structure */\n export type Aggregation = NonNullable<RsCoreTypes.State['aggregationInfo']>[0];\n\n /** A meta data object to provide definition of repeating structure */\n export type Meta = RsCoreTypes.Meta;\n\n /** A set of api's to communicate b/w repeating structure and its consumer (e.g. providing data to repeating structure)\n */\n export type ApiContext = RsCoreTypes.ApiContext;\n\n /**\n * Error object from the repeating structure\n */\n export type Errors = RsCoreTypes.Errors;\n\n /**\n * State object from the repeating structure\n */\n export type State = RsCoreTypes.State;\n /**\n * Personalized state object from the repeating structure. This state is generally shared to consumer.\n */\n export type PersonalizedState = RsCoreTypes.PersonalizedState;\n /** An array of multiple variants of metadata of repeating structures. */\n export type Presets = RsCoreTypes.RsCoreInitArgs['presets'];\n\n /** The set of methods exposed to consumers for communicating with repeating structure. */\n export type RsApi = RsCoreTypes.RsApi;\n\n /** Represents a row in Repeating structures */\n export type RowData = RsCoreTypes.RowData;\n\n export type RepeatingStructuresInitArgs = RepeatingStructuresProps;\n\n export type RsStyleFormat = RsStyleFormatType;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/lists-react",
3
- "version": "9.0.0-build.11.3",
3
+ "version": "9.0.0-build.11.5",
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,9 +14,9 @@
14
14
  "build": "tsc -b tsconfig.build.json"
15
15
  },
16
16
  "dependencies": {
17
- "@pega/cosmos-react-condition-builder": "9.0.0-build.11.3",
18
- "@pega/cosmos-react-core": "9.0.0-build.11.3",
19
- "@pega/cosmos-react-rte": "9.0.0-build.11.3",
17
+ "@pega/cosmos-react-condition-builder": "9.0.0-build.11.5",
18
+ "@pega/cosmos-react-core": "9.0.0-build.11.5",
19
+ "@pega/cosmos-react-rte": "9.0.0-build.11.5",
20
20
  "@types/lodash.get": "^4.4.9",
21
21
  "@types/react": "^17.0.62 || ^18.3.3",
22
22
  "@types/react-dom": "^17.0.20 || ^18.3.0",
@@ -24,8 +24,8 @@
24
24
  "dayjs": "^1.11.13",
25
25
  "fast-deep-equal": "^3.1.3",
26
26
  "lodash.get": "^4.4.2",
27
- "pega-repeating-structures-core": "npm:@pega/lists-core@9.0.0-build.11.3",
28
- "pega-ui-list-data-apis": "npm:@pega/lists-core-utils@9.0.0-build.11.3",
27
+ "pega-repeating-structures-core": "npm:@pega/lists-core@9.0.0-build.11.5",
28
+ "pega-ui-list-data-apis": "npm:@pega/lists-core-utils@9.0.0-build.11.5",
29
29
  "polished": "^4.1.0",
30
30
  "prop-types": "^15.8.1",
31
31
  "react": "^17.0.0 || ^18.0.0",
@@ -44,7 +44,7 @@
44
44
  "@testing-library/react": "^16.0.0",
45
45
  "@testing-library/user-event": "^14.6.1",
46
46
  "jest-axe": "^8.0.0",
47
- "srs-utils": "9.0.0-build.11.3",
47
+ "srs-utils": "9.0.0-build.11.5",
48
48
  "typescript": "~5.8.3"
49
49
  }
50
50
  }
@@ -1,31 +0,0 @@
1
- declare function GroupHeader({ groupHeader, columns }: {
2
- groupHeader: any;
3
- columns: any;
4
- }): import("react/jsx-runtime").JSX.Element | null;
5
- declare namespace GroupHeader {
6
- namespace propTypes {
7
- let columns: PropTypes.Validator<any[]>;
8
- let groupHeader: PropTypes.Validator<{
9
- [x: string]: any;
10
- }>;
11
- }
12
- }
13
- export default GroupHeader;
14
- /**
15
- * Formats additional field data based on its type and properties.
16
- */
17
- export type AdditionalFieldData = NonNullable<Awaited<ReturnType<NonNullable<import("pega-repeating-structures-core").RsCoreTypes.ApiContext["fetchGroupedInfo"]>>>[number]["additionalFieldsData"]>[number];
18
- /**
19
- * Formats additional field data based on its type and properties.
20
- */
21
- export type Column = import("pega-repeating-structures-core").RsCoreTypes.Column;
22
- /**
23
- * Formats additional field data based on its type and properties.
24
- */
25
- export type Meta = import("pega-repeating-structures-core").RsCoreTypes.Meta;
26
- /**
27
- * Formats additional field data based on its type and properties.
28
- */
29
- export type GroupGenerator = import("pega-repeating-structures-core").RsCoreTypes.GroupGenerator;
30
- import PropTypes from 'prop-types';
31
- //# sourceMappingURL=GroupRenderer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GroupRenderer.d.ts","sourceRoot":"","sources":["../../../Core/Components/GroupRenderer.jsx"],"names":[],"mappings":"AAoYA;;;mDAqIC;;;;;;;;;;;;;kCAxVY,WAAW,CACnB,OAAO,CACL,UAAU,CACR,WAAW,CACnB,OAAiB,gCAAgC,EAAE,WAAW,CAAC,UAAU,CAAC,kBAAkB,CAAC,CACpF,CACF,CACF,CAAC,MAAM,CAAC,CAAC,sBAAsB,CAAC,CAClC,CAAC,MAAM,CAAC;;;;qBAEC,OAAO,gCAAgC,EAAE,WAAW,CAAC,MAAM;;;;mBAC3D,OAAO,gCAAgC,EAAE,WAAW,CAAC,IAAI;;;;6BACzD,OAAO,gCAAgC,EAAE,WAAW,CAAC,cAAc;sBA7L1D,YAAY"}
@@ -1 +0,0 @@
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,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC1F,OAAO,UAAU,MAAM,0DAA0D,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EA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Ae,CAAC,EAAE,KAAK,oBAAoB,CAAC,EAAE,CAClE,EACD,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,GACxB,CACH,CAAC;6CACH,GACD,IACD,CACJ,IACG,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 { Flex, Icon, Tooltip, useElement, Text, MetaList } from '@pega/cosmos-react-core';\nimport BareButton from '@pega/cosmos-react-core/lib/components/Button/BareButton';\nimport { getGroupFromKey } from 'pega-ui-list-data-apis';\nimport { dateFunctionLabels, FieldType } from 'pega-repeating-structures-core';\nimport { StyledMetaListItem } from '@pega/cosmos-react-core/lib/components/MetaList/MetaList';\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';\nimport { getFormattedAggregationValue } from './AggregateMenu';\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 &:has(button[aria-expanded='true']) {\n filter: ${props => props.theme.base.shadow['low-filter']};\n }\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 .group-count {\n font-weight: ${props => props.theme.base['font-weight'].bold};\n white-space: pre;\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 &::before {\n content: '';\n position: sticky;\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 &.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, theme }) =>\n groupHeader.count === 0 ? `calc(${theme.base.spacing} * 2.25)` : '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 }) => theme.base.shadow['focus-inset']};\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 .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\nconst StyledText = styled(Text)`\n display: inline-flex;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n min-width: 0;\n`;\n\nconst StyledMetaList = styled(MetaList)`\n margin-inline-start: 0;\n`;\nconst GroupAdditionalInfoSeparator = styled(StyledMetaListItem)`\n margin-inline-start: 0.3rem;\n`;\n\n/**\n * For\n * @param {*} additionalFieldData\n * @param {*} additionalField\n * @param {*} param2\n * @returns\n */\n/**\n * Formats additional field data based on its type and properties.\n *\n * @typedef {NonNullable<\n * Awaited<\n * ReturnType<\n * NonNullable<\n * import('pega-repeating-structures-core').RsCoreTypes.ApiContext['fetchGroupedInfo']\n * >\n * >\n * >[number]['additionalFieldsData']\n * >[number]} AdditionalFieldData\n *\n * @typedef {import('pega-repeating-structures-core').RsCoreTypes.Column} Column\n * @typedef {import('pega-repeating-structures-core').RsCoreTypes.Meta} Meta\n * @typedef {import('pega-repeating-structures-core').RsCoreTypes.GroupGenerator} GroupGenerator\n *\n * @param {AdditionalFieldData} additionalFieldData - The data for the additional field.\n * @param {import('pega-repeating-structures-core').RsCoreTypes.GroupAdditionalField} additionalField - The configuration for the additional field.\n * @param {{column: Column, meta: Meta, groupHeader: GroupGenerator}} config - Additional config for formatting.\n * @param {Column} config.column - The column configuration.\n * @param {Meta} config.meta - RS Meta.\n * @param {GroupGenerator} config.groupHeader - The group header data.\n *\n * @returns {{label: string, renderer: ReactNode | string}} An object containing the formatted label and renderer.\n * @returns {string} returns.label - The formatted label for the additional field.\n * @returns {ReactNode | string} returns.renderer - The React component or value to render.\n */\nconst getFormattedAdditionalFieldData = (\n additionalFieldData,\n additionalField,\n { column, meta, groupHeader, translate }\n) => {\n const { value, count = 0 } = additionalFieldData || {};\n const { aggregation, dateFunction } = additionalField || {};\n const { locale, timezone } = meta;\n const {\n label,\n field: { type }\n } = column;\n\n // Additional field as aggregation\n if (aggregation && type === FieldType.NUMBER) {\n return {\n label: `${label}(${translate(aggregation)})`,\n renderer: getFormattedAggregationValue(value, aggregation, column)\n };\n }\n\n // Additional field as Date part\n if (\n count <= 1 &&\n dateFunction &&\n [FieldType.DATE, FieldType.DATE_TIME, FieldType.DATE_ONLY].includes(type)\n ) {\n return {\n label: `${label}(${translate(dateFunctionLabels[dateFunction])})`,\n renderer: (\n <DateValueDisplay\n value={value}\n dateFunction={dateFunction}\n locale={locale}\n timezone={timezone}\n />\n )\n };\n }\n\n // Additional field as normal field but with multiple values.\n if (count > 1) {\n return {\n label: `${label}${\n dateFunction && [FieldType.DATE, FieldType.DATE_TIME, FieldType.DATE_ONLY].includes(type)\n ? `(${translate(dateFunctionLabels[dateFunction])})`\n : ''\n }`,\n renderer: translate('Multiple')\n };\n }\n\n // Additional field as normal field.\n column.setExecutionContext(null);\n return {\n label,\n renderer: (\n <RenderingEngine\n {...{\n ...column.getRenderingEngineProps(),\n context: {\n ...column.getContext(),\n name: 'GroupAdditionalField',\n getValue: () => value,\n getExecutionContext: () => {\n return { getValue: () => groupHeader.data, name: 'groupHeader' };\n }\n }\n }}\n />\n )\n };\n};\n\nconst GroupAdditionalInfo = ({ additionalFieldData, columns, groupHeader, additionalField }) => {\n const [infoRef, setInfoRef] = useElement(null);\n const [translate] = useTranslate();\n const { id } = additionalFieldData;\n const column = columns.find(c => c.field.id === id);\n\n if (!column) return null;\n\n const { meta, isInstantRender } = column.parent;\n\n //\n if (isInstantRender) {\n return null;\n }\n\n const { label, renderer } = getFormattedAdditionalFieldData(\n additionalFieldData,\n additionalField,\n { column, meta, groupHeader, translate }\n );\n\n return (\n <>\n <Flex container={{ gap: 0.5 }} ref={setInfoRef}>\n <StyledText variant='secondary' data-testid='additional-field-label'>\n {label}:\n </StyledText>\n <StyledText variant='secondary' data-testid='additional-field-renderer'>\n {renderer}\n </StyledText>\n </Flex>\n <Tooltip smart target={infoRef} showDelay='short' hideDelay='none'>\n <Text>{`${label}: `}</Text>\n <Text>{renderer}</Text>\n </Tooltip>\n </>\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 {\n columnId,\n dateFunction,\n customFunction,\n 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 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 // 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}\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 icon\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 className='group-count'>{` (${groupCountFormatted})`}</span>\n </span>\n {!!(groupHeader.additionalFieldsData?.length && additionalFields.length) && (\n <>\n <Text aria-hidden variant='secondary' as={GroupAdditionalInfoSeparator}>\n •\n </Text>\n <StyledMetaList\n wrapItems={false}\n items={[\n ...groupHeader.additionalFieldsData.map(additionalFieldsData => (\n <GroupAdditionalInfo\n additionalFieldData={additionalFieldsData}\n additionalField={additionalFields.find(\n additionalField => additionalField.id === additionalFieldsData.id\n )}\n columns={columns}\n groupHeader={groupHeader}\n />\n ))\n ]}\n />\n </>\n )}\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"]}