@cnamts/synapse 0.0.6-alpha → 0.0.8-alpha
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/dist/design-system-v3.d.ts +331 -372
- package/dist/design-system-v3.js +2794 -2637
- package/dist/design-system-v3.umd.cjs +1 -10
- package/dist/style.css +1 -1
- package/package.json +10 -2
- package/src/assets/settings.scss +2 -2
- package/src/assets/tokens.scss +107 -112
- package/src/components/BackBtn/BackBtn.stories.ts +4 -1
- package/src/components/BackBtn/BackBtn.vue +4 -4
- package/src/components/BackToTopBtn/BackToTopBtn.stories.ts +3 -3
- package/src/components/BackToTopBtn/BackToTopBtn.vue +1 -0
- package/src/components/CollapsibleList/CollapsibleList.mdx +1 -1
- package/src/components/CollapsibleList/CollapsibleList.vue +43 -44
- package/src/components/ContextualMenu/ContextualMenu.mdx +118 -0
- package/src/components/ContextualMenu/ContextualMenu.stories.ts +430 -0
- package/src/components/ContextualMenu/ContextualMenu.vue +101 -0
- package/src/components/ContextualMenu/tests/ContextualMenu.spec.ts +115 -0
- package/src/components/ContextualMenu/tests/__snapshots__/ContextualMenu.spec.ts.snap +10 -0
- package/src/components/ContextualMenu/types.ts +5 -0
- package/src/components/CookieBanner/CookieBanner.stories.ts +3 -2
- package/src/components/CookieBanner/CookieBanner.vue +13 -10
- package/src/components/CookieBanner/tests/__snapshots__/CookieBanner.spec.ts.snap +17 -15
- package/src/components/CookiesSelection/CookiesInformation/CookiesInformation.vue +6 -1
- package/src/components/CookiesSelection/CookiesInformation/locales.ts +1 -0
- package/src/components/CookiesSelection/CookiesTable/CookiesTable.vue +1 -0
- package/src/components/CookiesSelection/tests/__snapshots__/CookiesSelection.spec.ts.snap +17 -15
- package/src/components/CopyBtn/CopyBtn.stories.ts +5 -2
- package/src/components/CopyBtn/CopyBtn.vue +7 -7
- package/src/components/Customs/SyBtnSelect/SyBtnSelect.stories.ts +11 -51
- package/src/components/Customs/SyBtnSelect/SyBtnSelect.vue +26 -26
- package/src/components/Customs/SyInputSelect/SyInputSelect.mdx +4 -1
- package/src/components/Customs/SyInputSelect/SyInputSelect.stories.ts +19 -7
- package/src/components/Customs/SyInputSelect/SyInputSelect.vue +24 -24
- package/src/components/Customs/SySelect/SySelect.mdx +1 -2
- package/src/components/Customs/SySelect/SySelect.stories.ts +0 -2
- package/src/components/Customs/SySelect/SySelect.vue +27 -26
- package/src/components/DataList/DataList.stories.ts +3 -2
- package/src/components/DataList/DataList.vue +1 -1
- package/src/components/DataListGroup/DataListGroup.stories.ts +3 -2
- package/src/components/DataListItem/DataListItem.vue +12 -12
- package/src/components/DialogBox/DialogBox.mdx +28 -2
- package/src/components/DialogBox/DialogBox.stories.ts +1 -1
- package/src/components/DialogBox/DialogBox.vue +3 -2
- package/src/components/DownloadBtn/DownloadBtn.mdx +3 -4
- package/src/components/DownloadBtn/DownloadBtn.stories.ts +20 -21
- package/src/components/DownloadBtn/DownloadBtn.vue +2 -1
- package/src/components/ErrorPage/ErrorPage.vue +1 -1
- package/src/components/ExternalLinks/ExternalLinks.mdx +86 -0
- package/src/components/ExternalLinks/ExternalLinks.stories.ts +553 -0
- package/src/components/ExternalLinks/ExternalLinks.vue +200 -0
- package/src/components/ExternalLinks/config.ts +34 -0
- package/src/components/ExternalLinks/locales.ts +4 -0
- package/src/components/ExternalLinks/tests/ExternalLinks.spec.ts +154 -0
- package/src/components/ExternalLinks/tests/__snapshots__/ExternalLinks.spec.ts.snap +159 -0
- package/src/components/FooterBar/FooterBar.vue +111 -82
- package/src/components/FranceConnectBtn/FranceConnectBtn.stories.ts +2 -1
- package/src/components/FranceConnectBtn/FranceConnectBtn.vue +14 -13
- package/src/components/HeaderBar/HeaderBar.stories.ts +19 -12
- package/src/components/HeaderBar/HeaderBar.vue +8 -3
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderBurgerMenu.vue +12 -7
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuItem/HeaderMenuItem.vue +5 -5
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuSection/HeaderMenuSection.vue +2 -2
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.vue +10 -8
- package/src/components/HeaderBar/HeaderLogo/HeaderLogo.vue +2 -2
- package/src/components/HeaderBar/HeaderLogo/logos/Logo-mobile.vue +2 -1
- package/src/components/HeaderBar/HeaderLogo/logos/Logo.vue +2 -1
- package/src/components/HeaderBar/HeaderMenuBtn/HeaderMenuBtn.vue +10 -10
- package/src/components/HeaderBar/consts.scss +1 -1
- package/src/components/HeaderLoading/HeaderLoading.vue +12 -11
- package/src/components/HeaderNavigationBar/HeaderNavigationBar.stories.ts +104 -32
- package/src/components/HeaderNavigationBar/HeaderNavigationBar.vue +2 -1
- package/src/components/HeaderNavigationBar/HorizontalNavbar/HorizontalNavbar.vue +9 -9
- package/src/components/HeaderToolbar/HeaderToolbar.vue +215 -180
- package/src/components/LangBtn/LangBtn.vue +8 -6
- package/src/components/LogoBrandSection/LogoBrandSection.stories.ts +2 -2
- package/src/components/NirField/NirField.mdx +1 -4
- package/src/components/NirField/NirField.stories.ts +71 -18
- package/src/components/NirField/NirField.vue +49 -49
- package/src/components/NirField/tests/NirField.spec.ts +1 -0
- package/src/components/NotFoundPage/NotFoundPage.stories.ts +33 -2
- package/src/components/NotFoundPage/NotFoundPage.vue +17 -0
- package/src/components/NotificationBar/NotificationBar.mdx +5 -5
- package/src/components/NotificationBar/NotificationBar.stories.ts +410 -314
- package/src/components/NotificationBar/NotificationBar.vue +43 -41
- package/src/components/PageContainer/PageContainer.stories.ts +5 -5
- package/src/components/PageContainer/PageContainer.vue +13 -8
- package/src/components/PageContainer/tests/PageContainer.spec.ts +1 -1
- package/src/components/PasswordField/PasswordField.mdx +70 -0
- package/src/components/PasswordField/PasswordField.stories.ts +213 -0
- package/src/components/PasswordField/PasswordField.vue +189 -0
- package/src/components/PasswordField/config.ts +11 -0
- package/src/components/PasswordField/locales.ts +4 -0
- package/src/components/PasswordField/tests/PasswordField.spec.ts +96 -0
- package/src/components/PhoneField/PhoneField.mdx +0 -2
- package/src/components/PhoneField/PhoneField.stories.ts +10 -50
- package/src/components/PhoneField/PhoneField.vue +34 -34
- package/src/components/SkipLink/SkipLink.vue +10 -10
- package/src/components/SocialMediaLinks/SocialMediaLinks.vue +29 -21
- package/src/components/SocialMediaLinks/tests/__snapshots__/SocialMediaLinks.spec.ts.snap +2 -2
- package/src/components/SubHeader/SubHeader.stories.ts +6 -3
- package/src/components/SubHeader/SubHeader.vue +32 -31
- package/src/components/SyAlert/SyAlert.vue +15 -8
- package/src/components/UserMenuBtn/UserMenuBtn.vue +1 -1
- package/src/components/UserMenuBtn/config.ts +1 -1
- package/src/components/index.ts +10 -6
- package/src/designTokens/index.ts +6 -4
- package/src/designTokens/{bootstrapColors.md → paColors.md} +1 -1
- package/src/designTokens/tokens/cnam/cnamLightTheme.ts +2 -0
- package/src/designTokens/tokens/pa/paColors.ts +171 -0
- package/src/designTokens/tokens/pa/paContextual.ts +58 -0
- package/src/designTokens/tokens/pa/paDarkTheme.ts +5 -0
- package/src/designTokens/tokens/pa/paLightTheme.ts +123 -0
- package/src/designTokens/tokens/pa/paSemantic.ts +87 -0
- package/src/stories/GuideDuDev/CreerUneIssue.mdx +64 -0
- package/src/stories/GuideDuDev/{CommentUtiliserLesRules.mdx → UtiliserLesRules.mdx} +2 -2
- package/src/stories/GuideDuDev/components.stories.ts +9 -7
- package/src/stories/Guidelines/Vuetify/Vuetify.stories.ts +163 -88
- package/src/stories/Guidelines/Vuetify/VuetifyItems.ts +250 -23
- package/src/temp/TestDTComponent.vue +5 -6
- package/src/designTokens/tokens/bootstrap/bootstrapColors.ts +0 -158
- package/src/designTokens/tokens/bootstrap/bootstrapLightTheme.ts +0 -22
- package/src/stories/GuideDuDev/CommentContribuer.mdx +0 -22
|
@@ -200,53 +200,53 @@
|
|
|
200
200
|
</template>
|
|
201
201
|
|
|
202
202
|
<style lang="scss" scoped>
|
|
203
|
-
@use '@/assets/tokens
|
|
203
|
+
@use '@/assets/tokens';
|
|
204
204
|
|
|
205
205
|
.sy-input-select {
|
|
206
|
-
|
|
207
|
-
|
|
206
|
+
text-transform: none !important;
|
|
207
|
+
font-size: 16px;
|
|
208
208
|
}
|
|
209
209
|
|
|
210
210
|
.v-input {
|
|
211
|
-
|
|
212
|
-
|
|
211
|
+
cursor: pointer;
|
|
212
|
+
position: relative;
|
|
213
213
|
}
|
|
214
214
|
|
|
215
215
|
.v-list {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
216
|
+
position: absolute;
|
|
217
|
+
width: 100%;
|
|
218
|
+
z-index: 1;
|
|
219
|
+
background-color: white;
|
|
220
|
+
min-width: fit-content;
|
|
221
|
+
max-width: 100px;
|
|
222
|
+
padding: 0;
|
|
223
|
+
box-shadow: 0 2px 5px rgb(0 0 0 / 12%), 0 2px 10px rgb(0 0 0 / 8%);
|
|
224
|
+
border-radius: 4px;
|
|
225
|
+
overflow-y: auto;
|
|
226
|
+
max-height: 300px;
|
|
227
227
|
}
|
|
228
228
|
|
|
229
229
|
.v-list-item:hover {
|
|
230
|
-
|
|
230
|
+
background-color: rgb(0 0 0 / 4%);
|
|
231
231
|
}
|
|
232
232
|
|
|
233
233
|
:deep(.v-list-item[aria-selected='true']) {
|
|
234
|
-
|
|
234
|
+
background-color: rgb(0 0 0 / 8%);
|
|
235
235
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
236
|
+
.v-list-item-title {
|
|
237
|
+
font-weight: bold;
|
|
238
|
+
}
|
|
239
239
|
}
|
|
240
240
|
|
|
241
241
|
.error {
|
|
242
|
-
|
|
242
|
+
border-color: tokens.$danger-default;
|
|
243
243
|
}
|
|
244
244
|
|
|
245
245
|
.v-btn {
|
|
246
|
-
|
|
246
|
+
color: tokens.$blue-base;
|
|
247
247
|
}
|
|
248
248
|
|
|
249
249
|
.text-color {
|
|
250
|
-
|
|
250
|
+
color: tokens.$blue-base;
|
|
251
251
|
}
|
|
252
252
|
</style>
|
|
@@ -35,11 +35,10 @@ Il est basé sur un `v-textfield`.
|
|
|
35
35
|
<main class="ma-12">
|
|
36
36
|
SelectedValue: {{ selectedValue }}
|
|
37
37
|
<div class="d-flex flex-wrap align-center">
|
|
38
|
-
<
|
|
38
|
+
<SySelect
|
|
39
39
|
v-model="selectedValue"
|
|
40
40
|
:items="items"
|
|
41
41
|
text-key="text"
|
|
42
|
-
outlined
|
|
43
42
|
required
|
|
44
43
|
/>
|
|
45
44
|
</div>
|
|
@@ -215,7 +215,6 @@ export const withCustomKey: Story = {
|
|
|
215
215
|
v-model="value"
|
|
216
216
|
:items="items"
|
|
217
217
|
text-key="customKey"
|
|
218
|
-
outlined
|
|
219
218
|
/>
|
|
220
219
|
</template>
|
|
221
220
|
`,
|
|
@@ -251,7 +250,6 @@ export const withCustomKey: Story = {
|
|
|
251
250
|
<div class="d-flex flex-wrap align-center pa-4">
|
|
252
251
|
<SySelect
|
|
253
252
|
v-bind="args"
|
|
254
|
-
outlined
|
|
255
253
|
text-key="customKey"
|
|
256
254
|
/>
|
|
257
255
|
</div>
|
|
@@ -183,56 +183,57 @@
|
|
|
183
183
|
</template>
|
|
184
184
|
|
|
185
185
|
<style scoped lang="scss">
|
|
186
|
-
@use '@/assets/tokens
|
|
186
|
+
@use '@/assets/tokens';
|
|
187
187
|
|
|
188
188
|
.sy-select {
|
|
189
|
-
|
|
190
|
-
|
|
189
|
+
display: flex;
|
|
190
|
+
flex-direction: column;
|
|
191
191
|
}
|
|
192
192
|
|
|
193
193
|
.v-field {
|
|
194
|
-
|
|
194
|
+
position: relative;
|
|
195
195
|
}
|
|
196
|
+
|
|
196
197
|
.v-field--focused {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
198
|
+
.v-icon.arrow {
|
|
199
|
+
transform: rotateX(180deg);
|
|
200
|
+
}
|
|
200
201
|
}
|
|
201
202
|
|
|
202
203
|
.v-list {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
204
|
+
position: absolute;
|
|
205
|
+
left: inherit !important;
|
|
206
|
+
margin-top: -22px;
|
|
207
|
+
background-color: white;
|
|
208
|
+
max-height: 300px;
|
|
209
|
+
padding: 0;
|
|
210
|
+
box-shadow: 0 2px 5px rgb(0 0 0 / 12%), 0 2px 10px rgb(0 0 0 / 8%);
|
|
211
|
+
border-radius: 4px;
|
|
212
|
+
overflow-y: auto;
|
|
213
|
+
z-index: 2;
|
|
213
214
|
}
|
|
214
215
|
|
|
215
216
|
.v-list-item:hover {
|
|
216
|
-
|
|
217
|
+
background-color: rgb(0 0 0 / 4%);
|
|
217
218
|
}
|
|
218
219
|
|
|
219
220
|
.v-list-item[aria-selected='true'] {
|
|
220
|
-
|
|
221
|
+
background-color: rgb(0 0 0 / 8%);
|
|
221
222
|
}
|
|
222
223
|
|
|
223
224
|
.v-icon {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
225
|
+
position: absolute;
|
|
226
|
+
right: 10px;
|
|
227
|
+
color: tokens.$grey-darken-20;
|
|
227
228
|
}
|
|
228
229
|
|
|
229
230
|
:deep(.v-field__input) {
|
|
230
|
-
|
|
231
|
+
color: tokens.$grey-darken-20;
|
|
231
232
|
}
|
|
232
233
|
|
|
233
234
|
.hidden-label {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
235
|
+
visibility: hidden;
|
|
236
|
+
position: absolute;
|
|
237
|
+
white-space: nowrap;
|
|
237
238
|
}
|
|
238
239
|
</style>
|
|
@@ -421,8 +421,9 @@ export const ActionBtn: Story = {
|
|
|
421
421
|
code: `
|
|
422
422
|
<script setup lang="ts">
|
|
423
423
|
import { DataList } from '@cnamts/synapse'
|
|
424
|
+
import { ref } from 'vue'
|
|
424
425
|
|
|
425
|
-
const items = [
|
|
426
|
+
const items = ref([
|
|
426
427
|
{
|
|
427
428
|
key: 'Nom',
|
|
428
429
|
value: 'Dupont',
|
|
@@ -436,7 +437,7 @@ export const ActionBtn: Story = {
|
|
|
436
437
|
value: '24/09/1970',
|
|
437
438
|
action: 'Modifier',
|
|
438
439
|
},
|
|
439
|
-
]
|
|
440
|
+
])
|
|
440
441
|
|
|
441
442
|
const updateBirthdate = (index: number) => {
|
|
442
443
|
items[index].value = '25/09/1970'
|
|
@@ -332,8 +332,9 @@ export const ActionBtn: Story = {
|
|
|
332
332
|
code: `
|
|
333
333
|
<script setup lang="ts">
|
|
334
334
|
import { DataListGroup } from '@cnamts/synapse'
|
|
335
|
+
import { ref } from 'vue'
|
|
335
336
|
|
|
336
|
-
const items = [
|
|
337
|
+
const items = ref([
|
|
337
338
|
{
|
|
338
339
|
title: 'Informations patient',
|
|
339
340
|
items: [
|
|
@@ -374,7 +375,7 @@ export const ActionBtn: Story = {
|
|
|
374
375
|
},
|
|
375
376
|
],
|
|
376
377
|
},
|
|
377
|
-
]
|
|
378
|
+
])
|
|
378
379
|
|
|
379
380
|
const updateBirthdate = (eventValue: object) => {
|
|
380
381
|
items.value[eventValue.dataListIndex].items[eventValue.itemIndex].value = '25/09/1970'
|
|
@@ -111,25 +111,25 @@
|
|
|
111
111
|
|
|
112
112
|
<style lang="scss" scoped>
|
|
113
113
|
.vd-row {
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
display: flex;
|
|
115
|
+
flex-wrap: wrap;
|
|
116
116
|
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
.vd-data-list-item-label {
|
|
118
|
+
align-self: center;
|
|
119
119
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
120
|
+
&::after {
|
|
121
|
+
content: ':';
|
|
122
|
+
margin: 0 4px;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
.vd-data-list-item-action-btn.v-btn {
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
min-width: 0;
|
|
129
|
+
margin: 0 -1px;
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
.v-icon.v-theme--light {
|
|
133
|
-
|
|
133
|
+
color: rgb(0 0 0 / 54%);
|
|
134
134
|
}
|
|
135
135
|
</style>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta, Canvas, Controls } from '@storybook/blocks';
|
|
1
|
+
import { Meta, Canvas, Controls, Source } from '@storybook/blocks';
|
|
2
2
|
import * as DialogBoxStories from './DialogBox.stories';
|
|
3
3
|
|
|
4
4
|
<Meta of={DialogBoxStories} />
|
|
@@ -11,4 +11,30 @@ L’élément `DialogBox` est utilisé pour afficher une boîte de dialogue avec
|
|
|
11
11
|
|
|
12
12
|
# API
|
|
13
13
|
|
|
14
|
-
<Controls of={DialogBoxStories.Default} />
|
|
14
|
+
<Controls of={DialogBoxStories.Default} />
|
|
15
|
+
|
|
16
|
+
# Exemple d'utilisation
|
|
17
|
+
|
|
18
|
+
<Source dark code={`
|
|
19
|
+
<script setup lang="ts">
|
|
20
|
+
import { DialogBox } from '@cnamts/synapse'
|
|
21
|
+
import { ref } from 'vue'
|
|
22
|
+
|
|
23
|
+
const dialogOpen = ref(false)
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<template>
|
|
27
|
+
<VBtn
|
|
28
|
+
color="primary"
|
|
29
|
+
@click="dialogOpen = !dialogOpen"
|
|
30
|
+
>Toggle DialogBox</VBtn>
|
|
31
|
+
<DialogBox
|
|
32
|
+
v-model="dialogOpen"
|
|
33
|
+
title="DialogBox title"
|
|
34
|
+
@confirm="dialogOpen = false"
|
|
35
|
+
@cancel="dialogOpen = false"
|
|
36
|
+
>
|
|
37
|
+
DialogBox content
|
|
38
|
+
</DialogBox>
|
|
39
|
+
</template>
|
|
40
|
+
`} />
|
|
@@ -151,6 +151,7 @@
|
|
|
151
151
|
|
|
152
152
|
<style lang="scss" scoped>
|
|
153
153
|
@use '@/assets/tokens' as *;
|
|
154
|
+
|
|
154
155
|
.v-card__title > * {
|
|
155
156
|
line-height: 1em;
|
|
156
157
|
}
|
|
@@ -166,7 +167,7 @@ h2 {
|
|
|
166
167
|
text-wrap: balance;
|
|
167
168
|
}
|
|
168
169
|
|
|
169
|
-
.vd-dialog-box-actions-ctn
|
|
170
|
+
.vd-dialog-box-actions-ctn {
|
|
170
171
|
display: flex;
|
|
171
172
|
flex-direction: column-reverse;
|
|
172
173
|
justify-content: stretch;
|
|
@@ -174,7 +175,7 @@ h2 {
|
|
|
174
175
|
}
|
|
175
176
|
|
|
176
177
|
@media screen and (min-width: $container-mobile-max-width) {
|
|
177
|
-
.vd-dialog-box-actions-ctn
|
|
178
|
+
.vd-dialog-box-actions-ctn {
|
|
178
179
|
flex-direction: row;
|
|
179
180
|
}
|
|
180
181
|
}
|
|
@@ -52,13 +52,12 @@ Exemple :
|
|
|
52
52
|
<Source dark code={`
|
|
53
53
|
<script setup lang="ts">
|
|
54
54
|
import { DownloadBtn } from '@cnamts/synapse'
|
|
55
|
-
import { NotificationBar } from '@cnamts/synapse'
|
|
56
|
-
import axios from 'axios'
|
|
57
|
-
import { useNotificationService } from '@cnamts/synapse/src/services/NotificationService'
|
|
55
|
+
import { NotificationBar, useNotificationService } from '@cnamts/synapse'
|
|
58
56
|
import type { Notification } from '@cnamts/synapse/src/components/NotificationBar/types'
|
|
57
|
+
import axios from 'axios'
|
|
59
58
|
|
|
60
59
|
function download() {
|
|
61
|
-
return axios.get('https://run.mocky.io/v3/
|
|
60
|
+
return axios.get('https://run.mocky.io/v3/884c25f5-6dc2-4c01-b8d9-26c54042f94f')
|
|
62
61
|
}
|
|
63
62
|
|
|
64
63
|
const { addNotification } = useNotificationService()
|
|
@@ -24,7 +24,7 @@ const meta = {
|
|
|
24
24
|
},
|
|
25
25
|
filePromise: {
|
|
26
26
|
control: false,
|
|
27
|
-
description: 'Une fonction retournant
|
|
27
|
+
description: 'Une fonction retournant une valeur de retour de Axios `Promise<AxiosResponse>`. <br>Exemple: `() => axios.get("https://run.mocky.io/v3/884c25f5-6dc2-4c01-b8d9-26c54042f94f")`',
|
|
28
28
|
table: {
|
|
29
29
|
category: 'props',
|
|
30
30
|
},
|
|
@@ -99,8 +99,8 @@ export const Default: Story = {
|
|
|
99
99
|
code: `<template>
|
|
100
100
|
<DownloadBtn
|
|
101
101
|
:file-promise="download"
|
|
102
|
-
@error="
|
|
103
|
-
@success="
|
|
102
|
+
@error="console.log('error')"
|
|
103
|
+
@success="console.log('success')"
|
|
104
104
|
>
|
|
105
105
|
Télécharger
|
|
106
106
|
</DownloadBtn>
|
|
@@ -114,7 +114,7 @@ export const Default: Story = {
|
|
|
114
114
|
import axios from 'axios'
|
|
115
115
|
|
|
116
116
|
const download = () => {
|
|
117
|
-
return axios.get('https://run.mocky.io/v3/
|
|
117
|
+
return axios.get('https://run.mocky.io/v3/884c25f5-6dc2-4c01-b8d9-26c54042f94f')
|
|
118
118
|
}
|
|
119
119
|
</script>
|
|
120
120
|
`,
|
|
@@ -122,7 +122,7 @@ export const Default: Story = {
|
|
|
122
122
|
],
|
|
123
123
|
},
|
|
124
124
|
args: {
|
|
125
|
-
filePromise: () => axios.get('https://run.mocky.io/v3/
|
|
125
|
+
filePromise: () => axios.get('https://run.mocky.io/v3/884c25f5-6dc2-4c01-b8d9-26c54042f94f'),
|
|
126
126
|
default: 'Télécharger',
|
|
127
127
|
onError: fn(),
|
|
128
128
|
onSuccess: fn(),
|
|
@@ -138,8 +138,8 @@ export const Error: Story = {
|
|
|
138
138
|
code: `<template>
|
|
139
139
|
<DownloadBtn
|
|
140
140
|
:file-promise="download"
|
|
141
|
-
@error="
|
|
142
|
-
@success="
|
|
141
|
+
@error="console.log('error')"
|
|
142
|
+
@success="console.log('success')"
|
|
143
143
|
>
|
|
144
144
|
Télécharger
|
|
145
145
|
</DownloadBtn>
|
|
@@ -177,8 +177,8 @@ export const Loading: Story = {
|
|
|
177
177
|
code: `<template>
|
|
178
178
|
<DownloadBtn
|
|
179
179
|
:file-promise="download"
|
|
180
|
-
@error="
|
|
181
|
-
@success="
|
|
180
|
+
@error="console.log('error')"
|
|
181
|
+
@success="console.log('success')"
|
|
182
182
|
>
|
|
183
183
|
Télécharger
|
|
184
184
|
</DownloadBtn>
|
|
@@ -222,8 +222,8 @@ export const Dark: Story = {
|
|
|
222
222
|
<VThemeProvider theme="dark" with-background class="pa-4">
|
|
223
223
|
<DownloadBtn
|
|
224
224
|
:file-promise="download"
|
|
225
|
-
@error="
|
|
226
|
-
@success="
|
|
225
|
+
@error="console.log('error')"
|
|
226
|
+
@success="console.log('success')"
|
|
227
227
|
>
|
|
228
228
|
Télécharger
|
|
229
229
|
</DownloadBtn>
|
|
@@ -257,7 +257,7 @@ export const Dark: Story = {
|
|
|
257
257
|
`,
|
|
258
258
|
}),
|
|
259
259
|
args: {
|
|
260
|
-
filePromise: () => axios.get('https://run.mocky.io/v3/
|
|
260
|
+
filePromise: () => axios.get('https://run.mocky.io/v3/884c25f5-6dc2-4c01-b8d9-26c54042f94f'),
|
|
261
261
|
default: 'Télécharger',
|
|
262
262
|
onError: fn(),
|
|
263
263
|
onSuccess: fn(),
|
|
@@ -274,8 +274,8 @@ export const Notify: Story = {
|
|
|
274
274
|
<NotificationBar />
|
|
275
275
|
<DownloadBtn
|
|
276
276
|
:file-promise="download"
|
|
277
|
-
@error="
|
|
278
|
-
@success="
|
|
277
|
+
@error="notify('Une error est survenue', 'error')"
|
|
278
|
+
@success="notify('Votre attestation a été téléchargée', 'success')"
|
|
279
279
|
>
|
|
280
280
|
Télécharger
|
|
281
281
|
</DownloadBtn>
|
|
@@ -286,8 +286,7 @@ export const Notify: Story = {
|
|
|
286
286
|
{
|
|
287
287
|
name: 'Script',
|
|
288
288
|
code: `<script setup lang="ts">
|
|
289
|
-
import { DownloadBtn } from '@cnamts/synapse'
|
|
290
|
-
import NotificationBar from '@cnamts/synapse'
|
|
289
|
+
import { DownloadBtn, NotificationBar } from '@cnamts/synapse'
|
|
291
290
|
|
|
292
291
|
import axios from 'axios'
|
|
293
292
|
|
|
@@ -312,7 +311,7 @@ export const Notify: Story = {
|
|
|
312
311
|
],
|
|
313
312
|
},
|
|
314
313
|
args: {
|
|
315
|
-
filePromise: () => axios.get('https://run.mocky.io/v3/
|
|
314
|
+
filePromise: () => axios.get('https://run.mocky.io/v3/884c25f5-6dc2-4c01-b8d9-26c54042f94f'),
|
|
316
315
|
default: 'Télécharger',
|
|
317
316
|
onError: fn(),
|
|
318
317
|
onSuccess: fn(),
|
|
@@ -362,8 +361,8 @@ export const Customization: Story = {
|
|
|
362
361
|
<DownloadBtn
|
|
363
362
|
:file-promise="download"
|
|
364
363
|
:vuetify-options="vuetifyOptions"
|
|
365
|
-
@error="
|
|
366
|
-
@success="
|
|
364
|
+
@error="console.log('error')"
|
|
365
|
+
@success="console.log('success')"
|
|
367
366
|
>
|
|
368
367
|
Télécharger
|
|
369
368
|
</DownloadBtn>
|
|
@@ -377,7 +376,7 @@ export const Customization: Story = {
|
|
|
377
376
|
import axios from 'axios'
|
|
378
377
|
|
|
379
378
|
const download = () => {
|
|
380
|
-
return axios.get('https://run.mocky.io/v3/
|
|
379
|
+
return axios.get('https://run.mocky.io/v3/884c25f5-6dc2-4c01-b8d9-26c54042f94f')
|
|
381
380
|
}
|
|
382
381
|
|
|
383
382
|
const vuetifyOptions = {
|
|
@@ -397,7 +396,7 @@ export const Customization: Story = {
|
|
|
397
396
|
],
|
|
398
397
|
},
|
|
399
398
|
args: {
|
|
400
|
-
filePromise: () => axios.get('https://run.mocky.io/v3/
|
|
399
|
+
filePromise: () => axios.get('https://run.mocky.io/v3/884c25f5-6dc2-4c01-b8d9-26c54042f94f'),
|
|
401
400
|
default: 'Télécharger',
|
|
402
401
|
onError: fn(),
|
|
403
402
|
onSuccess: fn(),
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import {Controls, Canvas, Meta, Source} from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import * as ExternalLinksStories from './ExternalLinks.stories.ts'
|
|
4
|
+
|
|
5
|
+
<Meta of={ExternalLinksStories} />
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# ExternalLinks
|
|
9
|
+
|
|
10
|
+
L'élément `ExternalLinks` est utilisé pour afficher un menu avec une liste vers des liens externes.
|
|
11
|
+
|
|
12
|
+
<Canvas of={ExternalLinksStories.Default} />
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
# API
|
|
16
|
+
|
|
17
|
+
<Controls of={ExternalLinksStories.Default} />
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
## Décalage
|
|
21
|
+
|
|
22
|
+
Vous pouvez décaler le composant vers le haut ou vers le bas en utilisant les props `nudge-top` et `nude-bottom`.
|
|
23
|
+
|
|
24
|
+
<Canvas of={ExternalLinksStories.NudgeTop} />
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
## Absence de données
|
|
28
|
+
|
|
29
|
+
Lorsqu'il n'y a pas de données, un message par défaut est affiché.
|
|
30
|
+
|
|
31
|
+
<Canvas of={ExternalLinksStories.NoData} />
|
|
32
|
+
|
|
33
|
+
## Composants Vuetify
|
|
34
|
+
|
|
35
|
+
Il est possibles de personnalisé les props passé aux composants utilisés en interne en utilisant la props `vuetifyOptions`.
|
|
36
|
+
|
|
37
|
+
<Canvas of={ExternalLinksStories.VuetifyOptions} />
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
## Slot `link-icon`
|
|
41
|
+
|
|
42
|
+
Vous pouvez utiliser le slot `link-icon` pour remplacer l'icône dans les liens.
|
|
43
|
+
|
|
44
|
+
<Canvas
|
|
45
|
+
of={ExternalLinksStories.CustomLinksIcon}
|
|
46
|
+
source={{
|
|
47
|
+
language: 'html',
|
|
48
|
+
format: 'dedent',
|
|
49
|
+
code: `
|
|
50
|
+
<script lang="ts" setup>
|
|
51
|
+
import { ExternalLinks } from '@cnamts/synapse'
|
|
52
|
+
import { VIcon } from 'vuetify/components'
|
|
53
|
+
import { mdiArrowTopRight } from '@mdi/js'
|
|
54
|
+
|
|
55
|
+
const items = [
|
|
56
|
+
{
|
|
57
|
+
text: 'ameli.fr',
|
|
58
|
+
href: 'https://www.ameli.fr',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
text: 'Github',
|
|
62
|
+
href: 'https://www.github.com',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
text: 'Twitter',
|
|
66
|
+
href: 'https://www.twitter.com',
|
|
67
|
+
},
|
|
68
|
+
]
|
|
69
|
+
|
|
70
|
+
const arrowIcon = mdiArrowTopRight
|
|
71
|
+
</script>
|
|
72
|
+
|
|
73
|
+
<template>
|
|
74
|
+
<ExternalLinks
|
|
75
|
+
:items
|
|
76
|
+
>
|
|
77
|
+
<template #link-icon>
|
|
78
|
+
<VIcon>
|
|
79
|
+
{{ arrowIcon }}
|
|
80
|
+
</VIcon>
|
|
81
|
+
</template>
|
|
82
|
+
</ExternalLinks>
|
|
83
|
+
</template>
|
|
84
|
+
`
|
|
85
|
+
}}
|
|
86
|
+
/>
|