@@ -3,6 +3,7 @@ import identity from '../../utils/identity'
3
3
import { getComponentConfig } from '../../utils/config'
4
4
import dropdownMixin from '../../mixins/dropdown'
5
5
import idMixin from '../../mixins/id'
6
+ import normalizeSlotMixin from '../../mixins/normalize-slot'
6
7
import { BButton } from '../button/button'
7
8
import { BTime } from '../time/time'
8
9
import { BIconClock , BIconClockFill } from '../../icons/icons'
@@ -182,7 +183,7 @@ export const BFormTimepicker = /*#__PURE__*/ Vue.extend({
182
183
BHover : VBHover
183
184
} ,
184
185
// The mixins order determines the order of appearance in the props reference section
185
- mixins : [ idMixin , propsMixin , dropdownMixin ] ,
186
+ mixins : [ idMixin , normalizeSlotMixin , propsMixin , dropdownMixin ] ,
186
187
model : {
187
188
prop : 'value' ,
188
189
event : 'input'
@@ -310,6 +311,16 @@ export const BFormTimepicker = /*#__PURE__*/ Vue.extend({
310
311
} ,
311
312
handleHover ( hovered ) /* istanbul ignore next: until tests written */ {
312
313
this . isHovered = hovered
314
+ } ,
315
+ // Render funtion helpers
316
+ defaultButtonFn ( scope ) {
317
+ return this . $createElement (
318
+ scope . isHovered || scope . hasFocus ? BIconClockFill : BIconClock ,
319
+ {
320
+ props : { scale : 1.25 } ,
321
+ attrs : { 'aria-hidden' : 'true' }
322
+ }
323
+ )
313
324
}
314
325
} ,
315
326
render ( h ) {
@@ -328,12 +339,8 @@ export const BFormTimepicker = /*#__PURE__*/ Vue.extend({
328
339
const idMenu = this . safeId ( '_dialog_' )
329
340
const idWrapper = this . safeId ( '_b-form-time_' )
330
341
331
- let $button = h ( 'div' , { attrs : { 'aria-hidden' : 'true' } } , [
332
- isHovered || hasFocus
333
- ? h ( BIconClockFill , { props : { scale : 1.25 } } )
334
- : h ( BIconClock , { props : { scale : 1.25 } } )
335
- ] )
336
- $button = h (
342
+ const btnScope = { isHovered, hasFocus, state, opened : visible }
343
+ const $button = h (
337
344
'button' ,
338
345
{
339
346
ref : 'toggle' ,
@@ -356,7 +363,11 @@ export const BFormTimepicker = /*#__PURE__*/ Vue.extend({
356
363
'!blur' : this . setFocus
357
364
}
358
365
} ,
359
- [ $button ]
366
+ [
367
+ this . hasNormalizedSlot ( 'button-content' )
368
+ ? this . normalizeSlot ( 'button-content' , btnScope )
369
+ : this . defaultButtonFn ( btnScope )
370
+ ]
360
371
)
361
372
362
373
// Label as a "fake" input
0 commit comments