@ctrl/ngx-emoji-mart 8.1.0 → 9.0.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.
Files changed (54) hide show
  1. package/README.md +39 -14
  2. package/anchors.component.d.ts +1 -1
  3. package/category.component.d.ts +3 -3
  4. package/esm2022/anchors.component.mjs +100 -0
  5. package/esm2022/category.component.mjs +409 -0
  6. package/esm2022/emoji-frequently.service.mjs +90 -0
  7. package/esm2022/emoji-search.service.mjs +178 -0
  8. package/esm2022/ngx-emoji/emoji.component.mjs +299 -0
  9. package/esm2022/ngx-emoji/emoji.module.mjs +17 -0
  10. package/esm2022/ngx-emoji/emoji.service.mjs +145 -0
  11. package/esm2022/picker.component.mjs +522 -0
  12. package/esm2022/picker.module.mjs +40 -0
  13. package/esm2022/preview.component.mjs +206 -0
  14. package/esm2022/search.component.mjs +175 -0
  15. package/esm2022/skins.component.mjs +107 -0
  16. package/{fesm2020 → fesm2022}/ctrl-ngx-emoji-mart-ngx-emoji.mjs +81 -68
  17. package/{fesm2020 → fesm2022}/ctrl-ngx-emoji-mart-ngx-emoji.mjs.map +1 -1
  18. package/{fesm2020 → fesm2022}/ctrl-ngx-emoji-mart.mjs +327 -261
  19. package/fesm2022/ctrl-ngx-emoji-mart.mjs.map +1 -0
  20. package/ngx-emoji/emoji.component.d.ts +10 -9
  21. package/ngx-emoji/emoji.module.d.ts +1 -2
  22. package/package.json +8 -16
  23. package/picker.component.d.ts +2 -2
  24. package/picker.module.d.ts +1 -4
  25. package/preview.component.d.ts +2 -2
  26. package/search.component.d.ts +1 -1
  27. package/skins.component.d.ts +2 -2
  28. package/esm2020/anchors.component.mjs +0 -83
  29. package/esm2020/category.component.mjs +0 -386
  30. package/esm2020/emoji-frequently.service.mjs +0 -88
  31. package/esm2020/emoji-search.service.mjs +0 -177
  32. package/esm2020/ngx-emoji/emoji.component.mjs +0 -283
  33. package/esm2020/ngx-emoji/emoji.module.mjs +0 -18
  34. package/esm2020/ngx-emoji/emoji.service.mjs +0 -144
  35. package/esm2020/picker.component.mjs +0 -508
  36. package/esm2020/picker.module.mjs +0 -49
  37. package/esm2020/preview.component.mjs +0 -187
  38. package/esm2020/search.component.mjs +0 -165
  39. package/esm2020/skins.component.mjs +0 -108
  40. package/fesm2015/ctrl-ngx-emoji-mart-ngx-emoji.mjs +0 -34325
  41. package/fesm2015/ctrl-ngx-emoji-mart-ngx-emoji.mjs.map +0 -1
  42. package/fesm2015/ctrl-ngx-emoji-mart.mjs +0 -1763
  43. package/fesm2015/ctrl-ngx-emoji-mart.mjs.map +0 -1
  44. package/fesm2020/ctrl-ngx-emoji-mart.mjs.map +0 -1
  45. /package/{esm2020 → esm2022}/ctrl-ngx-emoji-mart.mjs +0 -0
  46. /package/{esm2020 → esm2022}/ngx-emoji/ctrl-ngx-emoji-mart-ngx-emoji.mjs +0 -0
  47. /package/{esm2020 → esm2022}/ngx-emoji/data/categories.mjs +0 -0
  48. /package/{esm2020 → esm2022}/ngx-emoji/data/data.interfaces.mjs +0 -0
  49. /package/{esm2020 → esm2022}/ngx-emoji/data/emojis.mjs +0 -0
  50. /package/{esm2020 → esm2022}/ngx-emoji/data/skins.mjs +0 -0
  51. /package/{esm2020 → esm2022}/ngx-emoji/index.mjs +0 -0
  52. /package/{esm2020 → esm2022}/public_api.mjs +0 -0
  53. /package/{esm2020 → esm2022}/svgs/index.mjs +0 -0
  54. /package/{esm2020 → esm2022}/utils/index.mjs +0 -0
