API: Add `column[s]().searchable()` method

pull/295/merge
Allan Jardine 2 years ago
parent 323a3b0b01
commit a7ef1706b0

@ -16,7 +16,7 @@
} }
}; };
if (typeof window !== 'undefined') { if (typeof window === 'undefined') {
module.exports = function (root, $) { module.exports = function (root, $) {
if ( ! root ) { if ( ! root ) {
// CommonJS environments without a window global must pass a // CommonJS environments without a window global must pass a

@ -1,2 +1,2 @@
/*! © SpryMedia Ltd - datatables.net/license */ /*! © SpryMedia Ltd - datatables.net/license */
!function(t){var o,r;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return t(e,window,document)}):"object"==typeof exports?(o=require("jquery"),r=function(e,n){n.fn.dataTable||require("datatables.net")(e,n)},"undefined"!=typeof window?module.exports=function(e,n){return e=e||window,n=n||o(e),r(e,n),t(n,0,e.document)}:(r(window,o),module.exports=t(o,window,window.document))):t(jQuery,window,document)}(function(e,n,t,o){"use strict";e=e.fn.dataTable;return e.Api.register("average()",function(){var e=this.flatten();return e.reduce(function(e,n){return+e+ +n},0)/e.length}),e}); !function(t){var o,r;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return t(e,window,document)}):"object"==typeof exports?(o=require("jquery"),r=function(e,n){n.fn.dataTable||require("datatables.net")(e,n)},"undefined"==typeof window?module.exports=function(e,n){return e=e||window,n=n||o(e),r(e,n),t(n,0,e.document)}:(r(window,o),module.exports=t(o,window,window.document))):t(jQuery,window,document)}(function(e,n,t,o){"use strict";e=e.fn.dataTable;return e.Api.register("average()",function(){var e=this.flatten();return e.reduce(function(e,n){return+e+ +n},0)/e.length}),e});

@ -1,2 +1,2 @@
/*! © SpryMedia Ltd - datatables.net/license */ /*! © SpryMedia Ltd - datatables.net/license */
import $ from"jquery";import DataTable from"datatables.net";DataTable.Api.register("average()",function(){var t=this.flatten();return t.reduce(function(t,e){return+t+ +e},0)/t.length});export default DataTable; import jQuery from"jquery";import DataTable from"datatables.net";let $=jQuery;DataTable.Api.register("average()",function(){var e=this.flatten();return e.reduce(function(e,t){return+e+ +t},0)/e.length});export default DataTable;

@ -1,8 +1,11 @@
/*! © SpryMedia Ltd - datatables.net/license */ /*! © SpryMedia Ltd - datatables.net/license */
import $ from 'jquery'; import jQuery from 'jquery';
import DataTable from 'datatables.net'; import DataTable from 'datatables.net';
// Allow reassignment of the $ variable
let $ = jQuery;
/** /**
* It can sometimes be useful to get the average of data in an API result set, * It can sometimes be useful to get the average of data in an API result set,
* be it from a column, or a collection of cells. This method provides exactly * be it from a column, or a collection of cells. This method provides exactly

@ -0,0 +1,12 @@
/*! © SpryMedia Ltd - datatables.net/license */
declare module 'datatables.net' {
interface ApiColumnMethods {
/** Get searchable flag for selected column */
searchable(): boolean;
}
interface ApiColumnsMethods {
/** Get searchable flag for selected columns */
searchable(): Api<boolean>;
}
}
export {};

@ -0,0 +1,76 @@
/*! © SpryMedia Ltd - datatables.net/license */
(function( factory ){
if ( typeof define === 'function' && define.amd ) {
// AMD
define( ['jquery', 'datatables.net'], function ( $ ) {
return factory( $, window, document );
} );
}
else if ( typeof exports === 'object' ) {
// CommonJS
var jq = require('jquery');
var cjsRequires = function (root, $) {
if ( ! $.fn.dataTable ) {
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;
}
if ( ! $ ) {
$ = jq( root );
}
cjsRequires( root, $ );
return factory( $, root, root.document );
};
}
else {
cjsRequires( window, jq );
module.exports = factory( jq, window, window.document );
}
}
else {
// Browser
factory( jQuery, window, document );
}
}(function( $, window, document, undefined ) {
'use strict';
var DataTable = $.fn.dataTable;
/**
* The plug-in provides a way to determine the searchable state of one or more
* columns, as was configured by the `-init columns.searchable` option.
*
* @name columns().order()
* @summary Apply multi-column ordering through the columns() API method.
* @author [Allan Jardine](http://sprymedia.co.uk)
* @requires DataTables 1.10+
*
* @returns {boolean|DataTables.Api} Searchable flag
*
* @example
* // Get the searchable flag for all columns
* table.columns().searchable().toArray()
*
* @example
* // Get the searchable flag for column index 0
* table.column(0).searchable()
*/
DataTable.Api.registerPlural('columns().searchable()', 'column().searchable()', function (selector, opts) {
return this.iterator('column', function (settings, column) {
return settings.aoColumns[column].bSearchable;
}, 1);
});
return DataTable;
}));

@ -0,0 +1,2 @@
/*! © SpryMedia Ltd - datatables.net/license */
!function(t){var o,u;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return t(e,window,document)}):"object"==typeof exports?(o=require("jquery"),u=function(e,n){n.fn.dataTable||require("datatables.net")(e,n)},"undefined"==typeof window?module.exports=function(e,n){return e=e||window,n=n||o(e),u(e,n),t(n,0,e.document)}:(u(window,o),module.exports=t(o,window,window.document))):t(jQuery,window,document)}(function(e,n,t,o){"use strict";e=e.fn.dataTable;return e.Api.registerPlural("columns().searchable()","column().searchable()",function(e,n){return this.iterator("column",function(e,n){return e.aoColumns[n].bSearchable},1)}),e});

