@opensystemslab/map 0.4.6 → 0.4.9

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/package.json CHANGED
@@ -1,31 +1,34 @@
1
1
  {
2
2
  "name": "@opensystemslab/map",
3
- "version": "0.4.6",
3
+ "version": "0.4.9",
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,34 @@
1
+ import { LitElement } from "lit";
2
+ declare type Address = {
3
+ LPI: any;
4
+ };
5
+ export declare class AddressAutocomplete extends LitElement {
6
+ static styles: import("lit").CSSResult;
7
+ id: string;
8
+ postcode: string;
9
+ label: string;
10
+ initialAddress: string;
11
+ osPlacesApiKey: string;
12
+ private _totalAddresses;
13
+ private _addressesInPostcode;
14
+ private _options;
15
+ private _selectedAddress;
16
+ private _osError;
17
+ connectedCallback(): void;
18
+ disconnectedCallback(): void;
19
+ firstUpdated(): void;
20
+ _fetchData(offset?: number, prevResults?: Address[]): Promise<void>;
21
+ render(): import("lit").TemplateResult<1>;
22
+ /**
23
+ * dispatches an event for clients to subscribe to
24
+ * @param eventName
25
+ * @param payload
26
+ */
27
+ private dispatch;
28
+ }
29
+ declare global {
30
+ interface HTMLElementTagNameMap {
31
+ "address-autocomplete": AddressAutocomplete;
32
+ }
33
+ }
34
+ export {};
@@ -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";