import { jsx as a } from "@emotion/react/jsx-runtime";
import { InputTextEditorStyled as f } from "../../../slots/DataGridSlot.js";
function y(e) {
  e?.focus(), e?.select();
}
function d({
  row: e,
  column: r,
  onRowChange: o,
  onClose: u
}) {
  return /* @__PURE__ */ a(
    f,
    {
      ownerState: {},
      ref: y,
      value: e[r.key],
      onChange: (n) => o({ ...e, [r.key]: n.target.value }),
      onBlur: () => u(!0)
    }
  );
}
function k({
  row: e,
  column: r,
  onRowChange: o,
  onClose: u
}) {
  const n = (t) => {
    (t.key === "ArrowUp" || t.key === "ArrowDown") && u(!0), t.key === "Enter" && u(!0);
  };
  return /* @__PURE__ */ a(
    f,
    {
      ownerState: {},
      ref: y,
      type: "number",
      value: e[r.key],
      onKeyDown: n,
      onChange: (t) => o({
        ...e,
        [r.key]: t.target.value !== "" ? Number(t.target.value) : ""
      }),
      onBlur: () => u(!0)
    }
  );
}
export {
  k as NumberEditor,
  d as TextEditor,
  d as default
};
