Skip to content
This repository was archived by the owner on Nov 6, 2019. It is now read-only.

Commit babc358

Browse files
committed
Revert changes to default tab renderer.
Before, we needed to clamp down on the default tab renderer type. This is (a) backwards incompatible and (b) not needed anymore.
1 parent 953f2f0 commit babc358

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

packages/widgets/src/tabbar.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,7 +1328,7 @@ namespace TabBar {
13281328
* Subclasses are free to reimplement rendering methods as needed.
13291329
*/
13301330
export
1331-
class Renderer<T extends Widget = Widget> implements IRenderer<T> {
1331+
class Renderer implements IRenderer<any> {
13321332
/**
13331333
* Construct a new renderer.
13341334
*/
@@ -1346,7 +1346,7 @@ namespace TabBar {
13461346
*
13471347
* @returns A virtual element representing the tab.
13481348
*/
1349-
renderTab(data: IRenderData<T>): VirtualElement {
1349+
renderTab(data: IRenderData<any>): VirtualElement {
13501350
let title = data.title.caption;
13511351
let key = this.createTabKey(data);
13521352
let id = key;
@@ -1370,7 +1370,7 @@ namespace TabBar {
13701370
*
13711371
* @returns A virtual element representing the tab icon.
13721372
*/
1373-
renderIcon(data: IRenderData<T>): VirtualElement {
1373+
renderIcon(data: IRenderData<any>): VirtualElement {
13741374
let className = this.createIconClass(data);
13751375
return h.div({ className }, data.title.iconLabel);
13761376
}
@@ -1382,7 +1382,7 @@ namespace TabBar {
13821382
*
13831383
* @returns A virtual element representing the tab label.
13841384
*/
1385-
renderLabel(data: IRenderData<T>): VirtualElement {
1385+
renderLabel(data: IRenderData<any>): VirtualElement {
13861386
return h.div({ className: 'p-TabBar-tabLabel' }, data.title.label);
13871387
}
13881388

@@ -1393,7 +1393,7 @@ namespace TabBar {
13931393
*
13941394
* @returns A virtual element representing the tab close icon.
13951395
*/
1396-
renderCloseIcon(data: IRenderData<T>): VirtualElement {
1396+
renderCloseIcon(data: IRenderData<any>): VirtualElement {
13971397
return h.div({ className: 'p-TabBar-tabCloseIcon' });
13981398
}
13991399

@@ -1409,7 +1409,7 @@ namespace TabBar {
14091409
* the key is generated. This enables efficient rendering of moved
14101410
* tabs and avoids subtle hover style artifacts.
14111411
*/
1412-
createTabKey(data: IRenderData<T>): string {
1412+
createTabKey(data: IRenderData<any>): string {
14131413
let key = this._tabKeys.get(data.title);
14141414
if (key === undefined) {
14151415
key = `tab-key-${this._tabID++}`;
@@ -1425,7 +1425,7 @@ namespace TabBar {
14251425
*
14261426
* @returns The inline style data for the tab.
14271427
*/
1428-
createTabStyle(data: IRenderData<T>): ElementInlineStyle {
1428+
createTabStyle(data: IRenderData<any>): ElementInlineStyle {
14291429
return { zIndex: `${data.zIndex}` };
14301430
}
14311431

@@ -1436,7 +1436,7 @@ namespace TabBar {
14361436
*
14371437
* @returns The full class name for the tab.
14381438
*/
1439-
createTabClass(data: IRenderData<T>): string {
1439+
createTabClass(data: IRenderData<any>): string {
14401440
let name = 'p-TabBar-tab';
14411441
if (data.title.className) {
14421442
name += ` ${data.title.className}`;
@@ -1457,7 +1457,7 @@ namespace TabBar {
14571457
*
14581458
* @returns The dataset for the tab.
14591459
*/
1460-
createTabDataset(data: IRenderData<T>): ElementDataset {
1460+
createTabDataset(data: IRenderData<any>): ElementDataset {
14611461
return data.title.dataset;
14621462
}
14631463

@@ -1468,7 +1468,7 @@ namespace TabBar {
14681468
*
14691469
* @returns The ARIA attributes for the tab.
14701470
*/
1471-
createTabARIA(data: IRenderData<T>): ElementARIAAttrs {
1471+
createTabARIA(data: IRenderData<any>): ElementARIAAttrs {
14721472
return {role: 'tab', 'aria-selected': data.current.toString()};
14731473
}
14741474

@@ -1479,14 +1479,14 @@ namespace TabBar {
14791479
*
14801480
* @returns The full class name for the tab icon.
14811481
*/
1482-
createIconClass(data: IRenderData<T>): string {
1482+
createIconClass(data: IRenderData<any>): string {
14831483
let name = 'p-TabBar-tabIcon';
14841484
let extra = data.title.iconClass;
14851485
return extra ? `${name} ${extra}` : name;
14861486
}
14871487

14881488
private _tabID = 0;
1489-
private _tabKeys = new WeakMap<Title<T>, string>();
1489+
private _tabKeys = new WeakMap<Title<any>, string>();
14901490
}
14911491

14921492
/**

0 commit comments

Comments
 (0)