@ -0,0 +1,2 @@
/*! © SpryMedia Ltd - datatables.net/license */
import jQuery from"jquery";import DataTable from"datatables.net";let $=jQuery;DataTable.Api.registerPlural("columns().searchable()","column().searchable()",function(a,e){return this.iterator("column",function(a,e){return a.aoColumns[e].bSearchable},1)});export default DataTable;

@ -0,0 +1,35 @@
/*! © SpryMedia Ltd - datatables.net/license */
import jQuery from 'jquery';
import DataTable from 'datatables.net';
// Allow reassignment of the $ variable
let $ = jQuery;
/**
* The plug-in provides a way to determine the searchable state of one or more
* columns, as was configured by the `-init columns.searchable` option.
*
* @name columns().order()
* @summary Apply multi-column ordering through the columns() API method.
* @author [Allan Jardine](http://sprymedia.co.uk)
* @requires DataTables 1.10+
*
* @returns {boolean|DataTables.Api} Searchable flag
*
* @example
* // Get the searchable flag for all columns
* table.columns().searchable().toArray()
*
* @example
* // Get the searchable flag for column index 0
* table.column(0).searchable()
*/
DataTable.Api.registerPlural('columns().searchable()', 'column().searchable()', function (selector, opts) {
return this.iterator('column', function (settings, column) {
return settings.aoColumns[column].bSearchable;
}, 1);
});
export default DataTable;

