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/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.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.11.3",
24
+ "datatables.net": ">=1.12.1",
23
25
  "jquery": ">=1.7"
24
26
  },
25
27
  "moduleType": [
@@ -249,7 +249,7 @@ export default class Criteria {
249
249
  */
250
250
  private _populateCondition;
251
251
  /**
252
- * Populates the data select element
252
+ * Populates the data / column select element
253
253
  */
254
254
  private _populateData;
255
255
  /**
package/types/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /*! SearchBuilder 1.3.4
1
+ /*! SearchBuilder 1.4.2
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,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 {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 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
- * Gets the details of the current SearchBuilder setup
53
+ * SearchBuilder methods container
54
+ *
55
+ * @returns Api for chaining with the additional SearchBuilder methods
28
56
  */
29
- getDetails(): IDetails;
57
+ searchBuilder: ApiSearchBuilder<T>;
58
+ }
30
59
 
60
+ interface ApiStatic {
31
61
  /**
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
62
+ * SearchBuilder class
37
63
  */
38
- rebuild(state: IDetails): Api<any>;
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
+ }