Skip to content

Commit 3409e6f

Browse files
committed
OtherUI: fix ts issues
1 parent 7e0f357 commit 3409e6f

File tree

15 files changed

+1530
-1193
lines changed

15 files changed

+1530
-1193
lines changed

packages/devextreme/js/__internal/grids/grid_core/editor_factory/m_editor_factory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ interface EditorFactoryMixinType {
5050

5151
}
5252

53-
const ViewControllerWithMixin: ModuleType<ViewController & EditorFactoryMixinType> = EditorFactoryMixin(modules.ViewController) as any;
53+
const ViewControllerWithMixin: ModuleType<ViewController & EditorFactoryMixinType> = EditorFactoryMixin(modules.ViewController);
5454

5555
export class EditorFactory extends ViewControllerWithMixin {
5656
private _isFocusOverlay: any;

packages/devextreme/js/__internal/pagination/content.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import type { RefObject } from '@ts/core/r1/types';
66
import { Widget } from '@ts/core/r1/widget';
77
import { createRef as infernoCreateRef } from 'inferno';
88

9-
import { registerKeyboardAction } from '../../ui/shared/accessibility';
109
import type { EventCallback } from '../core/r1/event_callback';
1110
import type { DisposeEffectReturn } from '../core/r1/utils/effect_return';
1211
import { combineClasses } from '../core/r1/utils/render_utils';
12+
import { registerKeyboardAction } from '../ui/shared/accessibility';
1313
import {
1414
LIGHT_MODE_CLASS,
1515
PAGER_CLASS,

packages/devextreme/js/__internal/ui/file_manager/ui.file_manager.adaptivity.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import type { OptionChanged } from '@ts/core/widget/types';
88
import type { WidgetProperties } from '@ts/core/widget/widget';
99
import Widget from '@ts/core/widget/widget';
1010
import Drawer from '@ts/ui/drawer/drawer';
11+
import type { ActiveStateChangedEvent, ApplyPanelSizeEvent } from '@ts/ui/splitter_control';
1112

1213
const window = getWindow();
1314
const ADAPTIVE_STATE_SCREEN_WIDTH = 573;
@@ -16,11 +17,6 @@ const FILE_MANAGER_ADAPTIVITY_DRAWER_PANEL_CLASS = 'dx-filemanager-adaptivity-dr
1617
const DRAWER_PANEL_CONTENT_INITIAL = 'dx-drawer-panel-content-initial';
1718
const DRAWER_PANEL_CONTENT_ADAPTIVE = 'dx-drawer-panel-content-adaptive';
1819

19-
interface PanelSize {
20-
leftPanelWidth: string | number;
21-
rightPanelWidth: string | number;
22-
}
23-
2420
interface FileManagerAdaptivityControlOptions extends WidgetProperties {
2521
drawerTemplate?: (container: dxElementWrapper | Element) => void;
2622
contentTemplate?: (container: dxElementWrapper) => void;
@@ -87,7 +83,7 @@ class FileManagerAdaptivityControl extends Widget<FileManagerAdaptivityControlOp
8783
this._checkAdaptiveState();
8884
}
8985

90-
_onApplyPanelSize(e: PanelSize): void {
86+
_onApplyPanelSize(e: ApplyPanelSizeEvent): void {
9187
if (!hasWindow()) {
9288
return;
9389
}
@@ -100,9 +96,9 @@ class FileManagerAdaptivityControl extends Widget<FileManagerAdaptivityControlOp
10096
this._setDrawerWidth(e.leftPanelWidth);
10197
}
10298

103-
_onActiveStateChanged({ isActive }: { isActive: boolean }): void {
104-
this._splitter?.disableSplitterCalculation(!isActive);
105-
if (!isActive) {
99+
_onActiveStateChanged(e: ActiveStateChangedEvent): void {
100+
this._splitter?.disableSplitterCalculation(!e.isActive);
101+
if (!e.isActive) {
106102
this._splitter?.$element().css('left', 'auto');
107103
}
108104
}

packages/devextreme/js/__internal/ui/gantt/ui.gantt.size_helper.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
} from '@js/core/utils/size';
88
import { hasWindow } from '@js/core/utils/window';
99
import type Gantt from '@ts/ui/gantt/ui.gantt';
10+
import type { ApplyPanelSizeEvent } from '@ts/ui/splitter_control';
1011

1112
type Dimension = 'width' | 'height';
1213

@@ -34,10 +35,9 @@ export class GanttSizeHelper {
3435
this._gantt._setGanttViewOption(dimension, getter(this._gantt._$ganttView));
3536
}
3637

37-
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
38-
_getPanelsWidthByOption() {
38+
_getPanelsWidthByOption(): ApplyPanelSizeEvent {
3939
const ganttWidth = getWidth(this._gantt.$element());
40-
const leftPanelWidth = this._gantt.option('taskListWidth');
40+
const { taskListWidth: leftPanelWidth } = this._gantt.option();
4141
// eslint-disable-next-line @typescript-eslint/init-declarations
4242
let rightPanelWidth;
4343
// @ts-expect-error ts-error
@@ -53,6 +53,7 @@ export class GanttSizeHelper {
5353
// @ts-expect-error ts-error
5454
rightPanelWidth = `${100 - parseInt(leftPanelWidth.replace('%', ''), 10)}%`;
5555
}
56+
// @ts-expect-error ts-error
5657
return { leftPanelWidth, rightPanelWidth };
5758
}
5859

@@ -85,7 +86,7 @@ export class GanttSizeHelper {
8586
}
8687
}
8788

88-
setInnerElementsWidth(widths?): void {
89+
setInnerElementsWidth(widths?: ApplyPanelSizeEvent): void {
8990
if (!hasWindow()) {
9091
return;
9192
}
@@ -96,8 +97,8 @@ export class GanttSizeHelper {
9697
this._setTreeListDimension('width', 0);
9798
this._setGanttViewDimension('width', 0);
9899
}
99-
this._setTreeListDimension('width', widths.leftPanelWidth);
100-
this._setGanttViewDimension('width', widths.rightPanelWidth);
100+
this._setTreeListDimension('width', widths?.leftPanelWidth);
101+
this._setGanttViewDimension('width', widths?.rightPanelWidth);
101102
if (takeWithFromOption) {
102103
this._gantt._splitter?._setSplitterPositionLeft();
103104
}

packages/devextreme/js/__internal/ui/gantt/ui.gantt.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,8 @@ class Gantt extends Widget<Properties> {
247247
this._sizeHelper?.onApplyPanelSize(e);
248248
},
249249
});
250-
this._splitter.option(
251-
'initialLeftPanelWidth',
252-
this.option('taskListWidth'),
253-
);
250+
const { taskListWidth } = this.option();
251+
this._splitter.option('initialLeftPanelWidth', taskListWidth);
254252
}
255253

256254
_renderBars(): void {

0 commit comments

Comments
 (0)