UNPKG

stone-kit

Version:
52 lines (51 loc) 1.68 kB
import { jsxs as l, jsx as r } from "react/jsx-runtime"; import { c as o } from "../../../index-rKuIKazb.js"; const d = "_root_7jm23_1", _ = "_nameWrapper_7jm23_8", p = "_clearBtn_7jm23_18", I = "_checkboxWrapper_7jm23_33", b = "_checkboxItem_7jm23_39", j = "_checkboxItemActive_7jm23_57", v = "_checkboxItemDisabled_7jm23_69", t = { root: d, nameWrapper: _, clearBtn: p, checkboxWrapper: I, checkboxItem: b, checkboxItemActive: j, checkboxItemDisabled: v }, c = o.bind(t), N = ({ label: n = "Тип квартиры", checkboxes: a, addClassname: s }) => { const i = () => { a == null || a.forEach((e) => { e != null && e.isSelected && (e == null || e.setValue()); }); }; return /* @__PURE__ */ l("div", { className: c(t.root, s), children: [ /* @__PURE__ */ l("div", { className: t.nameWrapper, children: [ /* @__PURE__ */ r("div", { children: n }), /* @__PURE__ */ r( "div", { className: t.clearBtn, onClick: i, children: "Очистить" } ) ] }), /* @__PURE__ */ r("div", { className: t.checkboxWrapper, children: a == null ? void 0 : a.map((e) => /* @__PURE__ */ r( "button", { className: c( t.checkboxItem, { [t.checkboxItemActive]: e == null ? void 0 : e.isSelected }, { [t.checkboxItemDisabled]: e == null ? void 0 : e.disabled } ), onClick: () => e == null ? void 0 : e.setValue(), disabled: e == null ? void 0 : e.disabled, children: e == null ? void 0 : e.label }, e == null ? void 0 : e.label )) }) ] }); }; export { N as CheckboxSelect };