|
|
|
@ -9,8 +9,7 @@ interface Option {
|
|
|
|
|
|
|
|
|
|
const { formState, validateInfos, setAdditionalValidations, sqlUi, onDataTypeChange, onAlter } = useColumnCreateStoreOrThrow() |
|
|
|
|
|
|
|
|
|
const validators = computed(() => { |
|
|
|
|
return { |
|
|
|
|
const validators = { |
|
|
|
|
'meta.currency_locale': [ |
|
|
|
|
{ |
|
|
|
|
validator: (_: any, locale: any) => { |
|
|
|
@ -35,19 +34,18 @@ const validators = computed(() => {
|
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// set additional validations |
|
|
|
|
setAdditionalValidations({ |
|
|
|
|
...validators.value, |
|
|
|
|
...validators, |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
const { isPg } = useProject() |
|
|
|
|
|
|
|
|
|
const currencyList = ref(currencyCodes) |
|
|
|
|
const currencyList = currencyCodes || [] |
|
|
|
|
|
|
|
|
|
const currencyLocaleList = ref(currencyLocales()) |
|
|
|
|
const currencyLocaleList = currencyLocales() || [] |
|
|
|
|
|
|
|
|
|
const isMoney = computed(() => formState.value.dt === 'money') |
|
|
|
|
|
|
|
|
@ -73,7 +71,7 @@ function filterOption(input: string, option: Option) {
|
|
|
|
|
:filter-option="filterOption" |
|
|
|
|
:disabled="isMoney && isPg" |
|
|
|
|
> |
|
|
|
|
<a-select-option v-for="(currencyLocale, i) in currencyLocaleList ?? []" :key="i" :value="currencyLocale.value"> |
|
|
|
|
<a-select-option v-for="(currencyLocale, i) of currencyLocaleList" :key="i" :value="currencyLocale.value"> |
|
|
|
|
{{ currencyLocale.text }} |
|
|
|
|
</a-select-option> |
|
|
|
|
</a-select> |
|
|
|
@ -89,7 +87,7 @@ function filterOption(input: string, option: Option) {
|
|
|
|
|
size="small" |
|
|
|
|
:disabled="isMoney && isPg" |
|
|
|
|
> |
|
|
|
|
<a-select-option v-for="(currencyCode, i) in currencyList ?? []" :key="i" :value="currencyCode"> |
|
|
|
|
<a-select-option v-for="(currencyCode, i) of currencyList" :key="i" :value="currencyCode"> |
|
|
|
|
{{ currencyCode }} |
|
|
|
|
</a-select-option> |
|
|
|
|
</a-select> |
|
|
|
|