@cnamts/synapse 0.0.14-alpha → 0.0.16-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 (108) hide show
  1. package/dist/components/CookiesSelection/CookiesSelection.d.ts +26 -26
  2. package/dist/components/Customs/SyInputSelect/SyInputSelect.d.ts +2 -2
  3. package/dist/components/Customs/SySelect/SySelect.d.ts +24 -12
  4. package/dist/components/Customs/SySelect/locales.d.ts +3 -0
  5. package/dist/components/Customs/SyTextField/SyTextField.d.ts +1393 -3
  6. package/dist/components/DatePicker/DatePicker.d.ts +3532 -22
  7. package/dist/components/DatePicker/DateTextInput.d.ts +1408 -11
  8. package/dist/components/DialogBox/config.d.ts +1 -1
  9. package/dist/components/DownloadBtn/DownloadBtn.d.ts +2 -0
  10. package/dist/components/LangBtn/LangBtn.d.ts +467 -1
  11. package/dist/components/LangBtn/config.d.ts +1 -3
  12. package/dist/components/NirField/NirField.d.ts +2805 -15
  13. package/dist/components/PasswordField/PasswordField.d.ts +2 -2
  14. package/dist/components/PeriodField/PeriodField.d.ts +7345 -325
  15. package/dist/components/PhoneField/PhoneField.d.ts +3 -3
  16. package/dist/components/SelectBtnField/SelectBtnField.d.ts +1 -1
  17. package/dist/components/SkipLink/SkipLink.d.ts +3 -2
  18. package/dist/components/SyAlert/SyAlert.d.ts +72 -1
  19. package/dist/components/UploadWorkflow/UploadWorkflow.d.ts +26 -26
  20. package/dist/components/UserMenuBtn/UserMenuBtn.d.ts +2 -0
  21. package/dist/components/index.d.ts +2 -0
  22. package/dist/composables/date/useDateFormat.d.ts +2 -2
  23. package/dist/composables/date/useDateFormatDayjs.d.ts +23 -0
  24. package/dist/composables/date/useDateInitializationDayjs.d.ts +18 -0
  25. package/dist/design-system-v3.js +4314 -3987
  26. package/dist/design-system-v3.umd.cjs +1 -1
  27. package/dist/style.css +1 -1
  28. package/dist/vuetifyConfig.d.ts +1 -0
  29. package/package.json +1 -1
  30. package/src/components/BackBtn/Accessibilite.stories.ts +4 -0
  31. package/src/components/BackBtn/BackBtn.vue +2 -1
  32. package/src/components/BackToTopBtn/Accessibilite.stories.ts +4 -0
  33. package/src/components/BackToTopBtn/BackToTopBtn.stories.ts +78 -21
  34. package/src/components/BackToTopBtn/BackToTopBtn.vue +15 -0
  35. package/src/components/BackToTopBtn/config.ts +2 -2
  36. package/src/components/BackToTopBtn/tests/__snapshots__/BackToTopBtn.spec.ts.snap +4 -4
  37. package/src/components/CopyBtn/Accessibilite.stories.ts +4 -0
  38. package/src/components/Customs/SyBtnSelect/SyBtnSelect.stories.ts +2 -2
  39. package/src/components/Customs/SyBtnSelect/SyBtnSelect.vue +0 -1
  40. package/src/components/Customs/SyInputSelect/SyInputSelect.stories.ts +3 -3
  41. package/src/components/Customs/SyInputSelect/SyInputSelect.vue +4 -4
  42. package/src/components/Customs/SySelect/SySelect.stories.ts +4 -0
  43. package/src/components/Customs/SySelect/SySelect.vue +75 -10
  44. package/src/components/Customs/SySelect/locales.ts +3 -0
  45. package/src/components/Customs/SySelect/tests/SySelect.spec.ts +24 -2
  46. package/src/components/Customs/SyTextField/Accessibilite.stories.ts +7 -0
  47. package/src/components/Customs/SyTextField/SyTextField.stories.ts +14 -1
  48. package/src/components/Customs/SyTextField/SyTextField.vue +85 -20
  49. package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.vue +795 -0
  50. package/src/components/DatePicker/DatePicker.stories.ts +432 -1
  51. package/src/components/DatePicker/DatePicker.vue +143 -76
  52. package/src/components/DatePicker/DatePickerValidation.mdx +338 -0
  53. package/src/components/DatePicker/DatePickerValidation.stories.ts +30 -0
  54. package/src/components/DatePicker/DateTextInput.vue +87 -135
  55. package/src/components/DatePicker/docExamples/DatePickerBidirectionalValidation.vue +282 -0
  56. package/src/components/DatePicker/docExamples/DatePickerValidationExamples.vue +535 -0
  57. package/src/components/DatePicker/tests/DatePicker.spec.ts +33 -32
  58. package/src/components/DatePicker/tests/DateTextInput.spec.ts +83 -35
  59. package/src/components/DialogBox/DialogBox.stories.ts +5 -2
  60. package/src/components/DialogBox/DialogBox.vue +1 -1
  61. package/src/components/DialogBox/config.ts +1 -1
  62. package/src/components/DownloadBtn/Accessibilite.stories.ts +4 -0
  63. package/src/components/DownloadBtn/DownloadBtn.stories.ts +17 -8
  64. package/src/components/DownloadBtn/DownloadBtn.vue +13 -6
  65. package/src/components/DownloadBtn/tests/__snapshots__/DownloadBtn.spec.ts.snap +0 -2
  66. package/src/components/FranceConnectBtn/Accessibilite.stories.ts +4 -0
  67. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuItem/HeaderMenuItem.vue +3 -0
  68. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.vue +3 -0
  69. package/src/components/HeaderBar/HeaderBurgerMenu/menu.scss +19 -0
  70. package/src/components/HeaderBar/HeaderMenuBtn/HeaderMenuBtn.vue +12 -2
  71. package/src/components/LangBtn/Accessibilite.stories.ts +4 -0
  72. package/src/components/LangBtn/LangBtn.stories.ts +1 -4
  73. package/src/components/LangBtn/LangBtn.vue +68 -9
  74. package/src/components/LangBtn/config.ts +0 -1
  75. package/src/components/LangBtn/tests/LangBtn.spec.ts +30 -2
  76. package/src/components/PageContainer/Accessibilite.stories.ts +36 -23
  77. package/src/components/PaginatedTable/PaginatedTable.stories.ts +144 -18
  78. package/src/components/PasswordField/PasswordField.stories.ts +6 -6
  79. package/src/components/PasswordField/PasswordField.vue +3 -3
  80. package/src/components/PeriodField/PeriodField.vue +4 -4
  81. package/src/components/PhoneField/PhoneField.stories.ts +216 -24
  82. package/src/components/PhoneField/PhoneField.vue +32 -2
  83. package/src/components/PhoneField/tests/PhoneField.spec.ts +161 -14
  84. package/src/components/RatingPicker/NumberPicker/NumberPicker.vue +2 -1
  85. package/src/components/RatingPicker/RatingPicker.stories.ts +1 -1
  86. package/src/components/SkipLink/Accessibilite.stories.ts +8 -0
  87. package/src/components/SkipLink/SkipLink.vue +11 -9
  88. package/src/components/SkipLink/tests/__snapshots__/skipLink.spec.ts.snap +7 -4
  89. package/src/components/SkipLink/tests/skipLink.spec.ts +120 -6
  90. package/src/components/SyAlert/Accessibilite.stories.ts +4 -0
  91. package/src/components/SyAlert/SyAlert.mdx +3 -7
  92. package/src/components/SyAlert/SyAlert.stories.ts +19 -12
  93. package/src/components/SyAlert/SyAlert.vue +88 -51
  94. package/src/components/SyAlert/tests/SyAlert.spec.ts +20 -2
  95. package/src/components/SyAlert/tests/__snapshots__/SyAlert.spec.ts.snap +83 -75
  96. package/src/components/UserMenuBtn/UserMenuBtn.stories.ts +56 -0
  97. package/src/components/UserMenuBtn/UserMenuBtn.vue +4 -2
  98. package/src/components/UserMenuBtn/tests/UserMenuBtn.spec.ts +41 -0
  99. package/src/components/index.ts +2 -0
  100. package/src/composables/date/useDateFormat.ts +17 -1
  101. package/src/composables/date/useDateFormatDayjs.ts +84 -0
  102. package/src/composables/date/useDateInitializationDayjs.ts +133 -0
  103. package/src/composables/rules/useFieldValidation.ts +26 -3
  104. package/src/stories/Accessibilite/Avancement/Avancement.mdx +12 -0
  105. package/src/stories/Accessibilite/Avancement/Avancement.stories.ts +134 -0
  106. package/src/stories/Accessibilite/KitDePreAudit/Echantillonnage.mdx +1 -1
  107. package/src/stories/GuideDuDev/LesBreackingChanges.mdx +31 -2
  108. package/src/components/LangBtn/tests/Config.spec.ts +0 -24
