diff --git a/CHANGELOG.md b/CHANGELOG.md index dbf6bdcc3..51dd2010c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- (Tickets) => Se añade la opción de clonar ticket. #6951 + ### Changed ### Fixed diff --git a/quasar.config.js b/quasar.config.js index 2d8289508..80ddc3759 100644 --- a/quasar.config.js +++ b/quasar.config.js @@ -29,7 +29,7 @@ module.exports = configure(function (/* ctx */) { // app boot file (/src/boot) // --> boot files are part of "main.js" // https://v2.quasar.dev/quasar-cli/boot-files - boot: ['i18n', 'axios', 'vnDate', 'validations'], + boot: ['i18n', 'axios', 'vnDate', 'validations', 'quasar'], // https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#css css: ['app.scss'], diff --git a/src/boot/qformMixin.js b/src/boot/qformMixin.js new file mode 100644 index 000000000..8c89c9202 --- /dev/null +++ b/src/boot/qformMixin.js @@ -0,0 +1,21 @@ +import { getCurrentInstance } from 'vue'; + +const filterAvailableInput = element => element.classList.contains('q-field__native') && !element.disabled +const filterAvailableText = element => element.__vueParentComponent.type.name === 'QInput' && element.__vueParentComponent?.attrs?.class !== 'vn-input-date'; + + +export default { + mounted: function () { + const vm = getCurrentInstance(); + if (vm.type.name === 'QForm') + if (!['searchbarForm','filterPanelForm'].includes(this.$el?.id)) { + // AUTOFOCUS + const elementsArray = Array.from(this.$el.elements); + const firstInputElement = elementsArray.filter(filterAvailableInput).find(filterAvailableText); + + if (firstInputElement) { + firstInputElement.focus(); + } + } + }, +}; diff --git a/src/boot/quasar.js b/src/boot/quasar.js new file mode 100644 index 000000000..a8d9b7ad9 --- /dev/null +++ b/src/boot/quasar.js @@ -0,0 +1,6 @@ +import { boot } from 'quasar/wrappers'; +import qFormMixin from './qformMixin'; + +export default boot(({ app }) => { + app.mixin(qFormMixin); +}); diff --git a/src/components/ui/VnFilterPanel.vue b/src/components/ui/VnFilterPanel.vue index 722462d4a..96d097191 100644 --- a/src/components/ui/VnFilterPanel.vue +++ b/src/components/ui/VnFilterPanel.vue @@ -164,7 +164,7 @@ function formatValue(value) {