Files
klz-cables.com/.pnpm-store/v10/files/7d/566f2391047aca02f0d9ccf05db0099a122b2e853963f6440f2d5e593d876e00d1f91ba9fe4f9f6e8f71d1bc88ea3a7daa9294b6c322c65d4d0c6522d13f58
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

87 lines
2.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, { useState } from 'react';
import { FieldLabel } from '../../fields/FieldLabel/index.js';
import { useForm } from '../../forms/Form/context.js';
import { useTranslation } from '../../providers/Translation/index.js';
import { filterOutUploadFields } from '../../utilities/filterOutUploadFields.js';
import { ReactSelect } from '../ReactSelect/index.js';
import { reduceFieldOptions } from './reduceFieldOptions.js';
import './index.scss';
const baseClass = 'field-select';
export const FieldSelect = t0 => {
const $ = _c(14);
const {
fields,
onChange,
permissions
} = t0;
const {
t
} = useTranslation();
const {
dispatchFields,
getFields
} = useForm();
let t1;
if ($[0] !== fields || $[1] !== getFields || $[2] !== permissions) {
t1 = () => reduceFieldOptions({
fields: filterOutUploadFields(fields),
formState: getFields(),
permissions
});
$[0] = fields;
$[1] = getFields;
$[2] = permissions;
$[3] = t1;
} else {
t1 = $[3];
}
const [options] = useState(t1);
let t2;
if ($[4] !== dispatchFields || $[5] !== getFields || $[6] !== onChange || $[7] !== options || $[8] !== t) {
let t3;
if ($[10] !== dispatchFields || $[11] !== getFields || $[12] !== onChange) {
t3 = selected => onChange({
dispatchFields,
formState: getFields(),
selected
});
$[10] = dispatchFields;
$[11] = getFields;
$[12] = onChange;
$[13] = t3;
} else {
t3 = $[13];
}
t2 = _jsxs("div", {
className: baseClass,
children: [_jsx(FieldLabel, {
label: t("fields:selectFieldsToEdit")
}), _jsx(ReactSelect, {
getOptionValue: _temp,
isMulti: true,
onChange: t3,
options
})]
});
$[4] = dispatchFields;
$[5] = getFields;
$[6] = onChange;
$[7] = options;
$[8] = t;
$[9] = t2;
} else {
t2 = $[9];
}
return t2;
};
function _temp(option) {
if (typeof option.value === "object" && "path" in option.value) {
return String(option.value.path);
}
return String(option.value);
}
//# sourceMappingURL=index.js.map