@cnamts/synapse 1.0.23 → 1.0.24
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-BWLR3U7W.js +114 -0
- package/dist/AutocompleteFilter-D9jzRzAL.cjs +1 -0
- package/dist/{DateFilter-Dc-gSGwk.js → DateFilter-BpwFexzi.js} +1 -1
- package/dist/DateFilter-DTUl8hb1.cjs +1 -0
- package/dist/{NumberFilter-vP38Wp6j.js → NumberFilter-Bz_NTdX9.js} +3 -3
- package/dist/NumberFilter-MAEojdk0.cjs +1 -0
- package/dist/PeriodFilter-CC4WgIhl.cjs +1 -0
- package/dist/{PeriodFilter-Ba1uYUnT.js → PeriodFilter-DX_wy9g-.js} +1 -1
- package/dist/SelectFilter-BR3fvl-a.cjs +1 -0
- package/dist/SelectFilter-xqiPtPgX.js +135 -0
- package/dist/{TextFilter-B84dpnoq.js → TextFilter-BBl3JFqK.js} +7 -7
- package/dist/TextFilter-CCfYFl5F.cjs +1 -0
- package/dist/apLightTheme-CFSRrjv2.cjs +1 -0
- package/dist/apLightTheme-D1P4jcD0.js +1231 -0
- package/dist/components/Amelipro/AmeliproAutoCompleteField/AmeliproAutoCompleteField.d.ts +7022 -9616
- package/dist/components/Amelipro/AmeliproCarousel/AmeliproCarousel.d.ts +2 -2
- package/dist/components/Amelipro/AmeliproIconBtn/AmeliproIconBtn.d.ts +2 -2
- package/dist/components/Amelipro/AmeliproPostalAddressField/AmeliproPostalAddressCityRow/AmeliproPostalAddressCityRow.d.ts +40 -40
- package/dist/components/Amelipro/AmeliproPostalAddressField/AmeliproPostalAddressField.d.ts +60 -60
- package/dist/components/Amelipro/AmeliproSelect/AmeliproSelect.d.ts +7168 -9762
- package/dist/components/Amelipro/AmeliproStepper/AmeliproStepper.d.ts +2 -2
- package/dist/components/Amelipro/AmeliproTabs/AmeliproTabs.d.ts +7501 -10095
- package/dist/components/Amelipro/AmeliproTextArea/AmeliproTextArea.d.ts +21 -21
- package/dist/components/Amelipro/AmeliproTextField/AmeliproTextField.d.ts +41 -41
- package/dist/components/Amelipro/StructureMenu/StructureTabs/StructureTabs.d.ts +2 -2
- package/dist/components/CookiesSelection/CookiesInformation/CookiesInformation.d.ts +20 -498
- package/dist/components/Customs/Selects/SyAutocomplete/SyAutocomplete.d.ts +108 -146
- package/dist/components/Customs/Selects/SyInputSelect/SyInputSelect.d.ts +5 -5
- package/dist/components/Customs/Selects/SySelect/SySelect.d.ts +12 -16
- package/dist/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.d.ts +8 -8
- package/dist/components/Customs/SyCheckbox/SyCheckbox.d.ts +28 -506
- package/dist/components/Customs/SyRadioGroup/SyRadioGroup.d.ts +28 -506
- package/dist/components/Customs/SyTextField/SyTextField.d.ts +65 -85
- package/dist/components/DatePicker/CalendarMode/DatePicker.d.ts +627 -771
- package/dist/components/DatePicker/ComplexDatePicker/ComplexDatePicker.d.ts +315 -402
- package/dist/components/DatePicker/DateTextInput/DateTextInput.d.ts +112 -155
- package/dist/components/DatePicker/composables/index.d.ts +1 -0
- package/dist/components/DatePicker/composables/useDatePickerFocusTrap.d.ts +11 -0
- package/dist/components/DatePicker/composables/useDateTextField.d.ts +4 -4
- package/dist/components/DatePicker/composables/useDateValidation.d.ts +3 -3
- package/dist/components/DatePicker/composables/useInputBlurHandler.d.ts +2 -2
- package/dist/components/DatePicker/composables/useManualDateValidation.d.ts +2 -2
- package/dist/components/HeaderNavigationBar/HeaderNavigationBar.d.ts +4 -4
- package/dist/components/HeaderToolbar/HeaderToolbar.d.ts +20 -28
- package/dist/components/LunarCalendar/useLunarCalendarValidation.d.ts +3 -3
- package/dist/components/MonthPicker/MonthPicker.d.ts +86 -122
- package/dist/components/MonthPicker/MonthPickerText/MonthPickerInput.d.ts +85 -121
- package/dist/components/NirField/NirField.d.ts +206 -270
- package/dist/components/NirField/locales.d.ts +10 -10
- package/dist/components/NirField/useNirValidation.d.ts +64 -0
- package/dist/components/PasswordField/PasswordField.d.ts +8 -9
- package/dist/components/PeriodField/PeriodField.d.ts +1352 -1640
- package/dist/components/PhoneField/PhoneField.d.ts +88 -124
- package/dist/components/RangeField/RangeSlider/RangeSlider.d.ts +12 -12
- package/dist/components/SyTextArea/SyTextArea.d.ts +34 -14
- package/dist/components/SyTextArea/useDefaultValidationRules.d.ts +11 -0
- package/dist/components/Tables/SyServerTable/SyServerTable.d.ts +9 -6
- package/dist/components/Tables/SyTable/SyTable.d.ts +9 -6
- package/dist/components/Tables/common/SyTableFilter.d.ts +2 -3
- package/dist/components/Tables/common/SyTablePagination.d.ts +17 -19
- package/dist/components/Tables/common/filters/AutocompleteFilter.d.ts +120 -0
- package/dist/components/Tables/common/filters/locales.d.ts +0 -1
- package/dist/components/Tables/common/types.d.ts +19 -3
- package/dist/components/Tables/common/useClickableTableRow.d.ts +17 -0
- package/dist/components/Tables/common/usePagination.d.ts +3 -1
- package/dist/components/Tables/common/usePinnedColumns.d.ts +31 -0
- package/dist/components/Tables/common/useTableHeaders.d.ts +2 -0
- package/dist/components/Tables/common/useTableRowCheckboxAccessibility.d.ts +5 -0
- package/dist/components/UploadWorkflow/UploadWorkflow.d.ts +6 -6
- package/dist/composables/date/useDatePickerAccessibility.d.ts +1 -1
- package/dist/composables/rules/useFieldValidation.d.ts +4 -4
- package/dist/composables/unifyValidation/useCustomValidation.d.ts +8 -0
- package/dist/composables/unifyValidation/useValidation.d.ts +102 -0
- package/dist/composables/unifyValidation/useVuetifyValidation.d.ts +18 -0
- package/dist/composables/useFormFieldErrorHandling.d.ts +2 -2
- package/dist/composables/validation/useFormValidation.d.ts +11 -2
- package/dist/composables/validation/useValidation.d.ts +15 -9
- package/dist/design-system-v3.d.ts +2 -0
- package/dist/design-system-v3.js +186 -187
- package/dist/design-system-v3.umd.cjs +1 -1066
- package/dist/{main-aLKwdMi1.js → main-BtTqyn4z.js} +16434 -15672
- package/dist/main-C1e3eoxd.cjs +1067 -0
- package/dist/main.d.ts +0 -1
- package/dist/synapse.css +1 -0
- package/dist/tooth-11-D3sLWv2n.cjs +1 -0
- package/dist/tooth-12-CXrLuH03.cjs +1 -0
- package/dist/tooth-13-BSfo5fpT.cjs +1 -0
- package/dist/tooth-14-DMzulx0h.cjs +1 -0
- package/dist/tooth-15-BKRFVi-9.cjs +1 -0
- package/dist/tooth-16-CpuxAbuM.cjs +1 -0
- package/dist/tooth-17-BPoahUdg.cjs +1 -0
- package/dist/tooth-18-DhHJz8sy.cjs +1 -0
- package/dist/tooth-21-Dgd5hn_X.cjs +1 -0
- package/dist/tooth-22-C2Tn19sB.cjs +1 -0
- package/dist/tooth-23-C9uaaSGb.cjs +1 -0
- package/dist/tooth-24-BrK9UGpf.cjs +1 -0
- package/dist/tooth-25-CE_EfGNp.cjs +1 -0
- package/dist/tooth-26-Ctv4i9Fy.cjs +1 -0
- package/dist/tooth-27-C5J7JkWM.cjs +1 -0
- package/dist/tooth-28-Z9oWqjo0.cjs +1 -0
- package/dist/tooth-31-BrYqmkTi.cjs +1 -0
- package/dist/tooth-32-BNNR0oCZ.cjs +1 -0
- package/dist/tooth-33-DuxvqO2J.cjs +1 -0
- package/dist/tooth-34-BCSCXMB6.cjs +1 -0
- package/dist/tooth-35-BLUXkX88.cjs +1 -0
- package/dist/tooth-36-IrKHYqlA.cjs +1 -0
- package/dist/tooth-37-BYqpdMwo.cjs +1 -0
- package/dist/tooth-38-B_eNXXdu.cjs +1 -0
- package/dist/tooth-41-Ddva4Ot8.cjs +1 -0
- package/dist/tooth-42-szcDqlM0.cjs +1 -0
- package/dist/tooth-43-B3ka6rQm.cjs +1 -0
- package/dist/tooth-44-CazyQucj.cjs +1 -0
- package/dist/tooth-45-B4HQtc8n.cjs +1 -0
- package/dist/tooth-46-BPM40gbG.cjs +1 -0
- package/dist/tooth-47-Dvr20dlh.cjs +1 -0
- package/dist/tooth-48-Bd8ljGsF.cjs +1 -0
- package/dist/tooth-51-OBpwCOF3.cjs +1 -0
- package/dist/tooth-52-aKxyHcmq.cjs +1 -0
- package/dist/tooth-53-vCwJjTOc.cjs +1 -0
- package/dist/tooth-54-DsWu2iFy.cjs +1 -0
- package/dist/tooth-55-BxC1X2Dn.cjs +1 -0
- package/dist/tooth-61-BbLvxMQi.cjs +1 -0
- package/dist/tooth-62-CmTkWczP.cjs +1 -0
- package/dist/tooth-63-DI7l_2qI.cjs +1 -0
- package/dist/tooth-64-B21sOsJh.cjs +1 -0
- package/dist/tooth-65-D2ZC2VEr.cjs +1 -0
- package/dist/tooth-71-D473PPO5.cjs +1 -0
- package/dist/tooth-72-Drh1wnNu.cjs +1 -0
- package/dist/tooth-73-DzlwYI23.cjs +1 -0
- package/dist/tooth-74-8aGvcZPg.cjs +1 -0
- package/dist/tooth-75-BFK7At_r.cjs +1 -0
- package/dist/tooth-81-BZmR-I0M.cjs +1 -0
- package/dist/tooth-82-euVfUUZV.cjs +1 -0
- package/dist/tooth-83-KV010j64.cjs +1 -0
- package/dist/tooth-84-BBg1RjhZ.cjs +1 -0
- package/dist/tooth-85-Cr-kc1wM.cjs +1 -0
- package/dist/vuetifyConfig.js +561 -0
- package/dist/vuetifyConfig.umd.cjs +1 -0
- package/package.json +10 -4
- package/src/assets/overrides/_btns.scss +0 -6
- package/src/assets/overrides/_icons.scss +9 -1
- package/src/assets/overrides/_typography.scss +0 -10
- package/src/components/Amelipro/AmeliproAutoCompleteField/__tests__/__snapshots__/AmeliproAutoCompleteField.spec.ts.snap +2 -2
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeaderBar/AmeliproHeaderBrandSection/__tests__/__snapshots__/AmeliproHeaderBrandSection.spec.ts.snap +1 -1
- package/src/components/Amelipro/AmeliproTextArea/__tests__/__snapshots__/AmeliproTextArea.spec.ts.snap +2 -2
- package/src/components/Captcha/accessibilite/Accessibility.mdx +86 -8
- package/src/components/Captcha/tests/__snapshots__/Captcha.spec.ts.snap +12 -12
- package/src/components/ChipList/ChipList.stories.ts +0 -15
- package/src/components/ChipList/ChipList.vue +5 -1
- package/src/components/ChipList/accessibilite/Accessibility.mdx +83 -10
- package/src/components/ChipList/tests/ChipList.a11y.spec.ts +41 -0
- package/src/components/Customs/Selects/SelectBtnField/accessibilite/Accessibility.mdx +0 -9
- package/src/components/Customs/Selects/SyAutocomplete/SyAutocomplete.vue +22 -5
- package/src/components/Customs/Selects/SyAutocomplete/tests/SyAutocomplete.spec.ts +143 -0
- package/src/components/Customs/Selects/SyAutocomplete/utils/ariaManager.ts +14 -10
- package/src/components/Customs/Selects/SyInputSelect/SyInputSelect.stories.ts +4 -4
- package/src/components/Customs/Selects/SyInputSelect/SyInputSelect.vue +8 -9
- package/src/components/Customs/Selects/SyInputSelect/tests/SyInputSelect.spec.ts +10 -10
- package/src/components/Customs/Selects/SySelect/SySelect.vue +14 -11
- package/src/components/Customs/Selects/SySelect/tests/SySelect.spec.ts +54 -0
- package/src/components/Customs/SyCheckBoxGroup/SyCheckBoxGroup.vue +6 -9
- package/src/components/Customs/SyCheckbox/SyCheckbox.stories.ts +10 -16
- package/src/components/Customs/SyCheckbox/SyCheckbox.vue +16 -11
- package/src/components/Customs/SyCheckbox/accessibilite/Accessibility.mdx +35 -0
- package/src/components/Customs/SyCheckbox/tests/SyCheckbox.a11y.spec.ts +134 -2
- package/src/components/Customs/SyForm/SyForm.stories.ts +31 -5
- package/src/components/Customs/SyRadioGroup/SyRadioGroup.vue +4 -7
- package/src/components/Customs/SyTextField/SyTextField.mdx +1 -1
- package/src/components/Customs/SyTextField/SyTextField.stories.ts +29 -27
- package/src/components/Customs/SyTextField/SyTextField.vue +154 -157
- package/src/components/Customs/SyTextField/tests/SyTextField.a11y.spec.ts +32 -0
- package/src/components/Customs/SyTextField/tests/SyTextField.spec.ts +120 -11
- package/src/components/DatePicker/CalendarMode/DatePicker.stories.ts +62 -58
- package/src/components/DatePicker/CalendarMode/DatePicker.vue +330 -223
- package/src/components/DatePicker/CalendarMode/accessibilite/Accessibility.mdx +82 -0
- package/src/components/DatePicker/CalendarMode/tests/DatePicker.a11y.spec.ts +141 -0
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.stories.ts +2 -56
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.vue +195 -159
- package/src/components/DatePicker/ComplexDatePicker/accessibilite/Accessibility.mdx +76 -0
- package/src/components/DatePicker/ComplexDatePicker/tests/ComplexDatePicker.spec.ts +10 -10
- package/src/components/DatePicker/DatePickerValidationExample/CalendarMode.stories.ts +8 -8
- package/src/components/DatePicker/DatePickerValidationExample/ComplexDatePicker.stories.ts +106 -8
- package/src/components/DatePicker/DatePickerValidationExample/DateTextInput.stories.ts +12 -11
- package/src/components/DatePicker/DatePickerValidationExample/MultiMode.stories.ts +12 -12
- package/src/components/DatePicker/DateTextInput/DateRange.stories.ts +0 -12
- package/src/components/DatePicker/DateTextInput/DateTextInput.vue +63 -57
- package/src/components/DatePicker/DateTextInput/NoCalendar.stories.ts +3 -0
- package/src/components/DatePicker/DateTextInput/accessibilite/Accessibility.mdx +66 -0
- package/src/components/DatePicker/DateTextInput/tests/DateTextInput.spec.ts +52 -1
- package/src/components/DatePicker/composables/index.ts +1 -0
- package/src/components/DatePicker/composables/tests/useCalendarKeyboardNavigation.spec.ts +109 -65
- package/src/components/DatePicker/composables/tests/useDatePickerFocusTrap.spec.ts +138 -0
- package/src/components/DatePicker/composables/tests/useDateValidation.spec.ts +74 -18
- package/src/components/DatePicker/composables/tests/useInputBlurHandler.spec.ts +39 -0
- package/src/components/DatePicker/composables/tests/useManualDateValidation.spec.ts +91 -0
- package/src/components/DatePicker/composables/useCalendarKeyboardNavigation.ts +442 -36
- package/src/components/DatePicker/composables/useDatePickerFocusTrap.ts +92 -0
- package/src/components/DatePicker/composables/useDateTextField.ts +7 -6
- package/src/components/DatePicker/composables/useDateValidation.ts +36 -35
- package/src/components/DatePicker/composables/useInputBlurHandler.ts +3 -3
- package/src/components/DatePicker/composables/useManualDateValidation.ts +6 -2
- package/src/components/DiacriticPicker/accessibilite/Accessibility.mdx +76 -8
- package/src/components/HeaderBar/HeaderBar.stories.ts +14 -2
- package/src/components/Logo/accessibilite/Accessibility.mdx +73 -11
- package/src/components/LogoBrandSection/accessibilite/Accessibility.mdx +85 -9
- package/src/components/LunarCalendar/tests/LunarCalendar.spec.ts +3 -1
- package/src/components/LunarCalendar/useLunarCalendarValidation.ts +4 -5
- package/src/components/MonthPicker/tests/MonthPicker.spec.ts +2 -1
- package/src/components/MonthPicker/tests/__snapshots__/MonthPicker.spec.ts.snap +7 -7
- package/src/components/NirField/NirField.stories.ts +4 -0
- package/src/components/NirField/NirField.vue +64 -260
- package/src/components/NirField/accessibilite/Accessibility.mdx +2 -2
- package/src/components/NirField/locales.ts +1 -1
- package/src/components/NirField/tests/NirField.spec.ts +6 -0
- package/src/components/NirField/useNirValidation.ts +271 -0
- package/src/components/PasswordField/PasswordField.stories.ts +4 -4
- package/src/components/PasswordField/PasswordField.vue +18 -24
- package/src/components/PasswordField/tests/PasswordField.spec.ts +6 -3
- package/src/components/PeriodField/PeriodField.stories.ts +4 -4
- package/src/components/PeriodField/PeriodField.vue +57 -57
- package/src/components/PeriodField/__tests__/PeriodField.async.spec.ts +32 -0
- package/src/components/PeriodField/accessibilite/Accessibility.mdx +68 -8
- package/src/components/PeriodField/tests/PeriodField.spec.ts +28 -2
- package/src/components/PhoneField/PhoneField.vue +5 -6
- package/src/components/PhoneField/tests/PhoneField.spec.ts +1 -0
- package/src/components/RangeField/RangeField.vue +6 -0
- package/src/components/SyTextArea/SyTextArea.stories.ts +138 -2
- package/src/components/SyTextArea/SyTextArea.vue +53 -23
- package/src/components/SyTextArea/tests/SyTextArea.spec.ts +126 -3
- package/src/components/SyTextArea/useDefaultValidationRules.ts +74 -0
- package/src/components/Tables/SyServerTable/SyServerTable.mdx +25 -0
- package/src/components/Tables/SyServerTable/SyServerTable.stories.ts +673 -1
- package/src/components/Tables/SyServerTable/SyServerTable.vue +148 -91
- package/src/components/Tables/SyServerTable/tests/SyServerTable.a11y.spec.ts +58 -0
- package/src/components/Tables/SyServerTable/tests/SyServerTable.spec.ts +122 -0
- package/src/components/Tables/SyTable/SyTable.mdx +25 -0
- package/src/components/Tables/SyTable/SyTable.stories.ts +452 -1
- package/src/components/Tables/SyTable/SyTable.vue +130 -56
- package/src/components/Tables/SyTable/tests/SyTable.a11y.spec.ts +57 -0
- package/src/components/Tables/SyTable/tests/SyTable.spec.ts +108 -0
- package/src/components/Tables/common/SyTableFilter.vue +22 -2
- package/src/components/Tables/common/TableHeader.vue +5 -1
- package/src/components/Tables/common/filters/AutocompleteFilter.vue +160 -0
- package/src/components/Tables/common/filters/NumberFilter.vue +1 -1
- package/src/components/Tables/common/filters/SelectFilter.vue +10 -11
- package/src/components/Tables/common/filters/TextFilter.vue +1 -1
- package/src/components/Tables/common/filters/getFilterComponent.ts +8 -1
- package/src/components/Tables/common/filters/locales.ts +0 -1
- package/src/components/Tables/common/filters/tests/AutocompleteFilter.a11y.spec.ts +110 -0
- package/src/components/Tables/common/filters/tests/AutocompleteFilter.spec.ts +203 -0
- package/src/components/Tables/common/filters/tests/SelectFilter.a11y.spec.ts +104 -0
- package/src/components/Tables/common/filters/tests/SelectFilter.spec.ts +152 -16
- package/src/components/Tables/common/tableFilterUtils.ts +3 -0
- package/src/components/Tables/common/tableStyles.scss +48 -4
- package/src/components/Tables/common/tests/filterByRange.spec.ts +2 -1
- package/src/components/Tables/common/types.ts +13 -4
- package/src/components/Tables/common/useClickableTableRow.ts +103 -0
- package/src/components/Tables/common/usePagination.ts +13 -0
- package/src/components/Tables/common/usePinnedColumns.ts +237 -0
- package/src/components/Tables/common/useTableHeaders.ts +3 -3
- package/src/components/Tables/common/useTableRowCheckboxAccessibility.ts +41 -0
- package/src/composables/date/tests/useDatePickerAccessibility.spec.ts +2 -6
- package/src/composables/date/useDatePickerAccessibility.ts +42 -207
- package/src/composables/rules/tests/useFieldValidation.spec.ts +120 -120
- package/src/composables/rules/useFieldValidation.ts +34 -17
- package/src/composables/unifyValidation/tests/useCustomValidation.spec.ts +601 -0
- package/src/composables/unifyValidation/tests/useValidation.spec.ts +2048 -0
- package/src/composables/unifyValidation/tests/useVuetifyValidation.spec.ts +184 -0
- package/src/composables/unifyValidation/useCustomValidation.ts +95 -0
- package/src/composables/unifyValidation/useValidation.ts +190 -0
- package/src/composables/unifyValidation/useVuetifyValidation.ts +54 -0
- package/src/composables/useFormFieldErrorHandling.ts +4 -7
- package/src/composables/validation/tests/useFormValidation.spec.ts +14 -0
- package/src/composables/validation/tests/useValidation.spec.ts +116 -21
- package/src/composables/validation/useFormValidation.ts +20 -13
- package/src/composables/validation/useValidatable.ts +8 -1
- package/src/composables/validation/useValidation.ts +135 -99
- package/src/composantsVuetify/Introduction.mdx +48 -0
- package/src/composantsVuetify/VBtn/VBtn.mdx +72 -0
- package/src/composantsVuetify/VBtn/v-btn.stories.ts +121 -0
- package/src/composantsVuetify/VTooltip/VTooltip.mdx +32 -0
- package/src/composantsVuetify/VTooltip/v-tooltip.stories.ts +95 -0
- package/src/designTokens/tokens/cnam/cnamSemantic.ts +2 -2
- package/src/main.ts +0 -2
- package/src/stories/Components/Components.stories.ts +74 -9
- package/src/stories/Demarrer/Accueil.stories.ts +3 -3
- package/src/stories/GuideDuDev/Amelipro.mdx +15 -0
- package/src/stories/GuideDuDev/Amelipro.stories.ts +209 -0
- package/src/stories/GuideDuDev/vuetifyOptions.mdx +3 -3
- package/dist/SelectFilter-BioGT6Nn.js +0 -136
- package/dist/style.css +0 -1
- package/src/components/DatePicker/Accessibilite.mdx +0 -14
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
2
|
import { fn } from '@storybook/test'
|
|
3
|
-
import { ref } from 'vue'
|
|
3
|
+
import { computed, defineComponent, ref } from 'vue'
|
|
4
4
|
import SyTable from './SyTable.vue'
|
|
5
5
|
import type { DataOptions, FilterType } from '../common/types'
|
|
6
6
|
import type { VDataTable } from 'vuetify/components'
|
|
@@ -156,6 +156,35 @@ const meta = {
|
|
|
156
156
|
type: { summary: 'boolean' },
|
|
157
157
|
},
|
|
158
158
|
},
|
|
159
|
+
'stickySelect': {
|
|
160
|
+
description: 'Rend la colonne de sélection (cases à cocher) sticky à gauche quand showSelect ou showSelectSingle est activé.',
|
|
161
|
+
control: { type: 'boolean' },
|
|
162
|
+
table: {
|
|
163
|
+
category: 'props',
|
|
164
|
+
type: { summary: 'boolean' },
|
|
165
|
+
defaultValue: {
|
|
166
|
+
summary: 'false',
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
'pinnedColumns': {
|
|
171
|
+
description: 'Liste des colonnes à épingler (sticky). Chaque entrée peut être une clé de colonne (string) ou un objet `{ key: string, side?: \'left\' | \'right\' }`. Par défaut, les colonnes sont épinglées à gauche.',
|
|
172
|
+
control: { type: 'object' },
|
|
173
|
+
table: {
|
|
174
|
+
category: 'props',
|
|
175
|
+
type: { summary: 'Array<string | { key: string, side?: \'left\' | \'right\' }>' },
|
|
176
|
+
defaultValue: { summary: 'undefined' },
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
'pinnedColumnKey': {
|
|
180
|
+
description: 'Raccourci pour épingler une seule colonne à gauche. Équivalent à `pinnedColumns: [key]`. Ignoré si `pinnedColumns` est défini.',
|
|
181
|
+
control: { type: 'text' },
|
|
182
|
+
table: {
|
|
183
|
+
category: 'props',
|
|
184
|
+
type: { summary: 'string' },
|
|
185
|
+
defaultValue: { summary: 'undefined' },
|
|
186
|
+
},
|
|
187
|
+
},
|
|
159
188
|
'selectionKey': {
|
|
160
189
|
description: 'Clé utilisée pour identifier chaque ligne lors de la sélection. Par défaut, utilise "id" si présent, sinon l\'objet complet.',
|
|
161
190
|
control: { type: 'text' },
|
|
@@ -165,6 +194,15 @@ const meta = {
|
|
|
165
194
|
defaultValue: { summary: 'undefined (fallback: id | objet complet)' },
|
|
166
195
|
},
|
|
167
196
|
},
|
|
197
|
+
'clickableRow': {
|
|
198
|
+
description: 'Rend chaque ligne cliquable. Quand cette prop est activée, la ligne devient focusable au clavier et émet `row-click` sur clic, `Entrée` ou `Espace`, sans interférer avec les éléments interactifs imbriqués.',
|
|
199
|
+
control: { type: 'boolean' },
|
|
200
|
+
table: {
|
|
201
|
+
category: 'props',
|
|
202
|
+
type: { summary: 'boolean' },
|
|
203
|
+
defaultValue: { summary: 'false' },
|
|
204
|
+
},
|
|
205
|
+
},
|
|
168
206
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
169
207
|
// @ts-ignore - 'cookie-description-${cookieName}' storybook can't infer dynamic slot name
|
|
170
208
|
'header.<columnKey>': {
|
|
@@ -186,6 +224,13 @@ const meta = {
|
|
|
186
224
|
},
|
|
187
225
|
},
|
|
188
226
|
},
|
|
227
|
+
'onRow-click': {
|
|
228
|
+
description: 'Émis lorsqu\'une ligne est activée alors que `clickableRow` est à `true`. Reçoit l\'objet de la ligne en paramètre. Les interactions avec des éléments déjà interactifs dans la ligne ne déclenchent pas cet événement.',
|
|
229
|
+
table: {
|
|
230
|
+
category: 'events',
|
|
231
|
+
type: { summary: '(item: Record<string, unknown>) => void' },
|
|
232
|
+
},
|
|
233
|
+
},
|
|
189
234
|
},
|
|
190
235
|
} satisfies Meta<typeof SyTable & typeof VDataTable>
|
|
191
236
|
|
|
@@ -1129,6 +1174,8 @@ export const FilterBySelect: Story = {
|
|
|
1129
1174
|
key: 'department',
|
|
1130
1175
|
filterable: true,
|
|
1131
1176
|
filterType: 'select',
|
|
1177
|
+
multiple: false,
|
|
1178
|
+
chips: false,
|
|
1132
1179
|
hideMessages: true,
|
|
1133
1180
|
filterOptions: [
|
|
1134
1181
|
{ text: 'RH', value: 'RH' },
|
|
@@ -1142,6 +1189,8 @@ export const FilterBySelect: Story = {
|
|
|
1142
1189
|
key: 'status',
|
|
1143
1190
|
filterable: true,
|
|
1144
1191
|
filterType: 'select',
|
|
1192
|
+
multiple: false,
|
|
1193
|
+
chips: false,
|
|
1145
1194
|
hideMessages: true,
|
|
1146
1195
|
filterOptions: [
|
|
1147
1196
|
{ text: 'Actif', value: 'Actif' },
|
|
@@ -1196,6 +1245,8 @@ export const FilterBySelect: Story = {
|
|
|
1196
1245
|
key: 'department',
|
|
1197
1246
|
filterable: true,
|
|
1198
1247
|
filterType: 'select',
|
|
1248
|
+
multiple: false,
|
|
1249
|
+
chips: false,
|
|
1199
1250
|
hideMessages: true,
|
|
1200
1251
|
filterOptions: [
|
|
1201
1252
|
{ text: 'RH', value: 'RH' },
|
|
@@ -1209,6 +1260,8 @@ export const FilterBySelect: Story = {
|
|
|
1209
1260
|
key: 'status',
|
|
1210
1261
|
filterable: true,
|
|
1211
1262
|
filterType: 'select',
|
|
1263
|
+
multiple: false,
|
|
1264
|
+
chips: false,
|
|
1212
1265
|
hideMessages: true,
|
|
1213
1266
|
filterOptions: [
|
|
1214
1267
|
{ text: 'Actif', value: 'Actif' },
|
|
@@ -1483,6 +1536,160 @@ export const FilterBySelectMultiple: Story = {
|
|
|
1483
1536
|
},
|
|
1484
1537
|
}
|
|
1485
1538
|
|
|
1539
|
+
export const FilterByAutocomplete: Story = {
|
|
1540
|
+
parameters: {
|
|
1541
|
+
a11y: {
|
|
1542
|
+
disable: true,
|
|
1543
|
+
},
|
|
1544
|
+
sourceCode: [
|
|
1545
|
+
{
|
|
1546
|
+
name: 'Template',
|
|
1547
|
+
code: `
|
|
1548
|
+
<template>
|
|
1549
|
+
<SyTable
|
|
1550
|
+
v-model:options="options"
|
|
1551
|
+
:headers="headers"
|
|
1552
|
+
:items="items"
|
|
1553
|
+
show-filters
|
|
1554
|
+
suffix="filter-autocomplete-table"
|
|
1555
|
+
/>
|
|
1556
|
+
</template>
|
|
1557
|
+
`,
|
|
1558
|
+
},
|
|
1559
|
+
{
|
|
1560
|
+
name: 'Script',
|
|
1561
|
+
code: `
|
|
1562
|
+
<script setup lang="ts">
|
|
1563
|
+
import { ref } from 'vue'
|
|
1564
|
+
import { SyTable } from '@cnamts/synapse'
|
|
1565
|
+
|
|
1566
|
+
const options = ref({
|
|
1567
|
+
itemsPerPage: 5,
|
|
1568
|
+
filters: []
|
|
1569
|
+
})
|
|
1570
|
+
|
|
1571
|
+
const headers = ref([
|
|
1572
|
+
{
|
|
1573
|
+
title: 'Nom',
|
|
1574
|
+
key: 'name',
|
|
1575
|
+
filterable: true,
|
|
1576
|
+
filterType: 'text'
|
|
1577
|
+
},
|
|
1578
|
+
{
|
|
1579
|
+
title: 'Département',
|
|
1580
|
+
key: 'department',
|
|
1581
|
+
filterable: true,
|
|
1582
|
+
filterType: 'autocomplete',
|
|
1583
|
+
filterOptions: [
|
|
1584
|
+
{ text: 'RH', value: 'RH' },
|
|
1585
|
+
{ text: 'IT', value: 'IT' },
|
|
1586
|
+
{ text: 'Finance', value: 'Finance' },
|
|
1587
|
+
{ text: 'Marketing', value: 'Marketing' },
|
|
1588
|
+
]
|
|
1589
|
+
},
|
|
1590
|
+
{
|
|
1591
|
+
title: 'Statut',
|
|
1592
|
+
key: 'status',
|
|
1593
|
+
filterable: true,
|
|
1594
|
+
filterType: 'autocomplete',
|
|
1595
|
+
multiple: true,
|
|
1596
|
+
chips: true,
|
|
1597
|
+
filterOptions: [
|
|
1598
|
+
{ text: 'Actif', value: 'Actif' },
|
|
1599
|
+
{ text: 'En congé', value: 'En congé' },
|
|
1600
|
+
{ text: 'Inactif', value: 'Inactif' },
|
|
1601
|
+
]
|
|
1602
|
+
},
|
|
1603
|
+
])
|
|
1604
|
+
|
|
1605
|
+
const items = ref([
|
|
1606
|
+
{ name: 'Jean Dupont', department: 'RH', status: 'Actif' },
|
|
1607
|
+
{ name: 'Marie Martin', department: 'IT', status: 'En congé' },
|
|
1608
|
+
{ name: 'Pierre Durand', department: 'Finance', status: 'Actif' },
|
|
1609
|
+
{ name: 'Sophie Petit', department: 'Marketing', status: 'Actif' },
|
|
1610
|
+
{ name: 'Thomas Leroy', department: 'IT', status: 'Inactif' },
|
|
1611
|
+
])
|
|
1612
|
+
</script>
|
|
1613
|
+
`,
|
|
1614
|
+
},
|
|
1615
|
+
],
|
|
1616
|
+
},
|
|
1617
|
+
args: {
|
|
1618
|
+
'headers': [
|
|
1619
|
+
{
|
|
1620
|
+
title: 'Nom',
|
|
1621
|
+
key: 'name',
|
|
1622
|
+
filterable: true,
|
|
1623
|
+
filterType: 'text',
|
|
1624
|
+
},
|
|
1625
|
+
{
|
|
1626
|
+
title: 'Département',
|
|
1627
|
+
key: 'department',
|
|
1628
|
+
filterable: true,
|
|
1629
|
+
filterType: 'autocomplete',
|
|
1630
|
+
filterOptions: [
|
|
1631
|
+
{ text: 'RH', value: 'RH' },
|
|
1632
|
+
{ text: 'IT', value: 'IT' },
|
|
1633
|
+
{ text: 'Finance', value: 'Finance' },
|
|
1634
|
+
{ text: 'Marketing', value: 'Marketing' },
|
|
1635
|
+
],
|
|
1636
|
+
},
|
|
1637
|
+
{
|
|
1638
|
+
title: 'Statut',
|
|
1639
|
+
key: 'status',
|
|
1640
|
+
filterable: true,
|
|
1641
|
+
filterType: 'autocomplete',
|
|
1642
|
+
multiple: true,
|
|
1643
|
+
chips: true,
|
|
1644
|
+
filterOptions: [
|
|
1645
|
+
{ text: 'Actif', value: 'Actif' },
|
|
1646
|
+
{ text: 'En congé', value: 'En congé' },
|
|
1647
|
+
{ text: 'Inactif', value: 'Inactif' },
|
|
1648
|
+
],
|
|
1649
|
+
},
|
|
1650
|
+
],
|
|
1651
|
+
'items': [
|
|
1652
|
+
{ name: 'Jean Dupont', department: 'RH', status: 'Actif' },
|
|
1653
|
+
{ name: 'Marie Martin', department: 'IT', status: 'En congé' },
|
|
1654
|
+
{ name: 'Pierre Durand', department: 'Finance', status: 'Actif' },
|
|
1655
|
+
{ name: 'Sophie Petit', department: 'Marketing', status: 'Actif' },
|
|
1656
|
+
{ name: 'Thomas Leroy', department: 'IT', status: 'Inactif' },
|
|
1657
|
+
],
|
|
1658
|
+
'caption': '',
|
|
1659
|
+
'options': {
|
|
1660
|
+
itemsPerPage: 5,
|
|
1661
|
+
filters: [],
|
|
1662
|
+
},
|
|
1663
|
+
'showFilters': true,
|
|
1664
|
+
'suffix': 'filter-autocomplete-table',
|
|
1665
|
+
'density': 'default',
|
|
1666
|
+
'striped': false,
|
|
1667
|
+
'onUpdate:options': fn(),
|
|
1668
|
+
},
|
|
1669
|
+
render: (args) => {
|
|
1670
|
+
return {
|
|
1671
|
+
components: { SyTable },
|
|
1672
|
+
setup() {
|
|
1673
|
+
const options = ref(args.options)
|
|
1674
|
+
const items = ref(args.items)
|
|
1675
|
+
|
|
1676
|
+
return {
|
|
1677
|
+
args,
|
|
1678
|
+
options,
|
|
1679
|
+
items,
|
|
1680
|
+
}
|
|
1681
|
+
},
|
|
1682
|
+
template: `
|
|
1683
|
+
<SyTable
|
|
1684
|
+
v-model:options="args.options"
|
|
1685
|
+
v-bind="args"
|
|
1686
|
+
suffix="filter-autocomplete-table"
|
|
1687
|
+
/>
|
|
1688
|
+
`,
|
|
1689
|
+
}
|
|
1690
|
+
},
|
|
1691
|
+
}
|
|
1692
|
+
|
|
1486
1693
|
export const FilterByExactDate: Story = {
|
|
1487
1694
|
parameters: {
|
|
1488
1695
|
a11y: {
|
|
@@ -2770,6 +2977,130 @@ export const ResizableColumns: Story = {
|
|
|
2770
2977
|
},
|
|
2771
2978
|
}
|
|
2772
2979
|
|
|
2980
|
+
export const ClickableRow: Story = {
|
|
2981
|
+
parameters: {
|
|
2982
|
+
a11y: {
|
|
2983
|
+
disable: true,
|
|
2984
|
+
},
|
|
2985
|
+
sourceCode: [
|
|
2986
|
+
{
|
|
2987
|
+
name: 'Template',
|
|
2988
|
+
code: `
|
|
2989
|
+
<template>
|
|
2990
|
+
<div>
|
|
2991
|
+
<SyTable
|
|
2992
|
+
v-model:options="options"
|
|
2993
|
+
:headers="headers"
|
|
2994
|
+
:items="items"
|
|
2995
|
+
clickable-row
|
|
2996
|
+
suffix="clickable-row-table"
|
|
2997
|
+
@row-click="selectedRow = $event"
|
|
2998
|
+
/>
|
|
2999
|
+
<div v-if="selectedRow" class="mt-4 pa-4 bg-grey-lighten-4">
|
|
3000
|
+
<h3 class="text-h6 mb-3">Ligne cliquée</h3>
|
|
3001
|
+
<div class="pa-2 bg-grey-lighten-3">
|
|
3002
|
+
<div><strong>Nom:</strong> {{ selectedRow.lastname }}</div>
|
|
3003
|
+
<div><strong>Prénom:</strong> {{ selectedRow.firstname }}</div>
|
|
3004
|
+
<div><strong>Email:</strong> {{ selectedRow.email }}</div>
|
|
3005
|
+
</div>
|
|
3006
|
+
</div>
|
|
3007
|
+
</div>
|
|
3008
|
+
</template>
|
|
3009
|
+
`,
|
|
3010
|
+
},
|
|
3011
|
+
{
|
|
3012
|
+
name: 'Script',
|
|
3013
|
+
code: `
|
|
3014
|
+
<script setup lang="ts">
|
|
3015
|
+
import { ref } from 'vue'
|
|
3016
|
+
import { SyTable } from '@cnamts/synapse'
|
|
3017
|
+
|
|
3018
|
+
const options = ref({ itemsPerPage: 5, filters: [] })
|
|
3019
|
+
const selectedRow = ref(null)
|
|
3020
|
+
|
|
3021
|
+
const headers = [
|
|
3022
|
+
{ title: 'Nom', key: 'lastname' },
|
|
3023
|
+
{ title: 'Prénom', key: 'firstname' },
|
|
3024
|
+
{ title: 'Email', key: 'email' },
|
|
3025
|
+
]
|
|
3026
|
+
|
|
3027
|
+
const items = [
|
|
3028
|
+
{ firstname: 'Virginie', lastname: 'Beauchesne', email: 'virginie.beauchesne@example.com' },
|
|
3029
|
+
{ firstname: 'Étienne', lastname: 'Salois', email: 'etienne.salois@example.com' },
|
|
3030
|
+
{ firstname: 'Alice', lastname: 'Dupont', email: 'alice.dupont@example.com' },
|
|
3031
|
+
{ firstname: 'Marc', lastname: 'Lefevre', email: 'marc.lefevre@example.com' },
|
|
3032
|
+
]
|
|
3033
|
+
</script>
|
|
3034
|
+
`,
|
|
3035
|
+
},
|
|
3036
|
+
],
|
|
3037
|
+
},
|
|
3038
|
+
args: {
|
|
3039
|
+
'headers': [
|
|
3040
|
+
{ title: 'Nom', key: 'lastname' },
|
|
3041
|
+
{ title: 'Prénom', key: 'firstname' },
|
|
3042
|
+
{ title: 'Email', key: 'email' },
|
|
3043
|
+
],
|
|
3044
|
+
'items': [
|
|
3045
|
+
{ firstname: 'Virginie', lastname: 'Beauchesne', email: 'virginie.beauchesne@example.com' },
|
|
3046
|
+
{ firstname: 'Étienne', lastname: 'Salois', email: 'etienne.salois@example.com' },
|
|
3047
|
+
{ firstname: 'Alice', lastname: 'Dupont', email: 'alice.dupont@example.com' },
|
|
3048
|
+
{ firstname: 'Marc', lastname: 'Lefevre', email: 'marc.lefevre@example.com' },
|
|
3049
|
+
],
|
|
3050
|
+
'options': { itemsPerPage: 5, filters: [] },
|
|
3051
|
+
'clickableRow': true,
|
|
3052
|
+
'suffix': 'clickable-row-table',
|
|
3053
|
+
'density': 'default',
|
|
3054
|
+
'striped': false,
|
|
3055
|
+
'onUpdate:options': fn(),
|
|
3056
|
+
'onRow-click': fn(),
|
|
3057
|
+
},
|
|
3058
|
+
render: (args) => {
|
|
3059
|
+
return {
|
|
3060
|
+
components: {
|
|
3061
|
+
ClickableRowTableCanvas: defineComponent({
|
|
3062
|
+
components: { SyTable },
|
|
3063
|
+
emits: ['row-click'],
|
|
3064
|
+
setup() {
|
|
3065
|
+
const boundArgs = computed(() => {
|
|
3066
|
+
return Object.fromEntries(Object.entries(args).filter(([key]) => key !== 'onRow-click'))
|
|
3067
|
+
})
|
|
3068
|
+
|
|
3069
|
+
return { args, boundArgs }
|
|
3070
|
+
},
|
|
3071
|
+
template: `
|
|
3072
|
+
<SyTable
|
|
3073
|
+
v-model:options="args.options"
|
|
3074
|
+
v-bind="boundArgs"
|
|
3075
|
+
@row-click="$emit('row-click', $event)"
|
|
3076
|
+
/>
|
|
3077
|
+
`,
|
|
3078
|
+
}),
|
|
3079
|
+
},
|
|
3080
|
+
setup() {
|
|
3081
|
+
const selectedRow = ref<Record<string, unknown> | null>(null)
|
|
3082
|
+
const handleRowClick = (item: Record<string, unknown>) => {
|
|
3083
|
+
selectedRow.value = item
|
|
3084
|
+
args['onRow-click']?.(item)
|
|
3085
|
+
}
|
|
3086
|
+
return { selectedRow, handleRowClick }
|
|
3087
|
+
},
|
|
3088
|
+
template: `
|
|
3089
|
+
<div>
|
|
3090
|
+
<ClickableRowTableCanvas @row-click="handleRowClick" />
|
|
3091
|
+
<div v-if="selectedRow" class="mt-4 pa-4 bg-grey-lighten-4">
|
|
3092
|
+
<h3 class="text-h6 mb-3">Ligne cliquée</h3>
|
|
3093
|
+
<div class="pa-2 bg-grey-lighten-3">
|
|
3094
|
+
<div><strong>Nom:</strong> {{ selectedRow.lastname }}</div>
|
|
3095
|
+
<div><strong>Prénom:</strong> {{ selectedRow.firstname }}</div>
|
|
3096
|
+
<div><strong>Email:</strong> {{ selectedRow.email }}</div>
|
|
3097
|
+
</div>
|
|
3098
|
+
</div>
|
|
3099
|
+
</div>
|
|
3100
|
+
`,
|
|
3101
|
+
}
|
|
3102
|
+
},
|
|
3103
|
+
}
|
|
2773
3104
|
export const RowSelection: Story = {
|
|
2774
3105
|
name: 'Row Selection',
|
|
2775
3106
|
parameters: {
|
|
@@ -3132,6 +3463,126 @@ export const SingleRowSelection: Story = {
|
|
|
3132
3463
|
},
|
|
3133
3464
|
}
|
|
3134
3465
|
|
|
3466
|
+
export const PinnedColumns: Story = {
|
|
3467
|
+
parameters: {
|
|
3468
|
+
a11y: {
|
|
3469
|
+
disable: true,
|
|
3470
|
+
},
|
|
3471
|
+
sourceCode: [
|
|
3472
|
+
{
|
|
3473
|
+
name: 'Template',
|
|
3474
|
+
code: `
|
|
3475
|
+
<template>
|
|
3476
|
+
<div style="max-width: 900px; overflow: auto;">
|
|
3477
|
+
<SyTable
|
|
3478
|
+
v-model:options="options"
|
|
3479
|
+
:headers="headers"
|
|
3480
|
+
:items="items"
|
|
3481
|
+
show-select
|
|
3482
|
+
sticky-select
|
|
3483
|
+
:pinned-columns="pinnedColumns"
|
|
3484
|
+
suffix="pinned-columns-table"
|
|
3485
|
+
/>
|
|
3486
|
+
</div>
|
|
3487
|
+
</template>
|
|
3488
|
+
`,
|
|
3489
|
+
},
|
|
3490
|
+
{
|
|
3491
|
+
name: 'Script',
|
|
3492
|
+
code: `
|
|
3493
|
+
<script setup lang="ts">
|
|
3494
|
+
import { ref } from 'vue'
|
|
3495
|
+
import { SyTable } from '@cnamts/synapse'
|
|
3496
|
+
import dayjs from 'dayjs'
|
|
3497
|
+
|
|
3498
|
+
const options = ref({ itemsPerPage: 5 })
|
|
3499
|
+
const headers = ref([
|
|
3500
|
+
{ title: 'ID', key: 'id', width: 80 },
|
|
3501
|
+
{ title: 'Nom', key: 'lastname', width: 160 },
|
|
3502
|
+
{ title: 'Prénom', key: 'firstname', width: 160 },
|
|
3503
|
+
{ title: 'Email', key: 'email', width: 240 },
|
|
3504
|
+
{ title: 'Ville', key: 'city', width: 160 },
|
|
3505
|
+
{ title: 'Pays', key: 'country', width: 160 },
|
|
3506
|
+
{ title: 'Téléphone', key: 'phone', width: 180 },
|
|
3507
|
+
{ title: 'Statut', key: 'status', width: 140 },
|
|
3508
|
+
{ title: 'Dernière connexion', key: 'lastLogin', width: 200 },
|
|
3509
|
+
{ title: 'Actions', key: 'actions', width: 140 },
|
|
3510
|
+
])
|
|
3511
|
+
const items = ref(Array.from({ length: 12 }).map((_, i) => ({
|
|
3512
|
+
id: i + 1,
|
|
3513
|
+
lastname: 'Nom ' + (i + 1),
|
|
3514
|
+
firstname: 'Prénom ' + (i + 1),
|
|
3515
|
+
email: 'user' + (i + 1) + '@example.com',
|
|
3516
|
+
city: 'Paris',
|
|
3517
|
+
country: 'France',
|
|
3518
|
+
phone: '01 02 03 04 05',
|
|
3519
|
+
status: i % 2 === 0 ? 'Actif' : 'Inactif',
|
|
3520
|
+
lastLogin: dayjs().subtract(i, 'day').format('DD/MM/YYYY'),
|
|
3521
|
+
actions: '…',
|
|
3522
|
+
})))
|
|
3523
|
+
const pinnedColumns = ref([
|
|
3524
|
+
{ key: 'actions', side: 'right' },
|
|
3525
|
+
])
|
|
3526
|
+
</script>
|
|
3527
|
+
`,
|
|
3528
|
+
},
|
|
3529
|
+
],
|
|
3530
|
+
},
|
|
3531
|
+
args: {
|
|
3532
|
+
'headers': [
|
|
3533
|
+
{ title: 'ID', key: 'id', width: 80 },
|
|
3534
|
+
{ title: 'Nom', key: 'lastname', width: 160 },
|
|
3535
|
+
{ title: 'Prénom', key: 'firstname', width: 160 },
|
|
3536
|
+
{ title: 'Email', key: 'email', width: 240 },
|
|
3537
|
+
{ title: 'Ville', key: 'city', width: 160 },
|
|
3538
|
+
{ title: 'Pays', key: 'country', width: 160 },
|
|
3539
|
+
{ title: 'Téléphone', key: 'phone', width: 180 },
|
|
3540
|
+
{ title: 'Statut', key: 'status', width: 140 },
|
|
3541
|
+
{ title: 'Dernière connexion', key: 'lastLogin', width: 200 },
|
|
3542
|
+
{ title: 'Actions', key: 'actions', width: 140 },
|
|
3543
|
+
],
|
|
3544
|
+
'items': Array.from({ length: 12 }).map((_, i) => ({
|
|
3545
|
+
id: i + 1,
|
|
3546
|
+
lastname: 'Nom ' + (i + 1),
|
|
3547
|
+
firstname: 'Prénom ' + (i + 1),
|
|
3548
|
+
email: 'user' + (i + 1) + '@example.com',
|
|
3549
|
+
city: 'Paris',
|
|
3550
|
+
country: 'France',
|
|
3551
|
+
phone: '01 02 03 04 05',
|
|
3552
|
+
status: i % 2 === 0 ? 'Actif' : 'Inactif',
|
|
3553
|
+
lastLogin: dayjs().subtract(i, 'day').format('DD/MM/YYYY'),
|
|
3554
|
+
actions: '…',
|
|
3555
|
+
})),
|
|
3556
|
+
'options': {
|
|
3557
|
+
itemsPerPage: 5,
|
|
3558
|
+
},
|
|
3559
|
+
'suffix': 'pinned-columns-table',
|
|
3560
|
+
'showSelect': true,
|
|
3561
|
+
'stickySelect': true,
|
|
3562
|
+
'pinnedColumns': [
|
|
3563
|
+
{ key: 'actions', side: 'right' },
|
|
3564
|
+
],
|
|
3565
|
+
'onUpdate:options': fn(),
|
|
3566
|
+
},
|
|
3567
|
+
render: (args) => {
|
|
3568
|
+
return {
|
|
3569
|
+
components: { SyTable },
|
|
3570
|
+
setup() {
|
|
3571
|
+
return { args }
|
|
3572
|
+
},
|
|
3573
|
+
template: `
|
|
3574
|
+
<div style="max-width: 900px; overflow: auto;">
|
|
3575
|
+
<SyTable
|
|
3576
|
+
v-model:options="args.options"
|
|
3577
|
+
v-bind="args"
|
|
3578
|
+
suffix="pinned-columns-table"
|
|
3579
|
+
/>
|
|
3580
|
+
</div>
|
|
3581
|
+
`,
|
|
3582
|
+
}
|
|
3583
|
+
},
|
|
3584
|
+
}
|
|
3585
|
+
|
|
3135
3586
|
export const ColumnControls: Story = {
|
|
3136
3587
|
parameters: {
|
|
3137
3588
|
a11y: {
|