diff --git a/.eslintrc.yml b/.eslintrc.yml index a98291e1..48d886e3 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -29,7 +29,7 @@ rules: class-methods-use-this: "off" import/no-extraneous-dependencies: - - "error" + - "warn" - devDependencies: - "**/*.spec.js" - "**/test_helpers/**/*.js" diff --git a/assets/css/leaflet.css b/assets/css/leaflet.css index 6d72222c..8fbef507 100644 --- a/assets/css/leaflet.css +++ b/assets/css/leaflet.css @@ -5,6 +5,7 @@ .geosearch.leaflet-bar.active form { display: block; + box-shadow: none; } .geosearch a.leaflet-bar-part { @@ -24,6 +25,9 @@ background-image: url(../img/alert.png); background-size: 18px 18px; } +.geosearch.active a.leaflet-bar-part { + border-radius: 4px 0 0 4px +} .leaflet-control-geosearch { position: relative; @@ -31,12 +35,13 @@ .leaflet-control-geosearch form { position: absolute; - top: 0; - left: 22px; - box-shadow: 0 1px 7px rgba(0, 0, 0, 0.65); + top: -2px; + left: 30px; border-radius: 0 4px 4px 0; + border: 2px solid rgba(0,0,0,0.2); + border-left: none; + background-clip: padding-box; z-index: -1; - background: #FFF; height: auto; margin: 0; padding: 0; @@ -51,7 +56,7 @@ font-size: 12px; height: 30px; border-radius: 0 4px 4px 0; - + text-indent: 0; } .leaflet-control-geosearch .message { diff --git a/example/components/Code.js b/example/components/Code.js new file mode 100644 index 00000000..6e563eb2 --- /dev/null +++ b/example/components/Code.js @@ -0,0 +1,31 @@ +import preact, { Component } from 'preact'; +import microlight from 'microlight'; +window.microlight = microlight; + +class Code extends Component { + componentDidMount() { + microlight.reset('code'); + } + + componentDidUpdate(prevProps) { + const { children } = this.props; + this.container.innerHTML = children.join('\n\n'); + microlight.reset('code'); + } + + defineContainer = (ref) => { + this.container = ref; + }; + + render() { + const { children } = this.props; + + return ( +
+ {page.code}
+
+ )}
);
}
diff --git a/example/components/Map.js b/example/components/Map.js
index b7f12bf4..83d2cd03 100644
--- a/example/components/Map.js
+++ b/example/components/Map.js
@@ -1,12 +1,13 @@
import preact, { Component } from 'preact';
import merge from 'lodash.merge';
+import L from 'leaflet';
+
import {
GeoSearchControl,
OpenStreetMapProvider,
Provider as BaseProvider,
} from '../../src';
-const L = window.L;
// eslint-disable-next-line no-confusing-arrow
const ensureInstance = Provider => Provider instanceof BaseProvider ? Provider : new Provider();
diff --git a/example/index.html b/example/index.html
index 30f31acc..eb92babc 100644
--- a/example/index.html
+++ b/example/index.html
@@ -13,6 +13,6 @@
-
+