svelte-tel-input 0.6.0 → 0.6.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # svelte-tel-input
2
2
 
3
+ ## 0.6.3
4
+
5
+ ### Patch Changes
6
+
7
+ - update dependencies ([#56](https://github.com/gyurielf/svelte-tel-input/pull/56))
8
+
9
+ ## 0.6.2
10
+
11
+ ### Patch Changes
12
+
13
+ - Update readme & update packages ([#54](https://github.com/gyurielf/svelte-tel-input/pull/54))
14
+
15
+ ## 0.6.1
16
+
17
+ ### Patch Changes
18
+
19
+ - Readme update ([#52](https://github.com/gyurielf/svelte-tel-input/pull/52))
20
+
3
21
  ## 0.6.0
4
22
 
5
23
  ### Minor Changes
package/README.md CHANGED
@@ -4,6 +4,8 @@
4
4
 
5
5
  <ins>Do not use it before 1.0, it won't works properly!</ins>
6
6
 
7
+ Lightweight phone input standardization.
8
+
7
9
  ## Installation
8
10
 
9
11
  Svelte Tel Input is distributed via [npm](https://www.npmjs.com/package/svelte-tel-input).
@@ -1,4 +1,4 @@
1
- <script >import { enteredTelInputStore } from '../../stores';
1
+ <script>import { enteredTelInputStore } from '../../stores';
2
2
  import { parsePhoneNumberWithError, ParseError } from 'libphonenumber-js';
3
3
  export let enteredTelInput;
4
4
  const handleInput = (event) => {
@@ -1,4 +1,4 @@
1
- <script >import { clickOutsideAction } from '../../utils/directives/clickOutsideAction';
1
+ <script>import { clickOutsideAction } from '../../utils/directives/clickOutsideAction';
2
2
  export let selectOptions = {
3
3
  searchInput: false,
4
4
  flags: true
@@ -7,35 +7,35 @@ export let items;
7
7
  let isOpen = false;
8
8
  let enteredSearch;
9
9
  const toggleSelect = (e) => {
10
- e === null || e === void 0 ? void 0 : e.preventDefault();
10
+ e?.preventDefault();
11
11
  isOpen = !isOpen;
12
12
  };
13
13
  const closeSelect = (e) => {
14
- e === null || e === void 0 ? void 0 : e.preventDefault();
14
+ e?.preventDefault();
15
15
  isOpen = false;
16
16
  };
17
17
  </script>
18
18
 
19
19
  <div class="select cursor-pointer" use:clickOutsideAction={closeSelect}>
20
- <div on:click={() => toggleSelect()}>CHOOSE</div>
21
- {#if isOpen}
22
- <ul class="border border-gray-900 max-h-40 w-fit overflow-y-scroll">
23
- {#if !selectOptions.searchInput}
24
- <input
25
- type="text"
26
- class="px-4 py-1 text-gray-900 focus:outline-none w-full"
27
- bind:value={enteredSearch}
28
- />
29
- {/if}
30
- {#each items as item}
31
- <li class="p-2 bg-gray-600 hover:bg-opacity-30">
32
- <span class="mr-3">{item.name}</span> +{item.dialCode}
33
- </li>
34
- {:else}
35
- <div>List is on the way..</div>
36
- {/each}
37
- </ul>
38
- {/if}
20
+ <div on:click={() => toggleSelect()}>CHOOSE</div>
21
+ {#if isOpen}
22
+ <ul class="border border-gray-900 max-h-40 w-fit overflow-y-scroll">
23
+ {#if !selectOptions.searchInput}
24
+ <input
25
+ type="text"
26
+ class="px-4 py-1 text-gray-900 focus:outline-none w-full"
27
+ bind:value={enteredSearch}
28
+ />
29
+ {/if}
30
+ {#each items as item}
31
+ <li class="p-2 bg-gray-600 hover:bg-opacity-30">
32
+ <span class="mr-3">{item.name}</span> +{item.dialCode}
33
+ </li>
34
+ {:else}
35
+ <div>List is on the way..</div>
36
+ {/each}
37
+ </ul>
38
+ {/if}
39
39
  </div>
40
40
 
41
- <style ></style>
41
+ <style></style>
@@ -1,4 +1,4 @@
1
- <script >import { createEventDispatcher } from 'svelte';
1
+ <script>import { createEventDispatcher } from 'svelte';
2
2
  const dispatch = createEventDispatcher();
3
3
  const setSelected = (e) => {
4
4
  dispatch('selectedItem');
@@ -6,5 +6,5 @@ const setSelected = (e) => {
6
6
  </script>
7
7
 
8
8
  <li on:click={setSelected}>
9
- <slot />
9
+ <slot />
10
10
  </li>
@@ -1,4 +1,4 @@
1
- <script >import { selectedCountryStore } from '../../../stores';
1
+ <script>import { selectedCountryStore } from '../../../stores';
2
2
  export let selectedCountry;
3
3
  const setSelectedCountry = (value) => {
4
4
  selectedCountry = value;
@@ -47,10 +47,10 @@ const setSelectedCountry = (value) => {
47
47
  </script>
48
48
 
49
49
  <select
50
- name="country_select"
51
- class="some-class {$$props.class}"
52
- on:change={(e) => setSelectedCountry(e.currentTarget.value)}
53
- bind:value={selectedCountry}
50
+ name="country_select"
51
+ class="some-class {$$props.class}"
52
+ on:change={(e) => setSelectedCountry(e.currentTarget.value)}
53
+ bind:value={selectedCountry}
54
54
  >
55
- <slot name="options" />
55
+ <slot name="options" />
56
56
  </select>
@@ -1,12 +1,12 @@
1
- <script >"use strict";
1
+ <script>"use strict";
2
2
  let selectedTelRegion;
3
3
  </script>
4
4
 
5
5
  <select
6
- name="region_select"
7
- class={$$props.class}
8
- bind:value={selectedTelRegion}
9
- on:change={() => console.log(selectedTelRegion)}
6
+ name="region_select"
7
+ class={$$props.class}
8
+ bind:value={selectedTelRegion}
9
+ on:change={() => console.log(selectedTelRegion)}
10
10
  >
11
- <slot name="options" />
11
+ <slot name="options" />
12
12
  </select>
@@ -1,4 +1,4 @@
1
- <script >export let regionOption;
1
+ <script>export let regionOption;
2
2
  </script>
3
3
 
4
4
  <option class={$$props.class} value={regionOption.value}>{regionOption.label}</option>
@@ -1,4 +1,4 @@
1
- <script >import { selectedTelTypeStore } from '../../../stores';
1
+ <script>import { selectedTelTypeStore } from '../../../stores';
2
2
  export let selectedTelType;
3
3
  const setSelectedCountry = (value) => {
4
4
  selectedTelType = value;
@@ -7,9 +7,9 @@ const setSelectedCountry = (value) => {
7
7
  </script>
8
8
 
9
9
  <select
10
- name="type_select"
11
- class={$$props.class}
12
- on:change={(e) => setSelectedCountry(e.currentTarget.value)}
10
+ name="type_select"
11
+ class={$$props.class}
12
+ on:change={(e) => setSelectedCountry(e.currentTarget.value)}
13
13
  >
14
- <slot name="options" />
14
+ <slot name="options" />
15
15
  </select>
@@ -1,4 +1,4 @@
1
- <script >export let typeOption;
1
+ <script>export let typeOption;
2
2
  </script>
3
3
 
4
4
  <option class={$$props.class} value={typeOption.value}>{typeOption.label}</option>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "svelte-tel-input",
3
3
  "description": "svelte-tel-input",
4
- "version": "0.6.0",
4
+ "version": "0.6.3",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/gyurielf/svelte-tel-input.git"
@@ -21,50 +21,50 @@
21
21
  "node": ">= 16"
22
22
  },
23
23
  "dependencies": {
24
- "libphonenumber-js": "^1.9.50"
24
+ "libphonenumber-js": "^1.10.7"
25
25
  },
26
26
  "devDependencies": {
27
- "@babel/core": "^7.17.8",
28
- "@babel/preset-env": "^7.16.11",
29
- "@changesets/cli": "^2.21.1",
30
- "@changesets/get-github-info": "^0.5.0",
31
- "@changesets/types": "^4.1.0",
32
- "@sveltejs/adapter-static": "^1.0.0-next.29",
33
- "@sveltejs/kit": "^1.0.0-next.303",
34
- "@testing-library/jest-dom": "^5.16.3",
35
- "@testing-library/svelte": "^3.1.0",
36
- "@types/jest": "^27.4.1",
37
- "@typescript-eslint/eslint-plugin": "^5.16.0",
38
- "@typescript-eslint/parser": "^5.16.0",
39
- "autoprefixer": "^10.4.4",
40
- "babel-jest": "^27.5.1",
41
- "babel-loader": "^8.2.4",
42
- "cssnano": "^5.1.5",
43
- "dotenv": "^16.0.0",
44
- "eslint": "^8.12.0",
27
+ "@babel/core": "^7.18.6",
28
+ "@babel/preset-env": "^7.18.6",
29
+ "@changesets/cli": "^2.23.1",
30
+ "@changesets/get-github-info": "^0.5.1",
31
+ "@changesets/types": "^5.0.0",
32
+ "@sveltejs/adapter-static": "^1.0.0-next.35",
33
+ "@sveltejs/kit": "^1.0.0-next.367",
34
+ "@testing-library/jest-dom": "^5.16.4",
35
+ "@testing-library/svelte": "^3.1.3",
36
+ "@types/jest": "^28.1.4",
37
+ "@typescript-eslint/eslint-plugin": "^5.30.5",
38
+ "@typescript-eslint/parser": "^5.30.5",
39
+ "autoprefixer": "^10.4.7",
40
+ "babel-jest": "^28.1.2",
41
+ "babel-loader": "^8.2.5",
42
+ "cssnano": "^5.1.12",
43
+ "dotenv": "^16.0.1",
44
+ "eslint": "^8.19.0",
45
45
  "eslint-config-prettier": "^8.5.0",
46
- "eslint-plugin-jest": "^26.1.3",
47
- "eslint-plugin-svelte3": "^3.4.1",
48
- "husky": "^7.0.4",
49
- "jest": "^27.5.1",
46
+ "eslint-plugin-jest": "^26.5.3",
47
+ "eslint-plugin-svelte3": "^4.0.0",
48
+ "husky": "^8.0.1",
49
+ "jest": "^28.1.2",
50
50
  "jest-matchmedia-mock": "^1.1.0",
51
51
  "micromatch": "^4.0.5",
52
- "postcss": "^8.4.12",
53
- "postcss-load-config": "^3.1.3",
54
- "prettier": "^2.6.1",
55
- "prettier-plugin-svelte": "^2.6.0",
56
- "svelte": "^3.46.4",
57
- "svelte-check": "^2.4.6",
58
- "svelte-inview": "^3.0.0",
52
+ "postcss": "^8.4.14",
53
+ "postcss-load-config": "^4.0.1",
54
+ "prettier": "^2.7.1",
55
+ "prettier-plugin-svelte": "^2.7.0",
56
+ "svelte": "^3.49.0",
57
+ "svelte-check": "^2.8.0",
58
+ "svelte-inview": "^3.0.1",
59
59
  "svelte-jester": "^2.3.2",
60
- "svelte-loader": "^3.1.2",
61
- "svelte-preprocess": "^4.10.4",
62
- "svelte2tsx": "^0.5.6",
63
- "tailwindcss": "^3.0.23",
64
- "ts-jest": "^27.1.4",
60
+ "svelte-loader": "^3.1.3",
61
+ "svelte-preprocess": "^4.10.7",
62
+ "svelte2tsx": "^0.5.11",
63
+ "tailwindcss": "^3.1.5",
64
+ "ts-jest": "^28.0.5",
65
65
  "tsconfig-paths-webpack-plugin": "^3.5.2",
66
- "tslib": "^2.3.1",
67
- "typescript": "^4.6.3"
66
+ "tslib": "^2.4.0",
67
+ "typescript": "^4.7.4"
68
68
  },
69
69
  "standard-version": {
70
70
  "skip": {