@ -16,7 +16,7 @@
} }
}; };
if (typeof window !== 'undefined') { if (typeof window === 'undefined') {
module.exports = function (root, $) { module.exports = function (root, $) {
if ( ! root ) { if ( ! root ) {
// CommonJS environments without a window global must pass a // CommonJS environments without a window global must pass a

@ -1,2 +1,2 @@
/*! © Alejandro Navarro - datatables.net/license */ /*! © Alejandro Navarro - datatables.net/license */
!function(t){var o,i;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return t(e,window,document)}):"object"==typeof exports?(o=require("jquery"),i=function(e,n){n.fn.dataTable||require("datatables.net")(e,n)},"undefined"!=typeof window?module.exports=function(e,n){return e=e||window,n=n||o(e),i(e,n),t(n,0,e.document)}:(i(window,o),module.exports=t(o,window,window.document))):t(jQuery,window,document)}(function(n,e,t,o){"use strict";var i=n.fn.dataTable;return i.Api.register("column().title()",function(){var e=this.header();return n(e).text().trim()}),i}); !function(t){var o,i;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return t(e,window,document)}):"object"==typeof exports?(o=require("jquery"),i=function(e,n){n.fn.dataTable||require("datatables.net")(e,n)},"undefined"==typeof window?module.exports=function(e,n){return e=e||window,n=n||o(e),i(e,n),t(n,0,e.document)}:(i(window,o),module.exports=t(o,window,window.document))):t(jQuery,window,document)}(function(n,e,t,o){"use strict";var i=n.fn.dataTable;return i.Api.register("column().title()",function(){var e=this.header();return n(e).text().trim()}),i});

@ -1,2 +1,2 @@
/*! © Alejandro Navarro - datatables.net/license */ /*! © Alejandro Navarro - datatables.net/license */
import $ from"jquery";import DataTable from"datatables.net";DataTable.Api.register("column().title()",function(){var t=this.header();return $(t).text().trim()});export default DataTable; import jQuery from"jquery";import DataTable from"datatables.net";let $=jQuery;DataTable.Api.register("column().title()",function(){var t=this.header();return $(t).text().trim()});export default DataTable;

@ -1,8 +1,11 @@
/*! © Alejandro Navarro - datatables.net/license */ /*! © Alejandro Navarro - datatables.net/license */
import $ from 'jquery'; import jQuery from 'jquery';
import DataTable from 'datatables.net'; import DataTable from 'datatables.net';
// Allow reassignment of the $ variable
let $ = jQuery;
/** /**
* This plug-in will read the text from the header cell of a column, returning * This plug-in will read the text from the header cell of a column, returning
* that value. * that value.

@ -16,7 +16,7 @@
} }
}; };
if (typeof window !== 'undefined') { if (typeof window === 'undefined') {
module.exports = function (root, $) { module.exports = function (root, $) {
if ( ! root ) { if ( ! root ) {
// CommonJS environments without a window global must pass a // CommonJS environments without a window global must pass a

@ -1,2 +1,2 @@
/*! © SpryMedia Ltd - datatables.net/license */ /*! © SpryMedia Ltd - datatables.net/license */
!function(t){var r,o;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return t(e,window,document)}):"object"==typeof exports?(r=require("jquery"),o=function(e,n){n.fn.dataTable||require("datatables.net")(e,n)},"undefined"!=typeof window?module.exports=function(e,n){return e=e||window,n=n||r(e),o(e,n),t(n,0,e.document)}:(o(window,r),module.exports=t(r,window,window.document))):t(jQuery,window,document)}(function(e,n,t,r){"use strict";var u=e.fn.dataTable;return u.Api.register("columns().order()",function(i){return this.iterator("columns",function(e,n){for(var t=[],r=0,o=n.length;r<o;r++)t.push([n[r],Array.isArray(i)?i[r]:i]);new u.Api(e).order(t)})}),u}); !function(t){var r,o;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return t(e,window,document)}):"object"==typeof exports?(r=require("jquery"),o=function(e,n){n.fn.dataTable||require("datatables.net")(e,n)},"undefined"==typeof window?module.exports=function(e,n){return e=e||window,n=n||r(e),o(e,n),t(n,0,e.document)}:(o(window,r),module.exports=t(r,window,window.document))):t(jQuery,window,document)}(function(e,n,t,r){"use strict";var u=e.fn.dataTable;return u.Api.register("columns().order()",function(i){return this.iterator("columns",function(e,n){for(var t=[],r=0,o=n.length;r<o;r++)t.push([n[r],Array.isArray(i)?i[r]:i]);new u.Api(e).order(t)})}),u});

@ -1,2 +1,2 @@
/*! © SpryMedia Ltd - datatables.net/license */ /*! © SpryMedia Ltd - datatables.net/license */
import $ from"jquery";import DataTable from"datatables.net";DataTable.Api.register("columns().order()",function(i){return this.iterator("columns",function(r,a){for(var t=[],e=0,o=a.length;e<o;e++)t.push([a[e],Array.isArray(i)?i[e]:i]);new DataTable.Api(r).order(t)})});export default DataTable; import jQuery from"jquery";import DataTable from"datatables.net";let $=jQuery;DataTable.Api.register("columns().order()",function(i){return this.iterator("columns",function(r,a){for(var e=[],t=0,o=a.length;t<o;t++)e.push([a[t],Array.isArray(i)?i[t]:i]);new DataTable.Api(r).order(e)})});export default DataTable;

