-
Notifications
You must be signed in to change notification settings - Fork 606
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
57 additions
and
32 deletions.
There are no files selected for viewing
78 changes: 51 additions & 27 deletions
78
packages/devextreme/js/__internal/grids/new/card_view/main_view.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,72 @@ | ||
/* eslint-disable spellcheck/spell-checker */ | ||
/* eslint-disable @typescript-eslint/explicit-member-accessibility */ | ||
import type { Subscribable } from '@ts/core/reactive/index'; | ||
import { combined } from '@ts/core/reactive/index'; | ||
import { ColumnsChooserView } from '@ts/grids/new/grid_core/columns_chooser/view'; | ||
import { View } from '@ts/grids/new/grid_core/core/view_old'; | ||
import { View } from '@ts/grids/new/grid_core/core/view'; | ||
import { FilterPanelView } from '@ts/grids/new/grid_core/filtering/filter_panel/filter_panel'; | ||
import { PagerView } from '@ts/grids/new/grid_core/pager'; | ||
import { ToolbarView } from '@ts/grids/new/grid_core/toolbar/view'; | ||
import type { InfernoNode } from 'inferno'; | ||
import type { ComponentType } from 'inferno'; | ||
|
||
import { ContentView } from './content_view/view'; | ||
import { HeaderPanelView } from './header_panel/view'; | ||
|
||
export class MainView extends View { | ||
public vdom: InfernoNode | Subscribable<InfernoNode>; | ||
interface MainViewProps { | ||
Toolbar: ComponentType; | ||
Content: ComponentType; | ||
Pager: ComponentType; | ||
HeaderPanel: ComponentType; | ||
FilterPanel: ComponentType; | ||
ColumnsChooser: ComponentType; | ||
} | ||
|
||
function MainViewComponent({ | ||
Toolbar, Content, Pager, HeaderPanel, FilterPanel, ColumnsChooser, | ||
}: MainViewProps): JSX.Element { | ||
return (<> | ||
{/* @ts-expect-error */} | ||
<Toolbar/> | ||
{/* @ts-expect-error */} | ||
<HeaderPanel/> | ||
{/* @ts-expect-error */} | ||
<Content/> | ||
{/* @ts-expect-error */} | ||
<FilterPanel/> | ||
{/* @ts-expect-error */} | ||
<Pager/> | ||
{/* @ts-expect-error */} | ||
<ColumnsChooser/> | ||
</>); | ||
} | ||
|
||
export class MainView extends View<MainViewProps> { | ||
protected override component = MainViewComponent; | ||
|
||
public static dependencies = [ | ||
ContentView, PagerView, ToolbarView, HeaderPanelView, FilterPanelView, ColumnsChooserView, | ||
] as const; | ||
|
||
constructor( | ||
_content: ContentView, | ||
_pager: PagerView, | ||
_toolbar: ToolbarView, | ||
_headerPanel: HeaderPanelView, | ||
_filterPanel: FilterPanelView, | ||
_columnsChooser: ColumnsChooserView, | ||
private readonly content: ContentView, | ||
private readonly pager: PagerView, | ||
private readonly toolbar: ToolbarView, | ||
private readonly headerPanel: HeaderPanelView, | ||
private readonly filterPanel: FilterPanelView, | ||
private readonly columnsChooser: ColumnsChooserView, | ||
) { | ||
super(); | ||
const Toolbar = _toolbar.asInferno(); | ||
const Content = _content.asInferno(); | ||
const Pager = _pager.asInferno(); | ||
const HeaderPanel = _headerPanel.asInferno(); | ||
const FilterPanel = _filterPanel.asInferno(); | ||
const ColumnsChooser = _columnsChooser.asInferno(); | ||
} | ||
|
||
this.vdom = <> | ||
<Toolbar/> | ||
<HeaderPanel/> | ||
{/* @ts-expect-error */} | ||
<Content/> | ||
<FilterPanel/> | ||
<Pager/> | ||
{/* @ts-expect-error */} | ||
<ColumnsChooser/> | ||
</>; | ||
// eslint-disable-next-line max-len | ||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type | ||
protected override getProps() { | ||
return combined({ | ||
Toolbar: this.toolbar.asInferno(), | ||
Content: this.content.asInferno(), | ||
Pager: this.pager.asInferno(), | ||
HeaderPanel: this.headerPanel.asInferno(), | ||
FilterPanel: this.filterPanel.asInferno(), | ||
ColumnsChooser: this.columnsChooser.asInferno(), | ||
}); | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
packages/devextreme/js/__internal/grids/new/data_grid/widget_base.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
packages/devextreme/js/__internal/grids/new/grid_core/main_view.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
/* eslint-disable @typescript-eslint/ban-types */ | ||
/* eslint-disable spellcheck/spell-checker */ | ||
/* eslint-disable @typescript-eslint/explicit-member-accessibility */ | ||
|
||
import { View } from './core/view_old'; | ||
import { View } from './core/view'; | ||
|
||
export abstract class MainView extends View {} | ||
export abstract class MainView<T extends {}> extends View<T> {} |