datatables.net 2.0.4 → 2.0.6
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 +48 -23
- package/js/dataTables.min.js +2 -2
- package/js/dataTables.min.mjs +2 -2
- package/js/dataTables.mjs +47 -22
- package/package.json +1 -1
- package/types/types.d.ts +11 -2
package/js/dataTables.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! DataTables 2.0.
|
|
1
|
+
/*! DataTables 2.0.6
|
|
2
2
|
* © SpryMedia Ltd - datatables.net/license
|
|
3
3
|
*/
|
|
4
4
|
|
|
@@ -2592,9 +2592,15 @@ function _fnGetCellData( settings, rowIdx, colIdx, type )
|
|
|
2592
2592
|
type = 'sort';
|
|
2593
2593
|
}
|
|
2594
2594
|
|
|
2595
|
+
var row = settings.aoData[rowIdx];
|
|
2596
|
+
|
|
2597
|
+
if (! row) {
|
|
2598
|
+
return undefined;
|
|
2599
|
+
}
|
|
2600
|
+
|
|
2595
2601
|
var draw = settings.iDraw;
|
|
2596
2602
|
var col = settings.aoColumns[colIdx];
|
|
2597
|
-
var rowData =
|
|
2603
|
+
var rowData = row._aData;
|
|
2598
2604
|
var defaultContent = col.sDefaultContent;
|
|
2599
2605
|
var cellData = col.fnGetData( rowData, type, {
|
|
2600
2606
|
settings: settings,
|
|
@@ -4363,6 +4369,7 @@ function _fnFilter( searchRows, settings, input, options, column )
|
|
|
4363
4369
|
}
|
|
4364
4370
|
|
|
4365
4371
|
var i = 0;
|
|
4372
|
+
var matched = [];
|
|
4366
4373
|
|
|
4367
4374
|
// Search term can be a function, regex or string - if a string we apply our
|
|
4368
4375
|
// smart filtering regex (assuming the options require that)
|
|
@@ -4374,18 +4381,22 @@ function _fnFilter( searchRows, settings, input, options, column )
|
|
|
4374
4381
|
: _fnFilterCreateSearch( input, options );
|
|
4375
4382
|
|
|
4376
4383
|
// Then for each row, does the test pass. If not, lop the row from the array
|
|
4377
|
-
|
|
4384
|
+
for (i=0 ; i<searchRows.length ; i++) {
|
|
4378
4385
|
var row = settings.aoData[ searchRows[i] ];
|
|
4379
4386
|
var data = column === undefined
|
|
4380
4387
|
? row._sFilterRow
|
|
4381
4388
|
: row._aFilterData[ column ];
|
|
4382
4389
|
|
|
4383
|
-
if ( (searchFunc &&
|
|
4384
|
-
|
|
4385
|
-
i--;
|
|
4390
|
+
if ( (searchFunc && searchFunc(data, row._aData, searchRows[i], column)) || (rpSearch && rpSearch.test(data)) ) {
|
|
4391
|
+
matched.push(searchRows[i]);
|
|
4386
4392
|
}
|
|
4393
|
+
}
|
|
4387
4394
|
|
|
4388
|
-
|
|
4395
|
+
// Mutate the searchRows array
|
|
4396
|
+
searchRows.length = matched.length;
|
|
4397
|
+
|
|
4398
|
+
for (i=0 ; i<matched.length ; i++) {
|
|
4399
|
+
searchRows[i] = matched[i];
|
|
4389
4400
|
}
|
|
4390
4401
|
}
|
|
4391
4402
|
|
|
@@ -4753,6 +4764,7 @@ function _fnPageChange ( settings, action, redraw )
|
|
|
4753
4764
|
function _processingHtml ( settings )
|
|
4754
4765
|
{
|
|
4755
4766
|
var table = settings.nTable;
|
|
4767
|
+
var scrolling = settings.oScroll.sX !== '' || settings.oScroll.sY !== '';
|
|
4756
4768
|
|
|
4757
4769
|
if ( settings.oFeatures.bProcessing ) {
|
|
4758
4770
|
var n = $('<div/>', {
|
|
@@ -4761,9 +4773,16 @@ function _processingHtml ( settings )
|
|
|
4761
4773
|
'role': 'status'
|
|
4762
4774
|
} )
|
|
4763
4775
|
.html( settings.oLanguage.sProcessing )
|
|
4764
|
-
.append('<div><div></div><div></div><div></div><div></div></div>')
|
|
4765
|
-
|
|
4766
|
-
|
|
4776
|
+
.append('<div><div></div><div></div><div></div><div></div></div>');
|
|
4777
|
+
|
|
4778
|
+
// Different positioning depending on if scrolling is enabled or not
|
|
4779
|
+
if (scrolling) {
|
|
4780
|
+
n.prependTo( 'div.dt-scroll', settings.nTableWrapper );
|
|
4781
|
+
}
|
|
4782
|
+
else {
|
|
4783
|
+
n.insertBefore( table );
|
|
4784
|
+
}
|
|
4785
|
+
|
|
4767
4786
|
$(table).on( 'processing.dt.DT', function (e, s, show) {
|
|
4768
4787
|
n.css( 'display', show ? 'block' : 'none' );
|
|
4769
4788
|
} );
|
|
@@ -5007,7 +5026,7 @@ function _fnScrollDraw ( settings )
|
|
|
5007
5026
|
// of the indexes out.
|
|
5008
5027
|
if (settings.aiDisplay.length) {
|
|
5009
5028
|
// Get the column sizes from the first row in the table
|
|
5010
|
-
var colSizes = table.
|
|
5029
|
+
var colSizes = table.children('tbody > tr').eq(0).children('th, td').map(function (vis) {
|
|
5011
5030
|
return {
|
|
5012
5031
|
idx: _fnVisibleToColumnIndex(settings, vis),
|
|
5013
5032
|
width: $(this).outerWidth()
|
|
@@ -5451,6 +5470,10 @@ function _fnSortAttachListener(settings, node, selector, column, callback) {
|
|
|
5451
5470
|
* @param {*} settings
|
|
5452
5471
|
*/
|
|
5453
5472
|
function _fnSortDisplay(settings, display) {
|
|
5473
|
+
if (display.length < 2) {
|
|
5474
|
+
return;
|
|
5475
|
+
}
|
|
5476
|
+
|
|
5454
5477
|
var master = settings.aiDisplayMaster;
|
|
5455
5478
|
var masterMap = {};
|
|
5456
5479
|
var map = {};
|
|
@@ -7753,11 +7776,6 @@ _api_registerPlural( 'rows().remove()', 'row().remove()', function () {
|
|
|
7753
7776
|
settings.aiDisplayMaster.splice(idx, 1);
|
|
7754
7777
|
}
|
|
7755
7778
|
|
|
7756
|
-
idx = settings.aiDisplay.indexOf(row);
|
|
7757
|
-
if (idx !== -1) {
|
|
7758
|
-
settings.aiDisplay.splice(idx, 1);
|
|
7759
|
-
}
|
|
7760
|
-
|
|
7761
7779
|
// For server-side processing tables - subtract the deleted row from the count
|
|
7762
7780
|
if ( settings._iRecordsDisplay > 0 ) {
|
|
7763
7781
|
settings._iRecordsDisplay--;
|
|
@@ -7847,9 +7865,15 @@ _api_register( 'row().data()', function ( data ) {
|
|
|
7847
7865
|
_api_register( 'row().node()', function () {
|
|
7848
7866
|
var ctx = this.context;
|
|
7849
7867
|
|
|
7850
|
-
|
|
7851
|
-
ctx[0].aoData[ this[0] ]
|
|
7852
|
-
|
|
7868
|
+
if (ctx.length && this.length && this[0].length) {
|
|
7869
|
+
var row = ctx[0].aoData[ this[0] ];
|
|
7870
|
+
|
|
7871
|
+
if (row && row.nTr) {
|
|
7872
|
+
return row.nTr;
|
|
7873
|
+
}
|
|
7874
|
+
}
|
|
7875
|
+
|
|
7876
|
+
return null;
|
|
7853
7877
|
} );
|
|
7854
7878
|
|
|
7855
7879
|
|
|
@@ -7908,8 +7932,9 @@ var __details_state_load = function (api, state)
|
|
|
7908
7932
|
if ( state && state.childRows ) {
|
|
7909
7933
|
api
|
|
7910
7934
|
.rows( state.childRows.map(function (id) {
|
|
7911
|
-
// Escape any `:` characters from the row id
|
|
7912
|
-
|
|
7935
|
+
// Escape any `:` characters from the row id. Accounts for
|
|
7936
|
+
// already escaped characters.
|
|
7937
|
+
return id.replace(/([^:\\]*(?:\\.[^:\\]*)*):/g, "$1\\:");
|
|
7913
7938
|
}) )
|
|
7914
7939
|
.every( function () {
|
|
7915
7940
|
_fnCallbackFire( api.settings()[0], null, 'requestChild', [ this ] )
|
|
@@ -9533,7 +9558,7 @@ _api_register( 'i18n()', function ( token, def, plural ) {
|
|
|
9533
9558
|
* @type string
|
|
9534
9559
|
* @default Version number
|
|
9535
9560
|
*/
|
|
9536
|
-
DataTable.version = "2.0.
|
|
9561
|
+
DataTable.version = "2.0.6";
|
|
9537
9562
|
|
|
9538
9563
|
/**
|
|
9539
9564
|
* Private data store, containing all of the settings objects that are
|
package/package.json
CHANGED
package/types/types.d.ts
CHANGED
|
@@ -157,11 +157,20 @@ export interface Feature {
|
|
|
157
157
|
|
|
158
158
|
/** Pagination buttons */
|
|
159
159
|
paging?: {
|
|
160
|
+
/** Set the maximum number of paging number buttons */
|
|
161
|
+
buttons?: number;
|
|
162
|
+
|
|
160
163
|
/** Paging button display options */
|
|
161
164
|
type?: 'numbers' | 'simple' | 'simple_numbers' | 'full' | 'full_numbers' | 'first_last_numbers';
|
|
162
165
|
|
|
163
|
-
/**
|
|
166
|
+
/**
|
|
167
|
+
* Set the maximum number of paging number buttons
|
|
168
|
+
* @deprecated Use `buttons` instead.
|
|
169
|
+
*/
|
|
164
170
|
numbers?: number;
|
|
171
|
+
|
|
172
|
+
/** Include the extreme page numbers, if separated by ellipsis, or not */
|
|
173
|
+
boundaryNumbers?: boolean;
|
|
165
174
|
}
|
|
166
175
|
|
|
167
176
|
/** Global search input */
|
|
@@ -182,7 +191,7 @@ type LayoutEdge = 'Start' | 'End';
|
|
|
182
191
|
|
|
183
192
|
type LayoutKeys = `${LayoutSide}${LayoutNumber}${LayoutEdge}` | `${LayoutSide}${LayoutNumber}`;
|
|
184
193
|
|
|
185
|
-
type Layout = Partial<Record<LayoutKeys, keyof Feature | Feature | Array<keyof Feature> | Feature[]>>;
|
|
194
|
+
type Layout = Partial<Record<LayoutKeys, keyof Feature | Feature | Array<keyof Feature> | Feature[] | null>>;
|
|
186
195
|
|
|
187
196
|
|
|
188
197
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|