@1024pix/pix-ui 13.4.0 → 13.4.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/CHANGELOG.md +12 -0
- package/addon/components/pix-pagination.hbs +4 -2
- package/addon/components/pix-pagination.js +5 -0
- package/addon/styles/_pix-pagination.scss +19 -9
- package/app/stories/pix-pagination.stories.js +24 -0
- package/app/stories/pix-pagination.stories.mdx +6 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Pix-UI Changelog
|
|
2
2
|
|
|
3
|
+
## v13.4.2 (07/04/2022)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### :building_construction: Tech
|
|
7
|
+
- [#208](https://github.com/1024pix/pix-ui/pull/208) [TECH] Suppression de la margin dans Pix-Pagination (PIX-4733)
|
|
8
|
+
|
|
9
|
+
## v13.4.1 (05/04/2022)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### :rocket: Amélioration
|
|
13
|
+
- [#207](https://github.com/1024pix/pix-ui/pull/207) [FEATURE] Permettre à pix-pagination d'avoir une version condensée (PIX-4715)
|
|
14
|
+
|
|
3
15
|
## v13.4.0 (25/03/2022)
|
|
4
16
|
|
|
5
17
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<footer class=
|
|
1
|
+
<footer class={{this.isCondensed}}>
|
|
2
2
|
<section class="pix-pagination__size">
|
|
3
3
|
<span class="pagination-size__label">{{this.beforeResultsPerPage}}</span>
|
|
4
4
|
<PixSelect
|
|
@@ -17,8 +17,9 @@
|
|
|
17
17
|
{{this.pageInfo}}
|
|
18
18
|
{{/if}}
|
|
19
19
|
</span>
|
|
20
|
-
<div class="pix-
|
|
20
|
+
<div class="pix-pagination-navigation__action">
|
|
21
21
|
<PixIconButton
|
|
22
|
+
class="pix-pagination-navigation__action-button"
|
|
22
23
|
@icon="arrow-left"
|
|
23
24
|
aria-label={{this.previousPageLabel}}
|
|
24
25
|
@triggerAction={{this.goToPreviousPage}}
|
|
@@ -32,6 +33,7 @@
|
|
|
32
33
|
{{this.pageNumber}}
|
|
33
34
|
</span>
|
|
34
35
|
<PixIconButton
|
|
36
|
+
class="pix-pagination-navigation__action-button"
|
|
35
37
|
@icon="arrow-right"
|
|
36
38
|
aria-label={{this.nextPageLabel}}
|
|
37
39
|
@triggerAction={{this.goToNextPage}}
|
|
@@ -9,9 +9,14 @@ const DEFAULT_PAGE_OPTIONS = [
|
|
|
9
9
|
{ label: '50', value: 50 },
|
|
10
10
|
{ label: '100', value: 100 },
|
|
11
11
|
];
|
|
12
|
+
|
|
12
13
|
export default class PixPagination extends Component {
|
|
13
14
|
@service router;
|
|
14
15
|
|
|
16
|
+
get isCondensed() {
|
|
17
|
+
return this.args.isCondensed ? 'pix-pagination-condensed' : 'pix-pagination';
|
|
18
|
+
}
|
|
19
|
+
|
|
15
20
|
get beforeResultsPerPage() {
|
|
16
21
|
return this.formatMessage('beforeResultsPerPage');
|
|
17
22
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
.pix-pagination{
|
|
1
|
+
.pix-pagination, .pix-pagination-condensed {
|
|
2
2
|
display: flex;
|
|
3
3
|
justify-content: center;
|
|
4
|
-
margin: 16px 0;
|
|
5
4
|
color: $grey-60;
|
|
6
5
|
font-size: 0.875rem;
|
|
6
|
+
|
|
7
7
|
&__size {
|
|
8
8
|
display: none;
|
|
9
9
|
align-items: center;
|
|
@@ -21,15 +21,22 @@
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
&__navigation{
|
|
24
|
+
&__navigation {
|
|
25
25
|
display: flex;
|
|
26
26
|
align-items: center;
|
|
27
27
|
padding: 0;
|
|
28
28
|
gap: 12px;
|
|
29
29
|
flex-direction: column-reverse;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.pix-pagination-navigation {
|
|
34
|
+
&__action {
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
|
|
38
|
+
&-button {
|
|
39
|
+
margin: 0 8px;
|
|
33
40
|
}
|
|
34
41
|
}
|
|
35
42
|
}
|
|
@@ -37,12 +44,15 @@
|
|
|
37
44
|
@include device-is('tablet') {
|
|
38
45
|
.pix-pagination {
|
|
39
46
|
justify-content: space-between;
|
|
40
|
-
|
|
47
|
+
}
|
|
48
|
+
.pix-pagination > .pix-pagination {
|
|
49
|
+
&__size {
|
|
41
50
|
display: flex;
|
|
42
51
|
}
|
|
43
|
-
|
|
52
|
+
|
|
53
|
+
&__navigation {
|
|
44
54
|
gap: initial;
|
|
45
|
-
flex-direction:initial
|
|
55
|
+
flex-direction: initial;
|
|
46
56
|
}
|
|
47
57
|
}
|
|
48
58
|
}
|
|
@@ -7,6 +7,7 @@ export const Template = (args) => {
|
|
|
7
7
|
@pagination={{pagination}}
|
|
8
8
|
@locale = {{locale}}
|
|
9
9
|
@pageOptions= {{pageOptions}}
|
|
10
|
+
@isCondensed= {{isCondensed}}
|
|
10
11
|
/>
|
|
11
12
|
`,
|
|
12
13
|
context: args,
|
|
@@ -52,6 +53,18 @@ OnePage.args = {
|
|
|
52
53
|
locale: 'fr',
|
|
53
54
|
};
|
|
54
55
|
|
|
56
|
+
export const Condensed = Template.bind({});
|
|
57
|
+
Condensed.args = {
|
|
58
|
+
pagination: {
|
|
59
|
+
page: 1,
|
|
60
|
+
pageSize: 10,
|
|
61
|
+
rowCount: 2,
|
|
62
|
+
pageCount: 1,
|
|
63
|
+
},
|
|
64
|
+
locale: 'fr',
|
|
65
|
+
isCondensed: true,
|
|
66
|
+
};
|
|
67
|
+
|
|
55
68
|
// select attribute data type from https://storybook.js.org/docs/react/essentials/controls
|
|
56
69
|
export const argTypes = {
|
|
57
70
|
pagination: {
|
|
@@ -119,4 +132,15 @@ export const argTypes = {
|
|
|
119
132
|
defaultValue: { summary: 'fr' },
|
|
120
133
|
},
|
|
121
134
|
},
|
|
135
|
+
isCondensed: {
|
|
136
|
+
name: 'isCondensed',
|
|
137
|
+
description:
|
|
138
|
+
"En desktop, retire le contrôle du nombre d'élèments par page pour simplifier l'usage",
|
|
139
|
+
type: { name: 'boolean', required: false },
|
|
140
|
+
control: { type: 'boolean' },
|
|
141
|
+
table: {
|
|
142
|
+
type: { summary: 'boolean' },
|
|
143
|
+
defaultValue: { summary: 'false' },
|
|
144
|
+
},
|
|
145
|
+
},
|
|
122
146
|
};
|
|
@@ -44,6 +44,11 @@ Sur mobile, le select qui permet de choisir le nombre d'élément à afficher su
|
|
|
44
44
|
<Story name='OnePage' story={stories.OnePage} height={110} />
|
|
45
45
|
</Canvas>
|
|
46
46
|
|
|
47
|
+
## Version condensée
|
|
48
|
+
<Canvas>
|
|
49
|
+
<Story name='Condensed' story={stories.Condensed} height={140} />
|
|
50
|
+
</Canvas>
|
|
51
|
+
|
|
47
52
|
## Usage
|
|
48
53
|
|
|
49
54
|
```html
|
|
@@ -51,6 +56,7 @@ Sur mobile, le select qui permet de choisir le nombre d'élément à afficher su
|
|
|
51
56
|
@pagination={{pagination}}
|
|
52
57
|
@locale = {{locale}}
|
|
53
58
|
@pageOptions = {{pageOptions}
|
|
59
|
+
@isCondensed = {{isCondensed}
|
|
54
60
|
/>
|
|
55
61
|
```
|
|
56
62
|
|