flowrix 1.0.1-beta.12 → 1.0.1-beta.120

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.
Files changed (267) hide show
  1. package/dist/module.d.mts +1 -6
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +170 -30
  4. package/dist/runtime/composables/Blog/useBlogIndex.d.ts +2 -5
  5. package/dist/runtime/composables/Blog/useBlogSingle.js +2 -4
  6. package/dist/runtime/composables/Brand/brand.js +2 -0
  7. package/dist/runtime/composables/Cart/useCart.d.ts +40 -0
  8. package/dist/runtime/composables/Cart/useCart.js +10 -0
  9. package/dist/runtime/composables/Cart/useCartComponent.d.ts +1 -0
  10. package/dist/runtime/composables/Cart/useCartComponent.js +11 -0
  11. package/dist/runtime/composables/Cart/useCartDetail.d.ts +15 -5
  12. package/dist/runtime/composables/Cart/useCartDetail.js +3 -0
  13. package/dist/runtime/composables/Category/useCategoryIndex.d.ts +25 -32
  14. package/dist/runtime/composables/Category/useCategoryIndex.js +56 -44
  15. package/dist/runtime/composables/Checkout/PaymentMethods/useDirectDeposit.js +8 -0
  16. package/dist/runtime/composables/Checkout/PaymentMethods/useEway.js +16 -6
  17. package/dist/runtime/composables/Checkout/PaymentMethods/useFlowrixpay.d.ts +40 -1
  18. package/dist/runtime/composables/Checkout/PaymentMethods/useFlowrixpay.js +10 -2
  19. package/dist/runtime/composables/Checkout/PaymentMethods/useOpayo.d.ts +40 -1
  20. package/dist/runtime/composables/Checkout/PaymentMethods/useOpayo.js +10 -2
  21. package/dist/runtime/composables/Checkout/PaymentMethods/usePaymentMethods.js +3 -14
  22. package/dist/runtime/composables/Checkout/PaymentMethods/usePaypal.js +8 -0
  23. package/dist/runtime/composables/Checkout/PaymentMethods/useStripe.d.ts +2 -2
  24. package/dist/runtime/composables/Checkout/PaymentMethods/useStripe.js +8 -0
  25. package/dist/runtime/composables/Checkout/PaymentMethods/useZippay.js +8 -0
  26. package/dist/runtime/composables/Checkout/useCheckout.d.ts +85 -73
  27. package/dist/runtime/composables/Checkout/useCheckout.js +84 -53
  28. package/dist/runtime/composables/Checkout/useCheckoutBillingAddress.d.ts +43 -0
  29. package/dist/runtime/composables/Checkout/useCheckoutBillingAddress.js +84 -0
  30. package/dist/runtime/composables/Checkout/useCheckoutShippingAddress.d.ts +55 -0
  31. package/dist/runtime/composables/Checkout/useCheckoutShippingAddress.js +196 -0
  32. package/dist/runtime/composables/Checkout/useCreateAccount.d.ts +7 -7
  33. package/dist/runtime/composables/Checkout/useCreateAccount.js +3 -1
  34. package/dist/runtime/composables/Checkout/useDeliveryMethod.d.ts +2 -2
  35. package/dist/runtime/composables/Checkout/useDeliveryMethod.js +18 -11
  36. package/dist/runtime/composables/Customer/useBillingAddress.d.ts +112 -0
  37. package/dist/runtime/composables/Customer/useBillingAddress.js +93 -0
  38. package/dist/runtime/composables/Customer/useLogin.d.ts +9 -0
  39. package/dist/runtime/composables/Customer/useLogin.js +34 -0
  40. package/dist/runtime/composables/Customer/useOrders.d.ts +29 -0
  41. package/dist/runtime/composables/Customer/useOrders.js +56 -0
  42. package/dist/runtime/composables/Customer/usePasswordReset.d.ts +26 -0
  43. package/dist/runtime/composables/Customer/usePasswordReset.js +258 -0
  44. package/dist/runtime/composables/Customer/useProfile.d.ts +75 -0
  45. package/dist/runtime/composables/Customer/useProfile.js +106 -0
  46. package/dist/runtime/composables/Customer/useQuotations.d.ts +32 -0
  47. package/dist/runtime/composables/Customer/useQuotations.js +40 -0
  48. package/dist/runtime/composables/Customer/useRegister.d.ts +121 -13
  49. package/dist/runtime/composables/Customer/useRegister.js +310 -35
  50. package/dist/runtime/composables/Customer/useShippingAddress.d.ts +121 -0
  51. package/dist/runtime/composables/Customer/useShippingAddress.js +145 -0
  52. package/dist/runtime/composables/Customer/useUpdatePassword.d.ts +21 -0
  53. package/dist/runtime/composables/Customer/useUpdatePassword.js +130 -0
  54. package/dist/runtime/composables/Customer/useUserCards.d.ts +22 -0
  55. package/dist/runtime/composables/Customer/useUserCards.js +65 -0
  56. package/dist/runtime/composables/{useWishlists.d.ts → Customer/useWishlists.d.ts} +6 -19
  57. package/dist/runtime/composables/{useWishlists.js → Customer/useWishlists.js} +21 -29
  58. package/dist/runtime/composables/Extras/useCountry.d.ts +11 -6
  59. package/dist/runtime/composables/Extras/useCountry.js +5 -4
  60. package/dist/runtime/composables/Header/useHeader.d.ts +6 -20
  61. package/dist/runtime/composables/Header/useHeader.js +3 -2
  62. package/dist/runtime/composables/Product/CustomProduct/useCustomeScript.js +4 -5
  63. package/dist/runtime/composables/Product/CustomProduct/useSteps.d.ts +1 -1
  64. package/dist/runtime/composables/Product/useProductComponent.js +110 -0
  65. package/dist/runtime/composables/Product/useProductSlug.d.ts +8 -1
  66. package/dist/runtime/composables/Product/useQuickView.d.ts +8 -0
  67. package/dist/runtime/composables/Product/useQuickView.js +27 -0
  68. package/dist/runtime/composables/Product/useService.d.ts +1 -1
  69. package/dist/runtime/composables/Product/useService.js +0 -3
  70. package/dist/runtime/composables/Samples/useSamples.js +1 -1
  71. package/dist/runtime/composables/SideBar/Filters/useFilters.d.ts +2 -2
  72. package/dist/runtime/composables/SideBar/Filters/useSorting.d.ts +2 -2
  73. package/dist/runtime/composables/index.d.ts +18 -12
  74. package/dist/runtime/composables/index.js +18 -12
  75. package/dist/runtime/composables/useAddresses.js +6 -6
  76. package/dist/runtime/composables/useApp.d.ts +1 -0
  77. package/dist/runtime/composables/useApp.js +85 -0
  78. package/dist/runtime/composables/useCards.js +2 -2
  79. package/dist/runtime/composables/useDataLayer.js +1 -1
  80. package/dist/runtime/composables/useDotDigital.d.ts +3 -0
  81. package/dist/runtime/composables/useDotDigital.js +122 -0
  82. package/dist/runtime/composables/useLocation.d.ts +2 -12
  83. package/dist/runtime/composables/useMetaLayer.js +11 -11
  84. package/dist/runtime/composables/useQuotationCheckout.d.ts +78 -0
  85. package/dist/runtime/composables/useQuotationCheckout.js +137 -0
  86. package/dist/runtime/composables/useSubscriptions.d.ts +17 -10
  87. package/dist/runtime/composables/useSubscriptions.js +68 -33
  88. package/dist/runtime/composables/useTikTokDatalayer.js +7 -7
  89. package/dist/runtime/composables/useWebforms.d.ts +38 -9
  90. package/dist/runtime/composables/useWebforms.js +93 -60
  91. package/dist/runtime/middleware/flowrix.d.ts +5 -4
  92. package/dist/runtime/middleware/flowrix.js +40 -21
  93. package/dist/runtime/pages/404.d.vue.ts +3 -0
  94. package/dist/runtime/pages/404.vue +6 -0
  95. package/dist/runtime/pages/404.vue.d.ts +3 -0
  96. package/dist/runtime/pages/flowrix-default.d.vue.ts +3 -0
  97. package/dist/runtime/pages/flowrix-default.vue +43 -0
  98. package/dist/runtime/pages/flowrix-default.vue.d.ts +3 -0
  99. package/dist/runtime/plugin.d.ts +1 -1
  100. package/dist/runtime/plugins/router.d.ts +2 -0
  101. package/dist/runtime/plugins/router.js +11 -0
  102. package/dist/runtime/server/api/albums.d.ts +1 -0
  103. package/dist/runtime/server/api/albums.js +35 -7
  104. package/dist/runtime/server/api/auth/forgot.js +1 -2
  105. package/dist/runtime/server/api/auth/login.d.ts +7 -0
  106. package/dist/runtime/server/api/auth/login.js +4 -16
  107. package/dist/runtime/server/api/auth/logout.js +1 -2
  108. package/dist/runtime/server/api/auth/register.js +1 -2
  109. package/dist/runtime/server/api/auth/session.get.js +1 -3
  110. package/dist/runtime/server/api/auth/user/reset-password.js +1 -2
  111. package/dist/runtime/server/api/auth/user/session.js +1 -2
  112. package/dist/runtime/server/api/auth/user/verify-token.js +1 -2
  113. package/dist/runtime/server/api/banners.js +20 -15
  114. package/dist/runtime/server/api/brand/[...slug].js +55 -0
  115. package/dist/runtime/server/api/brand/index.d.ts +3 -0
  116. package/dist/runtime/server/api/brand/index.js +46 -0
  117. package/dist/runtime/server/api/cache/[...slug].delete.d.ts +4 -1
  118. package/dist/runtime/server/api/cache/[...slug].delete.js +4 -7
  119. package/dist/runtime/server/api/cache/clean.get.d.ts +5 -0
  120. package/dist/runtime/server/api/cache/clean.get.js +4 -7
  121. package/dist/runtime/server/api/cart/[slug]/add.d.ts +1 -1
  122. package/dist/runtime/server/api/cart/[slug]/add.js +11 -11
  123. package/dist/runtime/server/api/cart/[slug]/update.d.ts +1 -1
  124. package/dist/runtime/server/api/cart/[slug]/update.js +11 -11
  125. package/dist/runtime/server/api/{v2/[...slug].d.ts → cart/related.d.ts} +0 -1
  126. package/dist/runtime/server/api/cart/related.js +21 -0
  127. package/dist/runtime/server/api/cart/remove.d.ts +1 -1
  128. package/dist/runtime/server/api/cart/remove.js +10 -10
  129. package/dist/runtime/server/api/cart/service/[slug]/add.d.ts +1 -1
  130. package/dist/runtime/server/api/cart/service/[slug]/add.js +12 -12
  131. package/dist/runtime/server/api/catalog/brands.d.ts +3 -0
  132. package/dist/runtime/server/api/catalog/brands.js +52 -0
  133. package/dist/runtime/server/api/catalog/categories.js +28 -19
  134. package/dist/runtime/server/api/catalog/categoriesall.d.ts +3 -0
  135. package/dist/runtime/server/api/catalog/categoriesall.js +52 -0
  136. package/dist/runtime/server/api/catalog/featured.js +28 -17
  137. package/dist/runtime/server/api/catalog/posts.d.ts +3 -0
  138. package/dist/runtime/server/api/catalog/posts.js +52 -0
  139. package/dist/runtime/server/api/catalog/samples.js +28 -19
  140. package/dist/runtime/server/api/catalog/search.js +28 -19
  141. package/dist/runtime/server/api/category/[...slug].js +30 -20
  142. package/dist/runtime/server/api/check-404.d.ts +4 -0
  143. package/dist/runtime/server/api/check-404.js +8 -0
  144. package/dist/runtime/server/api/checkout/applyCoupon.d.ts +1 -1
  145. package/dist/runtime/server/api/checkout/applyCoupon.js +13 -13
  146. package/dist/runtime/server/api/checkout/configs.d.ts +1 -1
  147. package/dist/runtime/server/api/checkout/configs.js +11 -11
  148. package/dist/runtime/server/api/checkout/countries.d.ts +1 -1
  149. package/dist/runtime/server/api/checkout/countries.js +5 -9
  150. package/dist/runtime/server/api/checkout/paymentmethod.d.ts +1 -1
  151. package/dist/runtime/server/api/checkout/paymentmethod.js +16 -11
  152. package/dist/runtime/server/api/{blog/blog.d.ts → checkout/quotation/[slug].d.ts} +0 -1
  153. package/dist/runtime/server/api/checkout/quotation/[slug].js +20 -0
  154. package/dist/runtime/server/api/checkout/quotation/guest/[slug].d.ts +2 -0
  155. package/dist/runtime/server/api/checkout/quotation/guest/[slug].js +35 -0
  156. package/dist/runtime/server/api/checkout/quotation/guest/customer.d.ts +2 -0
  157. package/dist/runtime/server/api/checkout/quotation/guest/customer.js +20 -0
  158. package/dist/runtime/server/api/checkout/quotation/submit/[slug].d.ts +2 -0
  159. package/dist/runtime/server/api/checkout/quotation/submit/[slug].js +22 -0
  160. package/dist/runtime/server/api/checkvariables.d.ts +3 -0
  161. package/dist/runtime/server/api/checkvariables.js +35 -0
  162. package/dist/runtime/server/api/cmspost/[...slug].js +54 -0
  163. package/dist/runtime/server/api/cmspost/all.d.ts +3 -0
  164. package/dist/runtime/server/api/cmspost/all.js +52 -0
  165. package/dist/runtime/server/api/company/profile.d.ts +1 -1
  166. package/dist/runtime/server/api/company/profile.js +12 -7
  167. package/dist/runtime/server/api/contact-center/webforms/[id]/details.d.ts +1 -1
  168. package/dist/runtime/server/api/contact-center/webforms/[id]/details.js +50 -15
  169. package/dist/runtime/server/api/contact-center/webforms/create.d.ts +1 -1
  170. package/dist/runtime/server/api/contact-center/webforms/create.js +13 -9
  171. package/dist/runtime/server/api/countries.d.ts +2 -0
  172. package/dist/runtime/server/api/countries.js +44 -0
  173. package/dist/runtime/server/api/customer/address/add.js +1 -2
  174. package/dist/runtime/server/api/customer/address/delete.js +2 -3
  175. package/dist/runtime/server/api/customer/address/setshipping.js +1 -2
  176. package/dist/runtime/server/api/customer/address/update.js +1 -2
  177. package/dist/runtime/server/api/customer/cards/delete.js +2 -3
  178. package/dist/runtime/server/api/customer/cards/get.js +2 -3
  179. package/dist/runtime/server/api/customer/change-password.js +2 -3
  180. package/dist/runtime/server/api/customer/checkout.js +1 -2
  181. package/dist/runtime/server/api/customer/orders.js +2 -3
  182. package/dist/runtime/server/api/customer/profile/update.js +1 -2
  183. package/dist/runtime/server/api/customer/quotations.js +2 -3
  184. package/dist/runtime/server/api/customer/search.js +1 -2
  185. package/dist/runtime/server/api/customer/tax-invoice.js +1 -2
  186. package/dist/runtime/server/api/customer/wishlist/add.js +1 -2
  187. package/dist/runtime/server/api/customer/wishlist/createWishList.js +1 -2
  188. package/dist/runtime/server/api/customer/wishlist/deleteFromWishList.js +1 -2
  189. package/dist/runtime/server/api/customer/wishlist/deleteWishList.js +1 -2
  190. package/dist/runtime/server/api/customer/wishlist/get.js +2 -3
  191. package/dist/runtime/server/api/customer/wishlist/getWishListItems.js +1 -2
  192. package/dist/runtime/server/api/customer/wishlist/updateWishList.js +2 -3
  193. package/dist/runtime/server/api/featured.d.ts +3 -0
  194. package/dist/runtime/server/api/featured.js +52 -0
  195. package/dist/runtime/server/api/generate/robots.get.d.ts +2 -0
  196. package/dist/runtime/server/api/generate/robots.get.js +20 -0
  197. package/dist/runtime/server/api/generate/sitemap.get.d.ts +2 -0
  198. package/dist/runtime/server/api/generate/sitemap.get.js +32 -0
  199. package/dist/runtime/server/api/location.d.ts +1 -1
  200. package/dist/runtime/server/api/location.js +24 -12
  201. package/dist/runtime/server/api/nav/[id]/links.d.ts +1 -0
  202. package/dist/runtime/server/api/nav/[id]/links.js +46 -10
  203. package/dist/runtime/server/api/page/[...slug].js +54 -0
  204. package/dist/runtime/server/api/product/[...slug].js +28 -13
  205. package/dist/runtime/server/api/quickview/[slug].d.ts +2 -0
  206. package/dist/runtime/server/api/quickview/[slug].js +21 -0
  207. package/dist/runtime/server/api/reviews.d.ts +2 -0
  208. package/dist/runtime/server/api/reviews.js +23 -0
  209. package/dist/runtime/server/api/samples.d.ts +3 -0
  210. package/dist/runtime/server/api/samples.js +53 -0
  211. package/dist/runtime/server/api/search.d.ts +3 -0
  212. package/dist/runtime/server/api/search.js +53 -0
  213. package/dist/runtime/server/api/service/[slug].js +22 -16
  214. package/dist/runtime/server/api/service/availability.d.ts +1 -1
  215. package/dist/runtime/server/api/service/availability.js +14 -12
  216. package/dist/runtime/server/api/service/getall.d.ts +3 -0
  217. package/dist/runtime/server/api/service/getall.js +57 -0
  218. package/dist/runtime/server/api/shop.d.ts +3 -0
  219. package/dist/runtime/server/api/shop.js +53 -0
  220. package/dist/runtime/server/api/subscribe.d.ts +1 -1
  221. package/dist/runtime/server/api/subscribe.js +23 -14
  222. package/dist/runtime/server/api/v2/[...slug].get.d.ts +2 -0
  223. package/dist/runtime/server/api/v2/[...slug].get.js +32 -0
  224. package/dist/runtime/server/api/webform.d.ts +3 -0
  225. package/dist/runtime/server/api/webform.js +54 -0
  226. package/dist/runtime/server/tsconfig.json +3 -3
  227. package/dist/runtime/stores/Cart.d.ts +12 -0
  228. package/dist/runtime/stores/Cart.js +62 -17
  229. package/dist/runtime/stores/Checkout.d.ts +9 -15
  230. package/dist/runtime/stores/Checkout.js +24 -40
  231. package/dist/runtime/stores/Search.d.ts +1 -1
  232. package/dist/runtime/stores/Services.js +2 -2
  233. package/dist/runtime/stores/auth.d.ts +8 -11
  234. package/dist/runtime/stores/auth.js +385 -8
  235. package/dist/runtime/stores/countries.d.ts +1 -3
  236. package/dist/runtime/stores/countries.js +4 -8
  237. package/dist/runtime/stores/product/README.md +6 -6
  238. package/dist/runtime/stores/product/slug.d.ts +1 -17
  239. package/dist/runtime/stores/webforms.d.ts +24 -9
  240. package/dist/runtime/stores/webforms.js +105 -5
  241. package/dist/runtime/stores/wishlists.d.ts +114 -7
  242. package/dist/runtime/stores/wishlists.js +209 -15
  243. package/dist/runtime/utils/api.js +7 -13
  244. package/dist/runtime/utils/htmlCache.d.ts +2 -2
  245. package/dist/runtime/utils/htmlCache.js +23 -13
  246. package/dist/types.d.mts +6 -2
  247. package/package.json +15 -5
  248. package/dist/runtime/composables/Checkout/useBillingAddress.d.ts +0 -19
  249. package/dist/runtime/composables/Checkout/useBillingAddress.js +0 -82
  250. package/dist/runtime/composables/Checkout/useShippingAddress.d.ts +0 -9
  251. package/dist/runtime/composables/Checkout/useShippingAddress.js +0 -121
  252. package/dist/runtime/composables/useAuth.d.ts +0 -45
  253. package/dist/runtime/composables/useAuth.js +0 -180
  254. package/dist/runtime/composables/useCountries.d.ts +0 -12
  255. package/dist/runtime/composables/useCountries.js +0 -50
  256. package/dist/runtime/composables/useOrders.d.ts +0 -21
  257. package/dist/runtime/composables/useOrders.js +0 -82
  258. package/dist/runtime/composables/useQuotations.d.ts +0 -14
  259. package/dist/runtime/composables/useQuotations.js +0 -50
  260. package/dist/runtime/server/api/blog/[slug].js +0 -51
  261. package/dist/runtime/server/api/blog/blog.js +0 -17
  262. package/dist/runtime/server/api/brand/[slug].js +0 -58
  263. package/dist/runtime/server/api/page/[slug].js +0 -51
  264. package/dist/runtime/server/api/v2/[...slug].js +0 -9
  265. /package/dist/runtime/server/api/brand/{[slug].d.ts → [...slug].d.ts} +0 -0
  266. /package/dist/runtime/server/api/{blog/[slug].d.ts → cmspost/[...slug].d.ts} +0 -0
  267. /package/dist/runtime/server/api/page/{[slug].d.ts → [...slug].d.ts} +0 -0
