@micromag/element-map 0.3.178 → 0.3.182
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.
- package/es/index.js +27 -3
- package/lib/index.js +27 -3
- package/package.json +3 -3
package/es/index.js
CHANGED
|
@@ -334,6 +334,26 @@ function useGoogleMap(_ref) {
|
|
|
334
334
|
|
|
335
335
|
var styles$1 = {"container":"micromag-element-map-container","map":"micromag-element-map-map","preventScroll":"micromag-element-map-preventScroll"};
|
|
336
336
|
|
|
337
|
+
var stopDragEventsPropagation = {
|
|
338
|
+
onTouchMove: function onTouchMove(e) {
|
|
339
|
+
return e.stopPropagation();
|
|
340
|
+
},
|
|
341
|
+
onTouchStart: function onTouchStart(e) {
|
|
342
|
+
return e.stopPropagation();
|
|
343
|
+
},
|
|
344
|
+
onTouchEnd: function onTouchEnd(e) {
|
|
345
|
+
return e.stopPropagation();
|
|
346
|
+
},
|
|
347
|
+
onPointerMove: function onPointerMove(e) {
|
|
348
|
+
return e.stopPropagation();
|
|
349
|
+
},
|
|
350
|
+
onPointerUp: function onPointerUp(e) {
|
|
351
|
+
return e.stopPropagation();
|
|
352
|
+
},
|
|
353
|
+
onPointerDown: function onPointerDown(e) {
|
|
354
|
+
return e.stopPropagation();
|
|
355
|
+
}
|
|
356
|
+
};
|
|
337
357
|
var propTypes$2 = {
|
|
338
358
|
center: PropTypes.shape({
|
|
339
359
|
lat: PropTypes.number,
|
|
@@ -419,9 +439,9 @@ var Map$1 = function Map(_ref) {
|
|
|
419
439
|
map = _useGoogleMap.map,
|
|
420
440
|
mapRef = _useGoogleMap.ref;
|
|
421
441
|
|
|
422
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
442
|
+
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
423
443
|
className: classNames([styles$1.container, (_ref2 = {}, _defineProperty(_ref2, className, className !== null), _defineProperty(_ref2, styles$1.preventScroll, !draggable), _ref2)])
|
|
424
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
444
|
+
}, stopDragEventsPropagation), /*#__PURE__*/React.createElement("div", {
|
|
425
445
|
ref: mapRef,
|
|
426
446
|
className: styles$1.map,
|
|
427
447
|
tabIndex: focusable ? '0' : '-1'
|
|
@@ -602,6 +622,7 @@ var propTypes = {
|
|
|
602
622
|
onReady: PropTypes.func,
|
|
603
623
|
onCenterChanged: PropTypes.func,
|
|
604
624
|
onBoundsChanged: PropTypes.func,
|
|
625
|
+
onDrag: PropTypes.func,
|
|
605
626
|
onDragEnd: PropTypes.func,
|
|
606
627
|
withoutStyle: PropTypes.bool,
|
|
607
628
|
fitBounds: PropTypes.bool,
|
|
@@ -624,6 +645,7 @@ var defaultProps = {
|
|
|
624
645
|
onReady: null,
|
|
625
646
|
onCenterChanged: null,
|
|
626
647
|
onBoundsChanged: null,
|
|
648
|
+
onDrag: null,
|
|
627
649
|
onDragEnd: null,
|
|
628
650
|
withoutStyle: false,
|
|
629
651
|
fitBounds: false,
|
|
@@ -647,6 +669,7 @@ var Map = function Map(_ref) {
|
|
|
647
669
|
onReady = _ref.onReady,
|
|
648
670
|
onCenterChanged = _ref.onCenterChanged,
|
|
649
671
|
onBoundsChanged = _ref.onBoundsChanged,
|
|
672
|
+
onDrag = _ref.onDrag,
|
|
650
673
|
onDragEnd = _ref.onDragEnd,
|
|
651
674
|
withoutStyle = _ref.withoutStyle,
|
|
652
675
|
fitBounds = _ref.fitBounds,
|
|
@@ -711,10 +734,11 @@ var Map = function Map(_ref) {
|
|
|
711
734
|
onClick: onClick,
|
|
712
735
|
onCenterChanged: onCenterChanged,
|
|
713
736
|
onBoundsChanged: onBoundsChanged,
|
|
737
|
+
onDrag: onDrag,
|
|
714
738
|
onDragEnd: onDragEnd,
|
|
715
739
|
onTilesLoaded: onTilesLoaded
|
|
716
740
|
};
|
|
717
|
-
}, [onClick, onCenterChanged, onBoundsChanged, onDragEnd, onTilesLoaded]);
|
|
741
|
+
}, [onClick, onCenterChanged, onBoundsChanged, onDrag, onDragEnd, onTilesLoaded]);
|
|
718
742
|
return /*#__PURE__*/React.createElement("div", {
|
|
719
743
|
className: classNames([styles.container, _defineProperty({}, className, className !== null)])
|
|
720
744
|
}, /*#__PURE__*/React.createElement(Map$1, {
|
package/lib/index.js
CHANGED
|
@@ -348,6 +348,26 @@ function useGoogleMap(_ref) {
|
|
|
348
348
|
|
|
349
349
|
var styles$1 = {"container":"micromag-element-map-container","map":"micromag-element-map-map","preventScroll":"micromag-element-map-preventScroll"};
|
|
350
350
|
|
|
351
|
+
var stopDragEventsPropagation = {
|
|
352
|
+
onTouchMove: function onTouchMove(e) {
|
|
353
|
+
return e.stopPropagation();
|
|
354
|
+
},
|
|
355
|
+
onTouchStart: function onTouchStart(e) {
|
|
356
|
+
return e.stopPropagation();
|
|
357
|
+
},
|
|
358
|
+
onTouchEnd: function onTouchEnd(e) {
|
|
359
|
+
return e.stopPropagation();
|
|
360
|
+
},
|
|
361
|
+
onPointerMove: function onPointerMove(e) {
|
|
362
|
+
return e.stopPropagation();
|
|
363
|
+
},
|
|
364
|
+
onPointerUp: function onPointerUp(e) {
|
|
365
|
+
return e.stopPropagation();
|
|
366
|
+
},
|
|
367
|
+
onPointerDown: function onPointerDown(e) {
|
|
368
|
+
return e.stopPropagation();
|
|
369
|
+
}
|
|
370
|
+
};
|
|
351
371
|
var propTypes$2 = {
|
|
352
372
|
center: PropTypes__default["default"].shape({
|
|
353
373
|
lat: PropTypes__default["default"].number,
|
|
@@ -433,9 +453,9 @@ var Map$1 = function Map(_ref) {
|
|
|
433
453
|
map = _useGoogleMap.map,
|
|
434
454
|
mapRef = _useGoogleMap.ref;
|
|
435
455
|
|
|
436
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
456
|
+
return /*#__PURE__*/React__default["default"].createElement("div", Object.assign({
|
|
437
457
|
className: classNames__default["default"]([styles$1.container, (_ref2 = {}, _defineProperty__default["default"](_ref2, className, className !== null), _defineProperty__default["default"](_ref2, styles$1.preventScroll, !draggable), _ref2)])
|
|
438
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
458
|
+
}, stopDragEventsPropagation), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
439
459
|
ref: mapRef,
|
|
440
460
|
className: styles$1.map,
|
|
441
461
|
tabIndex: focusable ? '0' : '-1'
|
|
@@ -616,6 +636,7 @@ var propTypes = {
|
|
|
616
636
|
onReady: PropTypes__default["default"].func,
|
|
617
637
|
onCenterChanged: PropTypes__default["default"].func,
|
|
618
638
|
onBoundsChanged: PropTypes__default["default"].func,
|
|
639
|
+
onDrag: PropTypes__default["default"].func,
|
|
619
640
|
onDragEnd: PropTypes__default["default"].func,
|
|
620
641
|
withoutStyle: PropTypes__default["default"].bool,
|
|
621
642
|
fitBounds: PropTypes__default["default"].bool,
|
|
@@ -638,6 +659,7 @@ var defaultProps = {
|
|
|
638
659
|
onReady: null,
|
|
639
660
|
onCenterChanged: null,
|
|
640
661
|
onBoundsChanged: null,
|
|
662
|
+
onDrag: null,
|
|
641
663
|
onDragEnd: null,
|
|
642
664
|
withoutStyle: false,
|
|
643
665
|
fitBounds: false,
|
|
@@ -661,6 +683,7 @@ var Map = function Map(_ref) {
|
|
|
661
683
|
onReady = _ref.onReady,
|
|
662
684
|
onCenterChanged = _ref.onCenterChanged,
|
|
663
685
|
onBoundsChanged = _ref.onBoundsChanged,
|
|
686
|
+
onDrag = _ref.onDrag,
|
|
664
687
|
onDragEnd = _ref.onDragEnd,
|
|
665
688
|
withoutStyle = _ref.withoutStyle,
|
|
666
689
|
fitBounds = _ref.fitBounds,
|
|
@@ -725,10 +748,11 @@ var Map = function Map(_ref) {
|
|
|
725
748
|
onClick: onClick,
|
|
726
749
|
onCenterChanged: onCenterChanged,
|
|
727
750
|
onBoundsChanged: onBoundsChanged,
|
|
751
|
+
onDrag: onDrag,
|
|
728
752
|
onDragEnd: onDragEnd,
|
|
729
753
|
onTilesLoaded: onTilesLoaded
|
|
730
754
|
};
|
|
731
|
-
}, [onClick, onCenterChanged, onBoundsChanged, onDragEnd, onTilesLoaded]);
|
|
755
|
+
}, [onClick, onCenterChanged, onBoundsChanged, onDrag, onDragEnd, onTilesLoaded]);
|
|
732
756
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
733
757
|
className: classNames__default["default"]([styles.container, _defineProperty__default["default"]({}, className, className !== null)])
|
|
734
758
|
}, /*#__PURE__*/React__default["default"].createElement(Map$1, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-map",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.182",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@babel/runtime": "^7.13.10",
|
|
52
|
-
"@micromag/core": "^0.3.
|
|
52
|
+
"@micromag/core": "^0.3.182",
|
|
53
53
|
"classnames": "^2.2.6",
|
|
54
54
|
"lodash": "^4.17.21",
|
|
55
55
|
"prop-types": "^15.7.2",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"publishConfig": {
|
|
60
60
|
"access": "public"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "3fdd215df2c83f292063fba88077d88be5718955"
|
|
63
63
|
}
|