@ -4,24 +4,23 @@
*
*
* 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/#bs5/dt-1.1 1.5
* https : //datatables.net/download/#bs5/dt-1.1 2.1
*
*
* Included libraries :
* Included libraries :
* DataTables 1.1 1. 5
* DataTables 1.1 2. 1
* /
* /
/ * ! D a t a T a b l e s 1 . 1 1. 5
/ * ! D a t a T a b l e s 1 . 1 2. 1
* © 2008 - 202 1 SpryMedia Ltd - datatables . net / license
* © 2008 - 202 2 SpryMedia Ltd - datatables . net / license
* /
* /
/ * *
/ * *
* @ summary DataTables
* @ summary DataTables
* @ description Paginate , search and order HTML tables
* @ description Paginate , search and order HTML tables
* @ version 1.11 . 5
* @ version 1.12 . 1
* @ file jquery . dataTables . js
* @ author SpryMedia Ltd
* @ author SpryMedia Ltd
* @ contact www . datatables . net
* @ contact www . datatables . net
* @ copyright Copyright 2008 - 2021 SpryMedia Ltd .
* @ copyright SpryMedia Ltd .
*
*
* This source file is free software , available under the following license :
* This source file is free software , available under the following license :
* MIT license - http : //datatables.net/license
* MIT license - http : //datatables.net/license
@ -1077,7 +1076,7 @@
success : function ( json ) {
success : function ( json ) {
_fnCamelToHungarian ( defaults . oLanguage , json ) ;
_fnCamelToHungarian ( defaults . oLanguage , json ) ;
_fnLanguageCompat ( json ) ;
_fnLanguageCompat ( json ) ;
$ . extend ( true , oLanguage , json ) ;
$ . extend ( true , oLanguage , json , oSettings . oInit . oLanguage ) ;
_fnCallbackFire ( oSettings , null , 'i18n' , [ oSettings ] ) ;
_fnCallbackFire ( oSettings , null , 'i18n' , [ oSettings ] ) ;
_fnInitialise ( oSettings ) ;
_fnInitialise ( oSettings ) ;
@ -2310,9 +2309,17 @@
th . addClass ( oOptions . sClass ) ;
th . addClass ( oOptions . sClass ) ;
}
}
var origClass = oCol . sClass ;
$ . extend ( oCol , oOptions ) ;
$ . extend ( oCol , oOptions ) ;
_fnMap ( oCol , oOptions , "sWidth" , "sWidthOrig" ) ;
_fnMap ( oCol , oOptions , "sWidth" , "sWidthOrig" ) ;
// Merge class from previously defined classes with this one, rather than just
// overwriting it in the extend above
if ( origClass !== oCol . sClass ) {
oCol . sClass = origClass + ' ' + oCol . sClass ;
}
/ * i D a t a S o r t t o b e a p p l i e d ( b a c k w a r d s c o m p a t i b i l i t y ) , b u t a D a t a S o r t w i l l t a k e
/ * i D a t a S o r t t o b e a p p l i e d ( b a c k w a r d s c o m p a t i b i l i t y ) , b u t a D a t a S o r t w i l l t a k e
* priority if defined
* priority if defined
* /
* /
@ -2585,9 +2592,11 @@
def = aoColDefs [ i ] ;
def = aoColDefs [ i ] ;
/* Each definition can target multiple columns, as it is an array */
/* Each definition can target multiple columns, as it is an array */
var aTargets = def . targets !== undefined ?
var aTargets = def . target !== undefined
def . targets :
? def . target
def . aTargets ;
: def . targets !== undefined
? def . targets
: def . aTargets ;
if ( ! Array . isArray ( aTargets ) )
if ( ! Array . isArray ( aTargets ) )
{
{
@ -5089,6 +5098,7 @@
'class' : settings . oClasses . sProcessing
'class' : settings . oClasses . sProcessing
} )
} )
. html ( settings . oLanguage . sProcessing )
. html ( settings . oLanguage . sProcessing )
. append ( '<div><div></div><div></div><div></div><div></div></div>' )
. insertBefore ( settings . nTable ) [ 0 ] ;
. insertBefore ( settings . nTable ) [ 0 ] ;
}
}
@ -5338,6 +5348,7 @@
footerCopy = footer . clone ( ) . prependTo ( table ) ;
footerCopy = footer . clone ( ) . prependTo ( table ) ;
footerTrgEls = footer . find ( 'tr' ) ; // the original tfoot is in its own table and must be sized
footerTrgEls = footer . find ( 'tr' ) ; // the original tfoot is in its own table and must be sized
footerSrcEls = footerCopy . find ( 'tr' ) ;
footerSrcEls = footerCopy . find ( 'tr' ) ;
footerCopy . find ( '[id]' ) . removeAttr ( 'id' ) ;
}
}
// Clone the current header and footer elements and then place it into the inner table
// Clone the current header and footer elements and then place it into the inner table
@ -5345,6 +5356,7 @@
headerTrgEls = header . find ( 'tr' ) ; // original header is in its own table
headerTrgEls = header . find ( 'tr' ) ; // original header is in its own table
headerSrcEls = headerCopy . find ( 'tr' ) ;
headerSrcEls = headerCopy . find ( 'tr' ) ;
headerCopy . find ( 'th, td' ) . removeAttr ( 'tabindex' ) ;
headerCopy . find ( 'th, td' ) . removeAttr ( 'tabindex' ) ;
headerCopy . find ( '[id]' ) . removeAttr ( 'id' ) ;
/ *
/ *
@ -6471,6 +6483,17 @@
// Store the saved state so it might be accessed at any time
// Store the saved state so it might be accessed at any time
settings . oLoadedState = $ . extend ( true , { } , s ) ;
settings . oLoadedState = $ . extend ( true , { } , s ) ;
// Page Length
if ( s . length !== undefined ) {
// If already initialised just set the value directly so that the select element is also updated
if ( api ) {
api . page . len ( s . length )
}
else {
settings . _iDisplayLength = s . length ;
}
}
// Restore key features - todo - for 1.11 this needs to be done by
// Restore key features - todo - for 1.11 this needs to be done by
// subscribed events
// subscribed events
if ( s . start !== undefined ) {
if ( s . start !== undefined ) {
@ -6479,13 +6502,9 @@
settings . iInitDisplayStart = s . start ;
settings . iInitDisplayStart = s . start ;
}
}
else {
else {
_fnPageChange ( settings , s . start / s . length ) ;
_fnPageChange ( settings , s . start / settings . _iDisplayLength ) ;
}
}
}
}
if ( s . length !== undefined ) {
settings . _iDisplayLength = s . length ;
}
// Order
// Order
if ( s . order !== undefined ) {
if ( s . order !== undefined ) {
@ -7218,8 +7237,10 @@
pluck : function ( prop )
pluck : function ( prop )
{
{
let fn = DataTable . util . get ( prop ) ;
return this . map ( function ( el ) {
return this . map ( function ( el ) {
return el [ prop ] ;
return fn( el ) ;
} ) ;
} ) ;
} ,
} ,
@ -8448,7 +8469,7 @@
var api = new _Api ( settings ) ;
var api = new _Api ( settings ) ;
var namespace = '.dt.DT_details' ;
var namespace = '.dt.DT_details' ;
var drawEvent = 'draw' + namespace ;
var drawEvent = 'draw' + namespace ;
var colvisEvent = 'column- visibility '+ namespace ;
var colvisEvent = 'column- sizing '+ namespace ;
var destroyEvent = 'destroy' + namespace ;
var destroyEvent = 'destroy' + namespace ;
var data = settings . aoData ;
var data = settings . aoData ;
@ -9500,7 +9521,6 @@
remove = remove || false ;
remove = remove || false ;
return this . iterator ( 'table' , function ( settings ) {
return this . iterator ( 'table' , function ( settings ) {
var orig = settings . nTableWrapper . parentNode ;
var classes = settings . oClasses ;
var classes = settings . oClasses ;
var table = settings . nTable ;
var table = settings . nTable ;
var tbody = settings . nTBody ;
var tbody = settings . nTBody ;
@ -9555,6 +9575,8 @@
jqTbody . children ( ) . detach ( ) ;
jqTbody . children ( ) . detach ( ) ;
jqTbody . append ( rows ) ;
jqTbody . append ( rows ) ;
var orig = settings . nTableWrapper . parentNode ;
// Remove the DataTables generated nodes, events and classes
// Remove the DataTables generated nodes, events and classes
var removedMethod = remove ? 'remove' : 'detach' ;
var removedMethod = remove ? 'remove' : 'detach' ;
jqTable [ removedMethod ] ( ) ;
jqTable [ removedMethod ] ( ) ;
@ -9648,7 +9670,7 @@
* @ type string
* @ type string
* @ default Version number
* @ default Version number
* /
* /
DataTable . version = "1.1 1.5 ";
DataTable . version = "1.1 2.1 ";
/ * *
/ * *
* Private data store , containing all of the settings objects that are
* Private data store , containing all of the settings objects that are
@ -11853,7 +11875,6 @@
* Text which is displayed when the table is processing a user action
* Text which is displayed when the table is processing a user action
* ( usually a sort command or similar ) .
* ( usually a sort command or similar ) .
* @ type string
* @ type string
* @ default Processing ...
*
*
* @ dtopt Language
* @ dtopt Language
* @ name DataTable . defaults . language . processing
* @ name DataTable . defaults . language . processing
@ -11867,7 +11888,7 @@
* } ) ;
* } ) ;
* } ) ;
* } ) ;
* /
* /
"sProcessing" : " Processing... ",
"sProcessing" : " ",
/ * *
/ * *
@ -14073,7 +14094,7 @@
*
*
* @ type string
* @ type string
* /
* /
build : "bs5/dt-1.11.5 ",
build : "bs5/dt-1.12.1 ",
/ * *
/ * *
@ -15119,6 +15140,213 @@
d ;
d ;
} ;
} ;
// Common logic for moment, luxon or a date action
function _ _mld ( dt , momentFn , luxonFn , dateFn , arg1 ) {
if ( window . moment ) {
return dt [ momentFn ] ( arg1 ) ;
}
else if ( window . luxon ) {
return dt [ luxonFn ] ( arg1 ) ;
}
return dateFn ? dt [ dateFn ] ( arg1 ) : dt ;
}
var _ _mlWarning = false ;
function _ _mldObj ( d , format , locale ) {
var dt ;
if ( window . moment ) {
dt = window . moment . utc ( d , format , locale , true ) ;
if ( ! dt . isValid ( ) ) {
return null ;
}
}
else if ( window . luxon ) {
dt = format
? window . luxon . DateTime . fromFormat ( d , format )
: window . luxon . DateTime . fromISO ( d ) ;
if ( ! dt . isValid ) {
return null ;
}
dt . setLocale ( locale ) ;
}
else if ( ! format ) {
// No format given, must be ISO
dt = new Date ( d ) ;
}
else {
if ( ! _ _mlWarning ) {
alert ( 'DataTables warning: Formatted date without Moment.js or Luxon - https://datatables.net/tn/17' ) ;
}
_ _mlWarning = true ;
}
return dt ;
}
// Wrapper for date, datetime and time which all operate the same way with the exception of
// the output string for auto locale support
function _ _mlHelper ( localeString ) {
return function ( from , to , locale , def ) {
// Luxon and Moment support
// Argument shifting
if ( arguments . length === 0 ) {
locale = 'en' ;
to = null ; // means toLocaleString
from = null ; // means iso8601
}
else if ( arguments . length === 1 ) {
locale = 'en' ;
to = from ;
from = null ;
}
else if ( arguments . length === 2 ) {
locale = to ;
to = from ;
from = null ;
}
var typeName = 'datetime-' + to ;
// Add type detection and sorting specific to this date format - we need to be able to identify
// date type columns as such, rather than as numbers in extensions. Hence the need for this.
if ( ! DataTable . ext . type . order [ typeName ] ) {
// The renderer will give the value to type detect as the type!
DataTable . ext . type . detect . unshift ( function ( d ) {
return d === typeName ? typeName : false ;
} ) ;
// The renderer gives us Moment, Luxon or Date obects for the sorting, all of which have a
// `valueOf` which gives milliseconds epoch
DataTable . ext . type . order [ typeName + '-asc' ] = function ( a , b ) {
var x = a . valueOf ( ) ;
var y = b . valueOf ( ) ;
return x === y
? 0
: x < y
? - 1
: 1 ;
}
DataTable . ext . type . order [ typeName + '-desc' ] = function ( a , b ) {
var x = a . valueOf ( ) ;
var y = b . valueOf ( ) ;
return x === y
? 0
: x > y
? - 1
: 1 ;
}
}
return function ( d , type ) {
// Allow for a default value
if ( d === null || d === undefined ) {
if ( def === '--now' ) {
// We treat everything as UTC further down, so no changes are
// made, as such need to get the local date / time as if it were
// UTC
var local = new Date ( ) ;
d = new Date ( Date . UTC (
local . getFullYear ( ) , local . getMonth ( ) , local . getDate ( ) ,
local . getHours ( ) , local . getMinutes ( ) , local . getSeconds ( )
) ) ;
}
else {
d = '' ;
}
}
if ( type === 'type' ) {
// Typing uses the type name for fast matching
return typeName ;
}
if ( d === '' ) {
return type !== 'sort'
? ''
: _ _mldObj ( '0000-01-01 00:00:00' , null , locale ) ;
}
// Shortcut. If `from` and `to` are the same, we are using the renderer to
// format for ordering, not display - its already in the display format.
if ( to !== null && from === to && type !== 'sort' && type !== 'type' && ! ( d instanceof Date ) ) {
return d ;
}
var dt = _ _mldObj ( d , from , locale ) ;
if ( dt === null ) {
return d ;
}
if ( type === 'sort' ) {
return dt ;
}
var formatted = to === null
? _ _mld ( dt , 'toDate' , 'toJSDate' , '' ) [ localeString ] ( )
: _ _mld ( dt , 'format' , 'toFormat' , 'toISOString' , to ) ;
// XSS protection
return type === 'display' ?
_ _htmlEscapeEntities ( formatted ) :
formatted ;
} ;
}
}
// Based on locale, determine standard number formatting
// Fallback for legacy browsers is US English
var _ _thousands = ',' ;
var _ _decimal = '.' ;
if ( Intl ) {
try {
var num = new Intl . NumberFormat ( ) . formatToParts ( 100000.1 ) ;
for ( var i = 0 ; i < num . length ; i ++ ) {
if ( num [ i ] . type === 'group' ) {
_ _thousands = num [ i ] . value ;
}
else if ( num [ i ] . type === 'decimal' ) {
_ _decimal = num [ i ] . value ;
}
}
}
catch ( e ) {
// noop
}
}
// Formatted date time detection - use by declaring the formats you are going to use
DataTable . datetime = function ( format , locale ) {
var typeName = 'datetime-detect-' + format ;
if ( ! locale ) {
locale = 'en' ;
}
if ( ! DataTable . ext . type . order [ typeName ] ) {
DataTable . ext . type . detect . unshift ( function ( d ) {
var dt = _ _mldObj ( d , format , locale ) ;
return d === '' || dt ? typeName : false ;
} ) ;
DataTable . ext . type . order [ typeName + '-pre' ] = function ( d ) {
return _ _mldObj ( d , format , locale ) || 0 ;
}
}
}
/ * *
/ * *
* Helpers for ` columns.render ` .
* Helpers for ` columns.render ` .
*
*
@ -15146,13 +15374,29 @@
* @ namespace
* @ namespace
* /
* /
DataTable . render = {
DataTable . render = {
date : _ _mlHelper ( 'toLocaleDateString' ) ,
datetime : _ _mlHelper ( 'toLocaleString' ) ,
time : _ _mlHelper ( 'toLocaleTimeString' ) ,
number : function ( thousands , decimal , precision , prefix , postfix ) {
number : function ( thousands , decimal , precision , prefix , postfix ) {
// Auto locale detection
if ( thousands === null || thousands === undefined ) {
thousands = _ _thousands ;
}
if ( decimal === null || decimal === undefined ) {
decimal = _ _decimal ;
}
return {
return {
display : function ( d ) {
display : function ( d ) {
if ( typeof d !== 'number' && typeof d !== 'string' ) {
if ( typeof d !== 'number' && typeof d !== 'string' ) {
return d ;
return d ;
}
}
if ( d === '' || d === null ) {
return d ;
}
var negative = d < 0 ? '-' : '' ;
var negative = d < 0 ? '-' : '' ;
var flo = parseFloat ( d ) ;
var flo = parseFloat ( d ) ;