datatables.net-searchbuilder 1.3.4 → 1.4.2
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.
- package/js/dataTables.searchBuilder.js +270 -296
- package/js/dataTables.searchBuilder.min.js +4 -149
- package/js/dataTables.searchBuilder.min.mjs +7 -0
- package/js/dataTables.searchBuilder.mjs +3781 -0
- package/package.json +4 -2
- package/types/criteria.d.ts +1 -1
- package/types/index.d.ts +1 -1
- package/types/searchBuilder.bootstrap.d.ts +4 -0
- package/types/searchBuilder.bootstrap4.d.ts +4 -0
- package/types/searchBuilder.bootstrap5.d.ts +4 -0
- package/types/searchBuilder.bulma.d.ts +4 -0
- package/types/searchBuilder.dataTables.d.ts +4 -0
- package/types/searchBuilder.foundation.d.ts +4 -0
- package/types/searchBuilder.jqueryui.d.ts +4 -0
- package/types/searchBuilder.semanticui.d.ts +4 -0
- package/types/types.d.ts +97 -22
package/package.json
CHANGED
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
"name": "datatables.net-searchbuilder",
|
|
3
3
|
"description": "SearchBuilder for DataTables",
|
|
4
4
|
"main": "js/dataTables.searchBuilder.js",
|
|
5
|
+
"module": "js/dataTables.searchBuilder.mjs",
|
|
5
6
|
"types": "./types/types.d.ts",
|
|
6
|
-
"version": "1.
|
|
7
|
+
"version": "1.4.2",
|
|
7
8
|
"files": [
|
|
8
9
|
"js/**/*.js",
|
|
10
|
+
"js/**/*.mjs",
|
|
9
11
|
"types/**/*.d.ts"
|
|
10
12
|
],
|
|
11
13
|
"keywords": [
|
|
@@ -19,7 +21,7 @@
|
|
|
19
21
|
"sort"
|
|
20
22
|
],
|
|
21
23
|
"dependencies": {
|
|
22
|
-
"datatables.net": ">=1.
|
|
24
|
+
"datatables.net": ">=1.12.1",
|
|
23
25
|
"jquery": ">=1.7"
|
|
24
26
|
},
|
|
25
27
|
"moduleType": [
|
package/types/criteria.d.ts
CHANGED
package/types/index.d.ts
CHANGED
package/types/types.d.ts
CHANGED
|
@@ -1,40 +1,115 @@
|
|
|
1
|
+
// Type definitions for DataTables SearchBuilder
|
|
2
|
+
//
|
|
3
|
+
// Project: https://datatables.net/extensions/searchbuilder/, https://datatables.net
|
|
4
|
+
|
|
1
5
|
/// <reference types="jquery" />
|
|
2
|
-
/// <reference types="datatables.net"/>
|
|
3
6
|
|
|
4
|
-
import
|
|
7
|
+
import DataTables, {Api} from 'datatables.net';
|
|
8
|
+
import {IDefaults, IDetails, II18n} from './searchBuilder';
|
|
5
9
|
|
|
6
|
-
|
|
10
|
+
export default DataTables;
|
|
7
11
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
type DeepPartial<T> = T extends object ? {
|
|
13
|
+
[P in keyof T]?: DeepPartial<T[P]>;
|
|
14
|
+
} : T;
|
|
11
15
|
|
|
12
|
-
interface LanguageSettings {
|
|
13
|
-
searchBuilder?: {}
|
|
14
|
-
}
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
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[];
|
|
18
26
|
}
|
|
19
27
|
|
|
20
|
-
interface
|
|
28
|
+
interface ConfigLanguage {
|
|
21
29
|
/**
|
|
22
|
-
*
|
|
30
|
+
* SearchBuilder language options
|
|
23
31
|
*/
|
|
24
|
-
|
|
32
|
+
searchBuilder?: ConfigSearchBuilderLanguage;
|
|
33
|
+
}
|
|
25
34
|
|
|
35
|
+
interface ConfigColumns {
|
|
36
|
+
searchBuilder?: {
|
|
37
|
+
/** Set a default condition for this column */
|
|
38
|
+
defaultCondition?: number | string;
|
|
39
|
+
|
|
40
|
+
/** Set values of orthogonal data for rendering functions */
|
|
41
|
+
orthogonal?: {[key: string]: string};
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/** Set a custom title for a column in SearchBuilder */
|
|
45
|
+
searchBuilderTitle?: string;
|
|
46
|
+
|
|
47
|
+
/** Set the SearchBuilder type to use for a column */
|
|
48
|
+
searchBuilderType?: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
interface Api<T> {
|
|
26
52
|
/**
|
|
27
|
-
*
|
|
53
|
+
* SearchBuilder methods container
|
|
54
|
+
*
|
|
55
|
+
* @returns Api for chaining with the additional SearchBuilder methods
|
|
28
56
|
*/
|
|
29
|
-
|
|
57
|
+
searchBuilder: ApiSearchBuilder<T>;
|
|
58
|
+
}
|
|
30
59
|
|
|
60
|
+
interface ApiStatic {
|
|
31
61
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* @param state Object of the same structue that is returned from searchBuilder.getDetails().
|
|
35
|
-
* This contains all of the details needed to rebuild the state.
|
|
36
|
-
* @returns self for chaining
|
|
62
|
+
* SearchBuilder class
|
|
37
63
|
*/
|
|
38
|
-
|
|
64
|
+
SearchBuilder: {
|
|
65
|
+
/**
|
|
66
|
+
* Create a new SearchBuilder instance for the target DataTable
|
|
67
|
+
*/
|
|
68
|
+
new (dt: Api<any>, settings: string[] | ConfigSearchBuilder | ConfigSearchBuilder[]);
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* SearchBuilder version
|
|
72
|
+
*/
|
|
73
|
+
version: string;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Default configuration values
|
|
77
|
+
*/
|
|
78
|
+
defaults: ConfigSearchBuilder;
|
|
79
|
+
}
|
|
39
80
|
}
|
|
40
81
|
}
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
85
|
+
* Options
|
|
86
|
+
*/
|
|
87
|
+
|
|
88
|
+
interface ConfigSearchBuilder extends Partial<IDefaults> {}
|
|
89
|
+
|
|
90
|
+
interface ConfigSearchBuilderLanguage extends DeepPartial<II18n> {}
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
94
|
+
* API
|
|
95
|
+
*/
|
|
96
|
+
interface ApiSearchBuilder<T> extends Api<T> {
|
|
97
|
+
/**
|
|
98
|
+
* Returns the node of the SearchBuilder Container
|
|
99
|
+
*/
|
|
100
|
+
container(): JQuery<HTMLElement>;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Gets the details of the current SearchBuilder setup
|
|
104
|
+
*/
|
|
105
|
+
getDetails(): IDetails;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Rebuild the search to a given state.
|
|
109
|
+
*
|
|
110
|
+
* @param state Object of the same structure that is returned from searchBuilder.getDetails().
|
|
111
|
+
* This contains all of the details needed to rebuild the state.
|
|
112
|
+
* @returns self for chaining
|
|
113
|
+
*/
|
|
114
|
+
rebuild(state: IDetails): Api<T>;
|
|
115
|
+
}
|