@cloudparker/moldex.js 4.1.13 → 4.1.15

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.
@@ -1,4 +1,3 @@
1
-
2
1
  <script lang="ts">
3
2
  import EasyScriptLoader from '@cloudparker/easy-script-loader-svelte';
4
3
  import type { Snippet } from 'svelte';
@@ -14,6 +13,21 @@
14
13
 
15
14
  let EasyCountryData: any;
16
15
 
16
+ export async function getCountry({
17
+ isoCode,
18
+ dialCode,
19
+ name
20
+ }: {
21
+ isoCode?: string;
22
+ dialCode?: string;
23
+ name?: string;
24
+ }) {
25
+ if (EasyCountryData) {
26
+ return EasyCountryData.getCountry({ isoCode, dialCode, name });
27
+ }
28
+ return null;
29
+ }
30
+
17
31
  export async function loadCountries() {
18
32
  if (EasyCountryData) {
19
33
  countries = EasyCountryData.getCountries();
@@ -6,6 +6,11 @@ type Props = {
6
6
  children?: Snippet;
7
7
  };
8
8
  declare const CountryLoader: import("svelte").Component<Props, {
9
+ getCountry: ({ isoCode, dialCode, name }: {
10
+ isoCode?: string;
11
+ dialCode?: string;
12
+ name?: string;
13
+ }) => Promise<any>;
9
14
  loadCountries: () => Promise<void>;
10
15
  }, "countries">;
11
16
  type CountryLoader = ReturnType<typeof CountryLoader>;
@@ -19,6 +19,13 @@
19
19
 
20
20
  let EasyCountryStateData: any;
21
21
 
22
+ export async function getState(id:string){
23
+ if(EasyCountryStateData){
24
+ return EasyCountryStateData.getState(id);
25
+ }
26
+ return null;
27
+ }
28
+
22
29
  export async function loadStates(countryCode?: string) {
23
30
  if (EasyCountryStateData) {
24
31
  states = EasyCountryStateData.getStates(countryCode || null);
@@ -11,6 +11,7 @@ type Props = {
11
11
  children?: Snippet;
12
12
  };
13
13
  declare const StateLoader: import("svelte").Component<Props, {
14
+ getState: (id: string) => Promise<any>;
14
15
  loadStates: (countryCode?: string) => Promise<void>;
15
16
  }, "states">;
16
17
  type StateLoader = ReturnType<typeof StateLoader>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudparker/moldex.js",
3
- "version": "4.1.13",
3
+ "version": "4.1.15",
4
4
  "keywords": [
5
5
  "svelte"
6
6
  ],