UNPKG

carbon-components-angular

Version:
1,171 lines (1,028 loc) 58.5 kB
<!doctype html> <html class="no-js" lang=""> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <title>carbon-components-angular documentation</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="icon" type="image/x-icon" href="../images/favicon.ico"> <link rel="stylesheet" href="../styles/style.css"> <link rel="stylesheet" href="../styles/dark.css"> </head> <body> <div class="navbar navbar-default navbar-fixed-top d-block d-sm-none"> <a href="../" class="navbar-brand">carbon-components-angular documentation</a> <button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button> </div> <div class="xs-menu menu" id="mobile-menu"> <div id="book-search-input" role="search"><input type="text" placeholder="Type to search"></div> <compodoc-menu></compodoc-menu> </div> <div class="container-fluid main"> <div class="row main"> <div class="hidden-xs menu"> <compodoc-menu mode="normal"></compodoc-menu> </div> <!-- START CONTENT --> <div class="content component"> <div class="content-data"> <ol class="breadcrumb"> <li class="breadcrumb-item">Components</li> <li class="breadcrumb-item" > SelectionTile</li> </ol> <ul class="nav nav-tabs" role="tablist"> <li class="nav-item"> <a href="#info" class="nav-link active" role="tab" id="info-tab" data-bs-toggle="tab" data-link="info">Info</a> </li> <li class="nav-item"> <a href="#source" class="nav-link" role="tab" id="source-tab" data-bs-toggle="tab" data-link="source">Source</a> </li> <li class="nav-item"> <a href="#tree" class="nav-link" role="tab" id="tree-tab" data-bs-toggle="tab" data-link="dom-tree">DOM Tree</a> </li> </ul> <div class="tab-content"> <div class="tab-pane fade active in" id="info"><p class="comment"> <h3>File</h3> </p> <p class="comment"> <code>src/tiles/selection-tile.component.ts</code> </p> <p class="comment"> <h3>Implements</h3> </p> <p class="comment"> <code>AfterViewInit</code> </p> <section data-compodoc="block-metadata"> <h3>Metadata</h3> <table class="table table-sm table-hover metadata"> <tbody> <tr> <td class="col-md-3">selector</td> <td class="col-md-9"><code>cds-selection-tile, ibm-selection-tile</code></td> </tr> <tr> <td class="col-md-3">template</td> <td class="col-md-9"><pre class="line-numbers"><code class="language-html">&lt;input #input [attr.tabindex]&#x3D;&quot;disabled ? null : 0&quot; class&#x3D;&quot;cds--tile-input&quot; [id]&#x3D;&quot;id&quot; [disabled]&#x3D;&quot;disabled&quot; [type]&#x3D;&quot;(multiple ? &#x27;checkbox&#x27;: &#x27;radio&#x27;)&quot; [value]&#x3D;&quot;value&quot; [name]&#x3D;&quot;name&quot; (change)&#x3D;&quot;onChange($event)&quot;/&gt; &lt;label class&#x3D;&quot;cds--tile cds--tile--selectable&quot; [for]&#x3D;&quot;id&quot; [ngClass]&#x3D;&quot;{ &#x27;cds--tile--is-selected&#x27; : selected, &#x27;cds--tile--light&#x27;: theme &#x3D;&#x3D;&#x3D; &#x27;light&#x27;, &#x27;cds--tile--disabled&#x27; : disabled }&quot; [attr.aria-label]&#x3D;&quot;i18n.get(&#x27;TILES.TILE&#x27;) | async&quot;&gt; &lt;div class&#x3D;&quot;cds--tile__checkmark&quot;&gt; &lt;svg width&#x3D;&quot;16&quot; height&#x3D;&quot;16&quot; viewBox&#x3D;&quot;0 0 16 16&quot;&gt; &lt;path d&#x3D;&quot;M8 16A8 8 0 1 1 8 0a8 8 0 0 1 0 16zm3.646-10.854L6.75 10.043 4.354 7.646l-.708.708 3.104 3.103 5.604-5.603-.708-.708z&quot; fill-rule&#x3D;&quot;evenodd&quot;/&gt; &lt;/svg&gt; &lt;/div&gt; &lt;div class&#x3D;&quot;cds--tile-content&quot;&gt; &lt;ng-content&gt;&lt;/ng-content&gt; &lt;/div&gt; &lt;/label&gt; </code></pre></td> </tr> </tbody> </table> </section> <section data-compodoc="block-index"> <h3 id="index">Index</h3> <table class="table table-sm table-bordered index-table"> <tbody> <tr> <td class="col-md-4"> <h6><b>Properties</b></h6> </td> </tr> <tr> <td class="col-md-4"> <ul class="index-list"> <li> <span class="modifier">Protected</span> <a href="#_selected" >_selected</a> </li> <li> <span class="modifier">Public</span> <a href="#i18n" >i18n</a> </li> <li> <span class="modifier"></span> <a href="#input" >input</a> </li> <li> <a href="#multiple" >multiple</a> </li> <li> <a href="#name" >name</a> </li> <li> <span class="modifier">Static</span> <a href="#tileCount" >tileCount</a> </li> </ul> </td> </tr> <tr> <td class="col-md-4"> <h6><b>Methods</b></h6> </td> </tr> <tr> <td class="col-md-4"> <ul class="index-list"> <li> <span class="modifier"></span> <a href="#keyboardInput" >keyboardInput</a> </li> <li> <a href="#ngAfterViewInit" >ngAfterViewInit</a> </li> <li> <a href="#onChange" >onChange</a> </li> </ul> </td> </tr> <tr> <td class="col-md-4"> <h6><b>Inputs</b></h6> </td> </tr> <tr> <td class="col-md-4"> <ul class="index-list"> <li> <a href="#disabled" >disabled</a> </li> <li> <a href="#id" >id</a> </li> <li> <a href="#selected" >selected</a> </li> <li> <a href="#theme" class="deprecated-name">theme</a> </li> <li> <a href="#value" >value</a> </li> </ul> </td> </tr> <tr> <td class="col-md-4"> <h6><b>Outputs</b></h6> </td> </tr> <tr> <td class="col-md-4"> <ul class="index-list"> <li> <a href="#change" >change</a> </li> </ul> </td> </tr> <tr> <td class="col-md-4"> <h6><b>HostListeners</b></h6> </td> </tr> <tr> <td class="col-md-4"> <ul class="index-list"> <li> <a href="#keydown" >keydown</a> </li> </ul> </td> </tr> <tr> <td class="col-md-4"> <h6><b>Accessors</b></h6> </td> </tr> <tr> <td class="col-md-4"> <ul class="index-list"> <li> <a href="#selected" >selected</a> </li> </ul> </td> </tr> </tbody> </table> </section> <section data-compodoc="block-constructor"> <h3 id="constructor">Constructor</h3> <table class="table table-sm table-bordered"> <tbody> <tr> <td class="col-md-4"> <code>constructor(i18n: <a href="../injectables/I18n.html" target="_self">I18n</a>)</code> </td> </tr> <tr> <td class="col-md-4"> <div class="io-line">Defined in <a href="" data-line="105" class="link-to-prism">src/tiles/selection-tile.component.ts:105</a></div> </td> </tr> <tr> <td class="col-md-4"> <div> <b>Parameters :</b> <table class="params"> <thead> <tr> <td>Name</td> <td>Type</td> <td>Optional</td> </tr> </thead> <tbody> <tr> <td>i18n</td> <td> <code><a href="../injectables/I18n.html" target="_self" >I18n</a></code> </td> <td> No </td> </tr> </tbody> </table> </div> </td> </tr> </tbody> </table> </section> <section data-compodoc="block-inputs"> <h3 id="inputs">Inputs</h3> <table class="table table-sm table-bordered"> <tbody> <tr> <td class="col-md-4"> <a name="disabled"></a> <b>disabled</b> </td> </tr> <tr> <td class="col-md-4"> <i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean" target="_blank" >boolean</a></code> </td> </tr> <tr> <td class="col-md-4"> <i>Default value : </i><code>false</code> </td> </tr> <tr> <td class="col-md-2" colspan="2"> <div class="io-line">Defined in <a href="" data-line="88" class="link-to-prism">src/tiles/selection-tile.component.ts:88</a></div> </td> </tr> <tr> <td class="col-md-4"> <div class="io-description"><p>Set to <code>true</code> to disable the selection tile.</p> </div> </td> </tr> </tbody> </table> <table class="table table-sm table-bordered"> <tbody> <tr> <td class="col-md-4"> <a name="id"></a> <b>id</b> </td> </tr> <tr> <td class="col-md-4"> <i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> </td> </tr> <tr> <td class="col-md-4"> <i>Default value : </i><code>&#x60;tile-${SelectionTile.tileCount}&#x60;</code> </td> </tr> <tr> <td class="col-md-2" colspan="2"> <div class="io-line">Defined in <a href="" data-line="58" class="link-to-prism">src/tiles/selection-tile.component.ts:58</a></div> </td> </tr> <tr> <td class="col-md-4"> <div class="io-description"><p>The unique id for the input.</p> </div> </td> </tr> </tbody> </table> <table class="table table-sm table-bordered"> <tbody> <tr> <td class="col-md-4"> <a name="selected"></a> <b>selected</b> </td> </tr> <tr> <td class="col-md-4"> <i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean" target="_blank" >boolean</a></code> </td> </tr> <tr> <td class="col-md-2" colspan="2"> <div class="io-line">Defined in <a href="" data-line="64" class="link-to-prism">src/tiles/selection-tile.component.ts:64</a></div> </td> </tr> <tr> <td class="col-md-4"> <div class="io-description"><p>Updating the state of the input to match the state of the parameter passed in. Set to <code>true</code> if this tile should be selected.</p> </div> </td> </tr> </tbody> </table> <table class="table table-sm table-bordered"> <tbody> <tr> <td class="col-md-4"> <a name="theme"></a> <b>theme</b> </td> </tr> <tr> <td class="col-md-4"> <i>Type : </i> <code>&quot;light&quot; | &quot;dark&quot;</code> </td> </tr> <tr> <td class="col-md-4"> <i>Default value : </i><code>&quot;dark&quot;</code> </td> </tr> <tr> <td class="col-md-2" colspan="2"> <div class="io-line">Defined in <a href="" data-line="53" class="link-to-prism">src/tiles/selection-tile.component.ts:53</a></div> </td> </tr> </tbody> </table> <table class="table table-sm table-bordered"> <tbody> <tr> <td class="col-md-4"> <a name="value"></a> <b>value</b> </td> </tr> <tr> <td class="col-md-4"> <i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> </td> </tr> <tr> <td class="col-md-2" colspan="2"> <div class="io-line">Defined in <a href="" data-line="79" class="link-to-prism">src/tiles/selection-tile.component.ts:79</a></div> </td> </tr> <tr> <td class="col-md-4"> <div class="io-description"><p>The value for the tile. Returned via <code>ngModel</code> or <code>selected</code> event on the containing <code>TileGroup</code>.</p> </div> </td> </tr> </tbody> </table> </section> <section data-compodoc="block-outputs"> <h3 id="outputs">Outputs</h3> <table class="table table-sm table-bordered"> <tbody> <tr> <td class="col-md-4"> <a name="change"></a> <b>change</b> </td> </tr> <tr> <td class="col-md-4"> <i>Type : </i> <code>EventEmitter&lt;Event&gt;</code> </td> </tr> <tr> <td class="col-md-2" colspan="2"> <div class="io-line">Defined in <a href="" data-line="83" class="link-to-prism">src/tiles/selection-tile.component.ts:83</a></div> </td> </tr> <tr> <td class="col-md-4"> <div class="io-description"><p>Internal event used to notify the containing <code>TileGroup</code> of changes.</p> </div> </td> </tr> </tbody> </table> </section> <section data-compodoc="block-methods"> <h3>HostListeners</h3> <table class="table table-sm table-bordered"> <tbody> <tr> <td class="col-md-4"> <a name="keydown"></a> <span class="name"> <span ><b>keydown</b></span> <a href="#keydown"><span class="icon ion-ios-link"></span></a> </span> </td> </tr> <tr> <td class="col-md-4"> <i>Arguments : </i><code>'$event' </code> </td> </tr> <tr> <td class="col-md-4"> <code>keydown(event)</code> </td> </tr> <tr> <td class="col-md-4"> <div class="io-line">Defined in <a href="" data-line="120" class="link-to-prism">src/tiles/selection-tile.component.ts:120</a></div> </td> </tr> </tbody> </table> </section> <section data-compodoc="block-methods"> <h3 id="methods"> Methods </h3> <table class="table table-sm table-bordered"> <tbody> <tr> <td class="col-md-4"> <a name="keyboardInput"></a> <span class="name"> <span class="modifier"></span> <span ><b>keyboardInput</b></span> <a href="#keyboardInput"><span class="icon ion-ios-link"></span></a> </span> </td> </tr> <tr> <td class="col-md-4"> <span class="modifier-icon icon ion-ios-reset"></span> <code>keyboardInput(event)</code> </td> </tr> <tr> <td class="col-md-4"> <b>Decorators : </b> <br /> <code>@HostListener(&#x27;keydown&#x27;, [&#x27;$event&#x27;])<br /></code> </td> </tr> <tr> <td class="col-md-4"> <div class="io-line">Defined in <a href="" data-line="120" class="link-to-prism">src/tiles/selection-tile.component.ts:120</a></div> </td> </tr> <tr> <td class="col-md-4"> <div class="io-description"> <b>Parameters :</b> <table class="params"> <thead> <tr> <td>Name</td> <td>Optional</td> </tr> </thead> <tbody> <tr> <td>event</td> <td> No </td> </tr> </tbody> </table> </div> <div> </div> <div class="io-description"> <b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code> </div> <div class="io-description"> </div> </td> </tr> </tbody> </table> <table class="table table-sm table-bordered"> <tbody> <tr> <td class="col-md-4"> <a name="ngAfterViewInit"></a> <span class="name"> <span ><b>ngAfterViewInit</b></span> <a href="#ngAfterViewInit"><span class="icon ion-ios-link"></span></a> </span> </td> </tr> <tr> <td class="col-md-4"> <code>ngAfterViewInit()</code> </td> </tr> <tr> <td class="col-md-4"> <div class="io-line">Defined in <a href="" data-line="111" class="link-to-prism">src/tiles/selection-tile.component.ts:111</a></div> </td> </tr> <tr> <td class="col-md-4"> <div class="io-description"> <b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code> </div> </td> </tr> </tbody> </table> <table class="table table-sm table-bordered"> <tbody> <tr> <td class="col-md-4"> <a name="onChange"></a> <span class="name"> <span ><b>onChange</b></span> <a href="#onChange"><span class="icon ion-ios-link"></span></a> </span> </td> </tr> <tr> <td class="col-md-4"> <code>onChange(event)</code> </td> </tr> <tr> <td class="col-md-4"> <div class="io-line">Defined in <a href="" data-line="127" class="link-to-prism">src/tiles/selection-tile.component.ts:127</a></div> </td> </tr> <tr> <td class="col-md-4"> <div class="io-description"> <b>Parameters :</b> <table class="params"> <thead> <tr> <td>Name</td> <td>Optional</td> </tr> </thead> <tbody> <tr> <td>event</td> <td> No </td> </tr> </tbody> </table> </div> <div> </div> <div class="io-description"> <b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code> </div> <div class="io-description"> </div> </td> </tr> </tbody> </table> </section> <section data-compodoc="block-properties"> <h3 id="inputs"> Properties </h3> <table class="table table-sm table-bordered"> <tbody> <tr> <td class="col-md-4"> <a name="_selected"></a> <span class="name"> <span class="modifier">Protected</span> <span ><b>_selected</b></span> <a href="#_selected"><span class="icon ion-ios-link"></span></a> </span> </td> </tr> <tr> <td class="col-md-4"> <i>Type : </i> <code>null</code> </td> </tr> <tr> <td class="col-md-4"> <i>Default value : </i><code>null</code> </td> </tr> <tr> <td class="col-md-4"> <div class="io-line">Defined in <a href="" data-line="105" class="link-to-prism">src/tiles/selection-tile.component.ts:105</a></div> </td> </tr> </tbody> </table> <table class="table table-sm table-bordered"> <tbody> <tr> <td class="col-md-4"> <a name="i18n"></a> <span class="name"> <span class="modifier">Public</span> <span ><b>i18n</b></span> <a href="#i18n"><span class="icon ion-ios-link"></span></a> </span> </td> </tr> <tr> <td class="col-md-4"> <i>Type : </i> <code><a href="../injectables/I18n.html" target="_self" >I18n</a></code> </td> </tr> <tr> <td class="col-md-4"> <div class="io-line">Defined in <a href="" data-line="107" class="link-to-prism">src/tiles/selection-tile.component.ts:107</a></div> </td> </tr> </tbody> </table> <table class="table table-sm table-bordered"> <tbody> <tr> <td class="col-md-4"> <a name="input"></a> <span class="name"> <span class="modifier"></span> <span ><b>input</b></span> <a href="#input"><span class="icon ion-ios-link"></span></a> </span> </td> </tr> <tr> <td class="col-md-4"> <b>Decorators : </b> <br /> <code> @ViewChild(&#x27;input&#x27;, {static: true})<br /> </code> </td> </tr> <tr> <td class="col-md-4"> <div class="io-line">Defined in <a href="" data-line="101" class="link-to-prism">src/tiles/selection-tile.component.ts:101</a></div> </td> </tr> </tbody> </table> <table class="table table-sm table-bordered"> <tbody> <tr> <td class="col-md-4"> <a name="multiple"></a> <span class="name"> <span ><b>multiple</b></span> <a href="#multiple"><span class="icon ion-ios-link"></span></a> </span> </td> </tr> <tr> <td class="col-md-4"> <i>Default value : </i><code>true</code> </td> </tr> <tr> <td class="col-md-4"> <div class="io-line">Defined in <a href="" data-line="98" class="link-to-prism">src/tiles/selection-tile.component.ts:98</a></div> </td> </tr> <tr> <td class="col-md-4"> <div class="io-description"><p>Defines whether or not the <code>SelectionTile</code> supports selecting multiple tiles as opposed to single tile selection.</p> </div> </td> </tr> </tbody> </table> <table class="table table-sm table-bordered"> <tbody> <tr> <td class="col-md-4"> <a name="name"></a> <span class="name"> <span ><b>name</b></span> <a href="#name"><span class="icon ion-ios-link"></span></a> </span> </td> </tr> <tr> <td class="col-md-4"> <i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code> </td> </tr> <tr> <td class="col-md-4"> <i>Default value : </i><code>&quot;tile-group-unbound&quot;</code> </td> </tr> <tr> <td class="col-md-4"> <div class="io-line">Defined in <a href="" data-line="93" class="link-to-prism">src/tiles/selection-tile.component.ts:93</a></div> </td> </tr> <tr> <td class="col-md-4"> <div class="io-description"><p>Set by the containing <code>TileGroup</code>. Used for the <code>name</code> property on the input.</p> </div> </td> </tr> </tbody> </table> <table class="table table-sm table-bordered"> <tbody> <tr> <td class="col-md-4"> <a name="tileCount"></a> <span class="name"> <span class="modifier">Static</span> <span ><b>tileCount</b></span> <a href="#tileCount"><span class="icon ion-ios-link"></span></a> </span> </td> </tr> <tr> <td class="col-md-4"> <i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank" >number</a></code> </td> </tr> <tr> <td class="col-md-4"> <i>Default value : </i><code>0</code> </td> </tr> <tr> <td class="col-md-4"> <div class="io-line">Defined in <a href="" data-line="47" class="link-to-prism">src/tiles/selection-tile.component.ts:47</a></div> </td> </tr> </tbody> </table> </section> <section data-compodoc="block-accessors"> <h3 id="accessors"> Accessors </h3> <table class="table table-sm table-bordered"> <tbody> <tr> <td class="col-md-4"> <a name="selected"></a> <span class="name"><b>selected</b><a href="#selected"><span class="icon ion-ios-link"></span></a></span> </td> </tr> <tr> <td class="col-md-4"> <span class="accessor"><b>get</b><code>selected()</code></span> </td> </tr> <tr> <td class="col-md-4"> <div class="io-line">Defined in <a href="" data-line="73" class="link-to-prism">src/tiles/selection-tile.component.ts:73</a></div> </td> </tr> <tr> <td class="col-md-4"> <span class="accessor"><b>set</b><code>selected(value: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean" target="_blank">boolean</a>)</code></span> </td> </tr> <tr> <td class="col-md-4"> <div class="io-line">Defined in <a href="" data-line="64" class="link-to-prism">src/tiles/selection-tile.component.ts:64</a></div> </td> </tr> <tr> <td class="col-md-4"> <div class="io-description"><p>Updating the state of the input to match the state of the parameter passed in. Set to <code>true</code> if this tile should be selected.</p> </div> <div class="io-description"> <b>Parameters :</b> <table class="params"> <thead> <tr> <td>Name</td> <td>Type</td> <td>Optional</td> </tr> </thead> <tbody> <tr> <td>value</td> <td> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean" target="_blank" >boolean</a></code> </td> <td> No </td> </tr> </tbody> </table> </div> <div> </div> <div class="io-description"> <b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code> </div> </td> </tr> </tbody> </table> </section> </div> <div class="tab-pane fade tab-source-code" id="source"> <pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { Component, Input, Output, EventEmitter, ViewChild, HostListener, AfterViewInit } from &quot;@angular/core&quot;; import { I18n } from &quot;carbon-components-angular/i18n&quot;; @Component({ selector: &quot;cds-selection-tile, ibm-selection-tile&quot;, template: &#x60; &lt;input #input [attr.tabindex]&#x3D;&quot;disabled ? null : 0&quot; class&#x3D;&quot;cds--tile-input&quot; [id]&#x3D;&quot;id&quot; [disabled]&#x3D;&quot;disabled&quot; [type]&#x3D;&quot;(multiple ? &#x27;checkbox&#x27;: &#x27;radio&#x27;)&quot; [value]&#x3D;&quot;value&quot; [name]&#x3D;&quot;name&quot; (change)&#x3D;&quot;onChange($event)&quot;/&gt; &lt;label class&#x3D;&quot;cds--tile cds--tile--selectable&quot; [for]&#x3D;&quot;id&quot; [ngClass]&#x3D;&quot;{ &#x27;cds--tile--is-selected&#x27; : selected, &#x27;cds--tile--light&#x27;: theme &#x3D;&#x3D;&#x3D; &#x27;light&#x27;, &#x27;cds--tile--disabled&#x27; : disabled }&quot; [attr.aria-label]&#x3D;&quot;i18n.get(&#x27;TILES.TILE&#x27;) | async&quot;&gt; &lt;div class&#x3D;&quot;cds--tile__checkmark&quot;&gt; &lt;svg width&#x3D;&quot;16&quot; height&#x3D;&quot;16&quot; viewBox&#x3D;&quot;0 0 16 16&quot;&gt; &lt;path d&#x3D;&quot;M8 16A8 8 0 1 1 8 0a8 8 0 0 1 0 16zm3.646-10.854L6.75 10.043 4.354 7.646l-.708.708 3.104 3.103 5.604-5.603-.708-.708z&quot; fill-rule&#x3D;&quot;evenodd&quot;/&gt; &lt;/svg&gt; &lt;/div&gt; &lt;div class&#x3D;&quot;cds--tile-content&quot;&gt; &lt;ng-content&gt;&lt;/ng-content&gt; &lt;/div&gt; &lt;/label&gt; &#x60; }) export class SelectionTile implements AfterViewInit { static tileCount &#x3D; 0; /** * @deprecated since v5 - Use &#x60;cdsLayer&#x60; directive instead * Set to &#x60;&quot;light&quot;&#x60; to apply the light style */ @Input() theme: &quot;light&quot; | &quot;dark&quot; &#x3D; &quot;dark&quot;; /** * The unique id for the input. */ @Input() id &#x3D; &#x60;tile-${SelectionTile.tileCount}&#x60;; /** * Updating the state of the input to match the state of the parameter passed in. * Set to &#x60;true&#x60; if this tile should be selected. */ @Input() set selected(value: boolean) { // If an initial selected value is set before input exists, we save // the value and check again when input exists in &#x60;AfterViewInit&#x60;. this._selected &#x3D; value ? true : null; if (this.input) { this.input.nativeElement.checked &#x3D; this._selected; } } get selected() { return this.input ? this.input.nativeElement.checked : false; } /** * The value for the tile. Returned via &#x60;ngModel&#x60; or &#x60;selected&#x60; event on the containing &#x60;TileGroup&#x60;. */ @Input() value: string; /** * Internal event used to notify the containing &#x60;TileGroup&#x60; of changes. */ @Output() change: EventEmitter&lt;Event&gt; &#x3D; new EventEmitter(); /** * Set to &#x60;true&#x60; to disable the selection tile. */ @Input() disabled &#x3D; false; /** * Set by the containing &#x60;TileGroup&#x60;. Used for the &#x60;name&#x60; property on the input. */ name &#x3D; &quot;tile-group-unbound&quot;; /** * Defines whether or not the &#x60;SelectionTile&#x60; supports selecting multiple tiles as opposed to single * tile selection. */ multiple &#x3D; true; // Set to true because of the way tile group sets it up. // If it is first undefined then set to true, the type will change from radio to checkbox and deselects the inputs. @ViewChild(&quot;input&quot;, { static: true }) input; // If an initial selected value is set before input exists, we save // the value and check again when input exists in &#x60;AfterViewInit&#x60;. protected _selected &#x3D; null; constructor(public i18n: I18n) { SelectionTile.tileCount++; } ngAfterViewInit() { if (this.input) { setTimeout(() &#x3D;&gt; { this.input.nativeElement.checked &#x3D; this._selected; }); } } @HostListener(&quot;keydown&quot;, [&quot;$event&quot;]) keyboardInput(event) { if (event.key &#x3D;&#x3D;&#x3D; &quot;Enter&quot; || event.key &#x3D;&#x3D;&#x3D; &quot;Spacebar&quot; || event.key &#x3D;&#x3D;&#x3D; &quot; &quot;) { this.selected &#x3D; !this.selected; this.change.emit(event); } } onChange(event) { this.change.emit(event); } } </code></pre> </div> <div class="tab-pane fade " id="tree"> <div id="tree-container"></div> <div class="tree-legend"> <div class="title"> <b>Legend</b> </div> <div> <div class="color htmlelement"></div><span>Html element</span> </div> <div> <div class="color component"></div><span>Component</span> </div> <div> <div class="color directive"></div><span>Html element with directive</span> </div> </div> </div> </div> <script src="../js/libs/vis.min.js"></script> <script src="../js/libs/htmlparser.js"></script> <script src="../js/libs/deep-iterator.js"></script> <script> var COMPONENT_TEMPLATE = '<div><input #input [attr.tabindex]="disabled ? null : 0" class="cds--tile-input" [id]="id" [disabled]="disabled" [type]="(multiple ? \'checkbox\': \'radio\')" [value]="value" [name]="name" (change)="onChange($event)"/><label class="cds--tile cds--tile--selectable" [for]="id" [ngClass]="{ \'cds--tile--is-selected\' : selected, \'cds--tile--light\': theme === \'light\', \'cds--tile--disabled\' : disabled }" [attr.aria-label]="i18n.get(\'TILES.TILE\') | async"> <div class="cds--tile__checkmark"> <svg width="16" height="16" viewBox="0 0 16 16"> <path d="M8 16A8 8 0 1 1 8 0a8 8 0 0 1 0 16zm3.646-10.854L6.75 10.043 4.354 7.646l-.708.708 3.104 3.103 5.604-5.603-.708-.708z" fill-rule="evenodd"/> </svg> </div> <div class="cds--tile-content"> <ng-content></ng-content> </div></label> </div>' var COMPONENTS = [{'name': 'Accordion', 'selector': 'cds-accordion, ibm-accordion'},{'name': 'AccordionItem', 'selector': 'cds-accordion-item, ibm-accordion-item'},{'name': 'ActionableNotification', 'selector': 'cds-actionable-notification, ibm-actionable-notification'},{'name': 'AlertModal', 'selector': 'cds-alert-modal, ibm-alert-modal'},{'name': 'BaseIconButton', 'selector': ''},{'name': 'BaseNotification', 'selector': ''},{'name': 'BaseTabHeader', 'selector': ''},{'name': 'Breadcrumb', 'selector': 'cds-breadcrumb, ibm-breadcrumb'},{'name': 'BreadcrumbItemComponent', 'selector': 'cds-breadcrumb-item, ibm-breadcrumb-item'},{'name': 'ButtonSet', 'selector': 'cds-button-set, ibm-button-set'},{'name': 'Checkbox', 'selector': 'cds-checkbox, ibm-checkbox'},{'name': 'ClickableTile', 'selector': 'cds-clickable-tile, ibm-clickable-tile'},{'name': 'CodeSnippet', 'selector': 'cds-code-snippet, ibm-code-snippet'},{'name': 'ComboBox', 'selector': 'cds-combo-box, ibm-combo-box'},{'name': 'ContainedList', 'selector': 'cds-contained-list, ibm-contained-list'},{'name': 'ContainedListItem', 'selector': 'cds-contained-list-item, ibm-contained-list-item'},{'name': 'ContentSwitcher', 'selector': 'cds-content-switcher, ibm-content-switcher'},{'name': 'ContextMenuComponent', 'selector': 'cds-context-menu, ibm-context-menu'},{'name': 'ContextMenuDividerComponent', 'selector': 'cds-context-menu-divider, ibm-context-menu-divider'},{'name': 'ContextMenuGroupComponent', 'selector': 'cds-context-menu-group, ibm-context-menu-group'},{'name': 'ContextMenuItemComponent', 'selector': 'cds-context-menu-item, ibm-context-menu-item'},{'name': 'DatePicker', 'selector': 'cds-date-picker, ibm-date-picker'},{'name': 'DatePickerInput', 'selector': 'cds-date-picker-input, ibm-date-picker-input'},{'name': 'Dialog', 'selector': 'cds-dialog, ibm-dialog'},{'name': 'Documentation', 'selector': 'cds-documentation'},{'name': 'Dropdown', 'selector': 'cds-dropdown, ibm-dropdown'},{'name': 'DropdownList', 'selector': 'cds-dropdown-list, ibm-dropdown-list'},{'name': 'ExpandableTile', 'selector': 'cds-expandable-tile, ibm-expandable-tile'},{'name': 'FileComponent', 'selector': 'cds-file, ibm-file'},{'name': 'FileUploader', 'selector': 'cds-file-uploader, ibm-file-uploader'},{'name': 'Hamburger', 'selector': 'cds-hamburger, ibm-hamburger'},{'name': 'Header', 'selector': 'cds-header, ibm-header'},{'name': 'HeaderAction', 'selector': 'cds-header-action, ibm-header-action'},{'name': 'HeaderGlobal', 'selector': 'cds-header-global, ibm-header-global'},{'name': 'HeaderItem', 'selector': 'cds-header-item, ibm-header-item'},{'name': 'HeaderMenu', 'selector': 'cds-header-menu, ibm-header-menu'},{'name': 'HeaderNavigation', 'selector': 'cds-header-navigation, ibm-header-navigation'},{'name': 'IconButton', 'selector': 'cds-icon-button, ibm-icon-button'},{'name': 'InlineLoading', 'selector': 'cds-inline-loading, ibm-inline-loading'},{'name': 'Label', 'selector': 'cds-label, ibm-label'},{'name': 'ListColumn', 'selector': 'cds-list-column, ibm-list-column'},{'name': 'ListHeader', 'selector': 'cds-list-header, ibm-list-header'},{'name': 'ListRow', 'selector': 'cds-list-row, ibm-list-row'},{'name': 'Loading', 'selector': 'cds-loading, ibm-loading'},{'name': 'Modal', 'selector': 'cds-modal, ibm-modal'},{'name': 'ModalFooter', 'selector': 'cds-modal-footer, ibm-modal-footer'},{'name': 'ModalHeader', 'selector': 'cds-modal-header, ibm-modal-header'},{'name': 'Notification', 'selector': 'cds-notification, cds-inline-notification, ibm-notification, ibm-inline-notification'},{'name': 'NumberComponent', 'selector': 'cds-number, ibm-number'},{'name': 'OverflowMenu', 'selector': 'cds-overflow-menu, ibm-overflow-menu'},{'name': 'OverflowMenuCustomPane', 'selector': 'cds-overflow-custom-menu-pane, ibm-overflow-custom-menu-pane'},{'name': 'OverflowMenuOption', 'selector': 'cds-overflow-menu-option, ibm-overflow-menu-option'},{'name': 'OverflowMenuPane', 'selector': 'cds-overflow-menu-pane, ibm-overflow-menu-pane'},{'name': 'Overlay', 'selector': 'cds-overlay, ibm-overlay'},{'name': 'Pagination', 'selector': 'cds-pagination, ibm-pagination'},{'name': 'PaginationNav', 'selector': 'cds-pagination-nav, ibm-pagination-navm'},{'name': 'PaginationNavItem', 'selector': 'cds-pagination-nav-item, ibm-pagination-nav-item'},{'name': 'PaginationOverflow', 'selector': 'cds-pagination-overflow, ibm-pagination-overflow'},{'name': 'Panel', 'selector': 'cds-panel, ibm-panel'},{'name': 'PasswordInputLabelComponent', 'selector': 'cds-password-label, ibm-password-label'},{'name': 'Placeholder', 'selector': 'cds-placeholder, ibm-placeholder'},{'name': 'PopoverContent', 'selector': 'cds-popover-content, ibm-popover-content'},{'name': 'ProgressBar', 'selector': 'cds-progress-bar, ibm-progress-bar'},{'name': 'ProgressIndicator', 'selector': 'cds-progress-indicator, ibm-progress-indicator'},{'name': 'Radio', 'selector': 'cds-radio, ibm-radio'},{'name': 'RadioGroup', 'selector': 'cds-radio-group, ibm-radio-group'},{'name': 'Search', 'selector': 'cds-search, ibm-search'},{'name': 'Select', 'selector': 'cds-select, ibm-select'},{'name': 'SelectionTile', 'selector': 'cds-selection-tile, ibm-selection-tile'},{'name': 'SideNav', 'selector': 'cds-sidenav, ibm-sidenav'},{'name': 'SideNavItem', 'selector': 'cds-sidenav-item, ibm-sidenav-item'},{'name': 'SideNavMenu', 'selector': 'cds-sidenav-menu, ibm-sidenav-menu'},{'name': 'SkeletonPlaceholder', 'selector': 'cds-skeleton-placeholder, ibm-skeleton-placeholder'},{'name': 'SkeletonText', 'selector': 'cds-skeleton-text, ibm-skeleton-text'},{'name': 'Slider', 'selector': 'cds-slider, ibm-slider'},{'name': 'StructuredList', 'selector': 'cds-structured-list, ibm-structured-list'},{'name': 'SwitcherList', 'selector': 'cds-switcher-list, ibm-switcher-list'},{'name': 'SwitcherListItem', 'selector': 'cds-switcher-list-item, ibm-switcher-list-item'},{'name': 'Tab', 'selector': 'cds-tab, ibm-tab'},{'name': 'TabHeaderGroup', 'selector': 'cds-tab-header-group, ibm-tab-header-group'},{'name': 'TabHeaders', 'selector': 'cds-tab-headers, ibm-tab-headers'},{'name': 'Table', 'selector': 'cds-table, ibm-table'},{'name': 'TableBody', 'selector': '[cdsTableBody], [ibmTableBody]'},{'name': 'TableCheckbox', 'selector': '[cdsTableCheckbox], [ibmTableCheckbox]'},{'name': 'T