react-leaflet-custom-control
Advanced tools
Comparing version
@@ -0,1 +1,12 @@ | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
import React from 'react'; | ||
@@ -9,3 +20,4 @@ var POSITION_CLASSES = { | ||
var Control = function (props) { | ||
var _a = React.useState(document.createElement('div')), portalRoot = _a[0], setPortalRoot = _a[1]; | ||
var _a, _b; | ||
var _c = React.useState(document.createElement('div')), portalRoot = _c[0], setPortalRoot = _c[1]; | ||
var positionClass = ((props.position && POSITION_CLASSES[props.position]) || POSITION_CLASSES.topright); | ||
@@ -27,5 +39,6 @@ var controlContainerRef = React.createRef(); | ||
}, [portalRoot, props.prepend, controlContainerRef]); | ||
return (React.createElement("div", { ref: controlContainerRef, className: 'leaflet-control' }, props.children)); | ||
var className = (((_b = (_a = props.container) === null || _a === void 0 ? void 0 : _a.className) === null || _b === void 0 ? void 0 : _b.concat(' ')) || '') + 'leaflet-control'; | ||
return (React.createElement("div", __assign({}, props.container, { ref: controlContainerRef, className: className }), props.children)); | ||
}; | ||
export default Control; | ||
//# sourceMappingURL=Control.js.map |
{ | ||
"name": "react-leaflet-custom-control", | ||
"version": "1.3.2", | ||
"version": "1.3.3", | ||
"description": "Creates a control wrapper around a React element", | ||
@@ -5,0 +5,0 @@ "main": "lib/Control.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
12874
7.11%122
14.02%