Skip to content

Commit bb6d24c

Browse files
committed
fix: 🐛 corrige les erreurs TS
1 parent 625646c commit bb6d24c

File tree

5 files changed

+12
-11
lines changed

5 files changed

+12
-11
lines changed

src/components/DsfrButton/DsfrButton.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const iconProps = computed(() => typeof props.icon === 'string'
4747
'inline-flex': !dsfrIcon,
4848
'reverse': iconRight && !dsfrIcon,
4949
'justify-center': !dsfrIcon && iconOnly,
50-
[icon]: dsfrIcon,
50+
[icon as string]: dsfrIcon,
5151
}"
5252
:title="iconOnly ? label : undefined"
5353
:disabled="disabled"

src/components/DsfrButton/DsfrButtonGroup.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ const groupStyle = computed(() => `--equisized-width: ${equisizedWidth.value};`)
3232
const computeEquisizedWidth = async () => {
3333
let maxWidth = 0
3434
await new Promise((resolve) => setTimeout(resolve, 100))
35-
buttonsEl.value?.querySelectorAll('.fr-btn').forEach((button: Element) => {
35+
buttonsEl.value?.querySelectorAll('.fr-btn').forEach((btn: Element) => {
36+
const button = btn as HTMLButtonElement
3637
const width = button.offsetWidth
3738
const buttonStyle = window.getComputedStyle(button)
3839
const marginLeft = +buttonStyle.marginLeft.replace('px', '')

src/components/DsfrNavigation/DsfrNavigationMenuLink.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const iconProps = computed(() => (dsfrIcon.value || !props.icon)
2525
? undefined
2626
: (typeof props.icon === 'string')
2727
? { scale: defaultScale, name: props.icon }
28-
: { scale: defaultScale, ...(props.icon || {}) },
28+
: { scale: defaultScale, ...((props.icon as Record<string, string>) || {}) },
2929
)
3030
</script>
3131

src/components/DsfrRange/DsfrRange.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ onMounted(() => {
135135
:disabled="disabled"
136136
:aria-labelledby="`${id}-label`"
137137
:aria-describedby="`${id}-messages`"
138-
@input="emit('update:lowerValue', +$event.target?.value)"
138+
@input="emit('update:lowerValue', +($event.target as HTMLInputElement)?.value)"
139139
>
140140
<input
141141
:id="id"
@@ -148,7 +148,7 @@ onMounted(() => {
148148
:disabled="disabled"
149149
:aria-labelledby="`${id}-label`"
150150
:aria-describedby="`${id}-messages`"
151-
@input="emit('update:modelValue', +$event.target?.value)"
151+
@input="emit('update:modelValue', +($event.target as HTMLInputElement)?.value)"
152152
>
153153

154154
<span

src/components/DsfrTooltip/DsfrTooltip.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ watch(show, async (value) => {
3232
3333
opacity.value = 0
3434
await new Promise(resolve => setTimeout(resolve, 100))
35-
const sourceTop = source.value?.offsetTop
36-
const sourceHeight = source.value?.offsetHeight
37-
const sourceWidth = source.value?.offsetWidth
38-
const sourceLeft = source.value?.offsetLeft
39-
const tooltipHeight = tooltip.value?.offsetHeight
40-
const tooltipWidth = tooltip.value?.offsetWidth
35+
const sourceTop = source.value?.offsetTop as number
36+
const sourceHeight = source.value?.offsetHeight as number
37+
const sourceWidth = source.value?.offsetWidth as number
38+
const sourceLeft = source.value?.offsetLeft as number
39+
const tooltipHeight = tooltip.value?.offsetHeight as number
40+
const tooltipWidth = tooltip.value?.offsetWidth as number
4141
const isSourceAtTop = (sourceTop - tooltipHeight) < 0
4242
const isSourceAtBottom = !isSourceAtTop && (sourceTop + sourceHeight + tooltipHeight) >= document.documentElement.offsetHeight
4343
top.value = isSourceAtBottom

0 commit comments

Comments
 (0)