geostyler
Version:
Framework for styling geodata
58 lines (57 loc) • 1.43 kB
JavaScript
import { jsx as i, jsxs as b } from "react/jsx-runtime";
import { MarkEditor as k } from "../MarkEditor/MarkEditor.js";
import { IconEditor as l } from "../IconEditor/IconEditor.js";
import { GraphicTypeField as z } from "../Field/GraphicTypeField/GraphicTypeField.js";
import e from "../../../Util/SymbolizerUtil.js";
import { Form as I } from "antd";
import { getFormItemConfig as g } from "../../../Util/FormItemUtil.js";
const T = ({
graphicTypeFieldLabel: f = "Graphic-Type",
value: r,
graphicType: n,
onGraphicChange: o,
graphicTypeFieldProps: s,
iconEditorProps: c,
iconLibraries: d
}) => {
let m;
(r == null ? void 0 : r.kind) === "Mark" ? m = /* @__PURE__ */ i(
k,
{
symbolizer: r,
onSymbolizerChange: o
}
) : (r == null ? void 0 : r.kind) === "Icon" && (m = /* @__PURE__ */ i(
l,
{
symbolizer: r,
onSymbolizerChange: o,
iconLibraries: d,
...c
}
));
const p = (t) => {
o && o(t === "Mark" ? e.generateSymbolizer("Mark") : t === "Icon" ? e.generateSymbolizer("Icon") : void 0);
}, y = g();
return /* @__PURE__ */ b("div", { children: [
/* @__PURE__ */ i(
I.Item,
{
...y,
label: f,
children: /* @__PURE__ */ i(
z,
{
value: n,
onChange: p,
...s
}
)
}
),
m
] });
};
export {
T as GraphicEditor
};