@@ -44,20 +44,37 @@ function transformAnimationValues(values: AnimationDefinition[]) {
44
44
export class SpeedDialItemTitle extends Button {
45
45
constructor ( ) {
46
46
super ( ) ;
47
- // this._fabsHolder.isPassThroughParentEnabled = true;
48
47
this . verticalAlignment = 'middle' ;
48
+ this . style [ 'css:text-transform' ] = 'none' ;
49
+ this . style [ 'css:background-color' ] = 'white' ;
50
+ this . style [ 'css:ripple-color' ] = '#797979' ;
51
+ this . style [ 'css:color' ] = '#797979' ;
52
+ this . style [ 'css:elevation' ] = 2 ;
53
+ this . style [ 'css:border-radius' ] = 6 ;
54
+ this . style [ 'css:font-size' ] = 10 ;
55
+ this . style [ 'css:min-width' ] = 0 ;
56
+ this . style [ 'css:min-height' ] = 0 ;
57
+ this . style [ 'css:padding' ] = 4 ;
49
58
}
50
59
}
51
60
@CSSType ( 'MDSpeedDialItemButton' )
52
61
export class SpeedDialItemButton extends Button {
53
62
constructor ( ) {
54
63
super ( ) ;
55
- // this._fabsHolder.isPassThroughParentEnabled = true;
56
64
this . verticalAlignment = 'middle' ;
65
+ this . style [ 'css:font-size' ] = 26 ;
66
+ this . style [ 'css:border-radius' ] = 28 ;
67
+ this . style [ 'css:width' ] = 56 ;
68
+ this . style [ 'css:height' ] = 56 ;
69
+ this . style [ 'css:margin' ] = 16 ;
70
+ this . style [ 'css:dynamic-elevation-offset' ] = 2 ;
71
+ this . style [ 'css:font-size' ] = 26 ;
57
72
}
58
73
}
59
74
@CSSType ( 'MDSpeedDialButton' )
60
- export class SpeedDialButton extends SpeedDialItemButton { }
75
+ export class SpeedDialButton extends SpeedDialItemButton {
76
+
77
+ }
61
78
@CSSType ( 'MDSpeedDialItem' )
62
79
export class SpeedDialItem extends SpeedDialItemBase {
63
80
public actualActive : boolean = false ;
@@ -67,32 +84,16 @@ export class SpeedDialItem extends SpeedDialItemBase {
67
84
constructor ( size = 'mini' , private isMain = false ) {
68
85
super ( ) ;
69
86
// this._fabsHolder.isPassThroughParentEnabled = true;
87
+ this . isPassThroughParentEnabled = true ;
70
88
this . titleView = new SpeedDialItemTitle ( ) ;
71
89
this . titleView . notify = this . notifyChildEvent ( this . titleView , this . titleView . notify ) ;
72
90
this . titleView . col = 1 ;
73
91
this . titleView . text = this . title ;
74
- this . titleView . style [ 'css:text-transform' ] = 'none' ;
75
- this . titleView . style [ 'css:background-color' ] = 'white' ;
76
- this . titleView . style [ 'css:ripple-color' ] = '#797979' ;
77
- this . titleView . style [ 'css:color' ] = '#797979' ;
78
- this . titleView . style [ 'css:elevation' ] = 2 ;
79
- this . titleView . style [ 'css:border-radius' ] = 6 ;
80
- this . titleView . style [ 'css:font-size' ] = 10 ;
81
- this . titleView . style [ 'css:min-width' ] = 0 ;
82
- this . titleView . style [ 'css:min-height' ] = 0 ;
83
- this . titleView . style [ 'css:padding' ] = 4 ;
84
92
this . button = isMain ? new SpeedDialButton ( ) : new SpeedDialItemButton ( ) ;
85
93
this . button . notify = this . notifyChildEvent ( this . button , this . button . notify ) ;
86
94
this . button . horizontalAlignment = 'center' ;
87
95
// this.fabButtonTitle.style['css:elevation'] = 4;this.fabButtonTitle.style['css:elevation'] = 2;
88
- this . button . style [ 'css:font-size' ] = 26 ;
89
- this . button . style [ 'css:border-radius' ] = 28 ;
90
- this . button . style [ 'css:width' ] = 56 ;
91
- this . button . style [ 'css:height' ] = 56 ;
92
- this . button . style [ 'css:margin' ] = 16 ;
93
- this . button . style [ 'css:dynamic-elevation-offset' ] = 2 ;
94
96
this . button . col = this . fabButtonCol ;
95
- this . button . style [ 'css:font-size' ] = 26 ;
96
97
if ( size === 'mini' ) {
97
98
this . button . style [ 'css:border-radius' ] = 20 ;
98
99
this . button . style [ 'css:width' ] = 40 ;
@@ -141,7 +142,6 @@ export class SpeedDialItem extends SpeedDialItemBase {
141
142
if ( this . isMain ) {
142
143
this . fabmenu . get ( ) . onButtonTap ( args ) ;
143
144
} else {
144
- console . log ( 'onButtonTap' , this , args . eventName , this . hasListeners ( args . eventName ) ) ;
145
145
this . notify ( { object : this , ...args } ) ;
146
146
this . fabmenu . get ( ) . active = false ;
147
147
}
@@ -169,12 +169,6 @@ export class SpeedDialItem extends SpeedDialItemBase {
169
169
this . button . isUserInteractionEnabled = value ;
170
170
this . titleView . isUserInteractionEnabled = value ;
171
171
}
172
- // get size() {
173
- // return this._fabButton.size;
174
- // }
175
- // set size(value) {
176
- // this._fabButton.size = value;
177
- // }
178
172
get title ( ) {
179
173
return this . titleView . text ;
180
174
}
@@ -264,7 +258,6 @@ export class SpeedDial extends SpeedDialItemBase {
264
258
constructor ( ) {
265
259
super ( ) ;
266
260
this . actualActive = this . isActive ;
267
- this . backgroundColor = new Color ( '#00000000' ) ;
268
261
this . width = { unit : '%' , value : 100 } ;
269
262
this . height = { unit : '%' , value : 100 } ;
270
263
this . rows = 'auto,*,auto,auto' ;
@@ -273,10 +266,13 @@ export class SpeedDial extends SpeedDialItemBase {
273
266
this . _fabsHolder = new FlexboxLayout ( ) ;
274
267
this . _fabsHolder . row = 2 ;
275
268
this . _fabsHolder . horizontalAlignment = this . rPosition as HorizontalAlignment ;
269
+ this . isPassThroughParentEnabled = true ;
276
270
if ( global . isIOS ) {
277
271
this . _fabsHolder . isPassThroughParentEnabled = true ;
278
272
}
279
273
this . _fabsHolder . flexDirection = this . orientation === 'vertical' ? 'column-reverse' : 'row-reverse' ;
274
+ this . _fabsHolder . backgroundColor = new Color ( '#00000000' ) ;
275
+ this . _fabsHolder . visibility = 'hidden' ;
280
276
281
277
this . _fabMainButton = new SpeedDialItem ( null , true ) ;
282
278
this . prepareItem ( this . _fabMainButton , true ) ;
@@ -288,13 +284,17 @@ export class SpeedDial extends SpeedDialItemBase {
288
284
this . addChild ( this . _fabsHolder ) ;
289
285
}
290
286
287
+ get backDrop ( ) {
288
+ return this ;
289
+ }
290
+
291
291
initNativeView ( ) {
292
292
super . initNativeView ( ) ;
293
- this . _fabMainButton . on ( 'tap' , this . onButtonTap , this ) ;
293
+ this . backDrop . on ( 'tap' , this . onBackdropTap , this ) ;
294
294
}
295
295
disposeNativeView ( ) {
296
296
super . disposeNativeView ( ) ;
297
- this . _fabMainButton . off ( 'tap' , this . onButtonTap , this ) ;
297
+ this . backDrop . off ( 'tap' , this . onBackdropTap , this ) ;
298
298
}
299
299
300
300
prepareItem ( item : SpeedDialItem , isMain = false ) {
@@ -325,7 +325,6 @@ export class SpeedDial extends SpeedDialItemBase {
325
325
}
326
326
}
327
327
public _addChildFromBuilder ( name : string , value : any ) {
328
- console . log ( '_addChildFromBuilder' , name ) ;
329
328
if ( value instanceof SpeedDialItem ) {
330
329
value . fabmenu = new WeakRef ( this ) ;
331
330
this . fabs . push ( value ) ;
@@ -417,14 +416,15 @@ export class SpeedDial extends SpeedDialItemBase {
417
416
. concat ( this . computeAnimationData ( 'open' , this . _fabMainButton , 0 , length , duration , true ) )
418
417
. concat ( [
419
418
{
420
- target : this ,
419
+ target : this . backDrop ,
421
420
backgroundColor : new Color ( '#99000000' ) ,
422
421
curve : AnimationCurve . easeInOut ,
423
422
duration
424
423
}
425
424
] ) ;
426
425
427
426
try {
427
+ this . _fabsHolder . visibility = 'visible' ;
428
428
await new Animation ( params ) . play ( ) ;
429
429
fabs . forEach ( ( f ) => ( f . isUserInteractionEnabled = true ) ) ;
430
430
} catch ( err ) {
@@ -447,7 +447,7 @@ export class SpeedDial extends SpeedDialItemBase {
447
447
. concat ( this . computeAnimationData ( 'hide' , this . _fabMainButton , 0 , length , duration , true ) )
448
448
. concat ( [
449
449
{
450
- target : this ,
450
+ target : this . backDrop ,
451
451
backgroundColor : new Color ( '#00000000' ) ,
452
452
curve : AnimationCurve . easeInOut ,
453
453
duration
@@ -457,6 +457,7 @@ export class SpeedDial extends SpeedDialItemBase {
457
457
try {
458
458
fabs . forEach ( ( f ) => ( f . isUserInteractionEnabled = false ) ) ;
459
459
await new Animation ( params ) . play ( ) ;
460
+ this . _fabsHolder . visibility = 'hidden' ;
460
461
} catch ( err ) {
461
462
// console.error(err);
462
463
} finally {
0 commit comments