import { b9 as n, a0 as o, V as t, gv as s, P as d, bh as h, gw as m, bd as C, bb as g, gu as i, cM as u, gx as p } from "./684d2f28.js";
import { C as x } from "./9869e60a.js";
import { ColumnValueTooltip as b } from "./d404aae1.js";
import { getStyle as y } from "./6be5dc74.js";
import "react";
import "react-dom";
import "./b1144c16.js";
import "./926d8ea1.js";
import "./d6402597.js";
import "./1312a48b.js";
import "./00dac55d.js";
import "./622ce240.js";
import "./0c4ef413.js";
const f = n(m)`
  ${(e) => e.$style && y(e.$style)}
`, k = n.div`
  background: transparent !important;
  padding: 0 8px;
`, V = n.div`
  height: 22px;
  svg {
    width: 14px;
    height: 22px;
    g {
      stroke: ${(e) => e.$ifChecked && e.$style.checkedBackground} !important;
    }
  }
`, v = [{
  label: o("table.empty"),
  value: ""
}, {
  label: "-",
  value: "-"
}, {
  label: /* @__PURE__ */ t(s, {
    width: 10,
    height: 10
  }),
  value: "x"
}], w = {
  text: C,
  falseValues: g(v, "")
}, r = (e) => e.text, B = (e) => {
  const l = i(u);
  return /* @__PURE__ */ t(k, {
    onBlur: () => e.onChangeEnd(),
    onKeyDown: (a) => {
      a.key === "Enter" && e.onChangeEnd();
    },
    children: /* @__PURE__ */ t(f, {
      autoFocus: !0,
      $style: l,
      defaultChecked: e.value,
      onChange: (a) => e.onChange(a.target.checked)
    })
  });
}, q = function() {
  return new x(w, (e, l) => {
    const a = e.changeValue ?? r(e);
    return /* @__PURE__ */ t(() => {
      const c = i(u);
      return /* @__PURE__ */ t(V, {
        $style: c,
        $ifChecked: a,
        children: a ? /* @__PURE__ */ t(p, {}) : e.falseValues === "x" ? /* @__PURE__ */ t(s, {}) : e.falseValues
      });
    }, {});
  }, (e) => e.text.value, r).setEditViewFn((e) => /* @__PURE__ */ t(B, {
    value: e.value,
    onChange: e.onChange,
    onChangeEnd: e.onChangeEnd
  })).setPropertyViewFn((e) => /* @__PURE__ */ d(h, {
    children: [e.text.propertyView({
      label: o("table.columnValue"),
      tooltip: b
    }), e.falseValues.propertyView({
      label: o("table.falseValues"),
      radioButton: !0
    })]
  })).build();
}();
export {
  q as BooleanComp
};
