Skip to content

Commit

Permalink
feat: upgrade to Angular 16 (#421)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: requires angular >16
  • Loading branch information
arturovt authored May 9, 2023
1 parent e574b0a commit bbce6c3
Show file tree
Hide file tree
Showing 17 changed files with 2,001 additions and 1,525 deletions.
53 changes: 39 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ This project is a port of [emoji-mart](https://github.com/missive/emoji-mart) by

```sh
npm install @ctrl/ngx-emoji-mart
# Or if you're using yarn
yarn add @ctrl/ngx-emoji-mart
# Or if you're using pnpm
pnpm install @ctrl/ngx-emoji-mart
```

## Dependencies
Expand All @@ -26,34 +30,52 @@ Latest version available for each version of Angular
| 5.1.2 | 10.x 11.x |
| 6.2.0 | 12.x 13.x |
| 7.1.0 | 14.x |
| current | >=15.x |
| 8.2.0 | 15.x |
| current | >=16.x |

## Components

### Picker

Import Module in ngModule
Add `PickerComponent` to your module imports:

```ts
import { PickerModule } from '@ctrl/ngx-emoji-mart';
import { PickerComponent } from '@ctrl/ngx-emoji-mart';

@NgModule({
imports: [PickerComponent],
})
export class AppModule {}

// Or if using standalone components

@Component({
standalone: true,
imports: [PickerComponent],
})
export class AppComponent {}
```

Import styles in styles.scss if using SASS
Import styles in `styles.scss`:

```scss
@import '~@ctrl/ngx-emoji-mart/picker';
@import '@ctrl/ngx-emoji-mart/picker';
```

Or angular-cli can also include it via angular-cli.json
Or bundle those styles through `angular.json` configuration:

```
"styles": [
"styles.scss",
"node_modules/@ctrl/ngx-emoji-mart/picker.css"
]
```json
"build": {
"options": {
"styles": [
"src/styles.scss",
"node_modules/@ctrl/ngx-emoji-mart/picker.css"
]
}
}
```

use component
Now we can use the `emoji-mart` component:

```html
<emoji-mart title="Pick your emoji…" emoji="point_up"></emoji-mart>
Expand Down Expand Up @@ -195,8 +217,10 @@ Sheets are served from [unpkg](https://unpkg.com), a global CDN that serves file

### Emoji

Add `EmojiComponent` to your module or standalone component `imports`:

```ts
import { EmojiModule } from '@ctrl/ngx-emoji-mart/ngx-emoji';
import { EmojiComponent } from '@ctrl/ngx-emoji-mart/ngx-emoji';
```

```html
Expand All @@ -206,7 +230,7 @@ import { EmojiModule } from '@ctrl/ngx-emoji-mart/ngx-emoji';
```

| Prop | Required | Default | Description |
| -------------------------------------------- | :------: | ------------------------- | ------------------------------------------------------------------------------ |
| -------------------------------------------- | :------: | ------------------------- | ---------------------------------------------------------------------------------------------------------------- | --- |
| **emoji** || | Either a string or an `emoji` object |
| **size** || | The emoji width and height. |
| **isNative** | | `false` | Renders the native unicode emoji |
Expand Down Expand Up @@ -276,6 +300,7 @@ The `Picker` doesn’t have to be mounted for you to take advantage of the advan

```ts
import { EmojiSearch } from '@ctrl/ngx-emoji-mart';

class ex {
constructor(private emojiSearch: EmojiSearch) {
this.emojiSearch.search('christmas').map(o => o.native);
Expand Down
Loading

0 comments on commit bbce6c3

Please sign in to comment.