Welcome to mirror list, hosted at ThFree Co, Russian Federation.

pagination_links.vue « components « vue_shared « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 06097913e91e43e8a9d3bae6c427da1f2576d690 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<script>
import { GlPagination } from '@gitlab/ui';
import {
  PREV,
  NEXT,
  LABEL_FIRST_PAGE,
  LABEL_PREV_PAGE,
  LABEL_NEXT_PAGE,
  LABEL_LAST_PAGE,
} from '~/vue_shared/components/pagination/constants';

export default {
  components: {
    GlPagination,
  },
  props: {
    change: {
      type: Function,
      required: true,
    },
    pageInfo: {
      type: Object,
      required: true,
    },
  },
  prevText: PREV,
  nextText: NEXT,
  labelFirstPage: LABEL_FIRST_PAGE,
  labelPrevPage: LABEL_PREV_PAGE,
  labelNextPage: LABEL_NEXT_PAGE,
  labelLastPage: LABEL_LAST_PAGE,
};
</script>

<template>
  <gl-pagination
    v-bind="$attrs"
    :value="pageInfo.page"
    :per-page="pageInfo.perPage"
    :total-items="pageInfo.total"
    :prev-text="$options.prevText"
    :next-text="$options.nextText"
    :label-first-page="$options.labelFirstPage"
    :label-prev-page="$options.labelPrevPage"
    :label-next-page="$options.labelNextPage"
    :label-last-page="$options.labelLastPage"
    @input="change"
  />
</template>