@ -1,8 +1,11 @@
/*! © SpryMedia Ltd - datatables.net/license */ /*! © SpryMedia Ltd - datatables.net/license */
import $ from 'jquery'; import jQuery from 'jquery';
import DataTable from 'datatables.net'; import DataTable from 'datatables.net';
// Allow reassignment of the $ variable
let $ = jQuery;
/** /**
* The DataTables core library provides the ability to set the ordering via the * The DataTables core library provides the ability to set the ordering via the
* `dt-api column().order()` method, but there is no plural equivalent. While * `dt-api column().order()` method, but there is no plural equivalent. While

@ -16,7 +16,7 @@
} }
}; };
if (typeof window !== 'undefined') { if (typeof window === 'undefined') {
module.exports = function (root, $) { module.exports = function (root, $) {
if ( ! root ) { if ( ! root ) {
// CommonJS environments without a window global must pass a // CommonJS environments without a window global must pass a

@ -1,2 +1,2 @@
/*! © SpryMedia Ltd - datatables.net/license */ /*! © SpryMedia Ltd - datatables.net/license */
!function(t){var o,r;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return t(e,window,document)}):"object"==typeof exports?(o=require("jquery"),r=function(e,n){n.fn.dataTable||require("datatables.net")(e,n)},"undefined"!=typeof window?module.exports=function(e,n){return e=e||window,n=n||o(e),r(e,n),t(n,0,e.document)}:(r(window,o),module.exports=t(o,window,window.document))):t(jQuery,window,document)}(function(e,n,t,o){"use strict";e=e.fn.dataTable;return e.Api.register("order.neutral()",function(){return this.iterator("table",function(e){e.aaSorting.length=0,e.aiDisplay.sort(function(e,n){return e-n}),e.aiDisplayMaster.sort(function(e,n){return e-n})})}),e}); !function(t){var o,r;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return t(e,window,document)}):"object"==typeof exports?(o=require("jquery"),r=function(e,n){n.fn.dataTable||require("datatables.net")(e,n)},"undefined"==typeof window?module.exports=function(e,n){return e=e||window,n=n||o(e),r(e,n),t(n,0,e.document)}:(r(window,o),module.exports=t(o,window,window.document))):t(jQuery,window,document)}(function(e,n,t,o){"use strict";e=e.fn.dataTable;return e.Api.register("order.neutral()",function(){return this.iterator("table",function(e){e.aaSorting.length=0,e.aiDisplay.sort(function(e,n){return e-n}),e.aiDisplayMaster.sort(function(e,n){return e-n})})}),e});

@ -1,2 +1,2 @@
/*! © SpryMedia Ltd - datatables.net/license */ /*! © SpryMedia Ltd - datatables.net/license */
import $ from"jquery";import DataTable from"datatables.net";DataTable.Api.register("order.neutral()",function(){return this.iterator("table",function(t){t.aaSorting.length=0,t.aiDisplay.sort(function(t,a){return t-a}),t.aiDisplayMaster.sort(function(t,a){return t-a})})});export default DataTable; import jQuery from"jquery";import DataTable from"datatables.net";let $=jQuery;DataTable.Api.register("order.neutral()",function(){return this.iterator("table",function(t){t.aaSorting.length=0,t.aiDisplay.sort(function(t,r){return t-r}),t.aiDisplayMaster.sort(function(t,r){return t-r})})});export default DataTable;

@ -1,8 +1,11 @@
/*! © SpryMedia Ltd - datatables.net/license */ /*! © SpryMedia Ltd - datatables.net/license */
import $ from 'jquery'; import jQuery from 'jquery';
import DataTable from 'datatables.net'; import DataTable from 'datatables.net';
// Allow reassignment of the $ variable
let $ = jQuery;
/** /**
* This function will restore the order in which data was read into a DataTable * This function will restore the order in which data was read into a DataTable
* (for example from an HTML source). Although you can set `dt-api order()` to * (for example from an HTML source). Although you can set `dt-api order()` to

@ -16,7 +16,7 @@
} }
}; };
if (typeof window !== 'undefined') { if (typeof window === 'undefined') {
module.exports = function (root, $) { module.exports = function (root, $) {
if ( ! root ) { if ( ! root ) {
// CommonJS environments without a window global must pass a // CommonJS environments without a window global must pass a

@ -1,2 +1,2 @@
/*! © SpryMedia Ltd - datatables.net/license */ /*! © SpryMedia Ltd - datatables.net/license */
!function(t){var o,i;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return t(e,window,document)}):"object"==typeof exports?(o=require("jquery"),i=function(e,n){n.fn.dataTable||require("datatables.net")(e,n)},"undefined"!=typeof window?module.exports=function(e,n){return e=e||window,n=n||o(e),i(e,n),t(n,0,e.document)}:(i(window,o),module.exports=t(o,window,window.document))):t(jQuery,window,document)}(function(e,n,t,o){"use strict";e=e.fn.dataTable;return e.Api.register("page.jumpToData()",function(e,n){n=this.column(n,{order:"current"}).data().indexOf(e);return 0<=n&&(e=Math.floor(n/this.page.info().length),this.page(e).draw(!1)),this}),e}); !function(t){var o,i;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return t(e,window,document)}):"object"==typeof exports?(o=require("jquery"),i=function(e,n){n.fn.dataTable||require("datatables.net")(e,n)},"undefined"==typeof window?module.exports=function(e,n){return e=e||window,n=n||o(e),i(e,n),t(n,0,e.document)}:(i(window,o),module.exports=t(o,window,window.document))):t(jQuery,window,document)}(function(e,n,t,o){"use strict";e=e.fn.dataTable;return e.Api.register("page.jumpToData()",function(e,n){n=this.column(n,{order:"current"}).data().indexOf(e);return 0<=n&&(e=Math.floor(n/this.page.info().length),this.page(e).draw(!1)),this}),e});

