@syncfusion/ej2-querybuilder 25.2.7 → 26.1.38
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 +1334 -290
- package/dist/es6/ej2-querybuilder.es2015.js.map +1 -1
- package/dist/es6/ej2-querybuilder.es5.js +1327 -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 +1319 -262
- package/src/query-builder/query-library.js +2 -2
- package/styles/bootstrap-dark.css +195 -21
- package/styles/bootstrap-dark.scss +15 -1
- package/styles/bootstrap.css +195 -21
- package/styles/bootstrap.scss +15 -1
- package/styles/bootstrap4.css +199 -22
- package/styles/bootstrap4.scss +15 -1
- package/styles/bootstrap5-dark.css +199 -30
- package/styles/bootstrap5-dark.scss +15 -1
- package/styles/bootstrap5.css +199 -30
- package/styles/bootstrap5.scss +15 -1
- package/styles/fabric-dark.css +193 -20
- package/styles/fabric-dark.scss +15 -1
- package/styles/fabric.css +193 -20
- package/styles/fabric.scss +15 -1
- package/styles/fluent-dark.css +197 -28
- package/styles/fluent-dark.scss +15 -1
- package/styles/fluent.css +197 -28
- package/styles/fluent.scss +15 -1
- package/styles/fluent2.css +2052 -0
- package/styles/fluent2.scss +15 -0
- package/styles/highcontrast-light.css +196 -20
- package/styles/highcontrast-light.scss +15 -1
- package/styles/highcontrast.css +196 -20
- package/styles/highcontrast.scss +15 -1
- package/styles/material-dark.css +206 -24
- package/styles/material-dark.scss +15 -1
- package/styles/material.css +208 -24
- package/styles/material.scss +15 -1
- package/styles/material3-dark.css +213 -26
- package/styles/material3-dark.scss +15 -1
- package/styles/material3.css +213 -26
- package/styles/material3.scss +15 -1
- package/styles/query-builder/_bds-definition.scss +8 -1
- package/styles/query-builder/_bootstrap-dark-definition.scss +8 -0
- package/styles/query-builder/_bootstrap-definition.scss +8 -0
- package/styles/query-builder/_bootstrap4-definition.scss +8 -0
- package/styles/query-builder/_bootstrap5-definition.scss +8 -1
- package/styles/query-builder/_bootstrap5.3-definition.scss +115 -0
- package/styles/query-builder/_fabric-dark-definition.scss +8 -0
- package/styles/query-builder/_fabric-definition.scss +8 -0
- package/styles/query-builder/_fluent-definition.scss +8 -1
- package/styles/query-builder/_fluent2-definition.scss +114 -0
- package/styles/query-builder/_fusionnew-definition.scss +8 -1
- package/styles/query-builder/_highcontrast-definition.scss +8 -0
- package/styles/query-builder/_highcontrast-light-definition.scss +8 -0
- package/styles/query-builder/_layout.scss +273 -12
- package/styles/query-builder/_material-dark-definition.scss +8 -0
- package/styles/query-builder/_material-definition.scss +8 -0
- package/styles/query-builder/_material3-definition.scss +8 -1
- package/styles/query-builder/_tailwind-definition.scss +8 -1
- package/styles/query-builder/_theme.scss +34 -22
- package/styles/query-builder/bootstrap-dark.css +195 -21
- package/styles/query-builder/bootstrap.css +195 -21
- package/styles/query-builder/bootstrap4.css +199 -22
- package/styles/query-builder/bootstrap5-dark.css +199 -30
- package/styles/query-builder/bootstrap5.css +199 -30
- package/styles/query-builder/fabric-dark.css +193 -20
- package/styles/query-builder/fabric.css +193 -20
- package/styles/query-builder/fluent-dark.css +197 -28
- package/styles/query-builder/fluent.css +197 -28
- package/styles/query-builder/fluent2.css +2052 -0
- package/styles/query-builder/fluent2.scss +15 -0
- package/styles/query-builder/highcontrast-light.css +196 -20
- package/styles/query-builder/highcontrast.css +196 -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 +206 -24
- package/styles/query-builder/material.css +208 -24
- package/styles/query-builder/material3-dark.css +213 -26
- package/styles/query-builder/material3.css +213 -26
- package/styles/query-builder/tailwind-dark.css +206 -24
- package/styles/query-builder/tailwind.css +206 -24
- package/styles/tailwind-dark.css +206 -24
- package/styles/tailwind-dark.scss +15 -1
- package/styles/tailwind.css +206 -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,20 +1104,68 @@ 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++) {
|
|
792
1156
|
if (columns[parseInt(i.toString(), 10)].type === 'object') {
|
|
1157
|
+
if (this.isAngular && columns[parseInt(i.toString(), 10)].template) {
|
|
1158
|
+
delete columns[parseInt(i.toString(), 10)].template;
|
|
1159
|
+
}
|
|
793
1160
|
columns[parseInt(i.toString(), 10)].selectable = false;
|
|
794
1161
|
this.updateDropdowntreeDS(columns[parseInt(i.toString(), 10)].columns);
|
|
795
1162
|
}
|
|
1163
|
+
else if (this.isAngular && columns[parseInt(i.toString(), 10)].template) {
|
|
1164
|
+
delete columns[parseInt(i.toString(), 10)].template;
|
|
1165
|
+
}
|
|
796
1166
|
}
|
|
797
1167
|
}
|
|
798
|
-
updateAddedRule(target, rule, newRule, isRuleTemplate, pId) {
|
|
1168
|
+
updateAddedRule(target, rule, newRule, isRuleTemplate, pId, isNewRuleAdded) {
|
|
799
1169
|
let ruleElem;
|
|
800
1170
|
let index = 0;
|
|
801
1171
|
let groupElem;
|
|
@@ -806,7 +1176,12 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
806
1176
|
rules = this.getParentGroup(groupElem);
|
|
807
1177
|
while (ruleElem && ruleElem.previousElementSibling !== null) {
|
|
808
1178
|
ruleElem = ruleElem.previousElementSibling;
|
|
809
|
-
|
|
1179
|
+
const enableSeparateCondition = this.enableSeparateConnector && ((!this.headerTemplate && !ruleElem.classList.contains('e-btn-group')) ||
|
|
1180
|
+
(this.headerTemplate && (ruleElem.classList.contains('e-rule-container') ||
|
|
1181
|
+
ruleElem.classList.contains('e-group-container'))));
|
|
1182
|
+
if (!this.enableSeparateConnector || enableSeparateCondition) {
|
|
1183
|
+
index++;
|
|
1184
|
+
}
|
|
810
1185
|
}
|
|
811
1186
|
rules.rules[index] = rule;
|
|
812
1187
|
}
|
|
@@ -824,6 +1199,9 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
824
1199
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
825
1200
|
rules.rules[rules.rules.length - 1].custom = custom;
|
|
826
1201
|
}
|
|
1202
|
+
if (this.enableSeparateConnector) {
|
|
1203
|
+
rules.rules[rules.rules.length - 1].condition = rule.condition ? rule.condition : newRule.condition;
|
|
1204
|
+
}
|
|
827
1205
|
}
|
|
828
1206
|
else {
|
|
829
1207
|
rules.rules.splice(this.ruleIndex + 1, 0, {
|
|
@@ -833,6 +1211,9 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
833
1211
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
834
1212
|
rules.rules[this.ruleIndex + 1].custom = custom;
|
|
835
1213
|
}
|
|
1214
|
+
if (this.enableSeparateConnector) {
|
|
1215
|
+
rules.rules[this.ruleIndex + 1].condition = rule.condition ? rule.condition : newRule.condition;
|
|
1216
|
+
}
|
|
836
1217
|
}
|
|
837
1218
|
}
|
|
838
1219
|
else {
|
|
@@ -846,7 +1227,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
846
1227
|
rules.rules.push(newRule);
|
|
847
1228
|
}
|
|
848
1229
|
}
|
|
849
|
-
this.disableRuleCondition(target, rules);
|
|
1230
|
+
this.disableRuleCondition(target, rules, isNewRuleAdded);
|
|
850
1231
|
}
|
|
851
1232
|
changeRuleTemplate(column, element) {
|
|
852
1233
|
const operVal = this.selectedColumn.operators;
|
|
@@ -924,7 +1305,11 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
924
1305
|
if (validateRule && validateRule.isRequired) {
|
|
925
1306
|
while (indexElem && indexElem.previousElementSibling !== null) {
|
|
926
1307
|
indexElem = indexElem.previousElementSibling;
|
|
927
|
-
|
|
1308
|
+
const separateCondition = this.enableSeparateConnector && ((!this.headerTemplate && !indexElem.classList.contains('e-btn-group')) ||
|
|
1309
|
+
(this.headerTemplate && (indexElem.classList.contains('e-rule-container') || indexElem.classList.contains('e-group-container'))));
|
|
1310
|
+
if (!this.enableSeparateConnector || separateCondition) {
|
|
1311
|
+
index++;
|
|
1312
|
+
}
|
|
928
1313
|
}
|
|
929
1314
|
fieldElem = tempElem.querySelector('.e-rule-operator .e-control');
|
|
930
1315
|
if (!rule.rules[index].operator) {
|
|
@@ -1001,9 +1386,10 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1001
1386
|
obj.level = this.levelColl[obj.groupElement.id].slice();
|
|
1002
1387
|
return obj;
|
|
1003
1388
|
}
|
|
1004
|
-
groupTemplate() {
|
|
1389
|
+
groupTemplate(isConnector) {
|
|
1005
1390
|
let glueElem;
|
|
1006
1391
|
let inputElem;
|
|
1392
|
+
let dragClsName;
|
|
1007
1393
|
let labelElem;
|
|
1008
1394
|
let grpActElem;
|
|
1009
1395
|
let groupBtn;
|
|
@@ -1016,9 +1402,27 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1016
1402
|
groupElem.appendChild(grpBodyElem);
|
|
1017
1403
|
// create button group in OR and AND process
|
|
1018
1404
|
if (!this.headerTemplate) {
|
|
1019
|
-
|
|
1405
|
+
if (this.allowDragAndDrop) {
|
|
1406
|
+
dragClsName = 'e-icons e-drag-qb-rule';
|
|
1407
|
+
}
|
|
1408
|
+
else {
|
|
1409
|
+
dragClsName = 'e-icons e-drag-qb-rule e-hidden';
|
|
1410
|
+
}
|
|
1411
|
+
const spanDragElement = this.createElement('span', { attrs: { class: dragClsName, 'aria-lable': 'drag handle',
|
|
1412
|
+
title: 'drag handle' } });
|
|
1413
|
+
groupHdrElem.appendChild(spanDragElement);
|
|
1414
|
+
const className = this.enableSeparateConnector && !isConnector ? 'e-lib e-btn-group e-qb-toggle-btn' : 'e-lib e-btn-group';
|
|
1415
|
+
glueElem = this.createElement('div', { attrs: { class: className, role: 'group' } });
|
|
1416
|
+
if (this.enableSeparateConnector) {
|
|
1417
|
+
glueElem.classList.add('e-multi-connector');
|
|
1418
|
+
}
|
|
1020
1419
|
if (this.enableNotCondition) {
|
|
1021
|
-
|
|
1420
|
+
if (this.enableSeparateConnector) {
|
|
1421
|
+
inputElem = this.createElement('input', { attrs: { type: 'checkbox', class: 'e-qb-toggle' } });
|
|
1422
|
+
}
|
|
1423
|
+
else {
|
|
1424
|
+
inputElem = this.createElement('button', { attrs: { type: 'button', class: 'e-qb-toggle' } });
|
|
1425
|
+
}
|
|
1022
1426
|
glueElem.appendChild(inputElem);
|
|
1023
1427
|
}
|
|
1024
1428
|
inputElem = this.createElement('input', { attrs: { type: 'radio', class: 'e-btngroup-and', value: 'AND' } });
|
|
@@ -1033,8 +1437,16 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1033
1437
|
glueElem.appendChild(labelElem);
|
|
1034
1438
|
groupHdrElem.appendChild(glueElem);
|
|
1035
1439
|
grpActElem = this.createElement('div', { attrs: { class: 'e-group-action' } });
|
|
1036
|
-
|
|
1037
|
-
|
|
1440
|
+
if (this.enableSeparateConnector) {
|
|
1441
|
+
groupBtn = this.createElement('button', { attrs: { type: 'button', class: 'e-add-condition-btn' } });
|
|
1442
|
+
grpActElem.appendChild(groupBtn);
|
|
1443
|
+
groupBtn = this.createElement('button', { attrs: { type: 'button', class: 'e-add-group-btn' } });
|
|
1444
|
+
grpActElem.appendChild(groupBtn);
|
|
1445
|
+
}
|
|
1446
|
+
else {
|
|
1447
|
+
groupBtn = this.createElement('button', { attrs: { type: 'button', class: 'e-add-btn' } });
|
|
1448
|
+
grpActElem.appendChild(groupBtn);
|
|
1449
|
+
}
|
|
1038
1450
|
groupHdrElem.appendChild(grpActElem);
|
|
1039
1451
|
}
|
|
1040
1452
|
return groupElem;
|
|
@@ -1044,9 +1456,19 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1044
1456
|
let clsName;
|
|
1045
1457
|
let cloneClsName;
|
|
1046
1458
|
let lockClsName;
|
|
1459
|
+
let dragClsName;
|
|
1047
1460
|
const ruleElem = this.createElement('div');
|
|
1048
1461
|
const fieldElem = this.createElement('div', { attrs: { class: 'e-rule-field' } });
|
|
1049
1462
|
tempElem = this.createElement('div', { attrs: { class: 'e-rule-filter' } });
|
|
1463
|
+
if (this.allowDragAndDrop) {
|
|
1464
|
+
dragClsName = 'e-icons e-drag-qb-rule';
|
|
1465
|
+
}
|
|
1466
|
+
else {
|
|
1467
|
+
dragClsName = 'e-icons e-drag-qb-rule e-hidden';
|
|
1468
|
+
}
|
|
1469
|
+
const spanDragElement = this.createElement('span', { attrs: { class: dragClsName, 'aria-lable': 'drag handle',
|
|
1470
|
+
title: 'drag handle' } });
|
|
1471
|
+
fieldElem.appendChild(spanDragElement);
|
|
1050
1472
|
const filterElem = this.createElement('input', { attrs: { type: 'text', class: 'e-filter-input' } });
|
|
1051
1473
|
tempElem.appendChild(filterElem);
|
|
1052
1474
|
fieldElem.appendChild(tempElem);
|
|
@@ -1089,7 +1511,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1089
1511
|
}
|
|
1090
1512
|
addGroupElement(isGroup, target, condition, isBtnClick, not, isRoot, rule) {
|
|
1091
1513
|
const args = { groupID: target.id.replace(this.element.id + '_', ''), cancel: false, type: 'insertGroup' };
|
|
1092
|
-
if (!this.isImportRules && !this.isInitialLoad) {
|
|
1514
|
+
if (!this.isImportRules && !this.isInitialLoad && !this.prvtEvtTgrDaD) {
|
|
1093
1515
|
this.trigger('beforeChange', args, (observedChangeArgs) => {
|
|
1094
1516
|
this.addGroupSuccess(observedChangeArgs, isGroup, target, condition, isBtnClick, not, isRoot, rule);
|
|
1095
1517
|
});
|
|
@@ -1110,8 +1532,17 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1110
1532
|
else {
|
|
1111
1533
|
groupID = target.id;
|
|
1112
1534
|
}
|
|
1535
|
+
if (this.enableSeparateConnector) {
|
|
1536
|
+
this.groupElem = this.groupTemplate();
|
|
1537
|
+
}
|
|
1113
1538
|
const groupElem = this.groupElem.cloneNode(true);
|
|
1114
1539
|
groupElem.setAttribute('id', this.element.id + '_group' + this.groupIdCounter);
|
|
1540
|
+
if (this.groupIdCounter === 0 && this.allowDragAndDrop && groupElem.querySelector('.e-drag-qb-rule')) {
|
|
1541
|
+
if (groupElem && groupElem.children[0]) {
|
|
1542
|
+
groupElem.children[0].classList.add('e-parent-header');
|
|
1543
|
+
}
|
|
1544
|
+
addClass([groupElem.querySelector('.e-drag-qb-rule')], 'e-hidden');
|
|
1545
|
+
}
|
|
1115
1546
|
if (this.headerTemplate) {
|
|
1116
1547
|
if (isRoot) {
|
|
1117
1548
|
isGroup = false;
|
|
@@ -1164,7 +1595,25 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1164
1595
|
this.isLastGroup = true;
|
|
1165
1596
|
}
|
|
1166
1597
|
else {
|
|
1167
|
-
|
|
1598
|
+
if (this.enableSeparateConnector) {
|
|
1599
|
+
let index = 0;
|
|
1600
|
+
let tempGroupIndex = this.groupIndex + 1;
|
|
1601
|
+
for (let i = 0; i < tempGroupIndex; i++) {
|
|
1602
|
+
if (childElems[i].classList.contains('e-rule-container')) {
|
|
1603
|
+
tempGroupIndex++;
|
|
1604
|
+
index++;
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1607
|
+
if (index > 0) {
|
|
1608
|
+
index--;
|
|
1609
|
+
}
|
|
1610
|
+
const idx = this.groupIndex + index + 1;
|
|
1611
|
+
childElems[idx].parentNode.insertBefore(groupElem, childElems[idx]);
|
|
1612
|
+
}
|
|
1613
|
+
else {
|
|
1614
|
+
const idx = this.groupIndex + 1;
|
|
1615
|
+
childElems[idx].parentNode.insertBefore(groupElem, childElems[idx]);
|
|
1616
|
+
}
|
|
1168
1617
|
this.isMiddleGroup = true;
|
|
1169
1618
|
}
|
|
1170
1619
|
}
|
|
@@ -1230,7 +1679,14 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1230
1679
|
if (this.enableNotCondition) {
|
|
1231
1680
|
if (!this.headerTemplate) {
|
|
1232
1681
|
const notElem = groupElem.querySelector('.e-qb-toggle');
|
|
1233
|
-
|
|
1682
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1683
|
+
let tglBtn;
|
|
1684
|
+
if (this.enableSeparateConnector) {
|
|
1685
|
+
tglBtn = new CheckBox({ label: this.l10n.getConstant('NOT'), cssClass: 'e-qb-toggle' });
|
|
1686
|
+
}
|
|
1687
|
+
else {
|
|
1688
|
+
tglBtn = new Button({ content: this.l10n.getConstant('NOT'), cssClass: 'e-btn e-small' });
|
|
1689
|
+
}
|
|
1234
1690
|
tglBtn.appendTo(notElem);
|
|
1235
1691
|
groupElem.querySelector('.e-btngroup-and-lbl').classList.add('e-not');
|
|
1236
1692
|
if (this.updatedRule && this.updatedRule.not) {
|
|
@@ -1238,6 +1694,56 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1238
1694
|
}
|
|
1239
1695
|
}
|
|
1240
1696
|
}
|
|
1697
|
+
if (this.enableSeparateConnector && !this.headerTemplate) {
|
|
1698
|
+
let andElem = groupElem.querySelector('.e-btngroup-and');
|
|
1699
|
+
let orElem = groupElem.querySelector('.e-btngroup-or');
|
|
1700
|
+
const btnGroup = groupElem.querySelector('.e-btn-group');
|
|
1701
|
+
for (let i = 0; i < btnGroup.childNodes.length; i++) {
|
|
1702
|
+
if (groupElem.querySelector('.e-btn-group').childNodes[i].textContent.toLowerCase() === 'not') {
|
|
1703
|
+
if (!this.enableNotCondition) {
|
|
1704
|
+
btnGroup.childNodes[i].style.display = 'none';
|
|
1705
|
+
}
|
|
1706
|
+
else {
|
|
1707
|
+
btnGroup.childNodes[i].classList.add('e-multiconnector');
|
|
1708
|
+
}
|
|
1709
|
+
}
|
|
1710
|
+
else {
|
|
1711
|
+
btnGroup.childNodes[i].style.display = 'none';
|
|
1712
|
+
}
|
|
1713
|
+
}
|
|
1714
|
+
const prevSibling = groupElem.previousElementSibling;
|
|
1715
|
+
if (prevSibling) {
|
|
1716
|
+
if (isNullOrUndefined(this.headerTemplate)) {
|
|
1717
|
+
groupElem.parentElement.insertBefore(this.groupTemplate(true).querySelector('.e-btn-group'), groupElem);
|
|
1718
|
+
const notElem = groupElem.previousElementSibling.childNodes[0];
|
|
1719
|
+
if (notElem.classList.contains('e-qb-toggle')) {
|
|
1720
|
+
notElem.style.display = 'none';
|
|
1721
|
+
}
|
|
1722
|
+
}
|
|
1723
|
+
if (!this.isImportRules) {
|
|
1724
|
+
const groupElement = groupElem.previousElementSibling;
|
|
1725
|
+
const newAndElem = groupElement.querySelector('.e-btngroup-and');
|
|
1726
|
+
const newOrElem = groupElement.querySelector('.e-btngroup-or');
|
|
1727
|
+
if (!andElem.checked && !orElem.checked) {
|
|
1728
|
+
const nextSibling = groupElem.nextElementSibling;
|
|
1729
|
+
if (nextSibling && nextSibling.classList.contains('e-btn-group')) {
|
|
1730
|
+
andElem = nextSibling.querySelector('.e-btngroup-and');
|
|
1731
|
+
orElem = nextSibling.querySelector('.e-btngroup-or');
|
|
1732
|
+
newAndElem.checked = andElem.checked;
|
|
1733
|
+
newOrElem.checked = orElem.checked;
|
|
1734
|
+
}
|
|
1735
|
+
}
|
|
1736
|
+
else if (this.enableSeparateConnector) {
|
|
1737
|
+
if (andElem.checked) {
|
|
1738
|
+
newAndElem.checked = true;
|
|
1739
|
+
}
|
|
1740
|
+
if (orElem.checked) {
|
|
1741
|
+
newOrElem.checked = true;
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1744
|
+
}
|
|
1745
|
+
}
|
|
1746
|
+
}
|
|
1241
1747
|
this.updatedRule = null;
|
|
1242
1748
|
if (this.headerTemplate) {
|
|
1243
1749
|
const args = { requestType: 'header-template-create', ruleID: groupElem.id, condition: condition,
|
|
@@ -1245,60 +1751,161 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1245
1751
|
this.trigger('actionBegin', args);
|
|
1246
1752
|
}
|
|
1247
1753
|
else {
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1754
|
+
if (this.enableSeparateConnector) {
|
|
1755
|
+
const conditionBtn = groupElem.querySelector('.e-add-condition-btn');
|
|
1756
|
+
let btnObj = new Button({ cssClass: this.element.id + '_addConditionbtn', content: this.l10n.getConstant('AddCondition') });
|
|
1757
|
+
btnObj.appendTo(conditionBtn);
|
|
1758
|
+
btnObj.element.onclick = () => {
|
|
1759
|
+
this.addRuleElement(closest(conditionBtn, '.e-group-container'), {});
|
|
1760
|
+
};
|
|
1761
|
+
const groupBtn = groupElem.querySelector('.e-add-group-btn');
|
|
1762
|
+
btnObj = new Button({ cssClass: this.element.id + '_addGroupbtn', content: this.l10n.getConstant('AddGroup') });
|
|
1763
|
+
btnObj.appendTo(groupBtn);
|
|
1764
|
+
btnObj.element.onclick = () => {
|
|
1765
|
+
this.addGroupElement(true, closest(groupBtn, '.e-group-container'), '', true);
|
|
1766
|
+
};
|
|
1767
|
+
}
|
|
1768
|
+
else {
|
|
1769
|
+
const groupBtn = groupElem.querySelector('.e-add-btn');
|
|
1770
|
+
const btnObj = new DropDownButton({
|
|
1771
|
+
items: this.items,
|
|
1772
|
+
cssClass: 'e-round e-small e-caret-hide e-addrulegroup',
|
|
1773
|
+
iconCss: 'e-icons e-add-icon',
|
|
1774
|
+
beforeOpen: this.selectBtn.bind(this, groupBtn),
|
|
1775
|
+
select: this.selectBtn.bind(this, groupBtn)
|
|
1776
|
+
});
|
|
1777
|
+
btnObj.appendTo(groupBtn);
|
|
1778
|
+
groupBtn.setAttribute('title', this.l10n.getConstant('AddButton'));
|
|
1779
|
+
}
|
|
1258
1780
|
}
|
|
1259
|
-
if (!this.isImportRules) {
|
|
1781
|
+
if (!this.isImportRules && !this.prvtEvtTgrDaD) {
|
|
1260
1782
|
const grpId = target.id.replace(this.element.id + '_', '');
|
|
1261
1783
|
const chgrpId = groupElem.id.replace(this.element.id + '_', '');
|
|
1262
1784
|
this.trigger('change', { groupID: grpId, type: 'insertGroup', childGroupID: chgrpId });
|
|
1263
1785
|
}
|
|
1264
1786
|
}
|
|
1265
1787
|
}
|
|
1266
|
-
|
|
1788
|
+
setMultiConnector(trgt) {
|
|
1789
|
+
if (this.enableSeparateConnector && !this.headerTemplate) {
|
|
1790
|
+
if (trgt.previousElementSibling && this.groupElem.querySelector('.e-btn-group')) {
|
|
1791
|
+
trgt.parentElement.insertBefore(this.groupTemplate(true).querySelector('.e-btn-group'), trgt);
|
|
1792
|
+
const notElem = trgt.previousElementSibling.childNodes[0];
|
|
1793
|
+
if (notElem.classList.contains('e-qb-toggle')) {
|
|
1794
|
+
notElem.style.display = 'none';
|
|
1795
|
+
}
|
|
1796
|
+
this.addHeaderDiv(trgt);
|
|
1797
|
+
}
|
|
1798
|
+
}
|
|
1799
|
+
}
|
|
1800
|
+
addHeaderDiv(elem) {
|
|
1801
|
+
let prevRule;
|
|
1802
|
+
const prevElem = elem.previousElementSibling.previousElementSibling;
|
|
1803
|
+
if (prevElem) {
|
|
1804
|
+
if (prevElem.id.indexOf('rule') > -1) {
|
|
1805
|
+
prevRule = this.getRule(prevElem);
|
|
1806
|
+
}
|
|
1807
|
+
else {
|
|
1808
|
+
prevRule = this.getGroup(prevElem);
|
|
1809
|
+
}
|
|
1810
|
+
if (isNullOrUndefined(prevRule.condition)) {
|
|
1811
|
+
prevRule.condition = 'and';
|
|
1812
|
+
}
|
|
1813
|
+
const orElem = elem.previousElementSibling.querySelector('.e-btngroup-or');
|
|
1814
|
+
const andElem = elem.previousElementSibling.querySelector('.e-btngroup-and');
|
|
1815
|
+
orElem.disabled = false;
|
|
1816
|
+
andElem.disabled = false;
|
|
1817
|
+
if (prevRule.condition === 'or') {
|
|
1818
|
+
orElem.checked = true;
|
|
1819
|
+
}
|
|
1820
|
+
else {
|
|
1821
|
+
andElem.checked = true;
|
|
1822
|
+
}
|
|
1823
|
+
}
|
|
1824
|
+
}
|
|
1825
|
+
headerTemplateFn(groupElem, not, condition, rule, groupID, isInitialRule) {
|
|
1267
1826
|
let template;
|
|
1268
1827
|
const templateID = this.element.id + '_header';
|
|
1269
1828
|
let args;
|
|
1270
|
-
|
|
1829
|
+
let groupHdr = groupElem.querySelector('.e-group-header');
|
|
1830
|
+
if (this.enableSeparateConnector && groupElem.id.indexOf('rule') !== -1) {
|
|
1831
|
+
groupHdr = groupElem;
|
|
1832
|
+
}
|
|
1271
1833
|
if (this.headerTemplate) {
|
|
1272
1834
|
args = { requestType: 'header-template-initialize', ruleID: groupElem.id,
|
|
1273
1835
|
notCondition: this.enableNotCondition ? not : undefined,
|
|
1274
1836
|
condition: condition, rule: this.getRuleCollection(rule, true), groupID: groupID };
|
|
1275
1837
|
this.trigger('actionBegin', args);
|
|
1838
|
+
if (this.enableSeparateConnector && groupElem.id.indexOf('rule') !== -1) {
|
|
1839
|
+
args.requestType = 'rule-template-create';
|
|
1840
|
+
}
|
|
1276
1841
|
this.headerFn = this.templateParser(this.headerTemplate);
|
|
1277
1842
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1278
1843
|
if (this.isReact) {
|
|
1279
1844
|
template = this.headerFn(args, this, groupElem.id, templateID)[0];
|
|
1280
|
-
|
|
1845
|
+
if (this.enableSeparateConnector && isInitialRule) {
|
|
1846
|
+
this.enableSeparateConnectorInitialRule(groupElem, template);
|
|
1847
|
+
}
|
|
1848
|
+
else if (this.enableSeparateConnector && groupElem.id.indexOf('rule') !== -1) {
|
|
1849
|
+
groupHdr.parentElement.insertBefore(template, groupHdr.nextElementSibling);
|
|
1850
|
+
}
|
|
1851
|
+
else {
|
|
1852
|
+
groupHdr.appendChild(template);
|
|
1853
|
+
}
|
|
1281
1854
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1282
1855
|
}
|
|
1283
1856
|
else if (this.isAngular) {
|
|
1284
1857
|
const templateColl = this.headerFn(args, this, groupElem.id, templateID);
|
|
1285
1858
|
template = (templateColl[0].nodeType === 3) ? templateColl[1] : templateColl[0];
|
|
1286
|
-
|
|
1859
|
+
if (this.enableSeparateConnector && isInitialRule) {
|
|
1860
|
+
this.enableSeparateConnectorInitialRule(groupElem, template);
|
|
1861
|
+
}
|
|
1862
|
+
else if (this.enableSeparateConnector && groupElem.id.indexOf('rule') !== -1) {
|
|
1863
|
+
groupHdr.parentElement.insertBefore(template, groupHdr.nextElementSibling);
|
|
1864
|
+
}
|
|
1865
|
+
else {
|
|
1866
|
+
groupHdr.appendChild(template);
|
|
1867
|
+
}
|
|
1287
1868
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1288
1869
|
}
|
|
1289
1870
|
else if (this.isVue3) {
|
|
1290
1871
|
template = this.headerFn(args, this, groupElem.id, templateID);
|
|
1291
|
-
|
|
1292
|
-
|
|
1872
|
+
if (this.enableSeparateConnector && isInitialRule) {
|
|
1873
|
+
this.enableSeparateConnectorInitialRule(groupElem, template);
|
|
1874
|
+
}
|
|
1875
|
+
else if (this.enableSeparateConnector && groupElem.id.indexOf('rule') !== -1) {
|
|
1876
|
+
groupHdr.parentElement.insertBefore(template, groupHdr.nextElementSibling);
|
|
1877
|
+
}
|
|
1878
|
+
else {
|
|
1879
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1880
|
+
append(template, groupHdr);
|
|
1881
|
+
}
|
|
1293
1882
|
}
|
|
1294
1883
|
else {
|
|
1295
1884
|
template = this.headerFn(args, this, 'Template', templateID)[0];
|
|
1296
|
-
|
|
1885
|
+
if (this.enableSeparateConnector && isInitialRule) {
|
|
1886
|
+
this.enableSeparateConnectorInitialRule(groupElem, template);
|
|
1887
|
+
}
|
|
1888
|
+
else if (this.enableSeparateConnector && groupElem.id.indexOf('rule') !== -1) {
|
|
1889
|
+
groupHdr.parentElement.insertBefore(template, groupHdr.nextElementSibling);
|
|
1890
|
+
}
|
|
1891
|
+
else {
|
|
1892
|
+
groupHdr.appendChild(template);
|
|
1893
|
+
}
|
|
1297
1894
|
}
|
|
1298
1895
|
this.renderReactTemplates();
|
|
1299
1896
|
}
|
|
1300
1897
|
return groupElem;
|
|
1301
1898
|
}
|
|
1899
|
+
enableSeparateConnectorInitialRule(groupElem, template) {
|
|
1900
|
+
const elem = groupElem.nextElementSibling ? groupElem.nextElementSibling : groupElem;
|
|
1901
|
+
let group = elem.closest('.e-group-container');
|
|
1902
|
+
if (!groupElem.nextElementSibling && group) {
|
|
1903
|
+
group = group.nextElementSibling ? group.nextElementSibling : group;
|
|
1904
|
+
}
|
|
1905
|
+
if (group) {
|
|
1906
|
+
group.parentElement.insertBefore(template, group);
|
|
1907
|
+
}
|
|
1908
|
+
}
|
|
1302
1909
|
/**
|
|
1303
1910
|
* Notify the changes to component.
|
|
1304
1911
|
*
|
|
@@ -1309,7 +1916,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1309
1916
|
*/
|
|
1310
1917
|
notifyChange(value, element, type) {
|
|
1311
1918
|
const grpElement = closest(element, '.e-group-container');
|
|
1312
|
-
|
|
1919
|
+
let rules = this.getParentGroup(grpElement);
|
|
1313
1920
|
let ruleElement = closest(element, '.e-rule-container');
|
|
1314
1921
|
let index = 0;
|
|
1315
1922
|
if (type === 'not') {
|
|
@@ -1317,12 +1924,29 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1317
1924
|
return;
|
|
1318
1925
|
}
|
|
1319
1926
|
if (type === 'condition') {
|
|
1320
|
-
|
|
1927
|
+
if (this.enableSeparateConnector) {
|
|
1928
|
+
ruleElement = element.parentElement.previousElementSibling;
|
|
1929
|
+
if (ruleElement && ruleElement.classList.contains('e-group-container')) {
|
|
1930
|
+
ruleElement = ruleElement.querySelectorAll('.e-rule-container')[ruleElement.querySelectorAll('.e-rule-container').length - 1];
|
|
1931
|
+
}
|
|
1932
|
+
if (ruleElement && ruleElement.classList.contains('e-rule-container')) {
|
|
1933
|
+
rules = this.getRule(ruleElement);
|
|
1934
|
+
}
|
|
1935
|
+
rules.condition = value;
|
|
1936
|
+
}
|
|
1937
|
+
else {
|
|
1938
|
+
rules.condition = value;
|
|
1939
|
+
}
|
|
1321
1940
|
return;
|
|
1322
1941
|
}
|
|
1323
1942
|
while (ruleElement && ruleElement.previousElementSibling !== null) {
|
|
1324
1943
|
ruleElement = ruleElement.previousElementSibling;
|
|
1325
|
-
|
|
1944
|
+
if (!this.enableSeparateConnector || (this.enableSeparateConnector &&
|
|
1945
|
+
((!this.headerTemplate && !ruleElement.classList.contains('e-btn-group')) ||
|
|
1946
|
+
this.headerTemplate && (ruleElement.classList.contains('e-rule-container') ||
|
|
1947
|
+
ruleElement.classList.contains('e-group-container'))))) {
|
|
1948
|
+
index++;
|
|
1949
|
+
}
|
|
1326
1950
|
}
|
|
1327
1951
|
const rule = rules.rules[index];
|
|
1328
1952
|
const column = this.getColumn(rule.field);
|
|
@@ -1359,7 +1983,12 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1359
1983
|
}
|
|
1360
1984
|
while (ruleElem && ruleElem.previousElementSibling !== null) {
|
|
1361
1985
|
ruleElem = ruleElem.previousElementSibling;
|
|
1362
|
-
|
|
1986
|
+
if (!this.enableSeparateConnector || (this.enableSeparateConnector &&
|
|
1987
|
+
((!this.headerTemplate && !ruleElem.classList.contains('e-btn-group')) ||
|
|
1988
|
+
this.headerTemplate && (ruleElem.classList.contains('e-rule-container') ||
|
|
1989
|
+
ruleElem.classList.contains('e-group-container'))))) {
|
|
1990
|
+
index++;
|
|
1991
|
+
}
|
|
1363
1992
|
}
|
|
1364
1993
|
const rule = rules.rules[index];
|
|
1365
1994
|
if (type === 'field') {
|
|
@@ -1416,12 +2045,14 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1416
2045
|
else {
|
|
1417
2046
|
ruleElement.className = 'e-rule-container e-horizontal-mode';
|
|
1418
2047
|
}
|
|
1419
|
-
if (
|
|
1420
|
-
if (ruleElement.className.indexOf('e-
|
|
1421
|
-
ruleElement.className
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
ruleElement.previousElementSibling.className
|
|
2048
|
+
if (!this.enableSeparateConnector) {
|
|
2049
|
+
if (ruleElement.previousElementSibling && ruleElement.previousElementSibling.className.indexOf('e-rule-container') > -1) {
|
|
2050
|
+
if (ruleElement.className.indexOf('e-joined-rule') < 0) {
|
|
2051
|
+
ruleElement.className += ' e-joined-rule';
|
|
2052
|
+
}
|
|
2053
|
+
if (ruleElement.previousElementSibling.className.indexOf('e-prev-joined-rule') < 0) {
|
|
2054
|
+
ruleElement.previousElementSibling.className += ' e-prev-joined-rule';
|
|
2055
|
+
}
|
|
1425
2056
|
}
|
|
1426
2057
|
}
|
|
1427
2058
|
if (ruleElement.previousElementSibling && ruleElement.previousElementSibling.className.indexOf('e-group-container') > -1 &&
|
|
@@ -1485,8 +2116,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1485
2116
|
let value;
|
|
1486
2117
|
let rbValue;
|
|
1487
2118
|
if (element.className.indexOf('e-radio') > -1) {
|
|
1488
|
-
|
|
1489
|
-
rbValue = parseInt(element.id.split('valuekey')[1], 0);
|
|
2119
|
+
rbValue = parseInt(element.id.split('valuekey')[1], 10);
|
|
1490
2120
|
if (this.fieldMode === 'Default') {
|
|
1491
2121
|
dropDownObj = getComponent(closest(element, '.e-rule-container').querySelector('.e-filter-input'), 'dropdownlist');
|
|
1492
2122
|
this.selectedColumn = dropDownObj.getDataByValue(dropDownObj.value);
|
|
@@ -1516,7 +2146,9 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1516
2146
|
if (args.type === 'input' && args.currentTarget) {
|
|
1517
2147
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1518
2148
|
value = Number(args.currentTarget.value);
|
|
1519
|
-
|
|
2149
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2150
|
+
const elem = args.currentTarget;
|
|
2151
|
+
const numericTextBoxObj = getInstance(elem, NumericTextBox);
|
|
1520
2152
|
numericTextBoxObj.value = value;
|
|
1521
2153
|
this.isNumInput = true;
|
|
1522
2154
|
}
|
|
@@ -1624,7 +2256,12 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1624
2256
|
let index = 0;
|
|
1625
2257
|
while (ruleElem && ruleElem.previousElementSibling !== null) {
|
|
1626
2258
|
ruleElem = ruleElem.previousElementSibling;
|
|
1627
|
-
|
|
2259
|
+
if (!this.enableSeparateConnector || (this.enableSeparateConnector &&
|
|
2260
|
+
((!this.headerTemplate && !ruleElem.classList.contains('e-btn-group')) ||
|
|
2261
|
+
this.headerTemplate && (ruleElem.classList.contains('e-rule-container') ||
|
|
2262
|
+
ruleElem.classList.contains('e-group-container'))))) {
|
|
2263
|
+
index++;
|
|
2264
|
+
}
|
|
1628
2265
|
}
|
|
1629
2266
|
rules.rules[index].value = '';
|
|
1630
2267
|
this.changeRule(rules.rules[index], args);
|
|
@@ -1669,7 +2306,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1669
2306
|
const ruleID = ruleElem.id.replace(this.element.id + '_', '');
|
|
1670
2307
|
const eventsArgs = { groupID: grID, ruleID: ruleID, selectedField: this.fieldMode === 'DropdownTree' ?
|
|
1671
2308
|
dl.value[0] : dl.value, cancel: false, type: 'field' };
|
|
1672
|
-
if (!this.isImportRules) {
|
|
2309
|
+
if (!this.isImportRules && !this.prvtEvtTgrDaD) {
|
|
1673
2310
|
this.trigger('beforeChange', eventsArgs, (observedChangeArgs) => {
|
|
1674
2311
|
this.fieldChangeSuccess(observedChangeArgs, tmpRl, flt, rl, dArg);
|
|
1675
2312
|
});
|
|
@@ -1839,7 +2476,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1839
2476
|
if (valElem && this.getColumn(rule.field).template) {
|
|
1840
2477
|
filterElem = operatorElem.previousElementSibling;
|
|
1841
2478
|
}
|
|
1842
|
-
if (valElem.children.length
|
|
2479
|
+
if (valElem.children.length === 0) {
|
|
1843
2480
|
filterElem = operatorElem.previousElementSibling;
|
|
1844
2481
|
}
|
|
1845
2482
|
this.changeRuleValues(filterElem, rule, tempRule, ddlArgs);
|
|
@@ -1893,7 +2530,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1893
2530
|
value = '';
|
|
1894
2531
|
ddlIdx = -1;
|
|
1895
2532
|
}
|
|
1896
|
-
if (this.isImportRules || (this.ruleIndex > -1 || this.groupIndex > -1)) {
|
|
2533
|
+
if (this.isImportRules || (this.ruleIndex > -1 || this.groupIndex > -1 || this.prvtEvtTgrDaD)) {
|
|
1897
2534
|
value = rule ? (rule.operator ? rule.operator : value) : value;
|
|
1898
2535
|
}
|
|
1899
2536
|
let ddlOperator;
|
|
@@ -2273,14 +2910,15 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
2273
2910
|
const columnData = this.getItemData(parentId);
|
|
2274
2911
|
let selectedValue;
|
|
2275
2912
|
const isTemplate = (typeof columnData.template === 'string');
|
|
2276
|
-
if (this.isImportRules || this.ruleIndex > -1 || this.groupIndex > -1 || this.isPublic || isTemplate || rule.value
|
|
2913
|
+
if (this.isImportRules || this.ruleIndex > -1 || this.groupIndex > -1 || this.isPublic || isTemplate || rule.value !== '') {
|
|
2277
2914
|
selectedValue = rule.value;
|
|
2278
2915
|
}
|
|
2279
2916
|
else {
|
|
2280
2917
|
selectedValue = this.setDefaultValue(parentId, false, false);
|
|
2281
2918
|
}
|
|
2282
2919
|
if ((operator === 'in' || operator === 'notin') && (this.dataColl.length || columnData.values)) {
|
|
2283
|
-
selectedVal = (this.isImportRules || this.ruleIndex > -1 || this.groupIndex > -1) ? rule.value :
|
|
2920
|
+
selectedVal = (this.isImportRules || this.ruleIndex > -1 || this.groupIndex > -1 || this.isPublic) ? rule.value :
|
|
2921
|
+
this.setDefaultValue(parentId, true, false);
|
|
2284
2922
|
this.renderMultiSelect(columnData, parentId, idx, selectedVal, columnData.values);
|
|
2285
2923
|
if (this.displayMode === 'Vertical' || this.element.className.indexOf('e-device') > -1) {
|
|
2286
2924
|
ruleValElem.style.width = '100%';
|
|
@@ -2292,7 +2930,8 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
2292
2930
|
}
|
|
2293
2931
|
else {
|
|
2294
2932
|
if (operator === 'in' || operator === 'notin') {
|
|
2295
|
-
selectedVal = (this.isImportRules || this.ruleIndex > -1 || this.groupIndex > -1) ? rule.value :
|
|
2933
|
+
selectedVal = (this.isImportRules || this.ruleIndex > -1 || this.groupIndex > -1) ? rule.value :
|
|
2934
|
+
this.setDefaultValue(parentId, true, false);
|
|
2296
2935
|
selectedValue = selectedVal.join(',');
|
|
2297
2936
|
}
|
|
2298
2937
|
let txtBox;
|
|
@@ -2312,9 +2951,11 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
2312
2951
|
renderNumberValue(parentId, rule, operator, idx, ruleValElem, itemData, length) {
|
|
2313
2952
|
const columnData = this.getItemData(parentId);
|
|
2314
2953
|
const isTemplate = (typeof columnData.template === 'string');
|
|
2315
|
-
let selectedVal = (this.isImportRules || this.ruleIndex > -1 || this.groupIndex > -1 || this.isPublic || isTemplate ||
|
|
2954
|
+
let selectedVal = (this.isImportRules || this.ruleIndex > -1 || this.groupIndex > -1 || this.isPublic || isTemplate ||
|
|
2955
|
+
typeof rule.value === 'number') ? rule.value : this.setDefaultValue(parentId, false, true);
|
|
2316
2956
|
if ((operator === 'in' || operator === 'notin') && (this.dataColl.length || columnData.values)) {
|
|
2317
|
-
selectedVal = (this.isImportRules || this.ruleIndex > -1 || this.groupIndex > -1) ? rule.value :
|
|
2957
|
+
selectedVal = (this.isImportRules || this.ruleIndex > -1 || this.groupIndex > -1 || this.isPublic) ? rule.value :
|
|
2958
|
+
this.setDefaultValue(parentId, true, false);
|
|
2318
2959
|
this.renderMultiSelect(columnData, parentId, idx, selectedVal, columnData.values);
|
|
2319
2960
|
if (this.element.className.indexOf('e-device') > -1 || this.displayMode === 'Vertical') {
|
|
2320
2961
|
ruleValElem.style.width = '100%';
|
|
@@ -2325,7 +2966,8 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
2325
2966
|
}
|
|
2326
2967
|
}
|
|
2327
2968
|
else if (operator === 'in' || operator === 'notin') {
|
|
2328
|
-
selectedVal = (this.isImportRules || this.ruleIndex > -1 || this.groupIndex > -1) ? rule.value :
|
|
2969
|
+
selectedVal = (this.isImportRules || this.ruleIndex > -1 || this.groupIndex > -1) ? rule.value :
|
|
2970
|
+
this.setDefaultValue(parentId, true, false);
|
|
2329
2971
|
const selVal = selectedVal.join(',');
|
|
2330
2972
|
let txtInp;
|
|
2331
2973
|
txtInp = {
|
|
@@ -2786,10 +3428,14 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
2786
3428
|
}
|
|
2787
3429
|
const controlName = element.className.split(' e-')[idx];
|
|
2788
3430
|
const i = parseInt(element.id.slice(-1), 2);
|
|
3431
|
+
let column;
|
|
3432
|
+
let format;
|
|
3433
|
+
let selectedDate;
|
|
3434
|
+
let value;
|
|
3435
|
+
let radioBtnObj;
|
|
2789
3436
|
switch (controlName) {
|
|
2790
3437
|
case 'checkbox':
|
|
2791
|
-
|
|
2792
|
-
const value = getComponent(element, controlName).value;
|
|
3438
|
+
value = getComponent(element, controlName).value;
|
|
2793
3439
|
rule.value = (value !== '') ? value : undefined;
|
|
2794
3440
|
break;
|
|
2795
3441
|
case 'textbox':
|
|
@@ -2799,8 +3445,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
2799
3445
|
rule.value = getComponent(element, controlName).value;
|
|
2800
3446
|
break;
|
|
2801
3447
|
case 'radio':
|
|
2802
|
-
|
|
2803
|
-
const radioBtnObj = getComponent(element, controlName);
|
|
3448
|
+
radioBtnObj = getComponent(element, controlName);
|
|
2804
3449
|
if (radioBtnObj.checked) {
|
|
2805
3450
|
if (typeof rule.value === 'boolean') {
|
|
2806
3451
|
rule.value = radioBtnObj.value === 'true';
|
|
@@ -2828,12 +3473,9 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
2828
3473
|
}
|
|
2829
3474
|
break;
|
|
2830
3475
|
case 'datepicker':
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
const format = this.getFormat(column.format);
|
|
2835
|
-
// eslint-disable-next-line
|
|
2836
|
-
const selectedDate = getComponent(element, controlName).value;
|
|
3476
|
+
column = this.getColumn(rule.field);
|
|
3477
|
+
format = this.getFormat(column.format);
|
|
3478
|
+
selectedDate = getComponent(element, controlName).value;
|
|
2837
3479
|
if (rule.operator.indexOf('between') > -1) {
|
|
2838
3480
|
if (typeof rule.value === 'string') {
|
|
2839
3481
|
rule.value = [];
|
|
@@ -2866,7 +3508,12 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
2866
3508
|
const beforeRules = this.getValidRules(this.rule);
|
|
2867
3509
|
while (ruleElem && ruleElem.previousElementSibling !== null) {
|
|
2868
3510
|
ruleElem = ruleElem.previousElementSibling;
|
|
2869
|
-
|
|
3511
|
+
if (!this.enableSeparateConnector || (this.enableSeparateConnector &&
|
|
3512
|
+
((!this.headerTemplate && !ruleElem.classList.contains('e-btn-group')) ||
|
|
3513
|
+
this.headerTemplate && (ruleElem.classList.contains('e-rule-container') ||
|
|
3514
|
+
ruleElem.classList.contains('e-group-container'))))) {
|
|
3515
|
+
index++;
|
|
3516
|
+
}
|
|
2870
3517
|
}
|
|
2871
3518
|
let operator = rule.rules[index].operator ? rule.rules[index].operator.toString() : '';
|
|
2872
3519
|
ruleElem = closest(target, '.e-rule-container');
|
|
@@ -2915,7 +3562,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
2915
3562
|
}
|
|
2916
3563
|
this.updateValues(elementCln[i], rule.rules[index]);
|
|
2917
3564
|
}
|
|
2918
|
-
if (!this.isImportRules) {
|
|
3565
|
+
if (!this.isImportRules && !this.prvtEvtTgrDaD) {
|
|
2919
3566
|
this.trigger('change', eventsArgs);
|
|
2920
3567
|
}
|
|
2921
3568
|
if (this.allowValidation && rule.rules[index].field && target.parentElement.className.indexOf('e-tooltip') > -1) {
|
|
@@ -2960,7 +3607,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
2960
3607
|
const beforeRuleStr = JSON.stringify({ condition: beforeRule.condition, not: beforeRule.not, rule: beforeRule.rules });
|
|
2961
3608
|
const afetrRuleStr = JSON.stringify({ condition: afterRule.condition, not: afterRule.not, rule: afterRule.rules });
|
|
2962
3609
|
if (beforeRuleStr !== afetrRuleStr) {
|
|
2963
|
-
if (!this.isImportRules) {
|
|
3610
|
+
if (!this.isImportRules && !this.prvtEvtTgrDaD) {
|
|
2964
3611
|
this.trigger('ruleChange', { previousRule: beforeRule, rule: afterRule, type: type });
|
|
2965
3612
|
}
|
|
2966
3613
|
}
|
|
@@ -3127,7 +3774,6 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3127
3774
|
let len;
|
|
3128
3775
|
let tooltip;
|
|
3129
3776
|
super.destroy();
|
|
3130
|
-
let popupElement;
|
|
3131
3777
|
element = this.element.querySelectorAll('.e-addrulegroup');
|
|
3132
3778
|
len = element.length;
|
|
3133
3779
|
for (i = 0; i < len; i++) {
|
|
@@ -3173,7 +3819,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3173
3819
|
if (this.portals && this.portals.length) {
|
|
3174
3820
|
this.clearQBTemplate();
|
|
3175
3821
|
}
|
|
3176
|
-
popupElement = document.querySelectorAll('.qb-dropdownlist.e-popup');
|
|
3822
|
+
const popupElement = document.querySelectorAll('.qb-dropdownlist.e-popup');
|
|
3177
3823
|
if (popupElement) {
|
|
3178
3824
|
for (i = 0; i < popupElement.length; i++) {
|
|
3179
3825
|
popupElement[i].remove();
|
|
@@ -3246,7 +3892,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3246
3892
|
}
|
|
3247
3893
|
}
|
|
3248
3894
|
if (!this.headerTemplate) {
|
|
3249
|
-
this.disableRuleCondition(groupElem, rule);
|
|
3895
|
+
this.disableRuleCondition(groupElem, rule, null, this.enableSeparateConnector ? true : null);
|
|
3250
3896
|
}
|
|
3251
3897
|
}
|
|
3252
3898
|
}
|
|
@@ -3255,6 +3901,9 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3255
3901
|
if (this.cssClass) {
|
|
3256
3902
|
addClass([this.element], this.cssClass.replace(/\s+/g, ' ').trim().split(' '));
|
|
3257
3903
|
}
|
|
3904
|
+
if (this.enableSeparateConnector) {
|
|
3905
|
+
addClass([this.element], 'e-multi-connector');
|
|
3906
|
+
}
|
|
3258
3907
|
if (this.enableRtl) {
|
|
3259
3908
|
addClass([this.element], 'e-rtl');
|
|
3260
3909
|
}
|
|
@@ -3291,14 +3940,14 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3291
3940
|
}
|
|
3292
3941
|
}
|
|
3293
3942
|
else {
|
|
3294
|
-
if (this.columns.length && this.isImportRules) {
|
|
3943
|
+
if (this.columns && this.columns.length && this.isImportRules) {
|
|
3295
3944
|
this.addGroupElement(false, this.element, this.rule.condition, false, this.rule.not, false, this.rule);
|
|
3296
3945
|
const mRules = extend({}, this.rule, {}, true);
|
|
3297
3946
|
this.isRefreshed = true;
|
|
3298
3947
|
this.setGroupRules(mRules);
|
|
3299
3948
|
this.isRefreshed = false;
|
|
3300
3949
|
}
|
|
3301
|
-
else if (this.columns.length) {
|
|
3950
|
+
else if (this.columns && this.columns.length) {
|
|
3302
3951
|
this.addRuleElement(this.element.querySelector('.e-group-container'), {});
|
|
3303
3952
|
}
|
|
3304
3953
|
this.notGroupRtl();
|
|
@@ -3352,8 +4001,8 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3352
4001
|
this.groupIdCounter = 0;
|
|
3353
4002
|
if (!this.headerTemplate) {
|
|
3354
4003
|
if (this.enableNotCondition) {
|
|
3355
|
-
|
|
3356
|
-
|
|
4004
|
+
const inputElem = this.createElement('button', { attrs: { type: 'button', class: 'e-qb-toggle' } });
|
|
4005
|
+
if (this.groupElem.querySelector('.e-btn-group')) {
|
|
3357
4006
|
this.groupElem.querySelector('.e-btn-group').insertBefore(inputElem, this.groupElem.querySelector('.e-btngroup-and'));
|
|
3358
4007
|
}
|
|
3359
4008
|
}
|
|
@@ -3394,13 +4043,11 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3394
4043
|
}
|
|
3395
4044
|
onPropertyChanged(newProp, oldProp) {
|
|
3396
4045
|
const properties = Object.keys(newProp);
|
|
4046
|
+
const groupElem = this.element.querySelector('.e-group-container');
|
|
4047
|
+
let summaryElem = this.element.querySelector('.e-summary-content');
|
|
3397
4048
|
for (const prop of properties) {
|
|
3398
4049
|
switch (prop) {
|
|
3399
4050
|
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
4051
|
if (newProp.summaryView) {
|
|
3405
4052
|
groupElem.style.display = 'none';
|
|
3406
4053
|
if (this.element.querySelectorAll('.e-summary-content').length < 1) {
|
|
@@ -3540,6 +4187,14 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3540
4187
|
this.isReadonly = newProp.readonly;
|
|
3541
4188
|
this.enableReadonly();
|
|
3542
4189
|
break;
|
|
4190
|
+
case 'allowDragAndDrop':
|
|
4191
|
+
this.allowDragAndDrop = newProp.allowDragAndDrop;
|
|
4192
|
+
this.refresh();
|
|
4193
|
+
break;
|
|
4194
|
+
case 'enableSeparateConnector':
|
|
4195
|
+
this.enableSeparateConnector = newProp.enableSeparateConnector;
|
|
4196
|
+
this.refresh();
|
|
4197
|
+
break;
|
|
3543
4198
|
}
|
|
3544
4199
|
}
|
|
3545
4200
|
}
|
|
@@ -3697,6 +4352,134 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3697
4352
|
this.initControl();
|
|
3698
4353
|
}
|
|
3699
4354
|
this.renderComplete();
|
|
4355
|
+
if (this.allowDragAndDrop) {
|
|
4356
|
+
this.initializeDrag();
|
|
4357
|
+
}
|
|
4358
|
+
}
|
|
4359
|
+
initializeDrag() {
|
|
4360
|
+
this.draggable = new Draggable(this.element, {
|
|
4361
|
+
dragTarget: '.e-drag-qb-rule',
|
|
4362
|
+
distance: 5,
|
|
4363
|
+
helper: this.helper.bind(this),
|
|
4364
|
+
dragStart: this.dragStartHandler.bind(this),
|
|
4365
|
+
drag: this.dragHandler.bind(this),
|
|
4366
|
+
dragStop: this.dragStopHandler.bind(this),
|
|
4367
|
+
isReplaceDragEle: true,
|
|
4368
|
+
isPreventSelect: false,
|
|
4369
|
+
abort: '.e-parent-header',
|
|
4370
|
+
isDragScroll: true
|
|
4371
|
+
});
|
|
4372
|
+
}
|
|
4373
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
4374
|
+
helper(e) {
|
|
4375
|
+
const target = this.draggable.currentStateTarget;
|
|
4376
|
+
if (!target.classList.contains('e-drag-qb-rule') || (target.classList.contains('e-drag-qb-rule') && closest(target, '.e-disable'))) {
|
|
4377
|
+
return false;
|
|
4378
|
+
}
|
|
4379
|
+
const visualElement = this.createElement('div', {
|
|
4380
|
+
className: 'e-cloneproperties e-draganddrop e-dragclone',
|
|
4381
|
+
styles: 'height:"auto", z-index:2, width:' + this.element.offsetWidth
|
|
4382
|
+
});
|
|
4383
|
+
let cloneElement;
|
|
4384
|
+
if (this.draggable.currentStateTarget.parentElement.classList.contains('e-group-header')) {
|
|
4385
|
+
cloneElement = closest(target, '.e-group-container').cloneNode(true);
|
|
4386
|
+
closest(target, '.e-group-container').classList.add('e-qb-dragging-rule');
|
|
4387
|
+
}
|
|
4388
|
+
else {
|
|
4389
|
+
visualElement.classList.add('e-group-body');
|
|
4390
|
+
cloneElement = this.createElement('div', { className: 'e-rule-container' });
|
|
4391
|
+
const ruleElement = closest(target, '.e-rule-field').cloneNode(true);
|
|
4392
|
+
cloneElement.appendChild(ruleElement);
|
|
4393
|
+
closest(target, '.e-rule-field').classList.add('e-qb-dragging-rule');
|
|
4394
|
+
}
|
|
4395
|
+
visualElement.appendChild(cloneElement);
|
|
4396
|
+
const childElements = visualElement.querySelectorAll('*');
|
|
4397
|
+
childElements.forEach((child) => {
|
|
4398
|
+
child.removeAttribute('id');
|
|
4399
|
+
});
|
|
4400
|
+
this.element.appendChild(visualElement);
|
|
4401
|
+
return visualElement;
|
|
4402
|
+
}
|
|
4403
|
+
dragStartHandler(e) {
|
|
4404
|
+
this.draggedRule = e.target;
|
|
4405
|
+
this.isDragEventPrevent = false;
|
|
4406
|
+
document.body.classList.add('e-prevent-select');
|
|
4407
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4408
|
+
this.dragElement = e.dragElement;
|
|
4409
|
+
const rule = closest(e.target, '.e-rule-container');
|
|
4410
|
+
const group = closest(e.target, '.e-group-container');
|
|
4411
|
+
const dragEventArgs = { dragRuleID: rule !== null ? rule.id : group.id, dragGroupID: group.id, cancel: false };
|
|
4412
|
+
this.trigger('dragStart', dragEventArgs);
|
|
4413
|
+
this.isDragEventPrevent = dragEventArgs.cancel;
|
|
4414
|
+
}
|
|
4415
|
+
dragHandler(e) {
|
|
4416
|
+
if (this.isDragEventPrevent) {
|
|
4417
|
+
return;
|
|
4418
|
+
}
|
|
4419
|
+
let borderLineElem = this.element.querySelectorAll('.e-drag-rule-bottom-line');
|
|
4420
|
+
borderLineElem.forEach((ele) => {
|
|
4421
|
+
ele.classList.remove('e-drag-rule-bottom-line');
|
|
4422
|
+
});
|
|
4423
|
+
borderLineElem = this.element.querySelectorAll('.e-drag-rule-top-line');
|
|
4424
|
+
borderLineElem.forEach((ele) => {
|
|
4425
|
+
ele.classList.remove('e-drag-rule-top-line');
|
|
4426
|
+
});
|
|
4427
|
+
if (isNullOrUndefined(e.target)) {
|
|
4428
|
+
return;
|
|
4429
|
+
}
|
|
4430
|
+
if (e.target.nodeName === 'HTML' || closest(e.target, '.e-qb-dragging-rule') || closest(e.target, '.e-group-header') ||
|
|
4431
|
+
!closest(e.target, '#' + this.element.id) || closest(e.target, '.e-disable') || (e.target.parentElement && e.target.parentElement.classList.contains('e-btn-group') && this.enableSeparateConnector)) {
|
|
4432
|
+
this.dragElement.classList.add('e-notallowedcur');
|
|
4433
|
+
return;
|
|
4434
|
+
}
|
|
4435
|
+
else {
|
|
4436
|
+
this.dragElement.classList.remove('e-notallowedcur');
|
|
4437
|
+
}
|
|
4438
|
+
const targetElem = closest(e.target, '.e-rule-container');
|
|
4439
|
+
let grpElem = closest(e.target, '.e-group-container');
|
|
4440
|
+
if (targetElem) {
|
|
4441
|
+
const rect = targetElem.getBoundingClientRect();
|
|
4442
|
+
const mouseY = e.event.clientY || e.event.changedTouches[0].clientY;
|
|
4443
|
+
const distanceToTop = mouseY - rect.top;
|
|
4444
|
+
const distanceToBottom = rect.bottom - mouseY;
|
|
4445
|
+
const threshold = 20; // Adjust as needed
|
|
4446
|
+
if (distanceToTop < threshold) {
|
|
4447
|
+
targetElem.classList.add('e-drag-rule-top-line');
|
|
4448
|
+
}
|
|
4449
|
+
else if (distanceToBottom < threshold) {
|
|
4450
|
+
targetElem.classList.add('e-drag-rule-bottom-line');
|
|
4451
|
+
}
|
|
4452
|
+
}
|
|
4453
|
+
else if (e.target.classList.contains('e-rule-list') && e.target.children.length === 0) {
|
|
4454
|
+
e.target.classList.add('e-drag-rule-bottom-line');
|
|
4455
|
+
}
|
|
4456
|
+
else if (e.target.classList.contains('e-rule-list') && e.target.children[0].classList.contains('e-group-container')) {
|
|
4457
|
+
const rect = e.target.children[0].getBoundingClientRect();
|
|
4458
|
+
const mouseY = e.event.clientY || e.event.changedTouches[0].clientY;
|
|
4459
|
+
const distanceToTop = mouseY - rect.top;
|
|
4460
|
+
const threshold = 20; // Adjust as needed
|
|
4461
|
+
if (distanceToTop < threshold) {
|
|
4462
|
+
e.target.classList.add('e-drag-rule-top-line');
|
|
4463
|
+
}
|
|
4464
|
+
}
|
|
4465
|
+
else if (closest(e.target, '.e-group-container') || e.target.classList.contains('e-group-container')) {
|
|
4466
|
+
if (!grpElem) {
|
|
4467
|
+
grpElem = e.target;
|
|
4468
|
+
}
|
|
4469
|
+
if (grpElem.id.indexOf('group0') > -1) {
|
|
4470
|
+
const rect = e.target.getBoundingClientRect();
|
|
4471
|
+
const mouseY = e.event.clientY || e.event.changedTouches[0].clientY;
|
|
4472
|
+
const distanceToBottom = rect.bottom - mouseY;
|
|
4473
|
+
const threshold = 20; // Adjust as needed
|
|
4474
|
+
if (distanceToBottom < threshold) {
|
|
4475
|
+
e.target.classList.add('e-drag-rule-bottom-line');
|
|
4476
|
+
}
|
|
4477
|
+
}
|
|
4478
|
+
}
|
|
4479
|
+
const dragEventArgs = { dragRuleID: targetElem !== null ? targetElem.id : grpElem !== null ? grpElem.id : null,
|
|
4480
|
+
dragGroupID: grpElem !== null ? grpElem.id : null, cancel: false };
|
|
4481
|
+
this.trigger('drag', dragEventArgs);
|
|
4482
|
+
this.isDragEventPrevent = dragEventArgs.cancel;
|
|
3700
4483
|
}
|
|
3701
4484
|
templateParser(template) {
|
|
3702
4485
|
if (template) {
|
|
@@ -3740,6 +4523,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3740
4523
|
EventHandler.add(wrapper, 'focusout', this.focusEventHandler, this);
|
|
3741
4524
|
EventHandler.add(wrapper, 'focusin', this.focusEventHandler, this);
|
|
3742
4525
|
EventHandler.add(this.element, 'keydown', this.keyBoardHandler, this);
|
|
4526
|
+
EventHandler.add(document, 'keydown', this.keyBoardHandler, this);
|
|
3743
4527
|
}
|
|
3744
4528
|
unWireEvents() {
|
|
3745
4529
|
const wrapper = this.getWrapper();
|
|
@@ -3747,6 +4531,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3747
4531
|
EventHandler.remove(wrapper, 'focusout', this.focusEventHandler);
|
|
3748
4532
|
EventHandler.remove(wrapper, 'focusin', this.focusEventHandler);
|
|
3749
4533
|
EventHandler.remove(this.element, 'keydown', this.keyBoardHandler);
|
|
4534
|
+
EventHandler.remove(document, 'keydown', this.keyBoardHandler);
|
|
3750
4535
|
}
|
|
3751
4536
|
getParentGroup(target, isParent) {
|
|
3752
4537
|
const groupLevel = (target instanceof Element) ? this.levelColl[target.id] : this.levelColl[`${target}`];
|
|
@@ -3774,7 +4559,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3774
4559
|
groupId = groupElem.id.replace(this.element.id + '_', '');
|
|
3775
4560
|
}
|
|
3776
4561
|
const args = { groupID: groupId, cancel: false, type: 'deleteGroup' };
|
|
3777
|
-
if (!this.isImportRules) {
|
|
4562
|
+
if (!this.isImportRules && !this.prvtEvtTgrDaD) {
|
|
3778
4563
|
this.trigger('beforeChange', args, (observedChangeArgs) => {
|
|
3779
4564
|
this.deleteGroupSuccessCallBack(observedChangeArgs, target);
|
|
3780
4565
|
});
|
|
@@ -3804,13 +4589,20 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3804
4589
|
}
|
|
3805
4590
|
while (groupElem.previousElementSibling !== null) {
|
|
3806
4591
|
groupElem = groupElem.previousElementSibling;
|
|
3807
|
-
|
|
4592
|
+
if (!this.enableSeparateConnector || (this.enableSeparateConnector &&
|
|
4593
|
+
((!this.headerTemplate && !groupElem.classList.contains('e-btn-group')) ||
|
|
4594
|
+
this.headerTemplate && (groupElem.classList.contains('e-rule-container') ||
|
|
4595
|
+
groupElem.classList.contains('e-group-container'))))) {
|
|
4596
|
+
index++;
|
|
4597
|
+
}
|
|
3808
4598
|
}
|
|
3809
|
-
if (
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
4599
|
+
if (!this.enableSeparateConnector) {
|
|
4600
|
+
if (nextElem && nextElem.className.indexOf('e-separate-rule') > -1) {
|
|
4601
|
+
removeClass([nextElem], 'e-separate-rule');
|
|
4602
|
+
addClass([nextElem], 'e-joined-rule');
|
|
4603
|
+
if (prevElem && prevElem.className.indexOf('e-rule-container') > -1) {
|
|
4604
|
+
addClass([prevElem], 'e-prev-joined-rule');
|
|
4605
|
+
}
|
|
3814
4606
|
}
|
|
3815
4607
|
}
|
|
3816
4608
|
const elem = groupElem.parentElement.parentElement.parentElement;
|
|
@@ -3842,7 +4634,11 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3842
4634
|
delete this.levelColl[args.groupID];
|
|
3843
4635
|
this.refreshLevelColl();
|
|
3844
4636
|
this.disableRuleCondition(elem, rule);
|
|
3845
|
-
if (!this.
|
|
4637
|
+
if (this.enableSeparateConnector && prevElem && ((!this.headerTemplate && prevElem.classList.contains('e-btn-group')) ||
|
|
4638
|
+
(this.headerTemplate && prevElem.classList.contains('e-custom-group-btn')))) {
|
|
4639
|
+
detach(prevElem);
|
|
4640
|
+
}
|
|
4641
|
+
if (!this.isImportRules && !this.prvtEvtTgrDaD) {
|
|
3846
4642
|
this.trigger('change', args);
|
|
3847
4643
|
}
|
|
3848
4644
|
this.filterRules(beforeRules, this.getValidRules(this.rule), 'deleteGroup');
|
|
@@ -3858,7 +4654,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3858
4654
|
const groupID = groupElem.id.replace(this.element.id + '_', '');
|
|
3859
4655
|
const ruleID = closest(target, '.e-rule-container').id.replace(this.element.id + '_', '');
|
|
3860
4656
|
const args = { groupID: groupID, ruleID: ruleID, cancel: false, type: 'deleteRule' };
|
|
3861
|
-
if (!this.isImportRules) {
|
|
4657
|
+
if (!this.isImportRules && !this.prvtEvtTgrDaD) {
|
|
3862
4658
|
this.trigger('beforeChange', args, (observedChangeArgs) => {
|
|
3863
4659
|
this.deleteRuleSuccessCallBack(observedChangeArgs, target);
|
|
3864
4660
|
});
|
|
@@ -3873,10 +4669,10 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3873
4669
|
const rule = this.getParentGroup(groupElem);
|
|
3874
4670
|
let ruleElem = closest(target, '.e-rule-container');
|
|
3875
4671
|
const beforeRules = this.getValidRules(this.rule);
|
|
3876
|
-
const clnruleElem = ruleElem;
|
|
3877
|
-
const nextElem = ruleElem.nextElementSibling;
|
|
3878
4672
|
const prevElem = ruleElem.previousElementSibling;
|
|
3879
4673
|
let index = 0;
|
|
4674
|
+
const clnruleElem = ruleElem;
|
|
4675
|
+
const nextElem = ruleElem.nextElementSibling;
|
|
3880
4676
|
const valElem = ruleElem.querySelectorAll('.e-tooltip');
|
|
3881
4677
|
let i;
|
|
3882
4678
|
const len = valElem.length;
|
|
@@ -3885,7 +4681,12 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3885
4681
|
}
|
|
3886
4682
|
while (ruleElem.previousElementSibling !== null) {
|
|
3887
4683
|
ruleElem = ruleElem.previousElementSibling;
|
|
3888
|
-
|
|
4684
|
+
if (!this.enableSeparateConnector || (this.enableSeparateConnector &&
|
|
4685
|
+
((!this.headerTemplate && !ruleElem.classList.contains('e-btn-group')) ||
|
|
4686
|
+
this.headerTemplate && (ruleElem.classList.contains('e-rule-container') ||
|
|
4687
|
+
ruleElem.classList.contains('e-group-container'))))) {
|
|
4688
|
+
index++;
|
|
4689
|
+
}
|
|
3889
4690
|
}
|
|
3890
4691
|
const column = this.getColumn(rule.rules[index].field);
|
|
3891
4692
|
if (column && column.template && clnruleElem.querySelector('.e-template')) {
|
|
@@ -3904,17 +4705,27 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3904
4705
|
const isTemplateRendered = clnruleElem.querySelector('.e-template-value');
|
|
3905
4706
|
// eslint-disable
|
|
3906
4707
|
try {
|
|
4708
|
+
if (this.enableSeparateConnector && (clnruleElem.previousElementSibling || clnruleElem.nextElementSibling)) {
|
|
4709
|
+
const previousElem = clnruleElem.previousElementSibling;
|
|
4710
|
+
const nextElem = clnruleElem.nextElementSibling;
|
|
4711
|
+
if (isNullOrUndefined(nextElem) && ((!this.headerTemplate && previousElem.classList.contains('e-btn-group'))
|
|
4712
|
+
|| (this.headerTemplate && previousElem.classList.contains('e-custom-group-btn')))) {
|
|
4713
|
+
if (previousElem && previousElem.previousElementSibling && previousElem.previousElementSibling.classList.contains('e-rule-container')) {
|
|
4714
|
+
const rule = this.getRule(previousElem.previousElementSibling);
|
|
4715
|
+
rule.condition = null;
|
|
4716
|
+
}
|
|
4717
|
+
detach(previousElem);
|
|
4718
|
+
}
|
|
4719
|
+
else if ((!this.headerTemplate && nextElem.classList.contains('e-btn-group'))
|
|
4720
|
+
|| (this.headerTemplate && nextElem.classList.contains('e-custom-group-btn'))) {
|
|
4721
|
+
detach(nextElem);
|
|
4722
|
+
}
|
|
4723
|
+
}
|
|
3907
4724
|
detach(clnruleElem);
|
|
3908
4725
|
}
|
|
3909
4726
|
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;
|
|
4727
|
+
return;
|
|
3916
4728
|
}
|
|
3917
|
-
// eslint-enable
|
|
3918
4729
|
if (column && column.ruleTemplate) {
|
|
3919
4730
|
this.clearQBTemplate([clnruleElem.id]);
|
|
3920
4731
|
}
|
|
@@ -3923,13 +4734,13 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3923
4734
|
}
|
|
3924
4735
|
rule.rules.splice(index, 1);
|
|
3925
4736
|
if (!(rule.rules[0] && rule.rules[0].rules)) {
|
|
3926
|
-
this.disableRuleCondition(groupElem, rule);
|
|
4737
|
+
this.disableRuleCondition(groupElem, rule, this.enableSeparateConnector ? true : false);
|
|
3927
4738
|
}
|
|
3928
4739
|
const tooltipElem = this.element.querySelectorAll('.e-tooltip');
|
|
3929
4740
|
for (let i = 0; i < tooltipElem.length; i++) {
|
|
3930
4741
|
getComponent(tooltipElem[i], 'tooltip').refresh(tooltipElem[i]);
|
|
3931
4742
|
}
|
|
3932
|
-
if (!this.isImportRules) {
|
|
4743
|
+
if (!this.isImportRules && !this.prvtEvtTgrDaD) {
|
|
3933
4744
|
this.trigger('change', args);
|
|
3934
4745
|
}
|
|
3935
4746
|
this.filterRules(beforeRules, this.getValidRules(this.rule), 'deleteRule');
|
|
@@ -3953,9 +4764,32 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3953
4764
|
this.isImportRules = false;
|
|
3954
4765
|
}
|
|
3955
4766
|
keyBoardHandler(e) {
|
|
3956
|
-
if (this.readonly && (e.keyCode === 38 || e.keyCode === 40 || e.keyCode === 13)) {
|
|
4767
|
+
if (e.currentTarget === this.element && this.readonly && (e.keyCode === 38 || e.keyCode === 40 || e.keyCode === 13)) {
|
|
3957
4768
|
e.preventDefault();
|
|
3958
4769
|
}
|
|
4770
|
+
else if (e.code === 'Escape' && this.allowDragAndDrop) {
|
|
4771
|
+
this.isDragEventPrevent = true;
|
|
4772
|
+
document.body.classList.remove('e-prevent-select');
|
|
4773
|
+
let borderLineElem = this.element.querySelectorAll('.e-drag-rule-bottom-line');
|
|
4774
|
+
borderLineElem.forEach((ele) => {
|
|
4775
|
+
ele.classList.remove('e-drag-rule-bottom-line');
|
|
4776
|
+
});
|
|
4777
|
+
borderLineElem = this.element.querySelectorAll('.e-drag-rule-top-line');
|
|
4778
|
+
borderLineElem.forEach((ele) => {
|
|
4779
|
+
ele.classList.remove('e-drag-rule-top-line');
|
|
4780
|
+
});
|
|
4781
|
+
borderLineElem = this.element.querySelectorAll('.e-qb-dragging-rule');
|
|
4782
|
+
borderLineElem.forEach((ele) => {
|
|
4783
|
+
ele.classList.remove('e-qb-dragging-rule');
|
|
4784
|
+
});
|
|
4785
|
+
const dragElemnet = this.element.querySelector('.e-cloneproperties');
|
|
4786
|
+
if (dragElemnet) {
|
|
4787
|
+
remove(dragElemnet);
|
|
4788
|
+
}
|
|
4789
|
+
if (this.enableSeparateConnector) {
|
|
4790
|
+
this.refresh();
|
|
4791
|
+
}
|
|
4792
|
+
}
|
|
3959
4793
|
}
|
|
3960
4794
|
clearQBTemplate(ruleElemColl) {
|
|
3961
4795
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -3963,14 +4797,14 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3963
4797
|
this.clearTemplate(ruleElemColl);
|
|
3964
4798
|
}
|
|
3965
4799
|
}
|
|
3966
|
-
disableRuleCondition(groupElem, rules) {
|
|
4800
|
+
disableRuleCondition(groupElem, rules, isNewRuleAdded, isNewGroup) {
|
|
3967
4801
|
if (!this.headerTemplate) {
|
|
3968
4802
|
if (this.readonly) {
|
|
3969
4803
|
return;
|
|
3970
4804
|
}
|
|
3971
4805
|
const count = groupElem.querySelector('.e-rule-list').childElementCount;
|
|
3972
|
-
|
|
3973
|
-
|
|
4806
|
+
let andElem = groupElem.querySelector('.e-btngroup-and');
|
|
4807
|
+
let orElem = groupElem.querySelector('.e-btngroup-or');
|
|
3974
4808
|
if (count > 1) {
|
|
3975
4809
|
andElem.disabled = false;
|
|
3976
4810
|
orElem.disabled = false;
|
|
@@ -3979,21 +4813,124 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3979
4813
|
orElem.nextElementSibling.classList.remove('e-btn-disable');
|
|
3980
4814
|
andElem.nextElementSibling.classList.remove('e-btn-disable');
|
|
3981
4815
|
}
|
|
3982
|
-
if (
|
|
3983
|
-
|
|
4816
|
+
if (this.enableSeparateConnector && !isNewRuleAdded) {
|
|
4817
|
+
let index = 0;
|
|
4818
|
+
let element;
|
|
4819
|
+
// eslint-disable-next-line no-constant-condition
|
|
4820
|
+
while (true) {
|
|
4821
|
+
const andGroup = groupElem.parentElement.querySelectorAll('.e-btngroup-and');
|
|
4822
|
+
const orGroup = groupElem.parentElement.querySelectorAll('.e-btngroup-or');
|
|
4823
|
+
andElem = andGroup[andGroup.length - (1 + index)];
|
|
4824
|
+
orElem = orGroup[orGroup.length - (1 + index)];
|
|
4825
|
+
element = andGroup[andGroup.length - (1 + index)];
|
|
4826
|
+
if (element && element.parentElement && element.parentElement.style.display === 'none') {
|
|
4827
|
+
index++;
|
|
4828
|
+
}
|
|
4829
|
+
else {
|
|
4830
|
+
break;
|
|
4831
|
+
}
|
|
4832
|
+
}
|
|
4833
|
+
let elem = groupElem.previousElementSibling;
|
|
4834
|
+
while (elem && !elem.classList.contains('e-rule-container')) {
|
|
4835
|
+
if (elem.classList.contains('e-group-container')) {
|
|
4836
|
+
elem = elem.querySelectorAll('.e-rule-container')[elem.querySelectorAll('.e-rule-container').length - 1];
|
|
4837
|
+
break;
|
|
4838
|
+
}
|
|
4839
|
+
elem = elem.previousElementSibling;
|
|
4840
|
+
}
|
|
4841
|
+
if (isNewGroup && groupElem.classList.contains('e-group-container')) {
|
|
4842
|
+
elem = groupElem;
|
|
4843
|
+
const prevRule = this.getGroup(elem);
|
|
4844
|
+
if (prevRule.condition === 'or') {
|
|
4845
|
+
orElem.checked = true;
|
|
4846
|
+
}
|
|
4847
|
+
else {
|
|
4848
|
+
andElem.checked = true;
|
|
4849
|
+
}
|
|
4850
|
+
}
|
|
4851
|
+
else if (elem && elem.classList.contains('e-rule-container')) {
|
|
4852
|
+
const ruleID = elem.id.replace(this.element.id + '_', '');
|
|
4853
|
+
const prevRule = this.getRule(ruleID);
|
|
4854
|
+
if (prevRule.condition === 'or') {
|
|
4855
|
+
orElem.checked = true;
|
|
4856
|
+
}
|
|
4857
|
+
else {
|
|
4858
|
+
andElem.checked = true;
|
|
4859
|
+
}
|
|
4860
|
+
}
|
|
3984
4861
|
}
|
|
3985
|
-
else {
|
|
3986
|
-
|
|
4862
|
+
else if (!isNewRuleAdded) {
|
|
4863
|
+
if (rules && rules.condition === 'or') {
|
|
4864
|
+
orElem.checked = true;
|
|
4865
|
+
}
|
|
4866
|
+
else {
|
|
4867
|
+
andElem.checked = true;
|
|
4868
|
+
}
|
|
3987
4869
|
}
|
|
3988
4870
|
}
|
|
3989
4871
|
else {
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
4872
|
+
if (this.enableSeparateConnector && !isNewRuleAdded) {
|
|
4873
|
+
let index = 0;
|
|
4874
|
+
let element;
|
|
4875
|
+
// eslint-disable-next-line no-constant-condition
|
|
4876
|
+
while (true) {
|
|
4877
|
+
const andGroup = groupElem.parentElement.querySelectorAll('.e-btngroup-and');
|
|
4878
|
+
const orGroup = groupElem.parentElement.querySelectorAll('.e-btngroup-or');
|
|
4879
|
+
andElem = andGroup[andGroup.length - (1 + index)];
|
|
4880
|
+
orElem = orGroup[orGroup.length - (1 + index)];
|
|
4881
|
+
element = andGroup[andGroup.length - (1 + index)];
|
|
4882
|
+
if (element && element.parentElement && element.parentElement.style.display === 'none') {
|
|
4883
|
+
index++;
|
|
4884
|
+
}
|
|
4885
|
+
else {
|
|
4886
|
+
break;
|
|
4887
|
+
}
|
|
4888
|
+
}
|
|
4889
|
+
let elem;
|
|
4890
|
+
let tempElem = groupElem.previousElementSibling;
|
|
4891
|
+
while (tempElem) {
|
|
4892
|
+
if (tempElem.classList.contains('e-group-container')) {
|
|
4893
|
+
tempElem = tempElem.querySelectorAll('.e-rule-container')[tempElem.querySelectorAll('.e-rule-container').length - 1];
|
|
4894
|
+
}
|
|
4895
|
+
if (tempElem.classList.contains('e-rule-container')) {
|
|
4896
|
+
elem = tempElem;
|
|
4897
|
+
break;
|
|
4898
|
+
}
|
|
4899
|
+
tempElem = tempElem.previousElementSibling;
|
|
4900
|
+
}
|
|
4901
|
+
if (isNullOrUndefined(elem) && groupElem.querySelectorAll('.e-rule-container')[groupElem.querySelectorAll('.e-rule-container').length - 1]) {
|
|
4902
|
+
elem = groupElem.querySelectorAll('.e-rule-container')[groupElem.querySelectorAll('.e-rule-container').length - 1];
|
|
4903
|
+
}
|
|
4904
|
+
if (isNewGroup && groupElem.classList.contains('e-group-container')) {
|
|
4905
|
+
elem = groupElem;
|
|
4906
|
+
const prevRule = this.getGroup(elem);
|
|
4907
|
+
if (prevRule.condition === 'or') {
|
|
4908
|
+
orElem.checked = true;
|
|
4909
|
+
}
|
|
4910
|
+
else {
|
|
4911
|
+
andElem.checked = true;
|
|
4912
|
+
}
|
|
4913
|
+
}
|
|
4914
|
+
else if (elem) {
|
|
4915
|
+
const ruleID = elem.id.replace(this.element.id + '_', '');
|
|
4916
|
+
const prevRule = this.getRule(ruleID);
|
|
4917
|
+
if (prevRule.condition === 'or' && orElem) {
|
|
4918
|
+
orElem.checked = true;
|
|
4919
|
+
}
|
|
4920
|
+
else if (andElem) {
|
|
4921
|
+
andElem.checked = true;
|
|
4922
|
+
}
|
|
4923
|
+
}
|
|
4924
|
+
}
|
|
4925
|
+
else if (!isNewRuleAdded) {
|
|
4926
|
+
andElem.checked = false;
|
|
4927
|
+
andElem.disabled = true;
|
|
4928
|
+
orElem.checked = false;
|
|
4929
|
+
orElem.disabled = true;
|
|
4930
|
+
if (rules) {
|
|
4931
|
+
orElem.nextElementSibling.classList.add('e-btn-disable');
|
|
4932
|
+
andElem.nextElementSibling.classList.add('e-btn-disable');
|
|
4933
|
+
}
|
|
3997
4934
|
}
|
|
3998
4935
|
}
|
|
3999
4936
|
}
|
|
@@ -4097,7 +5034,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
4097
5034
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4098
5035
|
rule.custom = customObj;
|
|
4099
5036
|
}
|
|
4100
|
-
if (rule.rules.length === 0) {
|
|
5037
|
+
if (rule.rules && rule.rules.length === 0) {
|
|
4101
5038
|
rule = {};
|
|
4102
5039
|
}
|
|
4103
5040
|
}
|
|
@@ -4166,7 +5103,12 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
4166
5103
|
const rule = this.getParentGroup(groupElem);
|
|
4167
5104
|
while (ruleElem.previousElementSibling !== null) {
|
|
4168
5105
|
ruleElem = ruleElem.previousElementSibling;
|
|
4169
|
-
|
|
5106
|
+
if (!this.enableSeparateConnector || (this.enableSeparateConnector &&
|
|
5107
|
+
((!this.headerTemplate && !ruleElem.classList.contains('e-btn-group')) ||
|
|
5108
|
+
this.headerTemplate && (ruleElem.classList.contains('e-rule-container') ||
|
|
5109
|
+
ruleElem.classList.contains('e-group-container'))))) {
|
|
5110
|
+
index++;
|
|
5111
|
+
}
|
|
4170
5112
|
}
|
|
4171
5113
|
return rule.rules[index];
|
|
4172
5114
|
}
|
|
@@ -4576,13 +5518,10 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
4576
5518
|
if (value.indexOf(':') > -1 && (value.indexOf('/') < 0 && value.indexOf(',') < 0
|
|
4577
5519
|
&& value.indexOf('-') < 0)) {
|
|
4578
5520
|
currDate = new Date();
|
|
4579
|
-
|
|
4580
|
-
currDate.
|
|
4581
|
-
// eslint-disable-next-line
|
|
4582
|
-
currDate.setMinutes(parseInt(value.split(':')[1]));
|
|
5521
|
+
currDate.setHours(parseInt(value.split(':')[0], 10));
|
|
5522
|
+
currDate.setMinutes(parseInt(value.split(':')[1], 10));
|
|
4583
5523
|
if (value.split(':')[2]) {
|
|
4584
|
-
|
|
4585
|
-
currDate.setSeconds(parseInt(value.split(':')[2]));
|
|
5524
|
+
currDate.setSeconds(parseInt(value.split(':')[2], 10));
|
|
4586
5525
|
}
|
|
4587
5526
|
}
|
|
4588
5527
|
return currDate;
|
|
@@ -4598,17 +5537,43 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
4598
5537
|
parentElem = this.renderGroup(rule, rule.condition, parentElem, not);
|
|
4599
5538
|
}
|
|
4600
5539
|
else {
|
|
4601
|
-
if (rule.rules.length > 1 && !this.headerTemplate) {
|
|
5540
|
+
if (rule.rules && rule.rules.length > 1 && !this.headerTemplate) {
|
|
4602
5541
|
// enable/disable conditions when rule group is added
|
|
4603
|
-
|
|
4604
|
-
|
|
5542
|
+
let orElem = parentElem.querySelector('.e-btngroup-or');
|
|
5543
|
+
let andElem = parentElem.querySelector('.e-btngroup-and');
|
|
5544
|
+
if (this.enableSeparateConnector && parentElem.previousElementSibling) {
|
|
5545
|
+
orElem = parentElem.previousElementSibling.querySelector('.e-btngroup-or');
|
|
5546
|
+
andElem = parentElem.previousElementSibling.querySelector('.e-btngroup-and');
|
|
5547
|
+
}
|
|
4605
5548
|
orElem.disabled = false;
|
|
4606
5549
|
andElem.disabled = false;
|
|
4607
|
-
if (
|
|
4608
|
-
|
|
5550
|
+
if (this.enableSeparateConnector) {
|
|
5551
|
+
let elem = parentElem.previousElementSibling;
|
|
5552
|
+
while (elem && !elem.classList.contains('e-rule-container')) {
|
|
5553
|
+
if (elem.classList.contains('e-group-container')) {
|
|
5554
|
+
elem = elem.querySelectorAll('.e-rule-container')[elem.querySelectorAll('.e-rule-container').length - 1];
|
|
5555
|
+
break;
|
|
5556
|
+
}
|
|
5557
|
+
elem = elem.previousElementSibling;
|
|
5558
|
+
}
|
|
5559
|
+
if (elem && elem.classList.contains('e-rule-container')) {
|
|
5560
|
+
const ruleID = elem.id.replace(this.element.id + '_', '');
|
|
5561
|
+
const prevRule = this.getRule(ruleID);
|
|
5562
|
+
if (prevRule.condition === 'or') {
|
|
5563
|
+
orElem.checked = true;
|
|
5564
|
+
}
|
|
5565
|
+
else {
|
|
5566
|
+
andElem.checked = true;
|
|
5567
|
+
}
|
|
5568
|
+
}
|
|
4609
5569
|
}
|
|
4610
5570
|
else {
|
|
4611
|
-
|
|
5571
|
+
if (rule.condition === 'or') {
|
|
5572
|
+
orElem.checked = true;
|
|
5573
|
+
}
|
|
5574
|
+
else {
|
|
5575
|
+
andElem.checked = true;
|
|
5576
|
+
}
|
|
4612
5577
|
}
|
|
4613
5578
|
}
|
|
4614
5579
|
else {
|
|
@@ -4628,7 +5593,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
4628
5593
|
}
|
|
4629
5594
|
}
|
|
4630
5595
|
}
|
|
4631
|
-
if (rule.rules.length === 0 && this.headerTemplate) {
|
|
5596
|
+
if (rule.rules && rule.rules.length === 0 && this.headerTemplate) {
|
|
4632
5597
|
rule.rules[0] = { 'label': '', 'field': '', 'operator': '', 'type': '', 'value': '' };
|
|
4633
5598
|
}
|
|
4634
5599
|
const ruleColl = rule.rules;
|
|
@@ -4649,10 +5614,6 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
4649
5614
|
const lockGrpTarget = parentElem.querySelector('.e-rule-list').children[i].querySelector('.e-lock-grp-btn');
|
|
4650
5615
|
this.groupLock(lockGrpTarget);
|
|
4651
5616
|
}
|
|
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
5617
|
}
|
|
4657
5618
|
}
|
|
4658
5619
|
if (parentElem) {
|
|
@@ -4670,7 +5631,17 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
4670
5631
|
if (this.showButtons.cloneGroup && this.cloneGrpBtnClick && this.isMiddleGroup) {
|
|
4671
5632
|
this.isMiddleGroup = false;
|
|
4672
5633
|
this.cloneGrpBtnClick = false;
|
|
4673
|
-
|
|
5634
|
+
let index = 0;
|
|
5635
|
+
let tempGroupIndex = this.groupIndex + 1;
|
|
5636
|
+
if (this.enableSeparateConnector) {
|
|
5637
|
+
for (let i = 0; i < tempGroupIndex; i++) {
|
|
5638
|
+
if (cloneElem[i].classList.contains('e-rule-container')) {
|
|
5639
|
+
tempGroupIndex++;
|
|
5640
|
+
index++;
|
|
5641
|
+
}
|
|
5642
|
+
}
|
|
5643
|
+
}
|
|
5644
|
+
return cloneElem[this.groupIndex + index + 1]; // group added in the middle
|
|
4674
5645
|
}
|
|
4675
5646
|
else if (this.showButtons.cloneGroup && this.cloneGrpBtnClick && this.isLastGroup) {
|
|
4676
5647
|
this.isLastGroup = false;
|
|
@@ -4796,9 +5767,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
4796
5767
|
}
|
|
4797
5768
|
}
|
|
4798
5769
|
}
|
|
4799
|
-
else if (elem.classList.contains('e-btn-disable'))
|
|
4800
|
-
// do nothing
|
|
4801
|
-
}
|
|
5770
|
+
else if (elem.classList.contains('e-btn-disable')) ;
|
|
4802
5771
|
else {
|
|
4803
5772
|
elem.classList.add('e-readonly');
|
|
4804
5773
|
}
|
|
@@ -4838,6 +5807,9 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
4838
5807
|
for (let j = 0, jLen = rules.rules.length; j < jLen; j++) {
|
|
4839
5808
|
if (rules.rules[j].rules) {
|
|
4840
5809
|
queryStr = this.getSqlString(rules.rules[j], enableEscape, queryStr, sqlLocale);
|
|
5810
|
+
if (this.enableSeparateConnector) {
|
|
5811
|
+
condition = rules.rules[j].condition;
|
|
5812
|
+
}
|
|
4841
5813
|
}
|
|
4842
5814
|
else {
|
|
4843
5815
|
const rule = rules.rules[j];
|
|
@@ -4929,8 +5901,10 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
4929
5901
|
if (condition === '' || (rule && rule.condition !== '' && rule.custom && rule.custom.isCustom)) {
|
|
4930
5902
|
condition = rule.condition;
|
|
4931
5903
|
}
|
|
4932
|
-
|
|
4933
|
-
|
|
5904
|
+
if (condition) {
|
|
5905
|
+
condition = sqlLocale ? this.l10n.getConstant(condition.toUpperCase()).toUpperCase() : condition.toUpperCase();
|
|
5906
|
+
queryStr += ' ' + condition + ' ';
|
|
5907
|
+
}
|
|
4934
5908
|
}
|
|
4935
5909
|
}
|
|
4936
5910
|
}
|
|
@@ -4996,12 +5970,19 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
4996
5970
|
* @returns {ParameterizedSql} – Parameterized SQL query from rules.
|
|
4997
5971
|
*/
|
|
4998
5972
|
getParameterizedSql(rule) {
|
|
4999
|
-
|
|
5000
|
-
|
|
5973
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5974
|
+
if (this.moduleLoader.loadedModules.length) {
|
|
5975
|
+
if (!rule) {
|
|
5976
|
+
rule = this.getValidRules();
|
|
5977
|
+
}
|
|
5978
|
+
const obj = { sql: null };
|
|
5979
|
+
this.notify('query-library', { prop: 'getParameterSql', onPropertyChange: false, value: { rule: rule, obj: obj } });
|
|
5980
|
+
return obj['sql'];
|
|
5981
|
+
}
|
|
5982
|
+
else {
|
|
5983
|
+
console.warn('[WARNING] :: Module "query-library" is not available in QueryBuilder component! You either misspelled the module name or forgot to load it.');
|
|
5001
5984
|
}
|
|
5002
|
-
|
|
5003
|
-
this.notify('query-library', { prop: 'getParameterSql', onPropertyChange: false, value: { rule: rule, obj: obj } });
|
|
5004
|
-
return obj['sql'];
|
|
5985
|
+
return null;
|
|
5005
5986
|
}
|
|
5006
5987
|
/**
|
|
5007
5988
|
* Sets the rules from the parameter sql query.
|
|
@@ -5010,13 +5991,19 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5010
5991
|
* @returns {void}
|
|
5011
5992
|
*/
|
|
5012
5993
|
setParameterizedSql(sqlQuery) {
|
|
5013
|
-
|
|
5014
|
-
this.
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
sql = sql
|
|
5018
|
-
|
|
5019
|
-
|
|
5994
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5995
|
+
if (this.moduleLoader.loadedModules.length) {
|
|
5996
|
+
const obj = { sql: null };
|
|
5997
|
+
this.notify('query-library', { prop: 'convertParamSqlToSql', onPropertyChange: false, value: { sql: sqlQuery, obj: obj } });
|
|
5998
|
+
let sql = obj['sql'];
|
|
5999
|
+
if (sql) {
|
|
6000
|
+
sql = sql.replace(/`/g, '');
|
|
6001
|
+
const ruleModel = this.getRulesFromSql(sql);
|
|
6002
|
+
this.setRules({ condition: ruleModel.condition, not: ruleModel.not, rules: ruleModel.rules });
|
|
6003
|
+
}
|
|
6004
|
+
}
|
|
6005
|
+
else {
|
|
6006
|
+
console.warn('[WARNING] :: Module "query-library" is not available in QueryBuilder component! You either misspelled the module name or forgot to load it.');
|
|
5020
6007
|
}
|
|
5021
6008
|
}
|
|
5022
6009
|
/**
|
|
@@ -5026,12 +6013,19 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5026
6013
|
* @returns {ParameterizedNamedSql} – Parameterized Named SQL query from rules.
|
|
5027
6014
|
*/
|
|
5028
6015
|
getParameterizedNamedSql(rule) {
|
|
5029
|
-
|
|
5030
|
-
|
|
6016
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6017
|
+
if (this.moduleLoader.loadedModules.length) {
|
|
6018
|
+
if (!rule) {
|
|
6019
|
+
rule = this.getValidRules();
|
|
6020
|
+
}
|
|
6021
|
+
const obj = { sql: null };
|
|
6022
|
+
this.notify('query-library', { prop: 'getNamedParameterSql', onPropertyChange: false, value: { rule: rule, obj: obj } });
|
|
6023
|
+
return obj['sql'];
|
|
6024
|
+
}
|
|
6025
|
+
else {
|
|
6026
|
+
console.warn('[WARNING] :: Module "query-library" is not available in QueryBuilder component! You either misspelled the module name or forgot to load it.');
|
|
5031
6027
|
}
|
|
5032
|
-
|
|
5033
|
-
this.notify('query-library', { prop: 'getNamedParameterSql', onPropertyChange: false, value: { rule: rule, obj: obj } });
|
|
5034
|
-
return obj['sql'];
|
|
6028
|
+
return null;
|
|
5035
6029
|
}
|
|
5036
6030
|
/**
|
|
5037
6031
|
* Sets the rules from the named parameter SQL query.
|
|
@@ -5040,13 +6034,19 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5040
6034
|
* @returns {void}
|
|
5041
6035
|
*/
|
|
5042
6036
|
setParameterizedNamedSql(sqlQuery) {
|
|
5043
|
-
|
|
5044
|
-
this.
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
sql = sql
|
|
5048
|
-
|
|
5049
|
-
|
|
6037
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6038
|
+
if (this.moduleLoader.loadedModules.length) {
|
|
6039
|
+
const obj = { sql: null };
|
|
6040
|
+
this.notify('query-library', { prop: 'convertNamedParamSqlToSql', onPropertyChange: false, value: { sql: sqlQuery, obj: obj } });
|
|
6041
|
+
let sql = obj['sql'];
|
|
6042
|
+
if (sql) {
|
|
6043
|
+
sql = sql.replace(/`/g, '');
|
|
6044
|
+
const ruleModel = this.getRulesFromSql(sql);
|
|
6045
|
+
this.setRules({ condition: ruleModel.condition, not: ruleModel.not, rules: ruleModel.rules });
|
|
6046
|
+
}
|
|
6047
|
+
}
|
|
6048
|
+
else {
|
|
6049
|
+
console.warn('[WARNING] :: Module "query-library" is not available in QueryBuilder component! You either misspelled the module name or forgot to load it.');
|
|
5050
6050
|
}
|
|
5051
6051
|
}
|
|
5052
6052
|
/**
|
|
@@ -5057,8 +6057,14 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5057
6057
|
* @returns {void}
|
|
5058
6058
|
*/
|
|
5059
6059
|
setMongoQuery(mongoQuery, mongoLocale) {
|
|
5060
|
-
|
|
5061
|
-
this.
|
|
6060
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6061
|
+
if (this.moduleLoader.loadedModules.length) {
|
|
6062
|
+
this.rule = { condition: 'and', not: false, rules: [] };
|
|
6063
|
+
this.notify('query-library', { prop: 'mongoParser', onPropertyChange: false, value: { mongoQuery: JSON.parse(mongoQuery), rule: this.rule, mongoLocale: mongoLocale } });
|
|
6064
|
+
}
|
|
6065
|
+
else {
|
|
6066
|
+
console.warn('[WARNING] :: Module "query-library" is not available in QueryBuilder component! You either misspelled the module name or forgot to load it.');
|
|
6067
|
+
}
|
|
5062
6068
|
}
|
|
5063
6069
|
/**
|
|
5064
6070
|
* Gets the Mongo query from rules.
|
|
@@ -5067,12 +6073,19 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5067
6073
|
* @returns {object} - Sql query from rules.
|
|
5068
6074
|
*/
|
|
5069
6075
|
getMongoQuery(rule) {
|
|
5070
|
-
|
|
5071
|
-
|
|
6076
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6077
|
+
if (this.moduleLoader.loadedModules.length) {
|
|
6078
|
+
if (!rule) {
|
|
6079
|
+
rule = this.getValidRules();
|
|
6080
|
+
}
|
|
6081
|
+
const obj = { mongoQuery: null };
|
|
6082
|
+
this.notify('query-library', { prop: 'getMongoFromRules', onPropertyChange: false, value: { rule: rule, mongoQuery: '', obj: obj } });
|
|
6083
|
+
return obj['mongoQuery'];
|
|
6084
|
+
}
|
|
6085
|
+
else {
|
|
6086
|
+
console.warn('[WARNING] :: Module "query-library" is not available in QueryBuilder component! You either misspelled the module name or forgot to load it.');
|
|
5072
6087
|
}
|
|
5073
|
-
|
|
5074
|
-
this.notify('query-library', { prop: 'getMongoFromRules', onPropertyChange: false, value: { rule: rule, mongoQuery: '', obj: obj } });
|
|
5075
|
-
return obj['mongoQuery'];
|
|
6088
|
+
return '';
|
|
5076
6089
|
}
|
|
5077
6090
|
/**
|
|
5078
6091
|
* Clones the rule based on the rule ID to the specific group.
|
|
@@ -5091,7 +6104,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5091
6104
|
this.showButtons.cloneRule = true;
|
|
5092
6105
|
this.addRules([{
|
|
5093
6106
|
'label': getRule.label, 'field': getRule.field, 'type': getRule.type, 'operator': getRule.operator,
|
|
5094
|
-
'value': getRule.value
|
|
6107
|
+
'value': getRule.value, 'condition': getRule.condition
|
|
5095
6108
|
}], groupID);
|
|
5096
6109
|
this.ruleIndex = -1;
|
|
5097
6110
|
this.cloneRuleBtnClick = false;
|
|
@@ -5180,8 +6193,9 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5180
6193
|
let matchValue;
|
|
5181
6194
|
for (let i = 0, iLen = operators.length; i < iLen; i++) {
|
|
5182
6195
|
regexStr = /^\w+$/.test(operators[i]) ? '\\b' : '';
|
|
5183
|
-
// eslint-disable-next-line
|
|
5184
|
-
|
|
6196
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6197
|
+
const regExp = RegExp;
|
|
6198
|
+
regex = new regExp('^(' + operators[i] + ')' + regexStr, 'ig');
|
|
5185
6199
|
if (regex.exec(sqlString)) {
|
|
5186
6200
|
this.parser.push(['Operators', operators[i].toLowerCase()]);
|
|
5187
6201
|
return operators[i].length;
|
|
@@ -5191,8 +6205,9 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5191
6205
|
if (!lastPasrser || (lastPasrser && lastPasrser[0] !== 'Literal')) {
|
|
5192
6206
|
for (let i = 0, iLen = conditions.length; i < iLen; i++) {
|
|
5193
6207
|
regexStr = /^\w+$/.test(conditions[i]) ? '\\b' : '';
|
|
5194
|
-
// eslint-disable-next-line
|
|
5195
|
-
|
|
6208
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6209
|
+
const regExp = RegExp;
|
|
6210
|
+
regex = new regExp('^(' + conditions[i] + ')' + regexStr, 'ig');
|
|
5196
6211
|
if (regex.exec(sqlString)) {
|
|
5197
6212
|
this.parser.push(['Conditions', conditions[i].toLowerCase()]);
|
|
5198
6213
|
return conditions[i].length;
|
|
@@ -5201,8 +6216,9 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5201
6216
|
}
|
|
5202
6217
|
for (let i = 0, iLen = subOp.length; i < iLen; i++) {
|
|
5203
6218
|
regexStr = /^\w+$/.test(subOp[i]) ? '\\b' : '';
|
|
5204
|
-
// eslint-disable-next-line
|
|
5205
|
-
|
|
6219
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6220
|
+
const regExp = RegExp;
|
|
6221
|
+
regex = new regExp('^(' + subOp[i] + ')' + regexStr, 'ig');
|
|
5206
6222
|
if (regex.exec(sqlString)) {
|
|
5207
6223
|
this.parser.push(['SubOperators', subOp[i].toLowerCase()]);
|
|
5208
6224
|
return subOp[i].length;
|
|
@@ -5230,31 +6246,25 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5230
6246
|
this.parser.push(['String', null]);
|
|
5231
6247
|
return matchValue.length;
|
|
5232
6248
|
}
|
|
5233
|
-
|
|
5234
|
-
|
|
5235
|
-
// eslint-disable-next-line
|
|
5236
|
-
matchValue = /^`?([a-zåäö_][a-z0-9åäö_.\[\]\(\)]{0,}(\:(number|float|string|date|boolean))?)`?/i.exec(sqlString)[1];
|
|
6249
|
+
if (/^`?([a-z_][a-z0-9_.\\[\]\\(\\)]{0,}(\\:(number|float|string|date|boolean))?)`?/i.exec(sqlString)) {
|
|
6250
|
+
matchValue = /^`?([a-z_][a-z0-9_.\\[\]\\(\\)]{0,}(\\:(number|float|string|date|boolean))?)`?/i.exec(sqlString)[1];
|
|
5237
6251
|
this.parser.push(['Literal', matchValue]);
|
|
5238
6252
|
return matchValue.length;
|
|
5239
6253
|
}
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
// eslint-disable-next-line
|
|
5243
|
-
matchValue = /^'?([a-z_][a-z0-9 _.\[\]\(\)-]{0,}(\:(number|float|string|date|boolean))?)'?/i.exec(sqlString)[1];
|
|
6254
|
+
if (this.checkLiteral() && /^'?([a-z_][a-z0-9 _.\\[\]\\(\\)-]{0,}(\\:(number|float|string|date|boolean))?)'?/i.exec(sqlString)) {
|
|
6255
|
+
matchValue = /^'?([a-z_][a-z0-9 _.\\[\]\\(\\)-]{0,}(\\:(number|float|string|date|boolean))?)'?/i.exec(sqlString)[1];
|
|
5244
6256
|
this.parser.push(['Literal', matchValue]);
|
|
5245
6257
|
return matchValue.length + 2;
|
|
5246
6258
|
}
|
|
5247
6259
|
if (this.checkNumberLiteral(sqlString, sqlLocale)) {
|
|
5248
|
-
|
|
5249
|
-
matchValue = /^[0-9]+(\.[0-9]+)?/.exec(sqlString)[0];
|
|
6260
|
+
matchValue = /^[0-9]+(\.[0-9]+)$/.exec(sqlString)[0];
|
|
5250
6261
|
this.parser.push(['Literal', matchValue]);
|
|
5251
6262
|
return matchValue.length;
|
|
5252
6263
|
}
|
|
5253
6264
|
//String
|
|
5254
|
-
|
|
5255
|
-
if (
|
|
5256
|
-
|
|
5257
|
-
matchValue = /^'((?:[^\\']+?|\\.|'')*)'(?!')/.exec(sqlString)[0];
|
|
6265
|
+
const singleString = this.getSingleQuoteString(sqlString);
|
|
6266
|
+
if (singleString !== '') {
|
|
6267
|
+
matchValue = singleString;
|
|
5258
6268
|
if (matchValue[matchValue.length - 2] === '(') {
|
|
5259
6269
|
let isClosed = false;
|
|
5260
6270
|
for (let j = matchValue.length; j < sqlString.length; j++) {
|
|
@@ -5269,38 +6279,43 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5269
6279
|
}
|
|
5270
6280
|
else if (sqlString[matchValue.length] && (sqlString[matchValue.length] !== ')') &&
|
|
5271
6281
|
!this.checkCondition(sqlString, matchValue)) {
|
|
5272
|
-
matchValue = this.
|
|
6282
|
+
matchValue = this.combineSingleQuoteString(sqlString, matchValue);
|
|
5273
6283
|
}
|
|
5274
6284
|
// end
|
|
5275
6285
|
this.parser.push(['String', matchValue]);
|
|
5276
6286
|
return matchValue.length;
|
|
5277
6287
|
}
|
|
5278
6288
|
// Double String
|
|
5279
|
-
|
|
5280
|
-
if (
|
|
5281
|
-
|
|
5282
|
-
matchValue = /^"([^\\"]*(?:\\.[^\\"]*)*)"/.exec(sqlString)[0];
|
|
6289
|
+
const doubleString = this.getDoubleQuoteString(sqlString);
|
|
6290
|
+
if (doubleString !== '') {
|
|
6291
|
+
matchValue = doubleString;
|
|
5283
6292
|
this.parser.push(['DoubleString', matchValue]);
|
|
5284
6293
|
return matchValue.length;
|
|
5285
6294
|
}
|
|
5286
6295
|
//Number
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
// eslint-disable-next-line
|
|
5290
|
-
matchValue = /^[0-9]+(\.[0-9]+)?/.exec(sqlString)[0];
|
|
6296
|
+
if (/^\d*\.?\d+/.exec(sqlString)) {
|
|
6297
|
+
matchValue = /^\d*\.?\d+/.exec(sqlString)[0];
|
|
5291
6298
|
this.parser.push(['Number', matchValue]);
|
|
5292
6299
|
return matchValue.length;
|
|
5293
6300
|
}
|
|
5294
6301
|
//Negative Number
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
// eslint-disable-next-line
|
|
5298
|
-
matchValue = /^-?[0-9]+(\.[0-9]+)?/.exec(sqlString)[0];
|
|
6302
|
+
if (/^-?\d*\.?\d+/.exec(sqlString)) {
|
|
6303
|
+
matchValue = /^-?\d*\.?\d+/.exec(sqlString)[0];
|
|
5299
6304
|
this.parser.push(['Number', matchValue]);
|
|
5300
6305
|
return matchValue.length;
|
|
5301
6306
|
}
|
|
5302
6307
|
return 1;
|
|
5303
6308
|
}
|
|
6309
|
+
getDoubleQuoteString(sqlString) {
|
|
6310
|
+
const start = sqlString.indexOf('"');
|
|
6311
|
+
if (start === 0) {
|
|
6312
|
+
const end = sqlString.indexOf('"', start + 1);
|
|
6313
|
+
if (end !== -1) {
|
|
6314
|
+
return sqlString.substring(start, end + 1);
|
|
6315
|
+
}
|
|
6316
|
+
}
|
|
6317
|
+
return '';
|
|
6318
|
+
}
|
|
5304
6319
|
checkCondition(sqlString, matchValue) {
|
|
5305
6320
|
if (sqlString.slice(matchValue.length + 1, matchValue.length + 4) === 'AND' ||
|
|
5306
6321
|
sqlString.slice(matchValue.length + 1, matchValue.length + 3) === 'OR') {
|
|
@@ -5308,16 +6323,26 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5308
6323
|
}
|
|
5309
6324
|
return false;
|
|
5310
6325
|
}
|
|
5311
|
-
getSingleQuoteString(sqlString,
|
|
6326
|
+
getSingleQuoteString(sqlString, isBetween) {
|
|
6327
|
+
const start = sqlString.indexOf('\'');
|
|
6328
|
+
if ((start !== -1 && isBetween) || (start === 0 && !isBetween)) {
|
|
6329
|
+
const end = sqlString.indexOf('\'', start + 1);
|
|
6330
|
+
if (end !== -1) {
|
|
6331
|
+
return sqlString.substring(start, end + 1);
|
|
6332
|
+
}
|
|
6333
|
+
}
|
|
6334
|
+
return '';
|
|
6335
|
+
}
|
|
6336
|
+
combineSingleQuoteString(sqlString, matchValue) {
|
|
5312
6337
|
if (sqlString[matchValue.length] && (sqlString[matchValue.length] !== ')') &&
|
|
5313
6338
|
!this.checkCondition(sqlString, matchValue) && sqlString[matchValue.length] !== ',') {
|
|
5314
|
-
const
|
|
5315
|
-
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
6339
|
+
const tempMatchValue = matchValue.substring(0, matchValue.length - 1);
|
|
6340
|
+
const tempStr = sqlString.replace(tempMatchValue, '');
|
|
6341
|
+
const singleString = this.getSingleQuoteString(tempStr, true);
|
|
6342
|
+
if (singleString !== '') {
|
|
6343
|
+
const parsedValue = singleString.substring(1, singleString.length);
|
|
5319
6344
|
matchValue += parsedValue;
|
|
5320
|
-
matchValue = this.
|
|
6345
|
+
matchValue = this.combineSingleQuoteString(sqlString, matchValue);
|
|
5321
6346
|
}
|
|
5322
6347
|
}
|
|
5323
6348
|
return matchValue;
|
|
@@ -5346,8 +6371,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5346
6371
|
return true;
|
|
5347
6372
|
}
|
|
5348
6373
|
else {
|
|
5349
|
-
|
|
5350
|
-
if (/^[0-9]+(\.[0-9]+)?/.exec(sqlString)) {
|
|
6374
|
+
if (/^[0-9]+(?:\.[0-9]+)$/.exec(sqlString)) {
|
|
5351
6375
|
const secParser = this.parser[this.parser.length - 2];
|
|
5352
6376
|
const betweenParser = this.parser[this.parser.length - 3];
|
|
5353
6377
|
if (lastParser[0] === 'Left' && (secParser && secParser[0] === 'Conditions')) {
|
|
@@ -5560,16 +6584,17 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5560
6584
|
strVal = [];
|
|
5561
6585
|
rule.type = this.getTypeFromColumn(rule);
|
|
5562
6586
|
}
|
|
6587
|
+
if (this.enableSeparateConnector && parser[i + 1][0] === 'Conditions') {
|
|
6588
|
+
rule.condition = parser[i + 1][1];
|
|
6589
|
+
}
|
|
5563
6590
|
}
|
|
5564
6591
|
else if (parser[i + 1][0] === 'Operators') {
|
|
5565
6592
|
rule.operator = this.getOperator(parser[i + 2][1], parser[i + 1][1], sqlLocale);
|
|
5566
|
-
if (rule.operator
|
|
5567
|
-
rule.operator =
|
|
5568
|
-
|
|
6593
|
+
if (rule.operator === 'equal' && parser[i + 2][0] === 'String' && parser[i + 2][1] === '\'\'') {
|
|
6594
|
+
rule.operator = 'isempty';
|
|
5569
6595
|
}
|
|
5570
|
-
else if (rule.operator
|
|
5571
|
-
rule.operator =
|
|
5572
|
-
|
|
6596
|
+
else if (rule.operator === 'notequal' && parser[i + 2][0] === 'String' && parser[i + 2][1] === '\'\'') {
|
|
6597
|
+
rule.operator = 'isnotempty';
|
|
5573
6598
|
}
|
|
5574
6599
|
if (parser[i + 2][0] === 'Number') {
|
|
5575
6600
|
rule.type = 'number';
|
|
@@ -5583,6 +6608,9 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5583
6608
|
}
|
|
5584
6609
|
rule.value = val;
|
|
5585
6610
|
}
|
|
6611
|
+
if (this.enableSeparateConnector && parser[i + 3][0] === 'Conditions') {
|
|
6612
|
+
rule.condition = parser[i + 3][1];
|
|
6613
|
+
}
|
|
5586
6614
|
rule.type = this.getTypeFromColumn(rule);
|
|
5587
6615
|
}
|
|
5588
6616
|
rules.rules.push(rule);
|
|
@@ -5610,7 +6638,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5610
6638
|
subRules = this.processParser(this.parser, subRules, levelColl, sqlLocale);
|
|
5611
6639
|
return rules;
|
|
5612
6640
|
}
|
|
5613
|
-
else if (parser[i][0] === 'Conditions') {
|
|
6641
|
+
else if (parser[i][0] === 'Conditions' && !this.enableSeparateConnector) {
|
|
5614
6642
|
if (parser[i][1] === 'not' || (sqlLocale && this.l10n.getConstant('NOT').toLowerCase() === parser[i][1])) {
|
|
5615
6643
|
rules.not = true;
|
|
5616
6644
|
}
|
|
@@ -5631,27 +6659,6 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5631
6659
|
}
|
|
5632
6660
|
return rules;
|
|
5633
6661
|
}
|
|
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
6662
|
/**
|
|
5656
6663
|
* Clone the Group
|
|
5657
6664
|
*
|
|
@@ -5686,8 +6693,14 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5686
6693
|
this.ruleIndex = i;
|
|
5687
6694
|
}
|
|
5688
6695
|
}
|
|
5689
|
-
this.
|
|
5690
|
-
|
|
6696
|
+
if (this.enableSeparateConnector) {
|
|
6697
|
+
this.addRules([{ 'label': getRule.label, 'field': getRule.field, 'type': getRule.type, 'operator': getRule.operator,
|
|
6698
|
+
'value': getRule.value, 'condition': getRule.condition }], groupId);
|
|
6699
|
+
}
|
|
6700
|
+
else {
|
|
6701
|
+
this.addRules([{ 'label': getRule.label, 'field': getRule.field, 'type': getRule.type, 'operator': getRule.operator,
|
|
6702
|
+
'value': getRule.value }], groupId);
|
|
6703
|
+
}
|
|
5691
6704
|
this.ruleIndex = -1;
|
|
5692
6705
|
}
|
|
5693
6706
|
ruleLock(target) {
|
|
@@ -5695,7 +6708,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5695
6708
|
const rule = this.getRule(ruleElem.id.replace(this.element.id + '_', ''));
|
|
5696
6709
|
if (ruleElem.classList.contains('e-disable')) {
|
|
5697
6710
|
rule.isLocked = false;
|
|
5698
|
-
this.lockItems = this.lockItems.filter(lockItem => lockItem !== ruleElem.id);
|
|
6711
|
+
this.lockItems = this.lockItems.filter((lockItem) => lockItem !== ruleElem.id);
|
|
5699
6712
|
ruleElem.classList.remove('e-disable');
|
|
5700
6713
|
this.disableRuleControls(target, ruleElem, false);
|
|
5701
6714
|
target.children[0].classList.add('e-unlock');
|
|
@@ -5716,7 +6729,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5716
6729
|
}
|
|
5717
6730
|
groupLock(target) {
|
|
5718
6731
|
const groupElem = closest(target, '.e-group-container');
|
|
5719
|
-
|
|
6732
|
+
const group = this.getGroup(groupElem.id.replace(this.element.id + '_', ''));
|
|
5720
6733
|
const isRoot = groupElem.id.indexOf('group0') > -1;
|
|
5721
6734
|
if (groupElem.classList.contains('e-disable')) {
|
|
5722
6735
|
if (isRoot) {
|
|
@@ -5729,7 +6742,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5729
6742
|
else {
|
|
5730
6743
|
group.isLocked = false;
|
|
5731
6744
|
}
|
|
5732
|
-
this.lockItems = this.lockItems.filter(lockItem => lockItem !== groupElem.id);
|
|
6745
|
+
this.lockItems = this.lockItems.filter((lockItem) => lockItem !== groupElem.id);
|
|
5733
6746
|
groupElem.classList.remove('e-disable');
|
|
5734
6747
|
this.disableHeaderControls(target, groupElem, false);
|
|
5735
6748
|
target.children[0].classList.add('e-unlock');
|
|
@@ -5788,6 +6801,8 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5788
6801
|
const lockElem = groupElem.querySelectorAll('.e-lock-grp-btn');
|
|
5789
6802
|
const cloneElem = groupElem.querySelectorAll('.e-clone-grp-btn');
|
|
5790
6803
|
const groupContElem = groupElem.querySelectorAll('.e-group-container');
|
|
6804
|
+
const addCondition = groupElem.querySelectorAll('.e-add-condition-btn');
|
|
6805
|
+
const addGroup = groupElem.querySelectorAll('.e-add-group-btn');
|
|
5791
6806
|
for (let i = 0; i < andElem.length; i++) {
|
|
5792
6807
|
if (isDisabled) {
|
|
5793
6808
|
if (groupContElem[i] && groupContElem[i].classList.contains('e-disable')) {
|
|
@@ -5795,7 +6810,15 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5795
6810
|
}
|
|
5796
6811
|
andElem[i].disabled = true;
|
|
5797
6812
|
orElem[i].disabled = true;
|
|
5798
|
-
addElem[i]
|
|
6813
|
+
if (addElem[i]) {
|
|
6814
|
+
addElem[i].disabled = true;
|
|
6815
|
+
}
|
|
6816
|
+
if (addCondition[i]) {
|
|
6817
|
+
addCondition[i].disabled = true;
|
|
6818
|
+
}
|
|
6819
|
+
if (addGroup[i]) {
|
|
6820
|
+
addGroup[i].disabled = true;
|
|
6821
|
+
}
|
|
5799
6822
|
if (notElem[i]) {
|
|
5800
6823
|
notElem[i].disabled = true;
|
|
5801
6824
|
}
|
|
@@ -5806,7 +6829,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5806
6829
|
cloneElem[i].disabled = true;
|
|
5807
6830
|
}
|
|
5808
6831
|
andElem[i].parentElement.classList.add('e-disabled');
|
|
5809
|
-
if (lockElem[i] !== target) {
|
|
6832
|
+
if (lockElem[i] && lockElem[i] !== target) {
|
|
5810
6833
|
lockElem[i].disabled = true;
|
|
5811
6834
|
lockElem[i].children[0].classList.remove('e-unlock');
|
|
5812
6835
|
lockElem[i].children[0].classList.add('e-lock');
|
|
@@ -5818,8 +6841,18 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5818
6841
|
}
|
|
5819
6842
|
andElem[i].disabled = false;
|
|
5820
6843
|
orElem[i].disabled = false;
|
|
5821
|
-
addElem[i]
|
|
5822
|
-
|
|
6844
|
+
if (addElem[i]) {
|
|
6845
|
+
addElem[i].disabled = false;
|
|
6846
|
+
}
|
|
6847
|
+
if (addCondition[i]) {
|
|
6848
|
+
addCondition[i].disabled = false;
|
|
6849
|
+
}
|
|
6850
|
+
if (addGroup[i]) {
|
|
6851
|
+
addGroup[i].disabled = false;
|
|
6852
|
+
}
|
|
6853
|
+
if (lockElem[i]) {
|
|
6854
|
+
lockElem[i].disabled = false;
|
|
6855
|
+
}
|
|
5823
6856
|
if (notElem[i]) {
|
|
5824
6857
|
notElem[i].disabled = false;
|
|
5825
6858
|
}
|
|
@@ -5830,8 +6863,12 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5830
6863
|
cloneElem[i].disabled = false;
|
|
5831
6864
|
}
|
|
5832
6865
|
andElem[i].parentElement.classList.remove('e-disabled');
|
|
5833
|
-
lockElem[i]
|
|
5834
|
-
|
|
6866
|
+
if (lockElem[i]) {
|
|
6867
|
+
lockElem[i].children[0].classList.remove('e-lock');
|
|
6868
|
+
}
|
|
6869
|
+
if (lockElem[i]) {
|
|
6870
|
+
lockElem[i].children[0].classList.add('e-unlock');
|
|
6871
|
+
}
|
|
5835
6872
|
}
|
|
5836
6873
|
}
|
|
5837
6874
|
this.disableRuleControls(target, groupElem, isDisabled);
|
|
@@ -5966,6 +7003,15 @@ __decorate([
|
|
|
5966
7003
|
__decorate([
|
|
5967
7004
|
Event()
|
|
5968
7005
|
], QueryBuilder.prototype, "ruleChange", void 0);
|
|
7006
|
+
__decorate([
|
|
7007
|
+
Event()
|
|
7008
|
+
], QueryBuilder.prototype, "dragStart", void 0);
|
|
7009
|
+
__decorate([
|
|
7010
|
+
Event()
|
|
7011
|
+
], QueryBuilder.prototype, "drag", void 0);
|
|
7012
|
+
__decorate([
|
|
7013
|
+
Event()
|
|
7014
|
+
], QueryBuilder.prototype, "drop", void 0);
|
|
5969
7015
|
__decorate([
|
|
5970
7016
|
Complex({}, ShowButtons)
|
|
5971
7017
|
], QueryBuilder.prototype, "showButtons", void 0);
|
|
@@ -6041,9 +7087,15 @@ __decorate([
|
|
|
6041
7087
|
__decorate([
|
|
6042
7088
|
Property('')
|
|
6043
7089
|
], QueryBuilder.prototype, "separator", void 0);
|
|
7090
|
+
__decorate([
|
|
7091
|
+
Property(false)
|
|
7092
|
+
], QueryBuilder.prototype, "enableSeparateConnector", void 0);
|
|
6044
7093
|
__decorate([
|
|
6045
7094
|
Complex({ condition: 'and', rules: [] }, Rule)
|
|
6046
7095
|
], QueryBuilder.prototype, "rule", void 0);
|
|
7096
|
+
__decorate([
|
|
7097
|
+
Property(false)
|
|
7098
|
+
], QueryBuilder.prototype, "allowDragAndDrop", void 0);
|
|
6047
7099
|
QueryBuilder = __decorate([
|
|
6048
7100
|
NotifyPropertyChanges
|
|
6049
7101
|
], QueryBuilder);
|
|
@@ -6348,13 +7400,13 @@ class QueryLibrary {
|
|
|
6348
7400
|
}
|
|
6349
7401
|
else if (condition === '$or') {
|
|
6350
7402
|
let notBetween;
|
|
6351
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7403
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6352
7404
|
let innerObject = [];
|
|
6353
7405
|
let keys = [];
|
|
6354
7406
|
let firstKey = [];
|
|
6355
7407
|
let secondKey = [];
|
|
6356
7408
|
let innerKeys = [];
|
|
6357
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7409
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6358
7410
|
let firstValue = [];
|
|
6359
7411
|
let secondValue = [];
|
|
6360
7412
|
let innerFirstValue = [];
|
|
@@ -6734,13 +7786,5 @@ class QueryLibrary {
|
|
|
6734
7786
|
}
|
|
6735
7787
|
}
|
|
6736
7788
|
|
|
6737
|
-
|
|
6738
|
-
* QueryBuilder modules
|
|
6739
|
-
*/
|
|
6740
|
-
|
|
6741
|
-
/**
|
|
6742
|
-
* QueryBuilder all modules
|
|
6743
|
-
*/
|
|
6744
|
-
|
|
6745
|
-
export { Columns, Rule, Value, ShowButtons, QueryBuilder, QueryLibrary };
|
|
7789
|
+
export { Columns, QueryBuilder, QueryLibrary, Rule, ShowButtons, Value };
|
|
6746
7790
|
//# sourceMappingURL=ej2-querybuilder.es2015.js.map
|