@cnamts/synapse 0.0.8-alpha → 0.0.10-alpha
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/design-system-v3.d.ts +1152 -127
- package/dist/design-system-v3.js +4888 -2605
- package/dist/design-system-v3.umd.cjs +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/assets/settings.scss +1 -1
- package/src/components/ContextualMenu/Accessibilite.mdx +14 -0
- package/src/components/ContextualMenu/Accessibilite.stories.ts +191 -0
- package/src/components/ContextualMenu/AccessibiliteItems.ts +89 -0
- package/src/components/ContextualMenu/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/Customs/SySelect/SySelect.stories.ts +7 -7
- package/src/components/Customs/SySelect/SySelect.vue +9 -4
- package/src/components/Customs/SySelect/tests/SySelect.spec.ts +2 -2
- package/src/components/Customs/SyTextField/SyTextField.stories.ts +187 -2
- package/src/components/Customs/SyTextField/SyTextField.vue +185 -16
- package/src/components/Customs/SyTextField/tests/SyTextField.spec.ts +2 -4
- package/src/components/Customs/SyTextField/tests/__snapshots__/SyTextField.spec.ts.snap +18 -16
- package/src/components/Customs/SyTextField/types.d.ts +2 -2
- package/src/components/DatePicker/Accessibilite.mdx +14 -0
- package/src/components/DatePicker/Accessibilite.stories.ts +191 -0
- package/src/components/DatePicker/AccessibiliteItems.ts +233 -0
- package/src/components/DatePicker/DatePicker.mdx +186 -0
- package/src/components/DatePicker/DatePicker.stories.ts +787 -0
- package/src/components/DatePicker/DatePicker.vue +574 -0
- package/src/components/DatePicker/DateTextInput.vue +409 -0
- package/src/components/DatePicker/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/DatePicker/tests/DatePicker.spec.ts +266 -0
- package/src/components/DialogBox/DialogBox.stories.ts +1 -1
- package/src/components/ExternalLinks/Accessibilite.mdx +14 -0
- package/src/components/ExternalLinks/Accessibilite.stories.ts +191 -0
- package/src/components/ExternalLinks/AccessibiliteItems.ts +197 -0
- package/src/components/ExternalLinks/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/ExternalLinks/tests/__snapshots__/ExternalLinks.spec.ts.snap +9 -9
- package/src/components/FileList/FileList.mdx +103 -0
- package/src/components/FileList/FileList.stories.ts +562 -0
- package/src/components/FileList/FileList.vue +78 -0
- package/src/components/FileList/UploadItem/UploadItem.vue +270 -0
- package/src/components/FileList/UploadItem/locales.ts +9 -0
- package/src/components/FileList/tests/FileList.spec.ts +176 -0
- package/src/components/FilePreview/FilePreview.mdx +82 -0
- package/src/components/FilePreview/FilePreview.stories.ts +242 -0
- package/src/components/FilePreview/FilePreview.vue +68 -0
- package/src/components/FilePreview/config.ts +10 -0
- package/src/components/FilePreview/locales.ts +4 -0
- package/src/components/FilePreview/tests/FilePreview.spec.ts +124 -0
- package/src/components/FilePreview/tests/__snapshots__/FilePreview.spec.ts.snap +11 -0
- package/src/components/FileUpload/FileUpload.mdx +165 -0
- package/src/components/FileUpload/FileUpload.stories.ts +429 -0
- package/src/components/FileUpload/FileUpload.vue +195 -0
- package/src/components/FileUpload/FileUploadContent.vue +109 -0
- package/src/components/FileUpload/locales.ts +10 -0
- package/src/components/FileUpload/tests/FileUpload.spec.ts +332 -0
- package/src/components/FileUpload/tests/__snapshots__/FileUpload.spec.ts.snap +7 -0
- package/src/components/FileUpload/useFileDrop.ts +23 -0
- package/src/components/FileUpload/validateFiles.ts +39 -0
- package/src/components/NirField/NirField.stories.ts +1 -1
- package/src/components/NirField/NirField.vue +2 -1
- package/src/components/PasswordField/Accessibilite.mdx +14 -0
- package/src/components/PasswordField/Accessibilite.stories.ts +191 -0
- package/src/components/PasswordField/AccessibiliteItems.ts +184 -0
- package/src/components/PasswordField/PasswordField.vue +3 -3
- package/src/components/PasswordField/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/PeriodField/PeriodField.mdx +32 -0
- package/src/components/PeriodField/PeriodField.stories.ts +807 -0
- package/src/components/PeriodField/PeriodField.vue +355 -0
- package/src/components/PeriodField/tests/PeriodField.spec.ts +348 -0
- package/src/components/PhoneField/PhoneField.vue +44 -60
- package/src/components/PhoneField/tests/PhoneField.spec.ts +0 -15
- package/src/components/RangeField/Accessibilite.mdx +14 -0
- package/src/components/RangeField/Accessibilite.stories.ts +191 -0
- package/src/components/RangeField/AccessibiliteItems.ts +179 -0
- package/src/components/RangeField/RangeField.mdx +54 -0
- package/src/components/RangeField/RangeField.stories.ts +189 -0
- package/src/components/RangeField/RangeField.vue +157 -0
- package/src/components/RangeField/RangeSlider/RangeSlider.vue +387 -0
- package/src/components/RangeField/RangeSlider/Tooltip/Tooltip.vue +64 -0
- package/src/components/RangeField/RangeSlider/tests/__snapshots__/rangeSlider.spec.ts.snap +27 -0
- package/src/components/RangeField/RangeSlider/tests/rangeSlider.spec.ts +100 -0
- package/src/components/RangeField/RangeSlider/tests/useDoubleSlider.spec.ts +246 -0
- package/src/components/RangeField/RangeSlider/tests/useMouseSlide.spec.ts +204 -0
- package/src/components/RangeField/RangeSlider/tests/useThumb.spec.ts +22 -0
- package/src/components/RangeField/RangeSlider/tests/useThumbKeyboard.spec.ts +233 -0
- package/src/components/RangeField/RangeSlider/tests/useTooltipsNudge.spec.ts +150 -0
- package/src/components/RangeField/RangeSlider/tests/useTrack.spec.ts +314 -0
- package/src/components/RangeField/RangeSlider/tests/vAnimateClick.spec.ts +32 -0
- package/src/components/RangeField/RangeSlider/types.ts +15 -0
- package/src/components/RangeField/RangeSlider/useMouseSlide.ts +109 -0
- package/src/components/RangeField/RangeSlider/useRangeSlider.ts +126 -0
- package/src/components/RangeField/RangeSlider/useThumb.ts +18 -0
- package/src/components/RangeField/RangeSlider/useThumbKeyboard.ts +84 -0
- package/src/components/RangeField/RangeSlider/useTooltipsNudge.ts +92 -0
- package/src/components/RangeField/RangeSlider/useTrack.ts +116 -0
- package/src/components/RangeField/RangeSlider/vAnimateClick.ts +19 -0
- package/src/components/RangeField/config.ts +7 -0
- package/src/components/RangeField/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/RangeField/locales.ts +4 -0
- package/src/components/RangeField/tests/RangeField.spec.ts +224 -0
- package/src/components/RangeField/tests/__snapshots__/RangeField.spec.ts.snap +379 -0
- package/src/components/RatingPicker/Accessibilite.mdx +14 -0
- package/src/components/RatingPicker/Accessibilite.stories.ts +191 -0
- package/src/components/RatingPicker/AccessibiliteItems.ts +208 -0
- package/src/components/RatingPicker/EmotionPicker/EmotionPicker.vue +205 -0
- package/src/components/RatingPicker/EmotionPicker/locales.ts +3 -0
- package/src/components/RatingPicker/EmotionPicker/tests/EmotionPicker.spec.ts +104 -0
- package/src/components/RatingPicker/EmotionPicker/tests/__snapshots__/EmotionPicker.spec.ts.snap +66 -0
- package/src/components/RatingPicker/NumberPicker/NumberPicker.vue +159 -0
- package/src/components/RatingPicker/NumberPicker/locales.ts +4 -0
- package/src/components/RatingPicker/NumberPicker/tests/NumberPicker.spec.ts +73 -0
- package/src/components/RatingPicker/NumberPicker/tests/__snapshots__/NumberPicker.spec.ts.snap +105 -0
- package/src/components/RatingPicker/Rating.ts +45 -0
- package/src/components/RatingPicker/RatingPicker.mdx +56 -0
- package/src/components/RatingPicker/RatingPicker.stories.ts +515 -0
- package/src/components/RatingPicker/RatingPicker.vue +122 -0
- package/src/components/RatingPicker/StarsPicker/StarsPicker.vue +116 -0
- package/src/components/RatingPicker/StarsPicker/tests/StarsPicker.spec.ts +95 -0
- package/src/components/RatingPicker/StarsPicker/tests/__snapshots__/StarsPicker.spec.ts.snap +36 -0
- package/src/components/RatingPicker/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/RatingPicker/locales.ts +3 -0
- package/src/components/RatingPicker/tests/Rating.spec.ts +104 -0
- package/src/components/RatingPicker/tests/RatingPicker.spec.ts +187 -0
- package/src/components/RatingPicker/tests/__snapshots__/RatingPicker.spec.ts.snap +108 -0
- package/src/components/SearchListField/Accessibilite.mdx +14 -0
- package/src/components/SearchListField/Accessibilite.stories.ts +191 -0
- package/src/components/SearchListField/AccessibiliteItems.ts +310 -0
- package/src/components/SearchListField/SearchListField.mdx +74 -0
- package/src/components/SearchListField/SearchListField.stories.ts +126 -0
- package/src/components/SearchListField/SearchListField.vue +194 -0
- package/src/components/SearchListField/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/SearchListField/locales.ts +5 -0
- package/src/components/SearchListField/tests/SearchListField.spec.ts +323 -0
- package/src/components/SearchListField/types.d.ts +4 -0
- package/src/components/SelectBtnField/Accessibilite.mdx +14 -0
- package/src/components/SelectBtnField/Accessibilite.stories.ts +191 -0
- package/src/components/SelectBtnField/AccessibiliteItems.ts +191 -0
- package/src/components/SelectBtnField/SelectBtnField.mdx +50 -0
- package/src/components/SelectBtnField/SelectBtnField.stories.ts +763 -0
- package/src/components/SelectBtnField/SelectBtnField.vue +283 -0
- package/src/components/SelectBtnField/config.ts +11 -0
- package/src/components/SelectBtnField/constants/ExpertiseLevelEnum.ts +4 -0
- package/src/components/SelectBtnField/tests/SelectBtnField.spec.ts +327 -0
- package/src/components/SelectBtnField/tests/__snapshots__/SelectBtnField.spec.ts.snap +125 -0
- package/src/components/SelectBtnField/types.d.ts +11 -0
- package/src/components/SyAlert/SyAlert.vue +11 -9
- package/src/components/TableToolbar/TableToolbar.mdx +130 -0
- package/src/components/TableToolbar/TableToolbar.stories.ts +935 -0
- package/src/components/TableToolbar/TableToolbar.vue +168 -0
- package/src/components/TableToolbar/config.ts +24 -0
- package/src/components/TableToolbar/locales.ts +6 -0
- package/src/components/TableToolbar/tests/TableToolbar.spec.ts +166 -0
- package/src/components/TableToolbar/tests/__snapshots__/TableToolbar.spec.ts.snap +359 -0
- package/src/components/index.ts +11 -1
- package/src/composables/rules/useFieldValidation.ts +174 -44
- package/src/designTokens/index.ts +3 -3
- package/src/stories/Fondamentaux/CustomisationEtThemes.mdx +52 -2
- package/src/utils/calcHumanFileSize/index.ts +12 -0
- package/src/utils/calcHumanFileSize/tests/calcHumanFileSize.spec.ts +21 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import { computed, ref, watch
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { computed, ref, watch } from 'vue'
|
|
3
3
|
import type { PropType } from 'vue'
|
|
4
4
|
import { required as RequiredRule } from '@/utils/rules/required'
|
|
5
5
|
import { exactLength } from '@/utils/rules/exactLength'
|
|
@@ -44,6 +44,34 @@
|
|
|
44
44
|
const hasError = ref(false)
|
|
45
45
|
const onBlur = ref(false)
|
|
46
46
|
|
|
47
|
+
function formatPhoneNumber(value: string): string {
|
|
48
|
+
if (!value) return ''
|
|
49
|
+
const cleaned = value.replace(/\D/g, '')
|
|
50
|
+
return cleaned.replace(/(.{2})/g, '$1 ').trim()
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const computedValue = computed(() => formatPhoneNumber(phoneNumber.value))
|
|
54
|
+
|
|
55
|
+
watch(() => props.modelValue, (newVal) => {
|
|
56
|
+
phoneNumber.value = (newVal || '').replace(/\s/g, '')
|
|
57
|
+
}, { immediate: true })
|
|
58
|
+
|
|
59
|
+
watch(dialCode, (newVal) => {
|
|
60
|
+
emit('update:selectedDialCode', newVal)
|
|
61
|
+
if (typeof newVal === 'object' && newVal !== null) {
|
|
62
|
+
counter.value = newVal.phoneLength || 10
|
|
63
|
+
phoneMask.value = newVal.mask || '#'.repeat(newVal.phoneLength || 10).replace(/(.{2})/g, '$1 ').trim()
|
|
64
|
+
}
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
function handlePhoneInput(event: Event) {
|
|
68
|
+
const input = (event.target as HTMLInputElement).value
|
|
69
|
+
const cleanedInput = input.replace(/\D/g, '')
|
|
70
|
+
phoneNumber.value = cleanedInput
|
|
71
|
+
emit('update:modelValue', cleanedInput)
|
|
72
|
+
emit('change', cleanedInput)
|
|
73
|
+
}
|
|
74
|
+
|
|
47
75
|
const mergedDialCodes = computed(() =>
|
|
48
76
|
props.useCustomIndicatifsOnly ? props.customIndicatifs : [...indicatifs, ...props.customIndicatifs],
|
|
49
77
|
)
|
|
@@ -66,28 +94,13 @@
|
|
|
66
94
|
return format[props.displayFormat] || ind.code
|
|
67
95
|
}
|
|
68
96
|
|
|
69
|
-
const
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
function applyPhoneMask(phone: string): string {
|
|
75
|
-
phone = phone.replace(/\D/g, '')
|
|
76
|
-
if (currentDialCode.value?.mask) {
|
|
77
|
-
const regex = new RegExp(currentDialCode.value.mask.replace(/#/g, '\\d'))
|
|
78
|
-
return phone.replace(regex, currentDialCode.value.mask).trim()
|
|
97
|
+
const validationRules = computed(() => {
|
|
98
|
+
const rules = [exactLength(counter.value, true)]
|
|
99
|
+
if (props.required) {
|
|
100
|
+
rules.unshift(RequiredRule)
|
|
79
101
|
}
|
|
80
|
-
return
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
function handlePhoneInput(event: Event) {
|
|
84
|
-
const input = (event.target as HTMLInputElement).value.replace(/\s|\D/g, '')
|
|
85
|
-
phoneNumber.value = input.startsWith(String(dialCode.value) || '')
|
|
86
|
-
? input.slice(String(dialCode.value || '').length)
|
|
87
|
-
: input
|
|
88
|
-
emit('update:modelValue', phoneNumber.value)
|
|
89
|
-
emit('change', phoneNumber.value)
|
|
90
|
-
}
|
|
102
|
+
return rules
|
|
103
|
+
})
|
|
91
104
|
|
|
92
105
|
function validateInputOnBlur() {
|
|
93
106
|
if (!props.isValidatedOnBlur) return
|
|
@@ -100,34 +113,6 @@
|
|
|
100
113
|
onBlur.value = true
|
|
101
114
|
}
|
|
102
115
|
|
|
103
|
-
const validationRules = computed(() => {
|
|
104
|
-
const rules = [exactLength(counter.value, true)]
|
|
105
|
-
if (props.required) {
|
|
106
|
-
rules.unshift(RequiredRule)
|
|
107
|
-
}
|
|
108
|
-
return rules
|
|
109
|
-
})
|
|
110
|
-
|
|
111
|
-
const computedValue = computed(() =>
|
|
112
|
-
phoneNumber.value ? applyPhoneMask(phoneNumber.value) : '',
|
|
113
|
-
)
|
|
114
|
-
|
|
115
|
-
watch(() => props.modelValue, (newVal) => {
|
|
116
|
-
phoneNumber.value = newVal || ''
|
|
117
|
-
})
|
|
118
|
-
|
|
119
|
-
watch(dialCode, (newVal) => {
|
|
120
|
-
emit('update:selectedDialCode', newVal)
|
|
121
|
-
})
|
|
122
|
-
|
|
123
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- This is a generic type
|
|
124
|
-
watch(dialCode, (selectedPhoneCode: any) => {
|
|
125
|
-
if (selectedPhoneCode) {
|
|
126
|
-
counter.value = selectedPhoneCode?.phoneLength || 10
|
|
127
|
-
phoneMask.value = selectedPhoneCode?.mask || '## ## ## ## ##'
|
|
128
|
-
}
|
|
129
|
-
})
|
|
130
|
-
|
|
131
116
|
defineExpose({
|
|
132
117
|
computedValue,
|
|
133
118
|
dialCode,
|
|
@@ -137,7 +122,6 @@
|
|
|
137
122
|
phoneNumber,
|
|
138
123
|
mergedDialCodes,
|
|
139
124
|
})
|
|
140
|
-
|
|
141
125
|
</script>
|
|
142
126
|
|
|
143
127
|
<template>
|
|
@@ -146,26 +130,26 @@
|
|
|
146
130
|
v-if="props.withCountryCode"
|
|
147
131
|
v-model="dialCode"
|
|
148
132
|
:items="dialCodeOptions"
|
|
149
|
-
text-key="displayText"
|
|
150
|
-
value-key="code"
|
|
151
133
|
:label="locales.indicatifLabel"
|
|
134
|
+
:outlined="outlinedIndicatif"
|
|
152
135
|
:required="props.countryCodeRequired"
|
|
153
136
|
class="custom-select"
|
|
154
|
-
|
|
137
|
+
text-key="displayText"
|
|
138
|
+
value-key="code"
|
|
155
139
|
/>
|
|
156
140
|
<SyTextField
|
|
141
|
+
v-model="phoneNumber"
|
|
157
142
|
v-maska="phoneMask"
|
|
158
|
-
:model-value="computedValue"
|
|
159
|
-
:rules="validationRules"
|
|
160
|
-
:required="props.required"
|
|
161
143
|
:counter="counter"
|
|
162
144
|
:counter-value="(value: string) => value.replace(/\s/g, '').length"
|
|
163
145
|
:label="locales.label"
|
|
146
|
+
:required="props.required"
|
|
147
|
+
:rules="validationRules"
|
|
164
148
|
:variant="outlined ? 'outlined' : 'underlined'"
|
|
165
|
-
color="primary"
|
|
166
149
|
class="phone-field"
|
|
167
|
-
|
|
150
|
+
color="primary"
|
|
168
151
|
@blur="validateInputOnBlur"
|
|
152
|
+
@input="handlePhoneInput"
|
|
169
153
|
>
|
|
170
154
|
<template #append-inner>
|
|
171
155
|
<VIcon
|
|
@@ -96,21 +96,6 @@ describe('PhoneField', () => {
|
|
|
96
96
|
expect(wrapper.vm.hasError).toBe(false)
|
|
97
97
|
})
|
|
98
98
|
|
|
99
|
-
it('updates phoneNumber when modelValue prop changes', async () => {
|
|
100
|
-
const wrapper = mount(PhoneField, {
|
|
101
|
-
global: {
|
|
102
|
-
plugins: [vuetify],
|
|
103
|
-
},
|
|
104
|
-
props: {
|
|
105
|
-
modelValue: '1234567890',
|
|
106
|
-
},
|
|
107
|
-
})
|
|
108
|
-
|
|
109
|
-
await wrapper.setProps({ modelValue: '0987654321' })
|
|
110
|
-
|
|
111
|
-
expect(wrapper.vm.phoneNumber).toBe('0987654321')
|
|
112
|
-
})
|
|
113
|
-
|
|
114
99
|
it('uses only custom indicatifs when useCustomIndicatifsOnly is true', () => {
|
|
115
100
|
const customIndicatifs = [{ code: '+99', abbreviation: 'XX', country: 'Testland', phoneLength: 10 }]
|
|
116
101
|
const wrapper = mount(PhoneField, {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Meta, Story } from '@storybook/addon-docs';
|
|
2
|
+
import * as AccessStories from './Accessibilite.stories.ts';
|
|
3
|
+
|
|
4
|
+
<Meta of={AccessStories} />
|
|
5
|
+
|
|
6
|
+
Accessibilité
|
|
7
|
+
=============
|
|
8
|
+
<Story of={AccessStories.Legende} />
|
|
9
|
+
<br />
|
|
10
|
+
|
|
11
|
+
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
12
|
+
|
|
13
|
+
<Story of={AccessStories.AccessibilitePanel} />
|
|
14
|
+
<br />
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { VExpansionPanels, VExpansionPanel, VExpansionPanelTitle, VExpansionPanelText, VDataTable, VIcon } from 'vuetify/components'
|
|
2
|
+
import type { StoryObj } from '@storybook/vue3'
|
|
3
|
+
import { AccessibiliteItemsIndeterminate, AccessibiliteItemsValidated } from './AccessibiliteItems'
|
|
4
|
+
import { mdiCheckboxMarkedCircle, mdiLink, mdiEye } from '@mdi/js'
|
|
5
|
+
|
|
6
|
+
const checkIcon = mdiCheckboxMarkedCircle
|
|
7
|
+
const iconEye = mdiEye
|
|
8
|
+
const linkICon = mdiLink
|
|
9
|
+
|
|
10
|
+
export default {
|
|
11
|
+
title: 'Composants/Formulaires/RangeField/Accessibilité',
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const AccessibilitePanel: StoryObj = {
|
|
15
|
+
|
|
16
|
+
render: () => {
|
|
17
|
+
return {
|
|
18
|
+
components: { VExpansionPanels, VExpansionPanel, VExpansionPanelTitle, VExpansionPanelText, VDataTable, VIcon },
|
|
19
|
+
|
|
20
|
+
setup() {
|
|
21
|
+
const icon = checkIcon
|
|
22
|
+
|
|
23
|
+
return { AccessibiliteItemsIndeterminate, AccessibiliteItemsValidated, icon, linkICon, iconEye }
|
|
24
|
+
},
|
|
25
|
+
template: `
|
|
26
|
+
<div class="accessibiliteItems" style="display:flex; max-width: none !important;">
|
|
27
|
+
<v-col cols="6">
|
|
28
|
+
<div style="display:flex; margin-bottom: 10px; justify-content: space-between; align-items: center;">
|
|
29
|
+
<h5>{{ AccessibiliteItemsIndeterminate.length }} critères à prendre en charge par le projet</h5>
|
|
30
|
+
<div style="display: flex; align-items: center;">
|
|
31
|
+
<v-btn variant="tonal" color="red" size="x-small" style="margin: 4px;font-size: 8px;"
|
|
32
|
+
rounded>Tanaguru
|
|
33
|
+
</v-btn>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<v-expansion-panels value="opened" multiple>
|
|
38
|
+
<v-expansion-panel v-for="(item, index) in AccessibiliteItemsIndeterminate" :key="index" style="background-color: rgba(42, 96, 158, 0.1); margin-bottom: 10px;">
|
|
39
|
+
<v-expansion-panel-title>
|
|
40
|
+
<VIcon :icon="iconEye" style="margin-right: 5px; color:#5778b7;"/>
|
|
41
|
+
{{ item.title }}
|
|
42
|
+
</v-expansion-panel-title>
|
|
43
|
+
<v-expansion-panel-text>
|
|
44
|
+
<v-expansion-panels>
|
|
45
|
+
<v-expansion-panel v-for="(i, index) in item.items2" :key="i" style="margin-bottom: 10px;">
|
|
46
|
+
<v-expansion-panel-title
|
|
47
|
+
style="font-weight: bold; font-size: 13px; line-height: 16px;">
|
|
48
|
+
{{ i.subtitle}}
|
|
49
|
+
</v-expansion-panel-title>
|
|
50
|
+
<v-expansion-panel-text>
|
|
51
|
+
<div>
|
|
52
|
+
<p style="font-size: 13px;line-height: 16px;">
|
|
53
|
+
{{ i.precision }}
|
|
54
|
+
</p>
|
|
55
|
+
<div v-for="(value, index) in i.solution"
|
|
56
|
+
style="margin-top:15px; font-size: 13px;line-height: 16px;">
|
|
57
|
+
<p style="font-weight: bold;">Méthodologie du test : <a
|
|
58
|
+
href="{{i.link}}" target="blank">
|
|
59
|
+
<VIcon :icon="linkICon"/>
|
|
60
|
+
</a></p>
|
|
61
|
+
<p>{{ value.info1 }}</p>
|
|
62
|
+
<p>{{ value.info2 }}</p>
|
|
63
|
+
<p>{{ value.info3 }}</p>
|
|
64
|
+
<p>{{ value.info4 }}</p>
|
|
65
|
+
|
|
66
|
+
</div>
|
|
67
|
+
<span style="display:flex; justify-content:center; margin-bottom:5px;">______</span>
|
|
68
|
+
</div>
|
|
69
|
+
</v-expansion-panel-text>
|
|
70
|
+
</v-expansion-panel>
|
|
71
|
+
<v-expansion-panel >
|
|
72
|
+
<v-expansion-panel-title
|
|
73
|
+
style="font-weight: bold; font-size: 13px; line-height: 16px;">
|
|
74
|
+
{{ item.subtitle }}
|
|
75
|
+
</v-expansion-panel-title>
|
|
76
|
+
<v-expansion-panel-text>
|
|
77
|
+
<div v-for="(value, i) in item.items" :key="i">
|
|
78
|
+
<p style="font-size: 13px;line-height: 16px;">
|
|
79
|
+
{{ value.precision }}
|
|
80
|
+
</p>
|
|
81
|
+
<div v-for="element in value.solution"
|
|
82
|
+
style="margin-top:15px; font-size: 13px;line-height: 16px;">
|
|
83
|
+
<p style="font-weight: bold;">Méthodologie du test : <a
|
|
84
|
+
href="value.link" target="blank">
|
|
85
|
+
<VIcon :icon="linkICon"/>
|
|
86
|
+
</a></p>
|
|
87
|
+
<p>{{ element.info1 }}</p>
|
|
88
|
+
<p>{{ element.info2 }}</p>
|
|
89
|
+
<p>{{ element.info3 }}</p>
|
|
90
|
+
</div>
|
|
91
|
+
<span style="display:flex; justify-content:center; margin-bottom:5px;">______</span>
|
|
92
|
+
</div>
|
|
93
|
+
</v-expansion-panel-text>
|
|
94
|
+
</v-expansion-panel>
|
|
95
|
+
</v-expansion-panels>
|
|
96
|
+
</v-expansion-panel-text>
|
|
97
|
+
</v-expansion-panel>
|
|
98
|
+
</v-expansion-panels>
|
|
99
|
+
</v-col>
|
|
100
|
+
<v-col cols="6">
|
|
101
|
+
<div style="display:flex; margin-bottom: 10px; justify-content: space-between; align-items: center;">
|
|
102
|
+
<h5>{{ AccessibiliteItemsValidated.length }} critères pris en charge par l'équipe Design System</h5>
|
|
103
|
+
<div style="display: flex; align-items: center;">
|
|
104
|
+
<v-btn variant="tonal" color="red" size="x-small" style="margin: 4px;font-size: 8px;"
|
|
105
|
+
rounded>Tanaguru
|
|
106
|
+
</v-btn>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
<v-expansion-panels v-if="AccessibiliteItemsValidated.length > 0" value="opened" multiple>
|
|
110
|
+
<v-expansion-panel
|
|
111
|
+
v-for="(item, index) in AccessibiliteItemsValidated"
|
|
112
|
+
:key="index" style="background-color: rgba(53,135,0,0.1); margin-bottom: 10px;">
|
|
113
|
+
<v-expansion-panel-title>
|
|
114
|
+
<VIcon color="green" :icon="icon" style="margin-right: 5px;"/>
|
|
115
|
+
{{ item.title }}
|
|
116
|
+
</v-expansion-panel-title>
|
|
117
|
+
<v-expansion-panel-text>
|
|
118
|
+
<v-expansion-panels>
|
|
119
|
+
<v-expansion-panel>
|
|
120
|
+
<v-expansion-panel-title style="font-weight: bold;font-size: 13px; line-height: 16px;">
|
|
121
|
+
{{ item.subtitle }}
|
|
122
|
+
</v-expansion-panel-title>
|
|
123
|
+
<v-expansion-panel-text>
|
|
124
|
+
<div v-for="(value, i) in item.items" :key="i">
|
|
125
|
+
<p style="font-size: 13px;line-height: 16px;">
|
|
126
|
+
{{ value.precision }}
|
|
127
|
+
</p>
|
|
128
|
+
<div v-for="element in value.solution"
|
|
129
|
+
style="margin-top:15px; font-size: 13px;line-height: 16px;">
|
|
130
|
+
<p style="font-weight: bold;">Méthodologie du test : <a
|
|
131
|
+
href="value.link" target="blank">
|
|
132
|
+
<VIcon :icon="linkICon"/>
|
|
133
|
+
</a></p>
|
|
134
|
+
<p>{{ element.info1 }}</p>
|
|
135
|
+
<p>{{ element.info2 }}</p>
|
|
136
|
+
<p>{{ element.info3 }}</p>
|
|
137
|
+
</div>
|
|
138
|
+
<span style="display:flex; justify-content:center; margin-bottom:5px;">______</span>
|
|
139
|
+
</div>
|
|
140
|
+
</v-expansion-panel-text>
|
|
141
|
+
</v-expansion-panel>
|
|
142
|
+
</v-expansion-panels>
|
|
143
|
+
</v-expansion-panel-text>
|
|
144
|
+
</v-expansion-panel>
|
|
145
|
+
</v-expansion-panels>
|
|
146
|
+
<div v-else style="display: flex;justify-content: center;"><span style="text-align:center;" >Pas de critère d'accessibilité bloquant</span></div>
|
|
147
|
+
</v-col>
|
|
148
|
+
</div>
|
|
149
|
+
`,
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
tags: ['!dev'],
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export const Legende: StoryObj = {
|
|
156
|
+
args: {
|
|
157
|
+
icon: checkIcon,
|
|
158
|
+
},
|
|
159
|
+
render: (args) => {
|
|
160
|
+
return {
|
|
161
|
+
components: { VIcon },
|
|
162
|
+
setup() {
|
|
163
|
+
return { args }
|
|
164
|
+
},
|
|
165
|
+
template: `
|
|
166
|
+
<p style="color: grey;font-size: 11px; margin-bottom: 12px;">Date de conception: 20/11/2024</p>
|
|
167
|
+
<div>
|
|
168
|
+
<p>Le tableau ci-dessous liste nos recommandations suivant les <a target="blank" style="color:#0C41BD;" href="https://www.numerique.gouv.fr/publications/rgaa-accessibilite/#contenu">catégories du RGAA</a>.</p>
|
|
169
|
+
<p style="margin-bottom: 12px;font-weight:bold;">Pour rappel le composant seul ne garantie pas
|
|
170
|
+
l'accessibilité du site.</p>
|
|
171
|
+
<div style="font-size: 14px">
|
|
172
|
+
<p>Nous avons deux façons de relever les problèmes d'accessibilité des composants :</p>
|
|
173
|
+
<div>
|
|
174
|
+
<v-btn variant="tonal" color="grey" size="x-small" style="margin: 2px;font-size: 8px;" rounded>
|
|
175
|
+
Audit
|
|
176
|
+
</v-btn>
|
|
177
|
+
Problèmes relevés par le projet
|
|
178
|
+
</div>
|
|
179
|
+
<div>
|
|
180
|
+
<v-btn variant="tonal" color="red" size="x-small" style="margin: 2px;font-size: 8px;" rounded>
|
|
181
|
+
Tanaguru
|
|
182
|
+
</v-btn>
|
|
183
|
+
Problèmes relevés par Tanaguru
|
|
184
|
+
</div>
|
|
185
|
+
</div>
|
|
186
|
+
</div>
|
|
187
|
+
`,
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
tags: ['!dev'],
|
|
191
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { ExpertiseLevelEnum } from './constants/ExpertiseLevelEnum'
|
|
2
|
+
|
|
3
|
+
export const AccessibiliteItemsIndeterminate = [
|
|
4
|
+
{
|
|
5
|
+
title: 'Catégorie 3 : Couleurs',
|
|
6
|
+
subtitle: '3.2 Dans chaque page web, le contraste entre la couleur du texte et la couleur de son arrière-plan est-il suffisamment élevé?',
|
|
7
|
+
|
|
8
|
+
items2: [
|
|
9
|
+
{
|
|
10
|
+
subtitle: '3.1 Dans chaque page web, l’information ne doit pas être donnée uniquement par la couleur. Cette règle est-elle respectée ?',
|
|
11
|
+
precision: '3.1.2 Pour chaque indication de couleur donnée par un texte, l’information ne doit pas être donnée uniquement par la couleur. Cette règle est-elle respectée ?',
|
|
12
|
+
link: 'https://accessibilite.numerique.gouv.fr/methode/criteres-et-tests/#3.1.2',
|
|
13
|
+
solution: [{
|
|
14
|
+
info1: '1. Retrouver dans le document les textes et les textes en image sans effet de graisse d’une taille restituée inférieure à 24px qui pourraient poser des problèmes de contraste ;',
|
|
15
|
+
info2: '2. Pour chacun de ces textes, vérifier que : Soit le rapport de contraste entre le texte et son arrière-plan est de 4.5:1, au moins; Soit un mécanisme permet à l’utilisateur d’afficher le texte avec un rapport de contraste de 4.5:1, au moins.',
|
|
16
|
+
info3: '3. Si c’est le cas pour chaque texte, le test est validé',
|
|
17
|
+
}],
|
|
18
|
+
expertise: ExpertiseLevelEnum.DEV,
|
|
19
|
+
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
],
|
|
23
|
+
items: [
|
|
24
|
+
{
|
|
25
|
+
precision: '3.2.1 Dans chaque page web, le texte et le texte en image sans effet de graisse d’une taille restituée inférieure à 24px vérifient-ils une de ces conditions? Le rapport de contraste entre le texte et son arrière-plan est de 4.5:1, au moins; Un mécanisme permet à l’utilisateur d’afficher le texte avec un rapport de contraste de 4.5:1, au moins.',
|
|
26
|
+
link: 'https://accessibilite.numerique.gouv.fr/methode/criteres-et-tests/#3.2.1',
|
|
27
|
+
solution: [{
|
|
28
|
+
info1: '1. Retrouver dans le document les textes et les textes en image sans effet de graisse d’une taille restituée inférieure à 24px qui pourraient poser des problèmes de contraste ;',
|
|
29
|
+
info2: '2. Pour chacun de ces textes, vérifier que : Soit le rapport de contraste entre le texte et son arrière-plan est de 4.5:1, au moins; Soit un mécanisme permet à l’utilisateur d’afficher le texte avec un rapport de contraste de 4.5:1, au moins.',
|
|
30
|
+
info3: '3. Si c’est le cas pour chaque texte, le test est validé',
|
|
31
|
+
}],
|
|
32
|
+
expertise: ExpertiseLevelEnum.DEV,
|
|
33
|
+
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
title: 'Catégorie 10 : Présentation de l’information',
|
|
40
|
+
subtitle: '10.1 Dans le site web, des feuilles de styles sont-elles utilisées pour contrôler la présentation de l’information ? ?',
|
|
41
|
+
items: [
|
|
42
|
+
|
|
43
|
+
{
|
|
44
|
+
precision: '10.1.1 Dans chaque page web, les balises servant à la présentation de l’information ne doivent pas être présentes dans le code source généré des pages. Cette règle est-elle respectée ? ',
|
|
45
|
+
link: 'https://accessibilite.numerique.gouv.fr/methode/criteres-et-tests/#10.1.1',
|
|
46
|
+
solution: [{
|
|
47
|
+
info1: '1. Vérifier l’absence des éléments de présentation <basefont>, <big>, <blink>, <center>, <font>, <marquee>, <s>, <strike>, <tt> ; ',
|
|
48
|
+
info2: '2. Vérifier l’absence de l’élément <u> uniquement si le DOCTYPE du document ne correspond pas à HTML 5 ; ',
|
|
49
|
+
info3: '3. Si c’est le cas, le test est validé',
|
|
50
|
+
}],
|
|
51
|
+
expertise: ExpertiseLevelEnum.DEV,
|
|
52
|
+
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
title: 'Catégorie 11 : Formulaires',
|
|
59
|
+
subtitle: '11.2 Chaque étiquette associée à un champ de formulaire est-elle pertinente (hors cas particuliers) ? ',
|
|
60
|
+
|
|
61
|
+
items2: [
|
|
62
|
+
|
|
63
|
+
{
|
|
64
|
+
|
|
65
|
+
subtitle: '11.13 La finalité d’un champ de saisie peut-elle être déduite pour faciliter le remplissage automatique des champs avec les données de l’utilisateur ? ',
|
|
66
|
+
precision: '11.13.1 Chaque champ de formulaire dont l’objet se rapporte à une information concernant l’utilisateur vérifie-t-il ces conditions ? '
|
|
67
|
+
+ 'Le champ de formulaire possède un attribut autocomplete ; '
|
|
68
|
+
+ 'L’attribut autocomplete est pourvu d’une valeur présente dans la liste des valeurs possibles pour l’attribut autocomplete associés à un champ de formulaire ; '
|
|
69
|
+
+ 'La valeur indiquée pour l’attribut autocomplete est pertinente au regard du type d’information attendu. ',
|
|
70
|
+
link: 'https://accessibilite.numerique.gouv.fr/methode/criteres-et-tests/#11.13.1',
|
|
71
|
+
solution: [{
|
|
72
|
+
info1: '1. Retrouver dans le document les champs de formulaire qui se rapportent à une information concernant l’utilisateur (nom, prénom, numéro de téléphone, etc.) ; ',
|
|
73
|
+
info2: '2. Pour chaque champ de formulaire, vérifier que : Le champ de formulaire possède un attribut autocomplete ; L’attribut autocomplete est pourvu d’une valeur présente dans la liste des valeurs possibles; La valeur indiquée pour l’attribut autocomplete est pertinente au regard du type d’information attendu.',
|
|
74
|
+
info3: '3. Si c’est le cas pour chaque champ de formulaire retrouvé, le test est validé.',
|
|
75
|
+
}],
|
|
76
|
+
expertise: ExpertiseLevelEnum.DEV,
|
|
77
|
+
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
],
|
|
81
|
+
items: [
|
|
82
|
+
{
|
|
83
|
+
precision: '11.2.2 Chaque attribut title permet-il de connaître la fonction exacte du champ de formulaire auquel il est associé',
|
|
84
|
+
link: 'https://accessibilite.numerique.gouv.fr/methode/criteres-et-tests/#11.2.2',
|
|
85
|
+
solution: [{
|
|
86
|
+
info1: '1. Retrouver dans le document les champs de formulaire dont l’étiquette est fournie par un attribut title ; ',
|
|
87
|
+
info2: '2. Pour chaque champ de formulaire, vérifier que le contenu de l’attribut est pertinent ; ',
|
|
88
|
+
info3: '3. Si c’est le cas pour chaque champ de formulaire, le test est validé.',
|
|
89
|
+
}],
|
|
90
|
+
expertise: ExpertiseLevelEnum.DEV,
|
|
91
|
+
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
|
|
95
|
+
precision: ' 11.2.3 Chaque étiquette implémentée via l’attribut WAI-ARIA aria-label permet-elle de connaître la fonction exacte du champ de formulaire auquel elle est associée ? ',
|
|
96
|
+
link: 'https://accessibilite.numerique.gouv.fr/methode/criteres-et-tests/#11.2.3',
|
|
97
|
+
solution: [{
|
|
98
|
+
info1: '1. Retrouver dans le document les champs de formulaire dont l’étiquette est fournie par un attribut WAI-ARIA aria-label ; ',
|
|
99
|
+
info2: '2. Pour chaque champ de formulaire, vérifier que le contenu de l’attribut est pertinent ; ',
|
|
100
|
+
info3: '3. Si c’est le cas pour chaque champ de formulaire, le test est validé.',
|
|
101
|
+
}],
|
|
102
|
+
expertise: ExpertiseLevelEnum.DEV,
|
|
103
|
+
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
precision: '11.2.5 Chaque champ de formulaire ayant un intitulé visible vérifie-t-il ces conditions (hors cas particuliers) ? '
|
|
107
|
+
+ 'S’il est présent, le contenu de l’attribut WAI-ARIA aria-label du champ de formulaire contient au moins l’intitulé visible ; '
|
|
108
|
+
+ 'S’il est présent, le passage de texte lié au champ de formulaire via un attribut WAI-ARIA aria-labelledby contient au moins l’intitulé visible ; '
|
|
109
|
+
+ 'S’il est présent, le contenu de l’attribut title du champ de formulaire contient au moins l’intitulé visible ; '
|
|
110
|
+
+ 'S’il est présent le contenu de la balise <label> associé au champ de formulaire contient au moins l’intitulé visible.',
|
|
111
|
+
link: 'https://accessibilite.numerique.gouv.fr/methode/criteres-et-tests/#11.2.5',
|
|
112
|
+
solution: [{
|
|
113
|
+
info1: '1. Retrouver dans le document les champs de formulaire dont l’étiquette est fournie à la fois par un intitulé visible et par le contenu soit d’un élément <label>, soit d’un attribut title ou d’un attribut aria-label ou d’un attribut aria-labelledby ; ',
|
|
114
|
+
info2: '2. Pour chaque champ de formulaire, vérifier que le contenu de l’élément <label> ou de l’attribut title ou de l’attribut aria-label ou de l’attribut aria-labelledby contient l’intitulé visible ; ',
|
|
115
|
+
info3: '3. Si c’est le cas pour chaque champ de formulaire, le test est validé. ',
|
|
116
|
+
}],
|
|
117
|
+
expertise: ExpertiseLevelEnum.DEV,
|
|
118
|
+
|
|
119
|
+
},
|
|
120
|
+
],
|
|
121
|
+
|
|
122
|
+
},
|
|
123
|
+
|
|
124
|
+
]
|
|
125
|
+
|
|
126
|
+
export const AccessibiliteItemsValidated = [
|
|
127
|
+
|
|
128
|
+
{
|
|
129
|
+
title: 'Catégorie 8 : Eléments Obligatoires',
|
|
130
|
+
subtitle: '8.9 Dans chaque page web, les balises ne doivent pas être utilisées uniquement à des fins de présentation',
|
|
131
|
+
items: [
|
|
132
|
+
|
|
133
|
+
{
|
|
134
|
+
precision: ' 8.9.1 Dans chaque page web les balises (à l’exception de <div>, <span> et <table>) ne doivent pas être utilisées uniquement à des fins de présentation. Cette règle est-elle respectée',
|
|
135
|
+
link: 'https://accessibilite.numerique.gouv.fr/methode/criteres-et-tests/#8.9.1',
|
|
136
|
+
solution: [{
|
|
137
|
+
info1: '1. Retrouver dans le document l’ensemble des éléments sémantiques utilisés à des fins de présentation ;',
|
|
138
|
+
info2: '2. Pour chacun de ces éléments, vérifier que :'
|
|
139
|
+
+ 'L’élément est pourvu d’un attribut role=“presentation” ;'
|
|
140
|
+
+ 'L’utilisation de cet élément à des fins de présentation reste justifée',
|
|
141
|
+
info3: '3. Si c’est le cas, le test est validé',
|
|
142
|
+
}],
|
|
143
|
+
expertise: ExpertiseLevelEnum.DESIGN,
|
|
144
|
+
|
|
145
|
+
},
|
|
146
|
+
|
|
147
|
+
],
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
title: 'Catégorie 11 : Formulaires',
|
|
151
|
+
subtitle: '11.1 Chaque champ de formulaire a-t-il une étiquette ',
|
|
152
|
+
items: [
|
|
153
|
+
{
|
|
154
|
+
precision: '11.1.1 Chaque champ de formulaire vérifie-t-il une de ces conditions ? '
|
|
155
|
+
+ 'Le champ de formulaire possède un attribut WAI-ARIA aria-labelledby référençant un passage de texte identifié ; '
|
|
156
|
+
+ 'Le champ de formulaire possède un attribut WAI-ARIA aria-label ; '
|
|
157
|
+
+ 'Une balise <label> ayant un attribut for est associée au champ de formulaire ; '
|
|
158
|
+
+ 'Le champ de formulaire possède un attribut title ; '
|
|
159
|
+
+ 'Un bouton adjacent au champ de formulaire lui fournit une étiquette visible et un élément <label> visuellement caché ou un attribut WAI-ARIA aria-label, aria-labelledby ou title lui fournit un nom accessible.',
|
|
160
|
+
link: 'https://accessibilite.numerique.gouv.fr/methode/criteres-et-tests/#11.1.1',
|
|
161
|
+
solution: [{
|
|
162
|
+
info1: '1. Retrouver dans le document les champs de formulaire ; ',
|
|
163
|
+
info2: '2. Pour chaque champ de formulaire, vérifier que le champ de formulaire : '
|
|
164
|
+
+ 'Possède un attribut WAI-ARIA aria-labelledby référençant un passage de texte identifié ; '
|
|
165
|
+
+ 'Possède un attribut WAI-ARIA aria-label ; '
|
|
166
|
+
+ 'Est associé à un élément <label> ayant un attribut for ; '
|
|
167
|
+
+ 'Possède un attribut title ; '
|
|
168
|
+
+ 'Un bouton adjacent au champ de formulaire lui fournit une étiquette visible et un élément <label> visuellement caché ou un attribut WAI-ARIA aria-label, aria-labelledby ou title lui fournit un nom accessible. ',
|
|
169
|
+
info3: '3. Si c’est le cas pour champ de formulaire, le test est validé. ',
|
|
170
|
+
}],
|
|
171
|
+
expertise: ExpertiseLevelEnum.DESIGN,
|
|
172
|
+
|
|
173
|
+
},
|
|
174
|
+
|
|
175
|
+
],
|
|
176
|
+
|
|
177
|
+
},
|
|
178
|
+
|
|
179
|
+
]
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import {Controls, Canvas, Meta, Source} from '@storybook/blocks';
|
|
2
|
+
import * as RangeFieldStories from './RangeField.stories.ts';
|
|
3
|
+
|
|
4
|
+
<Meta of={RangeFieldStories} />
|
|
5
|
+
|
|
6
|
+
# RangeField
|
|
7
|
+
|
|
8
|
+
Le composant RangeField est utilisé pour permettre à l'utilisateur de sélectionner un interval.
|
|
9
|
+
|
|
10
|
+
<Canvas of={RangeFieldStories.Default} />
|
|
11
|
+
|
|
12
|
+
# Api
|
|
13
|
+
|
|
14
|
+
<Controls of={RangeFieldStories.Default} />
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# Personnalisation des limites
|
|
18
|
+
|
|
19
|
+
Vous pouvez personnaliser les limites de l'intervalle en utilisant les props `min` et `max`.
|
|
20
|
+
|
|
21
|
+
<Canvas
|
|
22
|
+
of={RangeFieldStories.OtherRange}
|
|
23
|
+
source={{
|
|
24
|
+
language: 'html',
|
|
25
|
+
format: 'dedent',
|
|
26
|
+
code: `
|
|
27
|
+
<script setup lang="ts">
|
|
28
|
+
import { ref } from 'vue'
|
|
29
|
+
import { RangeField } from '@cnamts/synapse'
|
|
30
|
+
|
|
31
|
+
const range = ref([0, 100])
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<template>
|
|
35
|
+
<RangeField
|
|
36
|
+
v-model="range"
|
|
37
|
+
min="-50"
|
|
38
|
+
max="50"
|
|
39
|
+
/>
|
|
40
|
+
</template>
|
|
41
|
+
`
|
|
42
|
+
}}
|
|
43
|
+
/>
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
# Personnalisation des composants Vuetify
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
Vous pouvez personnaliser les composants Vuetify `VTextField` utilisés dans le composant RangeField en utilisant la props `vuetifyOptions`.
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
<Canvas
|
|
53
|
+
of={RangeFieldStories.Customization}
|
|
54
|
+
/>
|