datatables.net-searchbuilder 1.3.0 → 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.0",
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>>;
@@ -60,6 +62,10 @@ export interface IS {
60
62
  filled: boolean;
61
63
  index: number;
62
64
  origData: string;
65
+ preventRedraw: boolean;
66
+ serverData: {
67
+ [keys: string]: builderType.IServerData[];
68
+ };
63
69
  topGroup: JQuery<HTMLElement>;
64
70
  type: string;
65
71
  value: string[];
@@ -95,11 +101,22 @@ export default class Criteria {
95
101
  dom: IDom;
96
102
  c: builderType.IDefaults;
97
103
  s: IS;
98
- 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);
105
+ /**
106
+ * Escape html characters within a string
107
+ *
108
+ * @param txt the string to be escaped
109
+ * @returns the escaped string
110
+ */
111
+ private static _escapeHTML;
99
112
  /**
100
113
  * Default initialisation function for select conditions
101
114
  */
102
115
  private static initSelect;
116
+ /**
117
+ * Default initialisation function for select conditions
118
+ */
119
+ private static initSelectSSP;
103
120
  /**
104
121
  * Default initialisation function for select array conditions
105
122
  *
@@ -140,6 +157,13 @@ export default class Criteria {
140
157
  * Function that is run on each element as a call back when a search should be triggered
141
158
  */
142
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;
143
167
  static dateConditions: {
144
168
  [keys: string]: ICondition;
145
169
  };
@@ -165,7 +189,7 @@ export default class Criteria {
165
189
  /**
166
190
  * Adds the left button to the criteria
167
191
  */
168
- updateArrows(hasSiblings?: boolean, redraw?: boolean): void;
192
+ updateArrows(hasSiblings?: boolean): void;
169
193
  /**
170
194
  * Destroys the criteria, removing listeners and container from the dom
171
195
  */
@@ -201,10 +225,7 @@ export default class Criteria {
201
225
  * Sets the listeners for the criteria
202
226
  */
203
227
  setListeners(): void;
204
- /**
205
- * Adjusts the criteria to make SearchBuilder responsive
206
- */
207
- private _adjustCriteria;
228
+ setupButtons(): void;
208
229
  /**
209
230
  * Builds the elements of the dom together
210
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.0
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
  /**