@@ -152,9 +152,10 @@ const TableContent = <
152152 ? `${ initialGridTemplateColumns } ${ typeof rowOnHoverComponentWidth === 'number' ? `minmax(${ rowOnHoverComponentWidth } px, 1fr)` : rowOnHoverComponentWidth } `
153153 : initialGridTemplateColumns
154154
155- const gridTemplateColumns = isAnyRowExpandable
156- ? `${ ACTION_GUTTER_SIZE } px ${ gridTemplateColumnsWithoutExpandButton } `
157- : gridTemplateColumnsWithoutExpandButton
155+ const gridTemplateColumns =
156+ isAnyRowExpandable || rowStartIconConfig
157+ ? `${ ACTION_GUTTER_SIZE } px ${ gridTemplateColumnsWithoutExpandButton } `
158+ : gridTemplateColumnsWithoutExpandButton
158159
159160 useEffect ( ( ) => {
160161 const scrollEventHandler = ( ) => {
@@ -248,21 +249,23 @@ const TableContent = <
248249 }
249250
250251 const renderRows = ( ) => {
251- if ( loading ) {
252+ if ( loading && ! visibleColumns . length ) {
252253 return SHIMMER_DUMMY_ARRAY . map ( ( shimmerRowLabel ) => (
253254 < div
254255 key = { shimmerRowLabel }
255- className = { `px-20 flexbox py-12 dc__gap-16 ${ showSeparatorBetweenRows ? 'border__secondary--bottom' : '' } ` }
256+ className = { `px-20 flex left py-12 dc__gap-16 ${ showSeparatorBetweenRows ? 'border__secondary--bottom' : '' } ` }
256257 >
257- { isBulkSelectionConfigured ? < div className = "shimmer w-20" /> : null }
258+ { isBulkSelectionConfigured || rowStartIconConfig || isAnyRowExpandable ? (
259+ < div className = "shimmer w-20" />
260+ ) : null }
258261 { SHIMMER_DUMMY_ARRAY . map ( ( shimmerCellLabel ) => (
259262 < div key = { shimmerCellLabel } className = "shimmer w-200" />
260263 ) ) }
261264 </ div >
262265 ) )
263266 }
264267
265- if ( areFilteredRowsLoading ) {
268+ if ( areFilteredRowsLoading || ( loading && visibleColumns . length ) ) {
266269 return SHIMMER_DUMMY_ARRAY . map ( ( shimmerRowLabel ) => (
267270 < div
268271 key = { shimmerRowLabel }
@@ -271,6 +274,11 @@ const TableContent = <
271274 gridTemplateColumns,
272275 } }
273276 >
277+ { isBulkSelectionConfigured || rowStartIconConfig || isAnyRowExpandable ? (
278+ < div className = "py-12 flex" aria-label = "Loading..." >
279+ < div className = "shimmer h-16 w-20" />
280+ </ div >
281+ ) : null }
274282 { visibleColumns . map ( ( { label } ) => (
275283 < div key = { label } className = "py-12 flex" aria-label = "Loading..." >
276284 < div className = "shimmer h-16 w-100" />
@@ -364,7 +372,7 @@ const TableContent = <
364372 ariaLabel = "Expand/Collapse row"
365373 showAriaLabelInTippy = { false }
366374 variant = { ButtonVariantType . borderLess }
367- size = { ComponentSizeType . xs }
375+ size = { ComponentSizeType . xxs }
368376 style = { ButtonStyleType . neutral }
369377 onClick = { toggleExpandRow }
370378 />
@@ -467,9 +475,11 @@ const TableContent = <
467475 ref = { headerRef }
468476 className = "bg__primary dc__min-width-fit-content px-20 border__secondary--bottom dc__position-sticky dc__zi-2 dc__top-0 generic-table__header"
469477 >
470- { loading ? (
478+ { loading && ! visibleColumns . length ? (
471479 < div className = "flexbox py-12 dc__gap-16" >
472- { isBulkSelectionConfigured ? < div className = "shimmer w-20" /> : null }
480+ { isBulkSelectionConfigured || rowStartIconConfig || isAnyRowExpandable ? (
481+ < div className = "shimmer w-20" />
482+ ) : null }
473483 { SHIMMER_DUMMY_ARRAY . map ( ( label ) => (
474484 < div key = { label } className = "shimmer w-200" />
475485 ) ) }
@@ -498,13 +508,15 @@ const TableContent = <
498508 ariaLabel = "Expand/Collapse all rows"
499509 showAriaLabelInTippy = { false }
500510 variant = { ButtonVariantType . borderLess }
501- size = { ComponentSizeType . xs }
511+ size = { ComponentSizeType . xxs }
502512 style = { ButtonStyleType . neutral }
503513 onClick = { toggleExpandAll }
504514 />
505515 </ div >
506516 ) : null }
507517
518+ { ! isAnyRowExpandable && rowStartIconConfig && < div /> }
519+
508520 { visibleColumns . map (
509521 (
510522 {
0 commit comments