Files
klz-cables.com/.pnpm-store/v10/files/bf/26beb97ee1ff828fe805c25b42230ac3ec882c64aa1e2c237f04065a919acb3190449707c5aae493a676f056587308620e6d538d381c87fe8c99b0956fea9c
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

120 lines
3.2 KiB
Plaintext

'use client';
import { c as _c } from "react/compiler-runtime";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import React from 'react';
import { FieldLabel } from '../../fields/FieldLabel/index.js';
import { ChevronIcon } from '../../icons/Chevron/index.js';
import { useListQuery } from '../../providers/ListQuery/index.js';
import { useTranslation } from '../../providers/Translation/index.js';
import './index.scss';
const baseClass = 'sort-column';
export const SortColumn = props => {
const $ = _c(19);
const {
name,
appearance,
disable: t0,
Label,
label
} = props;
const disable = t0 === undefined ? false : t0;
const {
handleSortChange,
query
} = useListQuery();
const {
t
} = useTranslation();
const {
sort
} = query;
const desc = `-${name}`;
const asc = name;
let ascClasses;
if ($[0] !== asc || $[1] !== sort) {
ascClasses = [`${baseClass}__asc`];
if (sort === asc) {
ascClasses.push(`${baseClass}--active`);
}
$[0] = asc;
$[1] = sort;
$[2] = ascClasses;
} else {
ascClasses = $[2];
}
let descClasses;
if ($[3] !== desc || $[4] !== sort) {
descClasses = [`${baseClass}__desc`];
if (sort === desc) {
descClasses.push(`${baseClass}--active`);
}
$[3] = desc;
$[4] = sort;
$[5] = descClasses;
} else {
descClasses = $[5];
}
const t1 = appearance && `${baseClass}--appearance-${appearance}`;
let t2;
if ($[6] !== t1) {
t2 = [baseClass, t1].filter(Boolean);
$[6] = t1;
$[7] = t2;
} else {
t2 = $[7];
}
const t3 = t2.join(" ");
let t4;
if ($[8] !== Label || $[9] !== asc || $[10] !== ascClasses || $[11] !== desc || $[12] !== descClasses || $[13] !== disable || $[14] !== handleSortChange || $[15] !== label || $[16] !== t || $[17] !== t3) {
t4 = _jsxs("div", {
className: t3,
children: [_jsx("span", {
className: `${baseClass}__label`,
children: Label ?? _jsx(FieldLabel, {
hideLocale: true,
label,
unstyled: true
})
}), !disable && _jsxs("div", {
className: `${baseClass}__buttons`,
children: [_jsx("button", {
"aria-label": t("general:sortByLabelDirection", {
direction: t("general:ascending"),
label
}),
className: [...ascClasses, `${baseClass}__button`].filter(Boolean).join(" "),
onClick: () => void handleSortChange(asc),
type: "button",
children: _jsx(ChevronIcon, {
direction: "up"
})
}), _jsx("button", {
"aria-label": t("general:sortByLabelDirection", {
direction: t("general:descending"),
label
}),
className: [...descClasses, `${baseClass}__button`].filter(Boolean).join(" "),
onClick: () => void handleSortChange(desc),
type: "button",
children: _jsx(ChevronIcon, {})
})]
})]
});
$[8] = Label;
$[9] = asc;
$[10] = ascClasses;
$[11] = desc;
$[12] = descClasses;
$[13] = disable;
$[14] = handleSortChange;
$[15] = label;
$[16] = t;
$[17] = t3;
$[18] = t4;
} else {
t4 = $[18];
}
return t4;
};
//# sourceMappingURL=index.js.map