@@ -1,11 +1,12 @@
1
1
  <script setup lang="ts">
2
- import { computed, ref, watch } from 'vue'
2
+ import { computed, nextTick, ref, watch } from 'vue'
3
3
  import type { AllLanguagesChar } from '@/components/LangBtn/types'
4
4
  import { mdiMenuDown } from '@mdi/js'
5
5
  import { locales } from './locales'
6
6
  import ISO6391 from 'iso-639-1'
7
7
  import useCustomizableOptions, { type CustomizableOptions } from '@/composables/useCustomizableOptions'
8
8
  import defaultOptions from './config'
9
+ import type { VBtn, VListItem } from 'vuetify/components'
9
10
 
10
11
  const props = withDefaults(defineProps<CustomizableOptions & {
11
12
  modelValue?: string
@@ -90,6 +91,30 @@
90
91
  }
91
92
  })
92
93
 
94
+ const itemRef = ref<Array<VListItem>>([])
95
+ const btnRef = ref<VBtn | null>(null)
96
+ watch(
97
+ menu,
98
+ (newVal) => {
99
+ setTimeout(async () => {
100
+ if (newVal) {
101
+ setTimeout(() => {
102
+ requestAnimationFrame(() => {
103
+ const inputElement = itemRef.value[0]?.$el
104
+ if (inputElement) {
105
+ inputElement.focus()
106
+ }
107
+ })
108
+ }, 0)
109
+ }
110
+ else {
111
+ await nextTick()
112
+ btnRef.value?.$el.focus()
113
+ }
114
+ }, 0)
115
+ },
116
+ )
117
+
93
118
  defineExpose({
94
119
  currentLangData,
95
120
  updateLang,
@@ -101,7 +126,7 @@
101
126
  <div :id="menuId">
102
127
  <VMenu
103
128
  v-bind="options.menu"
104
- :id="isMenuOpen ? 'lang-menu' : menuId "
129
+ id="lang-menu"
105
130
  v-model="menu"
106
131
  scroll-strategy="none"
107
132
  role="menu"
@@ -110,15 +135,16 @@
110
135
  <template #activator="{ props: activatorProps }">
111
136
  <VBtn
112
137
  id="lang-menu-btn"
138
+ v-bind="{
139
+ ...options.btn,
140
+ ...activatorProps,
141
+ }"
142
+ ref="btnRef"
113
143
  :aria-label="`${props.ariaLabel} ${currentLangData.name}`"
114
144
  aria-haspopup="menu"
115
145
  :aria-controls="menuId"
116
146
  :aria-owns="menuId"
117
147
  :aria-expanded="isMenuOpen"
118
- v-bind="{
119
- ...options.btn,
120
- ...activatorProps,
121
- }"
122
148
  class="vd-lang-btn"
123
149
  >
124
150
  {{ currentLangData.name }}
@@ -134,15 +160,22 @@
134
160
  <VList
135
161
  v-bind="options.list"
136
162
  aria-labelledby="lang-menu-btn"
163
+ color="secondary"
164
+ :aria-activedescendant="`lang-item-${selectedLanguage}`"
165
+ role="menu"
137
166
  >
138
167
  <VListItem
139
- v-for="(langData, code, index) in languagesData"
168
+ v-for="(langData, code) in languagesData"
140
169
  v-bind="options.listTile"
170
+ :id="`lang-item-${code}`"
141
171
  :key="code"
172
+ ref="itemRef"
173
+ :active="selectedLanguage === code"
142
174
  role="menuitem"
143
- :tabindex="index + 1"
175
+ :lang="code"
176
+ color="primary"
177
+ tabindex="0"
144
178
  :aria-label="`${props.ariaLabel} ${langData.nativeName}`"
145
- :aria-labelledby="`${menuId} ${langData.nativeName}`"
146
179
  @click="updateLang(code)"
147
180
  >
148
181
  <VListItemTitle v-bind="options.listTileTitle">
@@ -160,6 +193,17 @@
160
193
  background-color: rgba(tokens.$colors-overlay, 0.005);
161
194
  }
162
195
 
196
+ .v-list-item:focus-visible {
197
+ &::after {
198
+ color: rgb(var(--v-theme-primary));
199
+ opacity: 1;
200
+ }
201
+
202
+ :deep(.v-list-item__overlay) {
203
+ display: none;
204
+ }
205
+ }
206
+
163
207
  .vd-lang-btn {
164
208
  font-size: 16px;
165
209
 
@@ -167,5 +211,20 @@
167
211
 
168
212
  text-transform: none;
169
213
  letter-spacing: inherit;
214
+
215
+ &:deep() {
216
+ .v-btn__underlay,
217
+ .v-btn__overlay {
218
+ display: none;
219
+ }
220
+ }
221
+ }
222
+
223
+ .vd-lang-btn:focus-visible {
224
+ outline: 0;
225
+ }
226
+
227
+ .vd-lang-btn:focus-visible::after {
228
+ opacity: 1;
170
229
  }
171
230
  </style>
@@ -2,7 +2,6 @@ import type { VariantType } from '@/types/vuetifyTypes'
2
2
 
3
3
  const defaultOptions = {
4
4
  menu: {
5
- offsetY: true,
6
5
  },
7
6
  btn: {
8
7
  color: 'primary',
@@ -78,6 +78,28 @@ describe('LangBtn', () => {
78
78
  })
79
79
 
80
80
  it('updates language when a language is selected', async () => {
81
+ wrapper = mount(LangBtn, {
82
+ props: {
83
+ availableLanguages: ['fr', 'co', 'es'],
84
+ modelValue: 'es',
85
+ },
86
+ global: {
87
+ plugins: [vuetify],
88
+ },
89
+ attachTo: document.body,
90
+ })
91
+
92
+ const activatorButton = wrapper.find('.vd-lang-btn')
93
+ await activatorButton.trigger('click')
94
+ await wrapper.vm.$nextTick()
95
+
96
+ const languageItem = document.body.querySelectorAll('.v-list-item')[1] as HTMLElement
97
+ languageItem.click()
98
+ await wrapper.vm.$nextTick()
99
+
100
+ expect(wrapper.find('.vd-lang-btn').text()).toBe('corsu')
101
+ expect(wrapper.emitted('update:modelValue')).toBeTruthy()
102
+ expect(wrapper.emitted('update:modelValue')?.[0]).toEqual(['co'])
81
103
  })
82
104
 
83
105
  it('opens the menu when clicked', async () => {
@@ -103,7 +125,10 @@ describe('LangBtn', () => {
103
125
 
104
126
  it('hides down arrow when hideDownArrow is true', () => {
105
127
  wrapper = mount(LangBtn, {
106
- props: { hideDownArrow: true },
128
+ props: {
129
+ hideDownArrow: true,
130
+ availableLanguages: ['fr', 'co', 'es'],
131
+ },
107
132
  global: {
108
133
  plugins: [vuetify],
109
134
  },
@@ -113,7 +138,10 @@ describe('LangBtn', () => {
113
138
 
114
139
  it('shows down arrow when hideDownArrow is false', () => {
115
140
  wrapper = mount(LangBtn, {
116
- props: { hideDownArrow: false },
141
+ props: {
142
+ hideDownArrow: false,
143
+ availableLanguages: ['fr', 'co', 'es'],
144
+ },
117
145
  global: {
118
146
  plugins: [vuetify],
119
147
  },
@@ -2,6 +2,7 @@ import { VExpansionPanels, VExpansionPanel, VExpansionPanelTitle, VExpansionPane
2
2
  import type { StoryObj } from '@storybook/vue3'
3
3
  import { AccessibiliteItemsIndeterminate, AccessibiliteItemsValidated } from './AccessibiliteItems'
4
4
  import { mdiCheckboxMarkedCircle, mdiLink, mdiEye } from '@mdi/js'
5
+ import SyAlert from '@/components/SyAlert/SyAlert.vue'
5
6
 
6
7
  const checkIcon = mdiCheckboxMarkedCircle
7
8
  const iconEye = mdiEye
@@ -15,14 +16,22 @@ export const AccessibilitePanel: StoryObj = {
15
16
 
16
17
  render: () => {
17
18
  return {
18
- components: { VExpansionPanels, VExpansionPanel, VExpansionPanelTitle, VExpansionPanelText, VDataTable, VIcon },
19
+ components: { VExpansionPanels, VExpansionPanel, VExpansionPanelTitle, VExpansionPanelText, VDataTable, VIcon, SyAlert },
19
20
 
20
21
  setup() {
21
22
  const icon = checkIcon
22
23
 
23
- return { AccessibiliteItemsIndeterminate, AccessibiliteItemsValidated, icon, linkICon, iconEye }
24
+ return { AccessibiliteItemsIndeterminate, AccessibiliteItemsValidated, icon, linkICon, iconEye, SyAlert }
24
25
  },
25
26
  template: `
27
+ <div class="mt-6 mb-6">
28
+ <SyAlert
29
+ title="Attention au contraste"
30
+ :closable="false"
31
+ >
32
+ <p> Le composant étant libre dans son implémentation, l'utilisateur doit veiller à la conformité de ce critère au regard de son intégration.</p>
33
+ </SyAlert>
34
+ </div>
26
35
  <div class="accessibiliteItems" style="display:flex; max-width: none !important;">
27
36
  <v-col cols="6">
28
37
  <div style="display:flex; margin-bottom: 10px; justify-content: space-between; align-items: center;">
@@ -138,28 +147,32 @@ export const Legende: StoryObj = {
138
147
  return { args }
139
148
  },
140
149
  template: `
141
- <p style="color: grey;font-size: 11px; margin-bottom: 12px;">Date de conception: 20/11/2024</p>
142
- <div>
143
- <p>Le tableau ci-dessous liste nos recommandations suivant les <a target="blank" style="color:#0C41BD;" href="https://www.numerique.gouv.fr/publications/rgaa-accessibilite/#contenu">catégories du RGAA</a>.</p>
144
- <p style="margin-bottom: 12px;font-weight:bold;">Pour rappel le composant seul ne garantie pas
145
- l'accessibilité du site.</p>
146
- <div style="font-size: 14px">
147
- <p>Nous avons deux façons de relever les problèmes d'accessibilité des composants :</p>
148
- <div>
149
- <v-btn variant="tonal" color="grey" size="x-small" style="margin: 2px;font-size: 8px;" rounded>
150
- Audit
151
- </v-btn>
152
- Problèmes relevés par le projet
153
- </div>
154
- <div>
155
- <v-btn variant="tonal" color="red" size="x-small" style="margin: 2px;font-size: 8px;" rounded>
156
- Tanaguru
157
- </v-btn>
158
- Problèmes relevés par Tanaguru
159
- </div>
150
+ <p style="color: grey;font-size: 11px; margin-bottom: 12px;">Date de conception: 20/11/2024</p>
151
+ <div>
152
+ <p>Le tableau ci-dessous liste nos recommandations suivant les <a target="blank" style="color:#0C41BD;" href="https://www.numerique.gouv.fr/publications/rgaa-accessibilite/#contenu">catégories du RGAA</a>.</p>
153
+ <p style="margin-bottom: 12px;font-weight:bold;">Pour rappel le composant seul ne garantie pas
154
+ l'accessibilité du site.</p>
155
+ <div style="font-size: 14px">
156
+ <p>Nous avons deux façons de relever les problèmes d'accessibilité des composants :</p>
157
+ <div>
158
+ <v-btn variant="tonal" color="grey" size="x-small" style="margin: 2px;font-size: 8px;" rounded>
159
+ Audit
160
+ </v-btn>
161
+ Problèmes relevés par le projet
162
+ </div>
163
+ <div>
164
+ <v-btn variant="tonal" color="red" size="x-small" style="margin: 2px;font-size: 8px;" rounded>
165
+ Tanaguru
166
+ </v-btn>
167
+ Problèmes relevés par Tanaguru
168
+ </div>
169
+ </div>
160
170
  </div>
161
- </div>
162
- `,
171
+ <div class="mt-4">
172
+ <p>Rapport d’audit manuel : <a href="/audits/PageContainer.xlsx" style="color:#0C41BD;">Voir le rapport</a></p>
173
+ <p style="color: grey; font-size: 14px">Correctifs associés (<a href="https://github.com/assurance-maladie-digital/design-system/issues/4011" target="_blank" style="color:#0C41BD;">issue #4011</a>)</p>
174
+ </div>
175
+ `,
163
176
  }
164
177
  },
165
178
  tags: ['!dev'],
@@ -56,7 +56,7 @@ const meta = {
56
56
  control: { type: 'number' },
57
57
  },
58
58
  suffix: {
59
- description: 'Suffixe pour la pagination',
59
+ description: 'Suffixe permettant de gérer individuellement le stockage des options d’un tableau d’une page à l’autre. S’il n’est pas renseigné, le stockage s’effectue globalement pour tous les tableaux.',
60
60
  control: { type: 'text' },
61
61
  },
62
62
  itemsPerPage: {
@@ -133,12 +133,12 @@ export const Default: Story = {
133
133
  email: 'thierry.bobu@example.com',
134
134
  },
135
135
  {
136
- firstname: 'Bernadette',
136
+ firstname: 'Bernadette',
137
137
  lastname: 'Langelier',
138
138
  email: 'bernadette.langelier@exemple.com'
139
139
  },
140
140
  {
141
- firstname: 'Agate',
141
+ firstname: 'Agate',
142
142
  lastname: 'Roy',
143
143
  email: 'agate.roy@exemple.com'
144
144
  }
@@ -207,14 +207,14 @@ export const Default: Story = {
207
207
  return { args }
208
208
  },
209
209
  template: `
210
- <div class="pa-4">
211
- <PaginatedTable
210
+ <div class="pa-4">
211
+ <PaginatedTable
212
212
  v-model:options="args.options"
213
213
  :items="args.items"
214
214
  :headers="args.headers"
215
215
  />
216
- </div>
217
- `,
216
+ </div>
217
+ `,
218
218
  }
219
219
  },
220
220
  }
@@ -255,7 +255,7 @@ export const SortBy: Story = {
255
255
  key: 'firstname',
256
256
  },
257
257
  {
258
- title: 'Email',
258
+ title: 'Email',
259
259
  value: 'email',
260
260
  },
261
261
  ])
@@ -282,12 +282,12 @@ export const SortBy: Story = {
282
282
  email: 'thierry.bobu@example.com',
283
283
  },
284
284
  {
285
- firstname: 'Bernadette',
285
+ firstname: 'Bernadette',
286
286
  lastname: 'Langelier',
287
287
  email: 'bernadette.langelier@exemple.com'
288
288
  },
289
289
  {
290
- firstname: 'Agate',
290
+ firstname: 'Agate',
291
291
  lastname: 'Roy',
292
292
  email: 'agate.roy@exemple.com'
293
293
  }
@@ -356,14 +356,14 @@ export const SortBy: Story = {
356
356
  return { args }
357
357
  },
358
358
  template: `
359
- <div class="pa-4">
360
- <PaginatedTable
359
+ <div class="pa-4">
360
+ <PaginatedTable
361
361
  v-model:options="args.options"
362
362
  :items="args.items"
363
363
  :headers="args.headers"
364
364
  />
365
- </div>
366
- `,
365
+ </div>
366
+ `,
367
367
  }
368
368
  },
369
369
  }
@@ -574,8 +574,8 @@ export const TableServer: Story = {
574
574
  return { args, headers, users, options, state, fetchData, totalUsers, StateEnum }
575
575
  },
576
576
  template: `
577
- <div class="pa-4">
578
- <PaginatedTable
577
+ <div class="pa-4">
578
+ <PaginatedTable
579
579
  v-model:options="options"
580
580
  :items="users"
581
581
  :headers="headers"
@@ -584,8 +584,134 @@ export const TableServer: Story = {
584
584
  suffix="api-example"
585
585
  @update:options="fetchData"
586
586
  />
587
- </div>
588
- `,
587
+ </div>
588
+ `,
589
+ }
590
+ },
591
+ }
592
+
593
+ export const ManyTables: Story = {
594
+ parameters: {
595
+ sourceCode: [
596
+ {
597
+ name: 'Template',
598
+ code: `
599
+ <template>
600
+ <div class="pa-4">
601
+ <PaginatedTable
602
+ suffix="table1"
603
+ :items="itemsTable1"
604
+ />
605
+ <hr class="my-4">
606
+ <PaginatedTable
607
+ suffix="table2"
608
+ :items="itemsTable2"
609
+ />
610
+ </div>
611
+ </template>
612
+ `,
613
+ },
614
+ {
615
+ name: 'Script',
616
+ code: `
617
+ <script setup lang="ts">
618
+ import { ref } from 'vue'
619
+ import { PaginatedTable } from '@cnamts/synapse'
620
+
621
+ const itemsTable1 = ref([
622
+ {
623
+ id: 1,
624
+ lastname: 'Doe',
625
+ firstname: 'John',
626
+ },
627
+ {
628
+ id: 2,
629
+ lastname: 'Smith',
630
+ firstname: 'Jane',
631
+ },
632
+ {
633
+ id: 3,
634
+ lastname: 'Brown',
635
+ firstname: 'Charlie',
636
+ },
637
+ ])
638
+
639
+ const itemsTable2 = ref([
640
+ {
641
+ id: 1,
642
+ lastname: 'Smith',
643
+ firstname: 'Jane',
644
+ },
645
+ {
646
+ id: 2,
647
+ lastname: 'Doe',
648
+ firstname: 'John',
649
+ },
650
+ {
651
+ id: 3,
652
+ lastname: 'Brown',
653
+ firstname: 'Charlie',
654
+ },
655
+ ])
656
+ </script>
657
+ `,
658
+ },
659
+ ],
660
+ },
661
+ render: (args) => {
662
+ return {
663
+ components: { PaginatedTable },
664
+ setup() {
665
+ const itemsTable1 = ref([
666
+ {
667
+ id: 1,
668
+ lastname: 'Doe',
669
+ firstname: 'John',
670
+ },
671
+ {
672
+ id: 2,
673
+ lastname: 'Smith',
674
+ firstname: 'Jane',
675
+ },
676
+ {
677
+ id: 3,
678
+ lastname: 'Brown',
679
+ firstname: 'Charlie',
680
+ },
681
+ ])
682
+
683
+ const itemsTable2 = ref([
684
+ {
685
+ id: 1,
686
+ lastname: 'Smith',
687
+ firstname: 'Jane',
688
+ },
689
+ {
690
+ id: 2,
691
+ lastname: 'Doe',
692
+ firstname: 'John',
693
+ },
694
+ {
695
+ id: 3,
696
+ lastname: 'Brown',
697
+ firstname: 'Charlie',
698
+ },
699
+ ])
700
+ return { args, itemsTable1, itemsTable2 }
701
+ },
702
+ template: `
703
+ <div class="pa-4">
704
+ <PaginatedTable
705
+ suffix="table1"
706
+ :items="itemsTable1"
707
+ />
708
+ <hr class="my-4">
709
+ <PaginatedTable
710
+ suffix="table2"
711
+ :items="itemsTable2"
712
+ />
713
+ </div>
714
+ `,
589
715
  }
590
716
  },
591
717
  }
@@ -53,7 +53,7 @@ const meta = {
53
53
  control: 'object',
54
54
  description: 'Messages de succès à afficher',
55
55
  },
56
- readOnly: {
56
+ readonly: {
57
57
  control: 'boolean',
58
58
  description: 'Indique si le champ est en lecture seule',
59
59
  },
@@ -99,7 +99,7 @@ const meta = {
99
99
  errorMessages: null,
100
100
  warningMessages: null,
101
101
  successMessages: null,
102
- readOnly: false,
102
+ readonly: false,
103
103
  disabled: false,
104
104
  placeholder: 'Entrez votre mot de passe',
105
105
  customRules: [],
@@ -162,7 +162,7 @@ export const Default: Story = {
162
162
  :error-messages="args.errorMessages"
163
163
  :warning-messages="args.warningMessages"
164
164
  :success-messages="args.successMessages"
165
- :read-only="args.readOnly"
165
+ :readonly="args.readonly"
166
166
  :disabled="args.disabled"
167
167
  :placeholder="args.placeholder"
168
168
  :custom-rules="args.customRules"
@@ -301,7 +301,7 @@ export const ReadOnly: Story = {
301
301
  <PasswordField
302
302
  v-model="password"
303
303
  label="Mot de passe"
304
- :read-only="true"
304
+ :readonly="true"
305
305
  />
306
306
  </template>
307
307
  `,
@@ -320,7 +320,7 @@ export const ReadOnly: Story = {
320
320
  ],
321
321
  },
322
322
  args: {
323
- readOnly: true,
323
+ readonly: true,
324
324
  modelValue: 'MonMotDePasse123',
325
325
  },
326
326
  }
@@ -832,7 +832,7 @@ export const WithCustomRules: Story = {
832
832
  :color="args.color"
833
833
  :label="args.label"
834
834
  :required="args.required"
835
- :read-only="args.readOnly"
835
+ :readonly="args.readonly"
836
836
  :disabled="args.disabled"
837
837
  :placeholder="args.placeholder"
838
838
  :custom-rules="customRules"
@@ -23,7 +23,7 @@
23
23
  errorMessages?: string[] | null
24
24
  warningMessages?: string[] | null
25
25
  successMessages?: string[] | null
26
- readOnly?: boolean
26
+ readonly?: boolean
27
27
  disabled?: boolean
28
28
  placeholder?: string
29
29
  customRules?: ValidationRule[]
@@ -42,7 +42,7 @@
42
42
  errorMessages: null,
43
43
  warningMessages: null,
44
44
  successMessages: null,
45
- readOnly: false,
45
+ readonly: false,
46
46
  disabled: false,
47
47
  placeholder: undefined,
48
48
  customRules: () => [],
@@ -191,7 +191,7 @@
191
191
  :error-messages="errors"
192
192
  :warning-messages="warnings"
193
193
  :success-messages="successes"
194
- :read-only="props.readOnly"
194
+ :readonly="props.readonly"
195
195
  :disabled="props.disabled"
196
196
  :placeholder="props.placeholder"
197
197
  :type="showEyeIcon ? 'text' : 'password'"
@@ -28,7 +28,7 @@
28
28
  customRules?: ValidationRule[]
29
29
  customWarningRules?: ValidationRule[]
30
30
  disableErrorHandling?: boolean
31
- readOnly?: boolean
31
+ readonly?: boolean
32
32
  }>(), {
33
33
  modelValue: () => ({ from: null, to: null }),
34
34
  placeholderFrom: 'Début',
@@ -47,7 +47,7 @@
47
47
  customRules: () => [],
48
48
  customWarningRules: () => [],
49
49
  disableErrorHandling: false,
50
- readOnly: false,
50
+ readonly: false,
51
51
  })
52
52
 
53
53
  const emit = defineEmits(['update:modelValue'])
@@ -347,7 +347,7 @@
347
347
  :show-week-number="props.showWeekNumber"
348
348
  :show-success-messages="showSuccessMessagesActual"
349
349
  :success-message="fromDateValidation.hasSuccess"
350
- :read-only="props.readOnly"
350
+ :readonly="props.readonly"
351
351
  @closed="handleFromDateClosed"
352
352
  />
353
353
  </div>
@@ -371,7 +371,7 @@
371
371
  :show-week-number="props.showWeekNumber"
372
372
  :show-success-messages="showSuccessMessagesActual"
373
373
  :success-message="toDateValidation.hasSuccess"
374
- :read-only="props.readOnly"
374
+ :readonly="props.readonly"
375
375
  @closed="handleToDateClosed"
376
376
  />
377
377
  </div>