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