@searchstax-inc/searchstudio-ux-angular 4.1.68 → 4.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.
Files changed (64) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +323 -264
  3. package/fesm2022/searchstax-inc-searchstudio-ux-angular.mjs +994 -788
  4. package/fesm2022/searchstax-inc-searchstudio-ux-angular.mjs.map +1 -1
  5. package/package.json +6 -8
  6. package/types/searchstax-inc-searchstudio-ux-angular.d.ts +388 -0
  7. package/esm2022/lib/components/searchstax-input/searchstax-input.component.mjs +0 -81
  8. package/esm2022/lib/components/searchstax-results/searchstax-results.component.mjs +0 -88
  9. package/esm2022/lib/components/searchstax-search-answer/searchstax-search-answer.component.mjs +0 -49
  10. package/esm2022/lib/components/searchstax-search-external/searchstax-search-external.component.mjs +0 -41
  11. package/esm2022/lib/components/searchstax-search-facets/searchstax-search-facets.component.mjs +0 -119
  12. package/esm2022/lib/components/searchstax-search-location/searchstax-search-location.component.mjs +0 -92
  13. package/esm2022/lib/components/searchstax-search-overview/searchstax-search-overview.component.mjs +0 -42
  14. package/esm2022/lib/components/searchstax-search-pagination/searchstax-search-pagination.component.mjs +0 -64
  15. package/esm2022/lib/components/searchstax-search-related/searchstax-search-related.component.mjs +0 -45
  16. package/esm2022/lib/components/searchstax-search-sorting/searchstax-search-sorting.component.mjs +0 -46
  17. package/esm2022/lib/components/searchstax-wrapper.component.mjs +0 -93
  18. package/esm2022/lib/components/templates/SearchstaxLocationWidgetTemplateConfig.mjs +0 -91
  19. package/esm2022/lib/components/templates/searchstax-search-answer-template.mjs +0 -119
  20. package/esm2022/lib/components/templates/searchstax-search-external-template.mjs +0 -107
  21. package/esm2022/lib/components/templates/searchstax-search-facet-desktop-template.mjs +0 -209
  22. package/esm2022/lib/components/templates/searchstax-search-facet-mobile-template.mjs +0 -343
  23. package/esm2022/lib/components/templates/searchstax-search-input-template.mjs +0 -126
  24. package/esm2022/lib/components/templates/searchstax-search-location-template.mjs +0 -152
  25. package/esm2022/lib/components/templates/searchstax-search-no-results-template.mjs +0 -83
  26. package/esm2022/lib/components/templates/searchstax-search-overview-template.mjs +0 -87
  27. package/esm2022/lib/components/templates/searchstax-search-pagination-infinite-template.mjs +0 -60
  28. package/esm2022/lib/components/templates/searchstax-search-pagination-template.mjs +0 -96
  29. package/esm2022/lib/components/templates/searchstax-search-related-template.mjs +0 -81
  30. package/esm2022/lib/components/templates/searchstax-search-results-template.mjs +0 -181
  31. package/esm2022/lib/components/templates/searchstax-search-sorting-template.mjs +0 -76
  32. package/esm2022/lib/searchstudio-ux-angular.module.mjs +0 -138
  33. package/esm2022/lib/services/store-service.service.mjs +0 -17
  34. package/esm2022/public-api.mjs +0 -30
  35. package/esm2022/searchstax-inc-searchstudio-ux-angular.mjs +0 -5
  36. package/index.d.ts +0 -5
  37. package/lib/components/searchstax-input/searchstax-input.component.d.ts +0 -37
  38. package/lib/components/searchstax-results/searchstax-results.component.d.ts +0 -27
  39. package/lib/components/searchstax-search-answer/searchstax-search-answer.component.d.ts +0 -20
  40. package/lib/components/searchstax-search-external/searchstax-search-external.component.d.ts +0 -17
  41. package/lib/components/searchstax-search-facets/searchstax-search-facets.component.d.ts +0 -38
  42. package/lib/components/searchstax-search-location/searchstax-search-location.component.d.ts +0 -33
  43. package/lib/components/searchstax-search-overview/searchstax-search-overview.component.d.ts +0 -17
  44. package/lib/components/searchstax-search-pagination/searchstax-search-pagination.component.d.ts +0 -21
  45. package/lib/components/searchstax-search-related/searchstax-search-related.component.d.ts +0 -19
  46. package/lib/components/searchstax-search-sorting/searchstax-search-sorting.component.d.ts +0 -18
  47. package/lib/components/searchstax-wrapper.component.d.ts +0 -31
  48. package/lib/components/templates/SearchstaxLocationWidgetTemplateConfig.d.ts +0 -13
  49. package/lib/components/templates/searchstax-search-answer-template.d.ts +0 -7
  50. package/lib/components/templates/searchstax-search-external-template.d.ts +0 -7
  51. package/lib/components/templates/searchstax-search-facet-desktop-template.d.ts +0 -7
  52. package/lib/components/templates/searchstax-search-facet-mobile-template.d.ts +0 -7
  53. package/lib/components/templates/searchstax-search-input-template.d.ts +0 -7
  54. package/lib/components/templates/searchstax-search-location-template.d.ts +0 -7
  55. package/lib/components/templates/searchstax-search-no-results-template.d.ts +0 -7
  56. package/lib/components/templates/searchstax-search-overview-template.d.ts +0 -7
  57. package/lib/components/templates/searchstax-search-pagination-infinite-template.d.ts +0 -7
  58. package/lib/components/templates/searchstax-search-pagination-template.d.ts +0 -7
  59. package/lib/components/templates/searchstax-search-related-template.d.ts +0 -7
  60. package/lib/components/templates/searchstax-search-results-template.d.ts +0 -7
  61. package/lib/components/templates/searchstax-search-sorting-template.d.ts +0 -7
  62. package/lib/searchstudio-ux-angular.module.d.ts +0 -32
  63. package/lib/services/store-service.service.d.ts +0 -8
  64. package/public-api.d.ts +0 -26
