@cnamts/synapse 0.0.3-alpha → 0.0.4-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.
Files changed (185) hide show
  1. package/dist/design-system-v3.d.ts +712 -27
  2. package/dist/design-system-v3.js +2715 -1485
  3. package/dist/design-system-v3.umd.cjs +10 -1
  4. package/dist/style.css +1 -1
  5. package/package.json +5 -2
  6. package/src/components/Alert/Alert.mdx +1 -1
  7. package/src/components/Alert/Alert.stories.ts +91 -1
  8. package/src/components/BackBtn/BackBtn.mdx +1 -1
  9. package/src/components/BackBtn/BackBtn.stories.ts +84 -1
  10. package/src/components/BackToTopBtn/BackToTopBtn.mdx +3 -3
  11. package/src/components/BackToTopBtn/BackToTopBtn.stories.ts +172 -11
  12. package/src/components/CollapsibleList/CollapsibleList.mdx +2 -2
  13. package/src/components/CollapsibleList/CollapsibleList.stories.ts +37 -1
  14. package/src/components/CopyBtn/CopyBtn.mdx +1 -1
  15. package/src/components/CopyBtn/CopyBtn.stories.ts +120 -1
  16. package/src/components/CopyBtn/CopyBtn.vue +1 -1
  17. package/src/components/Customs/CustomInputSelect/CustomInputSelect.mdx +6 -8
  18. package/src/components/Customs/CustomInputSelect/CustomInputSelect.stories.ts +270 -4
  19. package/src/components/Customs/CustomInputSelect/CustomInputSelect.vue +80 -53
  20. package/src/components/Customs/CustomInputSelect/config.ts +10 -0
  21. package/src/components/Customs/CustomSelect/CustomSelect.mdx +3 -3
  22. package/src/components/Customs/CustomSelect/CustomSelect.stories.ts +158 -2
  23. package/src/components/Customs/CustomSelect/CustomSelect.vue +25 -6
  24. package/src/components/Customs/CustomTextField/CustomTextField.mdx +44 -0
  25. package/src/components/Customs/CustomTextField/CustomTextField.stories.ts +403 -0
  26. package/src/components/Customs/CustomTextField/CustomTextField.vue +110 -0
  27. package/src/components/Customs/CustomTextField/tests/CustomTextField.spec.ts +93 -0
  28. package/src/components/Customs/CustomTextField/tests/__snapshots__/CustomTextField.spec.ts.snap +59 -0
  29. package/src/components/Customs/CustomTextField/types.d.ts +3 -0
  30. package/src/components/DataList/DataList.mdx +77 -0
  31. package/src/components/DataList/DataList.stories.ts +960 -0
  32. package/src/components/DataList/DataList.vue +140 -0
  33. package/src/components/DataList/DataListLoading/DataListLoading.vue +56 -0
  34. package/src/components/DataList/DataListLoading/tests/DataListLoading.spec.ts +23 -0
  35. package/src/components/DataList/locales.ts +3 -0
  36. package/src/components/DataList/tests/DataList.spec.ts +194 -0
  37. package/src/components/DataList/types.d.ts +23 -0
  38. package/src/components/DataListGroup/DataListGroup.mdx +77 -0
  39. package/src/components/DataListGroup/DataListGroup.stories.ts +987 -0
  40. package/src/components/DataListGroup/DataListGroup.vue +59 -0
  41. package/src/components/DataListGroup/tests/DataListGroup.spec.ts +54 -0
  42. package/src/components/DataListGroup/tests/data/dataListGroupItems.ts +41 -0
  43. package/src/components/DataListGroup/types.d.ts +15 -0
  44. package/src/components/DataListItem/DataListItem.vue +135 -0
  45. package/src/components/DataListItem/config.ts +17 -0
  46. package/src/components/DataListItem/locales.ts +3 -0
  47. package/src/components/DataListItem/tests/DataListItem.spec.ts +156 -0
  48. package/src/components/DataListItem/types.d.ts +23 -0
  49. package/src/components/DownloadBtn/Accessibilite.mdx +14 -0
  50. package/src/components/DownloadBtn/Accessibilite.stories.ts +166 -0
  51. package/src/components/DownloadBtn/AccessibiliteItems.ts +129 -0
  52. package/src/components/DownloadBtn/DownloadBtn.mdx +5 -6
  53. package/src/components/DownloadBtn/DownloadBtn.stories.ts +207 -2
  54. package/src/components/DownloadBtn/constants/ExpertiseLevelEnum.ts +4 -0
  55. package/src/components/FooterBar/FooterBar.mdx +2 -2
  56. package/src/components/FooterBar/FooterBar.stories.ts +1 -1
  57. package/src/components/FranceConnectBtn/FranceConnectBtn.mdx +1 -1
  58. package/src/components/FranceConnectBtn/FranceConnectBtn.stories.ts +58 -1
  59. package/src/components/HeaderBar/HeaderBar.mdx +164 -45
  60. package/src/components/HeaderBar/HeaderBar.stories.ts +559 -15
  61. package/src/components/HeaderBar/HeaderBar.vue +60 -22
  62. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderBurgerMenu.mdx +433 -0
  63. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderBurgerMenu.stories.ts +1089 -0
  64. package/src/components/HeaderBar/{HeaderComplexMenu/HeaderComplexMenu.vue → HeaderBurgerMenu/HeaderBurgerMenu.vue} +74 -45
  65. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuItem/HeaderMenuItem.mdx +38 -0
  66. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuItem/HeaderMenuItem.stories.ts +89 -0
  67. package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderMenuItem/tests/__snapshots__/HeaderMenuItem.spec.ts.snap +1 -1
  68. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuSection/HeaderMenuSection.mdx +17 -0
  69. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuSection/HeaderMenuSection.stories.ts +121 -0
  70. package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderMenuSection/HeaderMenuSection.vue +2 -2
  71. package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderMenuSection/tests/HeaderMenuSection.spec.ts +1 -3
  72. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.mdx +43 -0
  73. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.stories.ts +261 -0
  74. package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderSubMenu/HeaderSubMenu.vue +17 -3
  75. package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderSubMenu/tests/HeaderSubMenu.spec.ts +1 -1
  76. package/src/components/HeaderBar/HeaderBurgerMenu/tests/HeaderBurgerMenu.spec.ts +180 -0
  77. package/src/components/HeaderBar/HeaderBurgerMenu/tests/__snapshots__/HeaderBurgerMenu.spec.ts.snap +13 -0
  78. package/src/components/HeaderBar/HeaderBurgerMenu/tests/__snapshots__/HeaderComplexMenu.spec.ts.snap +13 -0
  79. package/src/components/HeaderBar/HeaderLogo/HeaderLogo.vue +62 -25
  80. package/src/components/HeaderBar/HeaderLogo/tests/HeaderLogo.spec.ts +49 -1
  81. package/src/components/HeaderBar/HeaderMenuBtn/HeaderMenuBtn.vue +19 -23
  82. package/src/components/HeaderBar/HeaderMenuBtn/tests/HeaderMenuBtn.spec.ts +70 -0
  83. package/src/components/HeaderBar/Usages.mdx +85 -0
  84. package/src/components/HeaderBar/consts.scss +0 -1
  85. package/src/components/HeaderBar/tests/HeaderBar.spec.ts +8 -2
  86. package/src/components/HeaderBar/tests/__snapshots__/HeaderBar.spec.ts.snap +5 -10
  87. package/src/components/HeaderLoading/HeaderLoading.mdx +28 -0
  88. package/src/components/HeaderLoading/HeaderLoading.stories.ts +62 -0
  89. package/src/components/HeaderLoading/HeaderLoading.vue +45 -0
  90. package/src/components/HeaderLoading/tests/HeaderLoading.spec.ts +22 -0
  91. package/src/components/HeaderNavigationBar/HeaderNavigationBar.mdx +128 -0
  92. package/src/components/HeaderNavigationBar/HeaderNavigationBar.stories.ts +784 -0
  93. package/src/components/HeaderNavigationBar/HeaderNavigationBar.vue +194 -0
  94. package/src/components/HeaderNavigationBar/HorizontalNavbar/HorizontalNavbar.vue +74 -0
  95. package/src/components/HeaderNavigationBar/HorizontalNavbar/config.ts +18 -0
  96. package/src/components/HeaderNavigationBar/tests/HeaderNavigationBar.spec.ts +127 -0
  97. package/src/components/HeaderNavigationBar/types.ts +7 -0
  98. package/src/components/HeaderToolbar/HeaderToolbar.mdx +31 -0
  99. package/src/components/HeaderToolbar/HeaderToolbar.stories.ts +343 -0
  100. package/src/components/HeaderToolbar/HeaderToolbar.vue +487 -0
  101. package/src/components/HeaderToolbar/tests/HeaderToolbar.spec.ts +196 -0
  102. package/src/components/HeaderToolbar/types.d.ts +20 -0
  103. package/src/components/LangBtn/LangBtn.mdx +1 -1
  104. package/src/components/LangBtn/LangBtn.stories.ts +125 -8
  105. package/src/components/Logo/Logo.mdx +2 -2
  106. package/src/components/Logo/Logo.stories.ts +147 -1
  107. package/src/components/LogoBrandSection/LogoBrandSection.mdx +14 -0
  108. package/src/components/LogoBrandSection/LogoBrandSection.stories.ts +158 -0
  109. package/src/components/LogoBrandSection/LogoBrandSection.vue +312 -0
  110. package/src/components/LogoBrandSection/assets/ameli-pro.svg +1 -0
  111. package/src/components/LogoBrandSection/assets/ameli.svg +1 -0
  112. package/src/components/LogoBrandSection/assets/cnam.svg +1 -0
  113. package/src/components/LogoBrandSection/assets/compte-ameli.svg +1 -0
  114. package/src/components/LogoBrandSection/dividerDimensionsMapping.ts +14 -0
  115. package/src/components/LogoBrandSection/locales.ts +14 -0
  116. package/src/components/LogoBrandSection/secondaryLogoMapping.ts +24 -0
  117. package/src/components/LogoBrandSection/tests/LogoBrandSection.spec.ts +365 -0
  118. package/src/components/LogoBrandSection/tests/__snapshots__/LogoBrandSection.spec.ts.snap +14 -0
  119. package/src/components/LogoBrandSection/types.ts +8 -0
  120. package/src/components/NotificationBar/NotificationBar.mdx +6 -6
  121. package/src/components/NotificationBar/NotificationBar.stories.ts +1 -1
  122. package/src/components/NotificationBar/NotificationBar.vue +2 -2
  123. package/src/components/NotificationBar/tests/NotificationBar.spec.ts +1 -1
  124. package/src/components/PageContainer/PageContainer.mdx +1 -1
  125. package/src/components/PageContainer/PageContainer.stories.ts +86 -1
  126. package/src/components/PhoneField/PhoneField.mdx +49 -0
  127. package/src/components/PhoneField/PhoneField.stories.ts +869 -0
  128. package/src/components/PhoneField/PhoneField.vue +230 -0
  129. package/src/components/PhoneField/indicatifs.ts +104 -0
  130. package/src/components/PhoneField/locales.ts +4 -0
  131. package/src/components/PhoneField/tests/PhoneField.spec.ts +179 -0
  132. package/src/components/SkipLink/SkipLink.stories.ts +50 -1
  133. package/src/components/SocialMediaLinks/SocialMediaLinks.mdx +28 -1
  134. package/src/components/SocialMediaLinks/SocialMediaLinks.stories.ts +37 -1
  135. package/src/components/SubHeader/SubHeader.mdx +31 -0
  136. package/src/components/SubHeader/SubHeader.stories.ts +1032 -0
  137. package/src/components/SubHeader/SubHeader.vue +185 -0
  138. package/src/components/SubHeader/config.ts +12 -0
  139. package/src/components/SubHeader/locales.ts +3 -0
  140. package/src/components/SubHeader/tests/SubHeader.spec.ts +144 -0
  141. package/src/components/index.ts +24 -7
  142. package/src/composables/widthable/index.ts +29 -0
  143. package/src/composables/widthable/tests/widthable.spec.ts +52 -0
  144. package/src/designTokens/tokens/cnam/cnamLightTheme.ts +2 -2
  145. package/src/main.ts +1 -0
  146. package/src/modules.d.ts +4 -0
  147. package/src/services/index.ts +1 -0
  148. package/src/stories/Demarrer/Accueil.mdx +10 -0
  149. package/src/stories/Demarrer/Accueil.stories.ts +76 -0
  150. package/src/stories/Demarrer/PolitiqueDeConfidentialite.mdx +9 -0
  151. package/src/stories/Demarrer/PolitiqueDeConfidentialite.stories.ts +20 -0
  152. package/src/stories/Fondamentaux/Accessibilite/Accessibilite.mdx +1 -2
  153. package/src/stories/Fondamentaux/Accessibilite/Accessibilite.stories.ts +1 -1
  154. package/src/stories/Fondamentaux/EcoConception/Econception.stories.ts +1 -1
  155. package/src/stories/GuideDuDev/moduleDeNotification.mdx +52 -48
  156. package/src/stories/GuideDuDev/vuetifyOptions.mdx +31 -28
  157. package/src/stories/Guidelines/CustomisationEtThemes.mdx +1 -1
  158. package/src/utils/functions/throttleDisplayFn/tests/throttleDisplayFn.spec.ts +47 -0
  159. package/src/utils/functions/throttleDisplayFn/throttleDisplayFn.ts +26 -0
  160. package/src/utils/rules/exactLength/index.ts +33 -0
  161. package/src/utils/rules/exactLength/locales.ts +6 -0
  162. package/src/utils/rules/required/index.ts +25 -0
  163. package/src/utils/rules/required/locales.ts +5 -0
  164. package/src/utils/rules/required/ruleMessageHelper.ts +14 -0
  165. package/src/utils/rules/required/tests/index.spec.ts +47 -0
  166. package/src/utils/rules/required/tests/rulesMessageHelper.spec.ts +22 -0
  167. package/src/utils/rules/types.d.ts +15 -0
  168. package/src/components/Beta/beta.mdx +0 -5
  169. package/src/components/Deprecated/deprecated.mdx +0 -5
  170. package/src/components/HeaderBar/HeaderComplexMenu/HeaderComplexMenu.stories.ts +0 -272
  171. package/src/components/HeaderBar/HeaderComplexMenu/HeaderMenuItem/HeaderMenuItem.stories.ts +0 -49
  172. package/src/components/HeaderBar/HeaderComplexMenu/HeaderMenuSection/HeaderMenuSection.stories.ts +0 -56
  173. package/src/components/HeaderBar/HeaderComplexMenu/HeaderSubMenu/HeaderSubMenu.stories.ts +0 -137
  174. package/src/components/HeaderBar/HeaderComplexMenu/tests/HeaderComplexMenu.spec.ts +0 -129
  175. package/src/components/HeaderBar/HeaderComplexMenu/tests/__snapshots__/HeaderComplexMenu.spec.ts.snap +0 -18
  176. package/src/stories/Home/Accueil.mdx +0 -7
  177. package/src/stories/Home/PolitiqueDeConfidentialite.mdx +0 -4
  178. package/src/stories/Home/synapse.webp +0 -0
  179. /package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderMenuItem/HeaderMenuItem.vue +0 -0
  180. /package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/HeaderMenuItem/tests/HeaderMenuItem.spec.ts +0 -0
  181. /package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/conts.ts +0 -0
  182. /package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/locals.ts +0 -0
  183. /package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/tests/useHandleSubMenus.spec.ts +0 -0
  184. /package/src/components/HeaderBar/{HeaderComplexMenu → HeaderBurgerMenu}/useHandleSubMenus.ts +0 -0
  185. /package/src/components/Logo/{types.d.ts → types.ts} +0 -0
