@luomus/laji-form 15.1.32 → 15.1.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -321,6 +321,9 @@ class MobileEditorMap extends React.Component {
|
|
|
321
321
|
this.setOkButtonRef = (elem) => {
|
|
322
322
|
this.okButtonElem = react_dom_1.findDOMNode(elem);
|
|
323
323
|
};
|
|
324
|
+
this.updateDimensions = () => {
|
|
325
|
+
this.setState({ width: window.innerWidth, height: window.innerHeight });
|
|
326
|
+
};
|
|
324
327
|
this.onChange = () => {
|
|
325
328
|
const { map } = this.map;
|
|
326
329
|
const centerLatLng = map.getCenter();
|
|
@@ -395,23 +398,31 @@ class MobileEditorMap extends React.Component {
|
|
|
395
398
|
this.props.onClose(this.map.getOptions());
|
|
396
399
|
};
|
|
397
400
|
const { center, radius } = this.props;
|
|
398
|
-
this.state = {
|
|
401
|
+
this.state = {
|
|
402
|
+
mapOptions: this.setViewFromCenterAndRadius(center, radius),
|
|
403
|
+
width: window.innerWidth,
|
|
404
|
+
height: window.innerHeight
|
|
405
|
+
};
|
|
399
406
|
}
|
|
400
407
|
componentDidMount() {
|
|
401
408
|
this.mounted = true;
|
|
402
409
|
this.okButtonElem.focus();
|
|
410
|
+
window.addEventListener("resize", this.updateDimensions);
|
|
403
411
|
}
|
|
404
412
|
componenWillUnmount() {
|
|
405
413
|
this.mounted = false;
|
|
414
|
+
window.removeEventListener("resize", this.updateDimensions);
|
|
406
415
|
}
|
|
407
416
|
getCircle(radiusPixels) {
|
|
408
|
-
return (React.createElement("svg", { width: "100%", height: "100%", style: { position: "absolute", zIndex: 1000, top: 0, pointerEvents: "none" } },
|
|
417
|
+
return (React.createElement("svg", { width: "100%", height: "100%", style: { position: "absolute", zIndex: 1000, top: 0, left: 0, pointerEvents: "none" } },
|
|
409
418
|
React.createElement("defs", null,
|
|
410
419
|
React.createElement("mask", { id: "mask", x: "0", y: "0", width: "100%", height: "100%" },
|
|
411
420
|
React.createElement("rect", { x: "0", y: "0", width: "100%", height: "100%", fill: "#fff" }),
|
|
412
421
|
React.createElement("circle", { cx: "50%", cy: "50%", r: radiusPixels }))),
|
|
413
422
|
React.createElement("rect", { x: "0", y: "0", width: "100%", height: "100%", mask: "url(#mask)", fillOpacity: "0.2" }),
|
|
414
|
-
React.createElement("circle", { cx: "50%", cy: "50%", r: radiusPixels, stroke: "black", strokeWidth: "2", fillOpacity: "0" })
|
|
423
|
+
React.createElement("circle", { cx: "50%", cy: "50%", r: radiusPixels, stroke: "black", strokeWidth: "2", fillOpacity: "0" }),
|
|
424
|
+
React.createElement("line", { x1: this.state.width / 2, y1: this.state.height / 2 - radiusPixels, x2: this.state.width / 2, y2: this.state.height / 2 + radiusPixels, stroke: "black", strokeWidth: "2" }),
|
|
425
|
+
React.createElement("line", { x1: this.state.width / 2 - radiusPixels, y1: this.state.height / 2, x2: this.state.width / 2 + radiusPixels, y2: this.state.height / 2, stroke: "black", strokeWidth: "2" })));
|
|
415
426
|
}
|
|
416
427
|
render() {
|
|
417
428
|
let _a = this.props.map.getOptions(), { rootElem, customControls, draw, data, zoomToData, zoom, center, locate } = _a, options = __rest(_a, ["rootElem", "customControls", "draw", "data", "zoomToData", "zoom", "center", "locate"]); // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
@@ -748,7 +748,7 @@ class Autosuggest extends React.Component {
|
|
|
748
748
|
render() {
|
|
749
749
|
const { props } = this;
|
|
750
750
|
let { suggestions, inputValue = "" } = this.state;
|
|
751
|
-
const inputProps = Object.assign(Object.assign({ id: this.props.id, value: inputValue,
|
|
751
|
+
const inputProps = Object.assign(Object.assign({ id: this.props.id, value: inputValue, disabled: props.disabled || props.readonly, placeholder: props.placeholder }, (this.props.inputProps || {})), { onChange: this.onInputChange, onBlur: this.onBlur, onFocus: this.onFocus, autoComplete: "off" });
|
|
752
752
|
let cssClasses = {
|
|
753
753
|
suggestionsContainer: "rw-popup-container rw-popup-transition",
|
|
754
754
|
suggestionsContainerOpen: "rw-popup",
|