#6911 save on enter #207

Merged
jsegarra merged 50 commits from 6911-saveOnEnter into dev 2024-06-07 07:20:48 +00:00
2 changed files with 43 additions and 1 deletions
Showing only changes of commit 82e31d4dcf - Show all commits

View File

@ -29,7 +29,8 @@ module.exports = configure(function (/* ctx */) {
// app boot file (/src/boot) // app boot file (/src/boot)
// --> boot files are part of "main.js" // --> boot files are part of "main.js"
// https://v2.quasar.dev/quasar-cli/boot-files // https://v2.quasar.dev/quasar-cli/boot-files
boot: ['i18n', 'axios', 'vnDate', 'validations'], //
boot: ['i18n', 'axios', 'vnDate','quasar','setDefaults', 'validations'],
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#css // https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#css
css: ['app.scss'], css: ['app.scss'],

41
src/boot/setDefaults.js Normal file
View File

@ -0,0 +1,41 @@
import { QInput, QSelect } from "quasar";
import { QTable} from "quasar";
const setDefault = (component, key, value) => {
const prop = component.props[key];
switch (typeof prop) {
case "object":
prop.default = value;
break;
case "function":
component.props[key] = {
type: prop,
default: value
};
break;
case "undefined":
throw new Error("unknown prop: " + key);
default:
throw new Error("unhandled type: " + typeof prop);
}
};
QInput.props.outlined = {
type: QInput.props.outlined,
default: true
};
QInput.props.dense = {
type: QInput.props.dense,
default: true
};
QInput.props.stackLabel = {
type: QInput.props.stackLabel,
default: true
};
setDefault(QInput, "outlined", false);
setDefault(QTable, "gridHeader", true);
setDefault(QTable, "color", 'red-8');
setDefault(QTable, "pagination", { rowsPerPage: 25 });
setDefault(QTable, "rowKey", 'id');
setDefault(QSelect,'optionValue','id');
setDefault(QSelect,'optionLabel','name');