datatables.net-searchbuilder 1.3.2 → 1.3.3

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
@@ -3,7 +3,7 @@
3
3
  "description": "SearchBuilder for DataTables",
4
4
  "main": "js/dataTables.searchBuilder.js",
5
5
  "types": "./types/types.d.ts",
6
- "version": "1.3.2",
6
+ "version": "1.3.3",
7
7
  "files": [
8
8
  "js/**/*.js",
9
9
  "types/**/*.d.ts"
@@ -11,6 +11,7 @@ export interface IClasses {
11
11
  dropDown: string;
12
12
  greyscale: string;
13
13
  input: string;
14
+ inputCont: string;
14
15
  italic: string;
15
16
  joiner: string;
16
17
  left: string;
@@ -41,6 +42,7 @@ export interface IDom {
41
42
  dataTitle: JQuery<HTMLElement>;
42
43
  defaultValue: JQuery<HTMLElement>;
43
44
  delete: JQuery<HTMLElement>;
45
+ inputCont: JQuery<HTMLElement>;
44
46
  left: JQuery<HTMLElement>;
45
47
  right: JQuery<HTMLElement>;
46
48
  value: Array<JQuery<HTMLElement>>;
@@ -61,6 +63,9 @@ export interface IS {
61
63
  index: number;
62
64
  origData: string;
63
65
  preventRedraw: boolean;
66
+ serverData: {
67
+ [keys: string]: builderType.IServerData[];
68
+ };
64
69
  topGroup: JQuery<HTMLElement>;
65
70
  type: string;
66
71
  value: string[];
@@ -96,7 +101,7 @@ export default class Criteria {
96
101
  dom: IDom;
97
102
  c: builderType.IDefaults;
98
103
  s: IS;
99
- constructor(table: any, opts: builderType.IDefaults, topGroup: JQuery<HTMLElement>, index?: number, depth?: number);
104
+ constructor(table: any, opts: builderType.IDefaults, topGroup: JQuery<HTMLElement>, index?: number, depth?: number, serverData?: any);
100
105
  /**
101
106
  * Escape html characters within a string
102
107
  *
@@ -108,6 +113,10 @@ export default class Criteria {
108
113
  * Default initialisation function for select conditions
109
114
  */
110
115
  private static initSelect;
116
+ /**
117
+ * Default initialisation function for select conditions
118
+ */
119
+ private static initSelectSSP;
111
120
  /**
112
121
  * Default initialisation function for select array conditions
113
122
  *
@@ -148,6 +157,13 @@ export default class Criteria {
148
157
  * Function that is run on each element as a call back when a search should be triggered
149
158
  */
150
159
  private static updateListener;
160
+ /**
161
+ * Parses formatted numbers down to a form where they can be compared
162
+ *
163
+ * @param val the value to convert
164
+ * @returns the converted value
165
+ */
166
+ private static parseNumFmt;
151
167
  static dateConditions: {
152
168
  [keys: string]: ICondition;
153
169
  };
@@ -173,7 +189,7 @@ export default class Criteria {
173
189
  /**
174
190
  * Adds the left button to the criteria
175
191
  */
176
- updateArrows(hasSiblings?: boolean, redraw?: boolean): void;
192
+ updateArrows(hasSiblings?: boolean): void;
177
193
  /**
178
194
  * Destroys the criteria, removing listeners and container from the dom
179
195
  */
@@ -209,10 +225,7 @@ export default class Criteria {
209
225
  * Sets the listeners for the criteria
210
226
  */
211
227
  setListeners(): void;
212
- /**
213
- * Adjusts the criteria to make SearchBuilder responsive
214
- */
215
- private _adjustCriteria;
228
+ setupButtons(): void;
216
229
  /**
217
230
  * Builds the elements of the dom together
218
231
  */
package/types/group.d.ts CHANGED
@@ -28,6 +28,9 @@ export interface IS {
28
28
  logic: string;
29
29
  opts: builderType.IDefaults;
30
30
  preventRedraw: boolean;
31
+ serverData: {
32
+ [keys: string]: builderType.IServerData;
33
+ };
31
34
  toDrop: Criteria;
32
35
  topGroup: JQuery<HTMLElement>;
33
36
  }
@@ -68,7 +71,7 @@ export default class Group {
68
71
  dom: IDom;
69
72
  c: builderType.IDefaults;
70
73
  s: IS;
71
- constructor(table: any, opts: builderType.IDefaults, topGroup: JQuery<HTMLElement>, index?: number, isChild?: boolean, depth?: number);
74
+ constructor(table: any, opts: builderType.IDefaults, topGroup: JQuery<HTMLElement>, index?: number, isChild?: boolean, depth?: number, serverData?: any);
72
75
  /**
73
76
  * Destroys the groups buttons, clears the internal criteria and removes it from the dom
74
77
  */
@@ -117,7 +120,7 @@ export default class Group {
117
120
  *
118
121
  * @param crit Instance of Criteria to be added to the group
119
122
  */
120
- addCriteria(crit?: Criteria, redraw?: boolean): void;
123
+ addCriteria(crit?: Criteria): void;
121
124
  /**
122
125
  * Checks the group to see if it has any filled criteria
123
126
  */
package/types/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /*! SearchBuilder 1.3.1
1
+ /*! SearchBuilder 1.3.2
2
2
  * ©SpryMedia Ltd - datatables.net/license/mit
3
3
  */
4
4
  export {};
@@ -72,10 +72,17 @@ export interface II18n {
72
72
  value: string;
73
73
  valueJoiner: string;
74
74
  }
75
+ export interface IServerData {
76
+ label: any;
77
+ value: any;
78
+ }
75
79
  export interface IS {
76
80
  dt: any;
77
81
  opts: IDefaults;
78
82
  search: (settings: any, searchData: any, dataIndex: any, origData: any) => boolean;
83
+ serverData: {
84
+ [keys: string]: IServerData[];
85
+ };
79
86
  topGroup: Group;
80
87
  }
81
88
  /**