Skip to content

Commit

Permalink
Core: fix pivotGrid dataSource.bundled
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanblinov2k17 committed Oct 16, 2024
1 parent 96e66d0 commit c353115
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/devextreme/js/__internal/core/utils/m_common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const ensureDefined = function (value, defaultValue) {
return isDefined(value) ? value : defaultValue;
};

export const executeAsync = function (action, context/* , internal */) {
export const executeAsync = function (action, context?/* , internal */) {
// @ts-expect-error only void function can be called with new
const deferred = new Deferred();
const normalizedContext = context || this;
Expand Down
9 changes: 9 additions & 0 deletions packages/devextreme/js/__internal/core/utils/m_inflector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,12 @@ export const captionize = function(name) {
}
return captionList.join('');
};

export default {
dasherize,
underscore,
camelize,
humanize,
titleize,
captionize
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import Callbacks from '@js/core/utils/callbacks';
import { compileGetter } from '@js/core/utils/data';
import { Deferred, when } from '@js/core/utils/deferred';
import { extend } from '@js/core/utils/extend';
import { captionize } from '@js/core/utils/inflector';
import { each, map } from '@js/core/utils/iterator';
import { orderEach } from '@js/core/utils/object';
import {
Expand All @@ -21,6 +20,7 @@ import dateLocalization from '@js/localization/date';
import messageLocalization from '@js/localization/message';
import filterUtils from '@js/ui/shared/filtering';
import errors from '@js/ui/widget/ui.errors';
import inflector from '@ts/core/utils/m_inflector';
import type { DataController } from '@ts/grids/grid_core/data_controller/m_data_controller';
import type { FocusController } from '@ts/grids/grid_core/focus/m_focus';
import type { StateStoringController } from '@ts/grids/grid_core/state_storing/m_state_storing_core';
Expand Down Expand Up @@ -1605,7 +1605,7 @@ export class ColumnsController extends modules.Controller {
if (isString(dataField)) {
const getter = compileGetter(dataField);
calculatedColumnOptions = {
caption: captionize(dataField),
caption: inflector.captionize(dataField),
calculateCellValue(data, skipDeserialization) {
// @ts-expect-error
const value = getter(data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
import type { dxElementWrapper } from '@js/core/renderer';
import $ from '@js/core/renderer';
import { Deferred, when } from '@js/core/utils/deferred';
import { captionize } from '@js/core/utils/inflector';
import { isDefined } from '@js/core/utils/type';
import eventsEngine from '@js/events/core/events_engine';
import messageLocalization from '@js/localization/message';
import CheckBox from '@js/ui/check_box';
import inflector from '@ts/core/utils/m_inflector';
import {
getCaptionByOperation, getCurrentLookupValueText, getCurrentValueText,
getCustomOperation, getField, getGroupValue, isCondition, isGroup,
Expand Down Expand Up @@ -244,7 +244,7 @@ export class FilterPanelView extends modules.View {
const value = filterValue[2];

if (customOperation) {
operationText = customOperation.caption || captionize(customOperation.name);
operationText = customOperation.caption || inflector.captionize(customOperation.name);
} else if (value === null) {
operationText = getCaptionByOperation(operation === '=' ? 'isblank' : 'isnotblank', options.filterOperationDescriptions);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { EventsStrategy } from '@js/core/events_strategy';
import { normalizeIndexes } from '@js/core/utils/array';
import { Deferred, when } from '@js/core/utils/deferred';
import { extend } from '@js/core/utils/extend';
import { titleize } from '@js/core/utils/inflector';
import { each } from '@js/core/utils/iterator';
import {
isDefined, isFunction, isNumeric, isPlainObject,
Expand All @@ -12,6 +11,7 @@ import {
import Store from '@js/data/abstract_store';
import { normalizeDataSourceOptions } from '@js/data/data_source/utils';
import commonUtils from '@ts/core/utils/m_common';
import inflector from '@ts/core/utils/m_inflector';

import { LocalStore } from '../local_store/m_local_store';
import {
Expand Down Expand Up @@ -73,7 +73,7 @@ function createCaption(field) {
summaryType = '';
}

return titleize(caption) + summaryType;
return inflector.titleize(caption) + summaryType;
}

function resetFieldState(field, properties) {
Expand Down

0 comments on commit c353115

Please sign in to comment.