@1024pix/pix-ui 64.0.0 → 65.0.0
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.
|
@@ -1,10 +1,21 @@
|
|
|
1
|
+
import { warn } from '@ember/debug';
|
|
1
2
|
import Component from '@glimmer/component';
|
|
2
3
|
import { eq } from 'ember-truth-helpers';
|
|
3
4
|
|
|
4
|
-
import { formatMessage } from '../translations';
|
|
5
5
|
import PixStep from './pix-step';
|
|
6
6
|
|
|
7
7
|
export default class PixStepperComponent extends Component {
|
|
8
|
+
constructor(...args) {
|
|
9
|
+
super(...args);
|
|
10
|
+
warn(
|
|
11
|
+
'PixStepper: @texts attribute is mandatory for accessibility.',
|
|
12
|
+
Boolean(this.args.texts?.ariaLabel),
|
|
13
|
+
{
|
|
14
|
+
id: 'pix-ui.stepper-component.texts.mandatory',
|
|
15
|
+
},
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
|
|
8
19
|
get cssClass() {
|
|
9
20
|
const classes = ['pix-stepper'];
|
|
10
21
|
|
|
@@ -19,15 +30,8 @@ export default class PixStepperComponent extends Component {
|
|
|
19
30
|
return this.args.currentStep - 1;
|
|
20
31
|
}
|
|
21
32
|
|
|
22
|
-
get ariaLabel() {
|
|
23
|
-
return formatMessage(this.args.locale ?? 'fr', 'stepper.ariaLabel', {
|
|
24
|
-
current: this.args.currentStep,
|
|
25
|
-
total: this.args.steps.length,
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
|
|
29
33
|
<template>
|
|
30
|
-
<ol class={{this.cssClass}} role="list" aria-label={{
|
|
34
|
+
<ol class={{this.cssClass}} role="list" ...attributes aria-label={{@texts.ariaLabel}}>
|
|
31
35
|
{{#each @steps as |step index|}}
|
|
32
36
|
<PixStep
|
|
33
37
|
@index={{index}}
|
package/addon/translations/en.js
CHANGED
|
@@ -8,9 +8,6 @@ export default {
|
|
|
8
8
|
select: {
|
|
9
9
|
search: 'Search',
|
|
10
10
|
},
|
|
11
|
-
stepper: {
|
|
12
|
-
ariaLabel: 'Step {current, number} of {total, number}',
|
|
13
|
-
},
|
|
14
11
|
pixNavigation: {
|
|
15
12
|
shrinkNavigationAriaLabel: 'Reduce the width of the navigation menu',
|
|
16
13
|
expandNavigationAriaLabel: 'Return to the initial width of the navigation menu',
|
package/addon/translations/es.js
CHANGED
|
@@ -8,9 +8,6 @@ export default {
|
|
|
8
8
|
select: {
|
|
9
9
|
search: 'Buscar',
|
|
10
10
|
},
|
|
11
|
-
stepper: {
|
|
12
|
-
ariaLabel: 'Paso {current, number} de {total, number}',
|
|
13
|
-
},
|
|
14
11
|
pixNavigation: {
|
|
15
12
|
shrinkNavigationAriaLabel: 'Reducir el ancho del menú de navegación',
|
|
16
13
|
expandNavigationAriaLabel: 'Volver al ancho inicial del menú de navegación',
|
package/addon/translations/fr.js
CHANGED
|
@@ -13,7 +13,4 @@ export default {
|
|
|
13
13
|
shrinkNavigationAriaLabel: 'Réduire la largeur du menu de navigation',
|
|
14
14
|
expandNavigationAriaLabel: 'Revenir à la largeur initiale du menu de navigation',
|
|
15
15
|
},
|
|
16
|
-
stepper: {
|
|
17
|
-
ariaLabel: 'Étape {current, number} sur {total, number}',
|
|
18
|
-
},
|
|
19
16
|
};
|
package/addon/translations/nl.js
CHANGED
|
@@ -8,9 +8,6 @@ export default {
|
|
|
8
8
|
select: {
|
|
9
9
|
search: 'Zoeken',
|
|
10
10
|
},
|
|
11
|
-
stepper: {
|
|
12
|
-
ariaLabel: 'Stap {current, number} van {total, number}',
|
|
13
|
-
},
|
|
14
11
|
pixNavigation: {
|
|
15
12
|
shrinkNavigationAriaLabel: 'De breedte van het navigatiemenu verkleinen',
|
|
16
13
|
expandNavigationAriaLabel: 'Terug naar de oorspronkelijke breedte van het navigatiemenu',
|