package/README.md CHANGED
@@ -208,31 +208,30 @@ It receives the following props:
208
208
  }"
209
209
  >
210
210
  <div class="searchstax-answer-title">Smart Answers</div>
211
- <div
212
- class="searchstax-answer-error"
213
- *ngIf="answerData.shouldShowAnswerError"
214
- [innerHTML]="answerData.answerErrorMessage"
215
- ></div>
211
+ @if (answerData.shouldShowAnswerError) {
212
+ <div
213
+ class="searchstax-answer-error"
214
+ [innerHTML]="answerData.answerErrorMessage"
215
+ ></div>
216
+ }
216
217
  <div
217
218
  class="searchstax-answer-description"
218
219
  [innerHTML]="answerData.fullAnswerFormatted"
219
220
  ></div>
220
- <div
221
- *ngIf="answerData.answerLoading"
222
- class="searchstax-answer-loading"
223
- ></div>
224
- </div>
225
- <div
226
- *ngIf="answerData.showMoreButtonVisible"
227
- class="searchstax-answer-load-more-button-container"
228
- >
229
- <button
230
- class="searchstax-answer-load-more-button"
231
- (click)="showMore($event, context)"
232
- >
233
- Show More
234
- </button>
221
+ @if (answerData.answerLoading) {
222
+ <div class="searchstax-answer-loading"></div>
223
+ }
235
224
  </div>
225
+ @if (answerData.showMoreButtonVisible) {
226
+ <div class="searchstax-answer-load-more-button-container">
227
+ <button
228
+ class="searchstax-answer-load-more-button"
229
+ (click)="showMore($event, context)"
230
+ >
231
+ Show More
232
+ </button>
233
+ </div>
234
+ }
236
235
  </div>
237
236
  <div class="searchstax-answer-footer">
238
237
  <div id="feedbackWidgetContainer"></div>
@@ -307,10 +306,10 @@ It receives the following props:
307
306
  [ngClass]="{ hidden: suggestions.length === 0 }"
308
307
  (mouseleave)="onMouseLeave(context)"
309
308
  >
310
- <div
311
- class="searchstax-autosuggest-item"
312
- *ngFor="let suggestion of suggestions"
313
- >
309
+ @for (suggestion of suggestions; track $index) {
310
+ <div
311
+ class="searchstax-autosuggest-item"
312
+ >
314
313
  <div
315
314
  class="searchstax-autosuggest-item-term-container"
316
315
  [innerHtml]="suggestion.term"
@@ -318,7 +317,8 @@ It receives the following props:
318
317
  tabindex="0"
319
318
  (click)="onMouseClick($event, context)"
320
319
  ></div>
321
- </div>
320
+ </div>
321
+ }
322
322
  </div>
323
323
  </div>
324
324
  <app-searchstax-search-location
