@opensystemslab/map 0.4.4 → 0.4.7

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,25 +1,34 @@
1
1
  {
2
2
  "name": "@opensystemslab/map",
3
- "version": "0.4.4",
3
+ "version": "0.4.7",
4
4
  "license": "OGL-UK-3.0",
5
5
  "private": false,
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/theopensystemslab/map.git"
9
9
  },
10
- "browser": "./dist/map.umd.js",
11
- "module": "./dist/map.es.js",
12
- "exports": "./dist/map.es.js",
13
- "types": "types/map.d.ts",
10
+ "browser": "./dist/component-lib.umd.js",
11
+ "module": "./dist/component-lib.es.js",
12
+ "exports": "./dist/component-lib.es.js",
13
+ "types": "./dist/types/index.d.ts",
14
14
  "files": [
15
15
  "dist",
16
16
  "types"
17
17
  ],
18
+ "scripts": {
19
+ "dev": "vite",
20
+ "build": "rm -rf dist types && tsc && vite build && sed 's/src=\".*\"/src=\"component-lib.es.js\"/' index.html > dist/index.html",
21
+ "prepublishOnly": "npm run build",
22
+ "prepare": "husky install"
23
+ },
18
24
  "dependencies": {
19
25
  "@turf/union": "^6.5.0",
26
+ "accessible-autocomplete": "^2.0.4",
27
+ "govuk-frontend": "^3.14.0",
20
28
  "lit": "^2.0.0-rc.2",
21
29
  "ol": "^6.9.0",
22
- "ol-mapbox-style": "^6.4.1",
30
+ "ol-mapbox-style": "^7.1.1",
31
+ "postcode": "^5.1.0",
23
32
  "rambda": "^7.0.1"
24
33
  },
25
34
  "devDependencies": {
@@ -27,14 +36,12 @@
27
36
  "husky": "^7.0.1",
28
37
  "lint-staged": "^12.0.3",
29
38
  "prettier": "^2.3.2",
39
+ "rollup-plugin-postcss-lit": "^2.0.0",
40
+ "sass": "^1.44.0",
30
41
  "typescript": "^4.3.5",
31
42
  "vite": "^2.4.4"
32
43
  },
33
44
  "lint-staged": {
34
45
  "src/**/*.{js,jsx,ts,tsx,json,css,scss,md,html}": "prettier --write"
35
- },
36
- "scripts": {
37
- "dev": "vite",
38
- "build": "tsc && vite build && sed 's/src=\".*\"/src=\"map.es.js\"/' index.html > dist/index.html"
39
46
  }
40
- }
47
+ }
@@ -0,0 +1,29 @@
1
+ import { LitElement } from "lit";
2
+ export declare class AddressAutocomplete extends LitElement {
3
+ static styles: import("lit").CSSResult;
4
+ id: string;
5
+ postcode: string;
6
+ label: string;
7
+ osPlacesApiKey: string;
8
+ private _totalAddresses;
9
+ private _addressesInPostcode;
10
+ private _options;
11
+ private _selectedAddress;
12
+ private _osError;
13
+ connectedCallback(): void;
14
+ disconnectedCallback(): void;
15
+ firstUpdated(): void;
16
+ _fetchData(offset?: number, prevResults?: any[]): Promise<void>;
17
+ render(): import("lit").TemplateResult<1>;
18
+ /**
19
+ * dispatches an event for clients to subscribe to
20
+ * @param eventName
21
+ * @param payload
22
+ */
23
+ private dispatch;
24
+ }
25
+ declare global {
26
+ interface HTMLElementTagNameMap {
27
+ "address-autocomplete": AddressAutocomplete;
28
+ }
29
+ }
@@ -3,7 +3,8 @@ import Map from "ol/Map";
3
3
  import { DrawPointerEnum } from "./drawing";
4
4
  import { AreaUnitEnum } from "./utils";
5
5
  export declare class MyMap extends LitElement {
6
- static styles: import("lit").CSSResultGroup;
6
+ static styles: import("lit").CSSResult;
7
+ id: string;
7
8
  latitude: number;
8
9
  longitude: number;
9
10
  zoom: number;
@@ -7,5 +7,6 @@ export declare function makeFeatureLayer(color: string, featureFill: boolean): V
7
7
  * features containing the coordinates of the provided point
8
8
  * @param coord - xy coordinate
9
9
  * @param apiKey - Ordnance Survey Features API key, sign up here: https://osdatahub.os.uk/plans
10
+ * @param supportClickFeatures - whether the featureSource should support `clickFeatures` mode or be cleared upfront
10
11
  */
11
- export declare function getFeaturesAtPoint(coord: Array<number>, apiKey: any): void;
12
+ export declare function getFeaturesAtPoint(coord: Array<number>, apiKey: any, supportClickFeatures: boolean): void;
@@ -1,3 +1,3 @@
1
- import 'ol/ol.css';
2
- import { ScaleLine } from 'ol/control';
1
+ import "ol/ol.css";
2
+ import { ScaleLine } from "ol/control";
3
3
  export declare function scaleControl(useScaleBarStyle: boolean): ScaleLine;
@@ -0,0 +1,30 @@
1
+ import { LitElement } from "lit";
2
+ export declare class PostcodeSearch extends LitElement {
3
+ static styles: import("lit").CSSResult;
4
+ id: string;
5
+ errorId: string;
6
+ label: string;
7
+ hintText: string;
8
+ errorMessage: string;
9
+ onlyQuestionOnPage: boolean;
10
+ private _postcode;
11
+ private _sanitizedPostcode;
12
+ private _showPostcodeError;
13
+ _onInputChange(e: any): void;
14
+ _onBlur(): void;
15
+ _onKeyUp(e: KeyboardEvent): void;
16
+ _showError(): void;
17
+ _makeLabel(): import("lit").TemplateResult<1>;
18
+ render(): import("lit").TemplateResult<1>;
19
+ /**
20
+ * dispatches an event for clients to subscribe to
21
+ * @param eventName
22
+ * @param payload
23
+ */
24
+ private dispatch;
25
+ }
26
+ declare global {
27
+ interface HTMLElementTagNameMap {
28
+ "postcode-search": PostcodeSearch;
29
+ }
30
+ }
@@ -0,0 +1,3 @@
1
+ export { MyMap } from "./components/my-map/index";
2
+ export { AddressAutocomplete } from "./components/address-autocomplete/index";
3
+ export { PostcodeSearch } from "./components/postcode-search/index";