@cnamts/synapse 1.0.24 → 1.0.25
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 +27 -5
- package/dist/{AutocompleteFilter-BWLR3U7W.js → AutocompleteFilter-D7qBuCAP.js} +1 -1
- package/dist/{AutocompleteFilter-D9jzRzAL.cjs → AutocompleteFilter-Df9i5mAl.cjs} +1 -1
- package/dist/{DateFilter-DTUl8hb1.cjs → DateFilter-BJD6FMev.cjs} +1 -1
- package/dist/{DateFilter-BpwFexzi.js → DateFilter-BitMWrMU.js} +1 -1
- package/dist/{NumberFilter-Bz_NTdX9.js → NumberFilter-BTLUxw0a.js} +1 -1
- package/dist/{NumberFilter-MAEojdk0.cjs → NumberFilter-DGCzCXzI.cjs} +1 -1
- package/dist/{PeriodFilter-DX_wy9g-.js → PeriodFilter-B5rUIPAC.js} +1 -1
- package/dist/{PeriodFilter-CC4WgIhl.cjs → PeriodFilter-DO_ecTZW.cjs} +1 -1
- package/dist/{SelectFilter-BR3fvl-a.cjs → SelectFilter-CGwcKWLm.cjs} +1 -1
- package/dist/{SelectFilter-xqiPtPgX.js → SelectFilter-l4QnRcuk.js} +2 -2
- package/dist/{TextFilter-CCfYFl5F.cjs → TextFilter-B8nf7xoK.cjs} +1 -1
- package/dist/{TextFilter-BBl3JFqK.js → TextFilter-C9hj6Qrp.js} +1 -1
- package/dist/apLightTheme-CEK4iY3f.cjs +1 -0
- package/dist/{apLightTheme-D1P4jcD0.js → apLightTheme-DnIM24Lv.js} +441 -722
- package/dist/components/Customs/Selects/SyAutocomplete/SyAutocomplete.d.ts +10 -6
- package/dist/components/Customs/SyCheckbox/SyCheckbox.d.ts +3 -0
- package/dist/components/Customs/SyTabs/SyTabs.d.ts +13 -11
- package/dist/components/Customs/SyTextField/SyTextField.d.ts +4 -4
- package/dist/components/DatePicker/CalendarMode/DatePicker.d.ts +4 -24
- package/dist/components/DatePicker/ComplexDatePicker/ComplexDatePicker.d.ts +2 -12
- package/dist/components/DatePicker/DateTextInput/DateTextInput.d.ts +1 -6
- package/dist/components/DatePicker/composables/useDatePickerState.d.ts +1 -0
- package/dist/components/FileList/FileList.d.ts +6 -0
- package/dist/components/FilterSideBar/FilterSideBar.d.ts +2 -0
- package/dist/components/HeaderNavigationBar/HeaderNavigationBar.d.ts +13 -13
- package/dist/components/HeaderNavigationBar/HorizontalNavbar/HorizontalNavbar.d.ts +3 -3
- package/dist/components/MonthPicker/MonthPicker.d.ts +1 -6
- package/dist/components/MonthPicker/MonthPickerText/MonthPickerInput.d.ts +1 -6
- package/dist/components/NirField/NirField.d.ts +4 -16
- package/dist/components/PeriodField/PeriodField.d.ts +8 -48
- package/dist/components/PhoneField/PhoneField.d.ts +1 -6
- package/dist/components/Tables/SyServerTable/SyServerTable.d.ts +1 -0
- package/dist/components/Tables/SyTable/SyTable.d.ts +1 -0
- package/dist/components/Tables/common/SyTablePagination.d.ts +2 -0
- package/dist/components/Tables/common/TableHeader.d.ts +5 -0
- package/dist/components/Tables/common/locales.d.ts +3 -0
- package/dist/components/Tables/common/types.d.ts +2 -0
- package/dist/components/UploadWorkflow/UploadWorkflow.d.ts +1 -0
- package/dist/composables/unifyValidation/documentationValidationProps.d.ts +230 -0
- package/dist/composables/validation/useValidation.d.ts +5 -1
- package/dist/design-system-v3.js +2 -2
- package/dist/design-system-v3.umd.cjs +1 -1
- package/dist/designTokens/tokens/amelipro/apColors.d.ts +10 -10
- package/dist/designTokens/tokens/amelipro/apColors2026.d.ts +1 -2
- package/dist/designTokens/tokens/amelipro/apContextual.d.ts +44 -0
- package/dist/designTokens/tokens/amelipro/apSemantic.d.ts +1 -1
- package/dist/designTokens/tokens/baseColors.d.ts +127 -0
- package/dist/designTokens/tokens/baseContextualTokens.d.ts +50 -0
- package/dist/designTokens/tokens/cnam/cnamColors.d.ts +10 -10
- package/dist/designTokens/tokens/cnam/cnamSemantic.d.ts +1 -1
- package/dist/designTokens/tokens/pa/paColors.d.ts +1 -166
- package/dist/designTokens/tokens/pa/paSemantic.d.ts +1 -1
- package/dist/designTokens/utils/buildColorClassMap.d.ts +12 -0
- package/dist/designTokens/utils/createFlattenTheme.d.ts +1 -3
- package/dist/designTokens/utils/index.d.ts +2 -2
- package/dist/main-ByDPHpae.cjs +1067 -0
- package/dist/main-Cpx8Co6H.js +38869 -0
- package/dist/synapse.css +1 -1
- package/dist/utils/functions/classToHex.d.ts +1 -1
- package/dist/utils/functions/createHexResolver.d.ts +16 -0
- package/dist/vuetifyConfig.js +113 -152
- package/dist/vuetifyConfig.umd.cjs +1 -1
- package/package.json +29 -18
- package/src/assets/amelipro/apTokens2026.scss +5 -5
- package/src/assets/overrides/_breakpoints.scss +25 -0
- package/src/assets/overrides/_btns.scss +0 -2
- package/src/assets/overrides/_forms.scss +1 -3
- package/src/assets/overrides/_icons.scss +7 -11
- package/src/assets/overrides/_otp.scss +41 -0
- package/src/assets/overrides/_tables.scss +11 -20
- package/src/assets/overrides/_tooltips.scss +17 -7
- package/src/assets/overrides/_typography.scss +35 -37
- package/src/assets/overrides/_utilities.scss +43 -47
- package/src/assets/themes.scss +1 -0
- package/src/components/Amelipro/AmeliproAccordion/AmeliproAccordionTemplate/AmeliproAccordionTemplate.vue +20 -20
- package/src/components/Amelipro/AmeliproAccordionFrieze/AmeliproAccordionFrieze.vue +12 -14
- package/src/components/Amelipro/AmeliproAccordionList/AmeliproAccordionList.vue +4 -6
- package/src/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResultTemplate/AmeliproAccordionResultTemplate.vue +5 -5
- package/src/components/Amelipro/AmeliproAccordionResultList/AmeliproAccordionResultList.vue +4 -6
- package/src/components/Amelipro/AmeliproAutoCompleteField/AmeliproAutoCompleteField.vue +4 -6
- package/src/components/Amelipro/AmeliproBadge/AmeliproBadge.vue +4 -6
- package/src/components/Amelipro/AmeliproBreadcrumb/AmeliproBreadcrumb.vue +1 -3
- package/src/components/Amelipro/AmeliproBtn/AmeliproBtn.vue +4 -6
- package/src/components/Amelipro/AmeliproCallback/AmeliproCallback.vue +2 -2
- package/src/components/Amelipro/AmeliproCard/AmeliproCard.vue +31 -31
- package/src/components/Amelipro/AmeliproCarousel/AmeliproCarousel.vue +5 -7
- package/src/components/Amelipro/AmeliproCheckbox/AmeliproCheckbox.vue +13 -15
- package/src/components/Amelipro/AmeliproCheckboxGroup/AmeliproCheckboxGroup.vue +23 -23
- package/src/components/Amelipro/AmeliproChips/AmeliproChips.vue +1 -3
- package/src/components/Amelipro/AmeliproClickableTile/AmeliproClickableTile.vue +17 -12
- package/src/components/Amelipro/AmeliproClickableTile/tests/__snapshots__/AmeliproClickableTile.spec.ts.snap +2 -2
- package/src/components/Amelipro/AmeliproCopyBtn/AmeliproCopyBtn.vue +4 -6
- package/src/components/Amelipro/AmeliproCustomSelector/AmeliproCustomSelector.vue +13 -13
- package/src/components/Amelipro/AmeliproDentalChart/AmeliproDentalChart.vue +4 -2
- package/src/components/Amelipro/AmeliproDentalChart/AmeliproTooth/AmeliproTooth.vue +4 -4
- package/src/components/Amelipro/AmeliproDialog/AmeliproDialog.vue +5 -7
- package/src/components/Amelipro/AmeliproDisclosure/AmeliproDisclosure.vue +1 -3
- package/src/components/Amelipro/AmeliproErrorTemplate/AmeliproErrorTemplate.vue +2 -4
- package/src/components/Amelipro/AmeliproFilePreview/AmeliproFilePreview.vue +4 -6
- package/src/components/Amelipro/AmeliproFilters/AmeliproFilters.vue +13 -13
- package/src/components/Amelipro/AmeliproFirstLogin/AmeliproFirstLogin.vue +3 -5
- package/src/components/Amelipro/AmeliproFooter/AmeliproFooter.vue +1 -3
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeader.vue +2 -4
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBar.vue +1 -3
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBrandSection/AmeliproHeaderBrandSection.vue +20 -16
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBrandSection/__tests__/__snapshots__/AmeliproHeaderBrandSection.spec.ts.snap +1 -1
- package/src/components/Amelipro/AmeliproIconBtn/AmeliproIconBtn.vue +2 -4
- package/src/components/Amelipro/AmeliproIllustratedDataTile/AmeliproIllustratedDataTile.vue +5 -7
- package/src/components/Amelipro/AmeliproIllustratedRadioGroup/AmeliproIllustratedRadioGroup.vue +6 -8
- package/src/components/Amelipro/AmeliproMailTile/AmeliproMailTile.vue +14 -14
- package/src/components/Amelipro/AmeliproMenu/AmeliproMenu.vue +11 -13
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproDropdownMenu/AmeliproDropdownMenu.vue +2 -4
- package/src/components/Amelipro/AmeliproMessagingLayout/AmeliproMessagingLayout.vue +8 -8
- package/src/components/Amelipro/AmeliproMultipleFoldingCard/AmeliproMultipleFoldingCard.vue +40 -40
- package/src/components/Amelipro/AmeliproNumberedCard/AmeliproNumberedCard.vue +27 -27
- package/src/components/Amelipro/AmeliproOnboarding/AmeliproOnboarding.vue +3 -5
- package/src/components/Amelipro/AmeliproPageLayout/AmeliproPageLayout.vue +2 -4
- package/src/components/Amelipro/AmeliproPagination/AmeliproPagination.vue +2 -4
- package/src/components/Amelipro/AmeliproPagination/AmeliproPaginationBtn/AmeliproPaginationBtn.vue +3 -5
- package/src/components/Amelipro/AmeliproPatientBanner/AmeliproPatientBanner.vue +1 -3
- package/src/components/Amelipro/AmeliproPatientLogged/AmeliproPatientLogged.vue +2 -4
- package/src/components/Amelipro/AmeliproPatientLogin/AmeliproPatientLogin.vue +4 -4
- package/src/components/Amelipro/AmeliproPatientLogin/AmeliproPatientLoginForm/AmeliproPatientLoginForm.vue +1 -3
- package/src/components/Amelipro/AmeliproPostalAddressField/AmeliproPostalAddressCityRow/AmeliproPostalAddressCityRow.vue +3 -5
- package/src/components/Amelipro/AmeliproPostalAddressField/AmeliproPostalAddressField.vue +3 -5
- package/src/components/Amelipro/AmeliproRadioGroup/AmeliproRadioGroup.vue +23 -23
- package/src/components/Amelipro/AmeliproResultList/AmeliproResultList.vue +4 -6
- package/src/components/Amelipro/AmeliproSelect/AmeliproSelect.vue +12 -22
- package/src/components/Amelipro/AmeliproStateTile/AmeliproStateTile.vue +10 -12
- package/src/components/Amelipro/AmeliproStepper/AmeliproStepper.vue +17 -17
- package/src/components/Amelipro/AmeliproTable/AmeliproTable.vue +8 -10
- package/src/components/Amelipro/AmeliproTabs/AmeliproTabBtn/AmeliproTabBtn.vue +6 -8
- package/src/components/Amelipro/AmeliproTabs/AmeliproTabs.vue +4 -4
- package/src/components/Amelipro/AmeliproTextArea/AmeliproTextArea.vue +4 -6
- package/src/components/Amelipro/AmeliproTextField/AmeliproTextField.vue +7 -9
- package/src/components/Amelipro/AmeliproTileBtn/AmeliproTileBtn.vue +3 -5
- package/src/components/Amelipro/AmeliproTooltips/AmeliproTooltips.vue +0 -2
- package/src/components/Amelipro/AmeliproUpload/AmeliproUpload.vue +6 -6
- package/src/components/Amelipro/ServiceMenu/ServiceMenu.vue +2 -2
- package/src/components/Amelipro/StructureMenu/StructureBtn/StructureBtn.vue +4 -4
- package/src/components/Amelipro/StructureMenu/StructureItem/StructureItem.vue +4 -6
- package/src/components/Amelipro/StructureMenu/StructureMenu.vue +2 -2
- package/src/components/Amelipro/StructureMenu/StructureTabs/StructureTabs.vue +2 -2
- package/src/components/Amelipro/UserMenu/UserMenu.vue +1 -3
- package/src/components/BackBtn/tests/BackBtn.visual.cy.ts +43 -0
- package/src/components/BackBtn/tests/__snapshots__/back-btn-custom-bg.snap.png +0 -0
- package/src/components/BackBtn/tests/__snapshots__/back-btn-dark-mode.snap.png +0 -0
- package/src/components/BackBtn/tests/__snapshots__/back-btn-default.snap.png +0 -0
- package/src/components/BackBtn/tests/__snapshots__/back-btn-no-icon.snap.png +0 -0
- package/src/components/Captcha/Captcha.vue +1 -3
- package/src/components/ChipList/ChipList.vue +14 -16
- package/src/components/CookiesSelection/CookiesInformation/CookiesInformation.vue +0 -2
- package/src/components/CopyBtn/CopyBtn.vue +1 -3
- package/src/components/Customs/Selects/SelectBtnField/SelectBtnField.vue +17 -17
- package/src/components/Customs/Selects/SelectBtnField/tests/SelectBtnField.spec.ts +31 -0
- package/src/components/Customs/Selects/SyAutocomplete/SyAutocomplete.stories.ts +66 -0
- package/src/components/Customs/Selects/SyAutocomplete/SyAutocomplete.vue +7 -3
- package/src/components/Customs/Selects/SyAutocomplete/tests/SyAutocomplete.a11y.spec.ts +18 -0
- package/src/components/Customs/Selects/SyAutocomplete/tests/SyAutocomplete.spec.ts +66 -0
- package/src/components/Customs/Selects/SyInputSelect/SyInputSelect.vue +4 -6
- package/src/components/Customs/Selects/SySelect/SySelect.stories.ts +1 -39
- package/src/components/Customs/Selects/SySelect/SySelect.vue +263 -63
- package/src/components/Customs/Selects/SySelect/accessibilite/Accessibility.mdx +199 -269
- package/src/components/Customs/Selects/SySelect/tests/SySelect.spec.ts +35 -0
- package/src/components/Customs/SyCheckbox/SyCheckbox.mdx +5 -0
- package/src/components/Customs/SyCheckbox/SyCheckbox.vue +29 -0
- package/src/components/Customs/SyCheckbox/accessibilite/Accessibility.mdx +18 -3
- package/src/components/Customs/SyPagination/SyPagination.vue +0 -2
- package/src/components/Customs/SyTabs/SyTabs.mdx +0 -58
- package/src/components/Customs/SyTabs/SyTabs.stories.ts +32 -33
- package/src/components/Customs/SyTabs/SyTabs.vue +87 -67
- package/src/components/Customs/SyTabs/accessibilite/Accessibility.mdx +83 -23
- package/src/components/Customs/SyTabs/tests/SyTabs.a11y.spec.ts +88 -0
- package/src/components/Customs/SyTabs/tests/SyTabs.spec.ts +46 -1
- package/src/components/Customs/SyTextField/SyTextField.stories.ts +21 -41
- package/src/components/Customs/SyTextField/SyTextField.vue +4 -6
- package/src/components/DatePicker/CalendarMode/DatePicker.vue +12 -14
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.vue +20 -16
- package/src/components/DatePicker/ComplexDatePicker/tests/ComplexDatePicker.spec.ts +23 -0
- package/src/components/DatePicker/DateTextInput/DateTextInput.vue +8 -10
- package/src/components/DatePicker/composables/tests/useDatePickerState.spec.ts +53 -0
- package/src/components/DatePicker/composables/useDatePickerState.ts +24 -0
- package/src/components/DatePicker/composables/useDateTextField.ts +0 -1
- package/src/components/DatePicker/composables/useMonthButtonCustomization.ts +9 -8
- package/src/components/DatePicker/playground/DatePickerHolidayRule.vue +1 -1
- package/src/components/DialogBox/DialogBox.vue +3 -5
- package/src/components/DialogBox/tests/DialogBox.visual.cy.ts +76 -0
- package/src/components/DialogBox/tests/__snapshots__/dialog-box-custom-texts.snap.png +0 -0
- package/src/components/DialogBox/tests/__snapshots__/dialog-box-default.snap.png +0 -0
- package/src/components/DialogBox/tests/__snapshots__/dialog-box-no-actions.snap.png +0 -0
- package/src/components/FileList/FileList.vue +9 -2
- package/src/components/FileList/UploadItem/UploadItem.vue +11 -13
- package/src/components/FileList/tests/FileList.spec.ts +47 -0
- package/src/components/FileUpload/FileUpload.vue +3 -5
- package/src/components/FileUpload/FileUploadContent.vue +3 -5
- package/src/components/FilterInline/FilterInline.vue +1 -3
- package/src/components/FilterSideBar/FilterSideBar.mdx +44 -1
- package/src/components/FilterSideBar/FilterSideBar.stories.ts +105 -1
- package/src/components/FilterSideBar/FilterSideBar.vue +7 -0
- package/src/components/FilterSideBar/tests/FilterSideBar.a11y.spec.ts +54 -1
- package/src/components/FilterSideBar/tests/FilterSideBar.spec.ts +42 -0
- package/src/components/FooterBar/FooterBar.vue +9 -13
- package/src/components/FranceConnectBtn/FranceConnectBtn.vue +1 -1
- package/src/components/HeaderBar/HeaderBar.vue +2 -3
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderBurgerMenu.vue +2 -3
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuItem/HeaderMenuItem.vue +2 -3
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuSection/HeaderMenuSection.vue +0 -1
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.vue +8 -9
- package/src/components/HeaderBar/HeaderBurgerMenu/menu.scss +0 -8
- package/src/components/HeaderBar/HeaderBurgerMenu/tests/HeaderBurgerMenu.visual.cy.ts +196 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/tests/__snapshots__/header-burger-menu-generated-submenu-open.snap.png +0 -0
- package/src/components/HeaderBar/HeaderBurgerMenu/tests/__snapshots__/header-burger-menu-generated.snap.png +0 -0
- package/src/components/HeaderBar/HeaderLogo/HeaderLogo.vue +0 -1
- package/src/components/HeaderBar/HeaderMenuBtn/HeaderMenuBtn.vue +6 -7
- package/src/components/HeaderBar/tests/HeaderBar.visual.cy.ts +81 -0
- package/src/components/HeaderBar/tests/__snapshots__/header-bar-custom-width.snap.png +0 -0
- package/src/components/HeaderBar/tests/__snapshots__/header-bar-default.snap.png +0 -0
- package/src/components/HeaderBar/tests/__snapshots__/header-bar-no-sticky.snap.png +0 -0
- package/src/components/HeaderBar/tests/__snapshots__/header-bar-with-prepend.snap.png +0 -0
- package/src/components/HeaderBar/tests/__snapshots__/header-bar-with-side.snap.png +0 -0
- package/src/components/HeaderBar/tests/__snapshots__/header-bar-with-subtitle.snap.png +0 -0
- package/src/components/HeaderNavigationBar/HeaderNavigationBar.vue +12 -3
- package/src/components/HeaderNavigationBar/HorizontalNavbar/HorizontalNavbar.vue +15 -8
- package/src/components/HeaderToolbar/HeaderToolbar.vue +6 -7
- package/src/components/LangBtn/LangBtn.vue +2 -4
- package/src/components/Logo/tests/Logo.visual.cy.ts +57 -0
- package/src/components/Logo/tests/__snapshots__/logo-avatar.snap.png +0 -0
- package/src/components/Logo/tests/__snapshots__/logo-dark.snap.png +0 -0
- package/src/components/Logo/tests/__snapshots__/logo-default.snap.png +0 -0
- package/src/components/Logo/tests/__snapshots__/logo-no-organism.snap.png +0 -0
- package/src/components/Logo/tests/__snapshots__/logo-no-signature.snap.png +0 -0
- package/src/components/Logo/tests/__snapshots__/logo-risque-pro.snap.png +0 -0
- package/src/components/LogoBrandSection/LogoBrandSection.vue +2 -2
- package/src/components/MonthPicker/MonthPickerVisual/VisualPickerHeader.vue +1 -1
- package/src/components/NirField/NirField.stories.ts +2 -2
- package/src/components/NirField/NirField.vue +3 -5
- package/src/components/NirField/accessibilite/Accessibility.mdx +100 -5
- package/src/components/NirField/tests/NirField.spec.ts +118 -0
- package/src/components/NirField/tests/useNirValidation.spec.ts +449 -0
- package/src/components/NirField/useNirValidation.ts +38 -32
- package/src/components/NotificationBar/Notification/Notification.vue +5 -7
- package/src/components/NotificationBar/NotificationBar.vue +1 -3
- package/src/components/PaginatedTable/PaginatedTable.vue +2 -3
- package/src/components/PaginatedTable/Pagination.vue +3 -5
- package/src/components/PasswordField/PasswordField.vue +8 -10
- package/src/components/PhoneField/PhoneField.vue +3 -3
- package/src/components/RangeField/RangeSlider/RangeSlider.vue +0 -2
- package/src/components/RangeField/RangeSlider/Tooltip/Tooltip.vue +1 -1
- package/src/components/RangeField/tests/RangeField.visual.cy.ts +65 -0
- package/src/components/RangeField/tests/__snapshots__/range-field-custom-bg.snap.png +0 -0
- package/src/components/RangeField/tests/__snapshots__/range-field-custom-range.snap.png +0 -0
- package/src/components/RangeField/tests/__snapshots__/range-field-default.snap.png +0 -0
- package/src/components/RangeField/tests/__snapshots__/range-field-step.snap.png +0 -0
- package/src/components/RangeField/tests/__snapshots__/range-field-with-label.snap.png +0 -0
- package/src/components/RatingPicker/EmotionPicker/EmotionPicker.vue +6 -8
- package/src/components/RatingPicker/StarsPicker/StarsPicker.vue +3 -5
- package/src/components/SearchListField/SearchListField.vue +0 -2
- package/src/components/SkipLink/SkipLink.vue +2 -4
- package/src/components/SocialMediaLinks/SocialMediaLinks.vue +6 -6
- package/src/components/SubHeader/SubHeader.vue +1 -1
- package/src/components/SyAlert/SyAlert.vue +7 -9
- package/src/components/SyAlert/tests/SyAlert.visual.cy.ts +46 -0
- package/src/components/SyAlert/tests/__snapshots__/sy-alert-closable.snap.png +0 -0
- package/src/components/SyAlert/tests/__snapshots__/sy-alert-error.snap.png +0 -0
- package/src/components/SyAlert/tests/__snapshots__/sy-alert-info.snap.png +0 -0
- package/src/components/SyAlert/tests/__snapshots__/sy-alert-success.snap.png +0 -0
- package/src/components/SyAlert/tests/__snapshots__/sy-alert-variant-outlined.snap.png +0 -0
- package/src/components/SyAlert/tests/__snapshots__/sy-alert-variant-tonal.snap.png +0 -0
- package/src/components/SyAlert/tests/__snapshots__/sy-alert-warning.snap.png +0 -0
- package/src/components/SyBtnMenu/SyBtnMenu.vue +2 -4
- package/src/components/TableToolbar/TableToolbar.vue +6 -8
- package/src/components/Tables/SyServerTable/SyServerTable.stories.ts +166 -0
- package/src/components/Tables/SyServerTable/SyServerTable.vue +9 -7
- package/src/components/Tables/SyServerTable/tests/SyServerTable.a11y.spec.ts +23 -0
- package/src/components/Tables/SyServerTable/tests/SyServerTable.spec.ts +268 -0
- package/src/components/Tables/SyTable/SyTable.stories.ts +104 -0
- package/src/components/Tables/SyTable/SyTable.vue +9 -7
- package/src/components/Tables/SyTable/tests/SyTable.a11y.spec.ts +22 -0
- package/src/components/Tables/SyTable/tests/SyTable.spec.ts +274 -0
- package/src/components/Tables/common/SyTableFilter.vue +27 -2
- package/src/components/Tables/common/SyTablePagination.vue +142 -19
- package/src/components/Tables/common/TableHeader.vue +40 -3
- package/src/components/Tables/common/filters/SelectFilter.vue +1 -1
- package/src/components/Tables/common/locales.ts +3 -0
- package/src/components/Tables/common/tableStyles.scss +16 -19
- package/src/components/Tables/common/tests/SyTablePagination.spec.ts +18 -0
- package/src/components/Tables/common/tests/TableHeader.spec.ts +39 -0
- package/src/components/Tables/common/types.ts +2 -0
- package/src/components/Tables/common/useTableHeaders.ts +49 -27
- package/src/components/UploadWorkflow/UploadWorkflow.vue +1 -0
- package/src/components/UploadWorkflow/tests/UploadWorkflow.spec.ts +23 -0
- package/src/components/UploadWorkflow/tests/__snapshots__/UploadWorkflow.spec.ts.snap +66 -0
- package/src/components/UploadWorkflow/useFileList.ts +3 -0
- package/src/components/UserMenuBtn/UserMenuBtn.vue +1 -3
- package/src/composables/unifyValidation/documentationValidationProps.ts +235 -0
- package/src/composables/validation/useValidation.ts +17 -1
- package/src/composantsVuetify/VBreadcrumbs/VBreadcrumbs.mdx +28 -0
- package/src/composantsVuetify/VBreadcrumbs/v-breadcrumbs.stories.ts +108 -0
- package/src/composantsVuetify/VOtpInput/VOtpInput.mdx +39 -0
- package/src/composantsVuetify/VOtpInput/v-otp-input.stories.ts +56 -0
- package/src/composantsVuetify/VSkeletonLoader/VSkeletonLoader.mdx +42 -0
- package/src/composantsVuetify/VSkeletonLoader/v-skeleton-loader.stories.ts +77 -0
- package/src/composantsVuetify/VSwitch/VSwitch.mdx +47 -0
- package/src/composantsVuetify/VSwitch/v-switch.stories.ts +166 -0
- package/src/designTokens/tests/buildColorClassMap.spec.ts +31 -0
- package/src/designTokens/tests/generateScssTokens.spec.ts +12 -0
- package/src/designTokens/tests/themeUtils.spec.ts +53 -0
- package/src/designTokens/tokens/amelipro/apColors.ts +8 -130
- package/src/designTokens/tokens/amelipro/apColors2026.ts +3 -15
- package/src/designTokens/tokens/amelipro/apContextual.ts +55 -47
- package/src/designTokens/tokens/amelipro/apLightTheme.ts +1 -1
- package/src/designTokens/tokens/amelipro/apSemantic.ts +1 -1
- package/src/designTokens/tokens/baseColors.ts +129 -0
- package/src/designTokens/tokens/baseContextualTokens.ts +52 -0
- package/src/designTokens/tokens/cnam/cnamColors.ts +3 -125
- package/src/designTokens/tokens/cnam/cnamContextual.ts +4 -48
- package/src/designTokens/tokens/cnam/cnamLightTheme.ts +1 -1
- package/src/designTokens/tokens/cnam/cnamSemantic.ts +1 -1
- package/src/designTokens/tokens/pa/paColors.ts +2 -166
- package/src/designTokens/tokens/pa/paContextual.ts +3 -48
- package/src/designTokens/tokens/pa/paLightTheme.ts +1 -1
- package/src/designTokens/tokens/pa/paSemantic.ts +2 -2
- package/src/designTokens/utils/buildColorClassMap.ts +34 -0
- package/src/designTokens/utils/convertSemanticsToken.ts +8 -11
- package/src/designTokens/utils/createFlattenTheme.ts +15 -7
- package/src/designTokens/utils/index.ts +2 -2
- package/src/stories/Accessibilite/AuditDesignSystem.mdx +0 -11
- package/src/stories/Accessibilite/DesignSystem/Avancement.mdx +433 -0
- package/src/stories/Accessibilite/DesignSystem/a11y-status.json +692 -0
- package/src/stories/Accessibilite/KitDePreAudit/Echantillonnage.mdx +8 -1
- package/src/stories/Accessibilite/KitDePreAudit/Introduction.mdx +51 -10
- package/src/stories/Accessibilite/KitDePreAudit/Outils/Introduction.mdx +16 -9
- package/src/stories/Accessibilite/KitDePreAudit/Preaudit.mdx +48 -58
- package/src/stories/Components/Components.stories.ts +40 -1
- package/src/stories/Demarrer/EnrichirLeDesignSystem.mdx +4 -9
- package/src/stories/Demarrer/EnrichirLeDesignSystem.stories.ts +28 -0
- package/src/stories/Demarrer/Releases.stories.ts +48 -5
- package/src/stories/DesignTokens/ColorDisplay.vue +6 -5
- package/src/stories/DesignTokens/ColorIntegrationExample.vue +2 -4
- package/src/stories/DesignTokens/colors.stories.ts +5 -6
- package/src/stories/GuideDuDev/CreateVuetifyInstance.mdx +95 -0
- package/src/stories/GuideDuDev/Theme.mdx +36 -26
- package/src/stories/GuideDuDev/moduleDeNotification.mdx +3 -2
- package/src/stories/styles/accessibility-guide.css +3 -3
- package/src/utils/functions/classToHex.ts +6 -34
- package/src/utils/functions/createHexResolver.ts +45 -0
- package/src/utils/functions/tests/classToHex.spec.ts +36 -0
- package/src/utils/functions/tests/convertToHex.spec.ts +31 -0
- package/src/utils/functions/tests/createHexResolver.spec.ts +66 -0
- package/src/utils/functions/tests/isCssColor.spec.ts +48 -0
- package/dist/apLightTheme-CFSRrjv2.cjs +0 -1
- package/dist/designTokens/utils/convertGaps.d.ts +0 -5
- package/dist/main-BtTqyn4z.js +0 -38648
- package/dist/main-C1e3eoxd.cjs +0 -1067
- package/src/assets/apTokens.scss +0 -343
- package/src/assets/overrides/_container.scss +0 -36
- package/src/assets/tokens.scss +0 -388
- package/src/designTokens/apColors.md +0 -66
- package/src/designTokens/cnamColors.md +0 -193
- package/src/designTokens/paColors.md +0 -66
- package/src/designTokens/tokens/json/contextual-tokens.json +0 -156
- package/src/designTokens/tokens/json/primitives.json +0 -209
- package/src/designTokens/tokens/json/semantic.json +0 -120
- package/src/designTokens/utils/convertGaps.ts +0 -11
- package/src/stories/Accessibilite/Avancement/Avancement.mdx +0 -533
- package/src/stories/Accessibilite/Avancement/Avancement.stories.ts +0 -306
|
@@ -217,6 +217,15 @@ const meta = {
|
|
|
217
217
|
defaultValue: { summary: 'false' },
|
|
218
218
|
},
|
|
219
219
|
},
|
|
220
|
+
'pageInput': {
|
|
221
|
+
description: 'Affiche un champ de saisie numérique dans la pagination permettant de naviguer directement vers une page en la saisissant au clavier. La navigation est déclenchée à la validation (`Entrée`) ou à la perte de focus. La valeur est automatiquement clampée entre 1 et le nombre total de pages.',
|
|
222
|
+
control: { type: 'boolean' },
|
|
223
|
+
table: {
|
|
224
|
+
category: 'props',
|
|
225
|
+
type: { summary: 'boolean' },
|
|
226
|
+
defaultValue: { summary: 'false' },
|
|
227
|
+
},
|
|
228
|
+
},
|
|
220
229
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
221
230
|
// @ts-ignore - 'cookie-description-${cookieName}' storybook can't infer dynamic slot name
|
|
222
231
|
'header.<columnKey>': {
|
|
@@ -7342,3 +7351,160 @@ export const ComplexItemsDisplay: Story = {
|
|
|
7342
7351
|
}
|
|
7343
7352
|
},
|
|
7344
7353
|
}
|
|
7354
|
+
|
|
7355
|
+
export const PageInput: Story = {
|
|
7356
|
+
parameters: {
|
|
7357
|
+
a11y: {
|
|
7358
|
+
disable: true,
|
|
7359
|
+
},
|
|
7360
|
+
sourceCode: [
|
|
7361
|
+
{
|
|
7362
|
+
name: 'Template',
|
|
7363
|
+
code: `
|
|
7364
|
+
<template>
|
|
7365
|
+
<SyServerTable
|
|
7366
|
+
v-model:options="options"
|
|
7367
|
+
:items="users"
|
|
7368
|
+
:server-items-length="totalUsers"
|
|
7369
|
+
:loading="state === StateEnum.PENDING"
|
|
7370
|
+
suffix="server-page-input"
|
|
7371
|
+
page-input
|
|
7372
|
+
@update:options="fetchData"
|
|
7373
|
+
/>
|
|
7374
|
+
</template>
|
|
7375
|
+
`,
|
|
7376
|
+
},
|
|
7377
|
+
{
|
|
7378
|
+
name: 'Script',
|
|
7379
|
+
code: `
|
|
7380
|
+
<script setup lang="ts">
|
|
7381
|
+
import { ref, watch } from 'vue'
|
|
7382
|
+
import { SyServerTable } from '@cnamts/synapse'
|
|
7383
|
+
import { StateEnum } from '@cnamts/synapse/src/components/Tables/common/constants/StateEnum'
|
|
7384
|
+
import type { DataOptions } from '@cnamts/synapse/src/components/Tables/common/types'
|
|
7385
|
+
|
|
7386
|
+
const totalUsers = ref(0)
|
|
7387
|
+
const users = ref([])
|
|
7388
|
+
const state = ref(StateEnum.IDLE)
|
|
7389
|
+
const options = ref({ itemsPerPage: 5, page: 1 })
|
|
7390
|
+
|
|
7391
|
+
const fetchData = async () => {
|
|
7392
|
+
const { items, total } = await getDataFromApi(options.value)
|
|
7393
|
+
users.value = items
|
|
7394
|
+
totalUsers.value = total
|
|
7395
|
+
}
|
|
7396
|
+
|
|
7397
|
+
const getDataFromApi = async ({ page, itemsPerPage }: DataOptions) => {
|
|
7398
|
+
state.value = StateEnum.PENDING
|
|
7399
|
+
await new Promise(resolve => setTimeout(resolve, 500))
|
|
7400
|
+
const allItems = getUsers()
|
|
7401
|
+
const total = allItems.length
|
|
7402
|
+
const items = itemsPerPage > 0
|
|
7403
|
+
? allItems.slice((page - 1) * itemsPerPage, page * itemsPerPage)
|
|
7404
|
+
: allItems
|
|
7405
|
+
state.value = StateEnum.RESOLVED
|
|
7406
|
+
return { items, total }
|
|
7407
|
+
}
|
|
7408
|
+
|
|
7409
|
+
const getUsers = () => [
|
|
7410
|
+
{ firstname: 'Virginie', lastname: 'Beauchesne', email: 'virginie.beauchesne@example.com' },
|
|
7411
|
+
{ firstname: 'Simone', lastname: 'Bellefeuille', email: 'simone.bellefeuille@example.com' },
|
|
7412
|
+
{ firstname: 'Étienne', lastname: 'Salois', email: 'etienne.salois@example.com' },
|
|
7413
|
+
{ firstname: 'Bernadette', lastname: 'Langelier', email: 'bernadette.langelier@example.com' },
|
|
7414
|
+
{ firstname: 'Agate', lastname: 'Roy', email: 'agate.roy@example.com' },
|
|
7415
|
+
{ firstname: 'Louis', lastname: 'Denis', email: 'louis.denis@example.com' },
|
|
7416
|
+
{ firstname: 'Édith', lastname: 'Cartier', email: 'edith.cartier@example.com' },
|
|
7417
|
+
{ firstname: 'Alphonse', lastname: 'Bouvier', email: 'alphonse.bouvier@example.com' },
|
|
7418
|
+
{ firstname: 'Eustache', lastname: 'Dubois', email: 'eustache.dubois@example.com' },
|
|
7419
|
+
{ firstname: 'Rosemarie', lastname: 'Quessy', email: 'rosemarie.quessy@example.com' },
|
|
7420
|
+
{ firstname: 'Serge', lastname: 'Rivard', email: 'serge.rivard@example.com' },
|
|
7421
|
+
]
|
|
7422
|
+
|
|
7423
|
+
fetchData()
|
|
7424
|
+
</script>
|
|
7425
|
+
`,
|
|
7426
|
+
},
|
|
7427
|
+
],
|
|
7428
|
+
},
|
|
7429
|
+
args: {
|
|
7430
|
+
'options': { itemsPerPage: 5, page: 1 },
|
|
7431
|
+
'headers': [
|
|
7432
|
+
{ title: 'Nom', key: 'lastname' },
|
|
7433
|
+
{ title: 'Prénom', key: 'firstname' },
|
|
7434
|
+
{ title: 'Email', key: 'email' },
|
|
7435
|
+
],
|
|
7436
|
+
'serverItemsLength': 11,
|
|
7437
|
+
'suffix': 'server-page-input',
|
|
7438
|
+
'density': 'default',
|
|
7439
|
+
'striped': false,
|
|
7440
|
+
'pageInput': true,
|
|
7441
|
+
'onUpdate:options': fn(),
|
|
7442
|
+
},
|
|
7443
|
+
render: (args) => {
|
|
7444
|
+
return {
|
|
7445
|
+
components: { SyServerTable },
|
|
7446
|
+
setup() {
|
|
7447
|
+
const totalUsers = ref(0)
|
|
7448
|
+
const users = ref<User[]>([])
|
|
7449
|
+
const state = ref(StateEnum.IDLE)
|
|
7450
|
+
const options = ref({ ...args.options })
|
|
7451
|
+
|
|
7452
|
+
watch(options, (newVal) => {
|
|
7453
|
+
if (args.options) {
|
|
7454
|
+
Object.assign(args.options, JSON.parse(JSON.stringify(newVal)))
|
|
7455
|
+
}
|
|
7456
|
+
}, { deep: true })
|
|
7457
|
+
|
|
7458
|
+
const fetchData = async (): Promise<void> => {
|
|
7459
|
+
const { items, total } = await getDataFromApi(options.value as DataOptions)
|
|
7460
|
+
users.value = items
|
|
7461
|
+
totalUsers.value = total
|
|
7462
|
+
}
|
|
7463
|
+
|
|
7464
|
+
const getDataFromApi = async ({ page, itemsPerPage }: DataOptions): Promise<{ items: User[], total: number }> => {
|
|
7465
|
+
state.value = StateEnum.PENDING
|
|
7466
|
+
await new Promise(resolve => setTimeout(resolve, 500))
|
|
7467
|
+
return new Promise((resolve) => {
|
|
7468
|
+
const allItems = getUsers()
|
|
7469
|
+
const total = allItems.length
|
|
7470
|
+
const items = itemsPerPage > 0
|
|
7471
|
+
? allItems.slice((page - 1) * itemsPerPage, page * itemsPerPage)
|
|
7472
|
+
: allItems
|
|
7473
|
+
resolve({ items, total })
|
|
7474
|
+
state.value = StateEnum.RESOLVED
|
|
7475
|
+
})
|
|
7476
|
+
}
|
|
7477
|
+
|
|
7478
|
+
const getUsers = (): User[] => [
|
|
7479
|
+
{ firstname: 'Virginie', lastname: 'Beauchesne', email: 'virginie.beauchesne@example.com' },
|
|
7480
|
+
{ firstname: 'Simone', lastname: 'Bellefeuille', email: 'simone.bellefeuille@example.com' },
|
|
7481
|
+
{ firstname: 'Étienne', lastname: 'Salois', email: 'etienne.salois@example.com' },
|
|
7482
|
+
{ firstname: 'Bernadette', lastname: 'Langelier', email: 'bernadette.langelier@example.com' },
|
|
7483
|
+
{ firstname: 'Agate', lastname: 'Roy', email: 'agate.roy@example.com' },
|
|
7484
|
+
{ firstname: 'Louis', lastname: 'Denis', email: 'louis.denis@example.com' },
|
|
7485
|
+
{ firstname: 'Édith', lastname: 'Cartier', email: 'edith.cartier@example.com' },
|
|
7486
|
+
{ firstname: 'Alphonse', lastname: 'Bouvier', email: 'alphonse.bouvier@example.com' },
|
|
7487
|
+
{ firstname: 'Eustache', lastname: 'Dubois', email: 'eustache.dubois@example.com' },
|
|
7488
|
+
{ firstname: 'Rosemarie', lastname: 'Quessy', email: 'rosemarie.quessy@example.com' },
|
|
7489
|
+
{ firstname: 'Serge', lastname: 'Rivard', email: 'serge.rivard@example.com' },
|
|
7490
|
+
]
|
|
7491
|
+
|
|
7492
|
+
fetchData()
|
|
7493
|
+
|
|
7494
|
+
return { args, users, state, fetchData, options, totalUsers, StateEnum }
|
|
7495
|
+
},
|
|
7496
|
+
template: `
|
|
7497
|
+
<div>
|
|
7498
|
+
<SyServerTable
|
|
7499
|
+
v-model:options="options"
|
|
7500
|
+
:items="users"
|
|
7501
|
+
:server-items-length="totalUsers"
|
|
7502
|
+
:loading="state === StateEnum.PENDING"
|
|
7503
|
+
v-bind="args"
|
|
7504
|
+
@update:options="fetchData"
|
|
7505
|
+
/>
|
|
7506
|
+
</div>
|
|
7507
|
+
`,
|
|
7508
|
+
}
|
|
7509
|
+
},
|
|
7510
|
+
}
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
itemsPerPageOptions: undefined,
|
|
42
42
|
headingLevel: 2,
|
|
43
43
|
clickableRow: false,
|
|
44
|
+
pageInput: false,
|
|
44
45
|
})
|
|
45
46
|
|
|
46
47
|
const emit = defineEmits<{
|
|
@@ -337,6 +338,7 @@
|
|
|
337
338
|
:column="column"
|
|
338
339
|
:header-props-raw="getHeaderForColumn(column)?.headerProps as any"
|
|
339
340
|
:resizable-columns="props.resizableColumns"
|
|
341
|
+
:wrap-title="props.resizableColumns || !!getHeaderForColumn(column)?.maxWidth"
|
|
340
342
|
>
|
|
341
343
|
<template
|
|
342
344
|
v-for="slotName in Object.keys($slots)"
|
|
@@ -363,9 +365,9 @@
|
|
|
363
365
|
>
|
|
364
366
|
<th
|
|
365
367
|
:style="{
|
|
366
|
-
...(getHeaderForColumn(column)?.maxWidth ? { maxWidth: getHeaderForColumn(column)?.maxWidth as any } : {}),
|
|
368
|
+
...(getHeaderForColumn(column)?.maxWidth && !props.resizableColumns ? { maxWidth: getHeaderForColumn(column)?.maxWidth as any } : {}),
|
|
367
369
|
...(getHeaderForColumn(column)?.minWidth ? { minWidth: getHeaderForColumn(column)?.minWidth as any } : {}),
|
|
368
|
-
|
|
370
|
+
width: (reactiveColumnWidths[column.key!] || getHeaderForColumn(column)?.width) as any || undefined,
|
|
369
371
|
}"
|
|
370
372
|
>
|
|
371
373
|
<!-- Check if the column is filterable based on the headers prop -->
|
|
@@ -472,6 +474,7 @@
|
|
|
472
474
|
:page-count="pageCount"
|
|
473
475
|
:items-length="displayedItemsLength"
|
|
474
476
|
:items-per-page-options="props.itemsPerPageOptions"
|
|
477
|
+
:page-input="props.pageInput"
|
|
475
478
|
@update:page="updateOptions({ page: $event })"
|
|
476
479
|
@update:items-per-page="updateItemsPerPage"
|
|
477
480
|
/>
|
|
@@ -483,7 +486,6 @@
|
|
|
483
486
|
|
|
484
487
|
<style lang="scss" scoped>
|
|
485
488
|
@use '@/components/Tables/common/tableStyles' as *;
|
|
486
|
-
@use '@/assets/tokens';
|
|
487
489
|
|
|
488
490
|
.sy-server-table :deep() {
|
|
489
491
|
@include tablestyles;
|
|
@@ -492,7 +494,7 @@
|
|
|
492
494
|
|
|
493
495
|
@mixin striped-rows {
|
|
494
496
|
.v-table tbody tr:nth-child(even) {
|
|
495
|
-
background-color: rgba(
|
|
497
|
+
background-color: rgba(var(--v-theme-primary), 0.05);
|
|
496
498
|
}
|
|
497
499
|
}
|
|
498
500
|
|
|
@@ -510,11 +512,11 @@
|
|
|
510
512
|
}
|
|
511
513
|
|
|
512
514
|
.sy-server-table--pinned-left-shadow :deep(.sy-table__pinned--left) {
|
|
513
|
-
box-shadow: 2px 0 6px -4px rgba(
|
|
515
|
+
box-shadow: 2px 0 6px -4px rgba(var(--v-theme-grey-base), 0.6);
|
|
514
516
|
}
|
|
515
517
|
|
|
516
518
|
.sy-server-table--pinned-right-shadow :deep(.sy-table__pinned--right) {
|
|
517
|
-
box-shadow: -2px 0 6px -4px rgba(
|
|
519
|
+
box-shadow: -2px 0 6px -4px rgba(var(--v-theme-grey-base), 0.6);
|
|
518
520
|
}
|
|
519
521
|
|
|
520
522
|
.sy-server-table--pinned-select-left :deep(.v-data-table__th--select),
|
|
@@ -555,7 +557,7 @@
|
|
|
555
557
|
.sy-server-table--pinned-left-shadow.sy-server-table--pinned-select-left :deep(.v-table__wrapper > table > tbody > tr:not(.v-data-table-rows-loading) > .v-data-table__td:first-child),
|
|
556
558
|
.sy-server-table--pinned-left-shadow.sy-server-table--pinned-select-left :deep(.v-data-table__tbody .v-data-table__tr:not(.v-data-table-rows-loading) > .v-data-table__td:first-child),
|
|
557
559
|
.sy-server-table--pinned-left-shadow.sy-server-table--pinned-select-left :deep(.v-data-table__tbody tr:not(.v-data-table-rows-loading) > td:first-child) {
|
|
558
|
-
box-shadow: 2px 0 6px -4px rgba(
|
|
560
|
+
box-shadow: 2px 0 6px -4px rgba(var(--v-theme-grey-base), 0.6);
|
|
559
561
|
}
|
|
560
562
|
/* stylelint-enable @stylistic/max-line-length */
|
|
561
563
|
|
|
@@ -36,6 +36,29 @@ describe('SyServerTable - accessibility (axe)', () => {
|
|
|
36
36
|
}
|
|
37
37
|
})
|
|
38
38
|
|
|
39
|
+
it('has no obvious axe violations with pageInput enabled', async () => {
|
|
40
|
+
const manyItems = Array.from({ length: 11 }, (_, i) => ({ id: i + 1, name: `User ${i + 1}`, age: 20 + i }))
|
|
41
|
+
|
|
42
|
+
const wrapper = mount(SyServerTable, {
|
|
43
|
+
props: {
|
|
44
|
+
options: {} as DataOptions,
|
|
45
|
+
serverItemsLength: 11,
|
|
46
|
+
suffix: 'a11y-page-input-test',
|
|
47
|
+
pageInput: true,
|
|
48
|
+
headers,
|
|
49
|
+
items: manyItems,
|
|
50
|
+
},
|
|
51
|
+
attachTo: document.body,
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
await wrapper.vm.$nextTick()
|
|
55
|
+
|
|
56
|
+
const results = await axe(wrapper.element as HTMLElement)
|
|
57
|
+
assertNoA11yViolations(results, 'SyServerTable - pageInput', {
|
|
58
|
+
ignoreRules: ['region', 'aria-prohibited-attr'],
|
|
59
|
+
})
|
|
60
|
+
})
|
|
61
|
+
|
|
39
62
|
it('has no obvious axe violations when rows are clickable and contain nested actions', async () => {
|
|
40
63
|
const wrapper = mount(SyServerTable, {
|
|
41
64
|
props: {
|
|
@@ -1034,4 +1034,272 @@ describe('SyServerTable', () => {
|
|
|
1034
1034
|
expect(sortedHeaders[2]?.title).toBe('Name')
|
|
1035
1035
|
})
|
|
1036
1036
|
})
|
|
1037
|
+
|
|
1038
|
+
describe('maxWidth truncation', () => {
|
|
1039
|
+
const truncateHeaders = [
|
|
1040
|
+
{
|
|
1041
|
+
title: 'Nom de la colonne super longue',
|
|
1042
|
+
key: 'nom',
|
|
1043
|
+
maxWidth: '100px',
|
|
1044
|
+
},
|
|
1045
|
+
{
|
|
1046
|
+
title: 'Prénom',
|
|
1047
|
+
key: 'prenom',
|
|
1048
|
+
},
|
|
1049
|
+
]
|
|
1050
|
+
|
|
1051
|
+
const truncateItems = [
|
|
1052
|
+
{ nom: 'Valeur très longue qui dépasse la largeur maximale', prenom: 'Court' },
|
|
1053
|
+
]
|
|
1054
|
+
|
|
1055
|
+
it('applies maxWidth and wraps the header title on <th> when maxWidth is set', async () => {
|
|
1056
|
+
const wrapper = mount(SyServerTable, {
|
|
1057
|
+
props: {
|
|
1058
|
+
suffix: 'truncate-test',
|
|
1059
|
+
headers: truncateHeaders,
|
|
1060
|
+
items: truncateItems,
|
|
1061
|
+
serverItemsLength: truncateItems.length,
|
|
1062
|
+
},
|
|
1063
|
+
attachTo: document.body,
|
|
1064
|
+
})
|
|
1065
|
+
|
|
1066
|
+
await wrapper.vm.$nextTick()
|
|
1067
|
+
await vi.dynamicImportSettled()
|
|
1068
|
+
|
|
1069
|
+
const ths = wrapper.findAll('tr.headers th')
|
|
1070
|
+
const truncatedTh = ths.find(th => (th.attributes('style') || '').includes('max-width'))
|
|
1071
|
+
|
|
1072
|
+
expect(truncatedTh).toBeDefined()
|
|
1073
|
+
expect(truncatedTh!.attributes('style')).toContain('max-width: 100px')
|
|
1074
|
+
expect(truncatedTh!.attributes('style')).not.toContain('overflow: hidden')
|
|
1075
|
+
expect(truncatedTh!.attributes('title')).toBeUndefined()
|
|
1076
|
+
expect(truncatedTh!.find('.col-title').classes()).toContain('col-title--wrap')
|
|
1077
|
+
})
|
|
1078
|
+
|
|
1079
|
+
it('does not apply multiline header styles on <th> without maxWidth', async () => {
|
|
1080
|
+
const wrapper = mount(SyServerTable, {
|
|
1081
|
+
props: {
|
|
1082
|
+
suffix: 'no-truncate-test',
|
|
1083
|
+
headers: truncateHeaders,
|
|
1084
|
+
items: truncateItems,
|
|
1085
|
+
serverItemsLength: truncateItems.length,
|
|
1086
|
+
},
|
|
1087
|
+
attachTo: document.body,
|
|
1088
|
+
})
|
|
1089
|
+
|
|
1090
|
+
await wrapper.vm.$nextTick()
|
|
1091
|
+
await vi.dynamicImportSettled()
|
|
1092
|
+
|
|
1093
|
+
const ths = wrapper.findAll('tr.headers th')
|
|
1094
|
+
const normalTh = ths.find(th => !(th.attributes('style') || '').includes('max-width'))
|
|
1095
|
+
|
|
1096
|
+
expect(normalTh).toBeDefined()
|
|
1097
|
+
expect(normalTh!.attributes('title')).toBeUndefined()
|
|
1098
|
+
expect(normalTh!.find('.col-title').classes()).not.toContain('col-title--wrap')
|
|
1099
|
+
})
|
|
1100
|
+
|
|
1101
|
+
it('applies multiline styles on <td> when maxWidth is set', async () => {
|
|
1102
|
+
const wrapper = mount(SyServerTable, {
|
|
1103
|
+
props: {
|
|
1104
|
+
suffix: 'truncate-td-test',
|
|
1105
|
+
headers: truncateHeaders,
|
|
1106
|
+
items: truncateItems,
|
|
1107
|
+
serverItemsLength: truncateItems.length,
|
|
1108
|
+
},
|
|
1109
|
+
attachTo: document.body,
|
|
1110
|
+
})
|
|
1111
|
+
|
|
1112
|
+
await wrapper.vm.$nextTick()
|
|
1113
|
+
await vi.dynamicImportSettled()
|
|
1114
|
+
|
|
1115
|
+
const tds = wrapper.findAll('tbody tr td')
|
|
1116
|
+
const truncatedTd = tds.find(td => (td.attributes('style') || '').includes('max-width'))
|
|
1117
|
+
|
|
1118
|
+
expect(truncatedTd).toBeDefined()
|
|
1119
|
+
expect(truncatedTd!.attributes('style')).toContain('max-width: 100px')
|
|
1120
|
+
expect(truncatedTd!.attributes('style')).toContain('white-space: normal')
|
|
1121
|
+
expect(truncatedTd!.attributes('style')).toContain('overflow-wrap: anywhere')
|
|
1122
|
+
expect(truncatedTd!.attributes('style')).toContain('word-break: break-word')
|
|
1123
|
+
expect(truncatedTd!.attributes('style')).not.toContain('overflow: hidden')
|
|
1124
|
+
expect(truncatedTd!.attributes('title')).toBeUndefined()
|
|
1125
|
+
})
|
|
1126
|
+
|
|
1127
|
+
it('applies maxWidth without truncation on filter row <th> when maxWidth is set with showFilters', async () => {
|
|
1128
|
+
const wrapper = mount(SyServerTable, {
|
|
1129
|
+
props: {
|
|
1130
|
+
suffix: 'truncate-filter-test',
|
|
1131
|
+
showFilters: true,
|
|
1132
|
+
headers: truncateHeaders,
|
|
1133
|
+
items: truncateItems,
|
|
1134
|
+
serverItemsLength: truncateItems.length,
|
|
1135
|
+
},
|
|
1136
|
+
attachTo: document.body,
|
|
1137
|
+
})
|
|
1138
|
+
|
|
1139
|
+
await wrapper.vm.$nextTick()
|
|
1140
|
+
await vi.dynamicImportSettled()
|
|
1141
|
+
|
|
1142
|
+
const filterThs = wrapper.findAll('tr.filters th')
|
|
1143
|
+
const truncatedFilterTh = filterThs.find(th => (th.attributes('style') || '').includes('max-width'))
|
|
1144
|
+
|
|
1145
|
+
expect(truncatedFilterTh).toBeDefined()
|
|
1146
|
+
expect(truncatedFilterTh!.attributes('style')).toContain('max-width: 100px')
|
|
1147
|
+
expect(truncatedFilterTh!.attributes('style')).not.toContain('overflow: hidden')
|
|
1148
|
+
})
|
|
1149
|
+
|
|
1150
|
+
it('keeps multiline td styles after reordering a maxWidth column with column controls', async () => {
|
|
1151
|
+
const mockOrganizeColumns = {
|
|
1152
|
+
name: 'OrganizeColumns',
|
|
1153
|
+
props: ['headers'],
|
|
1154
|
+
template: '<div></div>',
|
|
1155
|
+
emits: ['update:headers'],
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
const wrapper = mount(SyServerTable, {
|
|
1159
|
+
props: {
|
|
1160
|
+
suffix: 'truncate-reorder-test',
|
|
1161
|
+
headers: truncateHeaders.map((header, index) => ({
|
|
1162
|
+
...header,
|
|
1163
|
+
order: index + 1,
|
|
1164
|
+
})),
|
|
1165
|
+
items: truncateItems,
|
|
1166
|
+
serverItemsLength: truncateItems.length,
|
|
1167
|
+
enableColumnControls: true,
|
|
1168
|
+
},
|
|
1169
|
+
global: {
|
|
1170
|
+
stubs: {
|
|
1171
|
+
OrganizeColumns: mockOrganizeColumns,
|
|
1172
|
+
},
|
|
1173
|
+
},
|
|
1174
|
+
attachTo: document.body,
|
|
1175
|
+
})
|
|
1176
|
+
|
|
1177
|
+
const organizeColumnsComponent = wrapper.findComponent({ name: 'OrganizeColumns' })
|
|
1178
|
+
const reorderedHeaders = JSON.parse(JSON.stringify([
|
|
1179
|
+
{ ...truncateHeaders[0], order: 2 },
|
|
1180
|
+
{ ...truncateHeaders[1], order: 1 },
|
|
1181
|
+
]))
|
|
1182
|
+
|
|
1183
|
+
organizeColumnsComponent.vm.$emit('update:headers', reorderedHeaders)
|
|
1184
|
+
await wrapper.vm.$nextTick()
|
|
1185
|
+
await vi.dynamicImportSettled()
|
|
1186
|
+
|
|
1187
|
+
const tds = wrapper.findAll('tbody tr td')
|
|
1188
|
+
expect(tds[0]!.text()).toBe('Court')
|
|
1189
|
+
expect(tds[1]!.text()).toBe('Valeur très longue qui dépasse la largeur maximale')
|
|
1190
|
+
expect(tds[1]!.attributes('style')).toContain('max-width: 100px')
|
|
1191
|
+
expect(tds[1]!.attributes('style')).toContain('white-space: normal')
|
|
1192
|
+
expect(tds[1]!.attributes('style')).toContain('overflow-wrap: anywhere')
|
|
1193
|
+
})
|
|
1194
|
+
})
|
|
1195
|
+
})
|
|
1196
|
+
|
|
1197
|
+
describe('SyServerTable pageInput', () => {
|
|
1198
|
+
const manyItems = Array.from({ length: 11 }, (_, i) => ({
|
|
1199
|
+
id: i + 1,
|
|
1200
|
+
name: `User ${i + 1}`,
|
|
1201
|
+
age: 20 + i,
|
|
1202
|
+
}))
|
|
1203
|
+
|
|
1204
|
+
it('does not render page-input when pageInput is false', async () => {
|
|
1205
|
+
const wrapper = mount(SyServerTable, {
|
|
1206
|
+
props: {
|
|
1207
|
+
options: { itemsPerPage: 5 } as DataOptions,
|
|
1208
|
+
suffix: 'page-input-server-test',
|
|
1209
|
+
serverItemsLength: 11,
|
|
1210
|
+
pageInput: false,
|
|
1211
|
+
},
|
|
1212
|
+
attrs: { items: manyItems, headers },
|
|
1213
|
+
})
|
|
1214
|
+
|
|
1215
|
+
await wrapper.vm.$nextTick()
|
|
1216
|
+
await vi.dynamicImportSettled()
|
|
1217
|
+
|
|
1218
|
+
expect(wrapper.find('.page-input').exists()).toBe(false)
|
|
1219
|
+
})
|
|
1220
|
+
|
|
1221
|
+
it('renders page-input field when pageInput is true and pageCount > 1', async () => {
|
|
1222
|
+
const wrapper = mount(SyServerTable, {
|
|
1223
|
+
props: {
|
|
1224
|
+
options: { itemsPerPage: 5 } as DataOptions,
|
|
1225
|
+
suffix: 'page-input-server-test',
|
|
1226
|
+
serverItemsLength: 11,
|
|
1227
|
+
pageInput: true,
|
|
1228
|
+
},
|
|
1229
|
+
attrs: { items: manyItems, headers },
|
|
1230
|
+
})
|
|
1231
|
+
|
|
1232
|
+
await wrapper.vm.$nextTick()
|
|
1233
|
+
await vi.dynamicImportSettled()
|
|
1234
|
+
|
|
1235
|
+
expect(wrapper.find('.page-input').exists()).toBe(true)
|
|
1236
|
+
expect(wrapper.find('.page-input__field').exists()).toBe(true)
|
|
1237
|
+
})
|
|
1238
|
+
|
|
1239
|
+
it('page-input field has correct min/max attributes', async () => {
|
|
1240
|
+
const wrapper = mount(SyServerTable, {
|
|
1241
|
+
props: {
|
|
1242
|
+
options: { itemsPerPage: 5 } as DataOptions,
|
|
1243
|
+
suffix: 'page-input-server-test',
|
|
1244
|
+
serverItemsLength: 11,
|
|
1245
|
+
pageInput: true,
|
|
1246
|
+
},
|
|
1247
|
+
attrs: { items: manyItems, headers },
|
|
1248
|
+
})
|
|
1249
|
+
|
|
1250
|
+
await wrapper.vm.$nextTick()
|
|
1251
|
+
await vi.dynamicImportSettled()
|
|
1252
|
+
|
|
1253
|
+
const input = wrapper.find('.page-input__field')
|
|
1254
|
+
expect(input.attributes('min')).toBe('1')
|
|
1255
|
+
expect(input.attributes('max')).toBe('3')
|
|
1256
|
+
})
|
|
1257
|
+
|
|
1258
|
+
it('navigates to page on Enter key', async () => {
|
|
1259
|
+
const wrapper = mount(SyServerTable, {
|
|
1260
|
+
props: {
|
|
1261
|
+
options: { itemsPerPage: 5 } as DataOptions,
|
|
1262
|
+
suffix: 'page-input-server-test',
|
|
1263
|
+
serverItemsLength: 11,
|
|
1264
|
+
pageInput: true,
|
|
1265
|
+
},
|
|
1266
|
+
attrs: { items: manyItems, headers },
|
|
1267
|
+
})
|
|
1268
|
+
|
|
1269
|
+
await wrapper.vm.$nextTick()
|
|
1270
|
+
await vi.dynamicImportSettled()
|
|
1271
|
+
|
|
1272
|
+
const input = wrapper.find('.page-input__field')
|
|
1273
|
+
await input.setValue(2)
|
|
1274
|
+
await input.trigger('keydown', { key: 'Enter' })
|
|
1275
|
+
|
|
1276
|
+
const emitted = wrapper.emitted('update:options')
|
|
1277
|
+
expect(emitted).toBeTruthy()
|
|
1278
|
+
const lastEmit = emitted![emitted!.length - 1]![0] as DataOptions
|
|
1279
|
+
expect(lastEmit.page).toBe(2)
|
|
1280
|
+
})
|
|
1281
|
+
|
|
1282
|
+
it('clamps out-of-range values on blur', async () => {
|
|
1283
|
+
const wrapper = mount(SyServerTable, {
|
|
1284
|
+
props: {
|
|
1285
|
+
options: { itemsPerPage: 5 } as DataOptions,
|
|
1286
|
+
suffix: 'page-input-server-test',
|
|
1287
|
+
serverItemsLength: 11,
|
|
1288
|
+
pageInput: true,
|
|
1289
|
+
},
|
|
1290
|
+
attrs: { items: manyItems, headers },
|
|
1291
|
+
})
|
|
1292
|
+
|
|
1293
|
+
await wrapper.vm.$nextTick()
|
|
1294
|
+
await vi.dynamicImportSettled()
|
|
1295
|
+
|
|
1296
|
+
const input = wrapper.find('.page-input__field')
|
|
1297
|
+
await input.setValue(99)
|
|
1298
|
+
await input.trigger('blur')
|
|
1299
|
+
|
|
1300
|
+
const emitted = wrapper.emitted('update:options')
|
|
1301
|
+
expect(emitted).toBeTruthy()
|
|
1302
|
+
const lastEmit = emitted![emitted!.length - 1]![0] as DataOptions
|
|
1303
|
+
expect(lastEmit.page).toBe(3)
|
|
1304
|
+
})
|
|
1037
1305
|
})
|
|
@@ -203,6 +203,15 @@ const meta = {
|
|
|
203
203
|
defaultValue: { summary: 'false' },
|
|
204
204
|
},
|
|
205
205
|
},
|
|
206
|
+
'pageInput': {
|
|
207
|
+
description: 'Affiche un champ de saisie numérique dans la pagination permettant de naviguer directement vers une page en la saisissant au clavier. La navigation est déclenchée à la validation (`Entrée`) ou à la perte de focus. La valeur est automatiquement clampée entre 1 et le nombre total de pages.',
|
|
208
|
+
control: { type: 'boolean' },
|
|
209
|
+
table: {
|
|
210
|
+
category: 'props',
|
|
211
|
+
type: { summary: 'boolean' },
|
|
212
|
+
defaultValue: { summary: 'false' },
|
|
213
|
+
},
|
|
214
|
+
},
|
|
206
215
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
207
216
|
// @ts-ignore - 'cookie-description-${cookieName}' storybook can't infer dynamic slot name
|
|
208
217
|
'header.<columnKey>': {
|
|
@@ -4912,3 +4921,98 @@ export const ComplexItemsDisplay: Story = {
|
|
|
4912
4921
|
}
|
|
4913
4922
|
},
|
|
4914
4923
|
}
|
|
4924
|
+
|
|
4925
|
+
export const PageInput: Story = {
|
|
4926
|
+
parameters: {
|
|
4927
|
+
a11y: {
|
|
4928
|
+
disable: true,
|
|
4929
|
+
},
|
|
4930
|
+
sourceCode: [
|
|
4931
|
+
{
|
|
4932
|
+
name: 'Template',
|
|
4933
|
+
code: `
|
|
4934
|
+
<template>
|
|
4935
|
+
<SyTable
|
|
4936
|
+
v-model:options="options"
|
|
4937
|
+
:headers="headers"
|
|
4938
|
+
:items="items"
|
|
4939
|
+
suffix="page-input-table"
|
|
4940
|
+
page-input
|
|
4941
|
+
/>
|
|
4942
|
+
</template>
|
|
4943
|
+
`,
|
|
4944
|
+
},
|
|
4945
|
+
{
|
|
4946
|
+
name: 'Script',
|
|
4947
|
+
code: `
|
|
4948
|
+
<script setup lang="ts">
|
|
4949
|
+
import { ref } from 'vue'
|
|
4950
|
+
import { SyTable } from '@cnamts/synapse'
|
|
4951
|
+
|
|
4952
|
+
const options = ref({ itemsPerPage: 5 })
|
|
4953
|
+
|
|
4954
|
+
const headers = ref([
|
|
4955
|
+
{ title: 'Nom', key: 'lastname' },
|
|
4956
|
+
{ title: 'Prénom', key: 'firstname' },
|
|
4957
|
+
{ title: 'Email', key: 'email' },
|
|
4958
|
+
])
|
|
4959
|
+
|
|
4960
|
+
const items = ref([
|
|
4961
|
+
{ firstname: 'Virginie', lastname: 'Beauchesne', email: 'virginie.beauchesne@example.com' },
|
|
4962
|
+
{ firstname: 'Simone', lastname: 'Bellefeuille', email: 'simone.bellefeuille@example.com' },
|
|
4963
|
+
{ firstname: 'Étienne', lastname: 'Salois', email: 'etienne.salois@example.com' },
|
|
4964
|
+
{ firstname: 'Thierry', lastname: 'Bobu', email: 'thierry.bobu@example.com' },
|
|
4965
|
+
{ firstname: 'Bernadette', lastname: 'Langelier', email: 'bernadette.langelier@example.com' },
|
|
4966
|
+
{ firstname: 'Agate', lastname: 'Roy', email: 'agate.roy@example.com' },
|
|
4967
|
+
{ firstname: 'Théo', lastname: 'Garnier', email: 'theo.garnier@example.com' },
|
|
4968
|
+
{ firstname: 'Clara', lastname: 'Moreau', email: 'clara.moreau@example.com' },
|
|
4969
|
+
{ firstname: 'Lucas', lastname: 'Lefebvre', email: 'lucas.lefebvre@example.com' },
|
|
4970
|
+
{ firstname: 'Emma', lastname: 'Dubois', email: 'emma.dubois@example.com' },
|
|
4971
|
+
{ firstname: 'Julien', lastname: 'Martin', email: 'julien.martin@example.com' },
|
|
4972
|
+
])
|
|
4973
|
+
</script>
|
|
4974
|
+
`,
|
|
4975
|
+
},
|
|
4976
|
+
],
|
|
4977
|
+
},
|
|
4978
|
+
args: {
|
|
4979
|
+
'headers': [
|
|
4980
|
+
{ title: 'Nom', key: 'lastname' },
|
|
4981
|
+
{ title: 'Prénom', key: 'firstname' },
|
|
4982
|
+
{ title: 'Email', key: 'email' },
|
|
4983
|
+
],
|
|
4984
|
+
'items': [
|
|
4985
|
+
{ firstname: 'Virginie', lastname: 'Beauchesne', email: 'virginie.beauchesne@example.com' },
|
|
4986
|
+
{ firstname: 'Simone', lastname: 'Bellefeuille', email: 'simone.bellefeuille@example.com' },
|
|
4987
|
+
{ firstname: 'Étienne', lastname: 'Salois', email: 'etienne.salois@example.com' },
|
|
4988
|
+
{ firstname: 'Thierry', lastname: 'Bobu', email: 'thierry.bobu@example.com' },
|
|
4989
|
+
{ firstname: 'Bernadette', lastname: 'Langelier', email: 'bernadette.langelier@example.com' },
|
|
4990
|
+
{ firstname: 'Agate', lastname: 'Roy', email: 'agate.roy@example.com' },
|
|
4991
|
+
{ firstname: 'Théo', lastname: 'Garnier', email: 'theo.garnier@example.com' },
|
|
4992
|
+
{ firstname: 'Clara', lastname: 'Moreau', email: 'clara.moreau@example.com' },
|
|
4993
|
+
{ firstname: 'Lucas', lastname: 'Lefebvre', email: 'lucas.lefebvre@example.com' },
|
|
4994
|
+
{ firstname: 'Emma', lastname: 'Dubois', email: 'emma.dubois@example.com' },
|
|
4995
|
+
{ firstname: 'Julien', lastname: 'Martin', email: 'julien.martin@example.com' },
|
|
4996
|
+
],
|
|
4997
|
+
'options': { itemsPerPage: 5 },
|
|
4998
|
+
'suffix': 'page-input-table',
|
|
4999
|
+
'pageInput': true,
|
|
5000
|
+
'density': 'default',
|
|
5001
|
+
'striped': false,
|
|
5002
|
+
'onUpdate:options': fn(),
|
|
5003
|
+
},
|
|
5004
|
+
render: (args) => {
|
|
5005
|
+
return {
|
|
5006
|
+
components: { SyTable },
|
|
5007
|
+
setup() {
|
|
5008
|
+
return { args }
|
|
5009
|
+
},
|
|
5010
|
+
template: `
|
|
5011
|
+
<SyTable
|
|
5012
|
+
v-model:options="args.options"
|
|
5013
|
+
v-bind="args"
|
|
5014
|
+
/>
|
|
5015
|
+
`,
|
|
5016
|
+
}
|
|
5017
|
+
},
|
|
5018
|
+
}
|