Skip to content

Commit

Permalink
fix: restore symbol for currency and percentage
Browse files Browse the repository at this point in the history
  • Loading branch information
astagi committed Dec 13, 2023
1 parent a7b5a4f commit 5d7682c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
</div>

<ng-container *ngIf="type === 'number'">
<span *ngIf="currency || percentage" class="input-group-text fw-semibold">{{symbol}}</span>
<input type="number"
[id]="id"
[step]="step ?? null"
Expand Down Expand Up @@ -93,9 +94,9 @@
</div>
<it-icon *ngIf="entry.icon" [name]="entry.icon" size="sm"></it-icon>
<span class="autocomplete-list-text">
<span [innerHTML]="entry.value | markMatchingText: autocomplete.searchedValue"></span>
<em *ngIf="entry.label">{{entry.label}}</em>
</span>
<span [innerHTML]="entry.value | markMatchingText: autocomplete.searchedValue"></span>
<em *ngIf="entry.label">{{entry.label}}</em>
</span>
</ng-template>
</li>
</ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ export class ItInputComponent extends ItAbstractFormComponent<string | number |
*/
@Input() percentage: BooleanInput | undefined;

/**
* The currency or percentage symbol [Used only if percentage or currency]
* @example '$'
*/
@Input() symbol: string | undefined;

/**
* To make the numeric field automatically resize according to the value contained in it. [Used only in type = 'number']
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ <h5>Valuta</h5>
<!-- Input numerico con valuta -->
<it-input type="number"
label="Currency"
currency="true"></it-input>
currency="true"
symbol="$"></it-input>


<h5>Percentuale</h5>
Expand All @@ -25,7 +26,8 @@ <h5>Percentuale</h5>
<!-- Input numerico con percentuale -->
<it-input type="number"
label="Percentage"
percentage="true"></it-input>
percentage="true"
symbol="%"></it-input>

<h5>Ridimensionamento</h5>
<p class="mb-5">È possibile far sì che il campo numerico si ridimensioni automaticamente a seconda del valore
Expand Down

0 comments on commit 5d7682c

Please sign in to comment.