@cnamts/synapse 1.0.6 → 1.0.8
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/{DateFilter-BlOpwEVq.js → DateFilter-DkqG0pmr.js} +1 -1
- package/dist/{NumberFilter-BPUXE4wY.js → NumberFilter-Ck7AwD39.js} +1 -1
- package/dist/{PeriodFilter-B2yx329_.js → PeriodFilter-LRI6YpgU.js} +1 -1
- package/dist/{SelectFilter-CedKn1oV.js → SelectFilter-DPc70Jk7.js} +1 -1
- package/dist/{TextFilter-DkhJjRtR.js → TextFilter-DRQL7uD8.js} +1 -1
- package/dist/components/Amelipro/AmeliproAccordionGroup/AmeliproAccordionGroup.d.ts +116 -0
- package/dist/components/Amelipro/AmeliproAccordionGroup/types.d.ts +4 -0
- package/dist/components/Amelipro/AmeliproAccordionList/AmeliproAccordionList.d.ts +220 -0
- package/dist/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResult.d.ts +68 -0
- package/dist/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResultTemplate/AmeliproAccordionResultTemplate.d.ts +70 -0
- package/dist/components/Amelipro/AmeliproAccordionResultList/AmeliproAccordionResultList.d.ts +204 -0
- package/dist/components/Amelipro/AmeliproAutoCompleteField/AmeliproAutoCompleteField.d.ts +26 -26
- package/dist/components/Amelipro/AmeliproBadge/AmeliproBadge.d.ts +59 -0
- package/dist/components/Amelipro/AmeliproBtn/AmeliproBtn.d.ts +3 -3
- package/dist/components/Amelipro/AmeliproCaptcha/AmeliproCaptcha.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproCarousel/AmeliproCarousel.d.ts +214 -0
- package/dist/components/Amelipro/AmeliproCarousel/AmeliproCarouselItem/AmeliproCarouselItem.d.ts +70 -0
- package/dist/components/Amelipro/AmeliproCarousel/types.d.ts +7 -0
- package/dist/components/Amelipro/AmeliproClickableTile/AmeliproClickableTile.d.ts +125 -0
- package/dist/components/Amelipro/AmeliproIconBtn/AmeliproIconBtn.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproIllustratedDataTile/AmeliproIllustratedDataTile.d.ts +2 -2
- package/dist/components/Amelipro/AmeliproResultList/AmeliproResultList.d.ts +164 -0
- package/dist/components/Amelipro/AmeliproSelect/AmeliproSelect.d.ts +27 -27
- package/dist/components/Amelipro/AmeliproStateTile/AmeliproStateTile.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproTable/AmeliproTable.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproTabs/AmeliproTabs.d.ts +32 -32
- package/dist/components/Amelipro/AmeliproTextArea/AmeliproTextArea.d.ts +6 -6
- package/dist/components/Amelipro/AmeliproTextField/AmeliproTextField.d.ts +7 -7
- package/dist/components/Amelipro/AmeliproTileBtn/AmeliproTileBtn.d.ts +1 -1
- package/dist/components/Amelipro/AmeliproTooltips/AmeliproTooltips.d.ts +2 -2
- package/dist/components/ChipList/ChipList.d.ts +4 -0
- package/dist/components/ChipList/locales.d.ts +4 -2
- package/dist/components/CookiesSelection/CookiesInformation/CookiesInformation.d.ts +8 -8
- package/dist/components/Customs/Selects/SySelect/SySelect.d.ts +329 -1296
- package/dist/components/Customs/Selects/SySelect/composables/useSySelectKeyboard.d.ts +0 -1
- package/dist/components/Customs/SyCheckbox/SyCheckbox.d.ts +2 -0
- package/dist/components/Customs/SyTabs/SyTabs.d.ts +71 -0
- package/dist/components/Customs/SyTabs/config.d.ts +17 -0
- package/dist/components/Customs/SyTabs/types.d.ts +11 -0
- package/dist/components/Customs/SyTextField/SyTextField.d.ts +9 -9
- package/dist/components/DataList/DataList.d.ts +1 -1
- package/dist/components/DatePicker/CalendarMode/DatePicker.d.ts +4811 -240
- package/dist/components/DatePicker/ComplexDatePicker/ComplexDatePicker.d.ts +52 -33
- package/dist/components/DatePicker/DateTextInput/DateTextInput.d.ts +23 -10
- package/dist/components/DatePicker/composables/useDateInputEditing.d.ts +1 -0
- package/dist/components/DatePicker/composables/useTodayButton.d.ts +1 -0
- package/dist/components/DialogBox/DialogBox.d.ts +219 -0
- package/dist/components/HeaderLoading/HeaderLoading.d.ts +27 -0
- package/dist/components/HeaderNavigationBar/HeaderNavigationBar.d.ts +110 -3
- package/dist/components/HeaderNavigationBar/HorizontalNavbar/HorizontalNavbar.d.ts +19 -1
- package/dist/components/LangBtn/LangBtn.d.ts +2 -2
- package/dist/components/NirField/NirField.d.ts +18 -18
- package/dist/components/PeriodField/PeriodField.d.ts +10766 -1620
- package/dist/components/PhoneField/PhoneField.d.ts +1866 -2
- package/dist/components/PhoneField/indicatifs.d.ts +1 -0
- package/dist/components/PhoneField/locales.d.ts +1 -0
- package/dist/components/RangeField/RangeField.d.ts +1 -1
- package/dist/components/RangeField/RangeSlider/RangeSlider.d.ts +1 -1
- package/dist/components/SubHeader/SubHeader.d.ts +8 -0
- package/dist/components/SubHeader/locales.d.ts +1 -0
- package/dist/components/SyTextArea/SyTextArea.d.ts +6 -6
- package/dist/components/Tables/SyServerTable/SyServerTable.d.ts +5 -4
- package/dist/components/Tables/SyTable/SyTable.d.ts +5 -4
- package/dist/components/Tables/common/SyTablePagination.d.ts +333 -1296
- package/dist/components/Tables/common/organizeColumns/OrganizeColumns.d.ts +2 -2
- package/dist/components/Tables/common/types.d.ts +2 -0
- package/dist/components/index.d.ts +9 -0
- package/dist/design-system-v3.js +173 -164
- package/dist/design-system-v3.umd.cjs +286 -263
- package/dist/{main-BXPFSAB4.js → main-DXMoMtj5.js} +13176 -11457
- package/dist/services/NotificationService.d.ts +1 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/assets/amelipro/icons.ts +38 -11
- package/src/components/Amelipro/AmeliproAccordionGroup/AmeliproAccordionGroup.mdx +20 -0
- package/src/components/Amelipro/AmeliproAccordionGroup/AmeliproAccordionGroup.stories.ts +135 -0
- package/src/components/Amelipro/AmeliproAccordionGroup/AmeliproAccordionGroup.vue +107 -0
- package/src/components/Amelipro/AmeliproAccordionGroup/__tests__/AmeliproAccordionGroup.spec.ts +37 -0
- package/src/components/Amelipro/AmeliproAccordionGroup/__tests__/__snapshots__/AmeliproAccordionGroup.spec.ts.snap +513 -0
- package/src/components/Amelipro/AmeliproAccordionGroup/types.d.ts +4 -0
- package/src/components/Amelipro/AmeliproAccordionList/AmeliproAccordionList.mdx +16 -0
- package/src/components/Amelipro/AmeliproAccordionList/AmeliproAccordionList.stories.ts +300 -0
- package/src/components/Amelipro/AmeliproAccordionList/AmeliproAccordionList.vue +288 -0
- package/src/components/Amelipro/AmeliproAccordionList/__tests__/AmeliproAccordionList.spec.ts +38 -0
- package/src/components/Amelipro/AmeliproAccordionList/__tests__/__snapshots__/AmeliproAccordionList.spec.ts.snap +1712 -0
- package/src/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResult.mdx +19 -0
- package/src/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResult.stories.ts +68 -0
- package/src/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResult.vue +66 -0
- package/src/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResultTemplate/AmeliproAccordionResultTemplate.vue +145 -0
- package/src/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResultTemplate/__tests__/AmeliproAccordionResultTemplate.spec.ts +24 -0
- package/src/components/Amelipro/AmeliproAccordionResult/AmeliproAccordionResultTemplate/__tests__/__snapshots__/AmeliproAccordionResultTemplate.spec.ts.snap +127 -0
- package/src/components/Amelipro/AmeliproAccordionResult/__tests__/AmeliproAccordionResult.spec.ts +24 -0
- package/src/components/Amelipro/AmeliproAccordionResult/__tests__/__snapshots__/AmeliproAccordionResult.spec.ts.snap +123 -0
- package/src/components/Amelipro/AmeliproAccordionResultList/AmeliproAccordionResultList.mdx +20 -0
- package/src/components/Amelipro/AmeliproAccordionResultList/AmeliproAccordionResultList.stories.ts +273 -0
- package/src/components/Amelipro/AmeliproAccordionResultList/AmeliproAccordionResultList.vue +275 -0
- package/src/components/Amelipro/AmeliproAccordionResultList/__tests__/AmeliproAccordionResultList.spec.ts +38 -0
- package/src/components/Amelipro/AmeliproAccordionResultList/__tests__/__snapshots__/AmeliproAccordionResultList.spec.ts.snap +1593 -0
- package/src/components/Amelipro/AmeliproBadge/AmeliproBadge.mdx +15 -0
- package/src/components/Amelipro/AmeliproBadge/AmeliproBadge.stories.ts +54 -0
- package/src/components/Amelipro/AmeliproBadge/AmeliproBadge.vue +76 -0
- package/src/components/Amelipro/AmeliproBadge/__tests__/AmeliproBadge.spec.ts +20 -0
- package/src/components/Amelipro/AmeliproBadge/__tests__/__snapshots__/AmeliproBadge.spec.ts.snap +19 -0
- package/src/components/Amelipro/AmeliproCarousel/AmeliproCarousel.mdx +15 -0
- package/src/components/Amelipro/AmeliproCarousel/AmeliproCarousel.stories.ts +191 -0
- package/src/components/Amelipro/AmeliproCarousel/AmeliproCarousel.vue +263 -0
- package/src/components/Amelipro/AmeliproCarousel/AmeliproCarouselItem/AmeliproCarouselItem.vue +93 -0
- package/src/components/Amelipro/AmeliproCarousel/AmeliproCarouselItem/__tests__/AmeliproCarouselItem.spec.ts +24 -0
- package/src/components/Amelipro/AmeliproCarousel/AmeliproCarouselItem/__tests__/__snapshots__/AmeliproCarouselItem.spec.ts.snap +43 -0
- package/src/components/Amelipro/AmeliproCarousel/__tests__/AmeliproCarousel.spec.ts +40 -0
- package/src/components/Amelipro/AmeliproCarousel/__tests__/__snapshots__/AmeliproCarousel.spec.ts.snap +342 -0
- package/src/components/Amelipro/AmeliproCarousel/types.d.ts +8 -0
- package/src/components/Amelipro/AmeliproClickableTile/AmeliproClickableTile.mdx +18 -0
- package/src/components/Amelipro/AmeliproClickableTile/AmeliproClickableTile.stories.ts +67 -0
- package/src/components/Amelipro/AmeliproClickableTile/AmeliproClickableTile.vue +233 -0
- package/src/components/Amelipro/AmeliproClickableTile/tests/AmeliproClickableTile.spec.ts +21 -0
- package/src/components/Amelipro/AmeliproClickableTile/tests/__snapshots__/AmeliproClickableTile.spec.ts.snap +140 -0
- package/src/components/Amelipro/AmeliproHeader/AmeliproHeader.vue +7 -1
- package/src/components/Amelipro/AmeliproHeader/tests/__snapshots__/AmeliproHeader.spec.ts.snap +5 -4
- package/src/components/Amelipro/AmeliproIcon/iconList.ts +6 -0
- package/src/components/Amelipro/AmeliproPageLayout/tests/__snapshots__/AmeliproPageLayout.spec.ts.snap +5 -4
- package/src/components/Amelipro/AmeliproResultList/AmeliproResultList.mdx +15 -0
- package/src/components/Amelipro/AmeliproResultList/AmeliproResultList.stories.ts +264 -0
- package/src/components/Amelipro/AmeliproResultList/AmeliproResultList.vue +231 -0
- package/src/components/Amelipro/AmeliproResultList/__tests__/AmeliproResultList.spec.ts +37 -0
- package/src/components/Amelipro/AmeliproResultList/__tests__/__snapshots__/AmeliproResultList.spec.ts.snap +434 -0
- package/src/components/Amelipro/AmeliproTable/AmeliproTable.vue +6 -5
- package/src/components/Amelipro/AmeliproTable/__tests__/__snapshots__/AmeliproTable.spec.ts.snap +23 -26
- package/src/components/Amelipro/AmeliproTileBtn/AmeliproTileBtn.stories.ts +2 -2
- package/src/components/ChipList/Accessibilite.stories.ts +4 -0
- package/src/components/ChipList/ChipList.vue +185 -42
- package/src/components/ChipList/locales.ts +4 -2
- package/src/components/ChipList/tests/chipList.spec.ts +7 -4
- package/src/components/Customs/Selects/SelectOverview.mdx +34 -66
- package/src/components/Customs/Selects/SyBtnSelect/SyBtnSelect.stories.ts +10 -10
- package/src/components/Customs/Selects/SyInputSelect/SyInputSelect.mdx +3 -0
- package/src/components/Customs/Selects/SyInputSelect/SyInputSelect.stories.ts +14 -0
- package/src/components/Customs/Selects/SySelect/SySelect.stories.ts +14 -6
- package/src/components/Customs/Selects/SySelect/SySelect.vue +268 -205
- package/src/components/Customs/Selects/SySelect/composables/tests/useSySelectKeyboard.spec.ts +0 -10
- package/src/components/Customs/Selects/SySelect/composables/useSySelectKeyboard.ts +0 -5
- package/src/components/Customs/Selects/SySelect/tests/SySelect.spec.ts +184 -25
- package/src/components/Customs/SyCheckbox/SyCheckbox.mdx +3 -1
- package/src/components/Customs/SyCheckbox/SyCheckbox.stories.ts +165 -0
- package/src/components/Customs/SyCheckbox/SyCheckbox.vue +28 -9
- package/src/components/Customs/SyTabs/Accessibilite.mdx +309 -0
- package/src/components/Customs/SyTabs/SyTabs.mdx +117 -0
- package/src/components/Customs/SyTabs/SyTabs.stories.ts +354 -0
- package/src/components/Customs/SyTabs/SyTabs.vue +413 -0
- package/src/components/Customs/SyTabs/config.ts +17 -0
- package/src/components/Customs/SyTabs/tests/SyTabs.spec.ts +425 -0
- package/src/components/Customs/SyTabs/types.ts +12 -0
- package/src/components/Customs/SyTextField/SyTextField.mdx +3 -0
- package/src/components/Customs/SyTextField/SyTextField.stories.ts +142 -1
- package/src/components/Customs/SyTextField/SyTextField.vue +19 -16
- package/src/components/DataList/DataList.vue +47 -49
- package/src/components/DataListGroup/DataListGroup.vue +1 -1
- package/src/components/DataListItem/DataListItem.vue +67 -63
- package/src/components/DataListItem/tests/DataListItem.spec.ts +2 -2
- package/src/components/DatePicker/CalendarMode/DatePicker.stories.ts +3 -3
- package/src/components/DatePicker/CalendarMode/DatePicker.vue +49 -13
- package/src/components/DatePicker/ComplexDatePicker/ComplexDatePicker.vue +412 -649
- package/src/components/DatePicker/DatePickerValidationExample/CalendarMode.stories.ts +215 -0
- package/src/components/DatePicker/DatePickerValidationExample/ComplexDatePicker.stories.ts +218 -0
- package/src/components/DatePicker/DatePickerValidationExample/DatePickerValidation.mdx +2 -0
- package/src/components/DatePicker/DatePickerValidationExample/DatePickerValidation.stories.ts +1 -1
- package/src/components/DatePicker/DatePickerValidationExample/DateTextInput.stories.ts +218 -0
- package/src/components/DatePicker/DatePickerValidationExample/MultiMode.stories.ts +281 -0
- package/src/components/DatePicker/DateTextInput/DateTextInput.events.spec.ts +17 -4
- package/src/components/DatePicker/DateTextInput/DateTextInput.range.spec.ts +111 -18
- package/src/components/DatePicker/DateTextInput/DateTextInput.spec.ts +238 -6
- package/src/components/DatePicker/DateTextInput/DateTextInput.vue +716 -757
- package/src/components/DatePicker/composables/tests/useDateInputEditing.spec.ts +4 -4
- package/src/components/DatePicker/composables/tests/useDisplayedDateString.spec.ts +17 -10
- package/src/components/DatePicker/composables/useDateInputEditing.ts +52 -22
- package/src/components/DatePicker/composables/useDisplayedDateString.ts +18 -4
- package/src/components/DatePicker/composables/useTodayButton.ts +13 -1
- package/src/components/DatePicker/utils/dateFormattingUtils.ts +79 -14
- package/src/components/DialogBox/DialogBox.stories.ts +12 -0
- package/src/components/DialogBox/DialogBox.vue +16 -11
- package/src/components/DialogBox/tests/DialogBox.spec.ts +22 -0
- package/src/components/HeaderLoading/Accessibilite.mdx +429 -8
- package/src/components/HeaderLoading/Accessibilite.stories.ts +4 -0
- package/src/components/HeaderLoading/HeaderLoading.vue +59 -0
- package/src/components/HeaderNavigationBar/HeaderNavigationBar.mdx +17 -2
- package/src/components/HeaderNavigationBar/HeaderNavigationBar.stories.ts +91 -2
- package/src/components/HeaderNavigationBar/HeaderNavigationBar.vue +37 -1
- package/src/components/HeaderNavigationBar/HorizontalNavbar/HorizontalNavbar.vue +284 -21
- package/src/components/HeaderNavigationBar/tests/HeaderNavigationBar.spec.ts +2 -2
- package/src/components/NirField/NirField.mdx +3 -0
- package/src/components/NirField/NirField.vue +10 -1
- package/src/components/NirField/tests/NirField.spec.ts +81 -0
- package/src/components/NotificationBar/NotificationBar.stories.ts +128 -2
- package/src/components/NotificationBar/NotificationBar.vue +16 -1
- package/src/components/NotificationBar/tests/NotificationBar.spec.ts +65 -0
- package/src/components/PasswordField/PasswordField.mdx +3 -0
- package/src/components/PeriodField/PeriodField.mdx +2 -0
- package/src/components/PeriodField/PeriodField.stories.ts +195 -0
- package/src/components/PhoneField/Accessibilite.stories.ts +4 -0
- package/src/components/PhoneField/PhoneField.mdx +3 -1
- package/src/components/PhoneField/PhoneField.stories.ts +285 -1
- package/src/components/PhoneField/PhoneField.vue +228 -95
- package/src/components/PhoneField/indicatifs.ts +102 -102
- package/src/components/PhoneField/locales.ts +1 -0
- package/src/components/PhoneField/tests/PhoneField.spec.ts +419 -2
- package/src/components/SkipLink/SkipLink.vue +3 -31
- package/src/components/SkipLink/tests/skipLink.spec.ts +0 -21
- package/src/components/SubHeader/Accessibilite.stories.ts +8 -0
- package/src/components/SubHeader/SubHeader.mdx +1 -0
- package/src/components/SubHeader/SubHeader.stories.ts +179 -60
- package/src/components/SubHeader/SubHeader.vue +45 -15
- package/src/components/SubHeader/locales.ts +1 -0
- package/src/components/SyAlert/SyAlert.vue +6 -0
- package/src/components/Tables/SyServerTable/SyServerTable.mdx +3 -10
- package/src/components/Tables/SyServerTable/SyServerTable.stories.ts +242 -0
- package/src/components/Tables/SyServerTable/SyServerTable.vue +29 -10
- package/src/components/Tables/SyTable/SyTable.mdx +3 -10
- package/src/components/Tables/SyTable/SyTable.stories.ts +242 -0
- package/src/components/Tables/SyTable/SyTable.vue +2 -0
- package/src/components/Tables/common/SyTablePagination.vue +13 -6
- package/src/components/Tables/common/filters/tests/SelectFilter.spec.ts +6 -1
- package/src/components/Tables/common/tests/SyTablePagination.spec.ts +157 -0
- package/src/components/Tables/common/types.ts +2 -0
- package/src/components/index.ts +9 -0
- package/src/composables/useFilterable/useFilterable.ts +10 -0
- package/src/designTokens/tokens/amelipro/apColors.ts +1 -1
- package/src/designTokens/tokens/cnam/cnamSemantic.ts +3 -3
- package/src/services/NotificationService.ts +9 -0
- package/src/stories/Components/Components.stories.ts +1 -1
- package/src/stories/GuideDuDev/FormValidationGuide.mdx +342 -0
- package/src/stories/Templates/Templates.stories.ts +1 -1
- package/src/utils/functions/ameliproColors/ameliproColors.ts +1 -1
- package/dist/components/DataList/locales.d.ts +0 -3
- package/src/components/DataList/locales.ts +0 -3
- package/src/components/PhoneField/tests/PhoneField.additional.spec.ts +0 -266
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { computed } from 'vue'
|
|
3
2
|
import type { PropType } from 'vue'
|
|
4
3
|
|
|
5
|
-
import { locales } from './locales'
|
|
6
4
|
import DataListItem from '@/components/DataListItem/DataListItem.vue'
|
|
7
5
|
import DataListLoading from './DataListLoading/DataListLoading.vue'
|
|
8
6
|
|
|
@@ -68,12 +66,14 @@
|
|
|
68
66
|
},
|
|
69
67
|
})
|
|
70
68
|
|
|
69
|
+
const uniqueId = Math.random().toString(36).substr(2, 9)
|
|
70
|
+
|
|
71
|
+
const sectionTitleId = `data-list-section-title-${uniqueId}`
|
|
72
|
+
|
|
71
73
|
const { widthStyles } = useWidthable(props)
|
|
72
74
|
|
|
73
75
|
const emit = defineEmits(['click:item-action'])
|
|
74
76
|
|
|
75
|
-
const label = computed(() => (props.loading ? locales.loadingLabel : undefined))
|
|
76
|
-
|
|
77
77
|
const getIcon = (iconName?: string): string | undefined => {
|
|
78
78
|
if (!iconName || !props.icons) {
|
|
79
79
|
return
|
|
@@ -90,54 +90,52 @@
|
|
|
90
90
|
</script>
|
|
91
91
|
|
|
92
92
|
<template>
|
|
93
|
-
<
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
v-if="loading"
|
|
101
|
-
:items-number="itemsNumberLoading"
|
|
102
|
-
:heading="headingLoading"
|
|
103
|
-
:title-class="titleClass"
|
|
104
|
-
:row="row"
|
|
105
|
-
/>
|
|
93
|
+
<VFadeTransition mode="out-in">
|
|
94
|
+
<DataListLoading
|
|
95
|
+
v-if="loading"
|
|
96
|
+
:items-number="itemsNumberLoading"
|
|
97
|
+
:heading="headingLoading"
|
|
98
|
+
:row="row"
|
|
99
|
+
/>
|
|
106
100
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
101
|
+
<component
|
|
102
|
+
:is="listTitle ? 'section' : 'div'"
|
|
103
|
+
v-else
|
|
104
|
+
:aria-labelledby="listTitle ? sectionTitleId : undefined"
|
|
105
|
+
:style="widthStyles"
|
|
106
|
+
class="sy-data-list"
|
|
107
|
+
>
|
|
108
|
+
<slot name="title">
|
|
109
|
+
<component
|
|
110
|
+
:is="titleTag"
|
|
111
|
+
v-if="listTitle"
|
|
112
|
+
:id="sectionTitleId"
|
|
113
|
+
:class="titleClass"
|
|
114
|
+
>
|
|
115
|
+
{{ listTitle }}
|
|
116
|
+
</component>
|
|
117
|
+
</slot>
|
|
119
118
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
</dd>
|
|
119
|
+
<dl v-if="items.length">
|
|
120
|
+
<DataListItem
|
|
121
|
+
v-for="(item, index) in items"
|
|
122
|
+
:key="index"
|
|
123
|
+
:label="item.key"
|
|
124
|
+
:value="item.value"
|
|
125
|
+
:action="item.action"
|
|
126
|
+
:chip="item.chip"
|
|
127
|
+
:row="row"
|
|
128
|
+
:render-html-value="renderHtmlValue"
|
|
129
|
+
:icon="getIcon(item.icon)"
|
|
130
|
+
:placeholder="placeholder"
|
|
131
|
+
:vuetify-options="item.options"
|
|
132
|
+
:class="getItemClass(index, item.class)"
|
|
133
|
+
class="sy-data-list-item text-body-1"
|
|
134
|
+
@click:action="emit('click:item-action', index)"
|
|
135
|
+
/>
|
|
138
136
|
</dl>
|
|
139
|
-
</
|
|
140
|
-
</
|
|
137
|
+
</component>
|
|
138
|
+
</VFadeTransition>
|
|
141
139
|
</template>
|
|
142
140
|
|
|
143
141
|
<style lang="scss" scoped>
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
|
|
34
34
|
const labelColor = computed(() => {
|
|
35
35
|
return theme.current.value.dark
|
|
36
|
-
? 'rgba(255, 255, 255, .
|
|
36
|
+
? 'rgba(255, 255, 255, .85)'
|
|
37
37
|
: 'rgba(0, 0, 0, .6)'
|
|
38
38
|
})
|
|
39
39
|
|
|
@@ -45,66 +45,73 @@
|
|
|
45
45
|
}
|
|
46
46
|
return props.value || props.placeholder
|
|
47
47
|
})
|
|
48
|
+
|
|
49
|
+
const actionButtonColor = computed(() => {
|
|
50
|
+
return theme.current.value.dark ? 'white' : 'primary'
|
|
51
|
+
})
|
|
48
52
|
</script>
|
|
49
53
|
|
|
50
54
|
<template>
|
|
51
|
-
<div
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
55
|
+
<div
|
|
56
|
+
:class="{ 'sy-row': row }"
|
|
57
|
+
class="sy-data-list-item"
|
|
58
|
+
>
|
|
59
|
+
<dt
|
|
60
|
+
class="sy-data-list-item-label text-caption"
|
|
61
|
+
:style="{ color: labelColor }"
|
|
62
|
+
>
|
|
63
|
+
<slot name="icon">
|
|
64
|
+
<SyIcon
|
|
65
|
+
v-if="icon"
|
|
66
|
+
v-bind="options.icon"
|
|
67
|
+
:icon="icon"
|
|
68
|
+
:decorative="true"
|
|
69
|
+
/>
|
|
70
|
+
</slot>
|
|
71
|
+
<span>{{ label }} :</span>
|
|
72
|
+
</dt>
|
|
73
|
+
|
|
74
|
+
<dd
|
|
75
|
+
class="sy-data-list-item-value d-flex align-center ga-2"
|
|
76
|
+
:class="{ 'has-icon': icon }"
|
|
77
|
+
>
|
|
78
|
+
<slot
|
|
79
|
+
name="value"
|
|
80
|
+
v-bind="{ itemValue }"
|
|
81
|
+
>
|
|
82
|
+
<VChip
|
|
83
|
+
v-if="chip"
|
|
84
|
+
v-bind="options.chip"
|
|
66
85
|
>
|
|
67
|
-
{{
|
|
68
|
-
</
|
|
69
|
-
|
|
70
|
-
<
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
86
|
+
{{ itemValue }}
|
|
87
|
+
</VChip>
|
|
88
|
+
|
|
89
|
+
<span
|
|
90
|
+
v-else-if="renderHtmlValue"
|
|
91
|
+
class="text-body-1"
|
|
92
|
+
v-html="itemValue"
|
|
93
|
+
/>
|
|
94
|
+
|
|
95
|
+
<span
|
|
96
|
+
v-else
|
|
97
|
+
class="text-body-1"
|
|
98
|
+
v-text="itemValue"
|
|
99
|
+
/>
|
|
100
|
+
|
|
101
|
+
<slot name="action">
|
|
102
|
+
<VBtn
|
|
103
|
+
v-if="action"
|
|
104
|
+
class="sy-data-list-item-action-btn px-2"
|
|
105
|
+
size="small"
|
|
106
|
+
variant="tonal"
|
|
107
|
+
:color="actionButtonColor"
|
|
108
|
+
@click="emits('click:action')"
|
|
74
109
|
>
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
>
|
|
79
|
-
{{ itemValue }}
|
|
80
|
-
</VChip>
|
|
81
|
-
|
|
82
|
-
<div
|
|
83
|
-
v-else-if="renderHtmlValue"
|
|
84
|
-
class="text-body-1"
|
|
85
|
-
v-html="itemValue"
|
|
86
|
-
/>
|
|
87
|
-
|
|
88
|
-
<div
|
|
89
|
-
v-else
|
|
90
|
-
class="text-body-1"
|
|
91
|
-
v-text="itemValue"
|
|
92
|
-
/>
|
|
93
|
-
</slot>
|
|
94
|
-
</div>
|
|
95
|
-
</div>
|
|
96
|
-
|
|
97
|
-
<slot name="action">
|
|
98
|
-
<VBtn
|
|
99
|
-
v-if="action"
|
|
100
|
-
v-bind="options.actionBtn"
|
|
101
|
-
class="sy-data-list-item-action-btn"
|
|
102
|
-
@click="emits('click:action')"
|
|
103
|
-
>
|
|
104
|
-
{{ action }}
|
|
105
|
-
</VBtn>
|
|
110
|
+
{{ action }}
|
|
111
|
+
</VBtn>
|
|
112
|
+
</slot>
|
|
106
113
|
</slot>
|
|
107
|
-
</
|
|
114
|
+
</dd>
|
|
108
115
|
</div>
|
|
109
116
|
</template>
|
|
110
117
|
|
|
@@ -112,21 +119,18 @@
|
|
|
112
119
|
.sy-row {
|
|
113
120
|
display: flex;
|
|
114
121
|
flex-wrap: wrap;
|
|
122
|
+
gap: 0.25rem;
|
|
115
123
|
|
|
116
124
|
.sy-data-list-item-label {
|
|
117
125
|
align-self: center;
|
|
118
|
-
|
|
119
|
-
&::after {
|
|
120
|
-
content: ':';
|
|
121
|
-
margin: 0 4px;
|
|
122
|
-
}
|
|
123
126
|
}
|
|
124
127
|
}
|
|
125
128
|
|
|
126
|
-
.sy-data-list-item-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
+
.sy-data-list-item-value.has-icon {
|
|
130
|
+
margin-left: 2.5rem;
|
|
131
|
+
}
|
|
129
132
|
|
|
133
|
+
.sy-data-list-item-action-btn.v-btn {
|
|
130
134
|
&:focus-visible::after {
|
|
131
135
|
opacity: 1;
|
|
132
136
|
}
|
|
@@ -66,7 +66,7 @@ describe('DataListItem', () => {
|
|
|
66
66
|
},
|
|
67
67
|
})
|
|
68
68
|
|
|
69
|
-
const elValue = wrapper.find('.sy-data-list-item-value
|
|
69
|
+
const elValue = wrapper.find('.sy-data-list-item-value span')
|
|
70
70
|
|
|
71
71
|
expect(elValue.text()).toBe('<span>Custom Value</span>')
|
|
72
72
|
})
|
|
@@ -83,7 +83,7 @@ describe('DataListItem', () => {
|
|
|
83
83
|
},
|
|
84
84
|
})
|
|
85
85
|
|
|
86
|
-
const elValue = wrapper.find('.sy-data-list-item-value
|
|
86
|
+
const elValue = wrapper.find('.sy-data-list-item-value span')
|
|
87
87
|
|
|
88
88
|
expect(elValue.text()).toBe('Paul Dupont')
|
|
89
89
|
})
|
|
@@ -622,8 +622,8 @@ export const WithError: Story = {
|
|
|
622
622
|
v-model="date"
|
|
623
623
|
placeholder="notAfterToday"
|
|
624
624
|
:custom-rules="[
|
|
625
|
-
|
|
626
|
-
|
|
625
|
+
{ type: 'notAfterToday', options: { message: 'La date ne peut pas être après aujourd'hui' } },
|
|
626
|
+
]"
|
|
627
627
|
/>
|
|
628
628
|
</template>
|
|
629
629
|
`,
|
|
@@ -656,7 +656,7 @@ export const WithError: Story = {
|
|
|
656
656
|
'noCalendar': false,
|
|
657
657
|
'modelValue': '01/01/2100',
|
|
658
658
|
'customRules': [
|
|
659
|
-
{ type: 'notAfterToday', options: { message: 'La date ne peut pas être après aujourd
|
|
659
|
+
{ type: 'notAfterToday', options: { message: 'La date ne peut pas être après aujourd hui' } },
|
|
660
660
|
],
|
|
661
661
|
'onUpdate:modelValue': fn(),
|
|
662
662
|
'onFocus': fn(),
|
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
max?: string
|
|
69
69
|
}
|
|
70
70
|
autoClamp?: boolean
|
|
71
|
+
isValidateOnBlur?: boolean
|
|
71
72
|
}>(), {
|
|
72
73
|
modelValue: undefined,
|
|
73
74
|
label: DATE_PICKER_MESSAGES.LABEL_DEFAULT,
|
|
@@ -106,13 +107,14 @@
|
|
|
106
107
|
max: '',
|
|
107
108
|
}),
|
|
108
109
|
autoClamp: false,
|
|
110
|
+
isValidateOnBlur: true,
|
|
109
111
|
})
|
|
110
112
|
|
|
111
113
|
// La compatibilité entre isBirthDate et birthDate est gérée directement dans l'appel au composable
|
|
112
114
|
|
|
113
115
|
// Utilisation des composables pour les fonctionnalités du CalendarMode
|
|
114
116
|
const { displayWeekendDays } = useWeekendDays(props)
|
|
115
|
-
const { todayInString } = useTodayButton(props)
|
|
117
|
+
const { todayInString, headerDate } = useTodayButton(props)
|
|
116
118
|
const { labelWithAsterisk } = useAsteriskDisplay(props)
|
|
117
119
|
|
|
118
120
|
const selectedDates = ref<Date | Date[] | null>(
|
|
@@ -125,9 +127,12 @@
|
|
|
125
127
|
todayInString,
|
|
126
128
|
})
|
|
127
129
|
|
|
130
|
+
const onblur = ref(false)
|
|
131
|
+
|
|
128
132
|
const dateTextInputRef = ref<null | ComponentPublicInstance<typeof DateTextInput>>()
|
|
129
133
|
const dateCalendarTextInputRef = ref<null | ComponentPublicInstance<typeof SyTextField>>()
|
|
130
134
|
const datePickerRef = ref<null | ComponentPublicInstance<typeof VDatePicker>>()
|
|
135
|
+
const complexDatePickerRef = ref<null | ComponentPublicInstance<typeof ComplexDatePicker>>()
|
|
131
136
|
|
|
132
137
|
// Fonction pour sélectionner la date du jour
|
|
133
138
|
const handleSelectToday = () => {
|
|
@@ -151,6 +156,12 @@
|
|
|
151
156
|
|
|
152
157
|
// Mettre à jour l'affichage formaté
|
|
153
158
|
updateDisplayFormattedDate()
|
|
159
|
+
|
|
160
|
+
// Mettre à jour les variables currentMonth et currentYear pour refléter la date d'aujourd'hui
|
|
161
|
+
currentMonth.value = today.getMonth().toString()
|
|
162
|
+
currentYear.value = today.getFullYear().toString()
|
|
163
|
+
currentMonthName.value = dayjs(today).format('MMMM')
|
|
164
|
+
currentYearName.value = today.getFullYear().toString()
|
|
154
165
|
}
|
|
155
166
|
|
|
156
167
|
const emit = defineEmits<{
|
|
@@ -210,6 +221,10 @@
|
|
|
210
221
|
if (props.readonly) {
|
|
211
222
|
return
|
|
212
223
|
}
|
|
224
|
+
// Ne pas afficher d'erreur si on est sur une perte de focus et si isValidateOnBlur est false
|
|
225
|
+
if (onblur.value && !props.isValidateOnBlur) {
|
|
226
|
+
return
|
|
227
|
+
}
|
|
213
228
|
// Ne pas afficher d'erreur si on est dans le contexte du mounted initial
|
|
214
229
|
if (shouldDisplayErrors && (!isInitialValidation.value || forceValidation)) {
|
|
215
230
|
errors.value.push(DATE_PICKER_MESSAGES.ERROR_REQUIRED)
|
|
@@ -550,9 +565,14 @@
|
|
|
550
565
|
})
|
|
551
566
|
|
|
552
567
|
const validateOnSubmit = () => {
|
|
568
|
+
// Si le mode noCalendar est activé, on délègue la validation au DateTextInput
|
|
553
569
|
if (props.noCalendar) {
|
|
554
570
|
return dateTextInputRef.value?.validateOnSubmit()
|
|
555
571
|
}
|
|
572
|
+
// Si le mode combiné est activé, on délègue la validation au ComplexDatePicker
|
|
573
|
+
else if (props.useCombinedMode) {
|
|
574
|
+
return complexDatePickerRef.value?.validateOnSubmit()
|
|
575
|
+
}
|
|
556
576
|
// Forcer la validation pour ignorer les conditions de validation interactive
|
|
557
577
|
validateDates(true)
|
|
558
578
|
// Retourner directement un booléen pour maintenir la compatibilité avec les tests existants
|
|
@@ -657,7 +677,10 @@
|
|
|
657
677
|
|
|
658
678
|
const handleInputBlur = () => {
|
|
659
679
|
emit('blur')
|
|
660
|
-
|
|
680
|
+
onblur.value = true
|
|
681
|
+
if (props.isValidateOnBlur) {
|
|
682
|
+
validateDates(true)
|
|
683
|
+
}
|
|
661
684
|
}
|
|
662
685
|
|
|
663
686
|
watch(isDatePickerVisible, async (isVisible) => {
|
|
@@ -670,15 +693,7 @@
|
|
|
670
693
|
resetViewMode()
|
|
671
694
|
}
|
|
672
695
|
|
|
673
|
-
if (isVisible) {
|
|
674
|
-
// set the focus on the date picker
|
|
675
|
-
await nextTick()
|
|
676
|
-
const firstButton = datePickerRef.value?.$el?.querySelector?.('button')
|
|
677
|
-
if (firstButton) {
|
|
678
|
-
firstButton.focus({ preventScroll: true })
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
else {
|
|
696
|
+
if (!isVisible) {
|
|
682
697
|
// set the focus on the text input
|
|
683
698
|
// wait for VMenu to finish DOM updates & transition
|
|
684
699
|
setTimeout(() => {
|
|
@@ -798,8 +813,9 @@
|
|
|
798
813
|
customizeMonthButton()
|
|
799
814
|
}
|
|
800
815
|
|
|
816
|
+
// Ne plus ouvrir automatiquement le calendrier au focus, juste émettre l'événement
|
|
801
817
|
const openDatePickerOnFocus = () => {
|
|
802
|
-
openDatePicker()
|
|
818
|
+
// openDatePicker() - désactivé pour améliorer l'accessibilité
|
|
803
819
|
emit('focus')
|
|
804
820
|
}
|
|
805
821
|
|
|
@@ -807,6 +823,22 @@
|
|
|
807
823
|
toggleDatePicker()
|
|
808
824
|
}
|
|
809
825
|
|
|
826
|
+
// Gestionnaire d'événement clavier pour l'input
|
|
827
|
+
const handleInputKeydown = (event: KeyboardEvent) => {
|
|
828
|
+
// Ouvrir le calendrier uniquement lorsque la touche Entrée est pressée
|
|
829
|
+
if (event.key === 'Enter') {
|
|
830
|
+
openDatePicker()
|
|
831
|
+
event.preventDefault() // Empêcher la soumission du formulaire
|
|
832
|
+
}
|
|
833
|
+
// Fermer le calendrier lorsque la touche Escape est pressée
|
|
834
|
+
else if ((event.key === 'Escape' || event.key === 'Esc') && isDatePickerVisible.value) {
|
|
835
|
+
isDatePickerVisible.value = false
|
|
836
|
+
emit('closed')
|
|
837
|
+
validateDates() // Valider les dates à la fermeture
|
|
838
|
+
event.preventDefault()
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
|
|
810
842
|
defineExpose({
|
|
811
843
|
validateOnSubmit,
|
|
812
844
|
isDatePickerVisible,
|
|
@@ -852,6 +884,7 @@
|
|
|
852
884
|
:period="props.period"
|
|
853
885
|
:auto-clamp="props.autoClamp"
|
|
854
886
|
:display-asterisk="props.displayAsterisk"
|
|
887
|
+
:is-validate-on-blur="props.isValidateOnBlur"
|
|
855
888
|
@update:model-value="handleDateTextInputUpdate"
|
|
856
889
|
@date-selected="handleDateTextInputSelection"
|
|
857
890
|
@blur="handleInputBlur"
|
|
@@ -860,6 +893,7 @@
|
|
|
860
893
|
</template>
|
|
861
894
|
<template v-else-if="props.useCombinedMode">
|
|
862
895
|
<ComplexDatePicker
|
|
896
|
+
ref="complexDatePickerRef"
|
|
863
897
|
:model-value="props.modelValue"
|
|
864
898
|
:format="props.format"
|
|
865
899
|
:date-format-return="props.dateFormatReturn"
|
|
@@ -891,6 +925,7 @@
|
|
|
891
925
|
:auto-clamp="props.autoClamp"
|
|
892
926
|
:label="props.label"
|
|
893
927
|
:placeholder="props.placeholder"
|
|
928
|
+
:is-validate-on-blur="props.isValidateOnBlur"
|
|
894
929
|
@update:model-value="emit('update:modelValue', $event)"
|
|
895
930
|
@focus="emit('focus')"
|
|
896
931
|
@blur="emit('blur')"
|
|
@@ -943,6 +978,7 @@
|
|
|
943
978
|
@click="openDatePickerOnClick"
|
|
944
979
|
@focus="openDatePickerOnFocus"
|
|
945
980
|
@blur="handleInputBlur"
|
|
981
|
+
@keydown="handleInputKeydown"
|
|
946
982
|
@update:model-value="updateSelectedDates"
|
|
947
983
|
@prepend-icon-click="openDatePickerOnIconClick"
|
|
948
984
|
@append-icon-click="openDatePickerOnIconClick"
|
|
@@ -975,7 +1011,7 @@
|
|
|
975
1011
|
</template>
|
|
976
1012
|
<template #header>
|
|
977
1013
|
<h3 class="mx-auto my-auto ml-5 mb-4">
|
|
978
|
-
{{ displayedDateString }}
|
|
1014
|
+
{{ selectedDates ? displayedDateString : headerDate }}
|
|
979
1015
|
</h3>
|
|
980
1016
|
</template>
|
|
981
1017
|
<template
|