@cnamts/synapse 1.0.26 → 1.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AutocompleteFilter-BPR-a55G.js → AutocompleteFilter-C9eLKyW8.js} +3 -3
- package/dist/{DateFilter-CknrJWs2.js → DateFilter-y-GLkAkn.js} +8 -8
- package/dist/{NumberFilter-DJ-yNlzv.js → NumberFilter-DN6hIBS7.js} +1 -1
- package/dist/{PeriodFilter-CiB5Oa9Z.js → PeriodFilter-MoUUp9qS.js} +1 -1
- package/dist/{SelectFilter-EiafX97M.js → SelectFilter-bCbrdLmu.js} +1 -1
- package/dist/{TextFilter-BzOmpdxj.js → TextFilter-CvjgEaoM.js} +4 -4
- package/dist/apLightTheme2026-ug4Y23ns.js +611 -0
- package/dist/components/Customs/Selects/SyAutocomplete/SyAutocomplete.d.ts +2369 -353
- package/dist/components/Customs/Selects/SyAutocomplete/composables/useSyAutocompleteValidation.d.ts +18 -0
- package/dist/components/Customs/Selects/SyAutocomplete/utils/ariaManager.d.ts +1 -1
- package/dist/components/Customs/Selects/SyAutocomplete/utils/useKeyboardHandler.d.ts +3 -1
- package/dist/components/Customs/Selects/SySelect/SySelect.d.ts +9 -10
- package/dist/components/Customs/Selects/SySelect/composables/useSySelectKeyboard.d.ts +1 -0
- package/dist/components/Customs/Selects/SySelect/composables/useSySelectValidation.d.ts +15 -0
- package/dist/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.d.ts +3 -3
- package/dist/components/Customs/SyCheckbox/SyCheckbox.d.ts +3 -3
- package/dist/components/Customs/SyIconButton/SyIconButton.d.ts +18 -0
- package/dist/components/Customs/SyRadioGroup/SyRadioGroup.d.ts +20 -38
- package/dist/components/Customs/SyRadioGroup/composables/useSyRadioGroupValidation.d.ts +50 -0
- package/dist/components/Customs/SyTextField/SyTextField.d.ts +6 -6
- package/dist/components/DatePicker/CalendarMode/DatePicker.d.ts +147 -136
- package/dist/components/DatePicker/ComplexDatePicker/ComplexDatePicker.d.ts +62 -54
- package/dist/components/DatePicker/DateTextInput/DateTextInput.d.ts +27 -24
- package/dist/components/DatePicker/composables/index.d.ts +1 -0
- package/dist/components/DatePicker/composables/useDatePickerValidationBridge.d.ts +51 -0
- package/dist/components/MonthPicker/MonthPicker.d.ts +23 -23
- package/dist/components/MonthPicker/MonthPickerText/MonthPickerInput.d.ts +23 -23
- package/dist/components/NirField/NirField.d.ts +56 -56
- package/dist/components/PasswordField/PasswordField.d.ts +3 -3
- package/dist/components/PeriodField/PeriodField.d.ts +236 -212
- package/dist/components/PhoneField/PhoneField.d.ts +23 -23
- package/dist/components/SyTextArea/SyTextArea.d.ts +25 -15
- package/dist/components/SyTextArea/composables/useSyTextAreaValidation.d.ts +20 -0
- package/dist/components/SyTextArea/locales.d.ts +1 -0
- 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 +25 -25
- package/dist/components/Tables/common/types.d.ts +2 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/composables/unifyValidation/documentationValidationProps.d.ts +160 -160
- package/dist/composables/unifyValidation/useValidation.d.ts +16 -14
- package/dist/design-system-v3.js +81 -80
- package/dist/designTokens/tokens/amelipro/apContextual.d.ts +6 -6
- package/dist/designTokens/tokens/amelipro/apDarkTheme.d.ts +3 -1
- package/dist/designTokens/tokens/amelipro/apLightTheme.d.ts +53 -100
- package/dist/designTokens/tokens/baseContextualTokens.d.ts +0 -6
- package/dist/designTokens/tokens/baseTokens.d.ts +232 -0
- package/dist/designTokens/tokens/cnam/cnamContextual.d.ts +6 -6
- package/dist/designTokens/tokens/cnam/cnamDarkTheme.d.ts +1 -1
- package/dist/designTokens/tokens/cnam/cnamLightTheme.d.ts +57 -101
- package/dist/designTokens/tokens/pa/paContextual.d.ts +0 -6
- package/dist/designTokens/tokens/pa/paDarkTheme.d.ts +1 -1
- package/dist/designTokens/tokens/pa/paLightTheme.d.ts +53 -97
- package/dist/designTokens/tokens/pa/paSemantic.d.ts +1 -0
- package/dist/designTokens/tokens/semanticTokens.d.ts +112 -0
- package/dist/main-CI6Q9nmO.js +39234 -0
- package/dist/synapse.css +1 -1
- package/dist/vuetifyConfig.js +208 -72
- package/package.json +4 -2
- package/src/assets/overrides/_icons.scss +5 -4
- package/src/assets/overrides/_otp.scss +4 -4
- package/src/assets/overrides/_typography.scss +2 -1
- package/src/assets/overrides/_utilities.scss +1 -42
- package/src/components/ChipList/ChipList.vue +30 -18
- package/src/components/ChipList/tests/chipList.spec.ts +4 -4
- package/src/components/CopyBtn/CopyBtn.vue +2 -2
- package/src/components/Customs/Selects/SelectBtnField/SelectBtnField.stories.ts +4 -0
- package/src/components/Customs/Selects/SelectBtnField/SelectBtnField.vue +7 -6
- package/src/components/Customs/Selects/SelectBtnField/tests/SelectBtnField.spec.ts +223 -0
- package/src/components/Customs/Selects/SyAutocomplete/SyAutocomplete.stories.ts +283 -351
- package/src/components/Customs/Selects/SyAutocomplete/SyAutocomplete.vue +182 -218
- package/src/components/Customs/Selects/SyAutocomplete/composables/useSyAutocompleteValidation.ts +101 -0
- package/src/components/Customs/Selects/SyAutocomplete/tests/SyAutocomplete.spec.ts +761 -1
- package/src/components/Customs/Selects/SyAutocomplete/utils/ariaManager.ts +3 -1
- package/src/components/Customs/Selects/SyAutocomplete/utils/useKeyboardHandler.ts +79 -5
- package/src/components/Customs/Selects/SyAutocomplete/validation/Validation.stories.ts +1029 -0
- package/src/components/Customs/Selects/SySelect/SySelect.stories.ts +9 -491
- package/src/components/Customs/Selects/SySelect/SySelect.vue +46 -79
- package/src/components/Customs/Selects/SySelect/composables/useSySelectKeyboard.ts +3 -0
- package/src/components/Customs/Selects/SySelect/composables/useSySelectValidation.ts +64 -0
- package/src/components/Customs/Selects/SySelect/tests/SySelect.spec.ts +196 -0
- package/src/components/Customs/Selects/SySelect/validation/Validation.stories.ts +1026 -0
- package/src/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.stories.ts +18 -7
- package/src/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.vue +2 -2
- package/src/components/Customs/SyCheckbox/SyCheckbox.stories.ts +8 -8
- package/src/components/Customs/SyCheckbox/SyCheckbox.vue +8 -8
- package/src/components/Customs/SyCheckbox/tests/SyCheckbox.spec.ts +1 -1
- package/src/components/Customs/SyIcon/accessibilite/Accessibility.mdx +0 -6
- package/src/components/Customs/SyIcon/utils/tests/iconUtils.spec.ts +107 -0
- package/src/components/Customs/SyRadioGroup/SyRadioGroup.mdx +2 -2
- package/src/components/Customs/SyRadioGroup/SyRadioGroup.stories.ts +395 -200
- package/src/components/Customs/SyRadioGroup/SyRadioGroup.vue +82 -127
- package/src/components/Customs/SyRadioGroup/composables/useSyRadioGroupValidation.ts +127 -0
- package/src/components/Customs/SyRadioGroup/tests/SyRadioGroup.a11y.spec.ts +93 -1
- package/src/components/Customs/SyRadioGroup/tests/SyRadioGroup.spec.ts +146 -9
- package/src/components/Customs/SyRadioGroup/tests/SyRadioGroup.visual.cy.ts +165 -0
- package/src/components/Customs/SyRadioGroup/validation/Validation.stories.ts +773 -0
- package/src/components/Customs/SyTabs/config.ts +3 -3
- package/src/components/Customs/SyTabs/tests/SyTabs.spec.ts +265 -0
- package/src/components/Customs/SyTabs/tests/useTabTransition.spec.ts +188 -0
- package/src/components/Customs/SyTextField/SyTextField.stories.ts +10 -29
- package/src/components/Customs/SyTextField/SyTextField.vue +23 -15
- package/src/components/DataList/DataList.stories.ts +1 -1
- package/src/components/DataListItem/tests/DataListItem.spec.ts +3 -1
- package/src/components/DatePicker/CalendarMode/DatePicker.vue +37 -142
- package/src/components/DatePicker/CalendarMode/tests/DatePicker.coverage.spec.ts +156 -0
- package/src/components/DatePicker/CalendarMode/tests/DatePicker.spec.ts +495 -4
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.vue +47 -66
- package/src/components/DatePicker/ComplexDatePicker/tests/ComplexDatePicker.spec.ts +206 -0
- package/src/components/DatePicker/ComplexDatePicker/tests/bridge-integration.regression.spec.ts +210 -0
- package/src/components/DatePicker/ComplexDatePicker/tests/calendar-navigation.regression.spec.ts +214 -0
- package/src/components/DatePicker/ComplexDatePicker/tests/validation-cross.regression.spec.ts +194 -0
- package/src/components/DatePicker/ComplexDatePicker/tests/validation-success-messages.regression.spec.ts +83 -0
- package/src/components/DatePicker/DateTextInput/DateTextInput.vue +129 -54
- package/src/components/DatePicker/DateTextInput/tests/DateTextInput.spec.ts +320 -0
- package/src/components/DatePicker/composables/index.ts +1 -0
- package/src/components/DatePicker/composables/tests/useCalendarKeyboardNavigation.spec.ts +360 -0
- package/src/components/DatePicker/composables/tests/useDatePickerValidationBridge.spec.ts +129 -0
- package/src/components/DatePicker/composables/useDatePickerValidationBridge.ts +205 -0
- package/src/components/DatePicker/docExamples/BidirectionalComplexValidation.vue +1 -1
- package/src/components/DatePicker/docExamples/DatePickerBidirectionalValidation.vue +1 -1
- package/src/components/DatePicker/tests/exposed-methods.coverage.spec.ts +75 -0
- package/src/components/DialogBox/DialogBox.vue +1 -1
- package/src/components/FileList/UploadItem/UploadItem.vue +4 -4
- package/src/components/FileUpload/FileUpload.vue +2 -2
- package/src/components/FileUpload/FileUploadContent.vue +1 -1
- package/src/components/FilterInline/FilterInline.mdx +2 -2
- package/src/components/FilterSideBar/FilterSideBar.stories.ts +1 -1
- package/src/components/FilterSideBar/FilterSideBar.vue +2 -2
- package/src/components/FooterBar/FooterBar.vue +7 -7
- package/src/components/FranceConnectBtn/FranceConnectBtn.vue +1 -1
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderMenuItem/HeaderMenuItem.vue +2 -2
- package/src/components/HeaderBar/HeaderBurgerMenu/HeaderSubMenu/HeaderSubMenu.vue +7 -7
- package/src/components/HeaderBar/HeaderMenuBtn/HeaderMenuBtn.vue +2 -2
- package/src/components/HeaderLoading/tests/HeaderLoading.spec.ts +87 -8
- package/src/components/HeaderNavigationBar/HorizontalNavbar/HorizontalNavbar.vue +3 -3
- package/src/components/HeaderNavigationBar/HorizontalNavbar/tests/HorizontalNavbar.spec.ts +589 -0
- package/src/components/HeaderToolbar/tests/HeaderToolBar.spec.ts +153 -1
- package/src/components/HeaderToolbar/tests/useMobileRightMenu.spec.ts +258 -0
- package/src/components/LogoBrandSection/tests/LogoBrandSection.spec.ts +2 -2
- package/src/components/LogoBrandSection/tests/__snapshots__/LogoBrandSection.spec.ts.snap +1 -1
- package/src/components/LunarCalendar/tests/useLunarCalendarRules.spec.ts +184 -0
- package/src/components/MonthPicker/MonthPickerVisual/MonthSelector.vue +3 -3
- package/src/components/MonthPicker/MonthPickerVisual/VisualPickerFooter.vue +1 -1
- package/src/components/MonthPicker/MonthPickerVisual/VisualPickerHeader.vue +2 -2
- package/src/components/MonthPicker/MonthPickerVisual/YearSelector.vue +1 -1
- package/src/components/NirField/NirField.vue +3 -3
- package/src/components/NotificationBar/Notification/Notification.vue +12 -12
- package/src/components/NotificationBar/NotificationBar.stories.ts +8 -8
- package/src/components/PaginatedTable/Pagination.vue +2 -2
- package/src/components/PasswordField/PasswordField.vue +8 -8
- package/src/components/PasswordField/tests/PasswordField.spec.ts +3 -3
- package/src/components/RangeField/RangeSlider/RangeSlider.vue +2 -2
- package/src/components/RangeField/RangeSlider/Tooltip/Tooltip.vue +1 -1
- package/src/components/StatusPage/tests/StatusPage.spec.ts +149 -0
- package/src/components/SubHeader/SubHeader.vue +1 -1
- package/src/components/SyAlert/SyAlert.vue +23 -23
- package/src/components/SyTextArea/SyTextArea.stories.ts +177 -131
- package/src/components/SyTextArea/SyTextArea.vue +235 -83
- package/src/components/SyTextArea/composables/useSyTextAreaValidation.ts +81 -0
- package/src/components/SyTextArea/locales.ts +1 -0
- package/src/components/SyTextArea/tests/SyTextArea.spec.ts +449 -1
- package/src/components/SyTextArea/useDefaultValidationRules.ts +2 -7
- package/src/components/SyTextArea/validation/Validation.stories.ts +856 -0
- package/src/components/TableToolbar/TableToolbar.vue +6 -6
- package/src/components/TableToolbar/accessibilite/Accessibility.mdx +81 -7
- package/src/components/Tables/SyServerTable/SyServerTable.stories.ts +163 -0
- package/src/components/Tables/SyServerTable/SyServerTable.vue +2 -1
- package/src/components/Tables/SyServerTable/tests/SyServerTable.spec.ts +67 -0
- package/src/components/Tables/SyTable/SyTable.stories.ts +94 -0
- package/src/components/Tables/SyTable/SyTable.vue +2 -1
- package/src/components/Tables/SyTable/tests/SyTable.spec.ts +64 -0
- package/src/components/Tables/common/TableHeader.vue +2 -2
- package/src/components/Tables/common/filters/logics/tests/NumberFilterLogic.spec.ts +176 -0
- package/src/components/Tables/common/filters/logics/tests/SelectFilterLogic.spec.ts +111 -0
- package/src/components/Tables/common/tableStyles.scss +6 -6
- package/src/components/Tables/common/types.ts +2 -0
- package/src/components/UploadWorkflow/tests/UploadWorkflow.spec.ts +2 -0
- package/src/components/index.ts +1 -0
- package/src/composables/date/tests/useDateFormatDayjs.spec.ts +31 -0
- package/src/composables/date/tests/useHolidayDay.spec.ts +109 -0
- package/src/composables/rules/tests/useFieldValidation.spec.ts +374 -0
- package/src/composables/tests/useError.spec.ts +30 -0
- package/src/composables/tests/useFormFieldErrorHandling.spec.ts +234 -0
- package/src/composables/unifyValidation/documentationValidationProps.ts +5 -5
- package/src/composables/unifyValidation/tests/documentationValidationProps.spec.ts +177 -0
- package/src/composables/unifyValidation/tests/useCustomValidation.spec.ts +30 -0
- package/src/composables/unifyValidation/tests/useValidation.spec.ts +6 -2
- package/src/composables/unifyValidation/useCustomValidation.ts +19 -9
- package/src/composables/unifyValidation/useValidation.ts +18 -21
- package/src/composables/useFilterable/useFilterable.spec.ts +42 -0
- package/src/composables/useFilterable/useFilterable.ts +11 -7
- package/src/composables/useFormFieldErrorHandling.ts +2 -2
- package/src/composantsVuetify/VBtn/VBtn.mdx +9 -39
- package/src/composantsVuetify/VBtn/v-btn.stories.ts +26 -86
- package/src/designTokens/tokens/amelipro/apContextual.ts +6 -0
- package/src/designTokens/tokens/amelipro/apDarkTheme.ts +2 -2
- package/src/designTokens/tokens/amelipro/apLightTheme.ts +72 -103
- package/src/designTokens/tokens/amelipro/apSemantic.ts +1 -1
- package/src/designTokens/tokens/baseContextualTokens.ts +1 -6
- package/src/designTokens/tokens/baseTokens.ts +232 -0
- package/src/designTokens/tokens/cnam/cnamContextual.ts +6 -0
- package/src/designTokens/tokens/cnam/cnamDarkTheme.ts +2 -2
- package/src/designTokens/tokens/cnam/cnamLightTheme.ts +76 -104
- package/src/designTokens/tokens/pa/paDarkTheme.ts +2 -2
- package/src/designTokens/tokens/pa/paLightTheme.ts +73 -99
- package/src/designTokens/tokens/pa/paSemantic.ts +2 -0
- package/src/designTokens/tokens/semanticTokens.ts +114 -0
- package/src/stories/Components/Components.stories.ts +7 -3
- package/src/stories/DesignTokens/ColorIntegrationExample.vue +2 -3
- package/src/stories/DesignTokens/Colors.mdx +6 -8
- package/src/stories/DesignTokens/colors.stories.ts +244 -1081
- package/src/utils/amelipro/toKebabCase/tests/toKebabCase.spec.ts +52 -0
- package/src/utils/formatNir/tests/formatNir.spec.ts +34 -0
- package/src/utils/tests/insertAt.spec.ts +44 -0
- package/dist/apLightTheme-DS0Uy44H.js +0 -954
- package/dist/components/RatingPicker/tests/RatingPicker.a11y.spect.d.ts +0 -1
- package/dist/main-BsJ9ec3i.js +0 -38954
- 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/DatePicker/CalendarMode/tests/DatePicker.events.spec.ts +0 -178
- 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/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/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/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/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/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/RatingPicker/tests/{RatingPicker.a11y.spect.ts → RatingPicker.a11y.spec.ts} +0 -0
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
<template>
|
|
62
62
|
<VToolbar
|
|
63
63
|
v-bind="options.toolbar"
|
|
64
|
-
:class="{ 'v-theme-
|
|
64
|
+
:class="{ 'v-theme-grey-darken80': theme.current.value.dark}"
|
|
65
65
|
class="sy-table-toolbar px-4 py-2 d-flex flex-wrap align-center justify-space-between"
|
|
66
66
|
>
|
|
67
67
|
<p
|
|
@@ -164,23 +164,23 @@
|
|
|
164
164
|
|
|
165
165
|
p,
|
|
166
166
|
.text-primary {
|
|
167
|
-
color: rgba(var(--v-theme-
|
|
167
|
+
color: rgba(var(--v-theme-onPrimary), 0.6) !important;
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
svg {
|
|
171
|
-
fill: rgb(var(--v-theme-
|
|
171
|
+
fill: rgb(var(--v-theme-onPrimary)) !important;
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
.v-label {
|
|
175
|
-
color: rgba(var(--v-theme-
|
|
175
|
+
color: rgba(var(--v-theme-onPrimary), 0.6) !important;
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
.v-field__input {
|
|
179
|
-
color: rgb(var(--v-theme-
|
|
179
|
+
color: rgb(var(--v-theme-onPrimary)) !important;
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
.v-theme--dark button.v-btn:hover :deep() {
|
|
184
|
-
background: rgba(var(--v-theme-
|
|
184
|
+
background: rgba(var(--v-theme-onPrimary), 0.1);
|
|
185
185
|
}
|
|
186
186
|
</style>
|
|
@@ -1,12 +1,86 @@
|
|
|
1
|
-
import { Meta, Story } from '@storybook/
|
|
2
|
-
import * as Stories from '../TableToolbar.stories
|
|
1
|
+
import { Meta, Story } from '@storybook/blocks';
|
|
2
|
+
import * as Stories from '../TableToolbar.stories';
|
|
3
|
+
import AccessibilityIcon from '@/common/imgs/accessibility-svgrepo-com.svg';
|
|
3
4
|
import '@/stories/styles/shared.css';
|
|
5
|
+
import {
|
|
6
|
+
AccessibilityGuideLayout,
|
|
7
|
+
CriteriaSection,
|
|
8
|
+
CriteriaCard,
|
|
9
|
+
DemoSection,
|
|
10
|
+
BestPracticesSection,
|
|
11
|
+
ResourcesSection,
|
|
12
|
+
AuditSection,
|
|
13
|
+
} from '@/stories/accessibility/AccessibilityGuideLayout.mdx';
|
|
4
14
|
|
|
5
15
|
<Meta of={Stories} />
|
|
6
16
|
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
17
|
+
<AccessibilityGuideLayout
|
|
18
|
+
componentName="TableToolbar"
|
|
19
|
+
iconSrc={AccessibilityIcon}
|
|
20
|
+
>
|
|
21
|
+
<AuditSection>
|
|
22
|
+
<div>Rapport d’audit manuel :{' '}<a href="/audits/TableToolbar.xlsx" style={{color: '#0C41BD'}}>Voir le rapport</a></div>
|
|
23
|
+
<div style={{color: 'grey', fontSize: '14px', marginTop: '0px'}}>Correctifs associés (<a href="https://github.com/assurance-maladie-digital/design-system-v3/issues/925" target="_blank" style={{color: '#0C41BD'}}>issue #925</a>)</div>
|
|
24
|
+
</AuditSection>
|
|
11
25
|
|
|
12
|
-
<
|
|
26
|
+
<CriteriaSection>
|
|
27
|
+
<CriteriaCard icon="🏷️" title="Structure et rôles">
|
|
28
|
+
<ul>
|
|
29
|
+
<li>Le conteneur est un <code>VToolbar</code> servant de barre d’outils et non de navigation principale.</li>
|
|
30
|
+
<li>Le champ de recherche est un <code>VTextField</code> avec label explicite via <code>searchLabel</code>.</li>
|
|
31
|
+
<li>Le bouton d’ajout est un <code>VBtn</code> avec icône <code>mdiPlus</code> et texte visible selon le breakpoint.</li>
|
|
32
|
+
<li>Le compteur (<code>nbTotal / nbFiltered</code>) est rendu sous forme de texte informatif, sans rôle interactif.</li>
|
|
33
|
+
<li>Les slots <code>filters</code>, <code>search-left</code> et <code>search-right</code> permettent d’injecter des contrôles additionnels sans casser la sémantique.</li>
|
|
34
|
+
</ul>
|
|
35
|
+
</CriteriaCard>
|
|
36
|
+
|
|
37
|
+
<CriteriaCard icon="⌨️" title="Navigation clavier">
|
|
38
|
+
<ul>
|
|
39
|
+
<li>Le champ de recherche est entièrement accessible au clavier (Tab / Shift+Tab).</li>
|
|
40
|
+
<li>Le bouton d’ajout est activable via Entrée / Espace.</li>
|
|
41
|
+
<li>Les éléments injectés via slots doivent respecter l’ordre de tabulation naturel du DOM.</li>
|
|
42
|
+
<li>Le focus reste logique lors du redimensionnement (mobile / desktop).</li>
|
|
43
|
+
<li>Les éléments désactivés via <code>loading</code> sont correctement inaccessibles au clavier.</li>
|
|
44
|
+
</ul>
|
|
45
|
+
</CriteriaCard>
|
|
46
|
+
|
|
47
|
+
<CriteriaCard icon="🎨" title="Contraste et lisibilité">
|
|
48
|
+
<ul>
|
|
49
|
+
<li>Le toolbar adapte son thème (clair/sombre) via <code>v-theme--dark</code>.</li>
|
|
50
|
+
<li>Le texte du compteur reste lisible avec contraste réduit en mode sombre.</li>
|
|
51
|
+
<li>Les icônes (loupe, plus) sont décoratives et ne portent pas de sens sans label associé.</li>
|
|
52
|
+
<li>Le champ de recherche conserve un focus visible cohérent avec le design system.</li>
|
|
53
|
+
</ul>
|
|
54
|
+
</CriteriaCard>
|
|
55
|
+
|
|
56
|
+
<CriteriaCard icon="📱" title="Responsive et lisibilité mobile">
|
|
57
|
+
<ul>
|
|
58
|
+
<li>Sur mobile, le champ de recherche passe en largeur complète (<code>flex-grow</code> ajusté).</li>
|
|
59
|
+
<li>Le texte du bouton “Ajouter” est masqué sur petit écran pour privilégier l’icône.</li>
|
|
60
|
+
<li>L’ordre des éléments est conservé pour éviter toute confusion de navigation.</li>
|
|
61
|
+
</ul>
|
|
62
|
+
</CriteriaCard>
|
|
63
|
+
</CriteriaSection>
|
|
64
|
+
|
|
65
|
+
<DemoSection componentName="TableToolbar">
|
|
66
|
+
<Story of={Stories.Default}/>
|
|
67
|
+
</DemoSection>
|
|
68
|
+
|
|
69
|
+
<BestPracticesSection>
|
|
70
|
+
<ul>
|
|
71
|
+
<li>Fournissez un <code>searchLabel</code> explicite pour éviter une recherche non contextualisée.</li>
|
|
72
|
+
<li>Évitez d’injecter trop d’actions dans le slot <code>search-right</code> pour ne pas surcharger la barre.</li>
|
|
73
|
+
<li>Activez <code>loading</code> pour bloquer les interactions pendant les requêtes.</li>
|
|
74
|
+
<li>Gardez le bouton “Ajouter” avec un libellé court et actionnable.</li>
|
|
75
|
+
<li>Utilisez le slot <code>filters</code> uniquement pour des contrôles secondaires liés au tableau.</li>
|
|
76
|
+
</ul>
|
|
77
|
+
</BestPracticesSection>
|
|
78
|
+
|
|
79
|
+
<ResourcesSection>
|
|
80
|
+
<ul>
|
|
81
|
+
<li><a href="https://www.w3.org/WAI/ARIA/apg/patterns/toolbar/" target="_blank" rel="noopener noreferrer">WAI-ARIA Authoring Practices – Toolbar Pattern</a></li>
|
|
82
|
+
<li><a href="https://www.w3.org/WAI/WCAG21/Understanding/focus-visible.html" target="_blank" rel="noopener noreferrer">WCAG – Focus Visible (2.4.7)</a></li>
|
|
83
|
+
<li><a href="https://www.numerique.gouv.fr/publications/rgaa-accessibilite/" target="_blank" rel="noopener noreferrer">RGAA – critères 10.7 (focus), 10.8 (contenus cachés)</a></li>
|
|
84
|
+
</ul>
|
|
85
|
+
</ResourcesSection>
|
|
86
|
+
</AccessibilityGuideLayout>
|
|
@@ -226,6 +226,15 @@ const meta = {
|
|
|
226
226
|
defaultValue: { summary: 'false' },
|
|
227
227
|
},
|
|
228
228
|
},
|
|
229
|
+
'hideDefaultFooter': {
|
|
230
|
+
description: 'Masque le footer par défaut du tableau (pagination et contrôles de page). Utile lorsque l\'on souhaite gérer la pagination manuellement ou ne pas en afficher.',
|
|
231
|
+
control: { type: 'boolean' },
|
|
232
|
+
table: {
|
|
233
|
+
category: 'props',
|
|
234
|
+
type: { summary: 'boolean' },
|
|
235
|
+
defaultValue: { summary: 'false' },
|
|
236
|
+
},
|
|
237
|
+
},
|
|
229
238
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
230
239
|
// @ts-ignore - 'cookie-description-${cookieName}' storybook can't infer dynamic slot name
|
|
231
240
|
'header.<columnKey>': {
|
|
@@ -7352,6 +7361,160 @@ export const ComplexItemsDisplay: Story = {
|
|
|
7352
7361
|
},
|
|
7353
7362
|
}
|
|
7354
7363
|
|
|
7364
|
+
export const HideDefaultFooter: Story = {
|
|
7365
|
+
parameters: {
|
|
7366
|
+
a11y: {
|
|
7367
|
+
disable: true,
|
|
7368
|
+
},
|
|
7369
|
+
sourceCode: [
|
|
7370
|
+
{
|
|
7371
|
+
name: 'Template',
|
|
7372
|
+
code: `
|
|
7373
|
+
<template>
|
|
7374
|
+
<SyServerTable
|
|
7375
|
+
v-model:options="options"
|
|
7376
|
+
:items="users"
|
|
7377
|
+
:headers="headers"
|
|
7378
|
+
:server-items-length="totalUsers"
|
|
7379
|
+
:loading="state === StateEnum.PENDING"
|
|
7380
|
+
suffix="server-hide-footer"
|
|
7381
|
+
hide-default-footer
|
|
7382
|
+
@update:options="fetchData"
|
|
7383
|
+
/>
|
|
7384
|
+
</template>
|
|
7385
|
+
`,
|
|
7386
|
+
},
|
|
7387
|
+
{
|
|
7388
|
+
name: 'Script',
|
|
7389
|
+
code: `
|
|
7390
|
+
<script setup lang="ts">
|
|
7391
|
+
import { ref } from 'vue'
|
|
7392
|
+
import { SyServerTable } from '@cnamts/synapse'
|
|
7393
|
+
import { StateEnum } from '@cnamts/synapse/src/components/Tables/common/constants/StateEnum'
|
|
7394
|
+
import type { DataOptions } from '@cnamts/synapse/src/components/Tables/common/types'
|
|
7395
|
+
|
|
7396
|
+
const totalUsers = ref(0)
|
|
7397
|
+
const users = ref([])
|
|
7398
|
+
const state = ref(StateEnum.IDLE)
|
|
7399
|
+
const options = ref({ itemsPerPage: -1, page: 1 })
|
|
7400
|
+
|
|
7401
|
+
const headers = [
|
|
7402
|
+
{ title: 'Nom', key: 'lastname' },
|
|
7403
|
+
{ title: 'Prénom', key: 'firstname' },
|
|
7404
|
+
{ title: 'Email', key: 'email' },
|
|
7405
|
+
]
|
|
7406
|
+
|
|
7407
|
+
const fetchData = async () => {
|
|
7408
|
+
const { items, total } = await getDataFromApi(options.value)
|
|
7409
|
+
users.value = items
|
|
7410
|
+
totalUsers.value = total
|
|
7411
|
+
}
|
|
7412
|
+
|
|
7413
|
+
const getDataFromApi = async ({ page, itemsPerPage }: DataOptions) => {
|
|
7414
|
+
state.value = StateEnum.PENDING
|
|
7415
|
+
await new Promise(resolve => setTimeout(resolve, 500))
|
|
7416
|
+
const allItems = getUsers()
|
|
7417
|
+
const total = allItems.length
|
|
7418
|
+
const items = itemsPerPage > 0
|
|
7419
|
+
? allItems.slice((page - 1) * itemsPerPage, page * itemsPerPage)
|
|
7420
|
+
: allItems
|
|
7421
|
+
state.value = StateEnum.RESOLVED
|
|
7422
|
+
return { items, total }
|
|
7423
|
+
}
|
|
7424
|
+
|
|
7425
|
+
const getUsers = () => [
|
|
7426
|
+
{ firstname: 'Virginie', lastname: 'Beauchesne', email: 'virginie.beauchesne@example.com' },
|
|
7427
|
+
{ firstname: 'Simone', lastname: 'Bellefeuille', email: 'simone.bellefeuille@example.com' },
|
|
7428
|
+
{ firstname: 'Étienne', lastname: 'Salois', email: 'etienne.salois@example.com' },
|
|
7429
|
+
{ firstname: 'Bernadette', lastname: 'Langelier', email: 'bernadette.langelier@example.com' },
|
|
7430
|
+
{ firstname: 'Agate', lastname: 'Roy', email: 'agate.roy@example.com' },
|
|
7431
|
+
{ firstname: 'Louis', lastname: 'Denis', email: 'louis.denis@example.com' },
|
|
7432
|
+
]
|
|
7433
|
+
|
|
7434
|
+
fetchData()
|
|
7435
|
+
</script>
|
|
7436
|
+
`,
|
|
7437
|
+
},
|
|
7438
|
+
],
|
|
7439
|
+
},
|
|
7440
|
+
args: {
|
|
7441
|
+
'options': { itemsPerPage: -1, page: 1 },
|
|
7442
|
+
'headers': [
|
|
7443
|
+
{ title: 'Nom', key: 'lastname' },
|
|
7444
|
+
{ title: 'Prénom', key: 'firstname' },
|
|
7445
|
+
{ title: 'Email', key: 'email' },
|
|
7446
|
+
],
|
|
7447
|
+
'serverItemsLength': 6,
|
|
7448
|
+
'suffix': 'server-hide-footer',
|
|
7449
|
+
'density': 'default',
|
|
7450
|
+
'striped': false,
|
|
7451
|
+
'hideDefaultFooter': true,
|
|
7452
|
+
'onUpdate:options': fn(),
|
|
7453
|
+
},
|
|
7454
|
+
render: (args) => {
|
|
7455
|
+
return {
|
|
7456
|
+
components: { SyServerTable },
|
|
7457
|
+
setup() {
|
|
7458
|
+
const totalUsers = ref(0)
|
|
7459
|
+
const users = ref<User[]>([])
|
|
7460
|
+
const state = ref(StateEnum.IDLE)
|
|
7461
|
+
const options = ref({ ...args.options })
|
|
7462
|
+
|
|
7463
|
+
watch(options, (newVal) => {
|
|
7464
|
+
if (args.options) {
|
|
7465
|
+
Object.assign(args.options, JSON.parse(JSON.stringify(newVal)))
|
|
7466
|
+
}
|
|
7467
|
+
}, { deep: true })
|
|
7468
|
+
|
|
7469
|
+
const fetchData = async (): Promise<void> => {
|
|
7470
|
+
const { items, total } = await getDataFromApi(options.value as DataOptions)
|
|
7471
|
+
users.value = items
|
|
7472
|
+
totalUsers.value = total
|
|
7473
|
+
}
|
|
7474
|
+
|
|
7475
|
+
const getDataFromApi = async ({ page, itemsPerPage }: DataOptions): Promise<{ items: User[], total: number }> => {
|
|
7476
|
+
state.value = StateEnum.PENDING
|
|
7477
|
+
await new Promise(resolve => setTimeout(resolve, 500))
|
|
7478
|
+
return new Promise((resolve) => {
|
|
7479
|
+
const allItems = getUsers()
|
|
7480
|
+
const total = allItems.length
|
|
7481
|
+
const items = itemsPerPage > 0
|
|
7482
|
+
? allItems.slice((page - 1) * itemsPerPage, page * itemsPerPage)
|
|
7483
|
+
: allItems
|
|
7484
|
+
resolve({ items, total })
|
|
7485
|
+
state.value = StateEnum.RESOLVED
|
|
7486
|
+
})
|
|
7487
|
+
}
|
|
7488
|
+
|
|
7489
|
+
const getUsers = (): User[] => [
|
|
7490
|
+
{ firstname: 'Virginie', lastname: 'Beauchesne', email: 'virginie.beauchesne@example.com' },
|
|
7491
|
+
{ firstname: 'Simone', lastname: 'Bellefeuille', email: 'simone.bellefeuille@example.com' },
|
|
7492
|
+
{ firstname: 'Étienne', lastname: 'Salois', email: 'etienne.salois@example.com' },
|
|
7493
|
+
{ firstname: 'Bernadette', lastname: 'Langelier', email: 'bernadette.langelier@example.com' },
|
|
7494
|
+
{ firstname: 'Agate', lastname: 'Roy', email: 'agate.roy@example.com' },
|
|
7495
|
+
{ firstname: 'Louis', lastname: 'Denis', email: 'louis.denis@example.com' },
|
|
7496
|
+
]
|
|
7497
|
+
|
|
7498
|
+
fetchData()
|
|
7499
|
+
|
|
7500
|
+
return { args, users, state, fetchData, options, totalUsers, StateEnum }
|
|
7501
|
+
},
|
|
7502
|
+
template: `
|
|
7503
|
+
<div>
|
|
7504
|
+
<SyServerTable
|
|
7505
|
+
v-model:options="options"
|
|
7506
|
+
:items="users"
|
|
7507
|
+
:server-items-length="totalUsers"
|
|
7508
|
+
:loading="state === StateEnum.PENDING"
|
|
7509
|
+
v-bind="args"
|
|
7510
|
+
@update:options="fetchData"
|
|
7511
|
+
/>
|
|
7512
|
+
</div>
|
|
7513
|
+
`,
|
|
7514
|
+
}
|
|
7515
|
+
},
|
|
7516
|
+
}
|
|
7517
|
+
|
|
7355
7518
|
export const PageInput: Story = {
|
|
7356
7519
|
parameters: {
|
|
7357
7520
|
a11y: {
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
headingLevel: 2,
|
|
43
43
|
clickableRow: false,
|
|
44
44
|
pageInput: false,
|
|
45
|
+
hideDefaultFooter: false,
|
|
45
46
|
})
|
|
46
47
|
|
|
47
48
|
const emit = defineEmits<{
|
|
@@ -467,7 +468,7 @@
|
|
|
467
468
|
v-model:headers="headers"
|
|
468
469
|
/>
|
|
469
470
|
<SyTablePagination
|
|
470
|
-
v-if="displayedItems.length > 0 ? displayedItemsLength : 0"
|
|
471
|
+
v-if="(displayedItems.length > 0 ? displayedItemsLength : 0) && !props.hideDefaultFooter"
|
|
471
472
|
:page="page"
|
|
472
473
|
:heading-level="props.headingLevel"
|
|
473
474
|
:items-per-page="itemsPerPageValue"
|
|
@@ -1194,6 +1194,73 @@ describe('SyServerTable', () => {
|
|
|
1194
1194
|
})
|
|
1195
1195
|
})
|
|
1196
1196
|
|
|
1197
|
+
describe('SyServerTable hideDefaultFooter', () => {
|
|
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('shows pagination footer by default (hideDefaultFooter is false)', async () => {
|
|
1205
|
+
const wrapper = mount(SyServerTable, {
|
|
1206
|
+
props: {
|
|
1207
|
+
options: { itemsPerPage: 5 } as DataOptions,
|
|
1208
|
+
suffix: 'hide-footer-server-test',
|
|
1209
|
+
serverItemsLength: 11,
|
|
1210
|
+
hideDefaultFooter: false,
|
|
1211
|
+
},
|
|
1212
|
+
attrs: { items: manyItems, headers },
|
|
1213
|
+
})
|
|
1214
|
+
|
|
1215
|
+
await wrapper.vm.$nextTick()
|
|
1216
|
+
await vi.dynamicImportSettled()
|
|
1217
|
+
|
|
1218
|
+
const pagination = wrapper.findComponent({ name: 'SyTablePagination' })
|
|
1219
|
+
expect(pagination.exists()).toBe(true)
|
|
1220
|
+
})
|
|
1221
|
+
|
|
1222
|
+
it('hides pagination footer when hideDefaultFooter is true', async () => {
|
|
1223
|
+
const wrapper = mount(SyServerTable, {
|
|
1224
|
+
props: {
|
|
1225
|
+
options: { itemsPerPage: 5 } as DataOptions,
|
|
1226
|
+
suffix: 'hide-footer-server-test',
|
|
1227
|
+
serverItemsLength: 11,
|
|
1228
|
+
hideDefaultFooter: true,
|
|
1229
|
+
},
|
|
1230
|
+
attrs: { items: manyItems, headers },
|
|
1231
|
+
})
|
|
1232
|
+
|
|
1233
|
+
await wrapper.vm.$nextTick()
|
|
1234
|
+
await vi.dynamicImportSettled()
|
|
1235
|
+
|
|
1236
|
+
const pagination = wrapper.findComponent({ name: 'SyTablePagination' })
|
|
1237
|
+
expect(pagination.exists()).toBe(false)
|
|
1238
|
+
})
|
|
1239
|
+
|
|
1240
|
+
it('still shows OrganizeColumns when hideDefaultFooter is true and enableColumnControls is enabled', async () => {
|
|
1241
|
+
const wrapper = mount(SyServerTable, {
|
|
1242
|
+
props: {
|
|
1243
|
+
options: { itemsPerPage: 5 } as DataOptions,
|
|
1244
|
+
suffix: 'hide-footer-col-controls-server-test',
|
|
1245
|
+
serverItemsLength: 11,
|
|
1246
|
+
hideDefaultFooter: true,
|
|
1247
|
+
enableColumnControls: true,
|
|
1248
|
+
},
|
|
1249
|
+
attrs: { items: manyItems, headers },
|
|
1250
|
+
attachTo: document.body,
|
|
1251
|
+
})
|
|
1252
|
+
|
|
1253
|
+
await wrapper.vm.$nextTick()
|
|
1254
|
+
await vi.dynamicImportSettled()
|
|
1255
|
+
|
|
1256
|
+
const organizeColumns = wrapper.findComponent({ name: 'OrganizeColumns' })
|
|
1257
|
+
expect(organizeColumns.exists()).toBe(true)
|
|
1258
|
+
|
|
1259
|
+
const pagination = wrapper.findComponent({ name: 'SyTablePagination' })
|
|
1260
|
+
expect(pagination.exists()).toBe(false)
|
|
1261
|
+
})
|
|
1262
|
+
})
|
|
1263
|
+
|
|
1197
1264
|
describe('SyServerTable pageInput', () => {
|
|
1198
1265
|
const manyItems = Array.from({ length: 11 }, (_, i) => ({
|
|
1199
1266
|
id: i + 1,
|
|
@@ -212,6 +212,15 @@ const meta = {
|
|
|
212
212
|
defaultValue: { summary: 'false' },
|
|
213
213
|
},
|
|
214
214
|
},
|
|
215
|
+
'hideDefaultFooter': {
|
|
216
|
+
description: 'Masque le footer par défaut du tableau (pagination et contrôles de page). Utile lorsque l\'on souhaite gérer la pagination manuellement ou ne pas en afficher.',
|
|
217
|
+
control: { type: 'boolean' },
|
|
218
|
+
table: {
|
|
219
|
+
category: 'props',
|
|
220
|
+
type: { summary: 'boolean' },
|
|
221
|
+
defaultValue: { summary: 'false' },
|
|
222
|
+
},
|
|
223
|
+
},
|
|
215
224
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
216
225
|
// @ts-ignore - 'cookie-description-${cookieName}' storybook can't infer dynamic slot name
|
|
217
226
|
'header.<columnKey>': {
|
|
@@ -4922,6 +4931,91 @@ export const ComplexItemsDisplay: Story = {
|
|
|
4922
4931
|
},
|
|
4923
4932
|
}
|
|
4924
4933
|
|
|
4934
|
+
export const HideDefaultFooter: Story = {
|
|
4935
|
+
parameters: {
|
|
4936
|
+
a11y: {
|
|
4937
|
+
disable: true,
|
|
4938
|
+
},
|
|
4939
|
+
sourceCode: [
|
|
4940
|
+
{
|
|
4941
|
+
name: 'Template',
|
|
4942
|
+
code: `
|
|
4943
|
+
<template>
|
|
4944
|
+
<SyTable
|
|
4945
|
+
v-model:options="options"
|
|
4946
|
+
:headers="headers"
|
|
4947
|
+
:items="items"
|
|
4948
|
+
suffix="hide-footer-table"
|
|
4949
|
+
hide-default-footer
|
|
4950
|
+
/>
|
|
4951
|
+
</template>
|
|
4952
|
+
`,
|
|
4953
|
+
},
|
|
4954
|
+
{
|
|
4955
|
+
name: 'Script',
|
|
4956
|
+
code: `
|
|
4957
|
+
<script setup lang="ts">
|
|
4958
|
+
import { ref } from 'vue'
|
|
4959
|
+
import { SyTable } from '@cnamts/synapse'
|
|
4960
|
+
|
|
4961
|
+
const options = ref({ itemsPerPage: -1 })
|
|
4962
|
+
|
|
4963
|
+
const headers = ref([
|
|
4964
|
+
{ title: 'Nom', key: 'lastname' },
|
|
4965
|
+
{ title: 'Prénom', key: 'firstname' },
|
|
4966
|
+
{ title: 'Email', key: 'email' },
|
|
4967
|
+
])
|
|
4968
|
+
|
|
4969
|
+
const items = ref([
|
|
4970
|
+
{ firstname: 'Virginie', lastname: 'Beauchesne', email: 'virginie.beauchesne@example.com' },
|
|
4971
|
+
{ firstname: 'Simone', lastname: 'Bellefeuille', email: 'simone.bellefeuille@example.com' },
|
|
4972
|
+
{ firstname: 'Étienne', lastname: 'Salois', email: 'etienne.salois@example.com' },
|
|
4973
|
+
{ firstname: 'Thierry', lastname: 'Bobu', email: 'thierry.bobu@example.com' },
|
|
4974
|
+
{ firstname: 'Bernadette', lastname: 'Langelier', email: 'bernadette.langelier@example.com' },
|
|
4975
|
+
{ firstname: 'Agate', lastname: 'Roy', email: 'agate.roy@example.com' },
|
|
4976
|
+
])
|
|
4977
|
+
</script>
|
|
4978
|
+
`,
|
|
4979
|
+
},
|
|
4980
|
+
],
|
|
4981
|
+
},
|
|
4982
|
+
args: {
|
|
4983
|
+
'headers': [
|
|
4984
|
+
{ title: 'Nom', key: 'lastname' },
|
|
4985
|
+
{ title: 'Prénom', key: 'firstname' },
|
|
4986
|
+
{ title: 'Email', key: 'email' },
|
|
4987
|
+
],
|
|
4988
|
+
'items': [
|
|
4989
|
+
{ firstname: 'Virginie', lastname: 'Beauchesne', email: 'virginie.beauchesne@example.com' },
|
|
4990
|
+
{ firstname: 'Simone', lastname: 'Bellefeuille', email: 'simone.bellefeuille@example.com' },
|
|
4991
|
+
{ firstname: 'Étienne', lastname: 'Salois', email: 'etienne.salois@example.com' },
|
|
4992
|
+
{ firstname: 'Thierry', lastname: 'Bobu', email: 'thierry.bobu@example.com' },
|
|
4993
|
+
{ firstname: 'Bernadette', lastname: 'Langelier', email: 'bernadette.langelier@example.com' },
|
|
4994
|
+
{ firstname: 'Agate', lastname: 'Roy', email: 'agate.roy@example.com' },
|
|
4995
|
+
],
|
|
4996
|
+
'options': { itemsPerPage: -1 },
|
|
4997
|
+
'suffix': 'hide-footer-table',
|
|
4998
|
+
'hideDefaultFooter': true,
|
|
4999
|
+
'density': 'default',
|
|
5000
|
+
'striped': false,
|
|
5001
|
+
'onUpdate:options': fn(),
|
|
5002
|
+
},
|
|
5003
|
+
render: (args) => {
|
|
5004
|
+
return {
|
|
5005
|
+
components: { SyTable },
|
|
5006
|
+
setup() {
|
|
5007
|
+
return { args }
|
|
5008
|
+
},
|
|
5009
|
+
template: `
|
|
5010
|
+
<SyTable
|
|
5011
|
+
v-model:options="args.options"
|
|
5012
|
+
v-bind="args"
|
|
5013
|
+
/>
|
|
5014
|
+
`,
|
|
5015
|
+
}
|
|
5016
|
+
},
|
|
5017
|
+
}
|
|
5018
|
+
|
|
4925
5019
|
export const PageInput: Story = {
|
|
4926
5020
|
parameters: {
|
|
4927
5021
|
a11y: {
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
headingLevel: 2,
|
|
42
42
|
clickableRow: false,
|
|
43
43
|
pageInput: false,
|
|
44
|
+
hideDefaultFooter: false,
|
|
44
45
|
})
|
|
45
46
|
|
|
46
47
|
const emit = defineEmits<{
|
|
@@ -457,7 +458,7 @@
|
|
|
457
458
|
v-model:headers="headers"
|
|
458
459
|
/>
|
|
459
460
|
<SyTablePagination
|
|
460
|
-
v-if="filteredItems.length > 0"
|
|
461
|
+
v-if="filteredItems.length > 0 && !props.hideDefaultFooter"
|
|
461
462
|
:page="page"
|
|
462
463
|
:items-per-page="itemsPerPageValue"
|
|
463
464
|
:heading-level="props.headingLevel"
|
|
@@ -1047,6 +1047,70 @@ describe('SyTable selectionKey', () => {
|
|
|
1047
1047
|
})
|
|
1048
1048
|
})
|
|
1049
1049
|
|
|
1050
|
+
describe('SyTable hideDefaultFooter', () => {
|
|
1051
|
+
const manyItems = Array.from({ length: 11 }, (_, i) => ({
|
|
1052
|
+
id: i + 1,
|
|
1053
|
+
name: `User ${i + 1}`,
|
|
1054
|
+
age: 20 + i,
|
|
1055
|
+
}))
|
|
1056
|
+
|
|
1057
|
+
it('shows pagination footer by default (hideDefaultFooter is false)', async () => {
|
|
1058
|
+
const wrapper = mount(SyTable, {
|
|
1059
|
+
props: {
|
|
1060
|
+
options: { itemsPerPage: 5 } as DataOptions,
|
|
1061
|
+
suffix: 'hide-footer-test',
|
|
1062
|
+
hideDefaultFooter: false,
|
|
1063
|
+
},
|
|
1064
|
+
attrs: { items: manyItems, headers },
|
|
1065
|
+
})
|
|
1066
|
+
|
|
1067
|
+
await wrapper.vm.$nextTick()
|
|
1068
|
+
await vi.dynamicImportSettled()
|
|
1069
|
+
|
|
1070
|
+
const pagination = wrapper.findComponent({ name: 'SyTablePagination' })
|
|
1071
|
+
expect(pagination.exists()).toBe(true)
|
|
1072
|
+
})
|
|
1073
|
+
|
|
1074
|
+
it('hides pagination footer when hideDefaultFooter is true', async () => {
|
|
1075
|
+
const wrapper = mount(SyTable, {
|
|
1076
|
+
props: {
|
|
1077
|
+
options: { itemsPerPage: 5 } as DataOptions,
|
|
1078
|
+
suffix: 'hide-footer-test',
|
|
1079
|
+
hideDefaultFooter: true,
|
|
1080
|
+
},
|
|
1081
|
+
attrs: { items: manyItems, headers },
|
|
1082
|
+
})
|
|
1083
|
+
|
|
1084
|
+
await wrapper.vm.$nextTick()
|
|
1085
|
+
await vi.dynamicImportSettled()
|
|
1086
|
+
|
|
1087
|
+
const pagination = wrapper.findComponent({ name: 'SyTablePagination' })
|
|
1088
|
+
expect(pagination.exists()).toBe(false)
|
|
1089
|
+
})
|
|
1090
|
+
|
|
1091
|
+
it('still shows OrganizeColumns when hideDefaultFooter is true and enableColumnControls is enabled', async () => {
|
|
1092
|
+
const wrapper = mount(SyTable, {
|
|
1093
|
+
props: {
|
|
1094
|
+
options: { itemsPerPage: 5 } as DataOptions,
|
|
1095
|
+
suffix: 'hide-footer-col-controls-test',
|
|
1096
|
+
hideDefaultFooter: true,
|
|
1097
|
+
enableColumnControls: true,
|
|
1098
|
+
},
|
|
1099
|
+
attrs: { items: manyItems, headers },
|
|
1100
|
+
attachTo: document.body,
|
|
1101
|
+
})
|
|
1102
|
+
|
|
1103
|
+
await wrapper.vm.$nextTick()
|
|
1104
|
+
await vi.dynamicImportSettled()
|
|
1105
|
+
|
|
1106
|
+
const organizeColumns = wrapper.findComponent({ name: 'OrganizeColumns' })
|
|
1107
|
+
expect(organizeColumns.exists()).toBe(true)
|
|
1108
|
+
|
|
1109
|
+
const pagination = wrapper.findComponent({ name: 'SyTablePagination' })
|
|
1110
|
+
expect(pagination.exists()).toBe(false)
|
|
1111
|
+
})
|
|
1112
|
+
})
|
|
1113
|
+
|
|
1050
1114
|
describe('SyTable pageInput', () => {
|
|
1051
1115
|
const manyItems = Array.from({ length: 11 }, (_, i) => ({
|
|
1052
1116
|
id: i + 1,
|
|
@@ -210,8 +210,8 @@
|
|
|
210
210
|
const wrapperClasses = computed(() => [
|
|
211
211
|
alignClass.value,
|
|
212
212
|
{
|
|
213
|
-
'h-100': !props.wrapTitle,
|
|
214
|
-
'v-data-table-header__content--wrap': props.wrapTitle,
|
|
213
|
+
'h-100': !props.wrapTitle || props.resizableColumns,
|
|
214
|
+
'v-data-table-header__content--wrap': props.wrapTitle && !props.resizableColumns,
|
|
215
215
|
},
|
|
216
216
|
])
|
|
217
217
|
</script>
|