[fix] sort rows
This commit is contained in:
parent
f125c0e652
commit
b04ee1fb9f
30
dist/frappe-datatable.cjs.js
vendored
30
dist/frappe-datatable.cjs.js
vendored
@ -221,10 +221,12 @@ var isObject_1 = isObject;
|
|||||||
|
|
||||||
var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
||||||
|
|
||||||
|
/** Detect free variable `global` from Node.js. */
|
||||||
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
||||||
|
|
||||||
var _freeGlobal = freeGlobal;
|
var _freeGlobal = freeGlobal;
|
||||||
|
|
||||||
|
/** Detect free variable `self`. */
|
||||||
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
||||||
|
|
||||||
/** Used as a reference to the global object. */
|
/** Used as a reference to the global object. */
|
||||||
@ -232,16 +234,34 @@ var root = _freeGlobal || freeSelf || Function('return this')();
|
|||||||
|
|
||||||
var _root = root;
|
var _root = root;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the timestamp of the number of milliseconds that have elapsed since
|
||||||
|
* the Unix epoch (1 January 1970 00:00:00 UTC).
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
* @memberOf _
|
||||||
|
* @since 2.4.0
|
||||||
|
* @category Date
|
||||||
|
* @returns {number} Returns the timestamp.
|
||||||
|
* @example
|
||||||
|
*
|
||||||
|
* _.defer(function(stamp) {
|
||||||
|
* console.log(_.now() - stamp);
|
||||||
|
* }, _.now());
|
||||||
|
* // => Logs the number of milliseconds it took for the deferred invocation.
|
||||||
|
*/
|
||||||
var now = function() {
|
var now = function() {
|
||||||
return _root.Date.now();
|
return _root.Date.now();
|
||||||
};
|
};
|
||||||
|
|
||||||
var now_1 = now;
|
var now_1 = now;
|
||||||
|
|
||||||
|
/** Built-in value references. */
|
||||||
var Symbol = _root.Symbol;
|
var Symbol = _root.Symbol;
|
||||||
|
|
||||||
var _Symbol = Symbol;
|
var _Symbol = Symbol;
|
||||||
|
|
||||||
|
/** Used for built-in method references. */
|
||||||
var objectProto = Object.prototype;
|
var objectProto = Object.prototype;
|
||||||
|
|
||||||
/** Used to check objects for own properties. */
|
/** Used to check objects for own properties. */
|
||||||
@ -309,6 +329,7 @@ function objectToString(value) {
|
|||||||
|
|
||||||
var _objectToString = objectToString;
|
var _objectToString = objectToString;
|
||||||
|
|
||||||
|
/** `Object#toString` result references. */
|
||||||
var nullTag = '[object Null]';
|
var nullTag = '[object Null]';
|
||||||
var undefinedTag = '[object Undefined]';
|
var undefinedTag = '[object Undefined]';
|
||||||
|
|
||||||
@ -363,6 +384,7 @@ function isObjectLike(value) {
|
|||||||
|
|
||||||
var isObjectLike_1 = isObjectLike;
|
var isObjectLike_1 = isObjectLike;
|
||||||
|
|
||||||
|
/** `Object#toString` result references. */
|
||||||
var symbolTag = '[object Symbol]';
|
var symbolTag = '[object Symbol]';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -389,6 +411,7 @@ function isSymbol(value) {
|
|||||||
|
|
||||||
var isSymbol_1 = isSymbol;
|
var isSymbol_1 = isSymbol;
|
||||||
|
|
||||||
|
/** Used as references for various `Number` constants. */
|
||||||
var NAN = 0 / 0;
|
var NAN = 0 / 0;
|
||||||
|
|
||||||
/** Used to match leading and trailing whitespace. */
|
/** Used to match leading and trailing whitespace. */
|
||||||
@ -452,6 +475,7 @@ function toNumber(value) {
|
|||||||
|
|
||||||
var toNumber_1 = toNumber;
|
var toNumber_1 = toNumber;
|
||||||
|
|
||||||
|
/** Error message constants. */
|
||||||
var FUNC_ERROR_TEXT = 'Expected a function';
|
var FUNC_ERROR_TEXT = 'Expected a function';
|
||||||
|
|
||||||
/* Built-in method references for those with the same name as other `lodash` methods. */
|
/* Built-in method references for those with the same name as other `lodash` methods. */
|
||||||
@ -638,6 +662,7 @@ function debounce(func, wait, options) {
|
|||||||
|
|
||||||
var debounce_1 = debounce;
|
var debounce_1 = debounce;
|
||||||
|
|
||||||
|
/** Error message constants. */
|
||||||
var FUNC_ERROR_TEXT$1 = 'Expected a function';
|
var FUNC_ERROR_TEXT$1 = 'Expected a function';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1092,12 +1117,11 @@ class DataManager {
|
|||||||
if (this.hasColumnById('_rowIndex')) {
|
if (this.hasColumnById('_rowIndex')) {
|
||||||
// update row index
|
// update row index
|
||||||
const srNoColIndex = this.getColumnIndexById('_rowIndex');
|
const srNoColIndex = this.getColumnIndexById('_rowIndex');
|
||||||
this.rows = this.rows.map((row, index) => {
|
this.rows.forEach((row, index) => {
|
||||||
return row.map(cell => {
|
row.forEach(cell => {
|
||||||
if (cell.colIndex === srNoColIndex) {
|
if (cell.colIndex === srNoColIndex) {
|
||||||
cell.content = (index + 1) + '';
|
cell.content = (index + 1) + '';
|
||||||
}
|
}
|
||||||
return cell;
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
30
dist/frappe-datatable.js
vendored
30
dist/frappe-datatable.js
vendored
@ -220,10 +220,12 @@ var isObject_1 = isObject;
|
|||||||
|
|
||||||
var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
||||||
|
|
||||||
|
/** Detect free variable `global` from Node.js. */
|
||||||
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
||||||
|
|
||||||
var _freeGlobal = freeGlobal;
|
var _freeGlobal = freeGlobal;
|
||||||
|
|
||||||
|
/** Detect free variable `self`. */
|
||||||
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
||||||
|
|
||||||
/** Used as a reference to the global object. */
|
/** Used as a reference to the global object. */
|
||||||
@ -231,16 +233,34 @@ var root = _freeGlobal || freeSelf || Function('return this')();
|
|||||||
|
|
||||||
var _root = root;
|
var _root = root;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the timestamp of the number of milliseconds that have elapsed since
|
||||||
|
* the Unix epoch (1 January 1970 00:00:00 UTC).
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
* @memberOf _
|
||||||
|
* @since 2.4.0
|
||||||
|
* @category Date
|
||||||
|
* @returns {number} Returns the timestamp.
|
||||||
|
* @example
|
||||||
|
*
|
||||||
|
* _.defer(function(stamp) {
|
||||||
|
* console.log(_.now() - stamp);
|
||||||
|
* }, _.now());
|
||||||
|
* // => Logs the number of milliseconds it took for the deferred invocation.
|
||||||
|
*/
|
||||||
var now = function() {
|
var now = function() {
|
||||||
return _root.Date.now();
|
return _root.Date.now();
|
||||||
};
|
};
|
||||||
|
|
||||||
var now_1 = now;
|
var now_1 = now;
|
||||||
|
|
||||||
|
/** Built-in value references. */
|
||||||
var Symbol = _root.Symbol;
|
var Symbol = _root.Symbol;
|
||||||
|
|
||||||
var _Symbol = Symbol;
|
var _Symbol = Symbol;
|
||||||
|
|
||||||
|
/** Used for built-in method references. */
|
||||||
var objectProto = Object.prototype;
|
var objectProto = Object.prototype;
|
||||||
|
|
||||||
/** Used to check objects for own properties. */
|
/** Used to check objects for own properties. */
|
||||||
@ -308,6 +328,7 @@ function objectToString(value) {
|
|||||||
|
|
||||||
var _objectToString = objectToString;
|
var _objectToString = objectToString;
|
||||||
|
|
||||||
|
/** `Object#toString` result references. */
|
||||||
var nullTag = '[object Null]';
|
var nullTag = '[object Null]';
|
||||||
var undefinedTag = '[object Undefined]';
|
var undefinedTag = '[object Undefined]';
|
||||||
|
|
||||||
@ -362,6 +383,7 @@ function isObjectLike(value) {
|
|||||||
|
|
||||||
var isObjectLike_1 = isObjectLike;
|
var isObjectLike_1 = isObjectLike;
|
||||||
|
|
||||||
|
/** `Object#toString` result references. */
|
||||||
var symbolTag = '[object Symbol]';
|
var symbolTag = '[object Symbol]';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -388,6 +410,7 @@ function isSymbol(value) {
|
|||||||
|
|
||||||
var isSymbol_1 = isSymbol;
|
var isSymbol_1 = isSymbol;
|
||||||
|
|
||||||
|
/** Used as references for various `Number` constants. */
|
||||||
var NAN = 0 / 0;
|
var NAN = 0 / 0;
|
||||||
|
|
||||||
/** Used to match leading and trailing whitespace. */
|
/** Used to match leading and trailing whitespace. */
|
||||||
@ -451,6 +474,7 @@ function toNumber(value) {
|
|||||||
|
|
||||||
var toNumber_1 = toNumber;
|
var toNumber_1 = toNumber;
|
||||||
|
|
||||||
|
/** Error message constants. */
|
||||||
var FUNC_ERROR_TEXT = 'Expected a function';
|
var FUNC_ERROR_TEXT = 'Expected a function';
|
||||||
|
|
||||||
/* Built-in method references for those with the same name as other `lodash` methods. */
|
/* Built-in method references for those with the same name as other `lodash` methods. */
|
||||||
@ -637,6 +661,7 @@ function debounce(func, wait, options) {
|
|||||||
|
|
||||||
var debounce_1 = debounce;
|
var debounce_1 = debounce;
|
||||||
|
|
||||||
|
/** Error message constants. */
|
||||||
var FUNC_ERROR_TEXT$1 = 'Expected a function';
|
var FUNC_ERROR_TEXT$1 = 'Expected a function';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1091,12 +1116,11 @@ class DataManager {
|
|||||||
if (this.hasColumnById('_rowIndex')) {
|
if (this.hasColumnById('_rowIndex')) {
|
||||||
// update row index
|
// update row index
|
||||||
const srNoColIndex = this.getColumnIndexById('_rowIndex');
|
const srNoColIndex = this.getColumnIndexById('_rowIndex');
|
||||||
this.rows = this.rows.map((row, index) => {
|
this.rows.forEach((row, index) => {
|
||||||
return row.map(cell => {
|
row.forEach(cell => {
|
||||||
if (cell.colIndex === srNoColIndex) {
|
if (cell.colIndex === srNoColIndex) {
|
||||||
cell.content = (index + 1) + '';
|
cell.content = (index + 1) + '';
|
||||||
}
|
}
|
||||||
return cell;
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -220,10 +220,12 @@ var isObject_1 = isObject;
|
|||||||
|
|
||||||
var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
||||||
|
|
||||||
|
/** Detect free variable `global` from Node.js. */
|
||||||
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
||||||
|
|
||||||
var _freeGlobal = freeGlobal;
|
var _freeGlobal = freeGlobal;
|
||||||
|
|
||||||
|
/** Detect free variable `self`. */
|
||||||
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
||||||
|
|
||||||
/** Used as a reference to the global object. */
|
/** Used as a reference to the global object. */
|
||||||
@ -231,16 +233,34 @@ var root = _freeGlobal || freeSelf || Function('return this')();
|
|||||||
|
|
||||||
var _root = root;
|
var _root = root;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the timestamp of the number of milliseconds that have elapsed since
|
||||||
|
* the Unix epoch (1 January 1970 00:00:00 UTC).
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
* @memberOf _
|
||||||
|
* @since 2.4.0
|
||||||
|
* @category Date
|
||||||
|
* @returns {number} Returns the timestamp.
|
||||||
|
* @example
|
||||||
|
*
|
||||||
|
* _.defer(function(stamp) {
|
||||||
|
* console.log(_.now() - stamp);
|
||||||
|
* }, _.now());
|
||||||
|
* // => Logs the number of milliseconds it took for the deferred invocation.
|
||||||
|
*/
|
||||||
var now = function() {
|
var now = function() {
|
||||||
return _root.Date.now();
|
return _root.Date.now();
|
||||||
};
|
};
|
||||||
|
|
||||||
var now_1 = now;
|
var now_1 = now;
|
||||||
|
|
||||||
|
/** Built-in value references. */
|
||||||
var Symbol = _root.Symbol;
|
var Symbol = _root.Symbol;
|
||||||
|
|
||||||
var _Symbol = Symbol;
|
var _Symbol = Symbol;
|
||||||
|
|
||||||
|
/** Used for built-in method references. */
|
||||||
var objectProto = Object.prototype;
|
var objectProto = Object.prototype;
|
||||||
|
|
||||||
/** Used to check objects for own properties. */
|
/** Used to check objects for own properties. */
|
||||||
@ -308,6 +328,7 @@ function objectToString(value) {
|
|||||||
|
|
||||||
var _objectToString = objectToString;
|
var _objectToString = objectToString;
|
||||||
|
|
||||||
|
/** `Object#toString` result references. */
|
||||||
var nullTag = '[object Null]';
|
var nullTag = '[object Null]';
|
||||||
var undefinedTag = '[object Undefined]';
|
var undefinedTag = '[object Undefined]';
|
||||||
|
|
||||||
@ -362,6 +383,7 @@ function isObjectLike(value) {
|
|||||||
|
|
||||||
var isObjectLike_1 = isObjectLike;
|
var isObjectLike_1 = isObjectLike;
|
||||||
|
|
||||||
|
/** `Object#toString` result references. */
|
||||||
var symbolTag = '[object Symbol]';
|
var symbolTag = '[object Symbol]';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -388,6 +410,7 @@ function isSymbol(value) {
|
|||||||
|
|
||||||
var isSymbol_1 = isSymbol;
|
var isSymbol_1 = isSymbol;
|
||||||
|
|
||||||
|
/** Used as references for various `Number` constants. */
|
||||||
var NAN = 0 / 0;
|
var NAN = 0 / 0;
|
||||||
|
|
||||||
/** Used to match leading and trailing whitespace. */
|
/** Used to match leading and trailing whitespace. */
|
||||||
@ -451,6 +474,7 @@ function toNumber(value) {
|
|||||||
|
|
||||||
var toNumber_1 = toNumber;
|
var toNumber_1 = toNumber;
|
||||||
|
|
||||||
|
/** Error message constants. */
|
||||||
var FUNC_ERROR_TEXT = 'Expected a function';
|
var FUNC_ERROR_TEXT = 'Expected a function';
|
||||||
|
|
||||||
/* Built-in method references for those with the same name as other `lodash` methods. */
|
/* Built-in method references for those with the same name as other `lodash` methods. */
|
||||||
@ -637,6 +661,7 @@ function debounce(func, wait, options) {
|
|||||||
|
|
||||||
var debounce_1 = debounce;
|
var debounce_1 = debounce;
|
||||||
|
|
||||||
|
/** Error message constants. */
|
||||||
var FUNC_ERROR_TEXT$1 = 'Expected a function';
|
var FUNC_ERROR_TEXT$1 = 'Expected a function';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1091,12 +1116,11 @@ class DataManager {
|
|||||||
if (this.hasColumnById('_rowIndex')) {
|
if (this.hasColumnById('_rowIndex')) {
|
||||||
// update row index
|
// update row index
|
||||||
const srNoColIndex = this.getColumnIndexById('_rowIndex');
|
const srNoColIndex = this.getColumnIndexById('_rowIndex');
|
||||||
this.rows = this.rows.map((row, index) => {
|
this.rows.forEach((row, index) => {
|
||||||
return row.map(cell => {
|
row.forEach(cell => {
|
||||||
if (cell.colIndex === srNoColIndex) {
|
if (cell.colIndex === srNoColIndex) {
|
||||||
cell.content = (index + 1) + '';
|
cell.content = (index + 1) + '';
|
||||||
}
|
}
|
||||||
return cell;
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -270,12 +270,11 @@ export default class DataManager {
|
|||||||
if (this.hasColumnById('_rowIndex')) {
|
if (this.hasColumnById('_rowIndex')) {
|
||||||
// update row index
|
// update row index
|
||||||
const srNoColIndex = this.getColumnIndexById('_rowIndex');
|
const srNoColIndex = this.getColumnIndexById('_rowIndex');
|
||||||
this.rows = this.rows.map((row, index) => {
|
this.rows.forEach((row, index) => {
|
||||||
return row.map(cell => {
|
row.forEach(cell => {
|
||||||
if (cell.colIndex === srNoColIndex) {
|
if (cell.colIndex === srNoColIndex) {
|
||||||
cell.content = (index + 1) + '';
|
cell.content = (index + 1) + '';
|
||||||
}
|
}
|
||||||
return cell;
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user