@syncfusion/ej2-querybuilder 26.2.10 → 27.1.48
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/README.md +1 -1
- 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 +279 -261
- package/dist/es6/ej2-querybuilder.es2015.js.map +1 -1
- package/dist/es6/ej2-querybuilder.es5.js +280 -261
- 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 +13 -12
- package/src/query-builder/query-builder.d.ts +0 -1
- package/src/query-builder/query-builder.js +279 -260
- package/styles/bootstrap-dark-lite.css +728 -0
- package/styles/bootstrap-dark-lite.scss +15 -0
- package/styles/bootstrap-dark.css +114 -170
- package/styles/bootstrap-dark.scss +1 -0
- package/styles/bootstrap-lite.css +713 -0
- package/styles/bootstrap-lite.scss +15 -0
- package/styles/bootstrap.css +106 -162
- package/styles/bootstrap.scss +1 -0
- package/styles/bootstrap4-lite.css +781 -0
- package/styles/bootstrap4-lite.scss +15 -0
- package/styles/bootstrap4.css +120 -231
- package/styles/bootstrap4.scss +1 -0
- package/styles/bootstrap5-dark-lite.css +764 -0
- package/styles/bootstrap5-dark-lite.scss +15 -0
- package/styles/bootstrap5-dark.css +109 -165
- package/styles/bootstrap5-dark.scss +1 -0
- package/styles/bootstrap5-lite.css +764 -0
- package/styles/bootstrap5-lite.scss +15 -0
- package/styles/bootstrap5.3-lite.css +775 -0
- package/styles/bootstrap5.3-lite.scss +15 -0
- package/styles/bootstrap5.3.css +959 -0
- package/styles/bootstrap5.3.scss +16 -0
- package/styles/bootstrap5.css +109 -165
- package/styles/bootstrap5.scss +1 -0
- package/styles/fabric-dark-lite.css +690 -0
- package/styles/fabric-dark-lite.scss +15 -0
- package/styles/fabric-dark.css +108 -156
- package/styles/fabric-dark.scss +1 -0
- package/styles/fabric-lite.css +679 -0
- package/styles/fabric-lite.scss +15 -0
- package/styles/fabric.css +102 -143
- package/styles/fabric.scss +1 -0
- package/styles/fluent-dark-lite.css +759 -0
- package/styles/fluent-dark-lite.scss +15 -0
- package/styles/fluent-dark.css +111 -159
- package/styles/fluent-dark.scss +1 -0
- package/styles/fluent-lite.css +759 -0
- package/styles/fluent-lite.scss +15 -0
- package/styles/fluent.css +111 -159
- package/styles/fluent.scss +1 -0
- package/styles/fluent2-lite.css +771 -0
- package/styles/fluent2-lite.scss +15 -0
- package/styles/fluent2.css +113 -150
- package/styles/fluent2.scss +1 -0
- package/styles/highcontrast-light-lite.css +773 -0
- package/styles/highcontrast-light-lite.scss +15 -0
- package/styles/highcontrast-light.css +101 -135
- package/styles/highcontrast-light.scss +1 -0
- package/styles/highcontrast-lite.css +801 -0
- package/styles/highcontrast-lite.scss +15 -0
- package/styles/highcontrast.css +122 -156
- package/styles/highcontrast.scss +1 -0
- package/styles/material-dark-lite.css +725 -0
- package/styles/material-dark-lite.scss +15 -0
- package/styles/material-dark.css +105 -131
- package/styles/material-dark.scss +1 -0
- package/styles/material-lite.css +731 -0
- package/styles/material-lite.scss +15 -0
- package/styles/material.css +105 -152
- package/styles/material.scss +1 -0
- package/styles/material3-dark-lite.css +738 -0
- package/styles/material3-dark-lite.scss +15 -0
- package/styles/material3-dark.css +101 -157
- package/styles/material3-dark.scss +1 -0
- package/styles/material3-lite.css +740 -0
- package/styles/material3-lite.scss +15 -0
- package/styles/material3.css +101 -157
- package/styles/material3.scss +1 -0
- package/styles/query-builder/_bigger.scss +208 -0
- package/styles/query-builder/_bootstrap5.3-definition.scss +1 -1
- package/styles/query-builder/_layout.scss +5 -210
- package/styles/query-builder/_theme.scss +10 -3
- package/styles/query-builder/bootstrap-dark.css +114 -170
- package/styles/query-builder/bootstrap-dark.scss +1 -0
- package/styles/query-builder/bootstrap.css +106 -162
- package/styles/query-builder/bootstrap.scss +1 -0
- package/styles/query-builder/bootstrap4.css +120 -231
- package/styles/query-builder/bootstrap4.scss +1 -0
- package/styles/query-builder/bootstrap5-dark.css +109 -165
- package/styles/query-builder/bootstrap5-dark.scss +1 -0
- package/styles/query-builder/bootstrap5.3.css +959 -0
- package/styles/query-builder/bootstrap5.3.scss +16 -0
- package/styles/query-builder/bootstrap5.css +109 -165
- package/styles/query-builder/bootstrap5.scss +1 -0
- package/styles/query-builder/fabric-dark.css +108 -156
- package/styles/query-builder/fabric-dark.scss +1 -0
- package/styles/query-builder/fabric.css +102 -143
- package/styles/query-builder/fabric.scss +1 -0
- package/styles/query-builder/fluent-dark.css +111 -159
- package/styles/query-builder/fluent-dark.scss +1 -0
- package/styles/query-builder/fluent.css +111 -159
- package/styles/query-builder/fluent.scss +1 -0
- package/styles/query-builder/fluent2.css +113 -150
- package/styles/query-builder/fluent2.scss +1 -0
- package/styles/query-builder/highcontrast-light.css +101 -135
- package/styles/query-builder/highcontrast-light.scss +1 -0
- package/styles/query-builder/highcontrast.css +122 -156
- package/styles/query-builder/highcontrast.scss +1 -0
- package/styles/query-builder/material-dark.css +105 -131
- package/styles/query-builder/material-dark.scss +1 -0
- package/styles/query-builder/material.css +105 -152
- package/styles/query-builder/material.scss +1 -0
- package/styles/query-builder/material3-dark.css +101 -157
- package/styles/query-builder/material3-dark.scss +1 -0
- package/styles/query-builder/material3.css +101 -157
- package/styles/query-builder/material3.scss +1 -0
- package/styles/query-builder/tailwind-dark.css +100 -137
- package/styles/query-builder/tailwind-dark.scss +1 -0
- package/styles/query-builder/tailwind.css +100 -137
- package/styles/query-builder/tailwind.scss +1 -0
- package/styles/tailwind-dark-lite.css +726 -0
- package/styles/tailwind-dark-lite.scss +15 -0
- package/styles/tailwind-dark.css +100 -137
- package/styles/tailwind-dark.scss +1 -0
- package/styles/tailwind-lite.css +726 -0
- package/styles/tailwind-lite.scss +15 -0
- package/styles/tailwind.css +100 -137
- package/styles/tailwind.scss +1 -0
- package/hotfix/26.1.35_Vol2.txt +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChildProperty, Property, Collection, Component,
|
|
1
|
+
import { ChildProperty, Property, Collection, Component, getComponent, removeClass, isNullOrUndefined, Animation, extend, closest, addClass, select, append, detach, rippleEffect, getInstance, getValue, getNumericObject, Browser, classList, Internationalization, getUniqueID, L10n, Draggable, remove, compile, EventHandler, cldrData, Event, Complex, NotifyPropertyChanges } from '@syncfusion/ej2-base';
|
|
2
2
|
import { Button, CheckBox, RadioButton } from '@syncfusion/ej2-buttons';
|
|
3
3
|
import { MultiSelect, CheckBoxSelection, DropDownList, DropDownTree } from '@syncfusion/ej2-dropdowns';
|
|
4
4
|
import { Query, DataManager, Deferred, Predicate } from '@syncfusion/ej2-data';
|
|
@@ -159,234 +159,6 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
159
159
|
this.cloneGrpBtnClick = false;
|
|
160
160
|
this.isMiddleGroup = false;
|
|
161
161
|
this.cloneRuleBtnClick = false;
|
|
162
|
-
this.isValueEmpty = false;
|
|
163
|
-
this.dragStopHandler = (e) => {
|
|
164
|
-
if (this.isDragEventPrevent) {
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
167
|
-
let targetGroup = closest(e.target, '.e-rule-container');
|
|
168
|
-
if (isNullOrUndefined(targetGroup) && e.target.parentElement &&
|
|
169
|
-
e.target.parentElement.classList.contains('e-btn-group') && this.enableSeparateConnector) {
|
|
170
|
-
targetGroup = closest(e.target.parentElement.previousElementSibling, '.e-rule-container');
|
|
171
|
-
}
|
|
172
|
-
let isPreventelem = closest(e.helper, '.e-notallowedcur');
|
|
173
|
-
let prevRule;
|
|
174
|
-
if (!isPreventelem) {
|
|
175
|
-
const targetGrp = closest(e.target, '.e-group-container');
|
|
176
|
-
const dropEventArgs = { cancel: false, dropRuleID: targetGroup !== null ? targetGroup.id
|
|
177
|
-
: targetGrp !== null ? targetGrp.id : null, dropGroupID: targetGrp !== null ? targetGrp.id : null };
|
|
178
|
-
this.trigger('drop', dropEventArgs);
|
|
179
|
-
if (dropEventArgs.cancel) {
|
|
180
|
-
isPreventelem = true;
|
|
181
|
-
}
|
|
182
|
-
prevRule = this.getValidRules();
|
|
183
|
-
}
|
|
184
|
-
this.prvtEvtTgrDaD = true;
|
|
185
|
-
const tgrt = this.enableSeparateConnector && e.target.parentElement &&
|
|
186
|
-
e.target.parentElement.classList.contains('e-btn-group') ? e.target.parentElement.previousElementSibling : e.target;
|
|
187
|
-
if (targetGroup && !isPreventelem) {
|
|
188
|
-
const groupId = targetGroup.id.split(this.element.id + '_')[1].split('_')[0];
|
|
189
|
-
if (this.draggable.currentStateTarget.parentElement.classList.contains('e-rule-field') ||
|
|
190
|
-
this.draggable.currentStateTarget.parentElement.classList.contains('e-group-header')) {
|
|
191
|
-
let rule;
|
|
192
|
-
if (this.draggable.currentStateTarget.parentElement.classList.contains('e-group-header')) {
|
|
193
|
-
rule = this.getGroup(this.draggedRule);
|
|
194
|
-
this.deleteGroup(closest(this.draggedRule, '.e-group-container'));
|
|
195
|
-
}
|
|
196
|
-
else {
|
|
197
|
-
rule = this.getRule(this.draggedRule);
|
|
198
|
-
this.deleteRule(this.draggedRule);
|
|
199
|
-
}
|
|
200
|
-
let groupRule = extend([], this.getGroup(targetGroup), [], true);
|
|
201
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
202
|
-
if (groupRule.properties) {
|
|
203
|
-
groupRule = groupRule.properties;
|
|
204
|
-
}
|
|
205
|
-
const groupElem = closest(targetGroup, '.e-group-container');
|
|
206
|
-
const nestGrpElem = groupElem.querySelectorAll('.e-group-container');
|
|
207
|
-
nestGrpElem.forEach((ele) => {
|
|
208
|
-
if (this.element.querySelector('#' + ele.id)) {
|
|
209
|
-
this.deleteGroup(ele);
|
|
210
|
-
}
|
|
211
|
-
});
|
|
212
|
-
const ruleElems = groupElem.querySelectorAll('.e-rule-container');
|
|
213
|
-
const ruleIds = [];
|
|
214
|
-
let dropInd;
|
|
215
|
-
for (let i = 0; i < ruleElems.length; i++) {
|
|
216
|
-
if (ruleElems[i].classList.contains('e-drag-rule-top-line') ||
|
|
217
|
-
ruleElems[i].classList.contains('e-drag-rule-bottom-line')) {
|
|
218
|
-
dropInd = i;
|
|
219
|
-
}
|
|
220
|
-
ruleIds.push(ruleElems[i].id.split(this.element.id + '_')[1]);
|
|
221
|
-
}
|
|
222
|
-
this.deleteRules(ruleIds);
|
|
223
|
-
if (targetGroup.classList.contains('e-drag-rule-top-line')) {
|
|
224
|
-
groupRule.rules.splice(dropInd, 0, rule);
|
|
225
|
-
}
|
|
226
|
-
else {
|
|
227
|
-
groupRule.rules.splice(dropInd + 1, 0, rule);
|
|
228
|
-
}
|
|
229
|
-
groupRule.rules.forEach((rule) => {
|
|
230
|
-
if (this.enableSeparateConnector) {
|
|
231
|
-
if (!rule.rules) {
|
|
232
|
-
this.addRules([rule], groupId);
|
|
233
|
-
}
|
|
234
|
-
else {
|
|
235
|
-
this.addGroups([rule], groupId);
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
else {
|
|
239
|
-
if (rule.condition) {
|
|
240
|
-
this.addGroups([rule], groupId);
|
|
241
|
-
}
|
|
242
|
-
else {
|
|
243
|
-
this.addRules([rule], groupId);
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
else if (tgrt.classList.contains('e-rule-list') && tgrt.children.length === 0 && !isPreventelem) {
|
|
250
|
-
const groupElem = closest(tgrt, '.e-group-container');
|
|
251
|
-
const groupId = groupElem.id.split(this.element.id + '_')[1].split('_')[0];
|
|
252
|
-
let rule;
|
|
253
|
-
if (this.draggable.currentStateTarget.parentElement.classList.contains('e-group-header')) {
|
|
254
|
-
rule = this.getGroup(this.draggedRule);
|
|
255
|
-
this.deleteGroup(closest(this.draggedRule, '.e-group-container'));
|
|
256
|
-
}
|
|
257
|
-
else {
|
|
258
|
-
rule = this.getRule(this.draggedRule);
|
|
259
|
-
this.deleteRule(this.draggedRule);
|
|
260
|
-
}
|
|
261
|
-
if (this.enableSeparateConnector) {
|
|
262
|
-
if (!rule.rules) {
|
|
263
|
-
this.addRules([rule], groupId);
|
|
264
|
-
}
|
|
265
|
-
else {
|
|
266
|
-
this.addGroups([rule], groupId);
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
else {
|
|
270
|
-
if (rule.condition) {
|
|
271
|
-
this.addGroups([rule], groupId);
|
|
272
|
-
}
|
|
273
|
-
else {
|
|
274
|
-
this.addRules([rule], groupId);
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
else if (tgrt.classList.contains('e-rule-list') && tgrt.children[0].classList.contains('e-group-container') && !isPreventelem) {
|
|
279
|
-
const groupElem = closest(tgrt, '.e-group-container');
|
|
280
|
-
const groupId = groupElem.id.split(this.element.id + '_')[1].split('_')[0];
|
|
281
|
-
let rule;
|
|
282
|
-
if (this.draggable.currentStateTarget.parentElement.classList.contains('e-group-header')) {
|
|
283
|
-
rule = this.getGroup(this.draggedRule);
|
|
284
|
-
this.deleteGroup(closest(this.draggedRule, '.e-group-container'));
|
|
285
|
-
}
|
|
286
|
-
else {
|
|
287
|
-
rule = this.getRule(this.draggedRule);
|
|
288
|
-
this.deleteRule(this.draggedRule);
|
|
289
|
-
}
|
|
290
|
-
let groupRule = extend([], this.getGroup(tgrt), [], true);
|
|
291
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
292
|
-
if (groupRule.properties) {
|
|
293
|
-
groupRule = groupRule.properties;
|
|
294
|
-
}
|
|
295
|
-
const groupElems = tgrt.querySelectorAll('.e-group-container');
|
|
296
|
-
groupElems.forEach((ele) => {
|
|
297
|
-
if (this.element.querySelector('#' + ele.id)) {
|
|
298
|
-
this.deleteGroup(ele);
|
|
299
|
-
}
|
|
300
|
-
});
|
|
301
|
-
const ruleElems = groupElem.querySelectorAll('.e-rule-container');
|
|
302
|
-
ruleElems.forEach((ele) => {
|
|
303
|
-
if (this.element.querySelector('#' + ele.id)) {
|
|
304
|
-
this.deleteRule(ele);
|
|
305
|
-
}
|
|
306
|
-
});
|
|
307
|
-
if (this.draggable.currentStateTarget.parentElement.classList.contains('e-group-header')) {
|
|
308
|
-
this.addGroups([rule], groupId);
|
|
309
|
-
}
|
|
310
|
-
else {
|
|
311
|
-
this.addRules([rule], groupId);
|
|
312
|
-
}
|
|
313
|
-
groupRule.rules.forEach((rule) => {
|
|
314
|
-
if (this.enableSeparateConnector) {
|
|
315
|
-
if (!rule.rules) {
|
|
316
|
-
this.addRules([rule], groupId);
|
|
317
|
-
}
|
|
318
|
-
else {
|
|
319
|
-
this.addGroups([rule], groupId);
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
else {
|
|
323
|
-
if (rule.condition) {
|
|
324
|
-
this.addGroups([rule], groupId);
|
|
325
|
-
}
|
|
326
|
-
else {
|
|
327
|
-
this.addRules([rule], groupId);
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
});
|
|
331
|
-
}
|
|
332
|
-
else if ((closest(e.target, '.e-group-container') || e.target.classList.contains('e-group-container')) && !isPreventelem) {
|
|
333
|
-
let rule;
|
|
334
|
-
targetGroup = closest(e.target, '.e-group-container');
|
|
335
|
-
if (!targetGroup && e.target.classList.contains('e-group-container')) {
|
|
336
|
-
targetGroup = e.target;
|
|
337
|
-
}
|
|
338
|
-
const groupId = targetGroup.id.split(this.element.id + '_')[1].split('_')[0];
|
|
339
|
-
if (groupId === 'group0') {
|
|
340
|
-
if (this.draggable.currentStateTarget.parentElement.classList.contains('e-group-header')) {
|
|
341
|
-
rule = this.getGroup(this.draggedRule);
|
|
342
|
-
this.deleteGroup(closest(this.draggedRule, '.e-group-container'));
|
|
343
|
-
}
|
|
344
|
-
else {
|
|
345
|
-
rule = this.getRule(this.draggedRule);
|
|
346
|
-
this.deleteRule(this.draggedRule);
|
|
347
|
-
}
|
|
348
|
-
if (this.enableSeparateConnector) {
|
|
349
|
-
if (!rule.rules) {
|
|
350
|
-
this.addRules([rule], groupId);
|
|
351
|
-
}
|
|
352
|
-
else {
|
|
353
|
-
this.addGroups([rule], groupId);
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
else {
|
|
357
|
-
if (rule.condition) {
|
|
358
|
-
this.addGroups([rule], groupId);
|
|
359
|
-
}
|
|
360
|
-
else {
|
|
361
|
-
this.addRules([rule], groupId);
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
if (!isPreventelem) {
|
|
367
|
-
this.trigger('ruleChange', { previousRule: prevRule, rule: this.getValidRules(), type: 'drag-and-drop' });
|
|
368
|
-
}
|
|
369
|
-
this.prvtEvtTgrDaD = false;
|
|
370
|
-
document.body.classList.remove('e-prevent-select');
|
|
371
|
-
let borderLineElem = this.element.querySelectorAll('.e-drag-rule-bottom-line');
|
|
372
|
-
borderLineElem.forEach((ele) => {
|
|
373
|
-
ele.classList.remove('e-drag-rule-bottom-line');
|
|
374
|
-
});
|
|
375
|
-
borderLineElem = this.element.querySelectorAll('.e-drag-rule-top-line');
|
|
376
|
-
borderLineElem.forEach((ele) => {
|
|
377
|
-
ele.classList.remove('e-drag-rule-top-line');
|
|
378
|
-
});
|
|
379
|
-
borderLineElem = this.element.querySelectorAll('.e-qb-dragging-rule');
|
|
380
|
-
borderLineElem.forEach((ele) => {
|
|
381
|
-
ele.classList.remove('e-qb-dragging-rule');
|
|
382
|
-
});
|
|
383
|
-
if (e.helper.classList.contains('e-cloneproperties') && document.querySelector('.' + e.helper.classList[0])) {
|
|
384
|
-
remove(e.helper);
|
|
385
|
-
}
|
|
386
|
-
if (this.enableSeparateConnector) {
|
|
387
|
-
this.refresh();
|
|
388
|
-
}
|
|
389
|
-
};
|
|
390
162
|
MultiSelect.Inject(CheckBoxSelection);
|
|
391
163
|
}
|
|
392
164
|
getPersistData() {
|
|
@@ -886,7 +658,9 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
886
658
|
elem = template;
|
|
887
659
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
888
660
|
append(elem, ruleElem);
|
|
889
|
-
ruleElem.children
|
|
661
|
+
if (ruleElem.children.length) {
|
|
662
|
+
ruleElem.children[ruleElem.children.length - 1].className += ' e-rule-field';
|
|
663
|
+
}
|
|
890
664
|
}
|
|
891
665
|
else {
|
|
892
666
|
template = this.ruleTemplateFn(args, this, 'Template', templateID)[0];
|
|
@@ -1174,7 +948,9 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1174
948
|
.filter((filteredChild) => filteredChild !== null);
|
|
1175
949
|
this.changeDataSource(matchedDataSource);
|
|
1176
950
|
setTimeout(() => {
|
|
1177
|
-
proxy.ddTree
|
|
951
|
+
if (!isNullOrUndefined(proxy.ddTree)) {
|
|
952
|
+
proxy.ddTree.treeObj.expandAll();
|
|
953
|
+
}
|
|
1178
954
|
}, 100);
|
|
1179
955
|
}
|
|
1180
956
|
}
|
|
@@ -1914,7 +1690,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1914
1690
|
if (this.headerTemplate) {
|
|
1915
1691
|
args = { requestType: 'header-template-initialize', ruleID: groupElem.id,
|
|
1916
1692
|
notCondition: this.enableNotCondition ? not : undefined,
|
|
1917
|
-
condition: condition, rule: this.getRuleCollection(rule,
|
|
1693
|
+
condition: condition, rule: this.getRuleCollection(rule, false), groupID: groupID };
|
|
1918
1694
|
this.trigger('actionBegin', args);
|
|
1919
1695
|
if (this.enableSeparateConnector && groupElem.id.indexOf('rule') !== -1) {
|
|
1920
1696
|
args.requestType = 'rule-template-create';
|
|
@@ -1950,6 +1726,17 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1950
1726
|
}
|
|
1951
1727
|
else if (this.isVue3) {
|
|
1952
1728
|
template = this.headerFn(args, this, groupElem.id, templateID);
|
|
1729
|
+
if (this.enableSeparateConnector && (isInitialRule || groupElem.id.indexOf('rule') !== -1)) {
|
|
1730
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1731
|
+
for (let i = 0; i < template.length; i++) {
|
|
1732
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1733
|
+
if (template[i].nodeName === 'DIV') {
|
|
1734
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1735
|
+
template = template[i];
|
|
1736
|
+
break;
|
|
1737
|
+
}
|
|
1738
|
+
}
|
|
1739
|
+
}
|
|
1953
1740
|
if (this.enableSeparateConnector && isInitialRule) {
|
|
1954
1741
|
this.enableSeparateConnectorInitialRule(groupElem, template);
|
|
1955
1742
|
}
|
|
@@ -2152,7 +1939,8 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
2152
1939
|
changeValue(i, args) {
|
|
2153
1940
|
let element;
|
|
2154
1941
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2155
|
-
if (this.isNumInput && typeof args.value === 'number')
|
|
1942
|
+
if ((this.isNumInput && typeof args.value === 'number') || (args.type === 'input' && args.target && args.target.classList.contains('e-numerictextbox'))
|
|
1943
|
+
&& (this.selectedColumn.validation.max !== Number.MAX_VALUE || this.selectedColumn.validation.min > 0)) {
|
|
2156
1944
|
this.isNumInput = false;
|
|
2157
1945
|
return;
|
|
2158
1946
|
}
|
|
@@ -2165,7 +1953,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
2165
1953
|
element = args.event.target;
|
|
2166
1954
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2167
1955
|
}
|
|
2168
|
-
else if (args.type === 'input' && args.
|
|
1956
|
+
else if (args.type === 'input' && args.target && args.target.classList.contains('e-numerictextbox')) {
|
|
2169
1957
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2170
1958
|
element = args.currentTarget;
|
|
2171
1959
|
}
|
|
@@ -2227,7 +2015,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
2227
2015
|
else {
|
|
2228
2016
|
value = args.value;
|
|
2229
2017
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2230
|
-
if (args.type === 'input' && args.
|
|
2018
|
+
if (args.type === 'input' && args.target && args.target.classList.contains('e-numerictextbox')) {
|
|
2231
2019
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2232
2020
|
value = Number(args.currentTarget.value);
|
|
2233
2021
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -2235,8 +2023,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
2235
2023
|
const numericTextBoxObj = getInstance(elem, NumericTextBox);
|
|
2236
2024
|
const decimalSeparator = getValue('decimal', getNumericObject(this.locale));
|
|
2237
2025
|
if (isNaN(value) && elem.value.indexOf(decimalSeparator) !== -1) {
|
|
2238
|
-
|
|
2239
|
-
value = numberValue;
|
|
2026
|
+
value = this.intl.getNumberParser({ format: 'n' })(elem.value);
|
|
2240
2027
|
}
|
|
2241
2028
|
numericTextBoxObj.value = value;
|
|
2242
2029
|
this.isNumInput = true;
|
|
@@ -2277,7 +2064,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
2277
2064
|
this.isFieldClose = true;
|
|
2278
2065
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2279
2066
|
const ddl = getComponent(id, 'dropdownlist');
|
|
2280
|
-
const item = ddl.popupObj.element.querySelector('.e-active');
|
|
2067
|
+
const item = ddl.popupObj && ddl.popupObj.element.querySelector('.e-active');
|
|
2281
2068
|
const itemData = ddl.getItemData();
|
|
2282
2069
|
ddl.value = itemData.value;
|
|
2283
2070
|
const customArgs = { element: ddl.element, value: itemData.value, isInteracted: true,
|
|
@@ -2614,13 +2401,11 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
2614
2401
|
}
|
|
2615
2402
|
const height = (this.element.className.indexOf('e-device') > -1) ? '250px' : '200px';
|
|
2616
2403
|
let operator;
|
|
2617
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2618
2404
|
operatorList.forEach((obj) => {
|
|
2619
2405
|
if ('value' in obj && typeof obj.value === 'string' && obj.value.toLowerCase() === rule.operator.toLowerCase()) {
|
|
2620
2406
|
operator = obj.value;
|
|
2621
2407
|
}
|
|
2622
2408
|
});
|
|
2623
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2624
2409
|
let value = operator ? operator : operatorList[0].value;
|
|
2625
2410
|
let ddlIdx = 0;
|
|
2626
2411
|
if (!this.autoSelectOperator) {
|
|
@@ -2950,8 +2735,11 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
2950
2735
|
closePopup(i, args) {
|
|
2951
2736
|
const element = document.getElementById(args.popup.element.id.replace('_popup', ''));
|
|
2952
2737
|
if (element) {
|
|
2953
|
-
const
|
|
2954
|
-
|
|
2738
|
+
const ms = getComponent(element, 'multiselect');
|
|
2739
|
+
if (ms) {
|
|
2740
|
+
const value = ms.value;
|
|
2741
|
+
this.updateRules(element, value, i);
|
|
2742
|
+
}
|
|
2955
2743
|
}
|
|
2956
2744
|
}
|
|
2957
2745
|
processTemplate(target, itemData, rule, tempRule) {
|
|
@@ -4581,6 +4369,236 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
4581
4369
|
this.trigger('drag', dragEventArgs);
|
|
4582
4370
|
this.isDragEventPrevent = dragEventArgs.cancel;
|
|
4583
4371
|
}
|
|
4372
|
+
dragStopHandler(e) {
|
|
4373
|
+
if (this.isDragEventPrevent) {
|
|
4374
|
+
return;
|
|
4375
|
+
}
|
|
4376
|
+
let targetGroup = closest(e.target, '.e-rule-container');
|
|
4377
|
+
if (isNullOrUndefined(targetGroup) && e.target.parentElement &&
|
|
4378
|
+
e.target.parentElement.classList.contains('e-btn-group') && this.enableSeparateConnector) {
|
|
4379
|
+
targetGroup = closest(e.target.parentElement.previousElementSibling, '.e-rule-container');
|
|
4380
|
+
}
|
|
4381
|
+
let isPreventelem;
|
|
4382
|
+
if (!isNullOrUndefined(e.helper)) {
|
|
4383
|
+
isPreventelem = closest(e.helper, '.e-notallowedcur');
|
|
4384
|
+
}
|
|
4385
|
+
let prevRule;
|
|
4386
|
+
if (!isPreventelem) {
|
|
4387
|
+
const targetGrp = closest(e.target, '.e-group-container');
|
|
4388
|
+
const dropEventArgs = { cancel: false, dropRuleID: targetGroup !== null ? targetGroup.id
|
|
4389
|
+
: targetGrp !== null ? targetGrp.id : null, dropGroupID: targetGrp !== null ? targetGrp.id : null };
|
|
4390
|
+
this.trigger('drop', dropEventArgs);
|
|
4391
|
+
if (dropEventArgs.cancel) {
|
|
4392
|
+
isPreventelem = true;
|
|
4393
|
+
}
|
|
4394
|
+
prevRule = this.getValidRules();
|
|
4395
|
+
}
|
|
4396
|
+
this.prvtEvtTgrDaD = true;
|
|
4397
|
+
const tgrt = this.enableSeparateConnector && e.target.parentElement &&
|
|
4398
|
+
e.target.parentElement.classList.contains('e-btn-group') ? e.target.parentElement.previousElementSibling : e.target;
|
|
4399
|
+
if (targetGroup && !isPreventelem) {
|
|
4400
|
+
const groupId = targetGroup.id.split(this.element.id + '_')[1].split('_')[0];
|
|
4401
|
+
if (this.draggable.currentStateTarget.parentElement.classList.contains('e-rule-field') ||
|
|
4402
|
+
this.draggable.currentStateTarget.parentElement.classList.contains('e-group-header')) {
|
|
4403
|
+
let rule;
|
|
4404
|
+
if (this.draggable.currentStateTarget.parentElement.classList.contains('e-group-header')) {
|
|
4405
|
+
rule = this.getGroup(this.draggedRule);
|
|
4406
|
+
this.deleteGroup(closest(this.draggedRule, '.e-group-container'));
|
|
4407
|
+
}
|
|
4408
|
+
else {
|
|
4409
|
+
rule = this.getRule(this.draggedRule);
|
|
4410
|
+
this.deleteRule(this.draggedRule);
|
|
4411
|
+
}
|
|
4412
|
+
let groupRule = extend([], this.getGroup(targetGroup), [], true);
|
|
4413
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4414
|
+
if (groupRule.properties) {
|
|
4415
|
+
groupRule = groupRule.properties;
|
|
4416
|
+
}
|
|
4417
|
+
const groupElem = closest(targetGroup, '.e-group-container');
|
|
4418
|
+
const nestGrpElem = groupElem.querySelectorAll('.e-group-container');
|
|
4419
|
+
nestGrpElem.forEach((ele) => {
|
|
4420
|
+
if (this.element.querySelector('#' + ele.id)) {
|
|
4421
|
+
this.deleteGroup(ele);
|
|
4422
|
+
}
|
|
4423
|
+
});
|
|
4424
|
+
const ruleElems = groupElem.querySelectorAll('.e-rule-container');
|
|
4425
|
+
const ruleIds = [];
|
|
4426
|
+
let dropInd;
|
|
4427
|
+
for (let i = 0; i < ruleElems.length; i++) {
|
|
4428
|
+
if (ruleElems[i].classList.contains('e-drag-rule-top-line') ||
|
|
4429
|
+
ruleElems[i].classList.contains('e-drag-rule-bottom-line')) {
|
|
4430
|
+
dropInd = i;
|
|
4431
|
+
}
|
|
4432
|
+
ruleIds.push(ruleElems[i].id.split(this.element.id + '_')[1]);
|
|
4433
|
+
}
|
|
4434
|
+
this.deleteRules(ruleIds);
|
|
4435
|
+
if (targetGroup.classList.contains('e-drag-rule-top-line')) {
|
|
4436
|
+
groupRule.rules.splice(dropInd, 0, rule);
|
|
4437
|
+
}
|
|
4438
|
+
else {
|
|
4439
|
+
groupRule.rules.splice(dropInd + 1, 0, rule);
|
|
4440
|
+
}
|
|
4441
|
+
groupRule.rules.forEach((rule) => {
|
|
4442
|
+
if (this.enableSeparateConnector) {
|
|
4443
|
+
if (!rule.rules) {
|
|
4444
|
+
this.addRules([rule], groupId);
|
|
4445
|
+
}
|
|
4446
|
+
else {
|
|
4447
|
+
this.addGroups([rule], groupId);
|
|
4448
|
+
}
|
|
4449
|
+
}
|
|
4450
|
+
else {
|
|
4451
|
+
if (rule.condition) {
|
|
4452
|
+
this.addGroups([rule], groupId);
|
|
4453
|
+
}
|
|
4454
|
+
else {
|
|
4455
|
+
this.addRules([rule], groupId);
|
|
4456
|
+
}
|
|
4457
|
+
}
|
|
4458
|
+
});
|
|
4459
|
+
}
|
|
4460
|
+
}
|
|
4461
|
+
else if (tgrt.classList.contains('e-rule-list') && tgrt.children.length === 0 && !isPreventelem) {
|
|
4462
|
+
const groupElem = closest(tgrt, '.e-group-container');
|
|
4463
|
+
const groupId = groupElem.id.split(this.element.id + '_')[1].split('_')[0];
|
|
4464
|
+
let rule;
|
|
4465
|
+
if (this.draggable.currentStateTarget.parentElement.classList.contains('e-group-header')) {
|
|
4466
|
+
rule = this.getGroup(this.draggedRule);
|
|
4467
|
+
this.deleteGroup(closest(this.draggedRule, '.e-group-container'));
|
|
4468
|
+
}
|
|
4469
|
+
else {
|
|
4470
|
+
rule = this.getRule(this.draggedRule);
|
|
4471
|
+
this.deleteRule(this.draggedRule);
|
|
4472
|
+
}
|
|
4473
|
+
if (this.enableSeparateConnector) {
|
|
4474
|
+
if (!rule.rules) {
|
|
4475
|
+
this.addRules([rule], groupId);
|
|
4476
|
+
}
|
|
4477
|
+
else {
|
|
4478
|
+
this.addGroups([rule], groupId);
|
|
4479
|
+
}
|
|
4480
|
+
}
|
|
4481
|
+
else {
|
|
4482
|
+
if (rule.condition) {
|
|
4483
|
+
this.addGroups([rule], groupId);
|
|
4484
|
+
}
|
|
4485
|
+
else {
|
|
4486
|
+
this.addRules([rule], groupId);
|
|
4487
|
+
}
|
|
4488
|
+
}
|
|
4489
|
+
}
|
|
4490
|
+
else if (tgrt.classList.contains('e-rule-list') && tgrt.children[0].classList.contains('e-group-container') && !isPreventelem) {
|
|
4491
|
+
const groupElem = closest(tgrt, '.e-group-container');
|
|
4492
|
+
const groupId = groupElem.id.split(this.element.id + '_')[1].split('_')[0];
|
|
4493
|
+
let rule;
|
|
4494
|
+
if (this.draggable.currentStateTarget.parentElement.classList.contains('e-group-header')) {
|
|
4495
|
+
rule = this.getGroup(this.draggedRule);
|
|
4496
|
+
this.deleteGroup(closest(this.draggedRule, '.e-group-container'));
|
|
4497
|
+
}
|
|
4498
|
+
else {
|
|
4499
|
+
rule = this.getRule(this.draggedRule);
|
|
4500
|
+
this.deleteRule(this.draggedRule);
|
|
4501
|
+
}
|
|
4502
|
+
let groupRule = extend([], this.getGroup(tgrt), [], true);
|
|
4503
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4504
|
+
if (groupRule.properties) {
|
|
4505
|
+
groupRule = groupRule.properties;
|
|
4506
|
+
}
|
|
4507
|
+
const groupElems = tgrt.querySelectorAll('.e-group-container');
|
|
4508
|
+
groupElems.forEach((ele) => {
|
|
4509
|
+
if (this.element.querySelector('#' + ele.id)) {
|
|
4510
|
+
this.deleteGroup(ele);
|
|
4511
|
+
}
|
|
4512
|
+
});
|
|
4513
|
+
const ruleElems = groupElem.querySelectorAll('.e-rule-container');
|
|
4514
|
+
ruleElems.forEach((ele) => {
|
|
4515
|
+
if (this.element.querySelector('#' + ele.id)) {
|
|
4516
|
+
this.deleteRule(ele);
|
|
4517
|
+
}
|
|
4518
|
+
});
|
|
4519
|
+
if (this.draggable.currentStateTarget.parentElement.classList.contains('e-group-header')) {
|
|
4520
|
+
this.addGroups([rule], groupId);
|
|
4521
|
+
}
|
|
4522
|
+
else {
|
|
4523
|
+
this.addRules([rule], groupId);
|
|
4524
|
+
}
|
|
4525
|
+
groupRule.rules.forEach((rule) => {
|
|
4526
|
+
if (this.enableSeparateConnector) {
|
|
4527
|
+
if (!rule.rules) {
|
|
4528
|
+
this.addRules([rule], groupId);
|
|
4529
|
+
}
|
|
4530
|
+
else {
|
|
4531
|
+
this.addGroups([rule], groupId);
|
|
4532
|
+
}
|
|
4533
|
+
}
|
|
4534
|
+
else {
|
|
4535
|
+
if (rule.condition) {
|
|
4536
|
+
this.addGroups([rule], groupId);
|
|
4537
|
+
}
|
|
4538
|
+
else {
|
|
4539
|
+
this.addRules([rule], groupId);
|
|
4540
|
+
}
|
|
4541
|
+
}
|
|
4542
|
+
});
|
|
4543
|
+
}
|
|
4544
|
+
else if ((closest(e.target, '.e-group-container') || e.target.classList.contains('e-group-container')) && !isPreventelem) {
|
|
4545
|
+
let rule;
|
|
4546
|
+
targetGroup = closest(e.target, '.e-group-container');
|
|
4547
|
+
if (!targetGroup && e.target.classList.contains('e-group-container')) {
|
|
4548
|
+
targetGroup = e.target;
|
|
4549
|
+
}
|
|
4550
|
+
const groupId = targetGroup.id.split(this.element.id + '_')[1].split('_')[0];
|
|
4551
|
+
if (groupId === 'group0') {
|
|
4552
|
+
if (this.draggable.currentStateTarget.parentElement.classList.contains('e-group-header')) {
|
|
4553
|
+
rule = this.getGroup(this.draggedRule);
|
|
4554
|
+
this.deleteGroup(closest(this.draggedRule, '.e-group-container'));
|
|
4555
|
+
}
|
|
4556
|
+
else {
|
|
4557
|
+
rule = this.getRule(this.draggedRule);
|
|
4558
|
+
this.deleteRule(this.draggedRule);
|
|
4559
|
+
}
|
|
4560
|
+
if (this.enableSeparateConnector) {
|
|
4561
|
+
if (!rule.rules) {
|
|
4562
|
+
this.addRules([rule], groupId);
|
|
4563
|
+
}
|
|
4564
|
+
else {
|
|
4565
|
+
this.addGroups([rule], groupId);
|
|
4566
|
+
}
|
|
4567
|
+
}
|
|
4568
|
+
else {
|
|
4569
|
+
if (rule.condition) {
|
|
4570
|
+
this.addGroups([rule], groupId);
|
|
4571
|
+
}
|
|
4572
|
+
else {
|
|
4573
|
+
this.addRules([rule], groupId);
|
|
4574
|
+
}
|
|
4575
|
+
}
|
|
4576
|
+
}
|
|
4577
|
+
}
|
|
4578
|
+
if (!isPreventelem) {
|
|
4579
|
+
this.trigger('ruleChange', { previousRule: prevRule, rule: this.getValidRules(), type: 'drag-and-drop' });
|
|
4580
|
+
}
|
|
4581
|
+
this.prvtEvtTgrDaD = false;
|
|
4582
|
+
document.body.classList.remove('e-prevent-select');
|
|
4583
|
+
let borderLineElem = this.element.querySelectorAll('.e-drag-rule-bottom-line');
|
|
4584
|
+
borderLineElem.forEach((ele) => {
|
|
4585
|
+
ele.classList.remove('e-drag-rule-bottom-line');
|
|
4586
|
+
});
|
|
4587
|
+
borderLineElem = this.element.querySelectorAll('.e-drag-rule-top-line');
|
|
4588
|
+
borderLineElem.forEach((ele) => {
|
|
4589
|
+
ele.classList.remove('e-drag-rule-top-line');
|
|
4590
|
+
});
|
|
4591
|
+
borderLineElem = this.element.querySelectorAll('.e-qb-dragging-rule');
|
|
4592
|
+
borderLineElem.forEach((ele) => {
|
|
4593
|
+
ele.classList.remove('e-qb-dragging-rule');
|
|
4594
|
+
});
|
|
4595
|
+
if (e.helper && e.helper.classList.contains('e-cloneproperties') && document.querySelector('.' + e.helper.classList[0])) {
|
|
4596
|
+
remove(e.helper);
|
|
4597
|
+
}
|
|
4598
|
+
if (this.enableSeparateConnector) {
|
|
4599
|
+
this.refresh();
|
|
4600
|
+
}
|
|
4601
|
+
}
|
|
4584
4602
|
templateParser(template) {
|
|
4585
4603
|
if (template) {
|
|
4586
4604
|
try {
|
|
@@ -4654,10 +4672,14 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
4654
4672
|
if (typeof target === 'string') {
|
|
4655
4673
|
groupId = this.element.id + '_' + target;
|
|
4656
4674
|
target = document.getElementById(groupId);
|
|
4675
|
+
groupId = groupId.replace(this.element.id + '_', '');
|
|
4657
4676
|
}
|
|
4658
4677
|
else {
|
|
4659
4678
|
groupId = groupElem.id.replace(this.element.id + '_', '');
|
|
4660
4679
|
}
|
|
4680
|
+
if (groupId === 'group0' || !target) {
|
|
4681
|
+
return;
|
|
4682
|
+
}
|
|
4661
4683
|
const args = { groupID: groupId, cancel: false, type: 'deleteGroup' };
|
|
4662
4684
|
if (!this.isImportRules && !this.prvtEvtTgrDaD) {
|
|
4663
4685
|
this.trigger('beforeChange', args, (observedChangeArgs) => {
|
|
@@ -5022,7 +5044,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5022
5044
|
}
|
|
5023
5045
|
}
|
|
5024
5046
|
}
|
|
5025
|
-
else if (!isNewRuleAdded) {
|
|
5047
|
+
else if (!isNewRuleAdded && !isNullOrUndefined(andElem)) {
|
|
5026
5048
|
andElem.checked = false;
|
|
5027
5049
|
andElem.disabled = true;
|
|
5028
5050
|
orElem.checked = false;
|
|
@@ -5042,7 +5064,6 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5042
5064
|
* @returns {RuleModel} - Valid rule or rules collection
|
|
5043
5065
|
*/
|
|
5044
5066
|
getValidRules(currentRule) {
|
|
5045
|
-
this.isValueEmpty = true;
|
|
5046
5067
|
if (!currentRule) {
|
|
5047
5068
|
currentRule = this.getRules();
|
|
5048
5069
|
}
|
|
@@ -5052,7 +5073,6 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5052
5073
|
const rule = !isNullOrUndefined(currentRule.isLocked) ?
|
|
5053
5074
|
this.getRuleCollection({ condition: ruleCondtion, rules: ruleColl, not: notCondition, isLocked: currentRule.isLocked }, true) :
|
|
5054
5075
|
this.getRuleCollection({ condition: ruleCondtion, rules: ruleColl, not: notCondition }, true);
|
|
5055
|
-
this.isValueEmpty = false;
|
|
5056
5076
|
return rule;
|
|
5057
5077
|
}
|
|
5058
5078
|
getRuleCollection(rule, isValidRule) {
|
|
@@ -5082,9 +5102,8 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5082
5102
|
rule.value = null;
|
|
5083
5103
|
}
|
|
5084
5104
|
}
|
|
5085
|
-
if ((this.isRefreshed && this.enablePersistence) || (rule.field !== '' && rule.operator !== '' &&
|
|
5086
|
-
|
|
5087
|
-
(customObj && customObj.isQuestion)) {
|
|
5105
|
+
if ((this.isRefreshed && this.enablePersistence) || (rule.field !== '' && rule.operator !== '' && (rule.value !== '' &&
|
|
5106
|
+
rule.value !== undefined)) || (customObj && customObj.isQuestion)) {
|
|
5088
5107
|
const condition = rule.condition;
|
|
5089
5108
|
const lockedRule = rule.isLocked;
|
|
5090
5109
|
rule = { 'label': rule.label, 'field': rule.field, 'operator': rule.operator, 'type': rule.type, 'value': rule.value };
|
|
@@ -5240,6 +5259,9 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5240
5259
|
const len = groupIdColl.length;
|
|
5241
5260
|
let groupID;
|
|
5242
5261
|
for (i = 0; i < len; i++) {
|
|
5262
|
+
if (groupIdColl[i] === 'group0') {
|
|
5263
|
+
continue;
|
|
5264
|
+
}
|
|
5243
5265
|
groupID = this.element.id + '_' + groupIdColl[i];
|
|
5244
5266
|
this.deleteGroup(document.getElementById(groupID));
|
|
5245
5267
|
}
|
|
@@ -6360,9 +6382,13 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
6360
6382
|
return matchValue.length + 2;
|
|
6361
6383
|
}
|
|
6362
6384
|
if (this.checkNumberLiteral(sqlString, sqlLocale)) {
|
|
6363
|
-
|
|
6364
|
-
|
|
6365
|
-
|
|
6385
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6386
|
+
const regExValue = /^[0-9]+(\.[0-9]+)$/.exec(sqlString);
|
|
6387
|
+
if (regExValue) {
|
|
6388
|
+
matchValue = regExValue[0];
|
|
6389
|
+
this.parser.push(['Literal', matchValue]);
|
|
6390
|
+
return matchValue.length;
|
|
6391
|
+
}
|
|
6366
6392
|
}
|
|
6367
6393
|
//String
|
|
6368
6394
|
const singleString = this.getSingleQuoteString(sqlString);
|
|
@@ -6776,16 +6802,8 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
6776
6802
|
*/
|
|
6777
6803
|
groupClone(target) {
|
|
6778
6804
|
const groupElem = target.closest('.e-rule-list').closest('.e-group-container');
|
|
6779
|
-
|
|
6780
|
-
|
|
6781
|
-
if (typeof target === 'string') {
|
|
6782
|
-
groupId = this.element.id + '_' + target;
|
|
6783
|
-
target = document.getElementById(groupId);
|
|
6784
|
-
}
|
|
6785
|
-
else {
|
|
6786
|
-
targetGrpId = target.id.replace(this.element.id + '_', '');
|
|
6787
|
-
groupId = groupElem.id.replace(this.element.id + '_', '');
|
|
6788
|
-
}
|
|
6805
|
+
const targetGrpId = target.id.replace(this.element.id + '_', '');
|
|
6806
|
+
const groupId = groupElem.id.replace(this.element.id + '_', '');
|
|
6789
6807
|
const group = this.getGroup(targetGrpId);
|
|
6790
6808
|
this.groupIndex = Array.prototype.indexOf.call(target.closest('.e-rule-list').children, target.closest('.e-group-container'));
|
|
6791
6809
|
this.addGroups([{ 'condition': group.condition, 'not': group.not, 'rules': group.rules }], groupId);
|