-
Notifications
You must be signed in to change notification settings - Fork 291
Added iconField #221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Added iconField #221
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ | |
| <span tabindex="-1" class="dropdown-btn" (click)="toggleDropdown($event)"> | ||
| <span *ngIf="selectedItems.length == 0">{{_placeholder}}</span> | ||
| <span class="selected-item" *ngFor="let item of selectedItems;trackBy: trackByFn;let k = index" [hidden]="k > _settings.itemsShowLimit-1"> | ||
| {{item.text}} | ||
| <i class="{{item.icon}}"></i> {{item.text}} | ||
| <a style="padding-top:2px;padding-left:2px;color:white" (click)="onItemClick($event,item)">x</a> | ||
| </span> | ||
| <span style="float:right !important;padding-right:4px"> | ||
|
|
@@ -25,7 +25,7 @@ | |
| <ul class="item2" [style.maxHeight]="_settings.maxHeight+'px'"> | ||
| <li *ngFor="let item of _data | multiSelectFilter:filter; let i = index;" (click)="onItemClick($event,item)" class="multiselect-item-checkbox"> | ||
| <input type="checkbox" aria-label="multiselect-item" [checked]="isSelected(item)" [disabled]="disabled || (isLimitSelectionReached() && !isSelected(item)) || item.isDisabled" /> | ||
| <div>{{item.text}}</div> | ||
| <div><i class="{{item.icon}}"></i> {{item.text}}</div> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Anything related to icons would need to be tested first. You have modified the code as if 100% of users would consume this property. It would be an optional property. |
||
| </li> | ||
| <li class='no-data' *ngIf="_data.length == 0 && !_settings.allowRemoteDataSearch"> | ||
| <h5>{{_settings.noDataAvailablePlaceholderText}}</h5> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ export interface IDropdownSettings { | |
| singleSelection?: boolean; | ||
| idField?: string; | ||
| textField?: string; | ||
| iconField?: string; | ||
| disabledField?: string; | ||
| enableCheckAll?: boolean; | ||
| selectAllText?: string; | ||
|
|
@@ -22,16 +23,19 @@ export interface IDropdownSettings { | |
| export class ListItem { | ||
| id: String | number; | ||
| text: String | number; | ||
| icon: String; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This would need to be an optional parameter as not everyone would use an icon. |
||
| isDisabled?: boolean; | ||
|
|
||
| public constructor(source: any) { | ||
| if (typeof source === 'string' || typeof source === 'number') { | ||
| this.id = this.text = source; | ||
| this.icon = ''; | ||
| this.isDisabled = false; | ||
| } | ||
| if (typeof source === 'object') { | ||
| this.id = source.id; | ||
| this.text = source.text; | ||
| this.icon = source.icon; | ||
| this.isDisabled = source.isDisabled; | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The existing code should be unbothered. This would need to be refactored to not touch existing code.