@@ -13,6 +13,7 @@ import {
1313
1414import { TextArea } from "./text-area.directive" ;
1515import { TextInput } from "./input.directive" ;
16+ import { PasswordInput } from "./password.directive" ;
1617
1718/**
1819 * Get started with importing the module:
@@ -74,6 +75,22 @@ import { TextInput } from "./input.directive";
7475 [textInputTemplate]="inputContentTemplate">
7576 </cds-text-label>
7677 </ng-container>
78+ <ng-container *ngSwitchCase="'PasswordInput'">
79+ <cds-password-label
80+ [labelInputID]="labelInputID"
81+ [disabled]="disabled"
82+ [skeleton]="skeleton"
83+ [helperText]="helperText"
84+ [invalid]="invalid"
85+ [invalidText]="invalidText"
86+ [warn]="warn"
87+ [warnText]="warnText"
88+ [ariaLabel]="ariaLabel"
89+ [labelTemplate]="labelContentTemplate"
90+ [passwordInputTemplate]="inputContentTemplate"
91+ >
92+ </cds-password-label>
93+ </ng-container>
7794 <ng-container *ngSwitchDefault>
7895 <ng-template [ngTemplateOutlet]="default"></ng-template>
7996 </ng-container>
@@ -102,13 +119,13 @@ import { TextInput } from "./input.directive";
102119 cdsIcon="warning--filled"
103120 size="16"
104121 class="cds--text-input__invalid-icon">
105- </svg>
122+ </svg>
106123 <svg
107124 *ngIf="!invalid && warn"
108125 cdsIcon="warning--alt--filled"
109126 size="16"
110127 class="cds--text-input__invalid-icon cds--text-input__invalid-icon--warning">
111- </svg>
128+ </svg>
112129 <ng-template [ngTemplateOutlet]="inputContentTemplate"></ng-template>
113130 </div>
114131 <div
@@ -137,7 +154,7 @@ export class Label implements AfterContentInit, AfterViewInit {
137154 /**
138155 * The id of the input item associated with the `Label`. This value is also used to associate the `Label` with
139156 * its input counterpart through the 'for' attribute.
140- */
157+ */
141158 @Input ( ) labelInputID = `cds-label-${ Label . labelCounter ++ } ` ;
142159 /**
143160 * Set to `true` for disabled state.
@@ -160,8 +177,8 @@ export class Label implements AfterContentInit, AfterViewInit {
160177 */
161178 @Input ( ) invalid = false ;
162179 /**
163- * Set to `true` to show a warning (contents set by warningText)
164- */
180+ * Set to `true` to show a warning (contents set by warningText)
181+ */
165182 @Input ( ) warn = false ;
166183 /**
167184 * Sets the warning text
@@ -179,11 +196,14 @@ export class Label implements AfterContentInit, AfterViewInit {
179196 // @ts -ignore
180197 @ContentChild ( TextInput , { static : false } ) textInput : TextInput ;
181198
199+ @ContentChild ( PasswordInput , { static : false } )
200+ passwordInput : PasswordInput ;
201+
182202 @HostBinding ( "class.cds--form-item" ) get labelClass ( ) {
183203 return this . type === undefined ;
184204 }
185205
186- type : "TextArea" | "TextInput" ;
206+ type : "TextArea" | "TextInput" | "PasswordInput" ;
187207
188208 /**
189209 * Creates an instance of Label.
@@ -198,6 +218,8 @@ export class Label implements AfterContentInit, AfterViewInit {
198218 this . type = "TextArea" ;
199219 } else if ( this . textInput ) {
200220 this . type = "TextInput" ;
221+ } else if ( this . passwordInput ) {
222+ this . type = "PasswordInput" ;
201223 }
202224 }
203225
0 commit comments