Tariff UI: add multiline formula support (#28219)
This commit is contained in:
parent
f528dca381
commit
e808bec8f9
1 changed files with 11 additions and 2 deletions
|
|
@ -75,7 +75,7 @@
|
|||
:type="inputType"
|
||||
:placeholder="placeholder"
|
||||
:required="required"
|
||||
:rows="rows || 4"
|
||||
:rows="textareaRows"
|
||||
:disabled="disabled"
|
||||
/>
|
||||
<PropertyZonesField v-else-if="zones" :id="id" v-model="value" :currency="currency" />
|
||||
|
|
@ -254,9 +254,18 @@ export default {
|
|||
return (
|
||||
this.rows ||
|
||||
this.array ||
|
||||
["accessToken", "refreshToken", "identifiers"].includes(this.property)
|
||||
["accessToken", "refreshToken", "identifiers", "formula"].includes(this.property)
|
||||
);
|
||||
},
|
||||
textareaRows() {
|
||||
if (this.rows) return this.rows;
|
||||
const autoGrow = this.property === "formula";
|
||||
if (autoGrow) {
|
||||
const lines = (this.value ?? "").split("\n").length;
|
||||
return Math.max(1, lines);
|
||||
}
|
||||
return 4;
|
||||
},
|
||||
boolean() {
|
||||
return this.type === "Bool";
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue