@pega/lists-react 9.0.0-build.14.9 → 9.0.0-build.15.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"SelectAllCheckbox.d.ts","sourceRoot":"","sources":["../../../../Core/Components/DefaultComponents/SelectAllCheckbox.jsx"],"names":[],"mappings":"AAmBA;;;;mDA2CC;;;;;;;;;sBA7DqB,YAAY"}
1
+ {"version":3,"file":"SelectAllCheckbox.d.ts","sourceRoot":"","sources":["../../../../Core/Components/DefaultComponents/SelectAllCheckbox.jsx"],"names":[],"mappings":"AAwBA;;;;mDA2CC;;;;;;;;;sBAlEqB,YAAY"}
@@ -7,6 +7,11 @@ import { StyledPseudoRadioCheck } from '@pega/cosmos-react-core/lib/components/R
7
7
  import useTranslate from '../../Hooks/useTranslate';
8
8
  const StyledDivWrapper = styled.div `
9
9
  height: 100%;
10
+
11
+ /* adding padding to the row select checkbox to give space of outline focus ring */
12
+ padding-block: 0.125rem;
13
+ padding-inline: 0.25rem;
14
+
10
15
  > div {
11
16
  height: 100%;
12
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SelectAllCheckbox.js","sourceRoot":"","sources":["../../../../Core/Components/DefaultComponents/SelectAllCheckbox.jsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,8DAA8D,CAAC;AAEtG,OAAO,YAAY,MAAM,0BAA0B,CAAC;AAEpD,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;IAK/B,sBAAsB;;;CAGzB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EACxC,aAAa,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CACpB,CAAC;AACJ,CAAC;AAED,iBAAiB,CAAC,SAAS,GAAG;IAC5B,mBAAmB,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IAC9C,aAAa,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACxC,mBAAmB,EAAE,SAAS,CAAC,IAAI;CACpC,CAAC","sourcesContent":["import styled from 'styled-components';\nimport PropTypes from 'prop-types';\nimport { useRef } from 'react';\n\nimport { Checkbox } from '@pega/cosmos-react-core';\nimport { StyledPseudoRadioCheck } from '@pega/cosmos-react-core/lib/components/RadioCheck/RadioCheck';\n\nimport useTranslate from '../../Hooks/useTranslate';\n\nconst StyledDivWrapper = styled.div`\n height: 100%;\n > div {\n height: 100%;\n }\n ${StyledPseudoRadioCheck} {\n margin-inline-end: 0;\n }\n`;\n\nexport default function SelectAllCheckbox({\n selectAllRows,\n getExecutionContext,\n getDisableSelection\n}) {\n const [translate] = useTranslate();\n const isProcessingRef = useRef(false);\n\n const { selectedRecordsCount, resultsCount, getState, getMeta } = getExecutionContext();\n if (!getState().showSelectAllCheckbox) {\n return null;\n }\n const { disableSelectionOnLoad } = getMeta();\n const disableSelection = getDisableSelection() ?? disableSelectionOnLoad;\n\n const isIndeterminate = selectedRecordsCount > 0 && selectedRecordsCount !== resultsCount;\n\n const isChecked =\n (selectedRecordsCount > 0 && selectedRecordsCount === resultsCount) || isIndeterminate;\n const handleChange = event => {\n if (disableSelection || isProcessingRef.current) {\n return;\n }\n const { checked } = event.target;\n isProcessingRef.current = true;\n\n selectAllRows(checked).then(() => {\n isProcessingRef.current = false;\n });\n };\n\n return (\n <StyledDivWrapper item>\n <Checkbox\n className='select-all-checkbox'\n checked={isChecked}\n onChange={handleChange}\n indeterminate={isIndeterminate}\n aria-label={translate('Select all')}\n disabled={disableSelection}\n />\n </StyledDivWrapper>\n );\n}\n\nSelectAllCheckbox.propTypes = {\n getExecutionContext: PropTypes.func.isRequired,\n selectAllRows: PropTypes.func.isRequired,\n getDisableSelection: PropT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I,eAAe,CAAC,OAAO,EAAE,CAAC;YAChD,OAAO;QACT,CAAC;QACD,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC;QACjC,eAAe,CAAC,OAAO,GAAG,IAAI,CAAC;QAE/B,aAAa,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;YAC/B,eAAe,CAAC,OAAO,GAAG,KAAK,CAAC;QAClC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,gBAAgB,IAAC,IAAI,kBACpB,KAAC,QAAQ,IACP,SAAS,EAAC,qBAAqB,EAC/B,OAAO,EAAE,SAAS,EAClB,QAAQ,EAAE,YAAY,EACtB,aAAa,EAAE,eAAe,gBAClB,SAAS,CAAC,YAAY,CAAC,EACnC,QAAQ,EAAE,gBAAgB,GAC1B,GACe,CACpB,CAAC;AACJ,CAAC;AAED,iBAAiB,CAAC,SAAS,GAAG;IAC5B,mBAAmB,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IAC9C,aAAa,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACxC,mBAAmB,EAAE,SAAS,CAAC,IAAI;CACpC,CAAC","sourcesContent":["import styled from 'styled-components';\nimport PropTypes from 'prop-types';\nimport { useRef } from 'react';\n\nimport { Checkbox } from '@pega/cosmos-react-core';\nimport { StyledPseudoRadioCheck } from '@pega/cosmos-react-core/lib/components/RadioCheck/RadioCheck';\n\nimport useTranslate from '../../Hooks/useTranslate';\n\nconst StyledDivWrapper = styled.div`\n height: 100%;\n\n /* adding padding to the row select checkbox to give space of outline focus ring */\n padding-block: 0.125rem;\n padding-inline: 0.25rem;\n\n > div {\n height: 100%;\n }\n ${StyledPseudoRadioCheck} {\n margin-inline-end: 0;\n }\n`;\n\nexport default function SelectAllCheckbox({\n selectAllRows,\n getExecutionContext,\n getDisableSelection\n}) {\n const [translate] = useTranslate();\n const isProcessingRef = useRef(false);\n\n const { selectedRecordsCount, resultsCount, getState, getMeta } = getExecutionContext();\n if (!getState().showSelectAllCheckbox) {\n return null;\n }\n const { disableSelectionOnLoad } = getMeta();\n const disableSelection = getDisableSelection() ?? disableSelectionOnLoad;\n\n const isIndeterminate = selectedRecordsCount > 0 && selectedRecordsCount !== resultsCount;\n\n const isChecked =\n (selectedRecordsCount > 0 && selectedRecordsCount === resultsCount) || isIndeterminate;\n const handleChange = event => {\n if (disableSelection || isProcessingRef.current) {\n return;\n }\n const { checked } = event.target;\n isProcessingRef.current = true;\n\n selectAllRows(checked).then(() => {\n isProcessingRef.current = false;\n });\n };\n\n return (\n <StyledDivWrapper item>\n <Checkbox\n className='select-all-checkbox'\n checked={isChecked}\n onChange={handleChange}\n indeterminate={isIndeterminate}\n aria-label={translate('Select all')}\n disabled={disableSelection}\n />\n </StyledDivWrapper>\n );\n}\n\nSelectAllCheckbox.propTypes = {\n getExecutionContext: PropTypes.func.isRequired,\n selectAllRows: PropTypes.func.isRequired,\n getDisableSelection: PropTypes.func\n};\n"]}
@@ -1 +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,iBAAi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qC1B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -34,10 +34,6 @@ export const useFormattedAdditionalFieldData = (additionalFieldData, additionalF
34
34
  if (!column || !meta) {
35
35
  return { label: null, renderer: null };
36
36
  }
37
- const { isInstantRender } = column.parent;
38
- if (isInstantRender) {
39
- return { label: null, renderer: null };
40
- }
41
37
  const { value, count = 0 } = additionalFieldData || {};
42
38
  const { locale, timezone } = meta;
43
39
  const { label, field: { type, name: additionalFieldName } } = column;
@@ -100,7 +96,7 @@ const GroupAdditionalInfo = ({ additionalFieldData, columns, groupHeader, additi
100
96
  const { id: fieldId } = additionalFieldData;
101
97
  const column = columns.find(c => c.field.id === fieldId);
102
98
  const { label, renderer } = useFormattedAdditionalFieldData(additionalFieldData, additionalField, { column: column ?? null, meta: column ? column.parent.meta : null, groupHeader }, rendererContext);
103
- if (!column || !label || !renderer) {
99
+ if (!column) {
104
100
  return null;
105
101
  }
106
102
  const isGroupHeaderContext = rendererContext === 'GroupHeader';
@@ -1 +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,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAG7E,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,gBAAgB,MAAM,qBAAqB,CAAC;AACnD,OAAO,eAAe,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EACL,oBAAoB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,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"]}
1
+ {"version":3,"file":"GroupAdditionalInfo.js","sourceRoot":"","sources":["../../../../Core/Components/GroupRen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,MAAM,oBAAoB,GAAG,eAAe,KAAK,aAAa,CAAC;IAE/D,OAAO,CACL,8BAEE,KAAC,kBAAkB,cAAE,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 { 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) {\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"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../Core/Components/GroupRenderer/index.jsx"],"names":[],"mappings":"AAqNA;;;;;;QAwCC;AA2GD;;;mDAsIC;;;;;;;;;;sBA9eqB,YAAY"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../Core/Components/GroupRenderer/index.jsx"],"names":[],"mappings":"AAoNA;;;;;;QAwCC;AA2GD;;;mDA6IC;;;;;;;;;;sBApfqB,YAAY"}
@@ -5,7 +5,6 @@ import styled from 'styled-components';
5
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 { StyledMetaListItem } from '@pega/cosmos-react-core/lib/components/MetaList/MetaList';
9
8
  import { createClassName as cx } from '../../Utils';
10
9
  import useTranslate from '../../Hooks/useTranslate';
11
10
  import { customFunctions, intervalGroupingBoundaries } from '../../constants';
@@ -138,7 +137,7 @@ const StyledMetaList = styled(MetaList) `
138
137
  margin: 0;
139
138
  padding: 0 0.3rem;
140
139
  `;
141
- const GroupAdditionalInfoSeparator = styled(StyledMetaListItem) `
140
+ const GroupAdditionalInfoSeparator = styled.span `
142
141
  margin-inline-start: 0.3rem;
143
142
  `;
