import { X as d, ad as s, w as g, c1 as w, O as C, S as u, L as p, a6 as f, G as c, bU as b, F as i, gH as h, Y as o } from "./603b75d9.js";
import { C as I } from "./4963ac97.js";
import { ColumnValueTooltip as y } from "./62f393ec.js";
import "react";
import "react-dom";
import "./ffcffc16.js";
import "./26dac75c.js";
const F = d.div`
  .ant-input-number  {
    width: 100%;
    border-radius: 0;
    background: transparent !important;
    // padding: 0 !important;
    box-shadow: none;

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