@1024pix/pix-ui 46.13.1 → 46.13.3
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,220 +0,0 @@
|
|
|
1
|
-
import { hbs } from 'ember-cli-htmlbars';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Form/Inputs/Checkbox',
|
|
5
|
-
argTypes: {
|
|
6
|
-
id: {
|
|
7
|
-
name: 'id',
|
|
8
|
-
description:
|
|
9
|
-
'Identifiant du champ permettant de lui attacher un label. Généré automatiquement si non renseigné.',
|
|
10
|
-
type: { name: 'string' },
|
|
11
|
-
},
|
|
12
|
-
class: {
|
|
13
|
-
name: 'class',
|
|
14
|
-
description: "Permet d'ajouter une classe au parent du composant.",
|
|
15
|
-
type: { name: 'string' },
|
|
16
|
-
},
|
|
17
|
-
isIndeterminate: {
|
|
18
|
-
name: 'isIndeterminate',
|
|
19
|
-
description:
|
|
20
|
-
"Rendre la checkbox indéterminée, état indiquant que la/les case(s) n'est/ne sont ni cochée(s) ni décochée(s) (exemple: une checkbox parente indiquant la sélection partielle de plusieurs checkbox enfants)",
|
|
21
|
-
type: { name: 'boolean', required: true },
|
|
22
|
-
table: {
|
|
23
|
-
type: { summary: 'boolean' },
|
|
24
|
-
defaultValue: { summary: false },
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
checked: {
|
|
28
|
-
name: 'checked',
|
|
29
|
-
description: 'Permet de cocher la checkbox',
|
|
30
|
-
type: { name: 'boolean', required: false },
|
|
31
|
-
table: {
|
|
32
|
-
type: { summary: 'boolean' },
|
|
33
|
-
defaultValue: { summary: false },
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
isDisabled: {
|
|
37
|
-
name: 'isDisabled',
|
|
38
|
-
description: 'Permet de désactiver la checkbox',
|
|
39
|
-
type: { name: 'boolean', required: false },
|
|
40
|
-
table: {
|
|
41
|
-
type: { summary: 'boolean' },
|
|
42
|
-
defaultValue: { summary: false },
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
label: {
|
|
46
|
-
name: 'label',
|
|
47
|
-
description: 'Le label du champ',
|
|
48
|
-
type: { name: 'string', required: true },
|
|
49
|
-
table: {
|
|
50
|
-
type: { summary: 'string' },
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
subLabel: {
|
|
54
|
-
name: 'subLabel',
|
|
55
|
-
description: 'Un descriptif complétant le label',
|
|
56
|
-
type: { name: 'string', required: false },
|
|
57
|
-
},
|
|
58
|
-
requiredLabel: {
|
|
59
|
-
name: 'requiredLabel',
|
|
60
|
-
description: 'Label indiquant que le champ est requis.',
|
|
61
|
-
type: { name: 'string', required: false },
|
|
62
|
-
table: {
|
|
63
|
-
type: { summary: 'string' },
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
screenReaderOnly: {
|
|
67
|
-
name: 'screenReaderOnly',
|
|
68
|
-
description: "Permet de rendre le label lisible uniquement par les lecteurs d'écran",
|
|
69
|
-
control: { type: 'boolean' },
|
|
70
|
-
type: { name: 'boolean', required: false },
|
|
71
|
-
table: {
|
|
72
|
-
type: { summary: 'boolean' },
|
|
73
|
-
defaultValue: { summary: false },
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
size: {
|
|
77
|
-
name: 'size',
|
|
78
|
-
description: 'Correspond à la taille de la police du label.',
|
|
79
|
-
type: { name: 'string', required: false },
|
|
80
|
-
table: {
|
|
81
|
-
defaultValue: { summary: 'default' },
|
|
82
|
-
},
|
|
83
|
-
control: { type: 'select' },
|
|
84
|
-
options: ['small', 'large', 'default'],
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
const Template = (args) => {
|
|
90
|
-
return {
|
|
91
|
-
template: hbs`<PixCheckbox
|
|
92
|
-
@id={{this.id}}
|
|
93
|
-
@class={{this.class}}
|
|
94
|
-
@isIndeterminate={{this.isIndeterminate}}
|
|
95
|
-
@checked={{this.checked}}
|
|
96
|
-
@isDisabled={{this.isDisabled}}
|
|
97
|
-
disabled={{this.disabled}}
|
|
98
|
-
@size={{this.size}}
|
|
99
|
-
@subLabel={{this.subLabel}}
|
|
100
|
-
@requiredLabel={{this.requiredLabel}}
|
|
101
|
-
@inlineLabel={{this.inlineLabel}}
|
|
102
|
-
@screenReaderOnly={{this.screenReaderOnly}}
|
|
103
|
-
>
|
|
104
|
-
<:label>{{this.label}}</:label>
|
|
105
|
-
</PixCheckbox>`,
|
|
106
|
-
context: args,
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
const FullWidthTemplate = (args) => {
|
|
111
|
-
return {
|
|
112
|
-
template: hbs`{{! template-lint-disable no-inline-styles }}
|
|
113
|
-
<div
|
|
114
|
-
style='border: 1px solid var(--pix-neutral-500); background: var(--pix-neutral-20); padding: var(--pix-spacing-4x); width: 500px'
|
|
115
|
-
><PixCheckbox @id={{this.id}} @isIndeterminate={{false}}>
|
|
116
|
-
<:label>{{this.label}}</:label>
|
|
117
|
-
</PixCheckbox></div>`,
|
|
118
|
-
context: args,
|
|
119
|
-
};
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
export const Default = Template.bind({});
|
|
123
|
-
Default.args = {
|
|
124
|
-
id: 'accept-newsletter',
|
|
125
|
-
label: 'Recevoir la newsletter',
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
export const DefaultChecked = Template.bind({});
|
|
129
|
-
DefaultChecked.args = {
|
|
130
|
-
id: 'accept-newsletter',
|
|
131
|
-
label: 'Recevoir la newsletter',
|
|
132
|
-
checked: true,
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
export const FullWidth = FullWidthTemplate.bind({});
|
|
136
|
-
FullWidth.args = {
|
|
137
|
-
id: 'proposal',
|
|
138
|
-
label: 'Une réponse',
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
export const isIndeterminate = Template.bind({});
|
|
142
|
-
isIndeterminate.args = {
|
|
143
|
-
id: 'accept-newsletter-2',
|
|
144
|
-
label: 'Recevoir la newsletter',
|
|
145
|
-
isIndeterminate: true,
|
|
146
|
-
checked: true,
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
export const withSmallLabel = Template.bind({});
|
|
150
|
-
withSmallLabel.args = {
|
|
151
|
-
id: 'accept-newsletter-2',
|
|
152
|
-
label: 'Recevoir la newsletter',
|
|
153
|
-
size: 'small',
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
export const withLargeLabel = Template.bind({});
|
|
157
|
-
withLargeLabel.args = {
|
|
158
|
-
id: 'accept-newsletter-2',
|
|
159
|
-
label: 'Recevoir la newsletter',
|
|
160
|
-
size: 'large',
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
export const isDisabled = Template.bind({});
|
|
164
|
-
isDisabled.args = {
|
|
165
|
-
id: 'accept-newsletter-2',
|
|
166
|
-
label: 'Recevoir la newsletter',
|
|
167
|
-
isDisabled: true,
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
export const checkedIsDisabled = Template.bind({});
|
|
171
|
-
checkedIsDisabled.args = {
|
|
172
|
-
id: 'accept-newsletter-2',
|
|
173
|
-
label: 'Recevoir la newsletter',
|
|
174
|
-
isDisabled: true,
|
|
175
|
-
checked: true,
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
export const isIndeterminateIsDisabled = Template.bind({});
|
|
179
|
-
isIndeterminateIsDisabled.args = {
|
|
180
|
-
id: 'accept-newsletter-2',
|
|
181
|
-
label: 'Recevoir la newsletter',
|
|
182
|
-
isDisabled: true,
|
|
183
|
-
checked: true,
|
|
184
|
-
isIndeterminate: true,
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
const MultipleTemplate = (args) => {
|
|
188
|
-
return {
|
|
189
|
-
template: hbs`<PixCheckbox
|
|
190
|
-
@id='one'
|
|
191
|
-
@class={{this.class}}
|
|
192
|
-
@screenReaderOnly={{this.screenReaderOnly}}
|
|
193
|
-
@isIndeterminate={{this.isIndeterminate}}
|
|
194
|
-
@size={{this.size}}
|
|
195
|
-
@checked={{this.checked}}
|
|
196
|
-
disabled={{this.disabled}}
|
|
197
|
-
@isDisabled={{this.isDisabled}}
|
|
198
|
-
>
|
|
199
|
-
<:label>{{this.label}}</:label>
|
|
200
|
-
</PixCheckbox>
|
|
201
|
-
<PixCheckbox
|
|
202
|
-
@id='two'
|
|
203
|
-
@class={{this.class}}
|
|
204
|
-
@screenReaderOnly={{this.screenReaderOnly}}
|
|
205
|
-
@isIndeterminate={{this.isIndeterminate}}
|
|
206
|
-
@size={{this.size}}
|
|
207
|
-
@checked={{this.checked}}
|
|
208
|
-
disabled={{this.disabled}}
|
|
209
|
-
@isDisabled={{this.isDisabled}}
|
|
210
|
-
>
|
|
211
|
-
<:label>{{this.label}}</:label>
|
|
212
|
-
</PixCheckbox>`,
|
|
213
|
-
context: args,
|
|
214
|
-
};
|
|
215
|
-
};
|
|
216
|
-
|
|
217
|
-
export const multiple = MultipleTemplate.bind({});
|
|
218
|
-
multiple.args = {
|
|
219
|
-
label: 'Recevoir la newsletter',
|
|
220
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { Meta, Story, ArgTypes } from '@storybook/blocks';
|
|
2
|
-
import * as ComponentStories from './pix-collapsible.stories';
|
|
3
|
-
|
|
4
|
-
<Meta of={ComponentStories} />
|
|
5
|
-
|
|
6
|
-
# PixCollapsible
|
|
7
|
-
|
|
8
|
-
Un `PixCollapsible` est un élément comprenant un libellé et un contenu.
|
|
9
|
-
Par défaut le contenu est masqué et cliquer sur le libellé permet de montrer le contenu du `PixCollapsible`.
|
|
10
|
-
|
|
11
|
-
> Il est possible de cumuler les `PixCollapsible` de sorte à former un accordéon, il suffit de les mettre dans une même div parente.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
<Story of={ComponentStories.collapsible} height={150} />
|
|
15
|
-
|
|
16
|
-
<Story of={ComponentStories.collapsibleWithBlockTitle} height={150} />
|
|
17
|
-
|
|
18
|
-
<Story of={ComponentStories.multipleCollapsible} height={260} />
|
|
19
|
-
|
|
20
|
-
### Collapsible avec tag
|
|
21
|
-
Les paramètres `tagContent` et `tagColor` permettent d'afficher un `Pix Tag` près du chevron.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<Story of={ComponentStories.collapsibleWithTag} height={260} />
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
## Usage
|
|
28
|
-
|
|
29
|
-
```html
|
|
30
|
-
<PixCollapsible @title="Titre du contenu à dérouler en cliquant" @iconTitle="user">
|
|
31
|
-
<p>Contenu du PixCollapsible</p>
|
|
32
|
-
</PixCollapsible>
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## Arguments
|
|
36
|
-
|
|
37
|
-
<ArgTypes of={ComponentStories} />
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { hbs } from 'ember-cli-htmlbars';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Others/Collapsible',
|
|
5
|
-
argTypes: {
|
|
6
|
-
title: {
|
|
7
|
-
name: 'title',
|
|
8
|
-
description: 'Intitulé du contenu du PixCollapsible',
|
|
9
|
-
type: { name: 'string', required: true },
|
|
10
|
-
},
|
|
11
|
-
titleIcon: {
|
|
12
|
-
name: 'titleIcon',
|
|
13
|
-
description: "Ajoute l'icône donnée en paramètre avant le titre du PixCollapsible",
|
|
14
|
-
type: { name: 'string', required: false },
|
|
15
|
-
},
|
|
16
|
-
tagContent: {
|
|
17
|
-
name: 'tagContent',
|
|
18
|
-
description: "Contenu du tag qui s'affiche près du chevron",
|
|
19
|
-
type: { name: 'string', required: false },
|
|
20
|
-
},
|
|
21
|
-
tagColor: {
|
|
22
|
-
name: 'tagColor',
|
|
23
|
-
description:
|
|
24
|
-
"Couleur du tag qui s'affiche près du chevron. Doit s'ajouter avec le paramètre tagContent. Voir le composant Pix Tag pour les couleurs disponibles",
|
|
25
|
-
type: { name: 'string', required: false },
|
|
26
|
-
table: { defaultValue: { summary: 'primary' } },
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const Template = (args) => {
|
|
32
|
-
return {
|
|
33
|
-
template: hbs`<PixCollapsible @title={{this.title}} @titleIcon={{this.titleIcon}}>
|
|
34
|
-
<div>Contenu du PixCollapsible</div>
|
|
35
|
-
</PixCollapsible>`,
|
|
36
|
-
context: args,
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export const collapsible = Template.bind({});
|
|
41
|
-
collapsible.args = {
|
|
42
|
-
title: 'Titre du contenu à dérouler en cliquant',
|
|
43
|
-
titleIcon: 'user',
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export const collapsibleWithBlockTitle = (args) => {
|
|
47
|
-
return {
|
|
48
|
-
template: hbs`<PixCollapsible @titleIcon={{this.titleIcon}}>
|
|
49
|
-
<:title>
|
|
50
|
-
<span>Titre avec <em>contenu de type block</em></span>
|
|
51
|
-
</:title>
|
|
52
|
-
<:default>
|
|
53
|
-
<div>Contenu du PixCollapsible</div>
|
|
54
|
-
</:default>
|
|
55
|
-
</PixCollapsible>`,
|
|
56
|
-
context: args,
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
export const multipleCollapsible = (args) => {
|
|
61
|
-
return {
|
|
62
|
-
template: hbs`<div>
|
|
63
|
-
<PixCollapsible @title='Titre A' @titleIcon={{this.titleIcon}}>
|
|
64
|
-
<div>Contenu A</div>
|
|
65
|
-
</PixCollapsible>
|
|
66
|
-
|
|
67
|
-
<PixCollapsible @title='Titre B' @titleIcon={{this.titleIcon}}>
|
|
68
|
-
<div>Contenu B</div>
|
|
69
|
-
</PixCollapsible>
|
|
70
|
-
|
|
71
|
-
<PixCollapsible @title='Titre C' @titleIcon={{this.titleIcon}}>
|
|
72
|
-
<div>Contenu C</div>
|
|
73
|
-
</PixCollapsible>
|
|
74
|
-
</div>`,
|
|
75
|
-
context: args,
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
export const collapsibleWithTag = (args) => {
|
|
80
|
-
return {
|
|
81
|
-
template: hbs`{{! template-lint-disable no-inline-styles }}
|
|
82
|
-
<div style='width:800px'>
|
|
83
|
-
{{! template-lint-disable no-inline-styles }}
|
|
84
|
-
<PixCollapsible
|
|
85
|
-
@title='Titre A'
|
|
86
|
-
@titleIcon={{this.titleIcon}}
|
|
87
|
-
@tagColor='success'
|
|
88
|
-
@tagContent='tag 1'
|
|
89
|
-
>
|
|
90
|
-
<div>Contenu A</div>
|
|
91
|
-
</PixCollapsible>
|
|
92
|
-
|
|
93
|
-
<PixCollapsible
|
|
94
|
-
@title='Titre B'
|
|
95
|
-
@titleIcon={{this.titleIcon}}
|
|
96
|
-
@tagColor='error'
|
|
97
|
-
@tagContent='tag 2'
|
|
98
|
-
>
|
|
99
|
-
<div>Contenu B</div>
|
|
100
|
-
</PixCollapsible>
|
|
101
|
-
</div>`,
|
|
102
|
-
context: args,
|
|
103
|
-
};
|
|
104
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Meta, Story, ArgTypes } from '@storybook/blocks';
|
|
2
|
-
import * as ComponentStories from './pix-filter-banner.stories.js';
|
|
3
|
-
|
|
4
|
-
<Meta of={ComponentStories} />
|
|
5
|
-
|
|
6
|
-
# Pix Filter Banner
|
|
7
|
-
|
|
8
|
-
Une `FilterBanner` permet de wrapper les éléments de filtres (`Select`, `Multi-Select`, ...).
|
|
9
|
-
|
|
10
|
-
> Il est possible de surcharger le style d'une `<PixFilterBanner>` via l'attribut `class` ainsi que de passer n'importe quel attribut sur sa `div` wrapper (par exemple, un `aria-label`)
|
|
11
|
-
|
|
12
|
-
<Story of={ComponentStories.filterBanner} height={80} />
|
|
13
|
-
|
|
14
|
-
## Usage
|
|
15
|
-
|
|
16
|
-
```html
|
|
17
|
-
<PixFilterBanner aria-label="Filtres sur les campagnes">
|
|
18
|
-
<PixSelect @options="{{options}}" @onChange="{{onChange}}" />
|
|
19
|
-
<PixSelect @options="{{options}}" @onChange="{{onChange}}" />
|
|
20
|
-
<PixSelect @options="{{options}}" @onChange="{{onChange}}" />
|
|
21
|
-
</PixFilterBanner>
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## Arguments
|
|
25
|
-
|
|
26
|
-
<ArgTypes of={ComponentStories} />
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { hbs } from 'ember-cli-htmlbars';
|
|
2
|
-
import { action } from '@storybook/addon-actions';
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: 'Form/Filter banner',
|
|
6
|
-
argTypes: {
|
|
7
|
-
title: {
|
|
8
|
-
name: 'title',
|
|
9
|
-
description: 'Titre du filtre',
|
|
10
|
-
type: { name: 'string', required: false },
|
|
11
|
-
},
|
|
12
|
-
details: {
|
|
13
|
-
name: 'details',
|
|
14
|
-
description: 'Détails du filtre',
|
|
15
|
-
type: { name: 'string', required: false },
|
|
16
|
-
},
|
|
17
|
-
clearFiltersLabel: {
|
|
18
|
-
name: 'clearFiltersLabel',
|
|
19
|
-
description: 'libellé du bouton',
|
|
20
|
-
type: { name: 'string', required: false },
|
|
21
|
-
},
|
|
22
|
-
onClearFilters: {
|
|
23
|
-
name: 'onClearFilters',
|
|
24
|
-
description: 'fonction à appeler pour déclencher l’action de suppression des filtres',
|
|
25
|
-
type: { required: false },
|
|
26
|
-
},
|
|
27
|
-
isClearFilterButtonDisabled: {
|
|
28
|
-
name: 'isClearFilterButtonDisabled',
|
|
29
|
-
description: 'Désactiver le button de la suppresion des filtres',
|
|
30
|
-
type: { name: 'boolean', required: true },
|
|
31
|
-
control: { type: 'boolean' },
|
|
32
|
-
table: {
|
|
33
|
-
type: { summary: 'boolean' },
|
|
34
|
-
defaultValue: { summary: false },
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export const filterBanner = (args) => {
|
|
41
|
-
return {
|
|
42
|
-
template: hbs`<PixFilterBanner
|
|
43
|
-
@title={{this.title}}
|
|
44
|
-
@details={{this.details}}
|
|
45
|
-
@clearFiltersLabel={{this.clearFiltersLabel}}
|
|
46
|
-
@onClearFilters={{this.onClearFilters}}
|
|
47
|
-
@isClearFilterButtonDisabled={{this.isClearFilterButtonDisabled}}
|
|
48
|
-
>
|
|
49
|
-
<PixSelect
|
|
50
|
-
@options={{this.options}}
|
|
51
|
-
@onChange={{this.onChange}}
|
|
52
|
-
@screenReaderOnly={{true}}
|
|
53
|
-
@placeholder='placeholer'
|
|
54
|
-
>
|
|
55
|
-
<:label>mon label</:label>
|
|
56
|
-
</PixSelect>
|
|
57
|
-
<PixSelect
|
|
58
|
-
@options={{this.options}}
|
|
59
|
-
@onChange={{this.onChange}}
|
|
60
|
-
@screenReaderOnly={{true}}
|
|
61
|
-
@placeholder='placeholer'
|
|
62
|
-
>
|
|
63
|
-
<:label>mon label</:label>
|
|
64
|
-
</PixSelect>
|
|
65
|
-
<PixSelect
|
|
66
|
-
@options={{this.options}}
|
|
67
|
-
@onChange={{this.onChange}}
|
|
68
|
-
@screenReaderOnly={{true}}
|
|
69
|
-
@placeholder='placeholer'
|
|
70
|
-
>
|
|
71
|
-
<:label>mon label</:label>
|
|
72
|
-
</PixSelect>
|
|
73
|
-
</PixFilterBanner>`,
|
|
74
|
-
context: args,
|
|
75
|
-
};
|
|
76
|
-
};
|
|
77
|
-
filterBanner.args = {
|
|
78
|
-
title: 'Filtres',
|
|
79
|
-
details: 'Des détails sur le filtre',
|
|
80
|
-
clearFiltersLabel: 'Effacer les filtres',
|
|
81
|
-
options: [
|
|
82
|
-
{ value: '1', label: 'Tomate' },
|
|
83
|
-
{ value: '2', label: 'Mozza' },
|
|
84
|
-
],
|
|
85
|
-
onChange: action('select-onchange'),
|
|
86
|
-
onClearFilters: action('onClearFilters'),
|
|
87
|
-
};
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { Meta, Story, ArgTypes } from '@storybook/blocks';
|
|
2
|
-
import * as ComponentStories from './pix-filterable-and-searchable-select.stories.js';
|
|
3
|
-
|
|
4
|
-
<Meta of={ComponentStories} />
|
|
5
|
-
|
|
6
|
-
# Pix Filterable and searchable select
|
|
7
|
-
|
|
8
|
-
Ce composant est la fusion de deux autres composants: PixMultiSelect et PixSelect.
|
|
9
|
-
|
|
10
|
-
Il permet de sélectionner une option, de filter sur la liste des options en fonction de leur catégorie afin de simplifier la sélection.
|
|
11
|
-
|
|
12
|
-
Les options sont représentées par un tableau d'objet contenant les propriétés value, label et category.
|
|
13
|
-
|
|
14
|
-
> **⚠️** **Il est nécessaire d'avoir au moins un label ou un placeholder !**
|
|
15
|
-
|
|
16
|
-
> **⚠️** **N'oubliez pas de rajouter un searchLabel dans le cas ou le menu déroulant est cherchable pour le rendre accessible !**
|
|
17
|
-
|
|
18
|
-
> Pour aider l'utilisateur, rajoutez un placeholder cohérent !
|
|
19
|
-
|
|
20
|
-
## Default
|
|
21
|
-
|
|
22
|
-
<Story of={ComponentStories.Default} height={400}/>
|
|
23
|
-
|
|
24
|
-
## Searchable
|
|
25
|
-
|
|
26
|
-
<Story of={ComponentStories.Searchable} height={400}/>
|
|
27
|
-
|
|
28
|
-
## With labels only for screenReaders
|
|
29
|
-
|
|
30
|
-
<Story of={ComponentStories.WithLabelsOnlyForScreenReaders} height={400}/>
|
|
31
|
-
|
|
32
|
-
## Usage
|
|
33
|
-
|
|
34
|
-
```html
|
|
35
|
-
<PixFilterableAndSearchableSelect
|
|
36
|
-
@selectLabel="{{selectLabel}}"
|
|
37
|
-
@placeholder="{{placeholder}}"
|
|
38
|
-
@options="{{options}}"
|
|
39
|
-
@value="{{value}}"
|
|
40
|
-
@isSearchable="{{isSearchable}}"
|
|
41
|
-
@hideDefaultOption="{{hideDefaultOption}}"
|
|
42
|
-
@searchPlaceholder="{{searchPlaceholder}}"
|
|
43
|
-
@emptySearchMessage="{{emptySearchMessage}}"
|
|
44
|
-
@errorMessage="{{errorMessage}}"
|
|
45
|
-
@onChange="{{onChange}}"
|
|
46
|
-
@categoriesPlaceholder="{{categoriesPlaceholder}}"
|
|
47
|
-
@categoriesEmptyMessage="{{categoriesEmptyMessage}}"
|
|
48
|
-
@errorMessage="{{errorMessage}}"
|
|
49
|
-
|
|
50
|
-
@sublabel="{{sublabel}}"
|
|
51
|
-
@screenReaderOnly="{{screenReaderOnly}}"
|
|
52
|
-
@inlineLabel="{{inlineLabel}}"
|
|
53
|
-
@searchLabel="{{searchLabel}}"
|
|
54
|
-
@requiredLabel="{{requiredLabel}}">
|
|
55
|
-
<:label>{{label}}</:label>
|
|
56
|
-
<:categoriesLabel>{{categoriesLabel}}</:categoriesLabel>
|
|
57
|
-
</PixFilterableAndSearchableSelect>
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
## Arguments
|
|
61
|
-
|
|
62
|
-
<ArgTypes of={ComponentStories} />
|