Files
klz-cables.com/.pnpm-store/v10/files/86/511623b253e2c9af5425529ea5fab4943612505914a8215f37777cdc3562b508debaaab8bcb07b965bcdd363bd7d4ed5c5e404ca2727e4b0c146f34ce76dc0
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

44 lines
1.6 KiB
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.preProcessRows = exports.preProcessColumns = void 0;
const table_helpers_1 = require("../utils/table-helpers");
const createComputedColumnsIfNecessary = (table) => {
if (table.computedColumns.length) {
table.computedColumns.forEach((computedColumn) => {
table.addColumn(computedColumn);
table.rows.forEach((row) => {
row.text[computedColumn.name] = computedColumn.function(row.text);
});
});
}
};
const disableColumnsIfNecessary = (table) => {
if (table.enabledColumns.length) {
table.columns = table.columns.filter((col) => table.enabledColumns.includes(col.name));
}
};
const enableColumnsIfNecessary = (table) => {
if (table.disabledColumns.length) {
table.columns = table.columns.filter((col) => !table.disabledColumns.includes(col.name));
}
};
const findColumnWidth = (table) => {
table.columns.forEach((column) => {
column.length = (0, table_helpers_1.findLenOfColumn)(column, table.rows, table.charLength);
});
};
const preProcessColumns = (table) => {
createComputedColumnsIfNecessary(table);
enableColumnsIfNecessary(table);
disableColumnsIfNecessary(table);
findColumnWidth(table);
};
exports.preProcessColumns = preProcessColumns;
const preProcessRows = (table) => {
const newRows = table.rows
.filter((r) => table.filterFunction(r.text))
.sort((r1, r2) => table.sortFunction(r1.text, r2.text));
table.rows = newRows;
};
exports.preProcessRows = preProcessRows;