forked from verdnatura/salix-front
Merge pull request 'refactor: #6993 set default QTable pagination' (!239) from 6993-HideAllPagination into dev
Reviewed-on: verdnatura/salix-front#239 Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
commit
7cfffbd2de
|
@ -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', 'quasar'],
|
||||
boot: ['i18n', 'axios', 'vnDate', 'validations', 'quasar.defaults'],
|
||||
|
||||
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#css
|
||||
css: ['app.scss'],
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
import { QTable } from 'quasar';
|
||||
import setDefault from './setDefault';
|
||||
|
||||
setDefault(QTable, 'pagination', { rowsPerPage: 0 });
|
||||
setDefault(QTable, 'hidePagination', true);
|
|
@ -0,0 +1,18 @@
|
|||
export default function (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);
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
export * from './defaults/qTable';
|
|
@ -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')"
|
||||
|
|
|
@ -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')"
|
||||
|
|
|
@ -218,7 +218,6 @@ function parseDms(data) {
|
|||
/>
|
||||
<QTable
|
||||
:columns="columns"
|
||||
:pagination="{ rowsPerPage: 0 }"
|
||||
:rows="rows"
|
||||
class="full-width q-mt-md"
|
||||
hide-bottom
|
||||
|
|
|
@ -291,8 +291,6 @@ async function importToNewRefundTicket() {
|
|||
selection="multiple"
|
||||
v-model:selected="selectedRows"
|
||||
:grid="$q.screen.lt.md"
|
||||
:pagination="{ rowsPerPage: 0 }"
|
||||
:hide-bottom="true"
|
||||
>
|
||||
<template #body-cell-ticket="{ value }">
|
||||
<QTd align="center">
|
||||
|
|
|
@ -150,10 +150,8 @@ const columns = computed(() => [
|
|||
<QTable
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
:pagination="{ rowsPerPage: 0 }"
|
||||
row-key="$index"
|
||||
selection="multiple"
|
||||
hide-pagination
|
||||
v-model:selected="selected"
|
||||
:grid="$q.screen.lt.md"
|
||||
table-header-class="text-left"
|
||||
|
|
|
@ -201,11 +201,9 @@ function showImportDialog() {
|
|||
:columns="columns"
|
||||
:rows="rows"
|
||||
:dense="$q.screen.lt.md"
|
||||
:pagination="{ rowsPerPage: 0 }"
|
||||
row-key="id"
|
||||
selection="multiple"
|
||||
v-model:selected="selected"
|
||||
hide-pagination
|
||||
:grid="$q.screen.lt.md"
|
||||
>
|
||||
<template #body-cell-claimed="{ row, value }">
|
||||
|
|
|
@ -121,7 +121,6 @@ function cancel() {
|
|||
class="my-sticky-header-table"
|
||||
:columns="columns"
|
||||
:rows="claimableSales"
|
||||
:pagination="{ rowsPerPage: 10 }"
|
||||
row-key="saleFk"
|
||||
selection="multiple"
|
||||
v-model:selected="selected"
|
||||
|
|
|
@ -198,7 +198,6 @@ const updateCompanyId = (id) => {
|
|||
|
||||
<QTable
|
||||
:columns="columns"
|
||||
:pagination="{ rowsPerPage: 12 }"
|
||||
:rows="rows"
|
||||
class="full-width q-mt-md"
|
||||
row-key="id"
|
||||
|
|
|
@ -97,13 +97,7 @@ const toCustomerCreditCreate = () => {
|
|||
|
||||
<template>
|
||||
<QPage class="column items-center q-pa-md">
|
||||
<QTable
|
||||
:columns="columns"
|
||||
:pagination="{ rowsPerPage: 12 }"
|
||||
:rows="rows"
|
||||
class="full-width q-mt-md"
|
||||
row-key="id"
|
||||
>
|
||||
<QTable :columns="columns" :rows="rows" class="full-width q-mt-md" row-key="id">
|
||||
<template #body-cell="props">
|
||||
<QTd :props="props">
|
||||
<QTr :props="props" class="cursor-pointer">
|
||||
|
|
|
@ -140,7 +140,6 @@ const toCustomerGreugeCreate = () => {
|
|||
|
||||
<QTable
|
||||
:columns="columns"
|
||||
:pagination="{ rowsPerPage: 12 }"
|
||||
:rows="rows"
|
||||
class="full-width q-mt-md"
|
||||
row-key="id"
|
||||
|
|
|
@ -97,7 +97,6 @@ const toCustomerRecoverieCreate = () => {
|
|||
<QPage class="column items-center q-pa-md">
|
||||
<QTable
|
||||
:columns="columns"
|
||||
:pagination="{ rowsPerPage: 12 }"
|
||||
:rows="rows"
|
||||
class="full-width q-mt-md"
|
||||
row-key="id"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -510,7 +510,6 @@ const selectSalesPersonId = (id) => (selectedSalesPersonId.value = id);
|
|||
<QPage class="column items-center q-pa-md">
|
||||
<QTable
|
||||
:columns="columns"
|
||||
:pagination="{ rowsPerPage: 12 }"
|
||||
:rows="rows"
|
||||
class="full-width q-mt-md"
|
||||
row-key="id"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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 }"
|
||||
>
|
||||
|
|
|
@ -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 }">
|
||||
|
|
|
@ -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 }">
|
||||
|
|
|
@ -356,7 +356,6 @@ function getLink(param) {
|
|||
:columns="dueDayColumns"
|
||||
:rows="invoiceIn.invoiceInDueDay"
|
||||
flat
|
||||
hide-pagination
|
||||
>
|
||||
<template #header="props">
|
||||
<QTr :props="props" class="bg">
|
||||
|
@ -385,7 +384,6 @@ function getLink(param) {
|
|||
:columns="intrastatColumns"
|
||||
:rows="invoiceIn.invoiceInIntrastat"
|
||||
flat
|
||||
hide-pagination
|
||||
>
|
||||
<template #header="props">
|
||||
<QTr :props="props" class="bg">
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -133,9 +133,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">
|
||||
|
|
|
@ -166,9 +166,7 @@ const downloadCSV = async () => {
|
|||
<QTable
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
hide-bottom
|
||||
row-key="clientId"
|
||||
:pagination="{ rowsPerPage: 0 }"
|
||||
class="full-width q-mt-md"
|
||||
>
|
||||
<template #body-cell-clientId="{ row }">
|
||||
|
|
|
@ -162,7 +162,6 @@ const detailsColumns = ref([
|
|||
:columns="detailsColumns"
|
||||
:rows="entity?.rows"
|
||||
flat
|
||||
hide-pagination
|
||||
>
|
||||
<template #header="props">
|
||||
<QTr :props="props">
|
||||
|
|
|
@ -205,10 +205,8 @@ const ticketColumns = ref([
|
|||
<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>
|
||||
|
|
|
@ -123,8 +123,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"
|
||||
|
|
|
@ -151,7 +151,6 @@ onMounted(async () => {
|
|||
:rows="rows"
|
||||
row-key="id"
|
||||
hide-header
|
||||
:pagination="{ rowsPerPage: 0 }"
|
||||
class="full-width q-mt-md"
|
||||
:no-data-label="t('No results')"
|
||||
>
|
||||
|
|
|
@ -289,7 +289,6 @@ async function setTravelData(travelData) {
|
|||
<QTable
|
||||
:rows="entriesTableRows"
|
||||
:columns="entriesTableColumns"
|
||||
hide-bottom
|
||||
row-key="id"
|
||||
class="full-width q-mt-md"
|
||||
>
|
||||
|
@ -354,7 +353,6 @@ async function setTravelData(travelData) {
|
|||
<QTable
|
||||
:rows="thermographs"
|
||||
:columns="thermographsTableColumns"
|
||||
hide-bottom
|
||||
row-key="id"
|
||||
class="full-width q-mt-md"
|
||||
/>
|
||||
|
|
|
@ -145,7 +145,6 @@ const removeThermograph = async (id) => {
|
|||
:rows="rows"
|
||||
:columns="TableColumns"
|
||||
:no-data-label="t('No results')"
|
||||
:rows-per-page-options="[0]"
|
||||
row-key="id"
|
||||
class="full-width q-mt-md"
|
||||
>
|
||||
|
|
|
@ -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)"
|
||||
|
|
Loading…
Reference in New Issue