1
1
/**
2
2
* @module @nativescript -community/ui-material-core/tab-navigation-base/tab-strip
3
- */
4
- import { AddArrayFromBuilder , AddChildFromBuilder , CSSType , Color , EventData , Property , View , ViewBase , booleanConverter } from '@nativescript/core' ;
3
+ */
4
+ import { AddArrayFromBuilder , AddChildFromBuilder , CSSType , Color , CssProperty , Property , Style , View , ViewBase , booleanConverter } from '@nativescript/core' ;
5
5
import { backgroundColorProperty , backgroundInternalProperty , colorProperty , fontInternalProperty } from '@nativescript/core/ui/styling/style-properties' ;
6
6
import { textTransformProperty } from '@nativescript/core/ui/text-base' ;
7
7
import { TabNavigationBase } from '../tab-navigation-base' ;
@@ -12,8 +12,9 @@ export const traceCategory = 'TabView';
12
12
13
13
// Place this on top because the webpack ts-loader doesn't work when export
14
14
// is after reference
15
- export const highlightColorProperty = new Property < TabStrip , Color > ( {
15
+ export const highlightColorProperty = new CssProperty < Style , Color > ( {
16
16
name : 'highlightColor' ,
17
+ cssName : 'highlight-color' ,
17
18
equalityComparer : Color . equals ,
18
19
valueConverter : ( v ) => new Color ( v )
19
20
} ) ;
@@ -34,11 +35,17 @@ export class TabStrip extends View implements TabStripDefinition, AddChildFromBu
34
35
public items : TabStripItem [ ] ;
35
36
public isIconSizeFixed : boolean ;
36
37
public iosIconRenderingMode : 'automatic' | 'alwaysOriginal' | 'alwaysTemplate' ;
38
+
39
+
40
+ /**
41
+ * defines the highlight color of the TabStrip item
42
+ * can be defined through css `highlight-color`
43
+ */
37
44
public highlightColor : Color ;
38
45
public selectedItemColor : Color ;
39
46
public unSelectedItemColor : Color ;
40
- public _hasImage : boolean ;
41
- public _hasTitle : boolean ;
47
+ protected _hasImage : boolean ;
48
+ protected _hasTitle : boolean ;
42
49
43
50
public eachChild ( callback : ( child : ViewBase ) => boolean ) {
44
51
const items = this . items ;
@@ -181,6 +188,6 @@ export const isIconSizeFixedProperty = new Property<TabStrip, boolean>({
181
188
} ) ;
182
189
isIconSizeFixedProperty . register ( TabStrip ) ;
183
190
184
- highlightColorProperty . register ( TabStrip ) ;
191
+ highlightColorProperty . register ( Style ) ;
185
192
selectedItemColorProperty . register ( TabStrip ) ;
186
193
unSelectedItemColorProperty . register ( TabStrip ) ;
0 commit comments