@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,86 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Sticky cart list header: three-state multi-selector and the bulk action
|
|
4
|
+
* bar (visible from one selected position). The bulk actions mirror the
|
|
5
|
+
* per-position functions (spec: Mehrfach-Aktionen).
|
|
6
|
+
*/
|
|
7
|
+
const { icon } = useIcons();
|
|
8
|
+
const { t } = useI18n();
|
|
9
|
+
const cart = useCartStore();
|
|
10
|
+
const selection = useCartSelection();
|
|
11
|
+
const actions = useCartActions();
|
|
12
|
+
const { settings, role } = useB2BContext();
|
|
13
|
+
|
|
14
|
+
const showCostCenter = computed(() =>
|
|
15
|
+
Boolean(role.value) && settings.value?.costCenters.enabled,
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
function bulkDelete(): void {
|
|
19
|
+
cart.removeByKeys(selection.selected.value);
|
|
20
|
+
selection.clear();
|
|
21
|
+
}
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<div
|
|
26
|
+
class="sticky top-(--ui-header-height) z-10 -mx-4 md:-mx-5 px-4 md:px-5 py-2 rounded-t-xl
|
|
27
|
+
bg-(--ui-bg)/95 backdrop-blur-sm border-b border-(--ui-border)
|
|
28
|
+
flex flex-wrap items-center gap-2"
|
|
29
|
+
>
|
|
30
|
+
<UCheckbox
|
|
31
|
+
:model-value="selection.someSelected.value ? 'indeterminate' : selection.allSelected.value"
|
|
32
|
+
:aria-label="t('cart.selection.selectAll')"
|
|
33
|
+
tabindex="0"
|
|
34
|
+
@update:model-value="selection.toggleAll()"
|
|
35
|
+
/>
|
|
36
|
+
<span class="text-xs text-muted">
|
|
37
|
+
{{ selection.selected.value.length > 0
|
|
38
|
+
? t('cart.selection.count', { count: selection.selected.value.length })
|
|
39
|
+
: t('cart.selection.selectAll') }}
|
|
40
|
+
</span>
|
|
41
|
+
|
|
42
|
+
<div
|
|
43
|
+
v-if="selection.selected.value.length > 0"
|
|
44
|
+
class="flex flex-wrap items-center gap-1 ml-auto"
|
|
45
|
+
>
|
|
46
|
+
<UButton
|
|
47
|
+
v-if="showCostCenter"
|
|
48
|
+
:icon="icon('hash')"
|
|
49
|
+
color="neutral"
|
|
50
|
+
variant="ghost"
|
|
51
|
+
size="xs"
|
|
52
|
+
tabindex="0"
|
|
53
|
+
:label="t('cart.bulk.editCostCenter')"
|
|
54
|
+
@click="actions.open('cost-center', selection.selected.value)"
|
|
55
|
+
/>
|
|
56
|
+
<UButton
|
|
57
|
+
:icon="icon('edit')"
|
|
58
|
+
color="neutral"
|
|
59
|
+
variant="ghost"
|
|
60
|
+
size="xs"
|
|
61
|
+
tabindex="0"
|
|
62
|
+
:label="t('cart.bulk.editTexts')"
|
|
63
|
+
@click="actions.open('texts', selection.selected.value)"
|
|
64
|
+
/>
|
|
65
|
+
<UButton
|
|
66
|
+
v-if="role"
|
|
67
|
+
:icon="icon('bookmark')"
|
|
68
|
+
color="neutral"
|
|
69
|
+
variant="ghost"
|
|
70
|
+
size="xs"
|
|
71
|
+
tabindex="0"
|
|
72
|
+
:label="t('cart.bulk.saveToList')"
|
|
73
|
+
@click="actions.open('save', selection.selected.value)"
|
|
74
|
+
/>
|
|
75
|
+
<UButton
|
|
76
|
+
:icon="icon('delete')"
|
|
77
|
+
color="error"
|
|
78
|
+
variant="ghost"
|
|
79
|
+
size="xs"
|
|
80
|
+
tabindex="0"
|
|
81
|
+
:label="t('cart.bulk.deletePositions')"
|
|
82
|
+
@click="bulkDelete"
|
|
83
|
+
/>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
</template>
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import CartPosition from "../position/CartPosition.vue";
|
|
3
|
+
import type { CalculatedCartLine } from "../../../interfaces/cart-calculation";
|
|
4
|
+
import type { CartItem } from "../../../interfaces/cart-item";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Sortable list of cart positions within one scope (free items or one
|
|
8
|
+
* requisition). Native HTML5 drag & drop on the position drag handles;
|
|
9
|
+
* positions never leave their scope (spec).
|
|
10
|
+
*/
|
|
11
|
+
const props = defineProps<{
|
|
12
|
+
items: CartItem[];
|
|
13
|
+
linesByKey: Map<string, CalculatedCartLine>;
|
|
14
|
+
/** requisitionId, or undefined for free items. */
|
|
15
|
+
scope?: string;
|
|
16
|
+
readonly?: boolean;
|
|
17
|
+
}>();
|
|
18
|
+
|
|
19
|
+
const cart = useCartStore();
|
|
20
|
+
|
|
21
|
+
const draggingIndex = ref<number | null>(null);
|
|
22
|
+
const dragOverIndex = ref<number | null>(null);
|
|
23
|
+
|
|
24
|
+
// Drags must start on the position's drag handle: a mousedown there arms
|
|
25
|
+
// the next dragstart; anywhere else the drag is suppressed (keeps text
|
|
26
|
+
// selection and the quantity input usable inside draggable rows).
|
|
27
|
+
const dragArmed = ref(false);
|
|
28
|
+
|
|
29
|
+
function onMouseDown(event: MouseEvent): void {
|
|
30
|
+
dragArmed.value = Boolean((event.target as HTMLElement).closest(".drag-handle"));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function onDragStart(event: DragEvent, index: number): void {
|
|
34
|
+
if (!dragArmed.value) {
|
|
35
|
+
event.preventDefault();
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
draggingIndex.value = index;
|
|
39
|
+
event.dataTransfer?.setData("text/plain", String(index));
|
|
40
|
+
if (event.dataTransfer) {
|
|
41
|
+
event.dataTransfer.effectAllowed = "move";
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function onDragOver(event: DragEvent, index: number): void {
|
|
46
|
+
if (draggingIndex.value === null) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
event.preventDefault();
|
|
50
|
+
dragOverIndex.value = index;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function onDrop(index: number): void {
|
|
54
|
+
if (draggingIndex.value !== null && draggingIndex.value !== index) {
|
|
55
|
+
cart.moveWithinScope(props.scope, draggingIndex.value, index);
|
|
56
|
+
}
|
|
57
|
+
draggingIndex.value = null;
|
|
58
|
+
dragOverIndex.value = null;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function onDragEnd(): void {
|
|
62
|
+
draggingIndex.value = null;
|
|
63
|
+
dragOverIndex.value = null;
|
|
64
|
+
dragArmed.value = false;
|
|
65
|
+
}
|
|
66
|
+
</script>
|
|
67
|
+
|
|
68
|
+
<template>
|
|
69
|
+
<ul class="divide-y divide-(--ui-border) list-none p-0 m-0">
|
|
70
|
+
<li
|
|
71
|
+
v-for="(item, index) in items"
|
|
72
|
+
:key="cart.keyOf(item)"
|
|
73
|
+
:draggable="!readonly"
|
|
74
|
+
class="transition-shadow"
|
|
75
|
+
:class="[
|
|
76
|
+
dragOverIndex === index && draggingIndex !== index
|
|
77
|
+
? 'ring-2 ring-(--ui-primary) rounded-lg'
|
|
78
|
+
: '',
|
|
79
|
+
draggingIndex === index ? 'opacity-50' : '',
|
|
80
|
+
]"
|
|
81
|
+
@mousedown="onMouseDown"
|
|
82
|
+
@dragstart="onDragStart($event, index)"
|
|
83
|
+
@dragover="onDragOver($event, index)"
|
|
84
|
+
@drop="onDrop(index)"
|
|
85
|
+
@dragend="onDragEnd"
|
|
86
|
+
>
|
|
87
|
+
<CartPosition
|
|
88
|
+
:item="item"
|
|
89
|
+
:line="linesByKey.get(cart.keyOf(item)) ?? null"
|
|
90
|
+
:readonly="readonly"
|
|
91
|
+
/>
|
|
92
|
+
</li>
|
|
93
|
+
</ul>
|
|
94
|
+
</template>
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import CartApprovalsPanel from "./CartApprovalsPanel.vue";
|
|
3
|
+
import CartWorkflowPickerModal from "../actions/CartWorkflowPickerModal.vue";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Cart summary 2.0: the calculated totals block in document order, the
|
|
7
|
+
* limits panel, the role-aware CTA and the secondary cart actions
|
|
8
|
+
* (export, print, clear). Sticky on desktop.
|
|
9
|
+
*/
|
|
10
|
+
const { icon } = useIcons();
|
|
11
|
+
const { t } = useI18n();
|
|
12
|
+
const { to } = useAppUrl();
|
|
13
|
+
const cart = useCartStore();
|
|
14
|
+
const actions = useCartActions();
|
|
15
|
+
const { calculation, pending } = useCartCalculation();
|
|
16
|
+
const { settings, role, workflows } = useB2BContext();
|
|
17
|
+
const { formatCurrency } = useCartSummaryFormatting();
|
|
18
|
+
|
|
19
|
+
const totals = computed(() =>
|
|
20
|
+
(calculation.value?.totals ?? []).filter(row => row.alwaysVisible || row.amount !== 0),
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
const isRequester = computed(() => role.value === "requester");
|
|
24
|
+
const orderable = computed(() => calculation.value?.orderable ?? true);
|
|
25
|
+
|
|
26
|
+
/* ---- CTA (spec 5 / 5a) -------------------------------------------- */
|
|
27
|
+
const workflowModalOpen = ref(false);
|
|
28
|
+
const noWorkflowModalOpen = ref(false);
|
|
29
|
+
|
|
30
|
+
async function onCheckout(): Promise<void> {
|
|
31
|
+
if (!isRequester.value) {
|
|
32
|
+
await navigateTo(to("/checkout"));
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
// Requesters continue into a requisition, never a direct order.
|
|
36
|
+
if (workflows.value.length === 0) {
|
|
37
|
+
noWorkflowModalOpen.value = true;
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (workflows.value.length === 1) {
|
|
41
|
+
await continueWithWorkflow(workflows.value[0]!.id);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
workflowModalOpen.value = true;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const selectedWorkflowId = useState<string | null>("cart-selected-workflow", () => null);
|
|
48
|
+
|
|
49
|
+
async function continueWithWorkflow(workflowId: string): Promise<void> {
|
|
50
|
+
selectedWorkflowId.value = workflowId;
|
|
51
|
+
workflowModalOpen.value = false;
|
|
52
|
+
await navigateTo(to("/checkout"));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function printCart(): void {
|
|
56
|
+
window.print();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* ---- spend incentives (revenue nudges) ------------------------------- */
|
|
60
|
+
const subtotalAmount = computed(() =>
|
|
61
|
+
calculation.value?.totals.find(row => row.key === "subtotal")?.amount ?? 0);
|
|
62
|
+
|
|
63
|
+
const openIncentive = computed(() =>
|
|
64
|
+
(calculation.value?.incentives ?? []).find(incentive => !incentive.reached) ?? null);
|
|
65
|
+
|
|
66
|
+
const reachedIncentives = computed(() =>
|
|
67
|
+
(calculation.value?.incentives ?? []).filter(incentive => incentive.reached));
|
|
68
|
+
|
|
69
|
+
const incentiveProgress = computed(() => {
|
|
70
|
+
if (!openIncentive.value) {
|
|
71
|
+
return 0;
|
|
72
|
+
}
|
|
73
|
+
return Math.min(100, Math.round((subtotalAmount.value / openIncentive.value.threshold) * 100));
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
const TRUST_ITEMS = [
|
|
77
|
+
{ token: "delivery", key: "cart.trust.delivery" },
|
|
78
|
+
{ token: "payment", key: "cart.trust.invoice" },
|
|
79
|
+
{ token: "phone", key: "cart.trust.support" },
|
|
80
|
+
] as const;
|
|
81
|
+
</script>
|
|
82
|
+
|
|
83
|
+
<template>
|
|
84
|
+
<div class="space-y-4">
|
|
85
|
+
<div class="border border-(--ui-border) rounded-xl p-4 md:p-5 space-y-4">
|
|
86
|
+
<h2 class="text-lg font-semibold text-highlighted">
|
|
87
|
+
{{ t('cart.page.summaryTitle') }}
|
|
88
|
+
</h2>
|
|
89
|
+
|
|
90
|
+
<!-- Spend incentives: progress to the next threshold -->
|
|
91
|
+
<div
|
|
92
|
+
v-if="openIncentive || reachedIncentives.length"
|
|
93
|
+
class="space-y-2 print:hidden"
|
|
94
|
+
>
|
|
95
|
+
<div
|
|
96
|
+
v-for="incentive in reachedIncentives"
|
|
97
|
+
:key="incentive.key"
|
|
98
|
+
class="flex items-center gap-1.5 text-xs text-success"
|
|
99
|
+
>
|
|
100
|
+
<UIcon
|
|
101
|
+
:name="icon('success')"
|
|
102
|
+
class="size-4 shrink-0"
|
|
103
|
+
/>
|
|
104
|
+
{{ t('cart.boost.reached', { label: incentive.label }) }}
|
|
105
|
+
</div>
|
|
106
|
+
<template v-if="openIncentive">
|
|
107
|
+
<p class="text-xs text-muted">
|
|
108
|
+
{{ t('cart.boost.missing', {
|
|
109
|
+
amount: formatCurrency(openIncentive.missing),
|
|
110
|
+
label: openIncentive.label,
|
|
111
|
+
}) }}
|
|
112
|
+
</p>
|
|
113
|
+
<div class="h-1.5 rounded-full bg-elevated overflow-hidden">
|
|
114
|
+
<div
|
|
115
|
+
class="h-full rounded-full bg-primary w-(--incentive-progress) transition-all"
|
|
116
|
+
:style="{ '--incentive-progress': `${incentiveProgress}%` }"
|
|
117
|
+
/>
|
|
118
|
+
</div>
|
|
119
|
+
</template>
|
|
120
|
+
</div>
|
|
121
|
+
|
|
122
|
+
<dl
|
|
123
|
+
v-if="totals.length"
|
|
124
|
+
class="flex flex-col gap-2.5 m-0"
|
|
125
|
+
:class="pending ? 'opacity-60' : ''"
|
|
126
|
+
>
|
|
127
|
+
<div
|
|
128
|
+
v-for="(row, index) in totals"
|
|
129
|
+
:key="`${row.key}-${index}`"
|
|
130
|
+
class="flex justify-between gap-3 text-sm"
|
|
131
|
+
:class="row.key === 'total'
|
|
132
|
+
? 'font-semibold text-highlighted border-t border-(--ui-border) pt-2.5'
|
|
133
|
+
: 'text-muted'"
|
|
134
|
+
>
|
|
135
|
+
<dt class="flex items-center gap-1.5">
|
|
136
|
+
{{ row.label }}
|
|
137
|
+
<UTooltip
|
|
138
|
+
v-if="row.key === 'min-order-value' && row.meta?.threshold"
|
|
139
|
+
:text="t('cart.summary.minOrderHint', { threshold: formatCurrency(row.meta.threshold) })"
|
|
140
|
+
>
|
|
141
|
+
<UIcon
|
|
142
|
+
:name="icon('info')"
|
|
143
|
+
class="size-3.5 text-dimmed"
|
|
144
|
+
/>
|
|
145
|
+
</UTooltip>
|
|
146
|
+
</dt>
|
|
147
|
+
<dd class="m-0 tabular-nums">
|
|
148
|
+
{{ formatCurrency(row.amount) }}
|
|
149
|
+
</dd>
|
|
150
|
+
</div>
|
|
151
|
+
</dl>
|
|
152
|
+
<USkeleton
|
|
153
|
+
v-else
|
|
154
|
+
class="h-24 w-full"
|
|
155
|
+
/>
|
|
156
|
+
|
|
157
|
+
<CartApprovalsPanel :limits="calculation?.approvalLimits ?? []" />
|
|
158
|
+
|
|
159
|
+
<UButton
|
|
160
|
+
color="primary"
|
|
161
|
+
variant="solid"
|
|
162
|
+
size="lg"
|
|
163
|
+
class="w-full justify-center mt-2"
|
|
164
|
+
:disabled="!orderable"
|
|
165
|
+
:loading="pending"
|
|
166
|
+
:label="isRequester ? t('cart.cta.requisition') : t('cart.cta.checkout')"
|
|
167
|
+
tabindex="0"
|
|
168
|
+
@click="onCheckout"
|
|
169
|
+
/>
|
|
170
|
+
<p
|
|
171
|
+
v-if="!orderable"
|
|
172
|
+
class="text-xs text-muted text-center"
|
|
173
|
+
>
|
|
174
|
+
{{ t('cart.cta.notOrderable') }}
|
|
175
|
+
</p>
|
|
176
|
+
|
|
177
|
+
<!-- Trust: the promises that close B2B orders -->
|
|
178
|
+
<ul
|
|
179
|
+
role="list"
|
|
180
|
+
class="space-y-1.5 pt-1 border-t border-(--ui-border) print:hidden"
|
|
181
|
+
>
|
|
182
|
+
<li
|
|
183
|
+
v-for="item in TRUST_ITEMS"
|
|
184
|
+
:key="item.token"
|
|
185
|
+
class="flex items-start gap-2 text-xs text-muted pt-1"
|
|
186
|
+
>
|
|
187
|
+
<UIcon
|
|
188
|
+
:name="icon(item.token)"
|
|
189
|
+
class="size-4 shrink-0 text-primary"
|
|
190
|
+
/>
|
|
191
|
+
{{ t(item.key) }}
|
|
192
|
+
</li>
|
|
193
|
+
</ul>
|
|
194
|
+
</div>
|
|
195
|
+
|
|
196
|
+
<!-- Secondary actions -->
|
|
197
|
+
<div class="flex flex-wrap items-center justify-center gap-1 print:hidden">
|
|
198
|
+
<UButton
|
|
199
|
+
v-if="settings?.cart.exportEnabled"
|
|
200
|
+
:icon="icon('upload')"
|
|
201
|
+
color="neutral"
|
|
202
|
+
variant="ghost"
|
|
203
|
+
size="xs"
|
|
204
|
+
tabindex="0"
|
|
205
|
+
:label="t('cart.export.action')"
|
|
206
|
+
@click="actions.open('export', [])"
|
|
207
|
+
/>
|
|
208
|
+
<UButton
|
|
209
|
+
v-if="settings?.cart.exportEnabled"
|
|
210
|
+
:icon="icon('file')"
|
|
211
|
+
color="neutral"
|
|
212
|
+
variant="ghost"
|
|
213
|
+
size="xs"
|
|
214
|
+
tabindex="0"
|
|
215
|
+
:label="t('cart.actions.print')"
|
|
216
|
+
@click="printCart"
|
|
217
|
+
/>
|
|
218
|
+
<UButton
|
|
219
|
+
:icon="icon('delete')"
|
|
220
|
+
color="neutral"
|
|
221
|
+
variant="ghost"
|
|
222
|
+
size="xs"
|
|
223
|
+
tabindex="0"
|
|
224
|
+
:label="t('cart.actions.clear')"
|
|
225
|
+
@click="cart.clearCart()"
|
|
226
|
+
/>
|
|
227
|
+
</div>
|
|
228
|
+
|
|
229
|
+
<CartWorkflowPickerModal
|
|
230
|
+
v-model:open="workflowModalOpen"
|
|
231
|
+
:workflows="workflows"
|
|
232
|
+
@select="continueWithWorkflow"
|
|
233
|
+
/>
|
|
234
|
+
|
|
235
|
+
<UModal
|
|
236
|
+
v-model:open="noWorkflowModalOpen"
|
|
237
|
+
:title="t('cart.workflow.noneTitle')"
|
|
238
|
+
>
|
|
239
|
+
<template #body>
|
|
240
|
+
<p class="text-sm text-muted">
|
|
241
|
+
{{ t('cart.workflow.noneDescription') }}
|
|
242
|
+
</p>
|
|
243
|
+
</template>
|
|
244
|
+
<template #footer>
|
|
245
|
+
<UButton
|
|
246
|
+
color="primary"
|
|
247
|
+
tabindex="0"
|
|
248
|
+
:label="t('cart.workflow.noneConfirm')"
|
|
249
|
+
@click="noWorkflowModalOpen = false"
|
|
250
|
+
/>
|
|
251
|
+
</template>
|
|
252
|
+
</UModal>
|
|
253
|
+
</div>
|
|
254
|
+
</template>
|