Skip to content

Commit 75532dc

Browse files
authored
Merge pull request #976 from systelab/975-configure-the-side-where-the-icon-appears-in-the-combo
975 - Configure the side where the icon appears in the combo
2 parents 5f675f2 + 857ad8f commit 75532dc

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

projects/systelab-components/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "systelab-components",
3-
"version": "18.0.3",
3+
"version": "18.0.4",
44
"license": "MIT",
55
"keywords": [
66
"Angular",

projects/systelab-components/src/lib/combobox/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,11 @@ In order to use a combobox with a custom input text color you must set the input
150150
represent as a rgb code or hex code the color that must be displayed the text.
151151

152152
## Using a Combo with icons
153-
In order to set an icon at the end of the input text box (similar as favourites), you must use the input property "withIcon" as true
153+
In order to set an icon in the input text box (similar as favourites), you must use the input property "withIcon" as true
154154
and set the property "iconClass" with the icon that you want to show (for example, if we want to show an engine icon: 'icon-gear').
155155
This icon will be displayed with the color of the input text by default, but you can set a different color using the
156-
"iconColor" to change the color of the icon.
156+
"iconColor" to change the color of the icon. If you want to change the side where the icon appears (by default it is
157+
the right side), you will have to set the "iconSide" property to "left".
157158

158159
## Using a Combo with Favourites
159160

projects/systelab-components/src/lib/combobox/abstract-combobox.component.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
<div #dropdowntoogle class="slab-flex-1 d-flex dropdown-toggle slab-dropdown-toogle" id="{{comboId}}"
33
data-toggle="dropdown" (click)="onComboClicked($event)" (keydown.arrowDown)="onComboKeyArrowDown($event)"
44
(keydown.arrowUp)="onComboKeyArrowUp($event)">
5+
<ng-container *ngIf="iconSide === 'left'">
6+
<button *ngIf="withIcon && id" class="slab-combo-button border-right-0 rounded-0 {{iconClass}}"
7+
[style.color]="iconColor" tabindex="-1"></button>
8+
</ng-container>
59
<input *ngIf="!customInputRenderer" #input [readonly]="!allowEditInput" type="text"
610
class="slab-flex-1 slab-combo-label slab-combo-input"
711
[tabindex]="tabindex"
@@ -20,8 +24,10 @@
2024
<button *ngIf="withDeleteOption && id && (id !== defaultIdValue)" type="button" #deleteButton
2125
class="slab-combo-button border-right-0 rounded-0 {{deleteIconClass}}" (click)="deleteValueSelected($event)"
2226
tabindex="-1"></button>
23-
<button *ngIf="withIcon && id" class="slab-combo-button border-right-0 rounded-0 {{iconClass}}"
24-
[style.color]="iconColor" tabindex="-1"></button>
27+
<ng-container *ngIf="iconSide === 'right'">
28+
<button *ngIf="withIcon && id" class="slab-combo-button border-right-0 rounded-0 {{iconClass}}"
29+
[style.color]="iconColor" tabindex="-1"></button>
30+
</ng-container>
2531
<button type="button" *ngIf="withFavourites && id!==null && (!isTree || (isTree && level))" #favouriteButton
2632
class="slab-combo-button slab-combo-star border-right-0 rounded-0 text-primary"
2733
[ngClass]="{'icon-star': isFavourite, 'icon-star-o': !isFavourite }" (click)="doToggleFavourite($event)"

projects/systelab-components/src/lib/combobox/abstract-combobox.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export abstract class AbstractComboBox<T> implements AgRendererComponent, OnInit
4242
@Input() public tabindex: number;
4343
@Input() public deleteIconClass = 'icon-close';
4444
@Input() public withEmptyValue: boolean;
45+
@Input() public iconSide = 'right';
4546

4647
public getAllFieldIDValue(): string | number {
4748
return '0';

0 commit comments

Comments
 (0)