@redseed/redseed-ui-vue3 2.13.2 → 2.13.3

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redseed/redseed-ui-vue3",
3
- "version": "2.13.2",
3
+ "version": "2.13.3",
4
4
  "description": "RedSeed UI Vue 3 components",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -45,7 +45,15 @@ const pageUpdated = (event) => {
45
45
  emit('pageUpdated', event)
46
46
  }
47
47
 
48
- const emit = defineEmits(['pageUpdated'])
48
+ const firstPageUpdated = (event) => {
49
+ emit('firstPageUpdated', event)
50
+ }
51
+
52
+ const lastPageUpdated = (event) => {
53
+ emit('lastPageUpdated', event)
54
+ }
55
+
56
+ const emit = defineEmits(['pageUpdated', 'firstPageUpated', 'lastPageUpdated'])
49
57
 
50
58
  const showEmptyMessage = computed(() => !props.totalItems && !props.controlApplied)
51
59
 
@@ -54,8 +62,14 @@ const showNotFoundMessage = computed(() => !props.totalItems && props.controlApp
54
62
  <template>
55
63
  <div ref="cardGroupElement" :class="cardGroupClasses">
56
64
  <div class="rsui-card-group__pagination">
57
- <Pagination v-if="totalItems > perPage" :totalItems="totalItems" :perPage="perPage" :currentPage="currentPage"
58
- @change="pageUpdated"></Pagination>
65
+ <Pagination v-if="totalItems > perPage"
66
+ :totalItems="totalItems"
67
+ :perPage="perPage"
68
+ :currentPage="currentPage"
69
+ @change="pageUpdated"
70
+ @first="pageUpdated"
71
+ @last="pageUpdated"
72
+ ></Pagination>
59
73
  </div>
60
74
  <div v-if="totalItems" class="rsui-card-group__cards">
61
75
  <slot></slot>
@@ -95,7 +109,7 @@ const showNotFoundMessage = computed(() => !props.totalItems && props.controlApp
95
109
  }
96
110
  }
97
111
 
98
- &--md,
112
+ &--md,
99
113
  &--lg,
100
114
  &--xl {
101
115
  .rsui-card-group__cards {
@@ -40,7 +40,7 @@ const paginationClass = computed(() => [
40
40
  }
41
41
  ])
42
42
 
43
- const emit = defineEmits(['change'])
43
+ const emit = defineEmits(['change', 'firstPage', 'lastPage'])
44
44
 
45
45
  const listControlElement = ref(null)
46
46
 
@@ -64,11 +64,15 @@ const searchText = ref('')
64
64
  const appliedFilters = ref([])
65
65
  const sortDesc = ref(false)
66
66
  const pagination = ref(null)
67
+ const paginationFirst = ref(null)
68
+ const paginationLast = ref(null)
67
69
 
68
70
  watch(searchText, () => { fireChangeEvent() }, { flush: 'post' })
69
71
  watch(appliedFilters, () => { fireChangeEvent() }, { deep: true, flush: 'post' })
70
72
  watch(sortDesc, () => { fireChangeEvent() }, { flush: 'post' })
71
73
  watch(pagination, () => { fireChangeEvent() }, { deep: true, flush: 'post' })
74
+ watch(paginationFirst, () => { fireFirstPageEvent() }, { deep: true, flush: 'post' })
75
+ watch(paginationLast, () => { fireLastPageEvent() }, { deep: true, flush: 'post' })
72
76
 
73
77
  function fireChangeEvent() {
74
78
  emit('change', {
@@ -78,6 +82,24 @@ function fireChangeEvent() {
78
82
  pagination: pagination.value
79
83
  })
80
84
  }
85
+
86
+ function fireFirstPageEvent() {
87
+ emit('firstPage', {
88
+ searchText: searchText.value,
89
+ appliedFilters: appliedFilters.value,
90
+ sortDesc: sortDesc.value,
91
+ pagination: pagination.value
92
+ })
93
+ }
94
+
95
+ function fireLastPageEvent() {
96
+ emit('lastPage', {
97
+ searchText: searchText.value,
98
+ appliedFilters: appliedFilters.value,
99
+ sortDesc: sortDesc.value,
100
+ pagination: pagination.value
101
+ })
102
+ }
81
103
  </script>
82
104
  <template>
83
105
  <div ref="listControlElement"
@@ -135,6 +157,8 @@ function fireChangeEvent() {
135
157
  :perPage="perPage"
136
158
  :currentPage="currentPage"
137
159
  @change="pagination = $event"
160
+ @fitst="paginationFirst = $event"
161
+ @last="paginationLast = $event"
138
162
  ></Pagination>
139
163
  </div>
140
164
  </div>