Socket
Socket
Sign inDemoInstall

@atlaskit/dynamic-table

Package Overview
Dependencies
126
Maintainers
1
Versions
193
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 14.11.2 to 14.11.3

tmp/api-report-tmp.d.ts

6

CHANGELOG.md
# @atlaskit/dynamic-table
## 14.11.3
### Patch Changes
- [`a486e54d1ef`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a486e54d1ef) - Improved performance of built-in table sorting for stateful dynamic tables
## 14.11.2

@@ -4,0 +10,0 @@

2

dist/cjs/components/stateless.js

@@ -32,3 +32,3 @@ "use strict";

var packageName = "@atlaskit/dynamic-table";
var packageVersion = "14.11.2";
var packageVersion = "14.11.3";
function toggleSortOrder(currentSortOrder) {

@@ -35,0 +35,0 @@ switch (currentSortOrder) {

@@ -26,2 +26,13 @@ "use strict";

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
var getSortingCellValue = function getSortingCellValue(cells, head, sortKey) {
for (var i = 0; i < cells.length; i++) {
var _head$cells$i;
if (head.cells[i] && ((_head$cells$i = head.cells[i]) === null || _head$cells$i === void 0 ? void 0 : _head$cells$i.key) === sortKey) {
var _cells$i;
return (_cells$i = cells[i]) === null || _cells$i === void 0 ? void 0 : _cells$i.key;
}
}
return undefined;
};
// sort all rows based on sort key and order

@@ -35,12 +46,9 @@ var getSortedRows = function getSortedRows(head, rows, sortKey, sortOrder) {

}
var modifier = sortOrder === _constants.ASC ? 1 : -1;
// return value which will be used for sorting
var getSortingCellValue = function getSortingCellValue(cells) {
for (var i = 0; i < cells.length; i++) {
if (head.cells[i] && head.cells[i].key === sortKey) {
return cells[i].key;
}
}
return undefined;
};
// Re-initialising an I18n Collator on every sort is performance intensive, thus constructed outside
var collator = new Intl.Collator(undefined, {
numeric: true,
sensitivity: 'accent'
});

@@ -53,7 +61,4 @@ // Get copy of rows to avoid sorting prop in place

return sortableRows.sort(function (a, b) {
var valA = getSortingCellValue(a.cells);
var valB = getSortingCellValue(b.cells);
// modifier used for sorting type (ascending or descending)
var modifier = sortOrder === _constants.ASC ? 1 : -1;
var valA = getSortingCellValue(a.cells, head, sortKey);
var valB = getSortingCellValue(b.cells, head, sortKey);
if (valA === undefined || valB === undefined) {

@@ -78,9 +83,4 @@ return modifier;

}
// Sort strings using localeCompare
if (typeof valA === 'string' && typeof valB === 'string') {
return modifier * valA.localeCompare(valB, undefined, {
sensitivity: 'accent',
numeric: true
});
return modifier * collator.compare(valA, valB);
}

@@ -87,0 +87,0 @@ if (!valA && valA !== 0 || valA < valB) {

{
"name": "@atlaskit/dynamic-table",
"version": "14.11.2",
"version": "14.11.3",
"sideEffects": false
}

@@ -17,3 +17,3 @@ import _extends from "@babel/runtime/helpers/extends";

const packageName = "@atlaskit/dynamic-table";
const packageVersion = "14.11.2";
const packageVersion = "14.11.3";
function toggleSortOrder(currentSortOrder) {

@@ -20,0 +20,0 @@ switch (currentSortOrder) {

@@ -6,2 +6,13 @@ import _extends from "@babel/runtime/helpers/extends";

import { getPageRows, validateSortKey } from '../internal/helpers';
const getSortingCellValue = (cells, head, sortKey) => {
for (let i = 0; i < cells.length; i++) {
var _head$cells$i;
if (head.cells[i] && ((_head$cells$i = head.cells[i]) === null || _head$cells$i === void 0 ? void 0 : _head$cells$i.key) === sortKey) {
var _cells$i;
return (_cells$i = cells[i]) === null || _cells$i === void 0 ? void 0 : _cells$i.key;
}
}
return undefined;
};
// sort all rows based on sort key and order

@@ -15,12 +26,9 @@ const getSortedRows = (head, rows, sortKey, sortOrder) => {

}
const modifier = sortOrder === ASC ? 1 : -1;
// return value which will be used for sorting
const getSortingCellValue = cells => {
for (let i = 0; i < cells.length; i++) {
if (head.cells[i] && head.cells[i].key === sortKey) {
return cells[i].key;
}
}
return undefined;
};
// Re-initialising an I18n Collator on every sort is performance intensive, thus constructed outside
const collator = new Intl.Collator(undefined, {
numeric: true,
sensitivity: 'accent'
});

@@ -33,7 +41,4 @@ // Get copy of rows to avoid sorting prop in place

return sortableRows.sort((a, b) => {
const valA = getSortingCellValue(a.cells);
const valB = getSortingCellValue(b.cells);
// modifier used for sorting type (ascending or descending)
const modifier = sortOrder === ASC ? 1 : -1;
const valA = getSortingCellValue(a.cells, head, sortKey);
const valB = getSortingCellValue(b.cells, head, sortKey);
if (valA === undefined || valB === undefined) {

@@ -58,9 +63,4 @@ return modifier;

}
// Sort strings using localeCompare
if (typeof valA === 'string' && typeof valB === 'string') {
return modifier * valA.localeCompare(valB, undefined, {
sensitivity: 'accent',
numeric: true
});
return modifier * collator.compare(valA, valB);
}

@@ -67,0 +67,0 @@ if (!valA && valA !== 0 || valA < valB) {

{
"name": "@atlaskit/dynamic-table",
"version": "14.11.2",
"version": "14.11.3",
"sideEffects": false
}

@@ -25,3 +25,3 @@ import _extends from "@babel/runtime/helpers/extends";

var packageName = "@atlaskit/dynamic-table";
var packageVersion = "14.11.2";
var packageVersion = "14.11.3";
function toggleSortOrder(currentSortOrder) {

@@ -28,0 +28,0 @@ switch (currentSortOrder) {

@@ -19,2 +19,13 @@ import _extends from "@babel/runtime/helpers/extends";

import { getPageRows, validateSortKey } from '../internal/helpers';
var getSortingCellValue = function getSortingCellValue(cells, head, sortKey) {
for (var i = 0; i < cells.length; i++) {
var _head$cells$i;
if (head.cells[i] && ((_head$cells$i = head.cells[i]) === null || _head$cells$i === void 0 ? void 0 : _head$cells$i.key) === sortKey) {
var _cells$i;
return (_cells$i = cells[i]) === null || _cells$i === void 0 ? void 0 : _cells$i.key;
}
}
return undefined;
};
// sort all rows based on sort key and order

@@ -28,12 +39,9 @@ var getSortedRows = function getSortedRows(head, rows, sortKey, sortOrder) {

}
var modifier = sortOrder === ASC ? 1 : -1;
// return value which will be used for sorting
var getSortingCellValue = function getSortingCellValue(cells) {
for (var i = 0; i < cells.length; i++) {
if (head.cells[i] && head.cells[i].key === sortKey) {
return cells[i].key;
}
}
return undefined;
};
// Re-initialising an I18n Collator on every sort is performance intensive, thus constructed outside
var collator = new Intl.Collator(undefined, {
numeric: true,
sensitivity: 'accent'
});

@@ -46,7 +54,4 @@ // Get copy of rows to avoid sorting prop in place

return sortableRows.sort(function (a, b) {
var valA = getSortingCellValue(a.cells);
var valB = getSortingCellValue(b.cells);
// modifier used for sorting type (ascending or descending)
var modifier = sortOrder === ASC ? 1 : -1;
var valA = getSortingCellValue(a.cells, head, sortKey);
var valB = getSortingCellValue(b.cells, head, sortKey);
if (valA === undefined || valB === undefined) {

@@ -71,9 +76,4 @@ return modifier;

}
// Sort strings using localeCompare
if (typeof valA === 'string' && typeof valB === 'string') {
return modifier * valA.localeCompare(valB, undefined, {
sensitivity: 'accent',
numeric: true
});
return modifier * collator.compare(valA, valB);
}

@@ -80,0 +80,0 @@ if (!valA && valA !== 0 || valA < valB) {

{
"name": "@atlaskit/dynamic-table",
"version": "14.11.2",
"version": "14.11.3",
"sideEffects": false
}
{
"name": "@atlaskit/dynamic-table",
"version": "14.11.2",
"version": "14.11.3",
"description": "A dynamic table displays rows of data with built-in pagination, sorting, and re-ordering functionality.",

@@ -44,3 +44,3 @@ "publishConfig": {

"@atlaskit/theme": "^12.5.0",
"@atlaskit/tokens": "^1.11.0",
"@atlaskit/tokens": "^1.14.0",
"@babel/runtime": "^7.0.0",

@@ -47,0 +47,0 @@ "@emotion/react": "^11.7.1",

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc