@@ -204,31 +204,34 @@ export const BFormTimepicker = /*#__PURE__*/ Vue.extend({
204
204
computed : {
205
205
timeProps ( ) {
206
206
// Props we pass to BTime
207
+ // Use self for better minification, as `this` won't
208
+ // minimize and we reference it a lot below
209
+ const self = this
207
210
// TODO: Make the ID's computed props
208
- const idLabel = this . safeId ( '_value_' )
209
- const idWrapper = this . safeId ( '_b-form-time_' )
211
+ const idLabel = self . safeId ( '_value_' )
212
+ const idWrapper = self . safeId ( '_b-form-time_' )
210
213
return {
211
- hidden : ! this . visible ,
214
+ hidden : ! self . visible ,
212
215
ariaControls : [ idLabel , idWrapper ] . filter ( identity ) . join ( ' ' ) || null ,
213
- value : this . localHMS ,
214
- readonly : this . readonly ,
215
- disabled : this . disabled ,
216
- locale : this . locale ,
217
- hour12 : this . hour12 ,
218
- hideHeader : this . hideHeader ,
219
- showSeconds : this . showSeconds ,
220
- secondsStep : this . secondsStep ,
221
- minutesStep : this . minutesStep ,
222
- labelNoTime : this . labelNoTime ,
223
- labelSelected : this . labelSelected ,
224
- labelHours : this . labelHours ,
225
- labelMinutes : this . labelMinutes ,
226
- labelSeconds : this . labelSeconds ,
227
- labelAmpm : this . labelAmpm ,
228
- labelAm : this . labelAm ,
229
- labelPm : this . labelPm ,
230
- labelIncrement : this . labelIncrement ,
231
- labelDecrement : this . labelDecrement ,
216
+ value : self . localHMS ,
217
+ readonly : self . readonly ,
218
+ disabled : self . disabled ,
219
+ locale : self . locale ,
220
+ hour12 : self . hour12 ,
221
+ hideHeader : self . hideHeader ,
222
+ showSeconds : self . showSeconds ,
223
+ secondsStep : self . secondsStep ,
224
+ minutesStep : self . minutesStep ,
225
+ labelNoTime : self . labelNoTime ,
226
+ labelSelected : self . labelSelected ,
227
+ labelHours : self . labelHours ,
228
+ labelMinutes : self . labelMinutes ,
229
+ labelSeconds : self . labelSeconds ,
230
+ labelAmpm : self . labelAmpm ,
231
+ labelAm : self . labelAm ,
232
+ labelPm : self . labelPm ,
233
+ labelIncrement : self . labelIncrement ,
234
+ labelDecrement : self . labelDecrement
232
235
}
233
236
}
234
237
} ,
@@ -299,16 +302,21 @@ export const BFormTimepicker = /*#__PURE__*/ Vue.extend({
299
302
render ( h ) {
300
303
const size = this . size
301
304
const state = this . state
305
+ const visible = this . visible
302
306
const localHMS = this . localHMS
303
307
const disabled = this . disabled
304
308
const readonly = this . readonly
309
+ const required = this . required
310
+ const hasFocus = this . hasFocus
311
+ const isHovered = this . isHovered
312
+ // These should be computed props?
305
313
const idButton = this . safeId ( )
306
314
const idLabel = this . safeId ( '_value_' )
307
315
const idMenu = this . safeId ( '_dialog_' )
308
316
const idWrapper = this . safeId ( '_b-form-time_' )
309
317
310
318
let $button = h ( 'div' , { attrs : { 'aria-hidden' : 'true' } } , [
311
- this . isHovered || this . hasFocus
319
+ isHovered || hasFocus
312
320
? h ( BIconClockFill , { props : { scale : 1.25 } } )
313
321
: h ( BIconClock , { props : { scale : 1.25 } } )
314
322
] )
@@ -323,9 +331,9 @@ export const BFormTimepicker = /*#__PURE__*/ Vue.extend({
323
331
type : 'button' ,
324
332
disabled : disabled ,
325
333
'aria-haspopup' : 'dialog' ,
326
- 'aria-expanded' : this . visible ? 'true' : 'false' ,
334
+ 'aria-expanded' : visible ? 'true' : 'false' ,
327
335
'aria-invalid' : state === false ? 'true' : null ,
328
- 'aria-required' : this . required ? 'true' : null
336
+ 'aria-required' : required ? 'true' : null
329
337
} ,
330
338
on : {
331
339
mousedown : this . onMousedown ,
@@ -357,7 +365,7 @@ export const BFormTimepicker = /*#__PURE__*/ Vue.extend({
357
365
dir : this . isRTL ? 'rtl' : 'ltr' ,
358
366
lang : this . localLocale || null ,
359
367
'aria-invalid' : state === false ? 'true' : null ,
360
- 'aria-required' : this . required ? 'true' : null
368
+ 'aria-required' : required ? 'true' : null
361
369
} ,
362
370
on : {
363
371
// Disable bubbling of the click event to
@@ -369,7 +377,7 @@ export const BFormTimepicker = /*#__PURE__*/ Vue.extend({
369
377
} ,
370
378
[
371
379
// Add the formatted value or placeholder
372
- localHMS ? this . formattedValue : this . placeholder || this . labelNoTime ,
380
+ localHMS ? this . formattedValue : this . placeholder || this . labelNoTime || '\u00A0' ,
373
381
// Add an sr-only 'selected date' label if a date is selected
374
382
localHMS ? h ( 'span' , { staticClass : 'sr-only' } , ` (${ this . labelSelected } ) ` ) : h ( )
375
383
]
@@ -416,7 +424,7 @@ export const BFormTimepicker = /*#__PURE__*/ Vue.extend({
416
424
h (
417
425
BButton ,
418
426
{
419
- props : { size : 'sm' , disabled : this . disabled , variant : this . closeButtonVariant } ,
427
+ props : { size : 'sm' , disabled : disabled , variant : this . closeButtonVariant } ,
420
428
attrs : { 'aria-label' : closeLabel || null } ,
421
429
on : { click : this . onCloseButton }
422
430
} ,
@@ -497,8 +505,8 @@ export const BFormTimepicker = /*#__PURE__*/ Vue.extend({
497
505
class : [
498
506
this . directionClass ,
499
507
{
500
- show : this . visible ,
501
- focus : this . hasFocus ,
508
+ show : visible ,
509
+ focus : hasFocus ,
502
510
[ `form-control-${ size } ` ] : ! ! size ,
503
511
'is-invalid' : state === false ,
504
512
'is-valid' : state === true
0 commit comments