@1024pix/pix-ui 64.0.0 → 66.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.
- package/addon/components/pix-checkbox.gjs +5 -10
- package/addon/components/pix-radio-button.gjs +4 -9
- package/addon/components/pix-stepper.gjs +13 -9
- package/addon/translations/en.js +0 -9
- package/addon/translations/es-419.js +0 -9
- package/addon/translations/es.js +0 -9
- package/addon/translations/fr.js +0 -10
- package/addon/translations/nl.js +0 -9
- package/package.json +1 -1
|
@@ -4,7 +4,6 @@ import { action } from '@ember/object';
|
|
|
4
4
|
import { guidFor } from '@ember/object/internals';
|
|
5
5
|
import Component from '@glimmer/component';
|
|
6
6
|
|
|
7
|
-
import { formatMessage } from '../translations';
|
|
8
7
|
import PixLabelWrapped from './pix-label-wrapped';
|
|
9
8
|
export default class PixCheckbox extends Component {
|
|
10
9
|
constructor() {
|
|
@@ -65,27 +64,23 @@ export default class PixCheckbox extends Component {
|
|
|
65
64
|
}
|
|
66
65
|
|
|
67
66
|
get stateSuccessMessage() {
|
|
68
|
-
return this.
|
|
67
|
+
return this.args.texts?.stateSuccess;
|
|
69
68
|
}
|
|
70
69
|
|
|
71
70
|
get stateErrorMessage() {
|
|
72
|
-
return this.
|
|
71
|
+
return this.args.texts?.stateError;
|
|
73
72
|
}
|
|
74
73
|
|
|
75
74
|
get stateDeclarativeMessage() {
|
|
76
|
-
return this.
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
formatMessage(message) {
|
|
80
|
-
return formatMessage(this.args.locale ?? 'fr', `input.${message}`);
|
|
75
|
+
return this.args.texts?.stateDeclarative;
|
|
81
76
|
}
|
|
82
77
|
|
|
83
78
|
<template>
|
|
84
79
|
<div class="pix-checkbox {{@class}}">
|
|
85
80
|
<PixLabelWrapped
|
|
86
81
|
@for={{this.id}}
|
|
87
|
-
@requiredLabel={{@requiredLabel}}
|
|
88
|
-
@subLabel={{@subLabel}}
|
|
82
|
+
@requiredLabel={{@text?.requiredLabel}}
|
|
83
|
+
@subLabel={{@text?.subLabel}}
|
|
89
84
|
@size={{@size}}
|
|
90
85
|
@inlineLabel={{true}}
|
|
91
86
|
@screenReaderOnly={{@screenReaderOnly}}
|
|
@@ -4,7 +4,6 @@ import { action } from '@ember/object';
|
|
|
4
4
|
import { guidFor } from '@ember/object/internals';
|
|
5
5
|
import Component from '@glimmer/component';
|
|
6
6
|
|
|
7
|
-
import { formatMessage } from '../translations';
|
|
8
7
|
import PixLabelWrapped from './pix-label-wrapped';
|
|
9
8
|
|
|
10
9
|
export default class PixRadioButton extends Component {
|
|
@@ -53,15 +52,11 @@ export default class PixRadioButton extends Component {
|
|
|
53
52
|
}
|
|
54
53
|
|
|
55
54
|
get stateSuccessMessage() {
|
|
56
|
-
return this.
|
|
55
|
+
return this.args.texts?.stateSuccess;
|
|
57
56
|
}
|
|
58
57
|
|
|
59
58
|
get stateErrorMessage() {
|
|
60
|
-
return this.
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
formatMessage(message) {
|
|
64
|
-
return formatMessage('fr', `input.${message}`);
|
|
59
|
+
return this.args.texts?.stateError;
|
|
65
60
|
}
|
|
66
61
|
|
|
67
62
|
@action
|
|
@@ -75,8 +70,8 @@ export default class PixRadioButton extends Component {
|
|
|
75
70
|
<div class="pix-radio-button {{@class}}">
|
|
76
71
|
<PixLabelWrapped
|
|
77
72
|
@for={{this.id}}
|
|
78
|
-
@requiredLabel={{@requiredLabel}}
|
|
79
|
-
@subLabel={{@subLabel}}
|
|
73
|
+
@requiredLabel={{@text?.requiredLabel}}
|
|
74
|
+
@subLabel={{@text?.subLabel}}
|
|
80
75
|
@size={{@size}}
|
|
81
76
|
@screenReaderOnly={{@screenReaderOnly}}
|
|
82
77
|
@isDisabled={{this.isDisabled}}
|
|
@@ -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
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
input: {
|
|
3
|
-
state: {
|
|
4
|
-
success: 'Correct selection',
|
|
5
|
-
error: 'Incorrect selection',
|
|
6
|
-
},
|
|
7
|
-
},
|
|
8
2
|
select: {
|
|
9
3
|
search: 'Search',
|
|
10
4
|
},
|
|
11
|
-
stepper: {
|
|
12
|
-
ariaLabel: 'Step {current, number} of {total, number}',
|
|
13
|
-
},
|
|
14
5
|
pixNavigation: {
|
|
15
6
|
shrinkNavigationAriaLabel: 'Reduce the width of the navigation menu',
|
|
16
7
|
expandNavigationAriaLabel: 'Return to the initial width of the navigation menu',
|
package/addon/translations/es.js
CHANGED
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
input: {
|
|
3
|
-
state: {
|
|
4
|
-
success: 'Selección correcta',
|
|
5
|
-
error: 'Selección incorrecta',
|
|
6
|
-
},
|
|
7
|
-
},
|
|
8
2
|
select: {
|
|
9
3
|
search: 'Buscar',
|
|
10
4
|
},
|
|
11
|
-
stepper: {
|
|
12
|
-
ariaLabel: 'Paso {current, number} de {total, number}',
|
|
13
|
-
},
|
|
14
5
|
pixNavigation: {
|
|
15
6
|
shrinkNavigationAriaLabel: 'Reducir el ancho del menú de navegación',
|
|
16
7
|
expandNavigationAriaLabel: 'Volver al ancho inicial del menú de navegación',
|
package/addon/translations/fr.js
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
input: {
|
|
3
|
-
state: {
|
|
4
|
-
success: 'Sélection correcte',
|
|
5
|
-
error: 'Sélection incorrecte',
|
|
6
|
-
declarative: 'Sélection sans bonne ou mauvaise réponse',
|
|
7
|
-
},
|
|
8
|
-
},
|
|
9
2
|
select: {
|
|
10
3
|
search: 'Rechercher',
|
|
11
4
|
},
|
|
@@ -13,7 +6,4 @@ export default {
|
|
|
13
6
|
shrinkNavigationAriaLabel: 'Réduire la largeur du menu de navigation',
|
|
14
7
|
expandNavigationAriaLabel: 'Revenir à la largeur initiale du menu de navigation',
|
|
15
8
|
},
|
|
16
|
-
stepper: {
|
|
17
|
-
ariaLabel: 'Étape {current, number} sur {total, number}',
|
|
18
|
-
},
|
|
19
9
|
};
|
package/addon/translations/nl.js
CHANGED
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
input: {
|
|
3
|
-
state: {
|
|
4
|
-
success: 'Correcte selectie',
|
|
5
|
-
error: 'Onjuiste selectie',
|
|
6
|
-
},
|
|
7
|
-
},
|
|
8
2
|
select: {
|
|
9
3
|
search: 'Zoeken',
|
|
10
4
|
},
|
|
11
|
-
stepper: {
|
|
12
|
-
ariaLabel: 'Stap {current, number} van {total, number}',
|
|
13
|
-
},
|
|
14
5
|
pixNavigation: {
|
|
15
6
|
shrinkNavigationAriaLabel: 'De breedte van het navigatiemenu verkleinen',
|
|
16
7
|
expandNavigationAriaLabel: 'Terug naar de oorspronkelijke breedte van het navigatiemenu',
|