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