UNPKG

geostyler

Version:
54 lines (53 loc) 1.31 kB
import { jsx as r, jsxs as o } from "react/jsx-runtime"; import { Input as c, Button as d } from "antd"; import { FunctionUI as x } from "../../FunctionUI/FunctionUI.js"; import { isGeoStylerFunction as y } from "geostyler-style"; import { FunctionOutlined as F } from "@ant-design/icons"; /* empty css */ const B = ({ className: m, functionUiProps: f, inputProps: l, onCancel: i, onChange: t, value: s }) => { let p = "string-expression-input"; return m && (p += ` ${m}`), y(s) ? /* @__PURE__ */ r("span", { className: p, children: /* @__PURE__ */ r( x, { type: "string", value: s, ...f, onChange: t, onCancel: () => i == null ? void 0 : i("string") } ) }) : /* @__PURE__ */ o("span", { className: p, children: [ /* @__PURE__ */ r( c, { value: s, onChange: (u) => { u.target.value === null && (t == null || t(void 0)), t == null || t(u.target.value); }, ...l } ), /* @__PURE__ */ r( d, { icon: /* @__PURE__ */ r(F, {}), onClick: () => { t == null || t({ name: "property", args: [""] }); } } ) ] }); }; export { B as StringExpressionInput, B as default };