fix: refs #8372 remove trailing commas in various files
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Jorge Penadés 2025-02-05 12:55:26 +01:00
parent 5078559668
commit e597552dc3
3 changed files with 10 additions and 13 deletions

View File

@ -9,19 +9,19 @@ export default {
if (!form) return; if (!form) return;
try { try {
const inputsFormCard = form.querySelectorAll( const inputsFormCard = form.querySelectorAll(
`input:not([disabled]):not([type="checkbox"])` `input:not([disabled]):not([type="checkbox"])`,
); );
if (inputsFormCard.length) { if (inputsFormCard.length) {
focusFirstInput(inputsFormCard[0]); focusFirstInput(inputsFormCard[0]);
} }
const textareas = document.querySelectorAll( const textareas = document.querySelectorAll(
'textarea:not([disabled]), [contenteditable]:not([disabled])' 'textarea:not([disabled]), [contenteditable]:not([disabled])',
); );
if (textareas.length) { if (textareas.length) {
focusFirstInput(textareas[textareas.length - 1]); focusFirstInput(textareas[textareas.length - 1]);
} }
const inputs = document.querySelectorAll( const inputs = document.querySelectorAll(
'form#formModel input:not([disabled]):not([type="checkbox"])' 'form#formModel input:not([disabled]):not([type="checkbox"])',
); );
const input = inputs[0]; const input = inputs[0];
if (!input) return; if (!input) return;
@ -31,7 +31,7 @@ export default {
console.error(error); console.error(error);
} }
form.addEventListener('keyup', function (evt) { form.addEventListener('keyup', function (evt) {
if (evt.key === 'Enter' && !that.$attrs['prevent-submit']) { if (evt.key === 'Enter') {
const input = evt.target; const input = evt.target;
if (input.type == 'textarea' && evt.shiftKey) { if (input.type == 'textarea' && evt.shiftKey) {
evt.preventDefault(); evt.preventDefault();
@ -44,7 +44,6 @@ export default {
return; return;
} }
evt.preventDefault(); evt.preventDefault();
that.onSubmit();
} }
}); });
}, },

View File

@ -97,7 +97,7 @@ const $props = defineProps({
}); });
const emit = defineEmits(['onFetch', 'onDataSaved']); const emit = defineEmits(['onFetch', 'onDataSaved']);
const modelValue = computed( const modelValue = computed(
() => $props.model ?? `formModel_${route?.meta?.title ?? route.name}` () => $props.model ?? `formModel_${route?.meta?.title ?? route.name}`,
).value; ).value;
const componentIsRendered = ref(false); const componentIsRendered = ref(false);
const arrayData = useArrayData(modelValue); const arrayData = useArrayData(modelValue);
@ -148,7 +148,7 @@ onMounted(async () => {
JSON.stringify(newVal) !== JSON.stringify(originalData.value); JSON.stringify(newVal) !== JSON.stringify(originalData.value);
isResetting.value = false; isResetting.value = false;
}, },
{ deep: true } { deep: true },
); );
} }
}); });
@ -156,7 +156,7 @@ onMounted(async () => {
if (!$props.url) if (!$props.url)
watch( watch(
() => arrayData.store.data, () => arrayData.store.data,
(val) => updateAndEmit('onFetch', val) (val) => updateAndEmit('onFetch', val),
); );
watch( watch(
@ -165,7 +165,7 @@ watch(
originalData.value = null; originalData.value = null;
reset(); reset();
await fetch(); await fetch();
} },
); );
onBeforeRouteLeave((to, from, next) => { onBeforeRouteLeave((to, from, next) => {
@ -254,7 +254,7 @@ function filter(value, update, filterOptions) {
(ref) => { (ref) => {
ref.setOptionIndex(-1); ref.setOptionIndex(-1);
ref.moveOptionSelection(1, true); ref.moveOptionSelection(1, true);
} },
); );
} }
@ -293,7 +293,6 @@ defineExpose({
class="q-pa-md" class="q-pa-md"
:style="maxWidth ? 'max-width: ' + maxWidth : ''" :style="maxWidth ? 'max-width: ' + maxWidth : ''"
id="formModel" id="formModel"
:prevent-submit="$attrs['prevent-submit']"
> >
<QCard> <QCard>
<slot <slot

View File

@ -84,7 +84,7 @@ function setPaymentType(accounting) {
viewReceipt.value = isCash.value; viewReceipt.value = isCash.value;
if (accountingType.value.daysInFuture) if (accountingType.value.daysInFuture)
initialData.payed.setDate( initialData.payed.setDate(
initialData.payed.getDate() + accountingType.value.daysInFuture initialData.payed.getDate() + accountingType.value.daysInFuture,
); );
maxAmount.value = accountingType.value && accountingType.value.maxAmount; maxAmount.value = accountingType.value && accountingType.value.maxAmount;
@ -189,7 +189,6 @@ async function getAmountPaid() {
:url-create="urlCreate" :url-create="urlCreate"
:mapper="onBeforeSave" :mapper="onBeforeSave"
@on-data-saved="onDataSaved" @on-data-saved="onDataSaved"
:prevent-submit="true"
> >
<template #form="{ data, validate }"> <template #form="{ data, validate }">
<span ref="closeButton" class="row justify-end close-icon" v-close-popup> <span ref="closeButton" class="row justify-end close-icon" v-close-popup>