@ -1,2 +1,2 @@
/*! © SpryMedia Ltd - datatables.net/license */ /*! © SpryMedia Ltd - datatables.net/license */
import $ from"jquery";import DataTable from"datatables.net";DataTable.Api.register("page.jumpToData()",function(a,t){t=this.column(t,{order:"current"}).data().indexOf(a);return 0<=t&&(a=Math.floor(t/this.page.info().length),this.page(a).draw(!1)),this});export default DataTable; import jQuery from"jquery";import DataTable from"datatables.net";let $=jQuery;DataTable.Api.register("page.jumpToData()",function(t,a){a=this.column(a,{order:"current"}).data().indexOf(t);return 0<=a&&(t=Math.floor(a/this.page.info().length),this.page(t).draw(!1)),this});export default DataTable;

@ -1,8 +1,11 @@
/*! © SpryMedia Ltd - datatables.net/license */ /*! © SpryMedia Ltd - datatables.net/license */
import $ from 'jquery'; import jQuery from 'jquery';
import DataTable from 'datatables.net'; import DataTable from 'datatables.net';
// Allow reassignment of the $ variable
let $ = jQuery;
/** /**
* It can be quite useful to jump straight to a page which contains a certain * It can be quite useful to jump straight to a page which contains a certain
* piece of data (a user name for example). This plug-in provides exactly that * piece of data (a user name for example). This plug-in provides exactly that

@ -16,7 +16,7 @@
} }
}; };
if (typeof window !== 'undefined') { if (typeof window === 'undefined') {
module.exports = function (root, $) { module.exports = function (root, $) {
if ( ! root ) { if ( ! root ) {
// CommonJS environments without a window global must pass a // CommonJS environments without a window global must pass a

@ -1,2 +1,2 @@
/*! © SpryMedia Ltd - datatables.net/license */ /*! © SpryMedia Ltd - datatables.net/license */
!function(t){var o,i;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return t(e,window,document)}):"object"==typeof exports?(o=require("jquery"),i=function(e,n){n.fn.dataTable||require("datatables.net")(e,n)},"undefined"!=typeof window?module.exports=function(e,n){return e=e||window,n=n||o(e),i(e,n),t(n,0,e.document)}:(i(window,o),module.exports=t(o,window,window.document))):t(jQuery,window,document)}(function(e,n,t,o){"use strict";e=e.fn.dataTable;return e.Api.register("processing()",function(n){return this.iterator("table",function(e){e.oApi._fnProcessingDisplay(e,n)})}),e}); !function(t){var o,i;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return t(e,window,document)}):"object"==typeof exports?(o=require("jquery"),i=function(e,n){n.fn.dataTable||require("datatables.net")(e,n)},"undefined"==typeof window?module.exports=function(e,n){return e=e||window,n=n||o(e),i(e,n),t(n,0,e.document)}:(i(window,o),module.exports=t(o,window,window.document))):t(jQuery,window,document)}(function(e,n,t,o){"use strict";e=e.fn.dataTable;return e.Api.register("processing()",function(n){return this.iterator("table",function(e){e.oApi._fnProcessingDisplay(e,n)})}),e});

@ -1,2 +1,2 @@
/*! © SpryMedia Ltd - datatables.net/license */ /*! © SpryMedia Ltd - datatables.net/license */
import $ from"jquery";import DataTable from"datatables.net";DataTable.Api.register("processing()",function(a){return this.iterator("table",function(t){t.oApi._fnProcessingDisplay(t,a)})});export default DataTable; import jQuery from"jquery";import DataTable from"datatables.net";let $=jQuery;DataTable.Api.register("processing()",function(e){return this.iterator("table",function(t){t.oApi._fnProcessingDisplay(t,e)})});export default DataTable;

