@@ -29,8 +29,12 @@ import { I18n } from "./../i18n/i18n.module";
2929 selector : "ibm-dropdown" ,
3030 template : `
3131 <div
32- class="bx--list-box"
33- [ngClass]="{'bx--dropdown--light': theme === 'light'}">
32+ class="bx--list-box bx--dropdown-v2"
33+ [ngClass]="{
34+ 'bx--dropdown--light': theme === 'light',
35+ 'bx--list-box--inline': inline,
36+ 'bx--skeleton': skeleton
37+ }">
3438 <button
3539 type="button"
3640 #dropdownButton
@@ -42,7 +46,7 @@ import { I18n } from "./../i18n/i18n.module";
4246 (blur)="onBlur()"
4347 [disabled]="disabled">
4448 <span class="bx--list-box__label">{{getDisplayValue() | async}}</span>
45- <div class="bx--list-box__menu-icon" [ngClass]="{'bx--list-box__menu-icon--open': !menuIsClosed }">
49+ <div *ngIf="!skeleton" class="bx--list-box__menu-icon" [ngClass]="{'bx--list-box__menu-icon--open': !menuIsClosed }">
4650 <svg fill-rule="evenodd" height="5" role="img" viewBox="0 0 10 5" width="10" alt="Open menu" [attr.aria-label]="menuButtonLabel">
4751 <title>{{menuButtonLabel}}</title>
4852 <path d="M0 0l5 4.998L10 0z"></path>
@@ -93,6 +97,14 @@ export class Dropdown implements OnInit, AfterContentInit, OnDestroy {
9397 * Set to `true` to disable the dropdown.
9498 */
9599 @Input ( ) disabled = false ;
100+ /**
101+ * Set to `true` for a loading dropdown.
102+ */
103+ @Input ( ) skeleton = false ;
104+ /**
105+ * Set to `true` for an inline dropdown.
106+ */
107+ @Input ( ) inline = false ;
96108 /**
97109 * Deprecated. Dropdown now defaults to appending inline
98110 * Set to `true` if the `Dropdown` is to be appended to the DOM body.
@@ -198,13 +210,18 @@ export class Dropdown implements OnInit, AfterContentInit, OnDestroy {
198210 * The `type` property specifies whether the `Dropdown` allows single selection or multi selection.
199211 */
200212 ngOnInit ( ) {
201- this . view . type = this . type ;
213+ if ( this . view ) {
214+ this . view . type = this . type ;
215+ }
202216 }
203217
204218 /**
205219 * Initializes classes and subscribes to events for single or multi selection.
206220 */
207221 ngAfterContentInit ( ) {
222+ if ( ! this . view ) {
223+ return ;
224+ }
208225 this . view . type = this . type ;
209226 this . view . size = this . size ;
210227 this . view . select . subscribe ( event => {
@@ -323,6 +340,9 @@ export class Dropdown implements OnInit, AfterContentInit, OnDestroy {
323340 * Returns the display value if there is no selection, otherwise the selection will be returned.
324341 */
325342 getDisplayValue ( ) : Observable < string > {
343+ if ( ! this . view ) {
344+ return ;
345+ }
326346 let selected = this . view . getSelected ( ) ;
327347 if ( selected && ! this . displayValue ) {
328348 if ( this . type === "multi" ) {
0 commit comments