stone-kit
Version:
uikit for redesign
58 lines (57 loc) • 1.74 kB
JavaScript
import { jsxs as o, jsx as a } from "react/jsx-runtime";
import { c as b } from "../../../index-YnD2EP-S.js";
const d = "_root_19qpl_1", m = "_nameWrapper_19qpl_8", x = "_large_19qpl_18", k = "_clearBtn_19qpl_25", I = "_checkboxWrapper_19qpl_40", g = "_checkboxItem_19qpl_46", q = "_checkboxItemActive_19qpl_64", v = "_checkboxItemDisabled_19qpl_76", B = "_checkBoxLarge_19qpl_81", e = {
root: d,
nameWrapper: m,
large: x,
clearBtn: k,
checkboxWrapper: I,
checkboxItem: g,
checkboxItemActive: q,
checkboxItemDisabled: v,
checkBoxLarge: B
}, l = b.bind(e), N = ({
label: s = "Тип квартиры",
checkboxes: r,
addClassname: n,
isNeedClear: i = !0,
labelSize: p = "medium",
isPromotion: h
}) => {
const _ = () => {
r?.forEach((c) => {
c?.isSelected && c?.setValue();
});
}, t = p === "large" || h;
return /* @__PURE__ */ o("div", { className: l(e.root, n), children: [
/* @__PURE__ */ o("div", { className: l(e.nameWrapper, { [e.large]: t }), children: [
/* @__PURE__ */ a("div", { children: s }),
i && /* @__PURE__ */ a(
"div",
{
className: e.clearBtn,
onClick: _,
children: "Очистить"
}
)
] }),
/* @__PURE__ */ a("div", { className: e.checkboxWrapper, children: r?.map((c) => /* @__PURE__ */ a(
"button",
{
className: l(
e.checkboxItem,
{ [e.checkboxItemActive]: c?.isSelected },
{ [e.checkboxItemDisabled]: c?.disabled },
{ [e.checkBoxLarge]: t }
),
onClick: () => c?.setValue(),
disabled: c?.disabled,
children: c?.label
},
c?.label
)) })
] });
};
export {
N as CheckboxSelect
};