import { X as i, Y as o, F as t, gs as u, a6 as C, G as m, bI as g, a3 as b, L as n, g2 as c, cY as d, bU as l, gt as y, gu as p } from "./603b75d9.js";
import { C as x } from "./4963ac97.js";
import { ColumnValueTooltip as f } from "./62f393ec.js";
import { getStyle as V } from "./0cc240d3.js";
import "react";
import "react-dom";
import "./ffcffc16.js";
import "./26dac75c.js";
import "./00d44232.js";
import "./f9847c56.js";
import "./a4d0e31e.js";
import "./41aba172.js";
const k = i(p)`
  ${(e) => e.$style && V(e.$style)}
`, w = i.div`
  background: transparent !important;
  padding: 0 8px;
`, F = i.span`
  // pointer-events: none;
  height: 22px;
  display: inline-block;
  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(u, {
    width: 10,
    height: 10
  }),
  value: "x"
}], B = {
  text: g,
  falseValues: b(v, ""),
  iconTrue: n,
  iconFalse: n,
  iconNull: n
}, s = (e) => e.text, $ = (e) => {
  const r = c(d);
  return /* @__PURE__ */ t(w, {
    onBlur: () => e.onChangeEnd(),
    onKeyDown: (a) => {
      a.key === "Enter" && e.onChangeEnd();
    },
    children: /* @__PURE__ */ t(k, {
      autoFocus: !0,
      $style: r,
      defaultChecked: e.value,
      onChange: (a) => e.onChange(a.target.checked)
    })
  });
}, M = function() {
  return new x(B, (e, r) => {
    const a = e.changeValue ?? s(e);
    return /* @__PURE__ */ t(() => {
      const h = c(d);
      return /* @__PURE__ */ t(F, {
        $style: h,
        $ifChecked: a,
        children: a === !0 ? l(e.iconTrue) ? e.iconTrue : /* @__PURE__ */ t(y, {}) : a === !1 ? l(e.iconFalse) ? e.iconFalse : e.falseValues === "x" ? /* @__PURE__ */ t(u, {}) : e.falseValues : l(e.iconNull) ? e.iconNull : "No Value"
      });
    }, {});
  }, (e) => e.text.value, s).setEditViewFn((e) => /* @__PURE__ */ t($, {
    value: e.value,
    onChange: e.onChange,
    onChangeEnd: e.onChangeEnd
  })).setPropertyViewFn((e) => /* @__PURE__ */ C(m, {
    children: [e.text.propertyView({
      label: o("table.columnValue"),
      tooltip: f
    }), e.falseValues.propertyView({
      label: o("table.falseValues"),
      radioButton: !0
    }), e.iconTrue.propertyView({
      label: o("table.iconTrue")
    }), e.iconFalse.propertyView({
      label: o("table.iconFalse")
    }), e.iconNull.propertyView({
      label: o("table.iconNull")
    })]
  })).build();
}();
export {
  M as BooleanComp
};
