@@ -19,8 +19,8 @@ export interface IDockviewPanel extends IDisposable, IPanel {
1919 readonly api : DockviewPanelApi ;
2020 readonly title : string | undefined ;
2121 readonly params : Parameters | undefined ;
22- readonly componentElId : string ;
23- readonly tabComponentElId : string ;
22+ readonly componentAttributes : Record < string , string > ;
23+ readonly tabComponentAttributes : Record < string , string > ;
2424 readonly minimumWidth ?: number ;
2525 readonly minimumHeight ?: number ;
2626 readonly maximumWidth ?: number ;
@@ -41,18 +41,9 @@ export class DockviewPanel
4141 implements IDockviewPanel
4242{
4343 readonly api : DockviewPanelApiImpl ;
44- /**
45- * The unique DOM id for the rendered panel element
46- *
47- * Used for accessibility attributes
48- */
49- readonly componentElId : string ;
50- /**
51- * The unique DOM id for the rendered tab element
52- *
53- * Used for accessibility attributes
54- */
55- readonly tabComponentElId : string ;
44+
45+ readonly componentAttributes : Record < string , string > ;
46+ readonly tabComponentAttributes : Record < string , string > ;
5647
5748 private _group : DockviewGroupPanel ;
5849 private _params ?: Parameters ;
@@ -104,7 +95,10 @@ export class DockviewPanel
10495 private readonly containerApi : DockviewApi ,
10596 group : DockviewGroupPanel ,
10697 readonly view : IDockviewPanelModel ,
107- options : { renderer ?: DockviewPanelRenderer } & Partial < Contraints >
98+ options : { renderer ?: DockviewPanelRenderer } & Partial < Contraints > & {
99+ componentAttributes ?: Record < string , string > ;
100+ tabComponentAttributes ?: Record < string , string > ;
101+ }
108102 ) {
109103 super ( ) ;
110104 this . _renderer = options . renderer ;
@@ -114,10 +108,8 @@ export class DockviewPanel
114108 this . _maximumWidth = options . maximumWidth ;
115109 this . _maximumHeight = options . maximumHeight ;
116110
117- const randomId = Math . random ( ) . toString ( 36 ) . slice ( 2 ) ;
118-
119- this . tabComponentElId = `tab-${ id } -${ randomId } ` ;
120- this . componentElId = `tab-panel-${ id } -${ randomId } ` ;
111+ this . componentAttributes = options . componentAttributes ?? { } ;
112+ this . tabComponentAttributes = options . tabComponentAttributes ?? { } ;
121113
122114 this . api = new DockviewPanelApiImpl (
123115 this ,
0 commit comments