Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

datatables.net-bs

Package Overview
Dependencies
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

datatables.net-bs - npm Package Compare versions

Comparing version 2.1.1 to 2.1.2

css/dataTables.bootstrap.min.css

212

js/dataTables.bootstrap.js
/*! DataTables Bootstrap 3 integration
* ©2011-2015 SpryMedia Ltd - datatables.net/license
* © SpryMedia Ltd - datatables.net/license
*/
/**
* DataTables integration for Bootstrap 3. This requires Bootstrap 3 and
* DataTables 1.10 or newer.
*
* This file sets the defaults and adds options to DataTables to style its
* controls using Bootstrap. See http://datatables.net/manual/styling/bootstrap
* for further information.
*/
(function( factory ){

@@ -22,16 +14,29 @@ if ( typeof define === 'function' && define.amd ) {

// CommonJS
module.exports = function (root, $) {
if ( ! root ) {
root = window;
var jq = require('jquery');
var cjsRequires = function (root, $) {
if ( ! $.fn.dataTable ) {
require('datatables.net')(root, $);
}
};
if ( ! $ || ! $.fn.dataTable ) {
// Require DataTables, which attaches to jQuery, including
// jQuery if needed and have a $ property so we can access the
// jQuery object that is used
$ = require('datatables.net')(root, $).$;
}
if (typeof window === 'undefined') {
module.exports = function (root, $) {
if ( ! root ) {
// CommonJS environments without a window global must pass a
// root. This will give an error otherwise
root = window;
}
return factory( $, root, root.document );
};
if ( ! $ ) {
$ = jq( root );
}
cjsRequires( root, $ );
return factory( $, root, root.document );
};
}
else {
cjsRequires( window, jq );
module.exports = factory( jq, window, window.document );
}
}

@@ -42,3 +47,3 @@ else {

}
}(function( $, window, document, undefined ) {
}(function( $, window, document ) {
'use strict';

@@ -48,8 +53,13 @@ var DataTable = $.fn.dataTable;

/**
* DataTables integration for Bootstrap 3.
*
* This file sets the defaults and adds options to DataTables to style its
* controls using Bootstrap. See https://datatables.net/manual/styling/bootstrap
* for further information.
*/
/* Set the defaults for DataTables initialisation */
$.extend( true, DataTable.defaults, {
dom:
"<'row'<'col-sm-6'l><'col-sm-6'f>>" +
"<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
renderer: 'bootstrap'

@@ -60,123 +70,51 @@ } );

/* Default class modification */
$.extend( DataTable.ext.classes, {
sWrapper: "dataTables_wrapper form-inline dt-bootstrap",
sFilterInput: "form-control input-sm",
sLengthSelect: "form-control input-sm",
sProcessing: "dataTables_processing panel panel-default"
$.extend( true, DataTable.ext.classes, {
container: "dt-container form-inline dt-bootstrap",
search: {
input: "form-control input-sm"
},
length: {
select: "form-control input-sm"
},
processing: {
container: "dt-processing panel panel-default"
},
layout: {
row: 'row dt-layout-row',
cell: 'dt-layout-cell',
tableCell: 'col-12',
start: 'dt-layout-start col-sm-6',
end: 'dt-layout-end col-sm-6',
full: 'dt-layout-full col-sm-12'
}
} );
/* Bootstrap paging button renderer */
DataTable.ext.renderer.pageButton.bootstrap = function ( settings, host, idx, buttons, page, pages ) {
var api = new DataTable.Api( settings );
var classes = settings.oClasses;
var lang = settings.oLanguage.oPaginate;
var aria = settings.oLanguage.oAria.paginate || {};
var btnDisplay, btnClass, counter=0;
DataTable.ext.renderer.pagingButton.bootstrap = function (settings, buttonType, content, active, disabled) {
var btnClasses = ['dt-paging-button', 'page-item'];
var attach = function( container, buttons ) {
var i, ien, node, button;
var clickHandler = function ( e ) {
e.preventDefault();
if ( !$(e.currentTarget).hasClass('disabled') && api.page() != e.data.action ) {
api.page( e.data.action ).draw( 'page' );
}
};
if (active) {
btnClasses.push('active');
}
for ( i=0, ien=buttons.length ; i<ien ; i++ ) {
button = buttons[i];
if (disabled) {
btnClasses.push('disabled')
}
if ( $.isArray( button ) ) {
attach( container, button );
}
else {
btnDisplay = '';
btnClass = '';
var li = $('<li>').addClass(btnClasses.join(' '));
var a = $('<a>', {
'href': disabled ? null : '#',
'class': 'page-link'
})
.html(content)
.appendTo(li);
switch ( button ) {
case 'ellipsis':
btnDisplay = '&#x2026;';
btnClass = 'disabled';
break;
case 'first':
btnDisplay = lang.sFirst;
btnClass = button + (page > 0 ?
'' : ' disabled');
break;
case 'previous':
btnDisplay = lang.sPrevious;
btnClass = button + (page > 0 ?
'' : ' disabled');
break;
case 'next':
btnDisplay = lang.sNext;
btnClass = button + (page < pages-1 ?
'' : ' disabled');
break;
case 'last':
btnDisplay = lang.sLast;
btnClass = button + (page < pages-1 ?
'' : ' disabled');
break;
default:
btnDisplay = button + 1;
btnClass = page === button ?
'active' : '';
break;
}
if ( btnDisplay ) {
node = $('<li>', {
'class': classes.sPageButton+' '+btnClass,
'id': idx === 0 && typeof button === 'string' ?
settings.sTableId +'_'+ button :
null
} )
.append( $('<a>', {
'href': '#',
'aria-controls': settings.sTableId,
'aria-label': aria[ button ],
'data-dt-idx': counter,
'tabindex': settings.iTabIndex
} )
.html( btnDisplay )
)
.appendTo( container );
settings.oApi._fnBindAction(
node, {action: button}, clickHandler
);
counter++;
}
}
}
return {
display: li,
clicker: a
};
};
// IE9 throws an 'unknown error' if document.activeElement is used
// inside an iframe or frame.
var activeEl;
try {
// Because this approach is destroying and recreating the paging
// elements, focus is lost on the select button which is bad for
// accessibility. So we want to restore focus once the draw has
// completed
activeEl = $(host).find(document.activeElement).data('dt-idx');
}
catch (e) {}
attach(
$(host).empty().html('<ul class="pagination"/>').children('ul'),
buttons
);
if ( activeEl !== undefined ) {
$(host).find( '[data-dt-idx='+activeEl+']' ).focus();
}
DataTable.ext.renderer.pagingContainer.bootstrap = function (settings, buttonEls) {
return $('<ul/>').addClass('pagination').append(buttonEls);
};

@@ -183,0 +121,0 @@

{
"name": "datatables.net-bs",
"version": "2.1.1",
"description": "DataTables for jQuery with styling for [Bootstrap](http://getbootstrap.com/)",
"description": "DataTables for jQuery with styling for [Bootstrap](https://getbootstrap.com/docs/3.3/)",
"main": "js/dataTables.bootstrap.js",
"module": "js/dataTables.bootstrap.mjs",
"style": "css/dataTables.bootstrap.css",
"types": "./types/dataTables.bootstrap.d.ts",
"version": "2.1.2",
"files": [
"js/dataTables.bootstrap.js",
"css/dataTables.bootstrap.css"
"css/**/*.css",
"js/**/*.js",
"js/**/*.mjs",
"types/**/*.d.ts"
],
"main": "js/dataTables.bootstrap.js",
"style": "css/dataTables.bootstrap.css",
"keywords": [
"filter",
"sort",
"DataTables",
"Bootstrap",
"Datatables",
"jQuery",
"table",
"Bootstrap"
"filter",
"sort"
],
"homepage": "https://datatables.net",
"bugs": "https://datatables.net/forums",
"license": "MIT",
"dependencies": {
"datatables.net": "2.1.2",
"jquery": ">=1.7"
},
"moduleType": [
"globals",
"amd",
"node"
],
"ignore": [
"composer.json",
"datatables.json",
"package.json"
],
"author": {

@@ -26,6 +41,5 @@ "name": "SpryMedia Ltd",

},
"dependencies": {
"jquery": ">=1.7",
"datatables.net": ">=1.10.9"
},
"homepage": "https://datatables.net",
"bugs": "https://datatables.net/forums",
"license": "MIT",
"repository": {

@@ -32,0 +46,0 @@ "type": "git",

@@ -1,4 +0,4 @@

# DataTables for jQuery with styling for [Bootstrap](http://getbootstrap.com/)
# DataTables for jQuery with styling for [Bootstrap](https://getbootstrap.com/docs/3.3/)
This package contains distribution files required to style [DataTables library](https://datatables.net) for [jQuery](http://jquery.com/) with styling for [Bootstrap](http://getbootstrap.com/).
This package contains distribution files required to style [DataTables library](https://datatables.net) for [jQuery](http://jquery.com/) with styling for [Bootstrap](https://getbootstrap.com/docs/3.3/).

@@ -20,2 +20,3 @@ DataTables is a table enhancing library which adds features such as paging, ordering, search, scrolling and many more to a static HTML page. A comprehensive API is also available that can be used to manipulate the table. Please refer to the [DataTables web-site](//datatables.net) for a full range of documentation and examples.

ES3 Syntax
```

@@ -26,2 +27,7 @@ var $ = require( 'jquery' );

ES6 Syntax
```
import 'datatables.net-bs'
```
### bower

@@ -37,3 +43,3 @@

Full documentation of the DataTables options, API and plug-in interface are available on the DOCS_LINK. The site also contains information on the wide variety of plug-ins that are available for DataTables, which can be used to enhance and customise your table even further.
Full documentation of the DataTables options, API and plug-in interface are available on the [website](https://datatables.net/reference/index). The site also contains information on the wide variety of plug-ins that are available for DataTables, which can be used to enhance and customise your table even further.

@@ -54,1 +60,2 @@

This software is released under the [MIT license](//datatables.net/license). You are free to use, modify and distribute this software, but all copyright information must remain.

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc