Skip to content

Commit

Permalink
docs(README): outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphaël Balet committed Apr 23, 2024
1 parent 80629ef commit 2079ed6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ If you want to show the sample number for the country selected or errors , use m
</form>
```

## Options
## Inputs

| Options | Type | Default | Description |
| ------------------ | ---------- | ------------ | ----------------------------------------------------------------------------------- |
Expand All @@ -108,6 +108,12 @@ If you want to show the sample number for the country selected or errors , use m
| resetOnChange | `boolean` | `false` | Reset input on country change |
| searchPlaceholder | `string` | `Search ...` | Placeholder for the search input |


## Outputs
| Options | Type | Default | Description |
| -------------- | ----------------------- | ----------- | ----------------- |
| countryChanged | `EventEmitter<Country>` | `undefined` | On country change |

## Css variable
| Name | Default | Explanation |
| ------------------------------- | -------------- | --------------------------------------------------- |
Expand Down
3 changes: 1 addition & 2 deletions projects/ngx-mat-input-tel-tester/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ <h3 id="phoneInput">Test International Telephone Input Form</h3>
[preferredCountries]="['us', 'ca']"
enablePlaceholder
enableSearch
required
[formControl]="phoneForm.controls.phone"
placeholder="Enter Number"
describedBy="phoneInput"
required
#phone
></ngx-mat-input-tel>
<mat-hint>e.g. {{ phone.selectedCountry.placeHolder }}</mat-hint>
Expand Down Expand Up @@ -67,7 +67,6 @@ <h2>Required & PlaceHolder</h2>
placeholder="Enter Number"
enablePlaceholder
enableSearch
required
#phone1
></ngx-mat-input-tel>
<mat-label>Phone</mat-label>
Expand Down
8 changes: 7 additions & 1 deletion projects/ngx-mat-input-tel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ If you want to show the sample number for the country selected or errors , use m
</form>
```

## Options
## Inputs

| Options | Type | Default | Description |
| ------------------ | ---------- | ------------ | ----------------------------------------------------------------------------------- |
Expand All @@ -108,6 +108,12 @@ If you want to show the sample number for the country selected or errors , use m
| resetOnChange | `boolean` | `false` | Reset input on country change |
| searchPlaceholder | `string` | `Search ...` | Placeholder for the search input |


## Outputs
| Options | Type | Default | Description |
| -------------- | ----------------------- | ----------- | ----------------- |
| countryChanged | `EventEmitter<Country>` | `undefined` | On country change |

## Css variable
| Name | Default | Explanation |
| ------------------------------- | -------------- | --------------------------------------------------- |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ export class NgxMatInputTelComponent
return this._format
}

private _placeholder?: string
@Input()
set placeholder(value: string) {
this._placeholder = value
Expand All @@ -145,6 +146,7 @@ export class NgxMatInputTelComponent
return this._placeholder || ''
}

private _required = false
@Input({ transform: booleanAttribute })
set required(value: boolean) {
this._required = coerceBooleanProperty(value)
Expand All @@ -154,6 +156,7 @@ export class NgxMatInputTelComponent
return this._required
}

private _disabled = false
@Input({ alias: 'disabled', transform: booleanAttribute })
set disabled(value: boolean) {
this._disabled = coerceBooleanProperty(value)
Expand All @@ -170,9 +173,6 @@ export class NgxMatInputTelComponent
@Output()
countryChanged: EventEmitter<Country> = new EventEmitter<Country>()

private _placeholder?: string
private _required = false
private _disabled = false
stateChanges = new Subject<void>()
focused = false
describedBy = ''
Expand Down

0 comments on commit 2079ed6

Please sign in to comment.