@@ -41,6 +41,8 @@ interface WebviewMessageRequest {
41
41
data ?: any ;
42
42
}
43
43
44
+ type InputType = "text" | "number" ;
45
+
44
46
export class Section {
45
47
readonly fields : Field [ ] = [ ] ;
46
48
@@ -61,7 +63,7 @@ export class Section {
61
63
return this ;
62
64
}
63
65
64
- addInput ( id : string , label : string , description ?: string , options ?: { default ?: string , readonly ?: boolean , rows ?: number , minlength ?: number , maxlength ?: number , regexTest ?: string } ) {
66
+ addInput ( id : string , label : string , description ?: string , options ?: { default ?: string , readonly ?: boolean , rows ?: number , minlength ?: number , maxlength ?: number , regexTest ?: string , inputType ?: InputType , min ?: number , max ?: number } ) {
65
67
const input = Object . assign ( new Field ( 'input' , id , label , description ) , options ) ;
66
68
this . addField ( input ) ;
67
69
return this ;
@@ -505,6 +507,9 @@ export class Field {
505
507
public minlength ?: number ;
506
508
public maxlength ?: number ;
507
509
public regexTest ?: string ;
510
+ public inputType ?: InputType ;
511
+ public min ?: number ;
512
+ public max ?: number ;
508
513
509
514
constructor ( readonly type : FieldType , readonly id : string , readonly label : string , readonly description ?: string ) {
510
515
@@ -565,12 +570,16 @@ export class Field {
565
570
${ this . renderLabel ( ) }
566
571
${ this . renderDescription ( ) }
567
572
<${ tag } class="long-input" id="${ this . id } " name="${ this . id } "
573
+ ${ this . inputType ? `type="${ this . inputType } "` : `` }
568
574
${ this . default ? `value="${ this . default } "` : `` }
569
575
${ this . readonly ? `readonly` : `` }
570
576
${ multiline ? `rows="${ this . rows } " resize="vertical"` : '' }
571
577
${ this . minlength ? `minlength="${ this . minlength } "` : `` }
572
- ${ this . maxlength ? `maxlength="${ this . maxlength } "` : `` } >
573
- /${ tag } >
578
+ ${ this . maxlength ? `maxlength="${ this . maxlength } "` : `` }
579
+ ${ this . min ? `min="${ this . min } "` : `` }
580
+ ${ this . max ? `max="${ this . max } "` : `` }
581
+ >
582
+ <${ tag } >
574
583
</vscode-form-group>` ;
575
584
576
585
case `paragraph` :
0 commit comments