@memberjunction/ng-search 5.22.0 → 5.24.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/__tests__/search-results.component.test.d.ts +2 -0
- package/dist/__tests__/search-results.component.test.d.ts.map +1 -0
- package/dist/__tests__/search-results.component.test.js +263 -0
- package/dist/__tests__/search-results.component.test.js.map +1 -0
- package/dist/__tests__/search.service.test.js +147 -0
- package/dist/__tests__/search.service.test.js.map +1 -1
- package/dist/lib/search-filter.component.d.ts +6 -1
- package/dist/lib/search-filter.component.d.ts.map +1 -1
- package/dist/lib/search-filter.component.js +100 -51
- package/dist/lib/search-filter.component.js.map +1 -1
- package/dist/lib/search-results.component.d.ts +51 -3
- package/dist/lib/search-results.component.d.ts.map +1 -1
- package/dist/lib/search-results.component.js +502 -167
- package/dist/lib/search-results.component.js.map +1 -1
- package/dist/lib/search-types.d.ts +2 -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.map +1 -1
- package/dist/lib/search.service.js +2 -0
- package/dist/lib/search.service.js.map +1 -1
- package/package.json +4 -4
|
@@ -8,10 +8,10 @@ import { Component, EventEmitter, Input, Output, ChangeDetectorRef, inject } fro
|
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
9
9
|
const _forTrack0 = ($index, $item) => $item.Category;
|
|
10
10
|
const _forTrack1 = ($index, $item) => $item.Value;
|
|
11
|
-
function
|
|
11
|
+
function SearchFilterComponent_Conditional_6_Template(rf, ctx) { if (rf & 1) {
|
|
12
12
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
13
|
-
i0.ɵɵelementStart(0, "button",
|
|
14
|
-
i0.ɵɵlistener("click", function
|
|
13
|
+
i0.ɵɵelementStart(0, "button", 10);
|
|
14
|
+
i0.ɵɵlistener("click", function SearchFilterComponent_Conditional_6_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.ClearAll()); });
|
|
15
15
|
i0.ɵɵtext(1);
|
|
16
16
|
i0.ɵɵelementEnd();
|
|
17
17
|
} if (rf & 2) {
|
|
@@ -19,85 +19,102 @@ function SearchFilterComponent_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
|
19
19
|
i0.ɵɵadvance();
|
|
20
20
|
i0.ɵɵtextInterpolate1(" Clear (", ctx_r1.GetActiveFilterCount(), ") ");
|
|
21
21
|
} }
|
|
22
|
-
function
|
|
23
|
-
i0.ɵɵelement(0, "i",
|
|
22
|
+
function SearchFilterComponent_For_10_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
23
|
+
i0.ɵɵelement(0, "i", 17);
|
|
24
24
|
} if (rf & 2) {
|
|
25
25
|
const filter_r4 = i0.ɵɵnextContext().$implicit;
|
|
26
26
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
27
27
|
i0.ɵɵclassProp("fa-chevron-down", ctx_r1.IsCategoryCollapsed(filter_r4.Category))("fa-chevron-up", !ctx_r1.IsCategoryCollapsed(filter_r4.Category));
|
|
28
28
|
} }
|
|
29
|
-
function
|
|
30
|
-
i0.ɵɵ
|
|
29
|
+
function SearchFilterComponent_For_10_Conditional_6_Template(rf, ctx) { if (rf & 1) {
|
|
30
|
+
const _r5 = i0.ɵɵgetCurrentView();
|
|
31
|
+
i0.ɵɵelementStart(0, "button", 18);
|
|
32
|
+
i0.ɵɵlistener("click", function SearchFilterComponent_For_10_Conditional_6_Template_button_click_0_listener($event) { i0.ɵɵrestoreView(_r5); const filter_r4 = i0.ɵɵnextContext().$implicit; const ctx_r1 = i0.ɵɵnextContext(); ctx_r1.SelectAll(filter_r4.Category); return i0.ɵɵresetView($event.stopPropagation()); });
|
|
33
|
+
i0.ɵɵtext(1);
|
|
34
|
+
i0.ɵɵelementEnd();
|
|
35
|
+
} if (rf & 2) {
|
|
36
|
+
const filter_r4 = i0.ɵɵnextContext().$implicit;
|
|
37
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
38
|
+
i0.ɵɵproperty("title", ctx_r1.IsAllSelected(filter_r4.Category) ? "Clear all" : "Select all");
|
|
39
|
+
i0.ɵɵadvance();
|
|
40
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r1.IsAllSelected(filter_r4.Category) ? "Clear" : "All", " ");
|
|
41
|
+
} }
|
|
42
|
+
function SearchFilterComponent_For_10_Conditional_7_For_2_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
43
|
+
i0.ɵɵelement(0, "i", 22);
|
|
31
44
|
} }
|
|
32
|
-
function
|
|
45
|
+
function SearchFilterComponent_For_10_Conditional_7_For_2_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
33
46
|
i0.ɵɵelement(0, "i");
|
|
34
47
|
} if (rf & 2) {
|
|
35
|
-
const
|
|
36
|
-
i0.ɵɵclassMap(
|
|
48
|
+
const option_r7 = i0.ɵɵnextContext().$implicit;
|
|
49
|
+
i0.ɵɵclassMap(option_r7.Icon + " filter-option-icon");
|
|
37
50
|
} }
|
|
38
|
-
function
|
|
39
|
-
const
|
|
40
|
-
i0.ɵɵelementStart(0, "label",
|
|
41
|
-
i0.ɵɵlistener("click", function
|
|
42
|
-
i0.ɵɵelementStart(1, "span",
|
|
43
|
-
i0.ɵɵconditionalCreate(2,
|
|
51
|
+
function SearchFilterComponent_For_10_Conditional_7_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
52
|
+
const _r6 = i0.ɵɵgetCurrentView();
|
|
53
|
+
i0.ɵɵelementStart(0, "label", 20);
|
|
54
|
+
i0.ɵɵlistener("click", function SearchFilterComponent_For_10_Conditional_7_For_2_Template_label_click_0_listener($event) { const option_r7 = i0.ɵɵrestoreView(_r6).$implicit; const filter_r4 = i0.ɵɵnextContext(2).$implicit; const ctx_r1 = i0.ɵɵnextContext(); ctx_r1.ToggleOption(filter_r4.Category, option_r7.Value); return i0.ɵɵresetView($event.preventDefault()); });
|
|
55
|
+
i0.ɵɵelementStart(1, "span", 21);
|
|
56
|
+
i0.ɵɵconditionalCreate(2, SearchFilterComponent_For_10_Conditional_7_For_2_Conditional_2_Template, 1, 0, "i", 22);
|
|
44
57
|
i0.ɵɵelementEnd();
|
|
45
|
-
i0.ɵɵconditionalCreate(3,
|
|
46
|
-
i0.ɵɵelementStart(4, "span",
|
|
58
|
+
i0.ɵɵconditionalCreate(3, SearchFilterComponent_For_10_Conditional_7_For_2_Conditional_3_Template, 1, 2, "i", 23);
|
|
59
|
+
i0.ɵɵelementStart(4, "span", 24);
|
|
47
60
|
i0.ɵɵtext(5);
|
|
48
61
|
i0.ɵɵelementEnd();
|
|
49
|
-
i0.ɵɵelementStart(6, "span",
|
|
62
|
+
i0.ɵɵelementStart(6, "span", 25);
|
|
50
63
|
i0.ɵɵtext(7);
|
|
51
64
|
i0.ɵɵelementEnd()();
|
|
52
65
|
} if (rf & 2) {
|
|
53
|
-
const
|
|
66
|
+
const option_r7 = ctx.$implicit;
|
|
54
67
|
const filter_r4 = i0.ɵɵnextContext(2).$implicit;
|
|
55
68
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
56
69
|
i0.ɵɵadvance();
|
|
57
|
-
i0.ɵɵclassProp("filter-checkbox-checked", ctx_r1.IsOptionSelected(filter_r4.Category,
|
|
70
|
+
i0.ɵɵclassProp("filter-checkbox-checked", ctx_r1.IsOptionSelected(filter_r4.Category, option_r7.Value));
|
|
58
71
|
i0.ɵɵadvance();
|
|
59
|
-
i0.ɵɵconditional(ctx_r1.IsOptionSelected(filter_r4.Category,
|
|
72
|
+
i0.ɵɵconditional(ctx_r1.IsOptionSelected(filter_r4.Category, option_r7.Value) ? 2 : -1);
|
|
60
73
|
i0.ɵɵadvance();
|
|
61
|
-
i0.ɵɵconditional(
|
|
74
|
+
i0.ɵɵconditional(option_r7.Icon ? 3 : -1);
|
|
62
75
|
i0.ɵɵadvance(2);
|
|
63
|
-
i0.ɵɵtextInterpolate(
|
|
76
|
+
i0.ɵɵtextInterpolate(option_r7.Label);
|
|
64
77
|
i0.ɵɵadvance(2);
|
|
65
|
-
i0.ɵɵtextInterpolate(
|
|
78
|
+
i0.ɵɵtextInterpolate(option_r7.Count);
|
|
66
79
|
} }
|
|
67
|
-
function
|
|
68
|
-
i0.ɵɵelementStart(0, "div",
|
|
69
|
-
i0.ɵɵrepeaterCreate(1,
|
|
80
|
+
function SearchFilterComponent_For_10_Conditional_7_Template(rf, ctx) { if (rf & 1) {
|
|
81
|
+
i0.ɵɵelementStart(0, "div", 16);
|
|
82
|
+
i0.ɵɵrepeaterCreate(1, SearchFilterComponent_For_10_Conditional_7_For_2_Template, 8, 6, "label", 19, _forTrack1);
|
|
70
83
|
i0.ɵɵelementEnd();
|
|
71
84
|
} if (rf & 2) {
|
|
72
85
|
const filter_r4 = i0.ɵɵnextContext().$implicit;
|
|
73
86
|
i0.ɵɵadvance();
|
|
74
87
|
i0.ɵɵrepeater(filter_r4.Options);
|
|
75
88
|
} }
|
|
76
|
-
function
|
|
89
|
+
function SearchFilterComponent_For_10_Template(rf, ctx) { if (rf & 1) {
|
|
77
90
|
const _r3 = i0.ɵɵgetCurrentView();
|
|
78
|
-
i0.ɵɵelementStart(0, "div",
|
|
79
|
-
i0.ɵɵlistener("click", function
|
|
80
|
-
i0.ɵɵelementStart(
|
|
81
|
-
i0.ɵɵtext(
|
|
91
|
+
i0.ɵɵelementStart(0, "div", 8)(1, "div", 11)(2, "div", 12);
|
|
92
|
+
i0.ɵɵlistener("click", function SearchFilterComponent_For_10_Template_div_click_2_listener() { const filter_r4 = i0.ɵɵrestoreView(_r3).$implicit; const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.ToggleCategory(filter_r4.Category)); });
|
|
93
|
+
i0.ɵɵelementStart(3, "span", 13);
|
|
94
|
+
i0.ɵɵtext(4);
|
|
82
95
|
i0.ɵɵelementEnd();
|
|
83
|
-
i0.ɵɵconditionalCreate(
|
|
96
|
+
i0.ɵɵconditionalCreate(5, SearchFilterComponent_For_10_Conditional_5_Template, 1, 4, "i", 14);
|
|
84
97
|
i0.ɵɵelementEnd();
|
|
85
|
-
i0.ɵɵconditionalCreate(
|
|
98
|
+
i0.ɵɵconditionalCreate(6, SearchFilterComponent_For_10_Conditional_6_Template, 2, 2, "button", 15);
|
|
99
|
+
i0.ɵɵelementEnd();
|
|
100
|
+
i0.ɵɵconditionalCreate(7, SearchFilterComponent_For_10_Conditional_7_Template, 3, 0, "div", 16);
|
|
86
101
|
i0.ɵɵelementEnd();
|
|
87
102
|
} if (rf & 2) {
|
|
88
103
|
const filter_r4 = ctx.$implicit;
|
|
89
104
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
90
|
-
i0.ɵɵadvance();
|
|
105
|
+
i0.ɵɵadvance(2);
|
|
91
106
|
i0.ɵɵclassProp("filter-category-collapsed", ctx_r1.IsCategoryCollapsed(filter_r4.Category));
|
|
92
107
|
i0.ɵɵadvance(2);
|
|
93
108
|
i0.ɵɵtextInterpolate(filter_r4.Category);
|
|
94
109
|
i0.ɵɵadvance();
|
|
95
|
-
i0.ɵɵconditional(ctx_r1.Collapsible ?
|
|
110
|
+
i0.ɵɵconditional(ctx_r1.Collapsible ? 5 : -1);
|
|
111
|
+
i0.ɵɵadvance();
|
|
112
|
+
i0.ɵɵconditional(!ctx_r1.IsCategoryCollapsed(filter_r4.Category) && filter_r4.Options.length > 1 ? 6 : -1);
|
|
96
113
|
i0.ɵɵadvance();
|
|
97
|
-
i0.ɵɵconditional(!ctx_r1.IsCategoryCollapsed(filter_r4.Category) ?
|
|
114
|
+
i0.ɵɵconditional(!ctx_r1.IsCategoryCollapsed(filter_r4.Category) ? 7 : -1);
|
|
98
115
|
} }
|
|
99
|
-
function
|
|
100
|
-
i0.ɵɵelementStart(0, "div",
|
|
116
|
+
function SearchFilterComponent_Conditional_11_Template(rf, ctx) { if (rf & 1) {
|
|
117
|
+
i0.ɵɵelementStart(0, "div", 9)(1, "p");
|
|
101
118
|
i0.ɵɵtext(2, "No filters available");
|
|
102
119
|
i0.ɵɵelementEnd()();
|
|
103
120
|
} }
|
|
@@ -111,6 +128,7 @@ export class SearchFilterComponent {
|
|
|
111
128
|
Collapsible = true;
|
|
112
129
|
FilterChanged = new EventEmitter();
|
|
113
130
|
FiltersCleared = new EventEmitter();
|
|
131
|
+
CloseRequested = new EventEmitter();
|
|
114
132
|
/** Collapsed state per category */
|
|
115
133
|
CollapsedCategories = new Set();
|
|
116
134
|
/** Toggle a filter option */
|
|
@@ -162,29 +180,58 @@ export class SearchFilterComponent {
|
|
|
162
180
|
this.FiltersCleared.emit();
|
|
163
181
|
this.cdr.detectChanges();
|
|
164
182
|
}
|
|
183
|
+
/** Select all options in a category, or clear all if already all selected */
|
|
184
|
+
SelectAll(category) {
|
|
185
|
+
const filter = this.Filters.find(f => f.Category === category);
|
|
186
|
+
if (!filter)
|
|
187
|
+
return;
|
|
188
|
+
const current = this.ActiveFilters[category] ?? [];
|
|
189
|
+
if (current.length === filter.Options.length) {
|
|
190
|
+
// All selected → clear
|
|
191
|
+
this.ActiveFilters[category] = [];
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
// Select all
|
|
195
|
+
this.ActiveFilters[category] = filter.Options.map(o => o.Value);
|
|
196
|
+
}
|
|
197
|
+
this.FilterChanged.emit({ Category: category, SelectedValues: this.ActiveFilters[category] });
|
|
198
|
+
this.cdr.detectChanges();
|
|
199
|
+
}
|
|
200
|
+
/** Check if all options in a category are selected */
|
|
201
|
+
IsAllSelected(category) {
|
|
202
|
+
const filter = this.Filters.find(f => f.Category === category);
|
|
203
|
+
if (!filter)
|
|
204
|
+
return false;
|
|
205
|
+
const selection = this.ActiveFilters[category] ?? [];
|
|
206
|
+
return selection.length === filter.Options.length;
|
|
207
|
+
}
|
|
165
208
|
static ɵfac = function SearchFilterComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SearchFilterComponent)(); };
|
|
166
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SearchFilterComponent, selectors: [["mj-search-filter"]], inputs: { Filters: "Filters", ActiveFilters: "ActiveFilters", Collapsible: "Collapsible" }, outputs: { FilterChanged: "FilterChanged", FiltersCleared: "FiltersCleared" }, standalone: false, decls:
|
|
209
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SearchFilterComponent, selectors: [["mj-search-filter"]], inputs: { Filters: "Filters", ActiveFilters: "ActiveFilters", Collapsible: "Collapsible" }, outputs: { FilterChanged: "FilterChanged", FiltersCleared: "FiltersCleared", CloseRequested: "CloseRequested" }, standalone: false, decls: 12, vars: 2, consts: [[1, "filter-panel"], [1, "filter-panel-header"], [1, "filter-panel-title"], [1, "fa-solid", "fa-filter"], [1, "filter-header-actions"], [1, "filter-clear-all"], ["title", "Hide filters", 1, "filter-close-btn", 3, "click"], [1, "fa-solid", "fa-times"], [1, "filter-category"], [1, "filter-empty"], [1, "filter-clear-all", 3, "click"], [1, "filter-category-header-row"], [1, "filter-category-header", 3, "click"], [1, "filter-category-name"], [1, "fa-solid", "filter-category-chevron", 3, "fa-chevron-down", "fa-chevron-up"], [1, "filter-select-all", 3, "title"], [1, "filter-options"], [1, "fa-solid", "filter-category-chevron"], [1, "filter-select-all", 3, "click", "title"], [1, "filter-option"], [1, "filter-option", 3, "click"], [1, "filter-checkbox"], [1, "fa-solid", "fa-check"], [3, "class"], [1, "filter-option-label"], [1, "filter-option-count"]], template: function SearchFilterComponent_Template(rf, ctx) { if (rf & 1) {
|
|
167
210
|
i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "span", 2);
|
|
168
211
|
i0.ɵɵelement(3, "i", 3);
|
|
169
212
|
i0.ɵɵtext(4, " Filters ");
|
|
170
213
|
i0.ɵɵelementEnd();
|
|
171
|
-
i0.ɵɵ
|
|
172
|
-
i0.ɵɵ
|
|
173
|
-
i0.ɵɵ
|
|
174
|
-
i0.ɵɵ
|
|
214
|
+
i0.ɵɵelementStart(5, "div", 4);
|
|
215
|
+
i0.ɵɵconditionalCreate(6, SearchFilterComponent_Conditional_6_Template, 2, 1, "button", 5);
|
|
216
|
+
i0.ɵɵelementStart(7, "button", 6);
|
|
217
|
+
i0.ɵɵlistener("click", function SearchFilterComponent_Template_button_click_7_listener() { return ctx.CloseRequested.emit(); });
|
|
218
|
+
i0.ɵɵelement(8, "i", 7);
|
|
219
|
+
i0.ɵɵelementEnd()()();
|
|
220
|
+
i0.ɵɵrepeaterCreate(9, SearchFilterComponent_For_10_Template, 8, 6, "div", 8, _forTrack0);
|
|
221
|
+
i0.ɵɵconditionalCreate(11, SearchFilterComponent_Conditional_11_Template, 3, 0, "div", 9);
|
|
175
222
|
i0.ɵɵelementEnd();
|
|
176
223
|
} if (rf & 2) {
|
|
177
|
-
i0.ɵɵadvance(
|
|
178
|
-
i0.ɵɵconditional(ctx.HasActiveFilters() ?
|
|
179
|
-
i0.ɵɵadvance();
|
|
224
|
+
i0.ɵɵadvance(6);
|
|
225
|
+
i0.ɵɵconditional(ctx.HasActiveFilters() ? 6 : -1);
|
|
226
|
+
i0.ɵɵadvance(3);
|
|
180
227
|
i0.ɵɵrepeater(ctx.Filters);
|
|
181
228
|
i0.ɵɵadvance(2);
|
|
182
|
-
i0.ɵɵconditional(ctx.Filters.length === 0 ?
|
|
183
|
-
} }, styles: ["\n\n\n.filter-panel[_ngcontent-%COMP%] {\n border: 1px solid var(--mj-border-default);\n border-radius: 8px;\n background: var(--mj-bg-surface);\n overflow: hidden;\n}\n\n.filter-panel-header[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0.75rem 1rem;\n border-bottom: 1px solid var(--mj-border-subtle);\n}\n\n.filter-panel-title[_ngcontent-%COMP%] {\n font-weight: 600;\n font-size: 0.85rem;\n color: var(--mj-text-primary);\n display: flex;\n align-items: center;\n gap: 0.5rem;\n}\n\n.filter-clear-all[_ngcontent-%COMP%] {\n border: none;\n background: none;\n color: var(--mj-brand-primary);\n font-size: 0.78rem;\n cursor: pointer;\n padding: 0.15rem 0.4rem;\n border-radius: 4px;\n}\n\n.filter-clear-all[_ngcontent-%COMP%]:hover {\n background: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface));\n}\n\n\n\n.filter-category[_ngcontent-%COMP%] {\n border-bottom: 1px solid var(--mj-border-subtle);\n}\n\n.filter-category[_ngcontent-%COMP%]:last-child {\n border-bottom: none;\n}\n\n.filter-category-header[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0.6rem 1rem;\n cursor: pointer;\n transition: background 0.1s ease;\n}\n\n.filter-category-header[_ngcontent-%COMP%]:hover {\n background: var(--mj-bg-surface-hover);\n}\n\n.filter-category-name[_ngcontent-%COMP%] {\n font-weight: 500;\n font-size: 0.82rem;\n color: var(--mj-text-primary);\n}\n\n.filter-category-chevron[_ngcontent-%COMP%] {\n font-size: 0.65rem;\n color: var(--mj-text-muted);\n}\n\n\n\n.filter-options[_ngcontent-%COMP%] {\n padding: 0.25rem 0;\n}\n\n.filter-option[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n padding: 0.4rem 1rem;\n cursor: pointer;\n transition: background 0.1s ease;\n font-size: 0.82rem;\n}\n\n.filter-option[_ngcontent-%COMP%]:hover {\n background: var(--mj-bg-surface-hover);\n}\n\n.filter-checkbox[_ngcontent-%COMP%] {\n width: 1rem;\n height: 1rem;\n border: 1.5px solid var(--mj-border-strong);\n border-radius: 3px;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n font-size: 0.6rem;\n transition: all 0.15s ease;\n}\n\n.filter-checkbox-checked[_ngcontent-%COMP%] {\n background: var(--mj-brand-primary);\n border-color: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\n}\n\n.filter-option-icon[_ngcontent-%COMP%] {\n color: var(--mj-text-muted);\n font-size: 0.78rem;\n width: 1rem;\n text-align: center;\n}\n\n.filter-option-label[_ngcontent-%COMP%] {\n flex: 1;\n color: var(--mj-text-secondary);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.filter-option-count[_ngcontent-%COMP%] {\n color: var(--mj-text-muted);\n font-size: 0.72rem;\n flex-shrink: 0;\n}\n\n\n\n.filter-empty[_ngcontent-%COMP%] {\n padding: 1.5rem 1rem;\n text-align: center;\n color: var(--mj-text-muted);\n font-size: 0.82rem;\n}"] });
|
|
229
|
+
i0.ɵɵconditional(ctx.Filters.length === 0 ? 11 : -1);
|
|
230
|
+
} }, styles: ["\n\n\n.filter-panel[_ngcontent-%COMP%] {\n border: 1px solid var(--mj-border-default);\n border-radius: 8px;\n background: var(--mj-bg-surface);\n overflow: hidden;\n}\n\n.filter-panel-header[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0.75rem 1rem;\n border-bottom: 1px solid var(--mj-border-subtle);\n}\n\n.filter-panel-title[_ngcontent-%COMP%] {\n font-weight: 600;\n font-size: 0.85rem;\n color: var(--mj-text-primary);\n display: flex;\n align-items: center;\n gap: 0.5rem;\n}\n\n.filter-clear-all[_ngcontent-%COMP%] {\n border: none;\n background: none;\n color: var(--mj-brand-primary);\n font-size: 0.78rem;\n cursor: pointer;\n padding: 0.15rem 0.4rem;\n border-radius: 4px;\n}\n\n.filter-clear-all[_ngcontent-%COMP%]:hover {\n background: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface));\n}\n\n.filter-header-actions[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 6px;\n}\n\n.filter-close-btn[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n border: none;\n border-radius: 4px;\n background: none;\n color: var(--mj-text-muted);\n font-size: 0.75rem;\n cursor: pointer;\n transition: all 0.15s;\n}\n\n.filter-close-btn[_ngcontent-%COMP%]:hover {\n background: var(--mj-bg-surface-hover);\n color: var(--mj-text-primary);\n}\n\n\n\n.filter-category[_ngcontent-%COMP%] {\n border-bottom: 1px solid var(--mj-border-subtle);\n}\n\n.filter-category[_ngcontent-%COMP%]:last-child {\n border-bottom: none;\n}\n\n.filter-category-header-row[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n}\n\n.filter-category-header[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0.6rem 1rem;\n cursor: pointer;\n transition: background 0.1s ease;\n flex: 1;\n}\n\n.filter-category-header[_ngcontent-%COMP%]:hover {\n background: var(--mj-bg-surface-hover);\n}\n\n.filter-select-all[_ngcontent-%COMP%] {\n padding: 2px 8px;\n border: 1px solid var(--mj-border-default);\n border-radius: 4px;\n background: none;\n color: var(--mj-text-muted);\n font-size: 0.65rem;\n font-weight: 500;\n cursor: pointer;\n margin-right: 8px;\n transition: color 0.15s ease, border-color 0.15s ease;\n}\n\n.filter-select-all[_ngcontent-%COMP%]:hover {\n color: var(--mj-brand-primary);\n border-color: var(--mj-brand-primary);\n}\n\n.filter-category-name[_ngcontent-%COMP%] {\n font-weight: 500;\n font-size: 0.82rem;\n color: var(--mj-text-primary);\n}\n\n.filter-category-chevron[_ngcontent-%COMP%] {\n font-size: 0.65rem;\n color: var(--mj-text-muted);\n}\n\n\n\n.filter-options[_ngcontent-%COMP%] {\n padding: 0.25rem 0;\n}\n\n.filter-option[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n padding: 0.4rem 1rem;\n cursor: pointer;\n transition: background 0.1s ease;\n font-size: 0.82rem;\n}\n\n.filter-option[_ngcontent-%COMP%]:hover {\n background: var(--mj-bg-surface-hover);\n}\n\n.filter-checkbox[_ngcontent-%COMP%] {\n width: 1rem;\n height: 1rem;\n border: 1.5px solid var(--mj-border-strong);\n border-radius: 3px;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n font-size: 0.6rem;\n transition: all 0.15s ease;\n}\n\n.filter-checkbox-checked[_ngcontent-%COMP%] {\n background: var(--mj-brand-primary);\n border-color: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\n}\n\n.filter-option-icon[_ngcontent-%COMP%] {\n color: var(--mj-text-muted);\n font-size: 0.78rem;\n width: 1rem;\n text-align: center;\n}\n\n.filter-option-label[_ngcontent-%COMP%] {\n flex: 1;\n color: var(--mj-text-secondary);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.filter-option-count[_ngcontent-%COMP%] {\n color: var(--mj-text-muted);\n font-size: 0.72rem;\n flex-shrink: 0;\n}\n\n\n\n.filter-empty[_ngcontent-%COMP%] {\n padding: 1.5rem 1rem;\n text-align: center;\n color: var(--mj-text-muted);\n font-size: 0.82rem;\n}"] });
|
|
184
231
|
}
|
|
185
232
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SearchFilterComponent, [{
|
|
186
233
|
type: Component,
|
|
187
|
-
args: [{ standalone: false, selector: 'mj-search-filter', template: "<div class=\"filter-panel\">\n <div class=\"filter-panel-header\">\n <span class=\"filter-panel-title\">\n <i class=\"fa-solid fa-filter\"></i> Filters\n </span>\n @if (HasActiveFilters()) {\n
|
|
234
|
+
args: [{ standalone: false, selector: 'mj-search-filter', template: "<div class=\"filter-panel\">\n <div class=\"filter-panel-header\">\n <span class=\"filter-panel-title\">\n <i class=\"fa-solid fa-filter\"></i> Filters\n </span>\n <div class=\"filter-header-actions\">\n @if (HasActiveFilters()) {\n <button class=\"filter-clear-all\" (click)=\"ClearAll()\">\n Clear ({{ GetActiveFilterCount() }})\n </button>\n }\n <button class=\"filter-close-btn\" (click)=\"CloseRequested.emit()\" title=\"Hide filters\">\n <i class=\"fa-solid fa-times\"></i>\n </button>\n </div>\n </div>\n\n @for (filter of Filters; track filter.Category) {\n <div class=\"filter-category\">\n <div class=\"filter-category-header-row\">\n <div\n class=\"filter-category-header\"\n (click)=\"ToggleCategory(filter.Category)\"\n [class.filter-category-collapsed]=\"IsCategoryCollapsed(filter.Category)\"\n >\n <span class=\"filter-category-name\">{{ filter.Category }}</span>\n @if (Collapsible) {\n <i class=\"fa-solid filter-category-chevron\"\n [class.fa-chevron-down]=\"IsCategoryCollapsed(filter.Category)\"\n [class.fa-chevron-up]=\"!IsCategoryCollapsed(filter.Category)\"></i>\n }\n </div>\n @if (!IsCategoryCollapsed(filter.Category) && filter.Options.length > 1) {\n <button class=\"filter-select-all\"\n (click)=\"SelectAll(filter.Category); $event.stopPropagation()\"\n [title]=\"IsAllSelected(filter.Category) ? 'Clear all' : 'Select all'\">\n {{ IsAllSelected(filter.Category) ? 'Clear' : 'All' }}\n </button>\n }\n </div>\n\n @if (!IsCategoryCollapsed(filter.Category)) {\n <div class=\"filter-options\">\n @for (option of filter.Options; track option.Value) {\n <label class=\"filter-option\" (click)=\"ToggleOption(filter.Category, option.Value); $event.preventDefault()\">\n <span class=\"filter-checkbox\" [class.filter-checkbox-checked]=\"IsOptionSelected(filter.Category, option.Value)\">\n @if (IsOptionSelected(filter.Category, option.Value)) {\n <i class=\"fa-solid fa-check\"></i>\n }\n </span>\n @if (option.Icon) {\n <i [class]=\"option.Icon + ' filter-option-icon'\"></i>\n }\n <span class=\"filter-option-label\">{{ option.Label }}</span>\n <span class=\"filter-option-count\">{{ option.Count }}</span>\n </label>\n }\n </div>\n }\n </div>\n }\n\n @if (Filters.length === 0) {\n <div class=\"filter-empty\">\n <p>No filters available</p>\n </div>\n }\n</div>\n", styles: ["/* Search Filter Panel */\n\n.filter-panel {\n border: 1px solid var(--mj-border-default);\n border-radius: 8px;\n background: var(--mj-bg-surface);\n overflow: hidden;\n}\n\n.filter-panel-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0.75rem 1rem;\n border-bottom: 1px solid var(--mj-border-subtle);\n}\n\n.filter-panel-title {\n font-weight: 600;\n font-size: 0.85rem;\n color: var(--mj-text-primary);\n display: flex;\n align-items: center;\n gap: 0.5rem;\n}\n\n.filter-clear-all {\n border: none;\n background: none;\n color: var(--mj-brand-primary);\n font-size: 0.78rem;\n cursor: pointer;\n padding: 0.15rem 0.4rem;\n border-radius: 4px;\n}\n\n.filter-clear-all:hover {\n background: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface));\n}\n\n.filter-header-actions {\n display: flex;\n align-items: center;\n gap: 6px;\n}\n\n.filter-close-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n border: none;\n border-radius: 4px;\n background: none;\n color: var(--mj-text-muted);\n font-size: 0.75rem;\n cursor: pointer;\n transition: all 0.15s;\n}\n\n.filter-close-btn:hover {\n background: var(--mj-bg-surface-hover);\n color: var(--mj-text-primary);\n}\n\n/* Category */\n.filter-category {\n border-bottom: 1px solid var(--mj-border-subtle);\n}\n\n.filter-category:last-child {\n border-bottom: none;\n}\n\n.filter-category-header-row {\n display: flex;\n align-items: center;\n}\n\n.filter-category-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0.6rem 1rem;\n cursor: pointer;\n transition: background 0.1s ease;\n flex: 1;\n}\n\n.filter-category-header:hover {\n background: var(--mj-bg-surface-hover);\n}\n\n.filter-select-all {\n padding: 2px 8px;\n border: 1px solid var(--mj-border-default);\n border-radius: 4px;\n background: none;\n color: var(--mj-text-muted);\n font-size: 0.65rem;\n font-weight: 500;\n cursor: pointer;\n margin-right: 8px;\n transition: color 0.15s ease, border-color 0.15s ease;\n}\n\n.filter-select-all:hover {\n color: var(--mj-brand-primary);\n border-color: var(--mj-brand-primary);\n}\n\n.filter-category-name {\n font-weight: 500;\n font-size: 0.82rem;\n color: var(--mj-text-primary);\n}\n\n.filter-category-chevron {\n font-size: 0.65rem;\n color: var(--mj-text-muted);\n}\n\n/* Options */\n.filter-options {\n padding: 0.25rem 0;\n}\n\n.filter-option {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n padding: 0.4rem 1rem;\n cursor: pointer;\n transition: background 0.1s ease;\n font-size: 0.82rem;\n}\n\n.filter-option:hover {\n background: var(--mj-bg-surface-hover);\n}\n\n.filter-checkbox {\n width: 1rem;\n height: 1rem;\n border: 1.5px solid var(--mj-border-strong);\n border-radius: 3px;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n font-size: 0.6rem;\n transition: all 0.15s ease;\n}\n\n.filter-checkbox-checked {\n background: var(--mj-brand-primary);\n border-color: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\n}\n\n.filter-option-icon {\n color: var(--mj-text-muted);\n font-size: 0.78rem;\n width: 1rem;\n text-align: center;\n}\n\n.filter-option-label {\n flex: 1;\n color: var(--mj-text-secondary);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.filter-option-count {\n color: var(--mj-text-muted);\n font-size: 0.72rem;\n flex-shrink: 0;\n}\n\n/* Empty state */\n.filter-empty {\n padding: 1.5rem 1rem;\n text-align: center;\n color: var(--mj-text-muted);\n font-size: 0.82rem;\n}\n"] }]
|
|
188
235
|
}], null, { Filters: [{
|
|
189
236
|
type: Input
|
|
190
237
|
}], ActiveFilters: [{
|
|
@@ -195,6 +242,8 @@ export class SearchFilterComponent {
|
|
|
195
242
|
type: Output
|
|
196
243
|
}], FiltersCleared: [{
|
|
197
244
|
type: Output
|
|
245
|
+
}], CloseRequested: [{
|
|
246
|
+
type: Output
|
|
198
247
|
}] }); })();
|
|
199
248
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SearchFilterComponent, { className: "SearchFilterComponent", filePath: "src/lib/search-filter.component.ts", lineNumber: 24 }); })();
|
|
200
249
|
//# sourceMappingURL=search-filter.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-filter.component.js","sourceRoot":"","sources":["../../src/lib/search-filter.component.ts","../../src/lib/search-filter.component.html"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACH,SAAS,EACT,YAAY,EACZ,KAAK,EACL,MAAM,EACN,iBAAiB,EACjB,MAAM,EACT,MAAM,eAAe,CAAC;;;;;;ICRX,iCAA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3B,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAEL,MAAM;;kBACN,MAAM;;kFAbE,qBAAqB","sourcesContent":["/**\n * @fileoverview Search Filter Component\n *\n * Faceted filter sidebar for narrowing search results.\n * Displays filter categories with checkable options and counts.\n */\n\nimport {\n Component,\n EventEmitter,\n Input,\n Output,\n ChangeDetectorRef,\n inject\n} from '@angular/core';\nimport { SearchFilter, SearchFilterChangeEvent } from './search-types';\n\n@Component({\n standalone: false,\n selector: 'mj-search-filter',\n templateUrl: './search-filter.component.html',\n styleUrls: ['./search-filter.component.css']\n})\nexport class SearchFilterComponent {\n private cdr = inject(ChangeDetectorRef);\n\n /** Available filters to display */\n @Input() Filters: SearchFilter[] = [];\n\n /** Currently active filter selections */\n @Input() ActiveFilters: Record<string, string[]> = {};\n\n /** Whether the filter panel is collapsible */\n @Input() Collapsible = true;\n\n @Output() FilterChanged = new EventEmitter<SearchFilterChangeEvent>();\n @Output() FiltersCleared = new EventEmitter<void>();\n\n /** Collapsed state per category */\n public CollapsedCategories = new Set<string>();\n\n /** Toggle a filter option */\n public ToggleOption(category: string, value: string): void {\n const current = this.ActiveFilters[category] ? [...this.ActiveFilters[category]] : [];\n const index = current.indexOf(value);\n if (index >= 0) {\n current.splice(index, 1);\n } else {\n current.push(value);\n }\n // Update local state to reflect change\n this.ActiveFilters = { ...this.ActiveFilters, [category]: current };\n this.FilterChanged.emit({ Category: category, SelectedValues: current });\n this.cdr.detectChanges();\n }\n\n /** Toggle category collapse */\n public ToggleCategory(category: string): void {\n if (!this.Collapsible) return;\n if (this.CollapsedCategories.has(category)) {\n this.CollapsedCategories.delete(category);\n } else {\n this.CollapsedCategories.add(category);\n }\n this.cdr.detectChanges();\n }\n\n /** Check if a category is collapsed */\n public IsCategoryCollapsed(category: string): boolean {\n return this.CollapsedCategories.has(category);\n }\n\n /** Check if an option is selected */\n public IsOptionSelected(category: string, value: string): boolean {\n return (this.ActiveFilters[category] ?? []).includes(value);\n }\n\n /** Check if any filters are active */\n public HasActiveFilters(): boolean {\n return Object.values(this.ActiveFilters).some(v => v.length > 0);\n }\n\n /** Get total active filter count */\n public GetActiveFilterCount(): number {\n return Object.values(this.ActiveFilters).reduce((sum, v) => sum + v.length, 0);\n }\n\n /** Clear all filters */\n public ClearAll(): void {\n this.ActiveFilters = {};\n this.FiltersCleared.emit();\n this.cdr.detectChanges();\n }\n}\n","<div class=\"filter-panel\">\n <div class=\"filter-panel-header\">\n <span class=\"filter-panel-title\">\n <i class=\"fa-solid fa-filter\"></i> Filters\n </span>\n @if (HasActiveFilters()) {\n <button class=\"filter-clear-all\" (click)=\"ClearAll()\">\n Clear ({{ GetActiveFilterCount() }})\n </button>\n }\n </div>\n\n @for (filter of Filters; track filter.Category) {\n <div class=\"filter-category\">\n <div\n class=\"filter-category-header\"\n (click)=\"ToggleCategory(filter.Category)\"\n [class.filter-category-collapsed]=\"IsCategoryCollapsed(filter.Category)\"\n >\n <span class=\"filter-category-name\">{{ filter.Category }}</span>\n @if (Collapsible) {\n <i class=\"fa-solid filter-category-chevron\"\n [class.fa-chevron-down]=\"IsCategoryCollapsed(filter.Category)\"\n [class.fa-chevron-up]=\"!IsCategoryCollapsed(filter.Category)\"></i>\n }\n </div>\n\n @if (!IsCategoryCollapsed(filter.Category)) {\n <div class=\"filter-options\">\n @for (option of filter.Options; track option.Value) {\n <label class=\"filter-option\" (click)=\"ToggleOption(filter.Category, option.Value); $event.preventDefault()\">\n <span class=\"filter-checkbox\" [class.filter-checkbox-checked]=\"IsOptionSelected(filter.Category, option.Value)\">\n @if (IsOptionSelected(filter.Category, option.Value)) {\n <i class=\"fa-solid fa-check\"></i>\n }\n </span>\n @if (option.Icon) {\n <i [class]=\"option.Icon + ' filter-option-icon'\"></i>\n }\n <span class=\"filter-option-label\">{{ option.Label }}</span>\n <span class=\"filter-option-count\">{{ option.Count }}</span>\n </label>\n }\n </div>\n }\n </div>\n }\n\n @if (Filters.length === 0) {\n <div class=\"filter-empty\">\n <p>No filters available</p>\n </div>\n }\n</div>\n"]}
|
|
1
|
+
{"version":3,"file":"search-filter.component.js","sourceRoot":"","sources":["../../src/lib/search-filter.component.ts","../../src/lib/search-filter.component.html"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACH,SAAS,EACT,YAAY,EACZ,KAAK,EACL,MAAM,EACN,iBAAiB,EACjB,MAAM,EACT,MAAM,eAAe,CAAC;;;;;;ICPP,kCAAsD;IAArB,yLAAS,iBAAU,KAAC;IACjD,YACJ;IAAA,iBAAS;;;IADL,cACJ;IADI,sEACJ;;;IAkBQ,wBAEqE;;;;IAAlE,AADA,iFAA8D,kEACD;;;;IAIpE,kCAE8E;IADtE,gOAAS,oCAA0B,wBAAE,wBAAwB,KAAC;IAElE,YACJ;IAAA,iBAAS;;;;IAFD,6FAAqE;IACzE,cACJ;IADI,2FACJ;;;IAUgB,wBAAiC;;;IAIrC,oBAAqD;;;IAAlD,qDAA6C;;;;IAPxD,iCAA4G;IAA/E,kQAAS,wDAA2C,wBAAE,uBAAuB,KAAC;IACvG,gCAAgH;IAC5G,iHAAuD;IAG3D,iBAAO;IACP,iHAAmB;IAGnB,gCAAkC;IAAA,YAAkB;IAAA,iBAAO;IAC3D,gCAAkC;IAAA,YAAkB;IACxD,AADwD,iBAAO,EACvD;;;;;IAV0B,cAAiF;IAAjF,uGAAiF;IAC3G,cAEC;IAFD,uFAEC;IAEL,cAEC;IAFD,yCAEC;IACiC,eAAkB;IAAlB,qCAAkB;IAClB,eAAkB;IAAlB,qCAAkB;;;IAZhE,+BAA4B;IACxB,gHAaC;IACL,iBAAM;;;IAdF,cAaC;IAbD,gCAaC;;;;IApCL,AADJ,AADJ,8BAA6B,cACe,cAKnC;IAFG,2MAAS,yCAA+B,KAAC;IAGzC,gCAAmC;IAAA,YAAqB;IAAA,iBAAO;IAC/D,6FAAmB;IAKvB,iBAAM;IACN,kGAA0E;IAO9E,iBAAM;IAEN,+FAA6C;IAkBjD,iBAAM;;;;IApCM,eAAw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1B,MAAM,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QACrD,OAAO,SAAS,CAAC,MAAM,KAAK,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;IACtD,CAAC;+GA/FQ,qBAAqB;6DAArB,qBAAqB;YCrB1B,AADJ,AADJ,8BAA0B,aACW,cACI;YAC7B,uBAAkC;YAAC,yBACvC;YAAA,iBAAO;YACP,8BAAmC;YAC/B,0FAA0B;YAK1B,iCAAsF;YAArD,kGAAS,yBAAqB,IAAC;YAC5D,uBAAiC;YAG7C,AADI,AADI,iBAAS,EACP,EACJ;YAEN,yFA2CC;YAED,yFAA4B;YAKhC,iBAAM;;YA7DM,eAIC;YAJD,iDAIC;YAOT,eA2CC;YA3CD,0BA2CC;YAED,eAIC;YAJD,oDAIC;;;iFD3CQ,qBAAqB;cANjC,SAAS;6BACM,KAAK,YACP,kBAAkB;;kBAQ3B,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAEL,MAAM;;kBACN,MAAM;;kBACN,MAAM;;kFAdE,qBAAqB","sourcesContent":["/**\n * @fileoverview Search Filter Component\n *\n * Faceted filter sidebar for narrowing search results.\n * Displays filter categories with checkable options and counts.\n */\n\nimport {\n Component,\n EventEmitter,\n Input,\n Output,\n ChangeDetectorRef,\n inject\n} from '@angular/core';\nimport { SearchFilter, SearchFilterChangeEvent } from './search-types';\n\n@Component({\n standalone: false,\n selector: 'mj-search-filter',\n templateUrl: './search-filter.component.html',\n styleUrls: ['./search-filter.component.css']\n})\nexport class SearchFilterComponent {\n private cdr = inject(ChangeDetectorRef);\n\n /** Available filters to display */\n @Input() Filters: SearchFilter[] = [];\n\n /** Currently active filter selections */\n @Input() ActiveFilters: Record<string, string[]> = {};\n\n /** Whether the filter panel is collapsible */\n @Input() Collapsible = true;\n\n @Output() FilterChanged = new EventEmitter<SearchFilterChangeEvent>();\n @Output() FiltersCleared = new EventEmitter<void>();\n @Output() CloseRequested = new EventEmitter<void>();\n\n /** Collapsed state per category */\n public CollapsedCategories = new Set<string>();\n\n /** Toggle a filter option */\n public ToggleOption(category: string, value: string): void {\n const current = this.ActiveFilters[category] ? [...this.ActiveFilters[category]] : [];\n const index = current.indexOf(value);\n if (index >= 0) {\n current.splice(index, 1);\n } else {\n current.push(value);\n }\n // Update local state to reflect change\n this.ActiveFilters = { ...this.ActiveFilters, [category]: current };\n this.FilterChanged.emit({ Category: category, SelectedValues: current });\n this.cdr.detectChanges();\n }\n\n /** Toggle category collapse */\n public ToggleCategory(category: string): void {\n if (!this.Collapsible) return;\n if (this.CollapsedCategories.has(category)) {\n this.CollapsedCategories.delete(category);\n } else {\n this.CollapsedCategories.add(category);\n }\n this.cdr.detectChanges();\n }\n\n /** Check if a category is collapsed */\n public IsCategoryCollapsed(category: string): boolean {\n return this.CollapsedCategories.has(category);\n }\n\n /** Check if an option is selected */\n public IsOptionSelected(category: string, value: string): boolean {\n return (this.ActiveFilters[category] ?? []).includes(value);\n }\n\n /** Check if any filters are active */\n public HasActiveFilters(): boolean {\n return Object.values(this.ActiveFilters).some(v => v.length > 0);\n }\n\n /** Get total active filter count */\n public GetActiveFilterCount(): number {\n return Object.values(this.ActiveFilters).reduce((sum, v) => sum + v.length, 0);\n }\n\n /** Clear all filters */\n public ClearAll(): void {\n this.ActiveFilters = {};\n this.FiltersCleared.emit();\n this.cdr.detectChanges();\n }\n\n /** Select all options in a category, or clear all if already all selected */\n public SelectAll(category: string): void {\n const filter = this.Filters.find(f => f.Category === category);\n if (!filter) return;\n\n const current = this.ActiveFilters[category] ?? [];\n if (current.length === filter.Options.length) {\n // All selected → clear\n this.ActiveFilters[category] = [];\n } else {\n // Select all\n this.ActiveFilters[category] = filter.Options.map(o => o.Value);\n }\n this.FilterChanged.emit({ Category: category, SelectedValues: this.ActiveFilters[category] });\n this.cdr.detectChanges();\n }\n\n /** Check if all options in a category are selected */\n public IsAllSelected(category: string): boolean {\n const filter = this.Filters.find(f => f.Category === category);\n if (!filter) return false;\n const selection = this.ActiveFilters[category] ?? [];\n return selection.length === filter.Options.length;\n }\n}\n","<div class=\"filter-panel\">\n <div class=\"filter-panel-header\">\n <span class=\"filter-panel-title\">\n <i class=\"fa-solid fa-filter\"></i> Filters\n </span>\n <div class=\"filter-header-actions\">\n @if (HasActiveFilters()) {\n <button class=\"filter-clear-all\" (click)=\"ClearAll()\">\n Clear ({{ GetActiveFilterCount() }})\n </button>\n }\n <button class=\"filter-close-btn\" (click)=\"CloseRequested.emit()\" title=\"Hide filters\">\n <i class=\"fa-solid fa-times\"></i>\n </button>\n </div>\n </div>\n\n @for (filter of Filters; track filter.Category) {\n <div class=\"filter-category\">\n <div class=\"filter-category-header-row\">\n <div\n class=\"filter-category-header\"\n (click)=\"ToggleCategory(filter.Category)\"\n [class.filter-category-collapsed]=\"IsCategoryCollapsed(filter.Category)\"\n >\n <span class=\"filter-category-name\">{{ filter.Category }}</span>\n @if (Collapsible) {\n <i class=\"fa-solid filter-category-chevron\"\n [class.fa-chevron-down]=\"IsCategoryCollapsed(filter.Category)\"\n [class.fa-chevron-up]=\"!IsCategoryCollapsed(filter.Category)\"></i>\n }\n </div>\n @if (!IsCategoryCollapsed(filter.Category) && filter.Options.length > 1) {\n <button class=\"filter-select-all\"\n (click)=\"SelectAll(filter.Category); $event.stopPropagation()\"\n [title]=\"IsAllSelected(filter.Category) ? 'Clear all' : 'Select all'\">\n {{ IsAllSelected(filter.Category) ? 'Clear' : 'All' }}\n </button>\n }\n </div>\n\n @if (!IsCategoryCollapsed(filter.Category)) {\n <div class=\"filter-options\">\n @for (option of filter.Options; track option.Value) {\n <label class=\"filter-option\" (click)=\"ToggleOption(filter.Category, option.Value); $event.preventDefault()\">\n <span class=\"filter-checkbox\" [class.filter-checkbox-checked]=\"IsOptionSelected(filter.Category, option.Value)\">\n @if (IsOptionSelected(filter.Category, option.Value)) {\n <i class=\"fa-solid fa-check\"></i>\n }\n </span>\n @if (option.Icon) {\n <i [class]=\"option.Icon + ' filter-option-icon'\"></i>\n }\n <span class=\"filter-option-label\">{{ option.Label }}</span>\n <span class=\"filter-option-count\">{{ option.Count }}</span>\n </label>\n }\n </div>\n }\n </div>\n }\n\n @if (Filters.length === 0) {\n <div class=\"filter-empty\">\n <p>No filters available</p>\n </div>\n }\n</div>\n"]}
|
|
@@ -10,16 +10,24 @@ import { SearchResultItem, SearchResultGroup, SearchResultSelectedEvent } from '
|
|
|
10
10
|
import * as i0 from "@angular/core";
|
|
11
11
|
export declare class SearchResultsComponent {
|
|
12
12
|
private cdr;
|
|
13
|
-
/** Grouped search results to display */
|
|
13
|
+
/** Grouped search results to display (used when DisplayMode is 'grouped') */
|
|
14
14
|
ResultGroups: SearchResultGroup[];
|
|
15
|
+
/** Flat list of all results sorted by score (used when DisplayMode is 'flat') */
|
|
16
|
+
FlatResults: SearchResultItem[];
|
|
17
|
+
/** Display mode: 'flat' for blended list sorted by score, 'grouped' for source-type groups */
|
|
18
|
+
DisplayMode: 'flat' | 'grouped';
|
|
15
19
|
/** Whether results are currently loading */
|
|
16
20
|
IsLoading: boolean;
|
|
17
21
|
/** Total result count */
|
|
18
22
|
TotalCount: number;
|
|
19
23
|
/** Elapsed search time in ms */
|
|
20
24
|
ElapsedMs: number;
|
|
21
|
-
/** Maximum results per group before "Show more" */
|
|
25
|
+
/** Maximum results per group before "Show more" (grouped mode only) */
|
|
22
26
|
MaxPerGroup: number;
|
|
27
|
+
/** Results per page in flat mode */
|
|
28
|
+
PageSize: number;
|
|
29
|
+
/** Whether to show the results summary line (count + time). Set false when parent provides its own header. */
|
|
30
|
+
ShowSummary: boolean;
|
|
23
31
|
/** Whether to show score badges */
|
|
24
32
|
ShowScores: boolean;
|
|
25
33
|
/** Whether to show tags */
|
|
@@ -32,10 +40,22 @@ export declare class SearchResultsComponent {
|
|
|
32
40
|
EntityName: string;
|
|
33
41
|
RecordID: string;
|
|
34
42
|
}>;
|
|
43
|
+
/** Emitted when user clicks "See Similar Items" — parent runs a "more like this" search */
|
|
44
|
+
MoreLikeThisRequested: EventEmitter<SearchResultItem>;
|
|
45
|
+
/** Current page (1-based) for flat mode pagination */
|
|
46
|
+
CurrentPage: number;
|
|
35
47
|
/** Tracks which groups are expanded */
|
|
36
48
|
ExpandedGroups: Set<string>;
|
|
37
49
|
/** Set of expanded result card IDs — multiple can be open simultaneously */
|
|
38
50
|
ExpandedResultIDs: Set<string>;
|
|
51
|
+
/** Get results for the current page in flat mode */
|
|
52
|
+
get PagedResults(): SearchResultItem[];
|
|
53
|
+
/** Total number of pages */
|
|
54
|
+
get TotalPages(): number;
|
|
55
|
+
/** Page numbers to display in the pager */
|
|
56
|
+
get PageNumbers(): number[];
|
|
57
|
+
/** Navigate to a specific page */
|
|
58
|
+
GoToPage(page: number): void;
|
|
39
59
|
/** Toggle group expansion */
|
|
40
60
|
ToggleGroup(sourceType: string): void;
|
|
41
61
|
/** Whether a group is expanded */
|
|
@@ -54,11 +74,39 @@ export declare class SearchResultsComponent {
|
|
|
54
74
|
IsExpanded(resultID: string): boolean;
|
|
55
75
|
/** Handle "Open Record" button click */
|
|
56
76
|
OnOpenRecord(result: SearchResultItem, event: MouseEvent): void;
|
|
77
|
+
/** Handle "See Similar Items" button click — emits the result for a "more like this" search */
|
|
78
|
+
OnMoreLikeThis(result: SearchResultItem, event: MouseEvent): void;
|
|
57
79
|
/** Format a score as a percentage */
|
|
58
80
|
FormatScore(score: number): string;
|
|
59
81
|
/** Format elapsed time */
|
|
60
82
|
FormatTime(ms: number): string;
|
|
83
|
+
/** Resolved link cache per result ID */
|
|
84
|
+
private resolvedLinksCache;
|
|
85
|
+
/**
|
|
86
|
+
* Resolve URL and Email fields from the result's RawMetadata using entity ExtendedType metadata.
|
|
87
|
+
* Returns clickable link entries with proper type classification.
|
|
88
|
+
*/
|
|
89
|
+
GetResolvedLinks(result: SearchResultItem): {
|
|
90
|
+
Value: string;
|
|
91
|
+
Label: string;
|
|
92
|
+
Type: 'URL' | 'Email';
|
|
93
|
+
}[];
|
|
94
|
+
/** Extract URLs from snippet text */
|
|
95
|
+
ExtractUrls(snippet: string): string[];
|
|
96
|
+
/** Truncate a URL for display */
|
|
97
|
+
TruncateUrl(url: string): string;
|
|
98
|
+
/** Cache of URL/Email field info per entity name */
|
|
99
|
+
private linkFieldsCache;
|
|
100
|
+
/**
|
|
101
|
+
* Get URL and Email fields for an entity using ExtendedType from entity metadata.
|
|
102
|
+
* Returns fields with ExtendedType='URL' or ExtendedType='Email'.
|
|
103
|
+
*/
|
|
104
|
+
GetLinkFields(entityName: string): {
|
|
105
|
+
Name: string;
|
|
106
|
+
DisplayName: string;
|
|
107
|
+
Type: 'URL' | 'Email';
|
|
108
|
+
}[];
|
|
61
109
|
static ɵfac: i0.ɵɵFactoryDeclaration<SearchResultsComponent, never>;
|
|
62
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SearchResultsComponent, "mj-search-results", never, { "ResultGroups": { "alias": "ResultGroups"; "required": false; }; "IsLoading": { "alias": "IsLoading"; "required": false; }; "TotalCount": { "alias": "TotalCount"; "required": false; }; "ElapsedMs": { "alias": "ElapsedMs"; "required": false; }; "MaxPerGroup": { "alias": "MaxPerGroup"; "required": false; }; "ShowScores": { "alias": "ShowScores"; "required": false; }; "ShowTags": { "alias": "ShowTags"; "required": false; }; "ShowSourceIcons": { "alias": "ShowSourceIcons"; "required": false; }; }, { "ResultSelected": "ResultSelected"; "OpenRecordRequested": "OpenRecordRequested"; }, never, never, false, never>;
|
|
110
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SearchResultsComponent, "mj-search-results", never, { "ResultGroups": { "alias": "ResultGroups"; "required": false; }; "FlatResults": { "alias": "FlatResults"; "required": false; }; "DisplayMode": { "alias": "DisplayMode"; "required": false; }; "IsLoading": { "alias": "IsLoading"; "required": false; }; "TotalCount": { "alias": "TotalCount"; "required": false; }; "ElapsedMs": { "alias": "ElapsedMs"; "required": false; }; "MaxPerGroup": { "alias": "MaxPerGroup"; "required": false; }; "PageSize": { "alias": "PageSize"; "required": false; }; "ShowSummary": { "alias": "ShowSummary"; "required": false; }; "ShowScores": { "alias": "ShowScores"; "required": false; }; "ShowTags": { "alias": "ShowTags"; "required": false; }; "ShowSourceIcons": { "alias": "ShowSourceIcons"; "required": false; }; }, { "ResultSelected": "ResultSelected"; "OpenRecordRequested": "OpenRecordRequested"; "MoreLikeThisRequested": "MoreLikeThisRequested"; }, never, never, false, never>;
|
|
63
111
|
}
|
|
64
112
|
//# sourceMappingURL=search-results.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-results.component.d.ts","sourceRoot":"","sources":["../../src/lib/search-results.component.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAEH,YAAY,EAKf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;;
|
|
1
|
+
{"version":3,"file":"search-results.component.d.ts","sourceRoot":"","sources":["../../src/lib/search-results.component.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAEH,YAAY,EAKf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;;AAGhG,qBAMa,sBAAsB;IAC/B,OAAO,CAAC,GAAG,CAA6B;IAExC,6EAA6E;IACpE,YAAY,EAAE,iBAAiB,EAAE,CAAM;IAEhD,iFAAiF;IACxE,WAAW,EAAE,gBAAgB,EAAE,CAAM;IAE9C,8FAA8F;IACrF,WAAW,EAAE,MAAM,GAAG,SAAS,CAAU;IAElD,4CAA4C;IACnC,SAAS,UAAS;IAE3B,yBAAyB;IAChB,UAAU,SAAK;IAExB,gCAAgC;IACvB,SAAS,SAAK;IAEvB,uEAAuE;IAC9D,WAAW,SAAK;IAEzB,oCAAoC;IAC3B,QAAQ,SAAM;IAEvB,8GAA8G;IACrG,WAAW,UAAQ;IAE5B,mC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