geostyler
Version:
Framework for styling geodata
52 lines (51 loc) • 1.13 kB
JavaScript
import { jsxs as a, jsx as i } from "react/jsx-runtime";
import { InputNumber as l, Button as e } from "antd";
import { PlusOutlined as p, MinusOutlined as h } from "@ant-design/icons";
/* empty css */
const y = ({
onChange: t,
value: o = []
}) => {
const c = () => {
const s = [...o];
s.push(1), t && t(s);
}, d = () => {
const s = [...o];
s.splice(s.length - 1, 1), t && t(s);
};
return /* @__PURE__ */ a("div", { className: "editor-field linedash-field", children: [
o.map((s, n) => /* @__PURE__ */ i(
l,
{
value: s,
min: 1,
step: 1,
style: { width: 55 },
onChange: (m) => {
const r = [...o];
r[n] = m, t && t(r);
}
},
n
)),
/* @__PURE__ */ i(
e,
{
className: "gs-add-dash-button",
icon: /* @__PURE__ */ i(p, {}),
onClick: c
}
),
/* @__PURE__ */ i(
e,
{
className: "gs-rm-dash-button",
icon: /* @__PURE__ */ i(h, {}),
onClick: d
}
)
] });
};
export {
y as LineDashField
};