@@ -0,0 +1,75 @@
1
+ export declare function useProfile(): {
2
+ profile: import("vue").Ref<{
3
+ firstName: string;
4
+ lastName: string;
5
+ email: string;
6
+ phone: string;
7
+ mobile: string;
8
+ dateOfBirth: string;
9
+ }, {
10
+ firstName: string;
11
+ lastName: string;
12
+ email: string;
13
+ phone: string;
14
+ mobile: string;
15
+ dateOfBirth: string;
16
+ } | {
17
+ firstName: string;
18
+ lastName: string;
19
+ email: string;
20
+ phone: string;
21
+ mobile: string;
22
+ dateOfBirth: string;
23
+ }>;
24
+ isEditing: import("vue").Ref<boolean, boolean>;
25
+ loading: import("vue").Ref<boolean, boolean>;
26
+ errorMessage: import("vue").Ref<string, string>;
27
+ successMessage: import("vue").Ref<string, string>;
28
+ dobFormatted: import("vue").WritableComputedRef<string, string>;
29
+ user: import("vue").ComputedRef<{
30
+ id: number;
31
+ fullname: string;
32
+ firstname: string;
33
+ lastname: string;
34
+ email: string;
35
+ avatar: string;
36
+ country_id: number | null;
37
+ country: {
38
+ id: number;
39
+ name: string;
40
+ emoji: string;
41
+ } | null;
42
+ state_id: number | null;
43
+ state: string | null;
44
+ suburb: string | null;
45
+ dob: string | null;
46
+ phone: string | null;
47
+ address: string | null;
48
+ mobile: string | null;
49
+ company: string | null;
50
+ addresses: {
51
+ id: number;
52
+ fullname: string | null;
53
+ firstname: string;
54
+ middlename: string | null;
55
+ lastname: string;
56
+ address: string;
57
+ suburb: string;
58
+ state: string | null;
59
+ state_id: number | null;
60
+ country: string;
61
+ country_id: number;
62
+ postcode: string;
63
+ mobile: string;
64
+ shipping: number;
65
+ billing: number;
66
+ }[];
67
+ created_at: string;
68
+ } | null>;
69
+ formatDisplayDate: (dateString: string) => string;
70
+ clearMessages: () => void;
71
+ cancelEdit: () => void;
72
+ updateCustomerProfile: () => Promise<void>;
73
+ initializeProfile: () => void;
74
+ resetProfile: () => void;
75
+ };
@@ -0,0 +1,106 @@
1
+ import { ref, computed } from "vue";
2
+ import { useAuthStore } from "../../stores/auth.js";
3
+ export function useProfile() {
4
+ const authStore = useAuthStore();
5
+ const user = computed(() => authStore.user);
6
+ const profile = ref({
7
+ firstName: user.value?.firstname || "",
8
+ lastName: user.value?.lastname || "",
9
+ email: user.value?.email || "",
10
+ phone: user.value?.phone || "",
11
+ mobile: user.value?.mobile || "",
12
+ dateOfBirth: user.value?.dob || ""
13
+ });
14
+ const isEditing = ref(false);
15
+ const loading = ref(false);
16
+ const errorMessage = ref("");
17
+ const successMessage = ref("");
18
+ const formatDisplayDate = (dateString) => {
19
+ if (!dateString) return "";
20
+ const date = new Date(dateString);
21
+ if (isNaN(date.getTime())) return dateString;
22
+ const months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
23
+ const day = date.getDate();
24
+ const month = months[date.getMonth()];
25
+ const year = date.getFullYear();
26
+ return `${month} ${day}, ${year}`;
27
+ };
28
+ const dobFormatted = computed({
29
+ get() {
30
+ return profile.value.dateOfBirth ? new Date(profile.value.dateOfBirth).toISOString().split("T")[0] : "";
31
+ },
32
+ set(value) {
33
+ profile.value.dateOfBirth = value;
34
+ }
35
+ });
36
+ const clearMessages = () => {
37
+ errorMessage.value = "";
38
+ successMessage.value = "";
39
+ };
40
+ const resetProfile = () => {
41
+ profile.value = {
42
+ firstName: user.value?.firstname || "",
43
+ lastName: user.value?.lastname || "",
44
+ email: user.value?.email || "",
45
+ phone: user.value?.phone || "",
46
+ mobile: user.value?.mobile || "",
47
+ dateOfBirth: user.value?.dob || ""
48
+ };
49
+ };
50
+ const cancelEdit = () => {
51
+ isEditing.value = false;
52
+ resetProfile();
53
+ clearMessages();
54
+ };
55
+ const updateCustomerProfile = async () => {
56
+ if (!profile.value.firstName?.trim() || !profile.value.lastName?.trim() || !profile.value.mobile?.trim()) {
57
+ errorMessage.value = "First name, Last name and Mobile are required!";
58
+ return;
59
+ }
60
+ loading.value = true;
61
+ errorMessage.value = "";
62
+ successMessage.value = "";
63
+ try {
64
+ const requestBody = {
65
+ firstname: profile.value.firstName.trim(),
66
+ lastname: profile.value.lastName.trim(),
67
+ phone: profile.value.phone?.trim() || "",
68
+ mobile: profile.value.mobile?.trim() || "",
69
+ dob: profile.value.dateOfBirth || ""
70
+ };
71
+ const response = await authStore.updateProfile(requestBody);
72
+ if (response.status === "Success") {
73
+ successMessage.value = response.message || "Profile updated successfully!";
74
+ isEditing.value = false;
75
+ } else {
76
+ errorMessage.value = response.message || "Failed to update profile. Please try again.";
77
+ }
78
+ } catch (err) {
79
+ console.error("Update error:", err);
80
+ errorMessage.value = err.message || "Failed to update profile. Please try again.";
81
+ } finally {
82
+ loading.value = false;
83
+ }
84
+ };
85
+ const initializeProfile = () => {
86
+ resetProfile();
87
+ };
88
+ return {
89
+ // State
90
+ profile,
91
+ isEditing,
92
+ loading,
93
+ errorMessage,
94
+ successMessage,
95
+ // Computed
96
+ dobFormatted,
97
+ user,
98
+ // Methods
99
+ formatDisplayDate,
100
+ clearMessages,
101
+ cancelEdit,
102
+ updateCustomerProfile,
103
+ initializeProfile,
104
+ resetProfile
105
+ };
106
+ }
@@ -0,0 +1,32 @@
1
+ export interface Quotation {
2
+ quotation_no: string;
3
+ createddate: string;
4
+ quotestatus: string;
5
+ total: number;
6
+ expired?: boolean;
7
+ converted?: boolean;
8
+ [key: string]: any;
9
+ }
10
+ export declare function useQuotations(): {
11
+ quotations: import("vue").Ref<{
12
+ [x: string]: any;
13
+ quotation_no: string;
14
+ createddate: string;
15
+ quotestatus: string;
16
+ total: number;
17
+ expired?: boolean | undefined;
18
+ converted?: boolean | undefined;
19
+ }[], Quotation[] | {
20
+ [x: string]: any;
21
+ quotation_no: string;
22
+ createddate: string;
23
+ quotestatus: string;
24
+ total: number;
25
+ expired?: boolean | undefined;
26
+ converted?: boolean | undefined;
27
+ }[]>;
28
+ pending: import("vue").Ref<boolean, boolean>;
29
+ loadQuotations: () => Promise<void>;
30
+ hasQuotations: () => boolean;
31
+ getQuotationStatus: (quotation: Quotation) => string;
32
+ };
@@ -0,0 +1,40 @@
1
+ import { ref } from "vue";
2
+ import { useAuthStore } from "../../stores/auth.js";
3
+ export function useQuotations() {
4
+ const authStore = useAuthStore();
5
+ const quotations = ref([]);
6
+ const pending = ref(true);
7
+ const loadQuotations = async () => {
8
+ pending.value = true;
9
+ try {
10
+ const quotationsData = await authStore.fetchQuotations();
11
+ quotations.value = Array.isArray(quotationsData) ? quotationsData : [];
12
+ } catch (error) {
13
+ console.error("Failed to load quotations:", error);
14
+ quotations.value = [];
15
+ } finally {
16
+ pending.value = false;
17
+ }
18
+ };
19
+ const hasQuotations = () => {
20
+ return quotations.value && quotations.value.length > 0;
21
+ };
22
+ const getQuotationStatus = (quotation) => {
23
+ if (quotation.expired) {
24
+ return "Expired";
25
+ } else if (quotation.converted) {
26
+ return "Purchased";
27
+ } else {
28
+ return "Available";
29
+ }
30
+ };
31
+ return {
32
+ // State
33
+ quotations,
34
+ pending,
35
+ // Methods
36
+ loadQuotations,
37
+ hasQuotations,
38
+ getQuotationStatus
39
+ };
40
+ }
@@ -1,18 +1,126 @@
1
- export default function (): {
2
- router: import("vue-router").Router;
3
- route: import("vue-router").RouteLocationNormalizedLoadedGeneric;
4
- form_error: import("vue").Ref<string, string>;
1
+ export default function (countries: any): {
2
+ router: any;
3
+ route: any;
5
4
  inputData: import("vue").Ref<{
6
- passwordStrengthValue: number;
5
+ abn: string;
6
+ addresses: never[];
7
+ address: string;
8
+ postCode: string;
9
+ suburb: string;
10
+ billing_address: string;
11
+ businessAddress: string;
12
+ billing_country: string;
13
+ billing_firstname: string;
14
+ billing_lastname: string;
15
+ billing_mobile: string;
16
+ billing_postcode: string;
17
+ billing_state: string;
18
+ billing_suburb: string;
19
+ company_name: string;
20
+ email: string;
21
+ email_confirmation: string;
22
+ firstname: string;
23
+ lastname: string;
24
+ mobile: string;
25
+ newsletterSignup: boolean;
26
+ password: string;
27
+ password_confirmation: string;
28
+ recaptcha: string;
29
+ shipping_address: string;
30
+ shipping_country: string;
31
+ shipping_postcode: string;
32
+ shipping_state: string;
33
+ shipping_suburb: string;
34
+ shipping_town: string;
35
+ shipping_mobile: string;
36
+ subscribe: boolean;
7
37
  }, {
8
- passwordStrengthValue: number;
38
+ abn: string;
39
+ addresses: never[];
40
+ address: string;
41
+ postCode: string;
42
+ suburb: string;
43
+ billing_address: string;
44
+ businessAddress: string;
45
+ billing_country: string;
46
+ billing_firstname: string;
47
+ billing_lastname: string;
48
+ billing_mobile: string;
49
+ billing_postcode: string;
50
+ billing_state: string;
51
+ billing_suburb: string;
52
+ company_name: string;
53
+ email: string;
54
+ email_confirmation: string;
55
+ firstname: string;
56
+ lastname: string;
57
+ mobile: string;
58
+ newsletterSignup: boolean;
59
+ password: string;
60
+ password_confirmation: string;
61
+ recaptcha: string;
62
+ shipping_address: string;
63
+ shipping_country: string;
64
+ shipping_postcode: string;
65
+ shipping_state: string;
66
+ shipping_suburb: string;
67
+ shipping_town: string;
68
+ shipping_mobile: string;
69
+ subscribe: boolean;
9
70
  } | {
10
- passwordStrengthValue: number;
71
+ abn: string;
72
+ addresses: never[];
73
+ address: string;
74
+ postCode: string;
75
+ suburb: string;
76
+ billing_address: string;
77
+ businessAddress: string;
78
+ billing_country: string;
79
+ billing_firstname: string;
80
+ billing_lastname: string;
81
+ billing_mobile: string;
82
+ billing_postcode: string;
83
+ billing_state: string;
84
+ billing_suburb: string;
85
+ company_name: string;
86
+ email: string;
87
+ email_confirmation: string;
88
+ firstname: string;
89
+ lastname: string;
90
+ mobile: string;
91
+ newsletterSignup: boolean;
92
+ password: string;
93
+ password_confirmation: string;
94
+ recaptcha: string;
95
+ shipping_address: string;
96
+ shipping_country: string;
97
+ shipping_postcode: string;
98
+ shipping_state: string;
99
+ shipping_suburb: string;
100
+ shipping_town: string;
101
+ shipping_mobile: string;
102
+ subscribe: boolean;
11
103
  }>;
12
- passwordStrength: any;
13
- passwordStrengthClass: any;
14
- passwordStrengthTextColor: any;
15
- passwordStrengthWidth: any;
16
- errorMessage: any;
17
- signupFunction: () => Promise<void>;
104
+ regResponse: import("vue").Ref<null, null>;
105
+ isBusinessAccount: import("vue").Ref<boolean, boolean>;
106
+ companyName: import("vue").Ref<string, string>;
107
+ abn: import("vue").Ref<string, string>;
108
+ address: import("vue").Ref<string, string>;
109
+ sameAsCustomerDetails: import("vue").Ref<boolean, boolean>;
110
+ showPassword: import("vue").Ref<boolean, boolean>;
111
+ showConfirmPassword: import("vue").Ref<boolean, boolean>;
112
+ isLoading: import("vue").Ref<boolean, boolean>;
113
+ getStates: (countryId: any) => any;
114
+ validateForm: () => true | "First Name is required" | "Last Name is required" | "Address is required" | "Country is required" | "State is required" | "Post Code is required" | "Suburb is required" | "Please enter a valid email address" | "Email addresses do not match" | "Password must be at least 6 characters" | "Passwords do not match" | "Mobile Number is required" | "Company Name is required" | "ABN is required" | "Business Address is required" | "Shipping Address is required" | "Shipping country is required." | "Shipping Town is required" | "Shipping State is required" | "Shipping Post Code is required" | "Shipping Mobile is required";
115
+ togglePassword: () => void;
116
+ toggleConfirmPassword: () => void;
117
+ handleSameAsCustomerDetails: () => void;
118
+ alertMessage: import("vue").Ref<string, string>;
119
+ alertType: import("vue").Ref<string, string>;
120
+ showAlert: import("vue").Ref<boolean, boolean>;
121
+ displayAlert: (message: any, type: any) => void;
122
+ dismissAlert: () => void;
123
+ handleSignup: () => Promise<void>;
124
+ initializeShippingData: () => void;
125
+ resetForm: () => void;
18
126
  };