@@ -3,7 +3,6 @@ import './VDatePickerMonth.sass'
3
3
4
4
// Components
5
5
import { VBtn } from '@/components/VBtn'
6
- import { VDefaultsProvider } from '@/components/VDefaultsProvider'
7
6
8
7
// Composables
9
8
import { makeCalendarProps , useCalendar } from '@/composables/calendar'
@@ -12,7 +11,7 @@ import { MaybeTransition } from '@/composables/transition'
12
11
13
12
// Utilities
14
13
import { computed , ref , shallowRef , watch } from 'vue'
15
- import { genericComponent , omit , propsFactory } from '@/util'
14
+ import { genericComponent , omit , propsFactory , useRender } from '@/util'
16
15
17
16
// Types
18
17
import type { PropType } from 'vue'
@@ -152,7 +151,7 @@ export const VDatePickerMonth = genericComponent<VDatePickerMonthSlots>()({
152
151
}
153
152
}
154
153
155
- return ( ) => (
154
+ useRender ( ( ) => (
156
155
< div class = "v-date-picker-month" >
157
156
{ props . showWeek && (
158
157
< div key = "weeks" class = "v-date-picker-month__weeks" >
@@ -188,6 +187,17 @@ export const VDatePickerMonth = genericComponent<VDatePickerMonthSlots>()({
188
187
{ daysInMonth . value . map ( ( item , i ) => {
189
188
const slotProps = {
190
189
props : {
190
+ class : 'v-date-picker-month__day-btn' ,
191
+ color : ( item . isSelected || item . isToday ) && ! item . isDisabled
192
+ ? props . color
193
+ : undefined ,
194
+ disabled : item . isDisabled ,
195
+ icon : true ,
196
+ ripple : false ,
197
+ text : item . localized ,
198
+ variant : item . isDisabled
199
+ ? item . isToday ? 'outlined' : 'text'
200
+ : item . isToday && ! item . isSelected ? 'outlined' : 'flat' ,
191
201
onClick : ( ) => onClick ( item . date ) ,
192
202
} ,
193
203
item,
@@ -212,38 +222,16 @@ export const VDatePickerMonth = genericComponent<VDatePickerMonthSlots>()({
212
222
] }
213
223
data-v-date = { ! item . isDisabled ? item . isoDate : undefined }
214
224
>
215
-
216
225
{ ( props . showAdjacentMonths || ! item . isAdjacent ) && (
217
- < VDefaultsProvider
218
- defaults = { {
219
- VBtn : {
220
- class : 'v-date-picker-month__day-btn' ,
221
- color : ( item . isSelected || item . isToday ) && ! item . isDisabled
222
- ? props . color
223
- : undefined ,
224
- disabled : item . isDisabled ,
225
- icon : true ,
226
- ripple : false ,
227
- text : item . localized ,
228
- variant : item . isDisabled
229
- ? item . isToday ? 'outlined' : 'text'
230
- : item . isToday && ! item . isSelected ? 'outlined' : 'flat' ,
231
- onClick : ( ) => onClick ( item . date ) ,
232
- } ,
233
- } }
234
- >
235
- { slots . day ?.( slotProps ) ?? (
236
- < VBtn { ...slotProps . props } />
237
- ) }
238
- </ VDefaultsProvider >
226
+ slots . day ?.( slotProps ) ?? ( < VBtn { ...slotProps . props } /> )
239
227
) }
240
228
</ div >
241
229
)
242
230
} ) }
243
231
</ div >
244
232
</ MaybeTransition >
245
233
</ div >
246
- )
234
+ ) )
247
235
} ,
248
236
} )
249
237
0 commit comments