Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@devexpress/dx-grid-core

Package Overview
Dependencies
Maintainers
9
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@devexpress/dx-grid-core - npm Package Compare versions

Comparing version 1.0.0-beta.2 to 1.0.0-beta.3

126

dist/dx-grid-core.es.js
/**
* Bundle of @devexpress/dx-grid-core
* Generated: 2017-12-14
* Version: 1.0.0-beta.2
* Generated: 2017-12-28
* Version: 1.0.0-beta.3
* License: https://js.devexpress.com/Licensing

@@ -22,6 +22,8 @@ */

var cellValueGetter = function cellValueGetter(getCellValue, columns) {
if (getCellValue) {
return getCellValue;
}
var defaultGetCellValue = function defaultGetCellValue(row, columnName) {
return row[columnName];
};
var cellValueGetter = function cellValueGetter() {
var getCellValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultGetCellValue;
var columns = arguments[1];

@@ -37,6 +39,8 @@ var useFastAccessor = true;

return useFastAccessor ? function (row, columnName) {
return row[columnName];
} : function (row, columnName) {
return map[columnName] ? map[columnName](row, columnName) : row[columnName];
if (useFastAccessor) {
return getCellValue;
}
return function (row, columnName) {
return map[columnName] ? map[columnName](row, columnName) : getCellValue(row, columnName);
};

@@ -49,3 +53,2 @@ };

keepOther = _ref.keepOther,
cancel = _ref.cancel,
sortIndex = _ref.sortIndex;

@@ -78,3 +81,3 @@ var sorting = state.sorting;

if (!cancel) {
if (direction !== null) {
var newIndexFallback = columnSortingIndex > -1 ? columnSortingIndex : nextSorting.length;

@@ -744,3 +747,3 @@ var newIndex = sortIndex !== undefined ? sortIndex : newIndexFallback;

var defaultColumnIdentity = function defaultColumnIdentity(value) {
var defaultColumnCriteria = function defaultColumnCriteria(value) {
return {

@@ -752,3 +755,3 @@ key: String(value),

var groupedRows = function groupedRows(rows, grouping, getCellValue, getColumnIdentity) {
var groupedRows = function groupedRows(rows, grouping, getCellValue, getColumnCriteria) {
var keyPrefix = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : '';

@@ -760,8 +763,8 @@

var groupIdentity = getColumnIdentity && getColumnIdentity(columnName) || defaultColumnIdentity;
var groupCriteria = getColumnCriteria && getColumnCriteria(columnName) || defaultColumnCriteria;
var groups = rows.reduce(function (acc, row) {
var _groupIdentity = groupIdentity(getCellValue(row, columnName), row),
key = _groupIdentity.key,
_groupIdentity$value = _groupIdentity.value,
value = _groupIdentity$value === undefined ? key : _groupIdentity$value;
var _groupCriteria = groupCriteria(getCellValue(row, columnName), row),
key = _groupCriteria.key,
_groupCriteria$value = _groupCriteria.value,
value = _groupCriteria$value === undefined ? key : _groupCriteria$value;

@@ -790,3 +793,3 @@ var sameKeyItems = acc.get(key);

acc.push((_acc$push = {}, defineProperty(_acc$push, GRID_GROUP_CHECK, true), defineProperty(_acc$push, GRID_GROUP_LEVEL_KEY, GRID_GROUP_TYPE + '_' + groupedBy), defineProperty(_acc$push, 'groupedBy', groupedBy), defineProperty(_acc$push, 'compoundKey', compoundKey), defineProperty(_acc$push, 'key', key), defineProperty(_acc$push, 'value', value), _acc$push));
acc.push.apply(acc, toConsumableArray(groupedRows(items, nestedGrouping, getCellValue, getColumnIdentity, '' + compoundKey + GROUP_KEY_SEPARATOR)));
acc.push.apply(acc, toConsumableArray(groupedRows(items, nestedGrouping, getCellValue, getColumnCriteria, '' + compoundKey + GROUP_KEY_SEPARATOR)));
return acc;

@@ -1064,4 +1067,6 @@ }, []);

var addRow = function addRow(addedRows, _ref3) {
var row = _ref3.row;
var addRow = function addRow(addedRows) {
var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { row: {} },
row = _ref3.row;
return [].concat(toConsumableArray(addedRows), [row]);

@@ -1143,6 +1148,12 @@ };

var computedCreateRowChange = function computedCreateRowChange(columns) {
var map = columns.reduce(function (acc, column) {
if (column.createRowChange) {
acc[column.name] = column.createRowChange;
var defaultCreateRowChange = function defaultCreateRowChange(row, value, columnName) {
return defineProperty({}, columnName, value);
};
var createRowChangeGetter = function createRowChangeGetter() {
var createRowChange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultCreateRowChange;
var columnExtensions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
var map = columnExtensions.reduce(function (acc, columnExtension) {
if (columnExtension.createRowChange) {
acc[columnExtension.columnName] = columnExtension.createRowChange;
}

@@ -1152,4 +1163,7 @@ return acc;

return function (row, columnName, value) {
return map[columnName] ? map[columnName](row, value, columnName) : defineProperty({}, columnName, value);
return function (row, value, columnName) {
if (map[columnName]) {
return map[columnName](row, value, columnName);
}
return createRowChange(row, value, columnName);
};

@@ -1487,8 +1501,25 @@ };

var tableColumnsWithDataRows = function tableColumnsWithDataRows(columns) {
var getColumnExtension = function getColumnExtension(columnExtensions, columnName) {
if (!columnExtensions) {
return {};
}
var columnExtension = columnExtensions.find(function (extension) {
return extension.columnName === columnName;
});
if (!columnExtension) {
return {};
}
return columnExtension;
};
var tableColumnsWithDataRows = function tableColumnsWithDataRows(columns, columnExtensions) {
return columns.map(function (column) {
var name = column.name;
var columnExtension = getColumnExtension(columnExtensions, name);
return {
key: TABLE_DATA_TYPE + '_' + column.name,
key: TABLE_DATA_TYPE + '_' + name,
type: TABLE_DATA_TYPE,
width: column.width,
width: columnExtension.width,
align: columnExtension.align,
column: column

@@ -1684,11 +1715,32 @@ };

var getGroupCellTargetIndex = function getGroupCellTargetIndex(geometries, sourceIndex, _ref) {
var x = _ref.x,
y = _ref.y;
var rectToObject = function rectToObject(_ref) {
var top = _ref.top,
right = _ref.right,
bottom = _ref.bottom,
left = _ref.left;
return {
top: top, right: right, bottom: bottom, left: left
};
};
var collapseGapsBetweenItems = function collapseGapsBetweenItems(geometries) {
return geometries.map(function (geometry, index) {
if (index !== geometries.length - 1 && geometry.top === geometries[index + 1].top) {
return _extends({}, geometry, {
right: geometries[index + 1].left
});
}
return geometry;
});
};
var getGroupCellTargetIndex = function getGroupCellTargetIndex(geometries, sourceIndex, _ref2) {
var x = _ref2.x,
y = _ref2.y;
if (geometries.length === 0) return 0;
var targetGeometries = sourceIndex !== -1 ? getTargetColumnGeometries(geometries, sourceIndex) : geometries;
var targetGeometries = sourceIndex !== -1 ? getTargetColumnGeometries(geometries, sourceIndex) : geometries.map(rectToObject);
var targetIndex = targetGeometries.findIndex(function (geometry, index) {
var targetIndex = collapseGapsBetweenItems(targetGeometries).findIndex(function (geometry, index) {
var inVerticalBounds = isOnTheSameLine(geometry, y);

@@ -1725,3 +1777,3 @@ var inHorizontalBounds = x >= geometry.left && x <= geometry.right;

export { getTableRowColumnsWithColSpan, getTableColumnGeometries, getTableTargetColumnIndex, getAnimations, filterActiveAnimations, evalAnimations, getGroupCellTargetIndex, getMessagesFormatter, rowIdGetter, cellValueGetter, setColumnSorting, getColumnSortingDirection, sortedRows, setColumnFilter, getColumnFilterConfig, filteredRows, GROUP_KEY_SEPARATOR, GROUP_ADD_MODE, GROUP_REMOVE_MODE, GROUP_REORDER_MODE, groupByColumn, toggleExpandedGroups, draftGroupingChange, cancelGroupingChange, draftGrouping, groupRowChecker, groupRowLevelKeyGetter, groupedRows, expandedGroupRows, customGroupedRows, customGroupingRowIdGetter, groupingPanelItems, setCurrentPage, setPageSize, paginatedRows, rowsWithPageHeaders, pageCount, rowCount, firstRowOnPage, lastRowOnPage, setRowsSelection, getAvailableToSelect, someSelected, allSelected, startEditRows, stopEditRows, addRow, changeAddedRow, cancelAddedRows, changeRow, cancelChanges, deleteRows, cancelDeletedRows, changedRowsByIds, addedRowsByIds, computedCreateRowChange, getRowChange, TABLE_REORDERING_TYPE, changeColumnOrder, orderedColumns, tableHeaderRowsWithReordering, draftOrder, tableColumnsWithWidths, changeTableColumnWidths, changeDraftTableColumnWidths, TABLE_EDIT_COMMAND_TYPE, isHeadingEditCommandsTableCell, isEditCommandsTableCell, tableColumnsWithEditing, TABLE_ADDED_TYPE, TABLE_EDIT_TYPE, isEditTableCell, isAddedTableRow, isEditTableRow, tableRowsWithEditing, TABLE_FILTER_TYPE, isFilterTableCell, isFilterTableRow, tableHeaderRowsWithFilter, TABLE_GROUP_TYPE, isGroupTableCell, isGroupIndentTableCell, isGroupTableRow, tableColumnsWithGrouping, tableRowsWithGrouping, TABLE_HEADING_TYPE, isHeadingTableCell, isHeadingTableRow, tableRowsWithHeading, TABLE_DETAIL_TYPE, isDetailRowExpanded, isDetailToggleTableCell, isDetailTableRow, setDetailRowExpanded, tableRowsWithExpandedDetail, tableColumnsWithDetail, TABLE_SELECT_TYPE, isSelectTableCell, isSelectAllTableCell, tableColumnsWithSelection, TABLE_DATA_TYPE, TABLE_NODATA_TYPE, isNoDataTableRow, isDataTableCell, isHeaderStubTableCell, isDataTableRow, tableColumnsWithDataRows, tableRowsWithDataRows, visibleTableColumns, columnChooserItems, toggleColumn };
export { getColumnExtension, getTableRowColumnsWithColSpan, getTableColumnGeometries, getTableTargetColumnIndex, getAnimations, filterActiveAnimations, evalAnimations, getGroupCellTargetIndex, getMessagesFormatter, rowIdGetter, cellValueGetter, setColumnSorting, getColumnSortingDirection, sortedRows, setColumnFilter, getColumnFilterConfig, filteredRows, GROUP_KEY_SEPARATOR, GROUP_ADD_MODE, GROUP_REMOVE_MODE, GROUP_REORDER_MODE, groupByColumn, toggleExpandedGroups, draftGroupingChange, cancelGroupingChange, draftGrouping, groupRowChecker, groupRowLevelKeyGetter, groupedRows, expandedGroupRows, customGroupedRows, customGroupingRowIdGetter, groupingPanelItems, setCurrentPage, setPageSize, paginatedRows, rowsWithPageHeaders, pageCount, rowCount, firstRowOnPage, lastRowOnPage, setRowsSelection, getAvailableToSelect, someSelected, allSelected, startEditRows, stopEditRows, addRow, changeAddedRow, cancelAddedRows, changeRow, cancelChanges, deleteRows, cancelDeletedRows, changedRowsByIds, addedRowsByIds, createRowChangeGetter, getRowChange, TABLE_REORDERING_TYPE, changeColumnOrder, orderedColumns, tableHeaderRowsWithReordering, draftOrder, tableColumnsWithWidths, changeTableColumnWidths, changeDraftTableColumnWidths, TABLE_EDIT_COMMAND_TYPE, isHeadingEditCommandsTableCell, isEditCommandsTableCell, tableColumnsWithEditing, TABLE_ADDED_TYPE, TABLE_EDIT_TYPE, isEditTableCell, isAddedTableRow, isEditTableRow, tableRowsWithEditing, TABLE_FILTER_TYPE, isFilterTableCell, isFilterTableRow, tableHeaderRowsWithFilter, TABLE_GROUP_TYPE, isGroupTableCell, isGroupIndentTableCell, isGroupTableRow, tableColumnsWithGrouping, tableRowsWithGrouping, TABLE_HEADING_TYPE, isHeadingTableCell, isHeadingTableRow, tableRowsWithHeading, TABLE_DETAIL_TYPE, isDetailRowExpanded, isDetailToggleTableCell, isDetailTableRow, setDetailRowExpanded, tableRowsWithExpandedDetail, tableColumnsWithDetail, TABLE_SELECT_TYPE, isSelectTableCell, isSelectAllTableCell, tableColumnsWithSelection, TABLE_DATA_TYPE, TABLE_NODATA_TYPE, isNoDataTableRow, isDataTableCell, isHeaderStubTableCell, isDataTableRow, tableColumnsWithDataRows, tableRowsWithDataRows, visibleTableColumns, columnChooserItems, toggleColumn };
//# sourceMappingURL=dx-grid-core.es.js.map
/**
* Bundle of @devexpress/dx-grid-core
* Generated: 2017-12-14
* Version: 1.0.0-beta.2
* Generated: 2017-12-28
* Version: 1.0.0-beta.3
* License: https://js.devexpress.com/Licensing

@@ -26,6 +26,8 @@ */

var cellValueGetter = function cellValueGetter(getCellValue, columns) {
if (getCellValue) {
return getCellValue;
}
var defaultGetCellValue = function defaultGetCellValue(row, columnName) {
return row[columnName];
};
var cellValueGetter = function cellValueGetter() {
var getCellValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultGetCellValue;
var columns = arguments[1];

@@ -41,6 +43,8 @@ var useFastAccessor = true;

return useFastAccessor ? function (row, columnName) {
return row[columnName];
} : function (row, columnName) {
return map[columnName] ? map[columnName](row, columnName) : row[columnName];
if (useFastAccessor) {
return getCellValue;
}
return function (row, columnName) {
return map[columnName] ? map[columnName](row, columnName) : getCellValue(row, columnName);
};

@@ -53,3 +57,2 @@ };

keepOther = _ref.keepOther,
cancel = _ref.cancel,
sortIndex = _ref.sortIndex;

@@ -82,3 +85,3 @@ var sorting = state.sorting;

if (!cancel) {
if (direction !== null) {
var newIndexFallback = columnSortingIndex > -1 ? columnSortingIndex : nextSorting.length;

@@ -748,3 +751,3 @@ var newIndex = sortIndex !== undefined ? sortIndex : newIndexFallback;

var defaultColumnIdentity = function defaultColumnIdentity(value) {
var defaultColumnCriteria = function defaultColumnCriteria(value) {
return {

@@ -756,3 +759,3 @@ key: String(value),

var groupedRows = function groupedRows(rows, grouping, getCellValue, getColumnIdentity) {
var groupedRows = function groupedRows(rows, grouping, getCellValue, getColumnCriteria) {
var keyPrefix = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : '';

@@ -764,8 +767,8 @@

var groupIdentity = getColumnIdentity && getColumnIdentity(columnName) || defaultColumnIdentity;
var groupCriteria = getColumnCriteria && getColumnCriteria(columnName) || defaultColumnCriteria;
var groups = rows.reduce(function (acc, row) {
var _groupIdentity = groupIdentity(getCellValue(row, columnName), row),
key = _groupIdentity.key,
_groupIdentity$value = _groupIdentity.value,
value = _groupIdentity$value === undefined ? key : _groupIdentity$value;
var _groupCriteria = groupCriteria(getCellValue(row, columnName), row),
key = _groupCriteria.key,
_groupCriteria$value = _groupCriteria.value,
value = _groupCriteria$value === undefined ? key : _groupCriteria$value;

@@ -794,3 +797,3 @@ var sameKeyItems = acc.get(key);

acc.push((_acc$push = {}, defineProperty(_acc$push, GRID_GROUP_CHECK, true), defineProperty(_acc$push, GRID_GROUP_LEVEL_KEY, GRID_GROUP_TYPE + '_' + groupedBy), defineProperty(_acc$push, 'groupedBy', groupedBy), defineProperty(_acc$push, 'compoundKey', compoundKey), defineProperty(_acc$push, 'key', key), defineProperty(_acc$push, 'value', value), _acc$push));
acc.push.apply(acc, toConsumableArray(groupedRows(items, nestedGrouping, getCellValue, getColumnIdentity, '' + compoundKey + GROUP_KEY_SEPARATOR)));
acc.push.apply(acc, toConsumableArray(groupedRows(items, nestedGrouping, getCellValue, getColumnCriteria, '' + compoundKey + GROUP_KEY_SEPARATOR)));
return acc;

@@ -1068,4 +1071,6 @@ }, []);

var addRow = function addRow(addedRows, _ref3) {
var row = _ref3.row;
var addRow = function addRow(addedRows) {
var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { row: {} },
row = _ref3.row;
return [].concat(toConsumableArray(addedRows), [row]);

@@ -1147,6 +1152,12 @@ };

var computedCreateRowChange = function computedCreateRowChange(columns) {
var map = columns.reduce(function (acc, column) {
if (column.createRowChange) {
acc[column.name] = column.createRowChange;
var defaultCreateRowChange = function defaultCreateRowChange(row, value, columnName) {
return defineProperty({}, columnName, value);
};
var createRowChangeGetter = function createRowChangeGetter() {
var createRowChange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultCreateRowChange;
var columnExtensions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
var map = columnExtensions.reduce(function (acc, columnExtension) {
if (columnExtension.createRowChange) {
acc[columnExtension.columnName] = columnExtension.createRowChange;
}

@@ -1156,4 +1167,7 @@ return acc;

return function (row, columnName, value) {
return map[columnName] ? map[columnName](row, value, columnName) : defineProperty({}, columnName, value);
return function (row, value, columnName) {
if (map[columnName]) {
return map[columnName](row, value, columnName);
}
return createRowChange(row, value, columnName);
};

@@ -1491,8 +1505,25 @@ };

var tableColumnsWithDataRows = function tableColumnsWithDataRows(columns) {
var getColumnExtension = function getColumnExtension(columnExtensions, columnName) {
if (!columnExtensions) {
return {};
}
var columnExtension = columnExtensions.find(function (extension) {
return extension.columnName === columnName;
});
if (!columnExtension) {
return {};
}
return columnExtension;
};
var tableColumnsWithDataRows = function tableColumnsWithDataRows(columns, columnExtensions) {
return columns.map(function (column) {
var name = column.name;
var columnExtension = getColumnExtension(columnExtensions, name);
return {
key: TABLE_DATA_TYPE + '_' + column.name,
key: TABLE_DATA_TYPE + '_' + name,
type: TABLE_DATA_TYPE,
width: column.width,
width: columnExtension.width,
align: columnExtension.align,
column: column

@@ -1688,11 +1719,32 @@ };

var getGroupCellTargetIndex = function getGroupCellTargetIndex(geometries, sourceIndex, _ref) {
var x = _ref.x,
y = _ref.y;
var rectToObject = function rectToObject(_ref) {
var top = _ref.top,
right = _ref.right,
bottom = _ref.bottom,
left = _ref.left;
return {
top: top, right: right, bottom: bottom, left: left
};
};
var collapseGapsBetweenItems = function collapseGapsBetweenItems(geometries) {
return geometries.map(function (geometry, index) {
if (index !== geometries.length - 1 && geometry.top === geometries[index + 1].top) {
return _extends({}, geometry, {
right: geometries[index + 1].left
});
}
return geometry;
});
};
var getGroupCellTargetIndex = function getGroupCellTargetIndex(geometries, sourceIndex, _ref2) {
var x = _ref2.x,
y = _ref2.y;
if (geometries.length === 0) return 0;
var targetGeometries = sourceIndex !== -1 ? getTargetColumnGeometries(geometries, sourceIndex) : geometries;
var targetGeometries = sourceIndex !== -1 ? getTargetColumnGeometries(geometries, sourceIndex) : geometries.map(rectToObject);
var targetIndex = targetGeometries.findIndex(function (geometry, index) {
var targetIndex = collapseGapsBetweenItems(targetGeometries).findIndex(function (geometry, index) {
var inVerticalBounds = isOnTheSameLine(geometry, y);

@@ -1729,2 +1781,3 @@ var inHorizontalBounds = x >= geometry.left && x <= geometry.right;

exports.getColumnExtension = getColumnExtension;
exports.getTableRowColumnsWithColSpan = getTableRowColumnsWithColSpan;

@@ -1785,3 +1838,3 @@ exports.getTableColumnGeometries = getTableColumnGeometries;

exports.addedRowsByIds = addedRowsByIds;
exports.computedCreateRowChange = computedCreateRowChange;
exports.createRowChangeGetter = createRowChangeGetter;
exports.getRowChange = getRowChange;

@@ -1788,0 +1841,0 @@ exports.TABLE_REORDERING_TYPE = TABLE_REORDERING_TYPE;

{
"name": "@devexpress/dx-grid-core",
"version": "1.0.0-beta.2",
"version": "1.0.0-beta.3",
"description": "Core library for the DevExtreme Reactive Grid component",

@@ -42,5 +42,5 @@ "author": {

"devDependencies": {
"@devexpress/dx-core": "1.0.0-beta.2",
"@devexpress/dx-core": "1.0.0-beta.3",
"babel-core": "^6.26.0",
"babel-jest": "^21.2.0",
"babel-jest": "^22.0.4",
"babel-plugin-external-helpers": "^6.22.0",

@@ -50,16 +50,16 @@ "babel-plugin-transform-object-rest-spread": "^6.26.0",

"babel-preset-es2015": "^6.24.1",
"core-js": "^2.5.1",
"eslint": "^4.12.1",
"core-js": "^2.5.3",
"eslint": "^4.14.0",
"eslint-config-airbnb-base": "^12.1.0",
"eslint-plugin-filenames": "^1.2.0",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-jest": "^21.4.2",
"jest": "^21.2.1",
"eslint-plugin-jest": "^21.5.0",
"jest": "^22.0.4",
"rollup": "0.50.0",
"rollup-plugin-babel": "^3.0.2",
"rollup-plugin-babel": "^3.0.3",
"rollup-plugin-license": "^0.5.0"
},
"peerDependencies": {
"@devexpress/dx-core": "1.0.0-beta.2"
"@devexpress/dx-core": "1.0.0-beta.3"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc