@cnamts/synapse 0.0.14-alpha → 0.0.15-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 (86) hide show
  1. package/dist/components/Customs/SyInputSelect/SyInputSelect.d.ts +2 -2
  2. package/dist/components/Customs/SySelect/SySelect.d.ts +24 -12
  3. package/dist/components/Customs/SySelect/locales.d.ts +3 -0
  4. package/dist/components/Customs/SyTextField/SyTextField.d.ts +2 -2
  5. package/dist/components/DatePicker/DatePicker.d.ts +732 -16
  6. package/dist/components/DatePicker/DateTextInput.d.ts +8 -8
  7. package/dist/components/DialogBox/config.d.ts +1 -1
  8. package/dist/components/DownloadBtn/DownloadBtn.d.ts +2 -0
  9. package/dist/components/LangBtn/LangBtn.d.ts +467 -1
  10. package/dist/components/LangBtn/config.d.ts +1 -3
  11. package/dist/components/NirField/NirField.d.ts +13 -13
  12. package/dist/components/PasswordField/PasswordField.d.ts +2 -2
  13. package/dist/components/PeriodField/PeriodField.d.ts +1462 -30
  14. package/dist/components/PhoneField/PhoneField.d.ts +3 -3
  15. package/dist/components/SelectBtnField/SelectBtnField.d.ts +1 -1
  16. package/dist/components/SkipLink/SkipLink.d.ts +3 -2
  17. package/dist/components/UserMenuBtn/UserMenuBtn.d.ts +2 -0
  18. package/dist/components/index.d.ts +1 -0
  19. package/dist/design-system-v3.js +3038 -2936
  20. package/dist/design-system-v3.umd.cjs +1 -1
  21. package/dist/style.css +1 -1
  22. package/dist/vuetifyConfig.d.ts +1 -0
  23. package/package.json +1 -1
  24. package/src/components/BackBtn/Accessibilite.stories.ts +4 -0
  25. package/src/components/BackBtn/BackBtn.vue +2 -1
  26. package/src/components/BackToTopBtn/Accessibilite.stories.ts +4 -0
  27. package/src/components/BackToTopBtn/BackToTopBtn.stories.ts +78 -21
  28. package/src/components/BackToTopBtn/BackToTopBtn.vue +15 -0
  29. package/src/components/BackToTopBtn/config.ts +2 -2
  30. package/src/components/BackToTopBtn/tests/__snapshots__/BackToTopBtn.spec.ts.snap +4 -4
  31. package/src/components/CopyBtn/Accessibilite.stories.ts +4 -0
  32. package/src/components/Customs/SyBtnSelect/SyBtnSelect.stories.ts +2 -2
  33. package/src/components/Customs/SyBtnSelect/SyBtnSelect.vue +0 -1
  34. package/src/components/Customs/SyInputSelect/SyInputSelect.stories.ts +3 -3
  35. package/src/components/Customs/SyInputSelect/SyInputSelect.vue +4 -4
  36. package/src/components/Customs/SySelect/SySelect.stories.ts +4 -0
  37. package/src/components/Customs/SySelect/SySelect.vue +75 -10
  38. package/src/components/Customs/SySelect/locales.ts +3 -0
  39. package/src/components/Customs/SySelect/tests/SySelect.spec.ts +24 -2
  40. package/src/components/Customs/SyTextField/SyTextField.stories.ts +1 -1
  41. package/src/components/Customs/SyTextField/SyTextField.vue +3 -3
  42. package/src/components/DatePicker/DatePicker.vue +82 -57
  43. package/src/components/DatePicker/DatePickerValidation.mdx +338 -0
  44. package/src/components/DatePicker/DatePickerValidation.stories.ts +22 -0
  45. package/src/components/DatePicker/DatePickerValidationExamples.vue +535 -0
  46. package/src/components/DatePicker/DateTextInput.vue +3 -3
  47. package/src/components/DatePicker/tests/DateTextInput.spec.ts +2 -2
  48. package/src/components/DialogBox/DialogBox.stories.ts +5 -2
  49. package/src/components/DialogBox/DialogBox.vue +1 -1
  50. package/src/components/DialogBox/config.ts +1 -1
  51. package/src/components/DownloadBtn/Accessibilite.stories.ts +4 -0
  52. package/src/components/DownloadBtn/DownloadBtn.stories.ts +17 -8
  53. package/src/components/DownloadBtn/DownloadBtn.vue +13 -6
  54. package/src/components/DownloadBtn/tests/__snapshots__/DownloadBtn.spec.ts.snap +0 -2
  55. package/src/components/FranceConnectBtn/Accessibilite.stories.ts +4 -0
  56. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuItem/HeaderMenuItem.vue +3 -0
  57. package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.vue +3 -0
  58. package/src/components/HeaderBar/HeaderBurgerMenu/menu.scss +19 -0
  59. package/src/components/HeaderBar/HeaderMenuBtn/HeaderMenuBtn.vue +12 -2
  60. package/src/components/LangBtn/Accessibilite.stories.ts +4 -0
  61. package/src/components/LangBtn/LangBtn.stories.ts +1 -4
  62. package/src/components/LangBtn/LangBtn.vue +68 -9
  63. package/src/components/LangBtn/config.ts +0 -1
  64. package/src/components/LangBtn/tests/LangBtn.spec.ts +30 -2
  65. package/src/components/PageContainer/Accessibilite.stories.ts +36 -23
  66. package/src/components/PaginatedTable/PaginatedTable.stories.ts +144 -18
  67. package/src/components/PasswordField/PasswordField.stories.ts +6 -6
  68. package/src/components/PasswordField/PasswordField.vue +3 -3
  69. package/src/components/PeriodField/PeriodField.vue +4 -4
  70. package/src/components/PhoneField/PhoneField.stories.ts +216 -24
  71. package/src/components/PhoneField/PhoneField.vue +32 -2
  72. package/src/components/PhoneField/tests/PhoneField.spec.ts +161 -14
  73. package/src/components/RatingPicker/NumberPicker/NumberPicker.vue +2 -1
  74. package/src/components/RatingPicker/RatingPicker.stories.ts +1 -1
  75. package/src/components/SkipLink/Accessibilite.stories.ts +8 -0
  76. package/src/components/SkipLink/SkipLink.vue +11 -9
  77. package/src/components/SkipLink/tests/__snapshots__/skipLink.spec.ts.snap +7 -4
  78. package/src/components/SkipLink/tests/skipLink.spec.ts +120 -6
  79. package/src/components/UserMenuBtn/UserMenuBtn.stories.ts +56 -0
  80. package/src/components/UserMenuBtn/UserMenuBtn.vue +4 -2
  81. package/src/components/UserMenuBtn/tests/UserMenuBtn.spec.ts +41 -0
  82. package/src/components/index.ts +1 -0
  83. package/src/composables/rules/useFieldValidation.ts +26 -3
  84. package/src/stories/Accessibilite/KitDePreAudit/Echantillonnage.mdx +1 -1
  85. package/src/stories/GuideDuDev/LesBreackingChanges.mdx +31 -2
  86. package/src/components/LangBtn/tests/Config.spec.ts +0 -24
@@ -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>