Skip to content

Commit 0085aae

Browse files
authored
fix(AnalyticalTable): update loading indicator and overlay styles (#7447)
> Please note that the default visualisation for controls is Disabled control and BusyIndicator on top. Therefore we don't need to apply a different overlay bg color or similar and setting `--sapContent_DisabledOpacity` is sufficient.
1 parent 9b42693 commit 0085aae

File tree

3 files changed

+42
-12
lines changed

3 files changed

+42
-12
lines changed

packages/main/src/components/AnalyticalTable/AnalyticalTable.cy.tsx

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1534,8 +1534,18 @@ describe('AnalyticalTable', () => {
15341534
cy.mount(<AnalyticalTable data={[]} columns={columns} loading loadingDelay={0} />);
15351535
cy.get('[data-component-name="AnalyticalTableLoadingPlaceholder"]').should('be.visible');
15361536
cy.get('.ui5-busy-indicator-busy-area').should('not.exist');
1537+
cy.get('[data-component-name="AnalyticalTableContainerWithScrollbar"] > :not([class*="busyIndicator"])').should(
1538+
'not.have.css',
1539+
'opacity',
1540+
'0.4',
1541+
);
15371542
cy.mount(<AnalyticalTable data={data} columns={columns} loading />);
15381543
cy.get('.ui5-busy-indicator-busy-area', { timeout: 2000 }).should('be.visible');
1544+
cy.get('[data-component-name="AnalyticalTableContainerWithScrollbar"] > :not([class*="busyIndicator"])').should(
1545+
'have.css',
1546+
'opacity',
1547+
'0.4',
1548+
);
15391549
cy.mount(<AnalyticalTable data={data} columns={columns} loading loadingDelay={50000} />);
15401550
cy.get('.ui5-busy-indicator-busy-area', { timeout: 2000 }).should('not.exist');
15411551
cy.mount(<AnalyticalTable data={[]} columns={columns} />);
@@ -1886,8 +1896,22 @@ describe('AnalyticalTable', () => {
18861896
});
18871897

18881898
it('overlay', (done) => {
1899+
cy.mount(<AnalyticalTable data={data} columns={columns} />);
1900+
cy.findByRole('region').should('not.exist');
1901+
cy.get('[data-component-name="AnalyticalTableContainerWithScrollbar"] > :not([class^="overlay"])').should(
1902+
'not.have.css',
1903+
'opacity',
1904+
'0.4',
1905+
);
1906+
cy.findByText('A').click();
1907+
18891908
cy.mount(<AnalyticalTable data={data} columns={columns} showOverlay />);
1890-
cy.findByRole('region').should('be.visible').should('have.css', 'opacity', '0.8');
1909+
cy.findByRole('region').should('be.visible');
1910+
cy.get('[data-component-name="AnalyticalTableContainerWithScrollbar"] > :not([class^="overlay"])').should(
1911+
'have.css',
1912+
'opacity',
1913+
'0.4',
1914+
);
18911915
cy.findByText('A').shouldNotBeClickable(done);
18921916
});
18931917

packages/main/src/components/AnalyticalTable/AnalyticalTable.module.css

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,22 @@
1212
}
1313
}
1414

15+
.tableContainerWithScrollBar {
16+
position: relative;
17+
18+
&:has(> .overlay) {
19+
> :not(.overlay) {
20+
opacity: var(--sapContent_DisabledOpacity);
21+
}
22+
}
23+
24+
&:has(> .busyIndicator) {
25+
> :not(.busyIndicator) {
26+
opacity: var(--sapContent_DisabledOpacity);
27+
}
28+
}
29+
}
30+
1531
.table {
1632
position: relative;
1733
width: 100%;
@@ -37,10 +53,6 @@
3753
}
3854
}
3955

40-
.tableContainerWithScrollBar {
41-
position: relative;
42-
}
43-
4456
.busyIndicator {
4557
position: absolute;
4658
z-index: 1;
@@ -52,8 +64,6 @@
5264
position: absolute;
5365
z-index: 1;
5466
inset: 0;
55-
background: var(--sapGroup_ContentBackground);
56-
opacity: 0.8;
5767

5868
&:focus {
5969
outline-offset: calc(-1 * var(--sapContent_FocusWidth));

packages/main/src/components/AnalyticalTable/index.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -755,12 +755,8 @@ const AnalyticalTable = forwardRef<AnalyticalTableDomRef, AnalyticalTablePropTyp
755755
active={true}
756756
delay={loadingDelay}
757757
data-component-name="AnalyticalTableBusyIndicator"
758-
>
759-
{/*todo: This is necessary; otherwise, the overlay bg color will not be applied. https://github.com/SAP/ui5-webcomponents/issues/9723 */}
760-
<span />
761-
</BusyIndicator>
758+
/>
762759
)}
763-
{/*todo: use global CSS once --sapBlockLayer_Opacity is available*/}
764760
{showOverlay && (
765761
<>
766762
<span id={invalidTableTextId} className={classNames.hiddenA11yText} aria-hidden="true">

0 commit comments

Comments
 (0)