@@ -1,1763 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { EventEmitter, Component, ChangeDetectionStrategy, Input, Output, PLATFORM_ID, Injectable, Inject, ViewChild, ViewChildren, NgModule } from '@angular/core';
3
- import * as i2 from '@angular/common';
4
- import { isPlatformBrowser, CommonModule } from '@angular/common';
5
- import { Subject } from 'rxjs';
6
- import * as i1 from '@ctrl/ngx-emoji-mart/ngx-emoji';
7
- import { categories as categories$1, EmojiModule } from '@ctrl/ngx-emoji-mart/ngx-emoji';
8
- import * as i2$1 from '@angular/forms';
9
- import { FormsModule } from '@angular/forms';
10
-
11
- class AnchorsComponent {
12
- constructor() {
13
- this.categories = [];
14
- this.icons = {};
15
- this.anchorClick = new EventEmitter();
16
- }
17
- trackByFn(idx, cat) {
18
- return cat.id;
19
- }
20
- handleClick($event, index) {
21
- this.anchorClick.emit({
22
- category: this.categories[index],
23
- index,
24
- });
25
- }
26
- }
27
- AnchorsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: AnchorsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
28
- AnchorsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: AnchorsComponent, selector: "emoji-mart-anchors", inputs: { categories: "categories", color: "color", selected: "selected", i18n: "i18n", icons: "icons" }, outputs: { anchorClick: "anchorClick" }, ngImport: i0, template: `
29
- <div class="emoji-mart-anchors">
30
- <ng-template ngFor let-category [ngForOf]="categories" let-idx="index" [ngForTrackBy]="trackByFn">
31
- <span
32
- *ngIf="category.anchor !== false"
33
- [attr.title]="i18n.categories[category.id]"
34
- (click)="this.handleClick($event, idx)"
35
- class="emoji-mart-anchor"
36
- [class.emoji-mart-anchor-selected]="category.name === selected"
37
- [style.color]="category.name === selected ? color : null"
38
- >
39
- <div>
40
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
41
- <path [attr.d]="icons[category.id]" />
42
- </svg>
43
- </div>
44
- <span class="emoji-mart-anchor-bar" [style.background-color]="color"></span>
45
- </span>
46
- </ng-template>
47
- </div>
48
- `, isInline: true, dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
49
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: AnchorsComponent, decorators: [{
50
- type: Component,
51
- args: [{
52
- selector: 'emoji-mart-anchors',
53
- template: `
54
- <div class="emoji-mart-anchors">
55
- <ng-template ngFor let-category [ngForOf]="categories" let-idx="index" [ngForTrackBy]="trackByFn">
56
- <span
57
- *ngIf="category.anchor !== false"
58
- [attr.title]="i18n.categories[category.id]"
59
- (click)="this.handleClick($event, idx)"
60
- class="emoji-mart-anchor"
61
- [class.emoji-mart-anchor-selected]="category.name === selected"
62
- [style.color]="category.name === selected ? color : null"
63
- >
64
- <div>
65
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
66
- <path [attr.d]="icons[category.id]" />
67
- </svg>
68
- </div>
69
- <span class="emoji-mart-anchor-bar" [style.background-color]="color"></span>
70
- </span>
71
- </ng-template>
72
- </div>
73
- `,
74
- changeDetection: ChangeDetectionStrategy.OnPush,
75
- preserveWhitespaces: false,
76
- }]
77
- }], propDecorators: { categories: [{
78
- type: Input
79
- }], color: [{
80
- type: Input
81
- }], selected: [{
82
- type: Input
83
- }], i18n: [{
84
- type: Input
85
- }], icons: [{
86
- type: Input
87
- }], anchorClick: [{
88
- type: Output
89
- }] } });
90
-
91
- class EmojiFrequentlyService {
92
- constructor(platformId) {
93
- this.platformId = platformId;
94
- this.NAMESPACE = 'emoji-mart';
95
- this.frequently = null;
96
- this.defaults = {};
97
- this.initialized = false;
98
- this.DEFAULTS = [
99
- '+1',
100
- 'grinning',
101
- 'kissing_heart',
102
- 'heart_eyes',
103
- 'laughing',
104
- 'stuck_out_tongue_winking_eye',
105
- 'sweat_smile',
106
- 'joy',
107
- 'scream',
108
- 'disappointed',
109
- 'unamused',
110
- 'weary',
111
- 'sob',
112
- 'sunglasses',
113
- 'heart',
114
- 'poop',
115
- ];
116
- }
117
- init() {
118
- this.frequently = JSON.parse((isPlatformBrowser(this.platformId) &&
119
- localStorage.getItem(`${this.NAMESPACE}.frequently`)) ||
120
- 'null');
121
- this.initialized = true;
122
- }
123
- add(emoji) {
124
- if (!this.initialized) {
125
- this.init();
126
- }
127
- if (!this.frequently) {
128
- this.frequently = this.defaults;
129
- }
130
- if (!this.frequently[emoji.id]) {
131
- this.frequently[emoji.id] = 0;
132
- }
133
- this.frequently[emoji.id] += 1;
134
- if (isPlatformBrowser(this.platformId)) {
135
- localStorage.setItem(`${this.NAMESPACE}.last`, emoji.id);
136
- localStorage.setItem(`${this.NAMESPACE}.frequently`, JSON.stringify(this.frequently));
137
- }
138
- }
139
- get(perLine, totalLines) {
140
- if (!this.initialized) {
141
- this.init();
142
- }
143
- if (this.frequently === null) {
144
- this.defaults = {};
145
- const result = [];
146
- for (let i = 0; i < perLine; i++) {
147
- this.defaults[this.DEFAULTS[i]] = perLine - i;
148
- result.push(this.DEFAULTS[i]);
149
- }
150
- return result;
151
- }
152
- const quantity = perLine * totalLines;
153
- const frequentlyKeys = Object.keys(this.frequently);
154
- const sorted = frequentlyKeys
155
- .sort((a, b) => this.frequently[a] - this.frequently[b])
156
- .reverse();
157
- const sliced = sorted.slice(0, quantity);
158
- const last = isPlatformBrowser(this.platformId) && localStorage.getItem(`${this.NAMESPACE}.last`);
159
- if (last && !sliced.includes(last)) {
160
- sliced.pop();
161
- sliced.push(last);
162
- }
163
- return sliced;
164
- }
165
- }
166
- EmojiFrequentlyService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: EmojiFrequentlyService, deps: [{ token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable });
167
- EmojiFrequentlyService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: EmojiFrequentlyService, providedIn: 'root' });
168
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: EmojiFrequentlyService, decorators: [{
169
- type: Injectable,
170
- args: [{ providedIn: 'root' }]
171
- }], ctorParameters: function () {
172
- return [{ type: undefined, decorators: [{
173
- type: Inject,
174
- args: [PLATFORM_ID]
175
- }] }];
176
- } });
177
-
178
- class CategoryComponent {
179
- constructor(ref, emojiService, frequently) {
180
- this.ref = ref;
181
- this.emojiService = emojiService;
182
- this.frequently = frequently;
183
- this.emojis = null;
184
- this.hasStickyPosition = true;
185
- this.name = '';
186
- this.perLine = 9;
187
- this.totalFrequentLines = 4;
188
- this.recent = [];
189
- this.custom = [];
190
- this.hideObsolete = true;
191
- this.virtualize = false;
192
- this.virtualizeOffset = 0;
193
- this.emojiOver = new EventEmitter();
194
- /**
195
- * Note: the suffix is added explicitly so we know the event is dispatched outside of the Angular zone.
196
- */
197
- this.emojiLeaveOutsideAngular = new EventEmitter();
198
- this.emojiClick = new EventEmitter();
199
- this.containerStyles = {};
200
- this.emojisToDisplay = [];
201
- this.filteredEmojisSubject = new Subject();
202
- this.filteredEmojis$ = this.filteredEmojisSubject.asObservable();
203
- this.labelStyles = {};
204
- this.labelSpanStyles = {};
205
- this.margin = 0;
206
- this.minMargin = 0;
207
- this.maxMargin = 0;
208
- this.top = 0;
209
- this.rows = 0;
210
- }
211
- ngOnInit() {
212
- this.updateRecentEmojis();
213
- this.emojisToDisplay = this.filterEmojis();
214
- if (this.noEmojiToDisplay) {
215
- this.containerStyles = { display: 'none' };
216
- }
217
- if (!this.hasStickyPosition) {
218
- this.labelStyles = { height: 28 };
219
- // this.labelSpanStyles = { position: 'absolute' };
220
- }
221
- }
222
- ngOnChanges(changes) {
223
- var _a, _b, _c, _d;
224
- if (((_b = (_a = changes.emojis) === null || _a === void 0 ? void 0 : _a.currentValue) === null || _b === void 0 ? void 0 : _b.length) !== ((_d = (_c = changes.emojis) === null || _c === void 0 ? void 0 : _c.previousValue) === null || _d === void 0 ? void 0 : _d.length)) {
225
- this.emojisToDisplay = this.filterEmojis();
226
- this.ngAfterViewInit();
227
- }
228
- }
229
- ngAfterViewInit() {
230
- if (!this.virtualize) {
231
- return;
232
- }
233
- const { width } = this.container.nativeElement.getBoundingClientRect();
234
- const perRow = Math.floor(width / (this.emojiSize + 12));
235
- this.rows = Math.ceil(this.emojisToDisplay.length / perRow);
236
- this.containerStyles = Object.assign(Object.assign({}, this.containerStyles), { minHeight: `${this.rows * (this.emojiSize + 12) + 28}px` });
237
- this.ref.detectChanges();
238
- this.handleScroll(this.container.nativeElement.parentNode.parentNode.scrollTop);
239
- }
240
- get noEmojiToDisplay() {
241
- return this.emojisToDisplay.length === 0;
242
- }
243
- memoizeSize() {
244
- const parent = this.container.nativeElement.parentNode.parentNode;
245
- const { top, height } = this.container.nativeElement.getBoundingClientRect();
246
- const parentTop = parent.getBoundingClientRect().top;
247
- const labelHeight = this.label.nativeElement.getBoundingClientRect().height;
248
- this.top = top - parentTop + parent.scrollTop;
249
- if (height === 0) {
250
- this.maxMargin = 0;
251
- }
252
- else {
253
- this.maxMargin = height - labelHeight;
254
- }
255
- }
256
- handleScroll(scrollTop) {
257
- let margin = scrollTop - this.top;
258
- margin = margin < this.minMargin ? this.minMargin : margin;
259
- margin = margin > this.maxMargin ? this.maxMargin : margin;
260
- if (this.virtualize) {
261
- const { top, height } = this.container.nativeElement.getBoundingClientRect();
262
- const parentHeight = this.container.nativeElement.parentNode.parentNode.clientHeight;
263
- if (parentHeight + (parentHeight + this.virtualizeOffset) >= top &&
264
- -height - (parentHeight + this.virtualizeOffset) <= top) {
265
- this.filteredEmojisSubject.next(this.emojisToDisplay);
266
- }
267
- else {
268
- this.filteredEmojisSubject.next([]);
269
- }
270
- }
271
- if (margin === this.margin) {
272
- this.ref.detectChanges();
273
- return false;
274
- }
275
- if (!this.hasStickyPosition) {
276
- this.label.nativeElement.style.top = `${margin}px`;
277
- }
278
- this.margin = margin;
279
- this.ref.detectChanges();
280
- return true;
281
- }
282
- updateRecentEmojis() {
283
- if (this.name !== 'Recent') {
284
- return;
285
- }
286
- let frequentlyUsed = this.recent || this.frequently.get(this.perLine, this.totalFrequentLines);
287
- if (!frequentlyUsed || !frequentlyUsed.length) {
288
- frequentlyUsed = this.frequently.get(this.perLine, this.totalFrequentLines);
289
- }
290
- if (!frequentlyUsed.length) {
291
- return;
292
- }
293
- this.emojis = frequentlyUsed
294
- .map(id => {
295
- const emoji = this.custom.filter((e) => e.id === id)[0];
296
- if (emoji) {
297
- return emoji;
298
- }
299
- return id;
300
- })
301
- .filter(id => !!this.emojiService.getData(id));
302
- }
303
- updateDisplay(display) {
304
- this.containerStyles.display = display;
305
- this.updateRecentEmojis();
306
- this.ref.detectChanges();
307
- }
308
- trackById(index, item) {
309
- return item;
310
- }
311
- filterEmojis() {
312
- const newEmojis = [];
313
- for (const emoji of this.emojis || []) {
314
- if (!emoji) {
315
- continue;
316
- }
317
- const data = this.emojiService.getData(emoji);
318
- if (!data || (data.obsoletedBy && this.hideObsolete) || (!data.unified && !data.custom)) {
319
- continue;
320
- }
321
- newEmojis.push(emoji);
322
- }
323
- return newEmojis;
324
- }
325
- }
326
- CategoryComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: CategoryComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.EmojiService }, { token: EmojiFrequentlyService }], target: i0.ɵɵFactoryTarget.Component });
327
- CategoryComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: CategoryComponent, selector: "emoji-category", inputs: { emojis: "emojis", hasStickyPosition: "hasStickyPosition", name: "name", perLine: "perLine", totalFrequentLines: "totalFrequentLines", recent: "recent", custom: "custom", i18n: "i18n", id: "id", hideObsolete: "hideObsolete", notFoundEmoji: "notFoundEmoji", virtualize: "virtualize", virtualizeOffset: "virtualizeOffset", emojiIsNative: "emojiIsNative", emojiSkin: "emojiSkin", emojiSize: "emojiSize", emojiSet: "emojiSet", emojiSheetSize: "emojiSheetSize", emojiForceSize: "emojiForceSize", emojiTooltip: "emojiTooltip", emojiBackgroundImageFn: "emojiBackgroundImageFn", emojiImageUrlFn: "emojiImageUrlFn", emojiUseButton: "emojiUseButton" }, outputs: { emojiOver: "emojiOver", emojiLeaveOutsideAngular: "emojiLeaveOutsideAngular", emojiClick: "emojiClick" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, static: true }, { propertyName: "label", first: true, predicate: ["label"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: `
328
- <section
329
- #container
330
- class="emoji-mart-category"
331
- [attr.aria-label]="i18n.categories[id]"
332
- [class.emoji-mart-no-results]="noEmojiToDisplay"
333
- [ngStyle]="containerStyles"
334
- >
335
- <div class="emoji-mart-category-label" [ngStyle]="labelStyles" [attr.data-name]="name">
336
- <!-- already labeled by the section aria-label -->
337
- <span #label [ngStyle]="labelSpanStyles" aria-hidden="true">
338
- {{ i18n.categories[id] }}
339
- </span>
340
- </div>
341
-
342
- <div *ngIf="virtualize; else normalRenderTemplate">
343
- <div *ngIf="filteredEmojis$ | async as filteredEmojis">
344
- <ngx-emoji
345
- *ngFor="let emoji of filteredEmojis; trackBy: trackById"
346
- [emoji]="emoji"
347
- [size]="emojiSize"
348
- [skin]="emojiSkin"
349
- [isNative]="emojiIsNative"
350
- [set]="emojiSet"
351
- [sheetSize]="emojiSheetSize"
352
- [forceSize]="emojiForceSize"
353
- [tooltip]="emojiTooltip"
354
- [backgroundImageFn]="emojiBackgroundImageFn"
355
- [imageUrlFn]="emojiImageUrlFn"
356
- [hideObsolete]="hideObsolete"
357
- [useButton]="emojiUseButton"
358
- (emojiOver)="emojiOver.emit($event)"
359
- (emojiLeaveOutsideAngular)="emojiLeaveOutsideAngular.emit($event)"
360
- (emojiClick)="emojiClick.emit($event)"
361
- ></ngx-emoji>
362
- </div>
363
- </div>
364
-
365
- <div *ngIf="noEmojiToDisplay">
366
- <div>
367
- <ngx-emoji
368
- [emoji]="notFoundEmoji"
369
- [size]="38"
370
- [skin]="emojiSkin"
371
- [isNative]="emojiIsNative"
372
- [set]="emojiSet"
373
- [sheetSize]="emojiSheetSize"
374
- [forceSize]="emojiForceSize"
375
- [tooltip]="emojiTooltip"
376
- [backgroundImageFn]="emojiBackgroundImageFn"
377
- [useButton]="emojiUseButton"
378
- ></ngx-emoji>
379
- </div>
380
-
381
- <div class="emoji-mart-no-results-label">
382
- {{ i18n.notfound }}
383
- </div>
384
- </div>
385
- </section>
386
-
387
- <ng-template #normalRenderTemplate>
388
- <ngx-emoji
389
- *ngFor="let emoji of emojisToDisplay; trackBy: trackById"
390
- [emoji]="emoji"
391
- [size]="emojiSize"
392
- [skin]="emojiSkin"
393
- [isNative]="emojiIsNative"
394
- [set]="emojiSet"
395
- [sheetSize]="emojiSheetSize"
396
- [forceSize]="emojiForceSize"
397
- [tooltip]="emojiTooltip"
398
- [backgroundImageFn]="emojiBackgroundImageFn"
399
- [imageUrlFn]="emojiImageUrlFn"
400
- [hideObsolete]="hideObsolete"
401
- [useButton]="emojiUseButton"
402
- (emojiOver)="emojiOver.emit($event)"
403
- (emojiLeaveOutsideAngular)="emojiLeaveOutsideAngular.emit($event)"
404
- (emojiClick)="emojiClick.emit($event)"
405
- ></ngx-emoji>
406
- </ng-template>
407
- `, isInline: true, dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i1.EmojiComponent, selector: "ngx-emoji", inputs: ["skin", "set", "sheetSize", "isNative", "forceSize", "tooltip", "size", "emoji", "fallback", "hideObsolete", "sheetRows", "sheetColumns", "useButton", "backgroundImageFn", "imageUrlFn"], outputs: ["emojiOver", "emojiLeave", "emojiLeaveOutsideAngular", "emojiClick"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
408
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: CategoryComponent, decorators: [{
409
- type: Component,
410
- args: [{
411
- selector: 'emoji-category',
412
- template: `
413
- <section
414
- #container
415
- class="emoji-mart-category"
416
- [attr.aria-label]="i18n.categories[id]"
417
- [class.emoji-mart-no-results]="noEmojiToDisplay"
418
- [ngStyle]="containerStyles"
419
- >
420
- <div class="emoji-mart-category-label" [ngStyle]="labelStyles" [attr.data-name]="name">
421
- <!-- already labeled by the section aria-label -->
422
- <span #label [ngStyle]="labelSpanStyles" aria-hidden="true">
423
- {{ i18n.categories[id] }}
424
- </span>
425
- </div>
426
-
427
- <div *ngIf="virtualize; else normalRenderTemplate">
428
- <div *ngIf="filteredEmojis$ | async as filteredEmojis">
429
- <ngx-emoji
430
- *ngFor="let emoji of filteredEmojis; trackBy: trackById"
431
- [emoji]="emoji"
432
- [size]="emojiSize"
433
- [skin]="emojiSkin"
434
- [isNative]="emojiIsNative"
435
- [set]="emojiSet"
436
- [sheetSize]="emojiSheetSize"
437
- [forceSize]="emojiForceSize"
438
- [tooltip]="emojiTooltip"
439
- [backgroundImageFn]="emojiBackgroundImageFn"
440
- [imageUrlFn]="emojiImageUrlFn"
441
- [hideObsolete]="hideObsolete"
442
- [useButton]="emojiUseButton"
443
- (emojiOver)="emojiOver.emit($event)"
444
- (emojiLeaveOutsideAngular)="emojiLeaveOutsideAngular.emit($event)"
445
- (emojiClick)="emojiClick.emit($event)"
446
- ></ngx-emoji>
447
- </div>
448
- </div>
449
-
450
- <div *ngIf="noEmojiToDisplay">
451
- <div>
452
- <ngx-emoji
453
- [emoji]="notFoundEmoji"
454
- [size]="38"
455
- [skin]="emojiSkin"
456
- [isNative]="emojiIsNative"
457
- [set]="emojiSet"
458
- [sheetSize]="emojiSheetSize"
459
- [forceSize]="emojiForceSize"
460
- [tooltip]="emojiTooltip"
461
- [backgroundImageFn]="emojiBackgroundImageFn"
462
- [useButton]="emojiUseButton"
463
- ></ngx-emoji>
464
- </div>
465
-
466
- <div class="emoji-mart-no-results-label">
467
- {{ i18n.notfound }}
468
- </div>
469
- </div>
470
- </section>
471
-
472
- <ng-template #normalRenderTemplate>
473
- <ngx-emoji
474
- *ngFor="let emoji of emojisToDisplay; trackBy: trackById"
475
- [emoji]="emoji"
476
- [size]="emojiSize"
477
- [skin]="emojiSkin"
478
- [isNative]="emojiIsNative"
479
- [set]="emojiSet"
480
- [sheetSize]="emojiSheetSize"
481
- [forceSize]="emojiForceSize"
482
- [tooltip]="emojiTooltip"
483
- [backgroundImageFn]="emojiBackgroundImageFn"
484
- [imageUrlFn]="emojiImageUrlFn"
485
- [hideObsolete]="hideObsolete"
486
- [useButton]="emojiUseButton"
487
- (emojiOver)="emojiOver.emit($event)"
488
- (emojiLeaveOutsideAngular)="emojiLeaveOutsideAngular.emit($event)"
489
- (emojiClick)="emojiClick.emit($event)"
490
- ></ngx-emoji>
491
- </ng-template>
492
- `,
493
- changeDetection: ChangeDetectionStrategy.OnPush,
494
- preserveWhitespaces: false,
495
- }]
496
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i1.EmojiService }, { type: EmojiFrequentlyService }]; }, propDecorators: { emojis: [{
497
- type: Input
498
- }], hasStickyPosition: [{
499
- type: Input
500
- }], name: [{
501
- type: Input
502
- }], perLine: [{
503
- type: Input
504
- }], totalFrequentLines: [{
505
- type: Input
506
- }], recent: [{
507
- type: Input
508
- }], custom: [{
509
- type: Input
510
- }], i18n: [{
511
- type: Input
512
- }], id: [{
513
- type: Input
514
- }], hideObsolete: [{
515
- type: Input
516
- }], notFoundEmoji: [{
517
- type: Input
518
- }], virtualize: [{
519
- type: Input
520
- }], virtualizeOffset: [{
521
- type: Input
522
- }], emojiIsNative: [{
523
- type: Input
524
- }], emojiSkin: [{
525
- type: Input
526
- }], emojiSize: [{
527
- type: Input
528
- }], emojiSet: [{
529
- type: Input
530
- }], emojiSheetSize: [{
531
- type: Input
532
- }], emojiForceSize: [{
533
- type: Input
534
- }], emojiTooltip: [{
535
- type: Input
536
- }], emojiBackgroundImageFn: [{
537
- type: Input
538
- }], emojiImageUrlFn: [{
539
- type: Input
540
- }], emojiUseButton: [{
541
- type: Input
542
- }], emojiOver: [{
543
- type: Output
544
- }], emojiLeaveOutsideAngular: [{
545
- type: Output
546
- }], emojiClick: [{
547
- type: Output
548
- }], container: [{
549
- type: ViewChild,
550
- args: ['container', { static: true }]
551
- }], label: [{
552
- type: ViewChild,
553
- args: ['label', { static: true }]
554
- }] } });
555
-
556
- function uniq(arr) {
557
- return arr.reduce((acc, item) => {
558
- if (!acc.includes(item)) {
559
- acc.push(item);
560
- }
561
- return acc;
562
- }, []);
563
- }
564
- function intersect(a, b) {
565
- const uniqA = uniq(a);
566
- const uniqB = uniq(b);
567
- return uniqA.filter((item) => uniqB.indexOf(item) >= 0);
568
- }
569
- // https://github.com/sonicdoe/measure-scrollbar
570
- function measureScrollbar() {
571
- if (typeof document === 'undefined') {
572
- return 0;
573
- }
574
- const div = document.createElement('div');
575
- div.style.width = '100px';
576
- div.style.height = '100px';
577
- div.style.overflow = 'scroll';
578
- div.style.position = 'absolute';
579
- div.style.top = '-9999px';
580
- document.body.appendChild(div);
581
- const scrollbarWidth = div.offsetWidth - div.clientWidth;
582
- document.body.removeChild(div);
583
- return scrollbarWidth;
584
- }
585
-
586
- class EmojiSearch {
587
- constructor(emojiService) {
588
- this.emojiService = emojiService;
589
- this.originalPool = {};
590
- this.index = {};
591
- this.emojisList = {};
592
- this.emoticonsList = {};
593
- this.emojiSearch = {};
594
- for (const emojiData of this.emojiService.emojis) {
595
- const { shortNames, emoticons } = emojiData;
596
- const id = shortNames[0];
597
- for (const emoticon of emoticons) {
598
- if (this.emoticonsList[emoticon]) {
599
- continue;
600
- }
601
- this.emoticonsList[emoticon] = id;
602
- }
603
- this.emojisList[id] = this.emojiService.getSanitizedData(id);
604
- this.originalPool[id] = emojiData;
605
- }
606
- }
607
- addCustomToPool(custom, pool) {
608
- for (const emoji of custom) {
609
- const emojiId = emoji.id || emoji.shortNames[0];
610
- if (emojiId && !pool[emojiId]) {
611
- pool[emojiId] = this.emojiService.getData(emoji);
612
- this.emojisList[emojiId] = this.emojiService.getSanitizedData(emoji);
613
- }
614
- }
615
- }
616
- search(value, emojisToShowFilter, maxResults = 75, include = [], exclude = [], custom = []) {
617
- var _a;
618
- this.addCustomToPool(custom, this.originalPool);
619
- let results;
620
- let pool = this.originalPool;
621
- if (value.length) {
622
- if (value === '-' || value === '-1') {
623
- return [this.emojisList['-1']];
624
- }
625
- if (value === '+' || value === '+1') {
626
- return [this.emojisList['+1']];
627
- }
628
- let values = value.toLowerCase().split(/[\s|,|\-|_]+/);
629
- let allResults = [];
630
- if (values.length > 2) {
631
- values = [values[0], values[1]];
632
- }
633
- if (include.length || exclude.length) {
634
- pool = {};
635
- for (const category of categories$1 || []) {
636
- const isIncluded = include && include.length ? include.indexOf(category.id) > -1 : true;
637
- const isExcluded = exclude && exclude.length ? exclude.indexOf(category.id) > -1 : false;
638
- if (!isIncluded || isExcluded) {
639
- continue;
640
- }
641
- for (const emojiId of category.emojis || []) {
642
- // Need to make sure that pool gets keyed
643
- // with the correct id, which is why we call emojiService.getData below
644
- const emoji = this.emojiService.getData(emojiId);
645
- pool[(_a = emoji === null || emoji === void 0 ? void 0 : emoji.id) !== null && _a !== void 0 ? _a : ''] = emoji;
646
- }
647
- }
648
- if (custom.length) {
649
- const customIsIncluded = include && include.length ? include.indexOf('custom') > -1 : true;
650
- const customIsExcluded = exclude && exclude.length ? exclude.indexOf('custom') > -1 : false;
651
- if (customIsIncluded && !customIsExcluded) {
652
- this.addCustomToPool(custom, pool);
653
- }
654
- }
655
- }
656
- allResults = values
657
- .map(v => {
658
- let aPool = pool;
659
- let aIndex = this.index;
660
- let length = 0;
661
- // eslint-disable-next-line @typescript-eslint/prefer-for-of
662
- for (let charIndex = 0; charIndex < v.length; charIndex++) {
663
- const char = v[charIndex];
664
- length++;
665
- if (!aIndex[char]) {
666
- aIndex[char] = {};
667
- }
668
- aIndex = aIndex[char];
669
- if (!aIndex.results) {
670
- const scores = {};
671
- aIndex.results = [];
672
- aIndex.pool = {};
673
- for (const id of Object.keys(aPool)) {
674
- const emoji = aPool[id];
675
- if (!this.emojiSearch[id]) {
676
- this.emojiSearch[id] = this.buildSearch(emoji.short_names, emoji.name, emoji.id, emoji.keywords, emoji.emoticons);
677
- }
678
- const query = this.emojiSearch[id];
679
- const sub = v.substr(0, length);
680
- const subIndex = query.indexOf(sub);
681
- if (subIndex !== -1) {
682
- let score = subIndex + 1;
683
- if (sub === id) {
684
- score = 0;
685
- }
686
- aIndex.results.push(this.emojisList[id]);
687
- aIndex.pool[id] = emoji;
688
- scores[id] = score;
689
- }
690
- }
691
- aIndex.results.sort((a, b) => {
692
- const aScore = scores[a.id];
693
- const bScore = scores[b.id];
694
- return aScore - bScore;
695
- });
696
- }
697
- aPool = aIndex.pool;
698
- }
699
- return aIndex.results;
700
- })
701
- .filter(a => a);
702
- if (allResults.length > 1) {
703
- results = intersect.apply(null, allResults);
704
- }
705
- else if (allResults.length) {
706
- results = allResults[0];
707
- }
708
- else {
709
- results = [];
710
- }
711
- }
712
- if (results) {
713
- if (emojisToShowFilter) {
714
- results = results.filter((result) => {
715
- if (result && result.id) {
716
- return emojisToShowFilter(this.emojiService.names[result.id]);
717
- }
718
- return false;
719
- });
720
- }
721
- if (results && results.length > maxResults) {
722
- results = results.slice(0, maxResults);
723
- }
724
- }
725
- return results || null;
726
- }
727
- buildSearch(shortNames, name, id, keywords, emoticons) {
728
- const search = [];
729
- const addToSearch = (strings, split) => {
730
- if (!strings) {
731
- return;
732
- }
733
- const arr = Array.isArray(strings) ? strings : [strings];
734
- for (const str of arr) {
735
- const substrings = split ? str.split(/[-|_|\s]+/) : [str];
736
- for (let s of substrings) {
737
- s = s.toLowerCase();
738
- if (!search.includes(s)) {
739
- search.push(s);
740
- }
741
- }
742
- }
743
- };
744
- addToSearch(shortNames, true);
745
- addToSearch(name, true);
746
- addToSearch(id, true);
747
- addToSearch(keywords, true);
748
- addToSearch(emoticons, false);
749
- return search.join(',');
750
- }
751
- }
752
- EmojiSearch.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: EmojiSearch, deps: [{ token: i1.EmojiService }], target: i0.ɵɵFactoryTarget.Injectable });
753
- EmojiSearch.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: EmojiSearch, providedIn: 'root' });
754
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: EmojiSearch, decorators: [{
755
- type: Injectable,
756
- args: [{ providedIn: 'root' }]
757
- }], ctorParameters: function () { return [{ type: i1.EmojiService }]; } });
758
-
759
- class SkinComponent {
760
- constructor() {
761
- this.changeSkin = new EventEmitter();
762
- this.opened = false;
763
- this.skinTones = [1, 2, 3, 4, 5, 6];
764
- }
765
- toggleOpen() {
766
- this.opened = !this.opened;
767
- }
768
- isSelected(skinTone) {
769
- return skinTone === this.skin;
770
- }
771
- isVisible(skinTone) {
772
- return this.opened || this.isSelected(skinTone);
773
- }
774
- pressed(skinTone) {
775
- return this.opened ? !!this.isSelected(skinTone) : '';
776
- }
777
- tabIndex(skinTone) {
778
- return this.isVisible(skinTone) ? '0' : '';
779
- }
780
- expanded(skinTone) {
781
- return this.isSelected(skinTone) ? this.opened : '';
782
- }
783
- handleClick(skin) {
784
- if (!this.opened) {
785
- this.opened = true;
786
- return;
787
- }
788
- this.opened = false;
789
- if (skin !== this.skin) {
790
- this.changeSkin.emit(skin);
791
- }
792
- }
793
- }
794
- SkinComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: SkinComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
795
- SkinComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: SkinComponent, selector: "emoji-skins", inputs: { skin: "skin", i18n: "i18n" }, outputs: { changeSkin: "changeSkin" }, ngImport: i0, template: `
796
- <section
797
- class="emoji-mart-skin-swatches"
798
- [class.opened]="opened"
799
- >
800
- <span
801
- *ngFor="let skinTone of skinTones"
802
- class="emoji-mart-skin-swatch"
803
- [class.selected]="skinTone === skin"
804
- >
805
- <span
806
- (click)="handleClick(skinTone)"
807
- (keyup.enter)="handleClick(skinTone)"
808
- (keyup.space)="handleClick(skinTone)"
809
- class="emoji-mart-skin emoji-mart-skin-tone-{{ skinTone }}"
810
- role="button"
811
- [tabIndex]="tabIndex(skinTone)"
812
- [attr.aria-hidden]="!isVisible(skinTone)"
813
- [attr.aria-pressed]="pressed(skinTone)"
814
- [attr.aria-haspopup]="!!isSelected(skinTone)"
815
- [attr.aria-expanded]="expanded(skinTone)"
816
- [attr.aria-label]="i18n.skintones[skinTone]"
817
- [attr.title]="i18n.skintones[skinTone]"
818
- ></span>
819
- </span>
820
- </section>
821
- `, isInline: true, dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
822
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: SkinComponent, decorators: [{
823
- type: Component,
824
- args: [{
825
- selector: 'emoji-skins',
826
- template: `
827
- <section
828
- class="emoji-mart-skin-swatches"
829
- [class.opened]="opened"
830
- >
831
- <span
832
- *ngFor="let skinTone of skinTones"
833
- class="emoji-mart-skin-swatch"
834
- [class.selected]="skinTone === skin"
835
- >
836
- <span
837
- (click)="handleClick(skinTone)"
838
- (keyup.enter)="handleClick(skinTone)"
839
- (keyup.space)="handleClick(skinTone)"
840
- class="emoji-mart-skin emoji-mart-skin-tone-{{ skinTone }}"
841
- role="button"
842
- [tabIndex]="tabIndex(skinTone)"
843
- [attr.aria-hidden]="!isVisible(skinTone)"
844
- [attr.aria-pressed]="pressed(skinTone)"
845
- [attr.aria-haspopup]="!!isSelected(skinTone)"
846
- [attr.aria-expanded]="expanded(skinTone)"
847
- [attr.aria-label]="i18n.skintones[skinTone]"
848
- [attr.title]="i18n.skintones[skinTone]"
849
- ></span>
850
- </span>
851
- </section>
852
- `,
853
- changeDetection: ChangeDetectionStrategy.OnPush,
854
- preserveWhitespaces: false,
855
- }]
856
- }], propDecorators: { skin: [{
857
- type: Input
858
- }], i18n: [{
859
- type: Input
860
- }], changeSkin: [{
861
- type: Output
862
- }] } });
863
-
864
- class PreviewComponent {
865
- constructor(ref, emojiService) {
866
- this.ref = ref;
867
- this.emojiService = emojiService;
868
- this.skinChange = new EventEmitter();
869
- this.emojiData = {};
870
- }
871
- ngOnChanges() {
872
- var _a;
873
- if (!this.emoji) {
874
- return;
875
- }
876
- this.emojiData = this.emojiService.getData(this.emoji, this.emojiSkin, this.emojiSet);
877
- const knownEmoticons = [];
878
- const listedEmoticons = [];
879
- const emoitcons = this.emojiData.emoticons || [];
880
- emoitcons.forEach((emoticon) => {
881
- if (knownEmoticons.indexOf(emoticon.toLowerCase()) >= 0) {
882
- return;
883
- }
884
- knownEmoticons.push(emoticon.toLowerCase());
885
- listedEmoticons.push(emoticon);
886
- });
887
- this.listedEmoticons = listedEmoticons;
888
- (_a = this.ref) === null || _a === void 0 ? void 0 : _a.detectChanges();
889
- }
890
- }
891
- PreviewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: PreviewComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.EmojiService }], target: i0.ɵɵFactoryTarget.Component });
892
- PreviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: PreviewComponent, selector: "emoji-preview", inputs: { title: "title", emoji: "emoji", idleEmoji: "idleEmoji", i18n: "i18n", emojiIsNative: "emojiIsNative", emojiSkin: "emojiSkin", emojiSize: "emojiSize", emojiSet: "emojiSet", emojiSheetSize: "emojiSheetSize", emojiBackgroundImageFn: "emojiBackgroundImageFn", emojiImageUrlFn: "emojiImageUrlFn" }, outputs: { skinChange: "skinChange" }, usesOnChanges: true, ngImport: i0, template: `
893
- <div class="emoji-mart-preview" *ngIf="emoji && emojiData">
894
- <div class="emoji-mart-preview-emoji">
895
- <ngx-emoji
896
- [emoji]="emoji"
897
- [size]="38"
898
- [isNative]="emojiIsNative"
899
- [skin]="emojiSkin"
900
- [size]="emojiSize"
901
- [set]="emojiSet"
902
- [sheetSize]="emojiSheetSize"
903
- [backgroundImageFn]="emojiBackgroundImageFn"
904
- [imageUrlFn]="emojiImageUrlFn"
905
- ></ngx-emoji>
906
- </div>
907
-
908
- <div class="emoji-mart-preview-data">
909
- <div class="emoji-mart-preview-name">{{ emojiData.name }}</div>
910
- <div class="emoji-mart-preview-shortname">
911
- <span
912
- class="emoji-mart-preview-shortname"
913
- *ngFor="let short_name of emojiData.shortNames"
914
- >
915
- :{{ short_name }}:
916
- </span>
917
- </div>
918
- <div class="emoji-mart-preview-emoticons">
919
- <span class="emoji-mart-preview-emoticon" *ngFor="let emoticon of listedEmoticons">
920
- {{ emoticon }}
921
- </span>
922
- </div>
923
- </div>
924
- </div>
925
-
926
- <div class="emoji-mart-preview" [hidden]="emoji">
927
- <div class="emoji-mart-preview-emoji">
928
- <ngx-emoji
929
- *ngIf="idleEmoji && idleEmoji.length"
930
- [isNative]="emojiIsNative"
931
- [skin]="emojiSkin"
932
- [set]="emojiSet"
933
- [emoji]="idleEmoji"
934
- [backgroundImageFn]="emojiBackgroundImageFn"
935
- [size]="38"
936
- [imageUrlFn]="emojiImageUrlFn"
937
- ></ngx-emoji>
938
- </div>
939
-
940
- <div class="emoji-mart-preview-data">
941
- <span class="emoji-mart-title-label">{{ title }}</span>
942
- </div>
943
-
944
- <div class="emoji-mart-preview-skins">
945
- <emoji-skins
946
- [skin]="emojiSkin"
947
- (changeSkin)="skinChange.emit($event)"
948
- [i18n]="i18n"
949
- ></emoji-skins>
950
- </div>
951
- </div>
952
- `, isInline: true, dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1.EmojiComponent, selector: "ngx-emoji", inputs: ["skin", "set", "sheetSize", "isNative", "forceSize", "tooltip", "size", "emoji", "fallback", "hideObsolete", "sheetRows", "sheetColumns", "useButton", "backgroundImageFn", "imageUrlFn"], outputs: ["emojiOver", "emojiLeave", "emojiLeaveOutsideAngular", "emojiClick"] }, { kind: "component", type: SkinComponent, selector: "emoji-skins", inputs: ["skin", "i18n"], outputs: ["changeSkin"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
953
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: PreviewComponent, decorators: [{
954
- type: Component,
955
- args: [{
956
- selector: 'emoji-preview',
957
- template: `
958
- <div class="emoji-mart-preview" *ngIf="emoji && emojiData">
959
- <div class="emoji-mart-preview-emoji">
960
- <ngx-emoji
961
- [emoji]="emoji"
962
- [size]="38"
963
- [isNative]="emojiIsNative"
964
- [skin]="emojiSkin"
965
- [size]="emojiSize"
966
- [set]="emojiSet"
967
- [sheetSize]="emojiSheetSize"
968
- [backgroundImageFn]="emojiBackgroundImageFn"
969
- [imageUrlFn]="emojiImageUrlFn"
970
- ></ngx-emoji>
971
- </div>
972
-
973
- <div class="emoji-mart-preview-data">
974
- <div class="emoji-mart-preview-name">{{ emojiData.name }}</div>
975
- <div class="emoji-mart-preview-shortname">
976
- <span
977
- class="emoji-mart-preview-shortname"
978
- *ngFor="let short_name of emojiData.shortNames"
979
- >
980
- :{{ short_name }}:
981
- </span>
982
- </div>
983
- <div class="emoji-mart-preview-emoticons">
984
- <span class="emoji-mart-preview-emoticon" *ngFor="let emoticon of listedEmoticons">
985
- {{ emoticon }}
986
- </span>
987
- </div>
988
- </div>
989
- </div>
990
-
991
- <div class="emoji-mart-preview" [hidden]="emoji">
992
- <div class="emoji-mart-preview-emoji">
993
- <ngx-emoji
994
- *ngIf="idleEmoji && idleEmoji.length"
995
- [isNative]="emojiIsNative"
996
- [skin]="emojiSkin"
997
- [set]="emojiSet"
998
- [emoji]="idleEmoji"
999
- [backgroundImageFn]="emojiBackgroundImageFn"
1000
- [size]="38"
1001
- [imageUrlFn]="emojiImageUrlFn"
1002
- ></ngx-emoji>
1003
- </div>
1004
-
1005
- <div class="emoji-mart-preview-data">
1006
- <span class="emoji-mart-title-label">{{ title }}</span>
1007
- </div>
1008
-
1009
- <div class="emoji-mart-preview-skins">
1010
- <emoji-skins
1011
- [skin]="emojiSkin"
1012
- (changeSkin)="skinChange.emit($event)"
1013
- [i18n]="i18n"
1014
- ></emoji-skins>
1015
- </div>
1016
- </div>
1017
- `,
1018
- changeDetection: ChangeDetectionStrategy.OnPush,
1019
- preserveWhitespaces: false,
1020
- }]
1021
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i1.EmojiService }]; }, propDecorators: { title: [{
1022
- type: Input
1023
- }], emoji: [{
1024
- type: Input
1025
- }], idleEmoji: [{
1026
- type: Input
1027
- }], i18n: [{
1028
- type: Input
1029
- }], emojiIsNative: [{
1030
- type: Input
1031
- }], emojiSkin: [{
1032
- type: Input
1033
- }], emojiSize: [{
1034
- type: Input
1035
- }], emojiSet: [{
1036
- type: Input
1037
- }], emojiSheetSize: [{
1038
- type: Input
1039
- }], emojiBackgroundImageFn: [{
1040
- type: Input
1041
- }], emojiImageUrlFn: [{
1042
- type: Input
1043
- }], skinChange: [{
1044
- type: Output
1045
- }] } });
1046
-
1047
- let id = 0;
1048
- class SearchComponent {
1049
- constructor(emojiSearch) {
1050
- this.emojiSearch = emojiSearch;
1051
- this.maxResults = 75;
1052
- this.autoFocus = false;
1053
- this.include = [];
1054
- this.exclude = [];
1055
- this.custom = [];
1056
- this.searchResults = new EventEmitter();
1057
- this.enterKey = new EventEmitter();
1058
- this.isSearching = false;
1059
- this.query = '';
1060
- this.inputId = `emoji-mart-search-${++id}`;
1061
- }
1062
- ngOnInit() {
1063
- this.icon = this.icons.search;
1064
- }
1065
- ngAfterViewInit() {
1066
- if (this.autoFocus) {
1067
- this.inputRef.nativeElement.focus();
1068
- }
1069
- }
1070
- clear() {
1071
- this.query = '';
1072
- this.handleSearch('');
1073
- this.inputRef.nativeElement.focus();
1074
- }
1075
- handleEnterKey($event) {
1076
- if (!this.query) {
1077
- return;
1078
- }
1079
- this.enterKey.emit($event);
1080
- $event.preventDefault();
1081
- }
1082
- handleSearch(value) {
1083
- if (value === '') {
1084
- this.icon = this.icons.search;
1085
- this.isSearching = false;
1086
- }
1087
- else {
1088
- this.icon = this.icons.delete;
1089
- this.isSearching = true;
1090
- }
1091
- const emojis = this.emojiSearch.search(this.query, this.emojisToShowFilter, this.maxResults, this.include, this.exclude, this.custom);
1092
- this.searchResults.emit(emojis);
1093
- }
1094
- handleChange() {
1095
- this.handleSearch(this.query);
1096
- }
1097
- }
1098
- SearchComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: SearchComponent, deps: [{ token: EmojiSearch }], target: i0.ɵɵFactoryTarget.Component });
1099
- SearchComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: SearchComponent, selector: "emoji-search", inputs: { maxResults: "maxResults", autoFocus: "autoFocus", i18n: "i18n", include: "include", exclude: "exclude", custom: "custom", icons: "icons", emojisToShowFilter: "emojisToShowFilter" }, outputs: { searchResults: "searchResults", enterKey: "enterKey" }, viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["inputRef"], descendants: true, static: true }], ngImport: i0, template: `
1100
- <div class="emoji-mart-search">
1101
- <input
1102
- [id]="inputId"
1103
- #inputRef
1104
- type="search"
1105
- (keyup.enter)="handleEnterKey($event)"
1106
- [placeholder]="i18n.search"
1107
- [autofocus]="autoFocus"
1108
- [(ngModel)]="query"
1109
- (ngModelChange)="handleChange()"
1110
- />
1111
- <!--
1112
- Use a <label> in addition to the placeholder for accessibility, but place it off-screen
1113
- http://www.maxability.co.in/2016/01/placeholder-attribute-and-why-it-is-not-accessible/
1114
- -->
1115
- <label class="emoji-mart-sr-only" [htmlFor]="inputId">
1116
- {{ i18n.search }}
1117
- </label>
1118
- <button
1119
- type="button"
1120
- class="emoji-mart-search-icon"
1121
- (click)="clear()"
1122
- (keyup.enter)="clear()"
1123
- [disabled]="!isSearching"
1124
- [attr.aria-label]="i18n.clear"
1125
- >
1126
- <svg
1127
- xmlns="http://www.w3.org/2000/svg"
1128
- viewBox="0 0 20 20"
1129
- width="13"
1130
- height="13"
1131
- opacity="0.5"
1132
- >
1133
- <path [attr.d]="icon" />
1134
- </svg>
1135
- </button>
1136
- </div>
1137
- `, isInline: true, dependencies: [{ kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
1138
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: SearchComponent, decorators: [{
1139
- type: Component,
1140
- args: [{
1141
- selector: 'emoji-search',
1142
- template: `
1143
- <div class="emoji-mart-search">
1144
- <input
1145
- [id]="inputId"
1146
- #inputRef
1147
- type="search"
1148
- (keyup.enter)="handleEnterKey($event)"
1149
- [placeholder]="i18n.search"
1150
- [autofocus]="autoFocus"
1151
- [(ngModel)]="query"
1152
- (ngModelChange)="handleChange()"
1153
- />
1154
- <!--
1155
- Use a <label> in addition to the placeholder for accessibility, but place it off-screen
1156
- http://www.maxability.co.in/2016/01/placeholder-attribute-and-why-it-is-not-accessible/
1157
- -->
1158
- <label class="emoji-mart-sr-only" [htmlFor]="inputId">
1159
- {{ i18n.search }}
1160
- </label>
1161
- <button
1162
- type="button"
1163
- class="emoji-mart-search-icon"
1164
- (click)="clear()"
1165
- (keyup.enter)="clear()"
1166
- [disabled]="!isSearching"
1167
- [attr.aria-label]="i18n.clear"
1168
- >
1169
- <svg
1170
- xmlns="http://www.w3.org/2000/svg"
1171
- viewBox="0 0 20 20"
1172
- width="13"
1173
- height="13"
1174
- opacity="0.5"
1175
- >
1176
- <path [attr.d]="icon" />
1177
- </svg>
1178
- </button>
1179
- </div>
1180
- `,
1181
- preserveWhitespaces: false,
1182
- }]
1183
- }], ctorParameters: function () { return [{ type: EmojiSearch }]; }, propDecorators: { maxResults: [{
1184
- type: Input
1185
- }], autoFocus: [{
1186
- type: Input
1187
- }], i18n: [{
1188
- type: Input
1189
- }], include: [{
1190
- type: Input
1191
- }], exclude: [{
1192
- type: Input
1193
- }], custom: [{
1194
- type: Input
1195
- }], icons: [{
1196
- type: Input
1197
- }], emojisToShowFilter: [{
1198
- type: Input
1199
- }], searchResults: [{
1200
- type: Output
1201
- }], enterKey: [{
1202
- type: Output
1203
- }], inputRef: [{
1204
- type: ViewChild,
1205
- args: ['inputRef', { static: true }]
1206
- }] } });
1207
-
1208
- /* eslint-disable max-len */
1209
- const categories = {
1210
- activity: `M12 0a12 12 0 1 0 0 24 12 12 0 0 0 0-24m10 11h-5c.3-2.5 1.3-4.8 2-6.1a10 10 0 0 1 3 6.1m-9 0V2a10 10 0 0 1 4.4 1.6A18 18 0 0 0 15 11h-2zm-2 0H9a18 18 0 0 0-2.4-7.4A10 10 0 0 1 11 2.1V11zm0 2v9a10 10 0 0 1-4.4-1.6A18 18 0 0 0 9 13h2zm4 0a18 18 0 0 0 2.4 7.4 10 10 0 0 1-4.4 1.5V13h2zM5 4.9c.7 1.3 1.7 3.6 2 6.1H2a10 10 0 0 1 3-6.1M2 13h5c-.3 2.5-1.3 4.8-2 6.1A10 10 0 0 1 2 13m17 6.1c-.7-1.3-1.7-3.6-2-6.1h5a10 10 0 0 1-3 6.1`,
1211
- custom: `M10 1h3v21h-3zm10.186 4l1.5 2.598L3.5 18.098 2 15.5zM2 7.598L3.5 5l18.186 10.5-1.5 2.598z`,
1212
- flags: `M0 0l6 24h2L2 0zm21 5h-4l-1-4H4l3 12h3l1 4h13L21 5zM6.6 3h7.8l2 8H8.6l-2-8zm8.8 10l-2.9 1.9-.4-1.9h3.3zm3.6 0l-1.5-6h2l2 8H16l3-2z`,
1213
- foods: `M17 5c-1.8 0-2.9.4-3.7 1 .5-1.3 1.8-3 4.7-3a1 1 0 0 0 0-2c-3 0-4.6 1.3-5.5 2.5l-.2.2c-.6-1.9-1.5-3.7-3-3.7C8.5 0 7.7.3 7 1c-2 1.5-1.7 2.9-.5 4C3.6 5.2 0 7.4 0 13c0 4.6 5 11 9 11 2 0 2.4-.5 3-1 .6.5 1 1 3 1 4 0 9-6.4 9-11 0-6-4-8-7-8M8.2 2.5c.7-.5 1-.5 1-.5.4.2 1 1.4 1.4 3-1.6-.6-2.8-1.3-3-1.8l.6-.7M15 22c-1 0-1.2-.1-1.6-.4l-.1-.2a2 2 0 0 0-2.6 0l-.1.2c-.4.3-.5.4-1.6.4-2.8 0-7-5.4-7-9 0-6 4.5-6 5-6 2 0 2.5.4 3.4 1.2l.3.3a2 2 0 0 0 2.6 0l.3-.3c1-.8 1.5-1.2 3.4-1.2.5 0 5 .1 5 6 0 3.6-4.2 9-7 9`,
1214
- nature: `M15.5 8a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3m-7 0a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3m10.43-8h-.02c-.97 0-2.14.79-3.02 1.5A13.88 13.88 0 0 0 12 .99c-1.28 0-2.62.13-3.87.51C7.24.8 6.07 0 5.09 0h-.02C3.35 0 .07 2.67 0 7.03c-.04 2.47.28 4.23 1.04 5 .26.27.88.69 1.3.9.19 3.17.92 5.23 2.53 6.37.9.64 2.19.95 3.2 1.1-.03.2-.07.4-.07.6 0 1.77 2.35 3 4 3s4-1.23 4-3c0-.2-.04-.4-.07-.59 2.57-.38 5.43-1.87 5.92-7.58.4-.22.89-.57 1.1-.8.77-.76 1.09-2.52 1.05-5C23.93 2.67 20.65 0 18.93 0M3.23 9.13c-.24.29-.84 1.16-.9 1.24A9.67 9.67 0 0 1 2 7.08c.05-3.28 2.48-4.97 3.1-5.03.25.02.72.27 1.26.65A7.95 7.95 0 0 0 4 7.82c-.14.55-.4.86-.79 1.31M12 22c-.9 0-1.95-.7-2-1 0-.65.47-1.24 1-1.6v.6a1 1 0 1 0 2 0v-.6c.52.36 1 .95 1 1.6-.05.3-1.1 1-2 1m3-3.48v.02a4.75 4.75 0 0 0-1.26-1.02c1.09-.52 2.24-1.33 2.24-2.22 0-1.84-1.78-2.2-3.98-2.2s-3.98.36-3.98 2.2c0 .89 1.15 1.7 2.24 2.22A4.8 4.8 0 0 0 9 18.54v-.03a6.1 6.1 0 0 1-2.97-.84c-1.3-.92-1.84-3.04-1.86-6.48l.03-.04c.5-.82 1.49-1.45 1.8-3.1C6 6 7.36 4.42 8.36 3.53c1.01-.35 2.2-.53 3.59-.53 1.45 0 2.68.2 3.73.57 1 .9 2.32 2.46 2.32 4.48.31 1.65 1.3 2.27 1.8 3.1l.1.18c-.06 5.97-1.95 7.01-4.9 7.19m6.63-8.2l-.11-.2a7.59 7.59 0 0 0-.74-.98 3.02 3.02 0 0 1-.79-1.32 7.93 7.93 0 0 0-2.35-5.12c.53-.38 1-.63 1.26-.65.64.07 3.05 1.77 3.1 5.03.02 1.81-.35 3.22-.37 3.24`,
1215
- objects: `M12 0a9 9 0 0 0-5 16.5V21s2 3 5 3 5-3 5-3v-4.5A9 9 0 0 0 12 0zm0 2a7 7 0 1 1 0 14 7 7 0 0 1 0-14zM9 17.5a9 9 0 0 0 6 0v.8a7 7 0 0 1-3 .7 7 7 0 0 1-3-.7v-.8zm.2 3a8.9 8.9 0 0 0 2.8.5c1 0 1.9-.2 2.8-.5-.6.7-1.6 1.5-2.8 1.5-1.1 0-2.1-.8-2.8-1.5zm5.5-8.1c-.8 0-1.1-.8-1.5-1.8-.5-1-.7-1.5-1.2-1.5s-.8.5-1.3 1.5c-.4 1-.8 1.8-1.6 1.8h-.3c-.5-.2-.8-.7-1.3-1.8l-.2-1A3 3 0 0 0 7 9a1 1 0 0 1 0-2c1.7 0 2 1.4 2.2 2.1.5-1 1.3-2 2.8-2 1.5 0 2.3 1.1 2.7 2.1.2-.8.6-2.2 2.3-2.2a1 1 0 1 1 0 2c-.2 0-.3.5-.3.7a6.5 6.5 0 0 1-.3 1c-.5 1-.8 1.7-1.7 1.7`,
1216
- people: `M12 0a12 12 0 1 0 0 24 12 12 0 0 0 0-24m0 22a10 10 0 1 1 0-20 10 10 0 0 1 0 20M8 7a2 2 0 1 0 0 4 2 2 0 0 0 0-4m8 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4m-.8 8c-.7 1.2-1.8 2-3.3 2-1.5 0-2.7-.8-3.4-2H15m3-2H6a6 6 0 1 0 12 0`,
1217
- places: `M6.5 12a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5m0 3c-.3 0-.5-.2-.5-.5s.2-.5.5-.5.5.2.5.5-.2.5-.5.5m11-3a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5m0 3c-.3 0-.5-.2-.5-.5s.2-.5.5-.5.5.2.5.5-.2.5-.5.5m5-5.5l-1-.4-.1-.1h.6c.6 0 1-.4 1-1 0-1-.9-2-2-2h-.6l-.8-1.7A3 3 0 0 0 16.8 2H7.2a3 3 0 0 0-2.8 2.3L3.6 6H3a2 2 0 0 0-2 2c0 .6.4 1 1 1h.6v.1l-1 .4a2 2 0 0 0-1.4 2l.7 7.6a1 1 0 0 0 1 .9H3v1c0 1.1.9 2 2 2h2a2 2 0 0 0 2-2v-1h6v1c0 1.1.9 2 2 2h2a2 2 0 0 0 2-2v-1h1.1a1 1 0 0 0 1-.9l.7-7.5a2 2 0 0 0-1.3-2.1M6.3 4.9c.1-.5.5-.9 1-.9h9.5c.4 0 .8.4 1 .9L19.2 9H4.7l1.6-4.1zM7 21H5v-1h2v1zm12 0h-2v-1h2v1zm2.2-3H2.8l-.7-6.6.9-.4h18l.9.4-.7 6.6z`,
1218
- recent: `M13 4h-2v7H9v2h2v2h2v-2h4v-2h-4zm-1-4a12 12 0 1 0 0 24 12 12 0 0 0 0-24m0 22a10 10 0 1 1 0-20 10 10 0 0 1 0 20`,
1219
- symbols: `M0 0h11v2H0zm4 11h3V6h4V4H0v2h4zm11.5 6a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5m0-2.99a.5.5 0 0 1 0 .99c-.28 0-.5-.22-.5-.5s.22-.49.5-.49m6 5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5m0 2.99a.5.5 0 0 1-.5-.5.5.5 0 0 1 1 .01.5.5 0 0 1-.5.49m.5-9l-9 9 1.51 1.5 9-9zm-5-2c2.2 0 4-1.12 4-2.5V2s.98-.16 1.5.95C23 4.05 23 6 23 6s1-1.12 1-3.13C24-.02 21 0 21 0h-2v6.35A5.85 5.85 0 0 0 17 6c-2.2 0-4 1.12-4 2.5s1.8 2.5 4 2.5m-6.7 9.48L8.82 18.9a47.54 47.54 0 0 1-1.44 1.13c-.3-.3-.99-1.02-2.04-2.19.9-.83 1.47-1.46 1.72-1.89s.38-.87.38-1.33c0-.6-.27-1.18-.82-1.76-.54-.58-1.33-.87-2.35-.87-1 0-1.79.29-2.34.87-.56.6-.83 1.18-.83 1.79 0 .81.42 1.75 1.25 2.8a6.57 6.57 0 0 0-1.8 1.79 3.46 3.46 0 0 0-.51 1.83c0 .86.3 1.56.92 2.1a3.5 3.5 0 0 0 2.42.83c1.17 0 2.44-.38 3.81-1.14L8.23 24h2.82l-2.09-2.38 1.34-1.14zM3.56 14.1a1.02 1.02 0 0 1 .73-.28c.31 0 .56.08.75.25a.85.85 0 0 1 .28.66c0 .52-.42 1.11-1.26 1.78-.53-.65-.8-1.23-.8-1.74a.9.9 0 0 1 .3-.67m.18 7.9c-.43 0-.78-.12-1.06-.35-.28-.23-.41-.49-.41-.76 0-.6.5-1.3 1.52-2.09a31.23 31.23 0 0 0 2.25 2.44c-.92.5-1.69.76-2.3.76`,
1220
- };
1221
- const search = {
1222
- search: `M12.9 14.32a8 8 0 1 1 1.41-1.41l5.35 5.33-1.42 1.42-5.33-5.34zM8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z`,
1223
- delete: `M10 8.586L2.929 1.515 1.515 2.929 8.586 10l-7.071 7.071 1.414 1.414L10 11.414l7.071 7.071 1.414-1.414L11.414 10l7.071-7.071-1.414-1.414L10 8.586z`,
1224
- };
1225
-
1226
- const I18N = {
1227
- search: 'Search',
1228
- emojilist: 'List of emoji',
1229
- notfound: 'No Emoji Found',
1230
- clear: 'Clear',
1231
- categories: {
1232
- search: 'Search Results',
1233
- recent: 'Frequently Used',
1234
- people: 'Smileys & People',
1235
- nature: 'Animals & Nature',
1236
- foods: 'Food & Drink',
1237
- activity: 'Activity',
1238
- places: 'Travel & Places',
1239
- objects: 'Objects',
1240
- symbols: 'Symbols',
1241
- flags: 'Flags',
1242
- custom: 'Custom',
1243
- },
1244
- skintones: {
1245
- 1: 'Default Skin Tone',
1246
- 2: 'Light Skin Tone',
1247
- 3: 'Medium-Light Skin Tone',
1248
- 4: 'Medium Skin Tone',
1249
- 5: 'Medium-Dark Skin Tone',
1250
- 6: 'Dark Skin Tone',
1251
- },
1252
- };
1253
- class PickerComponent {
1254
- constructor(ngZone, renderer, ref, frequently, platformId) {
1255
- this.ngZone = ngZone;
1256
- this.renderer = renderer;
1257
- this.ref = ref;
1258
- this.frequently = frequently;
1259
- this.platformId = platformId;
1260
- this.perLine = 9;
1261
- this.totalFrequentLines = 4;
1262
- this.i18n = {};
1263
- this.style = {};
1264
- this.title = 'Emoji Mart™';
1265
- this.emoji = 'department_store';
1266
- this.darkMode = !!(typeof matchMedia === 'function' && matchMedia('(prefers-color-scheme: dark)').matches);
1267
- this.color = '#ae65c5';
1268
- this.hideObsolete = true;
1269
- /** all categories shown */
1270
- this.categories = [];
1271
- /** used to temporarily draw categories */
1272
- this.activeCategories = [];
1273
- this.set = 'apple';
1274
- this.skin = 1;
1275
- /** Renders the native unicode emoji */
1276
- this.isNative = false;
1277
- this.emojiSize = 24;
1278
- this.sheetSize = 64;
1279
- this.showPreview = true;
1280
- this.emojiTooltip = false;
1281
- this.autoFocus = false;
1282
- this.custom = [];
1283
- this.hideRecent = true;
1284
- this.notFoundEmoji = 'sleuth_or_spy';
1285
- this.categoriesIcons = categories;
1286
- this.searchIcons = search;
1287
- this.useButton = false;
1288
- this.enableFrequentEmojiSort = false;
1289
- this.enableSearch = true;
1290
- this.showSingleCategory = false;
1291
- this.virtualize = false;
1292
- this.virtualizeOffset = 0;
1293
- this.emojiClick = new EventEmitter();
1294
- this.emojiSelect = new EventEmitter();
1295
- this.skinChange = new EventEmitter();
1296
- this.scrollHeight = 0;
1297
- this.clientHeight = 0;
1298
- this.clientWidth = 0;
1299
- this.firstRender = true;
1300
- this.previewEmoji = null;
1301
- this.animationFrameRequestId = null;
1302
- this.NAMESPACE = 'emoji-mart';
1303
- this.measureScrollbar = 0;
1304
- this.RECENT_CATEGORY = {
1305
- id: 'recent',
1306
- name: 'Recent',
1307
- emojis: null,
1308
- };
1309
- this.SEARCH_CATEGORY = {
1310
- id: 'search',
1311
- name: 'Search',
1312
- emojis: null,
1313
- anchor: false,
1314
- };
1315
- this.CUSTOM_CATEGORY = {
1316
- id: 'custom',
1317
- name: 'Custom',
1318
- emojis: [],
1319
- };
1320
- this.backgroundImageFn = (set, sheetSize) => `https://unpkg.com/emoji-datasource-${this.set}@6.0.1/img/${this.set}/sheets-256/${this.sheetSize}.png`;
1321
- }
1322
- ngOnInit() {
1323
- // measure scroll
1324
- this.measureScrollbar = measureScrollbar();
1325
- this.i18n = Object.assign(Object.assign({}, I18N), this.i18n);
1326
- this.i18n.categories = Object.assign(Object.assign({}, I18N.categories), this.i18n.categories);
1327
- this.skin =
1328
- JSON.parse((isPlatformBrowser(this.platformId) && localStorage.getItem(`${this.NAMESPACE}.skin`)) ||
1329
- 'null') || this.skin;
1330
- const allCategories = [...categories$1];
1331
- if (this.custom.length > 0) {
1332
- this.CUSTOM_CATEGORY.emojis = this.custom.map(emoji => {
1333
- return Object.assign(Object.assign({}, emoji), {
1334
- // `<Category />` expects emoji to have an `id`.
1335
- id: emoji.shortNames[0], custom: true });
1336
- });
1337
- allCategories.push(this.CUSTOM_CATEGORY);
1338
- }
1339
- if (this.include !== undefined) {
1340
- allCategories.sort((a, b) => {
1341
- if (this.include.indexOf(a.id) > this.include.indexOf(b.id)) {
1342
- return 1;
1343
- }
1344
- return -1;
1345
- });
1346
- }
1347
- for (const category of allCategories) {
1348
- const isIncluded = this.include && this.include.length ? this.include.indexOf(category.id) > -1 : true;
1349
- const isExcluded = this.exclude && this.exclude.length ? this.exclude.indexOf(category.id) > -1 : false;
1350
- if (!isIncluded || isExcluded) {
1351
- continue;
1352
- }
1353
- if (this.emojisToShowFilter) {
1354
- const newEmojis = [];
1355
- const { emojis } = category;
1356
- // eslint-disable-next-line @typescript-eslint/prefer-for-of
1357
- for (let emojiIndex = 0; emojiIndex < emojis.length; emojiIndex++) {
1358
- const emoji = emojis[emojiIndex];
1359
- if (this.emojisToShowFilter(emoji)) {
1360
- newEmojis.push(emoji);
1361
- }
1362
- }
1363
- if (newEmojis.length) {
1364
- const newCategory = {
1365
- emojis: newEmojis,
1366
- name: category.name,
1367
- id: category.id,
1368
- };
1369
- this.categories.push(newCategory);
1370
- }
1371
- }
1372
- else {
1373
- this.categories.push(category);
1374
- }
1375
- this.categoriesIcons = Object.assign(Object.assign({}, categories), this.categoriesIcons);
1376
- this.searchIcons = Object.assign(Object.assign({}, search), this.searchIcons);
1377
- }
1378
- const includeRecent = this.include && this.include.length
1379
- ? this.include.indexOf(this.RECENT_CATEGORY.id) > -1
1380
- : true;
1381
- const excludeRecent = this.exclude && this.exclude.length
1382
- ? this.exclude.indexOf(this.RECENT_CATEGORY.id) > -1
1383
- : false;
1384
- if (includeRecent && !excludeRecent) {
1385
- this.hideRecent = false;
1386
- this.categories.unshift(this.RECENT_CATEGORY);
1387
- }
1388
- if (this.categories[0]) {
1389
- this.categories[0].first = true;
1390
- }
1391
- this.categories.unshift(this.SEARCH_CATEGORY);
1392
- this.selected = this.categories.filter(category => category.first)[0].name;
1393
- // Need to be careful if small number of categories
1394
- const categoriesToLoadFirst = Math.min(this.categories.length, 3);
1395
- this.setActiveCategories((this.activeCategories = this.categories.slice(0, categoriesToLoadFirst)));
1396
- // Trim last active category
1397
- const lastActiveCategoryEmojis = this.categories[categoriesToLoadFirst - 1].emojis.slice();
1398
- this.categories[categoriesToLoadFirst - 1].emojis = lastActiveCategoryEmojis.slice(0, 60);
1399
- setTimeout(() => {
1400
- // Restore last category
1401
- this.categories[categoriesToLoadFirst - 1].emojis = lastActiveCategoryEmojis;
1402
- this.setActiveCategories(this.categories);
1403
- // The `setTimeout` will trigger the change detection, but since we're inside
1404
- // the OnPush component we can run change detection locally starting from this
1405
- // component and going down to the children.
1406
- this.ref.detectChanges();
1407
- // eslint-disable-next-line @typescript-eslint/no-unused-expressions
1408
- isPlatformBrowser(this.platformId) &&
1409
- this.ngZone.runOutsideAngular(() => {
1410
- // The `updateCategoriesSize` doesn't change properties that are used
1411
- // in templates, thus this is run in the context of the root zone to avoid
1412
- // running change detection.
1413
- requestAnimationFrame(() => {
1414
- this.updateCategoriesSize();
1415
- });
1416
- });
1417
- });
1418
- this.ngZone.runOutsideAngular(() => {
1419
- // DOM events that are listened by Angular inside the template trigger change detection
1420
- // and also wrapped into additional functions that call `markForCheck()`. We listen `scroll`
1421
- // in the context of the root zone since it will not trigger change detection each time
1422
- // the `scroll` event is dispatched.
1423
- this.scrollListener = this.renderer.listen(this.scrollRef.nativeElement, 'scroll', () => {
1424
- this.handleScroll();
1425
- });
1426
- });
1427
- }
1428
- ngOnDestroy() {
1429
- var _a;
1430
- (_a = this.scrollListener) === null || _a === void 0 ? void 0 : _a.call(this);
1431
- // This is called here because the component might be destroyed
1432
- // but there will still be a `requestAnimationFrame` callback in the queue
1433
- // that calls `detectChanges()` on the `ViewRef`. This will lead to a runtime
1434
- // exception if the `detectChanges()` is called after the `ViewRef` is destroyed.
1435
- this.cancelAnimationFrame();
1436
- }
1437
- setActiveCategories(categoriesToMakeActive) {
1438
- if (this.showSingleCategory) {
1439
- this.activeCategories = categoriesToMakeActive.filter(x => x.name === this.selected || x === this.SEARCH_CATEGORY);
1440
- }
1441
- else {
1442
- this.activeCategories = categoriesToMakeActive;
1443
- }
1444
- }
1445
- updateCategoriesSize() {
1446
- this.categoryRefs.forEach(component => component.memoizeSize());
1447
- if (this.scrollRef) {
1448
- const target = this.scrollRef.nativeElement;
1449
- this.scrollHeight = target.scrollHeight;
1450
- this.clientHeight = target.clientHeight;
1451
- this.clientWidth = target.clientWidth;
1452
- }
1453
- }
1454
- handleAnchorClick($event) {
1455
- var _a;
1456
- this.updateCategoriesSize();
1457
- this.selected = $event.category.name;
1458
- this.setActiveCategories(this.categories);
1459
- if (this.SEARCH_CATEGORY.emojis) {
1460
- this.handleSearch(null);
1461
- (_a = this.searchRef) === null || _a === void 0 ? void 0 : _a.clear();
1462
- this.handleAnchorClick($event);
1463
- return;
1464
- }
1465
- const component = this.categoryRefs.find(n => n.id === $event.category.id);
1466
- if (component) {
1467
- let { top } = component;
1468
- if ($event.category.first) {
1469
- top = 0;
1470
- }
1471
- else {
1472
- top += 1;
1473
- }
1474
- this.scrollRef.nativeElement.scrollTop = top;
1475
- }
1476
- this.nextScroll = $event.category.name;
1477
- // handle component scrolling to load emojis
1478
- for (const category of this.categories) {
1479
- const componentToScroll = this.categoryRefs.find(({ id }) => id === category.id);
1480
- componentToScroll === null || componentToScroll === void 0 ? void 0 : componentToScroll.handleScroll(this.scrollRef.nativeElement.scrollTop);
1481
- }
1482
- }
1483
- categoryTrack(index, item) {
1484
- return item.id;
1485
- }
1486
- handleScroll(noSelectionChange = false) {
1487
- if (this.nextScroll) {
1488
- this.selected = this.nextScroll;
1489
- this.nextScroll = undefined;
1490
- this.ref.detectChanges();
1491
- return;
1492
- }
1493
- if (!this.scrollRef) {
1494
- return;
1495
- }
1496
- if (this.showSingleCategory) {
1497
- return;
1498
- }
1499
- let activeCategory;
1500
- if (this.SEARCH_CATEGORY.emojis) {
1501
- activeCategory = this.SEARCH_CATEGORY;
1502
- }
1503
- else {
1504
- const target = this.scrollRef.nativeElement;
1505
- // check scroll is not at bottom
1506
- if (target.scrollTop === 0) {
1507
- // hit the TOP
1508
- activeCategory = this.categories.find(n => n.first === true);
1509
- }
1510
- else if (target.scrollHeight - target.scrollTop === this.clientHeight) {
1511
- // scrolled to bottom activate last category
1512
- activeCategory = this.categories[this.categories.length - 1];
1513
- }
1514
- else {
1515
- // scrolling
1516
- for (const category of this.categories) {
1517
- const component = this.categoryRefs.find(({ id }) => id === category.id);
1518
- const active = component === null || component === void 0 ? void 0 : component.handleScroll(target.scrollTop);
1519
- if (active) {
1520
- activeCategory = category;
1521
- }
1522
- }
1523
- }
1524
- this.scrollTop = target.scrollTop;
1525
- }
1526
- // This will allow us to run the change detection only when the category changes.
1527
- if (!noSelectionChange && activeCategory && activeCategory.name !== this.selected) {
1528
- this.selected = activeCategory.name;
1529
- this.ref.detectChanges();
1530
- }
1531
- else if (noSelectionChange) {
1532
- this.ref.detectChanges();
1533
- }
1534
- }
1535
- handleSearch($emojis) {
1536
- this.SEARCH_CATEGORY.emojis = $emojis;
1537
- for (const component of this.categoryRefs.toArray()) {
1538
- if (component.name === 'Search') {
1539
- component.emojis = $emojis;
1540
- component.updateDisplay($emojis ? 'block' : 'none');
1541
- }
1542
- else {
1543
- component.updateDisplay($emojis ? 'none' : 'block');
1544
- }
1545
- }
1546
- this.scrollRef.nativeElement.scrollTop = 0;
1547
- this.handleScroll();
1548
- }
1549
- handleEnterKey($event, emoji) {
1550
- if (!emoji) {
1551
- if (this.SEARCH_CATEGORY.emojis !== null && this.SEARCH_CATEGORY.emojis.length) {
1552
- emoji = this.SEARCH_CATEGORY.emojis[0];
1553
- if (emoji) {
1554
- this.emojiSelect.emit({ $event, emoji });
1555
- }
1556
- else {
1557
- return;
1558
- }
1559
- }
1560
- }
1561
- if (!this.hideRecent && !this.recent && emoji) {
1562
- this.frequently.add(emoji);
1563
- }
1564
- const component = this.categoryRefs.toArray()[1];
1565
- if (component && this.enableFrequentEmojiSort) {
1566
- component.updateRecentEmojis();
1567
- component.ref.markForCheck();
1568
- }
1569
- }
1570
- handleEmojiOver($event) {
1571
- if (!this.showPreview || !this.previewRef) {
1572
- return;
1573
- }
1574
- const emojiData = this.CUSTOM_CATEGORY.emojis.find((customEmoji) => customEmoji.id === $event.emoji.id);
1575
- if (emojiData) {
1576
- $event.emoji = Object.assign({}, emojiData);
1577
- }
1578
- this.previewEmoji = $event.emoji;
1579
- this.cancelAnimationFrame();
1580
- this.ref.detectChanges();
1581
- }
1582
- handleEmojiLeave() {
1583
- if (!this.showPreview || !this.previewRef) {
1584
- return;
1585
- }
1586
- // Note: `handleEmojiLeave` will be invoked outside of the Angular zone because of the `mouseleave`
1587
- // event set up outside of the Angular zone in `ngx-emoji`. See `setupMouseLeaveListener`.
1588
- // This is done explicitly because we don't have to run redundant change detection since we
1589
- // would still want to leave the Angular zone here when scheduling animation frame.
1590
- this.animationFrameRequestId = requestAnimationFrame(() => {
1591
- this.previewEmoji = null;
1592
- this.ref.detectChanges();
1593
- });
1594
- }
1595
- handleEmojiClick($event) {
1596
- this.emojiClick.emit($event);
1597
- this.emojiSelect.emit($event);
1598
- this.handleEnterKey($event.$event, $event.emoji);
1599
- }
1600
- handleSkinChange(skin) {
1601
- this.skin = skin;
1602
- localStorage.setItem(`${this.NAMESPACE}.skin`, String(skin));
1603
- this.skinChange.emit(skin);
1604
- }
1605
- getWidth() {
1606
- if (this.style && this.style.width) {
1607
- return this.style.width;
1608
- }
1609
- return this.perLine * (this.emojiSize + 12) + 12 + 2 + this.measureScrollbar + 'px';
1610
- }
1611
- cancelAnimationFrame() {
1612
- if (this.animationFrameRequestId !== null) {
1613
- cancelAnimationFrame(this.animationFrameRequestId);
1614
- this.animationFrameRequestId = null;
1615
- }
1616
- }
1617
- }
1618
- PickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: PickerComponent, deps: [{ token: i0.NgZone }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: EmojiFrequentlyService }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Component });
1619
- PickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: PickerComponent, selector: "emoji-mart", inputs: { perLine: "perLine", totalFrequentLines: "totalFrequentLines", i18n: "i18n", style: "style", title: "title", emoji: "emoji", darkMode: "darkMode", color: "color", hideObsolete: "hideObsolete", categories: "categories", activeCategories: "activeCategories", set: "set", skin: "skin", isNative: "isNative", emojiSize: "emojiSize", sheetSize: "sheetSize", emojisToShowFilter: "emojisToShowFilter", showPreview: "showPreview", emojiTooltip: "emojiTooltip", autoFocus: "autoFocus", custom: "custom", hideRecent: "hideRecent", imageUrlFn: "imageUrlFn", include: "include", exclude: "exclude", notFoundEmoji: "notFoundEmoji", categoriesIcons: "categoriesIcons", searchIcons: "searchIcons", useButton: "useButton", enableFrequentEmojiSort: "enableFrequentEmojiSort", enableSearch: "enableSearch", showSingleCategory: "showSingleCategory", virtualize: "virtualize", virtualizeOffset: "virtualizeOffset", recent: "recent", backgroundImageFn: "backgroundImageFn" }, outputs: { emojiClick: "emojiClick", emojiSelect: "emojiSelect", skinChange: "skinChange" }, viewQueries: [{ propertyName: "scrollRef", first: true, predicate: ["scrollRef"], descendants: true, static: true }, { propertyName: "previewRef", first: true, predicate: PreviewComponent, descendants: true }, { propertyName: "searchRef", first: true, predicate: SearchComponent, descendants: true }, { propertyName: "categoryRefs", predicate: CategoryComponent, descendants: true }], ngImport: i0, template: "<section\n class=\"emoji-mart {{ darkMode ? 'emoji-mart-dark' : '' }}\"\n [style.width]=\"getWidth()\"\n [ngStyle]=\"style\"\n>\n <div class=\"emoji-mart-bar\">\n <emoji-mart-anchors\n [categories]=\"categories\"\n (anchorClick)=\"handleAnchorClick($event)\"\n [color]=\"color\"\n [selected]=\"selected\"\n [i18n]=\"i18n\"\n [icons]=\"categoriesIcons\"\n ></emoji-mart-anchors>\n </div>\n <emoji-search\n *ngIf=\"enableSearch\"\n [i18n]=\"i18n\"\n (searchResults)=\"handleSearch($event)\"\n (enterKey)=\"handleEnterKey($event)\"\n [include]=\"include\"\n [exclude]=\"exclude\"\n [custom]=\"custom\"\n [autoFocus]=\"autoFocus\"\n [icons]=\"searchIcons\"\n [emojisToShowFilter]=\"emojisToShowFilter\"\n ></emoji-search>\n <section #scrollRef class=\"emoji-mart-scroll\" [attr.aria-label]=\"i18n.emojilist\">\n <emoji-category\n *ngFor=\"let category of activeCategories; let idx = index; trackBy: categoryTrack\"\n [id]=\"category.id\"\n [name]=\"category.name\"\n [emojis]=\"category.emojis\"\n [perLine]=\"perLine\"\n [totalFrequentLines]=\"totalFrequentLines\"\n [hasStickyPosition]=\"isNative\"\n [i18n]=\"i18n\"\n [hideObsolete]=\"hideObsolete\"\n [notFoundEmoji]=\"notFoundEmoji\"\n [custom]=\"category.id === RECENT_CATEGORY.id ? CUSTOM_CATEGORY.emojis : undefined\"\n [recent]=\"category.id === RECENT_CATEGORY.id ? recent : undefined\"\n [virtualize]=\"virtualize\"\n [virtualizeOffset]=\"virtualizeOffset\"\n [emojiIsNative]=\"isNative\"\n [emojiSkin]=\"skin\"\n [emojiSize]=\"emojiSize\"\n [emojiSet]=\"set\"\n [emojiSheetSize]=\"sheetSize\"\n [emojiForceSize]=\"isNative\"\n [emojiTooltip]=\"emojiTooltip\"\n [emojiBackgroundImageFn]=\"backgroundImageFn\"\n [emojiImageUrlFn]=\"imageUrlFn\"\n [emojiUseButton]=\"useButton\"\n (emojiOver)=\"handleEmojiOver($event)\"\n (emojiLeaveOutsideAngular)=\"handleEmojiLeave()\"\n (emojiClick)=\"handleEmojiClick($event)\"\n ></emoji-category>\n </section>\n <div class=\"emoji-mart-bar\" *ngIf=\"showPreview\">\n <emoji-preview\n [attr.title]=\"title\"\n [emoji]=\"previewEmoji\"\n [idleEmoji]=\"emoji\"\n [emojiIsNative]=\"isNative\"\n [emojiSize]=\"38\"\n [emojiSkin]=\"skin\"\n [emojiSet]=\"set\"\n [i18n]=\"i18n\"\n [emojiSheetSize]=\"sheetSize\"\n [emojiBackgroundImageFn]=\"backgroundImageFn\"\n [emojiImageUrlFn]=\"imageUrlFn\"\n (skinChange)=\"handleSkinChange($event)\"\n ></emoji-preview>\n </div>\n</section>\n", dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: AnchorsComponent, selector: "emoji-mart-anchors", inputs: ["categories", "color", "selected", "i18n", "icons"], outputs: ["anchorClick"] }, { kind: "component", type: CategoryComponent, selector: "emoji-category", inputs: ["emojis", "hasStickyPosition", "name", "perLine", "totalFrequentLines", "recent", "custom", "i18n", "id", "hideObsolete", "notFoundEmoji", "virtualize", "virtualizeOffset", "emojiIsNative", "emojiSkin", "emojiSize", "emojiSet", "emojiSheetSize", "emojiForceSize", "emojiTooltip", "emojiBackgroundImageFn", "emojiImageUrlFn", "emojiUseButton"], outputs: ["emojiOver", "emojiLeaveOutsideAngular", "emojiClick"] }, { kind: "component", type: SearchComponent, selector: "emoji-search", inputs: ["maxResults", "autoFocus", "i18n", "include", "exclude", "custom", "icons", "emojisToShowFilter"], outputs: ["searchResults", "enterKey"] }, { kind: "component", type: PreviewComponent, selector: "emoji-preview", inputs: ["title", "emoji", "idleEmoji", "i18n", "emojiIsNative", "emojiSkin", "emojiSize", "emojiSet", "emojiSheetSize", "emojiBackgroundImageFn", "emojiImageUrlFn"], outputs: ["skinChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1620
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: PickerComponent, decorators: [{
1621
- type: Component,
1622
- args: [{ selector: 'emoji-mart', changeDetection: ChangeDetectionStrategy.OnPush, preserveWhitespaces: false, template: "<section\n class=\"emoji-mart {{ darkMode ? 'emoji-mart-dark' : '' }}\"\n [style.width]=\"getWidth()\"\n [ngStyle]=\"style\"\n>\n <div class=\"emoji-mart-bar\">\n <emoji-mart-anchors\n [categories]=\"categories\"\n (anchorClick)=\"handleAnchorClick($event)\"\n [color]=\"color\"\n [selected]=\"selected\"\n [i18n]=\"i18n\"\n [icons]=\"categoriesIcons\"\n ></emoji-mart-anchors>\n </div>\n <emoji-search\n *ngIf=\"enableSearch\"\n [i18n]=\"i18n\"\n (searchResults)=\"handleSearch($event)\"\n (enterKey)=\"handleEnterKey($event)\"\n [include]=\"include\"\n [exclude]=\"exclude\"\n [custom]=\"custom\"\n [autoFocus]=\"autoFocus\"\n [icons]=\"searchIcons\"\n [emojisToShowFilter]=\"emojisToShowFilter\"\n ></emoji-search>\n <section #scrollRef class=\"emoji-mart-scroll\" [attr.aria-label]=\"i18n.emojilist\">\n <emoji-category\n *ngFor=\"let category of activeCategories; let idx = index; trackBy: categoryTrack\"\n [id]=\"category.id\"\n [name]=\"category.name\"\n [emojis]=\"category.emojis\"\n [perLine]=\"perLine\"\n [totalFrequentLines]=\"totalFrequentLines\"\n [hasStickyPosition]=\"isNative\"\n [i18n]=\"i18n\"\n [hideObsolete]=\"hideObsolete\"\n [notFoundEmoji]=\"notFoundEmoji\"\n [custom]=\"category.id === RECENT_CATEGORY.id ? CUSTOM_CATEGORY.emojis : undefined\"\n [recent]=\"category.id === RECENT_CATEGORY.id ? recent : undefined\"\n [virtualize]=\"virtualize\"\n [virtualizeOffset]=\"virtualizeOffset\"\n [emojiIsNative]=\"isNative\"\n [emojiSkin]=\"skin\"\n [emojiSize]=\"emojiSize\"\n [emojiSet]=\"set\"\n [emojiSheetSize]=\"sheetSize\"\n [emojiForceSize]=\"isNative\"\n [emojiTooltip]=\"emojiTooltip\"\n [emojiBackgroundImageFn]=\"backgroundImageFn\"\n [emojiImageUrlFn]=\"imageUrlFn\"\n [emojiUseButton]=\"useButton\"\n (emojiOver)=\"handleEmojiOver($event)\"\n (emojiLeaveOutsideAngular)=\"handleEmojiLeave()\"\n (emojiClick)=\"handleEmojiClick($event)\"\n ></emoji-category>\n </section>\n <div class=\"emoji-mart-bar\" *ngIf=\"showPreview\">\n <emoji-preview\n [attr.title]=\"title\"\n [emoji]=\"previewEmoji\"\n [idleEmoji]=\"emoji\"\n [emojiIsNative]=\"isNative\"\n [emojiSize]=\"38\"\n [emojiSkin]=\"skin\"\n [emojiSet]=\"set\"\n [i18n]=\"i18n\"\n [emojiSheetSize]=\"sheetSize\"\n [emojiBackgroundImageFn]=\"backgroundImageFn\"\n [emojiImageUrlFn]=\"imageUrlFn\"\n (skinChange)=\"handleSkinChange($event)\"\n ></emoji-preview>\n </div>\n</section>\n" }]
1623
- }], ctorParameters: function () {
1624
- return [{ type: i0.NgZone }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }, { type: EmojiFrequentlyService }, { type: undefined, decorators: [{
1625
- type: Inject,
1626
- args: [PLATFORM_ID]
1627
- }] }];
1628
- }, propDecorators: { perLine: [{
1629
- type: Input
1630
- }], totalFrequentLines: [{
1631
- type: Input
1632
- }], i18n: [{
1633
- type: Input
1634
- }], style: [{
1635
- type: Input
1636
- }], title: [{
1637
- type: Input
1638
- }], emoji: [{
1639
- type: Input
1640
- }], darkMode: [{
1641
- type: Input
1642
- }], color: [{
1643
- type: Input
1644
- }], hideObsolete: [{
1645
- type: Input
1646
- }], categories: [{
1647
- type: Input
1648
- }], activeCategories: [{
1649
- type: Input
1650
- }], set: [{
1651
- type: Input
1652
- }], skin: [{
1653
- type: Input
1654
- }], isNative: [{
1655
- type: Input
1656
- }], emojiSize: [{
1657
- type: Input
1658
- }], sheetSize: [{
1659
- type: Input
1660
- }], emojisToShowFilter: [{
1661
- type: Input
1662
- }], showPreview: [{
1663
- type: Input
1664
- }], emojiTooltip: [{
1665
- type: Input
1666
- }], autoFocus: [{
1667
- type: Input
1668
- }], custom: [{
1669
- type: Input
1670
- }], hideRecent: [{
1671
- type: Input
1672
- }], imageUrlFn: [{
1673
- type: Input
1674
- }], include: [{
1675
- type: Input
1676
- }], exclude: [{
1677
- type: Input
1678
- }], notFoundEmoji: [{
1679
- type: Input
1680
- }], categoriesIcons: [{
1681
- type: Input
1682
- }], searchIcons: [{
1683
- type: Input
1684
- }], useButton: [{
1685
- type: Input
1686
- }], enableFrequentEmojiSort: [{
1687
- type: Input
1688
- }], enableSearch: [{
1689
- type: Input
1690
- }], showSingleCategory: [{
1691
- type: Input
1692
- }], virtualize: [{
1693
- type: Input
1694
- }], virtualizeOffset: [{
1695
- type: Input
1696
- }], recent: [{
1697
- type: Input
1698
- }], emojiClick: [{
1699
- type: Output
1700
- }], emojiSelect: [{
1701
- type: Output
1702
- }], skinChange: [{
1703
- type: Output
1704
- }], scrollRef: [{
1705
- type: ViewChild,
1706
- args: ['scrollRef', { static: true }]
1707
- }], previewRef: [{
1708
- type: ViewChild,
1709
- args: [PreviewComponent, { static: false }]
1710
- }], searchRef: [{
1711
- type: ViewChild,
1712
- args: [SearchComponent, { static: false }]
1713
- }], categoryRefs: [{
1714
- type: ViewChildren,
1715
- args: [CategoryComponent]
1716
- }], backgroundImageFn: [{
1717
- type: Input
1718
- }] } });
1719
-
1720
- class PickerModule {
1721
- }
1722
- PickerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: PickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1723
- PickerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.8", ngImport: i0, type: PickerModule, declarations: [PickerComponent,
1724
- AnchorsComponent,
1725
- CategoryComponent,
1726
- SearchComponent,
1727
- PreviewComponent,
1728
- SkinComponent], imports: [CommonModule, FormsModule, EmojiModule], exports: [PickerComponent,
1729
- AnchorsComponent,
1730
- CategoryComponent,
1731
- SearchComponent,
1732
- PreviewComponent,
1733
- SkinComponent] });
1734
- PickerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: PickerModule, imports: [CommonModule, FormsModule, EmojiModule] });
1735
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: PickerModule, decorators: [{
1736
- type: NgModule,
1737
- args: [{
1738
- imports: [CommonModule, FormsModule, EmojiModule],
1739
- exports: [
1740
- PickerComponent,
1741
- AnchorsComponent,
1742
- CategoryComponent,
1743
- SearchComponent,
1744
- PreviewComponent,
1745
- SkinComponent,
1746
- ],
1747
- declarations: [
1748
- PickerComponent,
1749
- AnchorsComponent,
1750
- CategoryComponent,
1751
- SearchComponent,
1752
- PreviewComponent,
1753
- SkinComponent,
1754
- ],
1755
- }]
1756
- }] });
1757
-
1758
- /**
1759
- * Generated bundle index. Do not edit.
1760
- */
1761
-
1762
- export { AnchorsComponent, CategoryComponent, EmojiFrequentlyService, EmojiSearch, PickerComponent, PickerModule, PreviewComponent, SearchComponent, SkinComponent };
1763
- //# sourceMappingURL=ctrl-ngx-emoji-mart.mjs.map