Merge remote-tracking branch 'remotes/upstream/master'

This commit is contained in:
Toni Barth 2025-02-12 13:29:36 +01:00
commit 8ca7d3a987
48 changed files with 909 additions and 138 deletions

View file

@ -215,6 +215,10 @@ export default {
inputBlur() {
if (!this.isFocused) return
if (typeof this.textInput === 'string') {
this.textInput = this.textInput.trim()
}
setTimeout(() => {
if (document.activeElement === this.$refs.input) {
return
@ -231,6 +235,11 @@ export default {
},
forceBlur() {
this.isFocused = false
if (typeof this.textInput === 'string') {
this.textInput = this.textInput.trim()
}
if (this.textInput) this.submitForm()
if (this.$refs.input) this.$refs.input.blur()
},
@ -289,11 +298,12 @@ export default {
this.selectedMenuItemIndex = null
},
submitForm() {
if (!this.textInput) return
if (!this.textInput || !this.textInput.trim?.()) return
this.textInput = this.textInput.trim()
const cleaned = this.textInput.trim()
const matchesItem = this.items.find((i) => {
return i.name === cleaned
return i.name === this.textInput
})
if (matchesItem) {

View file

@ -40,7 +40,8 @@ export default {
showCopy: Boolean,
step: [String, Number],
min: [String, Number],
customInputClass: String
customInputClass: String,
trimWhitespace: Boolean
},
data() {
return {
@ -101,9 +102,13 @@ export default {
this.$emit('focus')
},
blurred() {
if (this.trimWhitespace && typeof this.inputValue === 'string') {
this.inputValue = this.inputValue.trim()
}
this.isFocused = false
this.$emit('blur')
},
change(e) {
this.$emit('change', e.target.value)
},

View file

@ -6,7 +6,7 @@
<em v-if="note" class="font-normal text-xs pl-2">{{ note }}</em>
</label>
</slot>
<ui-text-input :placeholder="placeholder || label" :inputId="identifier" ref="input" v-model="inputValue" :disabled="disabled" :readonly="readonly" :type="type" :show-copy="showCopy" class="w-full" :class="inputClass" @blur="inputBlurred" />
<ui-text-input :placeholder="placeholder || label" :inputId="identifier" ref="input" v-model="inputValue" :disabled="disabled" :readonly="readonly" :type="type" :show-copy="showCopy" class="w-full" :class="inputClass" :trim-whitespace="trimWhitespace" @blur="inputBlurred" />
</div>
</template>
@ -24,7 +24,8 @@ export default {
readonly: Boolean,
disabled: Boolean,
inputClass: String,
showCopy: Boolean
showCopy: Boolean,
trimWhitespace: Boolean
},
data() {
return {}

View file

@ -351,8 +351,10 @@ export default {
background-color: white;
}
trix-editor {
max-height: calc(4 * 1lh);
height: calc(4 * 1lh);
min-height: calc(4 * 1lh);
overflow-y: auto;
resize: vertical;
}
trix-editor * {