@ -1,8 +1,11 @@
/*! © SpryMedia Ltd - datatables.net/license */ /*! © SpryMedia Ltd - datatables.net/license */
import $ from 'jquery'; import jQuery from 'jquery';
import DataTable from 'datatables.net'; import DataTable from 'datatables.net';
// Allow reassignment of the $ variable
let $ = jQuery;
/** /**
* Externally trigger the display of DataTables' "processing" indicator. * Externally trigger the display of DataTables' "processing" indicator.
* *

@ -16,7 +16,7 @@
} }
}; };
if (typeof window !== 'undefined') { if (typeof window === 'undefined') {
module.exports = function (root, $) { module.exports = function (root, $) {
if ( ! root ) { if ( ! root ) {
// CommonJS environments without a window global must pass a // CommonJS environments without a window global must pass a

@ -1,2 +1,2 @@
/*! © Edouard Labre - datatables.net/license */ /*! © Edouard Labre - datatables.net/license */
!function(n){var i,o;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return n(e,window,document)}):"object"==typeof exports?(i=require("jquery"),o=function(e,t){t.fn.dataTable||require("datatables.net")(e,t)},"undefined"!=typeof window?module.exports=function(e,t){return e=e||window,t=t||i(e),o(e,t),n(t,0,e.document)}:(o(window,i),module.exports=n(i,window,window.document))):n(jQuery,window,document)}(function(e,t,n,i){"use strict";e=e.fn.dataTable;return e.Api.register("row().show()",function(){var e=this.table().page.info(),t=this.index(),t=this.table().rows({search:"applied"})[0].indexOf(t);return t>=e.start&&t<e.end||t<0||(e=Math.floor(t/this.table().page.len()),this.table().page(e)),this}),e}); !function(n){var i,o;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return n(e,window,document)}):"object"==typeof exports?(i=require("jquery"),o=function(e,t){t.fn.dataTable||require("datatables.net")(e,t)},"undefined"==typeof window?module.exports=function(e,t){return e=e||window,t=t||i(e),o(e,t),n(t,0,e.document)}:(o(window,i),module.exports=n(i,window,window.document))):n(jQuery,window,document)}(function(e,t,n,i){"use strict";e=e.fn.dataTable;return e.Api.register("row().show()",function(){var e=this.table().page.info(),t=this.index(),t=this.table().rows({search:"applied"})[0].indexOf(t);return t>=e.start&&t<e.end||t<0||(e=Math.floor(t/this.table().page.len()),this.table().page(e)),this}),e});

@ -1,2 +1,2 @@
/*! © Edouard Labre - datatables.net/license */ /*! © Edouard Labre - datatables.net/license */
import $ from"jquery";import DataTable from"datatables.net";DataTable.Api.register("row().show()",function(){var t=this.table().page.info(),a=this.index(),a=this.table().rows({search:"applied"})[0].indexOf(a);return a>=t.start&&a<t.end||a<0||(t=Math.floor(a/this.table().page.len()),this.table().page(t)),this});export default DataTable; import jQuery from"jquery";import DataTable from"datatables.net";let $=jQuery;DataTable.Api.register("row().show()",function(){var e=this.table().page.info(),t=this.index(),t=this.table().rows({search:"applied"})[0].indexOf(t);return t>=e.start&&t<e.end||t<0||(e=Math.floor(t/this.table().page.len()),this.table().page(e)),this});export default DataTable;