@@ -589,11 +589,11 @@ const locationWidgetConfig = {
589
589
  let-locationError="locationError"
590
590
  let-getCurrentLocation="getCurrentLocation"
591
591
  >
592
- <div
593
- class="searchstax-location-input-container"
594
- data-test-id="searchstax-location-input-container"
595
- *ngIf="locationData"
596
- >
592
+ @if (locationData) {
593
+ <div
594
+ class="searchstax-location-input-container"
595
+ data-test-id="searchstax-location-input-container"
596
+ >
597
597
  <div class="searchstax-location-input-wrapper">
598
598
  <span class="searchstax-location-input-label">NEAR</span>
599
599
  <div class="searchstax-location-input-wrapper-inner">
@@ -618,29 +618,34 @@ const locationWidgetConfig = {
618
618
  Use my current location
619
619
  </button>
620
620
  </div>
621
- <span
622
- *ngIf="locationData.shouldShowLocationDistanceDropdown"
623
- class="searchstax-location-input-label"
624
- >WITHIN</span
625
- >
626
- <select
627
- *ngIf="locationData.shouldShowLocationDistanceDropdown"
628
- id="searchstax-location-radius-select"
629
- class="searchstax-location-radius-select"
630
- aria-label="Search Location Radius Select"
631
- data-test-id="searchstax-location-radius-select"
632
- (change)="radiusChange($event, context)"
633
- [(ngModel)]="context.selectValue"
634
- >
635
- <option
636
- *ngFor="let value of locationData.locationSearchDistanceValues"
637
- [value]="value.value"
621
+ @if (locationData.shouldShowLocationDistanceDropdown) {
622
+ <span
623
+ class="searchstax-location-input-label"
624
+ >WITHIN</span
638
625
  >
639
- {{ value.label }}
640
- </option>
641
- </select>
626
+ }
627
+ @if (locationData.shouldShowLocationDistanceDropdown) {
628
+ <select
629
+ id="searchstax-location-radius-select"
630
+ class="searchstax-location-radius-select"
631
+ aria-label="Search Location Radius Select"
632
+ data-test-id="searchstax-location-radius-select"
633
+ (change)="radiusChange($event, context)"
634
+ [(ngModel)]="context.selectValue"
635
+ >
636
+ @for (
637
+ value of locationData.locationSearchDistanceValues;
638
+ track value.value
639
+ ) {
640
+ <option [value]="value.value">
641
+ {{ value.label }}
642
+ </option>
643
+ }
644
+ </select>
645
+ }
642
646
  </div>
643
- </div>
647
+ </div>
648
+ }
644
649
  </ng-template>
645
650
 
646
651
  </app-searchstax-search-location>
@@ -707,10 +712,13 @@ It receives following props:
707
712
  let-isImage="isImage"
708
713
  let-context="context"
709
714
  >
710
- <div class="searchstax-search-results">
711
- <a
712
- *ngFor="let searchResult of searchResults"
713
- [href]="searchResult.url"
715
+ <div class="searchstax-search-results" id="searchstax-search-results">
716
+ @for (
717
+ searchResult of searchResults ?? [];
718
+ track searchResult.uniqueId
719
+ ) {
720
+ <a
721
+ [href]="searchResult.url"
714
722
  [attr.data-searchstax-unique-result-id]="searchResult.uniqueId"
715
723
  (click)="resultClicked(searchResult, $event, context)"
716
724
  (keyup.enter)="resultClicked(searchResult, $event, context)"
@@ -723,21 +731,22 @@ It receives following props:
723
731
  class="searchstax-search-result"
724
732
  [ngClass]="{ 'has-thumbnail': searchResult.thumbnail }"
725
733
  >
726
- <div
727
- *ngIf="searchResult.promoted"
728
- class="searchstax-search-result-promoted"
729
- ></div>
730
- <div
731
- *ngIf="searchResult.ribbon"
732
- [innerHTML]="searchResult.ribbon"
733
- class="searchstax-search-result-ribbon"
734
- ></div>
735
- <img
736
- alt=""
737
- *ngIf="searchResult.thumbnail"
738
- [src]="searchResult.thumbnail"
739
- class="searchstax-thumbnail"
740
- />
734
+ @if (searchResult.promoted) {
735
+ <div class="searchstax-search-result-promoted"></div>
736
+ }
737
+ @if (searchResult.ribbon) {
738
+ <div
739
+ [innerHTML]="searchResult.ribbon"
740
+ class="searchstax-search-result-ribbon"
741
+ ></div>
742
+ }
743
+ @if (searchResult.thumbnail) {
744
+ <img
745
+ alt=""
746
+ [src]="searchResult.thumbnail"
747
+ class="searchstax-thumbnail"
748
+ />
749
+ }
741
750
  <div class="searchstax-search-result-title-container">
742
751
  <span
743
752
  class="searchstax-search-result-title"
@@ -745,39 +754,45 @@ It receives following props:
745
754
  [innerHTML]="searchResult.title"
746
755
  ></span>
747
756
  </div>
748
- <p
749
- tabindex="0"
750
- *ngIf="searchResult.paths"
751
- class="searchstax-search-result-common"
752
- [innerHTML]="searchResult.paths"
753
- ></p>
754
- <p
755
- tabindex="0"
756
- *ngIf="searchResult.description"
757
- [innerHTML]="searchResult.description"
758
- class="searchstax-search-result-description searchstax-search-result-common"
759
- ></p>
760
- <div *ngFor="let unmappedField of searchResult.unmappedFields">
761
- <div
762
- *ngIf="isImage(unmappedField)"
763
- class="searchstax-search-result-image-container"
764
- >
765
- <img
766
- alt=""
767
- [src]="unmappedField.value"
768
- class="searchstax-result-image"
769
- />
770
- </div>
771
- <div *ngIf="!isImage(unmappedField)">
772
- <p
773
- tabindex="0"
774
- class="searchstax-search-result-common"
775
- [innerHTML]="unmappedField.value"
776
- ></p>
777
- </div>
778
- </div>
757
+ @if (searchResult.paths) {
758
+ <p
759
+ tabindex="0"
760
+ class="searchstax-search-result-common"
761
+ [innerHTML]="searchResult.paths"
762
+ ></p>
763
+ }
764
+ @if (searchResult.description) {
765
+ <p
766
+ tabindex="0"
767
+ [innerHTML]="searchResult.description"
768
+ class="searchstax-search-result-description searchstax-search-result-common"
769
+ ></p>
770
+ }
771
+ @for (
772
+ unmappedField of searchResult.unmappedFields ?? [];
773
+ track $index
774
+ ) {
775
+ @if (isImage(unmappedField)) {
776
+ <div class="searchstax-search-result-image-container">
777
+ <img
778
+ alt=""
779
+ [src]="unmappedField.value"
780
+ class="searchstax-result-image"
781
+ />
782
+ </div>
783
+ } @else {
784
+ <div>
785
+ <p
786
+ tabindex="0"
787
+ class="searchstax-search-result-common"
788
+ [innerHTML]="unmappedField.value"
789
+ ></p>
790
+ </div>
791
+ }
792
+ }
779
793
  </div>
780
- </a>
794
+ </a>
795
+ }
781
796
  </div>
782
797
  </ng-template>
783
798
  <ng-template
@@ -791,18 +806,20 @@ It receives following props:
791
806
  Showing <strong>no results</strong> for
792
807
  <strong>"{{ searchTerm }}"</strong>
793
808
  <br />
794
- <span *ngIf="metadata?.spellingSuggestion"
795
- >&nbsp;Did you mean
796
- <a
797
- href="#"
798
- [attr.aria-label]="'did you mean: ' + metadata?.spellingSuggestion"
799
- class="searchstax-suggestion-term"
800
- (click)="
801
- executeSearch(metadata?.spellingSuggestion ?? '', $event, context)
802
- "
803
- >{{ metadata?.spellingSuggestion }}</a
804
- >?</span
805
- >
809
+ @if (metadata?.spellingSuggestion) {
810
+ <span
811
+ >&nbsp;Did you mean
812
+ <a
813
+ href="#"
814
+ [attr.aria-label]="'did you mean: ' + metadata?.spellingSuggestion"
815
+ class="searchstax-suggestion-term"
816
+ (click)="
817
+ executeSearch(metadata?.spellingSuggestion ?? '', $event, context)
818
+ "
819
+ >{{ metadata?.spellingSuggestion }}</a
820
+ >?</span
821
+ >
822
+ }
806
823
  </div>
807
824
  <ul>
808
825
  <li>
@@ -1055,11 +1072,14 @@ It receives following props:
1055
1072
  let-showMoreLessDesktop="showMoreLessDesktop"
1056
1073
  >
1057
1074
  <div class="searchstax-facets-container-desktop">
1058
- <div
1059
- class="searchstax-facet-container"
1060
- *ngFor="let facet of facetsTemplateDataDesktop?.facets"
1061
- [class]="{ active: isNotDeactivated(facet.name, context) }"
1062
- >
1075
+ @for (
1076
+ facet of facetsTemplateDataDesktop?.facets ?? [];
1077
+ track facet.name
1078
+ ) {
1079
+ <div
1080
+ class="searchstax-facet-container"
1081
+ [class]="{ active: isNotDeactivated(facet.name, context) }"
1082
+ >
1063
1083
  <div>
1064
1084
  <div
1065
1085
  class="searchstax-facet-title-container"
@@ -1071,14 +1091,17 @@ It receives following props:
1071
1091
  <div class="searchstax-facet-title-arrow active"></div>
1072
1092
  </div>
1073
1093
  <div class="searchstax-facet-values-container" aria-live="polite">
1074
- <div
1075
- *ngFor="let facetValue of facetValues(facet); index as key"
1076
- class="searchstax-facet-value-container"
1077
- [class]="{
1078
- 'searchstax-facet-value-disabled': facetValue.disabled
1079
- }"
1080
- #ref
1081
- >
1094
+ @for (
1095
+ facetValue of facetValues(facet);
1096
+ track $index
1097
+ ) {
1098
+ <div
1099
+ class="searchstax-facet-value-container"
1100
+ [class]="{
1101
+ 'searchstax-facet-value-disabled': facetValue.disabled
1102
+ }"
1103
+ #facetValueRow
1104
+ >
1082
1105
  <div class="searchstax-facet-input">
1083
1106
  <input
1084
1107
  type="checkbox"
@@ -1089,52 +1112,59 @@ It receives following props:
1089
1112
  "
1090
1113
  [disabled]="facetValue.disabled"
1091
1114
  (click)="
1092
- selectFacet(ref, $event, facetValue, true, context)
1115
+ selectFacet(facetValueRow, $event, facetValue, true, context)
1093
1116
  "
1094
1117
  />
1095
1118
  </div>
1096
1119
  <div
1097
1120
  class="searchstax-facet-value-label"
1098
- (click)="selectFacet(ref, $event, facetValue, false, context)"
1121
+ (click)="
1122
+ selectFacet(facetValueRow, $event, facetValue, false, context)
1123
+ "
1099
1124
  >
1100
1125
  {{ facetValue.value }}
1101
1126
  </div>
1102
1127
  <div
1103
1128
  class="searchstax-facet-value-count"
1104
- (click)="selectFacet(ref, $event, facetValue, false, context)"
1129
+ (click)="
1130
+ selectFacet(facetValueRow, $event, facetValue, false, context)
1131
+ "
1105
1132
  >
1106
1133
  ({{ facetValue.count }})
1107
1134
  </div>
1108
- </div>
1109
- <div
1110
- class="searchstax-facet-show-more-container"
1111
- *ngIf="facet.hasMoreFacets"
1112
- >
1113
- <div
1114
- class="searchstax-facet-show-more-container"
1115
- (click)="showMoreLessDesktop($event, facet, context)"
1116
- (keyup.enter)="showMoreLessDesktop($event, facet, context)"
1117
- (keyup.space)="showMoreLessDesktop($event, facet, context)"
1118
- tabindex="0"
1119
- role="button"
1120
- >
1121
- <div
1122
- *ngIf="facet.showingAllFacets"
1123
- class="searchstax-facet-show-less-button searchstax-facet-show-button"
1124
- >
1125
- less
1126
- </div>
1135
+ </div>
1136
+ }
1137
+ @if (facet.hasMoreFacets) {
1138
+ <div class="searchstax-facet-show-more-container">
1127
1139
  <div
1128
- *ngIf="!facet.showingAllFacets"
1129
- class="searchstax-facet-show-more-button searchstax-facet-show-button"
1140
+ class="searchstax-facet-show-more-container"
1141
+ (click)="showMoreLessDesktop($event, facet, context)"
1142
+ (keyup.enter)="showMoreLessDesktop($event, facet, context)"
1143
+ (keyup.space)="showMoreLessDesktop($event, facet, context)"
1144
+ tabindex="0"
1145
+ role="button"
1130
1146
  >
1131
- more
1147
+ @if (facet.showingAllFacets) {
1148
+ <div
1149
+ class="searchstax-facet-show-less-button searchstax-facet-show-button"
1150
+ >
1151
+ less
1152
+ </div>
1153
+ }
1154
+ @if (!facet.showingAllFacets) {
1155
+ <div
1156
+ class="searchstax-facet-show-more-button searchstax-facet-show-button"
1157
+ >
1158
+ more
1159
+ </div>
1160
+ }
1132
1161
  </div>
1133
1162
  </div>
1134
- </div>
1163
+ }
1135
1164
  </div>
1136
1165
  </div>
1137
- </div>
1166
+ </div>
1167
+ }
1138
1168
  </div>
