Tariff UI: add multiline formula support (#28219)

This commit is contained in:
Michael Geers 2026-03-15 10:54:48 +01:00 • committed by GitHub
parent f528dca381
commit e808bec8f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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";
},