@cnamts/synapse 0.0.12-alpha → 0.0.13-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.js +4913 -4021
- package/dist/design-system-v3.umd.cjs +1 -1
- package/dist/src/components/Amelipro/types/types.d.ts +30 -57
- package/dist/src/components/Customs/SyTextField/SyTextField.d.ts +2 -0
- package/dist/src/components/DatePicker/DatePicker.d.ts +36 -44
- package/dist/src/components/DatePicker/DateTextInput.d.ts +33 -36
- package/dist/src/components/FilterInline/AccessibiliteItems.d.ts +30 -0
- package/dist/src/components/FilterInline/constants/ExpertiseLevelEnum.d.ts +4 -0
- package/dist/src/components/FilterSideBar/AccessibiliteItems.d.ts +29 -0
- package/dist/src/components/FilterSideBar/constants/ExpertiseLevelEnum.d.ts +4 -0
- package/dist/src/components/NirField/NirField.d.ts +14 -2
- package/dist/src/components/NotificationBar/NotificationBar.d.ts +5 -5
- package/dist/src/components/PasswordField/PasswordField.d.ts +2 -0
- package/dist/src/components/PeriodField/PeriodField.d.ts +159 -157
- package/dist/src/components/PhoneField/PhoneField.d.ts +22 -1
- package/dist/src/components/UploadWorkflow/AccessibiliteItems.d.ts +29 -0
- package/dist/src/components/UploadWorkflow/constants/ExpertiseLevelEnum.d.ts +4 -0
- package/dist/src/components/Usages/Usages.d.ts +10 -0
- package/dist/src/components/index.d.ts +3 -0
- package/dist/src/composables/date/tests/useDatePickerAccessibility.spec.d.ts +1 -0
- package/dist/src/composables/date/useDateFormat.d.ts +26 -0
- package/dist/src/composables/date/useDateInitialization.d.ts +18 -0
- package/dist/src/composables/date/useDatePickerAccessibility.d.ts +8 -0
- package/dist/src/composables/useFilterable/useFilterable.d.ts +1 -1
- package/dist/src/composables/validation/useValidation.d.ts +1 -0
- package/dist/src/main.d.ts +1 -0
- package/dist/src/utils/formatDate/index.d.ts +3 -0
- package/dist/src/utils/formatDate/tests/formatDate.spec.d.ts +1 -0
- package/dist/src/utils/functions/validation/isDateAfter/index.d.ts +2 -0
- package/dist/src/utils/functions/validation/isDateAfter/tests/isDateAfter.spec.d.ts +1 -0
- package/dist/src/utils/functions/validation/isDateBefore/index.d.ts +2 -0
- package/dist/src/utils/functions/validation/isDateBefore/tests/isDateBefore.spec.d.ts +1 -0
- package/dist/src/utils/functions/validation/isDateInRange/index.d.ts +3 -0
- package/dist/src/utils/functions/validation/isDateInRange/tests/isDateInRange.spec.d.ts +1 -0
- package/dist/src/utils/functions/validation/isDateValid/index.d.ts +9 -0
- package/dist/src/utils/functions/validation/isDateValid/tests/isDateValid.spec.d.ts +1 -0
- package/dist/src/utils/functions/validation/isEmailValid/tests/isEmailValid.spec.d.ts +1 -0
- package/dist/src/utils/functions/validation/isWeekend/index.d.ts +3 -0
- package/dist/src/utils/functions/validation/isWeekend/tests/isWeekend.spec.d.ts +1 -0
- package/dist/src/utils/parseDate/index.d.ts +3 -0
- package/dist/src/utils/parseDate/tests/parseDate.spec.d.ts +1 -0
- package/dist/src/utils/rules/doMatchPattern/index.d.ts +3 -0
- package/dist/src/utils/rules/doMatchPattern/tests/matchPattern.spec.d.ts +1 -0
- package/dist/src/utils/rules/index.d.ts +11 -0
- package/dist/src/utils/rules/isDateValid/index.d.ts +4 -0
- package/dist/src/utils/rules/isDateValid/tests/isDateValid.spec.d.ts +1 -0
- package/dist/src/utils/rules/isExactLength/index.d.ts +3 -0
- package/dist/src/utils/rules/isExactLength/locales.d.ts +2 -0
- package/dist/src/utils/rules/isExactLength/tests/exactLength.spec.d.ts +1 -0
- package/dist/src/utils/rules/isMaxLength/index.d.ts +3 -0
- package/dist/src/utils/rules/isMaxLength/locales.d.ts +2 -0
- package/dist/src/utils/rules/isMaxLength/tests/isMaxLength.spec.d.ts +1 -0
- package/dist/src/utils/rules/isMinLength/index.d.ts +3 -0
- package/dist/src/utils/rules/isMinLength/locales.d.ts +2 -0
- package/dist/src/utils/rules/isMinLength/tests/isMinLength.spec.d.ts +1 -0
- package/dist/src/utils/rules/isNotAfterDate/index.d.ts +3 -0
- package/dist/src/utils/rules/isNotAfterDate/tests/isNotAfterDate.spec.d.ts +1 -0
- package/dist/src/utils/rules/isNotAfterToday/index.d.ts +4 -0
- package/dist/src/utils/rules/isNotAfterToday/locales.d.ts +2 -0
- package/dist/src/utils/rules/isNotAfterToday/tests/isNotAfterToday.spec.d.ts +1 -0
- package/dist/src/utils/rules/isNotBeforeDate/index.d.ts +3 -0
- package/dist/src/utils/rules/isNotBeforeDate/locales.d.ts +2 -0
- package/dist/src/utils/rules/isNotBeforeDate/tests/IsNotBeforeDate.spec.d.ts +1 -0
- package/dist/src/utils/rules/isNotBeforeToday/index.d.ts +4 -0
- package/dist/src/utils/rules/isNotBeforeToday/locales.d.ts +2 -0
- package/dist/src/utils/rules/isNotBeforeToday/tests/notBeforeToday.spec.d.ts +1 -0
- package/dist/src/utils/rules/isRequired/index.d.ts +4 -0
- package/dist/src/utils/rules/isRequired/locales.d.ts +2 -0
- package/dist/src/utils/rules/isRequired/tests/isRequred.spec.d.ts +1 -0
- package/dist/src/utils/rules/isValidEmail/index.d.ts +4 -0
- package/dist/src/utils/rules/isValidEmail/locales.d.ts +2 -0
- package/dist/src/utils/rules/isValidEmail/tests/isValidEmail.spec.d.ts +1 -0
- package/dist/style.css +1 -1
- package/package.json +3 -1
- package/src/assets/_radius.scss +12 -6
- package/src/assets/settings.scss +8 -0
- package/src/components/Amelipro/types/types.ts +40 -0
- package/src/components/ChipList/ChipList.stories.ts +26 -27
- package/src/components/ChipList/ChipList.vue +5 -1
- package/src/components/ChipList/config.ts +1 -0
- package/src/components/CookiesSelection/CookiesInformation/CookiesInformation.vue +2 -2
- package/src/components/Customs/SyBtnSelect/SyBtnSelect.mdx +1 -1
- package/src/components/Customs/SyInputSelect/SyInputSelect.mdx +1 -1
- package/src/components/Customs/SySelect/SySelect.mdx +1 -1
- package/src/components/Customs/SySelect/SySelect.vue +19 -4
- package/src/components/Customs/SyTextField/SyTextField.mdx +2 -2
- package/src/components/Customs/SyTextField/SyTextField.stories.ts +239 -0
- package/src/components/Customs/SyTextField/SyTextField.vue +3 -0
- package/src/components/DatePicker/DatePicker.stories.ts +177 -5
- package/src/components/DatePicker/DatePicker.vue +148 -347
- package/src/components/DatePicker/DateTextInput.vue +91 -251
- package/src/components/DatePicker/tests/DatePicker.spec.ts +118 -48
- package/src/components/DatePicker/tests/DateTextInput.spec.ts +202 -6
- package/src/components/FileList/Accessibilite.stories.ts +1 -1
- package/src/components/FileList/AccessibiliteItems.ts +22 -0
- package/src/components/FileUpload/FileUpload.stories.ts +9 -7
- package/src/components/FilterInline/Accessibilite.mdx +14 -0
- package/src/components/FilterInline/Accessibilite.stories.ts +216 -0
- package/src/components/FilterInline/AccessibiliteItems.ts +132 -0
- package/src/components/FilterInline/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/FilterSideBar/Accessibilite.mdx +14 -0
- package/src/components/FilterSideBar/Accessibilite.stories.ts +216 -0
- package/src/components/FilterSideBar/AccessibiliteItems.ts +153 -0
- package/src/components/FilterSideBar/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/NirField/NirField.stories.ts +165 -0
- package/src/components/NirField/NirField.vue +6 -2
- package/src/components/NirField/tests/config.spec.ts +65 -0
- package/src/components/NotificationBar/NotificationBar.mdx +2 -2
- package/src/components/NotificationBar/NotificationBar.stories.ts +59 -11
- package/src/components/NotificationBar/NotificationBar.vue +42 -114
- package/src/components/NotificationBar/tests/NotificationBar.spec.ts +28 -33
- package/src/components/NotificationBar/tests/__snapshots__/NotificationBar.spec.ts.snap +1 -1
- package/src/components/PaginatedTable/PaginatedTable.vue +6 -10
- package/src/components/PaginatedTable/tests/__snapshots__/PaginatedTable.spec.ts.snap +4 -4
- package/src/components/PasswordField/PasswordField.stories.ts +191 -4
- package/src/components/PasswordField/PasswordField.vue +3 -0
- package/src/components/PeriodField/PeriodField.stories.ts +214 -118
- package/src/components/PeriodField/PeriodField.vue +195 -148
- package/src/components/PeriodField/tests/PeriodField.spec.ts +146 -0
- package/src/components/PhoneField/PhoneField.stories.ts +101 -0
- package/src/components/PhoneField/PhoneField.vue +73 -17
- package/src/components/PhoneField/tests/PhoneField.spec.ts +40 -0
- package/src/components/RatingPicker/RatingPicker.stories.ts +7 -7
- package/src/components/SearchListField/SearchListField.stories.ts +1 -1
- package/src/components/UploadWorkflow/Accessibilite.mdx +14 -0
- package/src/components/UploadWorkflow/Accessibilite.stories.ts +216 -0
- package/src/components/UploadWorkflow/AccessibiliteItems.ts +192 -0
- package/src/components/UploadWorkflow/UploadWorkflow.vue +2 -2
- package/src/components/UploadWorkflow/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/Usages/tests/Usages.spec.ts +183 -0
- package/src/components/index.ts +3 -0
- package/src/composables/date/tests/useDateFormat.spec.ts +67 -0
- package/src/composables/date/tests/useDateInitialization.spec.ts +89 -0
- package/src/composables/date/tests/useDatePickerAccessibility.spec.ts +102 -0
- package/src/composables/date/useDateFormat.ts +94 -0
- package/src/composables/date/useDateInitialization.ts +92 -0
- package/src/composables/date/useDatePickerAccessibility.ts +78 -0
- package/src/composables/rules/tests/useFieldValidation.spec.ts +385 -4
- package/src/composables/useFilterable/useFilterable.ts +5 -4
- package/src/composables/validation/useValidation.ts +15 -0
- package/src/main.ts +1 -0
- package/src/stories/Accessibilite/Aculturation/AuditDesignSystem.mdx +28 -0
- package/src/stories/Accessibilite/Aculturation/SensibilisationAccessibilite.mdx +2 -2
- package/src/stories/Accessibilite/Audit/RGAA.mdx +6 -6
- package/src/stories/Accessibilite/Introduction.mdx +2 -1
- package/src/stories/Accessibilite/KitDePreAudit/Echantillonnage.mdx +1 -1
- package/src/stories/Accessibilite/KitDePreAudit/Introduction.mdx +1 -1
- package/src/stories/Accessibilite/KitDePreAudit/Outils/Introduction.mdx +8 -11
- package/src/stories/Accessibilite/KitDePreAudit/Outils/LecteursDEcran.mdx +77 -0
- package/src/stories/Accessibilite/KitDePreAudit/Outils/Tanaguru.mdx +9 -3
- package/src/stories/Accessibilite/KitDePreAudit/Preaudit.mdx +2 -2
- package/src/stories/Demarrer/Introduction.stories.ts +3 -3
- package/src/stories/Demarrer/Releases.mdx +8 -0
- package/src/stories/Demarrer/Releases.stories.ts +66 -0
- package/src/stories/DesignTokens/Conteneurs.stories.ts +3 -3
- package/src/stories/GuideDuDev/LesBreackingChanges.mdx +36 -0
- package/src/stories/GuideDuDev/UtiliserLesRules.mdx +2 -2
- package/src/utils/formatDate/index.ts +6 -0
- package/src/utils/formatDate/tests/formatDate.spec.ts +18 -0
- package/src/utils/functions/validation/isDateAfter/index.ts +9 -0
- package/src/utils/functions/validation/isDateAfter/tests/isDateAfter.spec.ts +18 -0
- package/src/utils/functions/validation/isDateBefore/index.ts +9 -0
- package/src/utils/functions/validation/isDateBefore/tests/isDateBefore.spec.ts +23 -0
- package/src/utils/functions/validation/isDateInRange/index.ts +22 -0
- package/src/utils/functions/validation/isDateInRange/tests/isDateInRange.spec.ts +28 -0
- package/src/utils/functions/validation/isDateValid/index.ts +67 -0
- package/src/utils/functions/validation/isDateValid/tests/isDateValid.spec.ts +46 -0
- package/src/utils/functions/validation/isEmailValid/index.ts +9 -0
- package/src/utils/functions/validation/isWeekend/index.ts +10 -0
- package/src/utils/functions/validation/isWeekend/tests/isWeekend.spec.ts +16 -0
- package/src/utils/parseDate/index.ts +29 -0
- package/src/utils/parseDate/tests/parseDate.spec.ts +52 -0
- package/src/utils/rules/Rules.mdx +16 -0
- package/src/utils/rules/doMatchPattern/DoMachPattern.mdx +66 -0
- package/src/utils/rules/doMatchPattern/DoMatchPattern.stories.ts +106 -0
- package/src/utils/rules/doMatchPattern/index.ts +28 -0
- package/src/utils/rules/doMatchPattern/locales.ts +5 -0
- package/src/utils/rules/doMatchPattern/tests/matchPattern.spec.ts +38 -0
- package/src/utils/rules/index.ts +11 -0
- package/src/utils/rules/isDateValid/IsDateValid.mdx +87 -0
- package/src/utils/rules/isDateValid/IsDateValid.stories.ts +113 -0
- package/src/utils/rules/isDateValid/index.ts +32 -0
- package/src/utils/rules/isDateValid/locales.ts +10 -0
- package/src/utils/rules/isDateValid/tests/isDateValid.spec.ts +27 -0
- package/src/utils/rules/isExactLength/IsExactLenght.mdx +68 -0
- package/src/utils/rules/isExactLength/IsExactLength.stories.ts +151 -0
- package/src/utils/rules/{exactLength → isExactLength}/index.ts +2 -4
- package/src/utils/rules/isExactLength/tests/exactLength.spec.ts +48 -0
- package/src/utils/rules/isMaxLength/IsMaxLength.mdx +68 -0
- package/src/utils/rules/isMaxLength/IsMaxLength.stories.ts +152 -0
- package/src/utils/rules/isMaxLength/index.ts +30 -0
- package/src/utils/rules/isMaxLength/locales.ts +6 -0
- package/src/utils/rules/isMaxLength/tests/isMaxLength.spec.ts +42 -0
- package/src/utils/rules/isMinLength/IsMinLength.mdx +68 -0
- package/src/utils/rules/isMinLength/IsMinLength.stories.ts +152 -0
- package/src/utils/rules/isMinLength/index.ts +30 -0
- package/src/utils/rules/isMinLength/locales.ts +6 -0
- package/src/utils/rules/isMinLength/tests/isMinLength.spec.ts +42 -0
- package/src/utils/rules/isNotAfterDate/IsNotAfterDate.mdx +68 -0
- package/src/utils/rules/isNotAfterDate/IsNotAfterDate.stories.ts +109 -0
- package/src/utils/rules/isNotAfterDate/index.ts +25 -0
- package/src/utils/rules/isNotAfterDate/locales.ts +6 -0
- package/src/utils/rules/isNotAfterDate/tests/isNotAfterDate.spec.ts +25 -0
- package/src/utils/rules/isNotAfterToday/IsNotAfterToday.mdx +83 -0
- package/src/utils/rules/isNotAfterToday/IsNotAfterToday.stories.ts +110 -0
- package/src/utils/rules/isNotAfterToday/index.ts +28 -0
- package/src/utils/rules/isNotAfterToday/locales.ts +5 -0
- package/src/utils/rules/isNotAfterToday/tests/isNotAfterToday.spec.ts +30 -0
- package/src/utils/rules/isNotBeforeDate/IsNotBeforeDate.mdx +68 -0
- package/src/utils/rules/isNotBeforeDate/IsNotBeforeDate.stories.ts +114 -0
- package/src/utils/rules/isNotBeforeDate/index.ts +25 -0
- package/src/utils/rules/isNotBeforeDate/locales.ts +6 -0
- package/src/utils/rules/isNotBeforeDate/tests/IsNotBeforeDate.spec.ts +25 -0
- package/src/utils/rules/isNotBeforeToday/IsNotBeforeToday.mdx +83 -0
- package/src/utils/rules/isNotBeforeToday/IsNotBeforeToday.stories.ts +110 -0
- package/src/utils/rules/isNotBeforeToday/index.ts +28 -0
- package/src/utils/rules/isNotBeforeToday/locales.ts +5 -0
- package/src/utils/rules/isNotBeforeToday/tests/notBeforeToday.spec.ts +36 -0
- package/src/utils/rules/isRequired/IsRequired.mdx +81 -0
- package/src/utils/rules/isRequired/IsRequired.stories.ts +101 -0
- package/src/utils/rules/{required → isRequired}/index.ts +3 -3
- package/src/utils/rules/{required/tests/index.spec.ts → isRequired/tests/isRequred.spec.ts} +9 -9
- package/src/utils/rules/isValidEmail/IsValidEmail.mdx +81 -0
- package/src/utils/rules/isValidEmail/IsValidEmail.stories.ts +101 -0
- package/src/utils/rules/{email → isValidEmail}/index.ts +3 -5
- package/src/utils/rules/{email/tests/email.spec.ts → isValidEmail/tests/isValidEmail.spec.ts} +5 -5
- package/dist/src/components/Amelipro/types/languages.d.ts +0 -6
- package/dist/src/utils/rules/email/index.d.ts +0 -4
- package/dist/src/utils/rules/exactLength/index.d.ts +0 -4
- package/dist/src/utils/rules/required/index.d.ts +0 -4
- package/dist/src/utils/rules/required/ruleMessageHelper.d.ts +0 -3
- package/src/components/Amelipro/types/languages.d.ts +0 -6
- package/src/components/Amelipro/types/types.d.ts +0 -65
- package/src/components/Customs/SyTextField/tests/__snapshots__/SyTextField.spec.ts.snap +0 -58
- package/src/utils/functions/isEmailValid/index.ts +0 -8
- package/src/utils/rules/required/ruleMessageHelper.ts +0 -14
- package/src/utils/rules/required/tests/rulesMessageHelper.spec.ts +0 -22
- /package/dist/src/{utils/functions/isEmailValid/tests/isEmailValid.spec.d.ts → components/NirField/tests/config.spec.d.ts} +0 -0
- /package/dist/src/{utils/rules/email/tests/email.spec.d.ts → components/Usages/tests/Usages.spec.d.ts} +0 -0
- /package/dist/src/{utils/rules/required/tests/index.spec.d.ts → composables/date/tests/useDateFormat.spec.d.ts} +0 -0
- /package/dist/src/{utils/rules/required/tests/rulesMessageHelper.spec.d.ts → composables/date/tests/useDateInitialization.spec.d.ts} +0 -0
- /package/dist/src/utils/functions/{isEmailValid → validation/isEmailValid}/index.d.ts +0 -0
- /package/dist/src/utils/rules/{exactLength → doMatchPattern}/locales.d.ts +0 -0
- /package/dist/src/utils/rules/{email → isDateValid}/locales.d.ts +0 -0
- /package/dist/src/utils/rules/{required → isNotAfterDate}/locales.d.ts +0 -0
- /package/src/components/NirField/{tests → examples}//342/200/257dataset/342/200/257.md" +0 -0
- /package/src/utils/functions/{isEmailValid → validation/isEmailValid}/tests/isEmailValid.spec.ts +0 -0
- /package/src/utils/rules/{exactLength → isExactLength}/locales.ts +0 -0
- /package/src/utils/rules/{required → isRequired}/locales.ts +0 -0
- /package/src/utils/rules/{email → isValidEmail}/locales.ts +0 -0
|
@@ -78,6 +78,14 @@ const meta: Meta<typeof PeriodField> = {
|
|
|
78
78
|
control: 'object',
|
|
79
79
|
description: 'Règles d\'avertissement',
|
|
80
80
|
},
|
|
81
|
+
disableErrorHandling: {
|
|
82
|
+
control: 'boolean',
|
|
83
|
+
description: 'Désactive la gestion des erreurs',
|
|
84
|
+
},
|
|
85
|
+
showSuccessMessages: {
|
|
86
|
+
control: 'boolean',
|
|
87
|
+
description: 'Affiche les messages de succès',
|
|
88
|
+
},
|
|
81
89
|
},
|
|
82
90
|
} as Meta<typeof PeriodField>
|
|
83
91
|
|
|
@@ -122,21 +130,19 @@ export const Default: Story = {
|
|
|
122
130
|
noIcon: false,
|
|
123
131
|
modelValue: { from: null, to: null },
|
|
124
132
|
},
|
|
125
|
-
render:
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
template: `
|
|
133
|
+
render: args => ({
|
|
134
|
+
components: { PeriodField: PeriodField },
|
|
135
|
+
setup() {
|
|
136
|
+
const value = ref({ from: null, to: null })
|
|
137
|
+
return { args, value }
|
|
138
|
+
},
|
|
139
|
+
template: `
|
|
133
140
|
<div class="pa-4">
|
|
134
141
|
<PeriodField v-bind="args" v-model="value"/>
|
|
135
142
|
<p>Période sélectionnée : {{ value }}</p>
|
|
136
143
|
</div>
|
|
137
144
|
`,
|
|
138
|
-
|
|
139
|
-
},
|
|
145
|
+
}),
|
|
140
146
|
}
|
|
141
147
|
|
|
142
148
|
export const CustomPlaceholders: Story = {
|
|
@@ -180,21 +186,19 @@ export const CustomPlaceholders: Story = {
|
|
|
180
186
|
noIcon: false,
|
|
181
187
|
modelValue: { from: null, to: null },
|
|
182
188
|
},
|
|
183
|
-
render:
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
template: `
|
|
189
|
+
render: args => ({
|
|
190
|
+
components: { PeriodField: PeriodField },
|
|
191
|
+
setup() {
|
|
192
|
+
const value = ref({ from: null, to: null })
|
|
193
|
+
return { args, value }
|
|
194
|
+
},
|
|
195
|
+
template: `
|
|
191
196
|
<div class="pa-4">
|
|
192
197
|
<PeriodField v-bind="args" v-model="value"/>
|
|
193
198
|
<p>Période sélectionnée : {{ value }}</p>
|
|
194
199
|
</div>
|
|
195
200
|
`,
|
|
196
|
-
|
|
197
|
-
},
|
|
201
|
+
}),
|
|
198
202
|
}
|
|
199
203
|
|
|
200
204
|
export const Disabled: Story = {
|
|
@@ -236,20 +240,18 @@ export const Disabled: Story = {
|
|
|
236
240
|
noIcon: false,
|
|
237
241
|
modelValue: { from: null, to: null },
|
|
238
242
|
},
|
|
239
|
-
render:
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
template: `
|
|
243
|
+
render: args => ({
|
|
244
|
+
components: { PeriodField: PeriodField },
|
|
245
|
+
setup() {
|
|
246
|
+
const value = ref({ from: null, to: null })
|
|
247
|
+
return { args, value }
|
|
248
|
+
},
|
|
249
|
+
template: `
|
|
247
250
|
<div class="pa-4">
|
|
248
251
|
<PeriodField v-bind="args" v-model="value"/>
|
|
249
252
|
</div>
|
|
250
253
|
`,
|
|
251
|
-
|
|
252
|
-
},
|
|
254
|
+
}),
|
|
253
255
|
}
|
|
254
256
|
|
|
255
257
|
export const Required: Story = {
|
|
@@ -292,21 +294,19 @@ export const Required: Story = {
|
|
|
292
294
|
noIcon: false,
|
|
293
295
|
modelValue: { from: null, to: null },
|
|
294
296
|
},
|
|
295
|
-
render:
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
template: `
|
|
297
|
+
render: args => ({
|
|
298
|
+
components: { PeriodField: PeriodField },
|
|
299
|
+
setup() {
|
|
300
|
+
const value = ref({ from: null, to: null })
|
|
301
|
+
return { args, value }
|
|
302
|
+
},
|
|
303
|
+
template: `
|
|
303
304
|
<div class="pa-4">
|
|
304
305
|
<PeriodField v-bind="args" v-model="value"/>
|
|
305
306
|
<p>Période sélectionnée : {{ value }}</p>
|
|
306
307
|
</div>
|
|
307
308
|
`,
|
|
308
|
-
|
|
309
|
-
},
|
|
309
|
+
}),
|
|
310
310
|
}
|
|
311
311
|
|
|
312
312
|
export const AppendIcon: Story = {
|
|
@@ -348,21 +348,19 @@ export const AppendIcon: Story = {
|
|
|
348
348
|
noIcon: false,
|
|
349
349
|
modelValue: { from: null, to: null },
|
|
350
350
|
},
|
|
351
|
-
render:
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
template: `
|
|
351
|
+
render: args => ({
|
|
352
|
+
components: { PeriodField: PeriodField },
|
|
353
|
+
setup() {
|
|
354
|
+
const value = ref({ from: null, to: null })
|
|
355
|
+
return { args, value }
|
|
356
|
+
},
|
|
357
|
+
template: `
|
|
359
358
|
<div class="pa-4">
|
|
360
359
|
<PeriodField v-bind="args" v-model="value"/>
|
|
361
360
|
<p>Période sélectionnée : {{ value }}</p>
|
|
362
361
|
</div>
|
|
363
362
|
`,
|
|
364
|
-
|
|
365
|
-
},
|
|
363
|
+
}),
|
|
366
364
|
}
|
|
367
365
|
|
|
368
366
|
export const WithoutIcon: Story = {
|
|
@@ -405,21 +403,19 @@ export const WithoutIcon: Story = {
|
|
|
405
403
|
noIcon: false,
|
|
406
404
|
modelValue: { from: null, to: null },
|
|
407
405
|
},
|
|
408
|
-
render:
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
template: `
|
|
406
|
+
render: args => ({
|
|
407
|
+
components: { PeriodField: PeriodField },
|
|
408
|
+
setup() {
|
|
409
|
+
const value = ref({ from: null, to: null })
|
|
410
|
+
return { args, value }
|
|
411
|
+
},
|
|
412
|
+
template: `
|
|
416
413
|
<div class="pa-4">
|
|
417
414
|
<PeriodField v-bind="args" v-model="value"/>
|
|
418
415
|
<p>Période sélectionnée : {{ value }}</p>
|
|
419
416
|
</div>
|
|
420
417
|
`,
|
|
421
|
-
|
|
422
|
-
},
|
|
418
|
+
}),
|
|
423
419
|
}
|
|
424
420
|
|
|
425
421
|
export const WithError: Story = {
|
|
@@ -467,21 +463,19 @@ export const WithError: Story = {
|
|
|
467
463
|
{ type: 'notAfterToday', options: { message: 'La date ne peut pas être après aujourd\'hui' } },
|
|
468
464
|
],
|
|
469
465
|
},
|
|
470
|
-
render:
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
template: `
|
|
466
|
+
render: args => ({
|
|
467
|
+
components: { PeriodField: PeriodField },
|
|
468
|
+
setup() {
|
|
469
|
+
const value = ref({ from: '01/01/2100', to: '05/01/2100' })
|
|
470
|
+
return { args, value }
|
|
471
|
+
},
|
|
472
|
+
template: `
|
|
478
473
|
<div class="pa-4">
|
|
479
474
|
<PeriodField v-bind="args" v-model="value"/>
|
|
480
475
|
<p>Période sélectionnée : {{ value }}</p>
|
|
481
476
|
</div>
|
|
482
477
|
`,
|
|
483
|
-
|
|
484
|
-
},
|
|
478
|
+
}),
|
|
485
479
|
}
|
|
486
480
|
|
|
487
481
|
export const WithWarning: Story = {
|
|
@@ -540,21 +534,19 @@ export const WithWarning: Story = {
|
|
|
540
534
|
},
|
|
541
535
|
],
|
|
542
536
|
},
|
|
543
|
-
render:
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
template: `
|
|
537
|
+
render: args => ({
|
|
538
|
+
components: { PeriodField: PeriodField },
|
|
539
|
+
setup() {
|
|
540
|
+
const value = ref({ from: '20/12/2023', to: '21/12/2023' })
|
|
541
|
+
return { args, value }
|
|
542
|
+
},
|
|
543
|
+
template: `
|
|
551
544
|
<div class="pa-4">
|
|
552
545
|
<PeriodField v-bind="args" v-model="value"/>
|
|
553
546
|
<p>Période sélectionnée : {{ value }}</p>
|
|
554
547
|
</div>
|
|
555
548
|
`,
|
|
556
|
-
|
|
557
|
-
},
|
|
549
|
+
}),
|
|
558
550
|
}
|
|
559
551
|
|
|
560
552
|
export const WithSuccess: Story = {
|
|
@@ -607,21 +599,19 @@ export const WithSuccess: Story = {
|
|
|
607
599
|
},
|
|
608
600
|
],
|
|
609
601
|
},
|
|
610
|
-
render:
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
template: `
|
|
602
|
+
render: args => ({
|
|
603
|
+
components: { PeriodField: PeriodField },
|
|
604
|
+
setup() {
|
|
605
|
+
const value = ref({ from: '22/01/2024', to: '23/01/2024' })
|
|
606
|
+
return { args, value }
|
|
607
|
+
},
|
|
608
|
+
template: `
|
|
618
609
|
<div class="pa-4">
|
|
619
610
|
<PeriodField v-bind="args" v-model="value"/>
|
|
620
611
|
<p>Période sélectionnée : {{ value }}</p>
|
|
621
612
|
</div>
|
|
622
613
|
`,
|
|
623
|
-
|
|
624
|
-
},
|
|
614
|
+
}),
|
|
625
615
|
}
|
|
626
616
|
|
|
627
617
|
export const DifferentFormats: Story = {
|
|
@@ -683,18 +673,17 @@ export const DifferentFormats: Story = {
|
|
|
683
673
|
noIcon: false,
|
|
684
674
|
modelValue: { from: '12/10/2023', to: '15/10/2023' },
|
|
685
675
|
},
|
|
686
|
-
render:
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
template: `
|
|
676
|
+
render: args => ({
|
|
677
|
+
components: { PeriodField: PeriodField },
|
|
678
|
+
setup() {
|
|
679
|
+
const value1 = ref({ from: '12/10/2023', to: '15/10/2023' })
|
|
680
|
+
const value2 = ref({ from: '10/12/2023', to: '10/15/2023' })
|
|
681
|
+
const value3 = ref({ from: '2023-10-12', to: '2023-10-15' })
|
|
682
|
+
const value4 = ref({ from: '12-10-23', to: '15-10-23' })
|
|
683
|
+
const value5 = ref({ from: '12.10.2023', to: '15.10.2023' })
|
|
684
|
+
return { args, value1, value2, value3, value4, value5 }
|
|
685
|
+
},
|
|
686
|
+
template: `
|
|
698
687
|
<div class="pa-4">
|
|
699
688
|
<PeriodField v-bind="args" v-model="value1" format="DD/MM/YYYY" class="mb-4" />
|
|
700
689
|
<PeriodField v-bind="args" v-model="value2" format="MM/DD/YYYY" class="mb-4" />
|
|
@@ -703,8 +692,7 @@ export const DifferentFormats: Story = {
|
|
|
703
692
|
<PeriodField v-bind="args" v-model="value5" format="DD.MM.YYYY"/>
|
|
704
693
|
</div>
|
|
705
694
|
`,
|
|
706
|
-
|
|
707
|
-
},
|
|
695
|
+
}),
|
|
708
696
|
}
|
|
709
697
|
|
|
710
698
|
export const WithDateFormatReturn: Story = {
|
|
@@ -763,19 +751,18 @@ export const WithDateFormatReturn: Story = {
|
|
|
763
751
|
noIcon: false,
|
|
764
752
|
modelValue: { from: null, to: null },
|
|
765
753
|
},
|
|
766
|
-
render:
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
template: `
|
|
754
|
+
render: args => ({
|
|
755
|
+
components: { PeriodField: PeriodField },
|
|
756
|
+
setup() {
|
|
757
|
+
const value1 = ref({ from: '12/10/2023', to: '15/10/2023' })
|
|
758
|
+
const value2 = ref({ from: '12/10/2023', to: '15/10/2023' })
|
|
759
|
+
const value3 = ref({ from: '12/10/2023', to: '15/10/2023' })
|
|
760
|
+
const valueReturn1 = ref({ from: '12/10/2023', to: '15/10/2023' })
|
|
761
|
+
const valueReturn2 = ref({ from: '10/12/2023', to: '10/15/2023' })
|
|
762
|
+
const valueReturn3 = ref({ from: '2023/12/10', to: '2023/15/10' })
|
|
763
|
+
return { args, value1, value2, value3, valueReturn1, valueReturn2, valueReturn3 }
|
|
764
|
+
},
|
|
765
|
+
template: `
|
|
779
766
|
<div class="pa-4">
|
|
780
767
|
<span>Période de retour : {{ valueReturn1 }}<br/><br/></span>
|
|
781
768
|
<PeriodField
|
|
@@ -802,6 +789,115 @@ export const WithDateFormatReturn: Story = {
|
|
|
802
789
|
/>
|
|
803
790
|
</div>
|
|
804
791
|
`,
|
|
805
|
-
|
|
792
|
+
}),
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
export const ValidationBehaviors: Story = {
|
|
796
|
+
parameters: {
|
|
797
|
+
sourceCode: [
|
|
798
|
+
{
|
|
799
|
+
code: `<template>
|
|
800
|
+
<div class="mb-8">
|
|
801
|
+
<h3 class="mb-4">Par défaut (avec validation)</h3>
|
|
802
|
+
<PeriodField
|
|
803
|
+
v-model="periodDefault"
|
|
804
|
+
required
|
|
805
|
+
/>
|
|
806
|
+
</div>
|
|
807
|
+
|
|
808
|
+
<div class="mb-8">
|
|
809
|
+
<h3 class="mb-4">Validation désactivée (disableErrorHandling=true)</h3>
|
|
810
|
+
<PeriodField
|
|
811
|
+
v-model="periodNoErrors"
|
|
812
|
+
required
|
|
813
|
+
:disable-error-handling="true"
|
|
814
|
+
/>
|
|
815
|
+
</div>
|
|
816
|
+
|
|
817
|
+
<div class="mb-8">
|
|
818
|
+
<h3 class="mb-4">Messages de succès désactivés (showSuccessMessages=false)</h3>
|
|
819
|
+
<PeriodField
|
|
820
|
+
v-model="periodNoSuccess"
|
|
821
|
+
required
|
|
822
|
+
:show-success-messages="false"
|
|
823
|
+
/>
|
|
824
|
+
</div>
|
|
825
|
+
|
|
826
|
+
<div class="mb-8">
|
|
827
|
+
<h3 class="mb-4">Validation et messages de succès désactivés</h3>
|
|
828
|
+
<PeriodField
|
|
829
|
+
v-model="periodNoValidation"
|
|
830
|
+
required
|
|
831
|
+
:disable-error-handling="true"
|
|
832
|
+
:show-success-messages="false"
|
|
833
|
+
/>
|
|
834
|
+
</div>
|
|
835
|
+
</template>
|
|
836
|
+
|
|
837
|
+
<script setup lang="ts">
|
|
838
|
+
import { ref } from 'vue'
|
|
839
|
+
import PeriodField from '../PeriodField.vue'
|
|
840
|
+
|
|
841
|
+
const periodDefault = ref({ from: null, to: null })
|
|
842
|
+
const periodNoErrors = ref({ from: null, to: null })
|
|
843
|
+
const periodNoSuccess = ref({ from: null, to: null })
|
|
844
|
+
const periodNoValidation = ref({ from: null, to: null })
|
|
845
|
+
</script>`,
|
|
846
|
+
},
|
|
847
|
+
],
|
|
806
848
|
},
|
|
849
|
+
render: args => ({
|
|
850
|
+
components: { PeriodField },
|
|
851
|
+
setup() {
|
|
852
|
+
const periodDefault = ref({ from: null, to: null })
|
|
853
|
+
const periodNoErrors = ref({ from: null, to: null })
|
|
854
|
+
const periodNoSuccess = ref({ from: null, to: null })
|
|
855
|
+
const periodNoValidation = ref({ from: null, to: null })
|
|
856
|
+
|
|
857
|
+
return {
|
|
858
|
+
args,
|
|
859
|
+
periodDefault,
|
|
860
|
+
periodNoErrors,
|
|
861
|
+
periodNoSuccess,
|
|
862
|
+
periodNoValidation,
|
|
863
|
+
}
|
|
864
|
+
},
|
|
865
|
+
template: `
|
|
866
|
+
<div class="mb-8">
|
|
867
|
+
<h3 class="mb-4">Par défaut (avec validation)</h3>
|
|
868
|
+
<PeriodField
|
|
869
|
+
v-model="periodDefault"
|
|
870
|
+
required
|
|
871
|
+
/>
|
|
872
|
+
</div>
|
|
873
|
+
|
|
874
|
+
<div class="mb-8">
|
|
875
|
+
<h3 class="mb-4">Validation désactivée (disableErrorHandling=true)</h3>
|
|
876
|
+
<PeriodField
|
|
877
|
+
v-model="periodNoErrors"
|
|
878
|
+
required
|
|
879
|
+
:disable-error-handling="true"
|
|
880
|
+
/>
|
|
881
|
+
</div>
|
|
882
|
+
|
|
883
|
+
<div class="mb-8">
|
|
884
|
+
<h3 class="mb-4">Messages de succès désactivés (showSuccessMessages=false)</h3>
|
|
885
|
+
<PeriodField
|
|
886
|
+
v-model="periodNoSuccess"
|
|
887
|
+
required
|
|
888
|
+
:show-success-messages="false"
|
|
889
|
+
/>
|
|
890
|
+
</div>
|
|
891
|
+
|
|
892
|
+
<div class="mb-8">
|
|
893
|
+
<h3 class="mb-4">Validation et messages de succès désactivés</h3>
|
|
894
|
+
<PeriodField
|
|
895
|
+
v-model="periodNoValidation"
|
|
896
|
+
required
|
|
897
|
+
:disable-error-handling="true"
|
|
898
|
+
:show-success-messages="false"
|
|
899
|
+
/>
|
|
900
|
+
</div>
|
|
901
|
+
`,
|
|
902
|
+
}),
|
|
807
903
|
}
|