@devexpress/dx-grid-core
Advanced tools
Comparing version 1.0.0-alpha.1 to 1.0.0-alpha.2
/** | ||
* Bundle of @devexpress/dx-grid-core | ||
* Generated: 2017-05-15 | ||
* Generated: 2017-05-26 | ||
* Version: 1.0.0-alpha.1 | ||
@@ -79,3 +79,4 @@ * License: https://js.devexpress.com/Licensing | ||
direction = _ref.direction, | ||
keepOther = _ref.keepOther; | ||
keepOther = _ref.keepOther, | ||
cancel = _ref.cancel; | ||
@@ -92,8 +93,12 @@ var sortingIndex = sorting.findIndex(function (s) { | ||
}); | ||
if (keepOther) { | ||
if (keepOther && cancel) { | ||
nextSorting.splice(sortingIndex, 1); | ||
} else if (keepOther && !cancel) { | ||
nextSorting.splice(sortingIndex, 1, updatedSorting); | ||
} else if (!keepOther && cancel) { | ||
nextSorting.length = 0; | ||
} else { | ||
nextSorting.push(updatedSorting); | ||
} | ||
} else { | ||
} else if (!cancel) { | ||
nextSorting.push({ | ||
@@ -346,2 +351,10 @@ columnName: columnName, | ||
var groupedColumns = function groupedColumns(columns, grouping) { | ||
return grouping.map(function (group) { | ||
return columns.find(function (c) { | ||
return c.name === group.columnName; | ||
}); | ||
}); | ||
}; | ||
var setCurrentPage = function setCurrentPage(prevPage, _ref) { | ||
@@ -351,2 +364,6 @@ var page = _ref.page; | ||
}; | ||
var setPageSize = function setPageSize(prevPageSize, _ref2) { | ||
var size = _ref2.size; | ||
return size; | ||
}; | ||
@@ -390,2 +407,6 @@ var paginate = function paginate(rows, pageSize, page) { | ||
var totalPageCount = function totalPageCount(rows, pageSize) { | ||
return Math.ceil(rows.length / pageSize); | ||
}; | ||
var setRowSelection = function setRowSelection(selection, _ref) { | ||
@@ -488,2 +509,6 @@ var rowId = _ref.rowId, | ||
var tableColumnsWithDetail = function tableColumnsWithDetail(columns) { | ||
return [{ type: 'detail', width: 25 }].concat(toConsumableArray(columns)); | ||
}; | ||
var isDetailRowExpanded = function isDetailRowExpanded(expandedRows, rowId) { | ||
@@ -612,3 +637,69 @@ return expandedRows.indexOf(rowId) > -1; | ||
export { setColumnSorting, getColumnSortingDirection, sortedRows, setColumnFilter, getColumnFilterConfig, filteredRows, groupByColumn, groupedRows, expandedGroupRows, setCurrentPage, paginate, ensurePageHeaders, setRowSelection, setRowsSelection, getAvailableToSelect, getAvailableSelection, setDetailRowExpanded, expandedDetailRows, isDetailRowExpanded, startEditRows, stopEditRows, addRow, changeAddedRow, cancelAddedRows, changeRow, cancelChanges, deleteRows, cancelDeletedRows, changedRowsByIds, addedRowsByIds, getRowChange, rowsWithEditing }; | ||
var tableHeaderRowsWithFilter = function tableHeaderRowsWithFilter(headerRows, rowHeight) { | ||
return [].concat(toConsumableArray(headerRows), [{ type: 'filter', height: rowHeight }]); | ||
}; | ||
var tableColumnsWithGroups = function tableColumnsWithGroups(columns, grouping) { | ||
return [].concat(toConsumableArray(grouping.map(function (group) { | ||
return { type: 'groupColumn', group: group, width: 20 }; | ||
})), toConsumableArray(columns)); | ||
}; | ||
var tableColumnsWithoutGroups = function tableColumnsWithoutGroups(columns, grouping) { | ||
return columns.filter(function (column) { | ||
return grouping.findIndex(function (g) { | ||
return g.columnName === column.name; | ||
}) === -1; | ||
}); | ||
}; | ||
var tableRowsWithHeading = function tableRowsWithHeading(headerRows) { | ||
return [{ type: 'heading' }].concat(toConsumableArray(headerRows)); | ||
}; | ||
var creatMultipleHandler = function creatMultipleHandler() { | ||
var handlers = []; | ||
var multipleHandler = function multipleHandler(e) { | ||
handlers.forEach(function (handler) { | ||
return handler(e); | ||
}); | ||
}; | ||
multipleHandler.addHandler = function (handler) { | ||
return handlers.unshift(handler); | ||
}; | ||
return multipleHandler; | ||
}; | ||
function extendWithEventListener(extraProps, name, handler) { | ||
var extendedExtraProps = Object.assign({}, extraProps); | ||
if (!extendedExtraProps[name]) { | ||
extendedExtraProps[name] = creatMultipleHandler(); | ||
} | ||
extendedExtraProps[name].addHandler(handler); | ||
return extendedExtraProps; | ||
} | ||
var tableColumnsWithSelection = function tableColumnsWithSelection(columns) { | ||
return [{ type: 'select', name: 'select', width: 30 }].concat(toConsumableArray(columns)); | ||
}; | ||
var tableBodyRowsWithSelection = function tableBodyRowsWithSelection(bodyRows, selection, getRowId) { | ||
var selectionSet = new Set(selection); | ||
return bodyRows.map(function (row) { | ||
if (!selectionSet.has(getRowId(row))) return row; | ||
return Object.assign({ selected: true, _originalRow: row }, row); | ||
}); | ||
}; | ||
var tableExtraProps = function tableExtraProps(extraProps, availableToSelect, setRowSelection, getRowId) { | ||
return extendWithEventListener(extraProps, 'onClick', function (_ref) { | ||
var row = _ref.row; | ||
var rowId = getRowId(row); | ||
if (availableToSelect.indexOf(rowId) === -1) return; | ||
setRowSelection({ rowId: rowId }); | ||
}); | ||
}; | ||
export { setColumnSorting, getColumnSortingDirection, sortedRows, setColumnFilter, getColumnFilterConfig, filteredRows, groupByColumn, groupedRows, expandedGroupRows, groupedColumns, setCurrentPage, setPageSize, paginate, ensurePageHeaders, totalPageCount, setRowSelection, setRowsSelection, getAvailableToSelect, getAvailableSelection, setDetailRowExpanded, expandedDetailRows, tableColumnsWithDetail, isDetailRowExpanded, startEditRows, stopEditRows, addRow, changeAddedRow, cancelAddedRows, changeRow, cancelChanges, deleteRows, cancelDeletedRows, changedRowsByIds, addedRowsByIds, getRowChange, rowsWithEditing, tableHeaderRowsWithFilter, tableColumnsWithGroups, tableColumnsWithoutGroups, tableRowsWithHeading, tableColumnsWithSelection, tableBodyRowsWithSelection, tableExtraProps }; | ||
//# sourceMappingURL=dx-grid-core.es.js.map |
/** | ||
* Bundle of @devexpress/dx-grid-core | ||
* Generated: 2017-05-15 | ||
* Generated: 2017-05-26 | ||
* Version: 1.0.0-alpha.1 | ||
@@ -85,3 +85,4 @@ * License: https://js.devexpress.com/Licensing | ||
direction = _ref.direction, | ||
keepOther = _ref.keepOther; | ||
keepOther = _ref.keepOther, | ||
cancel = _ref.cancel; | ||
@@ -98,8 +99,12 @@ var sortingIndex = sorting.findIndex(function (s) { | ||
}); | ||
if (keepOther) { | ||
if (keepOther && cancel) { | ||
nextSorting.splice(sortingIndex, 1); | ||
} else if (keepOther && !cancel) { | ||
nextSorting.splice(sortingIndex, 1, updatedSorting); | ||
} else if (!keepOther && cancel) { | ||
nextSorting.length = 0; | ||
} else { | ||
nextSorting.push(updatedSorting); | ||
} | ||
} else { | ||
} else if (!cancel) { | ||
nextSorting.push({ | ||
@@ -352,2 +357,10 @@ columnName: columnName, | ||
var groupedColumns = function groupedColumns(columns, grouping) { | ||
return grouping.map(function (group) { | ||
return columns.find(function (c) { | ||
return c.name === group.columnName; | ||
}); | ||
}); | ||
}; | ||
var setCurrentPage = function setCurrentPage(prevPage, _ref) { | ||
@@ -357,2 +370,6 @@ var page = _ref.page; | ||
}; | ||
var setPageSize = function setPageSize(prevPageSize, _ref2) { | ||
var size = _ref2.size; | ||
return size; | ||
}; | ||
@@ -396,2 +413,6 @@ var paginate = function paginate(rows, pageSize, page) { | ||
var totalPageCount = function totalPageCount(rows, pageSize) { | ||
return Math.ceil(rows.length / pageSize); | ||
}; | ||
var setRowSelection = function setRowSelection(selection, _ref) { | ||
@@ -494,2 +515,6 @@ var rowId = _ref.rowId, | ||
var tableColumnsWithDetail = function tableColumnsWithDetail(columns) { | ||
return [{ type: 'detail', width: 25 }].concat(toConsumableArray(columns)); | ||
}; | ||
var isDetailRowExpanded = function isDetailRowExpanded(expandedRows, rowId) { | ||
@@ -618,2 +643,68 @@ return expandedRows.indexOf(rowId) > -1; | ||
var tableHeaderRowsWithFilter = function tableHeaderRowsWithFilter(headerRows, rowHeight) { | ||
return [].concat(toConsumableArray(headerRows), [{ type: 'filter', height: rowHeight }]); | ||
}; | ||
var tableColumnsWithGroups = function tableColumnsWithGroups(columns, grouping) { | ||
return [].concat(toConsumableArray(grouping.map(function (group) { | ||
return { type: 'groupColumn', group: group, width: 20 }; | ||
})), toConsumableArray(columns)); | ||
}; | ||
var tableColumnsWithoutGroups = function tableColumnsWithoutGroups(columns, grouping) { | ||
return columns.filter(function (column) { | ||
return grouping.findIndex(function (g) { | ||
return g.columnName === column.name; | ||
}) === -1; | ||
}); | ||
}; | ||
var tableRowsWithHeading = function tableRowsWithHeading(headerRows) { | ||
return [{ type: 'heading' }].concat(toConsumableArray(headerRows)); | ||
}; | ||
var creatMultipleHandler = function creatMultipleHandler() { | ||
var handlers = []; | ||
var multipleHandler = function multipleHandler(e) { | ||
handlers.forEach(function (handler) { | ||
return handler(e); | ||
}); | ||
}; | ||
multipleHandler.addHandler = function (handler) { | ||
return handlers.unshift(handler); | ||
}; | ||
return multipleHandler; | ||
}; | ||
function extendWithEventListener(extraProps, name, handler) { | ||
var extendedExtraProps = Object.assign({}, extraProps); | ||
if (!extendedExtraProps[name]) { | ||
extendedExtraProps[name] = creatMultipleHandler(); | ||
} | ||
extendedExtraProps[name].addHandler(handler); | ||
return extendedExtraProps; | ||
} | ||
var tableColumnsWithSelection = function tableColumnsWithSelection(columns) { | ||
return [{ type: 'select', name: 'select', width: 30 }].concat(toConsumableArray(columns)); | ||
}; | ||
var tableBodyRowsWithSelection = function tableBodyRowsWithSelection(bodyRows, selection, getRowId) { | ||
var selectionSet = new Set(selection); | ||
return bodyRows.map(function (row) { | ||
if (!selectionSet.has(getRowId(row))) return row; | ||
return Object.assign({ selected: true, _originalRow: row }, row); | ||
}); | ||
}; | ||
var tableExtraProps = function tableExtraProps(extraProps, availableToSelect, setRowSelection, getRowId) { | ||
return extendWithEventListener(extraProps, 'onClick', function (_ref) { | ||
var row = _ref.row; | ||
var rowId = getRowId(row); | ||
if (availableToSelect.indexOf(rowId) === -1) return; | ||
setRowSelection({ rowId: rowId }); | ||
}); | ||
}; | ||
exports.setColumnSorting = setColumnSorting; | ||
@@ -628,5 +719,8 @@ exports.getColumnSortingDirection = getColumnSortingDirection; | ||
exports.expandedGroupRows = expandedGroupRows; | ||
exports.groupedColumns = groupedColumns; | ||
exports.setCurrentPage = setCurrentPage; | ||
exports.setPageSize = setPageSize; | ||
exports.paginate = paginate; | ||
exports.ensurePageHeaders = ensurePageHeaders; | ||
exports.totalPageCount = totalPageCount; | ||
exports.setRowSelection = setRowSelection; | ||
@@ -638,2 +732,3 @@ exports.setRowsSelection = setRowsSelection; | ||
exports.expandedDetailRows = expandedDetailRows; | ||
exports.tableColumnsWithDetail = tableColumnsWithDetail; | ||
exports.isDetailRowExpanded = isDetailRowExpanded; | ||
@@ -653,2 +748,9 @@ exports.startEditRows = startEditRows; | ||
exports.rowsWithEditing = rowsWithEditing; | ||
exports.tableHeaderRowsWithFilter = tableHeaderRowsWithFilter; | ||
exports.tableColumnsWithGroups = tableColumnsWithGroups; | ||
exports.tableColumnsWithoutGroups = tableColumnsWithoutGroups; | ||
exports.tableRowsWithHeading = tableRowsWithHeading; | ||
exports.tableColumnsWithSelection = tableColumnsWithSelection; | ||
exports.tableBodyRowsWithSelection = tableBodyRowsWithSelection; | ||
exports.tableExtraProps = tableExtraProps; | ||
@@ -655,0 +757,0 @@ Object.defineProperty(exports, '__esModule', { value: true }); |
{ | ||
"name": "@devexpress/dx-grid-core", | ||
"version": "1.0.0-alpha.1", | ||
"version": "1.0.0-alpha.2", | ||
"description": "Core library for the DevExtreme Reactive Grid component", | ||
@@ -5,0 +5,0 @@ "author": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
110764
1161