rez_core 2.1.44 → 2.1.45
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
|
@@ -210,6 +210,22 @@ export class FilterService {
|
|
|
210
210
|
filteredTabs.sort((a, b) => a.tab_value_count - b.tab_value_count);
|
|
211
211
|
} else if (layout.sorting === 'count_dsc') {
|
|
212
212
|
filteredTabs.sort((a, b) => b.tab_value_count - a.tab_value_count);
|
|
213
|
+
} else if (layout.sorting === 'custom') {
|
|
214
|
+
const orderMap = new Map<string, number>(
|
|
215
|
+
showList.map((val, index) => [val.toLowerCase(), index]),
|
|
216
|
+
);
|
|
217
|
+
|
|
218
|
+
filteredTabs.sort((a, b) => {
|
|
219
|
+
const aIndex = orderMap.has(a.tab_value.toLowerCase())
|
|
220
|
+
? orderMap.get(a.tab_value.toLowerCase())!
|
|
221
|
+
: Infinity;
|
|
222
|
+
|
|
223
|
+
const bIndex = orderMap.has(b.tab_value.toLowerCase())
|
|
224
|
+
? orderMap.get(b.tab_value.toLowerCase())!
|
|
225
|
+
: Infinity;
|
|
226
|
+
|
|
227
|
+
return aIndex - bIndex;
|
|
228
|
+
});
|
|
213
229
|
}
|
|
214
230
|
|
|
215
231
|
// Re-insert 'all' at the beginning
|