datatables.net 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/js/dataTables.js +37 -21
- package/js/dataTables.min.js +2 -2
- package/js/dataTables.min.mjs +2 -2
- package/js/dataTables.mjs +37 -21
- package/package.json +1 -1
- package/types/types.d.ts +43 -41
package/js/dataTables.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! DataTables
|
|
1
|
+
/*! DataTables 3.0.1
|
|
2
2
|
* Copyright (c) SpryMedia Ltd - datatables.net/license
|
|
3
3
|
*/
|
|
4
4
|
|
|
@@ -152,7 +152,7 @@ let _stripHtml = function (input, replacement = '') {
|
|
|
152
152
|
* This function is replaceable if the user wishes to use a different library
|
|
153
153
|
* for escaping HTML entities in a string.
|
|
154
154
|
*
|
|
155
|
-
* @param
|
|
155
|
+
* @param val Value to escape HTML in
|
|
156
156
|
* @returns Escaped value
|
|
157
157
|
*/
|
|
158
158
|
let _escapeHtml = function (val) {
|
|
@@ -551,7 +551,10 @@ function ajax(optionsIn) {
|
|
|
551
551
|
options.contentType = 'application/json; charset=utf-8';
|
|
552
552
|
}
|
|
553
553
|
}
|
|
554
|
-
xhr.open(method, options.url +
|
|
554
|
+
xhr.open(method, options.url +
|
|
555
|
+
(urlParams
|
|
556
|
+
? (options.url.includes('?') ? '&' : '?') + urlParams
|
|
557
|
+
: ''), true, options.username || null, options.password || null);
|
|
555
558
|
// Content type for FormData requests gets set by the browser.
|
|
556
559
|
if (options.contentType && !(options.data instanceof FormData)) {
|
|
557
560
|
xhr.setRequestHeader('Content-Type', options.contentType);
|
|
@@ -641,7 +644,9 @@ ajax.serialize = serialize;
|
|
|
641
644
|
* Run callback functions (allowing for none, one or array)
|
|
642
645
|
*
|
|
643
646
|
* @param fnIn Function(s) to run
|
|
644
|
-
* @param
|
|
647
|
+
* @param arg1 Parameters to pass to the function(s)
|
|
648
|
+
* @param arg2 Parameters to pass to the function(s)
|
|
649
|
+
* @param arg3 Parameters to pass to the function(s)
|
|
645
650
|
*/
|
|
646
651
|
function callback(fnIn, arg1, arg2, arg3) {
|
|
647
652
|
if (!fnIn) {
|
|
@@ -861,6 +866,7 @@ function pluck(a, prop, prop2) {
|
|
|
861
866
|
* as the indexes to pick from the source array
|
|
862
867
|
*
|
|
863
868
|
* @param a Array to get values from
|
|
869
|
+
* @param order Indexes to pick
|
|
864
870
|
* @param prop Property to read values from
|
|
865
871
|
* @param prop2 Inner property to get values from if a 2D array
|
|
866
872
|
* @returns Array of read values
|
|
@@ -1919,7 +1925,7 @@ class Dom {
|
|
|
1919
1925
|
/**
|
|
1920
1926
|
* Add an element (or multiple) to the instance. Will ensure uniqueness.
|
|
1921
1927
|
*
|
|
1922
|
-
* @param
|
|
1928
|
+
* @param selector Element(s) to add
|
|
1923
1929
|
* @param sort Indicate if the element should be added in document order.
|
|
1924
1930
|
* @returns Self for chaining
|
|
1925
1931
|
*/
|
|
@@ -2320,7 +2326,7 @@ class Dom {
|
|
|
2320
2326
|
/**
|
|
2321
2327
|
* Get all matching descendants
|
|
2322
2328
|
*
|
|
2323
|
-
* @param
|
|
2329
|
+
* @param input Elements to find
|
|
2324
2330
|
* @returns A new Dom instance with all matching elements
|
|
2325
2331
|
*/
|
|
2326
2332
|
find(input) {
|
|
@@ -3049,6 +3055,7 @@ const legacy = [];
|
|
|
3049
3055
|
* @param name The name of the new feature.
|
|
3050
3056
|
* @param cb A function that will create the elements and event listeners for
|
|
3051
3057
|
* the feature being added.
|
|
3058
|
+
* @param legacyChar
|
|
3052
3059
|
*/
|
|
3053
3060
|
function register$2(name, cb, legacyChar = '') {
|
|
3054
3061
|
features[name] = cb;
|
|
@@ -3913,7 +3920,7 @@ const ext = {
|
|
|
3913
3920
|
* Software version
|
|
3914
3921
|
* @type string
|
|
3915
3922
|
*/
|
|
3916
|
-
version: '3.0.
|
|
3923
|
+
version: '3.0.1'
|
|
3917
3924
|
};
|
|
3918
3925
|
//
|
|
3919
3926
|
// Backwards compatibility. Alias to pre 1.10 Hungarian notation counter parts
|
|
@@ -4818,7 +4825,7 @@ function create$1(parts = {}) {
|
|
|
4818
4825
|
* DOM source.
|
|
4819
4826
|
*
|
|
4820
4827
|
* @param settings DataTables settings object
|
|
4821
|
-
* @param
|
|
4828
|
+
* @param dataIn data array to be added
|
|
4822
4829
|
* @param tr TR element to add to the table - optional. If not given, DataTables
|
|
4823
4830
|
* will create a row automatically
|
|
4824
4831
|
* @param tds Array of TD|TH elements for the row - must be given if tr is.
|
|
@@ -4857,7 +4864,7 @@ function addData(settings, dataIn, tr, tds) {
|
|
|
4857
4864
|
* it is not cloned).
|
|
4858
4865
|
*
|
|
4859
4866
|
* @param settings DataTables settings object
|
|
4860
|
-
* @param
|
|
4867
|
+
* @param rows The TR element(s) to add to the table
|
|
4861
4868
|
* @returns Array of indexes for the added rows
|
|
4862
4869
|
*/
|
|
4863
4870
|
function addTr(settings, rows) {
|
|
@@ -5439,7 +5446,7 @@ function getWideStrings(settings, colIdx) {
|
|
|
5439
5446
|
/**
|
|
5440
5447
|
* Append a CSS unit (only if required) to a string
|
|
5441
5448
|
*
|
|
5442
|
-
* @param
|
|
5449
|
+
* @param s Value to css-ify
|
|
5443
5450
|
* @returns Value with css unit
|
|
5444
5451
|
*/
|
|
5445
5452
|
function stringToCss(s) {
|
|
@@ -6373,7 +6380,7 @@ function renderer(ctx, type) {
|
|
|
6373
6380
|
/**
|
|
6374
6381
|
* Add the options to the page HTML for the table
|
|
6375
6382
|
*
|
|
6376
|
-
* @param
|
|
6383
|
+
* @param ctx DataTables context
|
|
6377
6384
|
*/
|
|
6378
6385
|
function createLayout(ctx) {
|
|
6379
6386
|
var classes = ctx.classes;
|
|
@@ -6750,6 +6757,7 @@ function sortAttachListener(settings, node, selector, column, callback) {
|
|
|
6750
6757
|
* Sort the display array to match the master's order
|
|
6751
6758
|
*
|
|
6752
6759
|
* @param settings DataTables context
|
|
6760
|
+
* @param display The display array
|
|
6753
6761
|
*/
|
|
6754
6762
|
function sortDisplay(settings, display) {
|
|
6755
6763
|
if (display.length < 2) {
|
|
@@ -6977,7 +6985,6 @@ function sort(ctx, col, dir) {
|
|
|
6977
6985
|
* Function to run on user sort request
|
|
6978
6986
|
*
|
|
6979
6987
|
* @param settings dataTables settings object
|
|
6980
|
-
* @param attachTo node to attach the handler to
|
|
6981
6988
|
* @param colIdx column sorting index
|
|
6982
6989
|
* @param addIndex Counter
|
|
6983
6990
|
* @param shift Shift click add
|
|
@@ -7794,7 +7801,6 @@ const __filter_div_textContent = __filter_div.textContent !== undefined;
|
|
|
7794
7801
|
* Filter the table using both the global filter and column based filtering
|
|
7795
7802
|
*
|
|
7796
7803
|
* @param settings DataTables settings object
|
|
7797
|
-
* @param input search information
|
|
7798
7804
|
*/
|
|
7799
7805
|
function filterComplete(settings) {
|
|
7800
7806
|
settings.columns;
|
|
@@ -7858,7 +7864,6 @@ function filterCustom(settings) {
|
|
|
7858
7864
|
* @param settings
|
|
7859
7865
|
* @param input
|
|
7860
7866
|
* @param options
|
|
7861
|
-
* @param column
|
|
7862
7867
|
* @returns
|
|
7863
7868
|
*/
|
|
7864
7869
|
function filter(searchRows, settings, input, options) {
|
|
@@ -9211,7 +9216,7 @@ function getPrototypeNames(name) {
|
|
|
9211
9216
|
* Each of the input parameter types will be converted to a DataTables settings
|
|
9212
9217
|
* object where possible.
|
|
9213
9218
|
*
|
|
9214
|
-
* @param
|
|
9219
|
+
* @param mixedIn DataTable identifier. Can be one of:
|
|
9215
9220
|
* * `string` - jQuery selector. Any DataTables' matching the given selector
|
|
9216
9221
|
* with be found and used.
|
|
9217
9222
|
* * `node` - `TABLE` node which has already been formed into a DataTable.
|
|
@@ -9500,7 +9505,7 @@ const __reload = function (settings, holdPosition, callback) {
|
|
|
9500
9505
|
processingDisplay(settings, true);
|
|
9501
9506
|
// Cancel an existing request
|
|
9502
9507
|
var xhr = settings.jqXHR;
|
|
9503
|
-
if (xhr && xhr.readyState !== 4) {
|
|
9508
|
+
if (xhr && xhr.readyState !== 4 && typeof xhr.abort === 'function') {
|
|
9504
9509
|
xhr.abort();
|
|
9505
9510
|
}
|
|
9506
9511
|
// Trigger xhr
|
|
@@ -10277,7 +10282,7 @@ registerPlural('columns().orderable()', 'column().orderable()', function (direct
|
|
|
10277
10282
|
/**
|
|
10278
10283
|
* Set the page length
|
|
10279
10284
|
*
|
|
10280
|
-
* @param
|
|
10285
|
+
* @param ctx DataTables context
|
|
10281
10286
|
* @param val Value to change to
|
|
10282
10287
|
*/
|
|
10283
10288
|
function lengthChange(ctx, val) {
|
|
@@ -11211,7 +11216,14 @@ function check(releaseDate, software) {
|
|
|
11211
11216
|
return true;
|
|
11212
11217
|
}
|
|
11213
11218
|
}
|
|
11214
|
-
else if (
|
|
11219
|
+
else if (software === null) {
|
|
11220
|
+
// Validating the key only - there hasn't been any specific software
|
|
11221
|
+
// calling the `plus` parameter yet. The key is good, so carry on.
|
|
11222
|
+
return true;
|
|
11223
|
+
}
|
|
11224
|
+
else if (
|
|
11225
|
+
// Checking if the build version can be used with this key
|
|
11226
|
+
_licenseInfo.type === 'plus' ||
|
|
11215
11227
|
(_licenseInfo.type === 'editor' && software === 'editor')) {
|
|
11216
11228
|
if (!expires || new Date(releaseDate) > expires) {
|
|
11217
11229
|
noticePrep('Upgrade required for this version');
|
|
@@ -11221,6 +11233,7 @@ function check(releaseDate, software) {
|
|
|
11221
11233
|
return true;
|
|
11222
11234
|
}
|
|
11223
11235
|
else if (_licenseInfo.type === 'editor' && software !== 'editor') {
|
|
11236
|
+
// Editor specific license
|
|
11224
11237
|
noticePrep('License for Editor only. Upgrade for Plus');
|
|
11225
11238
|
noticeDisplay();
|
|
11226
11239
|
return false;
|
|
@@ -11379,7 +11392,7 @@ function verify(licenseString) {
|
|
|
11379
11392
|
*/
|
|
11380
11393
|
function plus (DataTable) {
|
|
11381
11394
|
Object.defineProperty(DataTable, 'plus', {
|
|
11382
|
-
value: function (releaseDate, software =
|
|
11395
|
+
value: function (releaseDate, software = '') {
|
|
11383
11396
|
// Unsecure sites are only useful for development, so allow there
|
|
11384
11397
|
// and on the site.
|
|
11385
11398
|
let host = window.location.hostname;
|
|
@@ -11530,6 +11543,8 @@ register$2('info', function (settings, optsIn) {
|
|
|
11530
11543
|
/**
|
|
11531
11544
|
* Update the information elements in the display
|
|
11532
11545
|
* @param settings DataTables settings object
|
|
11546
|
+
* @param opts
|
|
11547
|
+
* @param node
|
|
11533
11548
|
*/
|
|
11534
11549
|
function updateInfo(settings, opts, node) {
|
|
11535
11550
|
var start = settings.displayStart + 1, end = displayEnd(settings), max = recordsTotal(settings), total = recordsDisplay(settings), out = total ? opts.text : opts.empty;
|
|
@@ -11602,7 +11617,7 @@ function _pagingDraw(settings, host, opts) {
|
|
|
11602
11617
|
if (!settings.initDone) {
|
|
11603
11618
|
return;
|
|
11604
11619
|
}
|
|
11605
|
-
let plugin = opts.type ? ext.pager[opts.type] : _pagingDynamic, aria = settings.language.aria.paginate || {}, start = settings.displayStart, len = settings.pageLength, visRecords = recordsDisplay(settings), all = len === -1, page = all ? 0 : Math.ceil(start / len), pages =
|
|
11620
|
+
let plugin = opts.type ? ext.pager[opts.type] : _pagingDynamic, aria = settings.language.aria.paginate || {}, start = settings.displayStart, len = settings.pageLength, visRecords = recordsDisplay(settings), all = len === -1, page = all ? 0 : Math.ceil(start / len), pages = all ? (visRecords ? 1 : 0) : Math.ceil(visRecords / len), buttons = [], buttonEls = [], buttonsNested = plugin(opts).map(function (val) {
|
|
11606
11621
|
return val === 'numbers'
|
|
11607
11622
|
? pagingNumbers(page, pages, opts.buttons, opts.boundaryNumbers)
|
|
11608
11623
|
: val;
|
|
@@ -12271,7 +12286,8 @@ const defaults = {
|
|
|
12271
12286
|
},
|
|
12272
12287
|
stateSaveParams: null,
|
|
12273
12288
|
tabIndex: 0,
|
|
12274
|
-
titleRow: null
|
|
12289
|
+
titleRow: null,
|
|
12290
|
+
typeDetect: true
|
|
12275
12291
|
};
|
|
12276
12292
|
|
|
12277
12293
|
const DataTable = function (selector, options) {
|