@ -1,8 +1,11 @@
/*! © Edouard Labre - datatables.net/license */ /*! © Edouard Labre - datatables.net/license */
import $ from 'jquery'; import jQuery from 'jquery';
import DataTable from 'datatables.net'; import DataTable from 'datatables.net';
// Allow reassignment of the $ variable
let $ = jQuery;
/** /**
* This plugin jumps to the right page of the DataTable to show the required row * This plugin jumps to the right page of the DataTable to show the required row
* *

@ -16,7 +16,7 @@
} }
}; };
if (typeof window !== 'undefined') { if (typeof window === 'undefined') {
module.exports = function (root, $) { module.exports = function (root, $) {
if ( ! root ) { if ( ! root ) {
// CommonJS environments without a window global must pass a // CommonJS environments without a window global must pass a

@ -1,2 +1,2 @@
/*! © SpryMedia Ltd - datatables.net/license */ /*! © SpryMedia Ltd - datatables.net/license */
!function(t){var o,r;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return t(e,window,document)}):"object"==typeof exports?(o=require("jquery"),r=function(e,n){n.fn.dataTable||require("datatables.net")(e,n)},"undefined"!=typeof window?module.exports=function(e,n){return e=e||window,n=n||o(e),r(e,n),t(n,0,e.document)}:(r(window,o),module.exports=t(o,window,window.document))):t(jQuery,window,document)}(function(e,n,t,o){"use strict";e=e.fn.dataTable;return e.Api.register("rows().generate()",function(){return this.iterator("row",function(e,n){e.oApi._fnCreateTr(e,n)})}),e}); !function(t){var o,r;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return t(e,window,document)}):"object"==typeof exports?(o=require("jquery"),r=function(e,n){n.fn.dataTable||require("datatables.net")(e,n)},"undefined"==typeof window?module.exports=function(e,n){return e=e||window,n=n||o(e),r(e,n),t(n,0,e.document)}:(r(window,o),module.exports=t(o,window,window.document))):t(jQuery,window,document)}(function(e,n,t,o){"use strict";e=e.fn.dataTable;return e.Api.register("rows().generate()",function(){return this.iterator("row",function(e,n){e.oApi._fnCreateTr(e,n)})}),e});

@ -1,2 +1,2 @@
/*! © SpryMedia Ltd - datatables.net/license */ /*! © SpryMedia Ltd - datatables.net/license */
import $ from"jquery";import DataTable from"datatables.net";DataTable.Api.register("rows().generate()",function(){return this.iterator("row",function(t,e){t.oApi._fnCreateTr(t,e)})});export default DataTable; import jQuery from"jquery";import DataTable from"datatables.net";let $=jQuery;DataTable.Api.register("rows().generate()",function(){return this.iterator("row",function(e,t){e.oApi._fnCreateTr(e,t)})});export default DataTable;

@ -1,8 +1,11 @@
/*! © SpryMedia Ltd - datatables.net/license */ /*! © SpryMedia Ltd - datatables.net/license */
import $ from 'jquery'; import jQuery from 'jquery';
import DataTable from 'datatables.net'; import DataTable from 'datatables.net';
// Allow reassignment of the $ variable
let $ = jQuery;
/** /**
* When using `-init deferRender` you might find that under a specific set of circumstances you * When using `-init deferRender` you might find that under a specific set of circumstances you
* need the `-tag tr` element for a row which hasn't yet been drawn. This method can be used to * need the `-tag tr` element for a row which hasn't yet been drawn. This method can be used to

@ -0,0 +1,46 @@
/*! © SpryMedia Ltd - datatables.net/license */
/**
* The plug-in provides a way to determine the searchable state of one or more
* columns, as was configured by the `-init columns.searchable` option.
*
* @name columns().order()
* @summary Apply multi-column ordering through the columns() API method.
* @author [Allan Jardine](http://sprymedia.co.uk)
* @requires DataTables 1.10+
*
* @returns {boolean|DataTables.Api} Searchable flag
*
* @example
* // Get the searchable flag for all columns
* table.columns().searchable().toArray()
*
* @example
* // Get the searchable flag for column index 0
* table.column(0).searchable()
*/
import DataTable from 'datatables.net';
declare module 'datatables.net' {
interface ApiColumnMethods {
/** Get searchable flag for selected column */
searchable(): boolean;
}
interface ApiColumnsMethods {
/** Get searchable flag for selected columns */
searchable(): Api<boolean>;
}
}
DataTable.Api.registerPlural(
'columns().searchable()',
'column().searchable()',
function ( selector, opts ) {
return this.iterator( 'column', function ( settings, column ) {
return settings.aoColumns[column].bSearchable;
}, 1 );
}
);

