@@ -26,24 +26,44 @@ <h3>Basic CheckBox</h3>
26
26
< section >
27
27
< h3 > CheckBox states</ h3 >
28
28
< div class ="snippet ">
29
+ < ui5-checkbox text ="Success " value-state ="Success "> </ ui5-checkbox >
29
30
< ui5-checkbox text ="Error " value-state ="Error "> </ ui5-checkbox >
30
31
< ui5-checkbox text ="Warning " value-state ="Warning "> </ ui5-checkbox >
32
+ < ui5-checkbox text ="Information " value-state ="Information "> </ ui5-checkbox >
31
33
< ui5-checkbox text ="Disabled " disabled checked > </ ui5-checkbox >
32
34
< ui5-checkbox text ="Readonly " readonly checked > </ ui5-checkbox >
35
+ < ui5-checkbox text ="Success disabled " disabled value-state ="Success " checked > </ ui5-checkbox >
33
36
< ui5-checkbox text ="Error disabled " disabled value-state ="Error " checked > </ ui5-checkbox >
34
37
< ui5-checkbox text ="Warning disabled " disabled value-state ="Warning " checked > </ ui5-checkbox >
38
+ < ui5-checkbox text ="Information disabled " disabled value-state ="Information " checked > </ ui5-checkbox >
39
+ < ui5-checkbox text ="Success readonly " readonly value-state ="Success " checked > </ ui5-checkbox >
35
40
< ui5-checkbox text ="Error readonly " readonly value-state ="Error " checked > </ ui5-checkbox >
36
41
< ui5-checkbox text ="Warning readonly " readonly value-state ="Warning " checked > </ ui5-checkbox >
42
+ < ui5-checkbox text ="Information readonly " readonly value-state ="Information " checked > </ ui5-checkbox >
43
+ < ui5-checkbox text ="Success indeterminate " value-state ="Success " indeterminate checked > </ ui5-checkbox >
44
+ < ui5-checkbox text ="Error indeterminate " value-state ="Error " indeterminate checked > </ ui5-checkbox >
45
+ < ui5-checkbox text ="Warning indeterminate " value-state ="Warning " indeterminate checked > </ ui5-checkbox >
46
+ < ui5-checkbox text ="Information indeterminate " value-state ="Information " indeterminate checked > </ ui5-checkbox >
37
47
</ div >
38
48
< pre class ="prettyprint lang-html "> < xmp >
49
+ < ui5-checkbox text ="Success " value-state ="Success "> </ ui5-checkbox >
39
50
< ui5-checkbox text ="Error " value-state ="Error "> </ ui5-checkbox >
40
51
< ui5-checkbox text ="Warning " value-state ="Warning "> </ ui5-checkbox >
52
+ < ui5-checkbox text ="Information " value-state ="Information "> </ ui5-checkbox >
41
53
< ui5-checkbox text ="Disabled " disabled checked > </ ui5-checkbox >
42
54
< ui5-checkbox text ="Readonly " readonly checked > </ ui5-checkbox >
55
+ < ui5-checkbox text ="Success disabled " disabled value-state ="Success " checked > </ ui5-checkbox >
43
56
< ui5-checkbox text ="Error disabled " disabled value-state ="Error " checked > </ ui5-checkbox >
44
57
< ui5-checkbox text ="Warning disabled " disabled value-state ="Warning " checked > </ ui5-checkbox >
58
+ < ui5-checkbox text ="Information disabled " disabled value-state ="Information " checked > </ ui5-checkbox >
59
+ < ui5-checkbox text ="Success readonly " readonly value-state ="Success " checked > </ ui5-checkbox >
45
60
< ui5-checkbox text ="Error readonly " readonly value-state ="Error " checked > </ ui5-checkbox >
46
61
< ui5-checkbox text ="Warning readonly " readonly value-state ="Warning " checked > </ ui5-checkbox >
62
+ < ui5-checkbox text ="Information readonly " readonly value-state ="Information " checked > </ ui5-checkbox >
63
+ < ui5-checkbox text ="Success indeterminate " value-state ="Success " indeterminate checked > </ ui5-checkbox >
64
+ < ui5-checkbox text ="Error indeterminate " value-state ="Error " indeterminate checked > </ ui5-checkbox >
65
+ < ui5-checkbox text ="Warning indeterminate " value-state ="Warning " indeterminate checked > </ ui5-checkbox >
66
+ < ui5-checkbox text ="Information indeterminate " value-state ="Information " indeterminate checked > </ ui5-checkbox >
47
67
</ xmp > </ pre >
48
68
</ section >
49
69
@@ -59,4 +79,64 @@ <h3>CheckBox with Text Wrapping</h3>
59
79
</ xmp > </ pre >
60
80
</ section >
61
81
82
+ < section >
83
+ < h3 > CheckBox with indeterminate</ h3 >
84
+ < div class ="snippet ">
85
+ < ui5-checkbox id ="result-cb " text ="Select / deselect all " indeterminate checked > </ ui5-checkbox >
86
+ < hr />
87
+ < div style ="display: flex; flex-direction: column; align-items: flex-start; ">
88
+ < ui5-checkbox id ="cb1 " text ="English " checked > </ ui5-checkbox >
89
+ < ui5-checkbox id ="cb2 " text ="German "> </ ui5-checkbox >
90
+ < ui5-checkbox id ="cb3 " text ="French "> </ ui5-checkbox >
91
+ </ div >
92
+ < script >
93
+ var resultCb = document . querySelector ( "#result-cb" ) ;
94
+ var langCbs = Array . from ( document . querySelectorAll ( "[id^=cb]" ) ) ;
95
+
96
+ langCbs . forEach ( cbEl => {
97
+ cbEl . addEventListener ( "ui5-change" , event => {
98
+ const hasChecked = langCbs . some ( cb => cb . checked ) ;
99
+ const hasUnchecked = langCbs . some ( cb => ! cb . checked ) ;
100
+
101
+ resultCb . indeterminate = hasChecked && hasUnchecked ;
102
+ resultCb . checked = hasChecked ;
103
+ } ) ;
104
+ } ) ;
105
+
106
+ resultCb . addEventListener ( "ui5-change" , event => {
107
+ langCbs . forEach ( cb => cb . checked = event . target . checked ) ;
108
+ } ) ;
109
+ </ script >
110
+ </ div >
111
+ < pre class ="prettyprint lang-html "> < xmp >
112
+ < ui5-checkbox id ="result-cb " text ="Select / deselect all " indeterminate checked > </ ui5-checkbox >
113
+ < hr />
114
+ < div style ="display: flex; flex-direction: column; align-items: flex-start; ">
115
+ < ui5-checkbox id ="cb1 " text ="English " checked > </ ui5-checkbox >
116
+ < ui5-checkbox id ="cb2 " text ="German "> </ ui5-checkbox >
117
+ < ui5-checkbox id ="cb3 " text ="French "> </ ui5-checkbox >
118
+ </ div >
119
+ < script >
120
+ var resultCb = document . querySelector ( "#result-cb" ) ;
121
+ var langCbs = Array . from ( document . querySelectorAll ( "[id^=cb]" ) ) ;
122
+
123
+ langCbs . forEach ( function ( cbEl ) {
124
+ cbEl . addEventListener ( "ui5-change" , function ( event ) {
125
+ const hasChecked = langCbs . some ( function ( cb ) { return cb . checked } ) ;
126
+ const hasUnchecked = langCbs . some ( function ( cb ) { return ! cb . checked } ) ;
127
+
128
+ resultCb . indeterminate = hasChecked && hasUnchecked ;
129
+ resultCb . checked = hasChecked ;
130
+ } ) ;
131
+ } ) ;
132
+
133
+ resultCb . addEventListener ( "ui5-change" , function ( event ) {
134
+ langCbs . forEach ( function ( cb ) {
135
+ cb . checked = event . target . checked ;
136
+ } ) ;
137
+ } ) ;
138
+ </ script >
139
+ </ xmp > </ pre >
140
+ </ section >
141
+
62
142
<!-- JSDoc marker -->
0 commit comments