Bump DataTables from 2.2.1 to 2.2.2

This commit is contained in:
johnnyq
2025-03-14 13:35:48 -04:00
parent 8fb8ce319e
commit bf327afd19
4 changed files with 59 additions and 28 deletions

View File

@@ -4,13 +4,12 @@
* *
* To rebuild or modify this file with the latest versions of the included * To rebuild or modify this file with the latest versions of the included
* software please visit: * software please visit:
* https://datatables.net/download/#bs4/dt-2.2.1 * https://datatables.net/download/#bs4/dt-2.2.2
* *
* Included libraries: * Included libraries:
* DataTables 2.2.1 * DataTables 2.2.2
*/ */
@charset "UTF-8";
:root { :root {
--dt-row-selected: 2, 117, 216; --dt-row-selected: 2, 117, 216;
--dt-row-selected-text: 255, 255, 255; --dt-row-selected-text: 255, 255, 255;
@@ -93,8 +92,8 @@ table.dataTable thead > tr > td.dt-ordering-asc span.dt-column-order:before {
position: absolute; position: absolute;
display: block; display: block;
bottom: 50%; bottom: 50%;
content: ""; content: "\25B2";
content: ""/""; content: "\25B2"/"";
} }
table.dataTable thead > tr > th.dt-orderable-desc span.dt-column-order:after, table.dataTable thead > tr > th.dt-ordering-desc span.dt-column-order:after, table.dataTable thead > tr > th.dt-orderable-desc span.dt-column-order:after, table.dataTable thead > tr > th.dt-ordering-desc span.dt-column-order:after,
table.dataTable thead > tr > td.dt-orderable-desc span.dt-column-order:after, table.dataTable thead > tr > td.dt-orderable-desc span.dt-column-order:after,
@@ -102,8 +101,8 @@ table.dataTable thead > tr > td.dt-ordering-desc span.dt-column-order:after {
position: absolute; position: absolute;
display: block; display: block;
top: 50%; top: 50%;
content: ""; content: "\25BC";
content: ""/""; content: "\25BC"/"";
} }
table.dataTable thead > tr > th.dt-orderable-asc, table.dataTable thead > tr > th.dt-orderable-desc, table.dataTable thead > tr > th.dt-ordering-asc, table.dataTable thead > tr > th.dt-ordering-desc, table.dataTable thead > tr > th.dt-orderable-asc, table.dataTable thead > tr > th.dt-orderable-desc, table.dataTable thead > tr > th.dt-ordering-asc, table.dataTable thead > tr > th.dt-ordering-desc,
table.dataTable thead > tr > td.dt-orderable-asc, table.dataTable thead > tr > td.dt-orderable-asc,

View File

