places-autocomplete-svelte 2.2.7 → 2.2.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/README.md CHANGED
@@ -9,10 +9,10 @@ This component handles API loading, session tokens, fetching suggestions, and re
9
9
 
10
10
 
11
11
 
12
- ## Places (New) Autocomplete JavaScript Integration
12
+ ## Places (New) Autocomplete - JavaScript Library
13
13
 
14
- Simply include a single script tag and handle the response in your JavaScript code.
15
- [View Details](https://pacservice.pages.dev/)
14
+ A flexible and customizable vanilla JavaScript library leveraging the Google Maps Places (New) Autocomplete API. This library provides a user-friendly way to search for and retrieve detailed address information in any web application.
15
+ [View Details](https://github.com/alexpechkarev/places-autocomplete-js)
16
16
 
17
17
 
18
18
  ## Features
@@ -38,8 +38,8 @@ See a live demo of the component in action: [Basic Example](https://places-autoc
38
38
  [Customise request parameters](https://places-autocomplete-demo.pages.dev/examples/customise-request-parameters) - construct a `requestParams` object and control various aspects of the search, including language, region, and more.
39
39
 
40
40
 
41
- <video src="https://github.com/user-attachments/assets/b424b267-da1b-40d8-bf78-abf5d4353081" width="660" height="764" controls autoplay loop muted>
42
- </video>
41
+ <img src="places-autocomplete-svelte.gif" alt="Places (New) Autocomplete Svelte">
42
+
43
43
 
44
44
 
45
45
 
@@ -273,9 +273,17 @@
273
273
  resetKbdClasses();
274
274
  }, 300);
275
275
  }
276
+
277
+ // Handle click outside the input
278
+ // to reset the search input and results
279
+ function handleClickOutside(event: MouseEvent) {
280
+ if (inputRef && !inputRef.contains(event.target as Node)) {
281
+ reset();
282
+ }
283
+ }
276
284
  </script>
277
285
 
278
- <svelte:window onkeydown={onKeyDown} />
286
+ <svelte:window onkeydown={onKeyDown} onclick={handleClickOutside}/>
279
287
 
280
288
  <section class={options.classes?.section}>
281
289
  {#if options?.label ?? ''}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "places-autocomplete-svelte",
3
3
  "license": "MIT",
4
- "version": "2.2.7",
4
+ "version": "2.2.9",
5
5
  "description": "A flexible and customizable Svelte component leveraging the Google Maps Places (New) Autocomplete API to provide a user-friendly way to search for and retrieve detailed address information within your SvelteKit applications.",
6
6
  "keywords": [
7
7
  "svelte",
@@ -72,31 +72,31 @@
72
72
  "svelte": "^5.1.4"
73
73
  },
74
74
  "devDependencies": {
75
- "@sveltejs/adapter-auto": "^6.0.0",
76
- "@sveltejs/adapter-cloudflare": "^7.0.1",
77
- "@sveltejs/kit": "^2.20.7",
75
+ "@sveltejs/adapter-auto": "^6.0.1",
76
+ "@sveltejs/adapter-cloudflare": "^7.0.3",
77
+ "@sveltejs/kit": "^2.21.0",
78
78
  "@sveltejs/package": "^2.3.11",
79
79
  "@sveltejs/vite-plugin-svelte": "^5.0.3",
80
- "@tailwindcss/postcss": "^4.1.4",
80
+ "@tailwindcss/postcss": "^4.1.6",
81
81
  "@tailwindcss/typography": "^0.5.16",
82
- "@tailwindcss/vite": "^4.1.4",
82
+ "@tailwindcss/vite": "^4.1.6",
83
83
  "@types/eslint": "^9.6.1",
84
84
  "autoprefixer": "^10.4.21",
85
- "eslint": "^9.25.0",
86
- "eslint-config-prettier": "^10.1.2",
87
- "eslint-plugin-svelte": "^3.5.1",
88
- "globals": "^16.0.0",
85
+ "eslint": "^9.26.0",
86
+ "eslint-config-prettier": "^10.1.5",
87
+ "eslint-plugin-svelte": "^3.6.0",
88
+ "globals": "^16.1.0",
89
89
  "postcss": "^8.5.3",
90
90
  "prettier": "^3.5.3",
91
91
  "prettier-plugin-svelte": "^3.3.3",
92
92
  "publint": "^0.3.12",
93
- "svelte": "^5.28.1",
94
- "svelte-check": "^4.1.6",
95
- "tailwindcss": "^4.1.4",
93
+ "svelte": "^5.28.6",
94
+ "svelte-check": "^4.1.7",
95
+ "tailwindcss": "^4.1.6",
96
96
  "tslib": "^2.8.1",
97
97
  "typescript": "^5.8.3",
98
- "typescript-eslint": "^8.30.1",
99
- "vite": "^6.3.2"
98
+ "typescript-eslint": "^8.32.1",
99
+ "vite": "^6.3.5"
100
100
  },
101
101
  "svelte": "./dist/index.js",
102
102
  "types": "./dist/PlaceAutocomplete.svelte.d.ts",