22 configureTheme ,
33 defineComponents ,
44 IgcButtonComponent ,
5+ IgcButtonGroupComponent ,
6+ IgcToggleButtonComponent ,
57 IgcAvatarComponent ,
68 IgcCheckboxComponent ,
79 IgcRatingComponent ,
@@ -19,6 +21,8 @@ defineComponents(
1921 IgcSelectComponent ,
2022 IgcSwitchComponent ,
2123 IgcButtonComponent ,
24+ IgcButtonGroupComponent ,
25+ IgcToggleButtonComponent ,
2226) ;
2327
2428type User = {
@@ -83,7 +87,7 @@ function getAvatar() {
8387
8488async function setTheme ( theme ?: string ) {
8589 theme = theme ?? getElement < IgcSelectComponent > ( IgcSelectComponent . tagName ) . value ;
86- const variant = getElement < IgcSwitchComponent > ( IgcSwitchComponent . tagName ) . checked
90+ const variant = getElement < IgcSwitchComponent > ( '#theme-variant' ) . checked
8791 ? 'dark'
8892 : 'light' ;
8993
@@ -110,6 +114,7 @@ const themeChoose = html`
110114 ${ themes . map ( ( theme ) => html `< igc-select-item .value =${ theme } > ${ theme } </ igc-select-item > ` ) }
111115 </ igc-select >
112116 < igc-switch
117+ id ="theme-variant "
113118 label-position ="after "
114119 @igcChange =${ ( ) => setTheme ( ) }
115120 > Dark variant</ igc-switch
@@ -148,7 +153,7 @@ const columns: ColumnConfiguration<User>[] = [
148153 cellTemplate : ( params ) =>
149154 html `< igc-rating
150155 readonly
151- style =" --ig-size: 1 "
156+
152157 .value =${ params . value }
153158 > </ igc-rating > ` ,
154159 } ,
@@ -158,7 +163,6 @@ const columns: ColumnConfiguration<User>[] = [
158163 html `< igc-select
159164 outlined
160165 .value =${ params . value }
161- style ="--ig-size: 1"
162166 > ${ choices . map (
163167 ( choice ) => html `< igc-select-item .value =${ choice } > ${ choice } </ igc-select-item > ` ,
164168 ) } </ igc-select
@@ -224,19 +228,30 @@ const toggleFiltering = () => {
224228 column . filterable = ! column . filterable ;
225229} ;
226230
231+ const setSize = ( size : number ) => {
232+ document . getElementById ( 'demo' ) ! . style . setProperty ( '--ig-size' , String ( size ) ) ;
233+ } ;
234+
227235render (
228236 html `
229- < igc-button
230- variant ="outlined "
231- @click =${ toggleColumn }
232- > Toggle column</ igc-button
233- >
234- < igc-button
235- variant ="outlined "
236- @click =${ toggleFiltering }
237- > Toggle filtering</ igc-button
238- >
239- ${ themeChoose }
237+ < div class ="actions-panel ">
238+ < igc-switch
239+ label-position ="after "
240+ @igcChange =${ toggleColumn }
241+ > Toggle column</ igc-switch
242+ >
243+ < igc-switch
244+ label-position ="after "
245+ @igcChange =${ toggleFiltering }
246+ > Toggle filtering</ igc-switch
247+ >
248+ < igc-button-group >
249+ < igc-toggle-button @click =${ ( ) => setSize ( 1 ) } > Small</ igc-toggle-button >
250+ < igc-toggle-button @click =${ ( ) => setSize ( 2 ) } > Medium</ igc-toggle-button >
251+ < igc-toggle-button selected @click =${ ( ) => setSize ( 3 ) } > Large</ igc-toggle-button >
252+ </ igc-button-group >
253+ ${ themeChoose }
254+ </ div >
240255 < igc-grid-lite .data =${ data } >
241256 ${ columns . map (
242257 ( col ) =>
0 commit comments