devextreme
Version:
HTML5 JavaScript Component Suite for Responsive Web Development
31 lines (30 loc) • 1.02 kB
JavaScript
/**
* DevExtreme (esm/ui/scheduler/resources/utils.js)
* Version: 21.1.4
* Build date: Mon Jun 21 2021
*
* Copyright (c) 2012 - 2021 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
import {
normalizeDataSourceOptions
} from "../../../data/data_source/utils";
import {
DataSource
} from "../../../data/data_source/data_source";
export var getValueExpr = resource => resource.valueExpr || "id";
export var getDisplayExpr = resource => resource.displayExpr || "text";
export var getFieldExpr = resource => resource.fieldExpr || resource.field;
export var getWrappedDataSource = dataSource => {
if (dataSource instanceof DataSource) {
return dataSource
}
var result = {
store: normalizeDataSourceOptions(dataSource).store,
pageSize: 0
};
if (!Array.isArray(dataSource)) {
result.filter = dataSource.filter
}
return new DataSource(result)
};