quasar-factory-lib 0.1.17 → 0.1.19

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.
@@ -4,28 +4,27 @@
4
4
  v-show="!showSkeleton"
5
5
  ref="myTable"
6
6
  v-model:selected="selected"
7
+ v-model:pagination="pagination"
7
8
  class="my-table"
8
- :grid="smallDevice"
9
9
  :style="tableStyle"
10
10
  flat
11
- :filter-method="customFilter"
12
11
  bordered
13
12
  :rows="rowsData"
14
13
  :columns="columns"
14
+ :filter-method="customFilter"
15
+ :filter="filterComputed"
16
+ :sort-method="customSortMethod"
15
17
  :row-key="rowKey"
16
18
  :rows-per-page-options="rowsPerPageOptions"
17
19
  :selection="selectionType"
18
20
  :visible-columns="visibleColumns"
19
21
  table-class="text-grey-9"
20
22
  table-header-class="main-color"
21
- :filter="filterComputed"
22
- :sort-method="customSortMethod"
23
23
  separator="horizontal"
24
24
  binary-state-sort
25
25
  :selected-rows-label="getSelectedString"
26
26
  :loading="loading"
27
- pagination.sync="0"
28
- :grid-header="showGridHeader"
27
+ virtual-scroll
29
28
  @update:selected="(details) => {
30
29
  $emit('onUpdateSelected', details)
31
30
  }"
@@ -78,7 +77,7 @@
78
77
  </template>
79
78
  <template #body="props">
80
79
  <TableSlotBody
81
- v-if="!showSkeleton"
80
+ v-if="!showSkeleton && !smallDevice"
82
81
  :table-props="props"
83
82
  :selection-type="selectionType"
84
83
  :getCellClass="getCellClass"
@@ -89,10 +88,9 @@
89
88
  @on-click-icon-tool-tip="onClickIconToolTip"
90
89
  @click="onRowClick(props.row)"
91
90
  />
92
- </template>
93
- <template #item="props">
91
+
94
92
  <TableSlotGrid
95
- v-if="!showSkeleton"
93
+ v-if="!showSkeleton && smallDevice"
96
94
  :table-props="props"
97
95
  :selection-type="selectionType"
98
96
  :popup-edit-number-options="popupEditNumberOptions"
@@ -212,7 +210,7 @@ export default defineComponent({
212
210
  },
213
211
  rowsPerPageOptions: {
214
212
  type: Array,
215
- default: () => [20]
213
+ default: () => [0]
216
214
 
217
215
  }
218
216
  },
