Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions packages/devextreme/js/__internal/common/core/animation/frame.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/* eslint-disable import/no-mutable-exports */
/* eslint-disable @typescript-eslint/naming-convention */
/* eslint-disable func-names */

import callOnce from '@js/core/utils/call_once';
import { getWindow, hasWindow } from '@js/core/utils/window';

Expand Down Expand Up @@ -46,14 +50,28 @@ const setAnimationFrameMethods = callOnce(() => {
});

// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
export function requestAnimationFrame(...args): number {
export let requestAnimationFrame = function (...args): number {
setAnimationFrameMethods();

// @ts-ignore
return request.apply(window, args);
}
};

export function cancelAnimationFrame(requestID: number): void {
export let cancelAnimationFrame = function (requestID: number): void {
setAnimationFrameMethods();
cancel.apply(window, [requestID]);
};

/// #DEBUG
export function DEBUG_set_requestAnimationFrame(
value: typeof requestAnimationFrame,
): void {
requestAnimationFrame = value;
}

export function DEBUG_set_cancelAnimationFrame(
value: typeof cancelAnimationFrame,
): void {
cancelAnimationFrame = value;
}
/// #ENDDEBUG
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/* eslint-disable func-names */
/* eslint-disable import/no-mutable-exports */
/* eslint-disable @typescript-eslint/naming-convention */
/* eslint-disable @typescript-eslint/prefer-optional-chain */
/* eslint-disable @typescript-eslint/no-use-before-define */
import { data as elementData, removeData } from '@js/core/element_data';
Expand Down Expand Up @@ -124,7 +126,7 @@ export const move = function (
}
};

export const resetPosition = function (
export let resetPosition = function (
$element: dxElementWrapper | Element | undefined,
finishTransition?: boolean,
): void {
Expand Down Expand Up @@ -170,3 +172,9 @@ export const parseTranslate = function (translateString: string): TranslateVecto
z: parseFloat(result[2]),
};
};

/// #DEBUG
export function DEBUG_set_resetPosition(value: typeof resetPosition): void {
resetPosition = value;
}
/// #ENDDEBUG
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/* eslint-disable spellcheck/spell-checker */
/* eslint-disable import/no-mutable-exports */
/* eslint-disable @typescript-eslint/naming-convention */
import type { Format } from '@ts/core/localization/date';
import { escapeRegExp } from '@ts/core/utils/m_common';
import { logger } from '@ts/core/utils/m_console';
Expand Down Expand Up @@ -235,7 +237,7 @@ export const isPossibleForParsingFormat = (patterns: string[]): boolean => {
});
};

