@pega/lists-react 9.35.0 → 9.36.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":"VariableHeightVirtualizer.d.ts","sourceRoot":"","sources":["../../../../../Core/Components/Virtualise/VariableHeightVirtualizer/VariableHeightVirtualizer.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAgB,MAAM,OAAO,CAAC;AAsBrD,MAAM,WAAW,WAAW;IAC1B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,eAAe;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AASD,MAAM,WAAW,8BAA8B;IAC7C,sDAAsD;IACtD,EAAE,EAAE,MAAM,CAAC;IACX,oEAAoE;IACpE,QAAQ,EAAE,SAAS,CAAC;IACpB,wCAAwC;IACxC,WAAW,EAAE,CACX,MAAM,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,EAC5D,OAAO,EAAE;QAAE,gBAAgB,EAAE,OAAO,CAAA;KAAE,KACnC,IAAI,CAAC;IACV,oDAAoD;IACpD,cAAc,EAAE,OAAO,CAAC;IACxB,4CAA4C;IAC5C,eAAe,EAAE,eAAe,CAAC;IACjC,gDAAgD;IAChD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,yCAAyC;IACzC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,gEAAgE;IAChE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iDAAiD;IACjD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qCAAqC;IACrC,YAAY,CAAC,EAAE,CAAC,MAAM,SAAS,CAAC,GAAG,IAAI,CAAC;IACxC,qCAAqC;IACrC,YAAY,CAAC,EAAE,CAAC,MAAM,SAAS,CAAC,GAAG,IAAI,CAAC;IACxC,8CAA8C;IAC9C,kBAAkB,CAAC,EAAE,CAAC,MAAM,SAAS,CAAC,GAAG,IAAI,CAAC;IAC9C,wCAAwC;IACxC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,6CAA6C;IAC7C,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACvC,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,iDAAiD;IACjD,4BAA4B,CAAC,EAAE,MAAM,CAAC;CACvC;AAED,UAAU,cAAc;IACtB,+CAA+C;IAC/C,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,4CAA4C;IAC5C,kBAAkB,EAAE,MAAM,WAAW,GAAG,IAAI,CAAC;IAC7C,4CAA4C;IAC5C,kBAAkB,EAAE,MAAM,WAAW,GAAG,IAAI,CAAC;IAC7C,4CAA4C;IAC5C,iBAAiB,EAAE,MAAM,IAAI,CAAC;CAC/B;AAaD;;;;;;;;;;GAUG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,QAAA,MAAM,yBAAyB,2HA6T9B,CAAC;AAIF,eAAe,yBAAyB,CAAC"}
1
+ {"version":3,"file":"VariableHeightVirtualizer.d.ts","sourceRoot":"","sources":["../../../../../Core/Components/Virtualise/VariableHeightVirtualizer/VariableHeightVirtualizer.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAgB,MAAM,OAAO,CAAC;AAsBrD,MAAM,WAAW,WAAW;IAC1B,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,eAAe;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AASD,MAAM,WAAW,8BAA8B;IAC7C,sDAAsD;IACtD,EAAE,EAAE,MAAM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;IAC5C,kBAAkB,EAAE,MAAM,WAAW,GAAG,IAAI,CAAC;IAC7C,4CAA4C;IAC5C,iBAAiB,EAAE,MAAM,IAAI,CAAC;CAC/B;AAaD;;;;;;;;;;GAUG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,QAAA,MAAM,yBAAyB,2HA+T9B,CAAC;AAIF,eAAe,yBAAyB,CAAC"}
@@ -200,13 +200,14 @@ const VariableHeightVirtualizer = forwardRef(({ id, children, buffer = 15, apiCa
200
200
  (!endIndex ||
201
201
  (itemContainerRef.current &&
202
202
  parentContainerRef.current &&
203
- isViewNotFilled(virtualizedCount, itemContainerRef.current, parentContainerRef.current, !!renderHeader)))) {
203
+ isViewNotFilled(virtualizedCount, itemContainerRef.current, parentContainerRef.current, !!renderHeader, startIndex)))) {
204
204
  triggerPagination(scrollTop);
205
205
  }
206
206
  }, [
207
207
  loadedDataRange,
208
208
  scrollTop,
209
209
  virtualizedCount,
210
+ startIndex,
210
211
  endIndex,
211
212
  triggerPagination,
212
213
  parentContainerDimensionChangeTrigger,
@@ -1 +1 @@
1
- {"version":3,"file":"VariableHeightVirtualizer.js","sourceRoot":"","sources":["../../../../../Core/Components/Virtualise/VariableHeightVirtualizer/VariableHeightVirtualizer.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,MAAM,EACN,SAAS,EACT,QAAQ,EACR,WAAW,EACX,eAAe,EACf,UAAU,EACV,mBAAmB,EACnB,OAAO,EACR,MAAM,OAAO,CAAC;AAEf,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEnD,OAAO,iBAAiB,MAAM,sBAAsB,CAAC;AACrD,OAAO,YAAY,MAAM,6BAA6B,CAAC;AAEvD,OAAO,+BAA+B,MAAM,mCAAmC,CAAC;AAChF,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO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S,EAAC,cAAc,EACxB,SAAS,EAAC,OAAO,EACjB,QAAQ,EAAE,CAAC,gBACC,SAAS,CAAC,sBAAsB,CAAC,GAC7C,GACW,CAChB,EAED,cACE,GAAG,EAAE,gBAAgB,EACrB,KAAK,EAAE;4BACL,QAAQ,EAAE,UAAU;4BACpB,IAAI,EAAE,CAAC;4BACP,KAAK,EAAE,MAAM;4BACb,MAAM,EAAE,GAAG,mBAAmB,IAAI;yBACnC,EACD,SAAS,EAAE,GAAG,kBAAkB,gBAAgB,YAE/C,cAAc,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,GACtD,EAEL,cAAc,IAAI,CAAC,0BAA0B,IAAI,CAChD,KAAC,YAAY,cACH;4BACN,GAAG,EAAE,oBAAoB;4BACzB,IAAI,EAAE,eAAe;yBACtB,YAED,KAAC,QAAQ,IACP,SAAS,EAAC,cAAc,EACxB,SAAS,EAAC,OAAO,EACjB,QAAQ,EAAE,CAAC,gBACC,SAAS,CAAC,sBAAsB,CAAC,GAC7C,GACW,CAChB,IACG,EACL,gBAAgB,KAAK,CAAC,IAAI,CAAC,cAAc,IAAI,kBAAkB;gBAC9D,CAAC,CAAC,kBAAkB,EAAE;gBACtB,CAAC,CAAC,IAAI,EACP,YAAY,IAAI,YAAY,EAAE,IAC3B,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,yBAAyB,CAAC,WAAW,GAAG,2BAA2B,CAAC;AAEpE,eAAe,yBAAyB,CAAC","sourcesContent":["import {\n useRef,\n useEffect,\n useState,\n useCallback,\n useLayoutEffect,\n forwardRef,\n useImperativeHandle,\n useMemo\n} from 'react';\nimport type { ReactNode, ForwardedRef } from 'react';\nimport Styled from 'styled-components';\n\nimport { Progress } from '@pega/cosmos-react-core';\n\nimport useResizeObserver from '../UseResizeObserver';\nimport useTranslate from '../../../Hooks/useTranslate';\n\nimport useChildrenHeightResizeObserver from './useChildrenHeightResizeObserver';\nimport useLoaderPositioning from './useLoaderPositioning';\nimport usePagination from './usePagination';\nimport useScroll from './useScroll';\nimport useVirtualizerItemCount from './useVirtualizerItemCount';\nimport {\n calculateCumulativeItemSizeChange,\n getMaxHeight,\n isViewNotFilled,\n calculateTotalBufferHeight,\n getChangedItemsHeight,\n updateItemPositionStyles\n} from './utils';\n\nexport interface ItemsHeight {\n [index: number]: number;\n}\n\nexport interface LoadedDataRange {\n startIndex?: number;\n endIndex?: number;\n}\n\ninterface StyledLoaderProps {\n $style: {\n top: string;\n left: string;\n };\n}\n\nexport interface VariableHeightVirtualizerProps {\n /** Unique identifier for the virtualizer instance. */\n id: string;\n /** The React children elements to render inside the virtualizer. */\n children: ReactNode;\n /** Callback to fetch paginated data. */\n apiCallback: (\n params: { startIndex: number; endIndex: number; id: string },\n options: { takeLatestAction: boolean }\n ) => void;\n /** Indicates if data is currently being fetched. */\n isDataFetching: boolean;\n /** Range of data that is already loaded. */\n loadedDataRange: LoadedDataRange;\n /** Default height for items if not measured. */\n defaultItemHeight?: number;\n /** Total number of items in the list. */\n totalItemCount?: number | null;\n /** Number of items to buffer before/after the visible range. */\n buffer?: number;\n /** Maximum number of items to render at once. */\n maxItemsToPaint?: number;\n /** Function to render the header. */\n renderHeader?: (() => ReactNode) | null;\n /** Function to render the footer. */\n renderFooter?: (() => ReactNode) | null;\n /** Function to render the no-result state. */\n renderEmptyRecords?: (() => ReactNode) | null;\n /** CSS class for the item container. */\n itemContainerClass?: string;\n /** Maximum height for the view container. */\n viewMaxHeight?: string | number | null;\n /** Minimum height for the view container. */\n minHeight?: string | number;\n /** Minimum height when no items are rendered. */\n minHeightWhenNoItemsRendered?: string;\n}\n\ninterface VirtualizerRef {\n /** Scrolls the parent container to the top. */\n scrollToTop: () => void;\n /** Returns the parent container element. */\n getParentContainer: () => HTMLElement | null;\n /** Returns the buffer container element. */\n getBufferContainer: () => HTMLElement | null;\n /** Triggers a count change notification. */\n notifyCountChange: () => void;\n}\n\nconst StyledLoader = Styled.div<StyledLoaderProps>`\n display: flex;\n justify-content: center;\n padding: 0.5rem;\n position: absolute;\n width: var(--container-width);\n left: ${props => `var(${props.$style.left})`};\n top: ${props => `var(${props.$style.top})`};\n width: 100%;\n`;\n\n/**\n * Flow:\n * 1. First load/user scrolls/screen size change/column resize\n * 2. Calculate new pagination range based on scroll position or if view not filled\n * 3. Consumer executes API call to fetch new data\n * 4. New items are prepared and rendered\n * 5. Update cache of item heights\n * 6. Update buffer height\n * 7. Adjust itemContainer top\n * 8. Adjust scrollTop (if needed) to keep the items at same position visually\n */\n\n/**\n * VariableHeightVirtualizer is a React component that efficiently renders large lists with items of variable heights,\n * using virtualization techniques to minimize DOM nodes and improve performance.\n *\n * @param props - {@link VariableHeightVirtualizerProps}\n * @param ref - Forwarded ref exposing imperative APIs: scrollToTop, getParentContainer, getBufferContainer, notifyCountChange.\n *\n * @example\n * ```tsx\n * <VariableHeightVirtualizer\n * id=\"my-list\"\n * totalItemCount={10000}\n * loadedDataRange={{ startIndex: 0, endIndex: 49 }}\n * isDataFetching={isLoading}\n * apiCallback={fetchData}\n * defaultItemHeight={40}\n * buffer={10}\n * renderHeader={() => <Header />}\n * renderFooter={() => <Footer />}\n * renderEmptyRecords={() => <NoResults />}\n * >\n * {items.map(item => <ListItem key={item.id} {...item} />)}\n * </VariableHeightVirtualizer>\n * ```\n */\nconst VariableHeightVirtualizer = forwardRef<VirtualizerRef, VariableHeightVirtualizerProps>(\n (\n {\n id,\n children,\n buffer = 15,\n apiCallback,\n loadedDataRange = {},\n defaultItemHeight = 30,\n totalItemCount,\n maxItemsToPaint = 5000,\n renderHeader = null,\n renderFooter = null,\n renderEmptyRecords = null,\n itemContainerClass = '',\n viewMaxHeight = null,\n minHeight = 'auto',\n isDataFetching = false,\n minHeightWhenNoItemsRendered = 'auto'\n },\n ref: ForwardedRef<VirtualizerRef>\n ) => {\n const [startIndex, setStartIndex] = useState<number>(0);\n const [endIndex, setEndIndex] = useState<number>(0);\n const [scrollTop, setScrollTop] = useState<number>(0);\n const [totalBufferHeight, setTotalBufferHeight] = useState<number>(0);\n const [itemsHeight, setItemsHeight] = useState<ItemsHeight>({});\n const [itemContainerHeight, setItemContainerHeight] = useState<number>(0);\n\n const [countChangeTrigger, setCountChangeTrigger] = useState<number>(0);\n const [itemHeightChangeTrigger, setItemHeightChangeTrigger] = useState<number>(0);\n const [parentContainerDimensionChangeTrigger, setParentContainerDimensionChangeTrigger] =\n useState<number>(0);\n\n const parentContainerRef = useRef<HTMLDivElement>(null);\n const bufferContainerRef = useRef<HTMLDivElement>(null);\n const itemContainerRef = useRef<HTMLDivElement>(null);\n const previousItemsHeightRef = useRef<ItemsHeight>({});\n const previousFirstItemDataIndexRef = useRef<number | null>(null);\n\n const [translate] = useTranslate();\n\n const onParentContainerDimensionUpdate = useCallback(() => {\n const { height: parentContainerHeight, width: parentContainerWidth } =\n parentContainerRef.current?.getBoundingClientRect() ?? {};\n // trigger virtualizer operations only when the container has some height and width\n if (parentContainerHeight && parentContainerWidth) {\n setParentContainerDimensionChangeTrigger(value => value + 1);\n }\n }, []);\n\n const getParentContainer = useCallback(\n (): HTMLDivElement | null => parentContainerRef.current,\n []\n );\n useResizeObserver(getParentContainer, onParentContainerDimensionUpdate);\n\n const { isInfiniteMode, virtualizedCount } = useVirtualizerItemCount({\n totalItemCount,\n startIndex,\n endIndex,\n loadedDataRange,\n isDataFetching,\n itemContainerRef,\n children,\n buffer,\n countResetSignal: countChangeTrigger\n });\n\n const { triggerPagination, isForceRefreshedPagination } = usePagination({\n apiCallback,\n id,\n buffer,\n maxItemsToPaint,\n startIndex,\n endIndex,\n virtualizedCount,\n isInfiniteMode,\n itemsHeight,\n defaultItemHeight,\n parentContainerRef,\n itemContainerRef,\n setStartIndex,\n setEndIndex,\n previousFirstItemDataIndexRef\n });\n\n // Listens to the scroll events and trigger pagination when more records are needed to enable smooth scrolling\n useScroll({\n parentContainerRef,\n itemContainerRef,\n onThresholdBreach: (sTop: number) => {\n setScrollTop(sTop);\n triggerPagination(sTop);\n },\n delay: 150\n });\n\n // Expose APIs to the consumer\n useImperativeHandle(\n ref,\n (): VirtualizerRef => ({\n scrollToTop: () => {\n if (parentContainerRef.current) {\n parentContainerRef.current.scrollTop = 0;\n setScrollTop(0);\n\n triggerPagination(0, true);\n }\n },\n getParentContainer: () => parentContainerRef.current,\n getBufferContainer: () => itemContainerRef.current,\n notifyCountChange: () => setCountChangeTrigger(value => value + 1)\n })\n );\n\n // Measure height of rendered items and cache the heights\n useLayoutEffect(() => {\n if (!itemContainerRef.current) return;\n\n const newHeights = getChangedItemsHeight(\n itemContainerRef.current,\n itemsHeight,\n defaultItemHeight\n );\n if (Object.keys(newHeights).length > 0) {\n setItemsHeight((prev: ItemsHeight) => ({ ...prev, ...newHeights }));\n }\n }, [\n startIndex,\n itemsHeight,\n children,\n isDataFetching,\n defaultItemHeight,\n itemHeightChangeTrigger\n ]);\n\n // buffer height calculation\n useLayoutEffect(() => {\n const newBufferHeight = calculateTotalBufferHeight(\n virtualizedCount,\n itemsHeight,\n defaultItemHeight\n );\n\n if (newBufferHeight !== totalBufferHeight) {\n setTotalBufferHeight(newBufferHeight);\n }\n }, [itemsHeight, virtualizedCount, defaultItemHeight, totalBufferHeight]);\n\n // itemContainer size and position adjustments\n useLayoutEffect(() => {\n if (!itemContainerRef.current) return;\n\n setItemContainerHeight(\n updateItemPositionStyles(itemContainerRef.current, itemsHeight, defaultItemHeight)\n );\n }, [children, itemsHeight, defaultItemHeight]);\n\n // scroll position adjustment if rendered height is different than estimated height\n useLayoutEffect(() => {\n if (!parentContainerRef.current) return;\n\n const atTop = parentContainerRef.current.scrollTop === 0;\n if (!atTop) {\n const delta = calculateCumulativeItemSizeChange(\n startIndex,\n previousFirstItemDataIndexRef.current,\n itemsHeight,\n previousItemsHeightRef.current,\n defaultItemHeight\n );\n\n if (delta !== 0) {\n parentContainerRef.current.scrollTop += delta;\n }\n }\n\n previousItemsHeightRef.current = { ...itemsHeight };\n }, [startIndex, itemsHeight, defaultItemHeight]);\n\n // Adjust loader positions\n useLoaderPositioning({\n isDataFetching,\n parentContainerRef,\n itemContainerRef,\n children,\n itemsHeight,\n defaultItemHeight\n });\n\n // Initial pagination trigger and subsequent triggers if the view is not completely filled\n useEffect(() => {\n // If consumer already has data for initial items, then no need to trigger pagination. Just hydrate the internal state in sync with existing data.\n if (\n !endIndex &&\n loadedDataRange.startIndex !== undefined &&\n loadedDataRange.startIndex >= 0 &&\n loadedDataRange.endIndex !== undefined &&\n loadedDataRange.endIndex >= 0\n ) {\n setStartIndex(loadedDataRange.startIndex);\n setEndIndex(loadedDataRange.endIndex);\n return;\n }\n\n // If the consumer doesn't have data or view not filled then trigger pagination\n if (\n !isDataFetching &&\n (!endIndex ||\n (itemContainerRef.current &&\n parentContainerRef.current &&\n isViewNotFilled(\n virtualizedCount,\n itemContainerRef.current,\n parentContainerRef.current,\n !!renderHeader\n )))\n ) {\n triggerPagination(scrollTop);\n }\n }, [\n loadedDataRange,\n scrollTop,\n virtualizedCount,\n endIndex,\n triggerPagination,\n parentContainerDimensionChangeTrigger,\n isDataFetching,\n renderHeader\n ]);\n\n // Resize observer on items to track height changes\n const onItemsHeightUpdate = useCallback(() => {\n setItemHeightChangeTrigger(value => value + 1);\n }, []);\n useChildrenHeightResizeObserver({\n childrenContainerRef: itemContainerRef,\n children,\n itemsHeight,\n defaultItemHeight,\n onItemsHeightUpdate\n });\n\n const maxHeight = useMemo((): string => getMaxHeight(viewMaxHeight), [viewMaxHeight]);\n\n return (\n <div\n ref={parentContainerRef}\n style={{\n maxHeight,\n minHeight: virtualizedCount === 0 ? minHeightWhenNoItemsRendered : minHeight,\n overflowY: 'auto',\n position: 'relative',\n width: '100%'\n }}\n className='pContainer variableHeightVirtualizer'\n data-total-records={totalItemCount}\n >\n {renderHeader && renderHeader()}\n <div\n className='bContainer'\n ref={bufferContainerRef}\n style={{ height: totalBufferHeight, position: 'relative' }}\n >\n {isDataFetching && !isForceRefreshedPagination && (\n <StyledLoader\n $style={{\n top: '--above-loader-top',\n left: '--loader-left'\n }}\n >\n <Progress\n className='above-loader'\n placement='block'\n tabIndex={0}\n aria-label={translate('Loading more results')}\n />\n </StyledLoader>\n )}\n\n <div\n ref={itemContainerRef}\n style={{\n position: 'absolute',\n left: 0,\n width: '100%',\n height: `${itemContainerHeight}px`\n }}\n className={`${itemContainerClass} row-container`}\n >\n {totalItemCount === 0 && !isDataFetching ? null : children}\n </div>\n\n {isDataFetching && !isForceRefreshedPagination && (\n <StyledLoader\n $style={{\n top: '--below-loader-top',\n left: '--loader-left'\n }}\n >\n <Progress\n className='below-loader'\n placement='block'\n tabIndex={0}\n aria-label={translate('Loading more results')}\n />\n </StyledLoader>\n )}\n </div>\n {virtualizedCount === 0 && !isDataFetching && renderEmptyRecords\n ? renderEmptyRecords()\n : null}\n {renderFooter && renderFooter()}\n </div>\n );\n }\n);\n\nVariableHeightVirtualizer.displayName = 'VariableHeightVirtualizer';\n\nexport default VariableHeightVirtualizer;\n"]}
1
+ {"version":3,"file":"VariableHeightVirtualizer.js","sourceRoot":"","sources":["../../../../../Core/Components/Virtualise/VariableHeightVirtualizer/VariableHeightVirtualizer.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,MAAM,EACN,SAAS,EACT,QAAQ,EACR,WAAW,EACX,eAAe,EACf,UAAU,EACV,mBAAmB,EACnB,OAAO,EACR,MAAM,OAAO,CAAC;AAEf,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEnD,OAAO,iBAAiB,MAAM,sBAAsB,CAAC;AACrD,OAAO,YAAY,MAAM,6BAA6B,CAAC;AAEvD,OAAO,+BAA+B,MAAM,mCAAmC,CAAC;AAChF,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,uBAAuB,MAAM,2BAA2B,CA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jB,QAAQ,EAAE,CAAC,gBACC,SAAS,CAAC,sBAAsB,CAAC,GAC7C,GACW,CAChB,EAED,cACE,GAAG,EAAE,gBAAgB,EACrB,KAAK,EAAE;4BACL,QAAQ,EAAE,UAAU;4BACpB,IAAI,EAAE,CAAC;4BACP,KAAK,EAAE,MAAM;4BACb,MAAM,EAAE,GAAG,mBAAmB,IAAI;yBACnC,EACD,SAAS,EAAE,GAAG,kBAAkB,gBAAgB,YAE/C,cAAc,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,GACtD,EAEL,cAAc,IAAI,CAAC,0BAA0B,IAAI,CAChD,KAAC,YAAY,cACH;4BACN,GAAG,EAAE,oBAAoB;4BACzB,IAAI,EAAE,eAAe;yBACtB,YAED,KAAC,QAAQ,IACP,SAAS,EAAC,cAAc,EACxB,SAAS,EAAC,OAAO,EACjB,QAAQ,EAAE,CAAC,gBACC,SAAS,CAAC,sBAAsB,CAAC,GAC7C,GACW,CAChB,IACG,EACL,gBAAgB,KAAK,CAAC,IAAI,CAAC,cAAc,IAAI,kBAAkB;gBAC9D,CAAC,CAAC,kBAAkB,EAAE;gBACtB,CAAC,CAAC,IAAI,EACP,YAAY,IAAI,YAAY,EAAE,IAC3B,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,yBAAyB,CAAC,WAAW,GAAG,2BAA2B,CAAC;AAEpE,eAAe,yBAAyB,CAAC","sourcesContent":["import {\n useRef,\n useEffect,\n useState,\n useCallback,\n useLayoutEffect,\n forwardRef,\n useImperativeHandle,\n useMemo\n} from 'react';\nimport type { ReactNode, ForwardedRef } from 'react';\nimport Styled from 'styled-components';\n\nimport { Progress } from '@pega/cosmos-react-core';\n\nimport useResizeObserver from '../UseResizeObserver';\nimport useTranslate from '../../../Hooks/useTranslate';\n\nimport useChildrenHeightResizeObserver from './useChildrenHeightResizeObserver';\nimport useLoaderPositioning from './useLoaderPositioning';\nimport usePagination from './usePagination';\nimport useScroll from './useScroll';\nimport useVirtualizerItemCount from './useVirtualizerItemCount';\nimport {\n calculateCumulativeItemSizeChange,\n getMaxHeight,\n isViewNotFilled,\n calculateTotalBufferHeight,\n getChangedItemsHeight,\n updateItemPositionStyles\n} from './utils';\n\nexport interface ItemsHeight {\n [index: number]: number;\n}\n\nexport interface LoadedDataRange {\n startIndex?: number;\n endIndex?: number;\n}\n\ninterface StyledLoaderProps {\n $style: {\n top: string;\n left: string;\n };\n}\n\nexport interface VariableHeightVirtualizerProps {\n /** Unique identifier for the virtualizer instance. */\n id: string;\n /** The React children elements to render inside the virtualizer. */\n children: ReactNode;\n /** Callback to fetch paginated data. */\n apiCallback: (\n params: { startIndex: number; endIndex: number; id: string },\n options: { takeLatestAction: boolean }\n ) => void;\n /** Indicates if data is currently being fetched. */\n isDataFetching: boolean;\n /** Range of data that is already loaded. */\n loadedDataRange: LoadedDataRange;\n /** Default height for items if not measured. */\n defaultItemHeight?: number;\n /** Total number of items in the list. */\n totalItemCount?: number | null;\n /** Number of items to buffer before/after the visible range. */\n buffer?: number;\n /** Maximum number of items to render at once. */\n maxItemsToPaint?: number;\n /** Function to render the header. */\n renderHeader?: (() => ReactNode) | null;\n /** Function to render the footer. */\n renderFooter?: (() => ReactNode) | null;\n /** Function to render the no-result state. */\n renderEmptyRecords?: (() => ReactNode) | null;\n /** CSS class for the item container. */\n itemContainerClass?: string;\n /** Maximum height for the view container. */\n viewMaxHeight?: string | number | null;\n /** Minimum height for the view container. */\n minHeight?: string | number;\n /** Minimum height when no items are rendered. */\n minHeightWhenNoItemsRendered?: string;\n}\n\ninterface VirtualizerRef {\n /** Scrolls the parent container to the top. */\n scrollToTop: () => void;\n /** Returns the parent container element. */\n getParentContainer: () => HTMLElement | null;\n /** Returns the buffer container element. */\n getBufferContainer: () => HTMLElement | null;\n /** Triggers a count change notification. */\n notifyCountChange: () => void;\n}\n\nconst StyledLoader = Styled.div<StyledLoaderProps>`\n display: flex;\n justify-content: center;\n padding: 0.5rem;\n position: absolute;\n width: var(--container-width);\n left: ${props => `var(${props.$style.left})`};\n top: ${props => `var(${props.$style.top})`};\n width: 100%;\n`;\n\n/**\n * Flow:\n * 1. First load/user scrolls/screen size change/column resize\n * 2. Calculate new pagination range based on scroll position or if view not filled\n * 3. Consumer executes API call to fetch new data\n * 4. New items are prepared and rendered\n * 5. Update cache of item heights\n * 6. Update buffer height\n * 7. Adjust itemContainer top\n * 8. Adjust scrollTop (if needed) to keep the items at same position visually\n */\n\n/**\n * VariableHeightVirtualizer is a React component that efficiently renders large lists with items of variable heights,\n * using virtualization techniques to minimize DOM nodes and improve performance.\n *\n * @param props - {@link VariableHeightVirtualizerProps}\n * @param ref - Forwarded ref exposing imperative APIs: scrollToTop, getParentContainer, getBufferContainer, notifyCountChange.\n *\n * @example\n * ```tsx\n * <VariableHeightVirtualizer\n * id=\"my-list\"\n * totalItemCount={10000}\n * loadedDataRange={{ startIndex: 0, endIndex: 49 }}\n * isDataFetching={isLoading}\n * apiCallback={fetchData}\n * defaultItemHeight={40}\n * buffer={10}\n * renderHeader={() => <Header />}\n * renderFooter={() => <Footer />}\n * renderEmptyRecords={() => <NoResults />}\n * >\n * {items.map(item => <ListItem key={item.id} {...item} />)}\n * </VariableHeightVirtualizer>\n * ```\n */\nconst VariableHeightVirtualizer = forwardRef<VirtualizerRef, VariableHeightVirtualizerProps>(\n (\n {\n id,\n children,\n buffer = 15,\n apiCallback,\n loadedDataRange = {},\n defaultItemHeight = 30,\n totalItemCount,\n maxItemsToPaint = 5000,\n renderHeader = null,\n renderFooter = null,\n renderEmptyRecords = null,\n itemContainerClass = '',\n viewMaxHeight = null,\n minHeight = 'auto',\n isDataFetching = false,\n minHeightWhenNoItemsRendered = 'auto'\n },\n ref: ForwardedRef<VirtualizerRef>\n ) => {\n const [startIndex, setStartIndex] = useState<number>(0);\n const [endIndex, setEndIndex] = useState<number>(0);\n const [scrollTop, setScrollTop] = useState<number>(0);\n const [totalBufferHeight, setTotalBufferHeight] = useState<number>(0);\n const [itemsHeight, setItemsHeight] = useState<ItemsHeight>({});\n const [itemContainerHeight, setItemContainerHeight] = useState<number>(0);\n\n const [countChangeTrigger, setCountChangeTrigger] = useState<number>(0);\n const [itemHeightChangeTrigger, setItemHeightChangeTrigger] = useState<number>(0);\n const [parentContainerDimensionChangeTrigger, setParentContainerDimensionChangeTrigger] =\n useState<number>(0);\n\n const parentContainerRef = useRef<HTMLDivElement>(null);\n const bufferContainerRef = useRef<HTMLDivElement>(null);\n const itemContainerRef = useRef<HTMLDivElement>(null);\n const previousItemsHeightRef = useRef<ItemsHeight>({});\n const previousFirstItemDataIndexRef = useRef<number | null>(null);\n\n const [translate] = useTranslate();\n\n const onParentContainerDimensionUpdate = useCallback(() => {\n const { height: parentContainerHeight, width: parentContainerWidth } =\n parentContainerRef.current?.getBoundingClientRect() ?? {};\n // trigger virtualizer operations only when the container has some height and width\n if (parentContainerHeight && parentContainerWidth) {\n setParentContainerDimensionChangeTrigger(value => value + 1);\n }\n }, []);\n\n const getParentContainer = useCallback(\n (): HTMLDivElement | null => parentContainerRef.current,\n []\n );\n useResizeObserver(getParentContainer, onParentContainerDimensionUpdate);\n\n const { isInfiniteMode, virtualizedCount } = useVirtualizerItemCount({\n totalItemCount,\n startIndex,\n endIndex,\n loadedDataRange,\n isDataFetching,\n itemContainerRef,\n children,\n buffer,\n countResetSignal: countChangeTrigger\n });\n\n const { triggerPagination, isForceRefreshedPagination } = usePagination({\n apiCallback,\n id,\n buffer,\n maxItemsToPaint,\n startIndex,\n endIndex,\n virtualizedCount,\n isInfiniteMode,\n itemsHeight,\n defaultItemHeight,\n parentContainerRef,\n itemContainerRef,\n setStartIndex,\n setEndIndex,\n previousFirstItemDataIndexRef\n });\n\n // Listens to the scroll events and trigger pagination when more records are needed to enable smooth scrolling\n useScroll({\n parentContainerRef,\n itemContainerRef,\n onThresholdBreach: (sTop: number) => {\n setScrollTop(sTop);\n triggerPagination(sTop);\n },\n delay: 150\n });\n\n // Expose APIs to the consumer\n useImperativeHandle(\n ref,\n (): VirtualizerRef => ({\n scrollToTop: () => {\n if (parentContainerRef.current) {\n parentContainerRef.current.scrollTop = 0;\n setScrollTop(0);\n\n triggerPagination(0, true);\n }\n },\n getParentContainer: () => parentContainerRef.current,\n getBufferContainer: () => itemContainerRef.current,\n notifyCountChange: () => setCountChangeTrigger(value => value + 1)\n })\n );\n\n // Measure height of rendered items and cache the heights\n useLayoutEffect(() => {\n if (!itemContainerRef.current) return;\n\n const newHeights = getChangedItemsHeight(\n itemContainerRef.current,\n itemsHeight,\n defaultItemHeight\n );\n if (Object.keys(newHeights).length > 0) {\n setItemsHeight((prev: ItemsHeight) => ({ ...prev, ...newHeights }));\n }\n }, [\n startIndex,\n itemsHeight,\n children,\n isDataFetching,\n defaultItemHeight,\n itemHeightChangeTrigger\n ]);\n\n // buffer height calculation\n useLayoutEffect(() => {\n const newBufferHeight = calculateTotalBufferHeight(\n virtualizedCount,\n itemsHeight,\n defaultItemHeight\n );\n\n if (newBufferHeight !== totalBufferHeight) {\n setTotalBufferHeight(newBufferHeight);\n }\n }, [itemsHeight, virtualizedCount, defaultItemHeight, totalBufferHeight]);\n\n // itemContainer size and position adjustments\n useLayoutEffect(() => {\n if (!itemContainerRef.current) return;\n\n setItemContainerHeight(\n updateItemPositionStyles(itemContainerRef.current, itemsHeight, defaultItemHeight)\n );\n }, [children, itemsHeight, defaultItemHeight]);\n\n // scroll position adjustment if rendered height is different than estimated height\n useLayoutEffect(() => {\n if (!parentContainerRef.current) return;\n\n const atTop = parentContainerRef.current.scrollTop === 0;\n if (!atTop) {\n const delta = calculateCumulativeItemSizeChange(\n startIndex,\n previousFirstItemDataIndexRef.current,\n itemsHeight,\n previousItemsHeightRef.current,\n defaultItemHeight\n );\n\n if (delta !== 0) {\n parentContainerRef.current.scrollTop += delta;\n }\n }\n\n previousItemsHeightRef.current = { ...itemsHeight };\n }, [startIndex, itemsHeight, defaultItemHeight]);\n\n // Adjust loader positions\n useLoaderPositioning({\n isDataFetching,\n parentContainerRef,\n itemContainerRef,\n children,\n itemsHeight,\n defaultItemHeight\n });\n\n // Initial pagination trigger and subsequent triggers if the view is not completely filled\n useEffect(() => {\n // If consumer already has data for initial items, then no need to trigger pagination. Just hydrate the internal state in sync with existing data.\n if (\n !endIndex &&\n loadedDataRange.startIndex !== undefined &&\n loadedDataRange.startIndex >= 0 &&\n loadedDataRange.endIndex !== undefined &&\n loadedDataRange.endIndex >= 0\n ) {\n setStartIndex(loadedDataRange.startIndex);\n setEndIndex(loadedDataRange.endIndex);\n return;\n }\n\n // If the consumer doesn't have data or view not filled then trigger pagination\n if (\n !isDataFetching &&\n (!endIndex ||\n (itemContainerRef.current &&\n parentContainerRef.current &&\n isViewNotFilled(\n virtualizedCount,\n itemContainerRef.current,\n parentContainerRef.current,\n !!renderHeader,\n startIndex\n )))\n ) {\n triggerPagination(scrollTop);\n }\n }, [\n loadedDataRange,\n scrollTop,\n virtualizedCount,\n startIndex,\n endIndex,\n triggerPagination,\n parentContainerDimensionChangeTrigger,\n isDataFetching,\n renderHeader\n ]);\n\n // Resize observer on items to track height changes\n const onItemsHeightUpdate = useCallback(() => {\n setItemHeightChangeTrigger(value => value + 1);\n }, []);\n useChildrenHeightResizeObserver({\n childrenContainerRef: itemContainerRef,\n children,\n itemsHeight,\n defaultItemHeight,\n onItemsHeightUpdate\n });\n\n const maxHeight = useMemo((): string => getMaxHeight(viewMaxHeight), [viewMaxHeight]);\n\n return (\n <div\n ref={parentContainerRef}\n style={{\n maxHeight,\n minHeight: virtualizedCount === 0 ? minHeightWhenNoItemsRendered : minHeight,\n overflowY: 'auto',\n position: 'relative',\n width: '100%'\n }}\n className='pContainer variableHeightVirtualizer'\n data-total-records={totalItemCount}\n >\n {renderHeader && renderHeader()}\n <div\n className='bContainer'\n ref={bufferContainerRef}\n style={{ height: totalBufferHeight, position: 'relative' }}\n >\n {isDataFetching && !isForceRefreshedPagination && (\n <StyledLoader\n $style={{\n top: '--above-loader-top',\n left: '--loader-left'\n }}\n >\n <Progress\n className='above-loader'\n placement='block'\n tabIndex={0}\n aria-label={translate('Loading more results')}\n />\n </StyledLoader>\n )}\n\n <div\n ref={itemContainerRef}\n style={{\n position: 'absolute',\n left: 0,\n width: '100%',\n height: `${itemContainerHeight}px`\n }}\n className={`${itemContainerClass} row-container`}\n >\n {totalItemCount === 0 && !isDataFetching ? null : children}\n </div>\n\n {isDataFetching && !isForceRefreshedPagination && (\n <StyledLoader\n $style={{\n top: '--below-loader-top',\n left: '--loader-left'\n }}\n >\n <Progress\n className='below-loader'\n placement='block'\n tabIndex={0}\n aria-label={translate('Loading more results')}\n />\n </StyledLoader>\n )}\n </div>\n {virtualizedCount === 0 && !isDataFetching && renderEmptyRecords\n ? renderEmptyRecords()\n : null}\n {renderFooter && renderFooter()}\n </div>\n );\n }\n);\n\nVariableHeightVirtualizer.displayName = 'VariableHeightVirtualizer';\n\nexport default VariableHeightVirtualizer;\n"]}
@@ -17,7 +17,7 @@ interface VirtualizerItemCountParams {
17
17
  totalItemCount?: number | null;
18
18
  /** Optional buffer to add to the count in infinite mode. */
19
19
  buffer?: number;
20
- /** Signal to reset the count in infinite mode. */
20
+ /** Signal to reset the count when the list data changes. */
21
21
  countResetSignal?: number;
22
22
  }
23
23
  /**
@@ -27,7 +27,7 @@ interface VirtualizerItemCountParams {
27
27
  * - `isInfiniteMode`: Whether the list is in infinite scrolling mode.
28
28
  * - `virtualizedCount`: The current count of virtualized items.
29
29
  *
30
- * NOTE: In finite mode, the count is based on `totalItemCount`.
30
+ * NOTE: In finite mode, the count is based on `totalItemCount` and can shrink on a short page.
31
31
  * NOTE: In infinite mode, the count is dynamically calculated based on loaded items and buffer.
32
32
  */
33
33
  export default function useVirtualizerItemCount(params: VirtualizerItemCountParams): {
@@ -1 +1 @@
1
- {"version":3,"file":"useVirtualizerItemCount.d.ts","sourceRoot":"","sources":["../../../../../Core/Components/Virtualise/VariableHeightVirtualizer/useVirtualizerItemCount.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAGnE,UAAU,0BAA0B;IAClC,mDAAmD;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB,iDAAiD;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB,2CAA2C;IAC3C,eAAe,EAAE,eAAe,CAAC;IACjC,wDAAwD;IACxD,cAAc,EAAE,OAAO,CAAC;IAExB,mDAAmD;IACnD,gBAAgB,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IACzC,gDAAgD;IAChD,QAAQ,EAAE,SAAS,CAAC;IAEpB,mFAAmF;IACnF,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,4DAA4D;IAC5D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kDAAkD;IAClD,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,MAAM,EAAE,0BAA0B,GAAG;IACnF,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAwEA"}
1
+ {"version":3,"file":"useVirtualizerItemCount.d.ts","sourceRoot":"","sources":["../../../../../Core/Components/Virtualise/VariableHeightVirtualizer/useVirtualizerItemCount.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAGnE,UAAU,0BAA0B;IAClC,mDAAmD;IACnD,UAAU,EAAE,MAAM,CAAC;IACnB,iDAAiD;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB,2CAA2C;IAC3C,eAAe,EAAE,eAAe,CAAC;IACjC,wDAAwD;IACxD,cAAc,EAAE,OAAO,CAAC;IAExB,mDAAmD;IACnD,gBAAgB,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IACzC,gDAAgD;IAChD,QAAQ,EAAE,SAAS,CAAC;IAEpB,mFAAmF;IACnF,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,4DAA4D;IAC5D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4DAA4D;IAC5D,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,MAAM,EAAE,0BAA0B,GAAG;IACnF,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAiGA"}
@@ -7,7 +7,7 @@ import { getDataIndex } from './utils';
7
7
  * - `isInfiniteMode`: Whether the list is in infinite scrolling mode.
8
8
  * - `virtualizedCount`: The current count of virtualized items.
9
9
  *
10
- * NOTE: In finite mode, the count is based on `totalItemCount`.
10
+ * NOTE: In finite mode, the count is based on `totalItemCount` and can shrink on a short page.
11
11
  * NOTE: In infinite mode, the count is dynamically calculated based on loaded items and buffer.
12
12
  */
13
13
  export default function useVirtualizerItemCount(params) {
@@ -18,17 +18,33 @@ export default function useVirtualizerItemCount(params) {
18
18
  if (!isInfiniteMode) {
19
19
  setVirtualizedCount(totalItemCount ?? 0);
20
20
  }
21
- }, [totalItemCount, isInfiniteMode]);
21
+ }, [totalItemCount, isInfiniteMode, countResetSignal]);
22
22
  useLayoutEffect(() => {
23
23
  if (isInfiniteMode) {
24
24
  setVirtualizedCount(0);
25
25
  }
26
26
  }, [countResetSignal, isInfiniteMode]);
27
- // Calculating count based on loaded items for infinite scrolling
27
+ // Check completed short pages in finite mode; grow the count only in infinite mode.
28
28
  useEffect(() => {
29
- if (!isInfiniteMode || !endIndex || !loadedDataRange.endIndex || isDataFetching)
29
+ if (!endIndex || !loadedDataRange.endIndex || isDataFetching)
30
30
  return;
31
31
  const items = itemContainerRef.current?.children;
32
+ if (!isInfiniteMode) {
33
+ // Wait for the requested page's results before reducing the finite count.
34
+ // Otherwise, rows from the previous page could be mistaken for a short response.
35
+ if (loadedDataRange.startIndex !== startIndex ||
36
+ loadedDataRange.endIndex !== endIndex ||
37
+ !items?.length) {
38
+ return;
39
+ }
40
+ const lastItemDataIndex = getDataIndex(items[items.length - 1]);
41
+ // If results end before the requested end index, reduce the count to the last returned index + 1.
42
+ if (lastItemDataIndex !== null && lastItemDataIndex < endIndex) {
43
+ setVirtualizedCount(count => Math.min(count, lastItemDataIndex + 1));
44
+ }
45
+ return;
46
+ }
47
+ // Infinite mode logic
32
48
  if (!items?.length) {
33
49
  setVirtualizedCount(0);
34
50
  return;
@@ -52,7 +68,8 @@ export default function useVirtualizerItemCount(params) {
52
68
  loadedDataRange,
53
69
  virtualizedCount,
54
70
  itemContainerRef,
55
- endIndex
71
+ endIndex,
72
+ startIndex
56
73
  ]);
57
74
  return {
58
75
  isInfiniteMode,
@@ -1 +1 @@
1
- {"version":3,"file":"useVirtualizerItemCount.js","sourceRoot":"","sources":["../../../../../Core/Components/Virtualise/VariableHeightVirtualizer/useVirtualizerItemCount.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,eAAe,EACf,OAAO,EACP,QAAQ,EAGT,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAyBvC;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,MAAkC;IAIhF,MAAM,EACJ,UAAU,EACV,QAAQ,EACR,eAAe,EACf,cAAc,EACd,cAAc,EACd,MAAM,GAAG,EAAE,EACX,gBAAgB,EAChB,gBAAgB,EAChB,QAAQ,EACT,GAAG,MAAM,CAAC;IAEX,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAAC,cAAc,IAAI,CAAC,CAAC,CAAC;IAE9E,MAAM,cAAc,GAAG,OAAO,CAC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AC,GAAG,MAAM,CAAC;QAC9D,IAAI,cAAc,IAAI,eAAe,GAAG,gBAAgB,EAAE,CAAC;YACzD,mBAAmB,CAAC,eAAe,CAAC,CAAC;QACvC,CAAC;IACH,CAAC,EAAE;QACD,cAAc;QACd,QAAQ;QACR,cAAc;QACd,eAAe;QACf,gBAAgB;QAChB,gBAAgB;QAChB,QAAQ;KACT,CAAC,CAAC;IAEH,OAAO;QACL,cAAc;QACd,gBAAgB;KACjB,CAAC;AACJ,CAAC","sourcesContent":["import {\n useEffect,\n useLayoutEffect,\n useMemo,\n useState,\n type ReactNode,\n type RefObject\n} from 'react';\n\nimport type { LoadedDataRange } from './VariableHeightVirtualizer';\nimport { getDataIndex } from './utils';\n\ninterface VirtualizerItemCountParams {\n /** The starting index requested by virtualizer. */\n startIndex: number;\n /** The ending index requested by virtualizer. */\n endIndex: number;\n /** The range of items currently loaded. */\n loadedDataRange: LoadedDataRange;\n /** Indicates if the data is currently being fetched. */\n isDataFetching: boolean;\n\n /** Ref to the container holding rendered items. */\n itemContainerRef: RefObject<HTMLElement>;\n /** The rendered children items as ReactNode. */\n children: ReactNode;\n\n /** The total number of items if known, or `null`/`undefined` for infinite mode. */\n totalItemCount?: number | null;\n /** Optional buffer to add to the count in infinite mode. */\n buffer?: number;\n /** Signal to reset the count in infinite mode. */\n countResetSignal?: number;\n}\n\n/**\n * Determines the count of virtualized items in a list and whether the list is in infinite scrolling mode or not.\n *\n * @returns An object containing:\n * - `isInfiniteMode`: Whether the list is in infinite scrolling mode.\n * - `virtualizedCount`: The current count of virtualized items.\n *\n * NOTE: In finite mode, the count is based on `totalItemCount`.\n * NOTE: In infinite mode, the count is dynamically calculated based on loaded items and buffer.\n */\nexport default function useVirtualizerItemCount(params: VirtualizerItemCountParams): {\n isInfiniteMode: boolean;\n virtualizedCount: number;\n} {\n const {\n startIndex,\n endIndex,\n loadedDataRange,\n isDataFetching,\n totalItemCount,\n buffer = 10,\n countResetSignal,\n itemContainerRef,\n children\n } = params;\n\n const [virtualizedCount, setVirtualizedCount] = useState(totalItemCount || 0);\n\n const isInfiniteMode = useMemo(\n () => totalItemCount === null || totalItemCount === undefined,\n [totalItemCount]\n );\n\n useLayoutEffect(() => {\n if (!isInfiniteMode) {\n setVirtualizedCount(totalItemCount ?? 0);\n }\n }, [totalItemCount, isInfiniteMode]);\n\n useLayoutEffect(() => {\n if (isInfiniteMode) {\n setVirtualizedCount(0);\n }\n }, [countResetSignal, isInfiniteMode]);\n\n // Calculating count based on loaded items for infinite scrolling\n useEffect(() => {\n if (!isInfiniteMode || !endIndex || !loadedDataRange.endIndex || isDataFetching) return;\n\n const items = itemContainerRef.current?.children;\n if (!items?.length) {\n setVirtualizedCount(0);\n return;\n }\n\n const lastItemDataIndex = getDataIndex(items[items.length - 1]) ?? -1;\n\n const hasMoreResults =\n loadedDataRange.startIndex === startIndex &&\n loadedDataRange.endIndex === endIndex &&\n lastItemDataIndex === endIndex;\n\n if (!hasMoreResults && Number.isInteger(lastItemDataIndex)) {\n setVirtualizedCount(lastItemDataIndex + 1);\n return;\n }\n\n const countWithBuffer = loadedDataRange.endIndex + 1 + buffer;\n if (hasMoreResults && countWithBuffer > virtualizedCount) {\n setVirtualizedCount(countWithBuffer);\n }\n }, [\n isDataFetching,\n children,\n isInfiniteMode,\n loadedDataRange,\n virtualizedCount,\n itemContainerRef,\n endIndex\n ]);\n\n return {\n isInfiniteMode,\n virtualizedCount\n };\n}\n"]}
1
+ {"version":3,"file":"useVirtualizerItemCount.js","sourceRoot":"","sources":["../../../../../Core/Components/Virtualise/VariableHeightVirtualizer/useVirtualizerItemCount.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,eAAe,EACf,OAAO,EACP,QAAQ,EAGT,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAyBvC;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,MAAkC;IAIhF,MAAM,EACJ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';\n\nimport type { LoadedDataRange } from './VariableHeightVirtualizer';\nimport { getDataIndex } from './utils';\n\ninterface VirtualizerItemCountParams {\n /** The starting index requested by virtualizer. */\n startIndex: number;\n /** The ending index requested by virtualizer. */\n endIndex: number;\n /** The range of items currently loaded. */\n loadedDataRange: LoadedDataRange;\n /** Indicates if the data is currently being fetched. */\n isDataFetching: boolean;\n\n /** Ref to the container holding rendered items. */\n itemContainerRef: RefObject<HTMLElement>;\n /** The rendered children items as ReactNode. */\n children: ReactNode;\n\n /** The total number of items if known, or `null`/`undefined` for infinite mode. */\n totalItemCount?: number | null;\n /** Optional buffer to add to the count in infinite mode. */\n buffer?: number;\n /** Signal to reset the count when the list data changes. */\n countResetSignal?: number;\n}\n\n/**\n * Determines the count of virtualized items in a list and whether the list is in infinite scrolling mode or not.\n *\n * @returns An object containing:\n * - `isInfiniteMode`: Whether the list is in infinite scrolling mode.\n * - `virtualizedCount`: The current count of virtualized items.\n *\n * NOTE: In finite mode, the count is based on `totalItemCount` and can shrink on a short page.\n * NOTE: In infinite mode, the count is dynamically calculated based on loaded items and buffer.\n */\nexport default function useVirtualizerItemCount(params: VirtualizerItemCountParams): {\n isInfiniteMode: boolean;\n virtualizedCount: number;\n} {\n const {\n startIndex,\n endIndex,\n loadedDataRange,\n isDataFetching,\n totalItemCount,\n buffer = 10,\n countResetSignal,\n itemContainerRef,\n children\n } = params;\n\n const [virtualizedCount, setVirtualizedCount] = useState(totalItemCount || 0);\n\n const isInfiniteMode = useMemo(\n () => totalItemCount === null || totalItemCount === undefined,\n [totalItemCount]\n );\n\n useLayoutEffect(() => {\n if (!isInfiniteMode) {\n setVirtualizedCount(totalItemCount ?? 0);\n }\n }, [totalItemCount, isInfiniteMode, countResetSignal]);\n\n useLayoutEffect(() => {\n if (isInfiniteMode) {\n setVirtualizedCount(0);\n }\n }, [countResetSignal, isInfiniteMode]);\n\n // Check completed short pages in finite mode; grow the count only in infinite mode.\n useEffect(() => {\n if (!endIndex || !loadedDataRange.endIndex || isDataFetching) return;\n\n const items = itemContainerRef.current?.children;\n\n if (!isInfiniteMode) {\n // Wait for the requested page's results before reducing the finite count.\n // Otherwise, rows from the previous page could be mistaken for a short response.\n if (\n loadedDataRange.startIndex !== startIndex ||\n loadedDataRange.endIndex !== endIndex ||\n !items?.length\n ) {\n return;\n }\n\n const lastItemDataIndex = getDataIndex(items[items.length - 1]);\n\n // If results end before the requested end index, reduce the count to the last returned index + 1.\n if (lastItemDataIndex !== null && lastItemDataIndex < endIndex) {\n setVirtualizedCount(count => Math.min(count, lastItemDataIndex + 1));\n }\n\n return;\n }\n\n // Infinite mode logic\n\n if (!items?.length) {\n setVirtualizedCount(0);\n return;\n }\n\n const lastItemDataIndex = getDataIndex(items[items.length - 1]) ?? -1;\n\n const hasMoreResults =\n loadedDataRange.startIndex === startIndex &&\n loadedDataRange.endIndex === endIndex &&\n lastItemDataIndex === endIndex;\n\n if (!hasMoreResults && Number.isInteger(lastItemDataIndex)) {\n setVirtualizedCount(lastItemDataIndex + 1);\n return;\n }\n\n const countWithBuffer = loadedDataRange.endIndex + 1 + buffer;\n if (hasMoreResults && countWithBuffer > virtualizedCount) {\n setVirtualizedCount(countWithBuffer);\n }\n }, [\n isDataFetching,\n children,\n isInfiniteMode,\n loadedDataRange,\n virtualizedCount,\n itemContainerRef,\n endIndex,\n startIndex\n ]);\n\n return {\n isInfiniteMode,\n virtualizedCount\n };\n}\n"]}
@@ -62,9 +62,10 @@ export declare const getOffsetForIndex: (index: number, itemsHeight: ItemsHeight
62
62
  * @param itemContainer - The HTML element containing the rendered items.
63
63
  * @param parentContainer - The parent HTML element that contains the items and possibly the header.
64
64
  * @param renderHeader - Indicates whether a header is rendered at the top of the parent container.
65
+ * @param startIndex - The requested window's start index, used to allow recovery from an empty out-of-range window.
65
66
  * @returns `true` if the view is not filled with all items, `false` otherwise.
66
67
  */
67
- export declare const isViewNotFilled: (totalItemCount: number, itemContainer: HTMLDivElement, parentContainer: HTMLDivElement, renderHeader: boolean) => boolean;
68
+ export declare const isViewNotFilled: (totalItemCount: number, itemContainer: HTMLDivElement, parentContainer: HTMLDivElement, renderHeader: boolean, startIndex: number) => boolean;
68
69
  /**
69
70
  * Retrieves the numeric data index from the `data-index` attribute of a given Element.
70
71
  *
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../Core/Components/Virtualise/VariableHeightVirtualizer/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE/D,UAAU,qCAAqC;IAC7C,uDAAuD;IACvD,SAAS,EAAE,MAAM,CAAC;IAClB,6CAA6C;IAC7C,YAAY,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;IACxC,kDAAkD;IAClD,gBAAgB,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;IAE5C,6BAA6B;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,uDAAuD;IACvD,WAAW,EAAE,WAAW,CAAC;IACzB,gDAAgD;IAChD,iBAAiB,EAAE,MAAM,CAAC;IAE1B,iGAAiG;IACjG,MAAM,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,aAAa,EAAE,MAAM,CAAC;IACtB,+FAA+F;IAC/F,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;GAIG;AACH,eAAO,MAAM,+BAA+B,GAC1C,OAAO,qCAAqC,KAC3C;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAgDxC,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B,GACrC,gBAAgB,MAAM,EACtB,aAAa,WAAW,EACxB,mBAAmB,MAAM,KACxB,MAOF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GAAI,eAAe,MAAM,GAAG,MAAM,GAAG,IAAI,KAAG,MAGpE,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,GAC5B,OAAO,MAAM,EACb,aAAa,WAAW,EACxB,mBAAmB,MAAM,KACxB,MAOF,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,GAC1B,gBAAgB,MAAM,EACtB,eAAe,cAAc,EAC7B,iBAAiB,cAAc,EAC/B,cAAc,OAAO,KACpB,OAyBF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GAAI,SAAS,OAAO,KAAG,MAAM,GAAG,IAKxD,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,aAAa,EAAE,cAAc,EAC7B,WAAW,EAAE,WAAW,EACxB,iBAAiB,EAAE,MAAM,GACxB,WAAW,CAkBb;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,iCAAiC,GAC5C,YAAY,MAAM,EAClB,4BAA4B,MAAM,GAAG,IAAI,EACzC,aAAa,WAAW,EACxB,qBAAqB,WAAW,EAChC,mBAAmB,MAAM,KACxB,MAiBF,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,GACnC,eAAe,cAAc,EAC7B,aAAa,WAAW,EACxB,mBAAmB,MAAM,KACxB,MAwBF,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../Core/Components/Virtualise/VariableHeightVirtualizer/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE/D,UAAU,qCAAqC;IAC7C,uDAAuD;IACvD,SAAS,EAAE,MAAM,CAAC;IAClB,6CAA6C;IAC7C,YAAY,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;IACxC,kDAAkD;IAClD,gBAAgB,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;IAE5C,6BAA6B;IAC7B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GAAG,IAAI,EACzC,aAAa,WAAW,EACxB,qBAAqB,WAAW,EAChC,mBAAmB,MAAM,KACxB,MAiBF,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,GACnC,eAAe,cAAc,EAC7B,aAAa,WAAW,EACxB,mBAAmB,MAAM,KACxB,MAwBF,CAAC"}
@@ -87,9 +87,10 @@ export const getOffsetForIndex = (index, itemsHeight, defaultItemHeight) => {
87
87
  * @param itemContainer - The HTML element containing the rendered items.
88
88
  * @param parentContainer - The parent HTML element that contains the items and possibly the header.
89
89
  * @param renderHeader - Indicates whether a header is rendered at the top of the parent container.
90
+ * @param startIndex - The requested window's start index, used to allow recovery from an empty out-of-range window.
90
91
  * @returns `true` if the view is not filled with all items, `false` otherwise.
91
92
  */
92
- export const isViewNotFilled = (totalItemCount, itemContainer, parentContainer, renderHeader) => {
93
+ export const isViewNotFilled = (totalItemCount, itemContainer, parentContainer, renderHeader, startIndex) => {
93
94
  const parentContainerPosition = parentContainer.getBoundingClientRect();
94
95
  let headerHeight = 0;
95
96
  if (renderHeader && parentContainer.childElementCount > 1) {
@@ -102,8 +103,11 @@ export const isViewNotFilled = (totalItemCount, itemContainer, parentContainer,
102
103
  const items = Array.from(itemContainer.children);
103
104
  if (!items.length && !totalItemCount)
104
105
  return false;
105
- if (!items.length && totalItemCount)
106
- return true;
106
+ if (!items.length && totalItemCount) {
107
+ // Do not keep fetching to fill an empty page.
108
+ // If this page is past the end of the list, allow pagination to reset.
109
+ return startIndex >= totalItemCount;
110
+ }
107
111
  return (!!totalItemCount &&
108
112
  items.length !== totalItemCount &&
109
113
  (Math.floor(items[items.length - 1].getBoundingClientRect().bottom) <
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../Core/Components/Virtualise/VariableHeightVirtualizer/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,UAAU,EA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,CAAC;IAE1C,MAAM,MAAM,GAAG,iBAAiB,CAAC,kBAAkB,EAAE,WAAW,EAAE,iBAAiB,CAAC,CAAC;IACrF,aAAa,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,MAAM,IAAI,CAAC;IAExC,IAAI,0BAA0B,GAAG,CAAC,CAAC;IACnC,IAAI,gBAAgB,GAAG,kBAAkB,CAAC;IAC1C,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QAC/B,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,cAAc,CAAC;YAAE,OAAO;QAE9C,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU,CAAC;QACjC,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,0BAA0B,IAAI,CAAC;QACnD,0BAA0B,IAAI,WAAW,CAAC,gBAAgB,CAAC,IAAI,iBAAiB,CAAC;QACjF,gBAAgB,IAAI,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;AAChD,CAAC,CAAC","sourcesContent":["import type { RefObject } from 'react';\n\nimport { getScrollbarWidth } from 'pega-repeating-structures-core';\nimport { isInstance } from '@pega/cosmos-react-core';\n\nimport type { ItemsHeight } from './VariableHeightVirtualizer';\n\ninterface GetVirtualizedPaginationIndicesParams {\n /** Current vertical scroll offset of the container. */\n scrollTop: number;\n /** Ref to the scrolling container element */\n containerRef: RefObject<HTMLDivElement>;\n /** Ref to the container holding the list items */\n itemContainerRef: RefObject<HTMLDivElement>;\n\n /** Total number of items. */\n totalItemCount: number;\n /** Mapping of item indices and their actual height. */\n itemsHeight: ItemsHeight;\n /** Default height for items if not measured. */\n defaultItemHeight: number;\n\n /** Number of extra items to render above and below the visible viewport for smooth scrolling. */\n buffer: number;\n /** Maximum allowed end index (exclusive). */\n endIndexLimit: number;\n /** If true, allows indices to exceed totalCount for infinite scrolling by including buffer. */\n isInfiniteMode?: boolean;\n}\n\n/**\n * Calculates the start and end indices for virtualized pagination in a variable-height list.\n *\n * @returns Object containing the calculated start and end indices for rendering (inclusive both indices).\n */\nexport const getVirtualizedPaginationIndices = (\n param: GetVirtualizedPaginationIndicesParams\n): { startIndex: number; endIndex: number } => {\n const {\n totalItemCount,\n buffer,\n itemContainerRef,\n scrollTop,\n containerRef,\n itemsHeight,\n defaultItemHeight,\n endIndexLimit,\n isInfiniteMode\n } = param;\n\n const minimumItemsToFetchOnTop = buffer * 4;\n if (totalItemCount === 0 || itemContainerRef.current?.childElementCount === 0) {\n return { startIndex: 0, endIndex: minimumItemsToFetchOnTop };\n }\n\n const viewportHeight = containerRef.current?.clientHeight || 0;\n\n // Find the first visible item index for the current scroll position\n let aboveTheFoldItemsHeight = 0;\n let visibleStartIndex = 0;\n while (\n visibleStartIndex < totalItemCount &&\n aboveTheFoldItemsHeight + (itemsHeight[visibleStartIndex] ?? defaultItemHeight) < scrollTop\n ) {\n aboveTheFoldItemsHeight += itemsHeight[visibleStartIndex] ?? defaultItemHeight;\n visibleStartIndex += 1;\n }\n\n // Find the last visible item index for the current scroll position\n let inViewItemsHeight = 0;\n let visibleEndIndex = visibleStartIndex;\n while (visibleEndIndex < totalItemCount && inViewItemsHeight < viewportHeight) {\n inViewItemsHeight += itemsHeight[visibleEndIndex] ?? defaultItemHeight;\n visibleEndIndex += 1;\n }\n\n const startIndex = Math.max(0, visibleStartIndex - buffer);\n let endIndex = Math.min(visibleEndIndex + buffer, endIndexLimit - 1);\n if (isInfiniteMode) {\n endIndex = Math.max(endIndex, minimumItemsToFetchOnTop);\n } else {\n // In cases where the count is very less due to filters, we would fetch more items to avoid unnecessary API calls if the count after the filter removed is more\n endIndex = Math.max(Math.min(totalItemCount - 1, endIndex), minimumItemsToFetchOnTop);\n }\n return { startIndex, endIndex };\n};\n\n/**\n * Calculates the total buffer height for a list of items, using their individual heights if available,\n * or a default height otherwise.\n *\n * @param totalItemCount - The total number of items in the list.\n * @param itemsHeight - An object or array containing the heights of individual items, indexed by item position.\n * @param defaultItemHeight - The default height to use for items whose height is not specified in `itemsHeight`.\n * @returns The sum of all item heights, using the default height for any missing values.\n */\nexport const calculateTotalBufferHeight = (\n totalItemCount: number,\n itemsHeight: ItemsHeight,\n defaultItemHeight: number\n): number => {\n let totalBufferHeight = 0;\n for (let i = 0; i < totalItemCount; i += 1) {\n totalBufferHeight += itemsHeight[i] || defaultItemHeight;\n }\n\n return totalBufferHeight;\n};\n\n/**\n * Returns a CSS-compatible max-height value based on the input.\n *\n * @param viewMaxHeight - The maximum height value, which can be a number (pixels), a string (CSS value), or `null`.\n * @returns A string representing the CSS max-height value.\n */\nexport const getMaxHeight = (viewMaxHeight: number | string | null): string => {\n if (!viewMaxHeight) return 'none';\n return typeof viewMaxHeight === 'number' ? `${viewMaxHeight}px` : viewMaxHeight;\n};\n\n/**\n * Calculates the vertical offset for a given item index in a list with variable item heights.\n *\n * @param index - The index of the item for which to calculate the offset.\n * @param itemsHeight - Mapping of item indices and their actual height.\n * @param defaultItemHeight - The default height to use for items not present in the cache.\n * @returns The total offset (in pixels) from the top of the list to the specified index.\n */\nexport const getOffsetForIndex = (\n index: number,\n itemsHeight: ItemsHeight,\n defaultItemHeight: number\n): number => {\n let offset = 0;\n\n for (let i = 0; i < index; i += 1) {\n offset += itemsHeight[i] ?? defaultItemHeight;\n }\n return offset;\n};\n\n/**\n * Determines whether the viewable area of a virtualized list is not fully filled with rendered items.\n *\n * @param totalItemCount - The total number of items that should be rendered.\n * @param itemContainer - The HTML element containing the rendered items.\n * @param parentContainer - The parent HTML element that contains the items and possibly the header.\n * @param renderHeader - Indicates whether a header is rendered at the top of the parent container.\n * @returns `true` if the view is not filled with all items, `false` otherwise.\n */\nexport const isViewNotFilled = (\n totalItemCount: number,\n itemContainer: HTMLDivElement,\n parentContainer: HTMLDivElement,\n renderHeader: boolean\n): boolean => {\n const parentContainerPosition = parentContainer.getBoundingClientRect();\n let headerHeight = 0;\n if (renderHeader && parentContainer.childElementCount > 1) {\n const firstChild = parentContainer.children[0];\n if (isInstance(firstChild, HTMLDivElement)) {\n headerHeight = firstChild.offsetHeight;\n }\n }\n\n const scrollbarWidth = getScrollbarWidth();\n const items = Array.from(itemContainer.children);\n\n if (!items.length && !totalItemCount) return false;\n if (!items.length && totalItemCount) return true;\n\n return (\n !!totalItemCount &&\n items.length !== totalItemCount &&\n (Math.floor(items[items.length - 1].getBoundingClientRect().bottom) <\n Math.floor(parentContainerPosition.bottom - scrollbarWidth) ||\n Math.floor(items[0].getBoundingClientRect().top) >\n Math.floor(parentContainerPosition.top + headerHeight) ||\n items.length === 0)\n );\n};\n\n/**\n * Retrieves the numeric data index from the `data-index` attribute of a given Element.\n *\n * @param element - The Element from which to extract the data index.\n * @returns The parsed integer value of the `data-index` attribute, or `null` if the attribute is not present.\n */\nexport const getDataIndex = (element: Element): number | null => {\n const dataIndexStr = element?.getAttribute('data-index');\n if (!dataIndexStr) return null;\n const parsedDataIndex = parseInt(dataIndexStr, 10);\n return Number.isNaN(parsedDataIndex) ? null : parsedDataIndex;\n};\n\n/**\n * Calculates and returns an object containing the heights of items whose heights have changed\n * compared to their previous values.\n *\n * @param itemContainer - The container HTMLElement whose child nodes represent items to measure.\n * @param itemsHeight - An object mapping item indices to their measured heights.\n * @param defaultItemHeight - The default height to use for items not present in `itemsHeight`.\n * @returns An object mapping item indices to their new heights for items whose heights have changed.\n */\nexport function getChangedItemsHeight(\n itemContainer: HTMLDivElement,\n itemsHeight: ItemsHeight,\n defaultItemHeight: number\n): ItemsHeight {\n if (!itemContainer) return {};\n\n const newHeights: ItemsHeight = {};\n const nodes = Array.from(itemContainer.children);\n\n nodes.forEach(node => {\n const itemDataIndex = getDataIndex(node);\n if (itemDataIndex === null) return;\n\n const measuredHeight = node.getBoundingClientRect().height;\n const prevHeight = itemsHeight[itemDataIndex] ?? defaultItemHeight;\n if (measuredHeight !== prevHeight) {\n newHeights[itemDataIndex] = measuredHeight;\n }\n });\n\n return newHeights;\n}\n\n/**\n * Calculates the cumulative change in item heights between two sets of item height data,\n * for a range of items starting from `startIndex` up to (but not including) `previousFirstItemDataIndex`.\n *\n * This function compares the current heights (`itemsHeight`) with the previous heights (`previousItemsHeight`)\n * for each item in the specified range, using `defaultItemHeight` as a fallback if a previous height is missing.\n * The result is the sum of the differences in height for all items in the range.\n *\n * @param startIndex - The index at which to start calculating the cumulative height change.\n * @param previousFirstItemDataIndex - The index up to which to calculate (exclusive). If `null` or less than or equal to 0, returns 0.\n * @param itemsHeight - An object mapping item indices to their measured heights.\n * @param previousItemsHeight - An object mapping item indices of previously rendered items to their heights.\n * @param defaultItemHeight - The default height to use if a previous height is not available.\n * @returns The cumulative change in item heights for the specified range, or 0 if the result is not finite.\n */\nexport const calculateCumulativeItemSizeChange = (\n startIndex: number,\n previousFirstItemDataIndex: number | null,\n itemsHeight: ItemsHeight,\n previousItemsHeight: ItemsHeight,\n defaultItemHeight: number\n): number => {\n if (previousFirstItemDataIndex === null || previousFirstItemDataIndex <= 0) {\n return 0;\n }\n\n let delta = 0;\n\n for (let i = startIndex; i < previousFirstItemDataIndex; i += 1) {\n const actualHeight = itemsHeight[i];\n const previousHeight = previousItemsHeight[i] ?? defaultItemHeight;\n\n if (actualHeight !== null && actualHeight !== undefined) {\n delta += actualHeight - previousHeight;\n }\n }\n\n return Number.isFinite(delta) ? delta : 0;\n};\n\n/**\n * Updates the position styles of child items within a container element to enable virtualized rendering.\n * Sets the container's top offset and positions each child absolutely based on their calculated heights.\n *\n * @param itemContainer - The HTML element containing the list items to be positioned.\n * @param itemsHeight - An object mapping item indices to their measured heights.\n * @param defaultItemHeight - The default height to use for items without a specified height.\n * @returns The total height of all items within the container, rounded down to the nearest integer.\n */\nexport const updateItemPositionStyles = (\n itemContainer: HTMLDivElement,\n itemsHeight: ItemsHeight,\n defaultItemHeight: number\n): number => {\n const items = itemContainer.children;\n if (!items?.length) {\n return 0;\n }\n\n const firstItemDataIndex = getDataIndex(items[0]);\n if (firstItemDataIndex === null) return 0;\n\n const offset = getOffsetForIndex(firstItemDataIndex, itemsHeight, defaultItemHeight);\n itemContainer.style.top = `${offset}px`;\n\n let itemContainerCurrentHeight = 0;\n let currentItemIndex = firstItemDataIndex;\n Array.from(items).forEach(item => {\n if (!isInstance(item, HTMLDivElement)) return;\n\n item.style.position = 'absolute';\n item.style.top = `${itemContainerCurrentHeight}px`;\n itemContainerCurrentHeight += itemsHeight[currentItemIndex] ?? defaultItemHeight;\n currentItemIndex += 1;\n });\n\n return Math.floor(itemContainerCurrentHeight);\n};\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../Core/Components/Virtualise/VariableHeightVirtualizer/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AA2BrD;;;;GAIG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAC7C,KAA4C,EACF,EAAE;IAC5C,MAAM,EACJ,cAAc,EACd,MAAM,EACN,gBAAgB,EAChB,SAAS,EACT,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,cAAc,EACf,GAAG,KAAK,CAAC;IAEV,MAAM,wBAAwB,GAAG,MAAM,GAAG,CAAC,CAAC;IAC5C,IAAI,cAAc,KAAK,CAAC,IAAI,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,KAAK,CAAC,EAAE,CAAC;QAC9E,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,QAAQ,EAAE,wBAAwB,EAAE,CAAC;IAC/D,CAAC;IAED,MAAM,cAAc,GAAG,YAAY,CAAC,OAAO,EAAE,YAAY,IAAI,CAAC,CAAC;IAE/D,oEAAoE;IACpE,IAAI,uBAAuB,GAAG,CAAC,CAAC;IAChC,IAAI,iBAAiB,GAAG,CAAC,CAAC;IAC1B,OACE,iBAAiB,GAAG,cAAc;QAClC,uBAAu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,CAAC,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;AAChD,CAAC,CAAC","sourcesContent":["import type { RefObject } from 'react';\n\nimport { getScrollbarWidth } from 'pega-repeating-structures-core';\nimport { isInstance } from '@pega/cosmos-react-core';\n\nimport type { ItemsHeight } from './VariableHeightVirtualizer';\n\ninterface GetVirtualizedPaginationIndicesParams {\n /** Current vertical scroll offset of the container. */\n scrollTop: number;\n /** Ref to the scrolling container element */\n containerRef: RefObject<HTMLDivElement>;\n /** Ref to the container holding the list items */\n itemContainerRef: RefObject<HTMLDivElement>;\n\n /** Total number of items. */\n totalItemCount: number;\n /** Mapping of item indices and their actual height. */\n itemsHeight: ItemsHeight;\n /** Default height for items if not measured. */\n defaultItemHeight: number;\n\n /** Number of extra items to render above and below the visible viewport for smooth scrolling. */\n buffer: number;\n /** Maximum allowed end index (exclusive). */\n endIndexLimit: number;\n /** If true, allows indices to exceed totalCount for infinite scrolling by including buffer. */\n isInfiniteMode?: boolean;\n}\n\n/**\n * Calculates the start and end indices for virtualized pagination in a variable-height list.\n *\n * @returns Object containing the calculated start and end indices for rendering (inclusive both indices).\n */\nexport const getVirtualizedPaginationIndices = (\n param: GetVirtualizedPaginationIndicesParams\n): { startIndex: number; endIndex: number } => {\n const {\n totalItemCount,\n buffer,\n itemContainerRef,\n scrollTop,\n containerRef,\n itemsHeight,\n defaultItemHeight,\n endIndexLimit,\n isInfiniteMode\n } = param;\n\n const minimumItemsToFetchOnTop = buffer * 4;\n if (totalItemCount === 0 || itemContainerRef.current?.childElementCount === 0) {\n return { startIndex: 0, endIndex: minimumItemsToFetchOnTop };\n }\n\n const viewportHeight = containerRef.current?.clientHeight || 0;\n\n // Find the first visible item index for the current scroll position\n let aboveTheFoldItemsHeight = 0;\n let visibleStartIndex = 0;\n while (\n visibleStartIndex < totalItemCount &&\n aboveTheFoldItemsHeight + (itemsHeight[visibleStartIndex] ?? defaultItemHeight) < scrollTop\n ) {\n aboveTheFoldItemsHeight += itemsHeight[visibleStartIndex] ?? defaultItemHeight;\n visibleStartIndex += 1;\n }\n\n // Find the last visible item index for the current scroll position\n let inViewItemsHeight = 0;\n let visibleEndIndex = visibleStartIndex;\n while (visibleEndIndex < totalItemCount && inViewItemsHeight < viewportHeight) {\n inViewItemsHeight += itemsHeight[visibleEndIndex] ?? defaultItemHeight;\n visibleEndIndex += 1;\n }\n\n const startIndex = Math.max(0, visibleStartIndex - buffer);\n let endIndex = Math.min(visibleEndIndex + buffer, endIndexLimit - 1);\n if (isInfiniteMode) {\n endIndex = Math.max(endIndex, minimumItemsToFetchOnTop);\n } else {\n // In cases where the count is very less due to filters, we would fetch more items to avoid unnecessary API calls if the count after the filter removed is more\n endIndex = Math.max(Math.min(totalItemCount - 1, endIndex), minimumItemsToFetchOnTop);\n }\n return { startIndex, endIndex };\n};\n\n/**\n * Calculates the total buffer height for a list of items, using their individual heights if available,\n * or a default height otherwise.\n *\n * @param totalItemCount - The total number of items in the list.\n * @param itemsHeight - An object or array containing the heights of individual items, indexed by item position.\n * @param defaultItemHeight - The default height to use for items whose height is not specified in `itemsHeight`.\n * @returns The sum of all item heights, using the default height for any missing values.\n */\nexport const calculateTotalBufferHeight = (\n totalItemCount: number,\n itemsHeight: ItemsHeight,\n defaultItemHeight: number\n): number => {\n let totalBufferHeight = 0;\n for (let i = 0; i < totalItemCount; i += 1) {\n totalBufferHeight += itemsHeight[i] || defaultItemHeight;\n }\n\n return totalBufferHeight;\n};\n\n/**\n * Returns a CSS-compatible max-height value based on the input.\n *\n * @param viewMaxHeight - The maximum height value, which can be a number (pixels), a string (CSS value), or `null`.\n * @returns A string representing the CSS max-height value.\n */\nexport const getMaxHeight = (viewMaxHeight: number | string | null): string => {\n if (!viewMaxHeight) return 'none';\n return typeof viewMaxHeight === 'number' ? `${viewMaxHeight}px` : viewMaxHeight;\n};\n\n/**\n * Calculates the vertical offset for a given item index in a list with variable item heights.\n *\n * @param index - The index of the item for which to calculate the offset.\n * @param itemsHeight - Mapping of item indices and their actual height.\n * @param defaultItemHeight - The default height to use for items not present in the cache.\n * @returns The total offset (in pixels) from the top of the list to the specified index.\n */\nexport const getOffsetForIndex = (\n index: number,\n itemsHeight: ItemsHeight,\n defaultItemHeight: number\n): number => {\n let offset = 0;\n\n for (let i = 0; i < index; i += 1) {\n offset += itemsHeight[i] ?? defaultItemHeight;\n }\n return offset;\n};\n\n/**\n * Determines whether the viewable area of a virtualized list is not fully filled with rendered items.\n *\n * @param totalItemCount - The total number of items that should be rendered.\n * @param itemContainer - The HTML element containing the rendered items.\n * @param parentContainer - The parent HTML element that contains the items and possibly the header.\n * @param renderHeader - Indicates whether a header is rendered at the top of the parent container.\n * @param startIndex - The requested window's start index, used to allow recovery from an empty out-of-range window.\n * @returns `true` if the view is not filled with all items, `false` otherwise.\n */\nexport const isViewNotFilled = (\n totalItemCount: number,\n itemContainer: HTMLDivElement,\n parentContainer: HTMLDivElement,\n renderHeader: boolean,\n startIndex: number\n): boolean => {\n const parentContainerPosition = parentContainer.getBoundingClientRect();\n let headerHeight = 0;\n if (renderHeader && parentContainer.childElementCount > 1) {\n const firstChild = parentContainer.children[0];\n if (isInstance(firstChild, HTMLDivElement)) {\n headerHeight = firstChild.offsetHeight;\n }\n }\n\n const scrollbarWidth = getScrollbarWidth();\n const items = Array.from(itemContainer.children);\n\n if (!items.length && !totalItemCount) return false;\n\n if (!items.length && totalItemCount) {\n // Do not keep fetching to fill an empty page.\n // If this page is past the end of the list, allow pagination to reset.\n return startIndex >= totalItemCount;\n }\n\n return (\n !!totalItemCount &&\n items.length !== totalItemCount &&\n (Math.floor(items[items.length - 1].getBoundingClientRect().bottom) <\n Math.floor(parentContainerPosition.bottom - scrollbarWidth) ||\n Math.floor(items[0].getBoundingClientRect().top) >\n Math.floor(parentContainerPosition.top + headerHeight) ||\n items.length === 0)\n );\n};\n\n/**\n * Retrieves the numeric data index from the `data-index` attribute of a given Element.\n *\n * @param element - The Element from which to extract the data index.\n * @returns The parsed integer value of the `data-index` attribute, or `null` if the attribute is not present.\n */\nexport const getDataIndex = (element: Element): number | null => {\n const dataIndexStr = element?.getAttribute('data-index');\n if (!dataIndexStr) return null;\n const parsedDataIndex = parseInt(dataIndexStr, 10);\n return Number.isNaN(parsedDataIndex) ? null : parsedDataIndex;\n};\n\n/**\n * Calculates and returns an object containing the heights of items whose heights have changed\n * compared to their previous values.\n *\n * @param itemContainer - The container HTMLElement whose child nodes represent items to measure.\n * @param itemsHeight - An object mapping item indices to their measured heights.\n * @param defaultItemHeight - The default height to use for items not present in `itemsHeight`.\n * @returns An object mapping item indices to their new heights for items whose heights have changed.\n */\nexport function getChangedItemsHeight(\n itemContainer: HTMLDivElement,\n itemsHeight: ItemsHeight,\n defaultItemHeight: number\n): ItemsHeight {\n if (!itemContainer) return {};\n\n const newHeights: ItemsHeight = {};\n const nodes = Array.from(itemContainer.children);\n\n nodes.forEach(node => {\n const itemDataIndex = getDataIndex(node);\n if (itemDataIndex === null) return;\n\n const measuredHeight = node.getBoundingClientRect().height;\n const prevHeight = itemsHeight[itemDataIndex] ?? defaultItemHeight;\n if (measuredHeight !== prevHeight) {\n newHeights[itemDataIndex] = measuredHeight;\n }\n });\n\n return newHeights;\n}\n\n/**\n * Calculates the cumulative change in item heights between two sets of item height data,\n * for a range of items starting from `startIndex` up to (but not including) `previousFirstItemDataIndex`.\n *\n * This function compares the current heights (`itemsHeight`) with the previous heights (`previousItemsHeight`)\n * for each item in the specified range, using `defaultItemHeight` as a fallback if a previous height is missing.\n * The result is the sum of the differences in height for all items in the range.\n *\n * @param startIndex - The index at which to start calculating the cumulative height change.\n * @param previousFirstItemDataIndex - The index up to which to calculate (exclusive). If `null` or less than or equal to 0, returns 0.\n * @param itemsHeight - An object mapping item indices to their measured heights.\n * @param previousItemsHeight - An object mapping item indices of previously rendered items to their heights.\n * @param defaultItemHeight - The default height to use if a previous height is not available.\n * @returns The cumulative change in item heights for the specified range, or 0 if the result is not finite.\n */\nexport const calculateCumulativeItemSizeChange = (\n startIndex: number,\n previousFirstItemDataIndex: number | null,\n itemsHeight: ItemsHeight,\n previousItemsHeight: ItemsHeight,\n defaultItemHeight: number\n): number => {\n if (previousFirstItemDataIndex === null || previousFirstItemDataIndex <= 0) {\n return 0;\n }\n\n let delta = 0;\n\n for (let i = startIndex; i < previousFirstItemDataIndex; i += 1) {\n const actualHeight = itemsHeight[i];\n const previousHeight = previousItemsHeight[i] ?? defaultItemHeight;\n\n if (actualHeight !== null && actualHeight !== undefined) {\n delta += actualHeight - previousHeight;\n }\n }\n\n return Number.isFinite(delta) ? delta : 0;\n};\n\n/**\n * Updates the position styles of child items within a container element to enable virtualized rendering.\n * Sets the container's top offset and positions each child absolutely based on their calculated heights.\n *\n * @param itemContainer - The HTML element containing the list items to be positioned.\n * @param itemsHeight - An object mapping item indices to their measured heights.\n * @param defaultItemHeight - The default height to use for items without a specified height.\n * @returns The total height of all items within the container, rounded down to the nearest integer.\n */\nexport const updateItemPositionStyles = (\n itemContainer: HTMLDivElement,\n itemsHeight: ItemsHeight,\n defaultItemHeight: number\n): number => {\n const items = itemContainer.children;\n if (!items?.length) {\n return 0;\n }\n\n const firstItemDataIndex = getDataIndex(items[0]);\n if (firstItemDataIndex === null) return 0;\n\n const offset = getOffsetForIndex(firstItemDataIndex, itemsHeight, defaultItemHeight);\n itemContainer.style.top = `${offset}px`;\n\n let itemContainerCurrentHeight = 0;\n let currentItemIndex = firstItemDataIndex;\n Array.from(items).forEach(item => {\n if (!isInstance(item, HTMLDivElement)) return;\n\n item.style.position = 'absolute';\n item.style.top = `${itemContainerCurrentHeight}px`;\n itemContainerCurrentHeight += itemsHeight[currentItemIndex] ?? defaultItemHeight;\n currentItemIndex += 1;\n });\n\n return Math.floor(itemContainerCurrentHeight);\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"StyledTableContainer.d.ts","sourceRoot":"","sources":["../../../../Core/Views/Table/StyledTableContainer.jsx"],"names":[],"mappings":";AA4CA;;yJAwjCG"}
1
+ {"version":3,"file":"StyledTableContainer.d.ts","sourceRoot":"","sources":["../../../../Core/Views/Table/StyledTableContainer.jsx"],"names":[],"mappings":";AA6CA;;yJA0kCG"}
@@ -3,6 +3,7 @@ import { forwardRef } from 'react';
3
3
  import styled, { css } from 'styled-components';
4
4
  import { getLuminance, meetsContrastGuidelines, mix, readableColor, transparentize } from 'polished';
5
5
  import { StyledStatus } from '@pega/cosmos-react-core/lib/components/Badges/Status';
6
+ import { StyledHTML } from '@pega/cosmos-react-core/lib/components/HTML/HTML';
6
7
  import { StyledRadioCheck } from '@pega/cosmos-react-core/lib/components/RadioCheck/RadioCheck';
7
8
  import { StyledLabel, StyledProgressBackdrop, calculateFontSize, tryCatch, isSameColor } from '@pega/cosmos-react-core';
8
9
  import { StyledTabPanel } from '@pega/cosmos-react-core/lib/components/Tabs/TabPanel';
@@ -845,10 +846,19 @@ const StyledTableContainer = styled(forwardRef((props, ref) => _jsx("div", { ref
845
846
  display: -webkit-box;
846
847
  -webkit-box-orient: vertical;
847
848
  -webkit-line-clamp: 2;
848
- white-space: inherit;
849
849
  word-break: inherit;
850
850
  }
851
851
 
852
+ .cell-content {
853
+ white-space: normal;
854
+
855
+ /* Apply whitespace per content wrapper, including combined-column fragments,
856
+ preserving plain-text line breaks without adding blank lines from HTML source newlines. */
857
+ &:not(:has(${StyledHTML})) {
858
+ white-space: pre-wrap;
859
+ }
860
+ }
861
+
852
862
  ${CellIcon} {
853
863
  margin-block-start: 0.375rem;
854
864
  }
@@ -889,10 +899,19 @@ const StyledTableContainer = styled(forwardRef((props, ref) => _jsx("div", { ref
889
899
  > .cell-content {
890
900
  /* for full-content, the row cells should adjust according to content */
891
901
  max-height: none;
892
- white-space: inherit;
893
902
  word-break: inherit;
894
903
  }
895
904
 
905
+ .cell-content {
906
+ white-space: normal;
907
+
908
+ /* Apply whitespace per content wrapper, including combined-column fragments,
909
+ preserving plain-text line breaks without adding blank lines from HTML source newlines. */
910
+ &:not(:has(${StyledHTML})) {
911
+ white-space: pre-wrap;
912
+ }
913
+ }
914
+
896
915
  ${CellIcon} {
897
916
  margin-block-start: 0.375rem;
898
917
  }
@@ -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,EACR,WAAW,EACZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,sDAAsD,CAAC;AAEtF,OAAO,EAAE,mCAAmC,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AACjG,OAAO,EACL,6BAA6B,EAC7B,qCAAqC,EACtC,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,eAAe,GAAG;;eAET,CAAC;AAEhB,MAAM,aAAa,GAAG,eAAe,CAAC,EAAE,CAAC,GAAG,CAAA;sBACtB,eAAe;;;;;;wBAMb,eAAe;;CAEtC,CAAC;AAEF,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,EAC7F,KAAK,EACL,IAAI,EACJ,YAAY,EACb,EAAE,EAAE;IACH,IAAI,yBAAyB,CAAC;IAC9B,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CAAC;;;;;;+CAMC,2BAA2B;;;;;aAK7D,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCnC;;;wBAGiB,cAAc;;;;;;;;;;uBAUf,KAAK,CAAC,IAAI,CAAC,OAAO;;;;;;uBAMlB,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 isSameColor\n} from '@pega/cosmos-react-core';\nimport { StyledTabPanel } from '@pega/cosmos-react-core/lib/components/Tabs/TabPanel';\n\nimport { generateRSDataContainerHeightStyles, generateRSHeightStyles } from '../../Utils/styles';\nimport {\n MASTER_DETAIL_INDICATOR_CLASS,\n MASTER_DETAIL_PREVIEW_HIGHLIGHT_CLASS\n} from '../../constants';\n\nimport { CellIcon } from './CellWrapper';\n\nconst dataRowSelector = `.row:not(.group-header-row):not(.hierarchical-group-header-row):not(\n .hierarchical-group-footer-row\n):not(.header)`;\n\nconst rowBackground = backgroundColor => css`\n background-color: ${backgroundColor};\n\n /* Sticky action cells and the first frozen cell use pseudo-elements to paint their backgrounds. */\n > .cell,\n > .cell-action::before,\n > .cell-fixed.cell-first::before {\n background-color: ${backgroundColor};\n }\n`;\n\nconst StyledTableContainer = styled(forwardRef((props, ref) => <div ref={ref} {...props} />))(({\n theme,\n view,\n isFullscreen\n}) => {\n let colIdToFillRemainingSpace;\n let isAggregationApplied = false;\n\n (view.columns ?? [])\n .filter(c => !c.hidden)\n .forEach(c => {\n if (!colIdToFillRemainingSpace && c.field.fillAvailableSpace) {\n colIdToFillRemainingSpace = c.field.id;\n }\n if (c.aggregated) {\n isAggregationApplied = true;\n }\n });\n\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 highlightedRowColor = tryCatch(() =>\n mix(0.85, theme.base.palette['primary-background'], theme.base.palette.interactive)\n );\n const previewHighlightBorderColor = tryCatch(() =>\n transparentize(0.7, theme.base.palette.interactive)\n );\n const lightGreyColor = theme.base.colors.gray['extra-light'];\n const freezeLineShadowTransparent = transparentize(\n getLuminance(theme.components.table.header['foreground-color']) < 0.5 ? 0.9 : 0.75,\n theme.components.table.header['foreground-color']\n );\n\n const headerBackground = theme.components.table.header['background-color'];\n const bodyPrimaryBackground = theme.components.table.body['background-color'];\n const bodySecondaryBackground = theme.components.table.body['secondary-background-color'];\n const secondaryBackgroundForEvenRow = isSameColor(headerBackground, bodyPrimaryBackground);\n\n /* Calculating usable striped row background and foreground colors */\n const stripedRowBackground =\n getLuminance(bodySecondaryBackground) > 0.5\n ? bodySecondaryBackground\n : mix(0.75, bodyPrimaryBackground, bodySecondaryBackground);\n\n const stripedRowContrast = meetsContrastGuidelines(\n theme.components.table.body['foreground-color'],\n stripedRowBackground\n ).AA;\n const useableStripedRowForeground = stripedRowContrast\n ? theme.components.table.body['foreground-color']\n : readableColor(theme.components.table.body['foreground-color'], stripedRowBackground);\n\n /* Calculating even row and odd row background and foreground colors */\n const evenRowBackgroundColor = secondaryBackgroundForEvenRow\n ? bodySecondaryBackground\n : bodyPrimaryBackground;\n\n const useableEvenRowForeground = secondaryBackgroundForEvenRow\n ? useableStripedRowForeground\n : theme.components.table.body['foreground-color'];\n\n /* Calculating usable odd row background and foreground colors */\n const oddRowBackgroundColor = secondaryBackgroundForEvenRow\n ? bodyPrimaryBackground\n : bodySecondaryBackground;\n\n const useableOddRowForeground = secondaryBackgroundForEvenRow\n ? theme.components.table.body['foreground-color']\n : useableStripedRowForeground;\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\n const borderVerticalInner = theme.components.table.border['vertical-inner'];\n const borderVerticalOuter = theme.components.table.border['vertical-outer'];\n const borderHorizontalInner =\n theme.components.table.border['horizontal-inner'] && !theme.components.table['striped-rows'];\n const borderHorizontalOuter = theme.components.table.border['horizontal-outer'];\n\n const showBorderOnLastStripedRow =\n theme.components.table.border['horizontal-inner'] && theme.components.table['striped-rows'];\n const isMasterDetailEnabled = !!view.meta.masterDetail;\n\n return css`\n --forground-color: ${theme.base.palette['foreground-color']};\n --interactive: ${theme.base.palette.interactive};\n --light-blue: ${theme.base.colors.blue['extra-light']};\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: ${theme.components.table.header['background-color']};\n --header-fg-color: ${usableHeaderForeground};\n --default-group-header-height: 1.5rem;\n --group-header-height: var(--default-group-header-height);\n --group-bg-color: ${theme.components.table.body['secondary-background-color']};\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 ${borderHorizontalOuter &&\n css`\n border-top: var(--border-style);\n border-bottom: var(--border-style);\n `}\n ${borderVerticalOuter &&\n css`\n border-left: var(--border-style);\n border-right: var(--border-style);\n `}\n ${borderVerticalOuter &&\n borderHorizontalOuter &&\n css`\n border-radius: var(--border-radius, ${theme.base['border-radius']});\n `}\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 .cell {\n /* preventing cell from shrinking during autosize calculations */\n flex-shrink: 0;\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 box-shadow: ${theme.base.shadow['focus-inset']};\n outline: none;\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: 1.25rem;\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 position: relative;\n transition: transform 0.5s var(--animation-ease);\n ${borderVerticalInner &&\n css`\n border-right: var(--border-style);\n `}\n ${borderHorizontalInner &&\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 ${borderVerticalInner &&\n css`\n border-left: var(--border-style);\n `}\n\n /* The below styles are needed to avoid ellipses in safari when no text is present\n and to hide the 'Actions' label */\n\n /* stylelint-disable max-nesting-depth */\n\n div.header-label {\n text-overflow: unset;\n }\n }\n &.aggregateCell {\n background-color: var(--group-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 ${showBorderOnLastStripedRow &&\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.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 ${borderVerticalInner &&\n css`\n border-inline-start: var(--border-style);\n `}\n }\n }\n }\n\n > .cell-action {\n background-color: ${bodyPrimaryBackground};\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 var(--border-width) var(--border-color-freeze);\n filter: drop-shadow(\n calc(${theme.base.spacing} * 0.25) 0 0 ${freezeLineShadowTransparent}\n );\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 ${showBorderOnLastStripedRow &&\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: ${bodyPrimaryBackground};\n }\n .cell-fixed.aggregateCell {\n background: var(--group-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: ${evenRowBackgroundColor};\n color: ${useableEvenRowForeground};\n\n ${borderVerticalOuter &&\n css`\n .cell-fixed {\n background: ${evenRowBackgroundColor};\n color: ${useableEvenRowForeground};\n }\n > .cell-action {\n background: ${evenRowBackgroundColor};\n }\n `}\n\n /* Apply border radius if vertical outer border was disabled */\n ${!borderVerticalOuter &&\n css`\n border-radius: min(${props => props.theme.base['border-radius']}, 0.25rem);\n\n .cell-fixed {\n color: ${useableEvenRowForeground};\n }\n\n /* Avoid the non-frozen column's background to come behind the first cell's empty area in corner due to border-radius.\n Let the first cell-fixed take full rectangale width, add a pseudo element with the background and border radius of same size as the element */\n .cell-fixed:not(.cell-first) {\n background: ${evenRowBackgroundColor};\n }\n .cell-fixed.cell-first::before {\n background: ${evenRowBackgroundColor};\n content: '';\n position: absolute;\n inset: 0;\n z-index: -1;\n border-bottom-left-radius: min(${props => props.theme.base['border-radius']}, 0.25rem);\n pointer-events: none;\n }\n\n > .cell-action::before {\n background: ${evenRowBackgroundColor};\n content: '';\n position: absolute;\n inset: 0;\n z-index: -1;\n border-bottom-right-radius: min(${props => props.theme.base['border-radius']}, 0.25rem);\n pointer-events: none;\n }\n `}\n }\n\n .row[data-index='0']:not(.group-header-row):not(.header) {\n ${!borderVerticalOuter &&\n css`\n border-radius: 0 0 min(${props => props.theme.base['border-radius']}, 0.25rem)\n min(${props => props.theme.base['border-radius']}, 0.25rem);\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: 0.875rem;\n height: 0.875rem;\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-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 ${borderVerticalInner &&\n css`\n border-right: var(--border-style);\n `}\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 ${borderVerticalInner &&\n css`\n border-right: var(--border-style);\n `}\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 .sticky-header {\n display: grid;\n position: sticky;\n top: 0;\n z-index: 9;\n border-start-start-radius: inherit;\n border-start-end-radius: inherit;\n\n ${!borderVerticalInner &&\n css`\n & .row .cell:not(.cell-last-frozen):not(.cell-last):has(.column-resizer) {\n &::after {\n content: '';\n position: absolute;\n right: 0;\n top: 0.5rem;\n bottom: 0.5rem;\n width: 0.062rem;\n background-color: ${theme.base.palette['border-line']};\n }\n }\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 .row .cell.cell-last {\n border-right: 0;\n }\n\n ${!colIdToFillRemainingSpace\n ? css`\n .row .cell.cell-last {\n flex-grow: 1;\n }\n `\n : css`\n .row .cell[data-col-id='${colIdToFillRemainingSpace}'] {\n flex-grow: 1;\n }\n `}\n\n /* Disable the flex layout size changes when measuring for content based size to get correct width */\n\n [data-content-size-measuring] & .row .cell {\n flex-grow: 0 !important;\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 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 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 .cell-content {\n flex-grow: unset;\n }\n }\n }\n\n & > .row:not(.group-header-row) {\n min-width: 100%;\n\n .cell-content {\n &:not(:has(.combined-cell)):not(.combined-cell-content):has(${StyledStatus}) {\n padding: unset;\n\n &,\n & > span,\n & ${StyledStatus} {\n block-size: 100%;\n }\n\n ${StyledStatus} {\n display: flex;\n align-items: center;\n justify-content: space-evenly;\n border-radius: 0;\n }\n }\n }\n }\n\n &.wrap-content-height\n > .row:not(.group-header-row)\n .cell:not(:has(.combined-cell)):has(${StyledStatus}) {\n padding: 0;\n }\n\n & > .row .cell:not(.column-type-action) .cell-content {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n word-break: break-all;\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: pre-wrap;\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-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: pre-wrap;\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 ${rowBackground(highlightedRowColor)}\n }\n ${isMasterDetailEnabled &&\n css`\n ${dataRowSelector}:hover {\n ${rowBackground(highlightedRowColor)}\n }\n\n ${dataRowSelector}.${MASTER_DETAIL_PREVIEW_HIGHLIGHT_CLASS} {\n ${rowBackground(highlightedRowColor)}\n border-radius: 0.125rem;\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n box-shadow: inset 0 0 0 0.125rem ${previewHighlightBorderColor};\n pointer-events: none;\n z-index: 7;\n }\n\n .${MASTER_DETAIL_INDICATOR_CLASS} {\n position: absolute;\n inset-inline-end: 0;\n inset-block-start: 50%;\n inline-size: 0.5625rem;\n block-size: 2.125rem;\n transform: translateX(var(--detail-indicator-offset, 0)) translateY(-50%);\n pointer-events: none;\n z-index: 8;\n\n &::before {\n content: '';\n position: absolute;\n inset-inline-end: 0.1875rem;\n inset-block-start: 50%;\n inline-size: 0.375rem;\n block-size: 0.5rem;\n transform: translateY(-50%);\n background: var(--interactive);\n clip-path: polygon(0 50%, 100% 0, 100% 100%);\n }\n\n &::after {\n content: '';\n position: absolute;\n inset-inline-end: 0;\n inset-block-start: 50%;\n inline-size: 0.1875rem;\n block-size: 2.125rem;\n transform: translateY(-50%);\n border-radius: 0.0625rem;\n background: var(--interactive);\n }\n }\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 /* stylelint-disable-next-line unit-allowed-list */\n padding: 0 8px;\n margin: 0 calc(${theme.base.spacing} / 4);\n }\n\n .toolbar-button {\n /* stylelint-disable-next-line unit-allowed-list */\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/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,UAAU,EAAE,MAAM,kDAAkD,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,8DAA8D,CAAC;AAChG,OAAO,EACL,WAAW,EACX,s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C,CAAC,CAAC,oCAAoC;QACtC,CAAC,CAAC,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wEAwCsC,YAAY;;;;;gBAKpE,YAAY;;;;cAId,YAAY;;;;;;;;;;;;8CAYoB,YAAY;;;;;;;;;;;;;;;;;;;QAmBlD,YAAY;;;;;;QAMZ,gBAAgB,IAAI,WAAW;;;;;;;;;;;;;;;;;;;mBAmBpB,QAAQ;;;;;;;;;;;;;;;;;;;yBAmBF,UAAU;;;;;YAKvB,QAAQ;;;;;;;;;;;;+BAYW,oBAAoB;QAC3C,CAAC,CAAC,oCAAoC;QACtC,CAAC,CAAC,uBAAuB;;;;;;;;;;;;;;;;mBAgBd,QAAQ;;;;;;;;;;;;;;;;;;yBAkBF,UAAU;;;;;YAKvB,QAAQ;;;;;;;;;;;;;;;;;;;;mBAoBD,QAAQ,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;UAqBnB,aAAa,CAAC,mBAAmB,CAAC;;QAEpC,qBAAqB;QACvB,GAAG,CAAA;UACC,eAAe;YACb,aAAa,CAAC,mBAAmB,CAAC;;;UAGpC,eAAe,IAAI,qCAAqC;YACtD,aAAa,CAAC,mBAAmB,CAAC;;;;;;+CAMC,2BAA2B;;;;;aAK7D,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCnC;;;wBAGiB,cAAc;;;;;;;;;;uBAUf,KAAK,CAAC,IAAI,CAAC,OAAO;;;;;;uBAMlB,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 { StyledHTML } from '@pega/cosmos-react-core/lib/components/HTML/HTML';\nimport { StyledRadioCheck } from '@pega/cosmos-react-core/lib/components/RadioCheck/RadioCheck';\nimport {\n StyledLabel,\n StyledProgressBackdrop,\n calculateFontSize,\n tryCatch,\n isSameColor\n} from '@pega/cosmos-react-core';\nimport { StyledTabPanel } from '@pega/cosmos-react-core/lib/components/Tabs/TabPanel';\n\nimport { generateRSDataContainerHeightStyles, generateRSHeightStyles } from '../../Utils/styles';\nimport {\n MASTER_DETAIL_INDICATOR_CLASS,\n MASTER_DETAIL_PREVIEW_HIGHLIGHT_CLASS\n} from '../../constants';\n\nimport { CellIcon } from './CellWrapper';\n\nconst dataRowSelector = `.row:not(.group-header-row):not(.hierarchical-group-header-row):not(\n .hierarchical-group-footer-row\n):not(.header)`;\n\nconst rowBackground = backgroundColor => css`\n background-color: ${backgroundColor};\n\n /* Sticky action cells and the first frozen cell use pseudo-elements to paint their backgrounds. */\n > .cell,\n > .cell-action::before,\n > .cell-fixed.cell-first::before {\n background-color: ${backgroundColor};\n }\n`;\n\nconst StyledTableContainer = styled(forwardRef((props, ref) => <div ref={ref} {...props} />))(({\n theme,\n view,\n isFullscreen\n}) => {\n let colIdToFillRemainingSpace;\n let isAggregationApplied = false;\n\n (view.columns ?? [])\n .filter(c => !c.hidden)\n .forEach(c => {\n if (!colIdToFillRemainingSpace && c.field.fillAvailableSpace) {\n colIdToFillRemainingSpace = c.field.id;\n }\n if (c.aggregated) {\n isAggregationApplied = true;\n }\n });\n\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 highlightedRowColor = tryCatch(() =>\n mix(0.85, theme.base.palette['primary-background'], theme.base.palette.interactive)\n );\n const previewHighlightBorderColor = tryCatch(() =>\n transparentize(0.7, theme.base.palette.interactive)\n );\n const lightGreyColor = theme.base.colors.gray['extra-light'];\n const freezeLineShadowTransparent = transparentize(\n getLuminance(theme.components.table.header['foreground-color']) < 0.5 ? 0.9 : 0.75,\n theme.components.table.header['foreground-color']\n );\n\n const headerBackground = theme.components.table.header['background-color'];\n const bodyPrimaryBackground = theme.components.table.body['background-color'];\n const bodySecondaryBackground = theme.components.table.body['secondary-background-color'];\n const secondaryBackgroundForEvenRow = isSameColor(headerBackground, bodyPrimaryBackground);\n\n /* Calculating usable striped row background and foreground colors */\n const stripedRowBackground =\n getLuminance(bodySecondaryBackground) > 0.5\n ? bodySecondaryBackground\n : mix(0.75, bodyPrimaryBackground, bodySecondaryBackground);\n\n const stripedRowContrast = meetsContrastGuidelines(\n theme.components.table.body['foreground-color'],\n stripedRowBackground\n ).AA;\n const useableStripedRowForeground = stripedRowContrast\n ? theme.components.table.body['foreground-color']\n : readableColor(theme.components.table.body['foreground-color'], stripedRowBackground);\n\n /* Calculating even row and odd row background and foreground colors */\n const evenRowBackgroundColor = secondaryBackgroundForEvenRow\n ? bodySecondaryBackground\n : bodyPrimaryBackground;\n\n const useableEvenRowForeground = secondaryBackgroundForEvenRow\n ? useableStripedRowForeground\n : theme.components.table.body['foreground-color'];\n\n /* Calculating usable odd row background and foreground colors */\n const oddRowBackgroundColor = secondaryBackgroundForEvenRow\n ? bodyPrimaryBackground\n : bodySecondaryBackground;\n\n const useableOddRowForeground = secondaryBackgroundForEvenRow\n ? theme.components.table.body['foreground-color']\n : useableStripedRowForeground;\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\n const borderVerticalInner = theme.components.table.border['vertical-inner'];\n const borderVerticalOuter = theme.components.table.border['vertical-outer'];\n const borderHorizontalInner =\n theme.components.table.border['horizontal-inner'] && !theme.components.table['striped-rows'];\n const borderHorizontalOuter = theme.components.table.border['horizontal-outer'];\n\n const showBorderOnLastStripedRow =\n theme.components.table.border['horizontal-inner'] && theme.components.table['striped-rows'];\n const isMasterDetailEnabled = !!view.meta.masterDetail;\n\n return css`\n --forground-color: ${theme.base.palette['foreground-color']};\n --interactive: ${theme.base.palette.interactive};\n --light-blue: ${theme.base.colors.blue['extra-light']};\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: ${theme.components.table.header['background-color']};\n --header-fg-color: ${usableHeaderForeground};\n --default-group-header-height: 1.5rem;\n --group-header-height: var(--default-group-header-height);\n --group-bg-color: ${theme.components.table.body['secondary-background-color']};\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 ${borderHorizontalOuter &&\n css`\n border-top: var(--border-style);\n border-bottom: var(--border-style);\n `}\n ${borderVerticalOuter &&\n css`\n border-left: var(--border-style);\n border-right: var(--border-style);\n `}\n ${borderVerticalOuter &&\n borderHorizontalOuter &&\n css`\n border-radius: var(--border-radius, ${theme.base['border-radius']});\n `}\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 .cell {\n /* preventing cell from shrinking during autosize calculations */\n flex-shrink: 0;\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 box-shadow: ${theme.base.shadow['focus-inset']};\n outline: none;\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: 1.25rem;\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 position: relative;\n transition: transform 0.5s var(--animation-ease);\n ${borderVerticalInner &&\n css`\n border-right: var(--border-style);\n `}\n ${borderHorizontalInner &&\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 ${borderVerticalInner &&\n css`\n border-left: var(--border-style);\n `}\n\n /* The below styles are needed to avoid ellipses in safari when no text is present\n and to hide the 'Actions' label */\n\n /* stylelint-disable max-nesting-depth */\n\n div.header-label {\n text-overflow: unset;\n }\n }\n &.aggregateCell {\n background-color: var(--group-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 ${showBorderOnLastStripedRow &&\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.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 ${borderVerticalInner &&\n css`\n border-inline-start: var(--border-style);\n `}\n }\n }\n }\n\n > .cell-action {\n background-color: ${bodyPrimaryBackground};\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 var(--border-width) var(--border-color-freeze);\n filter: drop-shadow(\n calc(${theme.base.spacing} * 0.25) 0 0 ${freezeLineShadowTransparent}\n );\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 ${showBorderOnLastStripedRow &&\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: ${bodyPrimaryBackground};\n }\n .cell-fixed.aggregateCell {\n background: var(--group-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: ${evenRowBackgroundColor};\n color: ${useableEvenRowForeground};\n\n ${borderVerticalOuter &&\n css`\n .cell-fixed {\n background: ${evenRowBackgroundColor};\n color: ${useableEvenRowForeground};\n }\n > .cell-action {\n background: ${evenRowBackgroundColor};\n }\n `}\n\n /* Apply border radius if vertical outer border was disabled */\n ${!borderVerticalOuter &&\n css`\n border-radius: min(${props => props.theme.base['border-radius']}, 0.25rem);\n\n .cell-fixed {\n color: ${useableEvenRowForeground};\n }\n\n /* Avoid the non-frozen column's background to come behind the first cell's empty area in corner due to border-radius.\n Let the first cell-fixed take full rectangale width, add a pseudo element with the background and border radius of same size as the element */\n .cell-fixed:not(.cell-first) {\n background: ${evenRowBackgroundColor};\n }\n .cell-fixed.cell-first::before {\n background: ${evenRowBackgroundColor};\n content: '';\n position: absolute;\n inset: 0;\n z-index: -1;\n border-bottom-left-radius: min(${props => props.theme.base['border-radius']}, 0.25rem);\n pointer-events: none;\n }\n\n > .cell-action::before {\n background: ${evenRowBackgroundColor};\n content: '';\n position: absolute;\n inset: 0;\n z-index: -1;\n border-bottom-right-radius: min(${props => props.theme.base['border-radius']}, 0.25rem);\n pointer-events: none;\n }\n `}\n }\n\n .row[data-index='0']:not(.group-header-row):not(.header) {\n ${!borderVerticalOuter &&\n css`\n border-radius: 0 0 min(${props => props.theme.base['border-radius']}, 0.25rem)\n min(${props => props.theme.base['border-radius']}, 0.25rem);\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: 0.875rem;\n height: 0.875rem;\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-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 ${borderVerticalInner &&\n css`\n border-right: var(--border-style);\n `}\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 ${borderVerticalInner &&\n css`\n border-right: var(--border-style);\n `}\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 .sticky-header {\n display: grid;\n position: sticky;\n top: 0;\n z-index: 9;\n border-start-start-radius: inherit;\n border-start-end-radius: inherit;\n\n ${!borderVerticalInner &&\n css`\n & .row .cell:not(.cell-last-frozen):not(.cell-last):has(.column-resizer) {\n &::after {\n content: '';\n position: absolute;\n right: 0;\n top: 0.5rem;\n bottom: 0.5rem;\n width: 0.062rem;\n background-color: ${theme.base.palette['border-line']};\n }\n }\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 .row .cell.cell-last {\n border-right: 0;\n }\n\n ${!colIdToFillRemainingSpace\n ? css`\n .row .cell.cell-last {\n flex-grow: 1;\n }\n `\n : css`\n .row .cell[data-col-id='${colIdToFillRemainingSpace}'] {\n flex-grow: 1;\n }\n `}\n\n /* Disable the flex layout size changes when measuring for content based size to get correct width */\n\n [data-content-size-measuring] & .row .cell {\n flex-grow: 0 !important;\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 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 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 .cell-content {\n flex-grow: unset;\n }\n }\n }\n\n & > .row:not(.group-header-row) {\n min-width: 100%;\n\n .cell-content {\n &:not(:has(.combined-cell)):not(.combined-cell-content):has(${StyledStatus}) {\n padding: unset;\n\n &,\n & > span,\n & ${StyledStatus} {\n block-size: 100%;\n }\n\n ${StyledStatus} {\n display: flex;\n align-items: center;\n justify-content: space-evenly;\n border-radius: 0;\n }\n }\n }\n }\n\n &.wrap-content-height\n > .row:not(.group-header-row)\n .cell:not(:has(.combined-cell)):has(${StyledStatus}) {\n padding: 0;\n }\n\n & > .row .cell:not(.column-type-action) .cell-content {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n word-break: break-all;\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: pre-wrap;\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-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 word-break: inherit;\n }\n\n .cell-content {\n white-space: normal;\n\n /* Apply whitespace per content wrapper, including combined-column fragments,\n preserving plain-text line breaks without adding blank lines from HTML source newlines. */\n &:not(:has(${StyledHTML})) {\n white-space: pre-wrap;\n }\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: pre-wrap;\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 word-break: inherit;\n }\n\n .cell-content {\n white-space: normal;\n\n /* Apply whitespace per content wrapper, including combined-column fragments,\n preserving plain-text line breaks without adding blank lines from HTML source newlines. */\n &:not(:has(${StyledHTML})) {\n white-space: pre-wrap;\n }\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 ${rowBackground(highlightedRowColor)}\n }\n ${isMasterDetailEnabled &&\n css`\n ${dataRowSelector}:hover {\n ${rowBackground(highlightedRowColor)}\n }\n\n ${dataRowSelector}.${MASTER_DETAIL_PREVIEW_HIGHLIGHT_CLASS} {\n ${rowBackground(highlightedRowColor)}\n border-radius: 0.125rem;\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n box-shadow: inset 0 0 0 0.125rem ${previewHighlightBorderColor};\n pointer-events: none;\n z-index: 7;\n }\n\n .${MASTER_DETAIL_INDICATOR_CLASS} {\n position: absolute;\n inset-inline-end: 0;\n inset-block-start: 50%;\n inline-size: 0.5625rem;\n block-size: 2.125rem;\n transform: translateX(var(--detail-indicator-offset, 0)) translateY(-50%);\n pointer-events: none;\n z-index: 8;\n\n &::before {\n content: '';\n position: absolute;\n inset-inline-end: 0.1875rem;\n inset-block-start: 50%;\n inline-size: 0.375rem;\n block-size: 0.5rem;\n transform: translateY(-50%);\n background: var(--interactive);\n clip-path: polygon(0 50%, 100% 0, 100% 100%);\n }\n\n &::after {\n content: '';\n position: absolute;\n inset-inline-end: 0;\n inset-block-start: 50%;\n inline-size: 0.1875rem;\n block-size: 2.125rem;\n transform: translateY(-50%);\n border-radius: 0.0625rem;\n background: var(--interactive);\n }\n }\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 /* stylelint-disable-next-line unit-allowed-list */\n padding: 0 8px;\n margin: 0 calc(${theme.base.spacing} / 4);\n }\n\n .toolbar-button {\n /* stylelint-disable-next-line unit-allowed-list */\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.35.0",
3
+ "version": "9.36.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,18 +14,18 @@
14
14
  "build": "tsc -b tsconfig.build.json"
15
15
  },
16
16
  "dependencies": {
17
- "@pega/cosmos-react-condition-builder": "9.35.0",
18
- "@pega/cosmos-react-core": "9.35.0",
19
- "@pega/cosmos-react-rte": "9.35.0",
20
- "@pega/cosmos-react-work": "9.35.0",
17
+ "@pega/cosmos-react-condition-builder": "9.36.1",
18
+ "@pega/cosmos-react-core": "9.36.1",
19
+ "@pega/cosmos-react-rte": "9.36.1",
20
+ "@pega/cosmos-react-work": "9.36.1",
21
21
  "@types/lodash-es": "^4.17.12",
22
22
  "@types/react": "^17.0.62 || ^18.3.3",
23
23
  "@types/react-dom": "^17.0.20 || ^18.3.0",
24
24
  "dayjs": "^1.11.13",
25
25
  "fast-deep-equal": "^3.1.3",
26
26
  "lodash-es": "^4.18.1",
27
- "pega-repeating-structures-core": "npm:@pega/lists-core@9.35.0",
28
- "pega-ui-list-data-apis": "npm:@pega/lists-core-utils@9.35.0",
27
+ "pega-repeating-structures-core": "npm:@pega/lists-core@9.36.1",
28
+ "pega-ui-list-data-apis": "npm:@pega/lists-core-utils@9.36.1",
29
29
  "polished": "^4.1.0",
30
30
  "prop-types": "^15.8.1",
31
31
  "react": "^17.0.0 || ^18.0.0",
@@ -43,7 +43,7 @@
43
43
  "@testing-library/react": "^16.0.0",
44
44
  "@testing-library/user-event": "^14.6.1",
45
45
  "jest-axe": "^8.0.0",
46
- "srs-utils": "9.35.0",
46
+ "srs-utils": "9.36.1",
47
47
  "typescript": "~5.9.3"
48
48
  }
49
49
  }