quasar-factory-lib 0.1.20 → 0.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -98,6 +98,6 @@
98
98
  "release": "standard-version"
99
99
  },
100
100
  "type": "module",
101
- "version": "0.1.20",
101
+ "version": "0.1.21",
102
102
  "author": ""
103
103
  }
@@ -9,7 +9,7 @@
9
9
  :style="tableStyle"
10
10
  flat
11
11
  bordered
12
- :rows="rowsData"
12
+ :rows="rowsDataComputed"
13
13
  :columns="columns"
14
14
  :filter-method="customFilter"
15
15
  :filter="filterComputed"
@@ -25,9 +25,9 @@
25
25
  :selected-rows-label="getSelectedString"
26
26
  :loading="loading"
27
27
  virtual-scroll
28
- @virtual-scroll="onVirtualScroll"
29
28
  :virtual-scroll-item-size="48"
30
- :virtual-scroll-slice-ratio-before="0"
29
+ :virtual-scroll-sticky-size-start="48"
30
+ @virtual-scroll="onVirtualScroll"
31
31
  @update:selected="(details) => {
32
32
  $emit('onUpdateSelected', details)
33
33
  }"
@@ -274,7 +274,8 @@ export default defineComponent({
274
274
  draggableInstance: null,
275
275
  disabled: false,
276
276
  enableDragAndDrop: false,
277
- dragAndDropDelay: 0
277
+ dragAndDropDelay: 0,
278
+ nextPage: 2,
278
279
  }
279
280
  },
280
281
  computed: {
@@ -302,7 +303,13 @@ export default defineComponent({
302
303
  },
303
304
  pageLength (): number {
304
305
  return (this.totalPage + 1) * this.pageSize
305
- }
306
+ },
307
+ lastPage () {
308
+ return Math.ceil(this.rowsData.length / this.pageSize)
309
+ },
310
+ rowsDataComputed () {
311
+ return this.rowsData.slice(0, this.pageSize * (this.nextPage - 1))
312
+ }
306
313
  },
307
314
  watch: {
308
315
  rows (val) {
@@ -325,16 +332,6 @@ export default defineComponent({
325
332
  this.dragAndDropDelay = 0
326
333
  }
327
334
  },
328
- /* showSkeleton (val: boolean): void {
329
- if (!val) {
330
- this.handleInfiniteScrollTableCompositionAPi()
331
- }
332
- },
333
- '$q.screen.width' (): void {
334
- setTimeout(() => {
335
- this.handleInfiniteScrollTableCompositionAPi()
336
- }, 500)
337
- } */
338
335
  },
339
336
  mounted () {
340
337
  this.getAdvancedFilterColumns()
@@ -563,9 +560,21 @@ export default defineComponent({
563
560
  elementToScroll.addEventListener('scroll', fnAddScroll)
564
561
  })
565
562
  },
566
- onVirtualScroll (args) {
567
- console.log('args', args)
568
- },
563
+ onVirtualScroll ({to, ref}) {
564
+ const lastIndex = this.rowsDataComputed.length - 1
565
+ console.log(to, lastIndex)
566
+ if (!this.loading && this.nextPage < this.lastPage && to === lastIndex) {
567
+ this.loading = true
568
+
569
+ setTimeout(async () => {
570
+ this.nextPage++
571
+ await this.$nextTick(() => {
572
+ ref.refresh()
573
+ this.loading = false
574
+ })
575
+ }, 500)
576
+ }
577
+ }
569
578
  }
570
579
  })
571
580
  </script>
@@ -61,6 +61,10 @@
61
61
  .my-table .itemsFontSize{
62
62
  font-size: 14px;
63
63
  }
64
+ .my-table tbody {
65
+ /* height of all previous header rows */
66
+ scroll-margin-top: 48px;
67
+ }
64
68
  @media only screen and (max-width: 1100px) {
65
69
 
66
70
  .my-table .q-table__grid-content {
@@ -245,16 +245,17 @@ export default {
245
245
  },
246
246
  mounted () {
247
247
  this.tableStyle = setTableHeight.setTableHeight()
248
- this.showSkeleton = true
248
+
249
249
  this.store.cleanTableFilter()
250
250
  this.getRows()
251
251
  // this.getAlertLabelsWithError()
252
252
  },
253
253
  methods: {
254
254
  getRows () {
255
- this.rows = this.generateRows()
255
+ this.showSkeleton = true
256
256
  setTimeout(()=> {
257
- this.showSkeleton = false
257
+ this.rows = this.generateRows()
258
+ this.showSkeleton = false
258
259
  }, 1000)
259
260
  },
260
261
  onUpdateBasicCheckboxValue (rows: object []) {
@@ -34,7 +34,7 @@
34
34
  -->
35
35
  <q-page-container>
36
36
  <q-page>
37
- <Table
37
+ <DraggableQTable
38
38
  ref="tableRef"
39
39
  :rows="rows"
40
40
  :columns="columns"
@@ -81,14 +81,14 @@
81
81
  <script setup lang="ts">
82
82
  import { useQuasar } from 'quasar'
83
83
  import TaskNavBar from '../components/TaskNavBar/TaskNavBar.vue'
84
- import Table from '../components/Table/Table.vue'
84
+ import DraggableQTable from '../components/Table/DraggableQTable.vue'
85
85
  import NavBarSkeleton from '../components/NavBarSkeleton/NavBarSkeleton.vue'
86
86
  import TableRowsCounter from'../components/TableRowsCounter/TableRowsCounter.vue'
87
87
  // import AlertLabelsWithError from '../components/AlertLabelsWithError/AlertLabelsWithError.vue'
88
88
  import setTableHeight from '../components/Table/utils/setTableHeight'
89
89
  // import infiniteScroll from '../components/Table/utils/infiniteScroll'
90
90
  import { tableStore } from '../store/table.js'
91
- import { ref, computed, onMounted, watch } from 'vue'
91
+ import { ref, computed, onMounted, watch, nextTick } from 'vue'
92
92
 
93
93
  interface TableInterface {
94
94
  toggleSearchVisibility: (obj: object)=> void
@@ -579,9 +579,14 @@ import { ref, computed, onMounted, watch } from 'vue'
579
579
  showSkeleton.value = true
580
580
  rows.value = rowsData.value
581
581
  setTimeout(()=> {
582
- // showSkeleton.value = false
582
+ showSkeleton.value = false
583
583
 
584
584
  }, 1000)
585
+ nextTick(() => {
586
+ if(tableRef.value) {
587
+ tableRef.value.enableDragAndDrop = true
588
+ }
589
+ })
585
590
  }
586
591
  function onUpdateBasicCheckboxValue (rows: object []) {
587
592
  console.log(rows, 'onUpdateBasicCheckboxValue')