@open-formulieren/formio-builder
Version:
An opinionated Formio webform builder for Open Forms
24 lines (23 loc) • 2.64 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const jsx_runtime_1 = require("react/jsx-runtime");
const leaflet_tools_1 = require("@open-formulieren/leaflet-tools");
const react_intl_1 = require("react-intl");
const formio_1 = require("../../components/formio");
const DefaultZoom = () => {
const intl = (0, react_intl_1.useIntl)();
const tooltip = intl.formatMessage({ id: "UJTIZU", defaultMessage: [{ type: 0, value: "Zoom level for the map when it initially loads." }] });
return ((0, jsx_runtime_1.jsx)(formio_1.NumberField, { name: "defaultZoom", label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: 'xxVNeU', defaultMessage: [{ type: 0, value: "Zoom level" }] }), tooltip: tooltip, step: 1, min: leaflet_tools_1.TILE_LAYER_RD.minZoom, max: leaflet_tools_1.TILE_LAYER_RD.maxZoom }));
};
const Latitude = () => {
const intl = (0, react_intl_1.useIntl)();
const tooltip = intl.formatMessage({ id: "ADTla/", defaultMessage: [{ type: 0, value: "Latitude coordinate of the initial center point of the map." }] });
return ((0, jsx_runtime_1.jsx)(formio_1.NumberField, { name: "initialCenter.lat", label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: 'jnHPfU', defaultMessage: [{ type: 0, value: "Latitude" }] }), description: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: 'jiDz2v', defaultMessage: [{ type: 0, value: "Value in decimal degrees, between -90 and +90." }] }), tooltip: tooltip, placeholder: "52.1326332" }));
};
const Longitude = () => {
const intl = (0, react_intl_1.useIntl)();
const tooltip = intl.formatMessage({ id: "Kdgpxf", defaultMessage: [{ type: 0, value: "Longitude coordinate of the initial center point of the map." }] });
return ((0, jsx_runtime_1.jsx)(formio_1.NumberField, { name: "initialCenter.lng", label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: 'LZc4TN', defaultMessage: [{ type: 0, value: "Longitude" }] }), description: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: 'z45pcO', defaultMessage: [{ type: 0, value: "Value in decimal degrees, between -180 and +180." }] }), tooltip: tooltip, placeholder: "5.291266" }));
};
const MapConfiguration = () => ((0, jsx_runtime_1.jsxs)(formio_1.Panel, Object.assign({ title: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: 'pdmkVe', defaultMessage: [{ type: 0, value: "Initial focus" }] }), collapsible: true, initialCollapsed: true }, { children: [(0, jsx_runtime_1.jsx)(DefaultZoom, {}), (0, jsx_runtime_1.jsx)(Latitude, {}), (0, jsx_runtime_1.jsx)(Longitude, {})] })));
exports.default = MapConfiguration;