File tree 5 files changed +74
-19
lines changed
5 files changed +74
-19
lines changed Original file line number Diff line number Diff line change 1
1
<div class =" ui5-busyindicator-root" >
2
-
3
- {{ #if active }}
4
- <div class =" ui5-busyindicator-dynamic-content" tabindex =" 0" role =" progressbar" aria-valuemin =" 0" aria-valuemax =" 100" title =" {{ ariaTitle }} " >
5
- <div class =" ui5-busyindicator-circle circle-animation-0" ></div >
6
- <div class =" ui5-busyindicator-circle circle-animation-1" ></div >
7
- <div class =" ui5-busyindicator-circle circle-animation-2" ></div >
8
- </div >
9
- {{ /if }}
2
+ <div class =" ui5-busyindicator-wrapper" >
3
+ {{ #if active }}
4
+ <div class =" ui5-busyindicator-dynamic-content" tabindex =" 0" role =" progressbar" aria-valuemin =" 0" aria-valuemax =" 100" title =" {{ ariaTitle }} " >
5
+ <div class =" ui5-busyindicator-circle circle-animation-0" ></div >
6
+ <div class =" ui5-busyindicator-circle circle-animation-1" ></div >
7
+ <div class =" ui5-busyindicator-circle circle-animation-2" ></div >
8
+ </div >
9
+ {{ /if }}
10
+ {{ #if text }}
11
+ <ui5-label class =" ui5-busyindicator-text" >
12
+ {{ text }}
13
+ </ui5-label >
14
+ {{ /if }}
15
+ </div >
10
16
11
17
<slot ></slot >
12
18
</div >
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js";
2
2
import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js" ;
3
3
import { fetchI18nBundle , getI18nBundle } from "@ui5/webcomponents-base/dist/i18nBundle.js" ;
4
4
import BusyIndicatorSize from "./types/BusyIndicatorSize.js" ;
5
+ import Label from "./Label.js" ;
5
6
6
7
// Template
7
8
import BusyIndicatorTemplate from "./generated/templates/BusyIndicatorTemplate.lit.js" ;
@@ -30,6 +31,18 @@ const metadata = {
30
31
} ,
31
32
} ,
32
33
properties : /** @lends sap.ui.webcomponents.main.BusyIndicator.prototype */ {
34
+
35
+ /**
36
+ * Defines text to be displayed below the busy indicator. It can be used to inform the user of the current operation.
37
+ * @type {String }
38
+ * @public
39
+ * @defaultvalue ""
40
+ * @since 1.0.0-rc.7
41
+ */
42
+ text : {
43
+ type : String ,
44
+ } ,
45
+
33
46
/**
34
47
* Defines the size of the <code>ui5-busyindicator</code>.
35
48
* <br><br>
@@ -101,7 +114,10 @@ class BusyIndicator extends UI5Element {
101
114
}
102
115
103
116
static async onDefine ( ) {
104
- await fetchI18nBundle ( "@ui5/webcomponents" ) ;
117
+ await Promise . all ( [
118
+ fetchI18nBundle ( "@ui5/webcomponents" ) ,
119
+ Label . define ( ) ,
120
+ ] ) ;
105
121
}
106
122
107
123
get ariaTitle ( ) {
Original file line number Diff line number Diff line change 2
2
display : inline-block;
3
3
}
4
4
5
+ : host (: not ([active ])) .ui5-busyindicator-wrapper {
6
+ display : none;
7
+ }
8
+
5
9
: host ([active ]) {
6
10
color : var (--sapContent_IconColor );
7
11
pointer-events : none;
20
24
min-height : .5rem ;
21
25
}
22
26
27
+ : host ([size = "Small" ][text ]: not ([text = "" ])) .ui5-busyindicator-root {
28
+ min-height : 1.75rem ;
29
+ }
30
+
23
31
: host ([size = "Small" ]) .ui5-busyindicator-circle {
24
32
width : .5rem ;
25
33
height : .5rem ;
31
39
min-height : 1rem ;
32
40
}
33
41
42
+ : host (: not ([size ])[text ]: not ([text = "" ])) .ui5-busyindicator-root ,
43
+ : host ([size = "Medium" ][text ]: not ([text = "" ])) .ui5-busyindicator-root {
44
+ min-height : 2.25rem ;
45
+ }
46
+
34
47
: host (: not ([size ])) .ui5-busyindicator-circle ,
35
48
: host ([size = "Medium" ]) .ui5-busyindicator-circle {
36
49
width : 1rem ;
42
55
min-height : 2rem ;
43
56
}
44
57
58
+ : host ([size = "Large" ][text ]: not ([text = "" ])) .ui5-busyindicator-root {
59
+ min-height : 3.25rem ;
60
+ }
61
+
45
62
: host ([size = "Large" ]) .ui5-busyindicator-circle {
46
63
width : 2rem ;
47
64
height : 2rem ;
55
72
background-color : inherit;
56
73
}
57
74
75
+ .ui5-busyindicator-wrapper {
76
+ position : absolute;
77
+ z-index : 99 ;
78
+ width : 100% ;
79
+ }
80
+
58
81
.ui5-busyindicator-circle {
59
82
display : inline-block;
60
83
background-color : currentColor;
69
92
}
70
93
71
94
.ui5-busyindicator-dynamic-content {
72
- position : absolute;
73
- z-index : 99 ;
74
- width : 100% ;
75
95
height : 100% ;
76
96
display : flex;
77
97
justify-content : center;
98
118
animation-delay : 400ms ;
99
119
}
100
120
121
+ .ui5-busyindicator-text {
122
+ width : 100% ;
123
+ margin-top : .25rem ;
124
+ text-align : center;
125
+ }
126
+
101
127
@keyframes grow {
102
128
0% , 50% , 100% {
103
129
-webkit-transform : scale (0.5 );
Original file line number Diff line number Diff line change 12
12
}
13
13
14
14
: host (: not ([wrap ])) .ui5-label-root {
15
+ width : 100% ;
15
16
font-weight : inherit;
16
17
display : inline-block;
17
18
white-space : nowrap;
Original file line number Diff line number Diff line change 23
23
</ head >
24
24
25
25
< body style ="background-color: var(--sapBackgroundColor); ">
26
- < ui5-title > Default ( Large) ui5-busyindicator</ ui5-title >
27
- < ui5-busyindicator active > </ ui5-busyindicator >
26
+ < ui5-title > Large ui5-busyindicator</ ui5-title >
27
+ < ui5-busyindicator active size =" Large " > </ ui5-busyindicator >
28
28
< br />
29
29
< br />
30
30
31
- < ui5-title > Medium ui5-busyindicator</ ui5-title >
31
+ < ui5-title > Default Medium ui5-busyindicator</ ui5-title >
32
32
< ui5-busyindicator size ="Medium " active id ="indicator1 "> </ ui5-busyindicator >
33
33
34
34
< br />
35
35
< br />
36
36
< ui5-busyindicator size ="Medium " active id ="indicator2 "> </ ui5-busyindicator >
37
37
38
+ < ui5-title > ui5-busyindicator with text</ ui5-title >
39
+
40
+ < br />
41
+ < br />
42
+ < ui5-busyindicator active id ="indicator2 " text ="Loading " style ="width: 10rem; border: 1px solid red "> </ ui5-busyindicator >
43
+
38
44
< br />
39
45
< br />
40
46
44
50
45
51
< br />
46
52
< br />
47
- < ui5-busyindicator size ="Medium " active >
53
+ < ui5-busyindicator size ="Medium " active text =" Loading " >
48
54
< ui5-checkbox text ="Hello World "> </ ui5-checkbox >
49
55
</ ui5-busyindicator >
50
56
54
60
< ui5-button id ="fetch-btn " style ="width: 120px; "> Fetch List Data</ ui5-button >
55
61
< br >
56
62
< br >
57
- < ui5-busyindicator id ="busy-container " style ="width: 520px " size ="Medium ">
63
+ < ui5-busyindicator id ="busy-container " style ="width: 520px " size ="Medium " text =" Loading " >
58
64
< ui5-list id ="fetch-list " no-data-text ="No Data " header-text ="Available Items " style ="width: 100% "> </ ui5-list >
59
65
</ ui5-busyindicator >
60
66
61
67
62
68
< br >
63
69
< br >
64
70
< br >
65
- < br >
71
+ < br >
66
72
67
73
< ui5-busyindicator size ="Medium " active style ="width: 500px; margin-left: 100px ">
68
74
< ui5-list style ="width: 100%; border: 1px solid black; ">
72
78
</ ui5-list >
73
79
</ ui5-busyindicator >
74
80
75
- < br >
81
+ < br >
76
82
< br >
77
83
< br >
78
84
You can’t perform that action at this time.
0 commit comments