@syncfusion/ej2-querybuilder 30.2.4 → 31.1.17
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/dist/ej2-querybuilder.min.js +2 -2
- package/dist/ej2-querybuilder.umd.min.js +2 -2
- package/dist/ej2-querybuilder.umd.min.js.map +1 -1
- package/dist/es6/ej2-querybuilder.es2015.js +10 -1
- package/dist/es6/ej2-querybuilder.es2015.js.map +1 -1
- package/dist/es6/ej2-querybuilder.es5.js +13 -4
- package/dist/es6/ej2-querybuilder.es5.js.map +1 -1
- package/dist/global/ej2-querybuilder.min.js +2 -2
- package/dist/global/ej2-querybuilder.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/dist/ts/index.d.ts +4 -0
- package/dist/ts/index.ts +4 -0
- package/dist/ts/query-builder/index.d.ts +6 -0
- package/dist/ts/query-builder/index.ts +6 -0
- package/dist/ts/query-builder/query-builder-model.d.ts +569 -0
- package/dist/ts/query-builder/query-builder.d.ts +1172 -0
- package/dist/ts/query-builder/query-builder.ts +7612 -0
- package/dist/ts/query-builder/query-library.d.ts +24 -0
- package/dist/ts/query-builder/query-library.ts +625 -0
- package/package.json +46 -14
- package/src/query-builder/query-builder.js +13 -4
|
@@ -0,0 +1,1172 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Query Builder Source
|
|
3
|
+
*/
|
|
4
|
+
import { Component, INotifyPropertyChanged, ModuleDeclaration } from '@syncfusion/ej2-base';
|
|
5
|
+
import { ChildProperty } from '@syncfusion/ej2-base';
|
|
6
|
+
import { QueryBuilderModel, ShowButtonsModel, ColumnsModel, RuleModel, ValueModel } from './query-builder-model';
|
|
7
|
+
import { RadioButtonModel } from '@syncfusion/ej2-buttons';
|
|
8
|
+
import { DropDownTreeModel } from '@syncfusion/ej2-dropdowns';
|
|
9
|
+
import { MultiSelectModel, DropDownListModel } from '@syncfusion/ej2-dropdowns';
|
|
10
|
+
import { EmitType, BaseEventArgs } from '@syncfusion/ej2-base';
|
|
11
|
+
import { Query, Predicate, DataManager } from '@syncfusion/ej2-data';
|
|
12
|
+
import { TextBoxModel, NumericTextBoxModel } from '@syncfusion/ej2-inputs';
|
|
13
|
+
import { DatePickerModel } from '@syncfusion/ej2-calendars';
|
|
14
|
+
/**
|
|
15
|
+
* Defines the Columns of Query Builder
|
|
16
|
+
*/
|
|
17
|
+
export declare class Columns extends ChildProperty<Columns> {
|
|
18
|
+
/**
|
|
19
|
+
* Specifies the fields in columns.
|
|
20
|
+
*
|
|
21
|
+
* @default null
|
|
22
|
+
*/
|
|
23
|
+
field: string;
|
|
24
|
+
/**
|
|
25
|
+
* Specifies the labels name in columns.
|
|
26
|
+
*
|
|
27
|
+
* @default null
|
|
28
|
+
*/
|
|
29
|
+
label: string;
|
|
30
|
+
/**
|
|
31
|
+
* Specifies the types in columns field.
|
|
32
|
+
*
|
|
33
|
+
* @default null
|
|
34
|
+
*/
|
|
35
|
+
type: string;
|
|
36
|
+
/**
|
|
37
|
+
* Specifies the values in columns or bind the values from sub controls.
|
|
38
|
+
*
|
|
39
|
+
* @default null
|
|
40
|
+
*/
|
|
41
|
+
values: string[] | number[] | boolean[];
|
|
42
|
+
/**
|
|
43
|
+
* Specifies the operators in columns.
|
|
44
|
+
*
|
|
45
|
+
* @default null
|
|
46
|
+
*/
|
|
47
|
+
operators: {
|
|
48
|
+
[key: string]: Object;
|
|
49
|
+
}[];
|
|
50
|
+
/**
|
|
51
|
+
* Specifies the rule template for the field with any other widgets.
|
|
52
|
+
*
|
|
53
|
+
* @default null
|
|
54
|
+
* @aspType string
|
|
55
|
+
*/
|
|
56
|
+
ruleTemplate: string | Function;
|
|
57
|
+
/**
|
|
58
|
+
* Specifies the template for value field such as slider or any other widgets.
|
|
59
|
+
*
|
|
60
|
+
* @default null
|
|
61
|
+
*/
|
|
62
|
+
template: TemplateColumn | string | Function;
|
|
63
|
+
/**
|
|
64
|
+
* Specifies the validation for columns (text, number and date).
|
|
65
|
+
*
|
|
66
|
+
* @default { isRequired: true , min: 0, max: Number.MAX_VALUE }
|
|
67
|
+
*/
|
|
68
|
+
validation: Validation;
|
|
69
|
+
/**
|
|
70
|
+
* Specifies the date format for columns.
|
|
71
|
+
*
|
|
72
|
+
* @aspType string
|
|
73
|
+
* @blazorType string
|
|
74
|
+
* @default null
|
|
75
|
+
*/
|
|
76
|
+
format: string | FormatObject;
|
|
77
|
+
/**
|
|
78
|
+
* Specifies the step value(numeric textbox) for columns.
|
|
79
|
+
*
|
|
80
|
+
* @default null
|
|
81
|
+
*/
|
|
82
|
+
step: number;
|
|
83
|
+
/**
|
|
84
|
+
* Specifies the default value for columns.
|
|
85
|
+
*
|
|
86
|
+
* @default null
|
|
87
|
+
*/
|
|
88
|
+
value: string[] | number[] | string | number | boolean | Date;
|
|
89
|
+
/**
|
|
90
|
+
* Specifies the category for columns.
|
|
91
|
+
*
|
|
92
|
+
* @default null
|
|
93
|
+
*/
|
|
94
|
+
category: string;
|
|
95
|
+
/**
|
|
96
|
+
* Specifies the sub fields in columns.
|
|
97
|
+
*
|
|
98
|
+
* @default null
|
|
99
|
+
*/
|
|
100
|
+
columns: ColumnsModel[];
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Defines the rule of Query Builder
|
|
104
|
+
*/
|
|
105
|
+
export declare class Rule extends ChildProperty<Rule> {
|
|
106
|
+
/**
|
|
107
|
+
* Specifies the condition value in group.
|
|
108
|
+
*
|
|
109
|
+
* @default null
|
|
110
|
+
*/
|
|
111
|
+
condition: string;
|
|
112
|
+
/**
|
|
113
|
+
* Specifies the rules in group.
|
|
114
|
+
*
|
|
115
|
+
* @default []
|
|
116
|
+
*/
|
|
117
|
+
rules: RuleModel[];
|
|
118
|
+
/**
|
|
119
|
+
* Specifies the field value in group.
|
|
120
|
+
*
|
|
121
|
+
* @default null
|
|
122
|
+
*/
|
|
123
|
+
field: string;
|
|
124
|
+
/**
|
|
125
|
+
* Specifies the label value in group.
|
|
126
|
+
*
|
|
127
|
+
* @default null
|
|
128
|
+
*/
|
|
129
|
+
label: string;
|
|
130
|
+
/**
|
|
131
|
+
* Specifies the type value in group.
|
|
132
|
+
*
|
|
133
|
+
* @default null
|
|
134
|
+
*/
|
|
135
|
+
type: string;
|
|
136
|
+
/**
|
|
137
|
+
* Specifies the operator value in group.
|
|
138
|
+
*
|
|
139
|
+
* @default null
|
|
140
|
+
*/
|
|
141
|
+
operator: string;
|
|
142
|
+
/**
|
|
143
|
+
* Specifies the sub controls value in group.
|
|
144
|
+
*
|
|
145
|
+
* @default null
|
|
146
|
+
*/
|
|
147
|
+
value: string[] | number[] | string | number | boolean;
|
|
148
|
+
/**
|
|
149
|
+
* Specifies whether not condition is true/false.
|
|
150
|
+
*
|
|
151
|
+
* @default false
|
|
152
|
+
*/
|
|
153
|
+
not: boolean;
|
|
154
|
+
/**
|
|
155
|
+
* Specifies whether rule is locked or not.
|
|
156
|
+
*
|
|
157
|
+
* @aspType bool?
|
|
158
|
+
* @default null
|
|
159
|
+
*/
|
|
160
|
+
isLocked: boolean;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Defines the property for value.
|
|
164
|
+
*/
|
|
165
|
+
export declare class Value extends ChildProperty<Value> {
|
|
166
|
+
/**
|
|
167
|
+
* Specifies the property for NumericTextBox value.
|
|
168
|
+
*
|
|
169
|
+
* @default null
|
|
170
|
+
*/
|
|
171
|
+
numericTextBoxModel: NumericTextBoxModel;
|
|
172
|
+
/**
|
|
173
|
+
* Specifies the property for MultiSelect value.
|
|
174
|
+
*
|
|
175
|
+
* @default null
|
|
176
|
+
*/
|
|
177
|
+
multiSelectModel: MultiSelectModel;
|
|
178
|
+
/**
|
|
179
|
+
* Specifies the property for DatePicker value.
|
|
180
|
+
*
|
|
181
|
+
* @default null
|
|
182
|
+
*/
|
|
183
|
+
datePickerModel: DatePickerModel;
|
|
184
|
+
/**
|
|
185
|
+
* Specifies the TextBox value.
|
|
186
|
+
*
|
|
187
|
+
* @default null
|
|
188
|
+
*/
|
|
189
|
+
textBoxModel: TextBoxModel;
|
|
190
|
+
/**
|
|
191
|
+
* Specifies the RadioButton value.
|
|
192
|
+
*
|
|
193
|
+
* @default null
|
|
194
|
+
*/
|
|
195
|
+
radioButtonModel: RadioButtonModel;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Defines the ruleDelete, groupInsert, and groupDelete options of Query Builder.
|
|
199
|
+
*/
|
|
200
|
+
export declare class ShowButtons extends ChildProperty<ShowButtons> {
|
|
201
|
+
/**
|
|
202
|
+
* Specifies the boolean value in ruleDelete that the enable/disable the buttons in rule.
|
|
203
|
+
*
|
|
204
|
+
* @default false
|
|
205
|
+
*/
|
|
206
|
+
cloneRule: boolean;
|
|
207
|
+
/**
|
|
208
|
+
* Specifies the boolean value in ruleDelete that the enable/disable the buttons in rule.
|
|
209
|
+
*
|
|
210
|
+
* @default false
|
|
211
|
+
*/
|
|
212
|
+
cloneGroup: boolean;
|
|
213
|
+
/**
|
|
214
|
+
* Specifies the boolean value in ruleDelete that the enable/disable the buttons in rule.
|
|
215
|
+
*
|
|
216
|
+
* @default false
|
|
217
|
+
*/
|
|
218
|
+
lockRule: boolean;
|
|
219
|
+
/**
|
|
220
|
+
* Specifies the boolean value in ruleDelete that the enable/disable the buttons in rule.
|
|
221
|
+
*
|
|
222
|
+
* @default false
|
|
223
|
+
*/
|
|
224
|
+
lockGroup: boolean;
|
|
225
|
+
/**
|
|
226
|
+
* Specifies the boolean value in ruleDelete that the enable/disable the buttons in rule.
|
|
227
|
+
*
|
|
228
|
+
* @default true
|
|
229
|
+
*/
|
|
230
|
+
ruleDelete: boolean;
|
|
231
|
+
/**
|
|
232
|
+
* Specifies the boolean value in groupInsert that the enable/disable the buttons in group.
|
|
233
|
+
*
|
|
234
|
+
* @default true
|
|
235
|
+
*/
|
|
236
|
+
groupInsert: boolean;
|
|
237
|
+
/**
|
|
238
|
+
* Specifies the boolean value in groupDelete that the enable/disable the buttons in group.
|
|
239
|
+
*
|
|
240
|
+
* @default true
|
|
241
|
+
*/
|
|
242
|
+
groupDelete: boolean;
|
|
243
|
+
}
|
|
244
|
+
export interface FormatObject {
|
|
245
|
+
/**
|
|
246
|
+
* Specifies the format in which the date format will process
|
|
247
|
+
*/
|
|
248
|
+
skeleton?: string;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Defines the fieldMode of Dropdown control.
|
|
252
|
+
* ```props
|
|
253
|
+
* Default :- To Specifies the fieldMode as DropDownList.
|
|
254
|
+
* DropdownTree :- To Specifies the fieldMode as DropdownTree.
|
|
255
|
+
* ```
|
|
256
|
+
*/
|
|
257
|
+
export declare type FieldMode =
|
|
258
|
+
/** Display the DropdownList */
|
|
259
|
+
'Default' |
|
|
260
|
+
/** Display the DropdownTree */
|
|
261
|
+
'DropdownTree';
|
|
262
|
+
/**
|
|
263
|
+
* Defines the display mode of the control.
|
|
264
|
+
* ```props
|
|
265
|
+
* Horizontal :- To display the control in a horizontal UI.
|
|
266
|
+
* Vertical :- To display the control in a vertical UI.
|
|
267
|
+
* ```
|
|
268
|
+
*/
|
|
269
|
+
export declare type DisplayMode =
|
|
270
|
+
/** Display the Horizontal UI */
|
|
271
|
+
'Horizontal' |
|
|
272
|
+
/** Display the Vertical UI */
|
|
273
|
+
'Vertical';
|
|
274
|
+
/**
|
|
275
|
+
* Defines the sorting direction of the field names in a control.
|
|
276
|
+
* ```props
|
|
277
|
+
* Default :- Specifies the field names in default sorting order.
|
|
278
|
+
* Ascending :- Specifies the field names in ascending order.
|
|
279
|
+
* Descending :- Specifies the field names in descending order.
|
|
280
|
+
* ```
|
|
281
|
+
*/
|
|
282
|
+
export declare type SortDirection =
|
|
283
|
+
/** Show the field names in default */
|
|
284
|
+
'Default' |
|
|
285
|
+
/** Show the field names in Ascending */
|
|
286
|
+
'Ascending' |
|
|
287
|
+
/** Show the field names in Descending */
|
|
288
|
+
'Descending';
|
|
289
|
+
export declare class QueryBuilder extends Component<HTMLDivElement> implements INotifyPropertyChanged {
|
|
290
|
+
private groupIdCounter;
|
|
291
|
+
private ruleIdCounter;
|
|
292
|
+
private subFilterCounter;
|
|
293
|
+
private btnGroupId;
|
|
294
|
+
private levelColl;
|
|
295
|
+
private isImportRules;
|
|
296
|
+
private isPublic;
|
|
297
|
+
private parser;
|
|
298
|
+
private defaultLocale;
|
|
299
|
+
private l10n;
|
|
300
|
+
private intl;
|
|
301
|
+
private items;
|
|
302
|
+
private customOperators;
|
|
303
|
+
private operators;
|
|
304
|
+
private sqlOperators;
|
|
305
|
+
private ruleElem;
|
|
306
|
+
private groupElem;
|
|
307
|
+
private dataColl;
|
|
308
|
+
private dataManager;
|
|
309
|
+
private selectedColumn;
|
|
310
|
+
private previousColumn;
|
|
311
|
+
private actionButton;
|
|
312
|
+
private isInitialLoad;
|
|
313
|
+
private timer;
|
|
314
|
+
private isReadonly;
|
|
315
|
+
private fields;
|
|
316
|
+
private columnTemplateFn;
|
|
317
|
+
private target;
|
|
318
|
+
private updatedRule;
|
|
319
|
+
private ruleTemplateFn;
|
|
320
|
+
private isLocale;
|
|
321
|
+
private isRefreshed;
|
|
322
|
+
private headerFn;
|
|
323
|
+
private subFieldElem;
|
|
324
|
+
private selectedRule;
|
|
325
|
+
private isNotified;
|
|
326
|
+
private isAddSuccess;
|
|
327
|
+
private isNotValueChange;
|
|
328
|
+
private isRoot;
|
|
329
|
+
private prevItemData;
|
|
330
|
+
private isFieldChange;
|
|
331
|
+
private isFieldClose;
|
|
332
|
+
private isDestroy;
|
|
333
|
+
private isGetNestedData;
|
|
334
|
+
private isCustomOprCols;
|
|
335
|
+
private dummyDropdownTreeDs;
|
|
336
|
+
private groupCounter;
|
|
337
|
+
private lockItems;
|
|
338
|
+
private groupIndex;
|
|
339
|
+
private ruleIndex;
|
|
340
|
+
private isLastGroup;
|
|
341
|
+
private cloneGrpBtnClick;
|
|
342
|
+
private isMiddleGroup;
|
|
343
|
+
private cloneRuleBtnClick;
|
|
344
|
+
private isNumInput;
|
|
345
|
+
private draggable;
|
|
346
|
+
private draggedRule;
|
|
347
|
+
private dragElement;
|
|
348
|
+
private prvtEvtTgrDaD;
|
|
349
|
+
private isDragEventPrevent;
|
|
350
|
+
private isValueEmpty;
|
|
351
|
+
private isPropChange;
|
|
352
|
+
private ddTree;
|
|
353
|
+
/**
|
|
354
|
+
* Triggers when the component is created.
|
|
355
|
+
*
|
|
356
|
+
* @event created
|
|
357
|
+
* @blazorProperty 'Created'
|
|
358
|
+
*/
|
|
359
|
+
created: EmitType<Event>;
|
|
360
|
+
/**
|
|
361
|
+
* Triggers when field, operator, value is change.
|
|
362
|
+
*
|
|
363
|
+
* @event actionBegin
|
|
364
|
+
* @blazorProperty 'OnActionBegin'
|
|
365
|
+
*/
|
|
366
|
+
actionBegin: EmitType<ActionEventArgs>;
|
|
367
|
+
/**
|
|
368
|
+
* Triggers before the condition (And/Or), field, operator, value is changed.
|
|
369
|
+
*
|
|
370
|
+
* @event beforeChange
|
|
371
|
+
* @blazorProperty 'OnValueChange'
|
|
372
|
+
*/
|
|
373
|
+
beforeChange: EmitType<ChangeEventArgs>;
|
|
374
|
+
/**
|
|
375
|
+
* Triggers when changing the condition(AND/OR), field, value, operator is changed.
|
|
376
|
+
*
|
|
377
|
+
* @event change
|
|
378
|
+
* @blazorProperty 'Changed'
|
|
379
|
+
*/
|
|
380
|
+
change: EmitType<ChangeEventArgs>;
|
|
381
|
+
/**
|
|
382
|
+
* Triggers when dataBound to the Query Builder.
|
|
383
|
+
*
|
|
384
|
+
* @event dataBound
|
|
385
|
+
* @blazorProperty 'dataBound'
|
|
386
|
+
*/
|
|
387
|
+
dataBound: EmitType<Object>;
|
|
388
|
+
/**
|
|
389
|
+
* Triggers when changing the condition(AND/OR), field, value, operator is changed
|
|
390
|
+
*
|
|
391
|
+
* @event ruleChange
|
|
392
|
+
* @blazorProperty 'RuleChanged'
|
|
393
|
+
*/
|
|
394
|
+
ruleChange: EmitType<RuleChangeEventArgs>;
|
|
395
|
+
/**
|
|
396
|
+
* Triggers when rule/ group dragging starts.
|
|
397
|
+
*
|
|
398
|
+
*
|
|
399
|
+
*/
|
|
400
|
+
dragStart: EmitType<DragEventArgs>;
|
|
401
|
+
/**
|
|
402
|
+
* Triggers when rule/ group are dragged (moved) continuously.
|
|
403
|
+
*
|
|
404
|
+
*
|
|
405
|
+
*/
|
|
406
|
+
drag: EmitType<DragEventArgs>;
|
|
407
|
+
/**
|
|
408
|
+
* Triggers when rule/ group are dropped on to the target rule/ group.
|
|
409
|
+
*
|
|
410
|
+
*
|
|
411
|
+
*/
|
|
412
|
+
drop: EmitType<DropEventArgs>;
|
|
413
|
+
/**
|
|
414
|
+
* Specifies the showButtons settings of the query builder component.
|
|
415
|
+
* The showButtons can be enable Enables or disables the ruleDelete, groupInsert, and groupDelete buttons.
|
|
416
|
+
*
|
|
417
|
+
* @default { ruleDelete: true , groupInsert: true, groupDelete: true }
|
|
418
|
+
*/
|
|
419
|
+
showButtons: ShowButtonsModel;
|
|
420
|
+
/**
|
|
421
|
+
* Shows or hides the filtered query.
|
|
422
|
+
*
|
|
423
|
+
* @default false
|
|
424
|
+
*/
|
|
425
|
+
summaryView: boolean;
|
|
426
|
+
/**
|
|
427
|
+
* Enables or disables the validation.
|
|
428
|
+
*
|
|
429
|
+
* @default false
|
|
430
|
+
*/
|
|
431
|
+
allowValidation: boolean;
|
|
432
|
+
/**
|
|
433
|
+
* Specifies the fieldMode as DropDownList or DropDownTree.
|
|
434
|
+
*
|
|
435
|
+
* @default 'Default'
|
|
436
|
+
*/
|
|
437
|
+
fieldMode: FieldMode;
|
|
438
|
+
/**
|
|
439
|
+
* Specifies columns to create filters.
|
|
440
|
+
*
|
|
441
|
+
* @default {}
|
|
442
|
+
*/
|
|
443
|
+
columns: ColumnsModel[];
|
|
444
|
+
/**
|
|
445
|
+
* Specifies the property for field.
|
|
446
|
+
*
|
|
447
|
+
* @default null
|
|
448
|
+
*/
|
|
449
|
+
fieldModel: DropDownListModel | DropDownTreeModel;
|
|
450
|
+
/**
|
|
451
|
+
* Specifies the property for operator.
|
|
452
|
+
*
|
|
453
|
+
* @default null
|
|
454
|
+
*/
|
|
455
|
+
operatorModel: DropDownListModel;
|
|
456
|
+
/**
|
|
457
|
+
* Specifies the property for value.
|
|
458
|
+
*
|
|
459
|
+
* @default null
|
|
460
|
+
*/
|
|
461
|
+
valueModel: ValueModel;
|
|
462
|
+
/**
|
|
463
|
+
* Specifies the template for the header with any other widgets.
|
|
464
|
+
*
|
|
465
|
+
* @default null
|
|
466
|
+
* @aspType string
|
|
467
|
+
*/
|
|
468
|
+
headerTemplate: string | Function;
|
|
469
|
+
/**
|
|
470
|
+
* Defines class or multiple classes, which are separated by a space in the QueryBuilder element.
|
|
471
|
+
* You can add custom styles to the QueryBuilder using the cssClass property.
|
|
472
|
+
*
|
|
473
|
+
* @default ''
|
|
474
|
+
*/
|
|
475
|
+
cssClass: string;
|
|
476
|
+
/**
|
|
477
|
+
* Binds the column name from data source in query-builder.
|
|
478
|
+
* The `dataSource` is an array of JavaScript objects.
|
|
479
|
+
*
|
|
480
|
+
* @default []
|
|
481
|
+
*/
|
|
482
|
+
dataSource: Object[] | Object | DataManager;
|
|
483
|
+
/**
|
|
484
|
+
* Specifies the displayMode as Horizontal or Vertical.
|
|
485
|
+
*
|
|
486
|
+
* @default 'Horizontal'
|
|
487
|
+
*/
|
|
488
|
+
displayMode: DisplayMode;
|
|
489
|
+
/**
|
|
490
|
+
* Enable or disable persisting component's state between page reloads.
|
|
491
|
+
* If enabled, filter states will be persisted.
|
|
492
|
+
*
|
|
493
|
+
* @default false.
|
|
494
|
+
*/
|
|
495
|
+
enablePersistence: boolean;
|
|
496
|
+
/**
|
|
497
|
+
* Specifies the sort direction of the field names.
|
|
498
|
+
*
|
|
499
|
+
* @default 'Default'
|
|
500
|
+
*/
|
|
501
|
+
sortDirection: SortDirection;
|
|
502
|
+
/**
|
|
503
|
+
* Specifies the maximum group count or restricts the group count.
|
|
504
|
+
*
|
|
505
|
+
* @default 5
|
|
506
|
+
*/
|
|
507
|
+
maxGroupCount: number;
|
|
508
|
+
/**
|
|
509
|
+
* Specifies the height of the query builder.
|
|
510
|
+
*
|
|
511
|
+
* @default 'auto'
|
|
512
|
+
*/
|
|
513
|
+
height: string;
|
|
514
|
+
/**
|
|
515
|
+
* Specifies the width of the query builder.
|
|
516
|
+
*
|
|
517
|
+
* @default 'auto'
|
|
518
|
+
*/
|
|
519
|
+
width: string;
|
|
520
|
+
/**
|
|
521
|
+
* If match case is set to true, the grid filters the records with exact match.
|
|
522
|
+
* if false, it filters case insensitive records (uppercase and lowercase letters treated the same).
|
|
523
|
+
*
|
|
524
|
+
* @default false
|
|
525
|
+
*/
|
|
526
|
+
matchCase: boolean;
|
|
527
|
+
/**
|
|
528
|
+
* If immediateModeDelay is set by particular number, the rule Change event is triggered after that period.
|
|
529
|
+
*
|
|
530
|
+
* @default 0
|
|
531
|
+
*/
|
|
532
|
+
immediateModeDelay: number;
|
|
533
|
+
/**
|
|
534
|
+
* Enables/Disables the not group condition in query builder.
|
|
535
|
+
*
|
|
536
|
+
* @default false
|
|
537
|
+
*/
|
|
538
|
+
enableNotCondition: boolean;
|
|
539
|
+
/**
|
|
540
|
+
* When set to true, the user interactions on the component are disabled.
|
|
541
|
+
*
|
|
542
|
+
* @default false
|
|
543
|
+
*/
|
|
544
|
+
readonly: boolean;
|
|
545
|
+
/**
|
|
546
|
+
* Specifies a boolean value whether enable / disable the new rule adding while adding new groups.
|
|
547
|
+
*
|
|
548
|
+
* @remarks
|
|
549
|
+
* If this property is true, the empty rule is inserted while inserting new group.
|
|
550
|
+
* If set to false, the group is inserted without any rule.
|
|
551
|
+
* @default true
|
|
552
|
+
*/
|
|
553
|
+
addRuleToNewGroups: boolean;
|
|
554
|
+
/**
|
|
555
|
+
* Specifies a boolean value whether enable / disable the auto selection with the first value for the field.
|
|
556
|
+
*
|
|
557
|
+
* @remarks
|
|
558
|
+
* If this property is true, the field dropdown list will render with the first value of the dropdown list.
|
|
559
|
+
* If set to false, the dropdown list render with placeholder.
|
|
560
|
+
* @default false
|
|
561
|
+
*/
|
|
562
|
+
autoSelectField: boolean;
|
|
563
|
+
/**
|
|
564
|
+
* Specifies a boolean value whether enable / disable the auto selection with the first value for the operator.
|
|
565
|
+
*
|
|
566
|
+
* @remarks
|
|
567
|
+
* If this property is true, the operator dropdown list will render with the first value of the dropdown list.
|
|
568
|
+
* If set to false, the dropdown list render with placeholder.
|
|
569
|
+
* @default true
|
|
570
|
+
*/
|
|
571
|
+
autoSelectOperator: boolean;
|
|
572
|
+
/**
|
|
573
|
+
* Specifies the separator string for column.
|
|
574
|
+
*
|
|
575
|
+
* @default ''
|
|
576
|
+
*/
|
|
577
|
+
separator: string;
|
|
578
|
+
/**
|
|
579
|
+
* Specifies whether to enable separate connectors between rules/groups.
|
|
580
|
+
*
|
|
581
|
+
* @remarks
|
|
582
|
+
* When this property is set to true, each rule/group will have its own connector, allowing them to be connected independently with different connectors.
|
|
583
|
+
* When set to false, will result in connectors being shared between rules/groups, possibly connecting them with the same connector.
|
|
584
|
+
*
|
|
585
|
+
* @default false
|
|
586
|
+
*
|
|
587
|
+
*/
|
|
588
|
+
enableSeparateConnector: boolean;
|
|
589
|
+
/**
|
|
590
|
+
* Defines rules in the QueryBuilder.
|
|
591
|
+
* Specifies the initial rule, which is JSON data.
|
|
592
|
+
*
|
|
593
|
+
* @default {}
|
|
594
|
+
*/
|
|
595
|
+
rule: RuleModel;
|
|
596
|
+
/**
|
|
597
|
+
* Specifies a boolean value whether to enable / disable the drag and drop support to move the rules/ groups.
|
|
598
|
+
*
|
|
599
|
+
* @remarks
|
|
600
|
+
* If this property is true, the drag handle will be rendered in front of the rule/ group element to perform, drag and drop.
|
|
601
|
+
* If set to false, the drag handle element is not rendered.
|
|
602
|
+
* @default false
|
|
603
|
+
*/
|
|
604
|
+
allowDragAndDrop: boolean;
|
|
605
|
+
constructor(options?: QueryBuilderModel, element?: string | HTMLDivElement);
|
|
606
|
+
protected getPersistData(): string;
|
|
607
|
+
/**
|
|
608
|
+
* Clears the rules without root rule.
|
|
609
|
+
*
|
|
610
|
+
* @returns {void}.
|
|
611
|
+
*/
|
|
612
|
+
reset(): void;
|
|
613
|
+
private getWrapper;
|
|
614
|
+
protected getModuleName(): string;
|
|
615
|
+
requiredModules(): ModuleDeclaration[];
|
|
616
|
+
private GetRootColumnName;
|
|
617
|
+
private initialize;
|
|
618
|
+
private processColumnsInBatches;
|
|
619
|
+
private updateSubFieldsFromColumns;
|
|
620
|
+
private updateSubFieldsLarge;
|
|
621
|
+
private updateSubFields;
|
|
622
|
+
private updateCustomOperator;
|
|
623
|
+
private focusEventHandler;
|
|
624
|
+
private clickEventHandler;
|
|
625
|
+
private beforeSuccessCallBack;
|
|
626
|
+
private selectBtn;
|
|
627
|
+
private appendRuleElem;
|
|
628
|
+
private addRuleElement;
|
|
629
|
+
private addRuleSuccessCallBack;
|
|
630
|
+
private processAdjacentElements;
|
|
631
|
+
private handleOrphanedRuleElement;
|
|
632
|
+
private processConnectorElements;
|
|
633
|
+
private handleOrphanedConnectorElement;
|
|
634
|
+
private applyFieldComponent;
|
|
635
|
+
private applyDropdownListComponent;
|
|
636
|
+
private applyDropdownTreeComponent;
|
|
637
|
+
private dropdownTreeFiltering;
|
|
638
|
+
private changeDataSource;
|
|
639
|
+
private nestedChildFilter;
|
|
640
|
+
private isMatchedNode;
|
|
641
|
+
private dropdownTreeClose;
|
|
642
|
+
private updateDropdowntreeDS;
|
|
643
|
+
private updateAddedRule;
|
|
644
|
+
private changeRuleTemplate;
|
|
645
|
+
private renderToolTip;
|
|
646
|
+
/**
|
|
647
|
+
* Validate the conditions and it display errors for invalid fields.
|
|
648
|
+
*
|
|
649
|
+
* @returns {boolean} - Validation
|
|
650
|
+
*/
|
|
651
|
+
validateFields(): boolean;
|
|
652
|
+
private refreshLevelColl;
|
|
653
|
+
private refreshLevel;
|
|
654
|
+
private groupTemplate;
|
|
655
|
+
private ruleTemplate;
|
|
656
|
+
private addGroupElement;
|
|
657
|
+
private addGroupSuccess;
|
|
658
|
+
private setMultiConnector;
|
|
659
|
+
private addHeaderDiv;
|
|
660
|
+
private headerTemplateFn;
|
|
661
|
+
private enableSeparateConnectorInitialRule;
|
|
662
|
+
/**
|
|
663
|
+
* Notify the changes to component.
|
|
664
|
+
*
|
|
665
|
+
* @param {string | number | boolean | Date | string[] | number[] | Date[]} value - 'value' to be passed to update the rule value.
|
|
666
|
+
* @param {Element} element - 'element' to be passed to update the rule.
|
|
667
|
+
* @param {string} type - 'type' to be passed to update the rule .
|
|
668
|
+
* @returns {void}.
|
|
669
|
+
*/
|
|
670
|
+
notifyChange(value: string | number | boolean | Date | string[] | number[] | Date[], element: Element, type?: string): void;
|
|
671
|
+
private templateChange;
|
|
672
|
+
private changeValue;
|
|
673
|
+
private filterValue;
|
|
674
|
+
private changeValueSuccessCallBack;
|
|
675
|
+
private fieldClose;
|
|
676
|
+
private changeField;
|
|
677
|
+
private changeRule;
|
|
678
|
+
private changeFilter;
|
|
679
|
+
private changeOperator;
|
|
680
|
+
private fieldChangeSuccess;
|
|
681
|
+
private destroySubFields;
|
|
682
|
+
private createSubFields;
|
|
683
|
+
private operatorChangeSuccess;
|
|
684
|
+
private changeRuleValues;
|
|
685
|
+
private popupOpen;
|
|
686
|
+
private destroyControls;
|
|
687
|
+
private templateDestroy;
|
|
688
|
+
/**
|
|
689
|
+
* Return values bound to the column.
|
|
690
|
+
*
|
|
691
|
+
* @param {string} field - 'field' to be passed to get the field values.
|
|
692
|
+
* @returns {object[]} - Values bound to the column
|
|
693
|
+
*/
|
|
694
|
+
getValues(field: string): object[];
|
|
695
|
+
private createNestedObject;
|
|
696
|
+
private getDistinctValues;
|
|
697
|
+
private renderMultiSelect;
|
|
698
|
+
private multiSelectOpen;
|
|
699
|
+
private bindMultiSelectData;
|
|
700
|
+
private getMultiSelectData;
|
|
701
|
+
private createSpinner;
|
|
702
|
+
private closePopup;
|
|
703
|
+
private processTemplate;
|
|
704
|
+
private getItemData;
|
|
705
|
+
private setDefaultValue;
|
|
706
|
+
private renderStringValue;
|
|
707
|
+
private renderNumberValue;
|
|
708
|
+
private processValueString;
|
|
709
|
+
private parseDate;
|
|
710
|
+
private renderControls;
|
|
711
|
+
private processBoolValues;
|
|
712
|
+
private getOperatorIndex;
|
|
713
|
+
private getPreviousItemData;
|
|
714
|
+
private renderValues;
|
|
715
|
+
private setColumnTemplate;
|
|
716
|
+
private actionBeginSuccessCallBack;
|
|
717
|
+
private updateValues;
|
|
718
|
+
private updateRules;
|
|
719
|
+
private filterRules;
|
|
720
|
+
private ruleValueUpdate;
|
|
721
|
+
private validateValue;
|
|
722
|
+
private getFormat;
|
|
723
|
+
private findGroupByIdx;
|
|
724
|
+
/**
|
|
725
|
+
* Removes the component from the DOM and detaches all its related event handlers.
|
|
726
|
+
* Also it maintains the initial input element from the DOM.
|
|
727
|
+
*
|
|
728
|
+
* @method destroy
|
|
729
|
+
* @returns {void}
|
|
730
|
+
*/
|
|
731
|
+
destroy(): void;
|
|
732
|
+
/**
|
|
733
|
+
* Adds single or multiple rules.
|
|
734
|
+
*
|
|
735
|
+
* @param {RuleModel[]} rule - 'rule collection' to be passed to add the rules.
|
|
736
|
+
* @param {string} groupID - 'group id' to be passed to add the rule in groups.
|
|
737
|
+
* @returns {void}.
|
|
738
|
+
*/
|
|
739
|
+
addRules(rule: RuleModel[], groupID: string): void;
|
|
740
|
+
/**
|
|
741
|
+
* Adds single or multiple groups, which contains the collection of rules.
|
|
742
|
+
*
|
|
743
|
+
* @param {RuleModel[]} groups - 'group collection' to be passed to add the groups.
|
|
744
|
+
* @param {string} groupID - 'group id' to be passed to add the groups.
|
|
745
|
+
* @returns {void}.
|
|
746
|
+
*/
|
|
747
|
+
addGroups(groups: RuleModel[], groupID: string): void;
|
|
748
|
+
private initWrapper;
|
|
749
|
+
private renderSummary;
|
|
750
|
+
private renderSummaryCollapse;
|
|
751
|
+
private columnSort;
|
|
752
|
+
private onChangeNotGroup;
|
|
753
|
+
private notGroupRtl;
|
|
754
|
+
private checkNotGroup;
|
|
755
|
+
onPropertyChanged(newProp: QueryBuilderModel, oldProp: QueryBuilderModel): void;
|
|
756
|
+
protected preRender(): void;
|
|
757
|
+
protected render(): void;
|
|
758
|
+
private initializeDrag;
|
|
759
|
+
private helper;
|
|
760
|
+
private dragStartHandler;
|
|
761
|
+
private dragHandler;
|
|
762
|
+
private dragStopHandler;
|
|
763
|
+
private templateParser;
|
|
764
|
+
private executeDataManager;
|
|
765
|
+
private initControl;
|
|
766
|
+
protected wireEvents(): void;
|
|
767
|
+
protected unWireEvents(): void;
|
|
768
|
+
private getParentGroup;
|
|
769
|
+
/**
|
|
770
|
+
* Delete the Group
|
|
771
|
+
*
|
|
772
|
+
* @param {Element | string} target - 'target' to be passed to delete the group.
|
|
773
|
+
* @returns {void}
|
|
774
|
+
*/
|
|
775
|
+
deleteGroup(target: Element | string): void;
|
|
776
|
+
private deleteGroupSuccessCallBack;
|
|
777
|
+
private isPlatformTemplate;
|
|
778
|
+
private deleteRule;
|
|
779
|
+
private deleteRuleSuccessCallBack;
|
|
780
|
+
private setGroupRules;
|
|
781
|
+
private keyBoardHandler;
|
|
782
|
+
private windowResizeHandler;
|
|
783
|
+
private clearQBTemplate;
|
|
784
|
+
private disableRuleCondition;
|
|
785
|
+
/**
|
|
786
|
+
* Get the valid rule or rules collection.
|
|
787
|
+
*
|
|
788
|
+
* @param {RuleModel} currentRule - 'currentRule' to be passed to get the valid rules.
|
|
789
|
+
* @returns {RuleModel} - Valid rule or rules collection
|
|
790
|
+
*/
|
|
791
|
+
getValidRules(currentRule?: RuleModel): RuleModel;
|
|
792
|
+
private getRuleCollection;
|
|
793
|
+
/**
|
|
794
|
+
* Set the rule or rules collection.
|
|
795
|
+
*
|
|
796
|
+
* @param {RuleModel} rule - 'rule' to be passed to set rules.
|
|
797
|
+
* @returns {void}.
|
|
798
|
+
*/
|
|
799
|
+
setRules(rule: RuleModel): void;
|
|
800
|
+
/**
|
|
801
|
+
* Gets the rule or rule collection.
|
|
802
|
+
*
|
|
803
|
+
* @returns {object} - Rule or rule collection
|
|
804
|
+
*/
|
|
805
|
+
getRules(): RuleModel;
|
|
806
|
+
/**
|
|
807
|
+
* Gets the rule.
|
|
808
|
+
*
|
|
809
|
+
* @param {string | HTMLElement} elem - 'elem' to be passed to get rule.
|
|
810
|
+
* @returns {object} - Rule
|
|
811
|
+
*/
|
|
812
|
+
getRule(elem: string | HTMLElement): RuleModel;
|
|
813
|
+
/**
|
|
814
|
+
* Gets the group.
|
|
815
|
+
*
|
|
816
|
+
* @param {string | Element} target - 'target' to be passed to get group.
|
|
817
|
+
* @returns {object} -Group
|
|
818
|
+
*/
|
|
819
|
+
getGroup(target: Element | string): RuleModel;
|
|
820
|
+
/**
|
|
821
|
+
* Deletes the group or groups based on the group ID.
|
|
822
|
+
*
|
|
823
|
+
* @param {string[]} groupIdColl - 'groupIdColl' to be passed to delete groups.
|
|
824
|
+
* @returns {void}
|
|
825
|
+
*/
|
|
826
|
+
deleteGroups(groupIdColl: string[]): void;
|
|
827
|
+
/**
|
|
828
|
+
* Return the Query from current rules collection.
|
|
829
|
+
*
|
|
830
|
+
* @returns {Promise} - Query from current rules collection
|
|
831
|
+
* @blazorType object
|
|
832
|
+
*/
|
|
833
|
+
getFilteredRecords(): Promise<Object> | object;
|
|
834
|
+
/**
|
|
835
|
+
* Deletes the rule or rules based on the rule ID.
|
|
836
|
+
*
|
|
837
|
+
* @param {string[]} ruleIdColl - 'ruleIdColl' to be passed to delete rules.
|
|
838
|
+
* @returns {void}.
|
|
839
|
+
*/
|
|
840
|
+
deleteRules(ruleIdColl: string[]): void;
|
|
841
|
+
/**
|
|
842
|
+
* Gets the query for Data Manager.
|
|
843
|
+
*
|
|
844
|
+
* @param {RuleModel} rule - 'rule' to be passed to get query.
|
|
845
|
+
* @returns {string} - Query for Data Manager
|
|
846
|
+
*/
|
|
847
|
+
getDataManagerQuery(rule: RuleModel): Query;
|
|
848
|
+
/**
|
|
849
|
+
* Get the predicate from collection of rules.
|
|
850
|
+
*
|
|
851
|
+
* @param {RuleModel} rule - 'rule' to be passed to get predicate.
|
|
852
|
+
* @returns {Predicate} - Predicate from collection of rules
|
|
853
|
+
*/
|
|
854
|
+
getPredicate(rule: RuleModel): Predicate;
|
|
855
|
+
private getLocale;
|
|
856
|
+
private getColumn;
|
|
857
|
+
/**
|
|
858
|
+
* Return the operator bound to the column.
|
|
859
|
+
*
|
|
860
|
+
* @returns {[key: string]: Object}[] - Operator bound to the column
|
|
861
|
+
*/
|
|
862
|
+
getOperators(field: string): {
|
|
863
|
+
[key: string]: Object;
|
|
864
|
+
}[];
|
|
865
|
+
private setTime;
|
|
866
|
+
private datePredicate;
|
|
867
|
+
private arrayPredicate;
|
|
868
|
+
private getDate;
|
|
869
|
+
private isTime;
|
|
870
|
+
private importRules;
|
|
871
|
+
private renderGroup;
|
|
872
|
+
private renderRule;
|
|
873
|
+
private enableReadonly;
|
|
874
|
+
private enableBtnGroup;
|
|
875
|
+
private isDateFunction;
|
|
876
|
+
private getSqlString;
|
|
877
|
+
/**
|
|
878
|
+
* Sets the rules from the sql query.
|
|
879
|
+
*
|
|
880
|
+
* @param {string} sqlString - 'sql String' to be passed to set the rule.
|
|
881
|
+
* @param {boolean} sqlLocale - Optional. Set `true` if Localization for Sql query.
|
|
882
|
+
* @returns {void}
|
|
883
|
+
*/
|
|
884
|
+
setRulesFromSql(sqlString: string, sqlLocale?: boolean): void;
|
|
885
|
+
/**
|
|
886
|
+
* Get the rules from SQL query.
|
|
887
|
+
*
|
|
888
|
+
* @param {string} sqlString - 'sql String' to be passed to get the rule.
|
|
889
|
+
* @param {boolean} sqlLocale - Set `true` if Localization for Sql query.
|
|
890
|
+
* @returns {object} - Rules from SQL query
|
|
891
|
+
*/
|
|
892
|
+
getRulesFromSql(sqlString: string, sqlLocale?: boolean): RuleModel;
|
|
893
|
+
/**
|
|
894
|
+
* Gets the sql query from rules.
|
|
895
|
+
*
|
|
896
|
+
* @param {RuleModel} rule - 'rule' to be passed to get the sql.
|
|
897
|
+
* @param {boolean} allowEscape - Set `true` if it exclude the escape character.
|
|
898
|
+
* @param {boolean} sqlLocale - Set `true` if Localization for Sql query.
|
|
899
|
+
* @returns {string} - Sql query from rules.
|
|
900
|
+
*/
|
|
901
|
+
getSqlFromRules(rule?: RuleModel, allowEscape?: boolean, sqlLocale?: boolean): string;
|
|
902
|
+
/**
|
|
903
|
+
* Gets the parameter SQL query from rules.
|
|
904
|
+
*
|
|
905
|
+
* @param {RuleModel} rule – Specify the rule to be passed to get the parameter sql string.
|
|
906
|
+
* @returns {ParameterizedSql} – Parameterized SQL query from rules.
|
|
907
|
+
*/
|
|
908
|
+
getParameterizedSql(rule?: RuleModel): ParameterizedSql;
|
|
909
|
+
/**
|
|
910
|
+
* Sets the rules from the parameter sql query.
|
|
911
|
+
*
|
|
912
|
+
* @param { ParameterizedSql} sqlQuery – Specifies the parameter SQL to be passed to set the rule and load it to the query builder.
|
|
913
|
+
* @returns {void}
|
|
914
|
+
*/
|
|
915
|
+
setParameterizedSql(sqlQuery: ParameterizedSql): void;
|
|
916
|
+
/**
|
|
917
|
+
* Gets the named parameter SQL query from rules.
|
|
918
|
+
*
|
|
919
|
+
* @param {RuleModel} rule – Specify the rule to be passed to get the named parameter SQL string.
|
|
920
|
+
* @returns {ParameterizedNamedSql} – Parameterized Named SQL query from rules.
|
|
921
|
+
*/
|
|
922
|
+
getParameterizedNamedSql(rule?: RuleModel): ParameterizedNamedSql;
|
|
923
|
+
/**
|
|
924
|
+
* Sets the rules from the named parameter SQL query.
|
|
925
|
+
*
|
|
926
|
+
* @param { ParameterizedNamedSql } sqlQuery – Specifies the named parameter SQL to be passed to set the rule and load it to the query builder.
|
|
927
|
+
* @returns {void}
|
|
928
|
+
*/
|
|
929
|
+
setParameterizedNamedSql(sqlQuery: ParameterizedNamedSql): void;
|
|
930
|
+
/**
|
|
931
|
+
* Set the rules from Mongo query.
|
|
932
|
+
*
|
|
933
|
+
* @param {string} mongoQuery - 'sql String' to be passed to get the rule.
|
|
934
|
+
* @param {boolean} mongoLocale - Set `true` if Localization for Mongo query.
|
|
935
|
+
* @returns {void}
|
|
936
|
+
*/
|
|
937
|
+
setMongoQuery(mongoQuery: string, mongoLocale?: boolean): void;
|
|
938
|
+
/**
|
|
939
|
+
* Gets the Mongo query from rules.
|
|
940
|
+
*
|
|
941
|
+
* @param {RuleModel} rule - 'rule' to be passed to get the sql.
|
|
942
|
+
* @returns {object} - Sql query from rules.
|
|
943
|
+
*/
|
|
944
|
+
getMongoQuery(rule?: RuleModel): string;
|
|
945
|
+
/**
|
|
946
|
+
* Clones the rule based on the rule ID to the specific group.
|
|
947
|
+
*
|
|
948
|
+
* @param {string} ruleID - Specifies the ruleID that needs to be cloned.
|
|
949
|
+
* @param {string} groupID - Specifies the groupID in which the rule to be cloned.
|
|
950
|
+
* @param {number} index - Specifies the index to insert the cloned rule inside the group.
|
|
951
|
+
* @returns {void}
|
|
952
|
+
*/
|
|
953
|
+
cloneRule(ruleID: string, groupID: string, index: number): void;
|
|
954
|
+
/**
|
|
955
|
+
* Clones the group based on the group ID to the specific group.
|
|
956
|
+
*
|
|
957
|
+
* @param {string} groupID - Specifies the groupID that needs to be cloned.
|
|
958
|
+
* @param {string} parentGroupID - Specifies the parentGroupID in which the group to be cloned.
|
|
959
|
+
* @param {number} index - Specifies the index to insert the cloned group inside the parent group.
|
|
960
|
+
* @returns {void}
|
|
961
|
+
*/
|
|
962
|
+
cloneGroup(groupID: string, parentGroupID: string, index: number): void;
|
|
963
|
+
/**
|
|
964
|
+
* Locks the rule based on the rule ID.
|
|
965
|
+
*
|
|
966
|
+
* @param {string} ruleID - Specifies the ruleID that needs to be locked.
|
|
967
|
+
* @returns {void}
|
|
968
|
+
*/
|
|
969
|
+
lockRule(ruleID: string): void;
|
|
970
|
+
/**
|
|
971
|
+
* Locks the group based on the group ID
|
|
972
|
+
*
|
|
973
|
+
* @param {string} groupID - Specifies the groupID that needs to be locked.
|
|
974
|
+
* @returns {void}
|
|
975
|
+
*/
|
|
976
|
+
lockGroup(groupID: string): void;
|
|
977
|
+
private sqlParser;
|
|
978
|
+
private parseSqlStrings;
|
|
979
|
+
private getDoubleQuoteString;
|
|
980
|
+
private checkCondition;
|
|
981
|
+
private getSingleQuoteString;
|
|
982
|
+
private combineSingleQuoteString;
|
|
983
|
+
private checkLiteral;
|
|
984
|
+
private checkNumberLiteral;
|
|
985
|
+
private getOperator;
|
|
986
|
+
private getTypeFromColumn;
|
|
987
|
+
private getLabelFromColumn;
|
|
988
|
+
private getLabelFromField;
|
|
989
|
+
private processParser;
|
|
990
|
+
/**
|
|
991
|
+
* Clone the Group
|
|
992
|
+
*
|
|
993
|
+
* @param {Element | string} target - 'target' to be passed to clone the group.
|
|
994
|
+
* @returns {void}
|
|
995
|
+
*/
|
|
996
|
+
private groupClone;
|
|
997
|
+
private ruleClone;
|
|
998
|
+
private ruleLock;
|
|
999
|
+
private groupLock;
|
|
1000
|
+
private updateLockItems;
|
|
1001
|
+
private disableHeaderControls;
|
|
1002
|
+
private disableRuleControls;
|
|
1003
|
+
}
|
|
1004
|
+
export interface Level {
|
|
1005
|
+
[key: string]: number[];
|
|
1006
|
+
}
|
|
1007
|
+
/**
|
|
1008
|
+
* Creates the custom component of Query Builder
|
|
1009
|
+
*/
|
|
1010
|
+
export interface TemplateColumn {
|
|
1011
|
+
/**
|
|
1012
|
+
* Creates the custom component.
|
|
1013
|
+
*
|
|
1014
|
+
* @default null
|
|
1015
|
+
*/
|
|
1016
|
+
create?: Element | Function | string;
|
|
1017
|
+
/**
|
|
1018
|
+
* Wire events for the custom component.
|
|
1019
|
+
*
|
|
1020
|
+
* @default null
|
|
1021
|
+
*/
|
|
1022
|
+
write?: void | Function | string;
|
|
1023
|
+
/**
|
|
1024
|
+
* Destroy the custom component.
|
|
1025
|
+
*
|
|
1026
|
+
* @default null
|
|
1027
|
+
*/
|
|
1028
|
+
destroy?: Function | string;
|
|
1029
|
+
}
|
|
1030
|
+
/**
|
|
1031
|
+
* Defines the validation of Query Builder.
|
|
1032
|
+
*/
|
|
1033
|
+
export interface Validation {
|
|
1034
|
+
/**
|
|
1035
|
+
* Specifies the minimum value in textbox validation.
|
|
1036
|
+
*
|
|
1037
|
+
* @default 2
|
|
1038
|
+
*/
|
|
1039
|
+
min?: number;
|
|
1040
|
+
/**
|
|
1041
|
+
* Specifies the maximum value in textbox validation.
|
|
1042
|
+
*
|
|
1043
|
+
* @default 10
|
|
1044
|
+
*/
|
|
1045
|
+
max?: number;
|
|
1046
|
+
/**
|
|
1047
|
+
* Specifies whether the value is required or not
|
|
1048
|
+
*
|
|
1049
|
+
* @default true
|
|
1050
|
+
*/
|
|
1051
|
+
isRequired: boolean;
|
|
1052
|
+
}
|
|
1053
|
+
/**
|
|
1054
|
+
* Interface for change event.
|
|
1055
|
+
*/
|
|
1056
|
+
export interface ChangeEventArgs extends BaseEventArgs {
|
|
1057
|
+
groupID: string;
|
|
1058
|
+
ruleID?: string;
|
|
1059
|
+
childGroupID?: string;
|
|
1060
|
+
value?: string | number | Date | boolean | string[];
|
|
1061
|
+
selectedIndex?: number;
|
|
1062
|
+
selectedField?: string;
|
|
1063
|
+
cancel?: boolean;
|
|
1064
|
+
type?: string;
|
|
1065
|
+
not?: boolean;
|
|
1066
|
+
}
|
|
1067
|
+
/**
|
|
1068
|
+
* Interface for rule change event arguments.
|
|
1069
|
+
*/
|
|
1070
|
+
export interface RuleChangeEventArgs extends BaseEventArgs {
|
|
1071
|
+
previousRule?: RuleModel;
|
|
1072
|
+
rule: RuleModel;
|
|
1073
|
+
type?: string;
|
|
1074
|
+
}
|
|
1075
|
+
/**
|
|
1076
|
+
* Interface for action begin and action complete event args
|
|
1077
|
+
*/
|
|
1078
|
+
export interface ActionEventArgs extends BaseEventArgs {
|
|
1079
|
+
ruleID: string;
|
|
1080
|
+
requestType?: string;
|
|
1081
|
+
action?: string;
|
|
1082
|
+
rule?: RuleModel;
|
|
1083
|
+
fields?: Object;
|
|
1084
|
+
columns?: ColumnsModel[];
|
|
1085
|
+
operators?: {
|
|
1086
|
+
[key: string]: Object;
|
|
1087
|
+
}[];
|
|
1088
|
+
operatorFields?: Object;
|
|
1089
|
+
field?: string;
|
|
1090
|
+
operator?: string;
|
|
1091
|
+
condition?: string;
|
|
1092
|
+
notCondition?: boolean;
|
|
1093
|
+
renderTemplate?: boolean;
|
|
1094
|
+
groupID?: string;
|
|
1095
|
+
}
|
|
1096
|
+
/**
|
|
1097
|
+
* Interface to define the parameter SQL query.
|
|
1098
|
+
*
|
|
1099
|
+
*/
|
|
1100
|
+
export interface ParameterizedSql {
|
|
1101
|
+
/**
|
|
1102
|
+
* Specifies the SQL `WHERE` clause with `?` placeholders for each value.
|
|
1103
|
+
*/
|
|
1104
|
+
sql: string;
|
|
1105
|
+
/**
|
|
1106
|
+
* Specifies the parameter values in the same order their respective placeholders appear in the `sql` string.
|
|
1107
|
+
*/
|
|
1108
|
+
params: object[];
|
|
1109
|
+
}
|
|
1110
|
+
/**
|
|
1111
|
+
* Interface to define the parameterized named SQL query.
|
|
1112
|
+
*
|
|
1113
|
+
*/
|
|
1114
|
+
export interface ParameterizedNamedSql {
|
|
1115
|
+
/**
|
|
1116
|
+
* Specifies the SQL `WHERE` clause with bind variable placeholders for each value.
|
|
1117
|
+
*/
|
|
1118
|
+
sql: string;
|
|
1119
|
+
/**
|
|
1120
|
+
* Specifies the bind variable names from the `sql` string to the associated values.
|
|
1121
|
+
*/
|
|
1122
|
+
params: Record<string, object>;
|
|
1123
|
+
}
|
|
1124
|
+
/**
|
|
1125
|
+
* Interface to define the DragEventArgs for dragging action of group and rules.
|
|
1126
|
+
*
|
|
1127
|
+
*/
|
|
1128
|
+
export interface DragEventArgs {
|
|
1129
|
+
/**
|
|
1130
|
+
* Returns the ID of the rule id to be dragged.
|
|
1131
|
+
*
|
|
1132
|
+
* @returns {string} The ID of the rule where the drag action is performed.
|
|
1133
|
+
*/
|
|
1134
|
+
dragRuleID: string;
|
|
1135
|
+
/**
|
|
1136
|
+
* Returns the ID of the group to be dragged.
|
|
1137
|
+
*
|
|
1138
|
+
* @returns {string} The ID of the group where the drag action is performed.
|
|
1139
|
+
*/
|
|
1140
|
+
dragGroupID: string;
|
|
1141
|
+
/**
|
|
1142
|
+
* Determines whether to cancel the dragging action based on certain conditions.
|
|
1143
|
+
*
|
|
1144
|
+
* @returns {boolean} True if the dragging action should be cancelled, otherwise false.
|
|
1145
|
+
*
|
|
1146
|
+
*/
|
|
1147
|
+
cancel: boolean;
|
|
1148
|
+
}
|
|
1149
|
+
/**
|
|
1150
|
+
* Interface to define the DropEventArgs for dropping action of group and rules.
|
|
1151
|
+
*
|
|
1152
|
+
*/
|
|
1153
|
+
export interface DropEventArgs {
|
|
1154
|
+
/**
|
|
1155
|
+
* Determines whether to cancel the dropping action based on certain conditions.
|
|
1156
|
+
*
|
|
1157
|
+
* @returns {boolean} True if the dropping action should be cancelled, otherwise false.
|
|
1158
|
+
*/
|
|
1159
|
+
cancel: boolean;
|
|
1160
|
+
/**
|
|
1161
|
+
* Returns the ID of the rule where the drop action is initiated.
|
|
1162
|
+
*
|
|
1163
|
+
* @returns {string} The ID of the rule where the drop action is performed.
|
|
1164
|
+
*/
|
|
1165
|
+
dropRuleID: string;
|
|
1166
|
+
/**
|
|
1167
|
+
* Returns the ID of the group where the drop action is initiated.
|
|
1168
|
+
*
|
|
1169
|
+
* @returns {string} The ID of the group where the drop action is performed.
|
|
1170
|
+
*/
|
|
1171
|
+
dropGroupID: string;
|
|
1172
|
+
}
|