datatables.net-searchbuilder 1.3.4 → 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.
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.3.4",
7
+ "version": "1.4.0",
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.11.3",
24
+ "datatables.net": ">=1.12.1",
23
25
  "jquery": ">=1.7"
24
26
  },
25
27
  "moduleType": [
package/types/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /*! SearchBuilder 1.3.4
1
+ /*! SearchBuilder 1.4.0
2
2
  * ©SpryMedia Ltd - datatables.net/license/mit
3
3
  */
4
4
  export {};
@@ -0,0 +1,4 @@
1
+ /*! Bootstrap ui integration for DataTables' SearchBuilder
2
+ * © SpryMedia Ltd - datatables.net/license
3
+ */
4
+ declare var DataTable: any;
@@ -0,0 +1,4 @@
1
+ /*! Bootstrap 4 ui integration for DataTables' SearchBuilder
2
+ * © SpryMedia Ltd - datatables.net/license
3
+ */
4
+ declare var DataTable: any;
@@ -0,0 +1,4 @@
1
+ /*! Bootstrap 5 ui integration for DataTables' SearchBuilder
2
+ * © SpryMedia Ltd - datatables.net/license
3
+ */
4
+ declare var DataTable: any;
@@ -0,0 +1,4 @@
1
+ /*! Bulma ui integration for DataTables' SearchBuilder
2
+ * © SpryMedia Ltd - datatables.net/license
3
+ */
4
+ declare var DataTable: any;
@@ -0,0 +1,4 @@
1
+ /*! DataTables integration for DataTables' SearchBuilder
2
+ * © SpryMedia Ltd - datatables.net/license
3
+ */
4
+ declare var DataTable: any;
@@ -0,0 +1,4 @@
1
+ /*! Foundation ui integration for DataTables' SearchBuilder
2
+ * © SpryMedia Ltd - datatables.net/license
3
+ */
4
+ declare var DataTable: any;
@@ -0,0 +1,4 @@
1
+ /*! JQuery ui ui integration for DataTables' SearchBuilder
2
+ * © SpryMedia Ltd - datatables.net/license
3
+ */
4
+ declare var DataTable: any;
@@ -0,0 +1,4 @@
1
+ /*! semantic ui integration for DataTables' SearchBuilder
2
+ * © SpryMedia Ltd - datatables.net/license
3
+ */
4
+ declare var DataTable: any;
package/types/types.d.ts CHANGED
@@ -1,40 +1,99 @@
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 {IDefaults, IDetails} from './searchBuilder';
7
+ import DataTables, {Api} from 'datatables.net';
8
+ import {IDefaults, IDetails, II18n} from './searchBuilder';
5
9
 
6
- declare namespace DataTables {
10
+ export default DataTables;
7
11
 
8
- interface Settings {
9
- searchBuilder?: boolean | string[] | IDefaults | IDefaults[];
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
- interface Api<T> {
17
- searchBuilder: SearchBuilderGlobalApi;
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 SearchBuilderGlobalApi {
28
+ interface ConfigLanguage {
21
29
  /**
22
- * Returns the node of the SearchBuilder Container
30
+ * SearchBuilder language options
23
31
  */
24
- container(): JQuery<HTMLElement>;
32
+ searchBuilder?: ConfigSearchBuilderLanguage;
33
+ }
25
34
 
35
+ interface Api<T> {
26
36
  /**
27
- * Gets the details of the current SearchBuilder setup
37
+ * SearchBuilder methods container
38
+ *
39
+ * @returns Api for chaining with the additional SearchBuilder methods
28
40
  */
29
- getDetails(): IDetails;
41
+ searchBuilder: ApiSearchBuilder<T>;
42
+ }
30
43
 
44
+ interface ApiStatic {
31
45
  /**
32
- * Rebuild the search to a given state.
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
46
+ * SearchBuilder class
37
47
  */
38
- rebuild(state: IDetails): Api<any>;
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
+ }
39
64
  }
40
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
+ }