@syncfusion/ej2-querybuilder 25.2.7 → 26.1.35
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/.eslintrc.json +3 -2
- 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 +1326 -290
- package/dist/es6/ej2-querybuilder.es2015.js.map +1 -1
- package/dist/es6/ej2-querybuilder.es5.js +1319 -282
- 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/package.json +12 -12
- package/src/query-builder/query-builder-model.d.ts +45 -6
- package/src/query-builder/query-builder.d.ts +102 -5
- package/src/query-builder/query-builder.js +1311 -262
- package/src/query-builder/query-library.js +2 -2
- package/styles/bootstrap-dark.css +194 -21
- package/styles/bootstrap-dark.scss +15 -1
- package/styles/bootstrap.css +194 -21
- package/styles/bootstrap.scss +15 -1
- package/styles/bootstrap4.css +198 -22
- package/styles/bootstrap4.scss +15 -1
- package/styles/bootstrap5-dark.css +198 -30
- package/styles/bootstrap5-dark.scss +15 -1
- package/styles/bootstrap5.css +198 -30
- package/styles/bootstrap5.scss +15 -1
- package/styles/fabric-dark.css +192 -20
- package/styles/fabric-dark.scss +15 -1
- package/styles/fabric.css +192 -20
- package/styles/fabric.scss +15 -1
- package/styles/fluent-dark.css +196 -28
- package/styles/fluent-dark.scss +15 -1
- package/styles/fluent.css +196 -28
- package/styles/fluent.scss +15 -1
- package/styles/fluent2.css +2052 -0
- package/styles/fluent2.scss +15 -0
- package/styles/highcontrast-light.css +195 -20
- package/styles/highcontrast-light.scss +15 -1
- package/styles/highcontrast.css +195 -20
- package/styles/highcontrast.scss +15 -1
- package/styles/material-dark.css +205 -24
- package/styles/material-dark.scss +15 -1
- package/styles/material.css +207 -24
- package/styles/material.scss +15 -1
- package/styles/material3-dark.css +211 -26
- package/styles/material3-dark.scss +15 -1
- package/styles/material3.css +211 -26
- package/styles/material3.scss +15 -1
- package/styles/query-builder/_bds-definition.scss +7 -1
- package/styles/query-builder/_bootstrap-dark-definition.scss +7 -0
- package/styles/query-builder/_bootstrap-definition.scss +7 -0
- package/styles/query-builder/_bootstrap4-definition.scss +7 -0
- package/styles/query-builder/_bootstrap5-definition.scss +7 -1
- package/styles/query-builder/_bootstrap5.3-definition.scss +114 -0
- package/styles/query-builder/_fabric-dark-definition.scss +7 -0
- package/styles/query-builder/_fabric-definition.scss +7 -0
- package/styles/query-builder/_fluent-definition.scss +7 -1
- package/styles/query-builder/_fluent2-definition.scss +114 -0
- package/styles/query-builder/_fusionnew-definition.scss +7 -1
- package/styles/query-builder/_highcontrast-definition.scss +7 -0
- package/styles/query-builder/_highcontrast-light-definition.scss +7 -0
- package/styles/query-builder/_layout.scss +275 -12
- package/styles/query-builder/_material-dark-definition.scss +7 -0
- package/styles/query-builder/_material-definition.scss +7 -0
- package/styles/query-builder/_material3-definition.scss +7 -1
- package/styles/query-builder/_tailwind-definition.scss +7 -1
- package/styles/query-builder/_theme.scss +34 -22
- package/styles/query-builder/bootstrap-dark.css +194 -21
- package/styles/query-builder/bootstrap.css +194 -21
- package/styles/query-builder/bootstrap4.css +198 -22
- package/styles/query-builder/bootstrap5-dark.css +198 -30
- package/styles/query-builder/bootstrap5.css +198 -30
- package/styles/query-builder/fabric-dark.css +192 -20
- package/styles/query-builder/fabric.css +192 -20
- package/styles/query-builder/fluent-dark.css +196 -28
- package/styles/query-builder/fluent.css +196 -28
- package/styles/query-builder/fluent2.css +2052 -0
- package/styles/query-builder/fluent2.scss +15 -0
- package/styles/query-builder/highcontrast-light.css +195 -20
- package/styles/query-builder/highcontrast.css +195 -20
- package/styles/query-builder/icons/_bds.scss +4 -0
- package/styles/query-builder/icons/_bootstrap-dark.scss +4 -0
- package/styles/query-builder/icons/_bootstrap.scss +4 -0
- package/styles/query-builder/icons/_bootstrap4.scss +4 -0
- package/styles/query-builder/icons/_bootstrap5.3.scss +11 -0
- package/styles/query-builder/icons/_bootstrap5.scss +4 -0
- package/styles/query-builder/icons/_fabric-dark.scss +4 -0
- package/styles/query-builder/icons/_fabric.scss +4 -0
- package/styles/query-builder/icons/_fluent.scss +4 -0
- package/styles/query-builder/icons/_fluent2.scss +11 -0
- package/styles/query-builder/icons/_fusionnew.scss +4 -0
- package/styles/query-builder/icons/_highcontrast-light.scss +4 -0
- package/styles/query-builder/icons/_highcontrast.scss +4 -0
- package/styles/query-builder/icons/_material-dark.scss +4 -0
- package/styles/query-builder/icons/_material.scss +4 -0
- package/styles/query-builder/icons/_material3.scss +4 -0
- package/styles/query-builder/icons/_tailwind-dark.scss +4 -0
- package/styles/query-builder/icons/_tailwind.scss +4 -0
- package/styles/query-builder/material-dark.css +205 -24
- package/styles/query-builder/material.css +207 -24
- package/styles/query-builder/material3-dark.css +211 -26
- package/styles/query-builder/material3.css +211 -26
- package/styles/query-builder/tailwind-dark.css +205 -24
- package/styles/query-builder/tailwind.css +205 -24
- package/styles/tailwind-dark.css +205 -24
- package/styles/tailwind-dark.scss +15 -1
- package/styles/tailwind.css +205 -24
- package/styles/tailwind.scss +15 -1
- package/CHANGELOG.md +0 -828
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Button, RadioButton } from '@syncfusion/ej2-buttons';
|
|
3
|
-
import { CheckBoxSelection, DropDownList, DropDownTree
|
|
4
|
-
import { DataManager, Deferred, Predicate
|
|
1
|
+
import { ChildProperty, Property, Collection, Component, closest, isNullOrUndefined, extend, remove, getComponent, removeClass, Animation, addClass, select, append, detach, rippleEffect, getInstance, getValue, Browser, classList, Internationalization, getUniqueID, L10n, Draggable, compile, EventHandler, cldrData, Event, Complex, NotifyPropertyChanges } from '@syncfusion/ej2-base';
|
|
2
|
+
import { Button, CheckBox, RadioButton } from '@syncfusion/ej2-buttons';
|
|
3
|
+
import { MultiSelect, CheckBoxSelection, DropDownList, DropDownTree } from '@syncfusion/ej2-dropdowns';
|
|
4
|
+
import { Query, DataManager, Deferred, Predicate } from '@syncfusion/ej2-data';
|
|
5
5
|
import { NumericTextBox, TextBox } from '@syncfusion/ej2-inputs';
|
|
6
6
|
import { DatePicker } from '@syncfusion/ej2-calendars';
|
|
7
7
|
import { DropDownButton } from '@syncfusion/ej2-splitbuttons';
|
|
8
|
-
import { Tooltip,
|
|
8
|
+
import { Tooltip, showSpinner, hideSpinner, createSpinner } from '@syncfusion/ej2-popups';
|
|
9
9
|
|
|
10
10
|
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
11
11
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -13,9 +13,6 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
|
|
|
13
13
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
14
14
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15
15
|
};
|
|
16
|
-
/**
|
|
17
|
-
* Query Builder Source
|
|
18
|
-
*/
|
|
19
16
|
/**
|
|
20
17
|
* Defines the Columns of Query Builder
|
|
21
18
|
*/
|
|
@@ -162,6 +159,233 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
162
159
|
this.cloneGrpBtnClick = false;
|
|
163
160
|
this.isMiddleGroup = false;
|
|
164
161
|
this.cloneRuleBtnClick = false;
|
|
162
|
+
this.dragStopHandler = (e) => {
|
|
163
|
+
if (this.isDragEventPrevent) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
let targetGroup = closest(e.target, '.e-rule-container');
|
|
167
|
+
if (isNullOrUndefined(targetGroup) && e.target.parentElement &&
|
|
168
|
+
e.target.parentElement.classList.contains('e-btn-group') && this.enableSeparateConnector) {
|
|
169
|
+
targetGroup = closest(e.target.parentElement.previousElementSibling, '.e-rule-container');
|
|
170
|
+
}
|
|
171
|
+
let isPreventelem = closest(e.helper, '.e-notallowedcur');
|
|
172
|
+
let prevRule;
|
|
173
|
+
if (!isPreventelem) {
|
|
174
|
+
const targetGrp = closest(e.target, '.e-group-container');
|
|
175
|
+
const dropEventArgs = { cancel: false, dropRuleID: targetGroup !== null ? targetGroup.id
|
|
176
|
+
: targetGrp !== null ? targetGrp.id : null, dropGroupID: targetGrp !== null ? targetGrp.id : null };
|
|
177
|
+
this.trigger('drop', dropEventArgs);
|
|
178
|
+
if (dropEventArgs.cancel) {
|
|
179
|
+
isPreventelem = true;
|
|
180
|
+
}
|
|
181
|
+
prevRule = this.getValidRules();
|
|
182
|
+
}
|
|
183
|
+
this.prvtEvtTgrDaD = true;
|
|
184
|
+
const tgrt = this.enableSeparateConnector && e.target.parentElement &&
|
|
185
|
+
e.target.parentElement.classList.contains('e-btn-group') ? e.target.parentElement.previousElementSibling : e.target;
|
|
186
|
+
if (targetGroup && !isPreventelem) {
|
|
187
|
+
const groupId = targetGroup.id.split(this.element.id + '_')[1].split('_')[0];
|
|
188
|
+
if (this.draggable.currentStateTarget.parentElement.classList.contains('e-rule-field') ||
|
|
189
|
+
this.draggable.currentStateTarget.parentElement.classList.contains('e-group-header')) {
|
|
190
|
+
let rule;
|
|
191
|
+
if (this.draggable.currentStateTarget.parentElement.classList.contains('e-group-header')) {
|
|
192
|
+
rule = this.getGroup(this.draggedRule);
|
|
193
|
+
this.deleteGroup(closest(this.draggedRule, '.e-group-container'));
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
rule = this.getRule(this.draggedRule);
|
|
197
|
+
this.deleteRule(this.draggedRule);
|
|
198
|
+
}
|
|
199
|
+
let groupRule = extend([], this.getGroup(targetGroup), [], true);
|
|
200
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
201
|
+
if (groupRule.properties) {
|
|
202
|
+
groupRule = groupRule.properties;
|
|
203
|
+
}
|
|
204
|
+
const groupElem = closest(targetGroup, '.e-group-container');
|
|
205
|
+
const nestGrpElem = groupElem.querySelectorAll('.e-group-container');
|
|
206
|
+
nestGrpElem.forEach((ele) => {
|
|
207
|
+
if (this.element.querySelector('#' + ele.id)) {
|
|
208
|
+
this.deleteGroup(ele);
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
const ruleElems = groupElem.querySelectorAll('.e-rule-container');
|
|
212
|
+
const ruleIds = [];
|
|
213
|
+
let dropInd;
|
|
214
|
+
for (let i = 0; i < ruleElems.length; i++) {
|
|
215
|
+
if (ruleElems[i].classList.contains('e-drag-rule-top-line') ||
|
|
216
|
+
ruleElems[i].classList.contains('e-drag-rule-bottom-line')) {
|
|
217
|
+
dropInd = i;
|
|
218
|
+
}
|
|
219
|
+
ruleIds.push(ruleElems[i].id.split(this.element.id + '_')[1]);
|
|
220
|
+
}
|
|
221
|
+
this.deleteRules(ruleIds);
|
|
222
|
+
if (targetGroup.classList.contains('e-drag-rule-top-line')) {
|
|
223
|
+
groupRule.rules.splice(dropInd, 0, rule);
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
226
|
+
groupRule.rules.splice(dropInd + 1, 0, rule);
|
|
227
|
+
}
|
|
228
|
+
groupRule.rules.forEach((rule) => {
|
|
229
|
+
if (this.enableSeparateConnector) {
|
|
230
|
+
if (!rule.rules) {
|
|
231
|
+
this.addRules([rule], groupId);
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
this.addGroups([rule], groupId);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
else {
|
|
238
|
+
if (rule.condition) {
|
|
239
|
+
this.addGroups([rule], groupId);
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
this.addRules([rule], groupId);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
else if (tgrt.classList.contains('e-rule-list') && tgrt.children.length === 0 && !isPreventelem) {
|
|
249
|
+
const groupElem = closest(tgrt, '.e-group-container');
|
|
250
|
+
const groupId = groupElem.id.split(this.element.id + '_')[1].split('_')[0];
|
|
251
|
+
let rule;
|
|
252
|
+
if (this.draggable.currentStateTarget.parentElement.classList.contains('e-group-header')) {
|
|
253
|
+
rule = this.getGroup(this.draggedRule);
|
|
254
|
+
this.deleteGroup(closest(this.draggedRule, '.e-group-container'));
|
|
255
|
+
}
|
|
256
|
+
else {
|
|
257
|
+
rule = this.getRule(this.draggedRule);
|
|
258
|
+
this.deleteRule(this.draggedRule);
|
|
259
|
+
}
|
|
260
|
+
if (this.enableSeparateConnector) {
|
|
261
|
+
if (!rule.rules) {
|
|
262
|
+
this.addRules([rule], groupId);
|
|
263
|
+
}
|
|
264
|
+
else {
|
|
265
|
+
this.addGroups([rule], groupId);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
if (rule.condition) {
|
|
270
|
+
this.addGroups([rule], groupId);
|
|
271
|
+
}
|
|
272
|
+
else {
|
|
273
|
+
this.addRules([rule], groupId);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
else if (tgrt.classList.contains('e-rule-list') && tgrt.children[0].classList.contains('e-group-container') && !isPreventelem) {
|
|
278
|
+
const groupElem = closest(tgrt, '.e-group-container');
|
|
279
|
+
const groupId = groupElem.id.split(this.element.id + '_')[1].split('_')[0];
|
|
280
|
+
let rule;
|
|
281
|
+
if (this.draggable.currentStateTarget.parentElement.classList.contains('e-group-header')) {
|
|
282
|
+
rule = this.getGroup(this.draggedRule);
|
|
283
|
+
this.deleteGroup(closest(this.draggedRule, '.e-group-container'));
|
|
284
|
+
}
|
|
285
|
+
else {
|
|
286
|
+
rule = this.getRule(this.draggedRule);
|
|
287
|
+
this.deleteRule(this.draggedRule);
|
|
288
|
+
}
|
|
289
|
+
let groupRule = extend([], this.getGroup(tgrt), [], true);
|
|
290
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
291
|
+
if (groupRule.properties) {
|
|
292
|
+
groupRule = groupRule.properties;
|
|
293
|
+
}
|
|
294
|
+
const groupElems = tgrt.querySelectorAll('.e-group-container');
|
|
295
|
+
groupElems.forEach((ele) => {
|
|
296
|
+
if (this.element.querySelector('#' + ele.id)) {
|
|
297
|
+
this.deleteGroup(ele);
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
const ruleElems = groupElem.querySelectorAll('.e-rule-container');
|
|
301
|
+
ruleElems.forEach((ele) => {
|
|
302
|
+
if (this.element.querySelector('#' + ele.id)) {
|
|
303
|
+
this.deleteRule(ele);
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
if (this.draggable.currentStateTarget.parentElement.classList.contains('e-group-header')) {
|
|
307
|
+
this.addGroups([rule], groupId);
|
|
308
|
+
}
|
|
309
|
+
else {
|
|
310
|
+
this.addRules([rule], groupId);
|
|
311
|
+
}
|
|
312
|
+
groupRule.rules.forEach((rule) => {
|
|
313
|
+
if (this.enableSeparateConnector) {
|
|
314
|
+
if (!rule.rules) {
|
|
315
|
+
this.addRules([rule], groupId);
|
|
316
|
+
}
|
|
317
|
+
else {
|
|
318
|
+
this.addGroups([rule], groupId);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
else {
|
|
322
|
+
if (rule.condition) {
|
|
323
|
+
this.addGroups([rule], groupId);
|
|
324
|
+
}
|
|
325
|
+
else {
|
|
326
|
+
this.addRules([rule], groupId);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
else if ((closest(e.target, '.e-group-container') || e.target.classList.contains('e-group-container')) && !isPreventelem) {
|
|
332
|
+
let rule;
|
|
333
|
+
targetGroup = closest(e.target, '.e-group-container');
|
|
334
|
+
if (!targetGroup && e.target.classList.contains('e-group-container')) {
|
|
335
|
+
targetGroup = e.target;
|
|
336
|
+
}
|
|
337
|
+
const groupId = targetGroup.id.split(this.element.id + '_')[1].split('_')[0];
|
|
338
|
+
if (groupId === 'group0') {
|
|
339
|
+
if (this.draggable.currentStateTarget.parentElement.classList.contains('e-group-header')) {
|
|
340
|
+
rule = this.getGroup(this.draggedRule);
|
|
341
|
+
this.deleteGroup(closest(this.draggedRule, '.e-group-container'));
|
|
342
|
+
}
|
|
343
|
+
else {
|
|
344
|
+
rule = this.getRule(this.draggedRule);
|
|
345
|
+
this.deleteRule(this.draggedRule);
|
|
346
|
+
}
|
|
347
|
+
if (this.enableSeparateConnector) {
|
|
348
|
+
if (!rule.rules) {
|
|
349
|
+
this.addRules([rule], groupId);
|
|
350
|
+
}
|
|
351
|
+
else {
|
|
352
|
+
this.addGroups([rule], groupId);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
else {
|
|
356
|
+
if (rule.condition) {
|
|
357
|
+
this.addGroups([rule], groupId);
|
|
358
|
+
}
|
|
359
|
+
else {
|
|
360
|
+
this.addRules([rule], groupId);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
if (!isPreventelem) {
|
|
366
|
+
this.trigger('ruleChange', { previousRule: prevRule, rule: this.getValidRules(), type: 'drag-and-drop' });
|
|
367
|
+
}
|
|
368
|
+
this.prvtEvtTgrDaD = false;
|
|
369
|
+
document.body.classList.remove('e-prevent-select');
|
|
370
|
+
let borderLineElem = this.element.querySelectorAll('.e-drag-rule-bottom-line');
|
|
371
|
+
borderLineElem.forEach((ele) => {
|
|
372
|
+
ele.classList.remove('e-drag-rule-bottom-line');
|
|
373
|
+
});
|
|
374
|
+
borderLineElem = this.element.querySelectorAll('.e-drag-rule-top-line');
|
|
375
|
+
borderLineElem.forEach((ele) => {
|
|
376
|
+
ele.classList.remove('e-drag-rule-top-line');
|
|
377
|
+
});
|
|
378
|
+
borderLineElem = this.element.querySelectorAll('.e-qb-dragging-rule');
|
|
379
|
+
borderLineElem.forEach((ele) => {
|
|
380
|
+
ele.classList.remove('e-qb-dragging-rule');
|
|
381
|
+
});
|
|
382
|
+
if (e.helper.classList.contains('e-cloneproperties') && document.querySelector('.' + e.helper.classList[0])) {
|
|
383
|
+
remove(e.helper);
|
|
384
|
+
}
|
|
385
|
+
if (this.enableSeparateConnector) {
|
|
386
|
+
this.refresh();
|
|
387
|
+
}
|
|
388
|
+
};
|
|
165
389
|
MultiSelect.Inject(CheckBoxSelection);
|
|
166
390
|
}
|
|
167
391
|
getPersistData() {
|
|
@@ -299,7 +523,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
299
523
|
this.columns = cols;
|
|
300
524
|
}
|
|
301
525
|
}
|
|
302
|
-
else if (this.columns.length) {
|
|
526
|
+
else if (this.columns && this.columns.length) {
|
|
303
527
|
const columns = this.columns;
|
|
304
528
|
for (let i = 0, len = columns.length; i < len; i++) {
|
|
305
529
|
if (columns[i].category) {
|
|
@@ -409,6 +633,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
409
633
|
txtareaElem.style.height = txtareaElem.scrollHeight + 'px';
|
|
410
634
|
}
|
|
411
635
|
if (target.tagName === 'BUTTON' && target.className.indexOf('e-qb-toggle') < 0) {
|
|
636
|
+
const animation = new Animation({ duration: 1000, delay: 0 });
|
|
412
637
|
switch (true) {
|
|
413
638
|
case target.className.indexOf('e-removerule') > -1:
|
|
414
639
|
this.actionButton = target;
|
|
@@ -437,7 +662,6 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
437
662
|
this.deleteGroup(closest(target, '.e-group-container'));
|
|
438
663
|
break;
|
|
439
664
|
case target.className.indexOf('e-edit-rule') > -1:
|
|
440
|
-
const animation = new Animation({ duration: 1000, delay: 0 });
|
|
441
665
|
animation.animate('.e-query-builder', { name: 'SlideLeftIn' });
|
|
442
666
|
document.getElementById(this.element.id + '_summary_content').style.display = 'none';
|
|
443
667
|
if (this.element.querySelectorAll('.e-group-container').length < 1) {
|
|
@@ -465,6 +689,9 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
465
689
|
if (forIdValue) {
|
|
466
690
|
targetValue = document.getElementById(forIdValue).getAttribute('value');
|
|
467
691
|
}
|
|
692
|
+
else if (this.enableSeparateConnector) {
|
|
693
|
+
targetValue = target.textContent;
|
|
694
|
+
}
|
|
468
695
|
groupID = element.id.replace(this.element.id + '_', '');
|
|
469
696
|
const group = this.getGroup(groupID);
|
|
470
697
|
let ariaChecked;
|
|
@@ -504,18 +731,59 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
504
731
|
}
|
|
505
732
|
beforeSuccessCallBack(args, target) {
|
|
506
733
|
if (args && !args.cancel) {
|
|
507
|
-
|
|
734
|
+
let element = closest(target, '.e-group-container');
|
|
508
735
|
const groupID = element.id.replace(this.element.id + '_', '');
|
|
509
736
|
const beforeRules = this.getValidRules(this.rule);
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
737
|
+
let rule = this.getParentGroup(element);
|
|
738
|
+
if (this.enableSeparateConnector) {
|
|
739
|
+
if (isNullOrUndefined(closest(target, '.e-rule-container')) &&
|
|
740
|
+
element.classList.contains('e-group-container')) {
|
|
741
|
+
element = target.parentElement.previousElementSibling !== null ?
|
|
742
|
+
target.parentElement.previousElementSibling : element;
|
|
743
|
+
}
|
|
744
|
+
else {
|
|
745
|
+
element = closest(target, '.e-rule-container');
|
|
746
|
+
}
|
|
747
|
+
const id = element.id.replace(this.element.id + '_', '');
|
|
748
|
+
if (element.classList.contains('e-rule-container')) {
|
|
749
|
+
rule = this.getRule(element);
|
|
750
|
+
rule.condition = args.value;
|
|
751
|
+
}
|
|
752
|
+
else if (element.classList.contains('e-group-container')) {
|
|
753
|
+
rule = this.getGroup(element);
|
|
754
|
+
rule.condition = args.value;
|
|
755
|
+
}
|
|
756
|
+
if (this.enableNotCondition) {
|
|
757
|
+
rule.not = args.not;
|
|
758
|
+
}
|
|
759
|
+
if (!this.isImportRules) {
|
|
760
|
+
this.trigger('change', { groupID: groupID, ruleID: id, type: 'condition', value: rule.condition });
|
|
761
|
+
}
|
|
514
762
|
}
|
|
515
|
-
|
|
516
|
-
|
|
763
|
+
else {
|
|
764
|
+
rule.condition = args.value;
|
|
765
|
+
if (this.enableNotCondition) {
|
|
766
|
+
rule.not = args.not;
|
|
767
|
+
}
|
|
768
|
+
if (!this.isImportRules) {
|
|
769
|
+
this.trigger('change', { groupID: groupID, type: 'condition', value: rule.condition });
|
|
770
|
+
}
|
|
517
771
|
}
|
|
518
772
|
this.filterRules(beforeRules, this.getValidRules(this.rule), 'condition');
|
|
773
|
+
if (this.enableSeparateConnector) {
|
|
774
|
+
const andElem = target.parentElement.querySelector('.e-btngroup-and');
|
|
775
|
+
const orElem = target.parentElement.querySelector('.e-btngroup-or');
|
|
776
|
+
if (andElem && orElem) {
|
|
777
|
+
if (args.value === 'and') {
|
|
778
|
+
andElem.checked = true;
|
|
779
|
+
orElem.checked = false;
|
|
780
|
+
}
|
|
781
|
+
else if (args.value === 'or') {
|
|
782
|
+
orElem.checked = true;
|
|
783
|
+
andElem.checked = false;
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
}
|
|
519
787
|
}
|
|
520
788
|
}
|
|
521
789
|
selectBtn(target, event) {
|
|
@@ -558,7 +826,23 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
558
826
|
ruleListElem.appendChild(ruleElem);
|
|
559
827
|
}
|
|
560
828
|
else {
|
|
561
|
-
|
|
829
|
+
if (this.enableSeparateConnector) {
|
|
830
|
+
let index = -1;
|
|
831
|
+
let tempRuleIndex = this.ruleIndex + 1;
|
|
832
|
+
for (let i = 0; i < tempRuleIndex; i++) {
|
|
833
|
+
if (i === ruleListElem.children.length) {
|
|
834
|
+
break;
|
|
835
|
+
}
|
|
836
|
+
if (ruleListElem.children[i].classList.contains('e-rule-container')) {
|
|
837
|
+
tempRuleIndex++;
|
|
838
|
+
index++;
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
ruleListElem.insertBefore(ruleElem, ruleListElem.children[this.ruleIndex + index + 1]); // added clone rule to next position
|
|
842
|
+
}
|
|
843
|
+
else {
|
|
844
|
+
ruleListElem.insertBefore(ruleElem, ruleListElem.children[this.ruleIndex + 1]); // added clone rule to next position
|
|
845
|
+
}
|
|
562
846
|
}
|
|
563
847
|
this.cloneRuleBtnClick = false;
|
|
564
848
|
}
|
|
@@ -629,6 +913,9 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
629
913
|
if (this.showButtons.ruleDelete) {
|
|
630
914
|
removeClass(ruleElem.querySelectorAll('.e-lock-grp-btn'), 'e-button-hide');
|
|
631
915
|
}
|
|
916
|
+
if (this.allowDragAndDrop) {
|
|
917
|
+
removeClass(ruleElem.querySelectorAll('.e-drag-qb-rule'), 'e-hidden');
|
|
918
|
+
}
|
|
632
919
|
if (column && column.ruleTemplate && rule) {
|
|
633
920
|
this.renderReactTemplates();
|
|
634
921
|
}
|
|
@@ -639,7 +926,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
639
926
|
return;
|
|
640
927
|
}
|
|
641
928
|
const args = { groupID: target.id.replace(this.element.id + '_', ''), cancel: false, type: 'insertRule' };
|
|
642
|
-
if (!this.isImportRules && !this.isInitialLoad) {
|
|
929
|
+
if (!this.isImportRules && !this.isInitialLoad && !this.prvtEvtTgrDaD) {
|
|
643
930
|
this.trigger('beforeChange', args, (observedChangeArgs) => {
|
|
644
931
|
this.addRuleSuccessCallBack(observedChangeArgs, target, rule, column, action, parentId, isRuleTemplate);
|
|
645
932
|
});
|
|
@@ -694,20 +981,54 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
694
981
|
else {
|
|
695
982
|
ruleElem.className = 'e-rule-container e-horizontal-mode';
|
|
696
983
|
}
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
984
|
+
let previousRuleElem = ruleElem.previousElementSibling;
|
|
985
|
+
if (this.enableSeparateConnector) {
|
|
986
|
+
let prevRule;
|
|
987
|
+
let ruleContainer;
|
|
988
|
+
if (previousRuleElem && previousRuleElem.classList.contains('e-group-container')) {
|
|
989
|
+
ruleContainer = previousRuleElem.querySelectorAll('.e-rule-container');
|
|
990
|
+
previousRuleElem = ruleContainer[ruleContainer.length - 1];
|
|
991
|
+
}
|
|
992
|
+
if (previousRuleElem && previousRuleElem.classList.contains('e-rule-container')) {
|
|
993
|
+
prevRule = this.getRule(previousRuleElem);
|
|
994
|
+
}
|
|
995
|
+
if (this.headerTemplate && previousRuleElem && prevRule) {
|
|
996
|
+
this.headerTemplateFn(previousRuleElem, false, prevRule.condition, prevRule, previousRuleElem.id);
|
|
997
|
+
}
|
|
998
|
+
else if (isNullOrUndefined(previousRuleElem) && ruleElem.id !== this.element.id + '_group0_rule0') {
|
|
999
|
+
const group = ruleElem.closest('.e-group-container');
|
|
1000
|
+
if (group && group.previousElementSibling) {
|
|
1001
|
+
let prevElem = group.previousElementSibling;
|
|
1002
|
+
const prevRuleContainer = prevElem.querySelectorAll('.e-rule-container');
|
|
1003
|
+
if (prevElem.classList.contains('e-group-container')) {
|
|
1004
|
+
prevElem = prevRuleContainer[prevRuleContainer.length - 1];
|
|
1005
|
+
}
|
|
1006
|
+
if (prevElem.classList.contains('e-rule-container')) {
|
|
1007
|
+
const prevRule = this.getRule(prevElem);
|
|
1008
|
+
this.headerTemplateFn(prevElem, false, prevRule.condition, prevRule, prevElem.id, true);
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
else {
|
|
1012
|
+
this.headerTemplateFn(ruleElem, false, rule.condition, rule, ruleElem.id, true);
|
|
1013
|
+
}
|
|
700
1014
|
}
|
|
701
|
-
|
|
702
|
-
|
|
1015
|
+
}
|
|
1016
|
+
else {
|
|
1017
|
+
if (previousRuleElem && previousRuleElem.className.indexOf('e-rule-container') > -1) {
|
|
1018
|
+
if (ruleElem.className.indexOf('e-joined-rule') < 0) {
|
|
1019
|
+
ruleElem.className += ' e-joined-rule';
|
|
1020
|
+
}
|
|
1021
|
+
if (previousRuleElem.className.indexOf('e-prev-joined-rule') < 0) {
|
|
1022
|
+
previousRuleElem.className += ' e-prev-joined-rule';
|
|
1023
|
+
}
|
|
703
1024
|
}
|
|
704
1025
|
}
|
|
705
|
-
if (
|
|
1026
|
+
if (previousRuleElem && previousRuleElem.className.indexOf('e-group-container') > -1 &&
|
|
706
1027
|
ruleElem.className.indexOf('e-separate-rule') < 0) {
|
|
707
1028
|
ruleElem.className += ' e-separate-rule';
|
|
708
1029
|
}
|
|
709
1030
|
if (!this.isImportRules) {
|
|
710
|
-
this.updateAddedRule(trgt, rule, newRule, isRlTmp, pId);
|
|
1031
|
+
this.updateAddedRule(trgt, rule, newRule, isRlTmp, pId, this.enableSeparateConnector ? true : null);
|
|
711
1032
|
}
|
|
712
1033
|
if (!column || (column && !column.ruleTemplate) || !rule.field) {
|
|
713
1034
|
if (this.fieldMode === 'Default') {
|
|
@@ -738,7 +1059,8 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
738
1059
|
ddlVal = this.GetRootColumnName(rule.field);
|
|
739
1060
|
}
|
|
740
1061
|
else {
|
|
741
|
-
ddlVal = this.isImportRules ? this.GetRootColumnName(rule.field) :
|
|
1062
|
+
ddlVal = this.isImportRules ? this.GetRootColumnName(rule.field) :
|
|
1063
|
+
dropDownList.value;
|
|
742
1064
|
}
|
|
743
1065
|
this.selectedColumn = dropDownList.getDataByValue(ddlVal);
|
|
744
1066
|
if (Object.keys(rule).length) {
|
|
@@ -782,10 +1104,52 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
782
1104
|
}
|
|
783
1105
|
}
|
|
784
1106
|
ruleID = ruleElem.id.replace(this.element.id + '_', '');
|
|
785
|
-
if (
|
|
1107
|
+
if (rule && rule.isLocked) {
|
|
1108
|
+
const lockRuleTarget = ruleElem.querySelector('.e-lock-rule-btn');
|
|
1109
|
+
this.ruleLock(lockRuleTarget);
|
|
1110
|
+
}
|
|
1111
|
+
if (!this.isImportRules && !this.prvtEvtTgrDaD) {
|
|
786
1112
|
this.trigger('change', { groupID: trgt.id.replace(this.element.id + '_', ''), ruleID: ruleID, type: 'insertRule' });
|
|
787
1113
|
}
|
|
788
1114
|
}
|
|
1115
|
+
if (this.enableSeparateConnector && isNullOrUndefined(rule.condition) && ruleID) {
|
|
1116
|
+
rule = this.getRule(ruleID);
|
|
1117
|
+
}
|
|
1118
|
+
if (this.enableSeparateConnector) {
|
|
1119
|
+
let prevElem = ruleElem.previousElementSibling;
|
|
1120
|
+
let ruleContainer;
|
|
1121
|
+
while (prevElem && !prevElem.classList.contains('e-rule-container')) {
|
|
1122
|
+
if (prevElem.classList.contains('e-group-container')) {
|
|
1123
|
+
ruleContainer = prevElem.querySelectorAll('.e-rule-container');
|
|
1124
|
+
prevElem = ruleContainer[ruleContainer.length - 1];
|
|
1125
|
+
break;
|
|
1126
|
+
}
|
|
1127
|
+
prevElem = prevElem.previousElementSibling;
|
|
1128
|
+
}
|
|
1129
|
+
if (this.headerTemplate && prevElem) {
|
|
1130
|
+
const prevRule = this.getRule(prevElem);
|
|
1131
|
+
const args = { requestType: 'rule-template-create', ruleID: prevElem.id, condition: prevRule.condition,
|
|
1132
|
+
notCondition: this.enableNotCondition ? true : undefined };
|
|
1133
|
+
this.trigger('actionBegin', args);
|
|
1134
|
+
}
|
|
1135
|
+
else if (isNullOrUndefined(prevElem) && ruleElem.id !== this.element.id + '_group0_rule0') {
|
|
1136
|
+
const group = ruleElem.closest('.e-group-container');
|
|
1137
|
+
if (group && group.previousElementSibling && group.previousElementSibling.previousElementSibling) {
|
|
1138
|
+
let prevElem = group.previousElementSibling.previousElementSibling;
|
|
1139
|
+
if (prevElem.classList.contains('e-group-container')) {
|
|
1140
|
+
const ruleContainer = prevElem.querySelectorAll('.e-rule-container');
|
|
1141
|
+
prevElem = ruleContainer[ruleContainer.length - 1];
|
|
1142
|
+
}
|
|
1143
|
+
if (prevElem.classList.contains('e-rule-container')) {
|
|
1144
|
+
const prevRule = this.getRule(prevElem);
|
|
1145
|
+
const args = { requestType: 'rule-template-create', ruleID: prevElem.id,
|
|
1146
|
+
condition: prevRule.condition, notCondition: this.enableNotCondition ? true : undefined };
|
|
1147
|
+
this.trigger('actionBegin', args);
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
this.setMultiConnector(ruleElem);
|
|
1152
|
+
}
|
|
789
1153
|
}
|
|
790
1154
|
updateDropdowntreeDS(columns) {
|
|
791
1155
|
for (let i = 0; i < columns.length; i++) {
|
|
@@ -795,7 +1159,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
795
1159
|
}
|
|
796
1160
|
}
|
|
797
1161
|
}
|
|
798
|
-
updateAddedRule(target, rule, newRule, isRuleTemplate, pId) {
|
|
1162
|
+
updateAddedRule(target, rule, newRule, isRuleTemplate, pId, isNewRuleAdded) {
|
|
799
1163
|
let ruleElem;
|
|
800
1164
|
let index = 0;
|
|
801
1165
|
let groupElem;
|
|
@@ -806,7 +1170,12 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
806
1170
|
rules = this.getParentGroup(groupElem);
|
|
807
1171
|
while (ruleElem && ruleElem.previousElementSibling !== null) {
|
|
808
1172
|
ruleElem = ruleElem.previousElementSibling;
|
|
809
|
-
|
|
1173
|
+
const enableSeparateCondition = this.enableSeparateConnector && ((!this.headerTemplate && !ruleElem.classList.contains('e-btn-group')) ||
|
|
1174
|
+
(this.headerTemplate && (ruleElem.classList.contains('e-rule-container') ||
|
|
1175
|
+
ruleElem.classList.contains('e-group-container'))));
|
|
1176
|
+
if (!this.enableSeparateConnector || enableSeparateCondition) {
|
|
1177
|
+
index++;
|
|
1178
|
+
}
|
|
810
1179
|
}
|
|
811
1180
|
rules.rules[index] = rule;
|
|
812
1181
|
}
|
|
@@ -824,6 +1193,9 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
824
1193
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
825
1194
|
rules.rules[rules.rules.length - 1].custom = custom;
|
|
826
1195
|
}
|
|
1196
|
+
if (this.enableSeparateConnector) {
|
|
1197
|
+
rules.rules[rules.rules.length - 1].condition = rule.condition ? rule.condition : newRule.condition;
|
|
1198
|
+
}
|
|
827
1199
|
}
|
|
828
1200
|
else {
|
|
829
1201
|
rules.rules.splice(this.ruleIndex + 1, 0, {
|
|
@@ -833,6 +1205,9 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
833
1205
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
834
1206
|
rules.rules[this.ruleIndex + 1].custom = custom;
|
|
835
1207
|
}
|
|
1208
|
+
if (this.enableSeparateConnector) {
|
|
1209
|
+
rules.rules[this.ruleIndex + 1].condition = rule.condition ? rule.condition : newRule.condition;
|
|
1210
|
+
}
|
|
836
1211
|
}
|
|
837
1212
|
}
|
|
838
1213
|
else {
|
|
@@ -846,7 +1221,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
846
1221
|
rules.rules.push(newRule);
|
|
847
1222
|
}
|
|
848
1223
|
}
|
|
849
|
-
this.disableRuleCondition(target, rules);
|
|
1224
|
+
this.disableRuleCondition(target, rules, isNewRuleAdded);
|
|
850
1225
|
}
|
|
851
1226
|
changeRuleTemplate(column, element) {
|
|
852
1227
|
const operVal = this.selectedColumn.operators;
|
|
@@ -924,7 +1299,11 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
924
1299
|
if (validateRule && validateRule.isRequired) {
|
|
925
1300
|
while (indexElem && indexElem.previousElementSibling !== null) {
|
|
926
1301
|
indexElem = indexElem.previousElementSibling;
|
|
927
|
-
|
|
1302
|
+
const separateCondition = this.enableSeparateConnector && ((!this.headerTemplate && !indexElem.classList.contains('e-btn-group')) ||
|
|
1303
|
+
(this.headerTemplate && (indexElem.classList.contains('e-rule-container') || indexElem.classList.contains('e-group-container'))));
|
|
1304
|
+
if (!this.enableSeparateConnector || separateCondition) {
|
|
1305
|
+
index++;
|
|
1306
|
+
}
|
|
928
1307
|
}
|
|
929
1308
|
fieldElem = tempElem.querySelector('.e-rule-operator .e-control');
|
|
930
1309
|
if (!rule.rules[index].operator) {
|
|
@@ -1001,9 +1380,10 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1001
1380
|
obj.level = this.levelColl[obj.groupElement.id].slice();
|
|
1002
1381
|
return obj;
|
|
1003
1382
|
}
|
|
1004
|
-
groupTemplate() {
|
|
1383
|
+
groupTemplate(isConnector) {
|
|
1005
1384
|
let glueElem;
|
|
1006
1385
|
let inputElem;
|
|
1386
|
+
let dragClsName;
|
|
1007
1387
|
let labelElem;
|
|
1008
1388
|
let grpActElem;
|
|
1009
1389
|
let groupBtn;
|
|
@@ -1016,9 +1396,27 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1016
1396
|
groupElem.appendChild(grpBodyElem);
|
|
1017
1397
|
// create button group in OR and AND process
|
|
1018
1398
|
if (!this.headerTemplate) {
|
|
1019
|
-
|
|
1399
|
+
if (this.allowDragAndDrop) {
|
|
1400
|
+
dragClsName = 'e-icons e-drag-qb-rule';
|
|
1401
|
+
}
|
|
1402
|
+
else {
|
|
1403
|
+
dragClsName = 'e-icons e-drag-qb-rule e-hidden';
|
|
1404
|
+
}
|
|
1405
|
+
const spanDragElement = this.createElement('span', { attrs: { class: dragClsName, 'aria-lable': 'drag handle',
|
|
1406
|
+
title: 'drag handle' } });
|
|
1407
|
+
groupHdrElem.appendChild(spanDragElement);
|
|
1408
|
+
const className = this.enableSeparateConnector && !isConnector ? 'e-lib e-btn-group e-qb-toggle-btn' : 'e-lib e-btn-group';
|
|
1409
|
+
glueElem = this.createElement('div', { attrs: { class: className, role: 'group' } });
|
|
1410
|
+
if (this.enableSeparateConnector) {
|
|
1411
|
+
glueElem.classList.add('e-multi-connector');
|
|
1412
|
+
}
|
|
1020
1413
|
if (this.enableNotCondition) {
|
|
1021
|
-
|
|
1414
|
+
if (this.enableSeparateConnector) {
|
|
1415
|
+
inputElem = this.createElement('input', { attrs: { type: 'checkbox', class: 'e-qb-toggle' } });
|
|
1416
|
+
}
|
|
1417
|
+
else {
|
|
1418
|
+
inputElem = this.createElement('button', { attrs: { type: 'button', class: 'e-qb-toggle' } });
|
|
1419
|
+
}
|
|
1022
1420
|
glueElem.appendChild(inputElem);
|
|
1023
1421
|
}
|
|
1024
1422
|
inputElem = this.createElement('input', { attrs: { type: 'radio', class: 'e-btngroup-and', value: 'AND' } });
|
|
@@ -1033,8 +1431,16 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1033
1431
|
glueElem.appendChild(labelElem);
|
|
1034
1432
|
groupHdrElem.appendChild(glueElem);
|
|
1035
1433
|
grpActElem = this.createElement('div', { attrs: { class: 'e-group-action' } });
|
|
1036
|
-
|
|
1037
|
-
|
|
1434
|
+
if (this.enableSeparateConnector) {
|
|
1435
|
+
groupBtn = this.createElement('button', { attrs: { type: 'button', class: 'e-add-condition-btn' } });
|
|
1436
|
+
grpActElem.appendChild(groupBtn);
|
|
1437
|
+
groupBtn = this.createElement('button', { attrs: { type: 'button', class: 'e-add-group-btn' } });
|
|
1438
|
+
grpActElem.appendChild(groupBtn);
|
|
1439
|
+
}
|
|
1440
|
+
else {
|
|
1441
|
+
groupBtn = this.createElement('button', { attrs: { type: 'button', class: 'e-add-btn' } });
|
|
1442
|
+
grpActElem.appendChild(groupBtn);
|
|
1443
|
+
}
|
|
1038
1444
|
groupHdrElem.appendChild(grpActElem);
|
|
1039
1445
|
}
|
|
1040
1446
|
return groupElem;
|
|
@@ -1044,9 +1450,19 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1044
1450
|
let clsName;
|
|
1045
1451
|
let cloneClsName;
|
|
1046
1452
|
let lockClsName;
|
|
1453
|
+
let dragClsName;
|
|
1047
1454
|
const ruleElem = this.createElement('div');
|
|
1048
1455
|
const fieldElem = this.createElement('div', { attrs: { class: 'e-rule-field' } });
|
|
1049
1456
|
tempElem = this.createElement('div', { attrs: { class: 'e-rule-filter' } });
|
|
1457
|
+
if (this.allowDragAndDrop) {
|
|
1458
|
+
dragClsName = 'e-icons e-drag-qb-rule';
|
|
1459
|
+
}
|
|
1460
|
+
else {
|
|
1461
|
+
dragClsName = 'e-icons e-drag-qb-rule e-hidden';
|
|
1462
|
+
}
|
|
1463
|
+
const spanDragElement = this.createElement('span', { attrs: { class: dragClsName, 'aria-lable': 'drag handle',
|
|
1464
|
+
title: 'drag handle' } });
|
|
1465
|
+
fieldElem.appendChild(spanDragElement);
|
|
1050
1466
|
const filterElem = this.createElement('input', { attrs: { type: 'text', class: 'e-filter-input' } });
|
|
1051
1467
|
tempElem.appendChild(filterElem);
|
|
1052
1468
|
fieldElem.appendChild(tempElem);
|
|
@@ -1089,7 +1505,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1089
1505
|
}
|
|
1090
1506
|
addGroupElement(isGroup, target, condition, isBtnClick, not, isRoot, rule) {
|
|
1091
1507
|
const args = { groupID: target.id.replace(this.element.id + '_', ''), cancel: false, type: 'insertGroup' };
|
|
1092
|
-
if (!this.isImportRules && !this.isInitialLoad) {
|
|
1508
|
+
if (!this.isImportRules && !this.isInitialLoad && !this.prvtEvtTgrDaD) {
|
|
1093
1509
|
this.trigger('beforeChange', args, (observedChangeArgs) => {
|
|
1094
1510
|
this.addGroupSuccess(observedChangeArgs, isGroup, target, condition, isBtnClick, not, isRoot, rule);
|
|
1095
1511
|
});
|
|
@@ -1110,8 +1526,17 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1110
1526
|
else {
|
|
1111
1527
|
groupID = target.id;
|
|
1112
1528
|
}
|
|
1529
|
+
if (this.enableSeparateConnector) {
|
|
1530
|
+
this.groupElem = this.groupTemplate();
|
|
1531
|
+
}
|
|
1113
1532
|
const groupElem = this.groupElem.cloneNode(true);
|
|
1114
1533
|
groupElem.setAttribute('id', this.element.id + '_group' + this.groupIdCounter);
|
|
1534
|
+
if (this.groupIdCounter === 0 && this.allowDragAndDrop && groupElem.querySelector('.e-drag-qb-rule')) {
|
|
1535
|
+
if (groupElem && groupElem.children[0]) {
|
|
1536
|
+
groupElem.children[0].classList.add('e-parent-header');
|
|
1537
|
+
}
|
|
1538
|
+
addClass([groupElem.querySelector('.e-drag-qb-rule')], 'e-hidden');
|
|
1539
|
+
}
|
|
1115
1540
|
if (this.headerTemplate) {
|
|
1116
1541
|
if (isRoot) {
|
|
1117
1542
|
isGroup = false;
|
|
@@ -1164,7 +1589,25 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1164
1589
|
this.isLastGroup = true;
|
|
1165
1590
|
}
|
|
1166
1591
|
else {
|
|
1167
|
-
|
|
1592
|
+
if (this.enableSeparateConnector) {
|
|
1593
|
+
let index = 0;
|
|
1594
|
+
let tempGroupIndex = this.groupIndex + 1;
|
|
1595
|
+
for (let i = 0; i < tempGroupIndex; i++) {
|
|
1596
|
+
if (childElems[i].classList.contains('e-rule-container')) {
|
|
1597
|
+
tempGroupIndex++;
|
|
1598
|
+
index++;
|
|
1599
|
+
}
|
|
1600
|
+
}
|
|
1601
|
+
if (index > 0) {
|
|
1602
|
+
index--;
|
|
1603
|
+
}
|
|
1604
|
+
const idx = this.groupIndex + index + 1;
|
|
1605
|
+
childElems[idx].parentNode.insertBefore(groupElem, childElems[idx]);
|
|
1606
|
+
}
|
|
1607
|
+
else {
|
|
1608
|
+
const idx = this.groupIndex + 1;
|
|
1609
|
+
childElems[idx].parentNode.insertBefore(groupElem, childElems[idx]);
|
|
1610
|
+
}
|
|
1168
1611
|
this.isMiddleGroup = true;
|
|
1169
1612
|
}
|
|
1170
1613
|
}
|
|
@@ -1230,7 +1673,14 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1230
1673
|
if (this.enableNotCondition) {
|
|
1231
1674
|
if (!this.headerTemplate) {
|
|
1232
1675
|
const notElem = groupElem.querySelector('.e-qb-toggle');
|
|
1233
|
-
|
|
1676
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1677
|
+
let tglBtn;
|
|
1678
|
+
if (this.enableSeparateConnector) {
|
|
1679
|
+
tglBtn = new CheckBox({ label: this.l10n.getConstant('NOT'), cssClass: 'e-qb-toggle' });
|
|
1680
|
+
}
|
|
1681
|
+
else {
|
|
1682
|
+
tglBtn = new Button({ content: this.l10n.getConstant('NOT'), cssClass: 'e-btn e-small' });
|
|
1683
|
+
}
|
|
1234
1684
|
tglBtn.appendTo(notElem);
|
|
1235
1685
|
groupElem.querySelector('.e-btngroup-and-lbl').classList.add('e-not');
|
|
1236
1686
|
if (this.updatedRule && this.updatedRule.not) {
|
|
@@ -1238,6 +1688,56 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1238
1688
|
}
|
|
1239
1689
|
}
|
|
1240
1690
|
}
|
|
1691
|
+
if (this.enableSeparateConnector && !this.headerTemplate) {
|
|
1692
|
+
let andElem = groupElem.querySelector('.e-btngroup-and');
|
|
1693
|
+
let orElem = groupElem.querySelector('.e-btngroup-or');
|
|
1694
|
+
const btnGroup = groupElem.querySelector('.e-btn-group');
|
|
1695
|
+
for (let i = 0; i < btnGroup.childNodes.length; i++) {
|
|
1696
|
+
if (groupElem.querySelector('.e-btn-group').childNodes[i].textContent.toLowerCase() === 'not') {
|
|
1697
|
+
if (!this.enableNotCondition) {
|
|
1698
|
+
btnGroup.childNodes[i].style.display = 'none';
|
|
1699
|
+
}
|
|
1700
|
+
else {
|
|
1701
|
+
btnGroup.childNodes[i].classList.add('e-multiconnector');
|
|
1702
|
+
}
|
|
1703
|
+
}
|
|
1704
|
+
else {
|
|
1705
|
+
btnGroup.childNodes[i].style.display = 'none';
|
|
1706
|
+
}
|
|
1707
|
+
}
|
|
1708
|
+
const prevSibling = groupElem.previousElementSibling;
|
|
1709
|
+
if (prevSibling) {
|
|
1710
|
+
if (isNullOrUndefined(this.headerTemplate)) {
|
|
1711
|
+
groupElem.parentElement.insertBefore(this.groupTemplate(true).querySelector('.e-btn-group'), groupElem);
|
|
1712
|
+
const notElem = groupElem.previousElementSibling.childNodes[0];
|
|
1713
|
+
if (notElem.classList.contains('e-qb-toggle')) {
|
|
1714
|
+
notElem.style.display = 'none';
|
|
1715
|
+
}
|
|
1716
|
+
}
|
|
1717
|
+
if (!this.isImportRules) {
|
|
1718
|
+
const groupElement = groupElem.previousElementSibling;
|
|
1719
|
+
const newAndElem = groupElement.querySelector('.e-btngroup-and');
|
|
1720
|
+
const newOrElem = groupElement.querySelector('.e-btngroup-or');
|
|
1721
|
+
if (!andElem.checked && !orElem.checked) {
|
|
1722
|
+
const nextSibling = groupElem.nextElementSibling;
|
|
1723
|
+
if (nextSibling && nextSibling.classList.contains('e-btn-group')) {
|
|
1724
|
+
andElem = nextSibling.querySelector('.e-btngroup-and');
|
|
1725
|
+
orElem = nextSibling.querySelector('.e-btngroup-or');
|
|
1726
|
+
newAndElem.checked = andElem.checked;
|
|
1727
|
+
newOrElem.checked = orElem.checked;
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
else if (this.enableSeparateConnector) {
|
|
1731
|
+
if (andElem.checked) {
|
|
1732
|
+
newAndElem.checked = true;
|
|
1733
|
+
}
|
|
1734
|
+
if (orElem.checked) {
|
|
1735
|
+
newOrElem.checked = true;
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1738
|
+
}
|
|
1739
|
+
}
|
|
1740
|
+
}
|
|
1241
1741
|
this.updatedRule = null;
|
|
1242
1742
|
if (this.headerTemplate) {
|
|
1243
1743
|
const args = { requestType: 'header-template-create', ruleID: groupElem.id, condition: condition,
|
|
@@ -1245,60 +1745,161 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1245
1745
|
this.trigger('actionBegin', args);
|
|
1246
1746
|
}
|
|
1247
1747
|
else {
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1748
|
+
if (this.enableSeparateConnector) {
|
|
1749
|
+
const conditionBtn = groupElem.querySelector('.e-add-condition-btn');
|
|
1750
|
+
let btnObj = new Button({ cssClass: this.element.id + '_addConditionbtn', content: this.l10n.getConstant('AddCondition') });
|
|
1751
|
+
btnObj.appendTo(conditionBtn);
|
|
1752
|
+
btnObj.element.onclick = () => {
|
|
1753
|
+
this.addRuleElement(closest(conditionBtn, '.e-group-container'), {});
|
|
1754
|
+
};
|
|
1755
|
+
const groupBtn = groupElem.querySelector('.e-add-group-btn');
|
|
1756
|
+
btnObj = new Button({ cssClass: this.element.id + '_addGroupbtn', content: this.l10n.getConstant('AddGroup') });
|
|
1757
|
+
btnObj.appendTo(groupBtn);
|
|
1758
|
+
btnObj.element.onclick = () => {
|
|
1759
|
+
this.addGroupElement(true, closest(groupBtn, '.e-group-container'), '', true);
|
|
1760
|
+
};
|
|
1761
|
+
}
|
|
1762
|
+
else {
|
|
1763
|
+
const groupBtn = groupElem.querySelector('.e-add-btn');
|
|
1764
|
+
const btnObj = new DropDownButton({
|
|
1765
|
+
items: this.items,
|
|
1766
|
+
cssClass: 'e-round e-small e-caret-hide e-addrulegroup',
|
|
1767
|
+
iconCss: 'e-icons e-add-icon',
|
|
1768
|
+
beforeOpen: this.selectBtn.bind(this, groupBtn),
|
|
1769
|
+
select: this.selectBtn.bind(this, groupBtn)
|
|
1770
|
+
});
|
|
1771
|
+
btnObj.appendTo(groupBtn);
|
|
1772
|
+
groupBtn.setAttribute('title', this.l10n.getConstant('AddButton'));
|
|
1773
|
+
}
|
|
1258
1774
|
}
|
|
1259
|
-
if (!this.isImportRules) {
|
|
1775
|
+
if (!this.isImportRules && !this.prvtEvtTgrDaD) {
|
|
1260
1776
|
const grpId = target.id.replace(this.element.id + '_', '');
|
|
1261
1777
|
const chgrpId = groupElem.id.replace(this.element.id + '_', '');
|
|
1262
1778
|
this.trigger('change', { groupID: grpId, type: 'insertGroup', childGroupID: chgrpId });
|
|
1263
1779
|
}
|
|
1264
1780
|
}
|
|
1265
1781
|
}
|
|
1266
|
-
|
|
1782
|
+
setMultiConnector(trgt) {
|
|
1783
|
+
if (this.enableSeparateConnector && !this.headerTemplate) {
|
|
1784
|
+
if (trgt.previousElementSibling && this.groupElem.querySelector('.e-btn-group')) {
|
|
1785
|
+
trgt.parentElement.insertBefore(this.groupTemplate(true).querySelector('.e-btn-group'), trgt);
|
|
1786
|
+
const notElem = trgt.previousElementSibling.childNodes[0];
|
|
1787
|
+
if (notElem.classList.contains('e-qb-toggle')) {
|
|
1788
|
+
notElem.style.display = 'none';
|
|
1789
|
+
}
|
|
1790
|
+
this.addHeaderDiv(trgt);
|
|
1791
|
+
}
|
|
1792
|
+
}
|
|
1793
|
+
}
|
|
1794
|
+
addHeaderDiv(elem) {
|
|
1795
|
+
let prevRule;
|
|
1796
|
+
const prevElem = elem.previousElementSibling.previousElementSibling;
|
|
1797
|
+
if (prevElem) {
|
|
1798
|
+
if (prevElem.id.indexOf('rule') > -1) {
|
|
1799
|
+
prevRule = this.getRule(prevElem);
|
|
1800
|
+
}
|
|
1801
|
+
else {
|
|
1802
|
+
prevRule = this.getGroup(prevElem);
|
|
1803
|
+
}
|
|
1804
|
+
if (isNullOrUndefined(prevRule.condition)) {
|
|
1805
|
+
prevRule.condition = 'and';
|
|
1806
|
+
}
|
|
1807
|
+
const orElem = elem.previousElementSibling.querySelector('.e-btngroup-or');
|
|
1808
|
+
const andElem = elem.previousElementSibling.querySelector('.e-btngroup-and');
|
|
1809
|
+
orElem.disabled = false;
|
|
1810
|
+
andElem.disabled = false;
|
|
1811
|
+
if (prevRule.condition === 'or') {
|
|
1812
|
+
orElem.checked = true;
|
|
1813
|
+
}
|
|
1814
|
+
else {
|
|
1815
|
+
andElem.checked = true;
|
|
1816
|
+
}
|
|
1817
|
+
}
|
|
1818
|
+
}
|
|
1819
|
+
headerTemplateFn(groupElem, not, condition, rule, groupID, isInitialRule) {
|
|
1267
1820
|
let template;
|
|
1268
1821
|
const templateID = this.element.id + '_header';
|
|
1269
1822
|
let args;
|
|
1270
|
-
|
|
1823
|
+
let groupHdr = groupElem.querySelector('.e-group-header');
|
|
1824
|
+
if (this.enableSeparateConnector && groupElem.id.indexOf('rule') !== -1) {
|
|
1825
|
+
groupHdr = groupElem;
|
|
1826
|
+
}
|
|
1271
1827
|
if (this.headerTemplate) {
|
|
1272
1828
|
args = { requestType: 'header-template-initialize', ruleID: groupElem.id,
|
|
1273
1829
|
notCondition: this.enableNotCondition ? not : undefined,
|
|
1274
1830
|
condition: condition, rule: this.getRuleCollection(rule, true), groupID: groupID };
|
|
1275
1831
|
this.trigger('actionBegin', args);
|
|
1832
|
+
if (this.enableSeparateConnector && groupElem.id.indexOf('rule') !== -1) {
|
|
1833
|
+
args.requestType = 'rule-template-create';
|
|
1834
|
+
}
|
|
1276
1835
|
this.headerFn = this.templateParser(this.headerTemplate);
|
|
1277
1836
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1278
1837
|
if (this.isReact) {
|
|
1279
1838
|
template = this.headerFn(args, this, groupElem.id, templateID)[0];
|
|
1280
|
-
|
|
1839
|
+
if (this.enableSeparateConnector && isInitialRule) {
|
|
1840
|
+
this.enableSeparateConnectorInitialRule(groupElem, template);
|
|
1841
|
+
}
|
|
1842
|
+
else if (this.enableSeparateConnector && groupElem.id.indexOf('rule') !== -1) {
|
|
1843
|
+
groupHdr.parentElement.insertBefore(template, groupHdr.nextElementSibling);
|
|
1844
|
+
}
|
|
1845
|
+
else {
|
|
1846
|
+
groupHdr.appendChild(template);
|
|
1847
|
+
}
|
|
1281
1848
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1282
1849
|
}
|
|
1283
1850
|
else if (this.isAngular) {
|
|
1284
1851
|
const templateColl = this.headerFn(args, this, groupElem.id, templateID);
|
|
1285
1852
|
template = (templateColl[0].nodeType === 3) ? templateColl[1] : templateColl[0];
|
|
1286
|
-
|
|
1853
|
+
if (this.enableSeparateConnector && isInitialRule) {
|
|
1854
|
+
this.enableSeparateConnectorInitialRule(groupElem, template);
|
|
1855
|
+
}
|
|
1856
|
+
else if (this.enableSeparateConnector && groupElem.id.indexOf('rule') !== -1) {
|
|
1857
|
+
groupHdr.parentElement.insertBefore(template, groupHdr.nextElementSibling);
|
|
1858
|
+
}
|
|
1859
|
+
else {
|
|
1860
|
+
groupHdr.appendChild(template);
|
|
1861
|
+
}
|
|
1287
1862
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1288
1863
|
}
|
|
1289
1864
|
else if (this.isVue3) {
|
|
1290
1865
|
template = this.headerFn(args, this, groupElem.id, templateID);
|
|
1291
|
-
|
|
1292
|
-
|
|
1866
|
+
if (this.enableSeparateConnector && isInitialRule) {
|
|
1867
|
+
this.enableSeparateConnectorInitialRule(groupElem, template);
|
|
1868
|
+
}
|
|
1869
|
+
else if (this.enableSeparateConnector && groupElem.id.indexOf('rule') !== -1) {
|
|
1870
|
+
groupHdr.parentElement.insertBefore(template, groupHdr.nextElementSibling);
|
|
1871
|
+
}
|
|
1872
|
+
else {
|
|
1873
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1874
|
+
append(template, groupHdr);
|
|
1875
|
+
}
|
|
1293
1876
|
}
|
|
1294
1877
|
else {
|
|
1295
1878
|
template = this.headerFn(args, this, 'Template', templateID)[0];
|
|
1296
|
-
|
|
1879
|
+
if (this.enableSeparateConnector && isInitialRule) {
|
|
1880
|
+
this.enableSeparateConnectorInitialRule(groupElem, template);
|
|
1881
|
+
}
|
|
1882
|
+
else if (this.enableSeparateConnector && groupElem.id.indexOf('rule') !== -1) {
|
|
1883
|
+
groupHdr.parentElement.insertBefore(template, groupHdr.nextElementSibling);
|
|
1884
|
+
}
|
|
1885
|
+
else {
|
|
1886
|
+
groupHdr.appendChild(template);
|
|
1887
|
+
}
|
|
1297
1888
|
}
|
|
1298
1889
|
this.renderReactTemplates();
|
|
1299
1890
|
}
|
|
1300
1891
|
return groupElem;
|
|
1301
1892
|
}
|
|
1893
|
+
enableSeparateConnectorInitialRule(groupElem, template) {
|
|
1894
|
+
const elem = groupElem.nextElementSibling ? groupElem.nextElementSibling : groupElem;
|
|
1895
|
+
let group = elem.closest('.e-group-container');
|
|
1896
|
+
if (!groupElem.nextElementSibling && group) {
|
|
1897
|
+
group = group.nextElementSibling ? group.nextElementSibling : group;
|
|
1898
|
+
}
|
|
1899
|
+
if (group) {
|
|
1900
|
+
group.parentElement.insertBefore(template, group);
|
|
1901
|
+
}
|
|
1902
|
+
}
|
|
1302
1903
|
/**
|
|
1303
1904
|
* Notify the changes to component.
|
|
1304
1905
|
*
|
|
@@ -1309,7 +1910,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1309
1910
|
*/
|
|
1310
1911
|
notifyChange(value, element, type) {
|
|
1311
1912
|
const grpElement = closest(element, '.e-group-container');
|
|
1312
|
-
|
|
1913
|
+
let rules = this.getParentGroup(grpElement);
|
|
1313
1914
|
let ruleElement = closest(element, '.e-rule-container');
|
|
1314
1915
|
let index = 0;
|
|
1315
1916
|
if (type === 'not') {
|
|
@@ -1317,12 +1918,29 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1317
1918
|
return;
|
|
1318
1919
|
}
|
|
1319
1920
|
if (type === 'condition') {
|
|
1320
|
-
|
|
1921
|
+
if (this.enableSeparateConnector) {
|
|
1922
|
+
ruleElement = element.parentElement.previousElementSibling;
|
|
1923
|
+
if (ruleElement && ruleElement.classList.contains('e-group-container')) {
|
|
1924
|
+
ruleElement = ruleElement.querySelectorAll('.e-rule-container')[ruleElement.querySelectorAll('.e-rule-container').length - 1];
|
|
1925
|
+
}
|
|
1926
|
+
if (ruleElement && ruleElement.classList.contains('e-rule-container')) {
|
|
1927
|
+
rules = this.getRule(ruleElement);
|
|
1928
|
+
}
|
|
1929
|
+
rules.condition = value;
|
|
1930
|
+
}
|
|
1931
|
+
else {
|
|
1932
|
+
rules.condition = value;
|
|
1933
|
+
}
|
|
1321
1934
|
return;
|
|
1322
1935
|
}
|
|
1323
1936
|
while (ruleElement && ruleElement.previousElementSibling !== null) {
|
|
1324
1937
|
ruleElement = ruleElement.previousElementSibling;
|
|
1325
|
-
|
|
1938
|
+
if (!this.enableSeparateConnector || (this.enableSeparateConnector &&
|
|
1939
|
+
((!this.headerTemplate && !ruleElement.classList.contains('e-btn-group')) ||
|
|
1940
|
+
this.headerTemplate && (ruleElement.classList.contains('e-rule-container') ||
|
|
1941
|
+
ruleElement.classList.contains('e-group-container'))))) {
|
|
1942
|
+
index++;
|
|
1943
|
+
}
|
|
1326
1944
|
}
|
|
1327
1945
|
const rule = rules.rules[index];
|
|
1328
1946
|
const column = this.getColumn(rule.field);
|
|
@@ -1359,7 +1977,12 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1359
1977
|
}
|
|
1360
1978
|
while (ruleElem && ruleElem.previousElementSibling !== null) {
|
|
1361
1979
|
ruleElem = ruleElem.previousElementSibling;
|
|
1362
|
-
|
|
1980
|
+
if (!this.enableSeparateConnector || (this.enableSeparateConnector &&
|
|
1981
|
+
((!this.headerTemplate && !ruleElem.classList.contains('e-btn-group')) ||
|
|
1982
|
+
this.headerTemplate && (ruleElem.classList.contains('e-rule-container') ||
|
|
1983
|
+
ruleElem.classList.contains('e-group-container'))))) {
|
|
1984
|
+
index++;
|
|
1985
|
+
}
|
|
1363
1986
|
}
|
|
1364
1987
|
const rule = rules.rules[index];
|
|
1365
1988
|
if (type === 'field') {
|
|
@@ -1416,12 +2039,14 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1416
2039
|
else {
|
|
1417
2040
|
ruleElement.className = 'e-rule-container e-horizontal-mode';
|
|
1418
2041
|
}
|
|
1419
|
-
if (
|
|
1420
|
-
if (ruleElement.className.indexOf('e-
|
|
1421
|
-
ruleElement.className
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
ruleElement.previousElementSibling.className
|
|
2042
|
+
if (!this.enableSeparateConnector) {
|
|
2043
|
+
if (ruleElement.previousElementSibling && ruleElement.previousElementSibling.className.indexOf('e-rule-container') > -1) {
|
|
2044
|
+
if (ruleElement.className.indexOf('e-joined-rule') < 0) {
|
|
2045
|
+
ruleElement.className += ' e-joined-rule';
|
|
2046
|
+
}
|
|
2047
|
+
if (ruleElement.previousElementSibling.className.indexOf('e-prev-joined-rule') < 0) {
|
|
2048
|
+
ruleElement.previousElementSibling.className += ' e-prev-joined-rule';
|
|
2049
|
+
}
|
|
1425
2050
|
}
|
|
1426
2051
|
}
|
|
1427
2052
|
if (ruleElement.previousElementSibling && ruleElement.previousElementSibling.className.indexOf('e-group-container') > -1 &&
|
|
@@ -1485,8 +2110,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1485
2110
|
let value;
|
|
1486
2111
|
let rbValue;
|
|
1487
2112
|
if (element.className.indexOf('e-radio') > -1) {
|
|
1488
|
-
|
|
1489
|
-
rbValue = parseInt(element.id.split('valuekey')[1], 0);
|
|
2113
|
+
rbValue = parseInt(element.id.split('valuekey')[1], 10);
|
|
1490
2114
|
if (this.fieldMode === 'Default') {
|
|
1491
2115
|
dropDownObj = getComponent(closest(element, '.e-rule-container').querySelector('.e-filter-input'), 'dropdownlist');
|
|
1492
2116
|
this.selectedColumn = dropDownObj.getDataByValue(dropDownObj.value);
|
|
@@ -1516,7 +2140,9 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1516
2140
|
if (args.type === 'input' && args.currentTarget) {
|
|
1517
2141
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1518
2142
|
value = Number(args.currentTarget.value);
|
|
1519
|
-
|
|
2143
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2144
|
+
const elem = args.currentTarget;
|
|
2145
|
+
const numericTextBoxObj = getInstance(elem, NumericTextBox);
|
|
1520
2146
|
numericTextBoxObj.value = value;
|
|
1521
2147
|
this.isNumInput = true;
|
|
1522
2148
|
}
|
|
@@ -1624,7 +2250,12 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1624
2250
|
let index = 0;
|
|
1625
2251
|
while (ruleElem && ruleElem.previousElementSibling !== null) {
|
|
1626
2252
|
ruleElem = ruleElem.previousElementSibling;
|
|
1627
|
-
|
|
2253
|
+
if (!this.enableSeparateConnector || (this.enableSeparateConnector &&
|
|
2254
|
+
((!this.headerTemplate && !ruleElem.classList.contains('e-btn-group')) ||
|
|
2255
|
+
this.headerTemplate && (ruleElem.classList.contains('e-rule-container') ||
|
|
2256
|
+
ruleElem.classList.contains('e-group-container'))))) {
|
|
2257
|
+
index++;
|
|
2258
|
+
}
|
|
1628
2259
|
}
|
|
1629
2260
|
rules.rules[index].value = '';
|
|
1630
2261
|
this.changeRule(rules.rules[index], args);
|
|
@@ -1669,7 +2300,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1669
2300
|
const ruleID = ruleElem.id.replace(this.element.id + '_', '');
|
|
1670
2301
|
const eventsArgs = { groupID: grID, ruleID: ruleID, selectedField: this.fieldMode === 'DropdownTree' ?
|
|
1671
2302
|
dl.value[0] : dl.value, cancel: false, type: 'field' };
|
|
1672
|
-
if (!this.isImportRules) {
|
|
2303
|
+
if (!this.isImportRules && !this.prvtEvtTgrDaD) {
|
|
1673
2304
|
this.trigger('beforeChange', eventsArgs, (observedChangeArgs) => {
|
|
1674
2305
|
this.fieldChangeSuccess(observedChangeArgs, tmpRl, flt, rl, dArg);
|
|
1675
2306
|
});
|
|
@@ -1839,7 +2470,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1839
2470
|
if (valElem && this.getColumn(rule.field).template) {
|
|
1840
2471
|
filterElem = operatorElem.previousElementSibling;
|
|
1841
2472
|
}
|
|
1842
|
-
if (valElem.children.length
|
|
2473
|
+
if (valElem.children.length === 0) {
|
|
1843
2474
|
filterElem = operatorElem.previousElementSibling;
|
|
1844
2475
|
}
|
|
1845
2476
|
this.changeRuleValues(filterElem, rule, tempRule, ddlArgs);
|
|
@@ -1893,7 +2524,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1893
2524
|
value = '';
|
|
1894
2525
|
ddlIdx = -1;
|
|
1895
2526
|
}
|
|
1896
|
-
if (this.isImportRules || (this.ruleIndex > -1 || this.groupIndex > -1)) {
|
|
2527
|
+
if (this.isImportRules || (this.ruleIndex > -1 || this.groupIndex > -1 || this.prvtEvtTgrDaD)) {
|
|
1897
2528
|
value = rule ? (rule.operator ? rule.operator : value) : value;
|
|
1898
2529
|
}
|
|
1899
2530
|
let ddlOperator;
|
|
@@ -2273,14 +2904,15 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
2273
2904
|
const columnData = this.getItemData(parentId);
|
|
2274
2905
|
let selectedValue;
|
|
2275
2906
|
const isTemplate = (typeof columnData.template === 'string');
|
|
2276
|
-
if (this.isImportRules || this.ruleIndex > -1 || this.groupIndex > -1 || this.isPublic || isTemplate || rule.value
|
|
2907
|
+
if (this.isImportRules || this.ruleIndex > -1 || this.groupIndex > -1 || this.isPublic || isTemplate || rule.value !== '') {
|
|
2277
2908
|
selectedValue = rule.value;
|
|
2278
2909
|
}
|
|
2279
2910
|
else {
|
|
2280
2911
|
selectedValue = this.setDefaultValue(parentId, false, false);
|
|
2281
2912
|
}
|
|
2282
2913
|
if ((operator === 'in' || operator === 'notin') && (this.dataColl.length || columnData.values)) {
|
|
2283
|
-
selectedVal = (this.isImportRules || this.ruleIndex > -1 || this.groupIndex > -1) ? rule.value :
|
|
2914
|
+
selectedVal = (this.isImportRules || this.ruleIndex > -1 || this.groupIndex > -1 || this.isPublic) ? rule.value :
|
|
2915
|
+
this.setDefaultValue(parentId, true, false);
|
|
2284
2916
|
this.renderMultiSelect(columnData, parentId, idx, selectedVal, columnData.values);
|
|
2285
2917
|
if (this.displayMode === 'Vertical' || this.element.className.indexOf('e-device') > -1) {
|
|
2286
2918
|
ruleValElem.style.width = '100%';
|
|
@@ -2292,7 +2924,8 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
2292
2924
|
}
|
|
2293
2925
|
else {
|
|
2294
2926
|
if (operator === 'in' || operator === 'notin') {
|
|
2295
|
-
selectedVal = (this.isImportRules || this.ruleIndex > -1 || this.groupIndex > -1) ? rule.value :
|
|
2927
|
+
selectedVal = (this.isImportRules || this.ruleIndex > -1 || this.groupIndex > -1) ? rule.value :
|
|
2928
|
+
this.setDefaultValue(parentId, true, false);
|
|
2296
2929
|
selectedValue = selectedVal.join(',');
|
|
2297
2930
|
}
|
|
2298
2931
|
let txtBox;
|
|
@@ -2312,9 +2945,11 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
2312
2945
|
renderNumberValue(parentId, rule, operator, idx, ruleValElem, itemData, length) {
|
|
2313
2946
|
const columnData = this.getItemData(parentId);
|
|
2314
2947
|
const isTemplate = (typeof columnData.template === 'string');
|
|
2315
|
-
let selectedVal = (this.isImportRules || this.ruleIndex > -1 || this.groupIndex > -1 || this.isPublic || isTemplate ||
|
|
2948
|
+
let selectedVal = (this.isImportRules || this.ruleIndex > -1 || this.groupIndex > -1 || this.isPublic || isTemplate ||
|
|
2949
|
+
typeof rule.value === 'number') ? rule.value : this.setDefaultValue(parentId, false, true);
|
|
2316
2950
|
if ((operator === 'in' || operator === 'notin') && (this.dataColl.length || columnData.values)) {
|
|
2317
|
-
selectedVal = (this.isImportRules || this.ruleIndex > -1 || this.groupIndex > -1) ? rule.value :
|
|
2951
|
+
selectedVal = (this.isImportRules || this.ruleIndex > -1 || this.groupIndex > -1 || this.isPublic) ? rule.value :
|
|
2952
|
+
this.setDefaultValue(parentId, true, false);
|
|
2318
2953
|
this.renderMultiSelect(columnData, parentId, idx, selectedVal, columnData.values);
|
|
2319
2954
|
if (this.element.className.indexOf('e-device') > -1 || this.displayMode === 'Vertical') {
|
|
2320
2955
|
ruleValElem.style.width = '100%';
|
|
@@ -2325,7 +2960,8 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
2325
2960
|
}
|
|
2326
2961
|
}
|
|
2327
2962
|
else if (operator === 'in' || operator === 'notin') {
|
|
2328
|
-
selectedVal = (this.isImportRules || this.ruleIndex > -1 || this.groupIndex > -1) ? rule.value :
|
|
2963
|
+
selectedVal = (this.isImportRules || this.ruleIndex > -1 || this.groupIndex > -1) ? rule.value :
|
|
2964
|
+
this.setDefaultValue(parentId, true, false);
|
|
2329
2965
|
const selVal = selectedVal.join(',');
|
|
2330
2966
|
let txtInp;
|
|
2331
2967
|
txtInp = {
|
|
@@ -2786,10 +3422,14 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
2786
3422
|
}
|
|
2787
3423
|
const controlName = element.className.split(' e-')[idx];
|
|
2788
3424
|
const i = parseInt(element.id.slice(-1), 2);
|
|
3425
|
+
let column;
|
|
3426
|
+
let format;
|
|
3427
|
+
let selectedDate;
|
|
3428
|
+
let value;
|
|
3429
|
+
let radioBtnObj;
|
|
2789
3430
|
switch (controlName) {
|
|
2790
3431
|
case 'checkbox':
|
|
2791
|
-
|
|
2792
|
-
const value = getComponent(element, controlName).value;
|
|
3432
|
+
value = getComponent(element, controlName).value;
|
|
2793
3433
|
rule.value = (value !== '') ? value : undefined;
|
|
2794
3434
|
break;
|
|
2795
3435
|
case 'textbox':
|
|
@@ -2799,8 +3439,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
2799
3439
|
rule.value = getComponent(element, controlName).value;
|
|
2800
3440
|
break;
|
|
2801
3441
|
case 'radio':
|
|
2802
|
-
|
|
2803
|
-
const radioBtnObj = getComponent(element, controlName);
|
|
3442
|
+
radioBtnObj = getComponent(element, controlName);
|
|
2804
3443
|
if (radioBtnObj.checked) {
|
|
2805
3444
|
if (typeof rule.value === 'boolean') {
|
|
2806
3445
|
rule.value = radioBtnObj.value === 'true';
|
|
@@ -2828,12 +3467,9 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
2828
3467
|
}
|
|
2829
3468
|
break;
|
|
2830
3469
|
case 'datepicker':
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
const format = this.getFormat(column.format);
|
|
2835
|
-
// eslint-disable-next-line
|
|
2836
|
-
const selectedDate = getComponent(element, controlName).value;
|
|
3470
|
+
column = this.getColumn(rule.field);
|
|
3471
|
+
format = this.getFormat(column.format);
|
|
3472
|
+
selectedDate = getComponent(element, controlName).value;
|
|
2837
3473
|
if (rule.operator.indexOf('between') > -1) {
|
|
2838
3474
|
if (typeof rule.value === 'string') {
|
|
2839
3475
|
rule.value = [];
|
|
@@ -2866,7 +3502,12 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
2866
3502
|
const beforeRules = this.getValidRules(this.rule);
|
|
2867
3503
|
while (ruleElem && ruleElem.previousElementSibling !== null) {
|
|
2868
3504
|
ruleElem = ruleElem.previousElementSibling;
|
|
2869
|
-
|
|
3505
|
+
if (!this.enableSeparateConnector || (this.enableSeparateConnector &&
|
|
3506
|
+
((!this.headerTemplate && !ruleElem.classList.contains('e-btn-group')) ||
|
|
3507
|
+
this.headerTemplate && (ruleElem.classList.contains('e-rule-container') ||
|
|
3508
|
+
ruleElem.classList.contains('e-group-container'))))) {
|
|
3509
|
+
index++;
|
|
3510
|
+
}
|
|
2870
3511
|
}
|
|
2871
3512
|
let operator = rule.rules[index].operator ? rule.rules[index].operator.toString() : '';
|
|
2872
3513
|
ruleElem = closest(target, '.e-rule-container');
|
|
@@ -2915,7 +3556,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
2915
3556
|
}
|
|
2916
3557
|
this.updateValues(elementCln[i], rule.rules[index]);
|
|
2917
3558
|
}
|
|
2918
|
-
if (!this.isImportRules) {
|
|
3559
|
+
if (!this.isImportRules && !this.prvtEvtTgrDaD) {
|
|
2919
3560
|
this.trigger('change', eventsArgs);
|
|
2920
3561
|
}
|
|
2921
3562
|
if (this.allowValidation && rule.rules[index].field && target.parentElement.className.indexOf('e-tooltip') > -1) {
|
|
@@ -2960,7 +3601,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
2960
3601
|
const beforeRuleStr = JSON.stringify({ condition: beforeRule.condition, not: beforeRule.not, rule: beforeRule.rules });
|
|
2961
3602
|
const afetrRuleStr = JSON.stringify({ condition: afterRule.condition, not: afterRule.not, rule: afterRule.rules });
|
|
2962
3603
|
if (beforeRuleStr !== afetrRuleStr) {
|
|
2963
|
-
if (!this.isImportRules) {
|
|
3604
|
+
if (!this.isImportRules && !this.prvtEvtTgrDaD) {
|
|
2964
3605
|
this.trigger('ruleChange', { previousRule: beforeRule, rule: afterRule, type: type });
|
|
2965
3606
|
}
|
|
2966
3607
|
}
|
|
@@ -3127,7 +3768,6 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3127
3768
|
let len;
|
|
3128
3769
|
let tooltip;
|
|
3129
3770
|
super.destroy();
|
|
3130
|
-
let popupElement;
|
|
3131
3771
|
element = this.element.querySelectorAll('.e-addrulegroup');
|
|
3132
3772
|
len = element.length;
|
|
3133
3773
|
for (i = 0; i < len; i++) {
|
|
@@ -3173,7 +3813,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3173
3813
|
if (this.portals && this.portals.length) {
|
|
3174
3814
|
this.clearQBTemplate();
|
|
3175
3815
|
}
|
|
3176
|
-
popupElement = document.querySelectorAll('.qb-dropdownlist.e-popup');
|
|
3816
|
+
const popupElement = document.querySelectorAll('.qb-dropdownlist.e-popup');
|
|
3177
3817
|
if (popupElement) {
|
|
3178
3818
|
for (i = 0; i < popupElement.length; i++) {
|
|
3179
3819
|
popupElement[i].remove();
|
|
@@ -3246,7 +3886,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3246
3886
|
}
|
|
3247
3887
|
}
|
|
3248
3888
|
if (!this.headerTemplate) {
|
|
3249
|
-
this.disableRuleCondition(groupElem, rule);
|
|
3889
|
+
this.disableRuleCondition(groupElem, rule, null, this.enableSeparateConnector ? true : null);
|
|
3250
3890
|
}
|
|
3251
3891
|
}
|
|
3252
3892
|
}
|
|
@@ -3255,6 +3895,9 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3255
3895
|
if (this.cssClass) {
|
|
3256
3896
|
addClass([this.element], this.cssClass.replace(/\s+/g, ' ').trim().split(' '));
|
|
3257
3897
|
}
|
|
3898
|
+
if (this.enableSeparateConnector) {
|
|
3899
|
+
addClass([this.element], 'e-multi-connector');
|
|
3900
|
+
}
|
|
3258
3901
|
if (this.enableRtl) {
|
|
3259
3902
|
addClass([this.element], 'e-rtl');
|
|
3260
3903
|
}
|
|
@@ -3291,14 +3934,14 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3291
3934
|
}
|
|
3292
3935
|
}
|
|
3293
3936
|
else {
|
|
3294
|
-
if (this.columns.length && this.isImportRules) {
|
|
3937
|
+
if (this.columns && this.columns.length && this.isImportRules) {
|
|
3295
3938
|
this.addGroupElement(false, this.element, this.rule.condition, false, this.rule.not, false, this.rule);
|
|
3296
3939
|
const mRules = extend({}, this.rule, {}, true);
|
|
3297
3940
|
this.isRefreshed = true;
|
|
3298
3941
|
this.setGroupRules(mRules);
|
|
3299
3942
|
this.isRefreshed = false;
|
|
3300
3943
|
}
|
|
3301
|
-
else if (this.columns.length) {
|
|
3944
|
+
else if (this.columns && this.columns.length) {
|
|
3302
3945
|
this.addRuleElement(this.element.querySelector('.e-group-container'), {});
|
|
3303
3946
|
}
|
|
3304
3947
|
this.notGroupRtl();
|
|
@@ -3352,8 +3995,8 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3352
3995
|
this.groupIdCounter = 0;
|
|
3353
3996
|
if (!this.headerTemplate) {
|
|
3354
3997
|
if (this.enableNotCondition) {
|
|
3355
|
-
|
|
3356
|
-
|
|
3998
|
+
const inputElem = this.createElement('button', { attrs: { type: 'button', class: 'e-qb-toggle' } });
|
|
3999
|
+
if (this.groupElem.querySelector('.e-btn-group')) {
|
|
3357
4000
|
this.groupElem.querySelector('.e-btn-group').insertBefore(inputElem, this.groupElem.querySelector('.e-btngroup-and'));
|
|
3358
4001
|
}
|
|
3359
4002
|
}
|
|
@@ -3394,13 +4037,11 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3394
4037
|
}
|
|
3395
4038
|
onPropertyChanged(newProp, oldProp) {
|
|
3396
4039
|
const properties = Object.keys(newProp);
|
|
4040
|
+
const groupElem = this.element.querySelector('.e-group-container');
|
|
4041
|
+
let summaryElem = this.element.querySelector('.e-summary-content');
|
|
3397
4042
|
for (const prop of properties) {
|
|
3398
4043
|
switch (prop) {
|
|
3399
4044
|
case 'summaryView':
|
|
3400
|
-
// eslint-disable-next-line
|
|
3401
|
-
const groupElem = this.element.querySelector('.e-group-container');
|
|
3402
|
-
// eslint-disable-next-line
|
|
3403
|
-
let summaryElem = this.element.querySelector('.e-summary-content');
|
|
3404
4045
|
if (newProp.summaryView) {
|
|
3405
4046
|
groupElem.style.display = 'none';
|
|
3406
4047
|
if (this.element.querySelectorAll('.e-summary-content').length < 1) {
|
|
@@ -3540,6 +4181,14 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3540
4181
|
this.isReadonly = newProp.readonly;
|
|
3541
4182
|
this.enableReadonly();
|
|
3542
4183
|
break;
|
|
4184
|
+
case 'allowDragAndDrop':
|
|
4185
|
+
this.allowDragAndDrop = newProp.allowDragAndDrop;
|
|
4186
|
+
this.refresh();
|
|
4187
|
+
break;
|
|
4188
|
+
case 'enableSeparateConnector':
|
|
4189
|
+
this.enableSeparateConnector = newProp.enableSeparateConnector;
|
|
4190
|
+
this.refresh();
|
|
4191
|
+
break;
|
|
3543
4192
|
}
|
|
3544
4193
|
}
|
|
3545
4194
|
}
|
|
@@ -3697,6 +4346,134 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3697
4346
|
this.initControl();
|
|
3698
4347
|
}
|
|
3699
4348
|
this.renderComplete();
|
|
4349
|
+
if (this.allowDragAndDrop) {
|
|
4350
|
+
this.initializeDrag();
|
|
4351
|
+
}
|
|
4352
|
+
}
|
|
4353
|
+
initializeDrag() {
|
|
4354
|
+
this.draggable = new Draggable(this.element, {
|
|
4355
|
+
dragTarget: '.e-drag-qb-rule',
|
|
4356
|
+
distance: 5,
|
|
4357
|
+
helper: this.helper.bind(this),
|
|
4358
|
+
dragStart: this.dragStartHandler.bind(this),
|
|
4359
|
+
drag: this.dragHandler.bind(this),
|
|
4360
|
+
dragStop: this.dragStopHandler.bind(this),
|
|
4361
|
+
isReplaceDragEle: true,
|
|
4362
|
+
isPreventSelect: false,
|
|
4363
|
+
abort: '.e-parent-header',
|
|
4364
|
+
isDragScroll: true
|
|
4365
|
+
});
|
|
4366
|
+
}
|
|
4367
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
4368
|
+
helper(e) {
|
|
4369
|
+
const target = this.draggable.currentStateTarget;
|
|
4370
|
+
if (!target.classList.contains('e-drag-qb-rule') || (target.classList.contains('e-drag-qb-rule') && closest(target, '.e-disable'))) {
|
|
4371
|
+
return false;
|
|
4372
|
+
}
|
|
4373
|
+
const visualElement = this.createElement('div', {
|
|
4374
|
+
className: 'e-cloneproperties e-draganddrop e-dragclone',
|
|
4375
|
+
styles: 'height:"auto", z-index:2, width:' + this.element.offsetWidth
|
|
4376
|
+
});
|
|
4377
|
+
let cloneElement;
|
|
4378
|
+
if (this.draggable.currentStateTarget.parentElement.classList.contains('e-group-header')) {
|
|
4379
|
+
cloneElement = closest(target, '.e-group-container').cloneNode(true);
|
|
4380
|
+
closest(target, '.e-group-container').classList.add('e-qb-dragging-rule');
|
|
4381
|
+
}
|
|
4382
|
+
else {
|
|
4383
|
+
visualElement.classList.add('e-group-body');
|
|
4384
|
+
cloneElement = this.createElement('div', { className: 'e-rule-container' });
|
|
4385
|
+
const ruleElement = closest(target, '.e-rule-field').cloneNode(true);
|
|
4386
|
+
cloneElement.appendChild(ruleElement);
|
|
4387
|
+
closest(target, '.e-rule-field').classList.add('e-qb-dragging-rule');
|
|
4388
|
+
}
|
|
4389
|
+
visualElement.appendChild(cloneElement);
|
|
4390
|
+
const childElements = visualElement.querySelectorAll('*');
|
|
4391
|
+
childElements.forEach((child) => {
|
|
4392
|
+
child.removeAttribute('id');
|
|
4393
|
+
});
|
|
4394
|
+
this.element.appendChild(visualElement);
|
|
4395
|
+
return visualElement;
|
|
4396
|
+
}
|
|
4397
|
+
dragStartHandler(e) {
|
|
4398
|
+
this.draggedRule = e.target;
|
|
4399
|
+
this.isDragEventPrevent = false;
|
|
4400
|
+
document.body.classList.add('e-prevent-select');
|
|
4401
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4402
|
+
this.dragElement = e.dragElement;
|
|
4403
|
+
const rule = closest(e.target, '.e-rule-container');
|
|
4404
|
+
const group = closest(e.target, '.e-group-container');
|
|
4405
|
+
const dragEventArgs = { dragRuleID: rule !== null ? rule.id : group.id, dragGroupID: group.id, cancel: false };
|
|
4406
|
+
this.trigger('dragStart', dragEventArgs);
|
|
4407
|
+
this.isDragEventPrevent = dragEventArgs.cancel;
|
|
4408
|
+
}
|
|
4409
|
+
dragHandler(e) {
|
|
4410
|
+
if (this.isDragEventPrevent) {
|
|
4411
|
+
return;
|
|
4412
|
+
}
|
|
4413
|
+
let borderLineElem = this.element.querySelectorAll('.e-drag-rule-bottom-line');
|
|
4414
|
+
borderLineElem.forEach((ele) => {
|
|
4415
|
+
ele.classList.remove('e-drag-rule-bottom-line');
|
|
4416
|
+
});
|
|
4417
|
+
borderLineElem = this.element.querySelectorAll('.e-drag-rule-top-line');
|
|
4418
|
+
borderLineElem.forEach((ele) => {
|
|
4419
|
+
ele.classList.remove('e-drag-rule-top-line');
|
|
4420
|
+
});
|
|
4421
|
+
if (isNullOrUndefined(e.target)) {
|
|
4422
|
+
return;
|
|
4423
|
+
}
|
|
4424
|
+
if (e.target.nodeName === 'HTML' || closest(e.target, '.e-qb-dragging-rule') || closest(e.target, '.e-group-header') ||
|
|
4425
|
+
!closest(e.target, '#' + this.element.id) || closest(e.target, '.e-disable') || (e.target.parentElement && e.target.parentElement.classList.contains('e-btn-group') && this.enableSeparateConnector)) {
|
|
4426
|
+
this.dragElement.classList.add('e-notallowedcur');
|
|
4427
|
+
return;
|
|
4428
|
+
}
|
|
4429
|
+
else {
|
|
4430
|
+
this.dragElement.classList.remove('e-notallowedcur');
|
|
4431
|
+
}
|
|
4432
|
+
const targetElem = closest(e.target, '.e-rule-container');
|
|
4433
|
+
let grpElem = closest(e.target, '.e-group-container');
|
|
4434
|
+
if (targetElem) {
|
|
4435
|
+
const rect = targetElem.getBoundingClientRect();
|
|
4436
|
+
const mouseY = e.event.clientY || e.event.changedTouches[0].clientY;
|
|
4437
|
+
const distanceToTop = mouseY - rect.top;
|
|
4438
|
+
const distanceToBottom = rect.bottom - mouseY;
|
|
4439
|
+
const threshold = 20; // Adjust as needed
|
|
4440
|
+
if (distanceToTop < threshold) {
|
|
4441
|
+
targetElem.classList.add('e-drag-rule-top-line');
|
|
4442
|
+
}
|
|
4443
|
+
else if (distanceToBottom < threshold) {
|
|
4444
|
+
targetElem.classList.add('e-drag-rule-bottom-line');
|
|
4445
|
+
}
|
|
4446
|
+
}
|
|
4447
|
+
else if (e.target.classList.contains('e-rule-list') && e.target.children.length === 0) {
|
|
4448
|
+
e.target.classList.add('e-drag-rule-bottom-line');
|
|
4449
|
+
}
|
|
4450
|
+
else if (e.target.classList.contains('e-rule-list') && e.target.children[0].classList.contains('e-group-container')) {
|
|
4451
|
+
const rect = e.target.children[0].getBoundingClientRect();
|
|
4452
|
+
const mouseY = e.event.clientY || e.event.changedTouches[0].clientY;
|
|
4453
|
+
const distanceToTop = mouseY - rect.top;
|
|
4454
|
+
const threshold = 20; // Adjust as needed
|
|
4455
|
+
if (distanceToTop < threshold) {
|
|
4456
|
+
e.target.classList.add('e-drag-rule-top-line');
|
|
4457
|
+
}
|
|
4458
|
+
}
|
|
4459
|
+
else if (closest(e.target, '.e-group-container') || e.target.classList.contains('e-group-container')) {
|
|
4460
|
+
if (!grpElem) {
|
|
4461
|
+
grpElem = e.target;
|
|
4462
|
+
}
|
|
4463
|
+
if (grpElem.id.indexOf('group0') > -1) {
|
|
4464
|
+
const rect = e.target.getBoundingClientRect();
|
|
4465
|
+
const mouseY = e.event.clientY || e.event.changedTouches[0].clientY;
|
|
4466
|
+
const distanceToBottom = rect.bottom - mouseY;
|
|
4467
|
+
const threshold = 20; // Adjust as needed
|
|
4468
|
+
if (distanceToBottom < threshold) {
|
|
4469
|
+
e.target.classList.add('e-drag-rule-bottom-line');
|
|
4470
|
+
}
|
|
4471
|
+
}
|
|
4472
|
+
}
|
|
4473
|
+
const dragEventArgs = { dragRuleID: targetElem !== null ? targetElem.id : grpElem !== null ? grpElem.id : null,
|
|
4474
|
+
dragGroupID: grpElem !== null ? grpElem.id : null, cancel: false };
|
|
4475
|
+
this.trigger('drag', dragEventArgs);
|
|
4476
|
+
this.isDragEventPrevent = dragEventArgs.cancel;
|
|
3700
4477
|
}
|
|
3701
4478
|
templateParser(template) {
|
|
3702
4479
|
if (template) {
|
|
@@ -3740,6 +4517,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3740
4517
|
EventHandler.add(wrapper, 'focusout', this.focusEventHandler, this);
|
|
3741
4518
|
EventHandler.add(wrapper, 'focusin', this.focusEventHandler, this);
|
|
3742
4519
|
EventHandler.add(this.element, 'keydown', this.keyBoardHandler, this);
|
|
4520
|
+
EventHandler.add(document, 'keydown', this.keyBoardHandler, this);
|
|
3743
4521
|
}
|
|
3744
4522
|
unWireEvents() {
|
|
3745
4523
|
const wrapper = this.getWrapper();
|
|
@@ -3747,6 +4525,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3747
4525
|
EventHandler.remove(wrapper, 'focusout', this.focusEventHandler);
|
|
3748
4526
|
EventHandler.remove(wrapper, 'focusin', this.focusEventHandler);
|
|
3749
4527
|
EventHandler.remove(this.element, 'keydown', this.keyBoardHandler);
|
|
4528
|
+
EventHandler.remove(document, 'keydown', this.keyBoardHandler);
|
|
3750
4529
|
}
|
|
3751
4530
|
getParentGroup(target, isParent) {
|
|
3752
4531
|
const groupLevel = (target instanceof Element) ? this.levelColl[target.id] : this.levelColl[`${target}`];
|
|
@@ -3774,7 +4553,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3774
4553
|
groupId = groupElem.id.replace(this.element.id + '_', '');
|
|
3775
4554
|
}
|
|
3776
4555
|
const args = { groupID: groupId, cancel: false, type: 'deleteGroup' };
|
|
3777
|
-
if (!this.isImportRules) {
|
|
4556
|
+
if (!this.isImportRules && !this.prvtEvtTgrDaD) {
|
|
3778
4557
|
this.trigger('beforeChange', args, (observedChangeArgs) => {
|
|
3779
4558
|
this.deleteGroupSuccessCallBack(observedChangeArgs, target);
|
|
3780
4559
|
});
|
|
@@ -3804,13 +4583,20 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3804
4583
|
}
|
|
3805
4584
|
while (groupElem.previousElementSibling !== null) {
|
|
3806
4585
|
groupElem = groupElem.previousElementSibling;
|
|
3807
|
-
|
|
4586
|
+
if (!this.enableSeparateConnector || (this.enableSeparateConnector &&
|
|
4587
|
+
((!this.headerTemplate && !groupElem.classList.contains('e-btn-group')) ||
|
|
4588
|
+
this.headerTemplate && (groupElem.classList.contains('e-rule-container') ||
|
|
4589
|
+
groupElem.classList.contains('e-group-container'))))) {
|
|
4590
|
+
index++;
|
|
4591
|
+
}
|
|
3808
4592
|
}
|
|
3809
|
-
if (
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
4593
|
+
if (!this.enableSeparateConnector) {
|
|
4594
|
+
if (nextElem && nextElem.className.indexOf('e-separate-rule') > -1) {
|
|
4595
|
+
removeClass([nextElem], 'e-separate-rule');
|
|
4596
|
+
addClass([nextElem], 'e-joined-rule');
|
|
4597
|
+
if (prevElem && prevElem.className.indexOf('e-rule-container') > -1) {
|
|
4598
|
+
addClass([prevElem], 'e-prev-joined-rule');
|
|
4599
|
+
}
|
|
3814
4600
|
}
|
|
3815
4601
|
}
|
|
3816
4602
|
const elem = groupElem.parentElement.parentElement.parentElement;
|
|
@@ -3842,7 +4628,11 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3842
4628
|
delete this.levelColl[args.groupID];
|
|
3843
4629
|
this.refreshLevelColl();
|
|
3844
4630
|
this.disableRuleCondition(elem, rule);
|
|
3845
|
-
if (!this.
|
|
4631
|
+
if (this.enableSeparateConnector && prevElem && ((!this.headerTemplate && prevElem.classList.contains('e-btn-group')) ||
|
|
4632
|
+
(this.headerTemplate && prevElem.classList.contains('e-custom-group-btn')))) {
|
|
4633
|
+
detach(prevElem);
|
|
4634
|
+
}
|
|
4635
|
+
if (!this.isImportRules && !this.prvtEvtTgrDaD) {
|
|
3846
4636
|
this.trigger('change', args);
|
|
3847
4637
|
}
|
|
3848
4638
|
this.filterRules(beforeRules, this.getValidRules(this.rule), 'deleteGroup');
|
|
@@ -3858,7 +4648,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3858
4648
|
const groupID = groupElem.id.replace(this.element.id + '_', '');
|
|
3859
4649
|
const ruleID = closest(target, '.e-rule-container').id.replace(this.element.id + '_', '');
|
|
3860
4650
|
const args = { groupID: groupID, ruleID: ruleID, cancel: false, type: 'deleteRule' };
|
|
3861
|
-
if (!this.isImportRules) {
|
|
4651
|
+
if (!this.isImportRules && !this.prvtEvtTgrDaD) {
|
|
3862
4652
|
this.trigger('beforeChange', args, (observedChangeArgs) => {
|
|
3863
4653
|
this.deleteRuleSuccessCallBack(observedChangeArgs, target);
|
|
3864
4654
|
});
|
|
@@ -3873,10 +4663,10 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3873
4663
|
const rule = this.getParentGroup(groupElem);
|
|
3874
4664
|
let ruleElem = closest(target, '.e-rule-container');
|
|
3875
4665
|
const beforeRules = this.getValidRules(this.rule);
|
|
3876
|
-
const clnruleElem = ruleElem;
|
|
3877
|
-
const nextElem = ruleElem.nextElementSibling;
|
|
3878
4666
|
const prevElem = ruleElem.previousElementSibling;
|
|
3879
4667
|
let index = 0;
|
|
4668
|
+
const clnruleElem = ruleElem;
|
|
4669
|
+
const nextElem = ruleElem.nextElementSibling;
|
|
3880
4670
|
const valElem = ruleElem.querySelectorAll('.e-tooltip');
|
|
3881
4671
|
let i;
|
|
3882
4672
|
const len = valElem.length;
|
|
@@ -3885,7 +4675,12 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3885
4675
|
}
|
|
3886
4676
|
while (ruleElem.previousElementSibling !== null) {
|
|
3887
4677
|
ruleElem = ruleElem.previousElementSibling;
|
|
3888
|
-
|
|
4678
|
+
if (!this.enableSeparateConnector || (this.enableSeparateConnector &&
|
|
4679
|
+
((!this.headerTemplate && !ruleElem.classList.contains('e-btn-group')) ||
|
|
4680
|
+
this.headerTemplate && (ruleElem.classList.contains('e-rule-container') ||
|
|
4681
|
+
ruleElem.classList.contains('e-group-container'))))) {
|
|
4682
|
+
index++;
|
|
4683
|
+
}
|
|
3889
4684
|
}
|
|
3890
4685
|
const column = this.getColumn(rule.rules[index].field);
|
|
3891
4686
|
if (column && column.template && clnruleElem.querySelector('.e-template')) {
|
|
@@ -3904,17 +4699,27 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3904
4699
|
const isTemplateRendered = clnruleElem.querySelector('.e-template-value');
|
|
3905
4700
|
// eslint-disable
|
|
3906
4701
|
try {
|
|
4702
|
+
if (this.enableSeparateConnector && (clnruleElem.previousElementSibling || clnruleElem.nextElementSibling)) {
|
|
4703
|
+
const previousElem = clnruleElem.previousElementSibling;
|
|
4704
|
+
const nextElem = clnruleElem.nextElementSibling;
|
|
4705
|
+
if (isNullOrUndefined(nextElem) && ((!this.headerTemplate && previousElem.classList.contains('e-btn-group'))
|
|
4706
|
+
|| (this.headerTemplate && previousElem.classList.contains('e-custom-group-btn')))) {
|
|
4707
|
+
if (previousElem && previousElem.previousElementSibling && previousElem.previousElementSibling.classList.contains('e-rule-container')) {
|
|
4708
|
+
const rule = this.getRule(previousElem.previousElementSibling);
|
|
4709
|
+
rule.condition = null;
|
|
4710
|
+
}
|
|
4711
|
+
detach(previousElem);
|
|
4712
|
+
}
|
|
4713
|
+
else if ((!this.headerTemplate && nextElem.classList.contains('e-btn-group'))
|
|
4714
|
+
|| (this.headerTemplate && nextElem.classList.contains('e-custom-group-btn'))) {
|
|
4715
|
+
detach(nextElem);
|
|
4716
|
+
}
|
|
4717
|
+
}
|
|
3907
4718
|
detach(clnruleElem);
|
|
3908
4719
|
}
|
|
3909
4720
|
catch (err) {
|
|
3910
|
-
|
|
3911
|
-
err = [];
|
|
3912
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3913
|
-
const error = 'error';
|
|
3914
|
-
// eslint-disable-next-line
|
|
3915
|
-
err[error] = error;
|
|
4721
|
+
return;
|
|
3916
4722
|
}
|
|
3917
|
-
// eslint-enable
|
|
3918
4723
|
if (column && column.ruleTemplate) {
|
|
3919
4724
|
this.clearQBTemplate([clnruleElem.id]);
|
|
3920
4725
|
}
|
|
@@ -3923,13 +4728,13 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3923
4728
|
}
|
|
3924
4729
|
rule.rules.splice(index, 1);
|
|
3925
4730
|
if (!(rule.rules[0] && rule.rules[0].rules)) {
|
|
3926
|
-
this.disableRuleCondition(groupElem, rule);
|
|
4731
|
+
this.disableRuleCondition(groupElem, rule, this.enableSeparateConnector ? true : false);
|
|
3927
4732
|
}
|
|
3928
4733
|
const tooltipElem = this.element.querySelectorAll('.e-tooltip');
|
|
3929
4734
|
for (let i = 0; i < tooltipElem.length; i++) {
|
|
3930
4735
|
getComponent(tooltipElem[i], 'tooltip').refresh(tooltipElem[i]);
|
|
3931
4736
|
}
|
|
3932
|
-
if (!this.isImportRules) {
|
|
4737
|
+
if (!this.isImportRules && !this.prvtEvtTgrDaD) {
|
|
3933
4738
|
this.trigger('change', args);
|
|
3934
4739
|
}
|
|
3935
4740
|
this.filterRules(beforeRules, this.getValidRules(this.rule), 'deleteRule');
|
|
@@ -3953,9 +4758,32 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3953
4758
|
this.isImportRules = false;
|
|
3954
4759
|
}
|
|
3955
4760
|
keyBoardHandler(e) {
|
|
3956
|
-
if (this.readonly && (e.keyCode === 38 || e.keyCode === 40 || e.keyCode === 13)) {
|
|
4761
|
+
if (e.currentTarget === this.element && this.readonly && (e.keyCode === 38 || e.keyCode === 40 || e.keyCode === 13)) {
|
|
3957
4762
|
e.preventDefault();
|
|
3958
4763
|
}
|
|
4764
|
+
else if (e.code === 'Escape' && this.allowDragAndDrop) {
|
|
4765
|
+
this.isDragEventPrevent = true;
|
|
4766
|
+
document.body.classList.remove('e-prevent-select');
|
|
4767
|
+
let borderLineElem = this.element.querySelectorAll('.e-drag-rule-bottom-line');
|
|
4768
|
+
borderLineElem.forEach((ele) => {
|
|
4769
|
+
ele.classList.remove('e-drag-rule-bottom-line');
|
|
4770
|
+
});
|
|
4771
|
+
borderLineElem = this.element.querySelectorAll('.e-drag-rule-top-line');
|
|
4772
|
+
borderLineElem.forEach((ele) => {
|
|
4773
|
+
ele.classList.remove('e-drag-rule-top-line');
|
|
4774
|
+
});
|
|
4775
|
+
borderLineElem = this.element.querySelectorAll('.e-qb-dragging-rule');
|
|
4776
|
+
borderLineElem.forEach((ele) => {
|
|
4777
|
+
ele.classList.remove('e-qb-dragging-rule');
|
|
4778
|
+
});
|
|
4779
|
+
const dragElemnet = this.element.querySelector('.e-cloneproperties');
|
|
4780
|
+
if (dragElemnet) {
|
|
4781
|
+
remove(dragElemnet);
|
|
4782
|
+
}
|
|
4783
|
+
if (this.enableSeparateConnector) {
|
|
4784
|
+
this.refresh();
|
|
4785
|
+
}
|
|
4786
|
+
}
|
|
3959
4787
|
}
|
|
3960
4788
|
clearQBTemplate(ruleElemColl) {
|
|
3961
4789
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -3963,14 +4791,14 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3963
4791
|
this.clearTemplate(ruleElemColl);
|
|
3964
4792
|
}
|
|
3965
4793
|
}
|
|
3966
|
-
disableRuleCondition(groupElem, rules) {
|
|
4794
|
+
disableRuleCondition(groupElem, rules, isNewRuleAdded, isNewGroup) {
|
|
3967
4795
|
if (!this.headerTemplate) {
|
|
3968
4796
|
if (this.readonly) {
|
|
3969
4797
|
return;
|
|
3970
4798
|
}
|
|
3971
4799
|
const count = groupElem.querySelector('.e-rule-list').childElementCount;
|
|
3972
|
-
|
|
3973
|
-
|
|
4800
|
+
let andElem = groupElem.querySelector('.e-btngroup-and');
|
|
4801
|
+
let orElem = groupElem.querySelector('.e-btngroup-or');
|
|
3974
4802
|
if (count > 1) {
|
|
3975
4803
|
andElem.disabled = false;
|
|
3976
4804
|
orElem.disabled = false;
|
|
@@ -3979,21 +4807,124 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3979
4807
|
orElem.nextElementSibling.classList.remove('e-btn-disable');
|
|
3980
4808
|
andElem.nextElementSibling.classList.remove('e-btn-disable');
|
|
3981
4809
|
}
|
|
3982
|
-
if (
|
|
3983
|
-
|
|
4810
|
+
if (this.enableSeparateConnector && !isNewRuleAdded) {
|
|
4811
|
+
let index = 0;
|
|
4812
|
+
let element;
|
|
4813
|
+
// eslint-disable-next-line no-constant-condition
|
|
4814
|
+
while (true) {
|
|
4815
|
+
const andGroup = groupElem.parentElement.querySelectorAll('.e-btngroup-and');
|
|
4816
|
+
const orGroup = groupElem.parentElement.querySelectorAll('.e-btngroup-or');
|
|
4817
|
+
andElem = andGroup[andGroup.length - (1 + index)];
|
|
4818
|
+
orElem = orGroup[orGroup.length - (1 + index)];
|
|
4819
|
+
element = andGroup[andGroup.length - (1 + index)];
|
|
4820
|
+
if (element && element.parentElement && element.parentElement.style.display === 'none') {
|
|
4821
|
+
index++;
|
|
4822
|
+
}
|
|
4823
|
+
else {
|
|
4824
|
+
break;
|
|
4825
|
+
}
|
|
4826
|
+
}
|
|
4827
|
+
let elem = groupElem.previousElementSibling;
|
|
4828
|
+
while (elem && !elem.classList.contains('e-rule-container')) {
|
|
4829
|
+
if (elem.classList.contains('e-group-container')) {
|
|
4830
|
+
elem = elem.querySelectorAll('.e-rule-container')[elem.querySelectorAll('.e-rule-container').length - 1];
|
|
4831
|
+
break;
|
|
4832
|
+
}
|
|
4833
|
+
elem = elem.previousElementSibling;
|
|
4834
|
+
}
|
|
4835
|
+
if (isNewGroup && groupElem.classList.contains('e-group-container')) {
|
|
4836
|
+
elem = groupElem;
|
|
4837
|
+
const prevRule = this.getGroup(elem);
|
|
4838
|
+
if (prevRule.condition === 'or') {
|
|
4839
|
+
orElem.checked = true;
|
|
4840
|
+
}
|
|
4841
|
+
else {
|
|
4842
|
+
andElem.checked = true;
|
|
4843
|
+
}
|
|
4844
|
+
}
|
|
4845
|
+
else if (elem && elem.classList.contains('e-rule-container')) {
|
|
4846
|
+
const ruleID = elem.id.replace(this.element.id + '_', '');
|
|
4847
|
+
const prevRule = this.getRule(ruleID);
|
|
4848
|
+
if (prevRule.condition === 'or') {
|
|
4849
|
+
orElem.checked = true;
|
|
4850
|
+
}
|
|
4851
|
+
else {
|
|
4852
|
+
andElem.checked = true;
|
|
4853
|
+
}
|
|
4854
|
+
}
|
|
3984
4855
|
}
|
|
3985
|
-
else {
|
|
3986
|
-
|
|
4856
|
+
else if (!isNewRuleAdded) {
|
|
4857
|
+
if (rules && rules.condition === 'or') {
|
|
4858
|
+
orElem.checked = true;
|
|
4859
|
+
}
|
|
4860
|
+
else {
|
|
4861
|
+
andElem.checked = true;
|
|
4862
|
+
}
|
|
3987
4863
|
}
|
|
3988
4864
|
}
|
|
3989
4865
|
else {
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
4866
|
+
if (this.enableSeparateConnector && !isNewRuleAdded) {
|
|
4867
|
+
let index = 0;
|
|
4868
|
+
let element;
|
|
4869
|
+
// eslint-disable-next-line no-constant-condition
|
|
4870
|
+
while (true) {
|
|
4871
|
+
const andGroup = groupElem.parentElement.querySelectorAll('.e-btngroup-and');
|
|
4872
|
+
const orGroup = groupElem.parentElement.querySelectorAll('.e-btngroup-or');
|
|
4873
|
+
andElem = andGroup[andGroup.length - (1 + index)];
|
|
4874
|
+
orElem = orGroup[orGroup.length - (1 + index)];
|
|
4875
|
+
element = andGroup[andGroup.length - (1 + index)];
|
|
4876
|
+
if (element && element.parentElement && element.parentElement.style.display === 'none') {
|
|
4877
|
+
index++;
|
|
4878
|
+
}
|
|
4879
|
+
else {
|
|
4880
|
+
break;
|
|
4881
|
+
}
|
|
4882
|
+
}
|
|
4883
|
+
let elem;
|
|
4884
|
+
let tempElem = groupElem.previousElementSibling;
|
|
4885
|
+
while (tempElem) {
|
|
4886
|
+
if (tempElem.classList.contains('e-group-container')) {
|
|
4887
|
+
tempElem = tempElem.querySelectorAll('.e-rule-container')[tempElem.querySelectorAll('.e-rule-container').length - 1];
|
|
4888
|
+
}
|
|
4889
|
+
if (tempElem.classList.contains('e-rule-container')) {
|
|
4890
|
+
elem = tempElem;
|
|
4891
|
+
break;
|
|
4892
|
+
}
|
|
4893
|
+
tempElem = tempElem.previousElementSibling;
|
|
4894
|
+
}
|
|
4895
|
+
if (isNullOrUndefined(elem) && groupElem.querySelectorAll('.e-rule-container')[groupElem.querySelectorAll('.e-rule-container').length - 1]) {
|
|
4896
|
+
elem = groupElem.querySelectorAll('.e-rule-container')[groupElem.querySelectorAll('.e-rule-container').length - 1];
|
|
4897
|
+
}
|
|
4898
|
+
if (isNewGroup && groupElem.classList.contains('e-group-container')) {
|
|
4899
|
+
elem = groupElem;
|
|
4900
|
+
const prevRule = this.getGroup(elem);
|
|
4901
|
+
if (prevRule.condition === 'or') {
|
|
4902
|
+
orElem.checked = true;
|
|
4903
|
+
}
|
|
4904
|
+
else {
|
|
4905
|
+
andElem.checked = true;
|
|
4906
|
+
}
|
|
4907
|
+
}
|
|
4908
|
+
else if (elem) {
|
|
4909
|
+
const ruleID = elem.id.replace(this.element.id + '_', '');
|
|
4910
|
+
const prevRule = this.getRule(ruleID);
|
|
4911
|
+
if (prevRule.condition === 'or' && orElem) {
|
|
4912
|
+
orElem.checked = true;
|
|
4913
|
+
}
|
|
4914
|
+
else if (andElem) {
|
|
4915
|
+
andElem.checked = true;
|
|
4916
|
+
}
|
|
4917
|
+
}
|
|
4918
|
+
}
|
|
4919
|
+
else if (!isNewRuleAdded) {
|
|
4920
|
+
andElem.checked = false;
|
|
4921
|
+
andElem.disabled = true;
|
|
4922
|
+
orElem.checked = false;
|
|
4923
|
+
orElem.disabled = true;
|
|
4924
|
+
if (rules) {
|
|
4925
|
+
orElem.nextElementSibling.classList.add('e-btn-disable');
|
|
4926
|
+
andElem.nextElementSibling.classList.add('e-btn-disable');
|
|
4927
|
+
}
|
|
3997
4928
|
}
|
|
3998
4929
|
}
|
|
3999
4930
|
}
|
|
@@ -4097,7 +5028,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
4097
5028
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4098
5029
|
rule.custom = customObj;
|
|
4099
5030
|
}
|
|
4100
|
-
if (rule.rules.length === 0) {
|
|
5031
|
+
if (rule.rules && rule.rules.length === 0) {
|
|
4101
5032
|
rule = {};
|
|
4102
5033
|
}
|
|
4103
5034
|
}
|
|
@@ -4166,7 +5097,12 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
4166
5097
|
const rule = this.getParentGroup(groupElem);
|
|
4167
5098
|
while (ruleElem.previousElementSibling !== null) {
|
|
4168
5099
|
ruleElem = ruleElem.previousElementSibling;
|
|
4169
|
-
|
|
5100
|
+
if (!this.enableSeparateConnector || (this.enableSeparateConnector &&
|
|
5101
|
+
((!this.headerTemplate && !ruleElem.classList.contains('e-btn-group')) ||
|
|
5102
|
+
this.headerTemplate && (ruleElem.classList.contains('e-rule-container') ||
|
|
5103
|
+
ruleElem.classList.contains('e-group-container'))))) {
|
|
5104
|
+
index++;
|
|
5105
|
+
}
|
|
4170
5106
|
}
|
|
4171
5107
|
return rule.rules[index];
|
|
4172
5108
|
}
|
|
@@ -4576,13 +5512,10 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
4576
5512
|
if (value.indexOf(':') > -1 && (value.indexOf('/') < 0 && value.indexOf(',') < 0
|
|
4577
5513
|
&& value.indexOf('-') < 0)) {
|
|
4578
5514
|
currDate = new Date();
|
|
4579
|
-
|
|
4580
|
-
currDate.
|
|
4581
|
-
// eslint-disable-next-line
|
|
4582
|
-
currDate.setMinutes(parseInt(value.split(':')[1]));
|
|
5515
|
+
currDate.setHours(parseInt(value.split(':')[0], 10));
|
|
5516
|
+
currDate.setMinutes(parseInt(value.split(':')[1], 10));
|
|
4583
5517
|
if (value.split(':')[2]) {
|
|
4584
|
-
|
|
4585
|
-
currDate.setSeconds(parseInt(value.split(':')[2]));
|
|
5518
|
+
currDate.setSeconds(parseInt(value.split(':')[2], 10));
|
|
4586
5519
|
}
|
|
4587
5520
|
}
|
|
4588
5521
|
return currDate;
|
|
@@ -4598,17 +5531,43 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
4598
5531
|
parentElem = this.renderGroup(rule, rule.condition, parentElem, not);
|
|
4599
5532
|
}
|
|
4600
5533
|
else {
|
|
4601
|
-
if (rule.rules.length > 1 && !this.headerTemplate) {
|
|
5534
|
+
if (rule.rules && rule.rules.length > 1 && !this.headerTemplate) {
|
|
4602
5535
|
// enable/disable conditions when rule group is added
|
|
4603
|
-
|
|
4604
|
-
|
|
5536
|
+
let orElem = parentElem.querySelector('.e-btngroup-or');
|
|
5537
|
+
let andElem = parentElem.querySelector('.e-btngroup-and');
|
|
5538
|
+
if (this.enableSeparateConnector && parentElem.previousElementSibling) {
|
|
5539
|
+
orElem = parentElem.previousElementSibling.querySelector('.e-btngroup-or');
|
|
5540
|
+
andElem = parentElem.previousElementSibling.querySelector('.e-btngroup-and');
|
|
5541
|
+
}
|
|
4605
5542
|
orElem.disabled = false;
|
|
4606
5543
|
andElem.disabled = false;
|
|
4607
|
-
if (
|
|
4608
|
-
|
|
5544
|
+
if (this.enableSeparateConnector) {
|
|
5545
|
+
let elem = parentElem.previousElementSibling;
|
|
5546
|
+
while (elem && !elem.classList.contains('e-rule-container')) {
|
|
5547
|
+
if (elem.classList.contains('e-group-container')) {
|
|
5548
|
+
elem = elem.querySelectorAll('.e-rule-container')[elem.querySelectorAll('.e-rule-container').length - 1];
|
|
5549
|
+
break;
|
|
5550
|
+
}
|
|
5551
|
+
elem = elem.previousElementSibling;
|
|
5552
|
+
}
|
|
5553
|
+
if (elem && elem.classList.contains('e-rule-container')) {
|
|
5554
|
+
const ruleID = elem.id.replace(this.element.id + '_', '');
|
|
5555
|
+
const prevRule = this.getRule(ruleID);
|
|
5556
|
+
if (prevRule.condition === 'or') {
|
|
5557
|
+
orElem.checked = true;
|
|
5558
|
+
}
|
|
5559
|
+
else {
|
|
5560
|
+
andElem.checked = true;
|
|
5561
|
+
}
|
|
5562
|
+
}
|
|
4609
5563
|
}
|
|
4610
5564
|
else {
|
|
4611
|
-
|
|
5565
|
+
if (rule.condition === 'or') {
|
|
5566
|
+
orElem.checked = true;
|
|
5567
|
+
}
|
|
5568
|
+
else {
|
|
5569
|
+
andElem.checked = true;
|
|
5570
|
+
}
|
|
4612
5571
|
}
|
|
4613
5572
|
}
|
|
4614
5573
|
else {
|
|
@@ -4628,7 +5587,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
4628
5587
|
}
|
|
4629
5588
|
}
|
|
4630
5589
|
}
|
|
4631
|
-
if (rule.rules.length === 0 && this.headerTemplate) {
|
|
5590
|
+
if (rule.rules && rule.rules.length === 0 && this.headerTemplate) {
|
|
4632
5591
|
rule.rules[0] = { 'label': '', 'field': '', 'operator': '', 'type': '', 'value': '' };
|
|
4633
5592
|
}
|
|
4634
5593
|
const ruleColl = rule.rules;
|
|
@@ -4649,10 +5608,6 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
4649
5608
|
const lockGrpTarget = parentElem.querySelector('.e-rule-list').children[i].querySelector('.e-lock-grp-btn');
|
|
4650
5609
|
this.groupLock(lockGrpTarget);
|
|
4651
5610
|
}
|
|
4652
|
-
if (isNullOrUndefined(ruleColl[i].rules) && ruleColl[i].isLocked) {
|
|
4653
|
-
const lockRuleTarget = parentElem.querySelector('.e-rule-list').children[i].querySelector('.e-lock-rule-btn');
|
|
4654
|
-
this.ruleLock(lockRuleTarget);
|
|
4655
|
-
}
|
|
4656
5611
|
}
|
|
4657
5612
|
}
|
|
4658
5613
|
if (parentElem) {
|
|
@@ -4670,7 +5625,17 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
4670
5625
|
if (this.showButtons.cloneGroup && this.cloneGrpBtnClick && this.isMiddleGroup) {
|
|
4671
5626
|
this.isMiddleGroup = false;
|
|
4672
5627
|
this.cloneGrpBtnClick = false;
|
|
4673
|
-
|
|
5628
|
+
let index = 0;
|
|
5629
|
+
let tempGroupIndex = this.groupIndex + 1;
|
|
5630
|
+
if (this.enableSeparateConnector) {
|
|
5631
|
+
for (let i = 0; i < tempGroupIndex; i++) {
|
|
5632
|
+
if (cloneElem[i].classList.contains('e-rule-container')) {
|
|
5633
|
+
tempGroupIndex++;
|
|
5634
|
+
index++;
|
|
5635
|
+
}
|
|
5636
|
+
}
|
|
5637
|
+
}
|
|
5638
|
+
return cloneElem[this.groupIndex + index + 1]; // group added in the middle
|
|
4674
5639
|
}
|
|
4675
5640
|
else if (this.showButtons.cloneGroup && this.cloneGrpBtnClick && this.isLastGroup) {
|
|
4676
5641
|
this.isLastGroup = false;
|
|
@@ -4796,9 +5761,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
4796
5761
|
}
|
|
4797
5762
|
}
|
|
4798
5763
|
}
|
|
4799
|
-
else if (elem.classList.contains('e-btn-disable'))
|
|
4800
|
-
// do nothing
|
|
4801
|
-
}
|
|
5764
|
+
else if (elem.classList.contains('e-btn-disable')) ;
|
|
4802
5765
|
else {
|
|
4803
5766
|
elem.classList.add('e-readonly');
|
|
4804
5767
|
}
|
|
@@ -4838,6 +5801,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
4838
5801
|
for (let j = 0, jLen = rules.rules.length; j < jLen; j++) {
|
|
4839
5802
|
if (rules.rules[j].rules) {
|
|
4840
5803
|
queryStr = this.getSqlString(rules.rules[j], enableEscape, queryStr, sqlLocale);
|
|
5804
|
+
condition = rules.rules[j].condition;
|
|
4841
5805
|
}
|
|
4842
5806
|
else {
|
|
4843
5807
|
const rule = rules.rules[j];
|
|
@@ -4929,8 +5893,10 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
4929
5893
|
if (condition === '' || (rule && rule.condition !== '' && rule.custom && rule.custom.isCustom)) {
|
|
4930
5894
|
condition = rule.condition;
|
|
4931
5895
|
}
|
|
4932
|
-
|
|
4933
|
-
|
|
5896
|
+
if (condition) {
|
|
5897
|
+
condition = sqlLocale ? this.l10n.getConstant(condition.toUpperCase()).toUpperCase() : condition.toUpperCase();
|
|
5898
|
+
queryStr += ' ' + condition + ' ';
|
|
5899
|
+
}
|
|
4934
5900
|
}
|
|
4935
5901
|
}
|
|
4936
5902
|
}
|
|
@@ -4996,12 +5962,19 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
4996
5962
|
* @returns {ParameterizedSql} – Parameterized SQL query from rules.
|
|
4997
5963
|
*/
|
|
4998
5964
|
getParameterizedSql(rule) {
|
|
4999
|
-
|
|
5000
|
-
|
|
5965
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5966
|
+
if (this.moduleLoader.loadedModules.length) {
|
|
5967
|
+
if (!rule) {
|
|
5968
|
+
rule = this.getValidRules();
|
|
5969
|
+
}
|
|
5970
|
+
const obj = { sql: null };
|
|
5971
|
+
this.notify('query-library', { prop: 'getParameterSql', onPropertyChange: false, value: { rule: rule, obj: obj } });
|
|
5972
|
+
return obj['sql'];
|
|
5973
|
+
}
|
|
5974
|
+
else {
|
|
5975
|
+
console.warn('[WARNING] :: Module "query-library" is not available in QueryBuilder component! You either misspelled the module name or forgot to load it.');
|
|
5001
5976
|
}
|
|
5002
|
-
|
|
5003
|
-
this.notify('query-library', { prop: 'getParameterSql', onPropertyChange: false, value: { rule: rule, obj: obj } });
|
|
5004
|
-
return obj['sql'];
|
|
5977
|
+
return null;
|
|
5005
5978
|
}
|
|
5006
5979
|
/**
|
|
5007
5980
|
* Sets the rules from the parameter sql query.
|
|
@@ -5010,13 +5983,19 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5010
5983
|
* @returns {void}
|
|
5011
5984
|
*/
|
|
5012
5985
|
setParameterizedSql(sqlQuery) {
|
|
5013
|
-
|
|
5014
|
-
this.
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
sql = sql
|
|
5018
|
-
|
|
5019
|
-
|
|
5986
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5987
|
+
if (this.moduleLoader.loadedModules.length) {
|
|
5988
|
+
const obj = { sql: null };
|
|
5989
|
+
this.notify('query-library', { prop: 'convertParamSqlToSql', onPropertyChange: false, value: { sql: sqlQuery, obj: obj } });
|
|
5990
|
+
let sql = obj['sql'];
|
|
5991
|
+
if (sql) {
|
|
5992
|
+
sql = sql.replace(/`/g, '');
|
|
5993
|
+
const ruleModel = this.getRulesFromSql(sql);
|
|
5994
|
+
this.setRules({ condition: ruleModel.condition, not: ruleModel.not, rules: ruleModel.rules });
|
|
5995
|
+
}
|
|
5996
|
+
}
|
|
5997
|
+
else {
|
|
5998
|
+
console.warn('[WARNING] :: Module "query-library" is not available in QueryBuilder component! You either misspelled the module name or forgot to load it.');
|
|
5020
5999
|
}
|
|
5021
6000
|
}
|
|
5022
6001
|
/**
|
|
@@ -5026,12 +6005,19 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5026
6005
|
* @returns {ParameterizedNamedSql} – Parameterized Named SQL query from rules.
|
|
5027
6006
|
*/
|
|
5028
6007
|
getParameterizedNamedSql(rule) {
|
|
5029
|
-
|
|
5030
|
-
|
|
6008
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6009
|
+
if (this.moduleLoader.loadedModules.length) {
|
|
6010
|
+
if (!rule) {
|
|
6011
|
+
rule = this.getValidRules();
|
|
6012
|
+
}
|
|
6013
|
+
const obj = { sql: null };
|
|
6014
|
+
this.notify('query-library', { prop: 'getNamedParameterSql', onPropertyChange: false, value: { rule: rule, obj: obj } });
|
|
6015
|
+
return obj['sql'];
|
|
6016
|
+
}
|
|
6017
|
+
else {
|
|
6018
|
+
console.warn('[WARNING] :: Module "query-library" is not available in QueryBuilder component! You either misspelled the module name or forgot to load it.');
|
|
5031
6019
|
}
|
|
5032
|
-
|
|
5033
|
-
this.notify('query-library', { prop: 'getNamedParameterSql', onPropertyChange: false, value: { rule: rule, obj: obj } });
|
|
5034
|
-
return obj['sql'];
|
|
6020
|
+
return null;
|
|
5035
6021
|
}
|
|
5036
6022
|
/**
|
|
5037
6023
|
* Sets the rules from the named parameter SQL query.
|
|
@@ -5040,13 +6026,19 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5040
6026
|
* @returns {void}
|
|
5041
6027
|
*/
|
|
5042
6028
|
setParameterizedNamedSql(sqlQuery) {
|
|
5043
|
-
|
|
5044
|
-
this.
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
sql = sql
|
|
5048
|
-
|
|
5049
|
-
|
|
6029
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6030
|
+
if (this.moduleLoader.loadedModules.length) {
|
|
6031
|
+
const obj = { sql: null };
|
|
6032
|
+
this.notify('query-library', { prop: 'convertNamedParamSqlToSql', onPropertyChange: false, value: { sql: sqlQuery, obj: obj } });
|
|
6033
|
+
let sql = obj['sql'];
|
|
6034
|
+
if (sql) {
|
|
6035
|
+
sql = sql.replace(/`/g, '');
|
|
6036
|
+
const ruleModel = this.getRulesFromSql(sql);
|
|
6037
|
+
this.setRules({ condition: ruleModel.condition, not: ruleModel.not, rules: ruleModel.rules });
|
|
6038
|
+
}
|
|
6039
|
+
}
|
|
6040
|
+
else {
|
|
6041
|
+
console.warn('[WARNING] :: Module "query-library" is not available in QueryBuilder component! You either misspelled the module name or forgot to load it.');
|
|
5050
6042
|
}
|
|
5051
6043
|
}
|
|
5052
6044
|
/**
|
|
@@ -5057,8 +6049,14 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5057
6049
|
* @returns {void}
|
|
5058
6050
|
*/
|
|
5059
6051
|
setMongoQuery(mongoQuery, mongoLocale) {
|
|
5060
|
-
|
|
5061
|
-
this.
|
|
6052
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6053
|
+
if (this.moduleLoader.loadedModules.length) {
|
|
6054
|
+
this.rule = { condition: 'and', not: false, rules: [] };
|
|
6055
|
+
this.notify('query-library', { prop: 'mongoParser', onPropertyChange: false, value: { mongoQuery: JSON.parse(mongoQuery), rule: this.rule, mongoLocale: mongoLocale } });
|
|
6056
|
+
}
|
|
6057
|
+
else {
|
|
6058
|
+
console.warn('[WARNING] :: Module "query-library" is not available in QueryBuilder component! You either misspelled the module name or forgot to load it.');
|
|
6059
|
+
}
|
|
5062
6060
|
}
|
|
5063
6061
|
/**
|
|
5064
6062
|
* Gets the Mongo query from rules.
|
|
@@ -5067,12 +6065,19 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5067
6065
|
* @returns {object} - Sql query from rules.
|
|
5068
6066
|
*/
|
|
5069
6067
|
getMongoQuery(rule) {
|
|
5070
|
-
|
|
5071
|
-
|
|
6068
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6069
|
+
if (this.moduleLoader.loadedModules.length) {
|
|
6070
|
+
if (!rule) {
|
|
6071
|
+
rule = this.getValidRules();
|
|
6072
|
+
}
|
|
6073
|
+
const obj = { mongoQuery: null };
|
|
6074
|
+
this.notify('query-library', { prop: 'getMongoFromRules', onPropertyChange: false, value: { rule: rule, mongoQuery: '', obj: obj } });
|
|
6075
|
+
return obj['mongoQuery'];
|
|
6076
|
+
}
|
|
6077
|
+
else {
|
|
6078
|
+
console.warn('[WARNING] :: Module "query-library" is not available in QueryBuilder component! You either misspelled the module name or forgot to load it.');
|
|
5072
6079
|
}
|
|
5073
|
-
|
|
5074
|
-
this.notify('query-library', { prop: 'getMongoFromRules', onPropertyChange: false, value: { rule: rule, mongoQuery: '', obj: obj } });
|
|
5075
|
-
return obj['mongoQuery'];
|
|
6080
|
+
return '';
|
|
5076
6081
|
}
|
|
5077
6082
|
/**
|
|
5078
6083
|
* Clones the rule based on the rule ID to the specific group.
|
|
@@ -5091,7 +6096,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5091
6096
|
this.showButtons.cloneRule = true;
|
|
5092
6097
|
this.addRules([{
|
|
5093
6098
|
'label': getRule.label, 'field': getRule.field, 'type': getRule.type, 'operator': getRule.operator,
|
|
5094
|
-
'value': getRule.value
|
|
6099
|
+
'value': getRule.value, 'condition': getRule.condition
|
|
5095
6100
|
}], groupID);
|
|
5096
6101
|
this.ruleIndex = -1;
|
|
5097
6102
|
this.cloneRuleBtnClick = false;
|
|
@@ -5180,8 +6185,9 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5180
6185
|
let matchValue;
|
|
5181
6186
|
for (let i = 0, iLen = operators.length; i < iLen; i++) {
|
|
5182
6187
|
regexStr = /^\w+$/.test(operators[i]) ? '\\b' : '';
|
|
5183
|
-
// eslint-disable-next-line
|
|
5184
|
-
|
|
6188
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6189
|
+
const regExp = RegExp;
|
|
6190
|
+
regex = new regExp('^(' + operators[i] + ')' + regexStr, 'ig');
|
|
5185
6191
|
if (regex.exec(sqlString)) {
|
|
5186
6192
|
this.parser.push(['Operators', operators[i].toLowerCase()]);
|
|
5187
6193
|
return operators[i].length;
|
|
@@ -5191,8 +6197,9 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5191
6197
|
if (!lastPasrser || (lastPasrser && lastPasrser[0] !== 'Literal')) {
|
|
5192
6198
|
for (let i = 0, iLen = conditions.length; i < iLen; i++) {
|
|
5193
6199
|
regexStr = /^\w+$/.test(conditions[i]) ? '\\b' : '';
|
|
5194
|
-
// eslint-disable-next-line
|
|
5195
|
-
|
|
6200
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6201
|
+
const regExp = RegExp;
|
|
6202
|
+
regex = new regExp('^(' + conditions[i] + ')' + regexStr, 'ig');
|
|
5196
6203
|
if (regex.exec(sqlString)) {
|
|
5197
6204
|
this.parser.push(['Conditions', conditions[i].toLowerCase()]);
|
|
5198
6205
|
return conditions[i].length;
|
|
@@ -5201,8 +6208,9 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5201
6208
|
}
|
|
5202
6209
|
for (let i = 0, iLen = subOp.length; i < iLen; i++) {
|
|
5203
6210
|
regexStr = /^\w+$/.test(subOp[i]) ? '\\b' : '';
|
|
5204
|
-
// eslint-disable-next-line
|
|
5205
|
-
|
|
6211
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6212
|
+
const regExp = RegExp;
|
|
6213
|
+
regex = new regExp('^(' + subOp[i] + ')' + regexStr, 'ig');
|
|
5206
6214
|
if (regex.exec(sqlString)) {
|
|
5207
6215
|
this.parser.push(['SubOperators', subOp[i].toLowerCase()]);
|
|
5208
6216
|
return subOp[i].length;
|
|
@@ -5230,31 +6238,25 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5230
6238
|
this.parser.push(['String', null]);
|
|
5231
6239
|
return matchValue.length;
|
|
5232
6240
|
}
|
|
5233
|
-
|
|
5234
|
-
|
|
5235
|
-
// eslint-disable-next-line
|
|
5236
|
-
matchValue = /^`?([a-zåäö_][a-z0-9åäö_.\[\]\(\)]{0,}(\:(number|float|string|date|boolean))?)`?/i.exec(sqlString)[1];
|
|
6241
|
+
if (/^`?([a-z_][a-z0-9_.\\[\]\\(\\)]{0,}(\\:(number|float|string|date|boolean))?)`?/i.exec(sqlString)) {
|
|
6242
|
+
matchValue = /^`?([a-z_][a-z0-9_.\\[\]\\(\\)]{0,}(\\:(number|float|string|date|boolean))?)`?/i.exec(sqlString)[1];
|
|
5237
6243
|
this.parser.push(['Literal', matchValue]);
|
|
5238
6244
|
return matchValue.length;
|
|
5239
6245
|
}
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
// eslint-disable-next-line
|
|
5243
|
-
matchValue = /^'?([a-z_][a-z0-9 _.\[\]\(\)-]{0,}(\:(number|float|string|date|boolean))?)'?/i.exec(sqlString)[1];
|
|
6246
|
+
if (this.checkLiteral() && /^'?([a-z_][a-z0-9 _.\\[\]\\(\\)-]{0,}(\\:(number|float|string|date|boolean))?)'?/i.exec(sqlString)) {
|
|
6247
|
+
matchValue = /^'?([a-z_][a-z0-9 _.\\[\]\\(\\)-]{0,}(\\:(number|float|string|date|boolean))?)'?/i.exec(sqlString)[1];
|
|
5244
6248
|
this.parser.push(['Literal', matchValue]);
|
|
5245
6249
|
return matchValue.length + 2;
|
|
5246
6250
|
}
|
|
5247
6251
|
if (this.checkNumberLiteral(sqlString, sqlLocale)) {
|
|
5248
|
-
|
|
5249
|
-
matchValue = /^[0-9]+(\.[0-9]+)?/.exec(sqlString)[0];
|
|
6252
|
+
matchValue = /^[0-9]+(\.[0-9]+)$/.exec(sqlString)[0];
|
|
5250
6253
|
this.parser.push(['Literal', matchValue]);
|
|
5251
6254
|
return matchValue.length;
|
|
5252
6255
|
}
|
|
5253
6256
|
//String
|
|
5254
|
-
|
|
5255
|
-
if (
|
|
5256
|
-
|
|
5257
|
-
matchValue = /^'((?:[^\\']+?|\\.|'')*)'(?!')/.exec(sqlString)[0];
|
|
6257
|
+
const singleString = this.getSingleQuoteString(sqlString);
|
|
6258
|
+
if (singleString !== '') {
|
|
6259
|
+
matchValue = singleString;
|
|
5258
6260
|
if (matchValue[matchValue.length - 2] === '(') {
|
|
5259
6261
|
let isClosed = false;
|
|
5260
6262
|
for (let j = matchValue.length; j < sqlString.length; j++) {
|
|
@@ -5269,38 +6271,43 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5269
6271
|
}
|
|
5270
6272
|
else if (sqlString[matchValue.length] && (sqlString[matchValue.length] !== ')') &&
|
|
5271
6273
|
!this.checkCondition(sqlString, matchValue)) {
|
|
5272
|
-
matchValue = this.
|
|
6274
|
+
matchValue = this.combineSingleQuoteString(sqlString, matchValue);
|
|
5273
6275
|
}
|
|
5274
6276
|
// end
|
|
5275
6277
|
this.parser.push(['String', matchValue]);
|
|
5276
6278
|
return matchValue.length;
|
|
5277
6279
|
}
|
|
5278
6280
|
// Double String
|
|
5279
|
-
|
|
5280
|
-
if (
|
|
5281
|
-
|
|
5282
|
-
matchValue = /^"([^\\"]*(?:\\.[^\\"]*)*)"/.exec(sqlString)[0];
|
|
6281
|
+
const doubleString = this.getDoubleQuoteString(sqlString);
|
|
6282
|
+
if (doubleString !== '') {
|
|
6283
|
+
matchValue = doubleString;
|
|
5283
6284
|
this.parser.push(['DoubleString', matchValue]);
|
|
5284
6285
|
return matchValue.length;
|
|
5285
6286
|
}
|
|
5286
6287
|
//Number
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
// eslint-disable-next-line
|
|
5290
|
-
matchValue = /^[0-9]+(\.[0-9]+)?/.exec(sqlString)[0];
|
|
6288
|
+
if (/^\d*\.?\d+/.exec(sqlString)) {
|
|
6289
|
+
matchValue = /^\d*\.?\d+/.exec(sqlString)[0];
|
|
5291
6290
|
this.parser.push(['Number', matchValue]);
|
|
5292
6291
|
return matchValue.length;
|
|
5293
6292
|
}
|
|
5294
6293
|
//Negative Number
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
// eslint-disable-next-line
|
|
5298
|
-
matchValue = /^-?[0-9]+(\.[0-9]+)?/.exec(sqlString)[0];
|
|
6294
|
+
if (/^-?\d*\.?\d+/.exec(sqlString)) {
|
|
6295
|
+
matchValue = /^-?\d*\.?\d+/.exec(sqlString)[0];
|
|
5299
6296
|
this.parser.push(['Number', matchValue]);
|
|
5300
6297
|
return matchValue.length;
|
|
5301
6298
|
}
|
|
5302
6299
|
return 1;
|
|
5303
6300
|
}
|
|
6301
|
+
getDoubleQuoteString(sqlString) {
|
|
6302
|
+
const start = sqlString.indexOf('"');
|
|
6303
|
+
if (start === 0) {
|
|
6304
|
+
const end = sqlString.indexOf('"', start + 1);
|
|
6305
|
+
if (end !== -1) {
|
|
6306
|
+
return sqlString.substring(start, end + 1);
|
|
6307
|
+
}
|
|
6308
|
+
}
|
|
6309
|
+
return '';
|
|
6310
|
+
}
|
|
5304
6311
|
checkCondition(sqlString, matchValue) {
|
|
5305
6312
|
if (sqlString.slice(matchValue.length + 1, matchValue.length + 4) === 'AND' ||
|
|
5306
6313
|
sqlString.slice(matchValue.length + 1, matchValue.length + 3) === 'OR') {
|
|
@@ -5308,16 +6315,26 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5308
6315
|
}
|
|
5309
6316
|
return false;
|
|
5310
6317
|
}
|
|
5311
|
-
getSingleQuoteString(sqlString,
|
|
6318
|
+
getSingleQuoteString(sqlString, isBetween) {
|
|
6319
|
+
const start = sqlString.indexOf('\'');
|
|
6320
|
+
if ((start !== -1 && isBetween) || (start === 0 && !isBetween)) {
|
|
6321
|
+
const end = sqlString.indexOf('\'', start + 1);
|
|
6322
|
+
if (end !== -1) {
|
|
6323
|
+
return sqlString.substring(start, end + 1);
|
|
6324
|
+
}
|
|
6325
|
+
}
|
|
6326
|
+
return '';
|
|
6327
|
+
}
|
|
6328
|
+
combineSingleQuoteString(sqlString, matchValue) {
|
|
5312
6329
|
if (sqlString[matchValue.length] && (sqlString[matchValue.length] !== ')') &&
|
|
5313
6330
|
!this.checkCondition(sqlString, matchValue) && sqlString[matchValue.length] !== ',') {
|
|
5314
|
-
const
|
|
5315
|
-
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
6331
|
+
const tempMatchValue = matchValue.substring(0, matchValue.length - 1);
|
|
6332
|
+
const tempStr = sqlString.replace(tempMatchValue, '');
|
|
6333
|
+
const singleString = this.getSingleQuoteString(tempStr, true);
|
|
6334
|
+
if (singleString !== '') {
|
|
6335
|
+
const parsedValue = singleString.substring(1, singleString.length);
|
|
5319
6336
|
matchValue += parsedValue;
|
|
5320
|
-
matchValue = this.
|
|
6337
|
+
matchValue = this.combineSingleQuoteString(sqlString, matchValue);
|
|
5321
6338
|
}
|
|
5322
6339
|
}
|
|
5323
6340
|
return matchValue;
|
|
@@ -5346,8 +6363,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5346
6363
|
return true;
|
|
5347
6364
|
}
|
|
5348
6365
|
else {
|
|
5349
|
-
|
|
5350
|
-
if (/^[0-9]+(\.[0-9]+)?/.exec(sqlString)) {
|
|
6366
|
+
if (/^[0-9]+(?:\.[0-9]+)$/.exec(sqlString)) {
|
|
5351
6367
|
const secParser = this.parser[this.parser.length - 2];
|
|
5352
6368
|
const betweenParser = this.parser[this.parser.length - 3];
|
|
5353
6369
|
if (lastParser[0] === 'Left' && (secParser && secParser[0] === 'Conditions')) {
|
|
@@ -5560,16 +6576,17 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5560
6576
|
strVal = [];
|
|
5561
6577
|
rule.type = this.getTypeFromColumn(rule);
|
|
5562
6578
|
}
|
|
6579
|
+
if (this.enableSeparateConnector && parser[i + 1][0] === 'Conditions') {
|
|
6580
|
+
rule.condition = parser[i + 1][1];
|
|
6581
|
+
}
|
|
5563
6582
|
}
|
|
5564
6583
|
else if (parser[i + 1][0] === 'Operators') {
|
|
5565
6584
|
rule.operator = this.getOperator(parser[i + 2][1], parser[i + 1][1], sqlLocale);
|
|
5566
|
-
if (rule.operator
|
|
5567
|
-
rule.operator =
|
|
5568
|
-
|
|
6585
|
+
if (rule.operator === 'equal' && parser[i + 2][0] === 'String' && parser[i + 2][1] === '\'\'') {
|
|
6586
|
+
rule.operator = 'isempty';
|
|
5569
6587
|
}
|
|
5570
|
-
else if (rule.operator
|
|
5571
|
-
rule.operator =
|
|
5572
|
-
|
|
6588
|
+
else if (rule.operator === 'notequal' && parser[i + 2][0] === 'String' && parser[i + 2][1] === '\'\'') {
|
|
6589
|
+
rule.operator = 'isnotempty';
|
|
5573
6590
|
}
|
|
5574
6591
|
if (parser[i + 2][0] === 'Number') {
|
|
5575
6592
|
rule.type = 'number';
|
|
@@ -5583,6 +6600,9 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5583
6600
|
}
|
|
5584
6601
|
rule.value = val;
|
|
5585
6602
|
}
|
|
6603
|
+
if (this.enableSeparateConnector && parser[i + 3][0] === 'Conditions') {
|
|
6604
|
+
rule.condition = parser[i + 3][1];
|
|
6605
|
+
}
|
|
5586
6606
|
rule.type = this.getTypeFromColumn(rule);
|
|
5587
6607
|
}
|
|
5588
6608
|
rules.rules.push(rule);
|
|
@@ -5610,7 +6630,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5610
6630
|
subRules = this.processParser(this.parser, subRules, levelColl, sqlLocale);
|
|
5611
6631
|
return rules;
|
|
5612
6632
|
}
|
|
5613
|
-
else if (parser[i][0] === 'Conditions') {
|
|
6633
|
+
else if (parser[i][0] === 'Conditions' && !this.enableSeparateConnector) {
|
|
5614
6634
|
if (parser[i][1] === 'not' || (sqlLocale && this.l10n.getConstant('NOT').toLowerCase() === parser[i][1])) {
|
|
5615
6635
|
rules.not = true;
|
|
5616
6636
|
}
|
|
@@ -5631,27 +6651,6 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5631
6651
|
}
|
|
5632
6652
|
return rules;
|
|
5633
6653
|
}
|
|
5634
|
-
getValueFromParser(parser, idx) {
|
|
5635
|
-
let value = '';
|
|
5636
|
-
let k;
|
|
5637
|
-
for (k = idx; k < parser.length; k++) {
|
|
5638
|
-
if (parser[k][0] !== 'String' || parser[k][1] === ',' || parser[k][1] === ', ') {
|
|
5639
|
-
break;
|
|
5640
|
-
}
|
|
5641
|
-
else {
|
|
5642
|
-
if (value !== '') {
|
|
5643
|
-
idx += 1;
|
|
5644
|
-
}
|
|
5645
|
-
if (parser[k][1] !== null) {
|
|
5646
|
-
value += parser[k][1];
|
|
5647
|
-
}
|
|
5648
|
-
else {
|
|
5649
|
-
value = null;
|
|
5650
|
-
}
|
|
5651
|
-
}
|
|
5652
|
-
}
|
|
5653
|
-
return { value: value, idx: idx };
|
|
5654
|
-
}
|
|
5655
6654
|
/**
|
|
5656
6655
|
* Clone the Group
|
|
5657
6656
|
*
|
|
@@ -5686,8 +6685,14 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5686
6685
|
this.ruleIndex = i;
|
|
5687
6686
|
}
|
|
5688
6687
|
}
|
|
5689
|
-
this.
|
|
5690
|
-
|
|
6688
|
+
if (this.enableSeparateConnector) {
|
|
6689
|
+
this.addRules([{ 'label': getRule.label, 'field': getRule.field, 'type': getRule.type, 'operator': getRule.operator,
|
|
6690
|
+
'value': getRule.value, 'condition': getRule.condition }], groupId);
|
|
6691
|
+
}
|
|
6692
|
+
else {
|
|
6693
|
+
this.addRules([{ 'label': getRule.label, 'field': getRule.field, 'type': getRule.type, 'operator': getRule.operator,
|
|
6694
|
+
'value': getRule.value }], groupId);
|
|
6695
|
+
}
|
|
5691
6696
|
this.ruleIndex = -1;
|
|
5692
6697
|
}
|
|
5693
6698
|
ruleLock(target) {
|
|
@@ -5695,7 +6700,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5695
6700
|
const rule = this.getRule(ruleElem.id.replace(this.element.id + '_', ''));
|
|
5696
6701
|
if (ruleElem.classList.contains('e-disable')) {
|
|
5697
6702
|
rule.isLocked = false;
|
|
5698
|
-
this.lockItems = this.lockItems.filter(lockItem => lockItem !== ruleElem.id);
|
|
6703
|
+
this.lockItems = this.lockItems.filter((lockItem) => lockItem !== ruleElem.id);
|
|
5699
6704
|
ruleElem.classList.remove('e-disable');
|
|
5700
6705
|
this.disableRuleControls(target, ruleElem, false);
|
|
5701
6706
|
target.children[0].classList.add('e-unlock');
|
|
@@ -5716,7 +6721,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5716
6721
|
}
|
|
5717
6722
|
groupLock(target) {
|
|
5718
6723
|
const groupElem = closest(target, '.e-group-container');
|
|
5719
|
-
|
|
6724
|
+
const group = this.getGroup(groupElem.id.replace(this.element.id + '_', ''));
|
|
5720
6725
|
const isRoot = groupElem.id.indexOf('group0') > -1;
|
|
5721
6726
|
if (groupElem.classList.contains('e-disable')) {
|
|
5722
6727
|
if (isRoot) {
|
|
@@ -5729,7 +6734,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5729
6734
|
else {
|
|
5730
6735
|
group.isLocked = false;
|
|
5731
6736
|
}
|
|
5732
|
-
this.lockItems = this.lockItems.filter(lockItem => lockItem !== groupElem.id);
|
|
6737
|
+
this.lockItems = this.lockItems.filter((lockItem) => lockItem !== groupElem.id);
|
|
5733
6738
|
groupElem.classList.remove('e-disable');
|
|
5734
6739
|
this.disableHeaderControls(target, groupElem, false);
|
|
5735
6740
|
target.children[0].classList.add('e-unlock');
|
|
@@ -5788,6 +6793,8 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5788
6793
|
const lockElem = groupElem.querySelectorAll('.e-lock-grp-btn');
|
|
5789
6794
|
const cloneElem = groupElem.querySelectorAll('.e-clone-grp-btn');
|
|
5790
6795
|
const groupContElem = groupElem.querySelectorAll('.e-group-container');
|
|
6796
|
+
const addCondition = groupElem.querySelectorAll('.e-add-condition-btn');
|
|
6797
|
+
const addGroup = groupElem.querySelectorAll('.e-add-group-btn');
|
|
5791
6798
|
for (let i = 0; i < andElem.length; i++) {
|
|
5792
6799
|
if (isDisabled) {
|
|
5793
6800
|
if (groupContElem[i] && groupContElem[i].classList.contains('e-disable')) {
|
|
@@ -5795,7 +6802,15 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5795
6802
|
}
|
|
5796
6803
|
andElem[i].disabled = true;
|
|
5797
6804
|
orElem[i].disabled = true;
|
|
5798
|
-
addElem[i]
|
|
6805
|
+
if (addElem[i]) {
|
|
6806
|
+
addElem[i].disabled = true;
|
|
6807
|
+
}
|
|
6808
|
+
if (addCondition[i]) {
|
|
6809
|
+
addCondition[i].disabled = true;
|
|
6810
|
+
}
|
|
6811
|
+
if (addGroup[i]) {
|
|
6812
|
+
addGroup[i].disabled = true;
|
|
6813
|
+
}
|
|
5799
6814
|
if (notElem[i]) {
|
|
5800
6815
|
notElem[i].disabled = true;
|
|
5801
6816
|
}
|
|
@@ -5806,7 +6821,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5806
6821
|
cloneElem[i].disabled = true;
|
|
5807
6822
|
}
|
|
5808
6823
|
andElem[i].parentElement.classList.add('e-disabled');
|
|
5809
|
-
if (lockElem[i] !== target) {
|
|
6824
|
+
if (lockElem[i] && lockElem[i] !== target) {
|
|
5810
6825
|
lockElem[i].disabled = true;
|
|
5811
6826
|
lockElem[i].children[0].classList.remove('e-unlock');
|
|
5812
6827
|
lockElem[i].children[0].classList.add('e-lock');
|
|
@@ -5818,8 +6833,18 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5818
6833
|
}
|
|
5819
6834
|
andElem[i].disabled = false;
|
|
5820
6835
|
orElem[i].disabled = false;
|
|
5821
|
-
addElem[i]
|
|
5822
|
-
|
|
6836
|
+
if (addElem[i]) {
|
|
6837
|
+
addElem[i].disabled = false;
|
|
6838
|
+
}
|
|
6839
|
+
if (addCondition[i]) {
|
|
6840
|
+
addCondition[i].disabled = false;
|
|
6841
|
+
}
|
|
6842
|
+
if (addGroup[i]) {
|
|
6843
|
+
addGroup[i].disabled = false;
|
|
6844
|
+
}
|
|
6845
|
+
if (lockElem[i]) {
|
|
6846
|
+
lockElem[i].disabled = false;
|
|
6847
|
+
}
|
|
5823
6848
|
if (notElem[i]) {
|
|
5824
6849
|
notElem[i].disabled = false;
|
|
5825
6850
|
}
|
|
@@ -5830,8 +6855,12 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5830
6855
|
cloneElem[i].disabled = false;
|
|
5831
6856
|
}
|
|
5832
6857
|
andElem[i].parentElement.classList.remove('e-disabled');
|
|
5833
|
-
lockElem[i]
|
|
5834
|
-
|
|
6858
|
+
if (lockElem[i]) {
|
|
6859
|
+
lockElem[i].children[0].classList.remove('e-lock');
|
|
6860
|
+
}
|
|
6861
|
+
if (lockElem[i]) {
|
|
6862
|
+
lockElem[i].children[0].classList.add('e-unlock');
|
|
6863
|
+
}
|
|
5835
6864
|
}
|
|
5836
6865
|
}
|
|
5837
6866
|
this.disableRuleControls(target, groupElem, isDisabled);
|
|
@@ -5966,6 +6995,15 @@ __decorate([
|
|
|
5966
6995
|
__decorate([
|
|
5967
6996
|
Event()
|
|
5968
6997
|
], QueryBuilder.prototype, "ruleChange", void 0);
|
|
6998
|
+
__decorate([
|
|
6999
|
+
Event()
|
|
7000
|
+
], QueryBuilder.prototype, "dragStart", void 0);
|
|
7001
|
+
__decorate([
|
|
7002
|
+
Event()
|
|
7003
|
+
], QueryBuilder.prototype, "drag", void 0);
|
|
7004
|
+
__decorate([
|
|
7005
|
+
Event()
|
|
7006
|
+
], QueryBuilder.prototype, "drop", void 0);
|
|
5969
7007
|
__decorate([
|
|
5970
7008
|
Complex({}, ShowButtons)
|
|
5971
7009
|
], QueryBuilder.prototype, "showButtons", void 0);
|
|
@@ -6041,9 +7079,15 @@ __decorate([
|
|
|
6041
7079
|
__decorate([
|
|
6042
7080
|
Property('')
|
|
6043
7081
|
], QueryBuilder.prototype, "separator", void 0);
|
|
7082
|
+
__decorate([
|
|
7083
|
+
Property(false)
|
|
7084
|
+
], QueryBuilder.prototype, "enableSeparateConnector", void 0);
|
|
6044
7085
|
__decorate([
|
|
6045
7086
|
Complex({ condition: 'and', rules: [] }, Rule)
|
|
6046
7087
|
], QueryBuilder.prototype, "rule", void 0);
|
|
7088
|
+
__decorate([
|
|
7089
|
+
Property(false)
|
|
7090
|
+
], QueryBuilder.prototype, "allowDragAndDrop", void 0);
|
|
6047
7091
|
QueryBuilder = __decorate([
|
|
6048
7092
|
NotifyPropertyChanges
|
|
6049
7093
|
], QueryBuilder);
|
|
@@ -6348,13 +7392,13 @@ class QueryLibrary {
|
|
|
6348
7392
|
}
|
|
6349
7393
|
else if (condition === '$or') {
|
|
6350
7394
|
let notBetween;
|
|
6351
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7395
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6352
7396
|
let innerObject = [];
|
|
6353
7397
|
let keys = [];
|
|
6354
7398
|
let firstKey = [];
|
|
6355
7399
|
let secondKey = [];
|
|
6356
7400
|
let innerKeys = [];
|
|
6357
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7401
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6358
7402
|
let firstValue = [];
|
|
6359
7403
|
let secondValue = [];
|
|
6360
7404
|
let innerFirstValue = [];
|
|
@@ -6734,13 +7778,5 @@ class QueryLibrary {
|
|
|
6734
7778
|
}
|
|
6735
7779
|
}
|
|
6736
7780
|
|
|
6737
|
-
|
|
6738
|
-
* QueryBuilder modules
|
|
6739
|
-
*/
|
|
6740
|
-
|
|
6741
|
-
/**
|
|
6742
|
-
* QueryBuilder all modules
|
|
6743
|
-
*/
|
|
6744
|
-
|
|
6745
|
-
export { Columns, Rule, Value, ShowButtons, QueryBuilder, QueryLibrary };
|
|
7781
|
+
export { Columns, QueryBuilder, QueryLibrary, Rule, ShowButtons, Value };
|
|
6746
7782
|
//# sourceMappingURL=ej2-querybuilder.es2015.js.map
|