diff --git a/README.md b/README.md index bf353be..efc7a8b 100644 --- a/README.md +++ b/README.md @@ -50,23 +50,26 @@ import { IconPickerModule } from 'ngx-icon-picker'; Available inputs and output : ```typescript -[iconPicker] // The icon to select in the grid. - -[ipWidth] // Use this option to set icon picker dialog width (default: '230px'). -[ipHeight] // Use this option to force icon picker dialog height (default: 'auto'). -[ipMaxHeight] // Use this option to force icon picker dialog max-height (default: '200px'). - -[ipIconPack] // Icon pack (Font Awesome / Font Awesome5 / Font Awesome6 / Material / Prime): 'fa', 'fa5', 'fa6', 'mat', 'pi', 'all' (default: ['bs', 'fa5']). -[ipIconSize] // Set the icon size in the selector (default: '16px') -[ipIconVerticalPadding] // Set the top and bottom padding (default: '6px') -[ipIconHorizontalPadding] // Set the left and right button padding (default: '10px') -[ipKeepSearchFilter] // The search filter keep the value to filter (default: 'false') - -[ipFallbackIcon] // Is used when the icon is undefined (default: 'fas fa-user'). -[ipPosition] // Dialog position: 'right', 'left', 'top', 'bottom' (default: 'right'). -[ipPlaceHolder] // Search input placeholder (default: 'Search icon...'). - -(iconPickerSelect) // On selected icon value. + [iconPicker] // The icon to select in the grid. + + [ipWidth] // Use this option to set icon picker dialog width (default: '230px'). + [ipHeight] // Use this option to force icon picker dialog height (default: 'auto'). + [ipMaxHeight] // Use this option to force icon picker dialog max-height (default: '200px'). + + [ipIconPack] // Icon pack (Font Awesome / Font Awesome5 / Font Awesome6 / Material / Prime): 'fa', 'fa5', 'fa6', 'mat', 'pi', 'all' (default: ['bs', 'fa5']). + [ipIconSize] // Set the icon size in the selector (default: '16px') + [ipIconVerticalPadding] // Set the top and bottom padding (default: '6px') + [ipIconHorizontalPadding] // Set the left and right button padding (default: '10px') + [ipKeepSearchFilter] // The search filter keep the value to filter (default: 'false') + + [ipFallbackIcon] // Is used when the icon is undefined (default: 'fas fa-user'). + [ipPosition] // Dialog position: 'right', 'left', 'top', 'bottom' (default: 'right'). + [ipPlaceHolder] // Search input placeholder (default: 'Search icon...'). + + (iconPickerSelect) // On selected icon value. + (iconPickerOpen) // On open popup + (iconPickerClose) // On close popup + (iconPickerClose) // On focus element ``` To integrate the icon picker with an another framework, you have to use the extra inputs: diff --git a/package.json b/package.json index d54581f..06bbd1b 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "Icon picker widget for Angular (version 16 and newer)", "bugs": "https://github.com/tech-advantage/ngx-icon-picker/issues", "license": "MIT", - "version": "1.11.0", + "version": "1.11.1", "scripts": { "ng": "ng", "lint": "ng lint", diff --git a/projects/app/src/app/app.component.html b/projects/app/src/app/app.component.html index e17a4eb..1258a9d 100644 --- a/projects/app/src/app/app.component.html +++ b/projects/app/src/app/app.component.html @@ -4,7 +4,7 @@

Angular IconPicker Directive/Component with no dependencies required

View on Github

Icons with default Icon Pack

-
Bootstrap Glyphicons and Font Awesome 5
+
Font Awesome 5
@@ -19,14 +19,23 @@

Icons with default Icon Pack

[iconPicker]="iconCssDefault.value" [ipPosition]="'bottom'" [ipWidth]="'250px'" [ipPlaceHolder]="'Choose an icon'" [ipFallbackIcon]="fallbackIconDefault" (iconPickerSelect)="onIconPickerDefaultSelect($event)" + (iconPickerOpen)="onIconPickerOpen()" (iconPickerClose)="onIconPickerClose()" + (iconPickerFocus)="onIconPickerFocus()" /> +
+ +
+
+
+ State : {{stateIconPicker}} / Focus : {{awaitingOpening}}

Usage:

-         Example to integrate the Icon Picker in an application.
+        Example to integrate the Icon Picker in an application.
+        Use the emit events and display a awaiting pending icon.
       
@@ -41,7 +50,8 @@

Font Awesome 6 icons and panel size defined to 500px

- Change size - (true); + @Output() iconPickerOpen = new EventEmitter(true); + @Output() iconPickerClose = new EventEmitter(true); + @Output() iconPickerFocus = new EventEmitter(true); + + @HostListener('focus') handleFocus(): void { + this.elementFocus(); + } private dialog: any; private created: boolean; @@ -86,4 +93,15 @@ export class IconPickerDirective implements OnInit, OnChanges { this.iconPickerSelect.emit(icon); } + public stateChanged(state: boolean): void { + if (state) { + this.iconPickerOpen.emit(); + } else { + this.iconPickerClose.emit(); + } + } + + public elementFocus(): void { + this.iconPickerFocus.emit(); + } }