@opensystemslab/map 0.4.6 → 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,31 +1,34 @@
1
1
  {
2
2
  "name": "@opensystemslab/map",
3
- "version": "0.4.6",
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
18
  "scripts": {
19
19
  "dev": "vite",
20
- "build": "tsc && vite build && sed 's/src=\".*\"/src=\"map.es.js\"/' index.html > dist/index.html",
21
- "prepublishOnly": "rm -rf dist types && npm run build",
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
22
  "prepare": "husky install"
23
23
  },
24
24
  "dependencies": {
25
25
  "@turf/union": "^6.5.0",
26
+ "accessible-autocomplete": "^2.0.4",
27
+ "govuk-frontend": "^3.14.0",
26
28
  "lit": "^2.0.0-rc.2",
27
29
  "ol": "^6.9.0",
28
- "ol-mapbox-style": "^6.4.1",
30
+ "ol-mapbox-style": "^7.1.1",
31
+ "postcode": "^5.1.0",
29
32
  "rambda": "^7.0.1"
30
33
  },
31
34
  "devDependencies": {
@@ -33,6 +36,8 @@
33
36
  "husky": "^7.0.1",
34
37
  "lint-staged": "^12.0.3",
35
38
  "prettier": "^2.3.2",
39
+ "rollup-plugin-postcss-lit": "^2.0.0",
40
+ "sass": "^1.44.0",
36
41
  "typescript": "^4.3.5",
37
42
  "vite": "^2.4.4"
38
43
  },
@@ -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,7 @@ 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
7
  id: string;
8
8
  latitude: number;
9
9
  longitude: number;
@@ -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";