@@ -249,10 +247,11 @@ export default defineComponent({
249
247
  'operatorMachineAssignmentSetPartialMachineCenter',
250
248
  'operatorMachineAssignmentSeeDetail',
251
249
  'onClickOpenDialogOperators'
252
-
250
+
253
251
  ],
254
252
  data () {
255
253
  return {
254
+ pagination: { rowsPerPage: 0},
256
255
  selected: [],
257
256
  filter: '',
258
257
  rowsData: [] as object[],
@@ -282,7 +281,7 @@ export default defineComponent({
282
281
  return !this.smallDevice || this.showSearch
283
282
  },
284
283
  showGridHeader () {
285
- return this.selectionType === 'multiple' || this.showAdvancedFilter
284
+ return this.selectionType === 'multiple' || this.showAdvancedFilter
286
285
  },
287
286
  getTableSkeletonVisibility () {
288
287
  return !this.smallDevice && this.showSkeleton
@@ -352,7 +351,7 @@ export default defineComponent({
352
351
  this.draggableInstance = useDraggable(this.tableRef, this.rows, {
353
352
  animation: 100,
354
353
  delay: self.dragAndDropDelay,
355
-
354
+
356
355
  onStart (e) {
357
356
  self.$emit('onDragStart', e)
358
357
  },
@@ -431,7 +430,7 @@ export default defineComponent({
431
430
  data = this.additionalSortConditions(this.filteredRows, rows);
432
431
  }
433
432
  this.getSortedData(sortBy, data, descending)
434
- return data.slice(0, this.pageLength);
433
+ return data // .slice(0, this.pageLength);
435
434
  },
436
435
  getSortedData (sortBy: string, data: object[] | [], descending: boolean) {
437
436
  if (sortBy) {
@@ -476,14 +475,14 @@ export default defineComponent({
476
475
  } else {
477
476
  return xValue.localeCompare(yValue);
478
477
  }
479
- }
478
+ }
480
479
  else if (typeof xValue === 'number' && typeof yValue === 'number') {
481
480
  return xValue - yValue;
482
- }
481
+ }
483
482
  else if (typeof xValue === 'boolean' && typeof yValue === 'boolean') {
484
483
  console.log(xValue, yValue)
485
484
  return xValue === yValue ? 0 : xValue ? 1 : -1;
486
- }
485
+ }
487
486
  else {
488
487
  return String(xValue) > String(yValue) ? 1 : String(xValue) < String(yValue) ? -1 : 0;
489
488
  }
@@ -511,7 +510,7 @@ export default defineComponent({
511
510
  filteredRows_.push(this.rows[i])
512
511
  }
513
512
  }
514
- }
513
+ }
515
514
  else {
516
515
  filteredRows_ = rows
517
516
  }
@@ -532,13 +531,13 @@ export default defineComponent({
532
531
  }
533
532
 
534
533
  this.filteredRows = filteredRows_
535
- return filteredRows_.slice(0, this.pageLength)
534
+ return filteredRows_ //slice(0, this.pageLength)
536
535
  },
537
536
  getAdvancedFilterColumns (): void {
538
537
  this.advancedFiltersData = this.columns.reduce((acc, column) => {
539
538
  acc[column.name] = ''
540
539
  return acc
541
- }, {} as { [key: string]: string })
540
+ }, {} as Record<string, string>)
542
541
  },
543
542
  handleInfiniteScrollTableCompositionAPi () {
544
543
  // const offSet = this.showIconAdvancedFilter && this.smallDevice ? document.getElementsByClassName('q-table__control')[0].offsetHeight : 0
@@ -562,4 +561,4 @@ export default defineComponent({
562
561
  }
563
562
  }
564
563
  })
565
- </script>
564
+ </script>
@@ -1,5 +1,6 @@
1
1
  <template>
2
2
  <tr
3
+ :id="tablePropsData.row.id"
3
4
  :class="tablePropsData.row.rowBgColor || 'bg-main-color'"
4
5
  >
5
6
  <q-td
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div
3
3
  :id="'card-container-' + tablePropsData.row.id"
4
- class="col-xs-12 col-sm-12 grid-style-transition"
4
+ class="grid-style-transition"
5
5
  :style="tablePropsData.selected ? 'transform: scale(0.95);' : ''"
6
6
  >
7
7
  <q-card
@@ -1,6 +1,7 @@
1
1
  import type { App, Plugin } from 'vue'
2
2
 
3
3
  import MyTable from './Table.vue'
4
+ import DraggableQTable from './Table.vue'
4
5
 
5
6
  import { registerComponent } from '@/utils/plugins'
6
7
 
@@ -11,8 +12,10 @@ import { registerComponent } from '@/utils/plugins'
11
12
  export default {
12
13
  install (app: App) {
13
14
  registerComponent(app, 'MyTable', MyTable)
15
+ registerComponent(app, 'DraggableQTable', DraggableQTable)
14
16
  }
15
17
  } as Plugin
16
18
 
17
19
  /** export button components */
18
20
  export { MyTable as MyTable }
21
+ export { DraggableQTable as DraggableQTable }
@@ -1,4 +1,5 @@
1
1
  import MyTable from './Table'
2
+ import DraggableQTable from './Table'
2
3
  import AlertDialog from './Alert'
3
4
  import ConfirmDialog from './Confirm'
4
5
  import TaskNavBar from './TaskNavBar'
@@ -11,5 +12,5 @@ import SkeletonAreas from './SkeletonAreas'
11
12
  import ListSkeleton from './ListSkeleton'
12
13
  import SkeletonTaskList from './SkeletonTaskList'
13
14
  import SkeletonFormCreateTask from './SkeletonFormCreateTask'
14
- export { MyTable, AlertDialog, ConfirmDialog, TaskNavBar, ConfirmedTask, TableRowsCounter, NavBarSkeleton, AlertLabelsWithError, FormSkeleton, SkeletonAreas, ListSkeleton, SkeletonTaskList, SkeletonFormCreateTask }
15
+ export { DraggableQTable, MyTable, AlertDialog, ConfirmDialog, TaskNavBar, ConfirmedTask, TableRowsCounter, NavBarSkeleton, AlertLabelsWithError, FormSkeleton, SkeletonAreas, ListSkeleton, SkeletonTaskList, SkeletonFormCreateTask }
15
16
 
package/src/index.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import '@quasar/extras/material-icons/material-icons.css'
2
2
  import { Quasar } from 'quasar'
3
3
  import { App, Plugin } from 'vue'
4
- import { MyTable, AlertDialog, ConfirmDialog, TaskNavBar, ConfirmedTask, TableRowsCounter, NavBarSkeleton, AlertLabelsWithError, FormSkeleton, SkeletonAreas, ListSkeleton, SkeletonTaskList, SkeletonFormCreateTask } from './components/plugins.ts'
4
+ import { DraggableQTable, MyTable, AlertDialog, ConfirmDialog, TaskNavBar, ConfirmedTask, TableRowsCounter, NavBarSkeleton, AlertLabelsWithError, FormSkeleton, SkeletonAreas, ListSkeleton, SkeletonTaskList, SkeletonFormCreateTask } from './components/plugins.ts'
5
5
  import { registerPlugin, setVueInstance } from './utils/plugins.ts'
6
6
  import TranslateKeys from './i18n/translateKeys.ts'
7
7
  import { createPinia } from 'pinia'
8
- export { MyTable, AlertDialog, ConfirmDialog, TaskNavBar, ConfirmedTask, TableRowsCounter, NavBarSkeleton, AlertLabelsWithError, FormSkeleton, SkeletonAreas, ListSkeleton, SkeletonTaskList, SkeletonFormCreateTask } from './components/index.ts'
8
+ export { DraggableQTable, MyTable, AlertDialog, ConfirmDialog, TaskNavBar, ConfirmedTask, TableRowsCounter, NavBarSkeleton, AlertLabelsWithError, FormSkeleton, SkeletonAreas, ListSkeleton, SkeletonTaskList, SkeletonFormCreateTask } from './components/index.ts'
9
9
 
10
10
  export type { TranslateKeys }
11
11
  // import plugins from "./components/plugins";
@@ -21,6 +21,7 @@ const plugin: Plugin = {
21
21
  install(app: App) {
22
22
  console.log('[Quasar Components] Installing...')
23
23
  setVueInstance(app)
24
+ registerPlugin(app, DraggableQTable)
24
25
  registerPlugin(app, MyTable)
25
26
  registerPlugin(app, AlertDialog)
26
27
  registerPlugin(app, ConfirmDialog)
@@ -231,8 +231,8 @@ export default {
231
231
  type: 'string'
232
232
  }
233
233
  ],
234
- rows: [],
235
- rowsData: [
234
+ rows:[],
235
+ rowsData: [
236
236
  {
237
237
  id: 1,
238
238
  name: 'Frozen Yogurt',
@@ -540,6 +540,314 @@ export default {
540
540
  sodium: 54,
541
541
  calcium: '12%',
542
542
  iron: '6%'
543
+ },
544
+ {
545
+ id: 22,
546
+ name: 'Frozen Yogurt',
547
+ booleanIcon: true,
548
+ available: true,
549
+ calories: 159,
550
+ fat: 6.0,
551
+ carbs: 24,
552
+ checked: false,
553
+ protein: 4.0,
554
+ sodium: 87,
555
+ calcium: '14%',
556
+ iron: '1%'
557
+ },
558
+ {
559
+ id: 23,
560
+ name: 'Ice cream sandwich',
561
+ booleanIcon: true,
562
+ available: false,
563
+ calories: 237,
564
+ fat: 9.0,
565
+ carbs: 37,
566
+ checked: false,
567
+ protein: 4.3,
568
+ sodium: 129,
569
+ calcium: '8%',
570
+ iron: '1%'
571
+ },
572
+ {
573
+ id: 24,
574
+ name: 'Eclair',
575
+ booleanIcon: true,
576
+ available: true,
577
+ calories: 262,
578
+ fat: 16.0,
579
+ carbs: 23,
580
+ checked: false,
581
+ protein: 6.0,
582
+ sodium: 337,
583
+ calcium: '6%',
584
+ iron: '7%'
585
+ },
586
+ {
587
+ id: 25,
588
+ name: 'Cupcake',
589
+ booleanIcon: false,
590
+ available: false,
591
+ calories: 305,
592
+ fat: 3.7,
593
+ carbs: 67,
594
+ checked: false,
595
+ protein: 4.3,
596
+ sodium: 413,
597
+ calcium: '3%',
598
+ iron: '8%'
599
+ },
600
+ {
601
+ id: 26,
602
+ name: 'Gingerbread',
603
+ booleanIcon: true,
604
+ available: true,
605
+ calories: 356,
606
+ fat: 16.0,
607
+ carbs: 49,
608
+ checked: false,
609
+ protein: 3.9,
610
+ sodium: 327,
611
+ calcium: '7%',
612
+ iron: '16%'
613
+ },
614
+ {
615
+ id: 27,
616
+ name: 'Jelly bean',
617
+ booleanIcon: false,
618
+ available: false,
619
+ calories: 375,
620
+ fat: 0.0,
621
+ carbs: 94,
622
+ checked: true,
623
+ protein: 0.0,
624
+ sodium: 50,
625
+ calcium: '0%',
626
+ iron: '0%'
627
+ },
628
+ {
629
+ id: 28,
630
+ name: 'Lollipop',
631
+ booleanIcon: true,
632
+ available: true,
633
+ calories: 392,
634
+ fat: 0.2,
635
+ carbs: 98,
636
+ checked: false,
637
+ protein: 0,
638
+ sodium: 38,
639
+ calcium: '0%',
640
+ iron: '2%'
641
+ },
642
+ {
643
+ id: 29,
644
+ name: 'Honeycomb',
645
+ booleanIcon: true,
646
+ available: false,
647
+ calories: 408,
648
+ fat: 3.2,
649
+ carbs: 87,
650
+ checked: true,
651
+ protein: 6.5,
652
+ sodium: 562,
653
+ calcium: '0%',
654
+ iron: '45%'
655
+ },
656
+ {
657
+ id: 30,
658
+ name: 'Donut',
659
+ booleanIcon: true,
660
+ available: true,
661
+ calories: 452,
662
+ fat: 25.0,
663
+ carbs: 51,
664
+ checked: false,
665
+ protein: 4.9,
666
+ sodium: 326,
667
+ calcium: '2%',
668
+ iron: '22%'
669
+ },
670
+ {
671
+ id: 31,
672
+ name: 'KitKat',
673
+ booleanIcon: false,
674
+ available: false,
675
+ calories: 518,
676
+ fat: 26.0,
677
+ carbs: 65,
678
+ checked: true,
679
+ protein: 7,
680
+ sodium: 54,
681
+ calcium: '12%',
682
+ iron: '6%'
683
+ },
684
+ {
685
+ id: 32,
686
+ name: 'Frozen Yogurt',
687
+ booleanIcon: true,
688
+ available: true,
689
+ calories: 159,
690
+ fat: 6.0,
691
+ carbs: 24,
692
+ checked: false,
693
+ protein: 4.0,
694
+ sodium: 87,
695
+ calcium: '14%',
696
+ iron: '1%'
697
+ },
698
+ {
699
+ id: 33,
700
+ name: 'Ice cream sandwich',
701
+ booleanIcon: true,
702
+ available: false,
703
+ calories: 237,
704
+ fat: 9.0,
705
+ carbs: 37,
706
+ checked: false,
707
+ protein: 4.3,
708
+ sodium: 129,
709
+ calcium: '8%',
710
+ iron: '1%'
711
+ },
712
+ {
713
+ id: 34,
714
+ name: 'Eclair',
715
+ booleanIcon: true,
716
+ available: true,
717
+ calories: 262,
718
+ fat: 16.0,
719
+ carbs: 23,
720
+ checked: false,
721
+ protein: 6.0,
722
+ sodium: 337,
723
+ calcium: '6%',
724
+ iron: '7%'
725
+ },
726
+ {
727
+ id: 35,
728
+ name: 'Cupcake',
729
+ booleanIcon: false,
730
+ available: false,
731
+ calories: 305,
732
+ fat: 3.7,
733
+ carbs: 67,
734
+ checked: false,
735
+ protein: 4.3,
736
+ sodium: 413,
737
+ calcium: '3%',
738
+ iron: '8%'
739
+ },
740
+ {
741
+ id: 36,
742
+ name: 'Gingerbread',
743
+ booleanIcon: true,
744
+ available: true,
745
+ calories: 356,
746
+ fat: 16.0,
747
+ carbs: 49,
748
+ checked: false,
749
+ protein: 3.9,
750
+ sodium: 327,
751
+ calcium: '7%',
752
+ iron: '16%'
753
+ },
754
+ {
755
+ id: 37,
756
+ name: 'Jelly bean',
757
+ booleanIcon: false,
758
+ available: false,
759
+ calories: 375,
760
+ fat: 0.0,
761
+ carbs: 94,
762
+ checked: true,
763
+ protein: 0.0,
764
+ sodium: 50,
765
+ calcium: '0%',
766
+ iron: '0%'
767
+ },
768
+ {
769
+ id: 38,
770
+ name: 'Lollipop',
771
+ booleanIcon: true,
772
+ available: true,
773
+ calories: 392,
774
+ fat: 0.2,
775
+ carbs: 98,
776
+ checked: false,
777
+ protein: 0,
778
+ sodium: 38,
779
+ calcium: '0%',
780
+ iron: '2%'
781
+ },
782
+ {
783
+ id: 39,
784
+ name: 'Honeycomb',
785
+ booleanIcon: true,
786
+ available: false,
787
+ calories: 408,
788
+ fat: 3.2,
789
+ carbs: 87,
790
+ checked: true,
791
+ protein: 6.5,
792
+ sodium: 562,
793
+ calcium: '0%',
794
+ iron: '45%'
795
+ },
796
+ {
797
+ id: 40,
798
+ name: 'Donut',
799
+ booleanIcon: true,
800
+ available: true,
801
+ calories: 452,
802
+ fat: 25.0,
803
+ carbs: 51,
804
+ checked: false,
805
+ protein: 4.9,
806
+ sodium: 326,
807
+ calcium: '2%',
808
+ iron: '22%'
809
+ },
810
+ {
811
+ id: 41,
812
+ name: 'KitKat',
813
+ booleanIcon: false,
814
+ available: false,
815
+ calories: 518,
816
+ fat: 26.0,
817
+ carbs: 65,
818
+ checked: true,
819
+ protein: 7,
820
+ sodium: 54,
821
+ calcium: '12%',
822
+ iron: '6%'
823
+ },
824
+ {
825
+ id: 42,
826
+ name: 'KitKat',
827
+ booleanIcon: false,
828
+ available: false,
829
+ calories: 518,
830
+ fat: 26.0,
831
+ carbs: 65,
832
+ checked: true,
833
+ protein: 7,
834
+ sodium: 54,
835
+ calcium: '12%',
836
+ iron: '6%'
837
+ },
838
+ {
839
+ id: 43,
840
+ name: 'KitKat',
841
+ booleanIcon: false,
842
+ available: false,
843
+ calories: 518,
844
+ fat: 26.0,
845
+ carbs: 65,
846
+ checked: true,
847
+ protein: 7,
848
+ sodium: 54,
849
+ calcium: '12%',
850
+ iron: '6%'
543
851
  }
544
852
  ],
545
853
  showSkeleton: false,
@@ -555,7 +863,7 @@ export default {
555
863
  '$q.screen.width' (): void {
556
864
  setTimeout(() => {
557
865
  this.tableStyle = setTableHeight.setTableHeight()
558
- this.$refs.table.handleInfiniteScrollTableCompositionAPi()
866
+ // this.$refs.table.handleInfiniteScrollTableCompositionAPi()
559
867
  // infiniteScroll.handleInfiniteScrollNewTable(this)
560
868
  }, 500)
561
869
  },
@@ -563,7 +871,7 @@ export default {
563
871
  if (!val) {
564
872
  setTimeout(() => {
565
873
  this.tableStyle = setTableHeight.setTableHeight()
566
- this.$refs.table.handleInfiniteScrollTableCompositionAPi()
874
+ // this.$refs.table.handleInfiniteScrollTableCompositionAPi()
567
875
  // infiniteScroll.handleInfiniteScrollNewTable(this)
568
876
  }, 500)
569
877
  }
@@ -577,13 +885,15 @@ export default {
577
885
  },
578
886
  methods: {
579
887
  getRows () {
888
+ this.rows = this.rowsData
580
889
  setTimeout(()=> {
581
-
582
- this.rows = this.rowsData
890
+
891
+
583
892
  this.$nextTick(() =>{
584
- this.$refs.table.enableDragAndDrop = true
585
- this.showSkeleton = false
893
+ this.$refs.table.enableDragAndDrop = true
894
+
586
895
  })
896
+ this.showSkeleton = false
587
897
  }, 1000)
588
898
  },
589
899
  onUpdateBasicCheckboxValue (rows: object []) {