@ecomplus/storefront-components 1.0.0-beta.174 → 1.0.0-beta.176

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecomplus/storefront-components",
3
- "version": "1.0.0-beta.174",
3
+ "version": "1.0.0-beta.176",
4
4
  "description": "Vue components for E-Com Plus Storefront",
5
5
  "main": "dist/storefront-components.min.js",
6
6
  "scripts": {
@@ -19,6 +19,7 @@ import ShippingLine from '../ShippingLine.vue'
19
19
 
20
20
  const localStorage = typeof window === 'object' && window.localStorage
21
21
  const zipStorageKey = 'shipping-to-zip'
22
+ const globalOpts = (typeof window === 'object' && window.propsShippingCalculator) || {}
22
23
 
23
24
  const reduceItemBody = itemOrProduct => {
24
25
  const shippedItem = {}
@@ -54,9 +55,17 @@ export default {
54
55
  props: {
55
56
  zipCode: String,
56
57
  canSelectServices: Boolean,
58
+ canAutoSelectService: {
59
+ type: Boolean,
60
+ default: typeof globalOpts.canAutoSelectService === 'boolean'
61
+ ? globalOpts.canAutoSelectService
62
+ : true
63
+ },
57
64
  canInputZip: {
58
65
  type: Boolean,
59
- default: true
66
+ default: typeof globalOpts.canInputZip === 'boolean'
67
+ ? globalOpts.canInputZip
68
+ : true
60
69
  },
61
70
  countryCode: {
62
71
  type: String,
@@ -193,7 +202,9 @@ export default {
193
202
  ? -1
194
203
  : 1
195
204
  })
196
- this.setSelectedService(0)
205
+ if (this.canAutoSelectService) {
206
+ this.setSelectedService(0)
207
+ }
197
208
  this.hasPaidOption = Boolean(this.shippingServices.find(service => {
198
209
  return service.shipping_line.total_price || service.shipping_line.price
199
210
  }))
@@ -14,6 +14,8 @@ import {
14
14
  formatMoney
15
15
  } from '@ecomplus/utils'
16
16
 
17
+ const globalOpts = (typeof window === 'object' && window.propsShippingLine) || {}
18
+
17
19
  export default {
18
20
  name: 'ShippingLine',
19
21
 
@@ -25,6 +27,10 @@ export default {
25
27
  productionDeadline: {
26
28
  type: Number,
27
29
  default: 0
30
+ },
31
+ getDeadlineStr: {
32
+ type: Function,
33
+ default: globalOpts.getDeadlineStr
28
34
  }
29
35
  },
30
36
 
@@ -38,6 +44,14 @@ export default {
38
44
  days += shipping.delivery_time.days
39
45
  }
40
46
  days += this.productionDeadline
47
+ if (this.getDeadlineStr) {
48
+ const str = this.getDeadlineStr({
49
+ days,
50
+ isWorkingDays,
51
+ shippingLine: this.shippingLine
52
+ })
53
+ if (str) return str
54
+ }
41
55
  if (days > 1) {
42
56
  return `${i18n(i19upTo)} ${days} ` +
43
57
  i18n(isWorkingDays ? i19workingDays : i19days).toLowerCase()
@@ -40,6 +40,12 @@ export default {
40
40
  return ['orders', 'favorites', 'subscriptions', 'points', 'account'].includes(value)
41
41
  }
42
42
  },
43
+ isExternalAuth: {
44
+ type: Boolean,
45
+ default () {
46
+ return Boolean(window.$firebaseConfig && window.$firebaseConfig.authDomain)
47
+ }
48
+ },
43
49
  ecomPassport: {
44
50
  type: Object,
45
51
  default () {
@@ -143,6 +149,10 @@ export default {
143
149
  },
144
150
 
145
151
  created () {
152
+ if (this.isExternalAuth && !this.ecomPassport.checkAuthorization()) {
153
+ window.location.href = '/app/account'
154
+ return
155
+ }
146
156
  this.navTabs = [
147
157
  {
148
158
  label: this.i19registration,
@@ -18,3 +18,7 @@
18
18
  color: var(--text-muted);
19
19
  }
20
20
  }
21
+
22
+ .active .shipping-line > small {
23
+ color: inherit;
24
+ }