@@ -215,7 +215,7 @@ const SF = (function () {
215215 btn . appendChild ( icon ) ;
216216 }
217217
218- if ( config . text && ! config . circle ) {
218+ if ( config . text && ! config . circle && ! config . iconOnly ) {
219219 btn . appendChild ( document . createTextNode ( config . text ) ) ;
220220 }
221221
@@ -229,6 +229,8 @@ const SF = (function () {
229229
230230 if ( config . ariaLabel ) {
231231 btn . setAttribute ( 'aria-label' , config . ariaLabel ) ;
232+ } else if ( config . iconOnly && config . text ) {
233+ btn . setAttribute ( 'aria-label' , config . text ) ;
232234 } else if ( config . icon && ! config . text ) {
233235 btn . setAttribute ( 'aria-label' , config . icon . replace ( / f a - / , '' ) . replace ( / - / g, ' ' ) ) ;
234236 }
@@ -1220,6 +1222,27 @@ const SF = (function () {
12201222 }
12211223 meta . appendChild ( badge ) ;
12221224 }
1225+ var badges = Array . isArray ( config . badges )
1226+ ? config . badges
1227+ : config . badges
1228+ ? [ config . badges ]
1229+ : [ ] ;
1230+ if ( badges . length ) {
1231+ badges . forEach ( function ( entry ) {
1232+ if ( ! entry ) return ;
1233+ if ( typeof entry === 'string' ) {
1234+ meta . appendChild ( sf . el ( 'span' , { className : 'sf-resource-type-badge' } , entry ) ) ;
1235+ return ;
1236+ }
1237+ var extraBadge = sf . el ( 'span' , { className : 'sf-resource-type-badge' } , entry . label || '' ) ;
1238+ if ( entry . style ) {
1239+ extraBadge . style . background = entry . style . bg || '' ;
1240+ extraBadge . style . color = entry . style . color || '' ;
1241+ extraBadge . style . border = entry . style . border || '' ;
1242+ }
1243+ meta . appendChild ( extraBadge ) ;
1244+ } ) ;
1245+ }
12231246 identity . appendChild ( meta ) ;
12241247 }
12251248 resHeader . appendChild ( identity ) ;
@@ -1285,6 +1308,7 @@ const SF = (function () {
12851308 horizon : config . heatmap . horizon || 1 ,
12861309 label : config . heatmap . label ,
12871310 segments : config . heatmap . segments ,
1311+ labelWidth : labelWidth ,
12881312 } ;
12891313 heatmapCfg . railConfig = config ;
12901314 var heatmap = sf . rail . createHeatmap ( heatmapCfg ) ;
@@ -1340,6 +1364,7 @@ const SF = (function () {
13401364 if ( ! config || ! config . segments || ! Array . isArray ( config . segments ) || config . segments . length === 0 ) return null ;
13411365
13421366 var heatmap = sf . el ( 'div' , { className : 'sf-heatmap' } ) ;
1367+ heatmap . style . gridTemplateColumns = ( config . labelWidth || 200 ) + 'px 1fr' ;
13431368 var label = sf . el ( 'div' , { className : 'sf-heatmap-label' } , config . label || '' ) ;
13441369 heatmap . appendChild ( label ) ;
13451370
0 commit comments