|
7 | 7 | [value]="selectedCategory" |
8 | 8 | > |
9 | 9 | <label igxLabel>Select category</label> |
10 | | - @for (option of categories; track option) { |
| 10 | + @for (option of categories; track option.category) { |
11 | 11 | <igx-select-item |
12 | 12 | [value]="option.category" |
13 | 13 | > |
|
17 | 17 | </igx-select> |
18 | 18 | </div> |
19 | 19 | <igx-input-group class="sample__header-search" type="search"> |
20 | | - <input #input igxInput placeholder="Search by icon name or keyword" /> |
| 20 | + <input #input igxInput placeholder="Search by icon name or keyword" (input)="onSearchInput(input.value)" /> |
21 | 21 | <igx-prefix> |
22 | 22 | <igx-icon>search</igx-icon> |
23 | 23 | </igx-prefix> |
24 | 24 | @if (input.value.length > 0) { |
25 | 25 | <igx-suffix |
26 | | - (click)="input.value = ''" |
| 26 | + (click)="input.value = ''; clearSearch()" |
27 | 27 | > |
28 | 28 | <igx-icon>clear</igx-icon> |
29 | 29 | </igx-suffix> |
30 | 30 | } |
31 | 31 | </igx-input-group> |
32 | 32 | </div> |
33 | 33 | <div class="sample__body"> |
34 | | - @if ((allIcons | filterByName: input.value | categoriesFilter: selectedCategory); as fResults) { |
35 | | - @for (group of fResults; track group) { |
| 34 | + @if (filteredResults$ | async; as fResults) { |
| 35 | + @for (group of fResults; track trackByCategory($index, group)) { |
36 | 36 | <article class="sample__body-inner"> |
37 | 37 | <header class="sample__body-title"> |
38 | 38 | {{ group.category }} |
39 | 39 | </header> |
40 | 40 | <section class="sample__body-section"> |
41 | 41 | <div class="sample__grid"> |
42 | | - @for (icon of group.icons; track icon) { |
| 42 | + @for (icon of group.icons; track trackByIcon($index, icon)) { |
43 | 43 | <div |
44 | 44 | class="sample__grid-item" |
| 45 | + (mouseenter)="onIconMouseEnter(icon)" |
| 46 | + (mouseleave)="onIconMouseLeave()" |
45 | 47 | > |
46 | 48 | <button |
47 | 49 | [value]="icon.name" |
48 | | - [title]=" |
49 | | - 'Copy "' + |
50 | | - icon.name + |
51 | | - '" to clipboard' |
52 | | - " |
| 50 | + [title]="'Copy "' + icon.name + '" to clipboard'" |
53 | 51 | (click)="copyValue($event, icon.name)" |
54 | 52 | class="sample__grid-item-clipboard" |
55 | 53 | > |
|
59 | 57 | <igx-icon |
60 | 58 | class="sample__grid-icon" |
61 | 59 | family="imx-icons" |
62 | | - name="{{ icon.name }}" |
63 | | - ></igx-icon> |
| 60 | + [name]="icon.name"> |
| 61 | + </igx-icon> |
64 | 62 | <span |
65 | 63 | class="sample__grid-icon-name" |
66 | | - title="{{ icon.name }}" |
67 | | - >{{ icon.name }}</span |
68 | | - > |
69 | | - </div> |
| 64 | + [title]="icon.name"> |
| 65 | + {{ icon.name }} |
| 66 | + </span> |
| 67 | + </div> |
| 68 | + @if (hoveredIcon === icon) { |
70 | 69 | <button |
71 | 70 | (click)="downloadFile(icon)" |
72 | | - igxripple |
73 | 71 | class="sample__grid-item-download" |
74 | 72 | igxButton="contained" |
75 | | - > |
| 73 | + igxRipple> |
76 | 74 | <igx-icon>arrow_downward</igx-icon> |
77 | 75 | <span>SVG</span> |
78 | 76 | </button> |
79 | | - </div> |
80 | | - } |
| 77 | + } |
| 78 | + </div> |
| 79 | + } |
81 | 80 | </div> |
82 | 81 | </section> |
83 | 82 | </article> |
|
0 commit comments