poprawa csv
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
const state = { rows: [], mode: "machine", suggestionIndex: -1 };
|
||||
const labels = {
|
||||
oil_fuel_filters: "Olej / paliwo",
|
||||
air_cooling_filters: "Powietrze / chłodzenie",
|
||||
hydraulic_other_filters: "Hydrauliczny / inne"
|
||||
oil_filters: "Olej",
|
||||
fuel_filters: "Paliwo",
|
||||
air_filters: "Powietrze",
|
||||
hydraulic_filters: "Hydrauliczny",
|
||||
other_filters: "Inne"
|
||||
};
|
||||
const $ = (selector) => document.querySelector(selector);
|
||||
|
||||
@@ -39,10 +41,10 @@ function highlighted(value, query) {
|
||||
return safe.replace(new RegExp(`(${escaped})`, "ig"), "<mark>$1</mark>");
|
||||
}
|
||||
function allFilterText(row) {
|
||||
return ["oil_fuel_filters", "air_cooling_filters", "hydraulic_other_filters"].map((key) => row[key]).join(" ");
|
||||
return Object.keys(labels).map((key) => row[key]).join(" ");
|
||||
}
|
||||
function filterParts(value) {
|
||||
const parts = value.split(/\s*\|\s*|(?=(?:Olej|Paliwo|Powietrze|Hydrauliczny|Odpowietrznik|Płyn|Kabinowy)\b)/i)
|
||||
const parts = value.split(/\s*\|\s*/)
|
||||
.map((part) => part.replace(/\s*\|\s*$/, "").trim()).filter(Boolean);
|
||||
return parts.length ? parts : [value];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user