1139
1169
  </ng-template>
1140
1170
  <ng-template
@@ -1164,24 +1194,26 @@ It receives following props:
1164
1194
  <div class="searchstax-facets-pill-label">Filter By</div>
1165
1195
  </div>
1166
1196
  <div class="searchstax-facets-pills-selected">
1167
- <div
1168
- class="searchstax-facets-pill searchstax-facets-pill-facets"
1169
- *ngFor="let facet of selectedFacetsCheckboxes"
1170
- (click)="unselectFacet(facet, context)"
1171
- >
1197
+ @for (facet of selectedFacetsCheckboxes; track $index) {
1198
+ <div
1199
+ class="searchstax-facets-pill searchstax-facets-pill-facets"
1200
+ (click)="unselectFacet(facet, context)"
1201
+ >
1172
1202
  <div class="searchstax-facets-pill-label">
1173
1203
  {{ facet.value }} ({{ facet.count }})
1174
1204
  </div>
1175
1205
  <div class="searchstax-facets-pill-icon-close"></div>
1176
- </div>
1206
+ </div>
1207
+ }
1177
1208
  </div>
1178
- <div
1179
- class="searchstax-facets-pill searchstax-clear-filters searchstax-facets-pill-clear-all"
1180
- *ngIf="selectedFacetsCheckboxes.length"
1181
- (click)="unselectAll(context)"
1182
- >
1209
+ @if (selectedFacetsCheckboxes.length) {
1210
+ <div
1211
+ class="searchstax-facets-pill searchstax-clear-filters searchstax-facets-pill-clear-all"
1212
+ (click)="unselectAll(context)"
1213
+ >
1183
1214
  <div class="searchstax-facets-pill-label">Clear Filters</div>
1184
- </div>
1215
+ </div>
1216
+ }
1185
1217
  </div>