export const getRegExpInfo = (
export let getRegExpInfo = (
format: string,
dateParts: LdlmDateLocalization,
): {
Expand Down Expand Up @@ -381,3 +383,9 @@ export const getParser = (format: string, dateParts: LdlmDateLocalization) => {
return null;
};
};

/// #DEBUG
export function DEBUG_set_getRegExpInfo(value: typeof getRegExpInfo): void {
getRegExpInfo = value;
}
/// #ENDDEBUG
9 changes: 8 additions & 1 deletion packages/devextreme/js/__internal/viz/axes/base_axis.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable import/no-mutable-exports */
/* eslint-disable prefer-rest-params */
/* eslint-disable @stylistic/no-mixed-operators */
/* eslint-disable max-depth */
Expand Down Expand Up @@ -313,7 +314,7 @@ function getConstantLineSharpDirection(coord, axisCanvas) {
return Math.max(axisCanvas.start, axisCanvas.end) !== coord ? 1 : -1;
}

export const Axis = function (renderSettings) {
export let Axis = function (renderSettings) {
const that = this;

that._renderer = renderSettings.renderer;
Expand Down Expand Up @@ -2839,3 +2840,9 @@ Axis.prototype = {
shift: _noop,
/// #ENDDEBUG
};

/// #DEBUG
export function DEBUG_set_Axis(value: typeof Axis): void {
Axis = value;
}
/// #ENDDEBUG
10 changes: 9 additions & 1 deletion packages/devextreme/js/__internal/viz/axes/tick_generator.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/* eslint-disable prefer-destructuring */
/* eslint-disable import/no-mutable-exports */
/* eslint-disable @typescript-eslint/naming-convention */
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @stylistic/no-mixed-operators */
/* eslint-disable prefer-spread */
Expand Down Expand Up @@ -806,7 +808,7 @@ function dateGenerator(options) {
);
}

export const tickGenerator = function (options) {
export let tickGenerator = function (options) {
let result;

if (options.rangeIsEmpty) {
Expand All @@ -823,3 +825,9 @@ export const tickGenerator = function (options) {

return result;
};

/// #DEBUG
export function DEBUG_set_tickGenerator(value: typeof tickGenerator): void {
tickGenerator = value;
}
/// #ENDDEBUG
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/* eslint-disable @typescript-eslint/no-this-alias */
/* eslint-disable import/no-mutable-exports */
/* eslint-disable @typescript-eslint/naming-convention */
/* eslint-disable @typescript-eslint/init-declarations */
/* eslint-disable no-plusplus */
/* eslint-disable func-names */
Expand Down Expand Up @@ -69,13 +71,13 @@ function getLabelCheckerPosition(x, y, isHorizontal, canvas) {
};
}

export function Crosshair(renderer, options, params, group) {
export let Crosshair = function (renderer, options, params, group) {
const that = this;
that._renderer = renderer;
that._crosshairGroup = group;
that._options = {};
that.update(options, params);
}
};

Crosshair.prototype = {
constructor: Crosshair,
Expand Down Expand Up @@ -323,3 +325,9 @@ Crosshair.prototype = {
}
},
};

/// #DEBUG
export function DEBUG_set_Crosshair(value: typeof Crosshair): void {
Crosshair = value;
}
/// #ENDDEBUG
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/* eslint-disable @stylistic/no-mixed-operators */
/* eslint-disable import/no-mutable-exports */
/* eslint-disable func-names */
/* eslint-disable no-continue */
/* eslint-disable @typescript-eslint/init-declarations */
/* eslint-disable no-plusplus */
Expand Down Expand Up @@ -122,8 +124,8 @@ function getInnerRadius({ type, innerRadius }) {
return type === 'pie' ? 0 : _isNumber(innerRadius) ? Number(innerRadius) : DEFAULT_INNER_RADIUS;
}

function LayoutManager() {
}
let LayoutManager = function () {
};

function getAverageLabelWidth(centerX, radius, canvas, sizeLabels) {
return (centerX - radius - RADIAL_LABEL_INDENT - canvas.left) / sizeLabels.outerLabelsCount;
Expand Down Expand Up @@ -278,3 +280,9 @@ LayoutManager.prototype = {
};

export { LayoutManager };

/// #DEBUG
export function DEBUG_set_LayoutManager(value: typeof LayoutManager): void {
LayoutManager = value;
}
/// #ENDDEBUG
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable @stylistic/no-mixed-operators */
/* eslint-disable import/no-mutable-exports */
/* eslint-disable @typescript-eslint/no-this-alias */
/* eslint-disable @typescript-eslint/init-declarations */
/* eslint-disable func-names */
Expand All @@ -23,7 +24,7 @@ const _min = Math.min;
const _max = Math.max;
const MIN_SCROLL_BAR_SIZE = 10;

export const ScrollBar = function (renderer, group) {
export let ScrollBar = function (renderer, group) {
this._translator = new Translator2D({}, {}, {});
this._scroll = renderer.rect().append(group);
this._addEvents();
Expand Down Expand Up @@ -283,3 +284,9 @@ ScrollBar.prototype = {
});
},
};

/// #DEBUG
export function DEBUG_set_ScrollBar(value: typeof ScrollBar): void {
ScrollBar = value;
}
/// #ENDDEBUG
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/* eslint-disable prefer-rest-params */
/* eslint-disable import/no-mutable-exports */
/* eslint-disable @typescript-eslint/naming-convention */
/* eslint-disable @stylistic/no-mixed-operators */
/* eslint-disable no-bitwise */
/* eslint-disable prefer-spread */
Expand Down Expand Up @@ -26,7 +28,7 @@ import {
import { BaseThemeManager } from '@ts/viz/core/base_theme_manager';
import { extractColor, normalizeEnum as _normalizeEnum } from '@ts/viz/core/utils';

export const ThemeManager = BaseThemeManager.inherit((function () {
export let ThemeManager = BaseThemeManager.inherit((function () {
const ctor = function (params) {
const that = this;

Expand Down Expand Up @@ -245,3 +247,9 @@ export const ThemeManager = BaseThemeManager.inherit((function () {
},
};
})());

/// #DEBUG
export function DEBUG_set_ThemeManager(value: typeof ThemeManager): void {
ThemeManager = value;
}
/// #ENDDEBUG
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable @stylistic/max-len */
/* eslint-disable import/no-mutable-exports */
/* eslint-disable @typescript-eslint/explicit-function-return-type */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
/* eslint-disable @typescript-eslint/init-declarations */
Expand Down Expand Up @@ -505,7 +506,7 @@ function verifyData(source, incidentOccurred) {
return data;
}

export function validateData(data, groupsData, incidentOccurred, options) {
export let validateData = function (data, groupsData, incidentOccurred, options) {
data = verifyData(data, incidentOccurred);

groupsData.argumentType = groupsData.argumentAxisType = null;
Expand All @@ -524,4 +525,10 @@ export function validateData(data, groupsData, incidentOccurred, options) {
const dataByArgumentFields = sortData(data, groupsData, options, getUniqueArgumentFields(groupsData));

return dataByArgumentFields;
};

/// #DEBUG
export function DEBUG_set_validateData(value: typeof validateData): void {
validateData = value;
}
/// #ENDDEBUG
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/* eslint-disable no-return-assign */
/* eslint-disable import/no-mutable-exports */
/* eslint-disable func-names */
/* eslint-disable @typescript-eslint/no-this-alias */
/* eslint-disable @typescript-eslint/naming-convention */
/* eslint-disable no-multi-assign */
Expand Down Expand Up @@ -32,7 +34,7 @@ function getThemePart(theme, path) {
return _theme;
}

export const BaseThemeManager = Class.inherit({ // TODO: test hack
export let BaseThemeManager = Class.inherit({ // TODO: test hack
ctor(options) {
this._themeSection = options.themeSection;
this._fontFields = options.fontFields || [];
Expand Down Expand Up @@ -115,3 +117,9 @@ export const BaseThemeManager = Class.inherit({ // TODO: test hack
_extend(font, this._font, _extend({}, font));
},
});

/// #DEBUG
export function DEBUG_set_BaseThemeManager(value: typeof BaseThemeManager): void {
BaseThemeManager = value;
}
/// #ENDDEBUG
9 changes: 8 additions & 1 deletion packages/devextreme/js/__internal/viz/core/plaque.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable @stylistic/no-mixed-operators */
/* eslint-disable import/no-mutable-exports */
/* eslint-disable @typescript-eslint/init-declarations */
/* eslint-disable @typescript-eslint/naming-convention */
/* eslint-disable no-nested-ternary */
Expand Down Expand Up @@ -223,7 +224,7 @@ function getCloudPoints({ width, height }, x, y, anchorX, anchorY, { arrowWidth,
return buildPath('M', points, 'Z');
}

export class Plaque {
export let Plaque = class {
widget;

options;
Expand Down Expand Up @@ -480,4 +481,10 @@ export class Plaque {
const { width, height } = this._size || {};
return Math.abs(x - this.x) <= width / 2 && Math.abs(y - this.y) <= height / 2;
}
};

/// #DEBUG
export function DEBUG_set_Plaque(value: typeof Plaque): void {
Plaque = value;
}
/// #ENDDEBUG
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/* eslint-disable @typescript-eslint/prefer-optional-chain */
/* eslint-disable import/no-mutable-exports */
/* eslint-disable @typescript-eslint/naming-convention */
/* eslint-disable no-restricted-globals */
/* eslint-disable func-names */
/* eslint-disable @typescript-eslint/no-shadow */
Expand Down Expand Up @@ -144,13 +146,13 @@ Animation.prototype = {
},
};

export function AnimationController(element) {
export let AnimationController = function (element) {
const that = this;
that._animationCount = 0;
that._timerId = null;
that._animations = {};
that.element = element;
}
};

AnimationController.prototype = {
_loop() {
Expand Down Expand Up @@ -239,3 +241,9 @@ AnimationController.prototype = {
!hasUnstoppableInAnimations && this.stop();
},
};

/// #DEBUG
export function DEBUG_set_AnimationController(value: typeof AnimationController): void {
AnimationController = value;
}
/// #ENDDEBUG
Original file line number Diff line number Diff line change
Expand Up @@ -1843,7 +1843,7 @@ function unlinkItem(target) {
updateIndexes(items, i);
}

export function Renderer(options) {
export let Renderer = function (options) {
const that = this;
that.root = that._createElement('svg', {
xmlns: 'http://www.w3.org/2000/svg',
Expand All @@ -1868,7 +1868,7 @@ export function Renderer(options) {
that.root.append({ element: options.container });
that._locker = 0;
that._backed = false;
}
};

Renderer.prototype = {
constructor: Renderer,
Expand Down Expand Up @@ -2362,10 +2362,15 @@ const DEBUG_set_ArcSvgElement = function (value) {
const DEBUG_set_TextSvgElement = function (value) {
TextSvgElement = value;
};

const DEBUG_set_Renderer = function (value) {
Renderer = value;
};
/// #ENDDEBUG

/// #DEBUG
exports.DEBUG_set_ArcSvgElement = DEBUG_set_ArcSvgElement;
exports.DEBUG_set_Renderer = DEBUG_set_Renderer;
exports.DEBUG_set_PathSvgElement = DEBUG_set_PathSvgElement;
exports.DEBUG_set_RectSvgElement = DEBUG_set_RectSvgElement;
exports.DEBUG_set_SvgElement = DEBUG_set_SvgElement;
Expand Down
Loading
Loading