diff --git a/.gitignore b/.gitignore index 9a3d7ca49..57ff50b79 100644 --- a/.gitignore +++ b/.gitignore @@ -69,6 +69,15 @@ nativescript-core/css/system-classes.js* !nativescript-core/build/**/*.* #generated by api-extractor -nativescript-core/nativescript-core.d.ts +nativescript-core/nativescript-core.d.ts .vs/ +e2e/ +!e2e/animation +!e2e/config +!e2e/cuteness.io +!e2e/file-qualifiers +!e2e/modal-navigation +!e2e/nested-frame-navigation +!e2e/scoped-packages +!e2e/ui-tests-app \ No newline at end of file diff --git a/api-reports/NativeScript.api.md b/api-reports/NativeScript.api.md index 82d7abcdc..4689936ad 100644 --- a/api-reports/NativeScript.api.md +++ b/api-reports/NativeScript.api.md @@ -2336,6 +2336,8 @@ export class TabStrip extends View { // @public export class TabStripItem extends View { + iconClass: string; + iconSource: string; image: Image; diff --git a/nativescript-core/ui/tab-navigation-base/tab-strip-item/tab-strip-item.d.ts b/nativescript-core/ui/tab-navigation-base/tab-strip-item/tab-strip-item.d.ts index b9b8d0721..85fb78dc7 100644 --- a/nativescript-core/ui/tab-navigation-base/tab-strip-item/tab-strip-item.d.ts +++ b/nativescript-core/ui/tab-navigation-base/tab-strip-item/tab-strip-item.d.ts @@ -16,6 +16,11 @@ export class TabStripItem extends View { */ title: string; + /** + * Gets or sets the CSS class name of the icon in the tab strip entry. + */ + iconClass: string; + /** * Gets or sets the icon source of the tab strip entry. */ diff --git a/nativescript-core/ui/tab-navigation-base/tab-strip-item/tab-strip-item.ts b/nativescript-core/ui/tab-navigation-base/tab-strip-item/tab-strip-item.ts index 240cebec7..d5d6db68c 100644 --- a/nativescript-core/ui/tab-navigation-base/tab-strip-item/tab-strip-item.ts +++ b/nativescript-core/ui/tab-navigation-base/tab-strip-item/tab-strip-item.ts @@ -30,6 +30,7 @@ export class TabStripItem extends View implements TabStripItemDefinition, AddChi private _title: string; private _iconSource: string; + private _iconClass: string; private _highlightedHandler: () => void; private _normalHandler: () => void; @@ -59,6 +60,22 @@ export class TabStripItem extends View implements TabStripItemDefinition, AddChi } } + get iconClass(): string { + if (this.isLoaded) { + return this.image.className; + } + + return this._iconClass; + } + + set iconClass(value: string) { + this._iconClass = value; + + if (this.isLoaded) { + this.image.className = value; + } + } + get iconSource(): string { if (this.isLoaded) { return this.image.src; @@ -79,6 +96,7 @@ export class TabStripItem extends View implements TabStripItemDefinition, AddChi if (!this.image) { const image = new Image(); image.src = this.iconSource; + image.className = this.iconClass; this.image = image; this._addView(this.image); } @@ -176,6 +194,7 @@ export class TabStripItem extends View implements TabStripItemDefinition, AddChi if (value instanceof Image) { this.image = value; this.iconSource = (value).src; + this.iconClass = (value).className; this._addView(value); // selectedIndexProperty.coerce(this); }