@revenexx/cover 0.1.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 +21 -0
- package/README.md +39 -0
- package/app/api/account.ts +8 -0
- package/app/api/categories.ts +3 -0
- package/app/api/checkout.ts +6 -0
- package/app/api/images.ts +4 -0
- package/app/api/markets.ts +3 -0
- package/app/api/product.ts +3 -0
- package/app/api/products.ts +4 -0
- package/app/api/search.ts +4 -0
- package/app/app.config.ts +29 -0
- package/app/assets/css/cover.css +25 -0
- package/app/components/account/AccountMenu.vue +30 -0
- package/app/components/account/AccountShell.vue +18 -0
- package/app/components/account/AccountSidebar.vue +90 -0
- package/app/components/account/address/AccountAddressCard.vue +287 -0
- package/app/components/account/carts/AccountCartsTable.vue +284 -0
- package/app/components/account/dashboard/AccountDashboard.vue +351 -0
- package/app/components/account/directorder/AccountDirectOrder.vue +512 -0
- package/app/components/account/governance/AccountApprovalLimitsTable.vue +221 -0
- package/app/components/account/governance/AccountCostCenterDetail.vue +276 -0
- package/app/components/account/governance/AccountCostCentersTable.vue +252 -0
- package/app/components/account/governance/AccountRequisitionDetail.vue +295 -0
- package/app/components/account/governance/AccountRequisitionsTable.vue +255 -0
- package/app/components/account/governance/AccountWorkflowDetail.vue +215 -0
- package/app/components/account/governance/AccountWorkflowsTable.vue +168 -0
- package/app/components/account/governance/GovernanceApprovalLimitModal.vue +183 -0
- package/app/components/account/governance/GovernanceCostCenterModal.vue +188 -0
- package/app/components/account/governance/GovernanceWorkflowModal.vue +191 -0
- package/app/components/account/orderlists/AccountOrderListDetail.vue +349 -0
- package/app/components/account/orderlists/AccountOrderListsTable.vue +352 -0
- package/app/components/account/orders/AccountOrderDetail.vue +376 -0
- package/app/components/account/orders/AccountOrdersTable.vue +281 -0
- package/app/components/account/preferences/AccountPreferences.vue +50 -0
- package/app/components/auth/AuthForgotPasswordPanel.vue +88 -0
- package/app/components/auth/AuthLoginPanel.vue +103 -0
- package/app/components/auth/AuthLoginTeaser.vue +24 -0
- package/app/components/auth/AuthPageHeader.vue +21 -0
- package/app/components/auth/AuthRegisterPanel.vue +431 -0
- package/app/components/auth/AuthRegisterTeaser.vue +24 -0
- package/app/components/auth/AuthResetPasswordPanel.vue +115 -0
- package/app/components/cart/CartButton.vue +42 -0
- package/app/components/cart/actions/CartCostCenterModal.vue +110 -0
- package/app/components/cart/actions/CartExportModal.vue +82 -0
- package/app/components/cart/actions/CartPositionTextsModal.vue +92 -0
- package/app/components/cart/actions/CartSaveToListModal.vue +177 -0
- package/app/components/cart/actions/CartWorkflowPickerModal.vue +64 -0
- package/app/components/cart/drawer/CartDrawer.vue +49 -0
- package/app/components/cart/item/CartItem.vue +318 -0
- package/app/components/cart/manage/CartNameModal.vue +68 -0
- package/app/components/cart/position/CartPosition.vue +369 -0
- package/app/components/cart/quickadd/CartQuickAdd.vue +145 -0
- package/app/components/cart/recommend/CartCrossSell.vue +102 -0
- package/app/components/cart/recommend/CartRecommendCard.vue +59 -0
- package/app/components/cart/recommend/CartReorderStrip.vue +108 -0
- package/app/components/cart/requisition/CartRequisitionGroup.vue +74 -0
- package/app/components/cart/skeleton/CartSkeleton.vue +18 -0
- package/app/components/cart/summary/CartSummary.vue +25 -0
- package/app/components/cart/summary/CartSummaryBreakdown.vue +35 -0
- package/app/components/cart/switcher/CartSwitcher.vue +147 -0
- package/app/components/cart/target/CartTargetModal.vue +129 -0
- package/app/components/cart/view/CartApprovalsPanel.vue +89 -0
- package/app/components/cart/view/CartListHeader.vue +86 -0
- package/app/components/cart/view/CartPositionList.vue +94 -0
- package/app/components/cart/view/CartSummaryPanel.vue +254 -0
- package/app/components/cart/view/CartView.vue +310 -0
- package/app/components/category/info/CategoryPrice.vue +47 -0
- package/app/components/category/info/CategorySku.vue +15 -0
- package/app/components/category/info/CategoryStock.vue +25 -0
- package/app/components/category/list/CategoryItemCount.vue +27 -0
- package/app/components/category/list/CategoryListPagination.vue +81 -0
- package/app/components/category/skeleton/CategoryDetailSkeleton.vue +12 -0
- package/app/components/category/skeleton/CategoryListSkeleton.vue +65 -0
- package/app/components/category/view/CategoryViewToggle.vue +33 -0
- package/app/components/category/view/GridView.vue +78 -0
- package/app/components/category/view/ListView.vue +80 -0
- package/app/components/checkout/confirmation/CheckoutConfirmationView.vue +289 -0
- package/app/components/checkout/form/CheckoutSchemaForm.vue +72 -0
- package/app/components/checkout/onepage/CheckoutAddressPickerModal.vue +260 -0
- package/app/components/checkout/onepage/CheckoutAddressSection.vue +186 -0
- package/app/components/checkout/onepage/CheckoutDeliverySection.vue +158 -0
- package/app/components/checkout/onepage/CheckoutGate.vue +67 -0
- package/app/components/checkout/onepage/CheckoutGuestDetailsSection.vue +154 -0
- package/app/components/checkout/onepage/CheckoutNotesSection.vue +62 -0
- package/app/components/checkout/onepage/CheckoutOnePageView.vue +77 -0
- package/app/components/checkout/onepage/CheckoutPaymentSection.vue +181 -0
- package/app/components/checkout/onepage/CheckoutSectionTitle.vue +18 -0
- package/app/components/checkout/onepage/CheckoutSummarySection.vue +211 -0
- package/app/components/checkout/onepage/CheckoutWorkflowPanel.vue +38 -0
- package/app/components/layout/AppLogo.vue +21 -0
- package/app/components/layout/footer/Footer.vue +148 -0
- package/app/components/layout/header/AppBar.vue +75 -0
- package/app/components/layout/header/CategoryNav.vue +93 -0
- package/app/components/layout/header/HeaderActionItem.vue +81 -0
- package/app/components/layout/header/LocaleSwitcher.vue +123 -0
- package/app/components/layout/header/MainNav.vue +61 -0
- package/app/components/layout/header/MobileMenu.vue +81 -0
- package/app/components/layout/header/TopBar.vue +63 -0
- package/app/components/listing/ListingView.vue +227 -0
- package/app/components/product/detail/ProductDetailAddToCart.vue +188 -0
- package/app/components/product/detail/ProductDetailDescription.vue +20 -0
- package/app/components/product/detail/ProductDetailImageGallery.vue +58 -0
- package/app/components/product/detail/ProductDetailPricing.vue +108 -0
- package/app/components/product/detail/ProductDetailSaveToList.vue +291 -0
- package/app/components/product/detail/ProductDetailSpecifications.vue +33 -0
- package/app/components/product/detail/ProductDetailStock.vue +36 -0
- package/app/components/search/filter/SearchFacets.vue +256 -0
- package/app/components/search/filter/SearchFacetsDrawer.vue +58 -0
- package/app/components/ui/AppShell.vue +7 -0
- package/app/components/ui/debug/PiniaStateCard.vue +106 -0
- package/app/components/ui/feedback/EmptyState.vue +30 -0
- package/app/components/ui/feedback/ErrorBoundary.vue +44 -0
- package/app/components/ui/feedback/NotFound.vue +34 -0
- package/app/components/ui/forms/CountrySelection.vue +14 -0
- package/app/components/ui/forms/FormKitDatePicker.vue +124 -0
- package/app/components/ui/forms/PasswordInput.vue +136 -0
- package/app/components/ui/forms/SearchInput.vue +213 -0
- package/app/components/ui/table/TableSortButton.vue +51 -0
- package/app/components/ui/table/TableToolbar.vue +66 -0
- package/app/composables/useAccount.ts +27 -0
- package/app/composables/useAccountAddresses.ts +116 -0
- package/app/composables/useAccountOrders.ts +18 -0
- package/app/composables/useAppUrl.ts +38 -0
- package/app/composables/useAuthStore.ts +202 -0
- package/app/composables/useB2BContext.ts +23 -0
- package/app/composables/useCartActions.ts +25 -0
- package/app/composables/useCartCalculation.ts +90 -0
- package/app/composables/useCartSelection.ts +46 -0
- package/app/composables/useCartStore.ts +837 -0
- package/app/composables/useCartSummaryFormatting.ts +28 -0
- package/app/composables/useCategories.ts +29 -0
- package/app/composables/useCheckoutOnePage.ts +438 -0
- package/app/composables/useCheckoutProfileSource.ts +8 -0
- package/app/composables/useCheckoutSchema.ts +28 -0
- package/app/composables/useDataTable.ts +14 -0
- package/app/composables/useFormValidation.ts +29 -0
- package/app/composables/useIcons.ts +17 -0
- package/app/composables/useLocalePreferences.ts +45 -0
- package/app/composables/useMarkets.ts +15 -0
- package/app/composables/useProduct.ts +89 -0
- package/app/composables/useProductCard.ts +8 -0
- package/app/composables/useProductCardActions.ts +106 -0
- package/app/composables/useProductImage.ts +12 -0
- package/app/composables/useProductListing.ts +210 -0
- package/app/composables/useProductUrl.ts +17 -0
- package/app/composables/useProducts.ts +130 -0
- package/app/composables/useSearch.ts +12 -0
- package/app/composables/useThemeStore.ts +81 -0
- package/app/composables/useViewMode.ts +18 -0
- package/app/config/countries.ts +74 -0
- package/app/config/icons.ts +283 -0
- package/app/config/navigation.ts +191 -0
- package/app/config/palette.ts +13 -0
- package/app/config/themes.ts +20 -0
- package/app/formkit.config.ts +50 -0
- package/app/interfaces/account/address-list.ts +34 -0
- package/app/interfaces/account/order-list.ts +47 -0
- package/app/interfaces/account/order-lists.ts +35 -0
- package/app/interfaces/account/profile.ts +17 -0
- package/app/interfaces/account.ts +3 -0
- package/app/interfaces/address.ts +9 -0
- package/app/interfaces/auth.ts +104 -0
- package/app/interfaces/b2b.ts +234 -0
- package/app/interfaces/cart-calculation.ts +131 -0
- package/app/interfaces/cart-item.ts +45 -0
- package/app/interfaces/checkout-draft.ts +4 -0
- package/app/interfaces/checkout.ts +43 -0
- package/app/interfaces/delivery.ts +13 -0
- package/app/interfaces/market.ts +24 -0
- package/app/interfaces/payment.ts +19 -0
- package/app/interfaces/persisted-cart.ts +10 -0
- package/app/interfaces/product-detail.ts +54 -0
- package/app/interfaces/product-list.ts +33 -0
- package/app/interfaces/search-facets.ts +14 -0
- package/app/interfaces/validation.ts +14 -0
- package/app/layouts/default.vue +78 -0
- package/app/layouts/focus.vue +80 -0
- package/app/plugins/formkit-locale.client.ts +23 -0
- package/app/shared/constants.ts +1 -0
- package/app/validations/companyName.ts +18 -0
- package/app/validations/emailFormat.ts +10 -0
- package/app/validations/formValidationConfig.ts +50 -0
- package/app/validations/maxLength.ts +12 -0
- package/app/validations/minLength.ts +9 -0
- package/app/validations/optionalCompanyName.ts +23 -0
- package/app/validations/passwordsMatch.ts +5 -0
- package/app/validations/phoneNumber.ts +19 -0
- package/app/validations/required.ts +11 -0
- package/app/validations/termsRequired.ts +4 -0
- package/app/validations/types.ts +10 -0
- package/app/validations/zipCode.ts +15 -0
- package/i18n/locales/de/account.json +458 -0
- package/i18n/locales/de/auth.json +155 -0
- package/i18n/locales/de/cart.json +263 -0
- package/i18n/locales/de/checkout.json +217 -0
- package/i18n/locales/de/common.json +80 -0
- package/i18n/locales/de/cover.json +33 -0
- package/i18n/locales/de/order.json +1 -0
- package/i18n/locales/de/product.json +71 -0
- package/i18n/locales/de/search.json +54 -0
- package/i18n/locales/de/validation.json +12 -0
- package/i18n/locales/en/account.json +458 -0
- package/i18n/locales/en/auth.json +155 -0
- package/i18n/locales/en/cart.json +263 -0
- package/i18n/locales/en/checkout.json +217 -0
- package/i18n/locales/en/common.json +80 -0
- package/i18n/locales/en/cover.json +33 -0
- package/i18n/locales/en/order.json +1 -0
- package/i18n/locales/en/product.json +71 -0
- package/i18n/locales/en/search.json +54 -0
- package/i18n/locales/en/validation.json +12 -0
- package/nuxt.config.ts +109 -0
- package/package.json +65 -0
- package/public/img/product-placeholder.svg +8 -0
- package/public/templates/direct-order-template.csv +3 -0
- package/public/templates/direct-order-template.xlsx +0 -0
- package/server/api/account/address/[id].delete.ts +51 -0
- package/server/api/account/address/[id].put.ts +83 -0
- package/server/api/account/address/index.post.ts +60 -0
- package/server/api/account/addresses.get.ts +25 -0
- package/server/api/account/context.get.ts +16 -0
- package/server/api/account/governance/[domain]/[id].put.ts +57 -0
- package/server/api/account/governance/[domain].post.ts +111 -0
- package/server/api/account/order-lists/[id].delete.ts +22 -0
- package/server/api/account/order-lists/[id].get.ts +17 -0
- package/server/api/account/order-lists/[id].put.ts +46 -0
- package/server/api/account/order-lists/index.get.ts +14 -0
- package/server/api/account/order-lists/index.post.ts +38 -0
- package/server/api/account/orders/[id].get.ts +35 -0
- package/server/api/account/orders.get.ts +35 -0
- package/server/api/account/profile.get.ts +56 -0
- package/server/api/account/profile.put.ts +128 -0
- package/server/api/account/requisitions/[id].get.ts +15 -0
- package/server/api/account/requisitions.get.ts +23 -0
- package/server/api/auth/login.post.ts +37 -0
- package/server/api/auth/logout.post.ts +4 -0
- package/server/api/auth/me.get.ts +3 -0
- package/server/api/auth/personas.get.ts +7 -0
- package/server/api/auth/recovery.post.ts +32 -0
- package/server/api/auth/recovery.put.ts +37 -0
- package/server/api/auth/register.post.ts +126 -0
- package/server/api/cart/calculate.post.ts +25 -0
- package/server/api/cart/export.post.ts +81 -0
- package/server/api/cart/index.delete.ts +10 -0
- package/server/api/cart/index.get.ts +10 -0
- package/server/api/cart/sync.post.ts +14 -0
- package/server/api/carts/[id]/activate.post.ts +18 -0
- package/server/api/carts/[id]/index.delete.ts +18 -0
- package/server/api/carts/[id]/index.put.ts +19 -0
- package/server/api/carts/[id]/items.post.ts +21 -0
- package/server/api/carts/index.get.ts +14 -0
- package/server/api/carts/index.post.ts +14 -0
- package/server/api/categories/[slug].get.ts +22 -0
- package/server/api/categories/index.get.ts +11 -0
- package/server/api/checkout/profile.get.ts +21 -0
- package/server/api/checkout/schema/[key].get.ts +19 -0
- package/server/api/checkout/session.post.ts +8 -0
- package/server/api/images/detail/[filename].get.ts +18 -0
- package/server/api/images/list/[filename].get.ts +17 -0
- package/server/api/markets.get.ts +9 -0
- package/server/api/orders/index.post.ts +376 -0
- package/server/api/payment/methods.post.ts +65 -0
- package/server/api/product/[id].get.ts +29 -0
- package/server/api/products/[id].get.ts +30 -0
- package/server/api/products/index.get.ts +21 -0
- package/server/api/requisitions/index.post.ts +67 -0
- package/server/api/shipping/rates.post.ts +70 -0
- package/server/api/themes/index.get.ts +9 -0
- package/server/api/typesense/drop.get.ts +22 -0
- package/server/api/typesense/health.get.ts +9 -0
- package/server/api/typesense/search.post.ts +199 -0
- package/server/api/typesense/seed.get.ts +112 -0
- package/server/api/typesense/suggest.post.ts +69 -0
- package/server/config/account/organization.json +146 -0
- package/server/config/account/personas.json +169 -0
- package/server/config/account/user.json +8 -0
- package/server/config/account/workflows.json +19 -0
- package/server/data/account/address-list.json +103 -0
- package/server/data/account/order-list.json +491 -0
- package/server/data/account/order-lists.json +149 -0
- package/server/data/account/profile.json +9 -0
- package/server/data/account/registration-requests.json +3 -0
- package/server/data/account/requisitions.json +686 -0
- package/server/data/categories.json +186 -0
- package/server/data/forms/checkout/add-address.json +24 -0
- package/server/data/list/5137-1.png +0 -0
- package/server/data/list/5498-1.png +0 -0
- package/server/data/list/5498-2.png +0 -0
- package/server/data/list/5498-3.png +0 -0
- package/server/data/list/5498-4.png +0 -0
- package/server/data/list/5498-5.png +0 -0
- package/server/data/list/5498-6.png +0 -0
- package/server/data/list/5519-1.png +0 -0
- package/server/data/list/5713-1.png +0 -0
- package/server/data/list/5789-1.png +0 -0
- package/server/data/list/5930-1.png +0 -0
- package/server/data/list/6127-1.png +0 -0
- package/server/data/list/6234-1.png +0 -0
- package/server/data/list/6238-1.png +0 -0
- package/server/data/list/6246-1.png +0 -0
- package/server/data/list/6270-1.png +0 -0
- package/server/data/list/6330-1.png +0 -0
- package/server/data/list/6336-1.png +0 -0
- package/server/data/list/6360-1.png +0 -0
- package/server/data/list/6363-1.png +0 -0
- package/server/data/list/6375-1.png +0 -0
- package/server/data/list/6385-1.png +0 -0
- package/server/data/list/6413-1.png +0 -0
- package/server/data/list/6418-1.png +0 -0
- package/server/data/list/6465-1.png +0 -0
- package/server/data/list/6477-1.png +0 -0
- package/server/data/list/6509-1.png +0 -0
- package/server/data/list/6545-1.png +0 -0
- package/server/data/list/6548-1.png +0 -0
- package/server/data/list/6566-1.png +0 -0
- package/server/data/list/6581-1.png +0 -0
- package/server/data/list/6609-1.png +0 -0
- package/server/data/list/6611-1.png +0 -0
- package/server/data/list/6641-1.png +0 -0
- package/server/data/list/6659-1.png +0 -0
- package/server/data/list/6662-1.png +0 -0
- package/server/data/list/6689-1.png +0 -0
- package/server/data/list/6698-1.png +0 -0
- package/server/data/list/6701-1.png +0 -0
- package/server/data/list/6752-1.png +0 -0
- package/server/data/list/6755-1.png +0 -0
- package/server/data/list/6837-1.png +0 -0
- package/server/data/list/6841-1.png +0 -0
- package/server/data/list/6844-1.png +0 -0
- package/server/data/list/6846-1.png +0 -0
- package/server/data/list/6886-1.png +0 -0
- package/server/data/list/6895-1.png +0 -0
- package/server/data/list/6897-1.png +0 -0
- package/server/data/list/6919-1.png +0 -0
- package/server/data/list/6977-1.png +0 -0
- package/server/data/list/6983-1.png +0 -0
- package/server/data/list/6984-1.png +0 -0
- package/server/data/list/6985-1.png +0 -0
- package/server/data/list/6986-1.png +0 -0
- package/server/data/list/6989-1.png +0 -0
- package/server/data/list/6995-1.png +0 -0
- package/server/data/list/6998-1.png +0 -0
- package/server/data/markets.json +24 -0
- package/server/data/product-detail.json +2450 -0
- package/server/data/product-list.json +2450 -0
- package/server/data/themes.json +8 -0
- package/server/interfaces/account.ts +20 -0
- package/server/interfaces/auth.ts +32 -0
- package/server/interfaces/b2bContext.ts +23 -0
- package/server/interfaces/cart.ts +46 -0
- package/server/interfaces/cartCalculation.ts +17 -0
- package/server/interfaces/category.ts +12 -0
- package/server/interfaces/checkoutProfile.ts +5 -0
- package/server/interfaces/log.ts +3 -0
- package/server/interfaces/market.ts +10 -0
- package/server/interfaces/product.ts +21 -0
- package/server/interfaces/schema.ts +20 -0
- package/server/interfaces/theme.ts +10 -0
- package/server/services/ApiAuthService.ts +138 -0
- package/server/services/ApiCartService.ts +254 -0
- package/server/services/ApiCategoryService.ts +25 -0
- package/server/services/ApiMarketService.ts +71 -0
- package/server/services/ApiProductService.ts +53 -0
- package/server/services/LocalFileCategoryService.ts +23 -0
- package/server/services/LocalFileCheckoutProfileService.ts +117 -0
- package/server/services/LocalFileProductService.ts +128 -0
- package/server/services/LocalFileSchemaService.ts +70 -0
- package/server/services/LocalFileThemeService.ts +18 -0
- package/server/services/LogService.ts +28 -0
- package/server/services/MockAccountService.ts +58 -0
- package/server/services/MockAuthService.ts +105 -0
- package/server/services/MockB2BContextService.ts +149 -0
- package/server/services/MockCartCalculationService.ts +395 -0
- package/server/services/MockMarketService.ts +18 -0
- package/server/services/SdkAccountService.ts +56 -0
- package/server/services/SdkAuthService.ts +83 -0
- package/server/services/SessionCartService.ts +31 -0
- package/server/utils/accountService.ts +30 -0
- package/server/utils/authCookie.ts +13 -0
- package/server/utils/authService.ts +43 -0
- package/server/utils/b2bService.ts +49 -0
- package/server/utils/cartService.ts +59 -0
- package/server/utils/categoryService.ts +19 -0
- package/server/utils/checkoutProfileService.ts +9 -0
- package/server/utils/checkoutSession.ts +38 -0
- package/server/utils/coverData.ts +84 -0
- package/server/utils/governanceStore.ts +38 -0
- package/server/utils/i18n.ts +76 -0
- package/server/utils/inventoryService.ts +14 -0
- package/server/utils/liveCatalog.ts +234 -0
- package/server/utils/liveInventories.ts +76 -0
- package/server/utils/liveOrders.ts +139 -0
- package/server/utils/livePrices.ts +93 -0
- package/server/utils/locale.ts +39 -0
- package/server/utils/logService.ts +19 -0
- package/server/utils/marketService.ts +24 -0
- package/server/utils/orderService.ts +14 -0
- package/server/utils/paymentService.ts +14 -0
- package/server/utils/priceService.ts +14 -0
- package/server/utils/productService.ts +28 -0
- package/server/utils/productsSchema.ts +30 -0
- package/server/utils/revenexxApi.ts +136 -0
- package/server/utils/schemaService.ts +25 -0
- package/server/utils/serviceMode.ts +70 -0
- package/server/utils/shippingService.ts +14 -0
- package/server/utils/shopSdk.ts +88 -0
- package/server/utils/themeService.ts +16 -0
- package/server/utils/typesense.ts +27 -0
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import CartExportModal from "../actions/CartExportModal.vue";
|
|
3
|
+
import CartCostCenterModal from "../actions/CartCostCenterModal.vue";
|
|
4
|
+
import CartPositionTextsModal from "../actions/CartPositionTextsModal.vue";
|
|
5
|
+
import CartSaveToListModal from "../actions/CartSaveToListModal.vue";
|
|
6
|
+
import AccountDirectOrder from "../../account/directorder/AccountDirectOrder.vue";
|
|
7
|
+
import CartQuickAdd from "../quickadd/CartQuickAdd.vue";
|
|
8
|
+
import CartCrossSell from "../recommend/CartCrossSell.vue";
|
|
9
|
+
import CartReorderStrip from "../recommend/CartReorderStrip.vue";
|
|
10
|
+
import CartRequisitionGroup from "../requisition/CartRequisitionGroup.vue";
|
|
11
|
+
import CartListHeader from "./CartListHeader.vue";
|
|
12
|
+
import CartPositionList from "./CartPositionList.vue";
|
|
13
|
+
import CartSummaryPanel from "./CartSummaryPanel.vue";
|
|
14
|
+
import type { Requisition } from "../../../interfaces/b2b";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The Cart 2.0 page composition (spec: Warenkorb 2.0 Basis Layout):
|
|
18
|
+
* message box, sticky selection header with bulk actions, free positions,
|
|
19
|
+
* requisition groups, quick entry and the sticky calculated summary.
|
|
20
|
+
*/
|
|
21
|
+
const { icon } = useIcons();
|
|
22
|
+
const { t } = useI18n();
|
|
23
|
+
const { to } = useAppUrl();
|
|
24
|
+
const toast = useToast();
|
|
25
|
+
const cart = useCartStore();
|
|
26
|
+
const selection = useCartSelection();
|
|
27
|
+
const actions = useCartActions();
|
|
28
|
+
const { role, workflows, settings } = useB2BContext();
|
|
29
|
+
const { calculation, linesByKey } = useCartCalculation({ orchestrate: true });
|
|
30
|
+
|
|
31
|
+
const hydrated = ref(false);
|
|
32
|
+
onMounted(() => {
|
|
33
|
+
hydrated.value = true;
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const { items, requisitions, isEmpty, itemCount } = storeToRefs(cart);
|
|
37
|
+
|
|
38
|
+
const freeItems = computed(() => items.value.filter(i => !i.requisitionId));
|
|
39
|
+
const itemsByRequisition = computed(() => {
|
|
40
|
+
const map = new Map<string, typeof items.value>();
|
|
41
|
+
for (const item of items.value) {
|
|
42
|
+
if (item.requisitionId) {
|
|
43
|
+
const list = map.get(item.requisitionId) ?? [];
|
|
44
|
+
list.push(item);
|
|
45
|
+
map.set(item.requisitionId, list);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return map;
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
// Keep the selection in sync when positions leave the cart.
|
|
52
|
+
watch(items, () => selection.prune(), { deep: true });
|
|
53
|
+
|
|
54
|
+
const cartItemCount = computed(() =>
|
|
55
|
+
t("cart.page.itemCount", itemCount.value, { count: itemCount.value }),
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
const quickAddOpen = ref(false);
|
|
59
|
+
|
|
60
|
+
/* ---- loadable requisitions (orderer side, spec: hinzufügen) -------- */
|
|
61
|
+
const canLoadRequisitions = computed(() =>
|
|
62
|
+
Boolean(role.value && role.value !== "requester" && workflows.value.length > 0
|
|
63
|
+
&& settings.value?.workflows.enabled),
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
const { data: openRequisitions } = useFetch<Requisition[]>(
|
|
67
|
+
"/api/account/requisitions",
|
|
68
|
+
{ query: { status: "open" }, key: "open-requisitions", server: false, lazy: true, default: () => [] },
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
const loadableRequisitions = computed(() =>
|
|
72
|
+
(openRequisitions.value ?? []).filter(r =>
|
|
73
|
+
!requisitions.value.some(loaded => loaded.id === r.id),
|
|
74
|
+
),
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
function loadRequisition(requisition: Requisition): void {
|
|
78
|
+
const added = cart.addRequisition(requisition);
|
|
79
|
+
if (!added) {
|
|
80
|
+
toast.add({
|
|
81
|
+
title: t("cart.requisition.mergeRejected"),
|
|
82
|
+
description: t("cart.requisition.mergeRejectedDescription"),
|
|
83
|
+
color: "warning",
|
|
84
|
+
icon: icon("warning"),
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const messageColor = (severity: string) =>
|
|
90
|
+
severity === "error" ? "error" as const : severity === "warning" ? "warning" as const : "info" as const;
|
|
91
|
+
</script>
|
|
92
|
+
|
|
93
|
+
<template>
|
|
94
|
+
<UContainer class="py-6 lg:py-8">
|
|
95
|
+
<div class="flex flex-wrap items-center justify-between gap-4 mb-4">
|
|
96
|
+
<div class="flex items-center gap-4">
|
|
97
|
+
<h1 class="text-2xl font-semibold text-highlighted">
|
|
98
|
+
{{ t('cart.page.title') }}
|
|
99
|
+
</h1>
|
|
100
|
+
<CartSwitcher class="print:hidden" />
|
|
101
|
+
</div>
|
|
102
|
+
<UButton
|
|
103
|
+
v-if="!isEmpty"
|
|
104
|
+
:icon="icon('direct-order')"
|
|
105
|
+
color="neutral"
|
|
106
|
+
variant="outline"
|
|
107
|
+
size="sm"
|
|
108
|
+
tabindex="0"
|
|
109
|
+
class="print:hidden"
|
|
110
|
+
:label="t('cart.quickAdd.action')"
|
|
111
|
+
@click="quickAddOpen = true"
|
|
112
|
+
/>
|
|
113
|
+
</div>
|
|
114
|
+
|
|
115
|
+
<!-- Error / notice box (spec area 1) -->
|
|
116
|
+
<div
|
|
117
|
+
v-if="calculation?.messages.length"
|
|
118
|
+
class="space-y-2 mb-4"
|
|
119
|
+
>
|
|
120
|
+
<UAlert
|
|
121
|
+
v-for="message in calculation.messages"
|
|
122
|
+
:key="message.code"
|
|
123
|
+
:color="messageColor(message.severity)"
|
|
124
|
+
variant="soft"
|
|
125
|
+
:icon="icon(message.severity === 'error' ? 'error' : 'warning')"
|
|
126
|
+
:title="t(message.messageKey, message.params ?? {})"
|
|
127
|
+
/>
|
|
128
|
+
</div>
|
|
129
|
+
|
|
130
|
+
<!-- Loadable requisitions (orderer) -->
|
|
131
|
+
<div
|
|
132
|
+
v-if="canLoadRequisitions && loadableRequisitions.length"
|
|
133
|
+
class="mb-4 border border-(--ui-border) rounded-xl p-4 space-y-2 print:hidden"
|
|
134
|
+
>
|
|
135
|
+
<h2 class="text-sm font-semibold text-highlighted">
|
|
136
|
+
{{ t('cart.requisition.openTitle') }}
|
|
137
|
+
</h2>
|
|
138
|
+
<div
|
|
139
|
+
v-for="requisition in loadableRequisitions"
|
|
140
|
+
:key="requisition.id"
|
|
141
|
+
class="flex flex-wrap items-center justify-between gap-2 text-sm"
|
|
142
|
+
>
|
|
143
|
+
<span class="text-muted">
|
|
144
|
+
{{ requisition.workflowName }} ·
|
|
145
|
+
{{ t('cart.requisition.shortMeta', {
|
|
146
|
+
name: requisition.requestedBy.name,
|
|
147
|
+
count: requisition.items.length,
|
|
148
|
+
}) }}
|
|
149
|
+
</span>
|
|
150
|
+
<UButton
|
|
151
|
+
color="primary"
|
|
152
|
+
variant="soft"
|
|
153
|
+
size="xs"
|
|
154
|
+
tabindex="0"
|
|
155
|
+
:label="t('cart.requisition.load')"
|
|
156
|
+
@click="loadRequisition(requisition)"
|
|
157
|
+
/>
|
|
158
|
+
</div>
|
|
159
|
+
</div>
|
|
160
|
+
|
|
161
|
+
<!-- Skeleton until the client cart hydrates -->
|
|
162
|
+
<template v-if="!hydrated">
|
|
163
|
+
<div class="grid grid-cols-1 lg:grid-cols-12 gap-6 lg:gap-8">
|
|
164
|
+
<section class="lg:col-span-8 border border-(--ui-border) rounded-xl p-4 md:p-5">
|
|
165
|
+
<CartSkeleton />
|
|
166
|
+
</section>
|
|
167
|
+
<aside class="lg:col-span-4 space-y-4">
|
|
168
|
+
<div class="border border-(--ui-border) rounded-xl p-4 md:p-5 space-y-3">
|
|
169
|
+
<USkeleton class="h-5 w-40" />
|
|
170
|
+
<USkeleton class="h-4 w-full" />
|
|
171
|
+
<USkeleton class="h-4 w-5/6" />
|
|
172
|
+
<USkeleton class="h-9 w-full" />
|
|
173
|
+
</div>
|
|
174
|
+
</aside>
|
|
175
|
+
</div>
|
|
176
|
+
</template>
|
|
177
|
+
|
|
178
|
+
<!-- Empty cart (spec: Leerer Warenkorb) -->
|
|
179
|
+
<template v-else-if="isEmpty">
|
|
180
|
+
<UAlert
|
|
181
|
+
color="info"
|
|
182
|
+
variant="soft"
|
|
183
|
+
:icon="icon('info')"
|
|
184
|
+
:title="t('cart.emptyState.title')"
|
|
185
|
+
:description="t('cart.emptyState.description')"
|
|
186
|
+
class="mb-6"
|
|
187
|
+
/>
|
|
188
|
+
<div class="grid sm:grid-cols-2 gap-8 items-start">
|
|
189
|
+
<div class="border border-(--ui-border) rounded-xl p-4 md:p-5 space-y-3">
|
|
190
|
+
<h2 class="text-sm font-semibold text-highlighted">
|
|
191
|
+
{{ t('cart.quickAdd.title') }}
|
|
192
|
+
</h2>
|
|
193
|
+
<CartQuickAdd />
|
|
194
|
+
</div>
|
|
195
|
+
<div class="flex flex-col items-start gap-3">
|
|
196
|
+
<p class="text-sm text-muted">
|
|
197
|
+
{{ t('cart.emptyState.browseHint') }}
|
|
198
|
+
</p>
|
|
199
|
+
<div class="flex flex-wrap gap-2">
|
|
200
|
+
<UButton
|
|
201
|
+
color="primary"
|
|
202
|
+
variant="soft"
|
|
203
|
+
:to="to('/')"
|
|
204
|
+
:label="t('cart.emptyState.goToShop')"
|
|
205
|
+
tabindex="0"
|
|
206
|
+
/>
|
|
207
|
+
<UButton
|
|
208
|
+
color="neutral"
|
|
209
|
+
variant="outline"
|
|
210
|
+
:icon="icon('direct-order')"
|
|
211
|
+
:to="to('/account/direct-order')"
|
|
212
|
+
:label="t('cart.emptyState.directOrder')"
|
|
213
|
+
tabindex="0"
|
|
214
|
+
/>
|
|
215
|
+
<UButton
|
|
216
|
+
color="neutral"
|
|
217
|
+
variant="outline"
|
|
218
|
+
:icon="icon('order-list')"
|
|
219
|
+
:to="to('/account/order-lists')"
|
|
220
|
+
:label="t('cart.emptyState.orderLists')"
|
|
221
|
+
tabindex="0"
|
|
222
|
+
/>
|
|
223
|
+
</div>
|
|
224
|
+
</div>
|
|
225
|
+
</div>
|
|
226
|
+
|
|
227
|
+
<!-- The fastest paths back to an order -->
|
|
228
|
+
<div class="mt-8 space-y-8">
|
|
229
|
+
<CartReorderStrip />
|
|
230
|
+
<CartCrossSell popular />
|
|
231
|
+
</div>
|
|
232
|
+
</template>
|
|
233
|
+
|
|
234
|
+
<template v-else>
|
|
235
|
+
<div class="grid grid-cols-1 lg:grid-cols-12 gap-6 lg:gap-8 items-start">
|
|
236
|
+
<section class="lg:col-span-8 border border-(--ui-border) rounded-xl px-4 md:px-5 pb-2">
|
|
237
|
+
<CartListHeader class="print:hidden" />
|
|
238
|
+
|
|
239
|
+
<CartPositionList
|
|
240
|
+
v-if="freeItems.length"
|
|
241
|
+
:items="freeItems"
|
|
242
|
+
:lines-by-key="linesByKey"
|
|
243
|
+
/>
|
|
244
|
+
|
|
245
|
+
<div
|
|
246
|
+
v-if="requisitions.length"
|
|
247
|
+
class="space-y-4 py-4"
|
|
248
|
+
>
|
|
249
|
+
<CartRequisitionGroup
|
|
250
|
+
v-for="requisition in requisitions"
|
|
251
|
+
:key="requisition.id"
|
|
252
|
+
:requisition="requisition"
|
|
253
|
+
:items="itemsByRequisition.get(requisition.id) ?? []"
|
|
254
|
+
:lines-by-key="linesByKey"
|
|
255
|
+
/>
|
|
256
|
+
</div>
|
|
257
|
+
</section>
|
|
258
|
+
|
|
259
|
+
<aside class="lg:col-span-4 lg:sticky lg:top-24">
|
|
260
|
+
<p class="text-xs text-muted mb-2">
|
|
261
|
+
{{ cartItemCount }}
|
|
262
|
+
</p>
|
|
263
|
+
<CartSummaryPanel />
|
|
264
|
+
</aside>
|
|
265
|
+
</div>
|
|
266
|
+
|
|
267
|
+
<!-- Revenue strips: fast reorder + cross-sell -->
|
|
268
|
+
<div class="mt-8 space-y-8">
|
|
269
|
+
<CartReorderStrip />
|
|
270
|
+
<CartCrossSell />
|
|
271
|
+
</div>
|
|
272
|
+
</template>
|
|
273
|
+
|
|
274
|
+
<!-- Action modals (one instance each, driven by useCartActions) -->
|
|
275
|
+
<CartCostCenterModal
|
|
276
|
+
:open="actions.action.value.type === 'cost-center'"
|
|
277
|
+
:line-keys="actions.action.value.lineKeys"
|
|
278
|
+
@update:open="actions.close()"
|
|
279
|
+
/>
|
|
280
|
+
<CartPositionTextsModal
|
|
281
|
+
:open="actions.action.value.type === 'texts'"
|
|
282
|
+
:line-keys="actions.action.value.lineKeys"
|
|
283
|
+
@update:open="actions.close()"
|
|
284
|
+
/>
|
|
285
|
+
<CartSaveToListModal
|
|
286
|
+
:open="actions.action.value.type === 'save'"
|
|
287
|
+
:line-keys="actions.action.value.lineKeys"
|
|
288
|
+
@update:open="actions.close()"
|
|
289
|
+
/>
|
|
290
|
+
<CartExportModal
|
|
291
|
+
:open="actions.action.value.type === 'export'"
|
|
292
|
+
@update:open="actions.close()"
|
|
293
|
+
/>
|
|
294
|
+
|
|
295
|
+
<!-- Quick entry: the full direct-order toolset in a wide lightbox -->
|
|
296
|
+
<UModal
|
|
297
|
+
v-model:open="quickAddOpen"
|
|
298
|
+
:title="t('directOrder.title')"
|
|
299
|
+
:description="t('directOrder.description')"
|
|
300
|
+
:ui="{ content: 'sm:max-w-4xl' }"
|
|
301
|
+
>
|
|
302
|
+
<template #body>
|
|
303
|
+
<AccountDirectOrder
|
|
304
|
+
embedded
|
|
305
|
+
@added="quickAddOpen = false"
|
|
306
|
+
/>
|
|
307
|
+
</template>
|
|
308
|
+
</UModal>
|
|
309
|
+
</UContainer>
|
|
310
|
+
</template>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { getDisplayUnitPrice, getPriceTiers, getPriceWithOptionalTax } from "../../../composables/useProducts";
|
|
3
|
+
import type { ProductList } from "../../../interfaces/product-list";
|
|
4
|
+
|
|
5
|
+
const { t } = useI18n();
|
|
6
|
+
const { public: { locale, currency, taxIncludedPrices } } = useRuntimeConfig();
|
|
7
|
+
|
|
8
|
+
function formatPrice(price: number) {
|
|
9
|
+
return price.toLocaleString(locale, { style: "currency", currency });
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const props = defineProps<{
|
|
13
|
+
product: ProductList;
|
|
14
|
+
}>();
|
|
15
|
+
|
|
16
|
+
const tiers = computed(() => getPriceTiers(props.product.prices ?? []));
|
|
17
|
+
const hasTieredPricing = computed(() => tiers.value.length > 1);
|
|
18
|
+
const displayPrice = computed<number | null>(() => {
|
|
19
|
+
const basePrice = getDisplayUnitPrice(props.product.prices ?? []);
|
|
20
|
+
if (basePrice === null) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return getPriceWithOptionalTax(basePrice, props.product.tax.rate, taxIncludedPrices);
|
|
25
|
+
});
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<template>
|
|
29
|
+
<div>
|
|
30
|
+
<template v-if="displayPrice !== null">
|
|
31
|
+
<div v-if="hasTieredPricing">
|
|
32
|
+
<span class="text-sm text-muted mt-0.5">{{ t('product.price.from') }}</span>
|
|
33
|
+
{{ formatPrice(displayPrice) }}
|
|
34
|
+
</div>
|
|
35
|
+
<div v-else>
|
|
36
|
+
{{ formatPrice(displayPrice) }}
|
|
37
|
+
</div>
|
|
38
|
+
</template>
|
|
39
|
+
<!-- No price for this buyer context: on request — never €0. -->
|
|
40
|
+
<div
|
|
41
|
+
v-else
|
|
42
|
+
class="text-sm font-medium text-muted"
|
|
43
|
+
>
|
|
44
|
+
{{ t('product.price.onRequest') }}
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import type { ProductList } from "../../../interfaces/product-list";
|
|
3
|
+
|
|
4
|
+
defineProps<{
|
|
5
|
+
product: ProductList;
|
|
6
|
+
}>();
|
|
7
|
+
|
|
8
|
+
const { t } = useI18n();
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<div class="flex items-center justify-between gap-2 text-xs text-muted text-primary">
|
|
13
|
+
{{ t('product.sku') }}: {{ product.sku }}
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import type { ProductList } from "../../../interfaces/product-list";
|
|
3
|
+
|
|
4
|
+
const { icon } = useIcons();
|
|
5
|
+
|
|
6
|
+
const { t } = useI18n();
|
|
7
|
+
|
|
8
|
+
defineProps<{
|
|
9
|
+
product: ProductList;
|
|
10
|
+
isOutOfStock: boolean;
|
|
11
|
+
}>();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<div>
|
|
16
|
+
<span class="flex items-center gap-1 text-sm font-medium">
|
|
17
|
+
{{ !isOutOfStock ? t('product.stock.available') : t('product.stock.unavailable') }}
|
|
18
|
+
<UIcon
|
|
19
|
+
:name="!isOutOfStock ? icon('check') : icon('close')"
|
|
20
|
+
class="size-5 text-(--ui-primary)"
|
|
21
|
+
:style="{ color: !isOutOfStock ? 'green' : 'red' }"
|
|
22
|
+
/>
|
|
23
|
+
</span>
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const props = defineProps<{
|
|
3
|
+
page: number;
|
|
4
|
+
perPage: number;
|
|
5
|
+
total: number;
|
|
6
|
+
}>();
|
|
7
|
+
|
|
8
|
+
const { t } = useI18n();
|
|
9
|
+
|
|
10
|
+
const from = computed(() => (props.page - 1) * props.perPage + 1);
|
|
11
|
+
const to = computed(() => Math.min(props.page * props.perPage, props.total));
|
|
12
|
+
const isSingle = computed(() => from.value === to.value);
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<p
|
|
17
|
+
v-if="total > 0"
|
|
18
|
+
class="text-sm text-muted"
|
|
19
|
+
>
|
|
20
|
+
<template v-if="isSingle">
|
|
21
|
+
{{ t('product.list.count.single', { total }) }}
|
|
22
|
+
</template>
|
|
23
|
+
<template v-else>
|
|
24
|
+
{{ t('product.list.count.range', { from, to, total }) }}
|
|
25
|
+
</template>
|
|
26
|
+
</p>
|
|
27
|
+
</template>
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const { icon } = useIcons();
|
|
3
|
+
|
|
4
|
+
const page = defineModel<number>("page", { required: true });
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
total: number;
|
|
7
|
+
itemsPerPage: number;
|
|
8
|
+
}>();
|
|
9
|
+
const { t } = useI18n();
|
|
10
|
+
|
|
11
|
+
const pageCount = computed(() => Math.ceil(props.total / props.itemsPerPage));
|
|
12
|
+
const isFirst = computed(() => page.value <= 1);
|
|
13
|
+
const isLast = computed(() => page.value >= pageCount.value);
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<UPagination
|
|
18
|
+
v-model:page="page"
|
|
19
|
+
:total="total"
|
|
20
|
+
:items-per-page="itemsPerPage"
|
|
21
|
+
>
|
|
22
|
+
<template #first>
|
|
23
|
+
<UTooltip :text="t('product.list.pagination.first')">
|
|
24
|
+
<UButton
|
|
25
|
+
:icon="icon('chevron-double-left')"
|
|
26
|
+
color="neutral"
|
|
27
|
+
variant="outline"
|
|
28
|
+
:disabled="isFirst"
|
|
29
|
+
:aria-label="t('product.list.pagination.first')"
|
|
30
|
+
/>
|
|
31
|
+
</UTooltip>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<template #prev>
|
|
35
|
+
<UTooltip :text="t('product.list.pagination.prev')">
|
|
36
|
+
<UButton
|
|
37
|
+
:icon="icon('chevron-left')"
|
|
38
|
+
color="neutral"
|
|
39
|
+
variant="outline"
|
|
40
|
+
:disabled="isFirst"
|
|
41
|
+
:aria-label="t('product.list.pagination.prev')"
|
|
42
|
+
/>
|
|
43
|
+
</UTooltip>
|
|
44
|
+
</template>
|
|
45
|
+
|
|
46
|
+
<template #next>
|
|
47
|
+
<UTooltip :text="t('product.list.pagination.next')">
|
|
48
|
+
<UButton
|
|
49
|
+
:icon="icon('chevron-right')"
|
|
50
|
+
color="neutral"
|
|
51
|
+
variant="outline"
|
|
52
|
+
:disabled="isLast"
|
|
53
|
+
:aria-label="t('product.list.pagination.next')"
|
|
54
|
+
/>
|
|
55
|
+
</UTooltip>
|
|
56
|
+
</template>
|
|
57
|
+
|
|
58
|
+
<template #last>
|
|
59
|
+
<UTooltip :text="t('product.list.pagination.last')">
|
|
60
|
+
<UButton
|
|
61
|
+
:icon="icon('chevron-double-right')"
|
|
62
|
+
color="neutral"
|
|
63
|
+
variant="outline"
|
|
64
|
+
:disabled="isLast"
|
|
65
|
+
:aria-label="t('product.list.pagination.last')"
|
|
66
|
+
/>
|
|
67
|
+
</UTooltip>
|
|
68
|
+
</template>
|
|
69
|
+
|
|
70
|
+
<template #item="{ item, page: currentPage }">
|
|
71
|
+
<UButton
|
|
72
|
+
:color="currentPage === item.value ? 'primary' : 'neutral'"
|
|
73
|
+
:variant="currentPage === item.value ? 'solid' : 'outline'"
|
|
74
|
+
:label="String(item.value)"
|
|
75
|
+
:ui="{ label: 'min-w-5 text-center' }"
|
|
76
|
+
:aria-label="t('product.list.pagination.page', { page: item.value })"
|
|
77
|
+
square
|
|
78
|
+
/>
|
|
79
|
+
</template>
|
|
80
|
+
</UPagination>
|
|
81
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="mt-6 grid grid-cols-1 md:grid-cols-2 gap-8">
|
|
3
|
+
<USkeleton class="w-full aspect-square rounded-lg" />
|
|
4
|
+
<div class="flex flex-col gap-4">
|
|
5
|
+
<USkeleton class="h-8 w-3/4" />
|
|
6
|
+
<USkeleton class="h-3 w-1/4" />
|
|
7
|
+
<USkeleton class="h-3 w-1/3" />
|
|
8
|
+
<USkeleton class="h-5 w-1/2" />
|
|
9
|
+
<USkeleton class="h-10 w-full mt-4 rounded-md" />
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const { viewMode } = useViewMode();
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<!-- Grid skeleton -->
|
|
7
|
+
<div
|
|
8
|
+
v-if="viewMode !== 'list'"
|
|
9
|
+
class="mt-6 grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4"
|
|
10
|
+
>
|
|
11
|
+
<UCard
|
|
12
|
+
v-for="i in 8"
|
|
13
|
+
:key="i"
|
|
14
|
+
class="flex flex-col overflow-hidden"
|
|
15
|
+
:ui="{ body: 'flex-1' }"
|
|
16
|
+
>
|
|
17
|
+
<template #header>
|
|
18
|
+
<div class="h-50 flex items-center justify-center">
|
|
19
|
+
<USkeleton class="w-full h-full" />
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
<div class="flex flex-col gap-2">
|
|
23
|
+
<USkeleton class="h-4 w-3/4" />
|
|
24
|
+
<USkeleton class="h-3 w-16" />
|
|
25
|
+
<USkeleton class="h-3 w-12" />
|
|
26
|
+
<USkeleton class="h-4 w-1/2" />
|
|
27
|
+
</div>
|
|
28
|
+
<template #footer>
|
|
29
|
+
<div class="flex gap-2">
|
|
30
|
+
<USkeleton class="h-8 flex-1 rounded-md" />
|
|
31
|
+
<USkeleton class="h-8 flex-1 rounded-md" />
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
34
|
+
</UCard>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<!-- List skeleton -->
|
|
38
|
+
<div
|
|
39
|
+
v-else
|
|
40
|
+
class="mt-6 flex flex-col gap-4"
|
|
41
|
+
>
|
|
42
|
+
<UCard
|
|
43
|
+
v-for="i in 8"
|
|
44
|
+
:key="i"
|
|
45
|
+
class="overflow-hidden"
|
|
46
|
+
:ui="{ body: 'p-0 sm:p-0' }"
|
|
47
|
+
>
|
|
48
|
+
<div class="flex flex-row items-center gap-4 p-4">
|
|
49
|
+
<USkeleton class="w-15 h-15 shrink-0 rounded-md" />
|
|
50
|
+
<div class="flex-1 min-w-0 flex flex-col gap-1.5">
|
|
51
|
+
<USkeleton class="h-4 w-3/4" />
|
|
52
|
+
<USkeleton class="h-3 w-16" />
|
|
53
|
+
<USkeleton class="h-3 w-12" />
|
|
54
|
+
</div>
|
|
55
|
+
<div class="shrink-0 flex flex-col items-end gap-2">
|
|
56
|
+
<USkeleton class="h-4 w-16" />
|
|
57
|
+
<div class="flex gap-2">
|
|
58
|
+
<USkeleton class="h-7 w-14 rounded-md" />
|
|
59
|
+
<USkeleton class="h-7 w-20 rounded-md" />
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
</UCard>
|
|
64
|
+
</div>
|
|
65
|
+
</template>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const { icon } = useIcons();
|
|
3
|
+
|
|
4
|
+
const { viewMode } = useViewMode();
|
|
5
|
+
const { t } = useI18n();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<div class="flex items-center gap-1">
|
|
10
|
+
<UTooltip :text="t('product.list.view.list')">
|
|
11
|
+
<UButton
|
|
12
|
+
:icon="icon('list')"
|
|
13
|
+
:variant="viewMode === 'list' ? 'soft' : 'ghost'"
|
|
14
|
+
:color="viewMode === 'list' ? 'primary' : 'neutral'"
|
|
15
|
+
size="sm"
|
|
16
|
+
|
|
17
|
+
:aria-label="t('product.list.view.list')"
|
|
18
|
+
@click="viewMode = 'list'"
|
|
19
|
+
/>
|
|
20
|
+
</UTooltip>
|
|
21
|
+
<UTooltip :text="t('product.list.view.grid')">
|
|
22
|
+
<UButton
|
|
23
|
+
:icon="icon('grid')"
|
|
24
|
+
:variant="viewMode === 'grid' ? 'soft' : 'ghost'"
|
|
25
|
+
:color="viewMode === 'grid' ? 'primary' : 'neutral'"
|
|
26
|
+
size="sm"
|
|
27
|
+
|
|
28
|
+
:aria-label="t('product.list.view.grid')"
|
|
29
|
+
@click="viewMode = 'grid'"
|
|
30
|
+
/>
|
|
31
|
+
</UTooltip>
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|