@cnamts/synapse 1.0.14 → 1.0.16
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/README.md +0 -0
- package/dist/{DateFilter-isr8mXVb.js → DateFilter-DSwJUvBu.js} +12 -12
- package/dist/{NumberFilter-BOe7DqWX.js → NumberFilter-CwsbYyz4.js} +1 -1
- package/dist/{PeriodFilter-WTprpO40.js → PeriodFilter-csnEZU30.js} +1 -1
- package/dist/{SelectFilter-CqlG5dmI.js → SelectFilter-Bd5fndzR.js} +1 -1
- package/dist/{TextFilter-fVW5bsRw.js → TextFilter-B6gxzq2a.js} +1 -1
- package/dist/components/Amelipro/AmeliproAutoCompleteField/AmeliproAutoCompleteField.d.ts +2836 -2845
- package/dist/components/Amelipro/AmeliproCallback/AmeliproCallback.d.ts +3 -3
- package/dist/components/Amelipro/AmeliproCarousel/AmeliproCarousel.d.ts +7 -7
- package/dist/components/Amelipro/AmeliproCarousel/AmeliproCarouselItem/AmeliproCarouselItem.d.ts +3 -3
- package/dist/components/Amelipro/AmeliproCheckbox/AmeliproCheckbox.d.ts +3 -3
- package/dist/components/Amelipro/AmeliproCheckboxGroup/AmeliproCheckboxGroup.d.ts +3 -3
- package/dist/components/Amelipro/AmeliproClickableTile/AmeliproClickableTile.d.ts +3 -3
- package/dist/components/Amelipro/AmeliproCustomSelector/AmeliproCustomSelector.d.ts +3 -3
- package/dist/components/Amelipro/AmeliproErrorTemplate/AmeliproErrorTemplate.d.ts +3 -3
- package/dist/components/Amelipro/AmeliproFirstLogin/AmeliproFirstLogin.d.ts +3 -3
- package/dist/components/Amelipro/AmeliproFooter/AmeliproFooter.d.ts +18 -18
- package/dist/components/Amelipro/AmeliproHeader/AmeliproHeader.d.ts +9 -9
- package/dist/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBar.d.ts +3 -3
- package/dist/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBrandSection/AmeliproHeaderBrandSection.d.ts +3 -3
- package/dist/components/Amelipro/AmeliproIcon/AmeliproIcon.d.ts +3 -1
- package/dist/components/Amelipro/AmeliproIconBtn/AmeliproIconBtn.d.ts +5 -3
- package/dist/components/Amelipro/AmeliproIllustratedRadioGroup/AmeliproIllustratedRadioGroup.d.ts +3 -3
- package/dist/components/Amelipro/AmeliproMenu/AmeliproMenu.d.ts +3 -3
- package/dist/components/Amelipro/AmeliproMultipleFoldingCard/AmeliproMultipleFoldingCard.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproPagination/AmeliproPaginationBtn/AmeliproPaginationBtn.d.ts +3 -3
- package/dist/components/Amelipro/AmeliproPatientBanner/AmeliproPatientBanner.d.ts +3 -3
- package/dist/components/Amelipro/AmeliproPatientLogged/AmeliproPatientLogged.d.ts +9 -0
- package/dist/components/Amelipro/AmeliproPostalAddressField/AmeliproPostalAddressCityRow/AmeliproPostalAddressCityRow.d.ts +1288 -1284
- package/dist/components/Amelipro/AmeliproPostalAddressField/AmeliproPostalAddressField.d.ts +1936 -1930
- package/dist/components/Amelipro/AmeliproRadioGroup/AmeliproRadioGroup.d.ts +3 -3
- package/dist/components/Amelipro/AmeliproSelect/AmeliproSelect.d.ts +2838 -2865
- package/dist/components/Amelipro/AmeliproStateTile/AmeliproStateTile.d.ts +3 -3
- package/dist/components/Amelipro/AmeliproTabs/AmeliproTabs.d.ts +2843 -2870
- package/dist/components/Amelipro/AmeliproTextArea/AmeliproTextArea.d.ts +397 -397
- package/dist/components/Amelipro/AmeliproTextField/AmeliproTextField.d.ts +642 -640
- package/dist/components/Amelipro/AmeliproTileBtn/AmeliproTileBtn.d.ts +233 -5
- package/dist/components/Amelipro/AmeliproTransmission/AmeliproTransmission.d.ts +9 -9
- package/dist/components/Captcha/CaptchaHelpdesk.d.ts +6 -0
- package/dist/components/CookieBanner/CookieBanner.d.ts +117 -119
- package/dist/components/CookiesSelection/CookiesInformation/CookiesInformation.d.ts +484 -484
- package/dist/components/CookiesSelection/CookiesSelection.d.ts +104 -106
- package/dist/components/Customs/Selects/SelectBtnField/SelectBtnField.d.ts +14 -10
- package/dist/components/Customs/Selects/SySelect/SySelect.d.ts +118 -129
- package/dist/components/Customs/Selects/SySelect/composables/useSySelectKeyboard.d.ts +1 -3
- package/dist/components/Customs/SyCheckbox/SyCheckbox.d.ts +1 -1
- package/dist/components/Customs/SyForm/SyForm.d.ts +60 -53
- package/dist/components/Customs/SyRadioGroup/SyRadioGroup.d.ts +88 -0
- package/dist/components/Customs/SyRadioGroup/locales.d.ts +3 -0
- package/dist/components/Customs/SyTextField/SyTextField.d.ts +644 -642
- package/dist/components/DataList/DataList.d.ts +6 -1
- package/dist/components/DataListGroup/DataListGroup.d.ts +14 -2
- package/dist/components/DataListItem/DataListItem.d.ts +3 -0
- package/dist/components/DatePicker/CalendarMode/DatePicker.d.ts +2988 -3100
- package/dist/components/DatePicker/ComplexDatePicker/ComplexDatePicker.d.ts +1458 -1558
- package/dist/components/DatePicker/DateTextInput/DateTextInput.d.ts +655 -651
- package/dist/components/DatePicker/composables/index.d.ts +4 -0
- package/dist/components/DatePicker/composables/useAsteriskDisplay.d.ts +1 -1
- package/dist/components/DatePicker/composables/useCalendarKeyboardNavigation.d.ts +11 -0
- package/dist/components/DatePicker/composables/useDatePickerState.d.ts +25 -0
- package/dist/components/DatePicker/composables/useDateTextField.d.ts +61 -0
- package/dist/components/DatePicker/composables/useHolidayHighlighting.d.ts +15 -0
- package/dist/components/DatePicker/constants/messages.d.ts +0 -1
- package/dist/components/DialogBox/DialogBox.d.ts +175 -177
- package/dist/components/FilterSideBar/FilterSideBar.d.ts +161 -171
- package/dist/components/FooterBar/FooterBar.d.ts +5 -5
- package/dist/components/HeaderBar/HeaderBar.d.ts +2 -2
- package/dist/components/HeaderBar/HeaderLogo/HeaderLogo.d.ts +1 -1
- package/dist/components/HeaderNavigationBar/HeaderNavigationBar.d.ts +1 -1
- package/dist/components/HeaderToolbar/HeaderToolbar.d.ts +234 -258
- package/dist/components/LangBtn/LangBtn.d.ts +173 -179
- package/dist/components/LogoBrandSection/LogoBrandSection.d.ts +1 -1
- package/dist/components/LunarCalendar/LunarCalendar.d.ts +29 -0
- package/dist/components/LunarCalendar/useLunarCalendarRules.d.ts +5 -0
- package/dist/components/LunarCalendar/useLunarCalendarValidation.d.ts +13 -0
- package/dist/components/NirField/NirField.d.ts +1296 -1292
- package/dist/components/PaginatedTable/PaginatedTable.d.ts +1 -1
- package/dist/components/PeriodField/PeriodField.d.ts +5844 -6068
- package/dist/components/PhoneField/PhoneField.d.ts +645 -643
- package/dist/components/SyAlert/SyAlert.d.ts +31 -31
- package/dist/components/SyTextArea/SyTextArea.d.ts +395 -395
- package/dist/components/Tables/SyServerTable/SyServerTable.d.ts +193 -227
- package/dist/components/Tables/SyTable/SyTable.d.ts +192 -226
- package/dist/components/Tables/common/SyTableFilter.d.ts +1 -1
- package/dist/components/Tables/common/SyTablePagination.d.ts +118 -129
- package/dist/components/Tables/common/TableHeader.d.ts +52 -2
- package/dist/components/Tables/common/filters/DateFilter.d.ts +1 -1
- package/dist/components/Tables/common/filters/NumberFilter.d.ts +1 -1
- package/dist/components/Tables/common/filters/PeriodFilter.d.ts +1 -1
- package/dist/components/Tables/common/filters/SelectFilter.d.ts +1 -1
- package/dist/components/Tables/common/filters/TextFilter.d.ts +1 -1
- package/dist/components/Tables/common/locales.d.ts +1 -0
- package/dist/components/Tables/common/organizeColumns/OrganizeColumns.d.ts +86 -90
- package/dist/components/Tables/common/tableFilterUtils.d.ts +2 -2
- package/dist/components/Tables/common/types.d.ts +3 -2
- package/dist/components/Tables/common/useTableCheckbox.d.ts +3 -2
- package/dist/components/Tables/common/useTableFilter.d.ts +1 -1
- package/dist/components/Tables/common/useTableItems.d.ts +6 -8
- package/dist/components/UploadWorkflow/UploadWorkflow.d.ts +18 -18
- package/dist/components/index.d.ts +2 -0
- package/dist/design-system-v3.js +101 -98
- package/dist/design-system-v3.umd.cjs +25 -33
- package/dist/main-DkZZpa3S.js +35197 -0
- package/dist/style.css +1 -1
- package/dist/utils/formatNir/formatNir.d.ts +2 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/insertAt.d.ts +1 -0
- package/dist/utils/rules/validateDateValue.d.ts +14 -0
- package/dist/vuetifyConfig.d.ts +6 -6
- package/package.json +4 -4
- package/src/assets/tokens.scss +2 -0
- package/src/components/Amelipro/AmeliproAccordion/AmeliproAccordionTemplate/__tests__/__snapshots__/AmeliproAccordionTemplate.spec.ts.snap +1 -18
- package/src/components/Amelipro/AmeliproAccordion/__tests__/AmeliproAccordion.spec.ts +178 -9
- package/src/components/Amelipro/AmeliproAccordion/__tests__/__snapshots__/AmeliproAccordion.spec.ts.snap +28 -121
- package/src/components/Amelipro/AmeliproAccordionFrieze/__tests__/__snapshots__/AmeliproAccordionFrieze.spec.ts.snap +15 -270
- package/src/components/Amelipro/AmeliproAccordionList/__tests__/__snapshots__/AmeliproAccordionList.spec.ts.snap +12 -194
- package/src/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResultTemplate/__tests__/__snapshots__/AmeliproAccordionResultTemplate.spec.ts.snap +1 -18
- package/src/components/Amelipro/AmeliproAccordionResult/__tests__/__snapshots__/AmeliproAccordionResult.spec.ts.snap +1 -18
- package/src/components/Amelipro/AmeliproAccordionResultList/__tests__/__snapshots__/AmeliproAccordionResultList.spec.ts.snap +12 -194
- package/src/components/Amelipro/AmeliproAutoCompleteField/AmeliproAutoCompleteField.stories.ts +9 -9
- package/src/components/Amelipro/AmeliproAutoCompleteField/AmeliproAutoCompleteField.vue +5 -4
- package/src/components/Amelipro/AmeliproAutoCompleteField/__tests__/AmeliproAutoCompleteField.spec.ts +6 -6
- package/src/components/Amelipro/AmeliproAutoCompleteField/__tests__/__snapshots__/AmeliproAutoCompleteField.spec.ts.snap +2 -0
- package/src/components/Amelipro/AmeliproBadge/__tests__/AmeliproBadge.spec.ts +135 -9
- package/src/components/Amelipro/AmeliproBadge/__tests__/__snapshots__/AmeliproBadge.spec.ts.snap +20 -5
- package/src/components/Amelipro/AmeliproBreadcrumb/__tests__/AmeliproBreadcrumb.spec.ts +195 -28
- package/src/components/Amelipro/AmeliproBreadcrumb/__tests__/__snapshots__/AmeliproBreadcrumb.spec.ts.snap +193 -124
- package/src/components/Amelipro/AmeliproCaptcha/AmeliproCaptcha.vue +1 -1
- package/src/components/Amelipro/AmeliproCaptcha/__tests__/AmeliproCaptcha.spec.ts +364 -12
- package/src/components/Amelipro/AmeliproCaptcha/__tests__/__snapshots__/AmeliproCaptcha.spec.ts.snap +30 -390
- package/src/components/Amelipro/AmeliproCarousel/__tests__/__snapshots__/AmeliproCarousel.spec.ts.snap +4 -36
- package/src/components/Amelipro/AmeliproCheckbox/AmeliproCheckbox.stories.ts +10 -10
- package/src/components/Amelipro/AmeliproCheckbox/AmeliproCheckbox.vue +7 -7
- package/src/components/Amelipro/AmeliproCheckbox/__tests__/AmeliproCheckbox.spec.ts +5 -5
- package/src/components/Amelipro/AmeliproCheckbox/__tests__/__snapshots__/AmeliproCheckbox.spec.ts.snap +1 -1
- package/src/components/Amelipro/AmeliproCheckboxGroup/AmeliproCheckboxGroup.stories.ts +7 -6
- package/src/components/Amelipro/AmeliproCheckboxGroup/AmeliproCheckboxGroup.vue +6 -6
- package/src/components/Amelipro/AmeliproCheckboxGroup/__tests__/AmeliproCheckboxGroup.spec.ts +6 -6
- package/src/components/Amelipro/AmeliproCheckboxGroup/__tests__/__snapshots__/AmeliproCheckboxGroup.spec.ts.snap +2 -2
- package/src/components/Amelipro/AmeliproClickableTile/tests/__snapshots__/AmeliproClickableTile.spec.ts.snap +2 -43
- package/src/components/Amelipro/AmeliproContentLayout/__tests__/AmeliproContentLayout.spec.ts +80 -9
- package/src/components/Amelipro/AmeliproContentLayout/__tests__/__snapshots__/AmeliproContentLayout.spec.ts.snap +25 -4
- package/src/components/Amelipro/AmeliproCopyBtn/__tests__/__snapshots__/AmeliproCopyBtn.spec.ts.snap +1 -13
- package/src/components/Amelipro/AmeliproCustomSelector/AmeliproCustomSelector.stories.ts +7 -6
- package/src/components/Amelipro/AmeliproCustomSelector/AmeliproCustomSelector.vue +5 -5
- package/src/components/Amelipro/AmeliproCustomSelector/__tests__/AmeliproCustomSelector.spec.ts +187 -39
- package/src/components/Amelipro/AmeliproCustomSelector/__tests__/__snapshots__/AmeliproCustomSelector.spec.ts.snap +147 -147
- package/src/components/Amelipro/AmeliproDentalChart/tests/__snapshots__/AmeliproDentalChart.spec.ts.snap +1 -1
- package/src/components/Amelipro/AmeliproDialog/__tests__/__snapshots__/AmeliproDialog.spec.ts.snap +0 -2
- package/src/components/Amelipro/AmeliproErrorTemplate/__tests__/AmeliproErrorTemplate.spec.ts +160 -20
- package/src/components/Amelipro/AmeliproErrorTemplate/__tests__/__snapshots__/AmeliproErrorTemplate.spec.ts.snap +34 -177
- package/src/components/Amelipro/AmeliproFilePreview/AmeliproFilePreview.vue +1 -0
- package/src/components/Amelipro/AmeliproFilePreview/__tests__/AmeliproFilePreview.spec.ts +248 -19
- package/src/components/Amelipro/AmeliproFilePreview/__tests__/__snapshots__/AmeliproFilePreview.spec.ts.snap +34 -203
- package/src/components/Amelipro/AmeliproFirstLogin/__tests__/__snapshots__/AmeliproFirstLogin.spec.ts.snap +6 -144
- package/src/components/Amelipro/AmeliproIcon/AmeliproIcon.vue +20 -2
- package/src/components/Amelipro/AmeliproIcon/__tests__/__snapshots__/AmeliproIcon.spec.ts.snap +1 -25
- package/src/components/Amelipro/AmeliproIllustratedRadioGroup/AmeliproIllustratedRadioGroup.stories.ts +5 -5
- package/src/components/Amelipro/AmeliproIllustratedRadioGroup/AmeliproIllustratedRadioGroup.vue +6 -6
- package/src/components/Amelipro/AmeliproIllustratedRadioGroup/__tests__/AmeliproIllustratedRadioGroup.spec.ts +22 -22
- package/src/components/Amelipro/AmeliproIllustratedRadioGroup/__tests__/__snapshots__/AmeliproIllustratedRadioGroup.spec.ts.snap +2 -2
- package/src/components/Amelipro/AmeliproMultipleFoldingCard/__tests__/AmeliproMultipleFoldingCard.spec.ts +304 -0
- package/src/components/Amelipro/AmeliproMultipleFoldingCard/__tests__/__snapshots__/AmeliproMultipleFoldingCard.spec.ts.snap +373 -0
- package/src/components/Amelipro/AmeliproPatientLogged/AmeliproPatientLogged.stories.ts +2 -0
- package/src/components/Amelipro/AmeliproPatientLogged/AmeliproPatientLogged.vue +28 -2
- package/src/components/Amelipro/AmeliproPatientLogged/__tests__/__snapshots__/AmeliproPatientLogged.spec.ts.snap +9 -173
- package/src/components/Amelipro/AmeliproPatientLogin/AmeliproPatientLoginForm/AmeliproPatientLoginForm.vue +1 -1
- package/src/components/Amelipro/AmeliproPostalAddressField/AmeliproPostalAddressCityRow/AmeliproPostalAddressCityRow.vue +162 -72
- package/src/components/Amelipro/AmeliproPostalAddressField/AmeliproPostalAddressCityRow/__tests__/AmeliproPostalAddressCityRow.spec.ts +2 -2
- package/src/components/Amelipro/AmeliproPostalAddressField/AmeliproPostalAddressCityRow/__tests__/__snapshots__/AmeliproPostalAddressCityRow.spec.ts.snap +6 -39
- package/src/components/Amelipro/AmeliproPostalAddressField/AmeliproPostalAddressField.stories.ts +3 -3
- package/src/components/Amelipro/AmeliproPostalAddressField/AmeliproPostalAddressField.vue +8 -8
- package/src/components/Amelipro/AmeliproPostalAddressField/{tests → __tests__}/AmeliproPostalAddressField.spec.ts +2 -2
- package/src/components/Amelipro/AmeliproPostalAddressField/{tests → __tests__}/__snapshots__/AmeliproPostalAddressField.spec.ts.snap +11 -52
- package/src/components/Amelipro/AmeliproRadioGroup/AmeliproRadioGroup.stories.ts +7 -7
- package/src/components/Amelipro/AmeliproRadioGroup/AmeliproRadioGroup.vue +8 -8
- package/src/components/Amelipro/AmeliproRadioGroup/__tests__/AmeliproRadioGroup.spec.ts +6 -6
- package/src/components/Amelipro/AmeliproRadioGroup/__tests__/__snapshots__/AmeliproRadioGroup.spec.ts.snap +2 -2
- package/src/components/Amelipro/AmeliproResultList/__tests__/__snapshots__/AmeliproResultList.spec.ts.snap +2 -14
- package/src/components/Amelipro/AmeliproSelect/AmeliproSelect.stories.ts +7 -7
- package/src/components/Amelipro/AmeliproSelect/AmeliproSelect.vue +4 -4
- package/src/components/Amelipro/AmeliproSelect/__tests__/AmeliproSelect.spec.ts +12 -12
- package/src/components/Amelipro/AmeliproStepper/AmeliproStepper.vue +2 -2
- package/src/components/Amelipro/AmeliproStepper/__tests__/__snapshots__/AmeliproStepper.spec.ts.snap +2 -2
- package/src/components/Amelipro/AmeliproTable/AmeliproTable.vue +2 -2
- package/src/components/Amelipro/AmeliproTable/__tests__/AmeliproTable.spec.ts +463 -68
- package/src/components/Amelipro/AmeliproTable/__tests__/__snapshots__/AmeliproTable.spec.ts.snap +176 -511
- package/src/components/Amelipro/AmeliproTextArea/AmeliproTextArea.stories.ts +6 -6
- package/src/components/Amelipro/AmeliproTextArea/AmeliproTextArea.vue +4 -4
- package/src/components/Amelipro/AmeliproTextArea/__tests__/AmeliproTextArea.spec.ts +3 -3
- package/src/components/Amelipro/AmeliproTextArea/__tests__/__snapshots__/AmeliproTextArea.spec.ts.snap +1 -2
- package/src/components/Amelipro/AmeliproTextField/AmeliproTextField.stories.ts +10 -10
- package/src/components/Amelipro/AmeliproTextField/AmeliproTextField.vue +4 -4
- package/src/components/Amelipro/AmeliproTextField/__tests__/AmeliproTextField.spec.ts +5 -5
- package/src/components/Amelipro/AmeliproTextField/tests/__snapshots__/AmeliproTextField.spec.ts.snap +162 -0
- package/src/components/Amelipro/AmeliproTileBtn/AmeliproTileBtn.stories.ts +44 -0
- package/src/components/Amelipro/AmeliproTileBtn/AmeliproTileBtn.vue +79 -1
- package/src/components/Amelipro/AmeliproTooltips/__tests__/__snapshots__/AmeliproTooltips.spec.ts.snap +0 -2
- package/src/components/Amelipro/AmeliproUpload/AmeliproUpload.stories.ts +2 -2
- package/src/components/Amelipro/AmeliproUpload/AmeliproUpload.vue +21 -7
- package/src/components/Amelipro/AmeliproUpload/__tests__/AmeliproUpload.spec.ts +252 -44
- package/src/components/Amelipro/AmeliproUpload/__tests__/__snapshots__/AmeliproUpload.spec.ts.snap +166 -0
- package/src/components/Amelipro/ServiceMenu/ServiceBtn/__tests__/ServiceBtn.spec.ts +137 -0
- package/src/components/Amelipro/ServiceMenu/ServiceBtn/__tests__/__snapshots__/ServiceBtn.spec.ts.snap +56 -0
- package/src/components/Amelipro/ServiceMenu/ServiceList/__tests__/ServiceList.spec.ts +116 -0
- package/src/components/Amelipro/ServiceMenu/ServiceList/__tests__/__snapshots__/ServiceList.spec.ts.snap +58 -0
- package/src/components/Amelipro/ServiceMenu/ServiceMenuContent/__tests__/ServiceMenuContent.spec.ts +118 -0
- package/src/components/Amelipro/ServiceMenu/ServiceMenuContent/__tests__/__snapshots__/ServiceMenuContent.spec.ts.snap +151 -0
- package/src/components/Amelipro/ServiceMenu/__tests__/ServiceMenu.spec.ts +259 -0
- package/src/components/Amelipro/ServiceMenu/__tests__/__snapshots__/ServiceMenu.spec.ts.snap +102 -0
- package/src/components/Amelipro/StructureMenu/StructureBtn/__tests__/StructureBtn.spec.ts +90 -0
- package/src/components/Amelipro/StructureMenu/StructureBtn/__tests__/__snapshots__/StructureBtn.spec.ts.snap +63 -0
- package/src/components/Amelipro/StructureMenu/StructureItem/__tests__/StructureItem.spec.ts +133 -0
- package/src/components/Amelipro/StructureMenu/StructureItem/__tests__/__snapshots__/StructureItem.spec.ts.snap +143 -0
- package/src/components/Amelipro/StructureMenu/StructureList/__tests__/StructureList.spec.ts +190 -0
- package/src/components/Amelipro/StructureMenu/StructureList/__tests__/__snapshots__/StructureList.spec.ts.snap +109 -0
- package/src/components/Amelipro/StructureMenu/StructureTabs/__tests__/StructureTabs.spec.ts +159 -0
- package/src/components/Amelipro/StructureMenu/StructureTabs/__tests__/__snapshots__/StructureTabs.spec.ts.snap +103 -0
- package/src/components/Amelipro/StructureMenu/__tests__/StructureMenu.spec.ts +165 -0
- package/src/components/Amelipro/StructureMenu/__tests__/__snapshots__/StructureMenu.spec.ts.snap +39 -0
- package/src/components/Amelipro/UserInformationSummary/__tests__/UserInformationSummary.spec.ts +140 -0
- package/src/components/Amelipro/UserInformationSummary/{tests → __tests__}/__snapshots__/UserInformationSummary.spec.ts.snap +17 -24
- package/src/components/Amelipro/UserMenu/UserMenu.stories.ts +3 -3
- package/src/components/Amelipro/UserMenu/UserMenu.vue +2 -2
- package/src/components/Amelipro/UserMenu/UserMenuDetails/__tests__/UserMenuDetails.spec.ts +150 -0
- package/src/components/Amelipro/UserMenu/UserMenuDetails/__tests__/__snapshots__/UserMenuDetails.spec.ts.snap +117 -0
- package/src/components/Amelipro/UserMenu/__tests__/UserMenu.spec.ts +141 -0
- package/src/components/Amelipro/UserMenu/__tests__/__snapshots__/UserMenu.spec.ts.snap +103 -0
- package/src/components/Captcha/Captcha.vue +9 -24
- package/src/components/Captcha/CaptchaHelpdesk.vue +42 -0
- package/src/components/Captcha/tests/__snapshots__/Captcha.spec.ts.snap +256 -268
- package/src/components/CopyBtn/tests/__snapshots__/CopyBtn.spec.ts.snap +0 -1
- package/src/components/Customs/Selects/SelectBtnField/Accessibilite.stories.ts +4 -0
- package/src/components/Customs/Selects/SelectBtnField/SelectBtnField.stories.ts +154 -82
- package/src/components/Customs/Selects/SelectBtnField/SelectBtnField.vue +229 -125
- package/src/components/Customs/Selects/SelectBtnField/tests/SelectBtnField.spec.ts +12 -12
- package/src/components/Customs/Selects/SelectBtnField/tests/__snapshots__/SelectBtnField.spec.ts.snap +344 -826
- package/src/components/Customs/Selects/SySelect/SySelect.vue +215 -169
- package/src/components/Customs/Selects/SySelect/composables/tests/useSySelectKeyboard.spec.ts +4 -2
- package/src/components/Customs/Selects/SySelect/composables/useSySelectKeyboard.ts +7 -9
- package/src/components/Customs/SyForm/SyForm.mdx +47 -7
- package/src/components/Customs/SyForm/SyForm.stories.ts +38 -34
- package/src/components/Customs/SyForm/SyForm.vue +27 -6
- package/src/components/Customs/SyRadioGroup/Accessibilite.mdx +263 -0
- package/src/components/Customs/SyRadioGroup/SyRadioGroup.mdx +37 -0
- package/src/components/Customs/SyRadioGroup/SyRadioGroup.stories.ts +665 -0
- package/src/components/Customs/SyRadioGroup/SyRadioGroup.vue +324 -0
- package/src/components/Customs/SyRadioGroup/locales.ts +3 -0
- package/src/components/Customs/SyRadioGroup/tests/SyRadioGroup.spec.ts +135 -0
- package/src/components/Customs/SyTabs/SyTabs.vue +1 -1
- package/src/components/Customs/SyTextField/SyTextField.vue +225 -194
- package/src/components/Customs/SyTextField/tests/SyTextField.spec.ts +32 -2
- package/src/components/DataList/DataList.mdx +3 -1
- package/src/components/DataList/DataList.stories.ts +67 -17
- package/src/components/DataList/DataList.vue +13 -1
- package/src/components/DataListGroup/DataListGroup.stories.ts +42 -12
- package/src/components/DataListGroup/DataListGroup.vue +14 -1
- package/src/components/DataListItem/DataListItem.vue +10 -2
- package/src/components/DataListItem/tests/DataListItem.spec.ts +1 -1
- package/src/components/DatePicker/CalendarMode/DatePicker.vue +157 -178
- package/src/components/DatePicker/CalendarMode/tests/DatePicker.events.spec.ts +5 -0
- package/src/components/DatePicker/CalendarMode/tests/DatePicker.spec.ts +179 -179
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.vue +261 -258
- package/src/components/DatePicker/ComplexDatePicker/tests/ComplexDatePicker.spec.ts +234 -827
- package/src/components/DatePicker/DateTextInput/DateTextInput.vue +46 -73
- package/src/components/DatePicker/DateTextInput/tests/DateTextInput.spec.ts +350 -0
- package/src/components/DatePicker/composables/index.ts +4 -0
- package/src/components/DatePicker/composables/tests/useCalendarKeyboardNavigation.spec.ts +270 -0
- package/src/components/DatePicker/composables/tests/useDatePickerViewMode.spec.ts +61 -3
- package/src/components/DatePicker/composables/tests/useDateRangeInput.spec.ts +198 -0
- package/src/components/DatePicker/composables/tests/useDisplayedDateString.spec.ts +36 -2
- package/src/components/DatePicker/composables/tests/useInputHandler.spec.ts +755 -0
- package/src/components/DatePicker/composables/tests/useKeyboardEvents.spec.ts +168 -0
- package/src/components/DatePicker/composables/tests/useMonthButtonCustomization.spec.ts +40 -34
- package/src/components/DatePicker/composables/useAsteriskDisplay.ts +1 -2
- package/src/components/DatePicker/composables/useCalendarKeyboardNavigation.ts +155 -0
- package/src/components/DatePicker/composables/useDatePickerState.ts +163 -0
- package/src/components/DatePicker/composables/useDateRangeInput.ts +4 -8
- package/src/components/DatePicker/composables/useDateTextField.ts +156 -0
- package/src/components/DatePicker/composables/useHolidayHighlighting.ts +64 -0
- package/src/components/DatePicker/composables/useInputHandler.ts +25 -19
- package/src/components/DatePicker/composables/useMonthButtonCustomization.ts +52 -26
- package/src/components/DatePicker/constants/messages.ts +0 -1
- package/src/components/DatePicker/docExamples/DatePickerBidirectionalValidation.vue +2 -2
- package/src/components/DatePicker/playground/ComplexDatePickerPlayground.vue +16 -8
- package/src/components/ErrorPage/ErrorPage.vue +1 -1
- package/src/components/ErrorPage/tests/ErrorPage.spec.ts +17 -0
- package/src/components/ExternalLinks/tests/__snapshots__/ExternalLinks.spec.ts.snap +0 -1
- package/src/components/LunarCalendar/LunarCalendar.mdx +33 -0
- package/src/components/LunarCalendar/LunarCalendar.stories.ts +232 -0
- package/src/components/LunarCalendar/LunarCalendar.vue +57 -0
- package/src/components/LunarCalendar/tests/LunarCalendar.spec.ts +79 -0
- package/src/components/LunarCalendar/useLunarCalendarRules.ts +96 -0
- package/src/components/LunarCalendar/useLunarCalendarValidation.ts +47 -0
- package/src/components/NotificationBar/NotificationBar.vue +2 -2
- package/src/components/PaginatedTable/PaginatedTable.stories.ts +15 -10
- package/src/components/PaginatedTable/PaginatedTable.vue +24 -35
- package/src/components/PhoneField/PhoneField.vue +102 -83
- package/src/components/SearchListField/tests/SearchListField.spec.ts +7 -53
- package/src/components/SyAlert/SyAlert.vue +5 -2
- package/src/components/TableToolbar/tests/__snapshots__/TableToolbar.spec.ts.snap +24 -72
- package/src/components/Tables/SyServerTable/SyServerTable.stories.ts +521 -23
- package/src/components/Tables/SyServerTable/SyServerTable.vue +19 -13
- package/src/components/Tables/SyTable/SyTable.stories.ts +391 -18
- package/src/components/Tables/SyTable/SyTable.vue +16 -11
- package/src/components/Tables/common/TableHeader.vue +16 -7
- package/src/components/Tables/common/filters/DateFilter.vue +1 -1
- package/src/components/Tables/common/locales.ts +1 -0
- package/src/components/Tables/common/tableFilterUtils.ts +3 -3
- package/src/components/Tables/common/types.ts +4 -2
- package/src/components/Tables/common/useTableCheckbox.ts +4 -3
- package/src/components/Tables/common/useTableFilter.ts +2 -2
- package/src/components/Tables/common/useTableItems.ts +4 -19
- package/src/components/index.ts +2 -0
- package/src/composables/validation/tests/useFormValidation.spec.ts +251 -0
- package/src/composables/validation/tests/useValidatable.spec.ts +90 -0
- package/src/stories/Accessibilite/Audit/Exemptions-derogations.mdx +241 -0
- package/src/stories/Accessibilite/KitDePreAudit/Introduction.mdx +17 -10
- package/src/stories/Accessibilite/KitDePreAudit/Outils/Introduction.mdx +16 -0
- package/src/stories/Accessibilite/KitDePreAudit/Preaudit.mdx +160 -106
- package/src/stories/Accessibilite/Vuetify/VuetifyItems.ts +2 -1
- package/src/stories/GuideDuDev/ClassesUtilitaires/FormattingUtilities.mdx +20 -0
- package/src/stories/GuideDuDev/ClassesUtilitaires/index.mdx +10 -0
- package/src/utils/formatNir/formatNir.ts +15 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/insertAt.ts +11 -0
- package/src/utils/rules/isDateValid/IsDateValid.mdx +2 -2
- package/src/utils/rules/isDateValid/IsDateValid.stories.ts +6 -4
- package/src/utils/rules/isDateValid/index.ts +23 -8
- package/src/utils/rules/isDateValid/tests/isDateValid.spec.ts +9 -0
- package/src/utils/rules/isExactLength/IsExactLenght.mdx +1 -1
- package/src/utils/rules/isHolidayDay/IsHolidayDay.mdx +19 -7
- package/src/utils/rules/isHolidayDay/index.ts +6 -8
- package/src/utils/rules/isHolidayDay/tests/isHolidayDay.spec.ts +13 -1
- package/src/utils/rules/isNotAfterDate/IsNotAfterDate.mdx +2 -2
- package/src/utils/rules/isNotAfterDate/IsNotAfterDate.stories.ts +9 -2
- package/src/utils/rules/isNotAfterDate/index.ts +5 -12
- package/src/utils/rules/isNotAfterDate/tests/isNotAfterDate.spec.ts +20 -0
- package/src/utils/rules/isNotAfterToday/IsNotAfterToday.mdx +2 -2
- package/src/utils/rules/isNotAfterToday/IsNotAfterToday.stories.ts +8 -2
- package/src/utils/rules/isNotAfterToday/index.ts +6 -6
- package/src/utils/rules/isNotAfterToday/tests/isNotAfterToday.spec.ts +20 -0
- package/src/utils/rules/isNotBeforeDate/IsNotBeforeDate.mdx +2 -2
- package/src/utils/rules/isNotBeforeDate/index.ts +5 -12
- package/src/utils/rules/isNotBeforeDate/tests/IsNotBeforeDate.spec.ts +20 -0
- package/src/utils/rules/isNotBeforeToday/IsNotBeforeToday.mdx +2 -2
- package/src/utils/rules/isNotBeforeToday/IsNotBeforeToday.stories.ts +8 -2
- package/src/utils/rules/isNotBeforeToday/index.ts +6 -6
- package/src/utils/rules/isNotBeforeToday/tests/notBeforeToday.spec.ts +19 -0
- package/src/utils/rules/validateDateValue.ts +37 -0
- package/src/vuetifyConfig.ts +6 -2
- package/dist/components/Customs/Selects/SelectBtnField/config.d.ts +0 -11
- package/dist/components/DatePicker/tests/setup.d.ts +0 -75370
- package/dist/components/Tables/common/formatters.d.ts +0 -17
- package/dist/main-CbBVJ_le.js +0 -34377
- package/dist/stories/Accessibilite/Vuetify/VuetifyItems.d.ts +0 -70
- package/dist/stories/DesignTokens/StylesTypographiques.stories.new.d.ts +0 -8
- package/dist/stories/DesignTokens/TypographyDisplay.d.ts +0 -28
- package/dist/stories/DesignTokens/vue-shims.d.ts +0 -6
- package/src/components/Amelipro/AmeliproMultipleFoldingCard/tests/AmeliproMultipleFoldingCard.spec.ts +0 -40
- package/src/components/Amelipro/AmeliproMultipleFoldingCard/tests/__snapshots__/AmeliproMultipleFoldingCard.spec.ts.snap +0 -369
- package/src/components/Amelipro/ServiceMenu/ServiceBtn/tests/ServiceBtn.spec.ts +0 -21
- package/src/components/Amelipro/ServiceMenu/ServiceBtn/tests/__snapshots__/ServiceBtn.spec.ts.snap +0 -100
- package/src/components/Amelipro/ServiceMenu/ServiceList/tests/ServiceList.spec.ts +0 -25
- package/src/components/Amelipro/ServiceMenu/ServiceList/tests/__snapshots__/ServiceList.spec.ts.snap +0 -245
- package/src/components/Amelipro/ServiceMenu/ServiceMenuContent/tests/ServiceMenuContent.spec.ts +0 -45
- package/src/components/Amelipro/ServiceMenu/ServiceMenuContent/tests/__snapshots__/ServiceMenuContent.spec.ts.snap +0 -787
- package/src/components/Amelipro/ServiceMenu/tests/ServiceMenu.spec.ts +0 -46
- package/src/components/Amelipro/ServiceMenu/tests/__snapshots__/ServiceMenu.spec.ts.snap +0 -111
- package/src/components/Amelipro/StructureMenu/StructureBtn/tests/StructureBtn.spec.ts +0 -17
- package/src/components/Amelipro/StructureMenu/StructureBtn/tests/__snapshots__/StructureBtn.spec.ts.snap +0 -34
- package/src/components/Amelipro/StructureMenu/StructureItem/tests/StructureItem.spec.ts +0 -21
- package/src/components/Amelipro/StructureMenu/StructureItem/tests/__snapshots__/StructureItem.spec.ts.snap +0 -106
- package/src/components/Amelipro/StructureMenu/StructureList/tests/StructureList.spec.ts +0 -33
- package/src/components/Amelipro/StructureMenu/StructureList/tests/__snapshots__/StructureList.spec.ts.snap +0 -353
- package/src/components/Amelipro/StructureMenu/StructureTabs/tests/StructureTabs.spec.ts +0 -60
- package/src/components/Amelipro/StructureMenu/StructureTabs/tests/__snapshots__/StructureTabs.spec.ts.snap +0 -824
- package/src/components/Amelipro/StructureMenu/tests/StructureMenu.spec.ts +0 -69
- package/src/components/Amelipro/StructureMenu/tests/__snapshots__/StructureMenu.spec.ts.snap +0 -1383
- package/src/components/Amelipro/UserInformationSummary/tests/UserInformationSummary.spec.ts +0 -24
- package/src/components/Amelipro/UserMenu/UserMenuDetails/tests/UserMenuDetails.spec.ts +0 -33
- package/src/components/Amelipro/UserMenu/UserMenuDetails/tests/__snapshots__/UserMenuDetails.spec.ts.snap +0 -3
- package/src/components/Amelipro/UserMenu/tests/UserMenu.spec.ts +0 -34
- package/src/components/Amelipro/UserMenu/tests/__snapshots__/UserMenu.spec.ts.snap +0 -101
- package/src/components/Customs/Selects/SelectBtnField/config.ts +0 -11
- package/src/components/DatePicker/ComplexDatePicker/tests/ComplexDatePicker.events.spec.ts +0 -151
- package/src/components/DatePicker/DateTextInput/DateTextInput.events.spec.ts +0 -148
- package/src/components/DatePicker/DateTextInput/DateTextInput.range.spec.ts +0 -361
- package/src/components/DatePicker/DateTextInput/DateTextInput.spec.ts +0 -709
- package/src/components/DatePicker/tests/DatePicker.validation.spec.ts +0 -4111
- package/src/components/DatePicker/tests/archiTest.md +0 -33
- package/src/components/DatePicker/tests/navigation.regression.spec.ts +0 -74
- package/src/components/DatePicker/tests/navigation.simple.spec.ts +0 -137
- package/src/components/DatePicker/tests/setup.ts +0 -243
- package/src/components/Tables/common/formatters.ts +0 -72
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Meta } from '@storybook/blocks'
|
|
1
|
+
import { Meta, Source } from '@storybook/blocks'
|
|
2
2
|
|
|
3
3
|
<Meta title="Guide du dev/Règles De Validation/isHolidayDay" />
|
|
4
4
|
<style>
|
|
@@ -31,32 +31,44 @@ import { Meta } from '@storybook/blocks'
|
|
|
31
31
|
|
|
32
32
|
## Utilisation
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
<Source dark code={`
|
|
35
35
|
import { isHolidayDay } from '@/utils/isHolidayDay'
|
|
36
36
|
|
|
37
37
|
const rules = [
|
|
38
38
|
isHolidayDay,
|
|
39
39
|
]
|
|
40
|
-
|
|
40
|
+
`} />
|
|
41
|
+
|
|
41
42
|
|
|
42
43
|
## Personnalisation des messages d'erreur
|
|
43
44
|
|
|
44
45
|
Vous pouvez personnaliser le message d'erreur en utilisant la fonction `isHolidayDayFn` :
|
|
45
46
|
|
|
46
|
-
|
|
47
|
+
|
|
48
|
+
<Source dark code={`
|
|
47
49
|
import { isHolidayDayFn } from '@/utils/isHolidayDay'
|
|
48
50
|
|
|
49
51
|
const customRule = isHolidayDayFn({
|
|
50
52
|
default: 'Veuillez sélectionner une date qui n\'est pas un jour férié.',
|
|
51
53
|
})
|
|
52
|
-
|
|
54
|
+
`} />
|
|
53
55
|
|
|
54
56
|
## Fonctionnement
|
|
55
57
|
|
|
56
|
-
Cette règle utilise le composable `useHolidayDay` pour déterminer si une date est un jour férié en France. La règle retourne :
|
|
58
|
+
Cette règle utilise le composable `useHolidayDay` pour déterminer si une date est un jour férié en France. La valeur peut être une chaîne de caractères (format `DD/MM/YYYY`) ou un objet `Date`. La règle retourne :
|
|
57
59
|
|
|
58
60
|
- `true` si la valeur est vide ou si la date n'est pas un jour férié
|
|
59
|
-
- Un message d'erreur si la date est un jour férié
|
|
61
|
+
- Un message d'erreur si la date est un jour férié ou si le type de valeur n'est pas supporté
|
|
62
|
+
|
|
63
|
+
## API
|
|
64
|
+
|
|
65
|
+
<Source dark code={`
|
|
66
|
+
isHolidayDayFn(
|
|
67
|
+
errorMessages?: {
|
|
68
|
+
default: string;
|
|
69
|
+
}
|
|
70
|
+
): (value: string | Date) => true | string;
|
|
71
|
+
`} />
|
|
60
72
|
|
|
61
73
|
## Jours fériés pris en compte
|
|
62
74
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ruleMessage } from '@/utils/ruleMessage'
|
|
2
1
|
import { useHolidayDay } from '@/composables/date/useHolidayDay'
|
|
3
2
|
import type {
|
|
4
3
|
ErrorMessages,
|
|
@@ -7,6 +6,7 @@ import type {
|
|
|
7
6
|
Value,
|
|
8
7
|
} from '@/utils/rules/types'
|
|
9
8
|
import { defaultErrorMessages } from './locales'
|
|
9
|
+
import { validateDateValue } from '../validateDateValue'
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Vérifie qu'une date n'est pas un jour férié
|
|
@@ -17,16 +17,14 @@ export function isHolidayDayFn(
|
|
|
17
17
|
errorMessages: ErrorMessages = defaultErrorMessages,
|
|
18
18
|
): ValidationRule {
|
|
19
19
|
return (value: Value): ValidationResult => {
|
|
20
|
-
// Si la valeur est vide, on considère que c'est valide
|
|
21
|
-
if (!value) {
|
|
22
|
-
return true
|
|
23
|
-
}
|
|
24
|
-
|
|
25
20
|
// Utiliser le composable pour vérifier si la date est un jour férié
|
|
26
21
|
const { isHolidayDay } = useHolidayDay()
|
|
27
|
-
|
|
28
22
|
// On retourne true si ce n'est PAS un jour férié, sinon on retourne le message d'erreur
|
|
29
|
-
return (
|
|
23
|
+
return validateDateValue(
|
|
24
|
+
value,
|
|
25
|
+
formatted => !isHolidayDay(formatted),
|
|
26
|
+
{ errorMessages },
|
|
27
|
+
)
|
|
30
28
|
}
|
|
31
29
|
}
|
|
32
30
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest'
|
|
2
|
-
import { isHolidayDay } from '../index'
|
|
2
|
+
import { isHolidayDay, isHolidayDayFn } from '../index'
|
|
3
3
|
|
|
4
4
|
// Mock du composable useHolidayDay
|
|
5
5
|
// => du coup on ne teste plus la vrai fonction isHolidayDay mais son mock !
|
|
@@ -42,4 +42,16 @@ describe('isHolidayDay', () => {
|
|
|
42
42
|
expect(isHolidayDay(new Date('2025-07-14'))).toBe('La date ne peut pas être un jour férié.')
|
|
43
43
|
expect(isHolidayDay(new Date('2025-12-25'))).toBe('La date ne peut pas être un jour férié.')
|
|
44
44
|
})
|
|
45
|
+
|
|
46
|
+
it('devrait retourner un message d\'erreur si le type de valeur n\'est pas supporté', () => {
|
|
47
|
+
expect(isHolidayDay(123)).toBe('La date ne peut pas être un jour férié.')
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
it('devrait permettre de définir un message d\'erreur personnalisé via isHolidayDayFn', () => {
|
|
51
|
+
const rule = isHolidayDayFn({
|
|
52
|
+
default: 'Veuillez sélectionner une journée non fériée.',
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
expect(rule('01/01/2025')).toBe('Veuillez sélectionner une journée non fériée.')
|
|
56
|
+
})
|
|
45
57
|
})
|
|
@@ -72,7 +72,7 @@ isNotAfterDateFn(
|
|
|
72
72
|
errorMessages?: {
|
|
73
73
|
default: (date: string) => string;
|
|
74
74
|
}
|
|
75
|
-
): (value: string) => true | string;
|
|
75
|
+
): (value: string | Date) => true | string;
|
|
76
76
|
|
|
77
77
|
`} />
|
|
78
78
|
|
|
@@ -84,7 +84,7 @@ isNotAfterDateFn(
|
|
|
84
84
|
|
|
85
85
|
### Valeurs de retour
|
|
86
86
|
|
|
87
|
-
Retourne une fonction de validation qui
|
|
87
|
+
Retourne une fonction de validation qui accepte une chaîne de caractères ou un objet `Date` représentant une date et vérifie que cette date n'est pas postérieure à la date de référence.
|
|
88
88
|
|
|
89
89
|
## Exemples
|
|
90
90
|
|
|
@@ -63,16 +63,19 @@ export const CustomMessage: StoryObj<unknown> = {
|
|
|
63
63
|
return {
|
|
64
64
|
components: { VTextField },
|
|
65
65
|
setup() {
|
|
66
|
+
const model = ref('12/12/2023')
|
|
66
67
|
const date = isNotAfterDateFn('01/01/2022', {
|
|
67
68
|
default: (date: string) => `The date must not be after ${date}`,
|
|
68
69
|
})
|
|
69
|
-
return { date }
|
|
70
|
+
return { date, model }
|
|
70
71
|
},
|
|
71
72
|
template: `
|
|
72
73
|
<VTextField
|
|
74
|
+
v-model="model"
|
|
73
75
|
:rules="[date]"
|
|
74
76
|
label="Date"
|
|
75
77
|
variant="outlined"
|
|
78
|
+
validate-on="eager blur"
|
|
76
79
|
/>
|
|
77
80
|
`,
|
|
78
81
|
}
|
|
@@ -84,11 +87,13 @@ export const CustomMessage: StoryObj<unknown> = {
|
|
|
84
87
|
code: `
|
|
85
88
|
<script setup lang="ts">
|
|
86
89
|
import { VTextField } from 'vuetify/components'
|
|
90
|
+
import { ref } from 'vue'
|
|
87
91
|
import { isNotAfterDateFn } from '@cnamts/synapse'
|
|
88
92
|
|
|
89
93
|
const date = isNotAfterDateFn('01/01/2022', {
|
|
90
|
-
default: (date: string) =>
|
|
94
|
+
default: (date: string) => 'The date must not be after ' + date,
|
|
91
95
|
})
|
|
96
|
+
const model = ref('12/12/2023')
|
|
92
97
|
</script>
|
|
93
98
|
`,
|
|
94
99
|
},
|
|
@@ -97,9 +102,11 @@ export const CustomMessage: StoryObj<unknown> = {
|
|
|
97
102
|
code: `
|
|
98
103
|
<template>
|
|
99
104
|
<VTextField
|
|
105
|
+
v-model="model"
|
|
100
106
|
:rules="[date]"
|
|
101
107
|
label="Date"
|
|
102
108
|
variant="outlined"
|
|
109
|
+
validate-on="eager blur"
|
|
103
110
|
/>
|
|
104
111
|
</template>
|
|
105
112
|
`,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { formatDate } from '@/utils/formatDate'
|
|
2
2
|
import { parseDate } from '@/utils/parseDate'
|
|
3
|
-
import { ruleMessage } from '@/utils/ruleMessage'
|
|
4
3
|
import { isDateAfter } from '../../functions/validation/isDateAfter'
|
|
5
4
|
import type { ValidationResult, ValidationRule, Value } from '../types'
|
|
6
5
|
import { defaultErrorMessages } from './locales'
|
|
6
|
+
import { validateDateValue } from '../validateDateValue'
|
|
7
7
|
|
|
8
8
|
/** Check that the value is not after the specified date (DD/MM/YYYY format) */
|
|
9
9
|
export function isNotAfterDateFn(
|
|
@@ -11,19 +11,12 @@ export function isNotAfterDateFn(
|
|
|
11
11
|
errorMessages = defaultErrorMessages,
|
|
12
12
|
): ValidationRule {
|
|
13
13
|
return (value: Value): ValidationResult => {
|
|
14
|
-
if (!value) {
|
|
15
|
-
return true
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
if (typeof value !== 'string') {
|
|
19
|
-
return ruleMessage(errorMessages, 'default')
|
|
20
|
-
}
|
|
21
|
-
|
|
22
14
|
const formattedValue = formatDate(parseDate(date))
|
|
23
15
|
|
|
24
|
-
return (
|
|
25
|
-
|
|
26
|
-
|
|
16
|
+
return validateDateValue(
|
|
17
|
+
value,
|
|
18
|
+
formatted => !isDateAfter(date, formatted),
|
|
19
|
+
{ errorMessages, messageArgs: [formattedValue] },
|
|
27
20
|
)
|
|
28
21
|
}
|
|
29
22
|
}
|
|
@@ -8,6 +8,9 @@ describe('notAfterDate', () => {
|
|
|
8
8
|
const currentDate = formatDate(dayjs())
|
|
9
9
|
const pastDate = formatDate(dayjs().subtract(1, 'year'))
|
|
10
10
|
const futureDate = formatDate(dayjs().add(1, 'year'))
|
|
11
|
+
const pastDateObject = dayjs().subtract(1, 'year').toDate()
|
|
12
|
+
const futureDateObject = dayjs().add(1, 'year').toDate()
|
|
13
|
+
const todayDateObject = dayjs().toDate()
|
|
11
14
|
|
|
12
15
|
const rule = isNotAfterDateFn(currentDate)
|
|
13
16
|
|
|
@@ -22,4 +25,21 @@ describe('notAfterDate', () => {
|
|
|
22
25
|
it('returns true if the value is falsy', () => {
|
|
23
26
|
expect(rule('')).toBe(true)
|
|
24
27
|
})
|
|
28
|
+
|
|
29
|
+
it('returns true with a past Date object', () => {
|
|
30
|
+
expect(rule(pastDateObject)).toBe(true)
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
it('returns an error with a future Date object', () => {
|
|
34
|
+
expect(typeof rule(futureDateObject)).toBe('string')
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
it('returns true when the value is the reference date as a Date object', () => {
|
|
38
|
+
expect(rule(todayDateObject)).toBe(true)
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
it('returns an error when the value type is not supported', () => {
|
|
42
|
+
// number is allowed by Value type but is not handled by the rule
|
|
43
|
+
expect(typeof rule(123 as unknown as string)).toBe('string')
|
|
44
|
+
})
|
|
25
45
|
})
|
|
@@ -88,7 +88,7 @@ isNotAfterTodayFn(
|
|
|
88
88
|
errorMessages?: {
|
|
89
89
|
default: string;
|
|
90
90
|
}
|
|
91
|
-
): (value: string) => true | string;
|
|
91
|
+
): (value: string | Date) => true | string;
|
|
92
92
|
|
|
93
93
|
`} />
|
|
94
94
|
|
|
@@ -99,7 +99,7 @@ isNotAfterTodayFn(
|
|
|
99
99
|
|
|
100
100
|
### Valeurs de retour
|
|
101
101
|
|
|
102
|
-
Retourne une fonction qui prend en paramètre une chaîne de caractères représentant une date et retourne `true` si la date n'est pas postérieure à la date du jour, sinon retourne un message d'erreur.
|
|
102
|
+
Retourne une fonction qui prend en paramètre une chaîne de caractères ou un objet `Date` représentant une date et retourne `true` si la date n'est pas postérieure à la date du jour, sinon retourne un message d'erreur.
|
|
103
103
|
|
|
104
104
|
## Exemples
|
|
105
105
|
|
|
@@ -60,15 +60,17 @@ export const CustomMessage: StoryObj<unknown> = {
|
|
|
60
60
|
return {
|
|
61
61
|
components: { VTextField },
|
|
62
62
|
setup() {
|
|
63
|
+
const model = ref('31/12/2999')
|
|
63
64
|
const messages = {
|
|
64
65
|
default: 'The date must not be after today.',
|
|
65
66
|
}
|
|
66
67
|
const dateRule = isNotAfterTodayFn(messages)
|
|
67
68
|
|
|
68
|
-
return { dateRule }
|
|
69
|
+
return { dateRule, model }
|
|
69
70
|
},
|
|
70
71
|
template: `
|
|
71
72
|
<VTextField
|
|
73
|
+
v-model="model"
|
|
72
74
|
:rules="[dateRule]"
|
|
73
75
|
label="Date"
|
|
74
76
|
variant="outlined"
|
|
@@ -84,12 +86,14 @@ export const CustomMessage: StoryObj<unknown> = {
|
|
|
84
86
|
code: `
|
|
85
87
|
<script setup lang="ts">
|
|
86
88
|
import { VTextField } from 'vuetify/components'
|
|
89
|
+
import { ref } from 'vue'
|
|
87
90
|
import { isNotAfterTodayFn } from '@cnamts/synapse'
|
|
88
|
-
|
|
91
|
+
|
|
89
92
|
const messages = {
|
|
90
93
|
default: 'The date must not be after today.',
|
|
91
94
|
}
|
|
92
95
|
const dateRule = isNotAfterTodayFn(messages)
|
|
96
|
+
const model = ref('31/12/2999')
|
|
93
97
|
</script>
|
|
94
98
|
`,
|
|
95
99
|
},
|
|
@@ -98,9 +102,11 @@ export const CustomMessage: StoryObj<unknown> = {
|
|
|
98
102
|
code: `
|
|
99
103
|
<template>
|
|
100
104
|
<VTextField
|
|
105
|
+
v-model="model"
|
|
101
106
|
:rules="[dateRule]"
|
|
102
107
|
label="Date"
|
|
103
108
|
variant="outlined"
|
|
109
|
+
validate-on="eager blur"
|
|
104
110
|
/>
|
|
105
111
|
</template>
|
|
106
112
|
`,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { formatDate } from '@/utils/formatDate'
|
|
2
|
-
import { ruleMessage } from '@/utils/ruleMessage'
|
|
3
2
|
import dayjs from 'dayjs'
|
|
4
3
|
import { isDateAfter } from '../../functions/validation/isDateAfter'
|
|
5
4
|
import type {
|
|
@@ -9,18 +8,19 @@ import type {
|
|
|
9
8
|
Value,
|
|
10
9
|
} from '../types'
|
|
11
10
|
import { defaultErrorMessages } from './locales'
|
|
11
|
+
import { validateDateValue } from '../validateDateValue'
|
|
12
12
|
|
|
13
13
|
/** Check that the value is not after today (DD/MM/YYYY format) */
|
|
14
14
|
export function isNotAfterTodayFn(
|
|
15
15
|
errorMessages: ErrorMessages = defaultErrorMessages,
|
|
16
16
|
): ValidationRule {
|
|
17
17
|
return (value: Value): ValidationResult => {
|
|
18
|
-
|
|
19
|
-
return true
|
|
20
|
-
}
|
|
18
|
+
const today = formatDate(dayjs())
|
|
21
19
|
|
|
22
|
-
return (
|
|
23
|
-
|
|
20
|
+
return validateDateValue(
|
|
21
|
+
value,
|
|
22
|
+
formatted => !isDateAfter(today, formatted),
|
|
23
|
+
{ errorMessages },
|
|
24
24
|
)
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -8,6 +8,9 @@ const DATE_FORMAT = 'DD/MM/YYYY'
|
|
|
8
8
|
const pastDate = dayjs().subtract(1, 'year').format(DATE_FORMAT)
|
|
9
9
|
const futureDate = dayjs().add(1, 'year').format(DATE_FORMAT)
|
|
10
10
|
const today = dayjs().format(DATE_FORMAT)
|
|
11
|
+
const pastDateObject = dayjs().subtract(1, 'year').toDate()
|
|
12
|
+
const futureDateObject = dayjs().add(1, 'year').toDate()
|
|
13
|
+
const todayDateObject = dayjs().toDate()
|
|
11
14
|
|
|
12
15
|
describe('notAfterTodayFn', () => {
|
|
13
16
|
const notAfterToday = isNotAfterTodayFn(defaultErrorMessages)
|
|
@@ -27,4 +30,21 @@ describe('notAfterTodayFn', () => {
|
|
|
27
30
|
it('returns true when value is today', () => {
|
|
28
31
|
expect(notAfterToday(today)).toBe(true)
|
|
29
32
|
})
|
|
33
|
+
|
|
34
|
+
it('returns true when value is a past Date object', () => {
|
|
35
|
+
expect(notAfterToday(pastDateObject)).toBe(true)
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
it('returns error message when value is a future Date object', () => {
|
|
39
|
+
expect(notAfterToday(futureDateObject)).toBe(defaultErrorMessages.default)
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
it('returns true when value is today as a Date object', () => {
|
|
43
|
+
expect(notAfterToday(todayDateObject)).toBe(true)
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
it('returns error message when value type is not supported', () => {
|
|
47
|
+
// number is allowed by Value type but is not handled by the rule
|
|
48
|
+
expect(notAfterToday(123 as unknown as string)).toBe(defaultErrorMessages.default)
|
|
49
|
+
})
|
|
30
50
|
})
|
|
@@ -72,7 +72,7 @@ isNotBeforeDateFn(
|
|
|
72
72
|
errorMessages?: {
|
|
73
73
|
default?: (date: string) => string;
|
|
74
74
|
}
|
|
75
|
-
): (value: string) => true | string;
|
|
75
|
+
): (value: string | Date) => true | string;
|
|
76
76
|
|
|
77
77
|
`} />
|
|
78
78
|
|
|
@@ -84,7 +84,7 @@ isNotBeforeDateFn(
|
|
|
84
84
|
|
|
85
85
|
### Valeurs de retour
|
|
86
86
|
|
|
87
|
-
Retourne une fonction de validation utilisable dans un champs de formulaire Vuetify qui
|
|
87
|
+
Retourne une fonction de validation utilisable dans un champs de formulaire Vuetify qui accepte une chaîne de caractères ou un objet `Date` représentant une date et permet de vérifier que cette date n'est pas antérieure à la date de référence.
|
|
88
88
|
|
|
89
89
|
## Exemples
|
|
90
90
|
|
|
@@ -3,7 +3,7 @@ import { defaultErrorMessages } from './locales'
|
|
|
3
3
|
import { isDateBefore } from '../../functions/validation/isDateBefore'
|
|
4
4
|
import { formatDate } from '@/utils/formatDate'
|
|
5
5
|
import { parseDate } from '@/utils/parseDate'
|
|
6
|
-
import {
|
|
6
|
+
import { validateDateValue } from '../validateDateValue'
|
|
7
7
|
|
|
8
8
|
/** Check that the value is not after the specified date (DD/MM/YYYY format) */
|
|
9
9
|
export function isNotBeforeDateFn(
|
|
@@ -11,19 +11,12 @@ export function isNotBeforeDateFn(
|
|
|
11
11
|
errorMessages = defaultErrorMessages,
|
|
12
12
|
): ValidationRule {
|
|
13
13
|
return (value: Value): ValidationResult => {
|
|
14
|
-
if (!value) {
|
|
15
|
-
return true
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
if (typeof value !== 'string') {
|
|
19
|
-
return ruleMessage(errorMessages, 'default')
|
|
20
|
-
}
|
|
21
|
-
|
|
22
14
|
const formattedValue = formatDate(parseDate(date))
|
|
23
15
|
|
|
24
|
-
return (
|
|
25
|
-
|
|
26
|
-
|
|
16
|
+
return validateDateValue(
|
|
17
|
+
value,
|
|
18
|
+
formatted => !isDateBefore(date, formatted),
|
|
19
|
+
{ errorMessages, messageArgs: [formattedValue] },
|
|
27
20
|
)
|
|
28
21
|
}
|
|
29
22
|
}
|
|
@@ -8,6 +8,9 @@ describe('isNotBeforeDate', () => {
|
|
|
8
8
|
const currentDate = formatDate(dayjs())
|
|
9
9
|
const pastDate = formatDate(dayjs().subtract(1, 'year'))
|
|
10
10
|
const futureDate = formatDate(dayjs().add(1, 'year'))
|
|
11
|
+
const pastDateObject = dayjs().subtract(1, 'year').toDate()
|
|
12
|
+
const futureDateObject = dayjs().add(1, 'year').toDate()
|
|
13
|
+
const todayDateObject = dayjs().toDate()
|
|
11
14
|
|
|
12
15
|
const rule = isNotBeforeDateFn(currentDate)
|
|
13
16
|
|
|
@@ -22,4 +25,21 @@ describe('isNotBeforeDate', () => {
|
|
|
22
25
|
it('returns true if the value is falsy', () => {
|
|
23
26
|
expect(rule('')).toBe(true)
|
|
24
27
|
})
|
|
28
|
+
|
|
29
|
+
it('returns true with a future Date object', () => {
|
|
30
|
+
expect(rule(futureDateObject)).toBe(true)
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
it('returns an error with a past Date object', () => {
|
|
34
|
+
expect(typeof rule(pastDateObject)).toBe('string')
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
it('returns true when the value is the reference date as a Date object', () => {
|
|
38
|
+
expect(rule(todayDateObject)).toBe(true)
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
it('returns an error when the value type is not supported', () => {
|
|
42
|
+
// number is allowed by Value type but is not handled by the rule
|
|
43
|
+
expect(typeof rule(123 as unknown as string)).toBe('string')
|
|
44
|
+
})
|
|
25
45
|
})
|
|
@@ -89,7 +89,7 @@ isNotBeforeTodayFn(
|
|
|
89
89
|
errorMessages?: {
|
|
90
90
|
default: string;
|
|
91
91
|
}
|
|
92
|
-
): (value: string) => true | string;
|
|
92
|
+
): (value: string | Date) => true | string;
|
|
93
93
|
|
|
94
94
|
`} />
|
|
95
95
|
|
|
@@ -100,7 +100,7 @@ isNotBeforeTodayFn(
|
|
|
100
100
|
|
|
101
101
|
### Valeurs de retour
|
|
102
102
|
|
|
103
|
-
Retourne une fonction qui prend en paramètre une chaîne de caractères représentant une date et retourne `true` si la date n'est pas
|
|
103
|
+
Retourne une fonction qui prend en paramètre une chaîne de caractères ou un objet `Date` représentant une date et retourne `true` si la date n'est pas antérieure à la date du jour, sinon retourne un message d'erreur.
|
|
104
104
|
|
|
105
105
|
## Exemples
|
|
106
106
|
|
|
@@ -60,15 +60,17 @@ export const CustomMessage: StoryObj<unknown> = {
|
|
|
60
60
|
return {
|
|
61
61
|
components: { VTextField },
|
|
62
62
|
setup() {
|
|
63
|
+
const model = ref('01/01/2000')
|
|
63
64
|
const messages = {
|
|
64
65
|
default: 'The date must not be Before today.',
|
|
65
66
|
}
|
|
66
67
|
const dateRule = isNotBeforeTodayFn(messages)
|
|
67
68
|
|
|
68
|
-
return { dateRule }
|
|
69
|
+
return { dateRule, model }
|
|
69
70
|
},
|
|
70
71
|
template: `
|
|
71
72
|
<VTextField
|
|
73
|
+
v-model="model"
|
|
72
74
|
:rules="[dateRule]"
|
|
73
75
|
label="Date"
|
|
74
76
|
variant="outlined"
|
|
@@ -84,12 +86,14 @@ export const CustomMessage: StoryObj<unknown> = {
|
|
|
84
86
|
code: `
|
|
85
87
|
<script setup lang="ts">
|
|
86
88
|
import { VTextField } from 'vuetify/components'
|
|
89
|
+
import { ref } from 'vue'
|
|
87
90
|
import { isNotBeforeTodayFn } from '@cnamts/synapse'
|
|
88
|
-
|
|
91
|
+
|
|
89
92
|
const messages = {
|
|
90
93
|
default: 'The date must not be Before today.',
|
|
91
94
|
}
|
|
92
95
|
const dateRule = isNotBeforeTodayFn(messages)
|
|
96
|
+
const model = ref('01/01/2000')
|
|
93
97
|
</script>
|
|
94
98
|
`,
|
|
95
99
|
},
|
|
@@ -98,9 +102,11 @@ export const CustomMessage: StoryObj<unknown> = {
|
|
|
98
102
|
code: `
|
|
99
103
|
<template>
|
|
100
104
|
<VTextField
|
|
105
|
+
v-model="model"
|
|
101
106
|
:rules="[dateRule]"
|
|
102
107
|
label="Date"
|
|
103
108
|
variant="outlined"
|
|
109
|
+
validate-on="eager blur"
|
|
104
110
|
/>
|
|
105
111
|
</template>
|
|
106
112
|
`,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { formatDate } from '@/utils/formatDate'
|
|
2
|
-
import { ruleMessage } from '@/utils/ruleMessage'
|
|
3
2
|
import dayjs from 'dayjs'
|
|
4
3
|
import { isDateBefore } from '../../functions/validation/isDateBefore'
|
|
5
4
|
import type {
|
|
@@ -9,18 +8,19 @@ import type {
|
|
|
9
8
|
Value,
|
|
10
9
|
} from '../types'
|
|
11
10
|
import { defaultErrorMessages } from './locales'
|
|
11
|
+
import { validateDateValue } from '../validateDateValue'
|
|
12
12
|
|
|
13
13
|
/** Check that the value is not before today (DD/MM/YYYY format) */
|
|
14
14
|
export function isNotBeforeTodayFn(
|
|
15
15
|
errorMessages: ErrorMessages = defaultErrorMessages,
|
|
16
16
|
): ValidationRule {
|
|
17
17
|
return (value: Value): ValidationResult => {
|
|
18
|
-
|
|
19
|
-
return true
|
|
20
|
-
}
|
|
18
|
+
const today = formatDate(dayjs())
|
|
21
19
|
|
|
22
|
-
return (
|
|
23
|
-
|
|
20
|
+
return validateDateValue(
|
|
21
|
+
value,
|
|
22
|
+
formatted => !isDateBefore(today, formatted),
|
|
23
|
+
{ errorMessages },
|
|
24
24
|
)
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -8,6 +8,9 @@ const DATE_FORMAT = 'DD/MM/YYYY'
|
|
|
8
8
|
const pastDate = dayjs().subtract(1, 'year').format(DATE_FORMAT)
|
|
9
9
|
const futureDate = dayjs().add(1, 'year').format(DATE_FORMAT)
|
|
10
10
|
const today = dayjs().format(DATE_FORMAT)
|
|
11
|
+
const pastDateObject = dayjs().subtract(1, 'year').toDate()
|
|
12
|
+
const futureDateObject = dayjs().add(1, 'year').toDate()
|
|
13
|
+
const todayDateObject = dayjs().toDate()
|
|
11
14
|
|
|
12
15
|
describe('isNotBeforeToday', () => {
|
|
13
16
|
it('returns an error when the date is past', () => {
|
|
@@ -33,4 +36,20 @@ describe('isNotBeforeToday', () => {
|
|
|
33
36
|
it('returns true when value is today', () => {
|
|
34
37
|
expect(isNotBeforeToday(today)).toBe(true)
|
|
35
38
|
})
|
|
39
|
+
|
|
40
|
+
it('returns an error when the value is a past Date object', () => {
|
|
41
|
+
expect(typeof isNotBeforeToday(pastDateObject)).toBe('string')
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
it('returns true when the value is a future Date object', () => {
|
|
45
|
+
expect(isNotBeforeToday(futureDateObject)).toBe(true)
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
it('returns true when the value is today as a Date object', () => {
|
|
49
|
+
expect(isNotBeforeToday(todayDateObject)).toBe(true)
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
it('returns an error when the value is neither a string nor a Date', () => {
|
|
53
|
+
expect(typeof isNotBeforeToday(123)).toBe('string')
|
|
54
|
+
})
|
|
36
55
|
})
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import dayjs from 'dayjs'
|
|
2
|
+
import { formatDate } from '@/utils/formatDate'
|
|
3
|
+
import { ruleMessage } from '@/utils/ruleMessage'
|
|
4
|
+
import type { ErrorMessages, ValidationResult, Value } from './types'
|
|
5
|
+
|
|
6
|
+
interface ValidateDateOptions {
|
|
7
|
+
errorMessages: ErrorMessages
|
|
8
|
+
messageKey?: string
|
|
9
|
+
messageArgs?: unknown[]
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Utility to validate date-like values (string | Date) in rules.
|
|
14
|
+
* - returns true when the value is falsy
|
|
15
|
+
* - supports string and Date inputs
|
|
16
|
+
* - falls back to a rule message for unsupported types or invalid dates
|
|
17
|
+
*/
|
|
18
|
+
export function validateDateValue(
|
|
19
|
+
value: Value,
|
|
20
|
+
isValid: (formatted: string) => boolean,
|
|
21
|
+
{ errorMessages, messageKey = 'default', messageArgs }: ValidateDateOptions,
|
|
22
|
+
): ValidationResult {
|
|
23
|
+
if (!value) {
|
|
24
|
+
return true
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (value instanceof Date) {
|
|
28
|
+
const formatted = formatDate(dayjs(value))
|
|
29
|
+
return isValid(formatted) || ruleMessage(errorMessages, messageKey, messageArgs)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (typeof value === 'string') {
|
|
33
|
+
return isValid(value) || ruleMessage(errorMessages, messageKey, messageArgs)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return ruleMessage(errorMessages, messageKey, messageArgs)
|
|
37
|
+
}
|
package/src/vuetifyConfig.ts
CHANGED
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
apContextualTokens,
|
|
19
19
|
apLightTheme,
|
|
20
20
|
apDarkTheme,
|
|
21
|
+
apColorsTokens,
|
|
21
22
|
} from './designTokens'
|
|
22
23
|
import { createFlattenTheme, createFontVariables } from './designTokens/utils'
|
|
23
24
|
import { fr } from 'vuetify/locale'
|
|
@@ -39,12 +40,13 @@ export const createVuetifyInstance = () => createVuetify({
|
|
|
39
40
|
colors: {
|
|
40
41
|
...cnamLightTheme,
|
|
41
42
|
...cnamDarkTheme,
|
|
43
|
+
...createFlattenTheme(cnamColorsTokens),
|
|
42
44
|
},
|
|
43
45
|
variables: {
|
|
44
46
|
'border-color': cnamColorsTokens.grey.base,
|
|
45
47
|
'font-family': cnamFontsTokens.family.primary,
|
|
46
|
-
...createFlattenTheme(cnamContextualTokens),
|
|
47
48
|
...createFontVariables(cnamFontsTokens),
|
|
49
|
+
...createFlattenTheme(cnamContextualTokens),
|
|
48
50
|
},
|
|
49
51
|
},
|
|
50
52
|
pa: {
|
|
@@ -52,12 +54,13 @@ export const createVuetifyInstance = () => createVuetify({
|
|
|
52
54
|
colors: {
|
|
53
55
|
...paLightTheme,
|
|
54
56
|
...paDarkTheme,
|
|
57
|
+
...createFlattenTheme(paColorsTokens),
|
|
55
58
|
},
|
|
56
59
|
variables: {
|
|
57
60
|
'border-color': paColorsTokens.grey.base,
|
|
58
61
|
'font-family': paFontsTokens.family.primary,
|
|
59
|
-
...createFlattenTheme(paContextualTokens),
|
|
60
62
|
...createFontVariables(paFontsTokens),
|
|
63
|
+
...createFlattenTheme(paContextualTokens),
|
|
61
64
|
},
|
|
62
65
|
},
|
|
63
66
|
ap: {
|
|
@@ -65,6 +68,7 @@ export const createVuetifyInstance = () => createVuetify({
|
|
|
65
68
|
colors: {
|
|
66
69
|
...apLightTheme,
|
|
67
70
|
...apDarkTheme,
|
|
71
|
+
...createFlattenTheme(apColorsTokens),
|
|
68
72
|
},
|
|
69
73
|
variables: {
|
|
70
74
|
'font-family': '"Arial", sans-serif',
|