33import type { GridBase } from '@js/common/grids' ;
44import type { dxElementWrapper } from '@js/core/renderer' ;
55import $ from '@js/core/renderer' ;
6+ import { LoadPanelModel } from '@ts/ui/__tests__/__mock__/model/load_panel' ;
67import { ToastModel } from '@ts/ui/__tests__/__mock__/model/toast' ;
78
89import { AIPromptEditorModel } from './ai_prompt_editor' ;
@@ -17,13 +18,18 @@ const SELECTORS = {
1718 aiDialog : 'dx-aidialog' ,
1819 aiPromptEditor : 'dx-ai-prompt-editor' ,
1920 toast : 'dx-toast' ,
21+ loadPanel : 'dx-loadpanel' ,
2022} ;
2123
2224export abstract class GridCoreModel < TInstance extends GridBase = GridBase > {
2325 protected abstract NAME : string ;
2426
2527 constructor ( protected readonly root : HTMLElement ) { }
2628
29+ private getPromptEditorContainer ( ) : HTMLElement {
30+ return this . root . querySelector ( `.${ SELECTORS . aiPromptEditor } ` ) as HTMLElement ;
31+ }
32+
2733 public getHeaderCells ( ) : NodeListOf < HTMLElement > {
2834 return this . root . querySelectorAll ( `.${ SELECTORS . headerRowClass } > td` ) ;
2935 }
@@ -63,10 +69,6 @@ export abstract class GridCoreModel<TInstance extends GridBase = GridBase> {
6369 return document . body . querySelector ( `.${ SELECTORS . aiDialog } ` ) as HTMLElement ;
6470 }
6571
66- private getPromptEditorContainer ( ) : HTMLElement {
67- return this . root . querySelector ( `.${ SELECTORS . aiPromptEditor } ` ) as HTMLElement ;
68- }
69-
7072 public getAIPromptEditor ( ) : AIPromptEditorModel {
7173 return new AIPromptEditorModel ( this . getPromptEditorContainer ( ) ) ;
7274 }
@@ -101,5 +103,13 @@ export abstract class GridCoreModel<TInstance extends GridBase = GridBase> {
101103 await this . getInstance ( ) . refresh ( ) ;
102104 }
103105
106+ public apiAbortAIColumnRequest ( columnName : string ) : void {
107+ this . getInstance ( ) . abortAIColumnRequest ( columnName ) ;
108+ }
109+
110+ public getLoadPanel ( ) : LoadPanelModel {
111+ return new LoadPanelModel ( document . body . querySelector ( `.${ SELECTORS . loadPanel } ` ) ) ;
112+ }
113+
104114 public abstract getInstance ( ) : TInstance ;
105115}
0 commit comments