import { b9 as m, cn as l, w as c, bM as V, bv as g, ba as s, V as u, gJ as w, P as d, bh as C, a0 as a } from "./684d2f28.js";
import { C as x } from "./9869e60a.js";
import { ColumnValueTooltip as h } from "./d404aae1.js";
import "react";
import "react-dom";
import "./b1144c16.js";
import "./926d8ea1.js";
import "./d6402597.js";
const y = m.div`
  .ant-input-number  {
    width: 100%;
    border-radius: 0;
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none;

    input {
      padding: 0;
      border-radius: 0;
    }
  }
`, F = {
  text: l,
  step: c(l, 1),
  precision: V.closed(0, 20, 0),
  float: g,
  prefix: s,
  suffix: s
};
let r = !1, p = 1, i = 0;
const f = (t) => t.text, j = function() {
  return new x(F, (t, e) => {
    r = t.float, p = t.step, i = t.precision;
    const o = t.changeValue ?? f(t);
    let n = r ? o : Math.floor(o);
    return r && (n = n.toPrecision(i + 1)), t.prefix + n + t.suffix;
  }, (t) => t.text.value, f).setEditViewFn((t) => /* @__PURE__ */ u(y, {
    children: /* @__PURE__ */ u(w, {
      step: p,
      defaultValue: t.value,
      autoFocus: !0,
      variant: "borderless",
      onChange: (e) => {
        e = e ?? 0, t.onChange(r ? e : Math.floor(e));
      },
      precision: r ? i : 0,
      onBlur: t.onChangeEnd,
      onPressEnter: t.onChangeEnd
    })
  })).setPropertyViewFn((t) => /* @__PURE__ */ d(C, {
    children: [t.text.propertyView({
      label: a("table.columnValue"),
      tooltip: h
    }), t.step.propertyView({
      label: a("table.numberStep"),
      tooltip: a("table.numberStepTooltip"),
      onFocus: (e) => {
        if (!e) {
          const o = t.step.getView(), b = t.float.getView() ? o : Math.floor(o);
          t.step.dispatchChangeValueAction(String(b));
        }
      }
    }), r && t.precision.propertyView({
      label: a("table.precision")
    }), t.prefix.propertyView({
      label: a("table.prefix")
    }), t.suffix.propertyView({
      label: a("table.suffix")
    }), t.float.propertyView({
      label: a("table.float"),
      onChange: (e) => {
        const o = t.step.getView(), n = e ? o : Math.floor(o);
        t.step.dispatchChangeValueAction(String(n));
      }
    })]
  })).build();
}();
export {
  j as ColumnNumberComp
};