1186
1218
  <div
1187
1219
  class="searchstax-facets-mobile-overlay"
@@ -1200,13 +1232,16 @@ It receives following props:
1200
1232
  ></div>
1201
1233
  </div>
1202
1234
  <div class="searchstax-facets-container-mobile">
1203
- <div
1204
- *ngFor="let facet of facetsTemplateDataMobile?.facets"
1205
- class="searchstax-facet-container"
1206
- [class]="{
1207
- active: isNotDeactivated(facet.name, context)
1208
- }"
1209
- >
1235
+ @for (
1236
+ facet of facetsTemplateDataMobile?.facets ?? [];
1237
+ track facet.name
1238
+ ) {
1239
+ <div
1240
+ class="searchstax-facet-container"
1241
+ [class]="{
1242
+ active: isNotDeactivated(facet.name, context)
1243
+ }"
1244
+ >
1210
1245
  <div>
1211
1246
  <div
1212
1247
  class="searchstax-facet-title-container"
@@ -1221,14 +1256,17 @@ It receives following props:
1221
1256
  class="searchstax-facet-values-container"
1222
1257
  aria-live="polite"
1223
1258
  >
1224
- <div
1225
- *ngFor="let facetValue of facetValues(facet); index as key"
1226
- class="searchstax-facet-value-container"
1227
- [class]="{
1228
- 'searchstax-facet-value-disabled': facetValue.disabled
1229
- }"
1230
- #ref
1231
- >
1259
+ @for (
1260
+ facetValue of facetValues(facet);
1261
+ track $index
1262
+ ) {
1263
+ <div
1264
+ class="searchstax-facet-value-container"
1265
+ [class]="{
1266
+ 'searchstax-facet-value-disabled': facetValue.disabled
1267
+ }"
1268
+ #facetValueRow
1269
+ >
1232
1270
  <div class="searchstax-facet-input">
1233
1271
  <input
1234
1272
  type="checkbox"
@@ -1239,14 +1277,14 @@ It receives following props:
1239
1277
  "
1240
1278
  [disabled]="facetValue.disabled"
1241
1279
  (click)="
1242
- selectFacet(ref, $event, facetValue, true, context)
1280
+ selectFacet(facetValueRow, $event, facetValue, true, context)
1243
1281
  "
1244
1282
  />
1245
1283
  </div>
1246
1284
  <div
1247
1285
  class="searchstax-facet-value-label"
1248
1286
  (click)="
1249
- selectFacet(ref, $event, facetValue, false, context)
1287
+ selectFacet(facetValueRow, $event, facetValue, false, context)
1250
1288
  "
1251
1289
  >
1252
1290
  {{ facetValue.value }}
@@ -1254,40 +1292,43 @@ It receives following props:
1254
1292
  <div
1255
1293
  class="searchstax-facet-value-count"
1256
1294
  (click)="
1257
- selectFacet(ref, $event, facetValue, false, context)
1295
+ selectFacet(facetValueRow, $event, facetValue, false, context)
1258
1296
  "
1259
1297
  >
1260
1298
  ({{ facetValue.count }})
1261
1299
  </div>
1262
- </div>
1263
- <div
1264
- class="searchstax-facet-show-more-container"
1265
- *ngIf="facet.hasMoreFacets"
1266
- >
1267
- <div
1268
- class="searchstax-facet-show-more-container"
1269
- (click)="showMoreLessMobile($event, facet, context)"
1270
- (keyup.enter)="showMoreLessMobile($event, facet, context)"
1271
- (keyup.space)="showMoreLessMobile($event, facet, context)"
1272
- tabindex="0"
1273
- >
1274
- <div
1275
- *ngIf="facet.showingAllFacets"
1276
- class="searchstax-facet-show-less-button searchstax-facet-show-button"
1277
- >
1278
- less
1279
- </div>
1300
+ </div>
1301
+ }
1302
+ @if (facet.hasMoreFacets) {
1303
+ <div class="searchstax-facet-show-more-container">
1280
1304
  <div
1281
- *ngIf="!facet.showingAllFacets"
1282
- class="searchstax-facet-show-more-button searchstax-facet-show-button"
1305
+ class="searchstax-facet-show-more-container"
1306
+ (click)="showMoreLessMobile($event, facet, context)"
1307
+ (keyup.enter)="showMoreLessMobile($event, facet, context)"
1308
+ (keyup.space)="showMoreLessMobile($event, facet, context)"
1309
+ tabindex="0"
1283
1310
  >
1284
- more
1311
+ @if (facet.showingAllFacets) {
1312
+ <div
1313
+ class="searchstax-facet-show-less-button searchstax-facet-show-button"
1314
+ >
1315
+ less
1316
+ </div>
1317
+ }
1318
+ @if (!facet.showingAllFacets) {
1319
+ <div
1320
+ class="searchstax-facet-show-more-button searchstax-facet-show-button"
1321
+ >
1322
+ more
1323
+ </div>
1324
+ }
1285
1325
  </div>
1286
1326
  </div>
1287
- </div>
1327
+ }
1288
1328
  </div>
