datatables.net-searchbuilder-bm 1.3.3 → 1.4.0
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.
|
@@ -1,50 +1,65 @@
|
|
|
1
1
|
/*! Bulma ui integration for DataTables' SearchBuilder
|
|
2
|
-
* ©
|
|
2
|
+
* © SpryMedia Ltd - datatables.net/license
|
|
3
3
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
4
|
+
|
|
5
|
+
(function( factory ){
|
|
6
|
+
if ( typeof define === 'function' && define.amd ) {
|
|
7
|
+
// AMD
|
|
8
|
+
define( ['jquery', 'datatables.net-bm', 'datatables.net-searchbuilder'], function ( $ ) {
|
|
9
|
+
return factory( $, window, document );
|
|
10
|
+
} );
|
|
11
|
+
}
|
|
12
|
+
else if ( typeof exports === 'object' ) {
|
|
13
|
+
// CommonJS
|
|
14
|
+
module.exports = function (root, $) {
|
|
15
|
+
if ( ! root ) {
|
|
16
|
+
// CommonJS environments without a window global must pass a
|
|
17
|
+
// root. This will give an error otherwise
|
|
18
|
+
root = window;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if ( ! $ ) {
|
|
22
|
+
$ = typeof window !== 'undefined' ? // jQuery's factory checks for a global window
|
|
23
|
+
require('jquery') :
|
|
24
|
+
require('jquery')( root );
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if ( ! $.fn.dataTable ) {
|
|
28
|
+
require('datatables.net-bm')(root, $);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if ( ! $.fn.dataTable ) {
|
|
32
|
+
require('datatables.net-searchbuilder')(root, $);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
return factory( $, root, root.document );
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
// Browser
|
|
41
|
+
factory( jQuery, window, document );
|
|
42
|
+
}
|
|
43
|
+
}(function( $, window, document, undefined ) {
|
|
44
|
+
'use strict';
|
|
45
|
+
var DataTable = $.fn.dataTable;
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
$.extend(true, DataTable.SearchBuilder.classes, {
|
|
49
|
+
clearAll: 'button dtsb-clearAll'
|
|
50
|
+
});
|
|
51
|
+
$.extend(true, DataTable.Group.classes, {
|
|
52
|
+
add: 'button dtsb-add',
|
|
53
|
+
clearGroup: 'button dtsb-clearGroup is-light',
|
|
54
|
+
logic: 'button dtsb-logic is-light'
|
|
55
|
+
});
|
|
56
|
+
$.extend(true, DataTable.Criteria.classes, {
|
|
57
|
+
container: 'dtsb-criteria',
|
|
58
|
+
"delete": 'button dtsb-delete',
|
|
59
|
+
left: 'button dtsb-left',
|
|
60
|
+
right: 'button dtsb-right'
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
return DataTable;
|
|
50
65
|
}));
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
(function(b){"function"===typeof define&&define.amd?define(["jquery","datatables.net-bs5","datatables.net-searchbuilder"],function(a){return b(a)}):"object"===typeof exports?module.exports=function(a,c){a||(a=window);c&&c.fn.dataTable||(c=require("datatables.net-bs5")(a,c).$);c.fn.dataTable.searchBuilder||require("datatables.net-searchbuilder")(a,c);return b(c)}:b(jQuery)})(function(b){var a=b.fn.dataTable;b.extend(!0,a.SearchBuilder.classes,{clearAll:"button dtsb-clearAll"});b.extend(!0,a.Group.classes,
|
|
6
|
-
{add:"button dtsb-add",clearGroup:"button dtsb-clearGroup is-light",logic:"button dtsb-logic is-light"});b.extend(!0,a.Criteria.classes,{container:"dtsb-criteria","delete":"button dtsb-delete",left:"button dtsb-left",right:"button dtsb-right"});return a.searchPanes});
|
|
1
|
+
/*! Bulma ui integration for DataTables' SearchBuilder
|
|
2
|
+
* © SpryMedia Ltd - datatables.net/license
|
|
3
|
+
*/
|
|
4
|
+
!function(n){"function"==typeof define&&define.amd?define(["jquery","datatables.net-bm","datatables.net-searchbuilder"],function(e){return n(e,window,document)}):"object"==typeof exports?module.exports=function(e,t){return e=e||window,(t=t||("undefined"!=typeof window?require("jquery"):require("jquery")(e))).fn.dataTable||require("datatables.net-bm")(e,t),t.fn.dataTable||require("datatables.net-searchbuilder")(e,t),n(t,0,e.document)}:n(jQuery,window,document)}(function(e,t,n,r){"use strict";var d=e.fn.dataTable;return e.extend(!0,d.SearchBuilder.classes,{clearAll:"button dtsb-clearAll"}),e.extend(!0,d.Group.classes,{add:"button dtsb-add",clearGroup:"button dtsb-clearGroup is-light",logic:"button dtsb-logic is-light"}),e.extend(!0,d.Criteria.classes,{container:"dtsb-criteria",delete:"button dtsb-delete",left:"button dtsb-left",right:"button dtsb-right"}),d});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*! Bulma ui integration for DataTables' SearchBuilder
|
|
2
|
+
* © SpryMedia Ltd - datatables.net/license
|
|
3
|
+
*/
|
|
4
|
+
import $ from"jquery";import DataTable from"datatables.net-bm";import"datatables.net-searchbuilder";$.extend(!0,DataTable.SearchBuilder.classes,{clearAll:"button dtsb-clearAll"}),$.extend(!0,DataTable.Group.classes,{add:"button dtsb-add",clearGroup:"button dtsb-clearGroup is-light",logic:"button dtsb-logic is-light"}),$.extend(!0,DataTable.Criteria.classes,{container:"dtsb-criteria",delete:"button dtsb-delete",left:"button dtsb-left",right:"button dtsb-right"});export default DataTable;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*! Bulma ui integration for DataTables' SearchBuilder
|
|
2
|
+
* © SpryMedia Ltd - datatables.net/license
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import $ from 'jquery';
|
|
6
|
+
import DataTable from 'datatables.net-bm';
|
|
7
|
+
import 'datatables.net-searchbuilder';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
$.extend(true, DataTable.SearchBuilder.classes, {
|
|
11
|
+
clearAll: 'button dtsb-clearAll'
|
|
12
|
+
});
|
|
13
|
+
$.extend(true, DataTable.Group.classes, {
|
|
14
|
+
add: 'button dtsb-add',
|
|
15
|
+
clearGroup: 'button dtsb-clearGroup is-light',
|
|
16
|
+
logic: 'button dtsb-logic is-light'
|
|
17
|
+
});
|
|
18
|
+
$.extend(true, DataTable.Criteria.classes, {
|
|
19
|
+
container: 'dtsb-criteria',
|
|
20
|
+
"delete": 'button dtsb-delete',
|
|
21
|
+
left: 'button dtsb-left',
|
|
22
|
+
right: 'button dtsb-right'
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
export default DataTable;
|
package/package.json
CHANGED
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
"name": "datatables.net-searchbuilder-bm",
|
|
3
3
|
"description": "SearchBuilder for DataTables with styling for [Bulma](https://bulma.io/)",
|
|
4
4
|
"main": "js/searchBuilder.bulma.js",
|
|
5
|
+
"module": "js/searchBuilder.bulma.mjs",
|
|
5
6
|
"style": "css/searchBuilder.bulma.css",
|
|
6
|
-
"types": "./types/
|
|
7
|
-
"version": "1.
|
|
7
|
+
"types": "./types/types.d.ts",
|
|
8
|
+
"version": "1.4.0",
|
|
8
9
|
"files": [
|
|
9
10
|
"css/**/*.css",
|
|
10
11
|
"js/**/*.js",
|
|
12
|
+
"js/**/*.mjs",
|
|
11
13
|
"types/**/*.d.ts"
|
|
12
14
|
],
|
|
13
15
|
"keywords": [
|
|
@@ -22,8 +24,8 @@
|
|
|
22
24
|
"sort"
|
|
23
25
|
],
|
|
24
26
|
"dependencies": {
|
|
25
|
-
"datatables.net-searchbuilder": ">=1.
|
|
26
|
-
"datatables.net-bm": ">=1.
|
|
27
|
+
"datatables.net-searchbuilder": ">=1.3.4",
|
|
28
|
+
"datatables.net-bm": ">=1.12.1",
|
|
27
29
|
"jquery": ">=1.7"
|
|
28
30
|
},
|
|
29
31
|
"moduleType": [
|
package/types/types.d.ts
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// Type definitions for DataTables SearchBuilder
|
|
2
|
+
//
|
|
3
|
+
// Project: https://datatables.net/extensions/searchbuilder/, https://datatables.net
|
|
4
|
+
|
|
5
|
+
/// <reference types="jquery" />
|
|
6
|
+
|
|
7
|
+
import DataTables, {Api} from 'datatables.net';
|
|
8
|
+
import {IDefaults, IDetails, II18n} from './searchBuilder';
|
|
9
|
+
|
|
10
|
+
export default DataTables;
|
|
11
|
+
|
|
12
|
+
type DeepPartial<T> = T extends object ? {
|
|
13
|
+
[P in keyof T]?: DeepPartial<T[P]>;
|
|
14
|
+
} : T;
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
18
|
+
* DataTables' types integration
|
|
19
|
+
*/
|
|
20
|
+
declare module 'datatables.net' {
|
|
21
|
+
interface Config {
|
|
22
|
+
/**
|
|
23
|
+
* SearchBuilder extension options
|
|
24
|
+
*/
|
|
25
|
+
searchBuilder?: boolean | string[] | ConfigSearchBuilder | ConfigSearchBuilder[];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interface ConfigLanguage {
|
|
29
|
+
/**
|
|
30
|
+
* SearchBuilder language options
|
|
31
|
+
*/
|
|
32
|
+
searchBuilder?: ConfigSearchBuilderLanguage;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
interface Api<T> {
|
|
36
|
+
/**
|
|
37
|
+
* SearchBuilder methods container
|
|
38
|
+
*
|
|
39
|
+
* @returns Api for chaining with the additional SearchBuilder methods
|
|
40
|
+
*/
|
|
41
|
+
searchBuilder: ApiSearchBuilder<T>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
interface ApiStatic {
|
|
45
|
+
/**
|
|
46
|
+
* SearchBuilder class
|
|
47
|
+
*/
|
|
48
|
+
SearchBuilder: {
|
|
49
|
+
/**
|
|
50
|
+
* Create a new SearchBuilder instance for the target DataTable
|
|
51
|
+
*/
|
|
52
|
+
new (dt: Api<any>, settings: string[] | ConfigSearchBuilder | ConfigSearchBuilder[]);
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* SearchBuilder version
|
|
56
|
+
*/
|
|
57
|
+
version: string;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Default configuration values
|
|
61
|
+
*/
|
|
62
|
+
defaults: ConfigSearchBuilder;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
69
|
+
* Options
|
|
70
|
+
*/
|
|
71
|
+
|
|
72
|
+
interface ConfigSearchBuilder extends Partial<IDefaults> {}
|
|
73
|
+
|
|
74
|
+
interface ConfigSearchBuilderLanguage extends DeepPartial<II18n> {}
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
78
|
+
* API
|
|
79
|
+
*/
|
|
80
|
+
interface ApiSearchBuilder<T> extends Api<T> {
|
|
81
|
+
/**
|
|
82
|
+
* Returns the node of the SearchBuilder Container
|
|
83
|
+
*/
|
|
84
|
+
container(): JQuery<HTMLElement>;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Gets the details of the current SearchBuilder setup
|
|
88
|
+
*/
|
|
89
|
+
getDetails(): IDetails;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Rebuild the search to a given state.
|
|
93
|
+
*
|
|
94
|
+
* @param state Object of the same structure that is returned from searchBuilder.getDetails().
|
|
95
|
+
* This contains all of the details needed to rebuild the state.
|
|
96
|
+
* @returns self for chaining
|
|
97
|
+
*/
|
|
98
|
+
rebuild(state: IDetails): Api<T>;
|
|
99
|
+
}
|