@featherk/composables 0.9.0 → 0.9.1
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.
|
@@ -4,7 +4,7 @@ import type { USAddressFormData } from "./_useUSAddressFormData";
|
|
|
4
4
|
* @param formData - The form data object containing the ZIP code.
|
|
5
5
|
* @returns An object containing ZIP code display, validity, wrapper class, input handler, and reset function.
|
|
6
6
|
*/
|
|
7
|
-
export declare function useUSAddressZip(formData: USAddressFormData): {
|
|
7
|
+
export declare function useUSAddressZip(formData: USAddressFormData, zipInputId?: string): {
|
|
8
8
|
zipDisplay: import("vue").Ref<string, string>;
|
|
9
9
|
isZipValid: import("vue").ComputedRef<boolean>;
|
|
10
10
|
zipWrapperClass: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type MaybeRefOrGetter } from "vue";
|
|
2
2
|
interface UseUSAddressOptions {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
fieldsetRef: MaybeRefOrGetter<HTMLFieldSetElement | null>;
|
|
4
|
+
addressId: string;
|
|
5
5
|
}
|
|
6
6
|
export interface USAddressSubmitPayload {
|
|
7
7
|
address1: string;
|
|
@@ -12,7 +12,7 @@ export interface USAddressSubmitPayload {
|
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
14
|
* Composable for managing a US address form.
|
|
15
|
-
* @param options - The options object containing
|
|
15
|
+
* @param options - The options object containing fieldset reference and address id.
|
|
16
16
|
* @returns An object containing form state, validation state, and handlers.
|
|
17
17
|
*/
|
|
18
18
|
export declare function useUSAddress(options: UseUSAddressOptions): {
|
|
@@ -23,8 +23,8 @@ export declare function useUSAddress(options: UseUSAddressOptions): {
|
|
|
23
23
|
state: string | null;
|
|
24
24
|
zip: string;
|
|
25
25
|
};
|
|
26
|
-
submitted: Ref<boolean, boolean>;
|
|
27
|
-
touched: Ref<boolean, boolean>;
|
|
26
|
+
submitted: import("vue").Ref<boolean, boolean>;
|
|
27
|
+
touched: import("vue").Ref<boolean, boolean>;
|
|
28
28
|
addressValidate: import("vue").ComputedRef<boolean>;
|
|
29
29
|
address1Valid: import("vue").ComputedRef<boolean>;
|
|
30
30
|
cityValid: import("vue").ComputedRef<boolean>;
|
|
@@ -39,7 +39,7 @@ export declare function useUSAddress(options: UseUSAddressOptions): {
|
|
|
39
39
|
label: string;
|
|
40
40
|
value: string;
|
|
41
41
|
}[];
|
|
42
|
-
zipDisplay: Ref<string, string>;
|
|
42
|
+
zipDisplay: import("vue").Ref<string, string>;
|
|
43
43
|
zipWrapperClass: string;
|
|
44
44
|
onAddress1Input: (...args: unknown[]) => void;
|
|
45
45
|
onAddress2Input: (...args: unknown[]) => void;
|
|
@@ -50,7 +50,7 @@ export declare function useUSAddress(options: UseUSAddressOptions): {
|
|
|
50
50
|
onZipInput: (...args: unknown[]) => void;
|
|
51
51
|
onFieldsetFocusout: (event: FocusEvent) => void;
|
|
52
52
|
normalizedPayload: import("vue").ComputedRef<USAddressSubmitPayload>;
|
|
53
|
-
|
|
53
|
+
validateForSubmit: () => Promise<{
|
|
54
54
|
isValid: false;
|
|
55
55
|
payload: any;
|
|
56
56
|
} | {
|