144
143
  const ColorBadge = styled.div `
@@ -286,10 +285,16 @@ export default function GroupHeader({ groupHeader, columns }) {
286
285
  let groupAdditionalInfo;
287
286
  // Prepare additional info components if present
288
287
  if (groupHeader.additionalFieldsData?.length && additionalFields.length) {
289
- 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' }) })));
288
+ groupAdditionalInfo = groupHeader.additionalFieldsData.reduce((acc, additionalFieldData, idx) => {
289
+ const additionalField = additionalFields.find(field => field.id === additionalFieldData.id);
290
+ if (additionalField) {
291
+ acc.push(_jsx(Flex, { container: { gap: 0.5 }, id: additionalInfoIds[idx], children: _jsx(GroupAdditionalInfo, { additionalFieldData: additionalFieldData, additionalField: additionalField, columns: columns, groupHeader: groupHeader, rendererContext: 'GroupHeader' }) }));
292
+ }
293
+ return acc;
294
+ }, []);
290
295
  }
291
296
  // FIXME: Import rather than COPY, i would rather
292
- 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 => {
297
+ return (_jsxs(StyledGroupHeader, { groupHeader: groupHeader, className: cx('row group-header-row sticky-group-header'), "data-test-id": 'groupHeader', "data-testid": `${TestIdConstants.groupHeader}-${groupHeader.label}-${groupHeader.name}`, isAggregationApplied: isAggregationApplied, role: 'row', onFocus: e => {
293
298
  if (buttonRef.current && !e.currentTarget.contains(e.relatedTarget)) {
294
299
  e.preventDefault();
295
300
  buttonRef.current.focus();
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../Core/Components/GroupRenderer/index.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE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import 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 }\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\nconst ColorBadge = styled.div`\n position: sticky;\n inset-inline-start: 0;\n z-index: 10;\n\n &::before {\n content: '';\n position: absolute;\n inset-block-start: 0;\n inset-inline-start: 0;\n width: 0.25rem;\n height: 100%;\n background-color: ${props => props.colorIndicator};\n z-index: 12;\n }\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 <ColorBadge colorIndicator={groupHeader.colorIndicator} />\n {columns.map(c => {\n const cxt = {\n getValue: () =>\n groupHeader?.aggregation?.[c.field.name]?.[c.aggregationType?.toLowerCase()]\n };\n return (\n <AggregatorCell\n key={c.field.id}\n column={c}\n context={cxt}\n className={cx('cell', {\n 'cell-fixed': column.frozen\n })}\n />\n );\n })}\n </div>\n </StyledGroupHeader>\n );\n}\n\nGroupHeader.propTypes = {\n columns: PropTypes.arrayOf(PropTypes.any).isRequired,\n groupHeader: PropTypes.objectOf(PropTypes.any).isRequired\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../Core/Components/GroupRenderer/index.jsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAClG,OAAO,UAAU,MAAM,0DAA0D,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EAAE,eAAe,IAAI,EAAE,E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AC,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,eAAK,SAAS,EAAC,8BAA8B,aAC3C,KAAC,UAAU,IAAC,cAAc,EAAE,WAAW,CAAC,cAAc,GAAI,EACzD,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;wBACf,MAAM,GAAG,GAAG;4BACV,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;yBAC/E,CAAC;wBACF,OAAO,CACL,KAAC,cAAc,IAEb,MAAM,EAAE,CAAC,EACT,OAAO,EAAE,GAAG,EACZ,SAAS,EAAE,EAAE,CAAC,MAAM,EAAE;gCACpB,YAAY,EAAE,MAAM,CAAC,MAAM;6BAC5B,CAAC,IALG,CAAC,CAAC,KAAK,CAAC,EAAE,CAMf,CACH,CAAC;oBACJ,CAAC,CAAC,IACE,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';\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 }\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.span`\n margin-inline-start: 0.3rem;\n`;\n\nconst ColorBadge = styled.div`\n position: sticky;\n inset-inline-start: 0;\n z-index: 10;\n\n &::before {\n content: '';\n position: absolute;\n inset-block-start: 0;\n inset-inline-start: 0;\n width: 0.25rem;\n height: 100%;\n background-color: ${props => props.colorIndicator};\n z-index: 12;\n }\n`;\n\n/**\n * Generates unique ARIA label IDs for accessibility.\n * - groupLabelId: for the group label (e.g., \"Status:\")\n * - groupNameId: for the group value (e.g., \"Open\")\n * - additionalInfoIds: for any additional fields shown in the group header\n * These IDs are used in aria-labelledby to improve screen reader support.\n */\nconst getAriaLabelIds = (uniqueId, additionalFields) => {\n const groupLabelId = `group-label-${uniqueId}`;\n const groupNameId = `group-name-${uniqueId}`;\n const additionalInfoIds = additionalFields?.map(\n additionalField =>\n `group-additional-info-${uniqueId}-${additionalField.id}` /* used in aria-labelledby */\n );\n return { groupLabelId, groupNameId, additionalInfoIds };\n};\n/**\n * Returns label for interval grouping based on interval and boundaries\n Response data depends on boundary settings.\n Ex: For sample data of profit\n profit --> cases(count)\n {'0': 10, 1': 100, '2':30, '10': 35, '15':45, '20':2}\n For Interval 10\n If the boundary is 'include-lower-only',\n and value is 10 then label -> 10 to 20\n\n If boundary is 'include-upper-only',\n and value is 10 then label -> 0 to 10\n * */\nfunction buildIntervalGroupingLabel(value, customFunction, translate) {\n const { interval, boundaries } = customFunction;\n // To restrict the decimals in labels\n const intervalDecimalLength = (interval.toString().split('.')[1] || '').length;\n value = Number(value);\n // In case of 'include-lower-only'\n let lowerValue = value.toFixed(intervalDecimalLength);\n let upperValue = (value + interval).toFixed(intervalDecimalLength);\n // In case of boundary 'include-upper-only'\n if (boundaries === intervalGroupingBoundaries.includeUpperOnly) {\n lowerValue = (value - interval).toFixed(intervalDecimalLength);\n upperValue = value.toFixed(intervalDecimalLength);\n }\n return `${lowerValue} ${translate('to')} ${upperValue}`;\n}\n\nexport function GroupName({ view, column, groupHeader, dateFunction, customFunction }) {\n const [translate] = useTranslate();\n const { locale, timezone } = view.meta;\n const isRangeGrouping = customFunction?.type === customFunctions.RANGE_GROUPING;\n const isIntervalGrouping = customFunction?.type === customFunctions.INTERVAL_GROUPING;\n\n if (dateFunction) {\n return (\n <DateValueDisplay\n value={groupHeader.name}\n dateFunction={dateFunction}\n locale={locale}\n timezone={timezone}\n />\n );\n }\n\n if (isRangeGrouping) {\n /** If custom range grouping applied on number field , we need to show group name as text instead of number */\n return groupHeader.name;\n }\n\n if (isIntervalGrouping) {\n /** If custom range grouping applied on number , we need to show group name based on value and custom function details like interval and boundaries */\n return buildIntervalGroupingLabel(groupHeader.name, customFunction, translate);\n }\n\n column.setExecutionContext(null); // If null is not set then it will execute on the previous row context and facing issues when cell is edited. Based on column.editMode and current context renderer varies (it can be cellEditRenderer)\n\n const columnRendererProps = {\n ...column.getRenderingEngineProps(),\n context: {\n getValue: () => groupHeader.name,\n getExecutionContext: () => {\n return { getValue: () => groupHeader.data, name: 'groupHeader' };\n }\n }\n };\n\n return <RenderingEngine {...columnRendererProps} />;\n}\n\n/**\n * Tooltip content for the group header.\n * Shows the group label, value, and any additional fields.\n * Used for hover/focus tooltips on the group header button.\n */\nfunction GroupHeaderToolTip({ column, groupHeader, columns, additionalFields, target }) {\n const view = column.parent;\n const { dateFunction, customFunction } =\n getGroupFromKey(groupHeader.groupBy, view.state.groups) ?? {};\n const formatter = view.getFormatterByKey('Integer');\n const { locale } = view.meta;\n const groupCountFormatted = formatter\n ? formatter(groupHeader.count, { locale })\n : groupHeader.count;\n\n return (\n <Tooltip smart target={target} showDelay='short' hideDelay='none' describeTarget={false}>\n <Text>{!column.field.hideGroupColumnNameLabel && groupHeader.label}: </Text>\n <Text>\n <GroupName\n view={view}\n column={column}\n groupHeader={groupHeader}\n dateFunction={dateFunction}\n customFunction={customFunction}\n />\n <Text>{` (${groupCountFormatted})`}</Text>\n </Text>\n {!!(groupHeader.additionalFieldsData?.length && additionalFields.length) && (\n <>\n {groupHeader.additionalFieldsData?.map(additionalFieldData => {\n return (\n <>\n {' • '}\n <GroupAdditionalInfo\n groupHeader={groupHeader}\n additionalField={additionalFields.find(\n additionalField => additionalField.id === additionalFieldData.id\n )}\n columns={columns}\n additionalFieldData={additionalFieldData}\n rendererContext='GroupHeaderTooltip'\n />\n </>\n );\n })}\n </>\n )}\n </Tooltip>\n );\n}\n\n/**\n * Renders the main group header label and count.\n * - Shows the group label (e.g., \"Status:\") unless hidden by column config.\n * - Shows the group value and item count.\n * - Uses ARIA IDs for accessibility.\n */\nfunction GroupHeaderLabel({ column, groupHeader }) {\n const view = column.parent;\n const { dateFunction, customFunction } =\n getGroupFromKey(groupHeader.groupBy, view.state.groups) ?? {};\n const formatter = view.getFormatterByKey('Integer');\n const { locale } = view.meta;\n const groupCountFormatted = formatter\n ? formatter(groupHeader.count, { locale })\n : groupHeader.count;\n const { groupLabelId, groupNameId } = getAriaLabelIds(groupHeader.uniqueId);\n return (\n <>\n <div className='group-label' />\n {!column.field.hideGroupColumnNameLabel && (\n <span\n className='group-header-groupby'\n data-test-id={groupHeader.groupBy}\n data-testid={`${TestIdConstants.groupHeaderGroupBy}-${groupHeader.groupBy}`}\n id={groupLabelId}\n >\n {groupHeader.label}:\n </span>\n )}\n <div className='group-label' />\n <span\n className='group-context-count'\n style={{ display: 'inline-flex' }}\n data-test-id='groupHeader'\n data-testid={TestIdConstants.groupHeaderCount}\n id={groupNameId}\n >\n <GroupName\n view={view}\n column={column}\n groupHeader={groupHeader}\n dateFunction={dateFunction}\n customFunction={customFunction}\n />\n {/* adding whitespace pre to preserve the space at the begining of count text */}\n <span className='group-count'>{` (${groupCountFormatted})`}</span>\n <VisuallyHiddenText> items</VisuallyHiddenText>\n </span>\n </>\n );\n}\n// NOTE: While making any changes in GroupRenderer.jsx, also make similar changes in HierarchicalGroupRenderer.jsx file if applicable\n\nexport default function GroupHeader({ groupHeader, columns }) {\n const buttonRef = useRef();\n const view = columns[0].parent;\n const toggleGroup = useCallback(() => {\n if (groupHeader.count > 0) {\n view.type.toggleGroupExpansion({ groupHeader });\n }\n }, [groupHeader, view]);\n\n // TODO: This we are adding temporary to show freeze border until we make group header rendering change\n // when we will pick up aggregation.\n if (!groupHeader.isVisible) return null;\n\n // If grouping by a regular column (i.e. without a dateFunction), determine props for the renderer\n const { columnId, additionalFields = [] } =\n getGroupFromKey(groupHeader.groupBy, view.state.groups) ?? {};\n // if state.groups is not yet prepared/updated, then getGroupFromKey will return undefined\n if (!columnId) {\n return null;\n }\n\n const column = columns.find(c => c.field.id === columnId);\n const isAggregationApplied = columns.filter(c => !c.hidden).some(c => c.aggregated);\n\n // Generate unique ARIA label IDs for accessibility\n const {\n groupLabelId,\n groupNameId,\n additionalInfoIds = []\n } = getAriaLabelIds(groupHeader.uniqueId, additionalFields);\n let groupAdditionalInfo;\n\n // Prepare additional info components if present\n if (groupHeader.additionalFieldsData?.length && additionalFields.length) {\n groupAdditionalInfo = groupHeader.additionalFieldsData.reduce(\n (acc, additionalFieldData, idx) => {\n const additionalField = additionalFields.find(field => field.id === additionalFieldData.id);\n if (additionalField) {\n acc.push(\n <Flex container={{ gap: 0.5 }} id={additionalInfoIds[idx]}>\n <GroupAdditionalInfo\n additionalFieldData={additionalFieldData}\n additionalField={additionalField}\n columns={columns}\n groupHeader={groupHeader}\n rendererContext='GroupHeader'\n />\n </Flex>\n );\n }\n return acc;\n },\n []\n );\n }\n\n // FIXME: Import rather than COPY, i would rather\n return (\n <StyledGroupHeader\n groupHeader={groupHeader}\n className={cx('row group-header-row sticky-group-header')}\n data-test-id='groupHeader'\n data-testid={`${TestIdConstants.groupHeader}-${groupHeader.label}-${groupHeader.name}`}\n isAggregationApplied={isAggregationApplied}\n role='row'\n onFocus={e => {\n if (buttonRef.current && !e.currentTarget.contains(e.relatedTarget)) {\n e.preventDefault();\n buttonRef.current.focus();\n }\n }}\n >\n <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 <ColorBadge colorIndicator={groupHeader.colorIndicator} />\n {columns.map(c => {\n const cxt = {\n getValue: () =>\n groupHeader?.aggregation?.[c.field.name]?.[c.aggregationType?.toLowerCase()]\n };\n return (\n <AggregatorCell\n key={c.field.id}\n column={c}\n context={cxt}\n className={cx('cell', {\n 'cell-fixed': column.frozen\n })}\n />\n );\n })}\n </div>\n </StyledGroupHeader>\n );\n}\n\nGroupHeader.propTypes = {\n columns: PropTypes.arrayOf(PropTypes.any).isRequired,\n groupHeader: PropTypes.objectOf(PropTypes.any).isRequired\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"useRepeat.d.ts","sourceRoot":"","sources":["../../../Core/Hooks/useRepeat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuD,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG5F,OAAO,EAIL,KAAK,WAAW,EACjB,MAAM,gCAAgC,CAAC;AAGxC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AAK1F;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,gEAAgE;IAChE,IAAI,EAAE,MAAM,CAAC;IACb,uGAAuG;IACvG,UAAU,EAAE,WAAW,CAAC,UAAU,CAAC;IACnC,8GAA8G;IAC9G,SAAS,EAAE,WAAW,CAAC,MAAM,CAAC;IAC9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AI,EACJ,UAAU,EACV,OAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,sBAAsB,EACtB,UAAU,EACV,WAAW,EACX,IAAI,EACJ,cAAc,EACd,YAAY,EACZ,uBAAuB,EACxB,EAAE,wBAAwB,GAAG;IAAE,uBAAuB,EAAE,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;CAAE,GAAG,QAAQ,CA8RjG"}
@@ -167,6 +167,12 @@ export default function useRepeat({ meta, apiContext, presets = [], persistedInf
167
167
  .columns?.find(c => c.field.id === columnId)
168
168
  ?.applyFormatter(formatterName);
169
169
  }, [instance]);
170
+ const removeRenderFormatter = useCallback(columnId => {
171
+ instance
172
+ .getView()
173
+ .columns?.find(c => c.field.id === columnId)
174
+ ?.removeFormatter();
175
+ }, [instance]);
170
176
  // TODO: Move the RsCoreTypes.RsApi's to separate file, maybe useRsApi.ts
171
177
  // TODO:
172
178
  useImperativeHandle(repeatComponentInstance, () => ({
@@ -185,6 +191,7 @@ export default function useRepeat({ meta, apiContext, presets = [], persistedInf
185
191
  setGrouping: instance.getView().meta.grouping ? setGrouping : undefined,
186
192
  setAggregations,
187
193
  setRenderFormatter,
194
+ removeRenderFormatter,
188
195
  setRowReorderFieldVisibility,
189
196
  updateColumnsVisibility,
190
197
  setConditionalStyleFormats
@@ -1 +1 @@
1
- {"version":3,"file":"useRepeat.js","sourceRoot":"","sources":["../../../Core/Hooks/useRepeat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,mBAAmB,EAAkB,MAAM,OAAO,CAAC;AAC5F,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAEpC,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,+BAA+B,EAEhC,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,SAAS,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAG/D,OAAO,eAAe,MAAM,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ACb,QAAQ,CAAC,SAAS,CAAC,eAAe,EAAE,CAAC,WAAW,EAAE,CAAC;IACrD,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEzC,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["import { useEffect, useCallback, useRef, useImperativeHandle, type RefObject } from 'react';\nimport { v4 as uuidV4 } from 'uuid';\n\nimport {\n initializeRsCore,\n rowDragDropColumnMeta,\n sanitizeConditionalStyleFormats,\n type RsCoreTypes\n} from 'pega-repeating-structures-core';\n\nimport { deepEqual, isRowReorderFieldEnabled } from '../Utils';\nimport type { RepeatingStructuresProps } from '../../types/RepeatingStructuresBoot.types';\n\nimport useThunkReducer from './useThunkReducer';\nimport useTranslate from './useTranslate';\n\n/**\n * Represents the instance of a repeating structure, containing methods and properties\n * to interact with it.\n */\nexport interface Instance {\n /** A unique identifier for the repeating structure instance. */\n rsID: string;\n /** The API context for interacting with the repeating structure. See {@link RsCoreTypes.ApiContext} */\n apiContext: RsCoreTypes.ApiContext;\n /** The core API for managing the repeating structure's state and behavior. See {@link RsCoreTypes.RsCore}. */\n rsCoreApi: RsCoreTypes.RsCore;\n /** A method to retrieve the current view of the repeating structure. See {@link RsCoreTypes.RsCore.getView} */\n getView: RsCoreTypes.RsCore['getView'];\n /**\n * @deprecated This set of methods is deprecated and will be removed in future versions.\n * Use methods exposed using repeatComponentInstance instead.\n *\n * A set of APIs to interact with the repeating structure. See {@link RsCoreTypes.RsApi}.\n * */\n api: Pick<RsCoreTypes.RsApi, 'dispatchAction' | 'setRecordCount'>;\n}\n\nfunction getRsCoreApi(instance: Instance, opt: RsCoreTypes.RsCoreInitArgs) {\n if (instance.rsCoreApi) return instance.rsCoreApi;\n return initializeRsCore(opt);\n}\n\n/**\n * A custom React hook to manage the lifecycle of repeating structures using `RsCore` library.\n * It provides an RsCoreTypes.RsApi for interacting with the view.\n * Provide additional callbacks to API Context via `addCallbacks` method.\n *\n * @param props - RepeatingStructuresProps required to initialize and manage the repeating structures.\n * @see {@link RepeatingStructuresProps}\n * @returns A singleton instance object that contains methods to interact with repeating structure.\n * @see {@link Instance}\n */\nexport default function useRepeat({\n meta,\n apiContext,\n presets = [],\n persistedInfo,\n onRowClickAction,\n renderFactory,\n renderFormatterTypeMap,\n formatters,\n onViewReady,\n mode,\n toolBarOptions,\n styleFormats,\n repeatComponentInstance\n}: RepeatingStructuresProps & { repeatComponentInstance: RefObject<RsCoreTypes.RsApi> }): Instance {\n // Create the repeat instance\n const instance: Instance = useRef<Instance>({ rsID: uuidV4() } as Instance).current;\n\n // Normalize metadata everytime as you might have added custom column.\n // TODO: refactor this to normalizeMeta when required.\n\n const [, dispatch] = useThunkReducer();\n // FIXME: remove renderFactory from RsApi params\n\n type RsCoreTranslationKeys = keyof NonNullable<RsCoreTypes.RsCoreInitArgs['translations']>;\n const rsCoreTranslationKeys: RsCoreTranslationKeys[] = [\n 'created_view',\n 'created_view_with_default',\n 'deleted_view',\n 'saved_changes',\n 'saved_changes_with_default',\n 'view_marked_app_default',\n 'view_marked_default',\n 'view_navigation_instructions',\n 'Actions',\n 'Select',\n 'Reorder',\n 'Error'\n ];\n\n const [translate] = useTranslate();\n const rsCoreTranslationValues = translate(rsCoreTranslationKeys);\n const rsCoreTranslations = Object.fromEntries(\n rsCoreTranslationKeys.map((key, index) => [key, rsCoreTranslationValues[index]])\n );\n\n Object.assign(instance, {\n apiContext,\n rsCoreApi: getRsCoreApi(instance, {\n formatters,\n renderFormatterTypeMap,\n toolBarOptions,\n meta,\n onRowClickAction,\n apiContext,\n presets,\n persistedInfo,\n dispatch,\n mode,\n renderFactory,\n styleFormats,\n translations: rsCoreTranslations\n })\n });\n\n Object.assign(instance, {\n getView: instance.rsCoreApi.getView\n });\n\n // TODO: enrich this to take meta as well\n instance.rsCoreApi.updateInitArgs({ apiContext, styleFormats });\n\n instance.api = {\n ...(instance.api || {}),\n setRecordCount: instance.getView().type.setRecordCount,\n dispatchAction: instance.getView().type.dispatchAction\n };\n\n /** Compare new payload with current state to avoid unnecessary rerenders */\n // TODO: create separate api for setting visibility state for OOTB columns.\n const setHiddenColumns = useCallback(\n (hiddenColumns: string[], ootbColumns?: { dragHandle?: boolean }) => {\n if (\n hiddenColumns &&\n !ootbColumns &&\n hiddenColumns.length === instance.getView().state.hiddenColumns?.length &&\n hiddenColumns.every(id => instance.getView().state.hiddenColumns?.includes(id))\n ) {\n return;\n }\n if (ootbColumns?.dragHandle && !isRowReorderFieldEnabled(instance.getView().meta)) {\n delete ootbColumns.dragHandle;\n }\n instance.getView().type.applyHiddenColumns(hiddenColumns, ootbColumns);\n },\n [instance]\n );\n\n const setColumnOrder: RsCoreTypes.RsApi['setColumnOrder'] = useCallback(\n (colOrder: string[]) => {\n if (colOrder && deepEqual(colOrder, instance.getView().state.colOrder)) {\n return;\n }\n instance.getView().type.applyOrder(colOrder);\n },\n [instance]\n );\n\n const setAggregations: RsCoreTypes.RsApi['setAggregations'] = useCallback(\n (agg: RsCoreTypes.State['aggregationInfo']) => {\n if (agg && deepEqual(agg, instance.getView().state.aggregationInfo)) {\n return;\n }\n if (agg) instance.getView().type.applyAggregations(agg);\n },\n [instance]\n );\n\n const setFilter: RsCoreTypes.RsApi['setFilter'] = useCallback(\n newFilter => {\n if (newFilter && deepEqual(newFilter, instance.getView().state.filterExpression)) {\n return;\n }\n instance.getView().type.applyFilter({ filterExp: newFilter });\n },\n [instance]\n );\n\n const setAliases: RsCoreTypes.RsApi['setAliases'] = useCallback(\n aliases => {\n if (!aliases) {\n return;\n }\n instance.getView().type.applyAliases({ aliases });\n },\n [instance]\n );\n\n const setSorting: RsCoreTypes.RsApi['setSorting'] = useCallback(\n sortingOrder => {\n if (sortingOrder && deepEqual(sortingOrder, instance.getView().state.sortingOrder)) {\n return;\n }\n instance.getView().type.applySorting(sortingOrder);\n },\n [instance]\n );\n\n const setGrouping: RsCoreTypes.RsApi['setGrouping'] = useCallback(\n (groups: RsCoreTypes.Group[]) => {\n if (groups && deepEqual(groups, instance.getView().state.groups)) {\n return;\n }\n instance.getView().type.applyGrouping(groups);\n },\n [instance]\n );\n\n const setRowReorderFieldVisibility: RsCoreTypes.RsApi['setRowReorderFieldVisibility'] =\n useCallback(\n visibility => {\n if (isRowReorderFieldEnabled(instance.getView().meta)) {\n instance\n .getView()\n .type.updateColumnsVisibility({ [rowDragDropColumnMeta.field.id]: visibility });\n }\n },\n [instance]\n );\n\n const updateColumnsVisibility: RsCoreTypes.RsApi['updateColumnsVisibility'] = useCallback(\n columns => {\n const fieldDefs = instance.getView().meta.fieldDefs.map(field => field.id);\n const columnsToBeToggled: Record<string, boolean> = {};\n Object.keys(columns).forEach(column => {\n if (fieldDefs.includes(column)) {\n columnsToBeToggled[column] = columns[column];\n }\n });\n if (Object.keys(columnsToBeToggled).length) {\n instance.getView().type.updateColumnsVisibility(columnsToBeToggled);\n }\n },\n [instance]\n );\n\n const getActiveViewInfo = useCallback(() => {\n const {\n state: { personalization }\n } = instance.getView();\n\n const activePersonalization = personalization?.active;\n const activePersonalizationName = activePersonalization\n ? personalization?.allPersonalizations?.[activePersonalization]?.name\n : undefined;\n return {\n id: activePersonalization,\n name: activePersonalizationName,\n isDirty: !!personalization?.dirty\n };\n }, [instance]);\n\n const setConditionalStyleFormats: RsCoreTypes.RsApi['setConditionalStyleFormats'] = useCallback(\n conditionalStyleFormats => {\n const {\n meta: { fieldDefs }\n } = instance.getView();\n\n if (\n conditionalStyleFormats &&\n deepEqual(conditionalStyleFormats, instance.getView().state.conditionalStyleFormats)\n ) {\n return;\n }\n\n const sanitizedFormats = sanitizeConditionalStyleFormats(conditionalStyleFormats, fieldDefs);\n instance.getView().type.setConditionalStyleFormats(sanitizedFormats);\n },\n []\n );\n\n const setRenderFormatter: RsCoreTypes.RsApi['setRenderFormatter'] = useCallback(\n (columnId, formatterName) => {\n instance\n .getView()\n .columns?.find(c => c.field.id === columnId)\n ?.applyFormatter(formatterName);\n },\n [instance]\n );\n\n // TODO: Move the RsCoreTypes.RsApi's to separate file, maybe useRsApi.ts\n // TODO:\n useImperativeHandle(\n repeatComponentInstance,\n () => ({\n refreshView: instance.getView().type.forceRefresh,\n setRecordCount: instance.getView().type.setRecordCount,\n dispatchAction: instance.getView().type.dispatchAction,\n getActiveViewInfo,\n /** Only expose below APIs when those features are enabled */\n setHiddenColumns: instance.getView().meta.toggleFieldVisibility\n ? setHiddenColumns\n : undefined,\n setColumnOrder: instance.getView().meta.reorderFields ? setColumnOrder : undefined,\n setFilter,\n setSorting,\n setAliases,\n setGrouping: instance.getView().meta.grouping ? setGrouping : undefined,\n setAggregations,\n setRenderFormatter,\n setRowReorderFieldVisibility,\n updateColumnsVisibility,\n setConditionalStyleFormats\n }),\n\n []\n );\n\n // When ever component mounts, do this after first render of component\n useEffect(() => {\n instance.getView().type.doBootstrap();\n if (onViewReady) onViewReady(instance.api);\n if (instance.apiContext.addCallbacks && repeatComponentInstance?.current) {\n // add instance APIs as callbacks <setRecordCount> for push communication from Nebula to Client\n instance.apiContext.addCallbacks({\n ...repeatComponentInstance.current,\n forceRefresh: instance.getView().type.forceRefresh\n });\n }\n\n instance.apiContext.setRsID?.(instance.getView().rsID);\n\n instance.rsCoreApi.notifyViewEvent().mount();\n return () => {\n instance.rsCoreApi.notifyViewEvent().unmount();\n // Marking it as ts-ignore. Making these objects take null will increase conditional blocks in code.\n // @ts-ignore\n instance.rsCoreApi = null;\n // @ts-ignore\n instance.getView = null;\n };\n }, [instance]);\n\n useEffect(() => {\n instance.rsCoreApi.notifyViewEvent().afterRender();\n }, [instance, instance.getView().state]);\n\n return instance;\n}\n"]}
1
+ {"version":3,"file":"useRepeat.js","sourceRoot":"","sources":["../../../Core/Hooks/useRepeat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,mBAAmB,EAAkB,MAAM,OAAO,CAAC;AAC5F,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAA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AC,UAAU,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC;QAEvD,QAAQ,CAAC,SAAS,CAAC,eAAe,EAAE,CAAC,KAAK,EAAE,CAAC;QAC7C,OAAO,GAAG,EAAE;YACV,QAAQ,CAAC,SAAS,CAAC,eAAe,EAAE,CAAC,OAAO,EAAE,CAAC;YAC/C,oGAAoG;YACpG,aAAa;YACb,QAAQ,CAAC,SAAS,GAAG,IAAI,CAAC;YAC1B,aAAa;YACb,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAC;QAC1B,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,SAAS,CAAC,GAAG,EAAE;QACb,QAAQ,CAAC,SAAS,CAAC,eAAe,EAAE,CAAC,WAAW,EAAE,CAAC;IACrD,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEzC,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["import { useEffect, useCallback, useRef, useImperativeHandle, type RefObject } from 'react';\nimport { v4 as uuidV4 } from 'uuid';\n\nimport {\n initializeRsCore,\n rowDragDropColumnMeta,\n sanitizeConditionalStyleFormats,\n type RsCoreTypes\n} from 'pega-repeating-structures-core';\n\nimport { deepEqual, isRowReorderFieldEnabled } from '../Utils';\nimport type { RepeatingStructuresProps } from '../../types/RepeatingStructuresBoot.types';\n\nimport useThunkReducer from './useThunkReducer';\nimport useTranslate from './useTranslate';\n\n/**\n * Represents the instance of a repeating structure, containing methods and properties\n * to interact with it.\n */\nexport interface Instance {\n /** A unique identifier for the repeating structure instance. */\n rsID: string;\n /** The API context for interacting with the repeating structure. See {@link RsCoreTypes.ApiContext} */\n apiContext: RsCoreTypes.ApiContext;\n /** The core API for managing the repeating structure's state and behavior. See {@link RsCoreTypes.RsCore}. */\n rsCoreApi: RsCoreTypes.RsCore;\n /** A method to retrieve the current view of the repeating structure. See {@link RsCoreTypes.RsCore.getView} */\n getView: RsCoreTypes.RsCore['getView'];\n /**\n * @deprecated This set of methods is deprecated and will be removed in future versions.\n * Use methods exposed using repeatComponentInstance instead.\n *\n * A set of APIs to interact with the repeating structure. See {@link RsCoreTypes.RsApi}.\n * */\n api: Pick<RsCoreTypes.RsApi, 'dispatchAction' | 'setRecordCount'>;\n}\n\nfunction getRsCoreApi(instance: Instance, opt: RsCoreTypes.RsCoreInitArgs) {\n if (instance.rsCoreApi) return instance.rsCoreApi;\n return initializeRsCore(opt);\n}\n\n/**\n * A custom React hook to manage the lifecycle of repeating structures using `RsCore` library.\n * It provides an RsCoreTypes.RsApi for interacting with the view.\n * Provide additional callbacks to API Context via `addCallbacks` method.\n *\n * @param props - RepeatingStructuresProps required to initialize and manage the repeating structures.\n * @see {@link RepeatingStructuresProps}\n * @returns A singleton instance object that contains methods to interact with repeating structure.\n * @see {@link Instance}\n */\nexport default function useRepeat({\n meta,\n apiContext,\n presets = [],\n persistedInfo,\n onRowClickAction,\n renderFactory,\n renderFormatterTypeMap,\n formatters,\n onViewReady,\n mode,\n toolBarOptions,\n styleFormats,\n repeatComponentInstance\n}: RepeatingStructuresProps & { repeatComponentInstance: RefObject<RsCoreTypes.RsApi> }): Instance {\n // Create the repeat instance\n const instance: Instance = useRef<Instance>({ rsID: uuidV4() } as Instance).current;\n\n // Normalize metadata everytime as you might have added custom column.\n // TODO: refactor this to normalizeMeta when required.\n\n const [, dispatch] = useThunkReducer();\n // FIXME: remove renderFactory from RsApi params\n\n type RsCoreTranslationKeys = keyof NonNullable<RsCoreTypes.RsCoreInitArgs['translations']>;\n const rsCoreTranslationKeys: RsCoreTranslationKeys[] = [\n 'created_view',\n 'created_view_with_default',\n 'deleted_view',\n 'saved_changes',\n 'saved_changes_with_default',\n 'view_marked_app_default',\n 'view_marked_default',\n 'view_navigation_instructions',\n 'Actions',\n 'Select',\n 'Reorder',\n 'Error'\n ];\n\n const [translate] = useTranslate();\n const rsCoreTranslationValues = translate(rsCoreTranslationKeys);\n const rsCoreTranslations = Object.fromEntries(\n rsCoreTranslationKeys.map((key, index) => [key, rsCoreTranslationValues[index]])\n );\n\n Object.assign(instance, {\n apiContext,\n rsCoreApi: getRsCoreApi(instance, {\n formatters,\n renderFormatterTypeMap,\n toolBarOptions,\n meta,\n onRowClickAction,\n apiContext,\n presets,\n persistedInfo,\n dispatch,\n mode,\n renderFactory,\n styleFormats,\n translations: rsCoreTranslations\n })\n });\n\n Object.assign(instance, {\n getView: instance.rsCoreApi.getView\n });\n\n // TODO: enrich this to take meta as well\n instance.rsCoreApi.updateInitArgs({ apiContext, styleFormats });\n\n instance.api = {\n ...(instance.api || {}),\n setRecordCount: instance.getView().type.setRecordCount,\n dispatchAction: instance.getView().type.dispatchAction\n };\n\n /** Compare new payload with current state to avoid unnecessary rerenders */\n // TODO: create separate api for setting visibility state for OOTB columns.\n const setHiddenColumns = useCallback(\n (hiddenColumns: string[], ootbColumns?: { dragHandle?: boolean }) => {\n if (\n hiddenColumns &&\n !ootbColumns &&\n hiddenColumns.length === instance.getView().state.hiddenColumns?.length &&\n hiddenColumns.every(id => instance.getView().state.hiddenColumns?.includes(id))\n ) {\n return;\n }\n if (ootbColumns?.dragHandle && !isRowReorderFieldEnabled(instance.getView().meta)) {\n delete ootbColumns.dragHandle;\n }\n instance.getView().type.applyHiddenColumns(hiddenColumns, ootbColumns);\n },\n [instance]\n );\n\n const setColumnOrder: RsCoreTypes.RsApi['setColumnOrder'] = useCallback(\n (colOrder: string[]) => {\n if (colOrder && deepEqual(colOrder, instance.getView().state.colOrder)) {\n return;\n }\n instance.getView().type.applyOrder(colOrder);\n },\n [instance]\n );\n\n const setAggregations: RsCoreTypes.RsApi['setAggregations'] = useCallback(\n (agg: RsCoreTypes.State['aggregationInfo']) => {\n if (agg && deepEqual(agg, instance.getView().state.aggregationInfo)) {\n return;\n }\n if (agg) instance.getView().type.applyAggregations(agg);\n },\n [instance]\n );\n\n const setFilter: RsCoreTypes.RsApi['setFilter'] = useCallback(\n newFilter => {\n if (newFilter && deepEqual(newFilter, instance.getView().state.filterExpression)) {\n return;\n }\n instance.getView().type.applyFilter({ filterExp: newFilter });\n },\n [instance]\n );\n\n const setAliases: RsCoreTypes.RsApi['setAliases'] = useCallback(\n aliases => {\n if (!aliases) {\n return;\n }\n instance.getView().type.applyAliases({ aliases });\n },\n [instance]\n );\n\n const setSorting: RsCoreTypes.RsApi['setSorting'] = useCallback(\n sortingOrder => {\n if (sortingOrder && deepEqual(sortingOrder, instance.getView().state.sortingOrder)) {\n return;\n }\n instance.getView().type.applySorting(sortingOrder);\n },\n [instance]\n );\n\n const setGrouping: RsCoreTypes.RsApi['setGrouping'] = useCallback(\n (groups: RsCoreTypes.Group[]) => {\n if (groups && deepEqual(groups, instance.getView().state.groups)) {\n return;\n }\n instance.getView().type.applyGrouping(groups);\n },\n [instance]\n );\n\n const setRowReorderFieldVisibility: RsCoreTypes.RsApi['setRowReorderFieldVisibility'] =\n useCallback(\n visibility => {\n if (isRowReorderFieldEnabled(instance.getView().meta)) {\n instance\n .getView()\n .type.updateColumnsVisibility({ [rowDragDropColumnMeta.field.id]: visibility });\n }\n },\n [instance]\n );\n\n const updateColumnsVisibility: RsCoreTypes.RsApi['updateColumnsVisibility'] = useCallback(\n columns => {\n const fieldDefs = instance.getView().meta.fieldDefs.map(field => field.id);\n const columnsToBeToggled: Record<string, boolean> = {};\n Object.keys(columns).forEach(column => {\n if (fieldDefs.includes(column)) {\n columnsToBeToggled[column] = columns[column];\n }\n });\n if (Object.keys(columnsToBeToggled).length) {\n instance.getView().type.updateColumnsVisibility(columnsToBeToggled);\n }\n },\n [instance]\n );\n\n const getActiveViewInfo = useCallback(() => {\n const {\n state: { personalization }\n } = instance.getView();\n\n const activePersonalization = personalization?.active;\n const activePersonalizationName = activePersonalization\n ? personalization?.allPersonalizations?.[activePersonalization]?.name\n : undefined;\n return {\n id: activePersonalization,\n name: activePersonalizationName,\n isDirty: !!personalization?.dirty\n };\n }, [instance]);\n\n const setConditionalStyleFormats: RsCoreTypes.RsApi['setConditionalStyleFormats'] = useCallback(\n conditionalStyleFormats => {\n const {\n meta: { fieldDefs }\n } = instance.getView();\n\n if (\n conditionalStyleFormats &&\n deepEqual(conditionalStyleFormats, instance.getView().state.conditionalStyleFormats)\n ) {\n return;\n }\n\n const sanitizedFormats = sanitizeConditionalStyleFormats(conditionalStyleFormats, fieldDefs);\n instance.getView().type.setConditionalStyleFormats(sanitizedFormats);\n },\n []\n );\n\n const setRenderFormatter: RsCoreTypes.RsApi['setRenderFormatter'] = useCallback(\n (columnId, formatterName) => {\n instance\n .getView()\n .columns?.find(c => c.field.id === columnId)\n ?.applyFormatter(formatterName);\n },\n [instance]\n );\n\n const removeRenderFormatter: RsCoreTypes.RsApi['removeRenderFormatter'] = useCallback(\n columnId => {\n instance\n .getView()\n .columns?.find(c => c.field.id === columnId)\n ?.removeFormatter();\n },\n [instance]\n );\n\n // TODO: Move the RsCoreTypes.RsApi's to separate file, maybe useRsApi.ts\n // TODO:\n useImperativeHandle(\n repeatComponentInstance,\n () => ({\n refreshView: instance.getView().type.forceRefresh,\n setRecordCount: instance.getView().type.setRecordCount,\n dispatchAction: instance.getView().type.dispatchAction,\n getActiveViewInfo,\n /** Only expose below APIs when those features are enabled */\n setHiddenColumns: instance.getView().meta.toggleFieldVisibility\n ? setHiddenColumns\n : undefined,\n setColumnOrder: instance.getView().meta.reorderFields ? setColumnOrder : undefined,\n setFilter,\n setSorting,\n setAliases,\n setGrouping: instance.getView().meta.grouping ? setGrouping : undefined,\n setAggregations,\n setRenderFormatter,\n removeRenderFormatter,\n setRowReorderFieldVisibility,\n updateColumnsVisibility,\n setConditionalStyleFormats\n }),\n\n []\n );\n\n // When ever component mounts, do this after first render of component\n useEffect(() => {\n instance.getView().type.doBootstrap();\n if (onViewReady) onViewReady(instance.api);\n if (instance.apiContext.addCallbacks && repeatComponentInstance?.current) {\n // add instance APIs as callbacks <setRecordCount> for push communication from Nebula to Client\n instance.apiContext.addCallbacks({\n ...repeatComponentInstance.current,\n forceRefresh: instance.getView().type.forceRefresh\n });\n }\n\n instance.apiContext.setRsID?.(instance.getView().rsID);\n\n instance.rsCoreApi.notifyViewEvent().mount();\n return () => {\n instance.rsCoreApi.notifyViewEvent().unmount();\n // Marking it as ts-ignore. Making these objects take null will increase conditional blocks in code.\n // @ts-ignore\n instance.rsCoreApi = null;\n // @ts-ignore\n instance.getView = null;\n };\n }, [instance]);\n\n useEffect(() => {\n instance.rsCoreApi.notifyViewEvent().afterRender();\n }, [instance, instance.getView().state]);\n\n return instance;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"StyledTableContainer.d.ts","sourceRoot":"","sources":["../../../../Core/Views/Table/StyledTableContainer.jsx"],"names":[],"mappings":";AAwBA,oNAq3BG"}
1
+ {"version":3,"file":"StyledTableContainer.d.ts","sourceRoot":"","sources":["../../../../Core/Views/Table/StyledTableContainer.jsx"],"names":[],"mappings":";AAwBA,oNAk3BG"}
@@ -41,7 +41,7 @@ const StyledTableContainer = styled(forwardRef((props, ref) => _jsx("div", { ref
41
41
  --letter-spacing: ${theme.components.table.typography['letter-spacing']};
42
42
  --cell-padding: ${theme.base.spacing};
43
43
  --cell-vertical-padding: calc(${theme.base.spacing} * 0.5);
44
- --header-cell-padding: 0 0.125rem 0 var(--cell-padding);
44
+ --header-cell-padding: 0 0.44rem 0 var(--cell-padding);
45
45
  --header-bg-color: var(--secondary-background);
46
46
  --header-fg-color: ${usableHeaderForeground};
47
47
  --default-group-header-height: 1.5rem;
@@ -435,14 +435,16 @@ const StyledTableContainer = styled(forwardRef((props, ref) => _jsx("div", { ref
435
435
  padding: 0;
436
436
  }
437
437
  &.row-select-handle {
438
- padding-left: calc(var(--expand-collapse-all-width) + 0.25rem);
438
+ padding-inline-start: var(--expand-collapse-all-width);
439
439
  }
440
440
  }
441
441
 
442
442
  .row-container .row > .cell-first {
443
443
  &.row-select-handle {
444
+ /* Offset padding of 0.5rem added to SelectAllCheckbox in grouped views(getting pushed by margin),
445
+ ensuring row select checkboxes align vertically in header and data rows */
444
446
  padding-inline-start: calc(
445
- var(--expand-collapse-all-width) - var(--cell-padding) + 0.25rem
447
+ var(--expand-collapse-all-width) - var(--cell-padding) + 0.5rem
446
448
  );
447
449
  }
448
450
  }
@@ -567,11 +569,6 @@ const StyledTableContainer = styled(forwardRef((props, ref) => _jsx("div", { ref
567
569
  padding: 0;
568
570
  justify-content: center;
569
571
  }
570
-
571
- > .cell-first {
572
- padding: 0 var(--cell-padding);
573
- }
574
-
575
572
  .row {
576
573
  border-bottom: none;
577
574
  }
@@ -1 +1 @@
1
- {"version":3,"file":"StyledTableContainer.js","sourceRoot":"","sources":["../../../../Core/Views/Table/StyledTableContainer.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EACL,YAAY,EACZ,uBAAuB,EACvB,GAAG,EACH,aAAa,EACb,cAAc,EACf,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,YAAY,EAAE,MAAM,sDAAsD,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,8DAA8D,CAAC;AAChG,OAAO,EACL,WAAW,EACX,sBAAsB,EACtB,iBAAiB,EACjB,QAAQ,EACT,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,sDAAsD,CAAC;AAEtF,OAAO,EAAE,mCAAmC,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjG,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,oBAAoB,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,cAAK,GAAG,EAAE,GAAG,KAAM,KAAK,GAAI,CAAC,CAAC,CAAC,CAAC,EA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;;;;QAMZ,gBAAgB,IAAI,WAAW;;;;;;;;;;;;;;;;;;;mBAmBpB,QAAQ;;;;;;;;;;;;;;;;YAgBf,QAAQ;;;;;;;;;;;;+BAYW,oBAAoB;QAC3C,CAAC,CAAC,oCAAoC;QACtC,CAAC,CAAC,uBAAuB;;;;;;;;;;;;;;;;mBAgBd,QAAQ;;;;;;;;;;;;;;YAcf,QAAQ;;;;;;;;;;;;;;;;;;;;mBAoBD,QAAQ,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;4BAqBD,gBAAgB;;;;;8BAKd,gBAAgB;;;;4BAIlB,cAAc;;;;;;;;8BAQZ,cAAc;;;;;wBAKpB,cAAc;;;;;;;;;uBASf,KAAK,CAAC,IAAI,CAAC,OAAO;;;;;uBAKlB,KAAK,CAAC,IAAI,CAAC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDtC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,oBAAoB,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport styled, { css } from 'styled-components';\nimport {\n getLuminance,\n meetsContrastGuidelines,\n mix,\n readableColor,\n transparentize\n} from 'polished';\n\nimport { StyledStatus } from '@pega/cosmos-react-core/lib/components/Badges/Status';\nimport { StyledRadioCheck } from '@pega/cosmos-react-core/lib/components/RadioCheck/RadioCheck';\nimport {\n StyledLabel,\n StyledProgressBackdrop,\n calculateFontSize,\n tryCatch\n} from '@pega/cosmos-react-core';\nimport { StyledTabPanel } from '@pega/cosmos-react-core/lib/components/Tabs/TabPanel';\n\nimport { generateRSDataContainerHeightStyles, generateRSHeightStyles } from '../../Utils/styles';\n\nimport { CellIcon } from './CellWrapper';\n\nconst StyledTableContainer = styled(forwardRef((props, ref) => <div ref={ref} {...props} />))(({\n theme,\n view,\n isFullscreen\n}) => {\n const isAggregationApplied = view.columns?.filter(c => !c.hidden).some(c => c.aggregated);\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n const showFreezeLine =\n view.state.responsive?.sm &&\n !(view.hasNoRecords || view.hasNoFrozenColumns || view.bHideFreezeLine);\n const selectedRowColor = tryCatch(() =>\n mix(0.85, theme.base.palette['primary-background'], theme.base.palette.interactive)\n );\n const lightGreyColor = theme.base.colors.gray['extra-light'];\n const freezeLineShadowTransparent = transparentize(\n 0.9,\n theme.components.table.header['foreground-color']\n );\n const oddRowBackgroundColor =\n getLuminance(theme.components.table.body['secondary-background-color']) > 0.5\n ? theme.components.table.body['secondary-background-color']\n : mix(\n 0.75,\n theme.components.table.body['background-color'],\n theme.components.table.body['secondary-background-color']\n );\n\n const headerForegroundContrast = meetsContrastGuidelines(\n theme.components.table.header['foreground-color'],\n theme.components.table.header['background-color']\n ).AA;\n const usableHeaderForeground = headerForegroundContrast\n ? theme.components.table.header['foreground-color']\n : readableColor(\n theme.components.table.header['foreground-color'],\n theme.components.table.header['background-color']\n );\n const oddRowContrast = meetsContrastGuidelines(\n theme.components.table.body['foreground-color'],\n oddRowBackgroundColor\n ).AA;\n const useableOddRowForeground = oddRowContrast\n ? theme.components.table.body['foreground-color']\n : readableColor(theme.components.table.body['foreground-color'], oddRowBackgroundColor);\n\n return css`\n --primary-background: ${theme.base.palette['primary-background']};\n --secondary-background: ${theme.components.table.header['background-color']};\n --forground-color: ${theme.base.palette['foreground-color']};\n --interactive: ${theme.base.palette.interactive};\n --medium-blue: ${theme.base.colors.blue.medium};\n --border-color: ${theme.base.palette['border-line']};\n --border-color-freeze: #a5a5a5;\n --border-width: 0.062rem;\n --border-style: var(--border-width) solid var(--border-color);\n --font-stretch: ${theme.components.table.typography['font-stretch']};\n --letter-spacing: ${theme.components.table.typography['letter-spacing']};\n --cell-padding: ${theme.base.spacing};\n --cell-vertical-padding: calc(${theme.base.spacing} * 0.5);\n --header-cell-padding: 0 0.125rem 0 var(--cell-padding);\n --header-bg-color: var(--secondary-background);\n --header-fg-color: ${usableHeaderForeground};\n --default-group-header-height: 1.5rem;\n --group-header-height: var(--default-group-header-height);\n --box-sizing: content-box;\n --animation-ease: ${theme.base.animation.timing.ease};\n --font-weight-semi-bold: ${theme.base['font-weight']['semi-bold']};\n --row-height-multiplier: 1.125;\n --cell-fixed-position: sticky;\n position: relative;\n ${() => generateRSHeightStyles({ view, isFullscreen })}\n\n .small-screen-table {\n --cell-fixed-position: static;\n }\n\n .container {\n ${() => generateRSDataContainerHeightStyles()};\n border: var(--border-style);\n border-radius: var(--border-radius, ${theme.base['border-radius']});\n position: relative;\n letter-spacing: var(--letter-spacing);\n font-stretch: var(--font-stretch);\n ${StyledTabPanel} & ${StyledProgressBackdrop} {\n border-radius: var(--border-radius, ${theme.base['border-radius']});\n }\n }\n\n .hide-rows-till-ready .row[aria-rowindex] {\n visibility: hidden;\n }\n\n .table-drag-proxy {\n background: rgba(0, 0, 0, 0.21);\n position: absolute;\n top: 0;\n bottom: 0;\n z-index: 6;\n pointer-events: none;\n display: none;\n }\n\n .table-drag-line {\n background: #999999;\n position: absolute;\n top: 0;\n bottom: 0;\n width: 0.12rem;\n z-index: 6;\n pointer-events: none;\n display: none;\n }\n\n .cell-fixed {\n z-index: 1;\n }\n\n .group-wrapper {\n overflow: hidden;\n display: inline-flex;\n line-height: var(--group-header-height);\n\n .group-context-count {\n display: inline-flex;\n overflow: hidden;\n }\n }\n\n /* In review mode(Ex: Tabs) cosmos components are rendered and mark up is not compatible with\n group-wrapper cell. Overridden css in group-header when dl exists inside that class which indicates\n mark up is generated from cosmos which differentiates from normal table cell markup */\n .group-wrapper .group-context-count dl {\n grid-template-columns: auto;\n }\n\n .fallback,\n .fallback-footer {\n height: var(--row-height);\n background-color: var(--header-bg-color);\n color: var(--header-fg-color);\n position: absolute;\n width: 100%;\n z-index: -1;\n box-sizing: var(--box-sizing);\n }\n\n .fallback {\n /* stylelint-disable unit-allowed-list */\n top: -1px;\n border-bottom: var(--border-style);\n }\n\n .fallback-footer {\n top: 0;\n border-top: var(--border-style);\n }\n\n .sticky-header {\n display: grid;\n position: sticky;\n top: 0;\n z-index: 6;\n border-start-start-radius: inherit;\n border-start-end-radius: inherit;\n }\n\n .cell {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n\n .icons-ph {\n /* Maintaining action button aspect ratio of 1:1 with 24*24px width and height */\n min-width: 1.5rem;\n }\n\n &.custom-item {\n width: 10em;\n }\n }\n\n .cell:focus {\n outline: 0.125rem auto var(--medium-blue);\n }\n\n .cell.selection-border:focus {\n outline: none 0;\n }\n\n .row {\n display: inline-flex;\n height: var(--row-height);\n outline: none 0;\n transition: transform 0.5s var(--animation-ease);\n box-sizing: var(--box-sizing);\n position: relative;\n\n > .row-select-handle {\n display: flex;\n justify-content: center;\n &:active {\n outline: none;\n }\n\n > .header-lable-container {\n min-width: 20px;\n }\n /* stylelint-disable selector-max-class */\n &.cell-fixed > .cell-content {\n flex-grow: unset;\n }\n }\n\n > .cell,\n .group-header-aggregation-row > .cell {\n transition: transform 0.5s var(--animation-ease);\n border-right: var(--border-style);\n position: relative;\n ${!theme.components.table['striped-rows'] &&\n css`\n border-bottom: var(--border-style);\n `}\n display: flex;\n align-items: center;\n\n &::after {\n opacity: 1;\n transition: opacity 0.1s var(--animation-ease);\n }\n\n .row-action-menu {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n &.cell-action {\n position: sticky;\n z-index: 4;\n right: 0;\n border-right: 0;\n justify-content: center;\n border-left: var(--border-style);\n\n /* The below styles are needed to avoid ellipses in safari when no text is present\n and to hide the 'Actions' label */\n\n /* stylelint-disable max-nesting-depth */\n\n div.header-label {\n text-overflow: unset;\n }\n }\n &.aggregateCell {\n background-color: var(--header-bg-color);\n }\n }\n\n /** Adds bottom border to the last row of a group, when striped-rows are enabled */\n &:has(+ .group-header-row) > .cell {\n ${theme.components.table['striped-rows'] &&\n css`\n border-bottom: var(--border-style);\n `}\n }\n &.header > .cell {\n border-bottom: var(--border-style);\n }\n .group-header-aggregation-row {\n > .cell {\n &.cell-action {\n overflow: initial;\n\n /* extending border on the top left of row action cell as we need to show border for at the end group label value when row actions are present */\n &::before {\n content: '';\n position: absolute;\n inline-size: 0;\n inset-inline-start: calc(var(--border-width) * -1);\n inset-block-start: calc(var(--group-header-height) * -1);\n block-size: var(--group-header-height);\n border-inline-start: var(--border-style);\n }\n }\n }\n }\n\n > .cell-action {\n background-color: var(--primary-background);\n }\n\n > .row-reorder-handle {\n padding: 0;\n border-right: 0 !important;\n justify-content: center;\n cursor: move;\n }\n\n .aggregateCell.cell {\n border-right: none;\n }\n\n > .cell.cell-fixed,\n .group-header-aggregation-row > .cell-fixed {\n position: var(--cell-fixed-position);\n z-index: 4;\n\n ${showFreezeLine &&\n css`\n &.cell-last-frozen {\n border-right: solid 1px var(--border-color-freeze);\n box-shadow: calc(${theme.base.spacing} * 0.25) 0 0 0 ${freezeLineShadowTransparent};\n transition: 0.5s;\n }\n `}\n\n /* As the row select column and row dragDrop column always have to be frozen */\n &[data-col-id='RowSelect'],\n &[data-col-id='RowDragDrop'],\n &[data-col-id='RowError'] {\n position: sticky;\n flex-shrink: 0;\n z-index: 5;\n }\n }\n\n > .cell.cell-fixed:focus-within,\n .group-header-aggregation-row > .cell-fixed {\n z-index: 6;\n }\n\n &.click {\n cursor: pointer;\n }\n\n &:last-child {\n border-end-start-radius: inherit;\n border-end-end-radius: inherit;\n\n > .cell {\n &:first-child {\n border-end-start-radius: inherit;\n }\n\n &:last-child {\n border-end-end-radius: inherit;\n }\n\n ${theme.components.table['striped-rows'] &&\n css`\n border-bottom: var(--border-style);\n `}\n }\n }\n }\n .row:not(.row-error):not(.group-header-row):not(.header) {\n .cell-fixed {\n background: var(--primary-background);\n }\n .cell-fixed.aggregateCell {\n background: var(--header-bg-color);\n }\n }\n ${theme.components.table['striped-rows'] &&\n css`\n /* Targets rows with an odd data-index attribute, excluding group header rows */\n .row[data-index$='1']:not(.group-header-row):not(.header),\n .row[data-index$='3']:not(.group-header-row):not(.header),\n .row[data-index$='5']:not(.group-header-row):not(.header),\n .row[data-index$='7']:not(.group-header-row):not(.header),\n .row[data-index$='9']:not(.group-header-row):not(.header) {\n background: ${oddRowBackgroundColor};\n color: ${useableOddRowForeground};\n .cell-fixed {\n background: ${oddRowBackgroundColor};\n color: ${useableOddRowForeground};\n }\n > .cell-action {\n background: ${oddRowBackgroundColor};\n }\n }\n .row[data-index$='0']:not(.group-header-row):not(.header),\n .row[data-index$='2']:not(.group-header-row):not(.header),\n .row[data-index$='4']:not(.group-header-row):not(.header),\n .row[data-index$='6']:not(.group-header-row):not(.header),\n .row[data-index$='8']:not(.group-header-row):not(.header) {\n background: var(--primary-background);\n .cell-fixed {\n background: var(--primary-background);\n }\n > .cell-action {\n background: var(--primary-background);\n }\n }\n `}\n\n .row-error {\n background: ${mix(\n 0.1,\n theme.components['form-field'].error['status-color'],\n theme.base.palette['primary-background']\n )};\n\n /* stylelint-disable no-descending-specificity */\n .cell-fixed,\n .cell-action {\n background: inherit;\n }\n\n > .cell:not(.cell-fixed):not(.cell-action) {\n background: none;\n }\n }\n\n .sort-info-container {\n .sort-sequence {\n font-size: 0.625rem;\n color: ${theme.base.colors.gray['extra-dark']};\n }\n }\n\n .filter-info-container {\n display: flex;\n justify-content: center;\n align-items: center;\n\n svg {\n width: 14px;\n height: 14px;\n }\n }\n\n .cell.row-error-column {\n padding: 0;\n border-right: 0;\n text-align: right;\n outline: none;\n\n /* Focus handling will be done as part of interation 2: EPIC-88751 */\n\n svg {\n color: ${theme.base.colors.red.medium};\n }\n }\n\n .cell-right-align .filter-info-container svg {\n margin: 0 0.312rem 0 0;\n }\n\n &.show-expand-collapse-all {\n .row > .cell-first {\n padding-left: calc(var(--expand-collapse-all-width) + var(--cell-padding) + 0.25rem);\n &.row-reorder-handle,\n &.row-error-column {\n padding: 0;\n }\n &.row-select-handle {\n padding-left: calc(var(--expand-collapse-all-width) + 0.25rem);\n }\n }\n\n .row-container .row > .cell-first {\n &.row-select-handle {\n padding-inline-start: calc(\n var(--expand-collapse-all-width) - var(--cell-padding) + 0.25rem\n );\n }\n }\n\n /* stylelint-enable selector-max-class */\n .expand-collapse-all {\n position: absolute;\n width: var(--expand-collapse-all-width);\n z-index: 10;\n height: var(--row-height);\n background-color: var(--header-bg-color);\n color: var(--header-fg-color);\n border-right: var(--border-style);\n border-bottom: var(--border-style);\n border-start-start-radius: ${theme.base['border-radius']};\n padding-inline-start: 0.125rem;\n margin-inline-start: 0.25rem;\n display: flex;\n align-items: center;\n justify-content: center;\n\n &::before {\n content: '';\n position: absolute;\n inset-block-start: 0;\n inset-inline-start: -0.25rem;\n width: 0.25rem;\n height: 100%;\n background-color: var(--header-bg-color);\n z-index: 12;\n }\n\n > button {\n color: var(--forground-color);\n :focus {\n box-shadow: ${theme.base.shadow.focus};\n }\n }\n }\n .no-border-right {\n border-right: 0;\n }\n }\n\n /* stylelint-disable selector-max-class */\n\n .scroll-end {\n &.row-container > .row:last-child {\n & > .cell,\n & .group-header-aggregation-row > .cell {\n border-bottom: 0;\n }\n }\n }\n\n /* stylelint-enable selector-max-class */\n .header {\n font-weight: var(--font-weight-semi-bold);\n position: relative; /* This is required to position .border-fix element */\n border-start-start-radius: inherit;\n border-start-end-radius: inherit;\n\n > .cell.row-error-column {\n border-right: 0;\n }\n > .cell {\n display: flex;\n justify-content: space-between;\n align-items: center;\n z-index: 2;\n position: relative;\n cursor: pointer;\n background-color: var(--header-bg-color);\n color: var(--header-fg-color);\n font-weight: ${theme.base['font-weight'].bold};\n font-size: ${fontSize.xxs};\n border-right: var(--border-style);\n padding: var(--header-cell-padding);\n\n &:first-child {\n border-start-start-radius: inherit;\n }\n\n &:last-child {\n border-start-end-radius: inherit;\n }\n\n .header-lable-container {\n display: inline-flex;\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: ${fontSize.xs};\n font-weight: var(--font-weight-semi-bold);\n align-items: center;\n gap: 0.125rem;\n }\n\n .header-label {\n overflow: hidden;\n text-overflow: ellipsis;\n\n /* To avoid browser tooltip when we get ellipsis in safari */\n &::after {\n content: '';\n display: block;\n }\n\n /* To utilize smart tooltip making it as a non-box element */\n /* stylelint-disable selector-max-class */\n .cell-content {\n display: contents;\n }\n }\n }\n\n > .row-reorder-handle {\n padding: 0;\n }\n\n > .row-select-handle {\n /* Nullifying padding applied from .header > .cell */\n padding: 0;\n justify-content: center;\n }\n\n > .cell-first {\n padding: 0 var(--cell-padding);\n }\n\n .row {\n border-bottom: none;\n }\n }\n\n /* 4 selectors required as aggregateCell of only footer need this effect */\n\n .pContainer:not(.pContainerScroll) .footer .aggregateCell.cell {\n border-bottom: none;\n }\n\n /* stylelint-enable selector-max-class */\n .row .cell.cell-last {\n border-right: 0;\n flex-grow: 1;\n }\n\n .row-container {\n --data-row-height: calc(\n var(--hit-area) * var(--row-height-multiplier) + var(--cell-vertical-padding)\n );\n --group-header-height: ${isAggregationApplied\n ? 'var(--default-group-header-height)'\n : 'var(--data-row-height)'};\n &:not(.wrap-content-height) > .row:not(.group-header-row) {\n height: var(--data-row-height);\n }\n\n & > .row:not(.group-header-row) {\n min-width: 100%;\n }\n border-end-start-radius: inherit;\n border-end-end-radius: inherit;\n\n & > .row .cell-content {\n /*\n * Using box sizing content-box so that the padding is not considered for the alignment of the cell content.\n * Vertical alignment is done using flex and max-height below even though the .cell-content might overflow due to padding + content size.\n */\n box-sizing: content-box;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n word-break: break-all;\n flex-grow: 1;\n\n /* Adding padding on .cell-content so that focus rings can appear properly and doesn't clip due to overflow: hidden */\n padding: var(--cell-vertical-padding) var(--cell-padding);\n\n /* setting max-height so that the elements with more height like RTL, align with the row density height */\n max-height: var(--data-row-height);\n\n /* hiding scroll bar in case the cell render introduces scrollbar based on its implementation */\n & * {\n scrollbar-width: none;\n }\n\n /* in case of combine columns, removing padding from parent cell-content as children already have the padding */\n &:has(.combined-cell) {\n padding: 0;\n\n /* stylelint-disable-next-line selector-max-class */\n .cell-content {\n flex-grow: unset;\n }\n }\n }\n }\n\n .row .aggregateCell .cell-content {\n line-height: initial;\n padding: 0;\n }\n\n .short-height,\n .medium-height {\n ${StyledStatus} {\n white-space: nowrap;\n }\n }\n\n .short-height {\n ${StyledRadioCheck} ${StyledLabel} {\n min-height: auto;\n }\n }\n\n .medium-height {\n --row-height-multiplier: 4 / 3;\n }\n\n .tall-height {\n --row-height-multiplier: calc(4 / 3 + 0.5);\n > .row:not(.group-header-row) {\n > .cell {\n display: inline-grid;\n align-items: start;\n white-space: normal;\n word-break: break-all;\n grid-auto-flow: column;\n\n :has(> ${CellIcon}) {\n /* Adds spacing between children when icons are rendered alongside cell content in the cell container. */\n justify-content: space-between;\n }\n\n /* stylelint-disable selector-max-class */\n /* stylelint-disable-next-line selector-max-compound-selectors */\n > .cell-content > .combined-cell > .combined-cell-content,\n > .cell-content {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n white-space: inherit;\n word-break: inherit;\n }\n\n ${CellIcon} {\n margin-block-start: 0.375rem;\n }\n }\n }\n }\n\n .wrap-content-height {\n --row-height-multiplier: 4 / 3;\n --row-min-height: calc(\n var(--hit-area) * var(--row-height-multiplier) + var(--cell-vertical-padding) * 2\n );\n --group-header-height: ${isAggregationApplied\n ? 'var(--default-group-header-height)'\n : 'var(--row-min-height)'};\n\n > .row:not(.group-header-row) {\n height: auto;\n min-height: var(--row-min-height);\n > .cell {\n white-space: normal;\n\n /* -- For BUG-625508 -- */\n word-break: break-word;\n display: inline-grid;\n align-items: start;\n padding-top: var(--cell-vertical-padding);\n padding-bottom: var(--cell-vertical-padding);\n grid-auto-flow: column;\n\n :has(> ${CellIcon}) {\n /* Adds spacing between children when icons are rendered alongside cell content in the cell container. */\n justify-content: space-between;\n }\n\n /* stylelint-disable-next-line selector-max-compound-selectors */\n > .cell-content > .combined-cell > .combined-cell-content,\n > .cell-content {\n /* for full-content, the row cells should adjust according to content */\n max-height: none;\n white-space: inherit;\n word-break: inherit;\n }\n\n ${CellIcon} {\n margin-block-start: 0.375rem;\n }\n }\n }\n }\n\n .footer {\n .row {\n .cell {\n padding: 0;\n }\n }\n }\n\n /* stylelint-disable no-duplicate-selectors */\n .row-container {\n position: absolute;\n display: grid;\n width: 100%;\n font-size: ${fontSize.s};\n\n > .group-header-row,\n .hierarchical-group-footer-row {\n height: var(--group-header-height);\n .cell {\n padding: 0;\n border-right-width: 0;\n }\n }\n\n > .hierarchical-group-header-row {\n height: var(--group-header-height);\n }\n input.checkbox-on-hover + label {\n opacity: 0;\n }\n input.checkbox-on-hover:checked + label {\n opacity: 1;\n }\n .row.selected-row {\n background-color: ${selectedRowColor};\n\n > .cell,\n .cell-fixed,\n .cell-action {\n background-color: ${selectedRowColor};\n }\n }\n .row-on-hover:hover {\n background-color: ${lightGreyColor};\n input.checkbox-on-hover + label {\n opacity: 1;\n }\n\n > .cell,\n .cell-fixed,\n .cell-action {\n background-color: ${lightGreyColor};\n }\n }\n .row.hierarchical-group-footer-row {\n .cell-fixed {\n background: ${lightGreyColor};\n }\n }\n }\n\n /* stylelint-enable selector-max-class */\n\n .toolbar-button-applied {\n padding: 0 8px;\n margin: 0 calc(${theme.base.spacing} / 4);\n }\n\n .toolbar-button {\n padding: 0 8px;\n margin: 0 calc(${theme.base.spacing} / 4);\n }\n\n .column-resizer {\n cursor: col-resize;\n position: absolute;\n top: 0;\n right: 0;\n z-index: 3;\n width: 0.25rem;\n height: 100%;\n }\n\n .column-resizer:hover,\n .column-resizer:active {\n background: var(--interactive);\n }\n\n .align-right {\n justify-content: right;\n\n .cell-content {\n text-align: right;\n }\n }\n\n .align-left {\n justify-content: left;\n\n .cell-content {\n text-align: left;\n }\n }\n\n .align-center {\n justify-content: center;\n\n .cell-content {\n text-align: center;\n }\n }\n\n .popper {\n div.row {\n display: flex;\n vertical-align: middle;\n line-height: unset;\n border-bottom: none;\n outline: none 0;\n height: auto;\n }\n }\n `;\n});\n\nexport default StyledTableContainer;\n"]}
1
+ {"version":3,"file":"StyledTableContainer.js","sourceRoot":"","sources":["../../../../Core/Views/Table/Styled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KAAK,CAAC,IAAI,CAAC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDtC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,oBAAoB,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport styled, { css } from 'styled-components';\nimport {\n getLuminance,\n meetsContrastGuidelines,\n mix,\n readableColor,\n transparentize\n} from 'polished';\n\nimport { StyledStatus } from '@pega/cosmos-react-core/lib/components/Badges/Status';\nimport { StyledRadioCheck } from '@pega/cosmos-react-core/lib/components/RadioCheck/RadioCheck';\nimport {\n StyledLabel,\n StyledProgressBackdrop,\n calculateFontSize,\n tryCatch\n} from '@pega/cosmos-react-core';\nimport { StyledTabPanel } from '@pega/cosmos-react-core/lib/components/Tabs/TabPanel';\n\nimport { generateRSDataContainerHeightStyles, generateRSHeightStyles } from '../../Utils/styles';\n\nimport { CellIcon } from './CellWrapper';\n\nconst StyledTableContainer = styled(forwardRef((props, ref) => <div ref={ref} {...props} />))(({\n theme,\n view,\n isFullscreen\n}) => {\n const isAggregationApplied = view.columns?.filter(c => !c.hidden).some(c => c.aggregated);\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n const showFreezeLine =\n view.state.responsive?.sm &&\n !(view.hasNoRecords || view.hasNoFrozenColumns || view.bHideFreezeLine);\n const selectedRowColor = tryCatch(() =>\n mix(0.85, theme.base.palette['primary-background'], theme.base.palette.interactive)\n );\n const lightGreyColor = theme.base.colors.gray['extra-light'];\n const freezeLineShadowTransparent = transparentize(\n 0.9,\n theme.components.table.header['foreground-color']\n );\n const oddRowBackgroundColor =\n getLuminance(theme.components.table.body['secondary-background-color']) > 0.5\n ? theme.components.table.body['secondary-background-color']\n : mix(\n 0.75,\n theme.components.table.body['background-color'],\n theme.components.table.body['secondary-background-color']\n );\n\n const headerForegroundContrast = meetsContrastGuidelines(\n theme.components.table.header['foreground-color'],\n theme.components.table.header['background-color']\n ).AA;\n const usableHeaderForeground = headerForegroundContrast\n ? theme.components.table.header['foreground-color']\n : readableColor(\n theme.components.table.header['foreground-color'],\n theme.components.table.header['background-color']\n );\n const oddRowContrast = meetsContrastGuidelines(\n theme.components.table.body['foreground-color'],\n oddRowBackgroundColor\n ).AA;\n const useableOddRowForeground = oddRowContrast\n ? theme.components.table.body['foreground-color']\n : readableColor(theme.components.table.body['foreground-color'], oddRowBackgroundColor);\n\n return css`\n --primary-background: ${theme.base.palette['primary-background']};\n --secondary-background: ${theme.components.table.header['background-color']};\n --forground-color: ${theme.base.palette['foreground-color']};\n --interactive: ${theme.base.palette.interactive};\n --medium-blue: ${theme.base.colors.blue.medium};\n --border-color: ${theme.base.palette['border-line']};\n --border-color-freeze: #a5a5a5;\n --border-width: 0.062rem;\n --border-style: var(--border-width) solid var(--border-color);\n --font-stretch: ${theme.components.table.typography['font-stretch']};\n --letter-spacing: ${theme.components.table.typography['letter-spacing']};\n --cell-padding: ${theme.base.spacing};\n --cell-vertical-padding: calc(${theme.base.spacing} * 0.5);\n --header-cell-padding: 0 0.44rem 0 var(--cell-padding);\n --header-bg-color: var(--secondary-background);\n --header-fg-color: ${usableHeaderForeground};\n --default-group-header-height: 1.5rem;\n --group-header-height: var(--default-group-header-height);\n --box-sizing: content-box;\n --animation-ease: ${theme.base.animation.timing.ease};\n --font-weight-semi-bold: ${theme.base['font-weight']['semi-bold']};\n --row-height-multiplier: 1.125;\n --cell-fixed-position: sticky;\n position: relative;\n ${() => generateRSHeightStyles({ view, isFullscreen })}\n\n .small-screen-table {\n --cell-fixed-position: static;\n }\n\n .container {\n ${() => generateRSDataContainerHeightStyles()};\n border: var(--border-style);\n border-radius: var(--border-radius, ${theme.base['border-radius']});\n position: relative;\n letter-spacing: var(--letter-spacing);\n font-stretch: var(--font-stretch);\n ${StyledTabPanel} & ${StyledProgressBackdrop} {\n border-radius: var(--border-radius, ${theme.base['border-radius']});\n }\n }\n\n .hide-rows-till-ready .row[aria-rowindex] {\n visibility: hidden;\n }\n\n .table-drag-proxy {\n background: rgba(0, 0, 0, 0.21);\n position: absolute;\n top: 0;\n bottom: 0;\n z-index: 6;\n pointer-events: none;\n display: none;\n }\n\n .table-drag-line {\n background: #999999;\n position: absolute;\n top: 0;\n bottom: 0;\n width: 0.12rem;\n z-index: 6;\n pointer-events: none;\n display: none;\n }\n\n .cell-fixed {\n z-index: 1;\n }\n\n .group-wrapper {\n overflow: hidden;\n display: inline-flex;\n line-height: var(--group-header-height);\n\n .group-context-count {\n display: inline-flex;\n overflow: hidden;\n }\n }\n\n /* In review mode(Ex: Tabs) cosmos components are rendered and mark up is not compatible with\n group-wrapper cell. Overridden css in group-header when dl exists inside that class which indicates\n mark up is generated from cosmos which differentiates from normal table cell markup */\n .group-wrapper .group-context-count dl {\n grid-template-columns: auto;\n }\n\n .fallback,\n .fallback-footer {\n height: var(--row-height);\n background-color: var(--header-bg-color);\n color: var(--header-fg-color);\n position: absolute;\n width: 100%;\n z-index: -1;\n box-sizing: var(--box-sizing);\n }\n\n .fallback {\n /* stylelint-disable unit-allowed-list */\n top: -1px;\n border-bottom: var(--border-style);\n }\n\n .fallback-footer {\n top: 0;\n border-top: var(--border-style);\n }\n\n .sticky-header {\n display: grid;\n position: sticky;\n top: 0;\n z-index: 6;\n border-start-start-radius: inherit;\n border-start-end-radius: inherit;\n }\n\n .cell {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n\n .icons-ph {\n /* Maintaining action button aspect ratio of 1:1 with 24*24px width and height */\n min-width: 1.5rem;\n }\n\n &.custom-item {\n width: 10em;\n }\n }\n\n .cell:focus {\n outline: 0.125rem auto var(--medium-blue);\n }\n\n .cell.selection-border:focus {\n outline: none 0;\n }\n\n .row {\n display: inline-flex;\n height: var(--row-height);\n outline: none 0;\n transition: transform 0.5s var(--animation-ease);\n box-sizing: var(--box-sizing);\n position: relative;\n\n > .row-select-handle {\n display: flex;\n justify-content: center;\n &:active {\n outline: none;\n }\n\n > .header-lable-container {\n min-width: 20px;\n }\n /* stylelint-disable selector-max-class */\n &.cell-fixed > .cell-content {\n flex-grow: unset;\n }\n }\n\n > .cell,\n .group-header-aggregation-row > .cell {\n transition: transform 0.5s var(--animation-ease);\n border-right: var(--border-style);\n position: relative;\n ${!theme.components.table['striped-rows'] &&\n css`\n border-bottom: var(--border-style);\n `}\n display: flex;\n align-items: center;\n\n &::after {\n opacity: 1;\n transition: opacity 0.1s var(--animation-ease);\n }\n\n .row-action-menu {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n &.cell-action {\n position: sticky;\n z-index: 4;\n right: 0;\n border-right: 0;\n justify-content: center;\n border-left: var(--border-style);\n\n /* The below styles are needed to avoid ellipses in safari when no text is present\n and to hide the 'Actions' label */\n\n /* stylelint-disable max-nesting-depth */\n\n div.header-label {\n text-overflow: unset;\n }\n }\n &.aggregateCell {\n background-color: var(--header-bg-color);\n }\n }\n\n /** Adds bottom border to the last row of a group, when striped-rows are enabled */\n &:has(+ .group-header-row) > .cell {\n ${theme.components.table['striped-rows'] &&\n css`\n border-bottom: var(--border-style);\n `}\n }\n &.header > .cell {\n border-bottom: var(--border-style);\n }\n .group-header-aggregation-row {\n > .cell {\n &.cell-action {\n overflow: initial;\n\n /* extending border on the top left of row action cell as we need to show border for at the end group label value when row actions are present */\n &::before {\n content: '';\n position: absolute;\n inline-size: 0;\n inset-inline-start: calc(var(--border-width) * -1);\n inset-block-start: calc(var(--group-header-height) * -1);\n block-size: var(--group-header-height);\n border-inline-start: var(--border-style);\n }\n }\n }\n }\n\n > .cell-action {\n background-color: var(--primary-background);\n }\n\n > .row-reorder-handle {\n padding: 0;\n border-right: 0 !important;\n justify-content: center;\n cursor: move;\n }\n\n .aggregateCell.cell {\n border-right: none;\n }\n\n > .cell.cell-fixed,\n .group-header-aggregation-row > .cell-fixed {\n position: var(--cell-fixed-position);\n z-index: 4;\n\n ${showFreezeLine &&\n css`\n &.cell-last-frozen {\n border-right: solid 1px var(--border-color-freeze);\n box-shadow: calc(${theme.base.spacing} * 0.25) 0 0 0 ${freezeLineShadowTransparent};\n transition: 0.5s;\n }\n `}\n\n /* As the row select column and row dragDrop column always have to be frozen */\n &[data-col-id='RowSelect'],\n &[data-col-id='RowDragDrop'],\n &[data-col-id='RowError'] {\n position: sticky;\n flex-shrink: 0;\n z-index: 5;\n }\n }\n\n > .cell.cell-fixed:focus-within,\n .group-header-aggregation-row > .cell-fixed {\n z-index: 6;\n }\n\n &.click {\n cursor: pointer;\n }\n\n &:last-child {\n border-end-start-radius: inherit;\n border-end-end-radius: inherit;\n\n > .cell {\n &:first-child {\n border-end-start-radius: inherit;\n }\n\n &:last-child {\n border-end-end-radius: inherit;\n }\n\n ${theme.components.table['striped-rows'] &&\n css`\n border-bottom: var(--border-style);\n `}\n }\n }\n }\n .row:not(.row-error):not(.group-header-row):not(.header) {\n .cell-fixed {\n background: var(--primary-background);\n }\n .cell-fixed.aggregateCell {\n background: var(--header-bg-color);\n }\n }\n ${theme.components.table['striped-rows'] &&\n css`\n /* Targets rows with an odd data-index attribute, excluding group header rows */\n .row[data-index$='1']:not(.group-header-row):not(.header),\n .row[data-index$='3']:not(.group-header-row):not(.header),\n .row[data-index$='5']:not(.group-header-row):not(.header),\n .row[data-index$='7']:not(.group-header-row):not(.header),\n .row[data-index$='9']:not(.group-header-row):not(.header) {\n background: ${oddRowBackgroundColor};\n color: ${useableOddRowForeground};\n .cell-fixed {\n background: ${oddRowBackgroundColor};\n color: ${useableOddRowForeground};\n }\n > .cell-action {\n background: ${oddRowBackgroundColor};\n }\n }\n .row[data-index$='0']:not(.group-header-row):not(.header),\n .row[data-index$='2']:not(.group-header-row):not(.header),\n .row[data-index$='4']:not(.group-header-row):not(.header),\n .row[data-index$='6']:not(.group-header-row):not(.header),\n .row[data-index$='8']:not(.group-header-row):not(.header) {\n background: var(--primary-background);\n .cell-fixed {\n background: var(--primary-background);\n }\n > .cell-action {\n background: var(--primary-background);\n }\n }\n `}\n\n .row-error {\n background: ${mix(\n 0.1,\n theme.components['form-field'].error['status-color'],\n theme.base.palette['primary-background']\n )};\n\n /* stylelint-disable no-descending-specificity */\n .cell-fixed,\n .cell-action {\n background: inherit;\n }\n\n > .cell:not(.cell-fixed):not(.cell-action) {\n background: none;\n }\n }\n\n .sort-info-container {\n .sort-sequence {\n font-size: 0.625rem;\n color: ${theme.base.colors.gray['extra-dark']};\n }\n }\n\n .filter-info-container {\n display: flex;\n justify-content: center;\n align-items: center;\n\n svg {\n width: 14px;\n height: 14px;\n }\n }\n\n .cell.row-error-column {\n padding: 0;\n border-right: 0;\n text-align: right;\n outline: none;\n\n /* Focus handling will be done as part of interation 2: EPIC-88751 */\n\n svg {\n color: ${theme.base.colors.red.medium};\n }\n }\n\n .cell-right-align .filter-info-container svg {\n margin: 0 0.312rem 0 0;\n }\n\n &.show-expand-collapse-all {\n .row > .cell-first {\n padding-left: calc(var(--expand-collapse-all-width) + var(--cell-padding) + 0.25rem);\n &.row-reorder-handle,\n &.row-error-column {\n padding: 0;\n }\n &.row-select-handle {\n padding-inline-start: var(--expand-collapse-all-width);\n }\n }\n\n .row-container .row > .cell-first {\n &.row-select-handle {\n /* Offset padding of 0.5rem added to SelectAllCheckbox in grouped views(getting pushed by margin),\n ensuring row select checkboxes align vertically in header and data rows */\n padding-inline-start: calc(\n var(--expand-collapse-all-width) - var(--cell-padding) + 0.5rem\n );\n }\n }\n\n /* stylelint-enable selector-max-class */\n .expand-collapse-all {\n position: absolute;\n width: var(--expand-collapse-all-width);\n z-index: 10;\n height: var(--row-height);\n background-color: var(--header-bg-color);\n color: var(--header-fg-color);\n border-right: var(--border-style);\n border-bottom: var(--border-style);\n border-start-start-radius: ${theme.base['border-radius']};\n padding-inline-start: 0.125rem;\n margin-inline-start: 0.25rem;\n display: flex;\n align-items: center;\n justify-content: center;\n\n &::before {\n content: '';\n position: absolute;\n inset-block-start: 0;\n inset-inline-start: -0.25rem;\n width: 0.25rem;\n height: 100%;\n background-color: var(--header-bg-color);\n z-index: 12;\n }\n\n > button {\n color: var(--forground-color);\n :focus {\n box-shadow: ${theme.base.shadow.focus};\n }\n }\n }\n .no-border-right {\n border-right: 0;\n }\n }\n\n /* stylelint-disable selector-max-class */\n\n .scroll-end {\n &.row-container > .row:last-child {\n & > .cell,\n & .group-header-aggregation-row > .cell {\n border-bottom: 0;\n }\n }\n }\n\n /* stylelint-enable selector-max-class */\n .header {\n font-weight: var(--font-weight-semi-bold);\n position: relative; /* This is required to position .border-fix element */\n border-start-start-radius: inherit;\n border-start-end-radius: inherit;\n\n > .cell.row-error-column {\n border-right: 0;\n }\n > .cell {\n display: flex;\n justify-content: space-between;\n align-items: center;\n z-index: 2;\n position: relative;\n cursor: pointer;\n background-color: var(--header-bg-color);\n color: var(--header-fg-color);\n font-weight: ${theme.base['font-weight'].bold};\n font-size: ${fontSize.xxs};\n border-right: var(--border-style);\n padding: var(--header-cell-padding);\n\n &:first-child {\n border-start-start-radius: inherit;\n }\n\n &:last-child {\n border-start-end-radius: inherit;\n }\n\n .header-lable-container {\n display: inline-flex;\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: ${fontSize.xs};\n font-weight: var(--font-weight-semi-bold);\n align-items: center;\n gap: 0.125rem;\n }\n\n .header-label {\n overflow: hidden;\n text-overflow: ellipsis;\n\n /* To avoid browser tooltip when we get ellipsis in safari */\n &::after {\n content: '';\n display: block;\n }\n\n /* To utilize smart tooltip making it as a non-box element */\n /* stylelint-disable selector-max-class */\n .cell-content {\n display: contents;\n }\n }\n }\n\n > .row-reorder-handle {\n padding: 0;\n }\n\n > .row-select-handle {\n /* Nullifying padding applied from .header > .cell */\n padding: 0;\n justify-content: center;\n }\n .row {\n border-bottom: none;\n }\n }\n\n /* 4 selectors required as aggregateCell of only footer need this effect */\n\n .pContainer:not(.pContainerScroll) .footer .aggregateCell.cell {\n border-bottom: none;\n }\n\n /* stylelint-enable selector-max-class */\n .row .cell.cell-last {\n border-right: 0;\n flex-grow: 1;\n }\n\n .row-container {\n --data-row-height: calc(\n var(--hit-area) * var(--row-height-multiplier) + var(--cell-vertical-padding)\n );\n --group-header-height: ${isAggregationApplied\n ? 'var(--default-group-header-height)'\n : 'var(--data-row-height)'};\n &:not(.wrap-content-height) > .row:not(.group-header-row) {\n height: var(--data-row-height);\n }\n\n & > .row:not(.group-header-row) {\n min-width: 100%;\n }\n border-end-start-radius: inherit;\n border-end-end-radius: inherit;\n\n & > .row .cell-content {\n /*\n * Using box sizing content-box so that the padding is not considered for the alignment of the cell content.\n * Vertical alignment is done using flex and max-height below even though the .cell-content might overflow due to padding + content size.\n */\n box-sizing: content-box;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n word-break: break-all;\n flex-grow: 1;\n\n /* Adding padding on .cell-content so that focus rings can appear properly and doesn't clip due to overflow: hidden */\n padding: var(--cell-vertical-padding) var(--cell-padding);\n\n /* setting max-height so that the elements with more height like RTL, align with the row density height */\n max-height: var(--data-row-height);\n\n /* hiding scroll bar in case the cell render introduces scrollbar based on its implementation */\n & * {\n scrollbar-width: none;\n }\n\n /* in case of combine columns, removing padding from parent cell-content as children already have the padding */\n &:has(.combined-cell) {\n padding: 0;\n\n /* stylelint-disable-next-line selector-max-class */\n .cell-content {\n flex-grow: unset;\n }\n }\n }\n }\n\n .row .aggregateCell .cell-content {\n line-height: initial;\n padding: 0;\n }\n\n .short-height,\n .medium-height {\n ${StyledStatus} {\n white-space: nowrap;\n }\n }\n\n .short-height {\n ${StyledRadioCheck} ${StyledLabel} {\n min-height: auto;\n }\n }\n\n .medium-height {\n --row-height-multiplier: 4 / 3;\n }\n\n .tall-height {\n --row-height-multiplier: calc(4 / 3 + 0.5);\n > .row:not(.group-header-row) {\n > .cell {\n display: inline-grid;\n align-items: start;\n white-space: normal;\n word-break: break-all;\n grid-auto-flow: column;\n\n :has(> ${CellIcon}) {\n /* Adds spacing between children when icons are rendered alongside cell content in the cell container. */\n justify-content: space-between;\n }\n\n /* stylelint-disable selector-max-class */\n /* stylelint-disable-next-line selector-max-compound-selectors */\n > .cell-content > .combined-cell > .combined-cell-content,\n > .cell-content {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n white-space: inherit;\n word-break: inherit;\n }\n\n ${CellIcon} {\n margin-block-start: 0.375rem;\n }\n }\n }\n }\n\n .wrap-content-height {\n --row-height-multiplier: 4 / 3;\n --row-min-height: calc(\n var(--hit-area) * var(--row-height-multiplier) + var(--cell-vertical-padding) * 2\n );\n --group-header-height: ${isAggregationApplied\n ? 'var(--default-group-header-height)'\n : 'var(--row-min-height)'};\n\n > .row:not(.group-header-row) {\n height: auto;\n min-height: var(--row-min-height);\n > .cell {\n white-space: normal;\n\n /* -- For BUG-625508 -- */\n word-break: break-word;\n display: inline-grid;\n align-items: start;\n padding-top: var(--cell-vertical-padding);\n padding-bottom: var(--cell-vertical-padding);\n grid-auto-flow: column;\n\n :has(> ${CellIcon}) {\n /* Adds spacing between children when icons are rendered alongside cell content in the cell container. */\n justify-content: space-between;\n }\n\n /* stylelint-disable-next-line selector-max-compound-selectors */\n > .cell-content > .combined-cell > .combined-cell-content,\n > .cell-content {\n /* for full-content, the row cells should adjust according to content */\n max-height: none;\n white-space: inherit;\n word-break: inherit;\n }\n\n ${CellIcon} {\n margin-block-start: 0.375rem;\n }\n }\n }\n }\n\n .footer {\n .row {\n .cell {\n padding: 0;\n }\n }\n }\n\n /* stylelint-disable no-duplicate-selectors */\n .row-container {\n position: absolute;\n display: grid;\n width: 100%;\n font-size: ${fontSize.s};\n\n > .group-header-row,\n .hierarchical-group-footer-row {\n height: var(--group-header-height);\n .cell {\n padding: 0;\n border-right-width: 0;\n }\n }\n\n > .hierarchical-group-header-row {\n height: var(--group-header-height);\n }\n input.checkbox-on-hover + label {\n opacity: 0;\n }\n input.checkbox-on-hover:checked + label {\n opacity: 1;\n }\n .row.selected-row {\n background-color: ${selectedRowColor};\n\n > .cell,\n .cell-fixed,\n .cell-action {\n background-color: ${selectedRowColor};\n }\n }\n .row-on-hover:hover {\n background-color: ${lightGreyColor};\n input.checkbox-on-hover + label {\n opacity: 1;\n }\n\n > .cell,\n .cell-fixed,\n .cell-action {\n background-color: ${lightGreyColor};\n }\n }\n .row.hierarchical-group-footer-row {\n .cell-fixed {\n background: ${lightGreyColor};\n }\n }\n }\n\n /* stylelint-enable selector-max-class */\n\n .toolbar-button-applied {\n padding: 0 8px;\n margin: 0 calc(${theme.base.spacing} / 4);\n }\n\n .toolbar-button {\n padding: 0 8px;\n margin: 0 calc(${theme.base.spacing} / 4);\n }\n\n .column-resizer {\n cursor: col-resize;\n position: absolute;\n top: 0;\n right: 0;\n z-index: 3;\n width: 0.25rem;\n height: 100%;\n }\n\n .column-resizer:hover,\n .column-resizer:active {\n background: var(--interactive);\n }\n\n .align-right {\n justify-content: right;\n\n .cell-content {\n text-align: right;\n }\n }\n\n .align-left {\n justify-content: left;\n\n .cell-content {\n text-align: left;\n }\n }\n\n .align-center {\n justify-content: center;\n\n .cell-content {\n text-align: center;\n }\n }\n\n .popper {\n div.row {\n display: flex;\n vertical-align: middle;\n line-height: unset;\n border-bottom: none;\n outline: none 0;\n height: auto;\n }\n }\n `;\n});\n\nexport default StyledTableContainer;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/lists-react",
3
- "version": "9.0.0-build.14.9",
3
+ "version": "9.0.0-build.15.1",
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.14.9",
18
- "@pega/cosmos-react-core": "9.0.0-build.14.9",
19
- "@pega/cosmos-react-rte": "9.0.0-build.14.9",
17
+ "@pega/cosmos-react-condition-builder": "9.0.0-build.15.1",
18
+ "@pega/cosmos-react-core": "9.0.0-build.15.1",
19
+ "@pega/cosmos-react-rte": "9.0.0-build.15.1",
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.14.9",
28
- "pega-ui-list-data-apis": "npm:@pega/lists-core-utils@9.0.0-build.14.9",
27
+ "pega-repeating-structures-core": "npm:@pega/lists-core@9.0.0-build.15.1",
28
+ "pega-ui-list-data-apis": "npm:@pega/lists-core-utils@9.0.0-build.15.1",
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.14.9",
47
+ "srs-utils": "9.0.0-build.15.1",
48
48
  "typescript": "~5.9.3"
49
49
  }
50
50
  }