Skip to content

Commit 280b486

Browse files
committed
charts: remove Loader
1 parent ddad308 commit 280b486

File tree

5 files changed

+68
-27
lines changed

5 files changed

+68
-27
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
"@ui5/webcomponents-compat": "2.0.0-rc.6",
4545
"@ui5/webcomponents-fiori": "2.0.0-rc.6",
4646
"@ui5/webcomponents-icons": "2.0.0-rc.6",
47-
"react": "19.0.0-rc-c21bcd627b-20240624",
48-
"react-dom": "19.0.0-rc-c21bcd627b-20240624",
47+
"react": "18",
48+
"react-dom": "18",
4949
"remark-gfm": "^4.0.0",
5050
"tocbot": "4.28.2"
5151
},

packages/charts/src/internal/ChartContainer.module.css

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,23 @@
33
color: var(--sapTextColor);
44
font-family: var(--sapFontFamily);
55
width: 100%;
6-
/*todo remove in v2*/
76
height: 400px;
7+
min-height: fit-content;
88
position: relative;
99
}
1010

11+
.loading {
12+
opacity: 0.4;
13+
}
14+
15+
.busyIndicator {
16+
/* todo: clarify if we want to use the block layer variable of ui5wc or our own approach*/
17+
/*background: var(--_ui5_busy_indicator_block_layer);*/
18+
position: absolute;
19+
inset: 0;
20+
height: 100%;
21+
}
22+
1123
:global(.has-click-handler) {
1224
:global(.recharts-pie-sector),
1325
:global(.recharts-bar-rectangles),

packages/charts/src/internal/ChartContainer.tsx

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,28 @@
1-
import { type CommonProps, Label } from '@ui5/webcomponents-react';
1+
import { BusyIndicator, Label } from '@ui5/webcomponents-react';
2+
import type { CommonProps } from '@ui5/webcomponents-react';
23
import { useStylesheet } from '@ui5/webcomponents-react-base';
34
import { clsx } from 'clsx';
45
import type { ComponentType, ReactElement, ReactNode } from 'react';
56
import { Component, forwardRef } from 'react';
67
import { ResponsiveContainer } from 'recharts';
8+
// todo: same issue as with Loader import
9+
// import { addCustomCSSWithScoping } from '@ui5/webcomponents-react/dist/internal/addCustomCSSWithScoping.js';
10+
import { addCustomCSSWithScoping } from '../../../main/src/internal/addCustomCSSWithScoping.js';
711
import { classNames, styleData } from './ChartContainer.module.css.js';
812

13+
//todo: add feature request for parts or even a fix if this turns out to be a bug
14+
addCustomCSSWithScoping(
15+
'ui5-busy-indicator',
16+
`
17+
:host([data-component-name="ChartContainerBusyIndicator"]) .ui5-busy-indicator-busy-area{
18+
background:unset;
19+
},
20+
:host([data-component-name="ChartContainerBusyIndicator"]) .ui5-busy-indicator-busy-area:focus {
21+
border-radius: 0;
22+
}
23+
`
24+
);
25+
926
export interface ContainerProps extends CommonProps {
1027
children: ReactElement;
1128
Placeholder?: ComponentType;
@@ -43,9 +60,17 @@ const ChartContainer = forwardRef<HTMLDivElement, ContainerProps>((props, ref) =
4360
{dataset?.length > 0 ? (
4461
<>
4562
{/*todo replace with BusyIndicator*/}
46-
{loading && 'Loading...'}
63+
{loading && (
64+
<BusyIndicator
65+
active
66+
className={classNames.busyIndicator}
67+
data-component-name="ChartContainerBusyIndicator"
68+
/>
69+
)}
4770
<ErrorBoundary>
48-
<ResponsiveContainer debounce={resizeDebounce}>{children}</ResponsiveContainer>
71+
<ResponsiveContainer debounce={resizeDebounce} className={loading && classNames.loading}>
72+
{children}
73+
</ResponsiveContainer>
4974
</ErrorBoundary>
5075
</>
5176
) : (

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,7 @@ addCustomCSSWithScoping(
107107
:host([data-component-name="AnalyticalTableBusyIndicator"]) .ui5-busy-indicator-busy-area:focus {
108108
border-radius: 0;
109109
}
110-
111-
`
110+
`
112111
);
113112

114113
/**

yarn.lock

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19516,14 +19516,15 @@ __metadata:
1951619516
languageName: node
1951719517
linkType: hard
1951819518

19519-
"react-dom@npm:19.0.0-rc-c21bcd627b-20240624":
19520-
version: 19.0.0-rc-c21bcd627b-20240624
19521-
resolution: "react-dom@npm:19.0.0-rc-c21bcd627b-20240624"
19519+
"react-dom@npm:18":
19520+
version: 18.3.1
19521+
resolution: "react-dom@npm:18.3.1"
1952219522
dependencies:
19523-
scheduler: "npm:0.25.0-rc-c21bcd627b-20240624"
19523+
loose-envify: "npm:^1.1.0"
19524+
scheduler: "npm:^0.23.2"
1952419525
peerDependencies:
19525-
react: 19.0.0-rc-c21bcd627b-20240624
19526-
checksum: 10c0/61570745ba25391e1659ccb4da5f315b6e8fc65597741fe28af36c33551623e2f984ac6ce6acea0a062f9c97dd6c556788c8b3cd97ad497788d5a66e291ce622
19526+
react: ^18.3.1
19527+
checksum: 10c0/a752496c1941f958f2e8ac56239172296fcddce1365ce45222d04a1947e0cc5547df3e8447f855a81d6d39f008d7c32eab43db3712077f09e3f67c4874973e85
1952719528
languageName: node
1952819529
linkType: hard
1952919530

@@ -19626,10 +19627,12 @@ __metadata:
1962619627
languageName: node
1962719628
linkType: hard
1962819629

19629-
"react@npm:19.0.0-rc-c21bcd627b-20240624":
19630-
version: 19.0.0-rc-c21bcd627b-20240624
19631-
resolution: "react@npm:19.0.0-rc-c21bcd627b-20240624"
19632-
checksum: 10c0/82a760b294b40a13b93a94c6d3c76265896977c7f270006082a8b2dc89d71894d1f51e77861e9316265c1f8a92bc09f1314c1e4679be48e44690d0ec74e0c688
19630+
"react@npm:18":
19631+
version: 18.3.1
19632+
resolution: "react@npm:18.3.1"
19633+
dependencies:
19634+
loose-envify: "npm:^1.1.0"
19635+
checksum: 10c0/283e8c5efcf37802c9d1ce767f302dd569dd97a70d9bb8c7be79a789b9902451e0d16334b05d73299b20f048cbc3c7d288bbbde10b701fa194e2089c237dbea3
1963319636
languageName: node
1963419637
linkType: hard
1963519638

@@ -20527,13 +20530,6 @@ __metadata:
2052720530
languageName: node
2052820531
linkType: hard
2052920532

20530-
"scheduler@npm:0.25.0-rc-c21bcd627b-20240624":
20531-
version: 0.25.0-rc-c21bcd627b-20240624
20532-
resolution: "scheduler@npm:0.25.0-rc-c21bcd627b-20240624"
20533-
checksum: 10c0/78dfa0cadc3f617933d01718ddf855ac9ee46d96e5ab46e839c9b7d13138afb304a5ac779b89d0c600095cfdca409758828536a187099a39d16100d5be4fc758
20534-
languageName: node
20535-
linkType: hard
20536-
2053720533
"scheduler@npm:^0.23.0":
2053820534
version: 0.23.0
2053920535
resolution: "scheduler@npm:0.23.0"
@@ -20543,6 +20539,15 @@ __metadata:
2054320539
languageName: node
2054420540
linkType: hard
2054520541

20542+
"scheduler@npm:^0.23.2":
20543+
version: 0.23.2
20544+
resolution: "scheduler@npm:0.23.2"
20545+
dependencies:
20546+
loose-envify: "npm:^1.1.0"
20547+
checksum: 10c0/26383305e249651d4c58e6705d5f8425f153211aef95f15161c151f7b8de885f24751b377e4a0b3dd42cce09aad3f87a61dab7636859c0d89b7daf1a1e2a5c78
20548+
languageName: node
20549+
linkType: hard
20550+
2054620551
"semver@npm:2 || 3 || 4 || 5, semver@npm:^5.6.0":
2054720552
version: 5.7.2
2054820553
resolution: "semver@npm:5.7.2"
@@ -22426,8 +22431,8 @@ __metadata:
2242622431
postcss-modules: "npm:^6.0.0"
2242722432
postcss-nesting: "npm:^12.0.3"
2242822433
prettier: "npm:^3.0.0"
22429-
react: "npm:19.0.0-rc-c21bcd627b-20240624"
22430-
react-dom: "npm:19.0.0-rc-c21bcd627b-20240624"
22434+
react: "npm:18"
22435+
react-dom: "npm:18"
2243122436
remark-gfm: "npm:^4.0.0"
2243222437
rimraf: "npm:^5.0.0"
2243322438
storybook: "npm:8.0.10"

0 commit comments

Comments
 (0)