Skip to content
Merged
5 changes: 3 additions & 2 deletions apps/demos/Demos/ActionSheet/PopoverMode/Vue/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@
<script setup lang="ts">
import { ref } from 'vue';
import DxActionSheet from 'devextreme-vue/action-sheet';
import DxList, { type DxListTypes } from 'devextreme-vue/list';
import DxList from 'devextreme-vue/list';
import type { DxListTypes } from 'devextreme-vue/list';
import notify from 'devextreme/ui/notify';
import type { DxElement } from 'devextreme/core/element';
import { actionSheetItems, contacts } from './data.ts';
import ContactItem from './ContactItem.vue';
import { type DxElement } from 'devextreme/core/element';

const isActionSheetVisible = ref(false);
const actionSheetTarget = ref<DxElement>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { HttpClient, HttpParams, provideHttpClient, withFetch } from '@angular/c
import { lastValueFrom } from 'rxjs';
import { DxAutocompleteModule } from 'devextreme-angular';
import { CustomStore } from 'devextreme-angular/common/data';
import { Service } from './app.service';
import * as AspNetData from 'devextreme-aspnet-data-nojquery';
import { Service } from './app.service';

if (!/localhost/.test(document.location.host)) {
enableProdMode();
Expand Down
2 changes: 1 addition & 1 deletion apps/demos/Demos/Autocomplete/Overview/React/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { CustomStore } from 'devextreme-react/common/data';
import type { LoadOptions } from 'devextreme-react/common/data';
import { Autocomplete, type AutocompleteTypes } from 'devextreme-react/autocomplete';
import 'whatwg-fetch';
import { names, surnames, positions } from './data.ts';
import AspNetData from 'devextreme-aspnet-data-nojquery';
import { names, surnames, positions } from './data.ts';

function isNotEmpty(value: string): boolean {
return value !== undefined && value !== null && value !== '';
Expand Down
2 changes: 1 addition & 1 deletion apps/demos/Demos/Autocomplete/Overview/ReactJs/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React, { useCallback, useState } from 'react';
import { CustomStore } from 'devextreme-react/common/data';
import { Autocomplete } from 'devextreme-react/autocomplete';
import 'whatwg-fetch';
import { names, surnames, positions } from './data.js';
import AspNetData from 'devextreme-aspnet-data-nojquery';
import { names, surnames, positions } from './data.js';

function isNotEmpty(value) {
return value !== undefined && value !== null && value !== '';
Expand Down
5 changes: 3 additions & 2 deletions apps/demos/Demos/CardView/CardTemplate/Vue/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,11 @@
<script setup lang="ts">
import { DxCardView, DxColumn, DxHeaderFilter, DxSearchPanel, DxPaging } from 'devextreme-vue/card-view';
import { DxPopup, DxPosition } from 'devextreme-vue/popup';
import { ref } from 'vue';
import LicenseInfo from './LicenseInfo.vue';
import VehicleCard from './VehicleCard.vue';
import { vehicles, type Vehicle } from './data.ts';
import { ref } from 'vue';
import { vehicles } from './data.ts';
import type { Vehicle } from './data.ts';

const popupVisible = ref(false);
const currentVehicle = ref<Vehicle | undefined>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function getOrderDay(rowData: Order) {
})
export class AppComponent {
orderDateHeaderFilterDataSource(data) {
data.dataSource.postProcess = function (results) {
data.dataSource.postProcess = (results) => {
results.push({
text: 'Weekends',
value: 'weekends',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ interface HeaderFilterDataSourceOptions {

function orderDateHeaderFilterDataSource(options: HeaderFilterDataSourceOptions): void {
if (options.dataSource) {
options.dataSource.postProcess = function (results: HeaderFilterDataResult[]) {
options.dataSource.postProcess = (results: HeaderFilterDataResult[]) => {
results.push({
text: 'Weekends',
value: 'weekends',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const saleAmountHeaderFilterDataSource = [
];
function orderDateHeaderFilterDataSource(options) {
if (options.dataSource) {
options.dataSource.postProcess = function (results) {
options.dataSource.postProcess = (results) => {
results.push({
text: 'Weekends',
value: 'weekends',
Expand Down
2 changes: 1 addition & 1 deletion apps/demos/Demos/CardView/ColumnHeaderFilter/Vue/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ type HeaderFilterDataSourceArg = {
};

function orderDateHeaderFilterDataSource(data: HeaderFilterDataSourceArg): void {
data.dataSource.postProcess = function (results: Array<{ text: string; value: unknown }>) {
data.dataSource.postProcess = (results: Array<{ text: string; value: unknown }>) => {
results.push({
text: 'Weekends',
value: 'weekends',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ $(() => {
},
headerFilter: {
dataSource(data) {
data.dataSource.postProcess = function (results) {
data.dataSource.postProcess = (results) => {
results.push({
text: 'Weekends',
value: 'weekends',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { bootstrapApplication } from '@angular/platform-browser';
import { Component, enableProdMode, ViewChild, provideZoneChangeDetection } from '@angular/core';
import { DxCardViewModule, DxCardViewComponent, DxButtonModule } from 'devextreme-angular';
import { AppService, Employee } from './app.service';

import notify from 'devextreme/ui/notify';
import { AppService, Employee } from './app.service';

if (!document.location.host.includes('localhost')) {
enableProdMode();
Expand Down
2 changes: 1 addition & 1 deletion apps/demos/Demos/Charts/LoadDataOnDemand/test-code.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
testUtils.importAnd(() => ['devextreme/viz/chart', 'devextreme/data/data_source'], () => [DevExpress.viz.dxChart, DevExpress.data.DataSource], (dxChart, DataSource) => {
window.checkReady = function () {
window.checkReady = () => {
const dataSource = dxChart.getInstance(document.querySelector('#chart')).getDataSource();
return dataSource ? dataSource.items().length > 0 : false;
};
Expand Down
2 changes: 1 addition & 1 deletion apps/demos/Demos/Charts/PointImage/Vue/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ import {
DxLegend,
DxPoint,
} from 'devextreme-vue/chart';
import type { ExportFormat } from 'devextreme/common';
import { iceHockeyStatistics } from './data.ts';
import { type ExportFormat } from 'devextreme/common';

const exportFormats: ExportFormat[] = ['PNG', 'PDF', 'JPEG', 'GIF', 'SVG'];

Expand Down
2 changes: 1 addition & 1 deletion apps/demos/Demos/Charts/SignalRService/jQuery/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$(() => {
$.type = $.type || function (obj) {
$.type = $.type || function getType(obj) {
if (obj == null) {
return `${obj}`;
}
Expand Down
2 changes: 1 addition & 1 deletion apps/demos/Demos/Charts/SignalRService/test-code.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { bootstrapApplication } from '@angular/platform-browser';
import { Component, enableProdMode, provideZoneChangeDetection } from '@angular/core';
import { AsyncPipe } from '@angular/common';
import { DxChatModule, DxButtonModule } from 'devextreme-angular';
import { type DxChatTypes } from 'devextreme-angular/ui/chat';
import type { DxChatTypes } from 'devextreme-angular/ui/chat';
import { Observable } from 'rxjs';
import { AppService } from './app.service';
import { loadMessages } from 'devextreme-angular/common/core/localization';
import { DataSource } from 'devextreme-angular/common/data';
import { AppService } from './app.service';

if (!/localhost/.test(document.location.host)) {
enableProdMode();
Expand Down
4 changes: 1 addition & 3 deletions apps/demos/Demos/Common/ListsOverview/jQuery/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -1186,9 +1186,7 @@ const data = [{
],
}].map((dataItem) => ({
...dataItem,
toLowerCase: () => function (text, render) {
return render(text).toLowerCase();
},
toLowerCase: () => (text, render) => render(text).toLowerCase(),
}));

const dataSource = new DevExpress.data.DataSource({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,6 @@ const houses = [{
},
].map((dataItem) => ({
...dataItem,
formatCurrency: () => function (text, render) {
return window.formatCurrency(parseInt(render(text), 10));
},
replaceFileExtension: () => function (text, render) {
return render(text).replace('.jpg', 'b.jpg');
},
formatCurrency: () => (text, render) => window.formatCurrency(parseInt(render(text), 10)),
replaceFileExtension: () => (text, render) => render(text).replace('.jpg', 'b.jpg'),
}));
2 changes: 1 addition & 1 deletion apps/demos/Demos/DataGrid/AIColumns/React/Category.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { type Vehicle } from './types';
import type { DataGridTypes } from 'devextreme-react/data-grid';
import type { Vehicle } from './types';

export default function Category(props: DataGridTypes.ColumnCellTemplateData<Vehicle>) {
return <div className="category__wrapper">{props.data?.CategoryName}</div>;
Expand Down
6 changes: 2 additions & 4 deletions apps/demos/Demos/DataGrid/AIColumns/React/service.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { type AIMessage } from './types';
import { AIIntegration } from 'devextreme-react/common/ai-integration';
import type { RequestParams, Response } from 'devextreme-react/common/ai-integration';
import { AzureOpenAI } from 'openai';
import notify from 'devextreme/ui/notify';
import type { AIMessage } from './types';

const AzureOpenAIConfig = {
dangerouslyAllowBrowser: true,
Expand Down Expand Up @@ -68,13 +68,11 @@ export const aiIntegration = new AIIntegration({

const promise = getAIResponseRecursive(aiPrompt, signal);

const result: Response = {
return {
promise,
abort: () => {
controller.abort();
},
};

return result;
},
});
3 changes: 1 addition & 2 deletions apps/demos/Demos/DataGrid/AIColumns/ReactJs/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,11 @@ export const aiIntegration = new AIIntegration({
{ role: 'user', content: prompt.user ?? '' },
];
const promise = getAIResponseRecursive(aiPrompt, signal);
const result = {
return {
promise,
abort: () => {
controller.abort();
},
};
return result;
},
});
134 changes: 64 additions & 70 deletions apps/demos/Demos/DataGrid/AdvancedMasterDetailView/jQuery/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function masterDetailTemplate(_, masterDetailOptions) {
}

function createOrdersTabTemplate(masterDetailData) {
return function () {
return () => {
let orderHistoryDataGrid;
function onProductChanged(productID) {
orderHistoryDataGrid.option('dataSource', createOrderHistoryStore(productID));
Expand All @@ -63,84 +63,78 @@ function createOrdersTabTemplate(masterDetailData) {
}

function createProductSelectBoxTemplate(masterDetailData, onProductChanged) {
return function () {
return $('<div>').dxSelectBox({
inputAttr: { 'aria-label': 'Product' },
dataSource: DevExpress.data.AspNet.createStore({
key: 'ProductID',
loadParams: { SupplierID: masterDetailData.SupplierID },
loadUrl: `${url}/GetProductsBySupplier`,
}),
valueExpr: 'ProductID',
displayExpr: 'ProductName',
deferRendering: false,
onContentReady(e) {
const firstItem = e.component.option('items[0]');
if (firstItem) {
e.component.option('value', firstItem.ProductID);
}
},
onValueChanged(e) {
onProductChanged(e.value);
},
});
};
return () => $('<div>').dxSelectBox({
inputAttr: { 'aria-label': 'Product' },
dataSource: DevExpress.data.AspNet.createStore({
key: 'ProductID',
loadParams: { SupplierID: masterDetailData.SupplierID },
loadUrl: `${url}/GetProductsBySupplier`,
}),
valueExpr: 'ProductID',
displayExpr: 'ProductName',
deferRendering: false,
onContentReady(e) {
const firstItem = e.component.option('items[0]');
if (firstItem) {
e.component.option('value', firstItem.ProductID);
}
},
onValueChanged(e) {
onProductChanged(e.value);
},
});
}

function createOrderHistoryTemplate(onDataGridInitialized) {
return function () {
return $('<div>').dxDataGrid({
onInitialized: onDataGridInitialized,
paging: {
pageSize: 5,
return () => $('<div>').dxDataGrid({
onInitialized: onDataGridInitialized,
paging: {
pageSize: 5,
},
showBorders: true,
columns: [
'OrderID',
{
dataField: 'OrderDate',
dataType: 'date',
},
showBorders: true,
columns: [
'OrderID',
{
dataField: 'OrderDate',
dataType: 'date',
},
'ShipCountry',
'ShipCity',
{
dataField: 'UnitPrice',
'ShipCountry',
'ShipCity',
{
dataField: 'UnitPrice',
format: 'currency',
},
'Quantity',
{
dataField: 'Discount',
format: 'percent',
},
],
summary: {
totalItems: [{
column: 'UnitPrice',
summaryType: 'sum',
valueFormat: {
format: 'currency',
precision: 2,
},
'Quantity',
{
dataField: 'Discount',
format: 'percent',
},
],
summary: {
totalItems: [{
column: 'UnitPrice',
summaryType: 'sum',
valueFormat: {
format: 'currency',
precision: 2,
},
}, {
column: 'Quantity',
summaryType: 'count',
}],
},
});
};
}, {
column: 'Quantity',
summaryType: 'count',
}],
},
});
}

function createAddressTabTemplate(data) {
return function () {
return $('<div>').addClass('address-form form-container').dxForm({
formData: data,
colCount: 2,
customizeItem(item) {
item.template = formItemTemplate;
},
items: ['Address', 'City', 'Region', 'PostalCode', 'Country', 'Phone'],
});
};
return () => $('<div>').addClass('address-form form-container').dxForm({
formData: data,
colCount: 2,
customizeItem(item) {
item.template = formItemTemplate;
},
items: ['Address', 'City', 'Region', 'PostalCode', 'Country', 'Phone'],
});
}

function formItemTemplate(item) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$(() => {
$.type = $.type || function (obj) {
$.type = $.type || function getType(obj) {
if (obj == null) {
return `${obj}`;
}
Expand Down
Loading
Loading