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