geostyler
Version:
Framework for styling geodata
239 lines (238 loc) • 6.24 kB
JavaScript
import { jsxs as T, jsx as t } from "react/jsx-runtime";
import { useState as m } from "react";
import { Select as d, Form as n, Input as p, InputNumber as Z, Button as _ } from "antd";
/* empty css */
import { useGeoStylerLocale as $ } from "../../../context/GeoStylerContext/GeoStylerContext.js";
import { getFormItemConfig as ee } from "../../../Util/FormItemUtil.js";
const U = d.Option, ne = ({
onClick: j
}) => {
var b, I, C, F, w, x, S, v, k, q, L, D, P, V;
const r = $("WfsParserInput"), [y, B] = m("https://ows-demo.terrestris.de/geoserver/terrestris/ows"), [o, M] = m("1.1.0"), [c, O] = m("terrestris:bundeslaender"), [h, W] = m(), [i, G] = m(), [N, z] = m(), [g, A] = m(), [e, f] = m({
url: void 0,
version: void 0,
typeName: void 0,
featureID: void 0,
propertyName: void 0,
maxFeatures: void 0,
fetchParams: void 0,
srsName: void 0
}), E = (s) => {
const u = s.target.value;
let l = {};
u.length <= 0 && (l = {
status: "error",
message: "Url is required"
}), B(u), f({
...e,
url: l
});
}, H = (s) => {
const u = s.target.value;
let l = {};
u.length <= 0 && (l = {
status: "error",
message: "TypeName is required"
}), O(u), f({
...e,
typeName: l
});
}, J = (s) => {
let u = {};
s.length <= 0 && (u = {
status: "error",
message: "Version is required"
}), M(s), f({
...e,
version: u
});
}, K = (s) => {
W(s.target.value);
}, Q = (s) => {
z(s.target.value);
}, R = (s) => {
G(s);
}, X = (s) => {
A(s);
}, Y = () => {
let s;
o === "1.1.0" ? s = {
version: o,
typeName: c,
maxFeatures: g,
featureID: h,
propertyName: i,
srsName: N
} : s = {
version: o,
typeNames: c,
count: g,
featureID: h,
propertyName: i,
srsName: N
}, j({
url: y,
requestParams: s
});
}, a = ee();
return /* @__PURE__ */ T("div", { className: "wfs-parser-input", children: [
/* @__PURE__ */ t(
n.Item,
{
...a,
label: r.urlLabel,
validateStatus: (b = e == null ? void 0 : e.url) == null ? void 0 : b.status,
help: (I = e == null ? void 0 : e.url) == null ? void 0 : I.message,
hasFeedback: !0,
required: !0,
children: /* @__PURE__ */ t(
p,
{
className: "wfs-url-input",
value: y,
onChange: E
}
)
}
),
/* @__PURE__ */ t(
n.Item,
{
...a,
label: r.typeNameLabel,
validateStatus: (C = e == null ? void 0 : e.typeName) == null ? void 0 : C.status,
help: (F = e == null ? void 0 : e.typeName) == null ? void 0 : F.message,
hasFeedback: !0,
required: !0,
children: /* @__PURE__ */ t(
p,
{
className: "wfs-typename-input",
value: c,
onChange: H
}
)
}
),
/* @__PURE__ */ t(
n.Item,
{
...a,
label: r.versionLabel,
validateStatus: (w = e == null ? void 0 : e.version) == null ? void 0 : w.status,
help: (x = e == null ? void 0 : e.version) == null ? void 0 : x.message,
hasFeedback: !0,
required: !0,
children: /* @__PURE__ */ T(
d,
{
className: "wfs-version-input",
style: { width: "100%" },
value: o,
onChange: J,
children: [
/* @__PURE__ */ t(U, { value: "1.1.0", children: "1.1.0" }),
/* @__PURE__ */ t(U, { value: "2.0.0", children: "2.0.0" })
]
}
)
}
),
/* @__PURE__ */ t(
n.Item,
{
...a,
label: r.srsNameLabel,
validateStatus: (S = e == null ? void 0 : e.srsName) == null ? void 0 : S.status,
help: (v = e == null ? void 0 : e.srsName) == null ? void 0 : v.message,
hasFeedback: !0,
children: /* @__PURE__ */ t(
p,
{
className: "wfs-srsName-input",
value: N,
onChange: Q
}
)
}
),
/* @__PURE__ */ t(
n.Item,
{
...a,
label: r.featureIDLabel,
validateStatus: (k = e == null ? void 0 : e.featureID) == null ? void 0 : k.status,
help: (q = e == null ? void 0 : e.featureID) == null ? void 0 : q.message,
hasFeedback: !0,
children: /* @__PURE__ */ t(
p,
{
className: "wfs-featureid-input",
value: h,
onChange: K
}
)
}
),
/* @__PURE__ */ t(
n.Item,
{
...a,
label: r.propertyNameLabel,
validateStatus: (L = e == null ? void 0 : e.propertyName) == null ? void 0 : L.status,
help: (D = e == null ? void 0 : e.propertyName) == null ? void 0 : D.message,
hasFeedback: !0,
children: /* @__PURE__ */ t(
d,
{
className: "wfs-propertyname-input",
style: { width: "100%" },
mode: "tags",
value: i,
onChange: R
}
)
}
),
/* @__PURE__ */ t(
n.Item,
{
...a,
label: r.maxFeaturesLabel,
validateStatus: (P = e == null ? void 0 : e.maxFeatures) == null ? void 0 : P.status,
help: (V = e == null ? void 0 : e.maxFeatures) == null ? void 0 : V.message,
hasFeedback: !0,
children: /* @__PURE__ */ t(
Z,
{
className: "wfs-maxfeatures-input",
style: { width: "100%" },
min: 0,
value: g,
onChange: X,
precision: 0
}
)
}
),
/* @__PURE__ */ t(
n.Item,
{
...a,
children: /* @__PURE__ */ t(
_,
{
className: "wfs-parser-submit-button",
type: "primary",
onClick: Y,
children: r.requestButtonText
}
)
}
)
] });
};
export {
ne as WfsParserInput,
ne as default
};