@@ -4,13 +4,13 @@
* *
* To rebuild or modify this file with the latest versions of the included * To rebuild or modify this file with the latest versions of the included
* software please visit: * software please visit:
* https://datatables.net/download/#bs4/dt-2.2.1 * https://datatables.net/download/#bs4/dt-2.2.2
* *
* Included libraries: * Included libraries:
* DataTables 2.2.1 * DataTables 2.2.2
*/ */
/*! DataTables 2.2.1 /*! DataTables 2.2.2
* © SpryMedia Ltd - datatables.net/license * © SpryMedia Ltd - datatables.net/license
*/ */
@@ -519,7 +519,7 @@
* *
* @type string * @type string
*/ */
builder: "bs4/dt-2.2.1", builder: "bs4/dt-2.2.2",
/** /**
@@ -5556,6 +5556,15 @@
// This flag allows the above to be satisfied. // This flag allows the above to be satisfied.
var first = $(settings.nTableWrapper).is(':visible'); var first = $(settings.nTableWrapper).is(':visible');
// Use an empty div to attach the observer so it isn't impacted by height changes
var resizer = $('<div>')
.css({
width: '100%',
height: 0
})
.addClass('dt-autosize')
.appendTo(settings.nTableWrapper);
settings.resizeObserver = new ResizeObserver(function (e) { settings.resizeObserver = new ResizeObserver(function (e) {
if (first) { if (first) {
first = false; first = false;
@@ -5565,7 +5574,7 @@
} }
}); });
settings.resizeObserver.observe(settings.nTableWrapper); settings.resizeObserver.observe(resizer[0]);
} }
else { else {
// For old browsers, the best we can do is listen for a window resize // For old browsers, the best we can do is listen for a window resize
@@ -5897,10 +5906,14 @@
displayMaster = oSettings.aiDisplayMaster, displayMaster = oSettings.aiDisplayMaster,
aSort; aSort;
// Make sure the columns all have types defined
_fnColumnTypes(oSettings);
// Allow a specific column to be sorted, which will _not_ alter the display // Allow a specific column to be sorted, which will _not_ alter the display
// master // master
if (col !== undefined) { if (col !== undefined) {
var srcCol = oSettings.aoColumns[col]; var srcCol = oSettings.aoColumns[col];
aSort = [{ aSort = [{
src: col, src: col,
col: col, col: col,
@@ -9844,12 +9857,14 @@
// Function to run either once the table becomes ready or // Function to run either once the table becomes ready or
// immediately if it is already ready. // immediately if it is already ready.
return this.tables().every(function () { return this.tables().every(function () {
var api = this;
if (this.context[0]._bInitComplete) { if (this.context[0]._bInitComplete) {
fn.call(this); fn.call(api);
} }
else { else {
this.on('init.dt.DT', function () { this.on('init.dt.DT', function () {
fn.call(this); fn.call(api);
}); });
} }
} ); } );
@@ -9905,20 +9920,37 @@
jqTable.append( tfoot ); jqTable.append( tfoot );
} }
// Clean up the header
$(thead).find('span.dt-column-order').remove();
$(thead).find('span.dt-column-title').each(function () {
var title = $(this).html();
$(this).parent().append(title);
$(this).remove();
});
settings.colgroup.remove(); settings.colgroup.remove();
settings.aaSorting = []; settings.aaSorting = [];
settings.aaSortingFixed = []; settings.aaSortingFixed = [];
_fnSortingClasses( settings ); _fnSortingClasses( settings );
$(jqTable).find('th, td').removeClass(
$.map(DataTable.ext.type.className, function (v) {
return v;
}).join(' ')
);
$('th, td', thead) $('th, td', thead)
.removeClass( .removeClass(
orderClasses.none + ' ' +
orderClasses.canAsc + ' ' + orderClasses.canAsc + ' ' +
orderClasses.canDesc + ' ' + orderClasses.canDesc + ' ' +
orderClasses.isAsc + ' ' + orderClasses.isAsc + ' ' +
orderClasses.isDesc orderClasses.isDesc
) )
.css('width', ''); .css('width', '')
.removeAttr('data-dt-column')
.removeAttr('aria-sort');
// Add the TR elements back into the table in their original order // Add the TR elements back into the table in their original order
jqTbody.children().detach(); jqTbody.children().detach();
@@ -10006,7 +10038,7 @@
* @type string * @type string
* @default Version number * @default Version number
*/ */
DataTable.version = "2.2.1"; DataTable.version = "2.2.2";
/** /**
* Private data store, containing all of the settings objects that are * Private data store, containing all of the settings objects that are
@@ -13047,16 +13079,16 @@
cell.removeAttr('aria-sort'); cell.removeAttr('aria-sort');
} }
cell.attr('aria-label', orderable
? col.ariaTitle + ctx.api.i18n('oAria.orderable' + ariaType)
: col.ariaTitle
);
// Make the headers tab-able for keyboard navigation // Make the headers tab-able for keyboard navigation
if (orderable) { if (orderable) {
var orderSpan = cell.find('.dt-column-order'); var orderSpan = cell.find('.dt-column-order');
orderSpan.attr('role', 'button'); orderSpan
.attr('role', 'button')
.attr('aria-label', orderable
? col.ariaTitle + ctx.api.i18n('oAria.orderable' + ariaType)
: col.ariaTitle
);
if (tabIndex !== -1) { if (tabIndex !== -1) {
orderSpan.attr('tabindex', tabIndex); orderSpan.attr('tabindex', tabIndex);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long