import { useState as s } from "react";
import { SelectUIView as m } from "./f9c25fbe.js";
import { V as l, P as p, bh as c, a0 as i, ba as C, cQ as V } from "./684d2f28.js";
import { C as d } from "./9869e60a.js";
import { ColumnValueTooltip as g } from "./d404aae1.js";
import "./2d5fc5ff.js";
import "react-dom";
import "./0f3d7a1a.js";
import "./1312a48b.js";
import "./d6402597.js";
import "./00dac55d.js";
import "./b1144c16.js";
import "./926d8ea1.js";
const h = {
  text: C,
  options: V
};
let r = [];
const a = (t) => t.text, f = {}, b = (t) => {
  const [n, o] = s(t.initialValue);
  return /* @__PURE__ */ l(m, {
    ...f,
    value: n,
    options: t.options,
    onChange: (e) => {
      t.onChange(e), o(e);
    },
    onEvent: async (e) => (e === "blur" && t.onChangeEnd(), []),
    style: {}
  });
}, M = function() {
  return new d(h, (t, n) => {
    var e;
    r = t.options;
    const o = t.changeValue ?? a(t);
    return (e = t.options.find((u) => u.value === o)) == null ? void 0 : e.label;
  }, (t) => t.text.value, a).setEditViewFn((t) => /* @__PURE__ */ l(b, {
    initialValue: t.value,
    options: r,
    onChange: t.onChange,
    onChangeEnd: t.onChangeEnd
  })).setPropertyViewFn((t) => /* @__PURE__ */ p(c, {
    children: [t.text.propertyView({
      label: i("table.columnValue"),
      tooltip: g
    }), t.options.propertyView({
      title: i("optionsControl.optionList")
    })]
  })).build();
}();
export {
  M as ColumnSelectComp
};
