Skip to content

Commit

Permalink
chore: fix prop types error
Browse files Browse the repository at this point in the history
  • Loading branch information
KaelWD committed May 18, 2023
1 parent 8e2dc26 commit c759e8c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 13 deletions.
8 changes: 4 additions & 4 deletions packages/vuetify/src/components/VRangeSlider/VRangeSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,17 @@ export const VRangeSlider = genericComponent<VSliderSlots>()({
<input
id={ `${id.value}_start` }
name={ props.name || id.value }
disabled={ props.disabled }
readonly={ props.readonly }
disabled={ !!props.disabled }
readonly={ !!props.readonly }
tabindex="-1"
value={ model.value[0] }
/>

<input
id={ `${id.value}_stop` }
name={ props.name || id.value }
disabled={ props.disabled }
readonly={ props.readonly }
disabled={ !!props.disabled }
readonly={ !!props.readonly }
tabindex="-1"
value={ model.value[1] }
/>
Expand Down
4 changes: 2 additions & 2 deletions packages/vuetify/src/components/VSlider/VSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ export const VSlider = genericComponent<VSliderSlots>()({
<input
id={ id.value }
name={ props.name || id.value }
disabled={ props.disabled }
readonly={ props.readonly }
disabled={ !!props.disabled }
readonly={ !!props.readonly }
tabindex="-1"
value={ model.value }
/>
Expand Down
2 changes: 1 addition & 1 deletion packages/vuetify/src/components/VSlider/VSliderThumb.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export const VSliderThumb = genericComponent<VSliderThumbSlots>()({
aria-valuemin={ props.min }
aria-valuemax={ props.max }
aria-valuenow={ props.modelValue }
aria-readonly={ readonly.value }
aria-readonly={ !!readonly.value }
aria-orientation={ direction.value }
onKeydown={ !readonly.value ? onKeydown : undefined }
>
Expand Down
14 changes: 10 additions & 4 deletions packages/vuetify/src/components/VSlider/slider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type SliderProvide = {
color: Ref<string | undefined>
decimals: Ref<number>
direction: Ref<'vertical' | 'horizontal'>
disabled: Ref<boolean | undefined>
disabled: Ref<boolean | null | undefined>
elevation: Ref<number | string | undefined>
min: Ref<number>
max: Ref<number>
Expand All @@ -33,7 +33,7 @@ type SliderProvide = {
onSliderTouchstart: (e: TouchEvent) => void
parseMouseMove: (e: MouseEvent | TouchEvent) => number
position: (val: number) => number
readonly: Ref<boolean | undefined>
readonly: Ref<boolean | null | undefined>
rounded: Ref<boolean | number | string | undefined>
roundValue: (value: number) => number
thumbLabel: Ref<boolean | string | undefined>
Expand Down Expand Up @@ -73,9 +73,15 @@ function getPosition (e: MouseEvent | TouchEvent, position: 'clientX' | 'clientY
}

export const makeSliderProps = propsFactory({
disabled: Boolean,
disabled: {
type: Boolean as PropType<boolean | null>,
default: null,
},
error: Boolean,
readonly: Boolean,
readonly: {
type: Boolean as PropType<boolean | null>,
default: null,
},
max: {
type: [Number, String],
default: 100,
Expand Down
4 changes: 2 additions & 2 deletions packages/vuetify/src/composables/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export interface ValidationProps {

export const makeValidationProps = propsFactory({
disabled: {
type: Boolean,
type: Boolean as PropType<boolean | null>,
default: null,
},
error: Boolean,
Expand All @@ -54,7 +54,7 @@ export const makeValidationProps = propsFactory({
name: String,
label: String,
readonly: {
type: Boolean,
type: Boolean as PropType<boolean | null>,
default: null,
},
rules: {
Expand Down

0 comments on commit c759e8c

Please sign in to comment.