CR and size filters

pull/12/head
Matt Smith 2024-03-30 08:52:34 -05:00
parent 15d34a0838
commit dc70f366f4
3 changed files with 643 additions and 641 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -202,17 +202,17 @@ export default {
}
// // Filter by level range.
// if (this.crRange.length == 2) {
// result = result.filter(entry =>
// entry.system.attributes.level.value >= this.crRange[0] &&
// entry.system.attributes.level.value <= this.crRange[1]
// );
// }
if (this.crRange.length == 2) {
result = result.filter(entry =>
Number(entry.system.details.cr) >= this.crRange[0] &&
Number(entry.system.details.cr) <= this.crRange[1]
);
}
// Handle multiselect filters, which use arrays as their values.
// if (Array.isArray(this.size) && this.size.length > 0) {
// result = result.filter(entry => this.size.includes(entry.system.details.size.value));
// }
if (Array.isArray(this.size) && this.size.length > 0) {
result = result.filter(entry => this.size.includes(entry.system.traits.size));
}
// Reflow pager.
if (result.length > this.pager.perPage) {