Socket
Socket
Sign inDemoInstall

ng5-emoji-picker

Package Overview
Dependencies
1
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ng5-emoji-picker

Emoji picker for angular 5


Version published
Weekly downloads
6
Maintainers
1
Install size
1.77 MB
Created
Weekly downloads
 

Readme

Source

npm version

Emoji picker for Angular

This project was forked from the EmojiPanel project created by DanBovey

It's pretty basic right now, not very customizable but propagates necessary emoji selection events and comes with basic search and category selection functionalities.

Demo

Demo uses the sprite sheets

Usage:

import { EmojiPickerModule } from 'angular2-emoji-picker';

@NgModule({
  ...
  imports: [
    EmojiPickerModule.forRoot()
  ],
  ...
})
export class AppModule {}

Use The Sprite Sheet

/** file: app.component.ts */

import { EmojiPickerOptions } from 'angular2-emoji-picker';

/** imported seperately to reduce package size for those who won't use sheets */
import { EmojiPickerAppleSheetLocator } from 'angular2-emoji-picker/sheets';

constructor(private emojiPickerOptions: EmojiPickerOptions) {
  this.emojiPickerOptions.setEmojiSheet({
      url: 'sheet_apple_32.png',
      locator: EmojiPickerAppleSheetLocator
    });
}

include the sheet_apple_32.png file in your build and provide your specific file url

/** .angular-cli.json */

{
  "apps": [
    {
      "assets": [
        { "glob": "sheet_apple_32.png", "input": "../node_modules/angular2-emoji-picker/sheets/", "output": "./" }
      ]
    }
  ]
}

Directive API:

<i
    (click)="toggled = !toggled"
    [(emojiPickerIf)]="toggled"
    [emojiPickerDirection]="'bottom' || 'top' || 'left' || 'right'"
    [emojiPickerPreserveSelection]="true || false"
    [emojiPickerAutofocus]="true || false"
    (emojiPickerSelect)="handleSelection($event)">😄</i>

Emitter (emojiPickerSelect)="handleSelection($event)"

$event = EmojiEvent{ char : "😌", label : "relieved" }

EmojiPickerCaretEmitter

added for your convenience, emits information regarding a contenteditable enabled element

Emitter (emojiPickerCaretEmitter)="handleCaretChange($event)"

$event = CaretEvent{ caretOffset: 13, caretRange: Range{...}, textContent: 'content of div or input' }

Emoji Picker will get placed relative the element chosen via the directive api, centered and within window borders

Keywords

FAQs

Last updated on 29 Sep 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc