@memberjunction/ng-search 5.47.0 → 5.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/search-composite.component.d.ts +19 -2
- package/dist/lib/search-composite.component.d.ts.map +1 -1
- package/dist/lib/search-composite.component.js +79 -4
- package/dist/lib/search-composite.component.js.map +1 -1
- package/dist/lib/search-input.component.d.ts +9 -1
- package/dist/lib/search-input.component.d.ts.map +1 -1
- package/dist/lib/search-input.component.js +13 -2
- package/dist/lib/search-input.component.js.map +1 -1
- package/dist/lib/search-overlay.component.d.ts +65 -2
- package/dist/lib/search-overlay.component.d.ts.map +1 -1
- package/dist/lib/search-overlay.component.js +344 -135
- package/dist/lib/search-overlay.component.js.map +1 -1
- package/dist/lib/search-suggest.component.d.ts +43 -3
- package/dist/lib/search-suggest.component.d.ts.map +1 -1
- package/dist/lib/search-suggest.component.js +216 -75
- package/dist/lib/search-suggest.component.js.map +1 -1
- package/dist/lib/search-types.d.ts +9 -0
- package/dist/lib/search-types.d.ts.map +1 -1
- package/dist/lib/search-types.js.map +1 -1
- package/dist/lib/search.service.d.ts +20 -1
- package/dist/lib/search.service.d.ts.map +1 -1
- package/dist/lib/search.service.js +58 -1
- package/dist/lib/search.service.js.map +1 -1
- package/package.json +9 -9
|
@@ -11,23 +11,24 @@ import { UserInfoEngine } from '@memberjunction/core-entities';
|
|
|
11
11
|
import { MJEventType, MJGlobal } from '@memberjunction/global';
|
|
12
12
|
import * as i0 from "@angular/core";
|
|
13
13
|
const _forTrack0 = ($index, $item) => $item.Query;
|
|
14
|
-
const _forTrack1 = ($index, $item) => $item.
|
|
14
|
+
const _forTrack1 = ($index, $item) => $item.EntityName + $item.RecordID;
|
|
15
|
+
const _forTrack2 = ($index, $item) => $item.ID;
|
|
15
16
|
function SearchSuggestComponent_Conditional_0_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
16
17
|
i0.ɵɵelementStart(0, "div", 1);
|
|
17
|
-
i0.ɵɵelement(1, "i",
|
|
18
|
+
i0.ɵɵelement(1, "i", 6);
|
|
18
19
|
i0.ɵɵelementStart(2, "span");
|
|
19
20
|
i0.ɵɵtext(3, "Searching...");
|
|
20
21
|
i0.ɵɵelementEnd()();
|
|
21
22
|
} }
|
|
22
23
|
function SearchSuggestComponent_Conditional_0_Conditional_2_For_8_Template(rf, ctx) { if (rf & 1) {
|
|
23
24
|
const _r3 = i0.ɵɵgetCurrentView();
|
|
24
|
-
i0.ɵɵelementStart(0, "div",
|
|
25
|
+
i0.ɵɵelementStart(0, "div", 11);
|
|
25
26
|
i0.ɵɵlistener("mousedown", function SearchSuggestComponent_Conditional_0_Conditional_2_For_8_Template_div_mousedown_0_listener($event) { const recent_r4 = i0.ɵɵrestoreView(_r3).$implicit; const ctx_r1 = i0.ɵɵnextContext(3); ctx_r1.OnRecentClick(recent_r4); return i0.ɵɵresetView($event.preventDefault()); })("mouseenter", function SearchSuggestComponent_Conditional_0_Conditional_2_For_8_Template_div_mouseenter_0_listener() { const ɵ$index_25_r5 = i0.ɵɵrestoreView(_r3).$index; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.HighlightedIndex = ɵ$index_25_r5); });
|
|
26
|
-
i0.ɵɵelement(1, "i",
|
|
27
|
-
i0.ɵɵelementStart(2, "span",
|
|
27
|
+
i0.ɵɵelement(1, "i", 12);
|
|
28
|
+
i0.ɵɵelementStart(2, "span", 13);
|
|
28
29
|
i0.ɵɵtext(3);
|
|
29
30
|
i0.ɵɵelementEnd();
|
|
30
|
-
i0.ɵɵelementStart(4, "span",
|
|
31
|
+
i0.ɵɵelementStart(4, "span", 14);
|
|
31
32
|
i0.ɵɵtext(5);
|
|
32
33
|
i0.ɵɵelementEnd()();
|
|
33
34
|
} if (rf & 2) {
|
|
@@ -42,73 +43,107 @@ function SearchSuggestComponent_Conditional_0_Conditional_2_For_8_Template(rf, c
|
|
|
42
43
|
} }
|
|
43
44
|
function SearchSuggestComponent_Conditional_0_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
44
45
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
45
|
-
i0.ɵɵelementStart(0, "div", 2)(1, "div",
|
|
46
|
-
i0.ɵɵelement(2, "i",
|
|
46
|
+
i0.ɵɵelementStart(0, "div", 2)(1, "div", 7);
|
|
47
|
+
i0.ɵɵelement(2, "i", 8);
|
|
47
48
|
i0.ɵɵelementStart(3, "span");
|
|
48
49
|
i0.ɵɵtext(4, "Recent Searches");
|
|
49
50
|
i0.ɵɵelementEnd();
|
|
50
|
-
i0.ɵɵelementStart(5, "
|
|
51
|
-
i0.ɵɵlistener("mousedown", function
|
|
51
|
+
i0.ɵɵelementStart(5, "button", 9);
|
|
52
|
+
i0.ɵɵlistener("mousedown", function SearchSuggestComponent_Conditional_0_Conditional_2_Template_button_mousedown_5_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView($event.preventDefault()); })("click", function SearchSuggestComponent_Conditional_0_Conditional_2_Template_button_click_5_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.OnClearRecentClick($event)); });
|
|
52
53
|
i0.ɵɵtext(6, "Clear");
|
|
53
54
|
i0.ɵɵelementEnd()();
|
|
54
|
-
i0.ɵɵrepeaterCreate(7, SearchSuggestComponent_Conditional_0_Conditional_2_For_8_Template, 6, 4, "div",
|
|
55
|
+
i0.ɵɵrepeaterCreate(7, SearchSuggestComponent_Conditional_0_Conditional_2_For_8_Template, 6, 4, "div", 10, _forTrack0);
|
|
55
56
|
i0.ɵɵelementEnd();
|
|
56
57
|
} if (rf & 2) {
|
|
57
58
|
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
58
59
|
i0.ɵɵadvance(7);
|
|
59
60
|
i0.ɵɵrepeater(ctx_r1.VisibleRecentSearches);
|
|
60
61
|
} }
|
|
61
|
-
function
|
|
62
|
+
function SearchSuggestComponent_Conditional_0_Conditional_3_For_6_Template(rf, ctx) { if (rf & 1) {
|
|
62
63
|
const _r6 = i0.ɵɵgetCurrentView();
|
|
63
|
-
i0.ɵɵelementStart(0, "div",
|
|
64
|
-
i0.ɵɵlistener("mousedown", function
|
|
65
|
-
i0.ɵɵ
|
|
64
|
+
i0.ɵɵelementStart(0, "div", 11);
|
|
65
|
+
i0.ɵɵlistener("mousedown", function SearchSuggestComponent_Conditional_0_Conditional_3_For_6_Template_div_mousedown_0_listener($event) { const record_r7 = i0.ɵɵrestoreView(_r6).$implicit; const ctx_r1 = i0.ɵɵnextContext(3); ctx_r1.OnRecentRecordClick(record_r7); return i0.ɵɵresetView($event.preventDefault()); })("mouseenter", function SearchSuggestComponent_Conditional_0_Conditional_3_For_6_Template_div_mouseenter_0_listener() { const ɵ$index_46_r8 = i0.ɵɵrestoreView(_r6).$index; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.HighlightedIndex = (ctx_r1.showRecentSection ? ctx_r1.VisibleRecentSearches.length : 0) + ɵ$index_46_r8); });
|
|
66
|
+
i0.ɵɵelement(1, "i", 16);
|
|
67
|
+
i0.ɵɵelementStart(2, "span", 13);
|
|
68
|
+
i0.ɵɵtext(3);
|
|
69
|
+
i0.ɵɵelementEnd();
|
|
70
|
+
i0.ɵɵelementStart(4, "span", 14);
|
|
71
|
+
i0.ɵɵtext(5);
|
|
72
|
+
i0.ɵɵelementEnd()();
|
|
73
|
+
} if (rf & 2) {
|
|
74
|
+
const record_r7 = ctx.$implicit;
|
|
75
|
+
const ɵ$index_46_r8 = ctx.$index;
|
|
76
|
+
const ctx_r1 = i0.ɵɵnextContext(3);
|
|
77
|
+
i0.ɵɵclassProp("suggest-item-highlighted", ctx_r1.IsHighlighted((ctx_r1.showRecentSection ? ctx_r1.VisibleRecentSearches.length : 0) + ɵ$index_46_r8));
|
|
78
|
+
i0.ɵɵadvance(3);
|
|
79
|
+
i0.ɵɵtextInterpolate(record_r7.RecordName);
|
|
80
|
+
i0.ɵɵadvance(2);
|
|
81
|
+
i0.ɵɵtextInterpolate(record_r7.EntityName);
|
|
82
|
+
} }
|
|
83
|
+
function SearchSuggestComponent_Conditional_0_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
84
|
+
i0.ɵɵelementStart(0, "div", 2)(1, "div", 7);
|
|
85
|
+
i0.ɵɵelement(2, "i", 15);
|
|
86
|
+
i0.ɵɵelementStart(3, "span");
|
|
87
|
+
i0.ɵɵtext(4, "Recently Opened");
|
|
88
|
+
i0.ɵɵelementEnd()();
|
|
89
|
+
i0.ɵɵrepeaterCreate(5, SearchSuggestComponent_Conditional_0_Conditional_3_For_6_Template, 6, 4, "div", 10, _forTrack1);
|
|
90
|
+
i0.ɵɵelementEnd();
|
|
91
|
+
} if (rf & 2) {
|
|
92
|
+
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
93
|
+
i0.ɵɵadvance(5);
|
|
94
|
+
i0.ɵɵrepeater(ctx_r1.VisibleRecentRecords);
|
|
95
|
+
} }
|
|
96
|
+
function SearchSuggestComponent_Conditional_0_Conditional_4_Conditional_0_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
97
|
+
const _r9 = i0.ɵɵgetCurrentView();
|
|
98
|
+
i0.ɵɵelementStart(0, "div", 19);
|
|
99
|
+
i0.ɵɵlistener("mousedown", function SearchSuggestComponent_Conditional_0_Conditional_4_Conditional_0_For_2_Template_div_mousedown_0_listener($event) { const result_r10 = i0.ɵɵrestoreView(_r9).$implicit; const ctx_r1 = i0.ɵɵnextContext(4); ctx_r1.OnResultClick(result_r10); return i0.ɵɵresetView($event.preventDefault()); })("mouseenter", function SearchSuggestComponent_Conditional_0_Conditional_4_Conditional_0_For_2_Template_div_mouseenter_0_listener() { const ɵ$index_61_r11 = i0.ɵɵrestoreView(_r9).$index; const ctx_r1 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r1.HighlightedIndex = (ctx_r1.showRecentSection ? ctx_r1.VisibleRecentSearches.length : 0) + ɵ$index_61_r11); });
|
|
100
|
+
i0.ɵɵelementStart(1, "div", 20);
|
|
66
101
|
i0.ɵɵelement(2, "i");
|
|
67
102
|
i0.ɵɵelementEnd();
|
|
68
|
-
i0.ɵɵelementStart(3, "div",
|
|
103
|
+
i0.ɵɵelementStart(3, "div", 21)(4, "div", 22);
|
|
69
104
|
i0.ɵɵtext(5);
|
|
70
105
|
i0.ɵɵelementEnd();
|
|
71
|
-
i0.ɵɵelementStart(6, "div",
|
|
106
|
+
i0.ɵɵelementStart(6, "div", 23);
|
|
72
107
|
i0.ɵɵtext(7);
|
|
73
108
|
i0.ɵɵelementEnd()();
|
|
74
|
-
i0.ɵɵelementStart(8, "span",
|
|
109
|
+
i0.ɵɵelementStart(8, "span", 24);
|
|
75
110
|
i0.ɵɵtext(9);
|
|
76
111
|
i0.ɵɵelementEnd()();
|
|
77
112
|
} if (rf & 2) {
|
|
78
|
-
const
|
|
79
|
-
const ɵ$
|
|
113
|
+
const result_r10 = ctx.$implicit;
|
|
114
|
+
const ɵ$index_61_r11 = ctx.$index;
|
|
80
115
|
const ctx_r1 = i0.ɵɵnextContext(4);
|
|
81
|
-
i0.ɵɵclassProp("suggest-item-highlighted", ctx_r1.IsHighlighted((ctx_r1.showRecentSection ? ctx_r1.VisibleRecentSearches.length : 0) + ɵ$
|
|
116
|
+
i0.ɵɵclassProp("suggest-item-highlighted", ctx_r1.IsHighlighted((ctx_r1.showRecentSection ? ctx_r1.VisibleRecentSearches.length : 0) + ɵ$index_61_r11));
|
|
82
117
|
i0.ɵɵadvance(2);
|
|
83
|
-
i0.ɵɵclassMap(
|
|
118
|
+
i0.ɵɵclassMap(result_r10.EntityIcon || result_r10.SourceIcon || "fa-solid fa-database");
|
|
84
119
|
i0.ɵɵadvance(3);
|
|
85
|
-
i0.ɵɵtextInterpolate(
|
|
120
|
+
i0.ɵɵtextInterpolate(result_r10.RecordName || result_r10.Title);
|
|
86
121
|
i0.ɵɵadvance(2);
|
|
87
|
-
i0.ɵɵtextInterpolate(
|
|
122
|
+
i0.ɵɵtextInterpolate(result_r10.EntityName);
|
|
88
123
|
i0.ɵɵadvance();
|
|
89
|
-
i0.ɵɵclassMap("suggest-result-score " + ctx_r1.GetScoreClass(
|
|
124
|
+
i0.ɵɵclassMap("suggest-result-score " + ctx_r1.GetScoreClass(result_r10.Score));
|
|
90
125
|
i0.ɵɵadvance();
|
|
91
|
-
i0.ɵɵtextInterpolate(ctx_r1.FormatScore(
|
|
126
|
+
i0.ɵɵtextInterpolate(ctx_r1.FormatScore(result_r10.Score));
|
|
92
127
|
} }
|
|
93
|
-
function
|
|
128
|
+
function SearchSuggestComponent_Conditional_0_Conditional_4_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
94
129
|
i0.ɵɵelementStart(0, "div", 2);
|
|
95
|
-
i0.ɵɵrepeaterCreate(1,
|
|
130
|
+
i0.ɵɵrepeaterCreate(1, SearchSuggestComponent_Conditional_0_Conditional_4_Conditional_0_For_2_Template, 10, 9, "div", 18, _forTrack2);
|
|
96
131
|
i0.ɵɵelementEnd();
|
|
97
132
|
} if (rf & 2) {
|
|
98
133
|
const ctx_r1 = i0.ɵɵnextContext(3);
|
|
99
134
|
i0.ɵɵadvance();
|
|
100
135
|
i0.ɵɵrepeater(ctx_r1.VisiblePreviewResults);
|
|
101
136
|
} }
|
|
102
|
-
function
|
|
137
|
+
function SearchSuggestComponent_Conditional_0_Conditional_4_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
103
138
|
i0.ɵɵelementStart(0, "div", 4)(1, "span");
|
|
104
139
|
i0.ɵɵtext(2, "No results found");
|
|
105
140
|
i0.ɵɵelementEnd()();
|
|
106
141
|
} }
|
|
107
|
-
function
|
|
108
|
-
const
|
|
109
|
-
i0.ɵɵelementStart(0, "div",
|
|
110
|
-
i0.ɵɵlistener("mousedown", function
|
|
111
|
-
i0.ɵɵelement(1, "i",
|
|
142
|
+
function SearchSuggestComponent_Conditional_0_Conditional_4_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
143
|
+
const _r12 = i0.ɵɵgetCurrentView();
|
|
144
|
+
i0.ɵɵelementStart(0, "div", 25);
|
|
145
|
+
i0.ɵɵlistener("mousedown", function SearchSuggestComponent_Conditional_0_Conditional_4_Conditional_2_Template_div_mousedown_0_listener($event) { i0.ɵɵrestoreView(_r12); const ctx_r1 = i0.ɵɵnextContext(3); ctx_r1.OnSeeAllClick(); return i0.ɵɵresetView($event.preventDefault()); })("mouseenter", function SearchSuggestComponent_Conditional_0_Conditional_4_Conditional_2_Template_div_mouseenter_0_listener() { i0.ɵɵrestoreView(_r12); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.HighlightedIndex = (ctx_r1.showRecentSection ? ctx_r1.VisibleRecentSearches.length : 0) + ctx_r1.VisiblePreviewResults.length); });
|
|
146
|
+
i0.ɵɵelement(1, "i", 26);
|
|
112
147
|
i0.ɵɵelementStart(2, "span");
|
|
113
148
|
i0.ɵɵtext(3);
|
|
114
149
|
i0.ɵɵelementEnd()();
|
|
@@ -118,67 +153,67 @@ function SearchSuggestComponent_Conditional_0_Conditional_3_Conditional_2_Templa
|
|
|
118
153
|
i0.ɵɵadvance(3);
|
|
119
154
|
i0.ɵɵtextInterpolate1("See all ", ctx_r1.TotalCount, " results");
|
|
120
155
|
} }
|
|
121
|
-
function
|
|
122
|
-
i0.ɵɵconditionalCreate(0,
|
|
123
|
-
i0.ɵɵconditionalCreate(2,
|
|
156
|
+
function SearchSuggestComponent_Conditional_0_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
157
|
+
i0.ɵɵconditionalCreate(0, SearchSuggestComponent_Conditional_0_Conditional_4_Conditional_0_Template, 3, 0, "div", 2)(1, SearchSuggestComponent_Conditional_0_Conditional_4_Conditional_1_Template, 3, 0, "div", 4);
|
|
158
|
+
i0.ɵɵconditionalCreate(2, SearchSuggestComponent_Conditional_0_Conditional_4_Conditional_2_Template, 4, 3, "div", 17);
|
|
124
159
|
} if (rf & 2) {
|
|
125
160
|
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
126
161
|
i0.ɵɵconditional(ctx_r1.VisiblePreviewResults.length > 0 ? 0 : !ctx_r1.IsLoading ? 1 : -1);
|
|
127
162
|
i0.ɵɵadvance(2);
|
|
128
163
|
i0.ɵɵconditional(ctx_r1.showSeeAllFooter ? 2 : -1);
|
|
129
164
|
} }
|
|
130
|
-
function
|
|
165
|
+
function SearchSuggestComponent_Conditional_0_Conditional_5_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
131
166
|
i0.ɵɵtext(0);
|
|
132
167
|
} if (rf & 2) {
|
|
133
168
|
const ctx_r1 = i0.ɵɵnextContext(3);
|
|
134
169
|
i0.ɵɵtextInterpolate1(" Min relevance: ", ctx_r1.MinRelevancePercent, "% ");
|
|
135
170
|
} }
|
|
136
|
-
function
|
|
171
|
+
function SearchSuggestComponent_Conditional_0_Conditional_5_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
137
172
|
i0.ɵɵtext(0, " Showing all results ");
|
|
138
173
|
} }
|
|
139
|
-
function
|
|
140
|
-
i0.ɵɵelement(0, "i",
|
|
174
|
+
function SearchSuggestComponent_Conditional_0_Conditional_5_Conditional_7_For_4_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
175
|
+
i0.ɵɵelement(0, "i", 35);
|
|
141
176
|
} }
|
|
142
|
-
function
|
|
143
|
-
const
|
|
144
|
-
i0.ɵɵelementStart(0, "div",
|
|
145
|
-
i0.ɵɵlistener("mousedown", function
|
|
177
|
+
function SearchSuggestComponent_Conditional_0_Conditional_5_Conditional_7_For_4_Template(rf, ctx) { if (rf & 1) {
|
|
178
|
+
const _r14 = i0.ɵɵgetCurrentView();
|
|
179
|
+
i0.ɵɵelementStart(0, "div", 34);
|
|
180
|
+
i0.ɵɵlistener("mousedown", function SearchSuggestComponent_Conditional_0_Conditional_5_Conditional_7_For_4_Template_div_mousedown_0_listener($event) { const option_r15 = i0.ɵɵrestoreView(_r14).$implicit; const ctx_r1 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r1.SetMinRelevance(option_r15, $event)); });
|
|
146
181
|
i0.ɵɵelementStart(1, "span");
|
|
147
182
|
i0.ɵɵtext(2);
|
|
148
183
|
i0.ɵɵelementEnd();
|
|
149
|
-
i0.ɵɵconditionalCreate(3,
|
|
184
|
+
i0.ɵɵconditionalCreate(3, SearchSuggestComponent_Conditional_0_Conditional_5_Conditional_7_For_4_Conditional_3_Template, 1, 0, "i", 35);
|
|
150
185
|
i0.ɵɵelementEnd();
|
|
151
186
|
} if (rf & 2) {
|
|
152
|
-
const
|
|
187
|
+
const option_r15 = ctx.$implicit;
|
|
153
188
|
const ctx_r1 = i0.ɵɵnextContext(4);
|
|
154
|
-
i0.ɵɵclassProp("suggest-filter-option-active", ctx_r1.IsSelectedRelevance(
|
|
189
|
+
i0.ɵɵclassProp("suggest-filter-option-active", ctx_r1.IsSelectedRelevance(option_r15));
|
|
155
190
|
i0.ɵɵadvance(2);
|
|
156
|
-
i0.ɵɵtextInterpolate(ctx_r1.FormatRelevanceOption(
|
|
191
|
+
i0.ɵɵtextInterpolate(ctx_r1.FormatRelevanceOption(option_r15));
|
|
157
192
|
i0.ɵɵadvance();
|
|
158
|
-
i0.ɵɵconditional(ctx_r1.IsSelectedRelevance(
|
|
193
|
+
i0.ɵɵconditional(ctx_r1.IsSelectedRelevance(option_r15) ? 3 : -1);
|
|
159
194
|
} }
|
|
160
|
-
function
|
|
161
|
-
i0.ɵɵelementStart(0, "div",
|
|
195
|
+
function SearchSuggestComponent_Conditional_0_Conditional_5_Conditional_7_Template(rf, ctx) { if (rf & 1) {
|
|
196
|
+
i0.ɵɵelementStart(0, "div", 31)(1, "div", 32);
|
|
162
197
|
i0.ɵɵtext(2, "Min Relevance");
|
|
163
198
|
i0.ɵɵelementEnd();
|
|
164
|
-
i0.ɵɵrepeaterCreate(3,
|
|
199
|
+
i0.ɵɵrepeaterCreate(3, SearchSuggestComponent_Conditional_0_Conditional_5_Conditional_7_For_4_Template, 4, 4, "div", 33, i0.ɵɵrepeaterTrackByIdentity);
|
|
165
200
|
i0.ɵɵelementEnd();
|
|
166
201
|
} if (rf & 2) {
|
|
167
202
|
const ctx_r1 = i0.ɵɵnextContext(3);
|
|
168
203
|
i0.ɵɵadvance(3);
|
|
169
204
|
i0.ɵɵrepeater(ctx_r1.MinRelevanceOptions);
|
|
170
205
|
} }
|
|
171
|
-
function
|
|
172
|
-
const
|
|
173
|
-
i0.ɵɵelementStart(0, "div", 3)(1, "div",
|
|
174
|
-
i0.ɵɵlistener("mousedown", function
|
|
175
|
-
i0.ɵɵelement(2, "i",
|
|
176
|
-
i0.ɵɵelementStart(3, "span",
|
|
177
|
-
i0.ɵɵconditionalCreate(4,
|
|
206
|
+
function SearchSuggestComponent_Conditional_0_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
207
|
+
const _r13 = i0.ɵɵgetCurrentView();
|
|
208
|
+
i0.ɵɵelementStart(0, "div", 3)(1, "div", 27);
|
|
209
|
+
i0.ɵɵlistener("mousedown", function SearchSuggestComponent_Conditional_0_Conditional_5_Template_div_mousedown_1_listener($event) { i0.ɵɵrestoreView(_r13); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.ToggleFilter($event)); });
|
|
210
|
+
i0.ɵɵelement(2, "i", 28);
|
|
211
|
+
i0.ɵɵelementStart(3, "span", 29);
|
|
212
|
+
i0.ɵɵconditionalCreate(4, SearchSuggestComponent_Conditional_0_Conditional_5_Conditional_4_Template, 1, 1)(5, SearchSuggestComponent_Conditional_0_Conditional_5_Conditional_5_Template, 1, 0);
|
|
178
213
|
i0.ɵɵelementEnd();
|
|
179
|
-
i0.ɵɵelement(6, "i",
|
|
214
|
+
i0.ɵɵelement(6, "i", 30);
|
|
180
215
|
i0.ɵɵelementEnd();
|
|
181
|
-
i0.ɵɵconditionalCreate(7,
|
|
216
|
+
i0.ɵɵconditionalCreate(7, SearchSuggestComponent_Conditional_0_Conditional_5_Conditional_7_Template, 5, 0, "div", 31);
|
|
182
217
|
i0.ɵɵelementEnd();
|
|
183
218
|
} if (rf & 2) {
|
|
184
219
|
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
@@ -189,7 +224,7 @@ function SearchSuggestComponent_Conditional_0_Conditional_4_Template(rf, ctx) {
|
|
|
189
224
|
i0.ɵɵadvance();
|
|
190
225
|
i0.ɵɵconditional(ctx_r1.IsFilterOpen ? 7 : -1);
|
|
191
226
|
} }
|
|
192
|
-
function
|
|
227
|
+
function SearchSuggestComponent_Conditional_0_Conditional_6_Template(rf, ctx) { if (rf & 1) {
|
|
193
228
|
i0.ɵɵelementStart(0, "div", 4)(1, "span");
|
|
194
229
|
i0.ɵɵtext(2);
|
|
195
230
|
i0.ɵɵelementEnd()();
|
|
@@ -198,13 +233,37 @@ function SearchSuggestComponent_Conditional_0_Conditional_5_Template(rf, ctx) {
|
|
|
198
233
|
i0.ɵɵadvance(2);
|
|
199
234
|
i0.ɵɵtextInterpolate1("Type at least ", ctx_r1.MinQueryLength, " characters to search");
|
|
200
235
|
} }
|
|
236
|
+
function SearchSuggestComponent_Conditional_0_Conditional_7_Template(rf, ctx) { if (rf & 1) {
|
|
237
|
+
const _r16 = i0.ɵɵgetCurrentView();
|
|
238
|
+
i0.ɵɵelementStart(0, "div", 5);
|
|
239
|
+
i0.ɵɵelement(1, "i", 36);
|
|
240
|
+
i0.ɵɵelementStart(2, "span", 37);
|
|
241
|
+
i0.ɵɵtext(3);
|
|
242
|
+
i0.ɵɵelementEnd();
|
|
243
|
+
i0.ɵɵelementStart(4, "button", 38);
|
|
244
|
+
i0.ɵɵlistener("mousedown", function SearchSuggestComponent_Conditional_0_Conditional_7_Template_button_mousedown_4_listener($event) { i0.ɵɵrestoreView(_r16); return i0.ɵɵresetView($event.preventDefault()); })("click", function SearchSuggestComponent_Conditional_0_Conditional_7_Template_button_click_4_listener() { i0.ɵɵrestoreView(_r16); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.OnPromoAccept()); });
|
|
245
|
+
i0.ɵɵtext(5);
|
|
246
|
+
i0.ɵɵelementEnd();
|
|
247
|
+
i0.ɵɵelementStart(6, "button", 39);
|
|
248
|
+
i0.ɵɵlistener("mousedown", function SearchSuggestComponent_Conditional_0_Conditional_7_Template_button_mousedown_6_listener($event) { i0.ɵɵrestoreView(_r16); return i0.ɵɵresetView($event.preventDefault()); })("click", function SearchSuggestComponent_Conditional_0_Conditional_7_Template_button_click_6_listener($event) { i0.ɵɵrestoreView(_r16); const ctx_r1 = i0.ɵɵnextContext(2); ctx_r1.OnPromoDismiss(); return i0.ɵɵresetView($event.stopPropagation()); });
|
|
249
|
+
i0.ɵɵelement(7, "i", 40);
|
|
250
|
+
i0.ɵɵelementEnd()();
|
|
251
|
+
} if (rf & 2) {
|
|
252
|
+
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
253
|
+
i0.ɵɵadvance(3);
|
|
254
|
+
i0.ɵɵtextInterpolate(ctx_r1.PromoText);
|
|
255
|
+
i0.ɵɵadvance(2);
|
|
256
|
+
i0.ɵɵtextInterpolate(ctx_r1.PromoActionLabel);
|
|
257
|
+
} }
|
|
201
258
|
function SearchSuggestComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
202
259
|
i0.ɵɵelementStart(0, "div", 0);
|
|
203
260
|
i0.ɵɵconditionalCreate(1, SearchSuggestComponent_Conditional_0_Conditional_1_Template, 4, 0, "div", 1);
|
|
204
261
|
i0.ɵɵconditionalCreate(2, SearchSuggestComponent_Conditional_0_Conditional_2_Template, 9, 0, "div", 2);
|
|
205
|
-
i0.ɵɵconditionalCreate(3, SearchSuggestComponent_Conditional_0_Conditional_3_Template,
|
|
206
|
-
i0.ɵɵconditionalCreate(4, SearchSuggestComponent_Conditional_0_Conditional_4_Template,
|
|
207
|
-
i0.ɵɵconditionalCreate(5, SearchSuggestComponent_Conditional_0_Conditional_5_Template,
|
|
262
|
+
i0.ɵɵconditionalCreate(3, SearchSuggestComponent_Conditional_0_Conditional_3_Template, 7, 0, "div", 2);
|
|
263
|
+
i0.ɵɵconditionalCreate(4, SearchSuggestComponent_Conditional_0_Conditional_4_Template, 3, 2);
|
|
264
|
+
i0.ɵɵconditionalCreate(5, SearchSuggestComponent_Conditional_0_Conditional_5_Template, 8, 4, "div", 3);
|
|
265
|
+
i0.ɵɵconditionalCreate(6, SearchSuggestComponent_Conditional_0_Conditional_6_Template, 3, 1, "div", 4);
|
|
266
|
+
i0.ɵɵconditionalCreate(7, SearchSuggestComponent_Conditional_0_Conditional_7_Template, 8, 2, "div", 5);
|
|
208
267
|
i0.ɵɵelementEnd();
|
|
209
268
|
} if (rf & 2) {
|
|
210
269
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
@@ -213,11 +272,15 @@ function SearchSuggestComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
|
213
272
|
i0.ɵɵadvance();
|
|
214
273
|
i0.ɵɵconditional(ctx_r1.showRecentSection ? 2 : -1);
|
|
215
274
|
i0.ɵɵadvance();
|
|
216
|
-
i0.ɵɵconditional(ctx_r1.
|
|
275
|
+
i0.ɵɵconditional(ctx_r1.showRecentRecordsSection ? 3 : -1);
|
|
276
|
+
i0.ɵɵadvance();
|
|
277
|
+
i0.ɵɵconditional(ctx_r1.showPreviewSection && !ctx_r1.IsLoading ? 4 : -1);
|
|
217
278
|
i0.ɵɵadvance();
|
|
218
|
-
i0.ɵɵconditional(ctx_r1.showPreviewSection ?
|
|
279
|
+
i0.ɵɵconditional(ctx_r1.showPreviewSection ? 5 : -1);
|
|
219
280
|
i0.ɵɵadvance();
|
|
220
|
-
i0.ɵɵconditional(!ctx_r1.showRecentSection && !ctx_r1.showPreviewSection ?
|
|
281
|
+
i0.ɵɵconditional(!ctx_r1.showRecentSection && !ctx_r1.showRecentRecordsSection && !ctx_r1.showPreviewSection ? 6 : -1);
|
|
282
|
+
i0.ɵɵadvance();
|
|
283
|
+
i0.ɵɵconditional(ctx_r1.ShowPromo && ctx_r1.PromoText ? 7 : -1);
|
|
221
284
|
} }
|
|
222
285
|
/** User setting key for persisting the preview min relevance threshold */
|
|
223
286
|
const PREVIEW_MIN_RELEVANCE_KEY = 'search.previewMinRelevance';
|
|
@@ -244,6 +307,24 @@ export class SearchSuggestComponent {
|
|
|
244
307
|
MaxPreviewResults = 8;
|
|
245
308
|
/** Whether to show the recent searches section */
|
|
246
309
|
ShowRecent = true;
|
|
310
|
+
/**
|
|
311
|
+
* Recently opened records (host-loaded, e.g. from SearchService
|
|
312
|
+
* .GetRecentlyOpenedRecords). Rendered as a "Recently Opened" section in
|
|
313
|
+
* the idle/empty state so users can jump straight back to a record they
|
|
314
|
+
* just had open — the complement to Recent Searches (queries).
|
|
315
|
+
*/
|
|
316
|
+
RecentRecords = [];
|
|
317
|
+
/**
|
|
318
|
+
* Optional promo row pinned to the dropdown's bottom edge — a host-supplied
|
|
319
|
+
* nudge (e.g. Explorer advertising its command palette). The component is
|
|
320
|
+
* deliberately ignorant of WHAT is being promoted; the host provides the
|
|
321
|
+
* copy and handles both outcomes.
|
|
322
|
+
*/
|
|
323
|
+
ShowPromo = false;
|
|
324
|
+
/** Promo copy (one sentence). Required when ShowPromo is true. */
|
|
325
|
+
PromoText = '';
|
|
326
|
+
/** Label for the promo's accept action. */
|
|
327
|
+
PromoActionLabel = 'Turn on';
|
|
247
328
|
// --- Outputs ---
|
|
248
329
|
/** Emitted when the user selects a preview result */
|
|
249
330
|
ResultSelected = new EventEmitter();
|
|
@@ -253,6 +334,12 @@ export class SearchSuggestComponent {
|
|
|
253
334
|
SeeAllRequested = new EventEmitter();
|
|
254
335
|
/** Emitted when the user clicks "Clear" on recent searches */
|
|
255
336
|
ClearRecentRequested = new EventEmitter();
|
|
337
|
+
/** Emitted when the user selects a recently opened record */
|
|
338
|
+
RecentRecordSelected = new EventEmitter();
|
|
339
|
+
/** Promo accept — carries the current query so the host can hand it off. */
|
|
340
|
+
PromoAccepted = new EventEmitter();
|
|
341
|
+
/** Promo dismissed — the host should persist this and stop showing it. */
|
|
342
|
+
PromoDismissed = new EventEmitter();
|
|
256
343
|
// --- Internal state ---
|
|
257
344
|
/** Currently keyboard-highlighted index (-1 for none) */
|
|
258
345
|
HighlightedIndex = -1;
|
|
@@ -301,6 +388,16 @@ export class SearchSuggestComponent {
|
|
|
301
388
|
return;
|
|
302
389
|
}
|
|
303
390
|
}
|
|
391
|
+
if (this.showRecentRecordsSection) {
|
|
392
|
+
// Navigating recently opened records (indexes continue after recents)
|
|
393
|
+
const offset = this.showRecentSection ? this.VisibleRecentSearches.length : 0;
|
|
394
|
+
const recordIndex = this.HighlightedIndex - offset;
|
|
395
|
+
const visibleRecords = this.VisibleRecentRecords;
|
|
396
|
+
if (recordIndex >= 0 && recordIndex < visibleRecords.length) {
|
|
397
|
+
this.OnRecentRecordClick(visibleRecords[recordIndex]);
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
304
401
|
if (this.showPreviewSection) {
|
|
305
402
|
// Navigating preview results
|
|
306
403
|
const offset = this.showRecentSection ? this.VisibleRecentSearches.length : 0;
|
|
@@ -320,6 +417,12 @@ export class SearchSuggestComponent {
|
|
|
320
417
|
ResetHighlight() {
|
|
321
418
|
this.HighlightedIndex = -1;
|
|
322
419
|
}
|
|
420
|
+
/** Number of keyboard-navigable rows currently visible (recents + recently
|
|
421
|
+
opened + preview results + see-all). Public so the composite's Tab
|
|
422
|
+
handling knows when the highlight has walked off the end of the list. */
|
|
423
|
+
get NavigableItemCount() {
|
|
424
|
+
return this.getNavigableItemCount();
|
|
425
|
+
}
|
|
323
426
|
// --- Template getters ---
|
|
324
427
|
/** Whether to show recent searches section */
|
|
325
428
|
get showRecentSection() {
|
|
@@ -329,6 +432,14 @@ export class SearchSuggestComponent {
|
|
|
329
432
|
get showPreviewSection() {
|
|
330
433
|
return this.Query.length >= this.MinQueryLength;
|
|
331
434
|
}
|
|
435
|
+
/** Whether to show the recently-opened-records section (idle state only) */
|
|
436
|
+
get showRecentRecordsSection() {
|
|
437
|
+
return this.Query.length < this.MinQueryLength && this.RecentRecords.length > 0;
|
|
438
|
+
}
|
|
439
|
+
/** Visible recently opened records (capped at 3) */
|
|
440
|
+
get VisibleRecentRecords() {
|
|
441
|
+
return this.RecentRecords.slice(0, 3);
|
|
442
|
+
}
|
|
332
443
|
/** Whether to show the "See all N results" footer */
|
|
333
444
|
get showSeeAllFooter() {
|
|
334
445
|
return this.showPreviewSection && this.TotalCount > 0;
|
|
@@ -354,14 +465,27 @@ export class SearchSuggestComponent {
|
|
|
354
465
|
OnRecentClick(recent) {
|
|
355
466
|
this.RecentSelected.emit(recent.Query);
|
|
356
467
|
}
|
|
468
|
+
/** Handle clicking a recently opened record */
|
|
469
|
+
OnRecentRecordClick(record) {
|
|
470
|
+
this.RecentRecordSelected.emit(record);
|
|
471
|
+
}
|
|
357
472
|
/** Handle clicking "See all" */
|
|
358
473
|
OnSeeAllClick() {
|
|
359
474
|
this.SeeAllRequested.emit(this.Query);
|
|
360
475
|
}
|
|
361
|
-
/**
|
|
476
|
+
/** Promo accept — fired on click so keyboard Enter/Space work too; the
|
|
477
|
+
template's mousedown-preventDefault keeps the input from blurring first. */
|
|
478
|
+
OnPromoAccept() {
|
|
479
|
+
this.PromoAccepted.emit(this.Query);
|
|
480
|
+
}
|
|
481
|
+
/** Promo dismiss. */
|
|
482
|
+
OnPromoDismiss() {
|
|
483
|
+
this.PromoDismissed.emit();
|
|
484
|
+
}
|
|
485
|
+
/** "Clear" on recent searches — click-driven so keyboard Enter/Space work;
|
|
486
|
+
the template's mousedown-preventDefault keeps the input from blurring. */
|
|
362
487
|
OnClearRecentClick(event) {
|
|
363
488
|
event.stopPropagation();
|
|
364
|
-
event.preventDefault();
|
|
365
489
|
this.ClearRecentRequested.emit();
|
|
366
490
|
}
|
|
367
491
|
/** Check if an item at the given index is highlighted */
|
|
@@ -410,6 +534,9 @@ export class SearchSuggestComponent {
|
|
|
410
534
|
if (this.showRecentSection) {
|
|
411
535
|
count += this.VisibleRecentSearches.length;
|
|
412
536
|
}
|
|
537
|
+
if (this.showRecentRecordsSection) {
|
|
538
|
+
count += this.VisibleRecentRecords.length;
|
|
539
|
+
}
|
|
413
540
|
if (this.showPreviewSection) {
|
|
414
541
|
count += this.VisiblePreviewResults.length;
|
|
415
542
|
if (this.showSeeAllFooter) {
|
|
@@ -451,15 +578,15 @@ export class SearchSuggestComponent {
|
|
|
451
578
|
}
|
|
452
579
|
}
|
|
453
580
|
static ɵfac = function SearchSuggestComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SearchSuggestComponent)(); };
|
|
454
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SearchSuggestComponent, selectors: [["mj-search-suggest"]], inputs: { IsOpen: "IsOpen", PreviewResults: "PreviewResults", RecentSearches: "RecentSearches", TotalCount: "TotalCount", IsLoading: "IsLoading", Query: "Query", MinQueryLength: "MinQueryLength", MaxPreviewResults: "MaxPreviewResults", ShowRecent: "ShowRecent" }, outputs: { ResultSelected: "ResultSelected", RecentSelected: "RecentSelected", SeeAllRequested: "SeeAllRequested", ClearRecentRequested: "ClearRecentRequested" }, standalone: false, decls: 1, vars: 1, consts: [[1, "suggest-dropdown"], [1, "suggest-loading"], [1, "suggest-section"], [1, "suggest-filter-bar"], [1, "suggest-empty"], [1, "fa-solid", "fa-spinner", "fa-spin", "suggest-loading-icon"], [1, "suggest-section-header"], [1, "fa-solid", "fa-clock", "suggest-section-icon"], [1, "suggest-clear-link", 3, "mousedown"], [1, "suggest-item", "suggest-recent-item", 3, "suggest-item-highlighted"], [1, "suggest-item", "suggest-recent-item", 3, "mousedown", "mouseenter"], [1, "fa-solid", "fa-clock", "suggest-item-icon"], [1, "suggest-item-text"], [1, "suggest-item-meta"], [1, "suggest-see-all", 3, "suggest-item-highlighted"], [1, "suggest-item", "suggest-result-item", 3, "suggest-item-highlighted"], [1, "suggest-item", "suggest-result-item", 3, "mousedown", "mouseenter"], [1, "suggest-result-icon"], [1, "suggest-result-body"], [1, "suggest-result-title"], [1, "suggest-result-entity"], [1, "suggest-result-score"], [1, "suggest-see-all", 3, "mousedown", "mouseenter"], [1, "fa-solid", "fa-arrow-right", "suggest-see-all-icon"], [1, "suggest-filter-toggle", 3, "mousedown"], [1, "fa-solid", "fa-sliders", "suggest-filter-icon"], [1, "suggest-filter-label"], [1, "fa-solid", "fa-chevron-down", "suggest-filter-chevron"], [1, "suggest-filter-popover"], [1, "suggest-filter-popover-header"], [1, "suggest-filter-option", 3, "suggest-filter-option-active"], [1, "suggest-filter-option", 3, "mousedown"], [1, "fa-solid", "fa-check", "suggest-filter-check"]], template: function SearchSuggestComponent_Template(rf, ctx) { if (rf & 1) {
|
|
455
|
-
i0.ɵɵconditionalCreate(0, SearchSuggestComponent_Conditional_0_Template,
|
|
581
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SearchSuggestComponent, selectors: [["mj-search-suggest"]], inputs: { IsOpen: "IsOpen", PreviewResults: "PreviewResults", RecentSearches: "RecentSearches", TotalCount: "TotalCount", IsLoading: "IsLoading", Query: "Query", MinQueryLength: "MinQueryLength", MaxPreviewResults: "MaxPreviewResults", ShowRecent: "ShowRecent", RecentRecords: "RecentRecords", ShowPromo: "ShowPromo", PromoText: "PromoText", PromoActionLabel: "PromoActionLabel" }, outputs: { ResultSelected: "ResultSelected", RecentSelected: "RecentSelected", SeeAllRequested: "SeeAllRequested", ClearRecentRequested: "ClearRecentRequested", RecentRecordSelected: "RecentRecordSelected", PromoAccepted: "PromoAccepted", PromoDismissed: "PromoDismissed" }, standalone: false, decls: 1, vars: 1, consts: [[1, "suggest-dropdown"], [1, "suggest-loading"], [1, "suggest-section"], [1, "suggest-filter-bar"], [1, "suggest-empty"], [1, "suggest-promo"], [1, "fa-solid", "fa-spinner", "fa-spin", "suggest-loading-icon"], [1, "suggest-section-header"], [1, "fa-solid", "fa-clock", "suggest-section-icon"], ["type", "button", "aria-label", "Clear recent searches", 1, "suggest-clear-link", 3, "mousedown", "click"], [1, "suggest-item", "suggest-recent-item", 3, "suggest-item-highlighted"], [1, "suggest-item", "suggest-recent-item", 3, "mousedown", "mouseenter"], [1, "fa-solid", "fa-clock", "suggest-item-icon"], [1, "suggest-item-text"], [1, "suggest-item-meta"], [1, "fa-solid", "fa-clock-rotate-left", "suggest-section-icon"], [1, "fa-solid", "fa-file-lines", "suggest-item-icon"], [1, "suggest-see-all", 3, "suggest-item-highlighted"], [1, "suggest-item", "suggest-result-item", 3, "suggest-item-highlighted"], [1, "suggest-item", "suggest-result-item", 3, "mousedown", "mouseenter"], [1, "suggest-result-icon"], [1, "suggest-result-body"], [1, "suggest-result-title"], [1, "suggest-result-entity"], [1, "suggest-result-score"], [1, "suggest-see-all", 3, "mousedown", "mouseenter"], [1, "fa-solid", "fa-arrow-right", "suggest-see-all-icon"], [1, "suggest-filter-toggle", 3, "mousedown"], [1, "fa-solid", "fa-sliders", "suggest-filter-icon"], [1, "suggest-filter-label"], [1, "fa-solid", "fa-chevron-down", "suggest-filter-chevron"], [1, "suggest-filter-popover"], [1, "suggest-filter-popover-header"], [1, "suggest-filter-option", 3, "suggest-filter-option-active"], [1, "suggest-filter-option", 3, "mousedown"], [1, "fa-solid", "fa-check", "suggest-filter-check"], [1, "fa-solid", "fa-wand-magic-sparkles", "suggest-promo-icon"], [1, "suggest-promo-text"], ["type", "button", 1, "suggest-promo-action", 3, "mousedown", "click"], ["type", "button", "aria-label", "Dismiss", "title", "Dismiss", 1, "suggest-promo-dismiss", 3, "mousedown", "click"], [1, "fa-solid", "fa-xmark"]], template: function SearchSuggestComponent_Template(rf, ctx) { if (rf & 1) {
|
|
582
|
+
i0.ɵɵconditionalCreate(0, SearchSuggestComponent_Conditional_0_Template, 8, 7, "div", 0);
|
|
456
583
|
} if (rf & 2) {
|
|
457
584
|
i0.ɵɵconditional(ctx.IsOpen ? 0 : -1);
|
|
458
|
-
} }, styles: ["\n\n\n.suggest-dropdown[_ngcontent-%COMP%] {\n position: absolute;\n top: 100%;\n left: 0;\n right: 0;\n z-index: 99999;\n margin-top: 4px;\n border: 1px solid var(--mj-border-default);\n border-radius: 10px;\n background: var(--mj-bg-surface);\n box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);\n overflow: visible;\n animation: _ngcontent-%COMP%_suggestSlideIn 0.15s ease;\n}\n\n@keyframes _ngcontent-%COMP%_suggestSlideIn {\n from {\n opacity: 0;\n transform: translateY(-4px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}\n\n\n\n.suggest-section[_ngcontent-%COMP%] {\n padding: 0.25rem 0;\n}\n\n.suggest-section[_ngcontent-%COMP%] + .suggest-section[_ngcontent-%COMP%] {\n border-top: 1px solid var(--mj-border-subtle);\n}\n\n.suggest-section-header[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 0.4rem;\n padding: 0.5rem 0.75rem 0.3rem;\n font-size: 0.7rem;\n font-weight: 600;\n color: var(--mj-text-muted);\n text-transform: uppercase;\n letter-spacing: 0.04em;\n}\n\n.suggest-section-icon[_ngcontent-%COMP%] {\n font-size: 0.65rem;\n}\n\n.suggest-clear-link[_ngcontent-%COMP%] {\n margin-left: auto;\n font-size: 0.68rem;\n font-weight:
|
|
585
|
+
} }, styles: ["\n\n\n.suggest-dropdown[_ngcontent-%COMP%] {\n position: absolute;\n top: 100%;\n left: 0;\n right: 0;\n z-index: 99999;\n margin-top: 4px;\n border: 1px solid var(--mj-border-default);\n border-radius: 10px;\n background: var(--mj-bg-surface);\n box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);\n overflow: visible;\n animation: _ngcontent-%COMP%_suggestSlideIn 0.15s ease;\n}\n\n@keyframes _ngcontent-%COMP%_suggestSlideIn {\n from {\n opacity: 0;\n transform: translateY(-4px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}\n\n\n\n.suggest-section[_ngcontent-%COMP%] {\n padding: 0.25rem 0;\n}\n\n.suggest-section[_ngcontent-%COMP%] + .suggest-section[_ngcontent-%COMP%] {\n border-top: 1px solid var(--mj-border-subtle);\n}\n\n.suggest-section-header[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 0.4rem;\n padding: 0.5rem 0.75rem 0.3rem;\n font-size: 0.7rem;\n font-weight: 600;\n color: var(--mj-text-muted);\n text-transform: uppercase;\n letter-spacing: 0.04em;\n}\n\n.suggest-section-icon[_ngcontent-%COMP%] {\n font-size: 0.65rem;\n}\n\n.suggest-clear-link[_ngcontent-%COMP%] {\n margin-left: auto;\n padding: 0;\n border: none;\n background: transparent;\n font-family: inherit;\n font-size: 0.68rem;\n font-weight: var(--mj-font-medium);\n color: var(--mj-text-link, var(--mj-brand-primary));\n cursor: pointer;\n text-transform: none;\n letter-spacing: normal;\n}\n\n.suggest-clear-link[_ngcontent-%COMP%]:hover {\n text-decoration: underline;\n}\n\n.suggest-clear-link[_ngcontent-%COMP%]:focus-visible {\n outline: 2px solid var(--mj-border-focus);\n outline-offset: 2px;\n border-radius: var(--mj-radius-sm);\n}\n\n\n\n.suggest-item[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 0.6rem;\n padding: 0.45rem 0.75rem;\n cursor: pointer;\n transition: background 0.08s ease;\n}\n\n.suggest-item[_ngcontent-%COMP%]:hover, \n.suggest-item-highlighted[_ngcontent-%COMP%] {\n background: var(--mj-bg-surface-hover);\n}\n\n.suggest-item-icon[_ngcontent-%COMP%] {\n color: var(--mj-text-muted);\n font-size: 0.75rem;\n width: 1rem;\n text-align: center;\n flex-shrink: 0;\n}\n\n.suggest-item-text[_ngcontent-%COMP%] {\n flex: 1;\n font-size: 0.85rem;\n color: var(--mj-text-primary);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.suggest-item-meta[_ngcontent-%COMP%] {\n font-size: 0.72rem;\n color: var(--mj-text-muted);\n flex-shrink: 0;\n}\n\n\n\n.suggest-result-item[_ngcontent-%COMP%] {\n gap: 0.65rem;\n}\n\n.suggest-result-icon[_ngcontent-%COMP%] {\n width: 1.75rem;\n height: 1.75rem;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 6px;\n background: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface));\n color: var(--mj-brand-primary);\n font-size: 0.72rem;\n flex-shrink: 0;\n}\n\n.suggest-result-body[_ngcontent-%COMP%] {\n flex: 1;\n min-width: 0;\n}\n\n.suggest-result-title[_ngcontent-%COMP%] {\n font-size: 0.85rem;\n font-weight: 500;\n color: var(--mj-text-primary);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.suggest-result-entity[_ngcontent-%COMP%] {\n font-size: 0.7rem;\n color: var(--mj-text-muted);\n}\n\n\n\n.suggest-result-score[_ngcontent-%COMP%] {\n font-size: 0.68rem;\n font-weight: 600;\n padding: 0.1rem 0.4rem;\n border-radius: 9999px;\n flex-shrink: 0;\n \n\n color: var(--mj-text-muted);\n background: color-mix(in srgb, var(--mj-text-muted) 10%, var(--mj-bg-surface));\n}\n\n\n\n.suggest-score-high[_ngcontent-%COMP%] {\n color: var(--mj-status-success-text, var(--mj-status-success));\n background: color-mix(in srgb, var(--mj-status-success) 12%, var(--mj-bg-surface));\n}\n\n\n\n.suggest-score-medium[_ngcontent-%COMP%] {\n color: var(--mj-status-warning-text, var(--mj-status-warning));\n background: color-mix(in srgb, var(--mj-status-warning) 12%, var(--mj-bg-surface));\n}\n\n\n\n.suggest-score-low[_ngcontent-%COMP%] {\n color: var(--mj-text-muted);\n background: color-mix(in srgb, var(--mj-text-muted) 10%, var(--mj-bg-surface));\n}\n\n\n\n.suggest-loading[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n padding: 0.85rem 0.75rem;\n color: var(--mj-text-muted);\n font-size: 0.82rem;\n}\n\n.suggest-loading-icon[_ngcontent-%COMP%] {\n color: var(--mj-brand-primary);\n}\n\n\n\n.suggest-empty[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 1rem 0.75rem;\n color: var(--mj-text-muted);\n font-size: 0.82rem;\n}\n\n\n\n.suggest-see-all[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n padding: 0.55rem 0.75rem;\n border-top: 1px solid var(--mj-border-subtle);\n cursor: pointer;\n color: var(--mj-brand-primary);\n font-size: 0.82rem;\n font-weight: 500;\n transition: background 0.08s ease;\n}\n\n.suggest-see-all[_ngcontent-%COMP%]:hover, \n.suggest-see-all.suggest-item-highlighted[_ngcontent-%COMP%] {\n background: var(--mj-bg-surface-hover);\n}\n\n.suggest-see-all-icon[_ngcontent-%COMP%] {\n font-size: 0.72rem;\n}\n\n\n\n.suggest-filter-bar[_ngcontent-%COMP%] {\n position: relative;\n border-top: 1px solid var(--mj-border-subtle);\n padding: 0.35rem 0.75rem;\n}\n\n.suggest-filter-toggle[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 0.4rem;\n cursor: pointer;\n font-size: 0.7rem;\n color: var(--mj-text-muted);\n transition: color 0.1s ease;\n user-select: none;\n}\n\n.suggest-filter-toggle[_ngcontent-%COMP%]:hover {\n color: var(--mj-text-secondary);\n}\n\n.suggest-filter-icon[_ngcontent-%COMP%] {\n font-size: 0.65rem;\n}\n\n.suggest-filter-label[_ngcontent-%COMP%] {\n flex: 1;\n}\n\n.suggest-filter-chevron[_ngcontent-%COMP%] {\n font-size: 0.55rem;\n transition: transform 0.15s ease;\n}\n\n.suggest-filter-chevron-open[_ngcontent-%COMP%] {\n transform: rotate(180deg);\n}\n\n\n\n.suggest-filter-popover[_ngcontent-%COMP%] {\n position: absolute;\n top: 100%;\n left: 0.5rem;\n right: 0.5rem;\n margin-top: 4px;\n background: var(--mj-bg-surface-elevated, var(--mj-bg-surface));\n border: 1px solid var(--mj-border-default);\n border-radius: 8px;\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);\n overflow: hidden;\n z-index: 10;\n animation: _ngcontent-%COMP%_suggestSlideIn 0.12s ease;\n}\n\n.suggest-filter-popover-header[_ngcontent-%COMP%] {\n padding: 0.4rem 0.6rem 0.25rem;\n font-size: 0.65rem;\n font-weight: 600;\n color: var(--mj-text-muted);\n text-transform: uppercase;\n letter-spacing: 0.04em;\n}\n\n.suggest-filter-option[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0.35rem 0.6rem;\n cursor: pointer;\n font-size: 0.78rem;\n color: var(--mj-text-primary);\n transition: background 0.08s ease;\n}\n\n.suggest-filter-option[_ngcontent-%COMP%]:hover {\n background: var(--mj-bg-surface-hover);\n}\n\n.suggest-filter-option-active[_ngcontent-%COMP%] {\n color: var(--mj-brand-primary);\n font-weight: 600;\n}\n\n.suggest-filter-check[_ngcontent-%COMP%] {\n font-size: 0.65rem;\n color: var(--mj-brand-primary);\n}\n\n\n\n\n.suggest-promo[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: var(--mj-space-2);\n padding: var(--mj-space-2) var(--mj-space-3);\n border-top: 1px solid var(--mj-border-subtle);\n background: var(--mj-bg-surface-card);\n font-size: 0.78rem;\n color: var(--mj-text-muted);\n}\n\n.suggest-promo-icon[_ngcontent-%COMP%] {\n color: var(--mj-brand-primary);\n flex-shrink: 0;\n}\n\n.suggest-promo-text[_ngcontent-%COMP%] {\n flex: 1;\n min-width: 0;\n}\n\n.suggest-promo-action[_ngcontent-%COMP%] {\n flex-shrink: 0;\n padding: 0.2rem 0.6rem;\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-md);\n background: transparent;\n color: var(--mj-brand-primary);\n font-size: 0.75rem;\n font-weight: var(--mj-font-medium);\n cursor: pointer;\n transition: var(--mj-transition-colors);\n}\n\n.suggest-promo-action[_ngcontent-%COMP%]:hover {\n background: color-mix(in srgb, var(--mj-brand-primary) 8%, var(--mj-bg-surface));\n border-color: var(--mj-brand-primary);\n}\n\n.suggest-promo-dismiss[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 22px;\n height: 22px;\n padding: 0;\n border: none;\n border-radius: var(--mj-radius-full);\n background: transparent;\n color: var(--mj-text-disabled);\n font-size: 0.75rem;\n cursor: pointer;\n transition: var(--mj-transition-colors);\n flex-shrink: 0;\n}\n\n.suggest-promo-dismiss[_ngcontent-%COMP%]:hover {\n background: var(--mj-bg-surface-hover);\n color: var(--mj-text-secondary);\n}"] });
|
|
459
586
|
}
|
|
460
587
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SearchSuggestComponent, [{
|
|
461
588
|
type: Component,
|
|
462
|
-
args: [{ standalone: false, selector: 'mj-search-suggest', template: "@if (IsOpen) {\n <div class=\"suggest-dropdown\">\n @if (IsLoading && showPreviewSection) {\n <div class=\"suggest-loading\">\n <i class=\"fa-solid fa-spinner fa-spin suggest-loading-icon\"></i>\n <span>Searching...</span>\n </div>\n }\n\n <!-- Recent searches section -->\n @if (showRecentSection) {\n <div class=\"suggest-section\">\n <div class=\"suggest-section-header\">\n <i class=\"fa-solid fa-clock suggest-section-icon\"></i>\n <span>Recent Searches</span>\n <span class=\"suggest-clear-link\" (mousedown)=\"OnClearRecentClick($event)\">Clear</span>\n </div>\n @for (recent of VisibleRecentSearches; track recent.Query; let i = $index) {\n <div\n class=\"suggest-item suggest-recent-item\"\n [class.suggest-item-highlighted]=\"IsHighlighted(i)\"\n (mousedown)=\"OnRecentClick(recent); $event.preventDefault()\"\n (mouseenter)=\"HighlightedIndex = i\"\n >\n <i class=\"fa-solid fa-clock suggest-item-icon\"></i>\n <span class=\"suggest-item-text\">{{ recent.Query }}</span>\n <span class=\"suggest-item-meta\">{{ recent.ResultCount }} results</span>\n </div>\n }\n </div>\n }\n\n <!-- Preview results section -->\n @if (showPreviewSection && !IsLoading) {\n @if (VisiblePreviewResults.length > 0) {\n <div class=\"suggest-section\">\n @for (result of VisiblePreviewResults; track result.ID; let i = $index) {\n <div\n class=\"suggest-item suggest-result-item\"\n [class.suggest-item-highlighted]=\"IsHighlighted((showRecentSection ? VisibleRecentSearches.length : 0) + i)\"\n (mousedown)=\"OnResultClick(result); $event.preventDefault()\"\n (mouseenter)=\"HighlightedIndex = (showRecentSection ? VisibleRecentSearches.length : 0) + i\"\n >\n <div class=\"suggest-result-icon\">\n <i [class]=\"result.EntityIcon || result.SourceIcon || 'fa-solid fa-database'\"></i>\n </div>\n <div class=\"suggest-result-body\">\n <div class=\"suggest-result-title\">{{ result.RecordName || result.Title }}</div>\n <div class=\"suggest-result-entity\">{{ result.EntityName }}</div>\n </div>\n <span class=\"suggest-result-score\" [class]=\"'suggest-result-score ' + GetScoreClass(result.Score)\">{{ FormatScore(result.Score) }}</span>\n </div>\n }\n </div>\n } @else if (!IsLoading) {\n <div class=\"suggest-empty\">\n <span>No results found</span>\n </div>\n }\n\n <!-- See all footer -->\n @if (showSeeAllFooter) {\n <div\n class=\"suggest-see-all\"\n [class.suggest-item-highlighted]=\"IsHighlighted((showRecentSection ? VisibleRecentSearches.length : 0) + VisiblePreviewResults.length)\"\n (mousedown)=\"OnSeeAllClick(); $event.preventDefault()\"\n (mouseenter)=\"HighlightedIndex = (showRecentSection ? VisibleRecentSearches.length : 0) + VisiblePreviewResults.length\"\n >\n <i class=\"fa-solid fa-arrow-right suggest-see-all-icon\"></i>\n <span>See all {{ TotalCount }} results</span>\n </div>\n }\n }\n\n <!-- Min relevance filter bar -->\n @if (showPreviewSection) {\n <div class=\"suggest-filter-bar\">\n <div class=\"suggest-filter-toggle\" (mousedown)=\"ToggleFilter($event)\">\n <i class=\"fa-solid fa-sliders suggest-filter-icon\"></i>\n <span class=\"suggest-filter-label\">\n @if (MinRelevancePercent > 0) {\n Min relevance: {{ MinRelevancePercent }}%\n } @else {\n Showing all results\n }\n </span>\n <i class=\"fa-solid fa-chevron-down suggest-filter-chevron\" [class.suggest-filter-chevron-open]=\"IsFilterOpen\"></i>\n </div>\n\n @if (IsFilterOpen) {\n <div class=\"suggest-filter-popover\">\n <div class=\"suggest-filter-popover-header\">Min Relevance</div>\n @for (option of MinRelevanceOptions; track option) {\n <div\n class=\"suggest-filter-option\"\n [class.suggest-filter-option-active]=\"IsSelectedRelevance(option)\"\n (mousedown)=\"SetMinRelevance(option, $event)\"\n >\n <span>{{ FormatRelevanceOption(option) }}</span>\n @if (IsSelectedRelevance(option)) {\n <i class=\"fa-solid fa-check suggest-filter-check\"></i>\n }\n </div>\n }\n </div>\n }\n </div>\n }\n\n <!-- Empty state when no recent and query too short -->\n @if (!showRecentSection && !showPreviewSection) {\n <div class=\"suggest-empty\">\n <span>Type at least {{ MinQueryLength }} characters to search</span>\n </div>\n }\n </div>\n}\n", styles: ["/* Search Suggest Dropdown */\n\n.suggest-dropdown {\n position: absolute;\n top: 100%;\n left: 0;\n right: 0;\n z-index: 99999;\n margin-top: 4px;\n border: 1px solid var(--mj-border-default);\n border-radius: 10px;\n background: var(--mj-bg-surface);\n box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);\n overflow: visible;\n animation: suggestSlideIn 0.15s ease;\n}\n\n@keyframes suggestSlideIn {\n from {\n opacity: 0;\n transform: translateY(-4px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}\n\n/* Sections */\n.suggest-section {\n padding: 0.25rem 0;\n}\n\n.suggest-section + .suggest-section {\n border-top: 1px solid var(--mj-border-subtle);\n}\n\n.suggest-section-header {\n display: flex;\n align-items: center;\n gap: 0.4rem;\n padding: 0.5rem 0.75rem 0.3rem;\n font-size: 0.7rem;\n font-weight: 600;\n color: var(--mj-text-muted);\n text-transform: uppercase;\n letter-spacing: 0.04em;\n}\n\n.suggest-section-icon {\n font-size: 0.65rem;\n}\n\n.suggest-clear-link {\n margin-left: auto;\n font-size: 0.68rem;\n font-weight: 500;\n color: var(--mj-text-link, var(--mj-brand-primary));\n cursor: pointer;\n text-transform: none;\n letter-spacing: normal;\n}\n\n.suggest-clear-link:hover {\n text-decoration: underline;\n}\n\n/* Items */\n.suggest-item {\n display: flex;\n align-items: center;\n gap: 0.6rem;\n padding: 0.45rem 0.75rem;\n cursor: pointer;\n transition: background 0.08s ease;\n}\n\n.suggest-item:hover,\n.suggest-item-highlighted {\n background: var(--mj-bg-surface-hover);\n}\n\n.suggest-item-icon {\n color: var(--mj-text-muted);\n font-size: 0.75rem;\n width: 1rem;\n text-align: center;\n flex-shrink: 0;\n}\n\n.suggest-item-text {\n flex: 1;\n font-size: 0.85rem;\n color: var(--mj-text-primary);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.suggest-item-meta {\n font-size: 0.72rem;\n color: var(--mj-text-muted);\n flex-shrink: 0;\n}\n\n/* Result items */\n.suggest-result-item {\n gap: 0.65rem;\n}\n\n.suggest-result-icon {\n width: 1.75rem;\n height: 1.75rem;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 6px;\n background: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface));\n color: var(--mj-brand-primary);\n font-size: 0.72rem;\n flex-shrink: 0;\n}\n\n.suggest-result-body {\n flex: 1;\n min-width: 0;\n}\n\n.suggest-result-title {\n font-size: 0.85rem;\n font-weight: 500;\n color: var(--mj-text-primary);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.suggest-result-entity {\n font-size: 0.7rem;\n color: var(--mj-text-muted);\n}\n\n/* Score badge \u2014 base styles */\n.suggest-result-score {\n font-size: 0.68rem;\n font-weight: 600;\n padding: 0.1rem 0.4rem;\n border-radius: 9999px;\n flex-shrink: 0;\n /* Default: neutral gray */\n color: var(--mj-text-muted);\n background: color-mix(in srgb, var(--mj-text-muted) 10%, var(--mj-bg-surface));\n}\n\n/* Score badge \u2014 high relevance (green, \u226540%) */\n.suggest-score-high {\n color: var(--mj-status-success-text, var(--mj-status-success));\n background: color-mix(in srgb, var(--mj-status-success) 12%, var(--mj-bg-surface));\n}\n\n/* Score badge \u2014 medium relevance (amber, 15\u201339%) */\n.suggest-score-medium {\n color: var(--mj-status-warning-text, var(--mj-status-warning));\n background: color-mix(in srgb, var(--mj-status-warning) 12%, var(--mj-bg-surface));\n}\n\n/* Score badge \u2014 low relevance (gray, <15%) */\n.suggest-score-low {\n color: var(--mj-text-muted);\n background: color-mix(in srgb, var(--mj-text-muted) 10%, var(--mj-bg-surface));\n}\n\n/* Loading */\n.suggest-loading {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n padding: 0.85rem 0.75rem;\n color: var(--mj-text-muted);\n font-size: 0.82rem;\n}\n\n.suggest-loading-icon {\n color: var(--mj-brand-primary);\n}\n\n/* Empty state */\n.suggest-empty {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 1rem 0.75rem;\n color: var(--mj-text-muted);\n font-size: 0.82rem;\n}\n\n/* See all footer */\n.suggest-see-all {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n padding: 0.55rem 0.75rem;\n border-top: 1px solid var(--mj-border-subtle);\n cursor: pointer;\n color: var(--mj-brand-primary);\n font-size: 0.82rem;\n font-weight: 500;\n transition: background 0.08s ease;\n}\n\n.suggest-see-all:hover,\n.suggest-see-all.suggest-item-highlighted {\n background: var(--mj-bg-surface-hover);\n}\n\n.suggest-see-all-icon {\n font-size: 0.72rem;\n}\n\n/* --- Min Relevance Filter Bar --- */\n.suggest-filter-bar {\n position: relative;\n border-top: 1px solid var(--mj-border-subtle);\n padding: 0.35rem 0.75rem;\n}\n\n.suggest-filter-toggle {\n display: flex;\n align-items: center;\n gap: 0.4rem;\n cursor: pointer;\n font-size: 0.7rem;\n color: var(--mj-text-muted);\n transition: color 0.1s ease;\n user-select: none;\n}\n\n.suggest-filter-toggle:hover {\n color: var(--mj-text-secondary);\n}\n\n.suggest-filter-icon {\n font-size: 0.65rem;\n}\n\n.suggest-filter-label {\n flex: 1;\n}\n\n.suggest-filter-chevron {\n font-size: 0.55rem;\n transition: transform 0.15s ease;\n}\n\n.suggest-filter-chevron-open {\n transform: rotate(180deg);\n}\n\n/* Filter popover */\n.suggest-filter-popover {\n position: absolute;\n top: 100%;\n left: 0.5rem;\n right: 0.5rem;\n margin-top: 4px;\n background: var(--mj-bg-surface-elevated, var(--mj-bg-surface));\n border: 1px solid var(--mj-border-default);\n border-radius: 8px;\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);\n overflow: hidden;\n z-index: 10;\n animation: suggestSlideIn 0.12s ease;\n}\n\n.suggest-filter-popover-header {\n padding: 0.4rem 0.6rem 0.25rem;\n font-size: 0.65rem;\n font-weight: 600;\n color: var(--mj-text-muted);\n text-transform: uppercase;\n letter-spacing: 0.04em;\n}\n\n.suggest-filter-option {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0.35rem 0.6rem;\n cursor: pointer;\n font-size: 0.78rem;\n color: var(--mj-text-primary);\n transition: background 0.08s ease;\n}\n\n.suggest-filter-option:hover {\n background: var(--mj-bg-surface-hover);\n}\n\n.suggest-filter-option-active {\n color: var(--mj-brand-primary);\n font-weight: 600;\n}\n\n.suggest-filter-check {\n font-size: 0.65rem;\n color: var(--mj-brand-primary);\n}\n"] }]
|
|
589
|
+
args: [{ standalone: false, selector: 'mj-search-suggest', template: "@if (IsOpen) {\n <div class=\"suggest-dropdown\">\n @if (IsLoading && showPreviewSection) {\n <div class=\"suggest-loading\">\n <i class=\"fa-solid fa-spinner fa-spin suggest-loading-icon\"></i>\n <span>Searching...</span>\n </div>\n }\n\n <!-- Recent searches section -->\n @if (showRecentSection) {\n <div class=\"suggest-section\">\n <div class=\"suggest-section-header\">\n <i class=\"fa-solid fa-clock suggest-section-icon\"></i>\n <span>Recent Searches</span>\n <button type=\"button\" class=\"suggest-clear-link\" aria-label=\"Clear recent searches\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"OnClearRecentClick($event)\">Clear</button>\n </div>\n @for (recent of VisibleRecentSearches; track recent.Query; let i = $index) {\n <div\n class=\"suggest-item suggest-recent-item\"\n [class.suggest-item-highlighted]=\"IsHighlighted(i)\"\n (mousedown)=\"OnRecentClick(recent); $event.preventDefault()\"\n (mouseenter)=\"HighlightedIndex = i\"\n >\n <i class=\"fa-solid fa-clock suggest-item-icon\"></i>\n <span class=\"suggest-item-text\">{{ recent.Query }}</span>\n <span class=\"suggest-item-meta\">{{ recent.ResultCount }} results</span>\n </div>\n }\n </div>\n }\n\n <!-- Recently opened records section (idle state) -->\n @if (showRecentRecordsSection) {\n <div class=\"suggest-section\">\n <div class=\"suggest-section-header\">\n <i class=\"fa-solid fa-clock-rotate-left suggest-section-icon\"></i>\n <span>Recently Opened</span>\n </div>\n @for (record of VisibleRecentRecords; track record.EntityName + record.RecordID; let i = $index) {\n <div\n class=\"suggest-item suggest-recent-item\"\n [class.suggest-item-highlighted]=\"IsHighlighted((showRecentSection ? VisibleRecentSearches.length : 0) + i)\"\n (mousedown)=\"OnRecentRecordClick(record); $event.preventDefault()\"\n (mouseenter)=\"HighlightedIndex = (showRecentSection ? VisibleRecentSearches.length : 0) + i\"\n >\n <i class=\"fa-solid fa-file-lines suggest-item-icon\"></i>\n <span class=\"suggest-item-text\">{{ record.RecordName }}</span>\n <span class=\"suggest-item-meta\">{{ record.EntityName }}</span>\n </div>\n }\n </div>\n }\n\n <!-- Preview results section -->\n @if (showPreviewSection && !IsLoading) {\n @if (VisiblePreviewResults.length > 0) {\n <div class=\"suggest-section\">\n @for (result of VisiblePreviewResults; track result.ID; let i = $index) {\n <div\n class=\"suggest-item suggest-result-item\"\n [class.suggest-item-highlighted]=\"IsHighlighted((showRecentSection ? VisibleRecentSearches.length : 0) + i)\"\n (mousedown)=\"OnResultClick(result); $event.preventDefault()\"\n (mouseenter)=\"HighlightedIndex = (showRecentSection ? VisibleRecentSearches.length : 0) + i\"\n >\n <div class=\"suggest-result-icon\">\n <i [class]=\"result.EntityIcon || result.SourceIcon || 'fa-solid fa-database'\"></i>\n </div>\n <div class=\"suggest-result-body\">\n <div class=\"suggest-result-title\">{{ result.RecordName || result.Title }}</div>\n <div class=\"suggest-result-entity\">{{ result.EntityName }}</div>\n </div>\n <span class=\"suggest-result-score\" [class]=\"'suggest-result-score ' + GetScoreClass(result.Score)\">{{ FormatScore(result.Score) }}</span>\n </div>\n }\n </div>\n } @else if (!IsLoading) {\n <div class=\"suggest-empty\">\n <span>No results found</span>\n </div>\n }\n\n <!-- See all footer -->\n @if (showSeeAllFooter) {\n <div\n class=\"suggest-see-all\"\n [class.suggest-item-highlighted]=\"IsHighlighted((showRecentSection ? VisibleRecentSearches.length : 0) + VisiblePreviewResults.length)\"\n (mousedown)=\"OnSeeAllClick(); $event.preventDefault()\"\n (mouseenter)=\"HighlightedIndex = (showRecentSection ? VisibleRecentSearches.length : 0) + VisiblePreviewResults.length\"\n >\n <i class=\"fa-solid fa-arrow-right suggest-see-all-icon\"></i>\n <span>See all {{ TotalCount }} results</span>\n </div>\n }\n }\n\n <!-- Min relevance filter bar -->\n @if (showPreviewSection) {\n <div class=\"suggest-filter-bar\">\n <div class=\"suggest-filter-toggle\" (mousedown)=\"ToggleFilter($event)\">\n <i class=\"fa-solid fa-sliders suggest-filter-icon\"></i>\n <span class=\"suggest-filter-label\">\n @if (MinRelevancePercent > 0) {\n Min relevance: {{ MinRelevancePercent }}%\n } @else {\n Showing all results\n }\n </span>\n <i class=\"fa-solid fa-chevron-down suggest-filter-chevron\" [class.suggest-filter-chevron-open]=\"IsFilterOpen\"></i>\n </div>\n\n @if (IsFilterOpen) {\n <div class=\"suggest-filter-popover\">\n <div class=\"suggest-filter-popover-header\">Min Relevance</div>\n @for (option of MinRelevanceOptions; track option) {\n <div\n class=\"suggest-filter-option\"\n [class.suggest-filter-option-active]=\"IsSelectedRelevance(option)\"\n (mousedown)=\"SetMinRelevance(option, $event)\"\n >\n <span>{{ FormatRelevanceOption(option) }}</span>\n @if (IsSelectedRelevance(option)) {\n <i class=\"fa-solid fa-check suggest-filter-check\"></i>\n }\n </div>\n }\n </div>\n }\n </div>\n }\n\n <!-- Empty state when no recents of either kind and query too short -->\n @if (!showRecentSection && !showRecentRecordsSection && !showPreviewSection) {\n <div class=\"suggest-empty\">\n <span>Type at least {{ MinQueryLength }} characters to search</span>\n </div>\n }\n\n <!-- Host-supplied promo row (e.g. command palette nudge) -->\n @if (ShowPromo && PromoText) {\n <div class=\"suggest-promo\">\n <i class=\"fa-solid fa-wand-magic-sparkles suggest-promo-icon\"></i>\n <span class=\"suggest-promo-text\">{{ PromoText }}</span>\n <button type=\"button\" class=\"suggest-promo-action\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"OnPromoAccept()\">{{ PromoActionLabel }}</button>\n <button type=\"button\" class=\"suggest-promo-dismiss\" aria-label=\"Dismiss\" title=\"Dismiss\"\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"OnPromoDismiss(); $event.stopPropagation()\">\n <i class=\"fa-solid fa-xmark\"></i>\n </button>\n </div>\n }\n </div>\n}\n", styles: ["/* Search Suggest Dropdown */\n\n.suggest-dropdown {\n position: absolute;\n top: 100%;\n left: 0;\n right: 0;\n z-index: 99999;\n margin-top: 4px;\n border: 1px solid var(--mj-border-default);\n border-radius: 10px;\n background: var(--mj-bg-surface);\n box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);\n overflow: visible;\n animation: suggestSlideIn 0.15s ease;\n}\n\n@keyframes suggestSlideIn {\n from {\n opacity: 0;\n transform: translateY(-4px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}\n\n/* Sections */\n.suggest-section {\n padding: 0.25rem 0;\n}\n\n.suggest-section + .suggest-section {\n border-top: 1px solid var(--mj-border-subtle);\n}\n\n.suggest-section-header {\n display: flex;\n align-items: center;\n gap: 0.4rem;\n padding: 0.5rem 0.75rem 0.3rem;\n font-size: 0.7rem;\n font-weight: 600;\n color: var(--mj-text-muted);\n text-transform: uppercase;\n letter-spacing: 0.04em;\n}\n\n.suggest-section-icon {\n font-size: 0.65rem;\n}\n\n.suggest-clear-link {\n margin-left: auto;\n padding: 0;\n border: none;\n background: transparent;\n font-family: inherit;\n font-size: 0.68rem;\n font-weight: var(--mj-font-medium);\n color: var(--mj-text-link, var(--mj-brand-primary));\n cursor: pointer;\n text-transform: none;\n letter-spacing: normal;\n}\n\n.suggest-clear-link:hover {\n text-decoration: underline;\n}\n\n.suggest-clear-link:focus-visible {\n outline: 2px solid var(--mj-border-focus);\n outline-offset: 2px;\n border-radius: var(--mj-radius-sm);\n}\n\n/* Items */\n.suggest-item {\n display: flex;\n align-items: center;\n gap: 0.6rem;\n padding: 0.45rem 0.75rem;\n cursor: pointer;\n transition: background 0.08s ease;\n}\n\n.suggest-item:hover,\n.suggest-item-highlighted {\n background: var(--mj-bg-surface-hover);\n}\n\n.suggest-item-icon {\n color: var(--mj-text-muted);\n font-size: 0.75rem;\n width: 1rem;\n text-align: center;\n flex-shrink: 0;\n}\n\n.suggest-item-text {\n flex: 1;\n font-size: 0.85rem;\n color: var(--mj-text-primary);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.suggest-item-meta {\n font-size: 0.72rem;\n color: var(--mj-text-muted);\n flex-shrink: 0;\n}\n\n/* Result items */\n.suggest-result-item {\n gap: 0.65rem;\n}\n\n.suggest-result-icon {\n width: 1.75rem;\n height: 1.75rem;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 6px;\n background: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface));\n color: var(--mj-brand-primary);\n font-size: 0.72rem;\n flex-shrink: 0;\n}\n\n.suggest-result-body {\n flex: 1;\n min-width: 0;\n}\n\n.suggest-result-title {\n font-size: 0.85rem;\n font-weight: 500;\n color: var(--mj-text-primary);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.suggest-result-entity {\n font-size: 0.7rem;\n color: var(--mj-text-muted);\n}\n\n/* Score badge \u2014 base styles */\n.suggest-result-score {\n font-size: 0.68rem;\n font-weight: 600;\n padding: 0.1rem 0.4rem;\n border-radius: 9999px;\n flex-shrink: 0;\n /* Default: neutral gray */\n color: var(--mj-text-muted);\n background: color-mix(in srgb, var(--mj-text-muted) 10%, var(--mj-bg-surface));\n}\n\n/* Score badge \u2014 high relevance (green, \u226540%) */\n.suggest-score-high {\n color: var(--mj-status-success-text, var(--mj-status-success));\n background: color-mix(in srgb, var(--mj-status-success) 12%, var(--mj-bg-surface));\n}\n\n/* Score badge \u2014 medium relevance (amber, 15\u201339%) */\n.suggest-score-medium {\n color: var(--mj-status-warning-text, var(--mj-status-warning));\n background: color-mix(in srgb, var(--mj-status-warning) 12%, var(--mj-bg-surface));\n}\n\n/* Score badge \u2014 low relevance (gray, <15%) */\n.suggest-score-low {\n color: var(--mj-text-muted);\n background: color-mix(in srgb, var(--mj-text-muted) 10%, var(--mj-bg-surface));\n}\n\n/* Loading */\n.suggest-loading {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n padding: 0.85rem 0.75rem;\n color: var(--mj-text-muted);\n font-size: 0.82rem;\n}\n\n.suggest-loading-icon {\n color: var(--mj-brand-primary);\n}\n\n/* Empty state */\n.suggest-empty {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 1rem 0.75rem;\n color: var(--mj-text-muted);\n font-size: 0.82rem;\n}\n\n/* See all footer */\n.suggest-see-all {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n padding: 0.55rem 0.75rem;\n border-top: 1px solid var(--mj-border-subtle);\n cursor: pointer;\n color: var(--mj-brand-primary);\n font-size: 0.82rem;\n font-weight: 500;\n transition: background 0.08s ease;\n}\n\n.suggest-see-all:hover,\n.suggest-see-all.suggest-item-highlighted {\n background: var(--mj-bg-surface-hover);\n}\n\n.suggest-see-all-icon {\n font-size: 0.72rem;\n}\n\n/* --- Min Relevance Filter Bar --- */\n.suggest-filter-bar {\n position: relative;\n border-top: 1px solid var(--mj-border-subtle);\n padding: 0.35rem 0.75rem;\n}\n\n.suggest-filter-toggle {\n display: flex;\n align-items: center;\n gap: 0.4rem;\n cursor: pointer;\n font-size: 0.7rem;\n color: var(--mj-text-muted);\n transition: color 0.1s ease;\n user-select: none;\n}\n\n.suggest-filter-toggle:hover {\n color: var(--mj-text-secondary);\n}\n\n.suggest-filter-icon {\n font-size: 0.65rem;\n}\n\n.suggest-filter-label {\n flex: 1;\n}\n\n.suggest-filter-chevron {\n font-size: 0.55rem;\n transition: transform 0.15s ease;\n}\n\n.suggest-filter-chevron-open {\n transform: rotate(180deg);\n}\n\n/* Filter popover */\n.suggest-filter-popover {\n position: absolute;\n top: 100%;\n left: 0.5rem;\n right: 0.5rem;\n margin-top: 4px;\n background: var(--mj-bg-surface-elevated, var(--mj-bg-surface));\n border: 1px solid var(--mj-border-default);\n border-radius: 8px;\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);\n overflow: hidden;\n z-index: 10;\n animation: suggestSlideIn 0.12s ease;\n}\n\n.suggest-filter-popover-header {\n padding: 0.4rem 0.6rem 0.25rem;\n font-size: 0.65rem;\n font-weight: 600;\n color: var(--mj-text-muted);\n text-transform: uppercase;\n letter-spacing: 0.04em;\n}\n\n.suggest-filter-option {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0.35rem 0.6rem;\n cursor: pointer;\n font-size: 0.78rem;\n color: var(--mj-text-primary);\n transition: background 0.08s ease;\n}\n\n.suggest-filter-option:hover {\n background: var(--mj-bg-surface-hover);\n}\n\n.suggest-filter-option-active {\n color: var(--mj-brand-primary);\n font-weight: 600;\n}\n\n.suggest-filter-check {\n font-size: 0.65rem;\n color: var(--mj-brand-primary);\n}\n\n/* Host-supplied promo row \u2014 a quiet whisper pinned to the dropdown's bottom\n edge, never a banner. */\n.suggest-promo {\n display: flex;\n align-items: center;\n gap: var(--mj-space-2);\n padding: var(--mj-space-2) var(--mj-space-3);\n border-top: 1px solid var(--mj-border-subtle);\n background: var(--mj-bg-surface-card);\n font-size: 0.78rem;\n color: var(--mj-text-muted);\n}\n\n.suggest-promo-icon {\n color: var(--mj-brand-primary);\n flex-shrink: 0;\n}\n\n.suggest-promo-text {\n flex: 1;\n min-width: 0;\n}\n\n.suggest-promo-action {\n flex-shrink: 0;\n padding: 0.2rem 0.6rem;\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-md);\n background: transparent;\n color: var(--mj-brand-primary);\n font-size: 0.75rem;\n font-weight: var(--mj-font-medium);\n cursor: pointer;\n transition: var(--mj-transition-colors);\n}\n\n.suggest-promo-action:hover {\n background: color-mix(in srgb, var(--mj-brand-primary) 8%, var(--mj-bg-surface));\n border-color: var(--mj-brand-primary);\n}\n\n.suggest-promo-dismiss {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 22px;\n height: 22px;\n padding: 0;\n border: none;\n border-radius: var(--mj-radius-full);\n background: transparent;\n color: var(--mj-text-disabled);\n font-size: 0.75rem;\n cursor: pointer;\n transition: var(--mj-transition-colors);\n flex-shrink: 0;\n}\n\n.suggest-promo-dismiss:hover {\n background: var(--mj-bg-surface-hover);\n color: var(--mj-text-secondary);\n}\n"] }]
|
|
463
590
|
}], null, { IsOpen: [{
|
|
464
591
|
type: Input
|
|
465
592
|
}], PreviewResults: [{
|
|
@@ -478,6 +605,14 @@ export class SearchSuggestComponent {
|
|
|
478
605
|
type: Input
|
|
479
606
|
}], ShowRecent: [{
|
|
480
607
|
type: Input
|
|
608
|
+
}], RecentRecords: [{
|
|
609
|
+
type: Input
|
|
610
|
+
}], ShowPromo: [{
|
|
611
|
+
type: Input
|
|
612
|
+
}], PromoText: [{
|
|
613
|
+
type: Input
|
|
614
|
+
}], PromoActionLabel: [{
|
|
615
|
+
type: Input
|
|
481
616
|
}], ResultSelected: [{
|
|
482
617
|
type: Output
|
|
483
618
|
}], RecentSelected: [{
|
|
@@ -486,6 +621,12 @@ export class SearchSuggestComponent {
|
|
|
486
621
|
type: Output
|
|
487
622
|
}], ClearRecentRequested: [{
|
|
488
623
|
type: Output
|
|
624
|
+
}], RecentRecordSelected: [{
|
|
625
|
+
type: Output
|
|
626
|
+
}], PromoAccepted: [{
|
|
627
|
+
type: Output
|
|
628
|
+
}], PromoDismissed: [{
|
|
629
|
+
type: Output
|
|
489
630
|
}] }); })();
|
|
490
631
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SearchSuggestComponent, { className: "SearchSuggestComponent", filePath: "src/lib/search-suggest.component.ts", lineNumber: 36 }); })();
|
|
491
632
|
//# sourceMappingURL=search-suggest.component.js.map
|