@digigov/ui 0.35.0 → 0.35.2
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/CHANGELOG.md +8 -1
- package/admin/Pagination/Pagination.stories.d.ts +2 -0
- package/admin/Pagination/Pagination.stories.js +28 -0
- package/admin/Pagination/__stories__/Default.js +11 -69
- package/admin/Pagination/__stories__/PaginationSmall.js +1 -1
- package/admin/Pagination/__stories__/WithInactiveValues.d.ts +2 -0
- package/admin/Pagination/__stories__/WithInactiveValues.js +88 -0
- package/admin/Pagination/__stories__/WithResultsPerPage.d.ts +2 -0
- package/admin/Pagination/__stories__/WithResultsPerPage.js +60 -0
- package/admin/Pagination/index.js +1 -1
- package/admin/Pagination/index.mdx +8 -0
- package/es/admin/Pagination/Pagination.stories.js +2 -0
- package/es/admin/Pagination/__stories__/Default.js +11 -69
- package/es/admin/Pagination/__stories__/PaginationSmall.js +1 -1
- package/es/admin/Pagination/__stories__/WithInactiveValues.js +71 -0
- package/es/admin/Pagination/__stories__/WithResultsPerPage.js +42 -0
- package/es/admin/Pagination/index.js +1 -1
- package/es/admin/Pagination/index.mdx +8 -0
- package/es/locales/el.js +1 -1
- package/esm/admin/Pagination/Pagination.stories.js +2 -0
- package/esm/admin/Pagination/__stories__/Default.js +11 -69
- package/esm/admin/Pagination/__stories__/PaginationSmall.js +1 -1
- package/esm/admin/Pagination/__stories__/WithInactiveValues.js +71 -0
- package/esm/admin/Pagination/__stories__/WithResultsPerPage.js +42 -0
- package/esm/admin/Pagination/index.js +1 -1
- package/esm/admin/Pagination/index.mdx +8 -0
- package/esm/index.js +1 -1
- package/esm/locales/el.js +1 -1
- package/locales/el.js +1 -1
- package/package.json +3 -3
- package/src/admin/Pagination/Pagination.stories.js +2 -0
- package/src/admin/Pagination/__stories__/Default.tsx +9 -86
- package/src/admin/Pagination/__stories__/PaginationSmall.tsx +1 -1
- package/src/admin/Pagination/__stories__/WithInactiveValues.tsx +90 -0
- package/src/admin/Pagination/__stories__/WithResultsPerPage.tsx +66 -0
- package/src/admin/Pagination/index.mdx +8 -0
- package/src/admin/Pagination/index.tsx +1 -1
- package/src/locales/el.ts +1 -1
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
Pagination,
|
|
5
|
+
PaginationList,
|
|
6
|
+
PaginationListItem,
|
|
7
|
+
PaginationLabel,
|
|
8
|
+
} from '@digigov/ui/admin/Pagination';
|
|
9
|
+
import { ArrowIcon } from '@digigov/ui/core/SvgIcon';
|
|
10
|
+
import { Link } from '@digigov/ui/core/Link';
|
|
11
|
+
import { SectionBreak } from '@digigov/ui/core/SectionBreak';
|
|
12
|
+
import { I18NProvider } from '@digigov/ui/app/i18n';
|
|
13
|
+
|
|
14
|
+
export const WithInactiveValues = () => (
|
|
15
|
+
<div className="example">
|
|
16
|
+
<I18NProvider t={(str: string) => str}>
|
|
17
|
+
<Pagination>
|
|
18
|
+
<PaginationLabel start={10} end={20} total={10000}></PaginationLabel>
|
|
19
|
+
<PaginationList>
|
|
20
|
+
<PaginationListItem inactive>
|
|
21
|
+
<Link>
|
|
22
|
+
<ArrowIcon direction="left" />
|
|
23
|
+
Προηγούμενο
|
|
24
|
+
</Link>
|
|
25
|
+
</PaginationListItem>
|
|
26
|
+
<PaginationListItem currentPage>1</PaginationListItem>
|
|
27
|
+
<PaginationListItem>
|
|
28
|
+
<Link href="#page2">2</Link>
|
|
29
|
+
</PaginationListItem>
|
|
30
|
+
<PaginationListItem>
|
|
31
|
+
<Link href="#page3">3</Link>
|
|
32
|
+
</PaginationListItem>
|
|
33
|
+
<PaginationListItem variant="dots"></PaginationListItem>
|
|
34
|
+
<PaginationListItem>
|
|
35
|
+
<Link href="#page5">5</Link>
|
|
36
|
+
</PaginationListItem>
|
|
37
|
+
<PaginationListItem>
|
|
38
|
+
<Link href="#page6">6</Link>
|
|
39
|
+
</PaginationListItem>
|
|
40
|
+
<PaginationListItem>
|
|
41
|
+
<Link href="#page7">7</Link>
|
|
42
|
+
</PaginationListItem>
|
|
43
|
+
<PaginationListItem>
|
|
44
|
+
<Link>
|
|
45
|
+
Επόμενο
|
|
46
|
+
<ArrowIcon direction="right" />
|
|
47
|
+
</Link>
|
|
48
|
+
</PaginationListItem>
|
|
49
|
+
</PaginationList>
|
|
50
|
+
</Pagination>
|
|
51
|
+
<SectionBreak size="l" />
|
|
52
|
+
<Pagination>
|
|
53
|
+
<PaginationLabel start={10} end={20} total={10000}></PaginationLabel>
|
|
54
|
+
<PaginationList>
|
|
55
|
+
<PaginationListItem>
|
|
56
|
+
<Link>
|
|
57
|
+
<ArrowIcon direction="left" />
|
|
58
|
+
Προηγούμενο
|
|
59
|
+
</Link>
|
|
60
|
+
</PaginationListItem>
|
|
61
|
+
<PaginationListItem>
|
|
62
|
+
<Link href="#page1">1</Link>
|
|
63
|
+
</PaginationListItem>
|
|
64
|
+
<PaginationListItem>
|
|
65
|
+
<Link>2</Link>
|
|
66
|
+
</PaginationListItem>
|
|
67
|
+
<PaginationListItem>
|
|
68
|
+
<Link href="#page3">3</Link>
|
|
69
|
+
</PaginationListItem>
|
|
70
|
+
<PaginationListItem variant="dots"></PaginationListItem>
|
|
71
|
+
<PaginationListItem>
|
|
72
|
+
<Link href="#page5">5</Link>
|
|
73
|
+
</PaginationListItem>
|
|
74
|
+
<PaginationListItem>
|
|
75
|
+
<Link href="#page6">6</Link>
|
|
76
|
+
</PaginationListItem>
|
|
77
|
+
<PaginationListItem currentPage>7</PaginationListItem>
|
|
78
|
+
<PaginationListItem inactive>
|
|
79
|
+
<Link>
|
|
80
|
+
Επόμενο
|
|
81
|
+
<ArrowIcon direction="right" />
|
|
82
|
+
</Link>
|
|
83
|
+
</PaginationListItem>
|
|
84
|
+
</PaginationList>
|
|
85
|
+
</Pagination>
|
|
86
|
+
</I18NProvider>
|
|
87
|
+
</div>
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
export default WithInactiveValues;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
Pagination,
|
|
5
|
+
PaginationList,
|
|
6
|
+
PaginationListItem,
|
|
7
|
+
PaginationLabel,
|
|
8
|
+
} from '@digigov/ui/admin/Pagination';
|
|
9
|
+
import {
|
|
10
|
+
SelectContainer,
|
|
11
|
+
SelectOption,
|
|
12
|
+
} from '@digigov/ui/core/SelectContainer';
|
|
13
|
+
|
|
14
|
+
import { ArrowIcon } from '@digigov/ui/core/SvgIcon';
|
|
15
|
+
import { Link } from '@digigov/ui/core/Link';
|
|
16
|
+
import { I18NProvider } from '@digigov/ui/app/i18n';
|
|
17
|
+
import { LabelContainer } from '@digigov/react-core';
|
|
18
|
+
|
|
19
|
+
export const WithResultsPerPage = () => (
|
|
20
|
+
<div className="example">
|
|
21
|
+
<I18NProvider t={(str: string) => str}>
|
|
22
|
+
<Pagination>
|
|
23
|
+
<PaginationLabel start={1} end={10} total={15}></PaginationLabel>
|
|
24
|
+
<LabelContainer>
|
|
25
|
+
Αποτελέσματα ανά σελίδα
|
|
26
|
+
<SelectContainer>
|
|
27
|
+
<SelectOption>5</SelectOption>
|
|
28
|
+
<SelectOption>10</SelectOption>
|
|
29
|
+
<SelectOption>15</SelectOption>
|
|
30
|
+
</SelectContainer>
|
|
31
|
+
</LabelContainer>
|
|
32
|
+
<PaginationList>
|
|
33
|
+
<PaginationListItem>
|
|
34
|
+
<Link>
|
|
35
|
+
<ArrowIcon direction="left" />
|
|
36
|
+
Προηγούμενο
|
|
37
|
+
</Link>
|
|
38
|
+
</PaginationListItem>
|
|
39
|
+
<PaginationListItem>
|
|
40
|
+
<Link href="#page1">1</Link>
|
|
41
|
+
</PaginationListItem>
|
|
42
|
+
<PaginationListItem variant="dots"></PaginationListItem>
|
|
43
|
+
<PaginationListItem>
|
|
44
|
+
<Link href="#page2">2</Link>
|
|
45
|
+
</PaginationListItem>
|
|
46
|
+
<PaginationListItem currentPage>8</PaginationListItem>
|
|
47
|
+
<PaginationListItem>
|
|
48
|
+
<Link href="#page9">9</Link>
|
|
49
|
+
</PaginationListItem>
|
|
50
|
+
<PaginationListItem variant="dots"></PaginationListItem>
|
|
51
|
+
<PaginationListItem>
|
|
52
|
+
<Link href="#page20">20</Link>
|
|
53
|
+
</PaginationListItem>
|
|
54
|
+
<PaginationListItem>
|
|
55
|
+
<Link>
|
|
56
|
+
Επόμενο
|
|
57
|
+
<ArrowIcon direction="right" />
|
|
58
|
+
</Link>
|
|
59
|
+
</PaginationListItem>
|
|
60
|
+
</PaginationList>
|
|
61
|
+
</Pagination>
|
|
62
|
+
</I18NProvider>
|
|
63
|
+
</div>
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
export default WithResultsPerPage;
|
|
@@ -11,6 +11,14 @@ import Pagination from '@digigov/ui/app/Pagination';
|
|
|
11
11
|
|
|
12
12
|
<Story packageName="@digigov/ui" component="admin/Pagination" story="Default.tsx" />
|
|
13
13
|
|
|
14
|
+
## With inactive values
|
|
15
|
+
|
|
16
|
+
<Story packageName="@digigov/ui" component="admin/Pagination" story="WithInactiveValues.tsx" />
|
|
17
|
+
|
|
18
|
+
## With results per page
|
|
19
|
+
|
|
20
|
+
<Story packageName="@digigov/ui" component="admin/Pagination" story="WithResultsPerPage.tsx" />
|
|
21
|
+
|
|
14
22
|
## API
|
|
15
23
|
|
|
16
24
|
<PropTypes packageName="@digigov/ui" component="Pagination" />
|
|
@@ -30,7 +30,7 @@ export const PaginationLabel = React.forwardRef<
|
|
|
30
30
|
return (
|
|
31
31
|
<PaginationLabelContainer ref={ref}>
|
|
32
32
|
<I18nText i18nKey="pagination.label">
|
|
33
|
-
Showing <b>{start}</b> to <b>{end}</b> of <b>{total}</b> results
|
|
33
|
+
Showing <b>{start}</b> to <b>{end}</b> of <b>{total}</b> results
|
|
34
34
|
</I18nText>
|
|
35
35
|
</PaginationLabelContainer>
|
|
36
36
|
);
|
package/src/locales/el.ts
CHANGED
|
@@ -81,7 +81,7 @@ export default {
|
|
|
81
81
|
of: 'από',
|
|
82
82
|
results: 'αποτελέσματα',
|
|
83
83
|
label:
|
|
84
|
-
'Εμφανίζονται <1>{{start}}</1> έως <3>{{end}}</3> από <5>{{total}}</5>
|
|
84
|
+
'Εμφανίζονται <1>{{start}}</1> έως <3>{{end}}</3> από <5>{{total}}</5> αποτελέσματα',
|
|
85
85
|
},
|
|
86
86
|
upload: {
|
|
87
87
|
file: 'Αρχείο',
|