@wikala/spmkt 2.31.0 → 3.0.0-beta.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/MIGRATION_GUIDE.md +261 -0
- package/api/product.js +1 -0
- package/api/request.js +9 -4
- package/api/user.js +1 -1
- package/components/Account/AccountDashboard.vue +101 -101
- package/components/Account/AccountStore.js +57 -31
- package/components/Account/AffiliateReport.vue +56 -60
- package/components/Account/{OrderDetail.vue → Orders/OrderDetail.vue} +44 -30
- package/components/Account/Orders/Orders.vue +124 -0
- package/components/Account/{AccountSettings.vue → Settings/AccountSettings.vue} +4 -4
- package/components/Account/Settings/ChangeEmail.vue +136 -0
- package/components/Account/Settings/ChangeName.vue +82 -0
- package/components/Account/Settings/ChangePassword.vue +91 -0
- package/components/Address/Address.vue +38 -57
- package/components/Address/AddressBook.vue +77 -57
- package/components/Address/AddressSelect.vue +94 -87
- package/components/Address/Edit.vue +253 -265
- package/components/Address/PostalCode.vue +22 -21
- package/components/AgeGate.vue +11 -5
- package/components/Auth/Login.vue +62 -44
- package/components/Auth/Register.vue +82 -60
- package/components/Auth/ResetPassword.vue +45 -30
- package/components/Cart/AgeVerification/AgeChecker.vue +3 -3
- package/components/Cart/CartBadge.vue +15 -4
- package/components/Cart/CartBox.vue +19 -11
- package/components/Cart/CartItem.vue +3 -3
- package/components/Cart/CartMode.vue +6 -5
- package/components/Cart/CartPreview.vue +24 -18
- package/components/Cart/Coupon.vue +4 -5
- package/components/Cart/CreditCard/Everyware.vue +10 -10
- package/components/Cart/CreditCard/ExtendedCreditCard.vue +5 -5
- package/components/Cart/CreditCard/SquarePay.vue +18 -16
- package/components/Cart/CreditCard/StandardCreditCard.vue +9 -9
- package/components/Cart/Delivery/Delivery.vue +16 -12
- package/components/Cart/Delivery/DeliveryAddress.vue +1 -1
- package/components/Cart/Delivery/DeliveryMethods.vue +1 -1
- package/components/Cart/Delivery/DeliveryOptions.vue +15 -9
- package/components/Cart/Delivery/DeliveryTypes.vue +8 -5
- package/components/Cart/Delivery/ReservationSlots.vue +14 -8
- package/components/Cart/Disclaimer.vue +1 -1
- package/components/Cart/OrderConfirmation.vue +1 -1
- package/components/Cart/Payment/Payment.vue +37 -33
- package/components/Cart/Payment/PaymentMethods.vue +6 -4
- package/components/Cart/ReviewAndSubmit.vue +9 -7
- package/components/Cart/ShoppingCart.vue +42 -31
- package/components/Cart/Store/actions.js +1 -1
- package/components/Cart/Store/getters.js +2 -1
- package/components/Cart/Store/index.js +1 -1
- package/components/Cart/Store/mutations.js +7 -5
- package/components/Cart/UserIdentity.vue +1 -1
- package/components/Category/CategoryFilter.vue +128 -114
- package/components/Category/CategorySort.vue +44 -32
- package/components/Category/LoadMore.vue +39 -23
- package/components/DeliverTo.vue +10 -15
- package/components/DeliveryNotice.vue +72 -68
- package/components/DobInput.vue +23 -23
- package/components/Gmaps/GmapsAutocomplete.vue +139 -78
- package/components/Gmaps/GmapsLocations.vue +1 -1
- package/components/Gmaps/GmapsSingleLocation.vue +121 -87
- package/components/ModalContainer/ModalContainer.vue +12 -9
- package/components/ModalContainer/index.js +61 -18
- package/components/Product/AddToCart.vue +237 -221
- package/components/Product/BoxAddToCart.vue +114 -86
- package/components/Product/Compare.vue +68 -48
- package/components/Product/CompareBox.vue +128 -123
- package/components/Product/Lookup.vue +92 -65
- package/components/Product/Photo.vue +105 -66
- package/components/Product/Price.vue +64 -43
- package/components/Product/ProductAutocomplete.vue +52 -57
- package/components/Product/ProductBox.vue +61 -38
- package/components/Product/ProductImages.vue +83 -86
- package/components/Product/Quantity.vue +115 -53
- package/components/Product/QuickView.vue +52 -45
- package/components/Product/RelatedProducts.vue +88 -23
- package/components/Product/SKU.vue +27 -8
- package/components/Product/Variants.vue +335 -341
- package/components/Product/reviews-questions/ProductQuestions.vue +226 -198
- package/components/Product/reviews-questions/ProductReviews.vue +122 -107
- package/components/Product/reviews-questions/Review.vue +54 -59
- package/components/Product/reviews-questions/ReviewForm.vue +222 -170
- package/components/Product/reviews-questions/ReviewImages.vue +197 -216
- package/components/Product/reviews-questions/Vote.vue +83 -57
- package/components/QuantityInput.vue +18 -8
- package/components/RangeInput.vue +15 -8
- package/components/Recaptcha.vue +8 -1
- package/components/SelectShippingCountry.vue +81 -62
- package/components/TimedOffer.vue +59 -74
- package/composables/globals.js +53 -0
- package/config.js +5 -2
- package/index.js +41 -10
- package/install.js +75 -0
- package/locales/en.json +2 -1
- package/locales/sr.json +2 -1
- package/package.json +43 -30
- package/utils/directives.js +28 -45
- package/utils/event-bus.js +56 -0
- package/utils/filters.js +24 -7
- package/utils/{gmaps.js → google/gmaps.js} +43 -10
- package/utils/{google-analytics-eec.js → google/google-analytics-eec.js} +7 -7
- package/babel.config.js +0 -5
- package/components/Account/ChangeEmail.vue +0 -133
- package/components/Account/ChangeName.vue +0 -92
- package/components/Account/ChangePassword.vue +0 -94
- package/components/Account/CreditCards.vue +0 -18
- package/components/Account/Orders.vue +0 -110
- package/components/Account/Settings.vue +0 -18
- package/components/Cart/Delivery/DeliveryAddressGuest.spec.js +0 -128
- package/components/Cart/Delivery/DeliveryTypes.spec.js +0 -83
- package/components/Cart/PCIBadge/SecurityMetrics.vue +0 -11
- package/components/Instagram.vue +0 -49
- package/components/ProductImageModal.vue +0 -41
- package/jest.config.js +0 -16
- package/test/e2e/.babelrc.js +0 -8
- package/test/e2e/.eslintrc.js +0 -11
- package/test/e2e/accAuth.spec.js +0 -64
- package/test/e2e/ageGate.spec.js +0 -26
- package/test/e2e/checkout.spec.js +0 -106
- package/test/e2e/compare.spec.js +0 -52
- package/test/e2e/config/data.js +0 -21
- package/test/e2e/config/routes.js +0 -11
- package/test/e2e/region.spec.js +0 -46
- package/test/e2e/search.spec.js +0 -32
- package/tests/vueBuefy.js +0 -4
- package/tsconfig.json +0 -8
|
@@ -2,29 +2,31 @@
|
|
|
2
2
|
<div class="choose-addr">
|
|
3
3
|
<div v-if="addAddress" class="add-address">
|
|
4
4
|
<button type="button" @click="addNewAddress()" class="button">{{ $t('address.add') }}</button>
|
|
5
|
-
<b-modal :active="showEditAddressDialog" @close="showEditAddressDialog = false" class="wkl-modal-container">
|
|
6
|
-
<div class="edit-address-container">
|
|
7
|
-
<header class="modal-card-head">
|
|
8
|
-
<p class="modal-card-title">{{ addressData.id ? $t('address.title') : $t('address.add') }}</p>
|
|
9
|
-
</header>
|
|
10
|
-
<section class="edit-address">
|
|
11
|
-
<EditAddress
|
|
12
|
-
:countries="countries"
|
|
13
|
-
:address-data="addressData"
|
|
14
|
-
:errors="validationErrors"
|
|
15
|
-
:show-business="orderAsBussinessEnabled"
|
|
16
|
-
/>
|
|
17
|
-
</section>
|
|
18
|
-
<footer class="modal-card-foot">
|
|
19
|
-
<button @click="saveAddress" class="button is-primary is-fullwidth is-large" :class="{'is-loading': savingAddress}">{{ $t('global.save') }}</button>
|
|
20
|
-
</footer>
|
|
21
|
-
</div>
|
|
22
|
-
</b-modal>
|
|
23
5
|
</div>
|
|
6
|
+
<!-- Outside the add-address block: editing an existing address needs it too -->
|
|
7
|
+
<b-modal v-model="showEditAddressDialog" class="wkl-modal-container edit-address-modal" has-modal-card :can-cancel="['escape', 'outside']">
|
|
8
|
+
<div class="modal-card edit-address-container">
|
|
9
|
+
<header class="modal-card-head">
|
|
10
|
+
<p class="modal-card-title">{{ addressData.id ? $t('address.title') : $t('address.add') }}</p>
|
|
11
|
+
<button type="button" class="modal-close is-large" :aria-label="$t('global.close')" @click="showEditAddressDialog = false"></button>
|
|
12
|
+
</header>
|
|
13
|
+
<section class="modal-card-body edit-address">
|
|
14
|
+
<EditAddress
|
|
15
|
+
:countries="countries"
|
|
16
|
+
:address-data="addressData"
|
|
17
|
+
:errors="validationErrors"
|
|
18
|
+
:show-business="orderAsBussinessEnabled"
|
|
19
|
+
/>
|
|
20
|
+
</section>
|
|
21
|
+
<footer class="modal-card-foot">
|
|
22
|
+
<button @click="saveAddress" class="button is-primary is-fullwidth is-large" :class="{'is-loading': savingAddress}">{{ $t('global.save') }}</button>
|
|
23
|
+
</footer>
|
|
24
|
+
</div>
|
|
25
|
+
</b-modal>
|
|
24
26
|
<div v-if="addressList.length" class="address-list" ref="selectAddressContainer">
|
|
25
|
-
<div class="address-container" v-for="(address, index) in addressList" :key="index">
|
|
27
|
+
<div class="is-flex address-container" v-for="(address, index) in addressList" :key="index">
|
|
26
28
|
<div class="address-cb">
|
|
27
|
-
<b-radio @
|
|
29
|
+
<b-radio v-model="selectedAddressId" @update:model-value="selectAddress(address)" :native-value="address.id" size="is-small"></b-radio>
|
|
28
30
|
</div>
|
|
29
31
|
<Address
|
|
30
32
|
:repository="repository"
|
|
@@ -32,7 +34,6 @@
|
|
|
32
34
|
:address-data="address"
|
|
33
35
|
:actions-enabled="addressActionsEnabled"
|
|
34
36
|
@edit="editAddress"
|
|
35
|
-
@saved="onAddressSaved"
|
|
36
37
|
@deleted="addressDeleted"
|
|
37
38
|
@select="selectAddress(address)"
|
|
38
39
|
/>
|
|
@@ -42,13 +43,14 @@
|
|
|
42
43
|
</template>
|
|
43
44
|
|
|
44
45
|
<script>
|
|
45
|
-
import {
|
|
46
|
-
import
|
|
47
|
-
|
|
48
|
-
import
|
|
49
|
-
import EditAddress from './Edit'
|
|
50
|
-
import addressSchema from './address.schema'
|
|
46
|
+
import { ref, onMounted } from 'vue'
|
|
47
|
+
import { useBuefy, useT } from '../../composables/globals'
|
|
48
|
+
import { Address as AddressRepository } from '../../api'
|
|
49
|
+
import gmaps from '../../utils/google/gmaps'
|
|
51
50
|
|
|
51
|
+
import Address from './Address.vue'
|
|
52
|
+
import EditAddress from './Edit.vue'
|
|
53
|
+
import { addressSchema } from './address.schema'
|
|
52
54
|
|
|
53
55
|
export default {
|
|
54
56
|
name: 'AddressSelect',
|
|
@@ -78,7 +80,7 @@ export default {
|
|
|
78
80
|
},
|
|
79
81
|
addressActionsEnabled: {
|
|
80
82
|
type: Array,
|
|
81
|
-
default: ['edit', 'delete']
|
|
83
|
+
default: () => ['edit', 'delete']
|
|
82
84
|
},
|
|
83
85
|
context: {
|
|
84
86
|
type: String,
|
|
@@ -90,106 +92,111 @@ export default {
|
|
|
90
92
|
}
|
|
91
93
|
},
|
|
92
94
|
|
|
93
|
-
|
|
94
|
-
return {
|
|
95
|
-
addressData: { ...addressSchema },
|
|
96
|
-
showEditAddressDialog: false,
|
|
97
|
-
selectedAddressId: null,
|
|
98
|
-
validationErrors: {},
|
|
99
|
-
savingAddress: false
|
|
100
|
-
}
|
|
101
|
-
},
|
|
95
|
+
emits: ['select', 'addressSaved', 'addressDeleted'],
|
|
102
96
|
|
|
103
|
-
|
|
97
|
+
setup(props, { emit }) {
|
|
98
|
+
const $buefy = useBuefy()
|
|
99
|
+
const { t: $t } = useT()
|
|
104
100
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
101
|
+
const addressData = ref({ ...addressSchema })
|
|
102
|
+
const showEditAddressDialog = ref(false)
|
|
103
|
+
const selectedAddressId = ref(null)
|
|
104
|
+
const validationErrors = ref({})
|
|
105
|
+
const savingAddress = ref(false)
|
|
106
|
+
const selectAddressContainer = ref(null)
|
|
108
107
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
this.showEditAddressDialog = true;
|
|
114
|
-
},
|
|
108
|
+
const setCoordinates = async () => {
|
|
109
|
+
addressData.value.coordinates = await gmaps.geocodeAddress(AddressRepository.getFormatted(addressData.value))
|
|
110
|
+
}
|
|
115
111
|
|
|
116
|
-
|
|
112
|
+
const addNewAddress = () => {
|
|
113
|
+
addressData.value = { ...addressSchema }
|
|
114
|
+
showEditAddressDialog.value = true
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const editAddress = async (pl, button) => {
|
|
117
118
|
button.classList.add('is-loading')
|
|
118
119
|
try {
|
|
119
120
|
let resp = await AddressRepository.get(pl)
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
} catch (e)
|
|
123
|
-
|
|
121
|
+
addressData.value = resp.data.data
|
|
122
|
+
showEditAddressDialog.value = true
|
|
123
|
+
} catch (e) {
|
|
124
|
+
$buefy.toast.open({
|
|
124
125
|
message: 'Cannot get address data',
|
|
125
126
|
type: 'is-error'
|
|
126
127
|
})
|
|
127
128
|
} finally {
|
|
128
129
|
button.classList.remove('is-loading')
|
|
129
130
|
}
|
|
130
|
-
}
|
|
131
|
+
}
|
|
131
132
|
|
|
132
|
-
async
|
|
133
|
-
|
|
134
|
-
this.savingAddress = true
|
|
133
|
+
const saveAddress = async () => {
|
|
134
|
+
savingAddress.value = true
|
|
135
135
|
try {
|
|
136
|
-
await
|
|
136
|
+
await setCoordinates()
|
|
137
137
|
} catch (e) {
|
|
138
138
|
console.log('Geocoder problem', e)
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
try {
|
|
142
|
-
let response = await AddressRepository.edit(
|
|
142
|
+
let response = await AddressRepository.edit(addressData.value)
|
|
143
143
|
if (response.status == 201 || response.status == 200) {
|
|
144
|
-
|
|
145
|
-
message:
|
|
144
|
+
$buefy.toast.open({
|
|
145
|
+
message: $t('address.savedNotification'),
|
|
146
146
|
type: 'is-success'
|
|
147
147
|
})
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
this.$emit('addressSaved', response.data.data)
|
|
148
|
+
showEditAddressDialog.value = false
|
|
149
|
+
addressData.value = { ...addressSchema }
|
|
150
|
+
selectAddress(response.data.data)
|
|
151
|
+
emit('addressSaved', response.data.data)
|
|
153
152
|
}
|
|
154
153
|
} catch (error) {
|
|
155
154
|
if (error.errors) {
|
|
156
|
-
|
|
155
|
+
validationErrors.value = error.errors
|
|
157
156
|
}
|
|
158
157
|
} finally {
|
|
159
|
-
|
|
158
|
+
savingAddress.value = false
|
|
160
159
|
}
|
|
161
|
-
}
|
|
160
|
+
}
|
|
162
161
|
|
|
163
|
-
selectAddress(address) {
|
|
162
|
+
const selectAddress = (address) => {
|
|
164
163
|
let loadingSelectAddress = null
|
|
165
164
|
setTimeout(() => {
|
|
166
|
-
loadingSelectAddress =
|
|
167
|
-
container:
|
|
165
|
+
loadingSelectAddress = $buefy.loading.open({
|
|
166
|
+
container: selectAddressContainer.value
|
|
168
167
|
})
|
|
169
168
|
}, 500)
|
|
170
169
|
|
|
171
|
-
|
|
170
|
+
selectedAddressId.value = address.id
|
|
172
171
|
setTimeout(() => {
|
|
173
172
|
loadingSelectAddress.close()
|
|
174
|
-
|
|
173
|
+
emit('select', address)
|
|
175
174
|
}, 1500)
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
onAddressSaved(address) {
|
|
179
|
-
this.selectAddress(address)
|
|
180
|
-
this.showEditAddress = false
|
|
181
|
-
this.$emit('addressSaved', address)
|
|
182
|
-
},
|
|
175
|
+
}
|
|
183
176
|
|
|
184
|
-
addressDeleted() {
|
|
185
|
-
|
|
177
|
+
const addressDeleted = () => {
|
|
178
|
+
emit('addressDeleted')
|
|
186
179
|
}
|
|
187
|
-
},
|
|
188
180
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
181
|
+
onMounted(() => {
|
|
182
|
+
// console.log('AddressSelect countries ', props.countries)
|
|
183
|
+
if (props.addressList.length > 0) {
|
|
184
|
+
// selectAddress(props.addressList[0])
|
|
185
|
+
}
|
|
186
|
+
})
|
|
187
|
+
|
|
188
|
+
return {
|
|
189
|
+
addressData,
|
|
190
|
+
showEditAddressDialog,
|
|
191
|
+
selectedAddressId,
|
|
192
|
+
validationErrors,
|
|
193
|
+
savingAddress,
|
|
194
|
+
selectAddressContainer,
|
|
195
|
+
addNewAddress,
|
|
196
|
+
editAddress,
|
|
197
|
+
saveAddress,
|
|
198
|
+
selectAddress,
|
|
199
|
+
addressDeleted
|
|
193
200
|
}
|
|
194
201
|
}
|
|
195
202
|
}
|