1289
1329
  </div>
1290
- </div>
1330
+ </div>
1331
+ }
1291
1332
  </div>
1292
1333
  <button
1293
1334
  class="searchstax-facets-mobile-overlay-done"
@@ -1341,12 +1382,15 @@ It receives following props:
1341
1382
  {{ searchFeedbackData!.endResultIndex }}</b
1342
1383
  >
1343
1384
  of <b>{{ searchFeedbackData!.totalResults }}</b> results
1344
- <span *ngIf="searchFeedbackData.searchTerm"
1345
- >for "<b>{{ searchFeedbackData!.searchTerm }}</b
1346
- >"
1347
- </span>
1385
+ @if (searchFeedbackData.searchTerm) {
1386
+ <span
1387
+ >for "<b>{{ searchFeedbackData!.searchTerm }}</b
1388
+ >"
1389
+ </span>
1390
+ }
1348
1391
  <div class="searchstax-feedback-container-suggested">
1349
- <div *ngIf="searchFeedbackData.autoCorrectedQuery">
1392
+ @if (searchFeedbackData.autoCorrectedQuery) {
1393
+ <div>
1350
1394
  Search instead for
1351
1395
  <a
1352
1396
  href="#"
@@ -1357,7 +1401,8 @@ It receives following props:
1357
1401
  "
1358
1402
  >{{ searchFeedbackData!.originalQuery }}</a
1359
1403
  >
1360
- </div>
1404
+ </div>
1405
+ }
1361
1406
  </div>
1362
1407
  </h2>
1363
1408
  </ng-template>
@@ -1413,22 +1458,28 @@ It receives following props:
1413
1458
  [id]="'searchstax-related-searches-container' + rand"
1414
1459
  >
1415
1460
  Related searches: <span id="searchstax-related-searches"></span>
