add builder currencies prop
This commit is contained in:
@@ -89,6 +89,7 @@ window.customElements.define('template-builder', class extends HTMLElement {
|
|||||||
withPhone: this.dataset.withPhone === 'true',
|
withPhone: this.dataset.withPhone === 'true',
|
||||||
withLogo: this.dataset.withLogo !== 'false',
|
withLogo: this.dataset.withLogo !== 'false',
|
||||||
withPayment: this.dataset.withPayment === 'true',
|
withPayment: this.dataset.withPayment === 'true',
|
||||||
|
currencies: (this.dataset.currencies || '').split(',').filter(Boolean),
|
||||||
acceptFileTypes: this.dataset.acceptFileTypes,
|
acceptFileTypes: this.dataset.acceptFileTypes,
|
||||||
isDirectUpload: this.dataset.isDirectUpload === 'true'
|
isDirectUpload: this.dataset.isDirectUpload === 'true'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -304,6 +304,7 @@ export default {
|
|||||||
template: this.template,
|
template: this.template,
|
||||||
save: this.save,
|
save: this.save,
|
||||||
t: this.t,
|
t: this.t,
|
||||||
|
currencies: this.currencies,
|
||||||
baseFetch: this.baseFetch,
|
baseFetch: this.baseFetch,
|
||||||
fieldTypes: this.fieldTypes,
|
fieldTypes: this.fieldTypes,
|
||||||
backgroundColor: this.backgroundColor,
|
backgroundColor: this.backgroundColor,
|
||||||
@@ -352,6 +353,11 @@ export default {
|
|||||||
required: false,
|
required: false,
|
||||||
default: () => []
|
default: () => []
|
||||||
},
|
},
|
||||||
|
currencies: {
|
||||||
|
type: Array,
|
||||||
|
required: false,
|
||||||
|
default: () => []
|
||||||
|
},
|
||||||
fieldTypes: {
|
fieldTypes: {
|
||||||
type: Array,
|
type: Array,
|
||||||
required: false,
|
required: false,
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
@change="save"
|
@change="save"
|
||||||
>
|
>
|
||||||
<option
|
<option
|
||||||
v-for="currency in currencies"
|
v-for="currency in currenciesList"
|
||||||
:key="currency"
|
:key="currency"
|
||||||
:value="currency"
|
:value="currency"
|
||||||
>
|
>
|
||||||
@@ -167,7 +167,7 @@ export default {
|
|||||||
IconInnerShadowTop,
|
IconInnerShadowTop,
|
||||||
IconBrandStripe
|
IconBrandStripe
|
||||||
},
|
},
|
||||||
inject: ['backgroundColor', 'save'],
|
inject: ['backgroundColor', 'save', 'currencies'],
|
||||||
props: {
|
props: {
|
||||||
field: {
|
field: {
|
||||||
type: Object,
|
type: Object,
|
||||||
@@ -187,9 +187,12 @@ export default {
|
|||||||
redirectUri () {
|
redirectUri () {
|
||||||
return document.location.origin + '/auth/stripe_connect/callback'
|
return document.location.origin + '/auth/stripe_connect/callback'
|
||||||
},
|
},
|
||||||
currencies () {
|
defaultCurrencies () {
|
||||||
return ['USD', 'EUR', 'GBP']
|
return ['USD', 'EUR', 'GBP']
|
||||||
},
|
},
|
||||||
|
currenciesList () {
|
||||||
|
return this.currencies.length ? this.currencies : this.defaultCurrencies
|
||||||
|
},
|
||||||
authenticityToken () {
|
authenticityToken () {
|
||||||
return document.querySelector('meta[name="csrf-token"]')?.content
|
return document.querySelector('meta[name="csrf-token"]')?.content
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user