orionplace-nuxt 0.1.2 → 0.2.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/README.md +711 -24
- package/bin/orionplace-nuxt.mjs +39 -11
- package/package.json +26 -6
- package/runtime/api.mjs +4 -1
- package/runtime/domain.mjs +4 -2
- package/runtime/marketplace.mjs +287 -211
- package/src/asset-loading-plugin.mjs +10 -0
- package/src/module.mjs +44 -14
- package/src/project-readme.mjs +507 -35
- package/src/setup.mjs +100 -51
- package/src/update.mjs +36 -0
- package/src/validation.mjs +6 -0
- package/templates/.vscode/settings.json +5 -0
- package/templates/app/app.vue +48 -0
- package/templates/app/assets/css/orionplace-tokens.css +21 -0
- package/templates/app/assets/css/orionplace.css +28 -0
- package/templates/app/components/orionplace/account/AccountActivity.README.md +31 -0
- package/templates/app/components/orionplace/account/AccountActivity.vue +61 -0
- package/templates/app/components/orionplace/account/AccountPromocodes.README.md +50 -0
- package/templates/app/components/orionplace/account/AccountPromocodes.vue +267 -0
- package/templates/app/components/orionplace/account/AccountSection.README.md +31 -0
- package/templates/app/components/orionplace/account/AccountSection.vue +132 -0
- package/templates/app/components/orionplace/account/ProfileAvatar.vue +139 -0
- package/templates/app/components/orionplace/account/ProfileDeleteAccount.vue +161 -0
- package/templates/app/components/orionplace/account/ProfileDetailsForm.vue +172 -0
- package/templates/app/components/orionplace/account/ProfileEmailSettings.vue +269 -0
- package/templates/app/components/orionplace/account/ProfilePasswordForm.vue +201 -0
- package/templates/app/components/orionplace/account/ProfileSignIn.vue +446 -0
- package/templates/app/components/orionplace/account/SignInHistory.README.md +27 -0
- package/templates/app/components/orionplace/account/SignInHistory.vue +218 -0
- package/templates/app/components/orionplace/account/StorefrontLogout.README.md +15 -0
- package/templates/app/components/orionplace/account/StorefrontLogout.vue +109 -0
- package/templates/app/components/orionplace/account/StorefrontProfile.README.md +145 -0
- package/templates/app/components/orionplace/account/StorefrontProfile.vue +168 -0
- package/templates/app/components/orionplace/account/account.css +1047 -0
- package/templates/app/components/orionplace/account/profile.css +696 -0
- package/templates/app/components/orionplace/address/AddressForm.README.md +67 -0
- package/templates/app/components/orionplace/address/AddressForm.vue +537 -0
- package/templates/app/components/orionplace/address/StorefrontAddresses.README.md +44 -0
- package/templates/app/components/orionplace/address/StorefrontAddresses.vue +438 -0
- package/templates/app/components/orionplace/banners/MainBanner.vue +171 -0
- package/templates/app/components/orionplace/banners/examples/BannerExample.vue +6 -0
- package/templates/app/components/orionplace/blog/BlogArticle.README.md +44 -0
- package/templates/app/components/orionplace/blog/BlogArticle.vue +829 -0
- package/templates/app/components/orionplace/blog/BlogCommentForm.README.md +28 -0
- package/templates/app/components/orionplace/blog/BlogCommentForm.vue +129 -0
- package/templates/app/components/orionplace/blog/BlogComments.README.md +36 -0
- package/templates/app/components/orionplace/blog/BlogComments.vue +373 -0
- package/templates/app/components/orionplace/blog/BlogPostCard.vue +307 -0
- package/templates/app/components/orionplace/blog/BlogPostGroup.vue +108 -0
- package/templates/app/components/orionplace/blog/StorefrontJournal.README.md +42 -0
- package/templates/app/components/orionplace/blog/StorefrontJournal.vue +669 -0
- package/templates/app/components/orionplace/branding/BrandLogos.vue +25 -0
- package/templates/app/components/orionplace/branding/examples/BrandLogosExample.vue +6 -0
- package/templates/app/components/orionplace/cart/CartCheckoutDetails.README.md +81 -0
- package/templates/app/components/orionplace/cart/CartCheckoutDetails.vue +367 -0
- package/templates/app/components/orionplace/cart/CartDeliverySelector.README.md +95 -0
- package/templates/app/components/orionplace/cart/CartDeliverySelector.vue +724 -0
- package/templates/app/components/orionplace/cart/CartItemOptions.README.md +98 -0
- package/templates/app/components/orionplace/cart/CartItemOptions.vue +693 -0
- package/templates/app/components/orionplace/cart/CartLineItem.README.md +70 -0
- package/templates/app/components/orionplace/cart/CartLineItem.vue +271 -0
- package/templates/app/components/orionplace/cart/CartPreview.README.md +43 -0
- package/templates/app/components/orionplace/cart/CartPreview.vue +263 -0
- package/templates/app/components/orionplace/cart/DeliveryMap.README.md +48 -0
- package/templates/app/components/orionplace/cart/DeliveryMap.vue +155 -0
- package/templates/app/components/orionplace/cart/StorefrontCart.README.md +89 -0
- package/templates/app/components/orionplace/cart/StorefrontCart.vue +689 -0
- package/templates/app/components/orionplace/catalog/CatalogHeader.vue +681 -0
- package/templates/app/components/orionplace/catalog/CatalogRepresentative.vue +59 -0
- package/templates/app/components/orionplace/catalog/StorefrontCatalog.README.md +35 -0
- package/templates/app/components/orionplace/catalog/StorefrontCatalog.vue +179 -0
- package/templates/app/components/orionplace/catalog/examples/CatalogHeaderExample.vue +6 -0
- package/templates/app/components/orionplace/categories/CategoryGroup.vue +125 -0
- package/templates/app/components/orionplace/categories/StorefrontCategory.README.md +60 -0
- package/templates/app/components/orionplace/categories/StorefrontCategory.vue +277 -0
- package/templates/app/components/orionplace/categories/examples/CategoryGroupExample.vue +7 -0
- package/templates/app/components/orionplace/contact/AboutPage.README.md +23 -0
- package/templates/app/components/orionplace/contact/AboutPage.vue +409 -0
- package/templates/app/components/orionplace/contact/ContactForm.README.md +29 -0
- package/templates/app/components/orionplace/contact/ContactForm.vue +289 -0
- package/templates/app/components/orionplace/contact/EmailUnsubscribe.README.md +27 -0
- package/templates/app/components/orionplace/contact/EmailUnsubscribe.vue +95 -0
- package/templates/app/components/orionplace/contact/StorefrontContact.README.md +18 -0
- package/templates/app/components/orionplace/contact/StorefrontContact.vue +89 -0
- package/templates/app/components/orionplace/contact/examples/ContactExample.vue +6 -0
- package/templates/app/components/orionplace/currencies/MainCurrencySwitcher.vue +80 -0
- package/templates/app/components/orionplace/currencies/examples/CurrencyExample.vue +6 -0
- package/templates/app/components/orionplace/events/EventEnrollmentDialog.README.md +58 -0
- package/templates/app/components/orionplace/events/EventEnrollmentDialog.vue +294 -0
- package/templates/app/components/orionplace/events/EventsBlock.vue +138 -0
- package/templates/app/components/orionplace/events/examples/EventsExample.vue +6 -0
- package/templates/app/components/orionplace/locale/MainLanguageSwitcher.vue +506 -0
- package/templates/app/components/orionplace/locale/examples/LocaleExample.vue +6 -0
- package/templates/app/components/orionplace/manufacturers/ManufacturerIndex.README.md +36 -0
- package/templates/app/components/orionplace/manufacturers/ManufacturerIndex.vue +495 -0
- package/templates/app/components/orionplace/manufacturers/StorefrontManufacturers.README.md +30 -0
- package/templates/app/components/orionplace/manufacturers/StorefrontManufacturers.vue +263 -0
- package/templates/app/components/orionplace/orders/OrderDetails.README.md +39 -0
- package/templates/app/components/orionplace/orders/OrderDetails.vue +1074 -0
- package/templates/app/components/orionplace/orders/OrderPaymentForm.README.md +59 -0
- package/templates/app/components/orionplace/orders/OrderPaymentForm.vue +73 -0
- package/templates/app/components/orionplace/orders/StorefrontOrders.README.md +39 -0
- package/templates/app/components/orionplace/orders/StorefrontOrders.vue +869 -0
- package/templates/app/components/orionplace/orders/orders.css +612 -0
- package/templates/app/components/orionplace/payments/PaymentPanel.README.md +76 -0
- package/templates/app/components/orionplace/payments/PaymentPanel.vue +108 -0
- package/templates/app/components/orionplace/products/HoverImageViewer.vue +190 -0
- package/templates/app/components/orionplace/products/ProductCard.README.md +63 -0
- package/templates/app/components/orionplace/products/ProductCard.vue +897 -0
- package/templates/app/components/orionplace/products/ProductCardActions.README.md +33 -0
- package/templates/app/components/orionplace/products/ProductCardActions.vue +412 -0
- package/templates/app/components/orionplace/products/ProductCardBadges.vue +83 -0
- package/templates/app/components/orionplace/products/ProductCardDescription.vue +46 -0
- package/templates/app/components/orionplace/products/ProductCardFavorite.vue +99 -0
- package/templates/app/components/orionplace/products/ProductCardPrice.vue +66 -0
- package/templates/app/components/orionplace/products/ProductCardRating.vue +65 -0
- package/templates/app/components/orionplace/products/ProductCardSeller.vue +66 -0
- package/templates/app/components/orionplace/products/ProductCardStockNotice.vue +43 -0
- package/templates/app/components/orionplace/products/ProductCardTitle.vue +46 -0
- package/templates/app/components/orionplace/products/ProductCardVariants.vue +388 -0
- package/templates/app/components/orionplace/products/ProductGroup.vue +257 -0
- package/templates/app/components/orionplace/products/ProductPreorderDialog.README.md +22 -0
- package/templates/app/components/orionplace/products/ProductPreorderDialog.vue +471 -0
- package/templates/app/components/orionplace/products/ProductReviewForm.README.md +39 -0
- package/templates/app/components/orionplace/products/ProductReviewForm.vue +312 -0
- package/templates/app/components/orionplace/products/ProductReviewGallery.README.md +28 -0
- package/templates/app/components/orionplace/products/ProductReviewGallery.vue +141 -0
- package/templates/app/components/orionplace/products/ProductReviewImageViewer.README.md +51 -0
- package/templates/app/components/orionplace/products/ProductReviewImageViewer.vue +351 -0
- package/templates/app/components/orionplace/products/ProductReviews.README.md +70 -0
- package/templates/app/components/orionplace/products/ProductReviews.vue +1025 -0
- package/templates/app/components/orionplace/products/ProductSecondaryVariantModal.vue +460 -0
- package/templates/app/components/orionplace/products/ProductSpecificationsDialog.README.md +65 -0
- package/templates/app/components/orionplace/products/ProductSpecificationsDialog.vue +174 -0
- package/templates/app/components/orionplace/products/StorefrontProduct.README.md +52 -0
- package/templates/app/components/orionplace/products/StorefrontProduct.vue +1466 -0
- package/templates/app/components/orionplace/products/StorefrontWishlist.README.md +33 -0
- package/templates/app/components/orionplace/products/StorefrontWishlist.vue +290 -0
- package/templates/app/components/orionplace/products/examples/FeaturedExample.vue +6 -0
- package/templates/app/components/orionplace/products/examples/FeaturedHoverImageViewerExample.vue +14 -0
- package/templates/app/components/orionplace/products/examples/FeaturedProductCardActionsExample.vue +14 -0
- package/templates/app/components/orionplace/products/examples/FeaturedProductCardBadgesExample.vue +14 -0
- package/templates/app/components/orionplace/products/examples/FeaturedProductCardDescriptionExample.vue +14 -0
- package/templates/app/components/orionplace/products/examples/FeaturedProductCardExample.vue +14 -0
- package/templates/app/components/orionplace/products/examples/FeaturedProductCardFavoriteExample.vue +14 -0
- package/templates/app/components/orionplace/products/examples/FeaturedProductCardPriceExample.vue +14 -0
- package/templates/app/components/orionplace/products/examples/FeaturedProductCardRatingExample.vue +14 -0
- package/templates/app/components/orionplace/products/examples/FeaturedProductCardSellerExample.vue +14 -0
- package/templates/app/components/orionplace/products/examples/FeaturedProductCardStockNoticeExample.vue +14 -0
- package/templates/app/components/orionplace/products/examples/FeaturedProductCardTitleExample.vue +14 -0
- package/templates/app/components/orionplace/products/examples/FeaturedProductCardVariantsExample.vue +14 -0
- package/templates/app/components/orionplace/products/examples/ProductsExample.vue +6 -0
- package/templates/app/components/orionplace/products/examples/ProductsHoverImageViewerExample.vue +13 -0
- package/templates/app/components/orionplace/products/examples/ProductsProductCardActionsExample.vue +13 -0
- package/templates/app/components/orionplace/products/examples/ProductsProductCardBadgesExample.vue +13 -0
- package/templates/app/components/orionplace/products/examples/ProductsProductCardDescriptionExample.vue +13 -0
- package/templates/app/components/orionplace/products/examples/ProductsProductCardExample.vue +13 -0
- package/templates/app/components/orionplace/products/examples/ProductsProductCardFavoriteExample.vue +13 -0
- package/templates/app/components/orionplace/products/examples/ProductsProductCardPriceExample.vue +13 -0
- package/templates/app/components/orionplace/products/examples/ProductsProductCardRatingExample.vue +13 -0
- package/templates/app/components/orionplace/products/examples/ProductsProductCardSellerExample.vue +13 -0
- package/templates/app/components/orionplace/products/examples/ProductsProductCardStockNoticeExample.vue +13 -0
- package/templates/app/components/orionplace/products/examples/ProductsProductCardTitleExample.vue +13 -0
- package/templates/app/components/orionplace/products/examples/ProductsProductCardVariantsExample.vue +13 -0
- package/templates/app/components/orionplace/promo/PromoProducts.README.md +45 -0
- package/templates/app/components/orionplace/promo/PromoProducts.vue +287 -0
- package/templates/app/components/orionplace/search/MainSearch.vue +342 -0
- package/templates/app/components/orionplace/search/ProductSearchResults.README.md +81 -0
- package/templates/app/components/orionplace/search/ProductSearchResults.vue +458 -0
- package/templates/app/components/orionplace/search/SearchFilters.vue +546 -0
- package/templates/app/components/orionplace/search/examples/MainSearchExample.vue +6 -0
- package/templates/app/components/orionplace/sellers/SellerFilters.README.md +32 -0
- package/templates/app/components/orionplace/sellers/SellerFilters.vue +317 -0
- package/templates/app/components/orionplace/sellers/SellerPhotoGallery.README.md +45 -0
- package/templates/app/components/orionplace/sellers/SellerPhotoGallery.vue +406 -0
- package/templates/app/components/orionplace/sellers/SellerSummary.README.md +33 -0
- package/templates/app/components/orionplace/sellers/SellerSummary.vue +162 -0
- package/templates/app/components/orionplace/sellers/StorefrontSellers.README.md +73 -0
- package/templates/app/components/orionplace/sellers/StorefrontSellers.vue +300 -0
- package/templates/app/components/orionplace/shared/OrionplaceAvatar.README.md +30 -0
- package/templates/app/components/orionplace/shared/OrionplaceAvatar.vue +83 -0
- package/templates/app/components/orionplace/shared/OrionplaceBreadcrumbs.README.md +65 -0
- package/templates/app/components/orionplace/shared/OrionplaceBreadcrumbs.vue +118 -0
- package/templates/app/components/orionplace/shared/OrionplaceEmptyState.README.md +38 -0
- package/templates/app/components/orionplace/shared/OrionplaceEmptyState.vue +143 -0
- package/templates/app/components/orionplace/shared/OrionplaceImage.vue +84 -0
- package/templates/app/components/orionplace/shared/OrionplaceInfoHint.README.md +32 -0
- package/templates/app/components/orionplace/shared/OrionplaceInfoHint.vue +158 -0
- package/templates/app/components/orionplace/shared/OrionplacePasswordInput.README.md +30 -0
- package/templates/app/components/orionplace/shared/OrionplacePasswordInput.vue +197 -0
- package/templates/app/components/orionplace/shared/OrionplaceSearchSelect.README.md +38 -0
- package/templates/app/components/orionplace/shared/OrionplaceSearchSelect.vue +411 -0
- package/templates/app/components/orionplace/shared/OrionplaceSelect.README.md +31 -0
- package/templates/app/components/orionplace/shared/OrionplaceSelect.vue +525 -0
- package/templates/app/components/orionplace/shared/StorefrontErrorPage.README.md +55 -0
- package/templates/app/components/orionplace/shared/StorefrontErrorPage.vue +151 -0
- package/templates/app/components/orionplace/shared/StorefrontPagination.README.md +45 -0
- package/templates/app/components/orionplace/shared/StorefrontPagination.vue +101 -0
- package/templates/app/components/orionplace/shared/dialogs.css +36 -0
- package/templates/app/components/orionplace/shared/features.css +364 -0
- package/templates/app/components/orionplace/social/SocialLinks.vue +72 -0
- package/templates/app/components/orionplace/social/examples/SocialLinksExample.vue +6 -0
- package/templates/app/components/orionplace/storefront/StorefrontAccount.README.md +47 -0
- package/templates/app/components/orionplace/storefront/StorefrontAccount.vue +332 -0
- package/templates/app/components/orionplace/storefront/StorefrontCartButton.vue +68 -0
- package/templates/app/components/orionplace/storefront/StorefrontFooter.README.md +26 -0
- package/templates/app/components/orionplace/storefront/StorefrontFooter.vue +222 -0
- package/templates/app/components/orionplace/storefront/StorefrontHeader.README.md +93 -0
- package/templates/app/components/orionplace/storefront/StorefrontHeader.vue +509 -0
- package/templates/app/components/orionplace/storefront/StorefrontHome.README.md +79 -0
- package/templates/app/components/orionplace/storefront/StorefrontHome.vue +315 -0
- package/templates/app/components/orionplace/storefront/StorefrontWishlistButton.vue +105 -0
- package/templates/app/components/orionplace/storefront/examples/StorefrontAccountExample.vue +7 -0
- package/templates/app/components/orionplace/stores/StorefrontStores.README.md +41 -0
- package/templates/app/components/orionplace/stores/StorefrontStores.vue +345 -0
- package/templates/app/components/orionplace/subscriptions/StorefrontSubscriptions.README.md +151 -0
- package/templates/app/components/orionplace/subscriptions/StorefrontSubscriptions.vue +851 -0
- package/templates/app/components/orionplace/subscriptions/StorefrontTariff.README.md +38 -0
- package/templates/app/components/orionplace/subscriptions/StorefrontTariff.vue +535 -0
- package/templates/app/components/orionplace/subscriptions/StorefrontTariffs.README.md +36 -0
- package/templates/app/components/orionplace/subscriptions/StorefrontTariffs.vue +395 -0
- package/templates/app/components/orionplace/subscriptions/SubscriptionCancelDialog.README.md +39 -0
- package/templates/app/components/orionplace/subscriptions/SubscriptionCancelDialog.vue +292 -0
- package/templates/app/components/orionplace/subscriptions/SubscriptionChangeDialog.README.md +85 -0
- package/templates/app/components/orionplace/subscriptions/SubscriptionChangeDialog.vue +874 -0
- package/templates/app/components/orionplace/subscriptions/SubscriptionExtendDialog.README.md +53 -0
- package/templates/app/components/orionplace/subscriptions/SubscriptionExtendDialog.vue +536 -0
- package/templates/app/components/orionplace/subscriptions/SubscriptionPlanSummary.README.md +101 -0
- package/templates/app/components/orionplace/subscriptions/SubscriptionPlanSummary.vue +286 -0
- package/templates/app/components/orionplace/subscriptions/SubscriptionRemoteDetails.README.md +138 -0
- package/templates/app/components/orionplace/subscriptions/SubscriptionRemoteDetails.vue +134 -0
- package/templates/app/components/orionplace/subscriptions/SubscriptionRenewalDialog.README.md +85 -0
- package/templates/app/components/orionplace/subscriptions/SubscriptionRenewalDialog.vue +364 -0
- package/templates/app/components/orionplace/support/StorefrontSupport.README.md +39 -0
- package/templates/app/components/orionplace/support/StorefrontSupport.vue +484 -0
- package/templates/app/components/orionplace/support/TicketConversation.README.md +38 -0
- package/templates/app/components/orionplace/support/TicketConversation.vue +524 -0
- package/templates/app/components/orionplace/support/TicketImage.README.md +27 -0
- package/templates/app/components/orionplace/support/TicketImage.vue +186 -0
- package/templates/app/components/orionplace/support/TicketItemCard.README.md +59 -0
- package/templates/app/components/orionplace/support/TicketItemCard.vue +177 -0
- package/templates/app/components/orionplace/support/TicketMessageForm.README.md +35 -0
- package/templates/app/components/orionplace/support/TicketMessageForm.vue +258 -0
- package/templates/app/components/orionplace/support/TicketSubscriptionCard.README.md +40 -0
- package/templates/app/components/orionplace/support/TicketSubscriptionCard.vue +154 -0
- package/templates/app/components/orionplace/tariffs/TariffCard.README.md +12 -0
- package/templates/app/components/orionplace/tariffs/TariffCard.vue +241 -0
- package/templates/app/components/orionplace/tariffs/TariffCardDescription.README.md +12 -0
- package/templates/app/components/orionplace/tariffs/TariffCardDescription.vue +97 -0
- package/templates/app/components/orionplace/tariffs/TariffCardFeatures.README.md +14 -0
- package/templates/app/components/orionplace/tariffs/TariffCardFeatures.vue +172 -0
- package/templates/app/components/orionplace/tariffs/TariffCardImage.README.md +12 -0
- package/templates/app/components/orionplace/tariffs/TariffCardImage.vue +33 -0
- package/templates/app/components/orionplace/tariffs/TariffCardPrices.README.md +12 -0
- package/templates/app/components/orionplace/tariffs/TariffCardPrices.vue +280 -0
- package/templates/app/components/orionplace/tariffs/TariffCardTitle.README.md +12 -0
- package/templates/app/components/orionplace/tariffs/TariffCardTitle.vue +30 -0
- package/templates/app/components/orionplace/tariffs/TariffCards.README.md +12 -0
- package/templates/app/components/orionplace/tariffs/TariffCards.vue +94 -0
- package/templates/app/components/orionplace/tariffs/TariffSubscriptionModal.README.md +31 -0
- package/templates/app/components/orionplace/tariffs/TariffSubscriptionModal.vue +411 -0
- package/templates/app/components/orionplace/tariffs/examples/TariffCardDescriptionExample.vue +13 -0
- package/templates/app/components/orionplace/tariffs/examples/TariffCardExample.vue +13 -0
- package/templates/app/components/orionplace/tariffs/examples/TariffCardFeaturesExample.vue +14 -0
- package/templates/app/components/orionplace/tariffs/examples/TariffCardImageExample.vue +13 -0
- package/templates/app/components/orionplace/tariffs/examples/TariffCardPricesExample.vue +13 -0
- package/templates/app/components/orionplace/tariffs/examples/TariffCardTitleExample.vue +13 -0
- package/templates/app/components/orionplace/tariffs/examples/TariffCardsExample.vue +6 -0
- package/templates/app/components/orionplace/theme/OrionplaceThemeProvider.vue +38 -0
- package/templates/app/components/orionplace/units/UnitSwitcher.vue +71 -0
- package/templates/app/components/orionplace/units/examples/LengthExample.vue +6 -0
- package/templates/app/components/orionplace/units/examples/WeightExample.vue +6 -0
- package/templates/app/components/orionplace/wallet/StorefrontWallet.README.md +117 -0
- package/templates/app/components/orionplace/wallet/StorefrontWallet.vue +863 -0
- package/templates/app/components/orionplace/wallet/WalletBalance.vue +47 -0
- package/templates/app/components/orionplace/wallet/WalletTopUpForm.README.md +32 -0
- package/templates/app/components/orionplace/wallet/WalletTopUpForm.vue +224 -0
- package/templates/app/components/orionplace/wallet/examples/WalletExample.vue +6 -0
- package/templates/app/composables/useOrionplaceActionMenu.ts +126 -0
- package/templates/app/composables/useOrionplaceAddressEditor.ts +343 -0
- package/templates/app/composables/useOrionplaceAddresses.ts +75 -0
- package/templates/app/composables/useOrionplaceApi.ts +174 -0
- package/templates/app/composables/useOrionplaceAppLoad.ts +74 -0
- package/templates/app/composables/useOrionplaceBlogComments.ts +325 -0
- package/templates/app/composables/useOrionplaceBlogReading.ts +270 -0
- package/templates/app/composables/useOrionplaceCart.ts +226 -0
- package/templates/app/composables/useOrionplaceCartPreview.ts +142 -0
- package/templates/app/composables/useOrionplaceCategoryLink.ts +24 -0
- package/templates/app/composables/useOrionplaceCategoryProducts.ts +16 -0
- package/templates/app/composables/useOrionplaceFeature.ts +100 -0
- package/templates/app/composables/useOrionplaceFeaturedProducts.ts +14 -0
- package/templates/app/composables/useOrionplaceGeolocation.ts +28 -0
- package/templates/app/composables/useOrionplaceHomeProducts.ts +90 -0
- package/templates/app/composables/useOrionplaceManufacturerIndex.ts +83 -0
- package/templates/app/composables/useOrionplaceMap.ts +240 -0
- package/templates/app/composables/useOrionplaceMediaFormat.ts +24 -0
- package/templates/app/composables/useOrionplaceMissingPage.ts +67 -0
- package/templates/app/composables/useOrionplaceOrders.ts +185 -0
- package/templates/app/composables/useOrionplacePageSeo.ts +38 -0
- package/templates/app/composables/useOrionplaceProductActions.ts +116 -0
- package/templates/app/composables/useOrionplaceProductLink.ts +24 -0
- package/templates/app/composables/useOrionplaceProductSearch.ts +259 -0
- package/templates/app/composables/useOrionplaceProductVariants.ts +176 -0
- package/templates/app/composables/useOrionplaceProfile.ts +309 -0
- package/templates/app/composables/useOrionplaceProgress.ts +89 -0
- package/templates/app/composables/useOrionplaceReviews.ts +242 -0
- package/templates/app/composables/useOrionplaceSearchHistory.ts +23 -0
- package/templates/app/composables/useOrionplaceSearchScopeNames.ts +99 -0
- package/templates/app/composables/useOrionplaceServerData.ts +72 -0
- package/templates/app/composables/useOrionplaceSignIn.ts +66 -0
- package/templates/app/composables/useOrionplaceStableHeight.ts +69 -0
- package/templates/app/composables/useOrionplaceStorefront.ts +29 -0
- package/templates/app/composables/useOrionplaceSubscriptions.ts +217 -0
- package/templates/app/composables/useOrionplaceTheme.ts +27 -0
- package/templates/app/composables/useOrionplaceTicketSubject.ts +180 -0
- package/templates/app/composables/useOrionplaceTickets.ts +335 -0
- package/templates/app/composables/useOrionplaceWallet.ts +166 -0
- package/templates/app/error.vue +108 -0
- package/templates/app/interfaces/orionplace/accounts/IContact.ts +21 -0
- package/templates/app/interfaces/orionplace/accounts/IEmailNotificationLocale.ts +17 -0
- package/templates/app/interfaces/orionplace/accounts/IEmailVerification.ts +59 -0
- package/templates/app/interfaces/orionplace/accounts/IProfileActions.ts +38 -0
- package/templates/app/interfaces/orionplace/accounts/IProfileData.ts +123 -0
- package/templates/app/interfaces/orionplace/accounts/IProfileMedia.ts +17 -0
- package/templates/app/interfaces/orionplace/accounts/IStorefrontProfile.ts +54 -0
- package/templates/app/interfaces/orionplace/address/IAddressCitySuggestion.ts +19 -0
- package/templates/app/interfaces/orionplace/address/IAddressEditor.ts +9 -0
- package/templates/app/interfaces/orionplace/address/IAddressLocationSuggestion.ts +22 -0
- package/templates/app/interfaces/orionplace/address/IAddressRegionSearch.ts +30 -0
- package/templates/app/interfaces/orionplace/address/IAddressSuggestion.ts +20 -0
- package/templates/app/interfaces/orionplace/address/IUserAddress.ts +87 -0
- package/templates/app/interfaces/orionplace/apiBase/TMethod.ts +1 -0
- package/templates/app/interfaces/orionplace/appBase/IAppLoad.ts +16 -0
- package/templates/app/interfaces/orionplace/appBase/IAppLoadCommon.ts +45 -0
- package/templates/app/interfaces/orionplace/appBase/IApploadUserProfile.ts +13 -0
- package/templates/app/interfaces/orionplace/appBase/IForm.ts +21 -0
- package/templates/app/interfaces/orionplace/appBase/ISEO.ts +21 -0
- package/templates/app/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonBanner.ts +11 -0
- package/templates/app/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonContact.ts +8 -0
- package/templates/app/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonCurrency.ts +15 -0
- package/templates/app/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonEvents.ts +18 -0
- package/templates/app/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonLocale.ts +14 -0
- package/templates/app/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonLogos.ts +6 -0
- package/templates/app/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonPath.ts +22 -0
- package/templates/app/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonSEO.ts +26 -0
- package/templates/app/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonSocial.ts +15 -0
- package/templates/app/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonTariff.ts +7 -0
- package/templates/app/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonUnit.ts +12 -0
- package/templates/app/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonVariables.ts +8 -0
- package/templates/app/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonVisualSettings.ts +11 -0
- package/templates/app/interfaces/orionplace/appBase/appLoadCommon/IAppLoadCommonWalletValue.ts +3 -0
- package/templates/app/interfaces/orionplace/blog/IBlogApi.ts +247 -0
- package/templates/app/interfaces/orionplace/blog/IBlogPostPreview.ts +30 -0
- package/templates/app/interfaces/orionplace/cart/ICartActions.ts +67 -0
- package/templates/app/interfaces/orionplace/cart/ICartData.ts +382 -0
- package/templates/app/interfaces/orionplace/cart/ICartDeliveryActions.ts +68 -0
- package/templates/app/interfaces/orionplace/cart/ICartModal.ts +22 -0
- package/templates/app/interfaces/orionplace/cart/IDeliveryMap.ts +29 -0
- package/templates/app/interfaces/orionplace/catalog/ICatalogDirectory.ts +75 -0
- package/templates/app/interfaces/orionplace/category/ICategory.ts +41 -0
- package/templates/app/interfaces/orionplace/domains/IDomain.ts +13 -0
- package/templates/app/interfaces/orionplace/forms/ICustomerSubfilter.ts +19 -0
- package/templates/app/interfaces/orionplace/index.ts +57 -0
- package/templates/app/interfaces/orionplace/marketing/IPromoActions.ts +51 -0
- package/templates/app/interfaces/orionplace/orders/IOrderActions.ts +99 -0
- package/templates/app/interfaces/orionplace/orders/IOrderHistory.ts +259 -0
- package/templates/app/interfaces/orionplace/orders/IProductPreorder.ts +31 -0
- package/templates/app/interfaces/orionplace/payments/IInvoice.ts +147 -0
- package/templates/app/interfaces/orionplace/products/IProduct.ts +262 -0
- package/templates/app/interfaces/orionplace/products/IProductFeedbackApi.ts +218 -0
- package/templates/app/interfaces/orionplace/products/IProductSearchApi.ts +146 -0
- package/templates/app/interfaces/orionplace/products/IProductSearchFacets.ts +35 -0
- package/templates/app/interfaces/orionplace/products/IProductSecondaryVariantRequest.ts +15 -0
- package/templates/app/interfaces/orionplace/products/IProductSpecification.ts +14 -0
- package/templates/app/interfaces/orionplace/products/IWishlist.ts +22 -0
- package/templates/app/interfaces/orionplace/sellers/ISellerDirectory.ts +70 -0
- package/templates/app/interfaces/orionplace/shared/IBreadcrumb.ts +10 -0
- package/templates/app/interfaces/orionplace/shared/IGeoCoordinates.ts +4 -0
- package/templates/app/interfaces/orionplace/shared/IStorefrontControls.ts +13 -0
- package/templates/app/interfaces/orionplace/shared/ITransformValue.ts +3 -0
- package/templates/app/interfaces/orionplace/state.ts +4 -0
- package/templates/app/interfaces/orionplace/stores/IStoreDirectory.ts +63 -0
- package/templates/app/interfaces/orionplace/subscribeOptions/ISubscribeOption.ts +9 -0
- package/templates/app/interfaces/orionplace/subscribeTariff/ISubscribeTariff.ts +56 -0
- package/templates/app/interfaces/orionplace/subscribeTariff/ITariffSelection.ts +11 -0
- package/templates/app/interfaces/orionplace/subscribes/ISubscribe.ts +28 -0
- package/templates/app/interfaces/orionplace/subscribes/ISubscriptionApi.ts +125 -0
- package/templates/app/interfaces/orionplace/tickets/ICustomerTicketApi.ts +223 -0
- package/templates/app/interfaces/orionplace/transport.ts +34 -0
- package/templates/app/layouts/default.vue +376 -0
- package/templates/app/middleware/00.orionplace.global.ts +27 -0
- package/templates/app/middleware/01.orionplace-sellers.global.ts +15 -0
- package/templates/app/middleware/orionplace-account.ts +40 -0
- package/templates/app/pages/activity.vue +19 -0
- package/templates/app/pages/addresses.vue +23 -0
- package/templates/app/pages/browse.vue +246 -0
- package/templates/app/pages/cart.vue +20 -0
- package/templates/app/pages/catalog.vue +17 -0
- package/templates/app/pages/category/[id].vue +142 -0
- package/templates/app/pages/contact.vue +17 -0
- package/templates/app/pages/featured.vue +144 -0
- package/templates/app/pages/index.vue +194 -0
- package/templates/app/pages/journal/[id].vue +128 -0
- package/templates/app/pages/journal/index.vue +67 -0
- package/templates/app/pages/logout.vue +71 -0
- package/templates/app/pages/manufacturers.vue +33 -0
- package/templates/app/pages/orders.vue +40 -0
- package/templates/app/pages/product/[id].vue +126 -0
- package/templates/app/pages/profile.vue +118 -0
- package/templates/app/pages/promo/[id].vue +67 -0
- package/templates/app/pages/promocodes.vue +21 -0
- package/templates/app/pages/sellers.vue +203 -0
- package/templates/app/pages/stores.vue +36 -0
- package/templates/app/pages/subscriptions.vue +21 -0
- package/templates/app/pages/tariffs/[slug]/[id].vue +126 -0
- package/templates/app/pages/tariffs/index.vue +50 -0
- package/templates/app/pages/tickets.vue +56 -0
- package/templates/app/pages/unsubscribe.vue +32 -0
- package/templates/app/pages/wallet.vue +23 -0
- package/templates/app/pages/wishlist.vue +48 -0
- package/templates/app/stores/orionplace.ts +493 -0
- package/templates/app/stores/orionplaceBrowse.ts +79 -0
- package/templates/app/stores/orionplaceCatalog.ts +121 -0
- package/templates/app/stores/orionplaceDomainAccess.ts +55 -0
- package/templates/app/stores/orionplaceProducts.ts +249 -0
- package/templates/app/stores/orionplaceSelections.ts +132 -0
- package/templates/app/themes/orionplace.ts +108 -0
- package/templates/app/utils/orionplace/accountLabels.ts +22 -0
- package/templates/app/utils/orionplace/activityLabels.ts +65 -0
- package/templates/app/utils/orionplace/activityPresentation.ts +16 -0
- package/templates/app/utils/orionplace/addressChanges.ts +26 -0
- package/templates/app/utils/orionplace/addressRegions.ts +17 -0
- package/templates/app/utils/orionplace/api.ts +333 -0
- package/templates/app/utils/orionplace/blogArticleHtml.ts +318 -0
- package/templates/app/utils/orionplace/blogComments.ts +133 -0
- package/templates/app/utils/orionplace/blogLabels.ts +111 -0
- package/templates/app/utils/orionplace/blogLayout.ts +95 -0
- package/templates/app/utils/orionplace/breadcrumbLabels.ts +11 -0
- package/templates/app/utils/orionplace/browseLabels.ts +98 -0
- package/templates/app/utils/orionplace/cartAddress.ts +94 -0
- package/templates/app/utils/orionplace/cartLabels.ts +261 -0
- package/templates/app/utils/orionplace/cartOptions.ts +143 -0
- package/templates/app/utils/orionplace/cartPreview.ts +108 -0
- package/templates/app/utils/orionplace/cartPromo.ts +150 -0
- package/templates/app/utils/orionplace/cartShipment.ts +74 -0
- package/templates/app/utils/orionplace/cartSnapshot.ts +20 -0
- package/templates/app/utils/orionplace/catalog.ts +106 -0
- package/templates/app/utils/orionplace/category.ts +52 -0
- package/templates/app/utils/orionplace/categoryLabels.ts +31 -0
- package/templates/app/utils/orionplace/contactLabels.ts +102 -0
- package/templates/app/utils/orionplace/currency.ts +128 -0
- package/templates/app/utils/orionplace/deliveryMap.ts +89 -0
- package/templates/app/utils/orionplace/directoryLabels.ts +131 -0
- package/templates/app/utils/orionplace/emptyStateArt.ts +231 -0
- package/templates/app/utils/orionplace/errorPageLabels.ts +80 -0
- package/templates/app/utils/orionplace/featureData.ts +25 -0
- package/templates/app/utils/orionplace/featureLabels.ts +271 -0
- package/templates/app/utils/orionplace/featuredLabels.ts +28 -0
- package/templates/app/utils/orionplace/files.ts +71 -0
- package/templates/app/utils/orionplace/footerLabels.ts +35 -0
- package/templates/app/utils/orionplace/guestSession.ts +50 -0
- package/templates/app/utils/orionplace/headerLabels.ts +68 -0
- package/templates/app/utils/orionplace/homeContent.ts +129 -0
- package/templates/app/utils/orionplace/homeLabels.ts +52 -0
- package/templates/app/utils/orionplace/htmlText.ts +59 -0
- package/templates/app/utils/orionplace/links.ts +14 -0
- package/templates/app/utils/orionplace/manufacturerIndex.ts +91 -0
- package/templates/app/utils/orionplace/modalWindow.ts +109 -0
- package/templates/app/utils/orionplace/nativeApp.ts +361 -0
- package/templates/app/utils/orionplace/notice.ts +22 -0
- package/templates/app/utils/orionplace/orderLabels.ts +309 -0
- package/templates/app/utils/orionplace/orderPresentation.ts +586 -0
- package/templates/app/utils/orionplace/pageSeo.ts +274 -0
- package/templates/app/utils/orionplace/paginationScroll.ts +131 -0
- package/templates/app/utils/orionplace/phone.ts +22 -0
- package/templates/app/utils/orionplace/presentation.ts +72 -0
- package/templates/app/utils/orionplace/productActionLabels.ts +60 -0
- package/templates/app/utils/orionplace/productActions.ts +547 -0
- package/templates/app/utils/orionplace/productAvailability.ts +36 -0
- package/templates/app/utils/orionplace/productGallery.ts +72 -0
- package/templates/app/utils/orionplace/productLabels.ts +82 -0
- package/templates/app/utils/orionplace/productManufacturer.ts +30 -0
- package/templates/app/utils/orionplace/productPage.ts +46 -0
- package/templates/app/utils/orionplace/productPhotos.ts +67 -0
- package/templates/app/utils/orionplace/productSearchScope.ts +237 -0
- package/templates/app/utils/orionplace/productSeller.ts +51 -0
- package/templates/app/utils/orionplace/profile.ts +136 -0
- package/templates/app/utils/orionplace/profileLabels.ts +151 -0
- package/templates/app/utils/orionplace/promoLabels.ts +75 -0
- package/templates/app/utils/orionplace/promoPresentation.ts +381 -0
- package/templates/app/utils/orionplace/reviewLabels.ts +172 -0
- package/templates/app/utils/orionplace/reviewScope.ts +41 -0
- package/templates/app/utils/orionplace/richText.ts +13 -0
- package/templates/app/utils/orionplace/searchFilters.ts +99 -0
- package/templates/app/utils/orionplace/searchHistory.ts +144 -0
- package/templates/app/utils/orionplace/sellerDirectory.ts +134 -0
- package/templates/app/utils/orionplace/seo.ts +52 -0
- package/templates/app/utils/orionplace/serverCookies.ts +88 -0
- package/templates/app/utils/orionplace/sessionLabels.ts +27 -0
- package/templates/app/utils/orionplace/signInReturn.ts +89 -0
- package/templates/app/utils/orionplace/storeDirectory.ts +50 -0
- package/templates/app/utils/orionplace/subscriptionChanges.ts +167 -0
- package/templates/app/utils/orionplace/subscriptionLabels.ts +67 -0
- package/templates/app/utils/orionplace/subscriptionManageLabels.ts +307 -0
- package/templates/app/utils/orionplace/subscriptionPlans.ts +162 -0
- package/templates/app/utils/orionplace/subscriptionRemote.ts +110 -0
- package/templates/app/utils/orionplace/subscriptionUsage.ts +82 -0
- package/templates/app/utils/orionplace/tariffLabels.ts +130 -0
- package/templates/app/utils/orionplace/tariffPage.ts +77 -0
- package/templates/app/utils/orionplace/tariffVariables.ts +165 -0
- package/templates/app/utils/orionplace/tariffs.ts +284 -0
- package/templates/app/utils/orionplace/ticketItems.ts +87 -0
- package/templates/app/utils/orionplace/ticketLabels.ts +335 -0
- package/templates/app/utils/orionplace/ticketLocation.ts +79 -0
- package/templates/app/utils/orionplace/walletTransaction.ts +135 -0
- package/templates/app/utils/orionplaceAppLoad.ts +73 -0
- package/templates/orionplace/COMPONENT-DOWNLOAD.md +40 -0
- package/templates/orionplace/COMPONENTS.md +1983 -0
- package/templates/orionplace/THEMES.md +94 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Product card purchase controls · Nuxt
|
|
2
|
+
|
|
3
|
+
`ProductCardActions` reads the product selected by `productId` and `collection`.
|
|
4
|
+
`EProductStatus.PUBLISHED` with positive `c_real_left` allows cart actions.
|
|
5
|
+
Add emits `{ product, quantity }` with the requested total quantity. A positive
|
|
6
|
+
`cart_counts.modal_quantity` shows the quantity controls; at one, removal emits
|
|
7
|
+
`{ product, cartItem }`, using `cart_counts.cart_id`. The host supplies updated
|
|
8
|
+
product data after confirming the request.
|
|
9
|
+
|
|
10
|
+
For a product with secondary variants, adding or increasing quantity first emits
|
|
11
|
+
`requestVariants` without a payload. The enclosing `ProductCard` opens
|
|
12
|
+
`ProductCardVariants` through `openForPurchase()`. The picker emits the purchase
|
|
13
|
+
event for the customer's chosen product. Standalone hosts must handle
|
|
14
|
+
`requestVariants`; `variantSelectionResolved` is for an explicitly chosen variant.
|
|
15
|
+
Decreasing quantity, removal and cancellation of a notification use the current
|
|
16
|
+
product directly.
|
|
17
|
+
|
|
18
|
+
The notification button is available unless the product has positive stock and
|
|
19
|
+
status `EProductStatus.PUBLISHED` or `EProductStatus.PUBLISHED_AS_OPTION`.
|
|
20
|
+
`subscription_id` selects `subscribe` or `unsubscribe`, each with `{ product }`.
|
|
21
|
+
The host handles sign-in, the request and confirmed subscription data.
|
|
22
|
+
Preorder additionally requires `allow_preorder`, the seller's
|
|
23
|
+
`is_accepting_preorders`, no available stock and status `EProductStatus.LOW_STOCK`
|
|
24
|
+
or `EProductStatus.LOW_SALE_STOCK`. Its event is `{ product }`; the host collects
|
|
25
|
+
any required contact details and sends the preorder request.
|
|
26
|
+
|
|
27
|
+
The [English guide](https://orionmarket.place/en/sandbox/components/nuxt/productCardActions)
|
|
28
|
+
and [Russian guide](https://orionmarket.place/ru/sandbox/components/nuxt/productCardActions)
|
|
29
|
+
provide a demonstration cart and notification state synchronized with editable
|
|
30
|
+
product JSON. The low-stock switch sets `EProductStatus.LOW_STOCK` with zero
|
|
31
|
+
stock to show Notify; switching it off sets `EProductStatus.PUBLISHED` with
|
|
32
|
+
available stock. Reset restores the original data. Demonstration actions leave
|
|
33
|
+
the reader's cart and notification subscriptions unchanged.
|
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-if="product"
|
|
4
|
+
class="min-w-0"
|
|
5
|
+
:class="iconOnly ? 'flex flex-wrap items-end justify-end gap-1' : 'grid gap-2'"
|
|
6
|
+
data-product-actions
|
|
7
|
+
>
|
|
8
|
+
<div
|
|
9
|
+
v-if="quantity > 0 && availability.canAdd"
|
|
10
|
+
role="group"
|
|
11
|
+
:aria-label="quantityLabel || copy.quantity"
|
|
12
|
+
class="flex min-w-0 items-stretch overflow-hidden border border-solid"
|
|
13
|
+
:class="{
|
|
14
|
+
'h-9 border-orionplace-surface bg-orionplace-accent text-orionplace-surface':
|
|
15
|
+
iconOnly,
|
|
16
|
+
'h-11 border-orionplace-text bg-orionplace-surface text-orionplace-text':
|
|
17
|
+
!iconOnly,
|
|
18
|
+
}"
|
|
19
|
+
data-product-quantity
|
|
20
|
+
>
|
|
21
|
+
<button
|
|
22
|
+
type="button"
|
|
23
|
+
:disabled="disabled || !canDecrease"
|
|
24
|
+
:aria-label="quantity === 1 ? copy.remove : copy.decrease"
|
|
25
|
+
class="
|
|
26
|
+
grid h-full shrink-0 place-items-center
|
|
27
|
+
cursor-pointer border-0 bg-transparent p-0
|
|
28
|
+
text-base text-inherit
|
|
29
|
+
outline-none transition-colors motion-reduce:transition-none
|
|
30
|
+
disabled:cursor-default
|
|
31
|
+
"
|
|
32
|
+
:class="{
|
|
33
|
+
'w-9': iconOnly,
|
|
34
|
+
'enabled:hover:bg-orionplace-surface/15 focus-visible:bg-orionplace-surface/15':
|
|
35
|
+
iconOnly,
|
|
36
|
+
'disabled:text-orionplace-inverse-muted': iconOnly,
|
|
37
|
+
'w-11': !iconOnly,
|
|
38
|
+
'enabled:hover:bg-orionplace-hover focus-visible:bg-orionplace-hover':
|
|
39
|
+
!iconOnly,
|
|
40
|
+
'disabled:opacity-40': !iconOnly,
|
|
41
|
+
}"
|
|
42
|
+
data-product-decrease
|
|
43
|
+
@click="decrease"
|
|
44
|
+
>
|
|
45
|
+
<svg
|
|
46
|
+
v-if="quantity === 1"
|
|
47
|
+
viewBox="0 0 24 24"
|
|
48
|
+
class="h-4 w-4"
|
|
49
|
+
fill="none"
|
|
50
|
+
stroke="currentColor"
|
|
51
|
+
stroke-width="1.5"
|
|
52
|
+
aria-hidden="true"
|
|
53
|
+
>
|
|
54
|
+
<path d="M4 7h16M9 7V4h6v3M6 7l1 14h10l1-14M10 10v8m4-8v8" />
|
|
55
|
+
</svg>
|
|
56
|
+
<span
|
|
57
|
+
v-else
|
|
58
|
+
aria-hidden="true"
|
|
59
|
+
>
|
|
60
|
+
−
|
|
61
|
+
</span>
|
|
62
|
+
</button>
|
|
63
|
+
<span
|
|
64
|
+
class="
|
|
65
|
+
grid min-w-6 flex-1 place-items-center
|
|
66
|
+
text-center text-sm font-medium tabular-nums
|
|
67
|
+
"
|
|
68
|
+
:class="{
|
|
69
|
+
'border-0 border-x border-solid border-orionplace-border': !iconOnly,
|
|
70
|
+
}"
|
|
71
|
+
aria-live="polite"
|
|
72
|
+
aria-atomic="true"
|
|
73
|
+
>
|
|
74
|
+
{{ quantity }}
|
|
75
|
+
</span>
|
|
76
|
+
<button
|
|
77
|
+
type="button"
|
|
78
|
+
:disabled="disabled || !canIncrease"
|
|
79
|
+
:aria-label="copy.increase"
|
|
80
|
+
class="
|
|
81
|
+
grid h-full shrink-0 place-items-center
|
|
82
|
+
cursor-pointer border-0 bg-transparent p-0
|
|
83
|
+
text-base text-inherit
|
|
84
|
+
outline-none transition-colors motion-reduce:transition-none
|
|
85
|
+
disabled:cursor-default
|
|
86
|
+
"
|
|
87
|
+
:class="{
|
|
88
|
+
'w-9': iconOnly,
|
|
89
|
+
'enabled:hover:bg-orionplace-surface/15 focus-visible:bg-orionplace-surface/15':
|
|
90
|
+
iconOnly,
|
|
91
|
+
'disabled:text-orionplace-inverse-muted': iconOnly,
|
|
92
|
+
'w-11': !iconOnly,
|
|
93
|
+
'enabled:hover:bg-orionplace-hover focus-visible:bg-orionplace-hover':
|
|
94
|
+
!iconOnly,
|
|
95
|
+
'disabled:opacity-40': !iconOnly,
|
|
96
|
+
}"
|
|
97
|
+
data-product-increase
|
|
98
|
+
@click="add(quantity + 1)"
|
|
99
|
+
>
|
|
100
|
+
+
|
|
101
|
+
</button>
|
|
102
|
+
</div>
|
|
103
|
+
<button
|
|
104
|
+
v-else-if="availability.canAdd"
|
|
105
|
+
type="button"
|
|
106
|
+
:disabled="disabled"
|
|
107
|
+
:title="iconOnly ? label || copy.addHint : undefined"
|
|
108
|
+
:aria-label="label || copy.addHint"
|
|
109
|
+
class="
|
|
110
|
+
box-border grid min-w-0 place-items-center
|
|
111
|
+
cursor-pointer border border-solid
|
|
112
|
+
outline-none transition-[opacity,background-color]
|
|
113
|
+
motion-reduce:transition-none
|
|
114
|
+
disabled:cursor-default
|
|
115
|
+
"
|
|
116
|
+
:class="actionClasses"
|
|
117
|
+
data-product-add
|
|
118
|
+
@click="add(1)"
|
|
119
|
+
>
|
|
120
|
+
<svg
|
|
121
|
+
v-if="iconOnly"
|
|
122
|
+
viewBox="0 0 24 24"
|
|
123
|
+
class="h-4 w-4"
|
|
124
|
+
fill="none"
|
|
125
|
+
stroke="currentColor"
|
|
126
|
+
stroke-width="1.75"
|
|
127
|
+
stroke-linecap="round"
|
|
128
|
+
stroke-linejoin="round"
|
|
129
|
+
aria-hidden="true"
|
|
130
|
+
>
|
|
131
|
+
<path d="M3 4h2l3 12h11l2-8H6" />
|
|
132
|
+
<circle
|
|
133
|
+
cx="9"
|
|
134
|
+
cy="20"
|
|
135
|
+
r="1"
|
|
136
|
+
/>
|
|
137
|
+
<circle
|
|
138
|
+
cx="18"
|
|
139
|
+
cy="20"
|
|
140
|
+
r="1"
|
|
141
|
+
/>
|
|
142
|
+
</svg>
|
|
143
|
+
<span :class="{ 'sr-only': iconOnly }">
|
|
144
|
+
{{ label || copy.add }}
|
|
145
|
+
</span>
|
|
146
|
+
</button>
|
|
147
|
+
<button
|
|
148
|
+
v-if="availability.canSubscribe"
|
|
149
|
+
type="button"
|
|
150
|
+
:disabled="disabled"
|
|
151
|
+
:title="iconOnly ? subscriptionHint : undefined"
|
|
152
|
+
:aria-label="subscriptionHint"
|
|
153
|
+
class="
|
|
154
|
+
box-border grid min-w-0 place-items-center
|
|
155
|
+
cursor-pointer border border-solid
|
|
156
|
+
outline-none transition-[opacity,background-color]
|
|
157
|
+
motion-reduce:transition-none
|
|
158
|
+
disabled:cursor-default
|
|
159
|
+
"
|
|
160
|
+
:class="actionClasses"
|
|
161
|
+
data-product-subscription
|
|
162
|
+
@click="subscription"
|
|
163
|
+
>
|
|
164
|
+
<svg
|
|
165
|
+
v-if="iconOnly"
|
|
166
|
+
viewBox="0 0 24 24"
|
|
167
|
+
class="h-4 w-4"
|
|
168
|
+
fill="none"
|
|
169
|
+
stroke="currentColor"
|
|
170
|
+
stroke-width="1.75"
|
|
171
|
+
stroke-linecap="round"
|
|
172
|
+
stroke-linejoin="round"
|
|
173
|
+
aria-hidden="true"
|
|
174
|
+
>
|
|
175
|
+
<path d="M6 9a6 6 0 0 1 12 0v6l2 3H4l2-3V9m4 12h4" />
|
|
176
|
+
<path
|
|
177
|
+
v-if="availability.isSubscribed"
|
|
178
|
+
d="m3 3 18 18"
|
|
179
|
+
/>
|
|
180
|
+
</svg>
|
|
181
|
+
<span :class="{ 'sr-only': iconOnly }">
|
|
182
|
+
{{ subscriptionLabel }}
|
|
183
|
+
</span>
|
|
184
|
+
</button>
|
|
185
|
+
<button
|
|
186
|
+
v-if="availability.canPreorder"
|
|
187
|
+
type="button"
|
|
188
|
+
:disabled="disabled"
|
|
189
|
+
:title="iconOnly ? copy.preorder : undefined"
|
|
190
|
+
class="
|
|
191
|
+
box-border grid min-w-0 place-items-center
|
|
192
|
+
cursor-pointer border border-solid
|
|
193
|
+
outline-none transition-[opacity,background-color]
|
|
194
|
+
motion-reduce:transition-none
|
|
195
|
+
disabled:cursor-default
|
|
196
|
+
"
|
|
197
|
+
:class="actionClasses"
|
|
198
|
+
data-product-preorder
|
|
199
|
+
@click="preorder"
|
|
200
|
+
>
|
|
201
|
+
<svg
|
|
202
|
+
v-if="iconOnly"
|
|
203
|
+
viewBox="0 0 24 24"
|
|
204
|
+
class="h-4 w-4"
|
|
205
|
+
fill="none"
|
|
206
|
+
stroke="currentColor"
|
|
207
|
+
stroke-width="1.75"
|
|
208
|
+
stroke-linecap="round"
|
|
209
|
+
stroke-linejoin="round"
|
|
210
|
+
aria-hidden="true"
|
|
211
|
+
>
|
|
212
|
+
<circle
|
|
213
|
+
cx="12"
|
|
214
|
+
cy="12"
|
|
215
|
+
r="9"
|
|
216
|
+
/>
|
|
217
|
+
<path d="M12 7v5l3 2" />
|
|
218
|
+
</svg>
|
|
219
|
+
<span :class="{ 'sr-only': iconOnly }">
|
|
220
|
+
{{ copy.preorder }}
|
|
221
|
+
</span>
|
|
222
|
+
</button>
|
|
223
|
+
<p
|
|
224
|
+
v-if="
|
|
225
|
+
!availability.canAdd &&
|
|
226
|
+
!availability.canSubscribe &&
|
|
227
|
+
!availability.canPreorder
|
|
228
|
+
"
|
|
229
|
+
class="
|
|
230
|
+
m-0 text-[11px] leading-4 uppercase tracking-[0.08em]
|
|
231
|
+
text-orionplace-muted
|
|
232
|
+
"
|
|
233
|
+
:class="{
|
|
234
|
+
'border border-solid border-orionplace-accent bg-orionplace-surface px-2 py-1':
|
|
235
|
+
iconOnly,
|
|
236
|
+
}"
|
|
237
|
+
>
|
|
238
|
+
{{ product.status.status_display || copy.unavailable }}
|
|
239
|
+
</p>
|
|
240
|
+
</div>
|
|
241
|
+
</template>
|
|
242
|
+
|
|
243
|
+
<script setup lang="ts">
|
|
244
|
+
import { computed } from 'vue';
|
|
245
|
+
import { useOrionplaceProductsStore } from '@/stores/orionplaceProducts';
|
|
246
|
+
import { useOrionplaceSelectionsStore } from '@/stores/orionplaceSelections';
|
|
247
|
+
import { productLabels } from '@/utils/orionplace/productLabels';
|
|
248
|
+
|
|
249
|
+
const props = withDefaults(
|
|
250
|
+
defineProps<{
|
|
251
|
+
productId: number;
|
|
252
|
+
collection?: 'products' | 'featured';
|
|
253
|
+
label?: string;
|
|
254
|
+
quantityLabel?: string;
|
|
255
|
+
iconOnly?: boolean;
|
|
256
|
+
disabled?: boolean;
|
|
257
|
+
variantSelectionResolved?: boolean;
|
|
258
|
+
}>(),
|
|
259
|
+
{
|
|
260
|
+
collection: 'products',
|
|
261
|
+
iconOnly: false,
|
|
262
|
+
disabled: false,
|
|
263
|
+
variantSelectionResolved: false,
|
|
264
|
+
},
|
|
265
|
+
);
|
|
266
|
+
const productStore = useOrionplaceProductsStore();
|
|
267
|
+
const selectionStore = useOrionplaceSelectionsStore();
|
|
268
|
+
const product = computed(() =>
|
|
269
|
+
productStore.getProduct(props.productId, props.collection),
|
|
270
|
+
);
|
|
271
|
+
const copy = computed(() => productLabels(selectionStore.localeCode));
|
|
272
|
+
const availability = computed(() =>
|
|
273
|
+
productStore.getProductAvailability(props.productId, props.collection),
|
|
274
|
+
);
|
|
275
|
+
const subscriptionLabel = computed(() =>
|
|
276
|
+
availability.value.isSubscribed
|
|
277
|
+
? copy.value.unsubscribe
|
|
278
|
+
: copy.value.subscribe,
|
|
279
|
+
);
|
|
280
|
+
const subscriptionHint = computed(() =>
|
|
281
|
+
availability.value.isSubscribed
|
|
282
|
+
? copy.value.unsubscribeHint
|
|
283
|
+
: copy.value.subscribeHint,
|
|
284
|
+
);
|
|
285
|
+
// Over a photo the filled control keeps its own surface and adds a hairline
|
|
286
|
+
// in the opposite tone, so it separates from a light and from a dark
|
|
287
|
+
// picture. A disabled control keeps that surface and dims only its icon.
|
|
288
|
+
const actionClasses = computed(() => {
|
|
289
|
+
if (props.iconOnly) {
|
|
290
|
+
return [
|
|
291
|
+
'h-9 w-9 shrink-0 p-0',
|
|
292
|
+
'border-orionplace-surface bg-orionplace-accent text-orionplace-surface',
|
|
293
|
+
'enabled:hover:opacity-85 focus-visible:opacity-85',
|
|
294
|
+
'disabled:text-orionplace-inverse-muted',
|
|
295
|
+
];
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
return [
|
|
299
|
+
'h-11 w-full px-6',
|
|
300
|
+
'text-xs font-medium uppercase tracking-[0.08em]',
|
|
301
|
+
'border-orionplace-accent bg-orionplace-accent text-orionplace-surface',
|
|
302
|
+
'enabled:hover:opacity-85 focus-visible:opacity-85',
|
|
303
|
+
'disabled:opacity-40',
|
|
304
|
+
];
|
|
305
|
+
});
|
|
306
|
+
const quantity = computed(() => {
|
|
307
|
+
const storedQuantity = product.value?.cart_counts?.modal_quantity;
|
|
308
|
+
|
|
309
|
+
return Number.isInteger(storedQuantity) && Number(storedQuantity) > 0
|
|
310
|
+
? Number(storedQuantity)
|
|
311
|
+
: 0;
|
|
312
|
+
});
|
|
313
|
+
const cartItem = computed(() => product.value?.cart_counts?.cart_id);
|
|
314
|
+
const canIncrease = computed(
|
|
315
|
+
() =>
|
|
316
|
+
availability.value.canAdd &&
|
|
317
|
+
quantity.value < availability.value.maxQuantity,
|
|
318
|
+
);
|
|
319
|
+
const canDecrease = computed(() => {
|
|
320
|
+
if (quantity.value === 1) {
|
|
321
|
+
return Number.isInteger(cartItem.value) && Number(cartItem.value) > 0;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
return (
|
|
325
|
+
availability.value.canAdd &&
|
|
326
|
+
quantity.value > 1 &&
|
|
327
|
+
quantity.value - 1 <= availability.value.maxQuantity
|
|
328
|
+
);
|
|
329
|
+
});
|
|
330
|
+
const emit = defineEmits<{
|
|
331
|
+
add: [selection: { product: number; quantity: number }];
|
|
332
|
+
remove: [selection: { product: number; cartItem: number }];
|
|
333
|
+
subscribe: [selection: { product: number }];
|
|
334
|
+
unsubscribe: [selection: { product: number }];
|
|
335
|
+
preorder: [selection: { product: number }];
|
|
336
|
+
requestVariants: [];
|
|
337
|
+
}>();
|
|
338
|
+
|
|
339
|
+
function requestVariants() {
|
|
340
|
+
const needsSelection =
|
|
341
|
+
!props.variantSelectionResolved &&
|
|
342
|
+
product.value?.variants.main_variant?.second_exists;
|
|
343
|
+
|
|
344
|
+
if (needsSelection) {
|
|
345
|
+
// The host opens the picker; its selected product owns the purchase event.
|
|
346
|
+
emit('requestVariants');
|
|
347
|
+
return true;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
return false;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
function add(requestedQuantity: number) {
|
|
354
|
+
if (
|
|
355
|
+
!product.value ||
|
|
356
|
+
props.disabled ||
|
|
357
|
+
!availability.value.canAdd ||
|
|
358
|
+
!Number.isInteger(requestedQuantity) ||
|
|
359
|
+
requestedQuantity < 1 ||
|
|
360
|
+
requestedQuantity > availability.value.maxQuantity
|
|
361
|
+
) {
|
|
362
|
+
return;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
if (requestedQuantity > quantity.value && requestVariants()) {
|
|
366
|
+
return;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
emit('add', { product: product.value.id, quantity: requestedQuantity });
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
function decrease() {
|
|
373
|
+
if (!product.value || props.disabled || !canDecrease.value) {
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
if (quantity.value === 1) {
|
|
378
|
+
emit('remove', {
|
|
379
|
+
product: product.value.id,
|
|
380
|
+
cartItem: Number(cartItem.value),
|
|
381
|
+
});
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
add(quantity.value - 1);
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
function subscription() {
|
|
389
|
+
if (!product.value || props.disabled || !availability.value.canSubscribe) {
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
const selection = { product: product.value.id };
|
|
394
|
+
|
|
395
|
+
if (availability.value.isSubscribed) {
|
|
396
|
+
emit('unsubscribe', selection);
|
|
397
|
+
} else if (!requestVariants()) {
|
|
398
|
+
emit('subscribe', selection);
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
function preorder() {
|
|
403
|
+
if (
|
|
404
|
+
product.value &&
|
|
405
|
+
!props.disabled &&
|
|
406
|
+
availability.value.canPreorder &&
|
|
407
|
+
!requestVariants()
|
|
408
|
+
) {
|
|
409
|
+
emit('preorder', { product: product.value.id });
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
</script>
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-if="badges.length"
|
|
4
|
+
class="flex flex-wrap items-start gap-1"
|
|
5
|
+
>
|
|
6
|
+
<span
|
|
7
|
+
v-for="badge in badges"
|
|
8
|
+
:key="badge.key"
|
|
9
|
+
class="
|
|
10
|
+
px-2 py-0.5
|
|
11
|
+
text-[11px] font-medium leading-4 uppercase tracking-[0.08em]
|
|
12
|
+
"
|
|
13
|
+
:class="
|
|
14
|
+
badge.accent
|
|
15
|
+
? 'bg-orionplace-danger text-orionplace-surface'
|
|
16
|
+
: 'bg-orionplace-inverse-surface text-orionplace-inverse-text'
|
|
17
|
+
"
|
|
18
|
+
>
|
|
19
|
+
{{ badge.label }}
|
|
20
|
+
</span>
|
|
21
|
+
</div>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script setup lang="ts">
|
|
25
|
+
import { useOrionplaceProductsStore } from '@/stores/orionplaceProducts';
|
|
26
|
+
import { useOrionplaceSelectionsStore } from '@/stores/orionplaceSelections';
|
|
27
|
+
import { productLabels } from '@/utils/orionplace/productLabels';
|
|
28
|
+
|
|
29
|
+
import { computed } from 'vue';
|
|
30
|
+
|
|
31
|
+
// Omitted labels follow the current locale; an empty string hides a badge.
|
|
32
|
+
const props = withDefaults(
|
|
33
|
+
defineProps<{
|
|
34
|
+
productId: number;
|
|
35
|
+
collection?: 'products' | 'featured';
|
|
36
|
+
|
|
37
|
+
newLabel?: string;
|
|
38
|
+
popularLabel?: string;
|
|
39
|
+
dealLabel?: string;
|
|
40
|
+
lowStockLabel?: string;
|
|
41
|
+
}>(),
|
|
42
|
+
{ collection: 'products' },
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
const productStore = useOrionplaceProductsStore();
|
|
46
|
+
const selectionStore = useOrionplaceSelectionsStore();
|
|
47
|
+
const product = computed(() =>
|
|
48
|
+
productStore.getProduct(props.productId, props.collection),
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
const flags = computed(() => product.value?.flags ?? {});
|
|
52
|
+
|
|
53
|
+
const copy = computed(() => productLabels(selectionStore.localeCode));
|
|
54
|
+
|
|
55
|
+
const badges = computed(() =>
|
|
56
|
+
[
|
|
57
|
+
{
|
|
58
|
+
key: 'new',
|
|
59
|
+
shown: flags.value.flag_is_new,
|
|
60
|
+
label: props.newLabel ?? copy.value.badgeNew,
|
|
61
|
+
accent: false,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
key: 'popular',
|
|
65
|
+
shown: flags.value.flag_is_popular,
|
|
66
|
+
label: props.popularLabel ?? copy.value.badgePopular,
|
|
67
|
+
accent: false,
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
key: 'deal',
|
|
71
|
+
shown: flags.value.flag_is_good_deal,
|
|
72
|
+
label: props.dealLabel ?? copy.value.badgeDeal,
|
|
73
|
+
accent: true,
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
key: 'low-stock',
|
|
77
|
+
shown: flags.value.flag_is_soon_be_out,
|
|
78
|
+
label: props.lowStockLabel ?? copy.value.badgeLowStock,
|
|
79
|
+
accent: true,
|
|
80
|
+
},
|
|
81
|
+
].filter((badge) => badge.shown && badge.label),
|
|
82
|
+
);
|
|
83
|
+
</script>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<p
|
|
3
|
+
v-if="product"
|
|
4
|
+
class="m-0 text-sm leading-6 text-orionplace-muted"
|
|
5
|
+
>
|
|
6
|
+
{{ description }}
|
|
7
|
+
</p>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script setup lang="ts">
|
|
11
|
+
import { useOrionplaceProductsStore } from '@/stores/orionplaceProducts';
|
|
12
|
+
import { useOrionplaceSelectionsStore } from '@/stores/orionplaceSelections';
|
|
13
|
+
|
|
14
|
+
import { computed } from 'vue';
|
|
15
|
+
|
|
16
|
+
import {
|
|
17
|
+
getAvailableNestedValueFromObject,
|
|
18
|
+
plainText,
|
|
19
|
+
} from '@/utils/orionplace/presentation';
|
|
20
|
+
|
|
21
|
+
const props = withDefaults(
|
|
22
|
+
defineProps<{
|
|
23
|
+
productId: number;
|
|
24
|
+
collection?: 'products' | 'featured';
|
|
25
|
+
}>(),
|
|
26
|
+
{ collection: 'products' },
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
const productStore = useOrionplaceProductsStore();
|
|
30
|
+
const selectionStore = useOrionplaceSelectionsStore();
|
|
31
|
+
const product = computed(() =>
|
|
32
|
+
productStore.getProduct(props.productId, props.collection),
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
const translations = computed(() => product.value?.locale);
|
|
36
|
+
|
|
37
|
+
const description = computed(() =>
|
|
38
|
+
plainText(
|
|
39
|
+
getAvailableNestedValueFromObject(
|
|
40
|
+
translations.value,
|
|
41
|
+
selectionStore.localeCode,
|
|
42
|
+
'short_description',
|
|
43
|
+
),
|
|
44
|
+
),
|
|
45
|
+
);
|
|
46
|
+
</script>
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<button
|
|
3
|
+
type="button"
|
|
4
|
+
:aria-pressed="Boolean(wishlistId)"
|
|
5
|
+
:aria-label="caption"
|
|
6
|
+
:title="iconOnly ? caption : undefined"
|
|
7
|
+
:disabled="disabled || !product"
|
|
8
|
+
class="
|
|
9
|
+
inline-grid shrink-0 place-items-center
|
|
10
|
+
cursor-pointer border border-solid text-xs
|
|
11
|
+
outline-none transition-colors motion-reduce:transition-none
|
|
12
|
+
enabled:hover:bg-orionplace-hover
|
|
13
|
+
focus-visible:bg-orionplace-hover focus-visible:border-orionplace-text
|
|
14
|
+
disabled:cursor-default disabled:opacity-50
|
|
15
|
+
"
|
|
16
|
+
:class="{
|
|
17
|
+
'h-9 w-9 rounded-full border-transparent bg-transparent p-0': iconOnly,
|
|
18
|
+
'h-11 px-4 uppercase tracking-[0.08em]': !iconOnly,
|
|
19
|
+
'border-orionplace-text bg-orionplace-surface': !iconOnly,
|
|
20
|
+
'text-orionplace-accent': wishlistId,
|
|
21
|
+
'text-orionplace-text': !wishlistId,
|
|
22
|
+
}"
|
|
23
|
+
data-product-favorite
|
|
24
|
+
@click="toggle"
|
|
25
|
+
>
|
|
26
|
+
<svg
|
|
27
|
+
v-if="iconOnly"
|
|
28
|
+
viewBox="0 0 24 24"
|
|
29
|
+
class="h-5 w-5"
|
|
30
|
+
:fill="wishlistId ? 'currentColor' : 'none'"
|
|
31
|
+
stroke="currentColor"
|
|
32
|
+
stroke-width="1.5"
|
|
33
|
+
stroke-linecap="round"
|
|
34
|
+
stroke-linejoin="round"
|
|
35
|
+
aria-hidden="true"
|
|
36
|
+
>
|
|
37
|
+
<path
|
|
38
|
+
d="M12 20 4.2 12.4C-1.2 7.1 6.5.1 12 6.5 17.5.1 25.2 7.1 19.8 12.4Z"
|
|
39
|
+
/>
|
|
40
|
+
</svg>
|
|
41
|
+
<span :class="{ 'sr-only': iconOnly }">
|
|
42
|
+
{{ iconOnly ? caption : shortCaption }}
|
|
43
|
+
</span>
|
|
44
|
+
</button>
|
|
45
|
+
</template>
|
|
46
|
+
|
|
47
|
+
<script setup lang="ts">
|
|
48
|
+
import { useOrionplaceProductsStore } from '@/stores/orionplaceProducts';
|
|
49
|
+
import { useOrionplaceSelectionsStore } from '@/stores/orionplaceSelections';
|
|
50
|
+
|
|
51
|
+
import { computed } from 'vue';
|
|
52
|
+
import { productLabels } from '@/utils/orionplace/productLabels';
|
|
53
|
+
|
|
54
|
+
const props = withDefaults(
|
|
55
|
+
defineProps<{
|
|
56
|
+
productId: number;
|
|
57
|
+
collection?: 'products' | 'featured';
|
|
58
|
+
|
|
59
|
+
label?: string;
|
|
60
|
+
selectedLabel?: string;
|
|
61
|
+
iconOnly?: boolean;
|
|
62
|
+
disabled?: boolean;
|
|
63
|
+
}>(),
|
|
64
|
+
{
|
|
65
|
+
collection: 'products',
|
|
66
|
+
iconOnly: true,
|
|
67
|
+
disabled: false,
|
|
68
|
+
},
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
const productStore = useOrionplaceProductsStore();
|
|
72
|
+
const selectionStore = useOrionplaceSelectionsStore();
|
|
73
|
+
const product = computed(() =>
|
|
74
|
+
productStore.getProduct(props.productId, props.collection),
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
const wishlistId = computed(() => product.value?.whishlist_id);
|
|
78
|
+
const copy = computed(() => productLabels(selectionStore.localeCode));
|
|
79
|
+
const caption = computed(() =>
|
|
80
|
+
wishlistId.value
|
|
81
|
+
? props.selectedLabel || copy.value.removeFavorite
|
|
82
|
+
: props.label || copy.value.addFavorite,
|
|
83
|
+
);
|
|
84
|
+
// Visible one-word text; `caption` stays the accessible name.
|
|
85
|
+
const shortCaption = computed(() =>
|
|
86
|
+
wishlistId.value
|
|
87
|
+
? props.selectedLabel || copy.value.unsaveFavorite
|
|
88
|
+
: props.label || copy.value.saveFavorite,
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
const emit = defineEmits<{ toggle: [selected: boolean] }>();
|
|
92
|
+
|
|
93
|
+
// A guest's click is emitted too: the storefront then opens sign-in.
|
|
94
|
+
function toggle() {
|
|
95
|
+
if (product.value && !props.disabled) {
|
|
96
|
+
emit('toggle', !wishlistId.value);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
</script>
|