@kanda-libs/ks-component-ts 0.2.476 → 0.2.477

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@kanda-libs/ks-component-ts",
3
- "version": "0.2.476",
3
+ "version": "0.2.477",
4
4
  "description": "Kanda form component library",
5
5
  "main": "dist/index.esm.js",
6
6
  "module": "dist/index.esm.js",
@@ -11,7 +11,7 @@ export const validatePostcode = (postcode: string): boolean =>
11
11
  * Format address for proper display on select field
12
12
  */
13
13
  export const formatSelectName = (address: AddressApiResponseAddress) =>
14
- address.formattedAddress.filter(Boolean).join(", ");
14
+ address.formatted_address.filter(Boolean).join(", ");
15
15
 
16
16
  /**
17
17
  * Creates select field options from address api data
@@ -75,11 +75,11 @@ export default function useAddressSelectProps(
75
75
  );
76
76
  setValue(
77
77
  `${prefix}.line_1`,
78
- address?.line1 || address?.formatted_address[0]
78
+ address?.line_1 || address?.formatted_address[0]
79
79
  );
80
80
  setValue(
81
81
  `${prefix}.line_2`,
82
- address?.line2 ||
82
+ address?.line_2 ||
83
83
  address?.formatted_address[1] ||
84
84
  address?.locality ||
85
85
  null
@@ -2,18 +2,21 @@ import { InputHTMLAttributes } from "react";
2
2
  import { DefaultFormFieldProps, FieldInfoWrapperProps } from "~/field/types";
3
3
 
4
4
  export interface AddressApiResponseAddress {
5
- building_number?: string;
6
- sub_building_number?: string;
5
+ formatted_address: string[];
6
+ thoroughfare?: string;
7
7
  building_name?: string;
8
+ building_number?: string;
8
9
  sub_building_name?: string;
10
+ sub_building_number?: string;
9
11
  town_or_city?: string;
10
- line1?: string;
11
- line2?: string;
12
+ line_1?: string;
13
+ line_2?: string;
14
+ line_3?: string;
15
+ line_4?: string;
12
16
  locality?: string;
13
17
  county?: string;
18
+ district?: string;
14
19
  country?: string;
15
- formatted_address: string[];
16
- formattedAddress: string[];
17
20
  }
18
21
 
19
22
  export interface Address {