UNPKG

geostyler

Version:
259 lines (258 loc) 7.12 kB
import { jsxs as X, Fragment as Y, jsx as i } from "react/jsx-runtime"; import { Form as r, Collapse as Z } from "antd"; import { ColorField as $ } from "../Field/ColorField/ColorField.js"; import { OpacityField as F } from "../Field/OpacityField/OpacityField.js"; import { WidthField as ee } from "../Field/WidthField/WidthField.js"; import { LineDashField as le } from "../Field/LineDashField/LineDashField.js"; import { LineCapField as oe } from "../Field/LineCapField/LineCapField.js"; import { LineJoinField as ie } from "../Field/LineJoinField/LineJoinField.js"; import { OffsetField as S } from "../Field/OffsetField/OffsetField.js"; import { GraphicEditor as k } from "../GraphicEditor/GraphicEditor.js"; import L from "lodash-es/get.js"; import { useGeoStylerComposition as ne, useGeoStylerLocale as te, useGeoStylerUnsupportedProperties as ae } from "../../../context/GeoStylerContext/GeoStylerContext.js"; import { VisibilityField as re } from "../Field/VisibilityField/VisibilityField.js"; import { getFormItemConfig as se } from "../../../Util/FormItemUtil.js"; const Ie = (G) => { const O = ne("LineEditor"), V = { ...G, ...O }, { capField: p, colorField: c, dashOffsetField: u, graphicFillField: b, graphicStrokeField: C, joinField: d, lineDashField: y, onSymbolizerChange: o, opacityField: h, perpendicularOffsetField: m, symbolizer: n, widthField: f, visibilityField: g } = V, t = te("LineEditor"), { getFormItemSupportProps: s } = ae(n), T = (l) => { const e = structuredClone(n); e.color = l, o && o(e); }, j = (l) => { const e = structuredClone(n); e.width = l, o && o(e); }, E = (l) => { const e = structuredClone(n); e.perpendicularOffset = l, o && o(e); }, x = (l) => { const e = structuredClone(n); e.opacity = l, o && o(e); }, P = (l) => { const e = structuredClone(n); e.dasharray = l, o && o(e); }, D = (l) => { const e = structuredClone(n); e.dashOffset = l, o && o(e); }, J = (l) => { const e = structuredClone(n); e.cap = l, o && o(e); }, W = (l) => { const e = structuredClone(n); e.join = l, o && o(e); }, w = (l) => { const e = structuredClone(n); e.graphicStroke = l, o && o(e); }, A = (l) => { const e = structuredClone(n); e.graphicFill = l, o && o(e); }, K = (l) => { const e = structuredClone(n); e.visibility = l, o && o(e); }, { color: N, width: U, opacity: _, dasharray: q, dashOffset: B, cap: H, join: M, graphicStroke: z, perpendicularOffset: Q, graphicFill: I, visibility: R } = structuredClone(n), a = se(), v = [{ key: "1", label: t.generalSectionLabel, children: /* @__PURE__ */ X(Y, { children: [ (g == null ? void 0 : g.visibility) === !1 ? null : /* @__PURE__ */ i( r.Item, { ...a, label: t.visibilityLabel, children: /* @__PURE__ */ i( re, { value: R, onChange: K } ) } ), (c == null ? void 0 : c.visibility) === !1 ? null : /* @__PURE__ */ i( r.Item, { ...a, label: t.colorLabel, ...s("color"), children: /* @__PURE__ */ i( $, { value: N, defaultValue: c == null ? void 0 : c.default, onChange: T } ) } ), (f == null ? void 0 : f.visibility) === !1 ? null : /* @__PURE__ */ i( r.Item, { ...a, label: t.widthLabel, ...s("width"), children: /* @__PURE__ */ i( ee, { value: U, defaultValue: f == null ? void 0 : f.default, onChange: j } ) } ), (m == null ? void 0 : m.visibility) === !1 ? null : /* @__PURE__ */ i( r.Item, { ...a, label: t.perpendicularOffsetLabel, ...s("perpendicularOffset"), children: /* @__PURE__ */ i( S, { value: Q, defaultValue: m == null ? void 0 : m.default, onChange: E } ) } ), (h == null ? void 0 : h.visibility) === !1 ? null : /* @__PURE__ */ i( r.Item, { ...a, label: t.opacityLabel, ...s("opacity"), children: /* @__PURE__ */ i( F, { value: _, defaultValue: h == null ? void 0 : h.default, onChange: x } ) } ), (y == null ? void 0 : y.visibility) === !1 ? null : /* @__PURE__ */ i( r.Item, { ...a, label: t.dashLabel, ...s("dasharray"), children: /* @__PURE__ */ i( le, { value: q, onChange: P } ) } ), (u == null ? void 0 : u.visibility) === !1 ? null : /* @__PURE__ */ i( r.Item, { ...a, label: t.dashOffsetLabel, ...s("dashOffset"), children: /* @__PURE__ */ i( S, { value: B, defaultValue: u == null ? void 0 : u.default, onChange: D, disabled: n.dasharray === void 0 || L(n, "dasharray.length") === 0 } ) } ), (p == null ? void 0 : p.visibility) === !1 ? null : /* @__PURE__ */ i( r.Item, { ...a, label: t.capLabel, ...s("cap"), children: /* @__PURE__ */ i( oe, { value: H, onChange: (l) => J(l) } ) } ), (d == null ? void 0 : d.visibility) === !1 ? null : /* @__PURE__ */ i( r.Item, { ...a, label: t.joinLabel, ...s("join"), children: /* @__PURE__ */ i( ie, { value: M, onChange: (l) => W(l) } ) } ) ] }) }]; return (C == null ? void 0 : C.visibility) !== !1 && v.push({ key: "2", label: t.graphicStrokeSectionLabel, children: /* @__PURE__ */ i( k, { value: z, onGraphicChange: w, graphicTypeFieldLabel: t.graphicStrokeTypeLabel, graphicType: L(z, "kind") } ) }), (b == null ? void 0 : b.visibility) !== !1 && v.push({ key: "3", label: t.graphicFillSectionLabel, children: /* @__PURE__ */ i( k, { value: I, onGraphicChange: A, graphicTypeFieldLabel: t.graphicFillTypeLabel, graphicType: L(I, "kind") } ) }), /* @__PURE__ */ i("div", { className: "gs-line-symbolizer-editor", children: /* @__PURE__ */ i( Z, { items: v, defaultActiveKey: ["1"], bordered: !1 } ) }); }; export { Ie as LineEditor };