geostyler
Version:
Framework for styling geodata
44 lines (43 loc) • 1.33 kB
JavaScript
import { jsx as a } from "react/jsx-runtime";
import { useMemo as C } from "react";
import { Form as s } from "antd";
import { SourceChannelNameField as y } from "../SourceChannelNameField/SourceChannelNameField.js";
import { isGeoStylerFunction as f } from "geostyler-style";
import { useGeoStylerLocale as g } from "../../../../context/GeoStylerContext/GeoStylerContext.js";
import { getFormItemConfig as p } from "../../../../Util/FormItemUtil.js";
const x = ({
onChange: t,
value: n,
sourceChannelNames: m
}) => {
const l = g("GrayChannelField"), c = C(() => {
var e, r;
return f((e = n == null ? void 0 : n.grayChannel) == null ? void 0 : e.sourceChannelName) || (r = n == null ? void 0 : n.grayChannel) == null ? void 0 : r.sourceChannelName;
}, [n]), i = (e) => {
const r = e;
let o;
e && Object.prototype.hasOwnProperty.call(e, "grayChannel") ? (o = structuredClone(n), o.grayChannel.sourceChannelName = r) : o = {
grayChannel: {
sourceChannelName: r
}
}, t && t(o);
}, h = p();
return /* @__PURE__ */ a(
s.Item,
{
...h,
label: l.grayLabel,
children: /* @__PURE__ */ a(
y,
{
sourceChannelNames: m,
onChange: i,
value: c
}
)
}
);
};
export {
x as GrayChannelField
};