@luomus/laji-form 15.1.33 → 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 = { mapOptions: this.setViewFromCenterAndRadius(center, radius) };
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luomus/laji-form",
3
- "version": "15.1.33",
3
+ "version": "15.1.34",
4
4
  "description": "React module capable of building dynamic forms from Laji form json schemas",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",