sr-npm 1.7.848 → 1.7.849
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/package.json
CHANGED
|
@@ -271,6 +271,7 @@ async function loadJobsRepeater(_$w) {
|
|
|
271
271
|
console.log("countsByFieldId: ", countsByFieldId);
|
|
272
272
|
console.log("optionsByFieldId: ", optionsByFieldId);
|
|
273
273
|
updateOptionsUI(_$w,field.title, field._id, ''); // no search query
|
|
274
|
+
console.log("after updateoptionUI");
|
|
274
275
|
_$w(`#${FiltersIds[field.title]}CheckBox`).selectedIndices = []; // start empty
|
|
275
276
|
console.log("i am here 1 , field.title: ", field.title);
|
|
276
277
|
_$w(`#${FiltersIds[field.title]}CheckBox`).onChange(async (ev) => {
|
|
@@ -315,7 +316,13 @@ console.log("i am here 5 ");
|
|
|
315
316
|
|
|
316
317
|
function updateOptionsUI(_$w,fieldTitle, fieldId, searchQuery,clearAll=false) {
|
|
317
318
|
let base = optionsByFieldId.get(fieldId) || [];
|
|
319
|
+
console.log("fieldTitle :", fieldTitle);
|
|
320
|
+
console.log("fieldId :", fieldId);
|
|
321
|
+
console.log("base :", base);
|
|
318
322
|
const countsMap = countsByFieldId.get(fieldId) || new Map();
|
|
323
|
+
console.log("countsMap :", countsMap);
|
|
324
|
+
console.log("searchQuery :", searchQuery);
|
|
325
|
+
console.log("clearAll :", clearAll);
|
|
319
326
|
if(dontUpdateThisCheckBox===fieldId && !clearAll)
|
|
320
327
|
{
|
|
321
328
|
dontUpdateThisCheckBox=null;
|
|
@@ -337,16 +344,19 @@ console.log("i am here 5 ");
|
|
|
337
344
|
value: o.value
|
|
338
345
|
};
|
|
339
346
|
});
|
|
347
|
+
console.log("withCounts :", withCounts);
|
|
340
348
|
// Apply search
|
|
341
349
|
const filtered = searchQuery
|
|
342
350
|
? withCounts.filter(o => (o.label || '').toLowerCase().includes(searchQuery))
|
|
343
351
|
: withCounts;
|
|
344
|
-
|
|
352
|
+
console.log("filtered :", filtered);
|
|
345
353
|
// Preserve currently selected values that are still visible
|
|
346
354
|
let prevSelected=[]
|
|
347
355
|
clearAll? prevSelected=[]:prevSelected= _$w(`#${FiltersIds[fieldTitle]}CheckBox`).value;
|
|
348
356
|
const visibleSet = new Set(filtered.map(o => o.value));
|
|
357
|
+
console.log("visibleSet :", visibleSet);
|
|
349
358
|
const preserved = prevSelected.filter(v => visibleSet.has(v));
|
|
359
|
+
console.log("preserved :", preserved);
|
|
350
360
|
_$w(`#${FiltersIds[fieldTitle]}CheckBox`).options = filtered;
|
|
351
361
|
_$w(`#${FiltersIds[fieldTitle]}CheckBox`).value = preserved;
|
|
352
362
|
}
|