import { useState as d } from "react";
import { SelectUIView as h } from "./0cdeb449.js";
import { X as u, a6 as r, G as l, F as n, Y as a, S as g, d1 as m } from "./603b75d9.js";
import { C as x } from "./4963ac97.js";
import { ColumnValueTooltip as f } from "./62f393ec.js";
import "./d50792b8.js";
import "react-dom";
import "./f64a8554.js";
import "./00d44232.js";
import "./f9847c56.js";
import "./ffcffc16.js";
import "./26dac75c.js";
const C = u.div`
  display: inline-flex;
  align-items: center;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  background: transparent !important;
  padding: 8px;

  > div {
    width: 100%;
    height: 100%;
  }

  .ant-select {
    height: 100%;
    .ant-select-selector {
      padding: 0 7px;
      height: 100%;
      overflow: hidden;
      .ant-select-selection-item {
        display: inline-flex;
        align-items: center;
        padding-right: 24px;
      }
    }
    .ant-select-arrow {
      height: calc(100% - 3px);
      width: fit-content;
      top: 1.5px;
      margin-top: 0;
      background-color: white;
      right: 1.5px;
      border-right: 1px solid #d7d9e0;
      cursor: pointer;
      pointer-events: auto;
      svg {
        min-width: 18px;
        min-height: 18px;
      }
      &:hover svg path {
        fill: #315efb;
      }
    }
    .ant-select-selector .ant-select-selection-search {
      left: 7px;
      input {
        height: 100%;
      }
    }
    &.ant-select-open {
      .ant-select-arrow {
        border-right: none;
        border-left: 1px solid #d7d9e0;
        svg g path {
          fill: #315efb;
        }
      }
      .ant-select-selection-item {
        opacity: 0.4;
      }
    }
  }
`, w = {
  text: g,
  options: m
};
let s = [];
const c = (t) => t.text, b = {}, v = (t) => {
  const [o, i] = d(t.initialValue);
  return /* @__PURE__ */ n(h, {
    autoFocus: !0,
    allowClear: !0,
    ...b,
    value: o,
    options: t.options,
    onChange: (e) => {
      t.onChange(e), i(e);
    },
    onEvent: async (e) => (e === "blur" && t.onChangeEnd(), []),
    style: {}
  });
}, L = function() {
  return new x(w, (t, o) => {
    s = t.options;
    const i = t.changeValue ?? c(t), e = t.options.find((p) => p.value === i);
    return /* @__PURE__ */ r(l, {
      children: [/* @__PURE__ */ n("span", {
        children: e == null ? void 0 : e.prefixIcon
      }), /* @__PURE__ */ n("span", {
        children: e == null ? void 0 : e.label
      })]
    });
  }, (t) => t.text.value, c).setEditViewFn((t) => /* @__PURE__ */ n(C, {
    children: /* @__PURE__ */ n(v, {
      initialValue: t.value,
      options: s,
      onChange: t.onChange,
      onChangeEnd: t.onChangeEnd
    })
  })).setPropertyViewFn((t) => /* @__PURE__ */ r(l, {
    children: [t.text.propertyView({
      label: a("table.columnValue"),
      tooltip: f
    }), t.options.propertyView({
      title: a("optionsControl.optionList")
    })]
  })).build();
}();
export {
  L as ColumnSelectComp
};
