lucos_search_component 1.0.54 → 1.0.56
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/index.js +2 -7
- package/package.json +1 -1
- package/web-components/lucos-search.js +2 -7
package/dist/index.js
CHANGED
|
@@ -5813,17 +5813,14 @@ class LucosSearchComponent extends HTMLSpanElement {
|
|
|
5813
5813
|
q: query,
|
|
5814
5814
|
});
|
|
5815
5815
|
if (component.getAttribute("data-types")) {
|
|
5816
|
-
queryParams.set("filter_by",`type
|
|
5816
|
+
queryParams.set("filter_by",`type:=[${component.getAttribute("data-types")}]`);
|
|
5817
5817
|
} else if (component.getAttribute("data-exclude_types")) {
|
|
5818
|
-
queryParams.set("filter_by",`type
|
|
5818
|
+
queryParams.set("filter_by",`type:!=[${component.getAttribute("data-exclude_types")}]`);
|
|
5819
5819
|
}
|
|
5820
5820
|
try {
|
|
5821
5821
|
let results = await component.searchRequest(queryParams, abortController.signal);
|
|
5822
5822
|
if (abortController.signal.aborted) return;
|
|
5823
5823
|
this.clearOptions();
|
|
5824
|
-
if (component.isLanguageMode) {
|
|
5825
|
-
results.forEach(r => { if (!r.lang_family) r.lang_family = 'qli'; });
|
|
5826
|
-
}
|
|
5827
5824
|
// Remove common items from results to avoid duplication (they're always shown separately)
|
|
5828
5825
|
if (component._commonOptions) {
|
|
5829
5826
|
const commonIds = new Set(component._commonOptions.map(o => o.id));
|
|
@@ -5886,7 +5883,6 @@ class LucosSearchComponent extends HTMLSpanElement {
|
|
|
5886
5883
|
// In language mode, fetch families and register option groups
|
|
5887
5884
|
if (component.isLanguageMode) {
|
|
5888
5885
|
const families = await component.getLanguageFamilies();
|
|
5889
|
-
this.addOptionGroup('qli', { label: 'Language Isolate' });
|
|
5890
5886
|
families.forEach(family => {
|
|
5891
5887
|
this.addOptionGroup(family.code, { label: family.label });
|
|
5892
5888
|
});
|
|
@@ -5903,7 +5899,6 @@ class LucosSearchComponent extends HTMLSpanElement {
|
|
|
5903
5899
|
});
|
|
5904
5900
|
const results = await component.searchRequest(searchParams);
|
|
5905
5901
|
results.forEach(result => {
|
|
5906
|
-
if (component.isLanguageMode && !result.lang_family) result.lang_family = 'qli';
|
|
5907
5902
|
this.updateOption(result.id, result);
|
|
5908
5903
|
});
|
|
5909
5904
|
}
|
package/package.json
CHANGED
|
@@ -170,17 +170,14 @@ class LucosSearchComponent extends HTMLSpanElement {
|
|
|
170
170
|
q: query,
|
|
171
171
|
});
|
|
172
172
|
if (component.getAttribute("data-types")) {
|
|
173
|
-
queryParams.set("filter_by",`type
|
|
173
|
+
queryParams.set("filter_by",`type:=[${component.getAttribute("data-types")}]`);
|
|
174
174
|
} else if (component.getAttribute("data-exclude_types")) {
|
|
175
|
-
queryParams.set("filter_by",`type
|
|
175
|
+
queryParams.set("filter_by",`type:!=[${component.getAttribute("data-exclude_types")}]`);
|
|
176
176
|
}
|
|
177
177
|
try {
|
|
178
178
|
let results = await component.searchRequest(queryParams, abortController.signal);
|
|
179
179
|
if (abortController.signal.aborted) return;
|
|
180
180
|
this.clearOptions();
|
|
181
|
-
if (component.isLanguageMode) {
|
|
182
|
-
results.forEach(r => { if (!r.lang_family) r.lang_family = 'qli'; });
|
|
183
|
-
}
|
|
184
181
|
// Remove common items from results to avoid duplication (they're always shown separately)
|
|
185
182
|
if (component._commonOptions) {
|
|
186
183
|
const commonIds = new Set(component._commonOptions.map(o => o.id));
|
|
@@ -243,7 +240,6 @@ class LucosSearchComponent extends HTMLSpanElement {
|
|
|
243
240
|
// In language mode, fetch families and register option groups
|
|
244
241
|
if (component.isLanguageMode) {
|
|
245
242
|
const families = await component.getLanguageFamilies();
|
|
246
|
-
this.addOptionGroup('qli', { label: 'Language Isolate' });
|
|
247
243
|
families.forEach(family => {
|
|
248
244
|
this.addOptionGroup(family.code, { label: family.label });
|
|
249
245
|
});
|
|
@@ -260,7 +256,6 @@ class LucosSearchComponent extends HTMLSpanElement {
|
|
|
260
256
|
});
|
|
261
257
|
const results = await component.searchRequest(searchParams);
|
|
262
258
|
results.forEach(result => {
|
|
263
|
-
if (component.isLanguageMode && !result.lang_family) result.lang_family = 'qli';
|
|
264
259
|
this.updateOption(result.id, result);
|
|
265
260
|
});
|
|
266
261
|
}
|