Skip to content

Commit ef9e618

Browse files
Form: remove 'm_' prefix from files (DevExpress#30541)
1 parent 255a34d commit ef9e618

20 files changed

+71
-80
lines changed

packages/devextreme/js/__internal/ui/form/components/m_button_item.ts renamed to packages/devextreme/js/__internal/ui/form/components/button_item.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { isDefined } from '@js/core/utils/type';
55
import type { Properties } from '@js/ui/button';
66
import type { HorizontalAlignment, VerticalAlignment } from '@js/ui/form';
77
import type Button from '@ts/ui/button/wrapper';
8-
import type { TemplatesInfo } from '@ts/ui/form/m_form.layout_manager';
8+
import type { TemplatesInfo } from '@ts/ui/form/form.layout_manager';
99

1010
const FIELD_BUTTON_ITEM_CLASS = 'dx-field-button-item';
1111

packages/devextreme/js/__internal/ui/form/components/m_empty_item.ts renamed to packages/devextreme/js/__internal/ui/form/components/empty_item.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { dxElementWrapper } from '@js/core/renderer';
22
import $ from '@js/core/renderer';
3-
import type { TemplatesInfo } from '@ts/ui/form/m_form.layout_manager';
3+
import type { TemplatesInfo } from '@ts/ui/form/form.layout_manager';
44

55
export const FIELD_EMPTY_ITEM_CLASS = 'dx-field-empty-item';
66

packages/devextreme/js/__internal/ui/form/components/m_field_item.ts renamed to packages/devextreme/js/__internal/ui/form/components/field_item.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ import type { SimpleItem } from '@js/ui/form';
1010
import { current, isMaterialBased } from '@js/ui/themes';
1111
import errors from '@js/ui/widget/ui.errors';
1212
import type Editor from '@ts/ui/editor/editor';
13-
import type { SimpleItemLabelTemplateData } from '@ts/ui/form/components/m_label';
14-
import { renderLabel } from '@ts/ui/form/components/m_label';
13+
import type { SimpleItemLabelTemplateData } from '@ts/ui/form/components/label';
14+
import { renderLabel } from '@ts/ui/form/components/label';
1515
import {
1616
FIELD_ITEM_CONTENT_CLASS,
1717
} from '@ts/ui/form/constants';
18-
import type Form from '@ts/ui/form/m_form';
19-
import type LayoutManager from '@ts/ui/form/m_form.layout_manager';
20-
import type { FieldItemOptions } from '@ts/ui/form/m_form.layout_manager.utils';
18+
import type Form from '@ts/ui/form/form';
19+
import type LayoutManager from '@ts/ui/form/form.layout_manager';
20+
import type { FieldItemOptions } from '@ts/ui/form/form.layout_manager.utils';
2121
import Validator from '@ts/ui/m_validator';
2222

2323
export const FLEX_LAYOUT_CLASS = 'dx-flex-layout';
@@ -240,11 +240,10 @@ export function renderFieldItem({
240240
//
241241

242242
const $validationTarget = getValidationTarget($fieldEditorContainer);
243-
const validationTargetInstance = $validationTarget
244-
&& $validationTarget.data(VALIDATION_TARGET_CLASS);
243+
const validationTargetInstance = $validationTarget?.data(VALIDATION_TARGET_CLASS);
245244

246245
if (validationTargetInstance) {
247-
const isItemHaveCustomLabel = item.label && item.label.text;
246+
const isItemHaveCustomLabel = item.label?.text;
248247
const itemName = isItemHaveCustomLabel ? null : name;
249248
const fieldName = isItemHaveCustomLabel ? item.label.text : itemName && captionize(itemName);
250249
let validationRules: ValidationRule[] | null = null;

packages/devextreme/js/__internal/ui/form/components/m_label.ts renamed to packages/devextreme/js/__internal/ui/form/components/label.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import {
88
FIELD_ITEM_LABEL_CLASS,
99
FIELD_ITEM_LABEL_CONTENT_CLASS,
1010
} from '@ts/ui/form/constants';
11-
import type Form from '@ts/ui/form/m_form';
12-
import type LayoutManager from '@ts/ui/form/m_form.layout_manager';
13-
import type { LabelMarkOptions } from '@ts/ui/form/m_form.layout_manager.utils';
14-
import { getLabelMarkText } from '@ts/ui/form/m_form.layout_manager.utils';
11+
import type Form from '@ts/ui/form/form';
12+
import type LayoutManager from '@ts/ui/form/form.layout_manager';
13+
import type { LabelMarkOptions } from '@ts/ui/form/form.layout_manager.utils';
14+
import { getLabelMarkText } from '@ts/ui/form/form.layout_manager.utils';
1515

1616
// TODO: exported for tests only
1717
export const GET_LABEL_WIDTH_BY_TEXT_CLASS = 'dx-layout-manager-hidden-label';

packages/devextreme/js/__internal/ui/form/m_form.item_option_action.ts renamed to packages/devextreme/js/__internal/ui/form/form.item_option_action.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import type { dxElementWrapper } from '@js/core/renderer';
44
import type { Item, SimpleItem } from '@js/ui/form';
55
import type Button from '@ts/ui/button';
66
import type Editor from '@ts/ui/editor/editor';
7-
import type FormItemsRunTimeInfo from '@ts/ui/form/m_form.items_runtime_info';
8-
import type { PreparedItem } from '@ts/ui/form/m_form.items_runtime_info';
7+
import type FormItemsRunTimeInfo from '@ts/ui/form/form.items_runtime_info';
8+
import type { PreparedItem } from '@ts/ui/form/form.items_runtime_info';
99
import type TabPanel from '@ts/ui/tab_panel/tab_panel';
1010

1111
export interface ItemOptionActionOptions<T = Item> {
@@ -43,7 +43,6 @@ export default class ItemOptionAction<T extends ItemOptionActionOptions = ItemOp
4343
return this._itemsRunTimeInfo.findPreparedItemByItem(this._options.item);
4444
}
4545

46-
// eslint-disable-next-line class-methods-use-this
4746
tryExecute(): void {
4847
Class.abstract();
4948
}

packages/devextreme/js/__internal/ui/form/m_form.item_options_actions.ts renamed to packages/devextreme/js/__internal/ui/form/form.item_options_actions.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
import type { ValidationRule } from '@js/common';
33
import { data } from '@js/core/element_data';
44
import type { GroupItem } from '@js/ui/form';
5-
import type { ItemOptionActionOptions, ValidationRulesItemOptionActionOption } from '@ts/ui/form/m_form.item_option_action';
6-
import ItemOptionAction from '@ts/ui/form/m_form.item_option_action';
7-
import type { PreparedGroupedItem } from '@ts/ui/form/m_form.items_runtime_info';
8-
import { getFullOptionName } from '@ts/ui/form/m_form.utils';
5+
import type { ItemOptionActionOptions, ValidationRulesItemOptionActionOption } from '@ts/ui/form/form.item_option_action';
6+
import ItemOptionAction from '@ts/ui/form/form.item_option_action';
7+
import type { PreparedGroupedItem } from '@ts/ui/form/form.items_runtime_info';
8+
import { getFullOptionName } from '@ts/ui/form/form.utils';
99

1010
export type ItemOptionActionType = WidgetOptionItemOptionAction
1111
| ValidationRulesItemOptionAction
@@ -44,7 +44,6 @@ class TabOptionItemOptionAction extends ItemOptionAction {
4444
}
4545

4646
class SimpleItemTemplateChangedAction extends ItemOptionAction {
47-
// eslint-disable-next-line class-methods-use-this
4847
tryExecute(): boolean {
4948
return false;
5049
}
@@ -55,8 +54,7 @@ class GroupItemTemplateChangedAction extends ItemOptionAction<
5554
> {
5655
tryExecute(): boolean {
5756
const preparedItem: PreparedGroupedItem | undefined = this.findPreparedItem();
58-
if (preparedItem != null
59-
&& preparedItem._prepareGroupItemTemplate
57+
if (preparedItem?._prepareGroupItemTemplate
6058
&& preparedItem._renderGroupContentTemplate
6159
) {
6260
preparedItem._prepareGroupItemTemplate(this._options.item.template);

packages/devextreme/js/__internal/ui/form/m_form.items_runtime_info.ts renamed to packages/devextreme/js/__internal/ui/form/form.items_runtime_info.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import type {
1010
} from '@js/ui/form';
1111
import type Button from '@ts/ui/button';
1212
import type Editor from '@ts/ui/editor/editor';
13-
import type LayoutManager from '@ts/ui/form/m_form.layout_manager';
13+
import type LayoutManager from '@ts/ui/form/form.layout_manager';
1414
import type TabPanel from '@ts/ui/tab_panel/tab_panel';
1515

1616
export type PreparedItem<T = Item> = T & {

packages/devextreme/js/__internal/ui/form/m_form.layout_manager.ts renamed to packages/devextreme/js/__internal/ui/form/form.layout_manager.ts

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ import Widget from '@ts/core/widget/widget';
3131
import Button from '@ts/ui/button/wrapper';
3232
import type Editor from '@ts/ui/editor/editor';
3333
import type { EditorProperties } from '@ts/ui/editor/editor';
34-
import { renderButtonItem } from '@ts/ui/form/components/m_button_item';
35-
import { renderEmptyItem } from '@ts/ui/form/components/m_empty_item';
36-
import { renderFieldItem } from '@ts/ui/form/components/m_field_item';
34+
import { renderButtonItem } from '@ts/ui/form/components/button_item';
35+
import { renderEmptyItem } from '@ts/ui/form/components/empty_item';
36+
import { renderFieldItem } from '@ts/ui/form/components/field_item';
3737
import {
3838
FIELD_ITEM_CLASS,
3939
FORM_LAYOUT_MANAGER_CLASS,
@@ -42,12 +42,12 @@ import {
4242
SIMPLE_ITEM_TYPE,
4343
SINGLE_COLUMN_ITEM_CONTENT,
4444
} from '@ts/ui/form/constants';
45-
import type { FormProperties } from '@ts/ui/form/m_form';
46-
import type Form from '@ts/ui/form/m_form';
47-
import type { FormItemRuntimeInfo, PreparedItem } from '@ts/ui/form/m_form.items_runtime_info';
48-
import FormItemsRunTimeInfo from '@ts/ui/form/m_form.items_runtime_info';
49-
import type { LabelMarkOptions } from '@ts/ui/form/m_form.layout_manager.utils';
50-
import { convertToRenderFieldItemOptions } from '@ts/ui/form/m_form.layout_manager.utils';
45+
import type { FormProperties } from '@ts/ui/form/form';
46+
import type Form from '@ts/ui/form/form';
47+
import type { FormItemRuntimeInfo, PreparedItem } from '@ts/ui/form/form.items_runtime_info';
48+
import FormItemsRunTimeInfo from '@ts/ui/form/form.items_runtime_info';
49+
import type { LabelMarkOptions } from '@ts/ui/form/form.layout_manager.utils';
50+
import { convertToRenderFieldItemOptions } from '@ts/ui/form/form.layout_manager.utils';
5151
import type { LocationItem, ResponsiveBoxItem, ResponsiveBoxProperties } from '@ts/ui/responsive_box';
5252
import ResponsiveBox from '@ts/ui/responsive_box';
5353

@@ -309,7 +309,6 @@ class LayoutManager extends Widget<LayoutManagerProperties> {
309309
});
310310
}
311311

312-
// eslint-disable-next-line class-methods-use-this
313312
_generateItemsByData(layoutData: unknown): Item[] {
314313
const result: Item[] = [];
315314

@@ -358,7 +357,6 @@ class LayoutManager extends Widget<LayoutManagerProperties> {
358357
return item as ExtendedItem;
359358
}
360359

361-
// eslint-disable-next-line class-methods-use-this
362360
_getEditorTypeByDataType(dataType: string): 'dxNumberBox' | 'dxDateBox' | 'dxCheckBox' | 'dxTextBox' {
363361
switch (dataType) {
364362
case 'number':
@@ -404,7 +402,7 @@ class LayoutManager extends Widget<LayoutManagerProperties> {
404402
_renderResponsiveBox(): void {
405403
const templatesInfo: TemplatesInfo[] = [];
406404

407-
if (this._items && this._items.length) {
405+
if (this._items?.length) {
408406
const colCount = this._getColCount();
409407
const $container = $('<div>').appendTo(this.$element());
410408

@@ -464,7 +462,7 @@ class LayoutManager extends Widget<LayoutManagerProperties> {
464462
const that = this;
465463
const { colCountByScreen, screenByWidth } = this.option();
466464

467-
const xsColCount = colCountByScreen && colCountByScreen.xs;
465+
const xsColCount = colCountByScreen?.xs;
468466

469467
return {
470468
onItemStateChanged: this._itemStateChangedHandler.bind(this),
@@ -639,7 +637,6 @@ class LayoutManager extends Widget<LayoutManagerProperties> {
639637
this._setItems(result);
640638
}
641639

642-
// eslint-disable-next-line class-methods-use-this
643640
_getColByIndex(index: number, colCount: number): number {
644641
return index % colCount;
645642
}
@@ -903,7 +900,7 @@ class LayoutManager extends Widget<LayoutManagerProperties> {
903900
if (!isDefined(this._watch)) {
904901
const { form: formInstance } = this.option();
905902

906-
this._watch = formInstance && formInstance.option('integrationOptions.watchMethod');
903+
this._watch = formInstance?.option('integrationOptions.watchMethod');
907904
}
908905

909906
return this._watch;
@@ -941,7 +938,6 @@ class LayoutManager extends Widget<LayoutManagerProperties> {
941938
return instance;
942939
}
943940

944-
// eslint-disable-next-line class-methods-use-this
945941
_generateRatio(count: number, isAutoSize?: boolean): ResponsiveBoxItem[] {
946942
const result: ResponsiveBoxItem[] = [];
947943

packages/devextreme/js/__internal/ui/form/m_form.layout_manager.utils.ts renamed to packages/devextreme/js/__internal/ui/form/form.layout_manager.utils.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ import type {
1515
import type { DropDownEditorProperties } from '@ts/ui/drop_down_editor/m_drop_down_editor';
1616
import type { EditorProperties } from '@ts/ui/editor/editor';
1717
import type Editor from '@ts/ui/editor/editor';
18-
import type { LabelOptions } from '@ts/ui/form/components/m_label';
18+
import type { LabelOptions } from '@ts/ui/form/components/label';
1919
import { SIMPLE_ITEM_TYPE } from '@ts/ui/form/constants';
20-
import type Form from '@ts/ui/form/m_form';
21-
import type LayoutManager from '@ts/ui/form/m_form.layout_manager';
20+
import type Form from '@ts/ui/form/form';
21+
import type LayoutManager from '@ts/ui/form/form.layout_manager';
2222

2323
export interface LabelMarkOptions {
2424
showRequiredMark?: boolean;
@@ -337,18 +337,22 @@ function _convertToEditorOptions({
337337
if (defaultEditorName) {
338338
if (EDITORS_WITH_MULTIPLE_INPUT_FIELDS.includes(editorType)) {
339339
if (editorType === 'dxRangeSlider') {
340+
// eslint-disable-next-line max-depth
340341
if (!result.startName) {
341342
result.startName = `${defaultEditorName}Start`;
342343
}
344+
// eslint-disable-next-line max-depth
343345
if (!result.endName) {
344346
result.endName = `${defaultEditorName}End`;
345347
}
346348
}
347349

348350
if (editorType === 'dxDateRangeBox') {
351+
// eslint-disable-next-line max-depth
349352
if (!result.startDateName) {
350353
result.startDateName = `${defaultEditorName}Start`;
351354
}
355+
// eslint-disable-next-line max-depth
352356
if (!result.endDateName) {
353357
result.endDateName = `${defaultEditorName}End`;
354358
}

0 commit comments

Comments
 (0)