@@ -0,0 +1,987 @@
1
+ import DataListGroup from './DataListGroup.vue'
2
+ import type { Meta, StoryObj } from '@storybook/vue3'
3
+ import { mdiAccount, mdiCalendar, mdiCardAccountDetails, mdiDoctor, mdiPencil } from '@mdi/js'
4
+
5
+ const meta: Meta<typeof DataListGroup> = {
6
+ title: 'Composants/Données/DataListGroup',
7
+ component: DataListGroup,
8
+ parameters: {
9
+ layout: 'fullscreen',
10
+ controls: { exclude: ['width', 'minWidth', 'maxWidth'] },
11
+ },
12
+ argTypes: {
13
+ items: { control: 'object' },
14
+ icons: { control: 'object' },
15
+ itemWidth: { control: 'text' },
16
+ loading: { control: 'boolean' },
17
+ renderHtmlValue: { control: 'boolean' },
18
+ },
19
+ }
20
+
21
+ export default meta
22
+
23
+ type Story = StoryObj<typeof meta>
24
+
25
+ export const Default: Story = {
26
+ parameters: {
27
+ sourceCode: [
28
+ {
29
+ name: 'Template',
30
+ code: `
31
+ <template>
32
+ <DataListGroup :items="items" />
33
+ </template>
34
+ `,
35
+ },
36
+ {
37
+ name: 'Script',
38
+ code: `
39
+ <script setup lang="ts">
40
+ import DataListGroup from '@cnamts/synapse'
41
+
42
+ const items = [
43
+ {
44
+ title: 'Informations patient',
45
+ items: [
46
+ {
47
+ key: 'Nom',
48
+ value: 'Dupont',
49
+ },
50
+ {
51
+ key: 'Prénom',
52
+ value: 'Paul',
53
+ },
54
+ {
55
+ key: 'Date de naissance',
56
+ value: '24/09/1970',
57
+ },
58
+ ],
59
+ },
60
+ {
61
+ title: 'Médecin traitant',
62
+ items: [
63
+ {
64
+ key: 'Nom du praticien',
65
+ value: 'Gérard Leblanc',
66
+ },
67
+ {
68
+ key: 'N° RPPS',
69
+ value: 'XXXXX',
70
+ },
71
+ ],
72
+ },
73
+ {
74
+ title: 'Autres informations',
75
+ items: [
76
+ {
77
+ key: 'Dernière modification',
78
+ value: '04/06/2020',
79
+ },
80
+ ],
81
+ },
82
+ ]
83
+ </script>
84
+ `,
85
+ },
86
+ ],
87
+ },
88
+ args: {
89
+ items: [
90
+ {
91
+ title: 'Informations patient',
92
+ items: [
93
+ {
94
+ key: 'Nom',
95
+ value: 'Dupont',
96
+ },
97
+ {
98
+ key: 'Prénom',
99
+ value: 'Paul',
100
+ },
101
+ {
102
+ key: 'Date de naissance',
103
+ value: '24/09/1970',
104
+ },
105
+ ],
106
+ },
107
+ {
108
+ title: 'Médecin traitant',
109
+ items: [
110
+ {
111
+ key: 'Nom du praticien',
112
+ value: 'Gérard Leblanc',
113
+ },
114
+
115
+ {
116
+ key: 'N° RPPS',
117
+ value: 'XXXXX',
118
+ },
119
+ ],
120
+ },
121
+ {
122
+ title: 'Autres informations',
123
+ items: [
124
+ {
125
+ key: 'Dernière modification',
126
+ value: '04/06/2020',
127
+ },
128
+ ],
129
+ },
130
+ ],
131
+ icons: undefined,
132
+ itemWidth: '200px',
133
+ loading: false,
134
+ renderHtmlValue: false,
135
+ },
136
+ render: (args) => {
137
+ return {
138
+ components: { DataListGroup },
139
+ setup() {
140
+ return { args }
141
+ },
142
+ template: `
143
+ <div class="pa-4">
144
+ <DataListGroup
145
+ v-bind="args"
146
+ :items="args.items"
147
+ :icons="args.icons"
148
+ :item-width="args.itemWidth"
149
+ :loading="args.loading"
150
+ :render-html-value="args.renderHtmlValue"
151
+ />
152
+ </div>
153
+ `,
154
+ }
155
+ },
156
+ }
157
+
158
+ export const Icons: Story = {
159
+ parameters: {
160
+ controls: { exclude: ['itemWidth', 'loading', 'renderHtmlValue', 'click:list-item'] },
161
+ sourceCode: [
162
+ {
163
+ name: 'Template',
164
+ code: `
165
+ <template>
166
+ <DataListGroup
167
+ :items="items"
168
+ :icons="icons"
169
+ />
170
+ </template>
171
+ `,
172
+ },
173
+ {
174
+ name: 'Script',
175
+ code: `
176
+ <script setup lang="ts">
177
+ import DataListGroup from '@cnamts/synapse'
178
+ import { mdiCalendar, mdiAccount, mdiDoctor, mdiCardAccountDetails, mdiPencil } from '@mdi/js'
179
+
180
+ const icons = {
181
+ calendarIcon: mdiCalendar,
182
+ accountIcon: mdiAccount,
183
+ doctorIcon: mdiDoctor,
184
+ cardAccountIcon: mdiCardAccountDetails,
185
+ editIcon: mdiPencil,
186
+ }
187
+
188
+ const items = [
189
+ {
190
+ title: 'Informations patient',
191
+ items: [
192
+ {
193
+ key: 'Nom',
194
+ value: 'Dupont',
195
+ icon: 'accountIcon',
196
+ },
197
+ {
198
+ key: 'Prénom',
199
+ value: 'Paul',
200
+ icon: 'accountIcon',
201
+ },
202
+ {
203
+ key: 'Date de naissance',
204
+ value: '24/09/1970',
205
+ icon: 'calendarIcon',
206
+ },
207
+ ],
208
+ },
209
+ {
210
+ title: 'Médecin traitant',
211
+ items: [
212
+ {
213
+ key: 'Nom du praticien',
214
+ value: 'Gérard Leblanc',
215
+ icon: 'doctorIcon',
216
+ },
217
+ {
218
+ key: 'N° RPPS',
219
+ value: 'XXXXX',
220
+ icon: 'cardAccountIcon',
221
+ },
222
+ ],
223
+ },
224
+ {
225
+ title: 'Autres informations',
226
+ items: [
227
+ {
228
+ key: 'Dernière modification',
229
+ value: '04/06/2020',
230
+ icon: 'editIcon',
231
+ },
232
+ ],
233
+ },
234
+ ]
235
+ </script>
236
+ `,
237
+ },
238
+ ],
239
+ },
240
+ args: {
241
+ items: [
242
+ {
243
+ title: 'Informations patient',
244
+ items: [
245
+ {
246
+ key: 'Nom',
247
+ value: 'Dupont',
248
+ icon: 'accountIcon',
249
+ },
250
+ {
251
+ key: 'Prénom',
252
+ value: 'Paul',
253
+ icon: 'accountIcon',
254
+ },
255
+ {
256
+ key: 'Date de naissance',
257
+ value: '24/09/1970',
258
+ icon: 'calendarIcon',
259
+ },
260
+ ],
261
+ },
262
+ {
263
+ title: 'Médecin traitant',
264
+ items: [
265
+ {
266
+ key: 'Nom du praticien',
267
+ value: 'Gérard Leblanc',
268
+ icon: 'doctorIcon',
269
+ },
270
+ {
271
+ key: 'N° RPPS',
272
+ value: 'XXXXX',
273
+ icon: 'cardAccountIcon',
274
+ },
275
+ ],
276
+ },
277
+ {
278
+ title: 'Autres informations',
279
+ items: [
280
+ {
281
+ key: 'Dernière modification',
282
+ value: '04/06/2020',
283
+ icon: 'editIcon',
284
+ },
285
+ ],
286
+ },
287
+ ],
288
+ icons: {
289
+ calendarIcon: mdiCalendar,
290
+ accountIcon: mdiAccount,
291
+ doctorIcon: mdiDoctor,
292
+ cardAccountIcon: mdiCardAccountDetails,
293
+ editIcon: mdiPencil,
294
+ },
295
+ },
296
+ render: (args) => {
297
+ return {
298
+ components: { DataListGroup },
299
+ setup() {
300
+ return { args }
301
+ },
302
+ template: `
303
+ <div class="pa-4">
304
+ <DataListGroup
305
+ v-bind="args"
306
+ :items="args.items"
307
+ :icons="args.icons"
308
+ />
309
+ </div>
310
+ `,
311
+ }
312
+ },
313
+ }
314
+
315
+ export const ActionBtn: Story = {
316
+ parameters: {
317
+ controls: { exclude: ['icons', 'itemWidth', 'loading', 'renderHtmlValue', 'click:list-item'] },
318
+ sourceCode: [
319
+ {
320
+ name: 'Template',
321
+ code: `
322
+ <template>
323
+ <DataListGroup
324
+ :items="items"
325
+ @click:list-item="updateBirthdate"
326
+ />
327
+ </template>
328
+ `,
329
+ },
330
+ {
331
+ name: 'Script',
332
+ code: `
333
+ <script setup lang="ts">
334
+ import DataListGroup from '@cnamts/synapse'
335
+
336
+ const items = [
337
+ {
338
+ title: 'Informations patient',
339
+ items: [
340
+ {
341
+ key: 'Nom',
342
+ value: 'Dupont',
343
+ },
344
+ {
345
+ key: 'Prénom',
346
+ value: 'Paul',
347
+ },
348
+ {
349
+ key: 'Date de naissance',
350
+ value: '24/09/1970',
351
+ action: 'Modifier',
352
+ },
353
+ ],
354
+ },
355
+ {
356
+ title: 'Médecin traitant',
357
+ items: [
358
+ {
359
+ key: 'Nom du praticien',
360
+ value: 'Gérard Leblanc',
361
+ },
362
+ {
363
+ key: 'N° RPPS',
364
+ value: 'XXXXX',
365
+ },
366
+ ],
367
+ },
368
+ {
369
+ title: 'Autres informations',
370
+ items: [
371
+ {
372
+ key: 'Dernière modification',
373
+ value: '04/06/2020',
374
+ },
375
+ ],
376
+ },
377
+ ]
378
+
379
+ const updateBirthdate = (eventValue: object) => {
380
+ items.value[eventValue.dataListIndex].items[eventValue.itemIndex].value = '25/09/1970'
381
+ }
382
+ </script>
383
+ `,
384
+ },
385
+ ],
386
+ },
387
+ args: {
388
+ items: [
389
+ {
390
+ title: 'Informations patient',
391
+ items: [
392
+ {
393
+ key: 'Nom',
394
+ value: 'Dupont',
395
+ },
396
+ {
397
+ key: 'Prénom',
398
+ value: 'Paul',
399
+ },
400
+ {
401
+ key: 'Date de naissance',
402
+ value: '24/09/1970',
403
+ action: 'Modifier',
404
+ },
405
+ ],
406
+ },
407
+ {
408
+ title: 'Médecin traitant',
409
+ items: [
410
+ {
411
+ key: 'Nom du praticien',
412
+ value: 'Gérard Leblanc',
413
+ },
414
+
415
+ {
416
+ key: 'N° RPPS',
417
+ value: 'XXXXX',
418
+ },
419
+ ],
420
+ },
421
+ {
422
+ title: 'Autres informations',
423
+ items: [
424
+ {
425
+ key: 'Dernière modification',
426
+ value: '04/06/2020',
427
+ },
428
+ ],
429
+ },
430
+ ],
431
+ icons: undefined,
432
+ itemWidth: '200px',
433
+ loading: false,
434
+ renderHtmlValue: false,
435
+ },
436
+ render: (args) => {
437
+ return {
438
+ components: { DataListGroup },
439
+ setup() {
440
+ const updateBirthdate = (eventValue: { dataListIndex: number, itemIndex: number }) => {
441
+ args.items[eventValue.dataListIndex].items[eventValue.itemIndex].value = '25/09/1970'
442
+ }
443
+ return { args, updateBirthdate }
444
+ },
445
+ template: `
446
+ <div class="pa-4">
447
+ <DataListGroup
448
+ v-bind="args"
449
+ :items="args.items"
450
+ @click:list-item="updateBirthdate"
451
+ />
452
+ </div>
453
+ `,
454
+ }
455
+ },
456
+ }
457
+
458
+ export const ItemWidth: Story = {
459
+ parameters: {
460
+ controls: { exclude: ['icons', 'loading', 'renderHtmlValue', 'click:list-item'] },
461
+ sourceCode: [
462
+ {
463
+ name: 'Template',
464
+ code: `
465
+ <template>
466
+ <DataListGroup
467
+ :items="items"
468
+ item-width="300px"
469
+ />
470
+ </template>
471
+ `,
472
+ },
473
+ {
474
+ name: 'Script',
475
+ code: `
476
+ <script setup lang="ts">
477
+ import DataListGroup from '@cnamts/synapse'
478
+
479
+ const items = [
480
+ {
481
+ title: 'Informations patient',
482
+ items: [
483
+ {
484
+ key: 'Nom',
485
+ value: 'Dupont',
486
+ },
487
+ {
488
+ key: 'Prénom',
489
+ value: 'Paul',
490
+ },
491
+ {
492
+ key: 'Date de naissance',
493
+ value: '24/09/1970',
494
+ },
495
+ ],
496
+ },
497
+ {
498
+ title: 'Médecin traitant',
499
+ items: [
500
+ {
501
+ key: 'Nom du praticien',
502
+ value: 'Gérard Leblanc',
503
+ },
504
+ {
505
+ key: 'N° RPPS',
506
+ value: 'XXXXX',
507
+ },
508
+ ],
509
+ },
510
+ {
511
+ title: 'Autres informations',
512
+ items: [
513
+ {
514
+ key: 'Dernière modification',
515
+ value: '04/06/2020',
516
+ },
517
+ ],
518
+ },
519
+ ]
520
+ </script>
521
+ `,
522
+ },
523
+ ],
524
+ },
525
+ args: {
526
+ items: [
527
+ {
528
+ title: 'Informations patient',
529
+ items: [
530
+ {
531
+ key: 'Nom',
532
+ value: 'Dupont',
533
+ },
534
+ {
535
+ key: 'Prénom',
536
+ value: 'Paul',
537
+ },
538
+ {
539
+ key: 'Date de naissance',
540
+ value: '24/09/1970',
541
+ },
542
+ ],
543
+ },
544
+ {
545
+ title: 'Médecin traitant',
546
+ items: [
547
+ {
548
+ key: 'Nom du praticien',
549
+ value: 'Gérard Leblanc',
550
+ },
551
+
552
+ {
553
+ key: 'N° RPPS',
554
+ value: 'XXXXX',
555
+ },
556
+ ],
557
+ },
558
+ {
559
+ title: 'Autres informations',
560
+ items: [
561
+ {
562
+ key: 'Dernière modification',
563
+ value: '04/06/2020',
564
+ },
565
+ ],
566
+ },
567
+ ],
568
+ itemWidth: '300px',
569
+ },
570
+ render: (args) => {
571
+ return {
572
+ components: { DataListGroup },
573
+ setup() {
574
+ return { args }
575
+ },
576
+ template: `
577
+ <div class="pa-4">
578
+ <DataListGroup
579
+ v-bind="args"
580
+ :items="args.items"
581
+ :item-width="args.itemWidth"
582
+ />
583
+ </div>
584
+ `,
585
+ }
586
+ },
587
+ }
588
+
589
+ export const Chips: Story = {
590
+ parameters: {
591
+ controls: { exclude: ['icons', 'loading', 'itemWidth', 'renderHtmlValue', 'click:list-item'] },
592
+ sourceCode: [
593
+ {
594
+ name: 'Template',
595
+ code: `
596
+ <template>
597
+ <DataListGroup :items="items" />
598
+ </template>
599
+ `,
600
+ },
601
+ {
602
+ name: 'Script',
603
+ code: `
604
+ <script setup lang="ts">
605
+ import DataListGroup from '@cnamts/synapse'
606
+
607
+ const items = [
608
+ {
609
+ title: 'Informations patient',
610
+ items: [
611
+ {
612
+ key: 'Nom',
613
+ value: 'Dupont',
614
+ chip: true
615
+ },
616
+ {
617
+ key: 'Prénom',
618
+ value: 'Paul',
619
+ chip: true
620
+ },
621
+ {
622
+ key: 'Date de naissance',
623
+ value: '24/09/1970',
624
+ chip: true
625
+ },
626
+ ],
627
+ },
628
+ {
629
+ title: 'Médecin traitant',
630
+ items: [
631
+ {
632
+ key: 'Nom du praticien',
633
+ value: 'Gérard Leblanc',
634
+ chip: true
635
+ },
636
+ {
637
+ key: 'N° RPPS',
638
+ value: 'XXXXX',
639
+ chip: true
640
+ },
641
+ ],
642
+ },
643
+ {
644
+ title: 'Autres informations',
645
+ items: [
646
+ {
647
+ key: 'Dernière modification',
648
+ value: '04/06/2020',
649
+ chip: true
650
+ },
651
+ ],
652
+ },
653
+ ]
654
+ </script>
655
+ `,
656
+ },
657
+ ],
658
+ },
659
+ args: {
660
+ items: [
661
+ {
662
+ title: 'Informations patient',
663
+ items: [
664
+ {
665
+ key: 'Nom',
666
+ value: 'Dupont',
667
+ chip: true,
668
+ },
669
+ {
670
+ key: 'Prénom',
671
+ value: 'Paul',
672
+ chip: true,
673
+ },
674
+ {
675
+ key: 'Date de naissance',
676
+ value: '24/09/1970',
677
+ chip: true,
678
+ },
679
+ ],
680
+ },
681
+ {
682
+ title: 'Médecin traitant',
683
+ items: [
684
+ {
685
+ key: 'Nom du praticien',
686
+ value: 'Gérard Leblanc',
687
+ chip: true,
688
+ },
689
+
690
+ {
691
+ key: 'N° RPPS',
692
+ value: 'XXXXX',
693
+ chip: true,
694
+ },
695
+ ],
696
+ },
697
+ {
698
+ title: 'Autres informations',
699
+ items: [
700
+ {
701
+ key: 'Dernière modification',
702
+ value: '04/06/2020',
703
+ chip: true,
704
+ },
705
+ ],
706
+ },
707
+ ],
708
+ },
709
+ render: (args) => {
710
+ return {
711
+ components: { DataListGroup },
712
+ setup() {
713
+ return { args }
714
+ },
715
+ template: `
716
+ <div class="pa-4">
717
+ <DataListGroup
718
+ v-bind="args"
719
+ :items="args.items"
720
+ />
721
+ </div>
722
+ `,
723
+ }
724
+ },
725
+ }
726
+
727
+ export const HtmlValue: Story = {
728
+ parameters: {
729
+ controls: { exclude: ['icons', 'loading', 'itemsWidth', 'click:list-item'] },
730
+ sourceCode: [
731
+ {
732
+ name: 'Template',
733
+ code: `
734
+ <template>
735
+ <DataListGroup
736
+ :items="items"
737
+ render-html-value
738
+ />
739
+ </template>
740
+ `,
741
+ },
742
+ {
743
+ name: 'Script',
744
+ code: `
745
+ <script setup lang="ts">
746
+ import DataListGroup from '@cnamts/synapse'
747
+
748
+ const items = [
749
+ {
750
+ title: 'Informations patient',
751
+ items: [
752
+ {
753
+ key: 'Nom',
754
+ value: 'Dupont',
755
+ },
756
+ {
757
+ key: 'Prénom',
758
+ value: 'Paul',
759
+ },
760
+ {
761
+ key: 'Date de naissance',
762
+ value: '24/09/1970',
763
+ },
764
+ ],
765
+ },
766
+ {
767
+ title: 'Médecin traitant',
768
+ items: [
769
+ {
770
+ key: 'Nom du praticien',
771
+ value: 'Gérard Leblanc',
772
+ },
773
+ {
774
+ key: 'N° RPPS',
775
+ value: 'XXXXX',
776
+ },
777
+ ],
778
+ },
779
+ {
780
+ title: 'Autres informations',
781
+ items: [
782
+ {
783
+ key: 'Adresse',
784
+ value: '<b>50 Avenue du Professeur André Lemierre</b><br>75020 Paris'
785
+ },
786
+ ],
787
+ },
788
+ ]
789
+ </script>
790
+ `,
791
+ },
792
+ ],
793
+ },
794
+ args: {
795
+ items: [
796
+ {
797
+ title: 'Informations patient',
798
+ items: [
799
+ {
800
+ key: 'Nom',
801
+ value: 'Dupont',
802
+ },
803
+ {
804
+ key: 'Prénom',
805
+ value: 'Paul',
806
+ },
807
+ {
808
+ key: 'Date de naissance',
809
+ value: '24/09/1970',
810
+ },
811
+ ],
812
+ },
813
+ {
814
+ title: 'Médecin traitant',
815
+ items: [
816
+ {
817
+ key: 'Nom du praticien',
818
+ value: 'Gérard Leblanc',
819
+ },
820
+
821
+ {
822
+ key: 'N° RPPS',
823
+ value: 'XXXXX',
824
+ },
825
+ ],
826
+ },
827
+ {
828
+ title: 'Autres informations',
829
+ items: [
830
+ {
831
+ key: 'Adresse',
832
+ value: '<b>50 Avenue du Professeur André Lemierre</b><br>75020 Paris',
833
+ },
834
+ ],
835
+ },
836
+ ],
837
+ renderHtmlValue: true,
838
+ },
839
+ render: (args) => {
840
+ return {
841
+ components: { DataListGroup },
842
+ setup() {
843
+ return { args }
844
+ },
845
+ template: `
846
+ <div class="pa-4">
847
+ <DataListGroup
848
+ v-bind="args"
849
+ :items="args.items"
850
+ :render-html-value="args.renderHtmlValue"
851
+ />
852
+ </div>
853
+ `,
854
+ }
855
+ },
856
+ }
857
+
858
+ export const Loading: Story = {
859
+ parameters: {
860
+ controls: { exclude: ['icons', 'itemsWidth', 'renderHtmlValue', 'click:list-item'] },
861
+ sourceCode: [
862
+ {
863
+ name: 'Template',
864
+ code: `
865
+ <template>
866
+ <DataListGroup
867
+ :items="items"
868
+ loading
869
+ />
870
+ </template>
871
+ `,
872
+ },
873
+ {
874
+ name: 'Script',
875
+ code: `
876
+ <script setup lang="ts">
877
+ import DataListGroup from '@cnamts/synapse'
878
+
879
+ const items = [
880
+ {
881
+ title: 'Informations patient',
882
+ items: [
883
+ {
884
+ key: 'Nom',
885
+ value: 'Dupont',
886
+ },
887
+ {
888
+ key: 'Prénom',
889
+ value: 'Paul',
890
+ },
891
+ {
892
+ key: 'Date de naissance',
893
+ value: '24/09/1970',
894
+ },
895
+ ],
896
+ },
897
+ {
898
+ title: 'Médecin traitant',
899
+ items: [
900
+ {
901
+ key: 'Nom du praticien',
902
+ value: 'Gérard Leblanc',
903
+ },
904
+ {
905
+ key: 'N° RPPS',
906
+ value: 'XXXXX',
907
+ },
908
+ ],
909
+ },
910
+ {
911
+ title: 'Autres informations',
912
+ items: [
913
+ {
914
+ key: 'Dernière modification',
915
+ value: '04/06/2020',
916
+ },
917
+ ],
918
+ },
919
+ ]
920
+ </script>
921
+ `,
922
+ },
923
+ ],
924
+ },
925
+ args: {
926
+ items: [
927
+ {
928
+ title: 'Informations patient',
929
+ items: [
930
+ {
931
+ key: 'Nom',
932
+ value: 'Dupont',
933
+ },
934
+ {
935
+ key: 'Prénom',
936
+ value: 'Paul',
937
+ },
938
+ {
939
+ key: 'Date de naissance',
940
+ value: '24/09/1970',
941
+ },
942
+ ],
943
+ },
944
+ {
945
+ title: 'Médecin traitant',
946
+ items: [
947
+ {
948
+ key: 'Nom du praticien',
949
+ value: 'Gérard Leblanc',
950
+ },
951
+
952
+ {
953
+ key: 'N° RPPS',
954
+ value: 'XXXXX',
955
+ },
956
+ ],
957
+ },
958
+ {
959
+ title: 'Autres informations',
960
+ items: [
961
+ {
962
+ key: 'Dernière modification',
963
+ value: '04/06/2020',
964
+ },
965
+ ],
966
+ },
967
+ ],
968
+ loading: true,
969
+ },
970
+ render: (args) => {
971
+ return {
972
+ components: { DataListGroup },
973
+ setup() {
974
+ return { args }
975
+ },
976
+ template: `
977
+ <div class="pa-4">
978
+ <DataListGroup
979
+ v-bind="args"
980
+ :items="args.items"
981
+ :loading="args.loading"
982
+ />
983
+ </div>
984
+ `,
985
+ }
986
+ },
987
+ }