@1024pix/pix-ui 13.2.0 → 13.3.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 +18 -0
- package/addon/components/pix-dropdown.hbs +26 -9
- package/addon/styles/_form.scss +7 -0
- package/addon/styles/_pix-dropdown.scss +11 -3
- package/addon/styles/_pix-modal.scss +3 -4
- package/addon/styles/_reset-css.scss +0 -6
- package/app/stories/pix-dropdown.stories.js +11 -0
- package/app/stories/pix-dropdown.stories.mdx +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Pix-UI Changelog
|
|
2
2
|
|
|
3
|
+
## v13.3.2 (23/02/2022)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### :bug: Bug fix
|
|
7
|
+
- [#202](https://github.com/1024pix/pix-ui/pull/202) [BUGFIX] Corriger l'alignement dans le header de la Pix Modal.
|
|
8
|
+
|
|
9
|
+
## v13.3.1 (22/02/2022)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### :bug: Bug fix
|
|
13
|
+
- [#201](https://github.com/1024pix/pix-ui/pull/201) [BUGFIX] Corriger la couleur de la sélection et l'erreur d'accessibilité.
|
|
14
|
+
|
|
15
|
+
## v13.3.0 (21/02/2022)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### :rocket: Enhancement
|
|
19
|
+
- [#199](https://github.com/1024pix/pix-ui/pull/199) [FEATURE] Permettre de rendre obligatoire le PixDropdown
|
|
20
|
+
|
|
3
21
|
## v13.2.0 (17/02/2022)
|
|
4
22
|
|
|
5
23
|
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
<div class="pix-dropdown">
|
|
2
|
+
|
|
2
3
|
{{#if this.label}}
|
|
3
|
-
<label id={{@id}} class="pix-dropdown__label">
|
|
4
|
+
<label id={{@id}} class="pix-dropdown__label">
|
|
5
|
+
{{#if @requiredLabel}}
|
|
6
|
+
<abbr title={{@requiredLabel}} class="mandatory-mark" aria-hidden="true">*</abbr>
|
|
7
|
+
{{/if}}
|
|
8
|
+
{{this.label}}
|
|
9
|
+
</label>
|
|
4
10
|
{{/if}}
|
|
11
|
+
|
|
5
12
|
<div class="pix-dropdown__controller">
|
|
6
13
|
<button
|
|
7
14
|
type="button"
|
|
@@ -9,30 +16,37 @@
|
|
|
9
16
|
aria-label={{if this.isExpanded @collapseLabel @expandLabel}}
|
|
10
17
|
{{on "click" this.toggleDropdown}}
|
|
11
18
|
{{on "keyup" this.navigateThroughOptions}}
|
|
19
|
+
...attributes
|
|
12
20
|
>
|
|
13
21
|
<p
|
|
14
22
|
title={{this.placeholder}}
|
|
15
|
-
class="pix-dropdown__controller--placeholder-text
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}}"
|
|
23
|
+
class="pix-dropdown__controller--placeholder-text
|
|
24
|
+
{{unless this.hasSelectedOption ' default'}}"
|
|
25
|
+
aria-required={{if this.requiredLabel true false}}
|
|
19
26
|
>{{this.placeholder}}</p>
|
|
20
27
|
</button>
|
|
28
|
+
|
|
21
29
|
{{#if this.hasSelectedOption}}
|
|
22
30
|
<button
|
|
23
31
|
type="button"
|
|
24
32
|
class="pix-dropdown__controller--clear"
|
|
25
|
-
{{on "click" this.clearSelection}}
|
|
26
33
|
aria-label={{@clearLabel}}
|
|
34
|
+
{{on "click" this.clearSelection}}
|
|
27
35
|
>
|
|
28
36
|
<FaIcon @icon="times" />
|
|
29
37
|
</button>
|
|
30
38
|
{{/if}}
|
|
31
|
-
|
|
39
|
+
|
|
40
|
+
<div
|
|
41
|
+
role="button"
|
|
42
|
+
tabindex="-1"
|
|
32
43
|
class="pix-dropdown__controller--chevron"
|
|
33
|
-
|
|
34
|
-
|
|
44
|
+
{{on "click" this.toggleDropdown}}
|
|
45
|
+
>
|
|
46
|
+
<FaIcon @icon={{if this.isExpanded "chevron-up" "chevron-down"}} />
|
|
47
|
+
</div>
|
|
35
48
|
</div>
|
|
49
|
+
|
|
36
50
|
<div
|
|
37
51
|
role="listbox"
|
|
38
52
|
id={{this.menuId}}
|
|
@@ -45,6 +59,7 @@
|
|
|
45
59
|
{{on "keyup" this.navigateThroughOptions}}
|
|
46
60
|
{{on "scroll" this.incrementPage}}
|
|
47
61
|
>
|
|
62
|
+
|
|
48
63
|
{{#if @isSearchable}}
|
|
49
64
|
<div class="pix-dropdown__menu--search">
|
|
50
65
|
<FaIcon class="pix-dropdown__menu--search-icon" @icon="search" />
|
|
@@ -62,6 +77,7 @@
|
|
|
62
77
|
/>
|
|
63
78
|
</div>
|
|
64
79
|
{{/if}}
|
|
80
|
+
|
|
65
81
|
{{#each this.options as |opt index|}}
|
|
66
82
|
{{#if (lt index this.showLimit)}}
|
|
67
83
|
<div
|
|
@@ -82,4 +98,5 @@
|
|
|
82
98
|
{{/if}}
|
|
83
99
|
{{/each}}
|
|
84
100
|
</div>
|
|
101
|
+
|
|
85
102
|
</div>
|
package/addon/styles/_form.scss
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
position: relative;
|
|
5
5
|
|
|
6
6
|
button {
|
|
7
|
-
background: transparent;
|
|
8
7
|
margin: 0;
|
|
9
8
|
text-align: left;
|
|
10
9
|
cursor: pointer;
|
|
@@ -27,7 +26,7 @@
|
|
|
27
26
|
border: 1px solid $grey-40;
|
|
28
27
|
border-radius: $spacing-xxs;
|
|
29
28
|
padding: 0;
|
|
30
|
-
background: white;
|
|
29
|
+
background: $white;
|
|
31
30
|
|
|
32
31
|
&.expanded {
|
|
33
32
|
border-bottom-left-radius: 0;
|
|
@@ -36,6 +35,7 @@
|
|
|
36
35
|
}
|
|
37
36
|
|
|
38
37
|
&--placeholder-text {
|
|
38
|
+
color: $grey-90;
|
|
39
39
|
margin: 0;
|
|
40
40
|
font-size: 0.875rem;
|
|
41
41
|
overflow: hidden;
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
&--clear {
|
|
53
|
+
background: transparent;
|
|
53
54
|
font-size: 1rem;
|
|
54
55
|
color: $grey-50;
|
|
55
56
|
position: absolute;
|
|
@@ -66,11 +67,18 @@
|
|
|
66
67
|
}
|
|
67
68
|
|
|
68
69
|
&--chevron {
|
|
70
|
+
background: transparent;
|
|
71
|
+
border: none;
|
|
72
|
+
padding: 0;
|
|
69
73
|
position: absolute;
|
|
70
|
-
z-index: -1;
|
|
71
74
|
top: 9px;
|
|
72
75
|
right: 12px;
|
|
73
76
|
color: $grey-50;
|
|
77
|
+
cursor: pointer;
|
|
78
|
+
|
|
79
|
+
&:hover {
|
|
80
|
+
color: $grey-70;
|
|
81
|
+
}
|
|
74
82
|
}
|
|
75
83
|
}
|
|
76
84
|
|
|
@@ -27,14 +27,13 @@ $button-margin: 16px;
|
|
|
27
27
|
border-top-left-radius: 4px;
|
|
28
28
|
border-top-right-radius: 4px;
|
|
29
29
|
padding: $modal-padding;
|
|
30
|
-
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
justify-content: space-between;
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
&__close-button {
|
|
34
36
|
flex-shrink: 0;
|
|
35
|
-
right: $modal-padding;
|
|
36
|
-
position: absolute;
|
|
37
|
-
top: $modal-padding;
|
|
38
37
|
|
|
39
38
|
@include device-is('tablet') {
|
|
40
39
|
height: $tablet-close-button-size;
|
|
@@ -18,6 +18,7 @@ export const Template = (args) => {
|
|
|
18
18
|
@expandLabel={{expandLabel}}
|
|
19
19
|
@collapseLabel={{collapseLabel}}
|
|
20
20
|
@pageSize={{pageSize}}
|
|
21
|
+
@requiredLabel={{requiredLabel}}
|
|
21
22
|
/>
|
|
22
23
|
</div>
|
|
23
24
|
`,
|
|
@@ -54,6 +55,7 @@ withLabel.args = {
|
|
|
54
55
|
...Default.args,
|
|
55
56
|
id: 'dropdown-with-label',
|
|
56
57
|
label: 'Ton fruit préféré: ',
|
|
58
|
+
requiredLabel: 'Champ requis',
|
|
57
59
|
};
|
|
58
60
|
|
|
59
61
|
export const searchableDropdown = Template.bind({});
|
|
@@ -137,6 +139,15 @@ export const argTypes = {
|
|
|
137
139
|
type: { summary: 'string' },
|
|
138
140
|
},
|
|
139
141
|
},
|
|
142
|
+
requiredLabel: {
|
|
143
|
+
name: 'requiredLabel',
|
|
144
|
+
description:
|
|
145
|
+
'Label indiquant que le champ est requis, le paramètre @label devient obligatoire avec ce paramètre.',
|
|
146
|
+
type: { name: 'string', required: false },
|
|
147
|
+
table: {
|
|
148
|
+
type: { summary: 'string' },
|
|
149
|
+
},
|
|
150
|
+
},
|
|
140
151
|
id: {
|
|
141
152
|
name: 'id',
|
|
142
153
|
description: "L'id du label",
|
|
@@ -57,6 +57,7 @@ Les options sont représentées par un tableau d'objet contenant les propriété
|
|
|
57
57
|
@placeholder="Choisissez une option"
|
|
58
58
|
@searchPlaceholder="Rechercher"
|
|
59
59
|
@label="Mon menu déroulant"
|
|
60
|
+
@requiredLabel="Requis"
|
|
60
61
|
@clearLabel="Supprimer la sélection"
|
|
61
62
|
@expandLabel="Ouvrir le menu déroulant"
|
|
62
63
|
@collapseLabel="Réduire le menu déroulant"
|