fui-fancyui
Version:
FancyUI Libary
26 lines (25 loc) • 925 B
JavaScript
"use client";
import { jsxs as f, jsx as r } from "react/jsx-runtime";
import { SelectField as h } from "./DropDownSelect.style.js";
import { forwardRef as v } from "react";
const b = v((i, d) => {
const {
values: l,
value: u,
placeholder: o,
children: c,
align: t = "left",
emptySelect: p = !0,
required: n,
...s
} = i;
return /* @__PURE__ */ f(h, { ref: d, $align: t, $labelAlign: t, value: u || "", ...s, children: [
o && /* @__PURE__ */ r("option", { value: "", style: { color: "red" }, disabled: n && !0, children: o }, "-2"),
p && /* @__PURE__ */ r("option", { value: "", disabled: n && !0, children: "" }, "-1"),
l == null ? void 0 : l.map((e, a) => typeof e == "string" ? /* @__PURE__ */ r("option", { value: e.toLocaleLowerCase(), children: e }, a) : /* @__PURE__ */ r("option", { value: e.key, children: e.value }, a)),
c
] });
});
export {
b as default
};