File

src/ui/icon-picker/icon-selection-popup/icon-selection-popup.component.ts

Metadata

Index

Properties
Methods
Inputs
Outputs
HostListeners
Accessors

Constructor

constructor(changeDetectorRef: ChangeDetectorRef)
Parameters :
Name Type Optional
changeDetectorRef ChangeDetectorRef No

Inputs

anchor
Type : HTMLElement
selectedIcon
Type : string
Default value : ''

Outputs

iconSelected
Type : EventEmitter<string>

HostListeners

document:click
Arguments : '$event'
document:click(event: Event)
document:keydown
Arguments : '$event'
document:keydown(event: KeyboardEvent)

Methods

closePopup
closePopup()
Returns : void
Public documentClick
documentClick(event: Event)
Decorators :
@HostListener('document:click', ['$event'])
Parameters :
Name Type Optional
event Event No
Returns : void
Public keydown
keydown(event: KeyboardEvent)
Decorators :
@HostListener('document:keydown', ['$event'])
Parameters :
Name Type Optional
event KeyboardEvent No
Returns : void
onIconFilterChange
onIconFilterChange(searchIcon: string)
Parameters :
Name Type Optional
searchIcon string No
Returns : void
onIconSelected
onIconSelected(icon: string)
Parameters :
Name Type Optional
icon string No
Returns : void
populateFAIcons
populateFAIcons()
Returns : void

Properties

allFAIcons
Type : string[]
Default value : []
Readonly defaultPopupWidth
Type : number
Default value : 240
faIcons
Type : string[]
Default value : []
onSearchIconChange
Type : unknown
Default value : _.debounce((value: string) => { this.selectedIcon = value; this.onIconFilterChange(value); }, 200)
Public popup
Type : ElementRef
Decorators :
@ViewChild('popup', {read: ElementRef})
searchIcon
Type : string
Default value : ''

Accessors

popupWidth
getpopupWidth()
<!--
**************************************************************************
* Copyright © 2006-2026 by Consultingwerk Ltd. ("CW") -                  *
* www.consultingwerk.com and other contributors as listed                *
* below. All Rights Reserved.                                            *
*                                                                        *
*  Software is distributed on an "AS IS", WITHOUT WARRANTY OF ANY        *
*   KIND, either express or implied.                                     *
*                                                                        *
*  Contributors:                                                         *
*                                                                        *
**************************************************************************

--------------------------------------------------------------------------
    File        : icon-selection-popup.component.html
    Purpose     : Template for icon selection popup.
    Author(s)   : Oana Sucigan
    Created     : Jun 02, 2025
--------------------------------------------------------------------------
-->
<kendo-popup
	#popup
	class="icon-selection-popup"
	[anchor]="anchor"
	[positionMode]="'absolute'"
	[animate]="false"
>
	<div
		class="content"
		[style.width.px]="popupWidth"
		[style.minWidth.px]="popupWidth"
	>
		<div class="d-flex flex-column">
			<div class="icons-container p-2">
				<div class="icons-filter w-100 py-2">
					<kendo-textbox
						class="w-100"
						[clearButton]="true"
						[placeholder]="'Search icons...'"
						[ngModel]="searchIcon"
						(ngModelChange)="onSearchIconChange($event)"
					></kendo-textbox>
				</div>
				<div class="icons-list">
					@for (icon of faIcons; track icon) {
					<kendo-card
						width="150px"
						height="100px"
						(click)="onIconSelected(icon)"
					>
						<kendo-card-body>
							<i [class]="icon"></i>
						</kendo-card-body>
						<kendo-card-footer>
							<span class="icon-name">{{
								icon.split(' ')[1].split('fa-')[1]
							}}</span>
						</kendo-card-footer>
					</kendo-card>
					}
				</div>
			</div>
		</div>
	</div>
</kendo-popup>

./icon-selection-popup.component.scss

/**********************************************************************
 * Copyright © 2006-2026 by Consultingwerk Ltd. ("CW") -              *
 * www.consultingwerk.com and other contributors as listed            *
 * below. All Rights Reserved.                                        *
 *                                                                    *
 *  Software is distributed on an "AS IS", WITHOUT WARRANTY OF ANY    *
 *   KIND, either express or implied.                                 *
 *                                                                    *
 *  Contributors:                                                     *
 *                                                                    *
 **********************************************************************/
/*------------------------------------------------------------------------
    File        : icon-selection-popup.component.scss
    Purpose     : Styles for icon selection popup.
    Author(s)   : Oana Sucigan
    Created     : Jun 02, 2025
  ----------------------------------------------------------------------*/

.icons-filter {

}

.icons-container {
    display: flex;
    width: 100%;
    max-height: 300px;
    flex-direction: column;
}
.icons-filter {
    flex: 0;
}
.icons-list {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    overflow-y: scroll;
    gap:10px;
    flex: 1;
}

.k-card {
    cursor: pointer;

    .k-card-body {
        text-align: center;

    }
    .k-card-footer {
        text-align: center;

    }

    &:hover {
        background-color: #f0f0f0;
    }   
}

i {
    text-align: center;
    font-size: calc(1em * 2);
    font-weight: 900;
}

span.icon-name {
    text-align: center;
    margin-top: 1em * 1.5;
    padding: 0px;
    font-size: calc(1em * 0.9);
}
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""