geostyler
Version:
Framework for styling geodata
231 lines (230 loc) • 5.74 kB
JavaScript
import { jsxs as P, jsx as o } from "react/jsx-runtime";
import { ColorField as I } from "../Field/ColorField/ColorField.js";
import { OpacityField as z } from "../Field/OpacityField/OpacityField.js";
import { RadiusField as Q } from "../Field/RadiusField/RadiusField.js";
import { WidthField as T } from "../Field/WidthField/WidthField.js";
import { RotateField as U } from "../Field/RotateField/RotateField.js";
import { Form as s } from "antd";
import r from "lodash-es/cloneDeep.js";
import { OffsetField as L } from "../Field/OffsetField/OffsetField.js";
import { useGeoStylerComposition as Z, useGeoStylerLocale as $ } from "../../../context/GeoStylerContext/GeoStylerContext.js";
import { getFormItemConfig as X } from "../../../Util/FormItemUtil.js";
const fe = (V) => {
const O = Z("WellKnownNameEditor"), S = { ...V, ...O }, {
fillColorField: f,
fillOpacityField: u,
offsetXField: m,
offsetYField: c,
onSymbolizerChange: l,
opacityField: b,
radiusField: h,
rotateField: C,
strokeColorField: y,
strokeOpacityField: g,
strokeWidthField: v,
symbolizer: t
} = S, a = $("WellKnownNameEditor"), w = (n) => {
const e = r(t);
e.radius = n, l && l(e);
}, W = (n) => {
const e = r(t), d = [
n,
e.offset ? e.offset[1] : 0
];
e.offset = d, l && l(e);
}, R = (n) => {
const e = r(t), d = [
e.offset ? e.offset[0] : 0,
n
];
e.offset = d, l && l(e);
}, k = (n) => {
const e = r(t);
e.color = n, l && l(e);
}, x = (n) => {
const e = r(t);
e.opacity = n, l && l(e);
}, E = (n) => {
l && l({
...t,
fillOpacity: n
});
}, K = (n) => {
const e = r(t);
e.strokeColor = n, l && l(e);
}, N = (n) => {
const e = r(t);
e.strokeWidth = n, l && l(e);
}, j = (n) => {
const e = r(t);
e.strokeOpacity = n, l && l(e);
}, G = (n) => {
const e = r(t);
e.rotate = n, l && l(e);
}, {
color: D,
fillOpacity: _,
opacity: q,
radius: A,
rotate: B,
strokeColor: H,
strokeOpacity: J,
strokeWidth: M,
offset: p
} = t, i = X();
return /* @__PURE__ */ P("div", { children: [
(h == null ? void 0 : h.visibility) === !1 ? null : /* @__PURE__ */ o(
s.Item,
{
...i,
label: a.radiusLabel,
children: /* @__PURE__ */ o(
Q,
{
value: A,
defaultValue: h == null ? void 0 : h.default,
onChange: w
}
)
}
),
(m == null ? void 0 : m.visibility) === !1 ? null : /* @__PURE__ */ o(
s.Item,
{
...i,
label: a.offsetXLabel,
children: /* @__PURE__ */ o(
L,
{
value: p == null ? void 0 : p[0],
defaultValue: m == null ? void 0 : m.default,
onChange: W
}
)
}
),
(c == null ? void 0 : c.visibility) === !1 ? null : /* @__PURE__ */ o(
s.Item,
{
...i,
label: a.offsetYLabel,
children: /* @__PURE__ */ o(
L,
{
value: p == null ? void 0 : p[1],
defaultValue: c == null ? void 0 : c.default,
onChange: R
}
)
}
),
(f == null ? void 0 : f.visibility) === !1 ? null : /* @__PURE__ */ o(
s.Item,
{
...i,
label: a.fillColorLabel,
children: /* @__PURE__ */ o(
I,
{
value: D,
defaultValue: f == null ? void 0 : f.default,
onChange: k
}
)
}
),
(b == null ? void 0 : b.visibility) === !1 ? null : /* @__PURE__ */ o(
s.Item,
{
...i,
label: a.opacityLabel,
children: /* @__PURE__ */ o(
z,
{
value: q,
defaultValue: b == null ? void 0 : b.default,
onChange: x
}
)
}
),
(u == null ? void 0 : u.visibility) === !1 ? null : /* @__PURE__ */ o(
s.Item,
{
...i,
label: a.fillOpacityLabel,
children: /* @__PURE__ */ o(
z,
{
value: _,
defaultValue: u == null ? void 0 : u.default,
onChange: E
}
)
}
),
(y == null ? void 0 : y.visibility) === !1 ? null : /* @__PURE__ */ o(
s.Item,
{
...i,
label: a.strokeColorLabel,
children: /* @__PURE__ */ o(
I,
{
value: H,
defaultValue: y == null ? void 0 : y.default,
onChange: K
}
)
}
),
(v == null ? void 0 : v.visibility) === !1 ? null : /* @__PURE__ */ o(
s.Item,
{
...i,
label: a.strokeWidthLabel,
children: /* @__PURE__ */ o(
T,
{
value: M,
defaultValue: v == null ? void 0 : v.default,
onChange: N
}
)
}
),
(g == null ? void 0 : g.visibility) === !1 ? null : /* @__PURE__ */ o(
s.Item,
{
...i,
label: a.strokeOpacityLabel,
children: /* @__PURE__ */ o(
z,
{
value: J,
defaultValue: g == null ? void 0 : g.default,
onChange: j
}
)
}
),
(C == null ? void 0 : C.visibility) === !1 ? null : /* @__PURE__ */ o(
s.Item,
{
...i,
label: a.rotateLabel,
children: /* @__PURE__ */ o(
U,
{
value: B,
defaultValue: C == null ? void 0 : C.default,
onChange: G
}
)
}
)
] });
};
export {
fe as WellKnownNameEditor
};