@1024pix/pix-ui 46.13.0 → 46.13.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/package.json +6 -6
- package/app/stories/form.mdx +0 -11
- package/app/stories/form.stories.js +0 -142
- package/app/stories/pix-background-header.mdx +0 -29
- package/app/stories/pix-background-header.stories.js +0 -33
- package/app/stories/pix-banner.mdx +0 -86
- package/app/stories/pix-banner.stories.js +0 -112
- package/app/stories/pix-block.mdx +0 -32
- package/app/stories/pix-block.stories.js +0 -22
- package/app/stories/pix-button-link.mdx +0 -39
- package/app/stories/pix-button-link.stories.js +0 -114
- package/app/stories/pix-button-upload.mdx +0 -26
- package/app/stories/pix-button-upload.stories.js +0 -81
- package/app/stories/pix-button.mdx +0 -79
- package/app/stories/pix-button.stories.js +0 -270
- package/app/stories/pix-checkbox-variant-tile.mdx +0 -49
- package/app/stories/pix-checkbox-variant-tile.stories.js +0 -102
- package/app/stories/pix-checkbox.mdx +0 -75
- package/app/stories/pix-checkbox.stories.js +0 -220
- package/app/stories/pix-collapsible.mdx +0 -37
- package/app/stories/pix-collapsible.stories.js +0 -104
- package/app/stories/pix-filter-banner.mdx +0 -26
- package/app/stories/pix-filter-banner.stories.js +0 -87
- package/app/stories/pix-filterable-and-searchable-select.mdx +0 -62
- package/app/stories/pix-filterable-and-searchable-select.stories.js +0 -202
- package/app/stories/pix-icon-button.mdx +0 -84
- package/app/stories/pix-icon-button.stories.js +0 -108
- package/app/stories/pix-icon.mdx +0 -20
- package/app/stories/pix-icon.stories.js +0 -51
- package/app/stories/pix-indicator-card.mdx +0 -41
- package/app/stories/pix-indicator-card.stories.js +0 -78
- package/app/stories/pix-input-code.mdx +0 -33
- package/app/stories/pix-input-code.stories.js +0 -75
- package/app/stories/pix-input-password.mdx +0 -76
- package/app/stories/pix-input-password.stories.js +0 -145
- package/app/stories/pix-input.mdx +0 -104
- package/app/stories/pix-input.stories.js +0 -175
- package/app/stories/pix-label.mdx +0 -47
- package/app/stories/pix-label.stories.js +0 -112
- package/app/stories/pix-message.mdx +0 -54
- package/app/stories/pix-message.stories.js +0 -61
- package/app/stories/pix-modal.mdx +0 -53
- package/app/stories/pix-modal.stories.js +0 -73
- package/app/stories/pix-multi-select.mdx +0 -55
- package/app/stories/pix-multi-select.stories.js +0 -290
- package/app/stories/pix-pagination.mdx +0 -56
- package/app/stories/pix-pagination.stories.js +0 -148
- package/app/stories/pix-progress-gauge.mdx +0 -40
- package/app/stories/pix-progress-gauge.stories.js +0 -117
- package/app/stories/pix-radio-button-variant-tile.mdx +0 -46
- package/app/stories/pix-radio-button-variant-tile.stories.js +0 -92
- package/app/stories/pix-radio-button.mdx +0 -59
- package/app/stories/pix-radio-button.stories.js +0 -165
- package/app/stories/pix-return-to.mdx +0 -34
- package/app/stories/pix-return-to.stories.js +0 -41
- package/app/stories/pix-search-input.mdx +0 -41
- package/app/stories/pix-search-input.stories.js +0 -117
- package/app/stories/pix-select.mdx +0 -80
- package/app/stories/pix-select.stories.js +0 -445
- package/app/stories/pix-selectable-tag.mdx +0 -37
- package/app/stories/pix-selectable-tag.stories.js +0 -69
- package/app/stories/pix-sidebar.mdx +0 -49
- package/app/stories/pix-sidebar.stories.js +0 -74
- package/app/stories/pix-stars.mdx +0 -22
- package/app/stories/pix-stars.stories.js +0 -45
- package/app/stories/pix-tag.mdx +0 -26
- package/app/stories/pix-tag.stories.js +0 -25
- package/app/stories/pix-textarea.mdx +0 -50
- package/app/stories/pix-textarea.stories.js +0 -146
- package/app/stories/pix-toggle.mdx +0 -28
- package/app/stories/pix-toggle.stories.js +0 -134
- package/app/stories/pix-tooltip.mdx +0 -183
- package/app/stories/pix-tooltip.stories.js +0 -215
- package/app/styles/app.scss +0 -0
- package/scripts/migrate-colors-scss-vars-to-css-vars.sh +0 -120
- package/scripts/migrate-spacing-scss-vars-to-css-vars.sh +0 -23
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { hbs } from 'ember-cli-htmlbars';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Notification/Message',
|
|
5
|
-
render: (args) => ({
|
|
6
|
-
template: hbs`<PixMessage @type={{this.type}} @withIcon={{this.withIcon}}>
|
|
7
|
-
Ceci est un message
|
|
8
|
-
{{this.type}}
|
|
9
|
-
avec un texte tellement long qu'il est nécessaire
|
|
10
|
-
<br />
|
|
11
|
-
de l'afficher sur deux lignes.
|
|
12
|
-
</PixMessage>`,
|
|
13
|
-
context: args,
|
|
14
|
-
}),
|
|
15
|
-
argTypes: {
|
|
16
|
-
type: {
|
|
17
|
-
name: 'type',
|
|
18
|
-
description: 'Type du message',
|
|
19
|
-
type: { name: 'string', required: false },
|
|
20
|
-
table: { defaultValue: { summary: 'info' } },
|
|
21
|
-
control: { type: 'select' },
|
|
22
|
-
options: ['info', 'success', 'warning', 'alert', 'error'],
|
|
23
|
-
},
|
|
24
|
-
withIcon: {
|
|
25
|
-
name: 'withIcon',
|
|
26
|
-
description: 'Icône du message',
|
|
27
|
-
table: { defaultValue: { summary: false } },
|
|
28
|
-
type: { name: 'boolean', required: false },
|
|
29
|
-
control: { type: 'boolean' },
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export const Default = {};
|
|
35
|
-
|
|
36
|
-
export const error = {
|
|
37
|
-
args: {
|
|
38
|
-
type: 'error',
|
|
39
|
-
withIcon: true,
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export const warning = {
|
|
44
|
-
args: {
|
|
45
|
-
type: 'warning',
|
|
46
|
-
withIcon: true,
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export const success = {
|
|
51
|
-
args: {
|
|
52
|
-
type: 'success',
|
|
53
|
-
withIcon: true,
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export const withIcon = {
|
|
58
|
-
args: {
|
|
59
|
-
withIcon: true,
|
|
60
|
-
},
|
|
61
|
-
};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { Meta, Story, ArgTypes } from '@storybook/blocks';
|
|
2
|
-
|
|
3
|
-
import * as ComponentStories from './pix-modal.stories.js';
|
|
4
|
-
|
|
5
|
-
<Meta of={ComponentStories} />
|
|
6
|
-
|
|
7
|
-
# PixModal
|
|
8
|
-
|
|
9
|
-
Une fenêtre modale responsive et scrollable avec un overlay.
|
|
10
|
-
|
|
11
|
-
Ce composant possède deux `yield` :
|
|
12
|
-
|
|
13
|
-
- `:content` est destiné à accueillir le contenu principal de la fenêtre modale. Il peut accueillir tout type de
|
|
14
|
-
contenu HTML (simple texte, image, formulaire, etc.)
|
|
15
|
-
- `:footer` peut également accueillir tout type de contenu HTML, mais est destiné aux boutons permettant d'interagir
|
|
16
|
-
avec la modale, ce qui permettra de les positionner correctement dans tous les cas de figure.
|
|
17
|
-
|
|
18
|
-
<Story of={ComponentStories.Default} height={500} />
|
|
19
|
-
|
|
20
|
-
## Usage
|
|
21
|
-
|
|
22
|
-
```html
|
|
23
|
-
<PixModal
|
|
24
|
-
@title="Qu'est-ce qu'une modale ?"
|
|
25
|
-
@showModal={{this.showModal}}
|
|
26
|
-
@onCloseButtonClick={{this.closeModal}}
|
|
27
|
-
>
|
|
28
|
-
<:content>
|
|
29
|
-
<p>
|
|
30
|
-
Une fenêtre modale est, dans une interface graphique, une fenêtre qui prend le contrôle total du clavier et
|
|
31
|
-
de l'écran. Elle est en général associée à une question à laquelle il est impératif que l'utilisateur
|
|
32
|
-
réponde avant de poursuivre, ou de modifier quoi que ce soit. La fenêtre modale a pour propos : d'obtenir
|
|
33
|
-
des informations de l'utilisateur (ces informations sont nécessaires pour réaliser une opération) ; de
|
|
34
|
-
fournir une information à l'utilisateur (ce dernier doit en prendre connaissance avant de pouvoir continuer
|
|
35
|
-
à utiliser l'application).
|
|
36
|
-
</p>
|
|
37
|
-
</:content>
|
|
38
|
-
<:footer>
|
|
39
|
-
<PixButton
|
|
40
|
-
@variant="secondary"
|
|
41
|
-
@isBorderVisible={{true}}
|
|
42
|
-
@triggerAction={{this.closeModal}}
|
|
43
|
-
>
|
|
44
|
-
Annuler
|
|
45
|
-
</PixButton>
|
|
46
|
-
<PixButton>Valider</PixButton>
|
|
47
|
-
</:footer>
|
|
48
|
-
</PixModal>
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
## Arguments
|
|
52
|
-
|
|
53
|
-
<ArgTypes />
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { hbs } from 'ember-cli-htmlbars';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Basics/Modal',
|
|
5
|
-
render: (args) => ({
|
|
6
|
-
template: hbs`<PixModal
|
|
7
|
-
@showModal={{this.showModal}}
|
|
8
|
-
@title={{this.title}}
|
|
9
|
-
@onCloseButtonClick={{fn (mut this.showModal) (not this.showModal)}}
|
|
10
|
-
>
|
|
11
|
-
<:content>
|
|
12
|
-
<p>
|
|
13
|
-
Une fenêtre modale est, dans une interface graphique, une fenêtre qui prend le contrôle total
|
|
14
|
-
du clavier et de l'écran. Elle est en général associée à une question à laquelle il est
|
|
15
|
-
impératif que l'utilisateur réponde avant de poursuivre, ou de modifier quoi que ce soit. La
|
|
16
|
-
fenêtre modale a pour propos : d'obtenir des informations de l'utilisateur (ces informations
|
|
17
|
-
sont nécessaires pour réaliser une opération) ; de fournir une information à l'utilisateur (ce
|
|
18
|
-
dernier doit en prendre connaissance avant de pouvoir continuer à utiliser l'application).
|
|
19
|
-
</p>
|
|
20
|
-
</:content>
|
|
21
|
-
<:footer>
|
|
22
|
-
{{! template-lint-disable no-inline-styles }}
|
|
23
|
-
|
|
24
|
-
<div
|
|
25
|
-
style='display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 16px; margin-bottom: 16px'
|
|
26
|
-
>
|
|
27
|
-
<PixButton
|
|
28
|
-
@variant='secondary'
|
|
29
|
-
@isBorderVisible='true'
|
|
30
|
-
@triggerAction={{fn (mut this.showModal) (not this.showModal)}}
|
|
31
|
-
>Annuler</PixButton>
|
|
32
|
-
<PixButton @triggerAction={{fn (mut this.showModal) (not this.showModal)}}>Valider</PixButton>
|
|
33
|
-
</div>
|
|
34
|
-
</:footer>
|
|
35
|
-
</PixModal>
|
|
36
|
-
{{! template-lint-disable no-inline-styles }}
|
|
37
|
-
|
|
38
|
-
<div style='display:flex; justify-content:center; align-items:center; height:105vh;'>
|
|
39
|
-
<PixButton @triggerAction={{fn (mut this.showModal) (not this.showModal)}}>Ouvrir la modale</PixButton>
|
|
40
|
-
</div>`,
|
|
41
|
-
context: args,
|
|
42
|
-
}),
|
|
43
|
-
argTypes: {
|
|
44
|
-
title: {
|
|
45
|
-
name: 'title',
|
|
46
|
-
description: 'Titre de la modale',
|
|
47
|
-
type: { name: 'string', required: true },
|
|
48
|
-
},
|
|
49
|
-
onCloseButtonClick: {
|
|
50
|
-
name: 'onCloseButtonClick',
|
|
51
|
-
description: 'Fonction à exécuter à la fermeture de la modale',
|
|
52
|
-
type: { name: 'function', required: true },
|
|
53
|
-
},
|
|
54
|
-
showModal: {
|
|
55
|
-
name: 'showModal',
|
|
56
|
-
description: "Gérer l'ouverture de la modale",
|
|
57
|
-
type: { name: 'boolean', required: true },
|
|
58
|
-
control: { type: 'boolean' },
|
|
59
|
-
table: {
|
|
60
|
-
type: { summary: 'boolean' },
|
|
61
|
-
defaultValue: { summary: false },
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
export const Default = {
|
|
68
|
-
args: {
|
|
69
|
-
showModal: true,
|
|
70
|
-
title: "Qu'est-ce qu'une modale ?",
|
|
71
|
-
onCloseButtonClick: () => {},
|
|
72
|
-
},
|
|
73
|
-
};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { Meta, Story, ArgTypes } from '@storybook/blocks';
|
|
2
|
-
import * as ComponentStories from './pix-multi-select.stories';
|
|
3
|
-
|
|
4
|
-
<Meta of={ComponentStories} />
|
|
5
|
-
|
|
6
|
-
# Pix Multi Select
|
|
7
|
-
|
|
8
|
-
Un select custom permettant une gestion de la multiselection. Permet de passer soit du texte brut soit des composants à sa liste. (PixStars etc...)
|
|
9
|
-
L'ajout de `class` et d'autres attributs sont possibles.
|
|
10
|
-
|
|
11
|
-
## Accessibilité
|
|
12
|
-
|
|
13
|
-
Si vous utilisez le `PixMultiSelect` sans vouloir afficher le label, il faudra renseigner `screenReaderOnly` à `true`.
|
|
14
|
-
|
|
15
|
-
> ⚠️ La démonstration de PixMultiSelect NE fonctionne PAS comme prévu dans storybook (mais fonctionne très bien sur les app fronts). Pour plus d'informations, voir [https://github.com/1024pix/pix-ui/pull/76](https://github.com/1024pix/pix-ui/pull/76).
|
|
16
|
-
|
|
17
|
-
## With child component
|
|
18
|
-
|
|
19
|
-
<Story of={ComponentStories.multiSelectWithChildComponent} height={310} />
|
|
20
|
-
|
|
21
|
-
## Searchable
|
|
22
|
-
|
|
23
|
-
<Story of={ComponentStories.multiSelectSearchable} height={330} />
|
|
24
|
-
|
|
25
|
-
## withCustomClass
|
|
26
|
-
|
|
27
|
-
<Story of={ComponentStories.multiSelectWithCustomClass} height={330} />
|
|
28
|
-
|
|
29
|
-
## withId
|
|
30
|
-
|
|
31
|
-
<Story of={ComponentStories.multiSelectWithId} height={330} />
|
|
32
|
-
|
|
33
|
-
<Story of={ComponentStories.multiSelectWithYield} height={330} />
|
|
34
|
-
|
|
35
|
-
## Usage
|
|
36
|
-
|
|
37
|
-
```html
|
|
38
|
-
<PixMultiSelect
|
|
39
|
-
@id="{{id}}"
|
|
40
|
-
@screenReaderOnly="{{screenReaderOnly}}"
|
|
41
|
-
@placeholder="{{placeholder}}"
|
|
42
|
-
@onChange="{{doSomething}}"
|
|
43
|
-
@values="{{values}}"
|
|
44
|
-
@emptyMessage="{{emptyMessage}}"
|
|
45
|
-
@className="{{className}}"
|
|
46
|
-
@options="{{options}}"
|
|
47
|
-
>
|
|
48
|
-
<:label>{{label}}</:label>
|
|
49
|
-
<:default as |option|>{{option.label}}</:default>
|
|
50
|
-
</PixMultiSelect>
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
## Arguments
|
|
54
|
-
|
|
55
|
-
<ArgTypes />
|
|
@@ -1,290 +0,0 @@
|
|
|
1
|
-
import { hbs } from 'ember-cli-htmlbars';
|
|
2
|
-
import { action } from '@storybook/addon-actions';
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: 'Form/Multi Select',
|
|
6
|
-
render: (args) => ({
|
|
7
|
-
template: hbs`{{! template-lint-disable no-forbidden-elements }}
|
|
8
|
-
<style>
|
|
9
|
-
.custom { border : none; }
|
|
10
|
-
</style>
|
|
11
|
-
<h4><strong>⚠️ La sélection des éléments ne fonctionne pas dans Storybook.</strong></h4>
|
|
12
|
-
{{#if this.id}}
|
|
13
|
-
<div>
|
|
14
|
-
<label for={{this.id}}>Un label en dehors du composant</label>
|
|
15
|
-
</div>
|
|
16
|
-
{{/if}}
|
|
17
|
-
<PixMultiSelect
|
|
18
|
-
@id={{this.id}}
|
|
19
|
-
@placeholder={{this.placeholder}}
|
|
20
|
-
@screenReaderOnly={{this.screenReaderOnly}}
|
|
21
|
-
@size={{this.size}}
|
|
22
|
-
@onChange={{this.onChange}}
|
|
23
|
-
@emptyMessage={{this.emptyMessage}}
|
|
24
|
-
@className={{this.className}}
|
|
25
|
-
@isSearchable={{this.isSearchable}}
|
|
26
|
-
@strictSearch={{this.strictSearch}}
|
|
27
|
-
@values={{this.values}}
|
|
28
|
-
@options={{this.options}}
|
|
29
|
-
>
|
|
30
|
-
<:label>{{this.label}}</:label>
|
|
31
|
-
<:default as |option|>{{option.label}}</:default>
|
|
32
|
-
</PixMultiSelect>`,
|
|
33
|
-
context: args,
|
|
34
|
-
}),
|
|
35
|
-
argTypes: {
|
|
36
|
-
id: {
|
|
37
|
-
name: 'id',
|
|
38
|
-
description:
|
|
39
|
-
"Permet l'accessibilité du composant attribuant des ``for`` pour chaque entité. **⚠️ L'`id` est obligatoire que si le `label` n'est pas donné. ⚠️**",
|
|
40
|
-
type: { name: 'string' },
|
|
41
|
-
},
|
|
42
|
-
placeholder: {
|
|
43
|
-
name: 'placeholder',
|
|
44
|
-
description:
|
|
45
|
-
'Rempli le contenu interne du composant, `placeholder` pour `isSearchable` `true`, sinon rawContent du `button`',
|
|
46
|
-
type: { name: 'string', required: true },
|
|
47
|
-
},
|
|
48
|
-
emptyMessage: {
|
|
49
|
-
name: 'emptyMessage',
|
|
50
|
-
description:
|
|
51
|
-
'Un intitulé de choix indisponible (dans le cas ou certains filtres seraient excluant)',
|
|
52
|
-
type: { name: 'string', required: true },
|
|
53
|
-
},
|
|
54
|
-
options: {
|
|
55
|
-
name: 'options',
|
|
56
|
-
description:
|
|
57
|
-
'Les options sont représentées par un tableau d‘objet contenant les propriétés ``value`` et ``label``. ``value`` doit être de type ``String`` pour être conforme au traitement des input value.',
|
|
58
|
-
type: { name: 'array', required: false },
|
|
59
|
-
},
|
|
60
|
-
onChange: {
|
|
61
|
-
name: 'onChange',
|
|
62
|
-
description: "Une fonction permettant d'effectuer une action à chaque sélection",
|
|
63
|
-
type: { required: true },
|
|
64
|
-
},
|
|
65
|
-
values: {
|
|
66
|
-
name: 'values',
|
|
67
|
-
description: 'Une pré-sélection peut être donnée au composant',
|
|
68
|
-
type: { name: 'array', required: false },
|
|
69
|
-
},
|
|
70
|
-
isSearchable: {
|
|
71
|
-
name: 'isSearchable',
|
|
72
|
-
description: 'Permet de rajouter une saisie utilisateur pour faciliter la recherche',
|
|
73
|
-
type: { name: 'boolean', required: false },
|
|
74
|
-
table: { defaultValue: { summary: false } },
|
|
75
|
-
},
|
|
76
|
-
strictSearch: {
|
|
77
|
-
name: 'strictSearch',
|
|
78
|
-
description:
|
|
79
|
-
'Permet de rendre sensible à la casse et au diacritiques lorsque ``isSearchable`` à ``true``',
|
|
80
|
-
type: { name: 'boolean', required: false },
|
|
81
|
-
table: { defaultValue: { summary: false } },
|
|
82
|
-
},
|
|
83
|
-
headerClassName: {
|
|
84
|
-
name: 'headerClassName',
|
|
85
|
-
description: 'Cette classe css permet de surcharger le css par défaut du composant.',
|
|
86
|
-
type: { name: 'string', required: false },
|
|
87
|
-
table: {
|
|
88
|
-
type: { summary: 'string' },
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
placement: {
|
|
92
|
-
name: 'placement',
|
|
93
|
-
description:
|
|
94
|
-
"Permet de placer la dropdown du select par rapport à son bouton. Par défaut, cela s'adapte tout seul.",
|
|
95
|
-
type: { name: 'string', required: false },
|
|
96
|
-
options: [
|
|
97
|
-
'auto',
|
|
98
|
-
'auto-start',
|
|
99
|
-
'auto-end',
|
|
100
|
-
'top',
|
|
101
|
-
'top-start',
|
|
102
|
-
'top-end',
|
|
103
|
-
'bottom',
|
|
104
|
-
'bottom-start',
|
|
105
|
-
'bottom-end',
|
|
106
|
-
'right',
|
|
107
|
-
'right-start',
|
|
108
|
-
'right-end',
|
|
109
|
-
'left',
|
|
110
|
-
'left-start',
|
|
111
|
-
'left-end',
|
|
112
|
-
],
|
|
113
|
-
control: { type: 'select' },
|
|
114
|
-
table: {
|
|
115
|
-
type: { summary: 'string' },
|
|
116
|
-
defaultValue: { summary: 'bottom-start' },
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
label: {
|
|
120
|
-
name: 'label',
|
|
121
|
-
description: 'Le label du champ',
|
|
122
|
-
type: { name: 'string', required: true },
|
|
123
|
-
table: {
|
|
124
|
-
type: { summary: 'string' },
|
|
125
|
-
},
|
|
126
|
-
},
|
|
127
|
-
subLabel: {
|
|
128
|
-
name: 'subLabel',
|
|
129
|
-
description: 'Un descriptif complétant le label',
|
|
130
|
-
type: { name: 'string', required: false },
|
|
131
|
-
},
|
|
132
|
-
requiredLabel: {
|
|
133
|
-
name: 'requiredLabel',
|
|
134
|
-
description: 'Label indiquant que le champ est requis.',
|
|
135
|
-
type: { name: 'string', required: false },
|
|
136
|
-
table: {
|
|
137
|
-
type: { summary: 'string' },
|
|
138
|
-
},
|
|
139
|
-
},
|
|
140
|
-
screenReaderOnly: {
|
|
141
|
-
name: 'screenReaderOnly',
|
|
142
|
-
description: "Permet de rendre le label lisible uniquement par les lecteurs d'écran",
|
|
143
|
-
control: { type: 'boolean' },
|
|
144
|
-
type: { name: 'boolean', required: false },
|
|
145
|
-
table: {
|
|
146
|
-
type: { summary: 'boolean' },
|
|
147
|
-
defaultValue: { summary: false },
|
|
148
|
-
},
|
|
149
|
-
},
|
|
150
|
-
size: {
|
|
151
|
-
name: 'size',
|
|
152
|
-
description: 'Correspond à la taille de la police du label.',
|
|
153
|
-
type: { name: 'string', required: false },
|
|
154
|
-
table: {
|
|
155
|
-
defaultValue: { summary: 'default' },
|
|
156
|
-
},
|
|
157
|
-
control: { type: 'select' },
|
|
158
|
-
options: ['small', 'large', 'default'],
|
|
159
|
-
},
|
|
160
|
-
inlineLabel: {
|
|
161
|
-
name: 'inlineLabel',
|
|
162
|
-
description: 'Permet de ne pas afficher la marge pour les éléments de formulaire inline',
|
|
163
|
-
type: { name: 'boolean', required: false },
|
|
164
|
-
table: {
|
|
165
|
-
defaultValue: { summary: false },
|
|
166
|
-
},
|
|
167
|
-
control: { type: 'boolean' },
|
|
168
|
-
},
|
|
169
|
-
},
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
const DEFAULT_OPTIONS = [
|
|
173
|
-
{ label: 'ANETH HERBE AROMATIQUE', value: '1' },
|
|
174
|
-
{ label: 'ANIS VERT HERBE AROMATIQUE', value: '2' },
|
|
175
|
-
{ label: 'BADIANE AROMATE', value: '3' },
|
|
176
|
-
{ label: 'BAIES ROSES EPICES', value: '4' },
|
|
177
|
-
{ label: 'BASILIC HERBE AROMATIQUE', value: '5' },
|
|
178
|
-
{ label: 'BOURRACHE OFFICINALE HERBE AROMATIQUE', value: '6' },
|
|
179
|
-
{ label: 'CANNELLE AROMATE', value: '7' },
|
|
180
|
-
{ label: 'CAPRE CONDIMENT', value: '8' },
|
|
181
|
-
{ label: 'CARDAMOME AROMATE', value: '9' },
|
|
182
|
-
{ label: 'CARVI HERBE AROMATIQUE', value: '10' },
|
|
183
|
-
{ label: 'CERFEUIL HERBE AROMATIQUE', value: '11' },
|
|
184
|
-
];
|
|
185
|
-
|
|
186
|
-
export const Default = {
|
|
187
|
-
args: {
|
|
188
|
-
label: 'Label du champ',
|
|
189
|
-
options: DEFAULT_OPTIONS,
|
|
190
|
-
onChange: action('onChange'),
|
|
191
|
-
emptyMessage: 'pas de résultat',
|
|
192
|
-
values: ['1', '3'],
|
|
193
|
-
placeholder: 'placeholder',
|
|
194
|
-
},
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
export const multiSelectWithChildComponent = (args) => {
|
|
198
|
-
return {
|
|
199
|
-
template: hbs`<h4><strong>⚠️ La sélection des éléments ne fonctionne pas dans Storybook.</strong></h4>
|
|
200
|
-
<PixMultiSelect
|
|
201
|
-
@placeholder={{this.placeholder}}
|
|
202
|
-
@onChange={{this.onChange}}
|
|
203
|
-
@emptyMessage={{this.emptyMessage}}
|
|
204
|
-
@className={{this.className}}
|
|
205
|
-
@options={{this.options}}
|
|
206
|
-
@size={{this.size}}
|
|
207
|
-
@subLabel={{this.subLabel}}
|
|
208
|
-
@inlineLabel={{this.inlineLabel}}
|
|
209
|
-
@screenReaderOnly={{this.screenReaderOnly}}
|
|
210
|
-
>
|
|
211
|
-
<:label>{{this.label}}</:label>
|
|
212
|
-
<:default as |option|>
|
|
213
|
-
<PixStars
|
|
214
|
-
@alt={{concat 'Étoiles ' option.value ' sur ' option.total}}
|
|
215
|
-
@count={{option.value}}
|
|
216
|
-
@total={{option.total}}
|
|
217
|
-
/>
|
|
218
|
-
</:default>
|
|
219
|
-
</PixMultiSelect>`,
|
|
220
|
-
context: args,
|
|
221
|
-
};
|
|
222
|
-
};
|
|
223
|
-
|
|
224
|
-
multiSelectWithChildComponent.args = {
|
|
225
|
-
...Default.args,
|
|
226
|
-
placeholder: 'Sélectionner le niveau souhaité',
|
|
227
|
-
label: 'Résultat évaluation',
|
|
228
|
-
options: [
|
|
229
|
-
{ value: '0', total: 3 },
|
|
230
|
-
{ value: '1', total: 3 },
|
|
231
|
-
{ value: '2', total: 3 },
|
|
232
|
-
{ value: '3', total: 3 },
|
|
233
|
-
],
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
export const multiSelectSearchable = {
|
|
237
|
-
args: {
|
|
238
|
-
...Default.args,
|
|
239
|
-
isSearchable: true,
|
|
240
|
-
strictSearch: true,
|
|
241
|
-
emptyMessage: 'Aucune option trouvée',
|
|
242
|
-
},
|
|
243
|
-
};
|
|
244
|
-
|
|
245
|
-
export const multiSelectWithCustomClass = {
|
|
246
|
-
args: {
|
|
247
|
-
...Default.args,
|
|
248
|
-
className: 'custom',
|
|
249
|
-
isSearchable: false,
|
|
250
|
-
},
|
|
251
|
-
};
|
|
252
|
-
|
|
253
|
-
export const multiSelectWithId = {
|
|
254
|
-
args: {
|
|
255
|
-
...Default.args,
|
|
256
|
-
label: undefined,
|
|
257
|
-
id: 'custom',
|
|
258
|
-
isSearchable: false,
|
|
259
|
-
},
|
|
260
|
-
};
|
|
261
|
-
|
|
262
|
-
const TemplateWithYield = (args) => ({
|
|
263
|
-
template: hbs`<PixMultiSelect
|
|
264
|
-
@id={{this.id}}
|
|
265
|
-
@onChange={{this.onChange}}
|
|
266
|
-
@emptyMessage={{this.emptyMessage}}
|
|
267
|
-
@className={{this.className}}
|
|
268
|
-
@isSearchable={{this.isSearchable}}
|
|
269
|
-
@strictSearch={{this.strictSearch}}
|
|
270
|
-
@values={{this.values}}
|
|
271
|
-
@options={{this.options}}
|
|
272
|
-
@size={{this.size}}
|
|
273
|
-
@subLabel={{this.subLabel}}
|
|
274
|
-
@inlineLabel={{this.inlineLabel}}
|
|
275
|
-
@requiredLabel={{this.requiredLabel}}
|
|
276
|
-
@screenReaderOnly={{this.screenReaderOnly}}
|
|
277
|
-
>
|
|
278
|
-
<:label>{{this.label}}</:label>
|
|
279
|
-
<:placeholder>filtres (2)</:placeholder>
|
|
280
|
-
<:default as |option|>{{option.label}}</:default>
|
|
281
|
-
</PixMultiSelect>`,
|
|
282
|
-
context: args,
|
|
283
|
-
});
|
|
284
|
-
|
|
285
|
-
export const multiSelectWithYield = TemplateWithYield.bind({});
|
|
286
|
-
multiSelectWithYield.args = {
|
|
287
|
-
...Default.args,
|
|
288
|
-
placeholder: undefined,
|
|
289
|
-
isSearchable: false,
|
|
290
|
-
};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { Meta, Story, ArgTypes } from '@storybook/blocks';
|
|
2
|
-
|
|
3
|
-
import * as ComponentStories from './pix-pagination.stories';
|
|
4
|
-
|
|
5
|
-
<Meta of={ComponentStories} />
|
|
6
|
-
|
|
7
|
-
# PixPagination
|
|
8
|
-
|
|
9
|
-
PixPagination est un élément permettant de trigger le changement de page dans l'élément parent.
|
|
10
|
-
|
|
11
|
-
> ** ⚠️ Pour utiliser ce composant, il est recommandé d'ajouter cette config dans les routes où tu l'utiliseras.**
|
|
12
|
-
>
|
|
13
|
-
> ** Cela permettra de reload le `model` si les queryParams `pageNumber` & `pageSize` ont été modifiés.**
|
|
14
|
-
>
|
|
15
|
-
> ```javascript
|
|
16
|
-
> queryParams = { pageNumber: { refreshModel: true }, pageSize: { refreshModel: true } };
|
|
17
|
-
> ```
|
|
18
|
-
>
|
|
19
|
-
|
|
20
|
-
Le paramètre `pageOptions` n'est pas requis et possède une valeur par défaut.
|
|
21
|
-
|
|
22
|
-
** ⚠ Si vous voulez utiliser des options différentes, il ne faut pas oublier que l'API fait le premier call avec un pageSize
|
|
23
|
-
à 10 par défaut.**
|
|
24
|
-
|
|
25
|
-
Sur mobile, le select qui permet de choisir le nombre d'élément à afficher sur la page est retiré.
|
|
26
|
-
|
|
27
|
-
## En français avec paramètres par défaut
|
|
28
|
-
|
|
29
|
-
<Story of={ComponentStories.French} height={110} />
|
|
30
|
-
|
|
31
|
-
## En anglais avec le paramètre `pageOptions` custom
|
|
32
|
-
|
|
33
|
-
<Story of={ComponentStories.English} height={110} />
|
|
34
|
-
|
|
35
|
-
## Avec une seule page
|
|
36
|
-
|
|
37
|
-
<Story of={ComponentStories.OnePage} height={110} />
|
|
38
|
-
|
|
39
|
-
## Version condensée
|
|
40
|
-
|
|
41
|
-
<Story of={ComponentStories.Condensed} height={110} />
|
|
42
|
-
|
|
43
|
-
## Usage
|
|
44
|
-
|
|
45
|
-
```html
|
|
46
|
-
<PixPagination
|
|
47
|
-
@pagination="{{pagination}}"
|
|
48
|
-
@locale="{{locale}}"
|
|
49
|
-
@pageOptions="{{pageOptions}}"
|
|
50
|
-
@isCondensed="{{isCondensed}}"
|
|
51
|
-
/>
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
## Arguments
|
|
55
|
-
|
|
56
|
-
<ArgTypes />
|