Skip to content

Commit

Permalink
Collection.Base: convert to ES6 Class
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeniyKiyashko committed Jan 18, 2025
1 parent c3ae57e commit 8a42ab3
Show file tree
Hide file tree
Showing 25 changed files with 569 additions and 467 deletions.
6 changes: 3 additions & 3 deletions packages/devextreme/js/__internal/core/widget/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ export interface Properties<TComponent = any> extends WidgetOptions<TComponent>
class Widget<
TProperties extends Properties = Properties,
> extends DOMComponent<Widget<TProperties>, TProperties> {
private readonly _feedbackHideTimeout = 400;
public _activeStateUnit!: string;

public _feedbackHideTimeout = 400;

private readonly _feedbackShowTimeout = 30;

private _contentReadyAction?: ((event?: Record<string, unknown>) => void) | null;

private readonly _activeStateUnit!: string;

private _keyboardListenerId?: string | null;

private _isReady?: boolean;
Expand Down
4 changes: 2 additions & 2 deletions packages/devextreme/js/__internal/ui/calendar/m_calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ const SELECTION_STRATEGIES = {

// @ts-expect-error
const Calendar = Editor.inherit({
_activeStateUnit: `.${CALENDAR_CELL_CLASS}`,

_getDefaultOptions() {
return extend(this.callBase(), {

Expand Down Expand Up @@ -442,6 +440,8 @@ const Calendar = Editor.inherit({

_init() {
this.callBase();

this._activeStateUnit = `.${CALENDAR_CELL_CLASS}`;
this._initSelectionStrategy();
this._correctZoomLevel();
this._initCurrentDate();
Expand Down
5 changes: 3 additions & 2 deletions packages/devextreme/js/__internal/ui/collection/async.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import CollectionWidgetAsync from '@js/ui/collection/ui.collection_widget.async';
import type { CollectionWidgetOptions, ItemLike } from '@js/ui/collection/ui.collection_widget.base';
import type { ItemLike } from '@js/ui/collection/ui.collection_widget.base';
import type { CollectionWidgetBaseProperties } from '@ts/ui/collection/m_collection_widget.base';

import CollectionWidgetEdit from './edit';

declare class Async<
// eslint-disable-next-line @typescript-eslint/no-explicit-any
TProperties extends CollectionWidgetOptions<any, TItem, TKey>,
TProperties extends CollectionWidgetBaseProperties<any, TItem, TKey>,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
TItem extends ItemLike = any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down
97 changes: 0 additions & 97 deletions packages/devextreme/js/__internal/ui/collection/base.ts

This file was deleted.

8 changes: 4 additions & 4 deletions packages/devextreme/js/__internal/ui/collection/edit.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type { dxElementWrapper } from '@js/core/renderer';
import type { CollectionWidgetOptions, ItemLike } from '@js/ui/collection/ui.collection_widget.base';
import type { ItemLike } from '@js/ui/collection/ui.collection_widget.base';
import CollectionWidgetEdit from '@js/ui/collection/ui.collection_widget.edit';

import CollectionWidgetBase from './base';
import type { CollectionWidgetBaseProperties } from '@ts/ui/collection/m_collection_widget.base';
import CollectionWidgetBase from '@ts/ui/collection/m_collection_widget.base';

declare class Edit<
// eslint-disable-next-line @typescript-eslint/no-explicit-any
TProperties extends CollectionWidgetOptions<any, TItem, TKey>,
TProperties extends CollectionWidgetBaseProperties<any, TItem, TKey>,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
TItem extends ItemLike = any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import type { CollectionWidgetOptions, ItemLike } from '@js/ui/collection/ui.collection_widget.base';
import type { ItemLike } from '@js/ui/collection/ui.collection_widget.base';
import CollectionWidgetLiveUpdate from '@js/ui/collection/ui.collection_widget.live_update';
import type { CollectionWidgetBaseProperties } from '@ts/ui/collection/m_collection_widget.base';

import CollectionWidgetAsync from './async';

declare class LiveUpdate<
// eslint-disable-next-line @typescript-eslint/no-explicit-any
TProperties extends CollectionWidgetOptions<any, TItem, TKey>,
TProperties extends CollectionWidgetBaseProperties<any, TItem, TKey>,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
TItem extends ItemLike = any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down
Loading

0 comments on commit 8a42ab3

Please sign in to comment.