0
0
Fork 0

refactor: #6993 set default QTable pagination

This commit is contained in:
Jon Elias 2024-03-14 08:51:26 +01:00
parent 63f00c24d7
commit 37a2c33f9f
27 changed files with 2045 additions and 43 deletions

View File

@ -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', 'setDefaults'],
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#css
css: ['app.scss'],

2013
quasar.patch Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,4 @@
[ZoneTransfer]
ZoneId=3
ReferrerUrl=https://chat.verdnatura.es/direct/4MYAaHTayrgLirGvuFzY9RyDvyg99NzPu5
HostUrl=https://chat.verdnatura.es/file-upload/9whFtRhkNT95CdJud/quasar.patch?download

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

@ -0,0 +1,22 @@
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);
}
};
setDefault(QTable, 'pagination', { rowsPerPage: 25 });
setDefault(QTable, 'hidePagination', true);

View File

@ -202,7 +202,6 @@ const selectItem = ({ id }) => {
<QTable
:columns="tableColumns"
:rows="tableRows"
:pagination="{ rowsPerPage: 0 }"
:loading="loading"
:hide-header="!tableRows || !tableRows.length > 0"
:no-data-label="t('Enter a new search')"

View File

@ -200,7 +200,6 @@ const selectTravel = ({ id }) => {
<QTable
:columns="tableColumns"
:rows="tableRows"
:pagination="{ rowsPerPage: 0 }"
:loading="loading"
:hide-header="!tableRows || !tableRows.length > 0"
:no-data-label="t('Enter a new search')"

View File

@ -247,7 +247,6 @@ function openDialog(dmsId) {
flat
dense
:rows-per-page-options="[0]"
hide-bottom
>
<template #header="props">
<QTr :props="props">
@ -290,7 +289,6 @@ function openDialog(dmsId) {
flat
dense
:rows-per-page-options="[0]"
hide-bottom
>
<template #header="props">
<QTr :props="props">

View File

@ -224,10 +224,8 @@ const refreshData = () => {
<QPage class="column items-center q-pa-md">
<QTable
:columns="columns"
:pagination="{ rowsPerPage: 0 }"
:rows="rows"
class="full-width q-mt-md"
hide-bottom
row-key="clientFk"
selection="multiple"
v-model:selected="selected"

View File

@ -108,10 +108,8 @@ const selectCustomerId = (id) => {
<QPage class="column items-center q-pa-md">
<QTable
:columns="columns"
:pagination="{ rowsPerPage: 0 }"
:rows="rows"
class="full-width q-mt-md"
hide-bottom
row-key="id"
selection="multiple"
v-model:selected="selected"

View File

@ -151,10 +151,8 @@ function stateColor(row) {
:columns="columns"
:rows="rows"
row-key="id"
:pagination="{ rowsPerPage: 0 }"
:grid="grid || $q.screen.lt.sm"
class="q-mt-xs custom-table"
hide-pagination
>
<template #body-cell-actions="{ row }">
<QTd auto-width class="text-center">

View File

@ -320,7 +320,6 @@ const showLockIcon = (groupingMode, mode) => {
:columns="entriesTableColumns"
selection="multiple"
row-key="id"
hide-bottom
class="full-width q-mt-md"
:grid="$q.screen.lt.md"
v-model:selected="rowsSelected"

View File

@ -238,12 +238,7 @@ const redirectToBuysView = () => {
</div>
</VnRow>
<VnRow>
<QTable
:columns="columns"
:rows="importData.buys"
:pagination="{ rowsPerPage: 0 }"
hide-pagination
>
<QTable :columns="columns" :rows="importData.buys">
<template #body-cell-item="{ row, col }">
<QTd auto-width>
<VnSelectDialog

View File

@ -277,7 +277,6 @@ const fetchEntryBuys = async () => {
<QTable
:rows="entryBuys"
:columns="entriesTableColumns"
hide-bottom
row-key="index"
class="full-width q-mt-md"
>

View File

@ -659,7 +659,6 @@ onUnmounted(() => (stateStore.rightDrawer = false));
:columns="columns"
selection="multiple"
row-key="id"
:pagination="{ rowsPerPage: 0 }"
class="full-width q-mt-md"
:visible-columns="visibleColumns"
v-model:selected="rowsSelected"

View File

@ -111,7 +111,6 @@ const onSave = (data) => data.deletes && router.push(`/invoice-in/${invoiceId}/s
:rows="rows"
row-key="$index"
selection="single"
hide-pagination
:grid="$q.screen.lt.sm"
:pagination="{ rowsPerPage: 0 }"
>

View File

@ -99,7 +99,6 @@ async function insert() {
:columns="columns"
:rows="rows"
row-key="$index"
hide-pagination
:grid="$q.screen.lt.sm"
>
<template #body-cell-duedate="{ row }">

View File

@ -134,7 +134,6 @@ function getTotal(type) {
:columns="columns"
:rows="rows"
row-key="$index"
hide-pagination
:grid="$q.screen.lt.sm"
>
<template #body-cell="{ row, col }">

View File

@ -327,7 +327,7 @@ function getLink(param) {
:columns="vatColumns"
:rows="invoiceIn.invoiceInTax"
flat
hide-pagination
>
<template #header="props">
<QTr :props="props" class="bg">
@ -361,7 +361,7 @@ function getLink(param) {
:columns="dueDayColumns"
:rows="invoiceIn.invoiceInDueDay"
flat
hide-pagination
>
<template #header="props">
<QTr :props="props" class="bg">
@ -390,7 +390,6 @@ function getLink(param) {
:columns="intrastatColumns"
:rows="invoiceIn.invoiceInIntrastat"
flat
hide-pagination
>
<template #header="props">
<QTr :props="props" class="bg">

View File

@ -184,10 +184,8 @@ async function addExpense() {
selection="multiple"
:columns="columns"
:rows="rows"
row-key="$index"
hide-pagination
row-key="$index"
:grid="$q.screen.lt.sm"
:pagination="{ rowsPerPage: 0 }"
>
<template #body-cell-expense="{ row, col }">
<QTd auto-width>

View File

@ -124,9 +124,7 @@ onUnmounted(() => {
v-if="rows.length > 0"
:rows="rows"
:columns="columns"
hide-bottom
row-key="id"
:pagination="{ rowsPerPage: 0 }"
class="full-width q-mt-md"
>
<template #body-cell="props">

View File

@ -231,7 +231,6 @@ const selectWorkerId = (id) => {
<QTable
:columns="columns"
:rows="rows"
hide-bottom
row-key="clientId"
:pagination="{ rowsPerPage: 0 }"
class="full-width q-mt-md"

View File

@ -162,7 +162,6 @@ const detailsColumns = ref([
:columns="detailsColumns"
:rows="entity?.rows"
flat
hide-pagination
>
<template #header="props">
<QTr :props="props">

View File

@ -213,10 +213,8 @@ const openBuscaman = async (route, ticket) => {
<QTable
:columns="ticketColumns"
:rows="entity?.tickets"
:rows-per-page-options="[0]"
row-key="id"
flat
hide-pagination
>
<template #body-cell-city="{ value, row }">
<QTd auto-width>

View File

@ -105,8 +105,6 @@ function downloadPdfs() {
:columns="columns"
:rows="rows"
:dense="$q.screen.lt.md"
:pagination="{ rowsPerPage: null }"
hide-pagination
row-key="cmrFk"
selection="multiple"
v-model:selected="selected"

View File

@ -275,8 +275,6 @@ const markAsServed = () => {
flat
row-key="id"
selection="multiple"
:rows-per-page-options="[0]"
hide-pagination
:pagination="{ sortBy: 'ID', descending: true }"
>
<template #body-cell-worker="props">

View File

@ -300,7 +300,7 @@ async function setTravelData(travelData) {
<QTable
:rows="entriesTableRows"
:columns="entriesTableColumns"
hide-bottom
row-key="id"
class="full-width q-mt-md"
>
@ -365,7 +365,6 @@ async function setTravelData(travelData) {
<QTable
:rows="thermographs"
:columns="thermographsTableColumns"
hide-bottom
row-key="id"
class="full-width q-mt-md"
/>

View File

@ -453,9 +453,7 @@ const handleDragScroll = (event) => {
<QTable
:rows="rows"
:columns="columns"
hide-bottom
row-key="clientId"
:pagination="{ rowsPerPage: 0 }"
class="full-width"
table-style="user-select: none;"
@drag="handleDragScroll($event)"