@ctrl/ngx-emoji-mart 8.1.0 → 8.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/category.component.d.ts +3 -3
- package/esm2020/category.component.mjs +12 -12
- package/esm2020/ngx-emoji/emoji.component.mjs +29 -24
- package/esm2020/picker.component.mjs +3 -3
- package/esm2020/preview.component.mjs +1 -1
- package/fesm2015/ctrl-ngx-emoji-mart-ngx-emoji.mjs +28 -23
- package/fesm2015/ctrl-ngx-emoji-mart-ngx-emoji.mjs.map +1 -1
- package/fesm2015/ctrl-ngx-emoji-mart.mjs +14 -14
- package/fesm2015/ctrl-ngx-emoji-mart.mjs.map +1 -1
- package/fesm2020/ctrl-ngx-emoji-mart-ngx-emoji.mjs +28 -23
- package/fesm2020/ctrl-ngx-emoji-mart-ngx-emoji.mjs.map +1 -1
- package/fesm2020/ctrl-ngx-emoji-mart.mjs +14 -14
- package/fesm2020/ctrl-ngx-emoji-mart.mjs.map +1 -1
- package/ngx-emoji/emoji.component.d.ts +10 -9
- package/package.json +1 -1
@@ -34051,16 +34051,18 @@ class EmojiComponent {
|
|
34051
34051
|
this.size = 24;
|
34052
34052
|
this.emoji = '';
|
34053
34053
|
this.hideObsolete = false;
|
34054
|
-
this.
|
34054
|
+
this.emojiClick = new EventEmitter();
|
34055
34055
|
/**
|
34056
|
-
* Note: `
|
34057
|
-
* purposes. The `
|
34058
|
-
* about zone context the callback is being called in.
|
34059
|
-
* if anyone is listening to this event explicitly in their code.
|
34056
|
+
* Note: `emojiOver` and `emojiOverOutsideAngular` are dispatched on the same event (`mouseenter`), but
|
34057
|
+
* for different purposes. The `emojiOverOutsideAngular` event is listened only in `emoji-category`
|
34058
|
+
* component and the category component doesn't care about zone context the callback is being called in.
|
34059
|
+
* The `emojiOver` is for backwards compatibility if anyone is listening to this event explicitly in their code.
|
34060
34060
|
*/
|
34061
|
+
this.emojiOver = new EventEmitter();
|
34062
|
+
this.emojiOverOutsideAngular = new EventEmitter();
|
34063
|
+
/** See comments above, this serves the same purpose. */
|
34061
34064
|
this.emojiLeave = new EventEmitter();
|
34062
34065
|
this.emojiLeaveOutsideAngular = new EventEmitter();
|
34063
|
-
this.emojiClick = new EventEmitter();
|
34064
34066
|
this.title = undefined;
|
34065
34067
|
this.label = '';
|
34066
34068
|
this.custom = false;
|
@@ -34075,7 +34077,7 @@ class EmojiComponent {
|
|
34075
34077
|
this.destroy$ = new Subject();
|
34076
34078
|
this.ngZone = inject(NgZone);
|
34077
34079
|
this.emojiService = inject(EmojiService);
|
34078
|
-
this.
|
34080
|
+
this.setupMouseListeners();
|
34079
34081
|
}
|
34080
34082
|
ngOnChanges() {
|
34081
34083
|
if (!this.emoji) {
|
@@ -34161,16 +34163,21 @@ class EmojiComponent {
|
|
34161
34163
|
const emoji = this.getSanitizedData();
|
34162
34164
|
this.emojiClick.emit({ emoji, $event });
|
34163
34165
|
}
|
34164
|
-
|
34165
|
-
const
|
34166
|
-
this.emojiOver.emit({ emoji, $event });
|
34167
|
-
}
|
34168
|
-
setupMouseLeaveListener() {
|
34169
|
-
this.button$
|
34170
|
-
.pipe(
|
34166
|
+
setupMouseListeners() {
|
34167
|
+
const eventListener$ = (eventName) => this.button$.pipe(
|
34171
34168
|
// Note: `EMPTY` is used to remove event listener once the DOM node is removed.
|
34172
|
-
switchMap(button => (button ? fromEvent(button,
|
34173
|
-
|
34169
|
+
switchMap(button => (button ? fromEvent(button, eventName) : EMPTY)), takeUntil(this.destroy$));
|
34170
|
+
eventListener$('mouseenter').subscribe($event => {
|
34171
|
+
const emoji = this.getSanitizedData();
|
34172
|
+
this.emojiOverOutsideAngular.emit({ emoji, $event });
|
34173
|
+
// Note: this is done for backwards compatibility. We run change detection if developers
|
34174
|
+
// are listening to `emojiOver` in their code. For instance:
|
34175
|
+
// `<ngx-emoji (emojiOver)="..."></ngx-emoji>`.
|
34176
|
+
if (this.emojiOver.observed) {
|
34177
|
+
this.ngZone.run(() => this.emojiOver.emit({ emoji, $event }));
|
34178
|
+
}
|
34179
|
+
});
|
34180
|
+
eventListener$('mouseleave').subscribe($event => {
|
34174
34181
|
const emoji = this.getSanitizedData();
|
34175
34182
|
this.emojiLeaveOutsideAngular.emit({ emoji, $event });
|
34176
34183
|
// Note: this is done for backwards compatibility. We run change detection if developers
|
@@ -34183,14 +34190,13 @@ class EmojiComponent {
|
|
34183
34190
|
}
|
34184
34191
|
}
|
34185
34192
|
EmojiComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: EmojiComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
34186
|
-
EmojiComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: EmojiComponent, selector: "ngx-emoji", inputs: { skin: "skin", set: "set", sheetSize: "sheetSize", isNative: "isNative", forceSize: "forceSize", tooltip: "tooltip", size: "size", emoji: "emoji", fallback: "fallback", hideObsolete: "hideObsolete", sheetRows: "sheetRows", sheetColumns: "sheetColumns", useButton: "useButton", backgroundImageFn: "backgroundImageFn", imageUrlFn: "imageUrlFn" }, outputs: { emojiOver: "emojiOver",
|
34193
|
+
EmojiComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: EmojiComponent, selector: "ngx-emoji", inputs: { skin: "skin", set: "set", sheetSize: "sheetSize", isNative: "isNative", forceSize: "forceSize", tooltip: "tooltip", size: "size", emoji: "emoji", fallback: "fallback", hideObsolete: "hideObsolete", sheetRows: "sheetRows", sheetColumns: "sheetColumns", useButton: "useButton", backgroundImageFn: "backgroundImageFn", imageUrlFn: "imageUrlFn" }, outputs: { emojiClick: "emojiClick", emojiOver: "emojiOver", emojiOverOutsideAngular: "emojiOverOutsideAngular", emojiLeave: "emojiLeave", emojiLeaveOutsideAngular: "emojiLeaveOutsideAngular" }, viewQueries: [{ propertyName: "button", first: true, predicate: ["button"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
|
34187
34194
|
<ng-template [ngIf]="isVisible">
|
34188
34195
|
<button
|
34189
34196
|
*ngIf="useButton; else spanTpl"
|
34190
34197
|
#button
|
34191
34198
|
type="button"
|
34192
34199
|
(click)="handleClick($event)"
|
34193
|
-
(mouseenter)="handleOver($event)"
|
34194
34200
|
[attr.title]="title"
|
34195
34201
|
[attr.aria-label]="label"
|
34196
34202
|
class="emoji-mart-emoji"
|
@@ -34208,7 +34214,6 @@ EmojiComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version
|
|
34208
34214
|
<span
|
34209
34215
|
#button
|
34210
34216
|
(click)="handleClick($event)"
|
34211
|
-
(mouseenter)="handleOver($event)"
|
34212
34217
|
[attr.title]="title"
|
34213
34218
|
[attr.aria-label]="label"
|
34214
34219
|
class="emoji-mart-emoji"
|
@@ -34233,7 +34238,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
|
|
34233
34238
|
#button
|
34234
34239
|
type="button"
|
34235
34240
|
(click)="handleClick($event)"
|
34236
|
-
(mouseenter)="handleOver($event)"
|
34237
34241
|
[attr.title]="title"
|
34238
34242
|
[attr.aria-label]="label"
|
34239
34243
|
class="emoji-mart-emoji"
|
@@ -34251,7 +34255,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
|
|
34251
34255
|
<span
|
34252
34256
|
#button
|
34253
34257
|
(click)="handleClick($event)"
|
34254
|
-
(mouseenter)="handleOver($event)"
|
34255
34258
|
[attr.title]="title"
|
34256
34259
|
[attr.aria-label]="label"
|
34257
34260
|
class="emoji-mart-emoji"
|
@@ -34294,14 +34297,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
|
|
34294
34297
|
type: Input
|
34295
34298
|
}], useButton: [{
|
34296
34299
|
type: Input
|
34300
|
+
}], emojiClick: [{
|
34301
|
+
type: Output
|
34297
34302
|
}], emojiOver: [{
|
34298
34303
|
type: Output
|
34304
|
+
}], emojiOverOutsideAngular: [{
|
34305
|
+
type: Output
|
34299
34306
|
}], emojiLeave: [{
|
34300
34307
|
type: Output
|
34301
34308
|
}], emojiLeaveOutsideAngular: [{
|
34302
34309
|
type: Output
|
34303
|
-
}], emojiClick: [{
|
34304
|
-
type: Output
|
34305
34310
|
}], backgroundImageFn: [{
|
34306
34311
|
type: Input
|
34307
34312
|
}], imageUrlFn: [{
|