@1024pix/pix-ui 66.0.0 → 67.0.1
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.
|
@@ -6,7 +6,6 @@ import { inject as service } from '@ember/service';
|
|
|
6
6
|
import Component from '@glimmer/component';
|
|
7
7
|
import { tracked } from '@glimmer/tracking';
|
|
8
8
|
|
|
9
|
-
import { formatMessage } from '../translations';
|
|
10
9
|
import PixButton from './pix-button';
|
|
11
10
|
import PixIconButton from './pix-icon-button';
|
|
12
11
|
|
|
@@ -18,10 +17,24 @@ export default class PixNavigation extends Component {
|
|
|
18
17
|
super(...args);
|
|
19
18
|
this._navigationId = 'navigation-' + guidFor(this);
|
|
20
19
|
warn(
|
|
21
|
-
'PixNavigation: @
|
|
22
|
-
this.args.
|
|
20
|
+
'PixNavigation: @texts.openMenu and @texts.closeMenu are required',
|
|
21
|
+
this.args.texts?.openMenu && this.args.texts?.closeMenu,
|
|
23
22
|
{
|
|
24
|
-
id: 'pix-navigation.open-close-
|
|
23
|
+
id: 'pix-navigation.open-close-menu.required',
|
|
24
|
+
},
|
|
25
|
+
);
|
|
26
|
+
warn(
|
|
27
|
+
'PixNavigation: @texts.mainNavigation attribute is required for accessibility.',
|
|
28
|
+
this.args.texts?.mainNavigation,
|
|
29
|
+
{
|
|
30
|
+
id: 'pix-ui.stepper-component.texts.mainNavigation.required',
|
|
31
|
+
},
|
|
32
|
+
);
|
|
33
|
+
warn(
|
|
34
|
+
'PixNavigation: @texts.expandNavigation and @texts.shrinkNavigation attributes are required for accessibility.',
|
|
35
|
+
this.args.texts?.expandNavigation && this.args.texts?.shrinkNavigation,
|
|
36
|
+
{
|
|
37
|
+
id: 'pix-ui.stepper-component.texts.shrink-expand-navigation.required',
|
|
25
38
|
},
|
|
26
39
|
);
|
|
27
40
|
}
|
|
@@ -29,10 +42,6 @@ export default class PixNavigation extends Component {
|
|
|
29
42
|
@tracked
|
|
30
43
|
navigationMenuOpened = false;
|
|
31
44
|
|
|
32
|
-
formatMessage(message, values) {
|
|
33
|
-
return formatMessage(this.args.locale ?? 'fr', `pixNavigation.${message}`, values);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
45
|
@action
|
|
37
46
|
toggleNavigationMenu() {
|
|
38
47
|
this.navigationMenuOpened = !this.navigationMenuOpened;
|
|
@@ -64,11 +73,13 @@ export default class PixNavigation extends Component {
|
|
|
64
73
|
}
|
|
65
74
|
|
|
66
75
|
get shrunkNavigationAriaLabel() {
|
|
67
|
-
return this.
|
|
68
|
-
this.
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
76
|
+
return this.shrinkNavigationService.isShrunk
|
|
77
|
+
? this.args.texts.expandNavigation
|
|
78
|
+
: this.args.texts.shrinkNavigation;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
get menuLabel() {
|
|
82
|
+
return this.navigationMenuOpened ? this.args.texts.closeMenu : this.args.texts.openMenu;
|
|
72
83
|
}
|
|
73
84
|
|
|
74
85
|
get navigationId() {
|
|
@@ -104,11 +115,7 @@ export default class PixNavigation extends Component {
|
|
|
104
115
|
@triggerAction={{this.toggleNavigationMenu}}
|
|
105
116
|
>
|
|
106
117
|
<span class="screen-reader-only">
|
|
107
|
-
{{
|
|
108
|
-
{{@closeLabel}}
|
|
109
|
-
{{else}}
|
|
110
|
-
{{@openLabel}}
|
|
111
|
-
{{/if}}
|
|
118
|
+
{{this.menuLabel}}
|
|
112
119
|
</span>
|
|
113
120
|
</PixButton>
|
|
114
121
|
</div>
|
|
@@ -116,7 +123,7 @@ export default class PixNavigation extends Component {
|
|
|
116
123
|
<nav
|
|
117
124
|
class="pix-navigation__nav"
|
|
118
125
|
{{on "click" this.closeNavigation}}
|
|
119
|
-
aria-label={{@
|
|
126
|
+
aria-label={{@texts.mainNavigation}}
|
|
120
127
|
id={{this.navigationId}}
|
|
121
128
|
>
|
|
122
129
|
{{yield to="navElements"}}
|
package/addon/translations/en.js
CHANGED
package/addon/translations/es.js
CHANGED
package/addon/translations/fr.js
CHANGED
package/addon/translations/nl.js
CHANGED