flowrix 1.0.0
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/LICENSE +18 -0
- package/README.md +84 -0
- package/dist/module.d.mts +8 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +273 -0
- package/dist/runtime/composables/Blog/useBlogIndex.d.ts +111 -0
- package/dist/runtime/composables/Blog/useBlogIndex.js +86 -0
- package/dist/runtime/composables/Blog/useBlogMain.d.ts +13 -0
- package/dist/runtime/composables/Blog/useBlogMain.js +7 -0
- package/dist/runtime/composables/Blog/useBlogSidebar.d.ts +7 -0
- package/dist/runtime/composables/Blog/useBlogSidebar.js +37 -0
- package/dist/runtime/composables/Blog/useBlogSingle.d.ts +30 -0
- package/dist/runtime/composables/Blog/useBlogSingle.js +87 -0
- package/dist/runtime/composables/Blog/useMagazineCard.d.ts +13 -0
- package/dist/runtime/composables/Blog/useMagazineCard.js +14 -0
- package/dist/runtime/composables/Blog/useSingleBlogMain.d.ts +20 -0
- package/dist/runtime/composables/Blog/useSingleBlogMain.js +28 -0
- package/dist/runtime/composables/Brand/brand.d.ts +7 -0
- package/dist/runtime/composables/Brand/brand.js +45 -0
- package/dist/runtime/composables/Cart/useCartDetail.d.ts +49 -0
- package/dist/runtime/composables/Cart/useCartDetail.js +48 -0
- package/dist/runtime/composables/Category/useCategoryContent.d.ts +9 -0
- package/dist/runtime/composables/Category/useCategoryContent.js +15 -0
- package/dist/runtime/composables/Category/useCategoryGrid.d.ts +40 -0
- package/dist/runtime/composables/Category/useCategoryGrid.js +38 -0
- package/dist/runtime/composables/Category/useCategoryIndex.d.ts +33 -0
- package/dist/runtime/composables/Category/useCategoryIndex.js +65 -0
- package/dist/runtime/composables/Category/useCategoryTemplate2.d.ts +50 -0
- package/dist/runtime/composables/Category/useCategoryTemplate2.js +43 -0
- package/dist/runtime/composables/Category/useCategoryTemplate3.d.ts +66 -0
- package/dist/runtime/composables/Category/useCategoryTemplate3.js +45 -0
- package/dist/runtime/composables/Category/useCategoryTop.d.ts +18 -0
- package/dist/runtime/composables/Category/useCategoryTop.js +65 -0
- package/dist/runtime/composables/Checkout/PaymentMethods/useDirectDeposit.d.ts +3 -0
- package/dist/runtime/composables/Checkout/PaymentMethods/useDirectDeposit.js +22 -0
- package/dist/runtime/composables/Checkout/PaymentMethods/useEway.d.ts +8 -0
- package/dist/runtime/composables/Checkout/PaymentMethods/useEway.js +88 -0
- package/dist/runtime/composables/Checkout/PaymentMethods/useFlowrixpay.d.ts +13 -0
- package/dist/runtime/composables/Checkout/PaymentMethods/useFlowrixpay.js +155 -0
- package/dist/runtime/composables/Checkout/PaymentMethods/useOpayo.d.ts +9 -0
- package/dist/runtime/composables/Checkout/PaymentMethods/useOpayo.js +90 -0
- package/dist/runtime/composables/Checkout/PaymentMethods/usePaymentMethods.d.ts +15 -0
- package/dist/runtime/composables/Checkout/PaymentMethods/usePaymentMethods.js +146 -0
- package/dist/runtime/composables/Checkout/PaymentMethods/usePaypal.d.ts +3 -0
- package/dist/runtime/composables/Checkout/PaymentMethods/usePaypal.js +22 -0
- package/dist/runtime/composables/Checkout/PaymentMethods/useStripe.d.ts +7 -0
- package/dist/runtime/composables/Checkout/PaymentMethods/useStripe.js +43 -0
- package/dist/runtime/composables/Checkout/PaymentMethods/useZippay.d.ts +3 -0
- package/dist/runtime/composables/Checkout/PaymentMethods/useZippay.js +22 -0
- package/dist/runtime/composables/Checkout/useBillingAddress.d.ts +19 -0
- package/dist/runtime/composables/Checkout/useBillingAddress.js +82 -0
- package/dist/runtime/composables/Checkout/useCheckout.d.ts +186 -0
- package/dist/runtime/composables/Checkout/useCheckout.js +366 -0
- package/dist/runtime/composables/Checkout/useCreateAccount.d.ts +15 -0
- package/dist/runtime/composables/Checkout/useCreateAccount.js +61 -0
- package/dist/runtime/composables/Checkout/useDeliveryMethod.d.ts +4 -0
- package/dist/runtime/composables/Checkout/useDeliveryMethod.js +36 -0
- package/dist/runtime/composables/Checkout/useShippingAddress.d.ts +9 -0
- package/dist/runtime/composables/Checkout/useShippingAddress.js +121 -0
- package/dist/runtime/composables/Customer/useRegister.d.ts +18 -0
- package/dist/runtime/composables/Customer/useRegister.js +48 -0
- package/dist/runtime/composables/Extras/useCountry.d.ts +6 -0
- package/dist/runtime/composables/Extras/useCountry.js +11 -0
- package/dist/runtime/composables/Extras/useDateFormatter.d.ts +4 -0
- package/dist/runtime/composables/Extras/useDateFormatter.js +20 -0
- package/dist/runtime/composables/Extras/useNumberOnly.d.ts +5 -0
- package/dist/runtime/composables/Extras/useNumberOnly.js +21 -0
- package/dist/runtime/composables/Extras/usePasswordFormatter.d.ts +8 -0
- package/dist/runtime/composables/Extras/usePasswordFormatter.js +61 -0
- package/dist/runtime/composables/Extras/useSrcSets.d.ts +8 -0
- package/dist/runtime/composables/Extras/useSrcSets.js +26 -0
- package/dist/runtime/composables/Extras/useTogglePassword.d.ts +4 -0
- package/dist/runtime/composables/Extras/useTogglePassword.js +11 -0
- package/dist/runtime/composables/Footer/useFooter.d.ts +14 -0
- package/dist/runtime/composables/Footer/useFooter.js +61 -0
- package/dist/runtime/composables/Header/useHeader.d.ts +28 -0
- package/dist/runtime/composables/Header/useHeader.js +66 -0
- package/dist/runtime/composables/Menu/MainMenu.d.ts +4 -0
- package/dist/runtime/composables/Menu/MainMenu.js +17 -0
- package/dist/runtime/composables/Product/CustomProduct/useAttributeType.d.ts +3 -0
- package/dist/runtime/composables/Product/CustomProduct/useAttributeType.js +20 -0
- package/dist/runtime/composables/Product/CustomProduct/useAttributes.d.ts +70 -0
- package/dist/runtime/composables/Product/CustomProduct/useAttributes.js +68 -0
- package/dist/runtime/composables/Product/CustomProduct/useCustomProduct.d.ts +74 -0
- package/dist/runtime/composables/Product/CustomProduct/useCustomProduct.js +107 -0
- package/dist/runtime/composables/Product/CustomProduct/useCustomeScript.d.ts +159 -0
- package/dist/runtime/composables/Product/CustomProduct/useCustomeScript.js +2080 -0
- package/dist/runtime/composables/Product/CustomProduct/useSingleAttribute.d.ts +4 -0
- package/dist/runtime/composables/Product/CustomProduct/useSingleAttribute.js +27 -0
- package/dist/runtime/composables/Product/CustomProduct/useSingleStep.d.ts +68 -0
- package/dist/runtime/composables/Product/CustomProduct/useSingleStep.js +21 -0
- package/dist/runtime/composables/Product/CustomProduct/useSingleValue.d.ts +67 -0
- package/dist/runtime/composables/Product/CustomProduct/useSingleValue.js +15 -0
- package/dist/runtime/composables/Product/CustomProduct/useSteps.d.ts +74 -0
- package/dist/runtime/composables/Product/CustomProduct/useSteps.js +78 -0
- package/dist/runtime/composables/Product/simpleProduct/useSimpleProduct.d.ts +25 -0
- package/dist/runtime/composables/Product/simpleProduct/useSimpleProduct.js +77 -0
- package/dist/runtime/composables/Product/useProductCard.d.ts +13 -0
- package/dist/runtime/composables/Product/useProductCard.js +88 -0
- package/dist/runtime/composables/Product/useProductComponent.d.ts +5 -0
- package/dist/runtime/composables/Product/useProductComponent.js +21 -0
- package/dist/runtime/composables/Product/useProductSlug.d.ts +1 -0
- package/dist/runtime/composables/Product/useProductSlug.js +25 -0
- package/dist/runtime/composables/Product/useService.d.ts +17 -0
- package/dist/runtime/composables/Product/useService.js +67 -0
- package/dist/runtime/composables/Product/useTemplate.d.ts +5 -0
- package/dist/runtime/composables/Product/useTemplate.js +21 -0
- package/dist/runtime/composables/Samples/useSamples.d.ts +10 -0
- package/dist/runtime/composables/Samples/useSamples.js +36 -0
- package/dist/runtime/composables/SideBar/Filters/useFilters.d.ts +6 -0
- package/dist/runtime/composables/SideBar/Filters/useFilters.js +51 -0
- package/dist/runtime/composables/SideBar/Filters/useSorting.d.ts +5 -0
- package/dist/runtime/composables/SideBar/Filters/useSorting.js +27 -0
- package/dist/runtime/composables/SideBar/useSideBar.d.ts +8 -0
- package/dist/runtime/composables/SideBar/useSideBar.js +68 -0
- package/dist/runtime/composables/index.d.ts +74 -0
- package/dist/runtime/composables/index.js +74 -0
- package/dist/runtime/composables/types.d.ts +5 -0
- package/dist/runtime/composables/types.js +0 -0
- package/dist/runtime/composables/useAddToCart.d.ts +28 -0
- package/dist/runtime/composables/useAddToCart.js +114 -0
- package/dist/runtime/composables/useAddresses.d.ts +18 -0
- package/dist/runtime/composables/useAddresses.js +126 -0
- package/dist/runtime/composables/useAuth.d.ts +45 -0
- package/dist/runtime/composables/useAuth.js +180 -0
- package/dist/runtime/composables/useCards.d.ts +19 -0
- package/dist/runtime/composables/useCards.js +73 -0
- package/dist/runtime/composables/useClientApi.d.ts +23 -0
- package/dist/runtime/composables/useClientApi.js +53 -0
- package/dist/runtime/composables/useCountries.d.ts +12 -0
- package/dist/runtime/composables/useCountries.js +50 -0
- package/dist/runtime/composables/useDataLayer.d.ts +18 -0
- package/dist/runtime/composables/useDataLayer.js +385 -0
- package/dist/runtime/composables/useDynamicHtmlRenderer.d.ts +4 -0
- package/dist/runtime/composables/useDynamicHtmlRenderer.js +33 -0
- package/dist/runtime/composables/useLocation.d.ts +23 -0
- package/dist/runtime/composables/useLocation.js +32 -0
- package/dist/runtime/composables/useLocations.d.ts +12 -0
- package/dist/runtime/composables/useLocations.js +53 -0
- package/dist/runtime/composables/useMetaLayer.d.ts +10 -0
- package/dist/runtime/composables/useMetaLayer.js +263 -0
- package/dist/runtime/composables/useOrders.d.ts +21 -0
- package/dist/runtime/composables/useOrders.js +82 -0
- package/dist/runtime/composables/useQuotations.d.ts +14 -0
- package/dist/runtime/composables/useQuotations.js +50 -0
- package/dist/runtime/composables/useSearch.d.ts +7 -0
- package/dist/runtime/composables/useSearch.js +40 -0
- package/dist/runtime/composables/useSubscriptions.d.ts +13 -0
- package/dist/runtime/composables/useSubscriptions.js +58 -0
- package/dist/runtime/composables/useTikTokDatalayer.d.ts +8 -0
- package/dist/runtime/composables/useTikTokDatalayer.js +165 -0
- package/dist/runtime/composables/useWebforms.d.ts +16 -0
- package/dist/runtime/composables/useWebforms.js +75 -0
- package/dist/runtime/composables/useWishlists.d.ts +38 -0
- package/dist/runtime/composables/useWishlists.js +191 -0
- package/dist/runtime/middleware/flowrix.d.ts +6 -0
- package/dist/runtime/middleware/flowrix.js +40 -0
- package/dist/runtime/plugin.d.ts +2 -0
- package/dist/runtime/plugin.js +4 -0
- package/dist/runtime/plugins/persistedstate.client.d.ts +2 -0
- package/dist/runtime/plugins/persistedstate.client.js +9 -0
- package/dist/runtime/server/api/albums.d.ts +2 -0
- package/dist/runtime/server/api/albums.js +18 -0
- package/dist/runtime/server/api/auth/forgot.d.ts +5 -0
- package/dist/runtime/server/api/auth/forgot.js +44 -0
- package/dist/runtime/server/api/auth/login.d.ts +11 -0
- package/dist/runtime/server/api/auth/login.js +69 -0
- package/dist/runtime/server/api/auth/logout.d.ts +5 -0
- package/dist/runtime/server/api/auth/logout.js +23 -0
- package/dist/runtime/server/api/auth/register.d.ts +2 -0
- package/dist/runtime/server/api/auth/register.js +51 -0
- package/dist/runtime/server/api/auth/session.get.d.ts +2 -0
- package/dist/runtime/server/api/auth/session.get.js +46 -0
- package/dist/runtime/server/api/auth/user/reset-password.d.ts +5 -0
- package/dist/runtime/server/api/auth/user/reset-password.js +40 -0
- package/dist/runtime/server/api/auth/user/session.d.ts +2 -0
- package/dist/runtime/server/api/auth/user/session.js +43 -0
- package/dist/runtime/server/api/auth/user/verify-token.d.ts +6 -0
- package/dist/runtime/server/api/auth/user/verify-token.js +50 -0
- package/dist/runtime/server/api/banners.d.ts +3 -0
- package/dist/runtime/server/api/banners.js +41 -0
- package/dist/runtime/server/api/blog/[slug].d.ts +3 -0
- package/dist/runtime/server/api/blog/[slug].js +51 -0
- package/dist/runtime/server/api/blog/blog.d.ts +3 -0
- package/dist/runtime/server/api/blog/blog.js +17 -0
- package/dist/runtime/server/api/brand/[slug].d.ts +3 -0
- package/dist/runtime/server/api/brand/[slug].js +58 -0
- package/dist/runtime/server/api/cart/[slug]/add.d.ts +2 -0
- package/dist/runtime/server/api/cart/[slug]/add.js +21 -0
- package/dist/runtime/server/api/cart/[slug]/update.d.ts +2 -0
- package/dist/runtime/server/api/cart/[slug]/update.js +21 -0
- package/dist/runtime/server/api/cart/remove.d.ts +2 -0
- package/dist/runtime/server/api/cart/remove.js +21 -0
- package/dist/runtime/server/api/cart/service/[slug]/add.d.ts +2 -0
- package/dist/runtime/server/api/cart/service/[slug]/add.js +16 -0
- package/dist/runtime/server/api/catalog/categories.d.ts +3 -0
- package/dist/runtime/server/api/catalog/categories.js +43 -0
- package/dist/runtime/server/api/catalog/featured.d.ts +3 -0
- package/dist/runtime/server/api/catalog/featured.js +41 -0
- package/dist/runtime/server/api/catalog/samples.d.ts +3 -0
- package/dist/runtime/server/api/catalog/samples.js +44 -0
- package/dist/runtime/server/api/catalog/search.d.ts +3 -0
- package/dist/runtime/server/api/catalog/search.js +44 -0
- package/dist/runtime/server/api/category/[...slug].d.ts +3 -0
- package/dist/runtime/server/api/category/[...slug].js +51 -0
- package/dist/runtime/server/api/checkout/applyCoupon.d.ts +2 -0
- package/dist/runtime/server/api/checkout/applyCoupon.js +20 -0
- package/dist/runtime/server/api/checkout/configs.d.ts +2 -0
- package/dist/runtime/server/api/checkout/configs.js +20 -0
- package/dist/runtime/server/api/checkout/countries.d.ts +2 -0
- package/dist/runtime/server/api/checkout/countries.js +17 -0
- package/dist/runtime/server/api/checkout/paymentmethod.d.ts +2 -0
- package/dist/runtime/server/api/checkout/paymentmethod.js +20 -0
- package/dist/runtime/server/api/company/profile.d.ts +2 -0
- package/dist/runtime/server/api/company/profile.js +18 -0
- package/dist/runtime/server/api/contact-center/webforms/[id]/details.d.ts +3 -0
- package/dist/runtime/server/api/contact-center/webforms/[id]/details.js +19 -0
- package/dist/runtime/server/api/contact-center/webforms/create.d.ts +2 -0
- package/dist/runtime/server/api/contact-center/webforms/create.js +16 -0
- package/dist/runtime/server/api/customer/address/add.d.ts +14 -0
- package/dist/runtime/server/api/customer/address/add.js +33 -0
- package/dist/runtime/server/api/customer/address/delete.d.ts +20 -0
- package/dist/runtime/server/api/customer/address/delete.js +37 -0
- package/dist/runtime/server/api/customer/address/setshipping.d.ts +20 -0
- package/dist/runtime/server/api/customer/address/setshipping.js +41 -0
- package/dist/runtime/server/api/customer/address/update.d.ts +20 -0
- package/dist/runtime/server/api/customer/address/update.js +42 -0
- package/dist/runtime/server/api/customer/cards/delete.d.ts +2 -0
- package/dist/runtime/server/api/customer/cards/delete.js +23 -0
- package/dist/runtime/server/api/customer/cards/get.d.ts +2 -0
- package/dist/runtime/server/api/customer/cards/get.js +17 -0
- package/dist/runtime/server/api/customer/change-password.d.ts +14 -0
- package/dist/runtime/server/api/customer/change-password.js +34 -0
- package/dist/runtime/server/api/customer/checkout.d.ts +2 -0
- package/dist/runtime/server/api/customer/checkout.js +20 -0
- package/dist/runtime/server/api/customer/orders.d.ts +2 -0
- package/dist/runtime/server/api/customer/orders.js +17 -0
- package/dist/runtime/server/api/customer/profile/update.d.ts +14 -0
- package/dist/runtime/server/api/customer/profile/update.js +34 -0
- package/dist/runtime/server/api/customer/quotations.d.ts +2 -0
- package/dist/runtime/server/api/customer/quotations.js +17 -0
- package/dist/runtime/server/api/customer/search.d.ts +2 -0
- package/dist/runtime/server/api/customer/search.js +15 -0
- package/dist/runtime/server/api/customer/tax-invoice.d.ts +8 -0
- package/dist/runtime/server/api/customer/tax-invoice.js +36 -0
- package/dist/runtime/server/api/customer/wishlist/add.d.ts +2 -0
- package/dist/runtime/server/api/customer/wishlist/add.js +30 -0
- package/dist/runtime/server/api/customer/wishlist/createWishList.d.ts +2 -0
- package/dist/runtime/server/api/customer/wishlist/createWishList.js +29 -0
- package/dist/runtime/server/api/customer/wishlist/deleteFromWishList.d.ts +2 -0
- package/dist/runtime/server/api/customer/wishlist/deleteFromWishList.js +46 -0
- package/dist/runtime/server/api/customer/wishlist/deleteWishList.d.ts +2 -0
- package/dist/runtime/server/api/customer/wishlist/deleteWishList.js +30 -0
- package/dist/runtime/server/api/customer/wishlist/get.d.ts +2 -0
- package/dist/runtime/server/api/customer/wishlist/get.js +17 -0
- package/dist/runtime/server/api/customer/wishlist/getWishListItems.d.ts +2 -0
- package/dist/runtime/server/api/customer/wishlist/getWishListItems.js +21 -0
- package/dist/runtime/server/api/customer/wishlist/updateWishList.d.ts +2 -0
- package/dist/runtime/server/api/customer/wishlist/updateWishList.js +30 -0
- package/dist/runtime/server/api/location.d.ts +2 -0
- package/dist/runtime/server/api/location.js +13 -0
- package/dist/runtime/server/api/nav/[id]/links.d.ts +2 -0
- package/dist/runtime/server/api/nav/[id]/links.js +19 -0
- package/dist/runtime/server/api/page/[slug].d.ts +3 -0
- package/dist/runtime/server/api/page/[slug].js +51 -0
- package/dist/runtime/server/api/product/[...slug].d.ts +3 -0
- package/dist/runtime/server/api/product/[...slug].js +44 -0
- package/dist/runtime/server/api/service/[slug].d.ts +3 -0
- package/dist/runtime/server/api/service/[slug].js +51 -0
- package/dist/runtime/server/api/service/availability.d.ts +2 -0
- package/dist/runtime/server/api/service/availability.js +27 -0
- package/dist/runtime/server/api/subscribe.d.ts +2 -0
- package/dist/runtime/server/api/subscribe.js +16 -0
- package/dist/runtime/server/api/v2/[...slug].d.ts +3 -0
- package/dist/runtime/server/api/v2/[...slug].js +9 -0
- package/dist/runtime/server/tsconfig.json +3 -0
- package/dist/runtime/stores/Booking.d.ts +99 -0
- package/dist/runtime/stores/Booking.js +96 -0
- package/dist/runtime/stores/Cart.d.ts +67 -0
- package/dist/runtime/stores/Cart.js +272 -0
- package/dist/runtime/stores/Categories.d.ts +13 -0
- package/dist/runtime/stores/Categories.js +90 -0
- package/dist/runtime/stores/Checkout.d.ts +85 -0
- package/dist/runtime/stores/Checkout.js +213 -0
- package/dist/runtime/stores/IpLocation.d.ts +18 -0
- package/dist/runtime/stores/IpLocation.js +29 -0
- package/dist/runtime/stores/NavMenu.d.ts +15 -0
- package/dist/runtime/stores/NavMenu.js +26 -0
- package/dist/runtime/stores/Search.d.ts +0 -0
- package/dist/runtime/stores/Search.js +33 -0
- package/dist/runtime/stores/Services.d.ts +7 -0
- package/dist/runtime/stores/Services.js +49 -0
- package/dist/runtime/stores/Utilities.d.ts +5 -0
- package/dist/runtime/stores/Utilities.js +11 -0
- package/dist/runtime/stores/addresses.d.ts +15 -0
- package/dist/runtime/stores/addresses.js +31 -0
- package/dist/runtime/stores/auth.d.ts +62 -0
- package/dist/runtime/stores/auth.js +59 -0
- package/dist/runtime/stores/cards.d.ts +15 -0
- package/dist/runtime/stores/cards.js +22 -0
- package/dist/runtime/stores/compareStore.d.ts +7 -0
- package/dist/runtime/stores/compareStore.js +45 -0
- package/dist/runtime/stores/countries.d.ts +10 -0
- package/dist/runtime/stores/countries.js +19 -0
- package/dist/runtime/stores/index.d.ts +26 -0
- package/dist/runtime/stores/index.js +24 -0
- package/dist/runtime/stores/locations.d.ts +11 -0
- package/dist/runtime/stores/locations.js +19 -0
- package/dist/runtime/stores/orders.d.ts +16 -0
- package/dist/runtime/stores/orders.js +19 -0
- package/dist/runtime/stores/product/README.md +141 -0
- package/dist/runtime/stores/product/slug.d.ts +181 -0
- package/dist/runtime/stores/product/slug.js +91 -0
- package/dist/runtime/stores/product.d.ts +5 -0
- package/dist/runtime/stores/product.js +38 -0
- package/dist/runtime/stores/quotations.d.ts +12 -0
- package/dist/runtime/stores/quotations.js +19 -0
- package/dist/runtime/stores/subscriptions.d.ts +11 -0
- package/dist/runtime/stores/subscriptions.js +19 -0
- package/dist/runtime/stores/useCompanyProfile.d.ts +7 -0
- package/dist/runtime/stores/useCompanyProfile.js +22 -0
- package/dist/runtime/stores/useNavMenuStore.d.ts +5 -0
- package/dist/runtime/stores/useNavMenuStore.js +23 -0
- package/dist/runtime/stores/webforms.d.ts +18 -0
- package/dist/runtime/stores/webforms.js +23 -0
- package/dist/runtime/stores/wishlists.d.ts +28 -0
- package/dist/runtime/stores/wishlists.js +49 -0
- package/dist/runtime/utils/api.d.ts +13 -0
- package/dist/runtime/utils/api.js +102 -0
- package/dist/runtime/utils/companyProfile.d.ts +22 -0
- package/dist/runtime/utils/companyProfile.js +21 -0
- package/dist/types.d.mts +3 -0
- package/package.json +56 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
interface PostData {
|
|
2
|
+
meta_title?: string;
|
|
3
|
+
meta_description?: string;
|
|
4
|
+
content?: {
|
|
5
|
+
css?: string;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
interface MagazineCard {
|
|
9
|
+
CardImg: string;
|
|
10
|
+
CardTitle: string;
|
|
11
|
+
}
|
|
12
|
+
interface BlogSingleProps {
|
|
13
|
+
postData?: PostData;
|
|
14
|
+
}
|
|
15
|
+
export declare const useBlogSingle: (props: BlogSingleProps) => {
|
|
16
|
+
magazineCards: import("vue").Ref<{
|
|
17
|
+
CardImg: string;
|
|
18
|
+
CardTitle: string;
|
|
19
|
+
}[], MagazineCard[] | {
|
|
20
|
+
CardImg: string;
|
|
21
|
+
CardTitle: string;
|
|
22
|
+
}[]>;
|
|
23
|
+
loading: import("vue").Ref<boolean, boolean>;
|
|
24
|
+
total: import("vue").Ref<number, number>;
|
|
25
|
+
progressPercentage: import("vue").ComputedRef<number>;
|
|
26
|
+
canLoadMore: import("vue").ComputedRef<boolean>;
|
|
27
|
+
fullPath: import("vue").ComputedRef<string>;
|
|
28
|
+
loadMore: () => Promise<void>;
|
|
29
|
+
};
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { ref, computed } from "vue";
|
|
2
|
+
import { useRoute, useRequestHeaders, useHead } from "#imports";
|
|
3
|
+
import magazineImg1 from "@/assets/images/single-blog/Mask Group 79.png";
|
|
4
|
+
import magazineImg2 from "@/assets/images/single-blog/Mask Group 80.png";
|
|
5
|
+
export const useBlogSingle = (props) => {
|
|
6
|
+
const route = useRoute();
|
|
7
|
+
const magazineCards = ref([
|
|
8
|
+
{
|
|
9
|
+
CardImg: magazineImg1,
|
|
10
|
+
CardTitle: "What is Matter Technology and Why Does it Matter?"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
CardImg: magazineImg2,
|
|
14
|
+
CardTitle: "Easily convert your existing roller blinds into smart shades"
|
|
15
|
+
}
|
|
16
|
+
]);
|
|
17
|
+
const loading = ref(false);
|
|
18
|
+
const limit = 4;
|
|
19
|
+
const total = ref(magazineCards.value.length);
|
|
20
|
+
const currentIndex = ref(magazineCards.value.length);
|
|
21
|
+
const loadMore = async () => {
|
|
22
|
+
if (loading.value || currentIndex.value >= total.value) return;
|
|
23
|
+
loading.value = true;
|
|
24
|
+
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
25
|
+
const nextProducts = magazineCards.value.slice(currentIndex.value, currentIndex.value + limit);
|
|
26
|
+
magazineCards.value.push(...nextProducts);
|
|
27
|
+
currentIndex.value += nextProducts.length;
|
|
28
|
+
loading.value = false;
|
|
29
|
+
};
|
|
30
|
+
const fullPath = computed(() => {
|
|
31
|
+
if (process.server) {
|
|
32
|
+
const headers = useRequestHeaders();
|
|
33
|
+
const protocol = headers["x-forwarded-proto"] || "http";
|
|
34
|
+
const host = headers.host || "localhost";
|
|
35
|
+
return `${protocol}://${host}${route.fullPath}`;
|
|
36
|
+
} else {
|
|
37
|
+
return `${window.location.origin}${route.fullPath}`;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
const setupSEO = () => {
|
|
41
|
+
useHead(() => {
|
|
42
|
+
const css = props.postData?.content?.css || "";
|
|
43
|
+
return {
|
|
44
|
+
style: css ? [{
|
|
45
|
+
children: css,
|
|
46
|
+
type: "text/css"
|
|
47
|
+
}] : []
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
useHead({
|
|
51
|
+
title: props.postData?.meta_title || "Blog Post",
|
|
52
|
+
meta: [
|
|
53
|
+
{
|
|
54
|
+
name: "description",
|
|
55
|
+
content: props.postData?.meta_description || ""
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: "og:title",
|
|
59
|
+
content: props.postData?.meta_title || ""
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: "og:description",
|
|
63
|
+
content: props.postData?.meta_description || ""
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: "og:url",
|
|
67
|
+
content: fullPath.value
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
const progressPercentage = computed(() => magazineCards.value.length / total.value * 100);
|
|
73
|
+
const canLoadMore = computed(() => !loading.value && magazineCards.value.length < total.value);
|
|
74
|
+
setupSEO();
|
|
75
|
+
return {
|
|
76
|
+
// State
|
|
77
|
+
magazineCards,
|
|
78
|
+
loading,
|
|
79
|
+
total,
|
|
80
|
+
// Computed
|
|
81
|
+
progressPercentage,
|
|
82
|
+
canLoadMore,
|
|
83
|
+
fullPath,
|
|
84
|
+
// Methods
|
|
85
|
+
loadMore
|
|
86
|
+
};
|
|
87
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface MagazineCard {
|
|
2
|
+
CardImg: string;
|
|
3
|
+
CardTitle: string;
|
|
4
|
+
url?: string;
|
|
5
|
+
}
|
|
6
|
+
interface MagazineCardProps {
|
|
7
|
+
magazineCard: MagazineCard;
|
|
8
|
+
}
|
|
9
|
+
export declare const useMagazineCard: (props: MagazineCardProps) => {
|
|
10
|
+
card: import("vue").ComputedRef<MagazineCard>;
|
|
11
|
+
navigateToArticle: () => void;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { computed } from "vue";
|
|
2
|
+
import { navigateTo } from "#imports";
|
|
3
|
+
export const useMagazineCard = (props) => {
|
|
4
|
+
const card = computed(() => props.magazineCard);
|
|
5
|
+
const navigateToArticle = () => {
|
|
6
|
+
if (card.value.url) {
|
|
7
|
+
navigateTo(card.value.url);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
return {
|
|
11
|
+
card,
|
|
12
|
+
navigateToArticle
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface BlogContent {
|
|
2
|
+
html: string;
|
|
3
|
+
}
|
|
4
|
+
interface BlogPostData {
|
|
5
|
+
name: string;
|
|
6
|
+
author: string;
|
|
7
|
+
publish_date: string;
|
|
8
|
+
category: string;
|
|
9
|
+
image_url: string;
|
|
10
|
+
content: BlogContent;
|
|
11
|
+
}
|
|
12
|
+
interface SingleBlogMainProps {
|
|
13
|
+
postData: BlogPostData;
|
|
14
|
+
}
|
|
15
|
+
export declare const useSingleBlogMain: (props: SingleBlogMainProps) => {
|
|
16
|
+
post: import("vue").ComputedRef<BlogPostData>;
|
|
17
|
+
formattedDate: import("vue").ComputedRef<string>;
|
|
18
|
+
navigateToCategory: () => void;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { computed } from "vue";
|
|
2
|
+
import { navigateTo } from "#imports";
|
|
3
|
+
export const useSingleBlogMain = (props) => {
|
|
4
|
+
const post = computed(() => props.postData);
|
|
5
|
+
const formattedDate = computed(() => {
|
|
6
|
+
if (!post.value.publish_date) return "";
|
|
7
|
+
try {
|
|
8
|
+
const date = new Date(post.value.publish_date);
|
|
9
|
+
return date.toLocaleDateString("en-US", {
|
|
10
|
+
year: "numeric",
|
|
11
|
+
month: "long",
|
|
12
|
+
day: "numeric"
|
|
13
|
+
});
|
|
14
|
+
} catch (error) {
|
|
15
|
+
return post.value.publish_date;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
const navigateToCategory = () => {
|
|
19
|
+
if (post.value.category) {
|
|
20
|
+
navigateTo(`/blog/category/${post.value.category.toLowerCase()}`);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
return {
|
|
24
|
+
post,
|
|
25
|
+
formattedDate,
|
|
26
|
+
navigateToCategory
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { defineAsyncComponent, watch } from "vue";
|
|
2
|
+
export function useBrand(template) {
|
|
3
|
+
const route = useRoute();
|
|
4
|
+
const components = import.meta.glob(
|
|
5
|
+
"~/components/Brand/Template*/**/index.vue"
|
|
6
|
+
);
|
|
7
|
+
const path = `/components/Brand/Template-${template}/index.vue`;
|
|
8
|
+
const fallbackPath = `/components/Brand/Template-default/index.vue`;
|
|
9
|
+
const Brandtemplate = defineAsyncComponent({
|
|
10
|
+
loader: async () => {
|
|
11
|
+
if (template) {
|
|
12
|
+
if (components[path]) {
|
|
13
|
+
return await components[path]();
|
|
14
|
+
} else {
|
|
15
|
+
return await components[fallbackPath]();
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
const slug = route.params.slug;
|
|
21
|
+
const query = route.query;
|
|
22
|
+
const { data: brandData, error, pending, refresh } = useFetch(`/api/brand/${slug}`, {
|
|
23
|
+
query
|
|
24
|
+
});
|
|
25
|
+
watch(brandData, (newData) => {
|
|
26
|
+
}, { immediate: true });
|
|
27
|
+
watch(
|
|
28
|
+
() => [route.path, route.query],
|
|
29
|
+
async () => {
|
|
30
|
+
pending.value = true;
|
|
31
|
+
const response = await useFetch(`/api/brand/${slug}`, {
|
|
32
|
+
method: "GET",
|
|
33
|
+
query: route.query
|
|
34
|
+
});
|
|
35
|
+
brandData.value = response.data.value;
|
|
36
|
+
pending.value = false;
|
|
37
|
+
},
|
|
38
|
+
{ deep: true }
|
|
39
|
+
);
|
|
40
|
+
return {
|
|
41
|
+
Brandtemplate,
|
|
42
|
+
brandData,
|
|
43
|
+
pending
|
|
44
|
+
};
|
|
45
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
interface Product {
|
|
2
|
+
name: string;
|
|
3
|
+
height?: number;
|
|
4
|
+
width?: number;
|
|
5
|
+
type: string;
|
|
6
|
+
image: string;
|
|
7
|
+
options: {
|
|
8
|
+
promotionlabel: Array<{
|
|
9
|
+
cartPromotionTag: string;
|
|
10
|
+
cartPromotionTagBackgroundColor: string;
|
|
11
|
+
cartPromotionTagColor: string;
|
|
12
|
+
cartDescription?: string;
|
|
13
|
+
}>;
|
|
14
|
+
summary: Array<{
|
|
15
|
+
name: string;
|
|
16
|
+
value: string;
|
|
17
|
+
}>;
|
|
18
|
+
};
|
|
19
|
+
pricefloat: number;
|
|
20
|
+
qty: number;
|
|
21
|
+
rpfloat: number;
|
|
22
|
+
rowId: string;
|
|
23
|
+
slug: string;
|
|
24
|
+
bundle?: Array<{
|
|
25
|
+
name: string;
|
|
26
|
+
qty: number;
|
|
27
|
+
price: string;
|
|
28
|
+
image?: string;
|
|
29
|
+
rrp?: string;
|
|
30
|
+
}>;
|
|
31
|
+
service?: {
|
|
32
|
+
per_order_pricing: number;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
interface CartDetailProps {
|
|
36
|
+
items: Record<string, Product>;
|
|
37
|
+
}
|
|
38
|
+
export declare const useCartDetail: (props: CartDetailProps) => {
|
|
39
|
+
productAccordionStates: import("vue").Ref<Record<string, boolean>, Record<string, boolean>>;
|
|
40
|
+
cartItems: import("vue").ComputedRef<Record<string, Product>>;
|
|
41
|
+
companyProfile: any;
|
|
42
|
+
checkoutData: import("vue").ComputedRef<any>;
|
|
43
|
+
removeFromCartMiddleware: (productId: string, product: Product) => Promise<void>;
|
|
44
|
+
updateQuantityMiddleware: (product: Product, qty: number) => Promise<void>;
|
|
45
|
+
toggleAccordion: (rowId: string) => void;
|
|
46
|
+
dvidedsummary: (sammarydata: any[]) => any[][];
|
|
47
|
+
swatchimagesSrcset: (swatchImage: string) => string;
|
|
48
|
+
};
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { onMounted, ref, computed } from "vue";
|
|
2
|
+
export const useCartDetail = (props) => {
|
|
3
|
+
const cartStore = useCartStore();
|
|
4
|
+
const { profile: companyProfile } = useCompanyProfile();
|
|
5
|
+
const checkoutData = computed(() => useCheckoutStore().config);
|
|
6
|
+
const productAccordionStates = ref({});
|
|
7
|
+
onMounted(() => {
|
|
8
|
+
window.scrollTo({
|
|
9
|
+
top: 0,
|
|
10
|
+
behavior: "smooth"
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
const removeFromCartMiddleware = async (productId, product) => {
|
|
14
|
+
await cartStore.removeFromCart(productId, product);
|
|
15
|
+
};
|
|
16
|
+
const updateQuantityMiddleware = async (product, qty) => {
|
|
17
|
+
await cartStore.updateQuantity(product, qty);
|
|
18
|
+
};
|
|
19
|
+
const toggleAccordion = (rowId) => {
|
|
20
|
+
productAccordionStates.value[rowId] = !productAccordionStates.value[rowId];
|
|
21
|
+
};
|
|
22
|
+
const dvidedsummary = (sammarydata) => {
|
|
23
|
+
const sumary = [];
|
|
24
|
+
const firstMidpoint = Math.ceil(sammarydata.length / 2);
|
|
25
|
+
sumary[0] = sammarydata.slice(0, firstMidpoint);
|
|
26
|
+
sumary[1] = sammarydata.slice(firstMidpoint);
|
|
27
|
+
return sumary;
|
|
28
|
+
};
|
|
29
|
+
const swatchimagesSrcset = (swatchImage) => {
|
|
30
|
+
const swatchImage320 = swatchImage?.replace(/.webp/gi, "320.webp");
|
|
31
|
+
return swatchImage320;
|
|
32
|
+
};
|
|
33
|
+
const cartItems = computed(() => props.items);
|
|
34
|
+
return {
|
|
35
|
+
// State
|
|
36
|
+
productAccordionStates,
|
|
37
|
+
// Computed
|
|
38
|
+
cartItems,
|
|
39
|
+
companyProfile,
|
|
40
|
+
checkoutData,
|
|
41
|
+
// Methods
|
|
42
|
+
removeFromCartMiddleware,
|
|
43
|
+
updateQuantityMiddleware,
|
|
44
|
+
toggleAccordion,
|
|
45
|
+
dvidedsummary,
|
|
46
|
+
swatchimagesSrcset
|
|
47
|
+
};
|
|
48
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface CategoryContentProps {
|
|
2
|
+
description: string;
|
|
3
|
+
}
|
|
4
|
+
export declare const useCategoryContent: (props: CategoryContentProps) => {
|
|
5
|
+
description: import("vue").ComputedRef<string>;
|
|
6
|
+
processedDescription: import("vue").ComputedRef<string>;
|
|
7
|
+
sanitizeContent: (content: string) => string;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { computed } from "vue";
|
|
2
|
+
export const useCategoryContent = (props) => {
|
|
3
|
+
const description = computed(() => props.description);
|
|
4
|
+
const sanitizeContent = (content) => {
|
|
5
|
+
return content;
|
|
6
|
+
};
|
|
7
|
+
const processedDescription = computed(() => {
|
|
8
|
+
return sanitizeContent(description.value);
|
|
9
|
+
});
|
|
10
|
+
return {
|
|
11
|
+
description,
|
|
12
|
+
processedDescription,
|
|
13
|
+
sanitizeContent
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
interface Product {
|
|
2
|
+
id: string | number;
|
|
3
|
+
name: string;
|
|
4
|
+
image: string;
|
|
5
|
+
price: number;
|
|
6
|
+
}
|
|
7
|
+
interface ChildCategory {
|
|
8
|
+
slug: string;
|
|
9
|
+
name: string;
|
|
10
|
+
image: string;
|
|
11
|
+
short_description: string;
|
|
12
|
+
}
|
|
13
|
+
interface CategoryGridProps {
|
|
14
|
+
template: number;
|
|
15
|
+
childcategories: ChildCategory[];
|
|
16
|
+
products: Product[];
|
|
17
|
+
}
|
|
18
|
+
export declare const useCategoryGrid: (props: CategoryGridProps) => {
|
|
19
|
+
selectedProduct: import("vue").Ref<{
|
|
20
|
+
id: string | number;
|
|
21
|
+
name: string;
|
|
22
|
+
image: string;
|
|
23
|
+
price: number;
|
|
24
|
+
} | null, Product | {
|
|
25
|
+
id: string | number;
|
|
26
|
+
name: string;
|
|
27
|
+
image: string;
|
|
28
|
+
price: number;
|
|
29
|
+
} | null>;
|
|
30
|
+
showQuickView: import("vue").Ref<boolean, boolean>;
|
|
31
|
+
template: import("vue").ComputedRef<number>;
|
|
32
|
+
childcategories: import("vue").ComputedRef<ChildCategory[]>;
|
|
33
|
+
products: import("vue").ComputedRef<Product[]>;
|
|
34
|
+
shouldShowProducts: import("vue").ComputedRef<boolean>;
|
|
35
|
+
shouldShowCategories: import("vue").ComputedRef<boolean>;
|
|
36
|
+
openQuickView: (data: Product) => void;
|
|
37
|
+
closeQuickView: () => void;
|
|
38
|
+
formatShortDescription: (html: string) => string;
|
|
39
|
+
};
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ref, computed } from "vue";
|
|
2
|
+
export const useCategoryGrid = (props) => {
|
|
3
|
+
const selectedProduct = ref(null);
|
|
4
|
+
const showQuickView = ref(false);
|
|
5
|
+
const openQuickView = (data) => {
|
|
6
|
+
selectedProduct.value = data;
|
|
7
|
+
showQuickView.value = true;
|
|
8
|
+
};
|
|
9
|
+
const closeQuickView = () => {
|
|
10
|
+
showQuickView.value = false;
|
|
11
|
+
selectedProduct.value = null;
|
|
12
|
+
};
|
|
13
|
+
const formatShortDescription = (html) => {
|
|
14
|
+
const text = html.replace(/<[^>]*>/g, "");
|
|
15
|
+
const words = text.split(/\s+/);
|
|
16
|
+
return words.slice(0, 30).join(" ") + (words.length > 30 ? "..." : "");
|
|
17
|
+
};
|
|
18
|
+
const template = computed(() => props.template);
|
|
19
|
+
const childcategories = computed(() => props.childcategories);
|
|
20
|
+
const products = computed(() => props.products);
|
|
21
|
+
const shouldShowProducts = computed(() => template.value !== 3);
|
|
22
|
+
const shouldShowCategories = computed(() => template.value === 3 && childcategories.value.length > 0);
|
|
23
|
+
return {
|
|
24
|
+
// State
|
|
25
|
+
selectedProduct,
|
|
26
|
+
showQuickView,
|
|
27
|
+
// Computed
|
|
28
|
+
template,
|
|
29
|
+
childcategories,
|
|
30
|
+
products,
|
|
31
|
+
shouldShowProducts,
|
|
32
|
+
shouldShowCategories,
|
|
33
|
+
// Methods
|
|
34
|
+
openQuickView,
|
|
35
|
+
closeQuickView,
|
|
36
|
+
formatShortDescription
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type Ref, type ComputedRef } from 'vue';
|
|
2
|
+
interface CategoryData {
|
|
3
|
+
status: string;
|
|
4
|
+
message: number;
|
|
5
|
+
data: {
|
|
6
|
+
template: any;
|
|
7
|
+
type: string;
|
|
8
|
+
record: {
|
|
9
|
+
category: object;
|
|
10
|
+
products: object;
|
|
11
|
+
brands: object[];
|
|
12
|
+
filter_values: object[];
|
|
13
|
+
filters: object[];
|
|
14
|
+
categories: object[];
|
|
15
|
+
prices: object;
|
|
16
|
+
breadcrumb: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
interface CategoryIndexProps {
|
|
21
|
+
data: CategoryData;
|
|
22
|
+
}
|
|
23
|
+
interface UseCategoryIndexReturn {
|
|
24
|
+
catData: Ref<any>;
|
|
25
|
+
error: Ref<any>;
|
|
26
|
+
pending: Ref<boolean>;
|
|
27
|
+
transformedApiData: ComputedRef<CategoryData | null>;
|
|
28
|
+
renderData: ComputedRef<CategoryData>;
|
|
29
|
+
refresh: () => Promise<void>;
|
|
30
|
+
getSelectedTemplate: (templateComponents: Record<string, any>) => ComputedRef<any>;
|
|
31
|
+
}
|
|
32
|
+
export declare const useCategoryIndex: (props: CategoryIndexProps) => UseCategoryIndexReturn;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { useRoute, useFetch } from "#imports";
|
|
2
|
+
import { watch, computed } from "vue";
|
|
3
|
+
export const useCategoryIndex = (props) => {
|
|
4
|
+
const route = useRoute();
|
|
5
|
+
const slug = route.params.slug;
|
|
6
|
+
const { data: catData, error, pending, refresh } = useFetch(`/api/category/${slug}`, {
|
|
7
|
+
method: "GET",
|
|
8
|
+
query: route.query
|
|
9
|
+
});
|
|
10
|
+
watch(catData, (newData) => {
|
|
11
|
+
}, { immediate: true });
|
|
12
|
+
watch(
|
|
13
|
+
() => [route.path, route.query],
|
|
14
|
+
async () => {
|
|
15
|
+
pending.value = true;
|
|
16
|
+
const response = await useFetch(`/api/category/${slug}`, {
|
|
17
|
+
method: "GET",
|
|
18
|
+
query: route.query
|
|
19
|
+
});
|
|
20
|
+
catData.value = response.data.value;
|
|
21
|
+
pending.value = false;
|
|
22
|
+
},
|
|
23
|
+
{ deep: true }
|
|
24
|
+
);
|
|
25
|
+
const transformedApiData = computed(() => {
|
|
26
|
+
if (catData.value && catData.value.status === "Success") {
|
|
27
|
+
return {
|
|
28
|
+
status: catData.value.status,
|
|
29
|
+
message: catData.value.message,
|
|
30
|
+
data: {
|
|
31
|
+
template: catData.value.data?.category?.template || "default",
|
|
32
|
+
type: catData.value.data?.type || "category",
|
|
33
|
+
record: {
|
|
34
|
+
category: catData.value.data?.category || {},
|
|
35
|
+
products: catData.value.data?.products || {},
|
|
36
|
+
brands: catData.value.data?.brands || [],
|
|
37
|
+
filter_values: catData.value.data?.filter_values || [],
|
|
38
|
+
filters: catData.value.data?.filters || [],
|
|
39
|
+
categories: catData.value.data?.categories || [],
|
|
40
|
+
prices: catData.value.data?.prices || {},
|
|
41
|
+
breadcrumb: catData.value.data?.breadcrumb || ""
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
47
|
+
});
|
|
48
|
+
const renderData = computed(() => transformedApiData.value || props.data);
|
|
49
|
+
const getSelectedTemplate = (templateComponents) => {
|
|
50
|
+
return computed(() => {
|
|
51
|
+
return templateComponents[renderData.value?.data?.template] || templateComponents.default;
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
return {
|
|
55
|
+
// State
|
|
56
|
+
catData,
|
|
57
|
+
error,
|
|
58
|
+
pending,
|
|
59
|
+
transformedApiData,
|
|
60
|
+
renderData,
|
|
61
|
+
// Methods
|
|
62
|
+
refresh,
|
|
63
|
+
getSelectedTemplate
|
|
64
|
+
};
|
|
65
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
interface CategoryItem {
|
|
2
|
+
name: string;
|
|
3
|
+
slug: string;
|
|
4
|
+
image: string;
|
|
5
|
+
short_description: string;
|
|
6
|
+
sortorder?: number;
|
|
7
|
+
type?: string;
|
|
8
|
+
category?: string;
|
|
9
|
+
}
|
|
10
|
+
interface CategoryData {
|
|
11
|
+
category: {
|
|
12
|
+
name: string;
|
|
13
|
+
};
|
|
14
|
+
categories: CategoryItem[];
|
|
15
|
+
products: {
|
|
16
|
+
data: CategoryItem[];
|
|
17
|
+
};
|
|
18
|
+
prices?: {
|
|
19
|
+
minPrice: number;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
interface CategoryTemplate2Props {
|
|
23
|
+
data: CategoryData;
|
|
24
|
+
}
|
|
25
|
+
export declare const useCategoryTemplate2: (props: CategoryTemplate2Props) => {
|
|
26
|
+
companyProfile: any;
|
|
27
|
+
data: import("vue").ComputedRef<CategoryData>;
|
|
28
|
+
categoryData: import("vue").ComputedRef<{
|
|
29
|
+
type: string;
|
|
30
|
+
name: string;
|
|
31
|
+
slug: string;
|
|
32
|
+
image: string;
|
|
33
|
+
short_description: string;
|
|
34
|
+
sortorder?: number;
|
|
35
|
+
category?: string;
|
|
36
|
+
}[]>;
|
|
37
|
+
hasProducts: import("vue").ComputedRef<boolean>;
|
|
38
|
+
categoryName: import("vue").ComputedRef<string>;
|
|
39
|
+
getCategoryData: (CatData: CategoryData) => {
|
|
40
|
+
type: string;
|
|
41
|
+
name: string;
|
|
42
|
+
slug: string;
|
|
43
|
+
image: string;
|
|
44
|
+
short_description: string;
|
|
45
|
+
sortorder?: number;
|
|
46
|
+
category?: string;
|
|
47
|
+
}[];
|
|
48
|
+
formatShortDescription: (html: string | null | undefined) => string;
|
|
49
|
+
};
|
|
50
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { computed } from "vue";
|
|
2
|
+
import { useCompanyProfile } from "../Extras/useCompanyProfile";
|
|
3
|
+
export const useCategoryTemplate2 = (props) => {
|
|
4
|
+
const { profile: companyProfile } = useCompanyProfile();
|
|
5
|
+
const getCategoryData = (CatData) => {
|
|
6
|
+
const childCategories = CatData.categories.map((item) => ({
|
|
7
|
+
...item,
|
|
8
|
+
type: "category"
|
|
9
|
+
}));
|
|
10
|
+
const products = CatData.products.data.filter((item) => item.category === CatData.category.name).map((item) => ({
|
|
11
|
+
...item,
|
|
12
|
+
type: "product"
|
|
13
|
+
}));
|
|
14
|
+
const newData = [...childCategories, ...products].sort(
|
|
15
|
+
(a, b) => (a.sortorder || 0) - (b.sortorder || 0)
|
|
16
|
+
);
|
|
17
|
+
return newData;
|
|
18
|
+
};
|
|
19
|
+
const formatShortDescription = (html) => {
|
|
20
|
+
if (html === null || html === void 0) {
|
|
21
|
+
return "";
|
|
22
|
+
}
|
|
23
|
+
const text = html.replace(/<[^>]*>/g, "");
|
|
24
|
+
const words = text.split(/\s+/);
|
|
25
|
+
return words.slice(0, 30).join(" ") + (words.length > 30 ? "..." : "");
|
|
26
|
+
};
|
|
27
|
+
const data = computed(() => props.data);
|
|
28
|
+
const categoryData = computed(() => getCategoryData(data.value));
|
|
29
|
+
const hasProducts = computed(() => data.value.products.data.length > 0);
|
|
30
|
+
const categoryName = computed(() => data.value.category?.name || "");
|
|
31
|
+
return {
|
|
32
|
+
// State
|
|
33
|
+
companyProfile,
|
|
34
|
+
// Computed
|
|
35
|
+
data,
|
|
36
|
+
categoryData,
|
|
37
|
+
hasProducts,
|
|
38
|
+
categoryName,
|
|
39
|
+
// Methods
|
|
40
|
+
getCategoryData,
|
|
41
|
+
formatShortDescription
|
|
42
|
+
};
|
|
43
|
+
};
|