currency field ui impr

This commit is contained in:
Yuri Kuznetsov
2022-11-21 12:47:14 +02:00
parent 4762237796
commit 73af7d4119
4 changed files with 26 additions and 4 deletions
@@ -10,10 +10,14 @@
{{#if params.maxLength}} maxlength="{{params.maxLength}}"{{/if}}
>
</span>
{{#if multipleCurrencies}}
<span class="input-group-item">
<select
data-name="{{currencyFieldName}}"
class="form-control radius-right"
>{{{options currencyList currencyValue}}}</select>
</span>
{{else}}
<span class="input-group-addon radius-right">{{defaultCurrency}}</span>
{{/if}}
</div>
+7 -1
View File
@@ -60,12 +60,16 @@ function (Dep, /** module:ui/select*/Select) {
this.getPreferences().get('defaultCurrency') ||
this.getConfig().get('defaultCurrency');
let multipleCurrencies = !this.isSingleCurrency || currencyValue !== this.defaultCurrency;
return _.extend({
currencyFieldName: this.currencyFieldName,
currencyValue: currencyValue,
currencyOptions: this.currencyOptions,
currencyList: this.currencyList,
currencySymbol: this.getMetadata().get(['app', 'currency', 'symbolMap', currencyValue]) || '',
multipleCurrencies: multipleCurrencies,
defaultCurrency: this.defaultCurrency,
}, Dep.prototype.data.call(this));
},
@@ -223,7 +227,9 @@ function (Dep, /** module:ui/select*/Select) {
let data = {};
let currencyValue = this.$currency.val();
let currencyValue = this.$currency.length ?
this.$currency.val() :
this.defaultCurrency;
if (value === null) {
currencyValue = null;
+10 -1
View File
@@ -3663,12 +3663,21 @@ a.close:hover {
> .input-group-item:first-child {
flex-grow: 1;
display: block;
}
> .input-group-item:last-child {
flex-grow: 1;
display: block;
min-width: 70px;
max-width: 22%;
max-width: 80px;
}
> .input-group-addon:last-child {
flex-grow: 1;
display: block;
min-width: fit-content;
max-width: fit-content;
}
}
+5 -2
View File
@@ -401,11 +401,14 @@ input[type="radio"].form-radio {
}
.input-group-addon {
.radius-left {
padding: 6px 10px;
line-height: 1.5;
&.radius-left {
border-top-left-radius: var(--border-radius);
border-bottom-left-radius: var(--border-radius);
}
.radius-right {
&.radius-right {
border-top-right-radius: var(--border-radius);
border-bottom-right-radius: var(--border-radius);
}