aloha-vue 1.2.38 → 1.2.39

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
@@ -14,7 +14,7 @@
14
14
  "Vue.js"
15
15
  ],
16
16
  "homepage": "https://github.com/ilia-brykin/aloha/#README.md",
17
- "version": "1.2.38",
17
+ "version": "1.2.39",
18
18
  "author": {
19
19
  "name": "Ilia Brykin",
20
20
  "email": "brykin.ilia@gmail.com"
@@ -501,27 +501,30 @@ export default {
501
501
  tableGrandparentRef,
502
502
  });
503
503
 
504
+ const {
505
+ hasViews,
506
+ initViewCurrent,
507
+ isViewTableVisible,
508
+ updateViewCurrent,
509
+ viewCurrent,
510
+ } = ViewsAPI(props, context, {
511
+ closePreviewAll,
512
+ startSearch: () => ({}), // TODO: in AFilters
513
+ });
514
+
504
515
  const {
505
516
  changeOffset,
506
517
  changeLimit,
518
+ usePaginationLocal,
507
519
  } = LimitOffsetAPI(props, context, {
508
520
  closePreviewAll,
521
+ isViewTableVisible,
509
522
  limit,
510
523
  offset,
511
524
  scrollToTable,
512
525
  setEmptySelectedRowsIndexes,
513
526
  setFocusToTable,
514
- });
515
-
516
- const {
517
- hasViews,
518
- initViewCurrent,
519
- isViewTableVisible,
520
- updateViewCurrent,
521
527
  viewCurrent,
522
- } = ViewsAPI(props, context, {
523
- closePreviewAll,
524
- startSearch: () => ({}), // TODO: in AFilters
525
528
  });
526
529
 
527
530
  const {
@@ -628,6 +631,7 @@ export default {
628
631
  togglePreviewResize,
629
632
  updateRow,
630
633
  updateViewCurrent,
634
+ usePaginationLocal,
631
635
  viewCurrent,
632
636
  };
633
637
  },
@@ -824,7 +828,7 @@ export default {
824
828
  this.$slots[this.viewCurrent.type]({
825
829
  rows: this.rowsLocalAll,
826
830
  }),
827
- (this.isViewTableVisible && this.pagination.use) &&
831
+ (this.usePaginationLocal) &&
828
832
  h(APagination, {
829
833
  countAllRows: this.countAllRowsLocal,
830
834
  disabled: this.pagination.disabled,
@@ -1,4 +1,5 @@
1
1
  import {
2
+ computed,
2
3
  ref,
3
4
  toRef,
4
5
  } from "vue";
@@ -9,13 +10,25 @@ import {
9
10
 
10
11
  export default function LimitOffsetAPI(props, { emit }, {
11
12
  closePreviewAll = () => {},
13
+ isViewTableVisible = computed(() => true),
12
14
  limit = ref(0),
13
15
  offset = ref(0),
14
16
  scrollToTable = () => {},
15
17
  setEmptySelectedRowsIndexes = () => {},
16
18
  setFocusToTable = () => {},
19
+ viewCurrent = computed(() => ({})),
17
20
  }) {
18
21
  const offsetStart = toRef(props, "offsetStart");
22
+ const pagination = toRef(props, "pagination");
23
+
24
+ const usePaginationLocal = computed(() => {
25
+ if (pagination.value?.use) {
26
+ if (isViewTableVisible.value || viewCurrent.value.usePagination) {
27
+ return true;
28
+ }
29
+ }
30
+ return false;
31
+ });
19
32
 
20
33
  const changeOffset = _offset => {
21
34
  let offsetLocal;
@@ -58,5 +71,6 @@ export default function LimitOffsetAPI(props, { emit }, {
58
71
  return {
59
72
  changeOffset,
60
73
  changeLimit,
74
+ usePaginationLocal,
61
75
  };
62
76
  }