@ -16,7 +16,7 @@
} }
}; };
if (typeof window !== 'undefined') { if (typeof window === 'undefined') {
module.exports = function (root, $) { module.exports = function (root, $) {
if ( ! root ) { if ( ! root ) {
// CommonJS environments without a window global must pass a // CommonJS environments without a window global must pass a

2
api/sum().min.js vendored

@ -1,2 +1,2 @@
/*! © SpryMedia Ltd - datatables.net/license */ /*! © SpryMedia Ltd - datatables.net/license */
!function(t){var o,r;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return t(e,window,document)}):"object"==typeof exports?(o=require("jquery"),r=function(e,n){n.fn.dataTable||require("datatables.net")(e,n)},"undefined"!=typeof window?module.exports=function(e,n){return e=e||window,n=n||o(e),r(e,n),t(n,0,e.document)}:(r(window,o),module.exports=t(o,window,window.document))):t(jQuery,window,document)}(function(e,n,t,o){"use strict";e=e.fn.dataTable;return e.Api.register("sum()",function(){return this.flatten().reduce(function(e,n){return(e="string"==typeof e?+e.replace(/[^\d.-]/g,""):e)+(n="string"==typeof n?+n.replace(/[^\d.-]/g,""):n)},0)}),e}); !function(t){var o,r;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(e){return t(e,window,document)}):"object"==typeof exports?(o=require("jquery"),r=function(e,n){n.fn.dataTable||require("datatables.net")(e,n)},"undefined"==typeof window?module.exports=function(e,n){return e=e||window,n=n||o(e),r(e,n),t(n,0,e.document)}:(r(window,o),module.exports=t(o,window,window.document))):t(jQuery,window,document)}(function(e,n,t,o){"use strict";e=e.fn.dataTable;return e.Api.register("sum()",function(){return this.flatten().reduce(function(e,n){return(e="string"==typeof e?+e.replace(/[^\d.-]/g,""):e)+(n="string"==typeof n?+n.replace(/[^\d.-]/g,""):n)},0)}),e});

@ -1,2 +1,2 @@
/*! © SpryMedia Ltd - datatables.net/license */ /*! © SpryMedia Ltd - datatables.net/license */
import $ from"jquery";import DataTable from"datatables.net";DataTable.Api.register("sum()",function(){return this.flatten().reduce(function(t,e){return(t="string"==typeof t?+t.replace(/[^\d.-]/g,""):t)+(e="string"==typeof e?+e.replace(/[^\d.-]/g,""):e)},0)});export default DataTable; import jQuery from"jquery";import DataTable from"datatables.net";let $=jQuery;DataTable.Api.register("sum()",function(){return this.flatten().reduce(function(e,t){return(e="string"==typeof e?+e.replace(/[^\d.-]/g,""):e)+(t="string"==typeof t?+t.replace(/[^\d.-]/g,""):t)},0)});export default DataTable;

@ -1,8 +1,11 @@
/*! © SpryMedia Ltd - datatables.net/license */ /*! © SpryMedia Ltd - datatables.net/license */
import $ from 'jquery'; import jQuery from 'jquery';
import DataTable from 'datatables.net'; import DataTable from 'datatables.net';
// Allow reassignment of the $ variable
let $ = jQuery;
/** /**
* Fairly simply, this plug-in will take the data from an API result set * Fairly simply, this plug-in will take the data from an API result set
* and sum it, returning the summed value. The data can come from any data * and sum it, returning the summed value. The data can come from any data

@ -92,9 +92,9 @@ DT_BUILT="${DT_SRC}/built/DataTables"
PLUGINS="${DT_SRC}/extensions/Plugins" PLUGINS="${DT_SRC}/extensions/Plugins"
# for file in $PLUGINS/api/src/*.ts; do for file in $PLUGINS/api/src/*.ts; do
# ts_plugin $file ts_plugin $file
# done done
# for file in $PLUGINS/buttons/src/*.ts; do # for file in $PLUGINS/buttons/src/*.ts; do
# ts_plugin $file # ts_plugin $file
@ -108,17 +108,17 @@ PLUGINS="${DT_SRC}/extensions/Plugins"
# ts_plugin $file # ts_plugin $file
# done # done
for file in $PLUGINS/sorting/src/*.ts; do # for file in $PLUGINS/sorting/src/*.ts; do
ts_plugin $file # ts_plugin $file
done # done
for file in $PLUGINS/type-detection/src/*.ts; do # for file in $PLUGINS/type-detection/src/*.ts; do
ts_plugin $file # ts_plugin $file
done # done
for file in $PLUGINS/filtering/type-based/src/*.ts; do # for file in $PLUGINS/filtering/type-based/src/*.ts; do
ts_plugin $file # ts_plugin $file
done # done
# echo_section " Languages" # echo_section " Languages"
# for file in $PLUGINS/i18n/*.json; do # for file in $PLUGINS/i18n/*.json; do

Loading…
Cancel
Save