@wikala/spmkt 3.0.0-beta.1 → 4.0.0-alpha.1
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 +88 -0
- package/dist/analytics/ga4.d.ts +44 -0
- package/dist/analytics/ga4.js +47 -0
- package/dist/analytics/ga4.js.map +1 -0
- package/dist/core/api/account.d.ts +25 -0
- package/dist/core/api/account.js +27 -0
- package/dist/core/api/account.js.map +1 -0
- package/dist/core/api/address.d.ts +10 -0
- package/dist/core/api/address.js +18 -0
- package/dist/core/api/address.js.map +1 -0
- package/dist/core/api/cart.d.ts +43 -0
- package/dist/core/api/cart.js +46 -0
- package/dist/core/api/cart.js.map +1 -0
- package/dist/core/api/checkout.d.ts +90 -0
- package/dist/core/api/checkout.js +75 -0
- package/dist/core/api/checkout.js.map +1 -0
- package/dist/core/api/index.d.ts +12 -0
- package/dist/core/api/location.d.ts +8 -0
- package/dist/core/api/location.js +16 -0
- package/dist/core/api/location.js.map +1 -0
- package/dist/core/api/product.d.ts +13 -0
- package/dist/core/api/product.js +19 -0
- package/dist/core/api/product.js.map +1 -0
- package/dist/core/api/questions.d.ts +3 -0
- package/dist/core/api/questions.js +9 -0
- package/dist/core/api/questions.js.map +1 -0
- package/dist/core/api/reviews.d.ts +17 -0
- package/dist/core/api/reviews.js +30 -0
- package/dist/core/api/reviews.js.map +1 -0
- package/dist/core/api/search.d.ts +3 -0
- package/dist/core/api/search.js +8 -0
- package/dist/core/api/search.js.map +1 -0
- package/dist/core/config.d.ts +16 -0
- package/dist/core/config.js +33 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/cookies.d.ts +5 -0
- package/dist/core/cookies.js +29 -0
- package/dist/core/cookies.js.map +1 -0
- package/dist/core/errors.d.ts +27 -0
- package/dist/core/errors.js +42 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/events.d.ts +137 -0
- package/dist/core/events.js +13 -0
- package/dist/core/events.js.map +1 -0
- package/dist/core/forms.d.ts +17 -0
- package/dist/core/forms.js +70 -0
- package/dist/core/forms.js.map +1 -0
- package/dist/core/i18n.d.ts +26 -0
- package/dist/core/i18n.js +82 -0
- package/dist/core/i18n.js.map +1 -0
- package/dist/core/index.d.ts +22 -0
- package/dist/core/index.js +156 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/money.d.ts +10 -0
- package/dist/core/money.js +30 -0
- package/dist/core/money.js.map +1 -0
- package/dist/core/page-events.d.ts +13 -0
- package/dist/core/page-events.js +76 -0
- package/dist/core/page-events.js.map +1 -0
- package/dist/core/recaptcha.d.ts +17 -0
- package/dist/core/recaptcha.js +44 -0
- package/dist/core/recaptcha.js.map +1 -0
- package/dist/core/request.d.ts +38 -0
- package/dist/core/request.js +170 -0
- package/dist/core/request.js.map +1 -0
- package/dist/core/session.d.ts +7 -0
- package/dist/core/session.js +16 -0
- package/dist/core/session.js.map +1 -0
- package/dist/core/state.d.ts +22 -0
- package/dist/core/state.js +120 -0
- package/dist/core/state.js.map +1 -0
- package/dist/core/stores/cart.d.ts +45 -0
- package/dist/core/stores/cart.js +102 -0
- package/dist/core/stores/cart.js.map +1 -0
- package/dist/core/stores/checkout-draft.d.ts +58 -0
- package/dist/core/stores/checkout-draft.js +67 -0
- package/dist/core/stores/checkout-draft.js.map +1 -0
- package/dist/core/stores/checkout.d.ts +85 -0
- package/dist/core/stores/checkout.js +299 -0
- package/dist/core/stores/checkout.js.map +1 -0
- package/dist/core/stores/compare.d.ts +17 -0
- package/dist/core/stores/compare.js +78 -0
- package/dist/core/stores/compare.js.map +1 -0
- package/dist/core/stores/customer.d.ts +2 -0
- package/dist/core/stores/customer.js +13 -0
- package/dist/core/stores/customer.js.map +1 -0
- package/dist/core/stores/index.d.ts +9 -0
- package/dist/core/stores/location.d.ts +13 -0
- package/dist/core/stores/location.js +32 -0
- package/dist/core/stores/location.js.map +1 -0
- package/dist/core/types.d.ts +251 -0
- package/dist/elements/account-form/account-form.d.ts +33 -0
- package/dist/elements/account-form/account-form.js +42 -0
- package/dist/elements/account-form/account-form.js.map +1 -0
- package/dist/elements/account-form/index.d.ts +3 -0
- package/dist/elements/account-form/index.js +6 -0
- package/dist/elements/account-form/index.js.map +1 -0
- package/dist/elements/add-to-cart/add-to-cart.d.ts +43 -0
- package/dist/elements/add-to-cart/add-to-cart.js +99 -0
- package/dist/elements/add-to-cart/add-to-cart.js.map +1 -0
- package/dist/elements/add-to-cart/index.d.ts +3 -0
- package/dist/elements/add-to-cart/index.js +6 -0
- package/dist/elements/add-to-cart/index.js.map +1 -0
- package/dist/elements/address-autocomplete/address-autocomplete.d.ts +65 -0
- package/dist/elements/address-autocomplete/address-autocomplete.js +124 -0
- package/dist/elements/address-autocomplete/address-autocomplete.js.map +1 -0
- package/dist/elements/address-autocomplete/index.d.ts +3 -0
- package/dist/elements/address-autocomplete/index.js +7 -0
- package/dist/elements/address-autocomplete/index.js.map +1 -0
- package/dist/elements/address-book/address-book.d.ts +61 -0
- package/dist/elements/address-book/address-book.js +184 -0
- package/dist/elements/address-book/address-book.js.map +1 -0
- package/dist/elements/address-book/index.d.ts +3 -0
- package/dist/elements/address-book/index.js +6 -0
- package/dist/elements/address-book/index.js.map +1 -0
- package/dist/elements/age-check/age-check.d.ts +89 -0
- package/dist/elements/age-check/age-check.js +195 -0
- package/dist/elements/age-check/age-check.js.map +1 -0
- package/dist/elements/age-check/index.d.ts +3 -0
- package/dist/elements/age-check/index.js +8 -0
- package/dist/elements/age-check/index.js.map +1 -0
- package/dist/elements/age-gate/age-gate.d.ts +21 -0
- package/dist/elements/age-gate/age-gate.js +24 -0
- package/dist/elements/age-gate/age-gate.js.map +1 -0
- package/dist/elements/age-gate/index.d.ts +3 -0
- package/dist/elements/age-gate/index.js +7 -0
- package/dist/elements/age-gate/index.js.map +1 -0
- package/dist/elements/back-in-stock/back-in-stock.d.ts +61 -0
- package/dist/elements/back-in-stock/back-in-stock.js +101 -0
- package/dist/elements/back-in-stock/back-in-stock.js.map +1 -0
- package/dist/elements/back-in-stock/index.d.ts +3 -0
- package/dist/elements/back-in-stock/index.js +6 -0
- package/dist/elements/back-in-stock/index.js.map +1 -0
- package/dist/elements/carousel/carousel.d.ts +51 -0
- package/dist/elements/carousel/carousel.js +133 -0
- package/dist/elements/carousel/carousel.js.map +1 -0
- package/dist/elements/carousel/index.d.ts +3 -0
- package/dist/elements/carousel/index.js +6 -0
- package/dist/elements/carousel/index.js.map +1 -0
- package/dist/elements/cart/cart.d.ts +50 -0
- package/dist/elements/cart/cart.js +153 -0
- package/dist/elements/cart/cart.js.map +1 -0
- package/dist/elements/cart/index.d.ts +3 -0
- package/dist/elements/cart/index.js +6 -0
- package/dist/elements/cart/index.js.map +1 -0
- package/dist/elements/cart-count/cart-count.d.ts +16 -0
- package/dist/elements/cart-count/cart-count.js +32 -0
- package/dist/elements/cart-count/cart-count.js.map +1 -0
- package/dist/elements/cart-count/index.d.ts +3 -0
- package/dist/elements/cart-count/index.js +6 -0
- package/dist/elements/cart-count/index.js.map +1 -0
- package/dist/elements/checkout/checkout.d.ts +65 -0
- package/dist/elements/checkout/checkout.js +144 -0
- package/dist/elements/checkout/checkout.js.map +1 -0
- package/dist/elements/checkout/index.d.ts +3 -0
- package/dist/elements/checkout/index.js +6 -0
- package/dist/elements/checkout/index.js.map +1 -0
- package/dist/elements/checkout-address/checkout-address.d.ts +41 -0
- package/dist/elements/checkout-address/checkout-address.js +105 -0
- package/dist/elements/checkout-address/checkout-address.js.map +1 -0
- package/dist/elements/checkout-address/index.d.ts +3 -0
- package/dist/elements/checkout-address/index.js +6 -0
- package/dist/elements/checkout-address/index.js.map +1 -0
- package/dist/elements/checkout-delivery/checkout-delivery.d.ts +75 -0
- package/dist/elements/checkout-delivery/checkout-delivery.js +293 -0
- package/dist/elements/checkout-delivery/checkout-delivery.js.map +1 -0
- package/dist/elements/checkout-delivery/index.d.ts +3 -0
- package/dist/elements/checkout-delivery/index.js +6 -0
- package/dist/elements/checkout-delivery/index.js.map +1 -0
- package/dist/elements/checkout-identity/checkout-identity.d.ts +34 -0
- package/dist/elements/checkout-identity/checkout-identity.js +49 -0
- package/dist/elements/checkout-identity/checkout-identity.js.map +1 -0
- package/dist/elements/checkout-identity/index.d.ts +3 -0
- package/dist/elements/checkout-identity/index.js +6 -0
- package/dist/elements/checkout-identity/index.js.map +1 -0
- package/dist/elements/checkout-payment/checkout-payment.d.ts +74 -0
- package/dist/elements/checkout-payment/checkout-payment.js +286 -0
- package/dist/elements/checkout-payment/checkout-payment.js.map +1 -0
- package/dist/elements/checkout-payment/index.d.ts +3 -0
- package/dist/elements/checkout-payment/index.js +6 -0
- package/dist/elements/checkout-payment/index.js.map +1 -0
- package/dist/elements/collection/collection.d.ts +66 -0
- package/dist/elements/collection/collection.js +179 -0
- package/dist/elements/collection/collection.js.map +1 -0
- package/dist/elements/collection/index.d.ts +3 -0
- package/dist/elements/collection/index.js +6 -0
- package/dist/elements/collection/index.js.map +1 -0
- package/dist/elements/combobox/combobox.d.ts +54 -0
- package/dist/elements/combobox/combobox.js +178 -0
- package/dist/elements/combobox/combobox.js.map +1 -0
- package/dist/elements/combobox/index.d.ts +2 -0
- package/dist/elements/combobox/index.js +5 -0
- package/dist/elements/combobox/index.js.map +1 -0
- package/dist/elements/compare-bar/compare-bar.d.ts +21 -0
- package/dist/elements/compare-bar/compare-bar.js +34 -0
- package/dist/elements/compare-bar/compare-bar.js.map +1 -0
- package/dist/elements/compare-bar/index.d.ts +3 -0
- package/dist/elements/compare-bar/index.js +6 -0
- package/dist/elements/compare-bar/index.js.map +1 -0
- package/dist/elements/compare-remove/compare-remove.d.ts +20 -0
- package/dist/elements/compare-remove/compare-remove.js +19 -0
- package/dist/elements/compare-remove/compare-remove.js.map +1 -0
- package/dist/elements/compare-remove/index.d.ts +3 -0
- package/dist/elements/compare-remove/index.js +6 -0
- package/dist/elements/compare-remove/index.js.map +1 -0
- package/dist/elements/compare-toggle/compare-toggle.d.ts +39 -0
- package/dist/elements/compare-toggle/compare-toggle.js +53 -0
- package/dist/elements/compare-toggle/compare-toggle.js.map +1 -0
- package/dist/elements/compare-toggle/index.d.ts +3 -0
- package/dist/elements/compare-toggle/index.js +6 -0
- package/dist/elements/compare-toggle/index.js.map +1 -0
- package/dist/elements/dialog/dialog.d.ts +23 -0
- package/dist/elements/dialog/dialog.js +61 -0
- package/dist/elements/dialog/dialog.js.map +1 -0
- package/dist/elements/dialog/index.d.ts +3 -0
- package/dist/elements/dialog/index.js +6 -0
- package/dist/elements/dialog/index.js.map +1 -0
- package/dist/elements/location-picker/index.d.ts +3 -0
- package/dist/elements/location-picker/index.js +6 -0
- package/dist/elements/location-picker/index.js.map +1 -0
- package/dist/elements/location-picker/location-picker.d.ts +28 -0
- package/dist/elements/location-picker/location-picker.js +88 -0
- package/dist/elements/location-picker/location-picker.js.map +1 -0
- package/dist/elements/mini-cart/index.d.ts +3 -0
- package/dist/elements/mini-cart/index.js +6 -0
- package/dist/elements/mini-cart/index.js.map +1 -0
- package/dist/elements/mini-cart/mini-cart.d.ts +29 -0
- package/dist/elements/mini-cart/mini-cart.js +102 -0
- package/dist/elements/mini-cart/mini-cart.js.map +1 -0
- package/dist/elements/mobile-nav/index.d.ts +3 -0
- package/dist/elements/mobile-nav/index.js +6 -0
- package/dist/elements/mobile-nav/index.js.map +1 -0
- package/dist/elements/mobile-nav/mobile-nav.d.ts +20 -0
- package/dist/elements/mobile-nav/mobile-nav.js +29 -0
- package/dist/elements/mobile-nav/mobile-nav.js.map +1 -0
- package/dist/elements/product-gallery/index.d.ts +3 -0
- package/dist/elements/product-gallery/index.js +6 -0
- package/dist/elements/product-gallery/index.js.map +1 -0
- package/dist/elements/product-gallery/product-gallery.d.ts +49 -0
- package/dist/elements/product-gallery/product-gallery.js +143 -0
- package/dist/elements/product-gallery/product-gallery.js.map +1 -0
- package/dist/elements/quantity/index.d.ts +3 -0
- package/dist/elements/quantity/index.js +6 -0
- package/dist/elements/quantity/index.js.map +1 -0
- package/dist/elements/quantity/quantity.d.ts +21 -0
- package/dist/elements/quantity/quantity.js +57 -0
- package/dist/elements/quantity/quantity.js.map +1 -0
- package/dist/elements/questions/index.d.ts +3 -0
- package/dist/elements/questions/index.js +6 -0
- package/dist/elements/questions/index.js.map +1 -0
- package/dist/elements/questions/questions.d.ts +28 -0
- package/dist/elements/questions/questions.js +65 -0
- package/dist/elements/questions/questions.js.map +1 -0
- package/dist/elements/quick-view/index.d.ts +2 -0
- package/dist/elements/quick-view/index.js +6 -0
- package/dist/elements/quick-view/index.js.map +1 -0
- package/dist/elements/quick-view/quick-view.d.ts +26 -0
- package/dist/elements/quick-view/quick-view.js +70 -0
- package/dist/elements/quick-view/quick-view.js.map +1 -0
- package/dist/elements/range/index.d.ts +3 -0
- package/dist/elements/range/index.js +6 -0
- package/dist/elements/range/index.js.map +1 -0
- package/dist/elements/range/range.d.ts +24 -0
- package/dist/elements/range/range.js +37 -0
- package/dist/elements/range/range.js.map +1 -0
- package/dist/elements/related/index.d.ts +3 -0
- package/dist/elements/related/index.js +6 -0
- package/dist/elements/related/index.js.map +1 -0
- package/dist/elements/related/related.d.ts +33 -0
- package/dist/elements/related/related.js +66 -0
- package/dist/elements/related/related.js.map +1 -0
- package/dist/elements/review-form/index.d.ts +3 -0
- package/dist/elements/review-form/index.js +6 -0
- package/dist/elements/review-form/index.js.map +1 -0
- package/dist/elements/review-form/review-form.d.ts +60 -0
- package/dist/elements/review-form/review-form.js +158 -0
- package/dist/elements/review-form/review-form.js.map +1 -0
- package/dist/elements/reviews/index.d.ts +3 -0
- package/dist/elements/reviews/index.js +6 -0
- package/dist/elements/reviews/index.js.map +1 -0
- package/dist/elements/reviews/reviews.d.ts +19 -0
- package/dist/elements/reviews/reviews.js +30 -0
- package/dist/elements/reviews/reviews.js.map +1 -0
- package/dist/elements/search/index.d.ts +3 -0
- package/dist/elements/search/index.js +6 -0
- package/dist/elements/search/index.js.map +1 -0
- package/dist/elements/search/search.d.ts +20 -0
- package/dist/elements/search/search.js +53 -0
- package/dist/elements/search/search.js.map +1 -0
- package/dist/elements/shared/folding-form.d.ts +15 -0
- package/dist/elements/shared/folding-form.js +35 -0
- package/dist/elements/shared/folding-form.js.map +1 -0
- package/dist/elements/shared/google-maps.d.ts +100 -0
- package/dist/elements/shared/google-maps.js +34 -0
- package/dist/elements/shared/google-maps.js.map +1 -0
- package/dist/elements/shared/json-form.d.ts +28 -0
- package/dist/elements/shared/json-form.js +85 -0
- package/dist/elements/shared/json-form.js.map +1 -0
- package/dist/elements/shared/paged-section.d.ts +28 -0
- package/dist/elements/shared/paged-section.js +93 -0
- package/dist/elements/shared/paged-section.js.map +1 -0
- package/dist/elements/shared/phone-mask.d.ts +9 -0
- package/dist/elements/shared/phone-mask.js +38 -0
- package/dist/elements/shared/phone-mask.js.map +1 -0
- package/dist/elements/shared/select-item.d.ts +7 -0
- package/dist/elements/shared/select-item.js +19 -0
- package/dist/elements/shared/select-item.js.map +1 -0
- package/dist/elements/store-availability/index.d.ts +3 -0
- package/dist/elements/store-availability/index.js +6 -0
- package/dist/elements/store-availability/index.js.map +1 -0
- package/dist/elements/store-availability/store-availability.d.ts +26 -0
- package/dist/elements/store-availability/store-availability.js +66 -0
- package/dist/elements/store-availability/store-availability.js.map +1 -0
- package/dist/elements/store-map/index.d.ts +4 -0
- package/dist/elements/store-map/index.js +8 -0
- package/dist/elements/store-map/index.js.map +1 -0
- package/dist/elements/store-map/store-map.d.ts +59 -0
- package/dist/elements/store-map/store-map.js +118 -0
- package/dist/elements/store-map/store-map.js.map +1 -0
- package/dist/elements/tabs/index.d.ts +3 -0
- package/dist/elements/tabs/index.js +6 -0
- package/dist/elements/tabs/index.js.map +1 -0
- package/dist/elements/tabs/tabs.d.ts +21 -0
- package/dist/elements/tabs/tabs.js +69 -0
- package/dist/elements/tabs/tabs.js.map +1 -0
- package/dist/elements/toaster/index.d.ts +3 -0
- package/dist/elements/toaster/index.js +7 -0
- package/dist/elements/toaster/index.js.map +1 -0
- package/dist/elements/toaster/toaster.d.ts +47 -0
- package/dist/elements/toaster/toaster.js +109 -0
- package/dist/elements/toaster/toaster.js.map +1 -0
- package/dist/elements/variant-picker/index.d.ts +3 -0
- package/dist/elements/variant-picker/index.js +6 -0
- package/dist/elements/variant-picker/index.js.map +1 -0
- package/dist/elements/variant-picker/variant-picker.d.ts +28 -0
- package/dist/elements/variant-picker/variant-picker.js +83 -0
- package/dist/elements/variant-picker/variant-picker.js.map +1 -0
- package/dist/elements/vote/index.d.ts +3 -0
- package/dist/elements/vote/index.js +6 -0
- package/dist/elements/vote/index.js.map +1 -0
- package/dist/elements/vote/vote.d.ts +33 -0
- package/dist/elements/vote/vote.js +72 -0
- package/dist/elements/vote/vote.js.map +1 -0
- package/dist/lit/forms.d.ts +8 -0
- package/dist/lit/forms.js +42 -0
- package/dist/lit/forms.js.map +1 -0
- package/dist/lit/fragments.d.ts +28 -0
- package/dist/lit/fragments.js +74 -0
- package/dist/lit/fragments.js.map +1 -0
- package/dist/lit/index.d.ts +7 -0
- package/dist/lit/index.js +21 -0
- package/dist/lit/index.js.map +1 -0
- package/dist/lit/lazy-define.d.ts +35 -0
- package/dist/lit/lazy-define.js +103 -0
- package/dist/lit/lazy-define.js.map +1 -0
- package/dist/lit/signal-controller.d.ts +19 -0
- package/dist/lit/signal-controller.js +30 -0
- package/dist/lit/signal-controller.js.map +1 -0
- package/dist/lit/spmkt-element.d.ts +40 -0
- package/dist/lit/spmkt-element.js +76 -0
- package/dist/lit/spmkt-element.js.map +1 -0
- package/dist/locales/en.json +125 -0
- package/dist/locales/sr.json +130 -0
- package/package.json +45 -55
- package/MIGRATION_GUIDE.md +0 -310
- package/api/address.js +0 -115
- package/api/affiliate.js +0 -12
- package/api/cart.js +0 -81
- package/api/compare.js +0 -47
- package/api/countries.js +0 -13
- package/api/order.js +0 -27
- package/api/product-questions.js +0 -36
- package/api/product-reviews.js +0 -35
- package/api/product.js +0 -59
- package/api/request.js +0 -118
- package/api/user.js +0 -71
- package/api.js +0 -26
- package/components/Account/AccountDashboard.vue +0 -136
- package/components/Account/AccountStore.js +0 -97
- package/components/Account/AffiliateReport.vue +0 -98
- package/components/Account/Orders/OrderDetail.vue +0 -169
- package/components/Account/Orders/Orders.vue +0 -124
- package/components/Account/Settings/AccountSettings.vue +0 -45
- package/components/Account/Settings/ChangeEmail.vue +0 -136
- package/components/Account/Settings/ChangeName.vue +0 -82
- package/components/Account/Settings/ChangePassword.vue +0 -91
- package/components/Address/Address.vue +0 -141
- package/components/Address/AddressBook.vue +0 -171
- package/components/Address/AddressSelect.vue +0 -203
- package/components/Address/Edit.vue +0 -527
- package/components/Address/PostalCode.vue +0 -67
- package/components/Address/address.schema.js +0 -84
- package/components/AgeGate.vue +0 -109
- package/components/Auth/Login.vue +0 -191
- package/components/Auth/Register.vue +0 -240
- package/components/Auth/ResetPassword.vue +0 -108
- package/components/Cart/AgeVerification/AgeChecker.vue +0 -141
- package/components/Cart/CartBadge.vue +0 -68
- package/components/Cart/CartBox.vue +0 -139
- package/components/Cart/CartItem.vue +0 -126
- package/components/Cart/CartMode.vue +0 -200
- package/components/Cart/CartPreview.vue +0 -166
- package/components/Cart/CartSummary.vue +0 -107
- package/components/Cart/Coupon.vue +0 -107
- package/components/Cart/CreditCard/Everyware.vue +0 -262
- package/components/Cart/CreditCard/ExtendedCreditCard.vue +0 -240
- package/components/Cart/CreditCard/SquarePay.vue +0 -296
- package/components/Cart/CreditCard/StandardCreditCard.vue +0 -241
- package/components/Cart/Delivery/Delivery.vue +0 -364
- package/components/Cart/Delivery/DeliveryAddress.vue +0 -195
- package/components/Cart/Delivery/DeliveryAddressGuest.vue +0 -204
- package/components/Cart/Delivery/DeliveryMethods.vue +0 -109
- package/components/Cart/Delivery/DeliveryOptions.vue +0 -171
- package/components/Cart/Delivery/DeliveryTypes.vue +0 -61
- package/components/Cart/Delivery/DeliveryWarning.vue +0 -14
- package/components/Cart/Delivery/ReservationSlots.vue +0 -88
- package/components/Cart/Delivery/reservation.schema.js +0 -35
- package/components/Cart/Disclaimer.vue +0 -56
- package/components/Cart/OrderConfirmation.vue +0 -187
- package/components/Cart/Payment/Payment.vue +0 -436
- package/components/Cart/Payment/PaymentMethods.vue +0 -59
- package/components/Cart/ReviewAndSubmit.vue +0 -159
- package/components/Cart/ShoppingCart.vue +0 -219
- package/components/Cart/Store/actions.js +0 -129
- package/components/Cart/Store/getters.js +0 -80
- package/components/Cart/Store/index.js +0 -14
- package/components/Cart/Store/mutations.js +0 -172
- package/components/Cart/Store/state.js +0 -80
- package/components/Cart/UserIdentity.vue +0 -178
- package/components/Category/CategoryFilter.vue +0 -330
- package/components/Category/CategorySort.vue +0 -77
- package/components/Category/FilterMixin.js +0 -70
- package/components/Category/LoadMore.vue +0 -98
- package/components/DeliverTo.vue +0 -51
- package/components/DeliveryNotice.vue +0 -123
- package/components/DobInput.vue +0 -294
- package/components/Gmaps/GmapsAutocomplete.vue +0 -166
- package/components/Gmaps/GmapsLocations.vue +0 -233
- package/components/Gmaps/GmapsSingleLocation.vue +0 -134
- package/components/MobileMenu/MobileMenu.vue +0 -224
- package/components/MobileMenu/components/MenuBurger.vue +0 -23
- package/components/MobileMenu/components/MenuPanel.vue +0 -80
- package/components/MobileMenu/components/MenuShadow.vue +0 -21
- package/components/MobileMenu/demo-data.js +0 -97
- package/components/MobileMenu/icons/LeftArrowIcon.vue +0 -25
- package/components/MobileMenu/icons/MenuIcon.vue +0 -27
- package/components/MobileMenu/icons/RightArrowIcon.vue +0 -25
- package/components/MobileMenu/index.js +0 -8
- package/components/MobileMenu/mixins/contentControl.mixin.js +0 -46
- package/components/MobileMenu/mixins/functionalityStyle.mixin.js +0 -59
- package/components/MobileMenu/mixins/panelControl.mixin.js +0 -51
- package/components/ModalContainer/ModalContainer.vue +0 -212
- package/components/ModalContainer/index.js +0 -103
- package/components/Oembed.vue +0 -46
- package/components/Product/AddToCart.vue +0 -284
- package/components/Product/BoxAddToCart.vue +0 -177
- package/components/Product/Compare.vue +0 -150
- package/components/Product/CompareBox.vue +0 -162
- package/components/Product/Lookup.vue +0 -132
- package/components/Product/Photo.vue +0 -115
- package/components/Product/Price.vue +0 -106
- package/components/Product/ProductAutocomplete.vue +0 -103
- package/components/Product/ProductBox.vue +0 -88
- package/components/Product/ProductImages.vue +0 -137
- package/components/Product/Quantity.vue +0 -126
- package/components/Product/QuickView.vue +0 -145
- package/components/Product/RelatedProducts.vue +0 -104
- package/components/Product/SKU.vue +0 -46
- package/components/Product/Variants.vue +0 -399
- package/components/Product/reviews-questions/ProductQuestions.vue +0 -319
- package/components/Product/reviews-questions/ProductReviews.vue +0 -182
- package/components/Product/reviews-questions/Review.vue +0 -126
- package/components/Product/reviews-questions/ReviewForm.vue +0 -313
- package/components/Product/reviews-questions/ReviewImages.vue +0 -229
- package/components/Product/reviews-questions/Vote.vue +0 -104
- package/components/QuantityInput.vue +0 -111
- package/components/RangeInput.vue +0 -141
- package/components/Recaptcha.vue +0 -104
- package/components/SelectShippingCountry.vue +0 -115
- package/components/TimedOffer.vue +0 -84
- package/composables/globals.js +0 -53
- package/config.js +0 -21
- package/index.js +0 -182
- package/install.js +0 -88
- package/locales/en.json +0 -288
- package/locales/sr.json +0 -288
- package/translations.js +0 -4
- package/utils/animate.css +0 -50
- package/utils/animate.js +0 -23
- package/utils/buefy.js +0 -62
- package/utils/custom-event-bus.js +0 -13
- package/utils/directives.js +0 -79
- package/utils/event-bus.js +0 -56
- package/utils/filters.js +0 -110
- package/utils/format-date.js +0 -17
- package/utils/google/gmaps.js +0 -269
- package/utils/google/google-analytics-eec.js +0 -108
- package/utils/native-dom.js +0 -27
- package/utils/objects.js +0 -19
- package/utils/random-id.js +0 -10
- package/utils/rc-token.js +0 -24
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="box-add-to-cart" @click="handleClick">
|
|
3
|
-
<slot></slot>
|
|
4
|
-
</div>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script>
|
|
8
|
-
import { ref, onMounted } from 'vue'
|
|
9
|
-
import { useBuefy, useT } from '../../composables/globals'
|
|
10
|
-
import config from '../../config'
|
|
11
|
-
import GoogleAnalyticsEEC from '../../utils/google/google-analytics-eec.js'
|
|
12
|
-
import { request, Cart } from '../../api'
|
|
13
|
-
import { eventBus } from '../../utils/event-bus'
|
|
14
|
-
|
|
15
|
-
export default {
|
|
16
|
-
name: 'BoxAddToCart',
|
|
17
|
-
|
|
18
|
-
props: {
|
|
19
|
-
productId: {
|
|
20
|
-
type: Number,
|
|
21
|
-
required: true
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
emits: ['success'],
|
|
26
|
-
|
|
27
|
-
setup(props, { emit }) {
|
|
28
|
-
const $buefy = useBuefy()
|
|
29
|
-
const { t: $t } = useT()
|
|
30
|
-
|
|
31
|
-
// Reactive state
|
|
32
|
-
const loading = ref(false)
|
|
33
|
-
const product = ref({})
|
|
34
|
-
const qty = ref(1)
|
|
35
|
-
const product_id = ref(props.productId)
|
|
36
|
-
|
|
37
|
-
// Methods
|
|
38
|
-
const eecProduct = () => {
|
|
39
|
-
const eecProduct = {
|
|
40
|
-
item_id: product.value.id,
|
|
41
|
-
item_name: product.value.name,
|
|
42
|
-
price: product.value.price,
|
|
43
|
-
item_brand: product.value.brand ? product.value.brand.name : '',
|
|
44
|
-
item_category: product.value?.category?.path.startsWith('/')
|
|
45
|
-
? product.value?.category?.path.substr(1)
|
|
46
|
-
: product.value?.category?.path,
|
|
47
|
-
quantity: parseInt(qty.value, 10)
|
|
48
|
-
}
|
|
49
|
-
return eecProduct
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const productDetails = () => {
|
|
53
|
-
const prod = eecProduct()
|
|
54
|
-
prod.image_url = product.value.images && product.value.images[0]
|
|
55
|
-
? product.value.images[0].url
|
|
56
|
-
: ''
|
|
57
|
-
return prod
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const variantsInStock = () => {
|
|
61
|
-
const vis = product.value.variants?.filter(variant => {
|
|
62
|
-
return variant.in_stock
|
|
63
|
-
}) || []
|
|
64
|
-
return vis.length
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
const updateCart = async () => {
|
|
68
|
-
try {
|
|
69
|
-
const response = await Cart.update({
|
|
70
|
-
mode: 'add',
|
|
71
|
-
id: product.value.id,
|
|
72
|
-
qty: qty.value
|
|
73
|
-
})
|
|
74
|
-
|
|
75
|
-
if (response.data) {
|
|
76
|
-
eventBus.emit('updateCart', response.data)
|
|
77
|
-
} else {
|
|
78
|
-
throw new Error($t('cart.updateCartErrorUnknown'))
|
|
79
|
-
}
|
|
80
|
-
return response.data
|
|
81
|
-
} catch (error) {
|
|
82
|
-
if (!error.message) {
|
|
83
|
-
error.message = $t('cart.updateCartError', error.status)
|
|
84
|
-
}
|
|
85
|
-
$buefy.dialog.alert({
|
|
86
|
-
title: $t('global.error'),
|
|
87
|
-
message: error.message,
|
|
88
|
-
confirmText: 'OK'
|
|
89
|
-
})
|
|
90
|
-
} finally {
|
|
91
|
-
loading.value = false
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
const addToCart = async () => {
|
|
96
|
-
loading.value = true
|
|
97
|
-
const cartResponse = await updateCart()
|
|
98
|
-
if (cartResponse) {
|
|
99
|
-
emit('success')
|
|
100
|
-
eventBus.emit('addToCart', productDetails())
|
|
101
|
-
if (!!window.google_tag_manager) {
|
|
102
|
-
GoogleAnalyticsEEC.addToCart(eecProduct(), () => {
|
|
103
|
-
loading.value = false
|
|
104
|
-
})
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
const setProduct = async () => {
|
|
110
|
-
product.value = {}
|
|
111
|
-
try {
|
|
112
|
-
const resp = await request({
|
|
113
|
-
// The storefront's products/{id} route; the API one is admin-only
|
|
114
|
-
baseURL: config.BASE_URL,
|
|
115
|
-
url: '/products/' + product_id.value
|
|
116
|
-
})
|
|
117
|
-
product.value = resp.data.product_resource || {}
|
|
118
|
-
} catch (e) {
|
|
119
|
-
// The request helper rejects on HTTP errors and timeouts. Leave the product empty
|
|
120
|
-
// so handleClick's product id check stops instead of throwing
|
|
121
|
-
console.error('Cannot get product', e)
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
const handleClick = async (e) => {
|
|
126
|
-
const btn = e.target
|
|
127
|
-
btn.classList.add('is-loading')
|
|
128
|
-
|
|
129
|
-
try {
|
|
130
|
-
await setProduct()
|
|
131
|
-
|
|
132
|
-
if (!product.value.id) {
|
|
133
|
-
return
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
if (variantsInStock() === 1) {
|
|
137
|
-
product_id.value = product.value.variants.find(variant => variant.in_stock).id
|
|
138
|
-
await setProduct()
|
|
139
|
-
if (!product.value.id) {
|
|
140
|
-
return
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
if (variantsInStock() > 1) {
|
|
145
|
-
$buefy.dialog.confirm({
|
|
146
|
-
title: 'Proizvod sa varijantama',
|
|
147
|
-
message: 'Otvorićemo stranicu proizvoda da biste odabrali varijantu.',
|
|
148
|
-
confirmText: 'Ok',
|
|
149
|
-
type: 'is-success',
|
|
150
|
-
ariaRole: 'alertdialog',
|
|
151
|
-
ariaModal: true,
|
|
152
|
-
onConfirm: () => {
|
|
153
|
-
window.location.href = '/' + product.value.slug
|
|
154
|
-
}
|
|
155
|
-
})
|
|
156
|
-
return
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
await addToCart()
|
|
160
|
-
} finally {
|
|
161
|
-
btn.classList.remove('is-loading')
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
onMounted(() => {
|
|
166
|
-
product_id.value = props.productId
|
|
167
|
-
})
|
|
168
|
-
|
|
169
|
-
return {
|
|
170
|
-
loading,
|
|
171
|
-
product,
|
|
172
|
-
qty,
|
|
173
|
-
handleClick
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
</script>
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="comparePage">
|
|
3
|
-
<table class="table is-bordered">
|
|
4
|
-
<tr>
|
|
5
|
-
<td> </td>
|
|
6
|
-
<td class="comparePage__item" v-for="(item, index) in items" :key="item.id">
|
|
7
|
-
<div class="fixedContent">{{ item.name }}</div>
|
|
8
|
-
<Lookup :position="index" :product-on-position="item.id" label="Select" />
|
|
9
|
-
<a :href="item.slug">
|
|
10
|
-
<img :src="item.image" :alt="item.name" />
|
|
11
|
-
<h2>{{ item.name }}</h2>
|
|
12
|
-
<p>${{ item.price }}</p>
|
|
13
|
-
</a>
|
|
14
|
-
</td>
|
|
15
|
-
</tr>
|
|
16
|
-
|
|
17
|
-
<th>General</th>
|
|
18
|
-
|
|
19
|
-
<tr v-for="(attributes, i) in itemGeneral" :key="i">
|
|
20
|
-
<td>{{ attributes[0].name }}</td>
|
|
21
|
-
<td v-for="(attrs, i) in attributes" :key="i">
|
|
22
|
-
<div v-if="attrs.options">{{ stringFilter(attrs.options) }}</div>
|
|
23
|
-
<p v-else>{{ attrs.value }}</p>
|
|
24
|
-
</td>
|
|
25
|
-
</tr>
|
|
26
|
-
|
|
27
|
-
<th>Heating</th>
|
|
28
|
-
|
|
29
|
-
<tr v-for="(attributes, i) in itemHeating" :key="i">
|
|
30
|
-
<td>{{ attributes[0].name }}</td>
|
|
31
|
-
<td v-for="(attrs, i) in attributes" :key="i">
|
|
32
|
-
<div v-if="attrs.options">{{ stringFilter(attrs.options) }}</div>
|
|
33
|
-
<p v-else>{{ attrs.value }}</p>
|
|
34
|
-
</td>
|
|
35
|
-
</tr>
|
|
36
|
-
|
|
37
|
-
<th>Dimensions</th>
|
|
38
|
-
|
|
39
|
-
<tr v-for="(attributes, i) in itemDimensions" :key="i">
|
|
40
|
-
<td>{{ attributes[0].name }}</td>
|
|
41
|
-
<td v-for="(attrs, i) in attributes" :key="i">
|
|
42
|
-
<p>{{ attrs.value }}</p>
|
|
43
|
-
</td>
|
|
44
|
-
</tr>
|
|
45
|
-
|
|
46
|
-
<th>Battery</th>
|
|
47
|
-
|
|
48
|
-
<tr v-for="(attributes, i) in itemBattery" :key="i">
|
|
49
|
-
<td>{{ attributes[0].name }}</td>
|
|
50
|
-
<td v-for="(attrs, i) in attributes" :key="i">
|
|
51
|
-
<p>{{ attrs.value }}</p>
|
|
52
|
-
</td>
|
|
53
|
-
</tr>
|
|
54
|
-
</table>
|
|
55
|
-
</div>
|
|
56
|
-
</template>
|
|
57
|
-
|
|
58
|
-
<script setup>
|
|
59
|
-
import { ref, onMounted, onUnmounted, getCurrentInstance } from 'vue'
|
|
60
|
-
import Lookup from './Lookup.vue'
|
|
61
|
-
|
|
62
|
-
defineOptions({ name: 'ComparePage' })
|
|
63
|
-
|
|
64
|
-
const props = defineProps({
|
|
65
|
-
compareData: {
|
|
66
|
-
type: Object,
|
|
67
|
-
default: () => ({
|
|
68
|
-
product: [],
|
|
69
|
-
General: {},
|
|
70
|
-
Heating: {},
|
|
71
|
-
Dimensions: {},
|
|
72
|
-
Battery: {}
|
|
73
|
-
})
|
|
74
|
-
}
|
|
75
|
-
})
|
|
76
|
-
|
|
77
|
-
// Get global properties
|
|
78
|
-
const instance = getCurrentInstance()
|
|
79
|
-
|
|
80
|
-
// Reactive state
|
|
81
|
-
const items = ref([])
|
|
82
|
-
const itemGeneral = ref({})
|
|
83
|
-
const itemHeating = ref({})
|
|
84
|
-
const itemBattery = ref({})
|
|
85
|
-
const itemDimensions = ref({})
|
|
86
|
-
|
|
87
|
-
// Methods
|
|
88
|
-
const stringFilter = (value) => {
|
|
89
|
-
if (!value) return ''
|
|
90
|
-
value = value.toString()
|
|
91
|
-
return value
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
let onScroll = null
|
|
95
|
-
|
|
96
|
-
// Adds .scrolled to the product name headers while the first one is out of view. Its
|
|
97
|
-
// position is read once, since .scrolled makes the headers fixed, which moves them.
|
|
98
|
-
const initScrollMonitor = () => {
|
|
99
|
-
const elToWatch = document.querySelectorAll('.fixedContent')
|
|
100
|
-
if (!elToWatch.length) return
|
|
101
|
-
|
|
102
|
-
const rect = elToWatch[0].getBoundingClientRect()
|
|
103
|
-
const top = rect.top + window.scrollY
|
|
104
|
-
const bottom = rect.bottom + window.scrollY
|
|
105
|
-
const isInViewport = () => top < window.scrollY + window.innerHeight && bottom > window.scrollY
|
|
106
|
-
const setScrolled = (scrolled) => elToWatch.forEach((el) => el.classList.toggle('scrolled', scrolled))
|
|
107
|
-
|
|
108
|
-
let inViewport = isInViewport()
|
|
109
|
-
if (!inViewport && top < window.scrollY) {
|
|
110
|
-
setScrolled(true)
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
onScroll = () => {
|
|
114
|
-
if (isInViewport() !== inViewport) {
|
|
115
|
-
inViewport = !inViewport
|
|
116
|
-
setScrolled(!inViewport)
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
window.addEventListener('scroll', onScroll, { passive: true })
|
|
120
|
-
window.addEventListener('resize', onScroll, { passive: true })
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// Lifecycle hooks
|
|
124
|
-
onMounted(() => {
|
|
125
|
-
// Check if compareData prop is provided, otherwise use window.compare
|
|
126
|
-
if (props.compareData && props.compareData.product.length > 0) {
|
|
127
|
-
items.value = props.compareData.product
|
|
128
|
-
itemGeneral.value = props.compareData.General
|
|
129
|
-
itemHeating.value = props.compareData.Heating
|
|
130
|
-
itemDimensions.value = props.compareData.Dimensions
|
|
131
|
-
itemBattery.value = props.compareData.Battery
|
|
132
|
-
} else if (window.compare) {
|
|
133
|
-
items.value = window.compare.product
|
|
134
|
-
itemGeneral.value = window.compare.General
|
|
135
|
-
itemHeating.value = window.compare.Heating
|
|
136
|
-
itemDimensions.value = window.compare.Dimensions
|
|
137
|
-
itemBattery.value = window.compare.Battery
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
window.addEventListener('load', initScrollMonitor, false)
|
|
141
|
-
})
|
|
142
|
-
|
|
143
|
-
onUnmounted(() => {
|
|
144
|
-
window.removeEventListener('load', initScrollMonitor, false)
|
|
145
|
-
if (onScroll) {
|
|
146
|
-
window.removeEventListener('scroll', onScroll)
|
|
147
|
-
window.removeEventListener('resize', onScroll)
|
|
148
|
-
}
|
|
149
|
-
})
|
|
150
|
-
</script>
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div v-if="products.length > 0 && viewProducts" class="compareProducts">
|
|
3
|
-
<div class="columns is-mobile is-multiline is-vcentered box">
|
|
4
|
-
<div class="compareProducts__items is-flex">
|
|
5
|
-
<div
|
|
6
|
-
class="compareProducts__product is-flex is-centered is-vcentered is-relative"
|
|
7
|
-
@click="removeProd(product.id)"
|
|
8
|
-
v-for="product in products"
|
|
9
|
-
:key="product.id"
|
|
10
|
-
>
|
|
11
|
-
<img :src="product.image" :alt="product.name" />
|
|
12
|
-
</div>
|
|
13
|
-
</div>
|
|
14
|
-
<button name="compare_button" :disabled="products.length < 2" :class="['button', 'is-primary', { 'is-small': mq === 'mobile' }]" @click="compare">
|
|
15
|
-
{{ $t('product.compare') }}
|
|
16
|
-
</button>
|
|
17
|
-
<button name="clear_compare" :class="['button', 'btn-close', { 'is-small': mq === 'mobile' }]" @click="hideCompareBox"> × </button>
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
20
|
-
</template>
|
|
21
|
-
|
|
22
|
-
<script setup>
|
|
23
|
-
import { ref, onMounted, onBeforeUnmount } from 'vue'
|
|
24
|
-
import { useBuefy, useMq, useT } from '../../composables/globals'
|
|
25
|
-
import _ from 'underscore'
|
|
26
|
-
import Cookie from 'js-cookie'
|
|
27
|
-
import { eventBus } from '../../utils/event-bus'
|
|
28
|
-
|
|
29
|
-
defineOptions({ name: 'CompareBox' })
|
|
30
|
-
|
|
31
|
-
const $buefy = useBuefy()
|
|
32
|
-
const { t: $t } = useT()
|
|
33
|
-
const mq = useMq()
|
|
34
|
-
|
|
35
|
-
// Reactive state
|
|
36
|
-
const attTemplateId = ref(0)
|
|
37
|
-
const products = ref([])
|
|
38
|
-
const viewProducts = ref(true)
|
|
39
|
-
|
|
40
|
-
// Methods
|
|
41
|
-
const setCompareIconStatus = (product_id, status) => {
|
|
42
|
-
let productIconEl = document.getElementById('prod-compare-' + product_id)
|
|
43
|
-
if (!productIconEl) {
|
|
44
|
-
return false
|
|
45
|
-
}
|
|
46
|
-
if (status == 'on') {
|
|
47
|
-
productIconEl.classList.add('has-text-info')
|
|
48
|
-
} else {
|
|
49
|
-
productIconEl.classList.remove('has-text-info')
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const initCompareList = () => {
|
|
54
|
-
let cCompareList = ''
|
|
55
|
-
try {
|
|
56
|
-
cCompareList = JSON.parse(Cookie.get('compareList'))
|
|
57
|
-
} catch (e) {
|
|
58
|
-
console.log('Cannot parse compareList', Cookie.get('compareList'))
|
|
59
|
-
}
|
|
60
|
-
if (cCompareList) {
|
|
61
|
-
products.value = _.compact(cCompareList)
|
|
62
|
-
products.value.forEach((product) => {
|
|
63
|
-
setCompareIconStatus(product.id, 'on')
|
|
64
|
-
})
|
|
65
|
-
setAttTemplateId()
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const setAttTemplateId = () => {
|
|
70
|
-
if (products.value.length > 0) {
|
|
71
|
-
attTemplateId.value = products.value[0]['att_template_id']
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const setProducts = (newProducts) => {
|
|
76
|
-
products.value = newProducts
|
|
77
|
-
setAttTemplateId()
|
|
78
|
-
Cookie.set('compareList', JSON.stringify(products.value), { expires: 1 })
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
const addProduct = (product) => {
|
|
82
|
-
if (products.value.length >= 4) {
|
|
83
|
-
$buefy.dialog.alert({
|
|
84
|
-
title: $t('product.compareErrorDialogTitle'),
|
|
85
|
-
message: $t('product.compareErrorMaxProducts'),
|
|
86
|
-
canCancel: ['button', 'escape'],
|
|
87
|
-
confirmText: $t('product.compareErrorDialogConfirm'),
|
|
88
|
-
cancelText: $t('global.cancel'),
|
|
89
|
-
onConfirm: () => {
|
|
90
|
-
compare()
|
|
91
|
-
}
|
|
92
|
-
})
|
|
93
|
-
return false
|
|
94
|
-
}
|
|
95
|
-
products.value.push(product)
|
|
96
|
-
setCompareIconStatus(product.id, 'on')
|
|
97
|
-
setAttTemplateId()
|
|
98
|
-
Cookie.set('compareList', JSON.stringify(products.value), { expires: 1 })
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
const compare = () => {
|
|
102
|
-
const productList = products.value.map((el) => el.id)
|
|
103
|
-
window.location.href = `/compare-products?products=${productList}`
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
const removeProd = (id) => {
|
|
107
|
-
setProducts(_.reject(products.value, (product) => product.id == id))
|
|
108
|
-
setCompareIconStatus(id, 'off')
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
const clear = () => {
|
|
112
|
-
products.value.forEach((product) => {
|
|
113
|
-
setCompareIconStatus(product.id, 'off')
|
|
114
|
-
})
|
|
115
|
-
setProducts([])
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
const hideCompareBox = () => {
|
|
119
|
-
$buefy.dialog.alert({
|
|
120
|
-
title: $t('product.compareCloseDialogTitle'),
|
|
121
|
-
message: $t('product.compareCloseDialogMsg'),
|
|
122
|
-
canCancel: ['button', 'escape'],
|
|
123
|
-
confirmText: $t('product.compareClear'),
|
|
124
|
-
cancelText: $t('global.cancel'),
|
|
125
|
-
onConfirm: () => {
|
|
126
|
-
clear()
|
|
127
|
-
}
|
|
128
|
-
})
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
const handleCompareProduct = (productData) => {
|
|
132
|
-
if (_.findWhere(products.value, { id: productData.id })) {
|
|
133
|
-
removeProd(productData.id)
|
|
134
|
-
} else {
|
|
135
|
-
if (products.value.length > 0 && productData.att_template_id !== attTemplateId.value) {
|
|
136
|
-
$buefy.dialog.alert({
|
|
137
|
-
title: $t('global.error'),
|
|
138
|
-
message: $t('product.compareErrorDifferentCategories'),
|
|
139
|
-
canCancel: ['button', 'escape'],
|
|
140
|
-
confirmText: $t('product.compareClear'),
|
|
141
|
-
cancelText: $t('global.cancel'),
|
|
142
|
-
onConfirm: () => {
|
|
143
|
-
clear()
|
|
144
|
-
addProduct(productData)
|
|
145
|
-
}
|
|
146
|
-
})
|
|
147
|
-
return false
|
|
148
|
-
}
|
|
149
|
-
addProduct(productData)
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
// Lifecycle hooks
|
|
154
|
-
onMounted(() => {
|
|
155
|
-
initCompareList()
|
|
156
|
-
eventBus.on('compareProduct', handleCompareProduct)
|
|
157
|
-
})
|
|
158
|
-
|
|
159
|
-
onBeforeUnmount(() => {
|
|
160
|
-
eventBus.off('compareProduct', handleCompareProduct)
|
|
161
|
-
})
|
|
162
|
-
</script>
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<b-field :label="label">
|
|
4
|
-
<b-autocomplete
|
|
5
|
-
placeholder="Search for product"
|
|
6
|
-
field="name"
|
|
7
|
-
:keep-first="true"
|
|
8
|
-
:data="data"
|
|
9
|
-
:loading="isFetching"
|
|
10
|
-
@typing="getAsyncData"
|
|
11
|
-
@select="select($event)"
|
|
12
|
-
>
|
|
13
|
-
<template #default="props">
|
|
14
|
-
<div class="media">
|
|
15
|
-
<div class="media-left">
|
|
16
|
-
<img width="32" :src="props.option.image" />
|
|
17
|
-
</div>
|
|
18
|
-
<div class="media-content">
|
|
19
|
-
{{ props.option.name }}
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
22
|
-
</template>
|
|
23
|
-
</b-autocomplete>
|
|
24
|
-
</b-field>
|
|
25
|
-
</div>
|
|
26
|
-
</template>
|
|
27
|
-
|
|
28
|
-
<script setup>
|
|
29
|
-
import { ref, onMounted, onBeforeUnmount } from 'vue'
|
|
30
|
-
import { useBuefy, useBus } from '../../composables/globals'
|
|
31
|
-
import _ from 'underscore'
|
|
32
|
-
import { request } from '../../api'
|
|
33
|
-
|
|
34
|
-
defineOptions({ name: 'ProductLookup' })
|
|
35
|
-
|
|
36
|
-
const props = defineProps({
|
|
37
|
-
position: {
|
|
38
|
-
type: [Number, String],
|
|
39
|
-
default: -1
|
|
40
|
-
},
|
|
41
|
-
productOnPosition: {
|
|
42
|
-
type: [Number, String],
|
|
43
|
-
default: null
|
|
44
|
-
},
|
|
45
|
-
label: {
|
|
46
|
-
type: String,
|
|
47
|
-
default: ''
|
|
48
|
-
},
|
|
49
|
-
attTemplateId: {
|
|
50
|
-
type: [Number, String],
|
|
51
|
-
default: null
|
|
52
|
-
}
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
// Get global properties and injections
|
|
56
|
-
const $bus = useBus()
|
|
57
|
-
const $buefy = useBuefy()
|
|
58
|
-
|
|
59
|
-
// Reactive state
|
|
60
|
-
const data = ref([])
|
|
61
|
-
const selected = ref(null)
|
|
62
|
-
const isFetching = ref(false)
|
|
63
|
-
const selectedIds = ref([])
|
|
64
|
-
|
|
65
|
-
// Methods
|
|
66
|
-
const getAsyncData = _.debounce(function (query) {
|
|
67
|
-
if (!query.length) {
|
|
68
|
-
data.value = []
|
|
69
|
-
return
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
isFetching.value = true
|
|
73
|
-
|
|
74
|
-
return request({
|
|
75
|
-
baseURL: '',
|
|
76
|
-
url: '/products/lookup?q=' + query + '&tid=' + props.attTemplateId,
|
|
77
|
-
method: 'get'
|
|
78
|
-
})
|
|
79
|
-
.then((response) => {
|
|
80
|
-
console.log('response: ', response)
|
|
81
|
-
data.value = response.data.slice(0, 6)
|
|
82
|
-
isFetching.value = false
|
|
83
|
-
})
|
|
84
|
-
.catch((error) => {
|
|
85
|
-
console.log(error)
|
|
86
|
-
isFetching.value = false
|
|
87
|
-
})
|
|
88
|
-
}, 500)
|
|
89
|
-
|
|
90
|
-
const select = (option) => {
|
|
91
|
-
if (!option) {
|
|
92
|
-
return
|
|
93
|
-
}
|
|
94
|
-
if (selectedIds.value.indexOf(option.id.toString()) === -1) {
|
|
95
|
-
if (parseInt(props.position) >= 0) {
|
|
96
|
-
selectedIds.value[props.position] = option.id
|
|
97
|
-
} else {
|
|
98
|
-
selectedIds.value.push(option.id.toString())
|
|
99
|
-
}
|
|
100
|
-
window.location.href = '/compare-products?products=' + selectedIds.value.join(',')
|
|
101
|
-
} else {
|
|
102
|
-
$buefy.dialog.alert({
|
|
103
|
-
title: '',
|
|
104
|
-
message: "You've already selected " + option.name,
|
|
105
|
-
confirmText: 'OK'
|
|
106
|
-
})
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
const remove = (position) => {
|
|
111
|
-
selectedIds.value.splice(position, 1)
|
|
112
|
-
window.location.href = '/compare-products?products=' + selectedIds.value.join(',')
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
const onRemoveFromCompare = (position) => {
|
|
116
|
-
remove(position)
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// Lifecycle hooks
|
|
120
|
-
onMounted(() => {
|
|
121
|
-
const urlParams = new URL(window.location.href).searchParams.get('products')
|
|
122
|
-
if (urlParams) {
|
|
123
|
-
selectedIds.value = urlParams.split(',')
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
$bus.on('removeFromCompare', onRemoveFromCompare)
|
|
127
|
-
})
|
|
128
|
-
|
|
129
|
-
onBeforeUnmount(() => {
|
|
130
|
-
$bus.off('removeFromCompare', onRemoveFromCompare)
|
|
131
|
-
})
|
|
132
|
-
</script>
|