1416
- <span
1417
- class="searchstax-related-search"
1418
- *ngIf="relatedData.relatedSearches"
1419
- >
1420
- <span
1421
- *ngFor="let related of relatedData.relatedSearches"
1422
- (click)="executeSearch(related, context)"
1423
- (keyup.enter)="executeSearch(related, context)"
1424
- (keyup.space)="executeSearch(related, context)"
1425
- tabindex="0"
1426
- class="searchstax-related-search searchstax-related-search-item"
1427
- [attr.aria-label]="'Related search: ' + related.related_search"
1428
- >
1429
- {{ related.related_search }}<span *ngIf="!related.last">,</span>
1461
+ @if (relatedData.relatedSearches) {
1462
+ <span class="searchstax-related-search">
1463
+ @for (
1464
+ related of relatedData.relatedSearches;
1465
+ track $index
1466
+ ) {
1467
+ <span
1468
+ (click)="executeSearch(related, context)"
1469
+ (keyup.enter)="executeSearch(related, context)"
1470
+ (keyup.space)="executeSearch(related, context)"
1471
+ tabindex="0"
1472
+ class="searchstax-related-search searchstax-related-search-item"
1473
+ [attr.aria-label]="'Related search: ' + related.related_search"
1474
+ >
1475
+ {{ related.related_search }}
1476
+ @if (!related.last) {
1477
+ <span>,</span>
1478
+ }
1479
+ </span>
1480
+ }
1430
1481
  </span>
1431
- </span>
1482
+ }
1432
1483
  </div>
1433
1484
  </ng-template>
1434
1485
  </app-searchstax-related-searches>
@@ -1472,37 +1523,43 @@ It receives following props:
1472
1523
  class="searchstax-external-promotions-container"
1473
1524
  id="searchstax-external-promotions-container"
1474
1525
  >
1475
- <div
1476
- class="searchstax-external-promotion searchstax-search-result"
1477
- *ngFor="
1478
- let externalPromotion of externalPromotionsData.externalPromotions
1479
- "
1480
- >
1481
- <div class="icon-elevated"></div>
1482
- <a
1483
- *ngIf="externalPromotion.url"
1484
- [href]="externalPromotion.url"
1485
- (click)="trackClick(externalPromotion, $event, context)"
1486
- class="searchstax-result-item-link"
1487
- ></a>
1488
- <div class="searchstax-search-result-title-container">
1489
- <span class="searchstax-search-result-title">{{
1490
- externalPromotion.name
1491
- }}</span>
1492
- </div>
1493
- <p
1494
- *ngIf="externalPromotion.description"
1495
- class="searchstax-search-result-description searchstax-search-result-common"
1496
- >
1497
- {{ externalPromotion.description }}
1498
- </p>
1499
- <p
1500
- *ngIf="externalPromotion.url"
1501
- class="searchstax-search-result-description searchstax-search-result-common"
1526
+ @for (
1527
+ externalPromotion of externalPromotionsData?.externalPromotions ??
1528
+ [];
1529
+ track $index
1530
+ ) {
1531
+ <div
1532
+ class="searchstax-external-promotion searchstax-search-result"
1502
1533
  >
1503
- {{ externalPromotion.url }}
1504
- </p>
1505
- </div>
1534
+ <div class="icon-elevated"></div>
1535
+ @if (externalPromotion.url) {
1536
+ <a
1537
+ [href]="externalPromotion.url"
1538
+ (click)="trackClick(externalPromotion, $event, context)"
1539
+ class="searchstax-result-item-link"
1540
+ ></a>
1541
+ }
1542
+ <div class="searchstax-search-result-title-container">
1543
+ <span class="searchstax-search-result-title">{{
1544
+ externalPromotion.name
1545
+ }}</span>
1546
+ </div>
1547
+ @if (externalPromotion.description) {
1548
+ <p
1549
+ class="searchstax-search-result-description searchstax-search-result-common"
1550
+ >
1551
+ {{ externalPromotion.description }}
1552
+ </p>
1553
+ }
1554
+ @if (externalPromotion.url) {
1555
+ <p
1556
+ class="searchstax-search-result-description searchstax-search-result-common"
1557
+ >
1558
+ {{ externalPromotion.url }}
1559
+ </p>
1560
+ }
1561
+ </div>
1562
+ }
1506
1563
  </div>
1507
1564
  </ng-template>
1508
1565
  </app-searchstax-external-promotions>
@@ -1558,12 +1615,14 @@ It receives following props:
1558
1615
  [(ngModel)]="context.selectedSorting"
1559
1616
  (change)="orderChange($event, context)"
1560
1617
  >
1561
- <option
1562
- *ngFor="let sortOption of context.sortingData.sortOptions"
1563
- [value]="sortOption.key"
1564
- >
1565
- {{ sortOption.value }}
1566
- </option>
1618
+ @for (
1619
+ sortOption of context.sortingData?.sortOptions ?? [];
1620
+ track sortOption.key
1621
+ ) {
1622
+ <option [value]="sortOption.key">
1623
+ {{ sortOption.value }}
1624
+ </option>
1625
+ }
1567
1626
  </select>
1568
1627
  </div>
1569
1628
  </ng-template>