@appscode/design-system 2.17.64 → 2.17.66
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
|
@@ -3,12 +3,14 @@ import { computed, ref, watch } from "vue";
|
|
|
3
3
|
|
|
4
4
|
interface Props {
|
|
5
5
|
hideRowsPerPageSelection?: boolean;
|
|
6
|
+
userDefinedItemsPerPage?: number | null;
|
|
6
7
|
totalNoOfItems?: number;
|
|
7
8
|
itemsPerPage?: number;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
const props = withDefaults(defineProps<Props>(), {
|
|
11
12
|
hideRowsPerPageSelection: false,
|
|
13
|
+
userDefinedItemsPerPage: null,
|
|
12
14
|
totalNoOfItems: 0,
|
|
13
15
|
itemsPerPage: 5,
|
|
14
16
|
});
|
|
@@ -19,6 +21,7 @@ const activePageNo = ref(1);
|
|
|
19
21
|
|
|
20
22
|
const selectedItemCountPerPage = computed({
|
|
21
23
|
get() {
|
|
24
|
+
if (props.userDefinedItemsPerPage) return props.userDefinedItemsPerPage;
|
|
22
25
|
if (props.itemsPerPage > 5 && props.totalNoOfItems <= 5) return 5;
|
|
23
26
|
else if (props.itemsPerPage > 10 && props.totalNoOfItems <= 10) return 10;
|
|
24
27
|
else if (props.itemsPerPage > 15 && props.totalNoOfItems <= 15) return 15;
|
|
@@ -113,6 +116,12 @@ watch(
|
|
|
113
116
|
<div class="level-item" v-show="!hideRowsPerPageSelection && totalNoOfItems > 5">
|
|
114
117
|
<label>Rows per page</label>
|
|
115
118
|
<select v-model="selectedItemCountPerPage" name="page" data-testid="rows-per-page-selector">
|
|
119
|
+
<option
|
|
120
|
+
:value="userDefinedItemsPerPage"
|
|
121
|
+
v-if="userDefinedItemsPerPage && ![5, 10, 15, 20, 25, 50].includes(userDefinedItemsPerPage)"
|
|
122
|
+
>
|
|
123
|
+
default
|
|
124
|
+
</option>
|
|
116
125
|
<option :value="5">5</option>
|
|
117
126
|
<option :value="10" v-show="totalNoOfItems > 5">10</option>
|
|
118
127
|
<option :value="15" v-show="totalNoOfItems > 10">15</option>
|