@syncfusion/ej2-querybuilder 32.2.8 → 33.1.44

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.
@@ -1419,10 +1419,9 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
1419
1419
  if (rule.rules[index].value instanceof Array) {
1420
1420
  valArray = rule.rules[index].value;
1421
1421
  }
1422
- if (excludeOprs.indexOf(rule.rules[index].operator) < -1 &&
1423
- (isNullOrUndefined(rule.rules[index].value) &&
1424
- rule.rules[index].type !== 'date') || rule.rules[index].value === '' || rule.rules[index].value === null ||
1425
- (rule.rules[index].value instanceof Array && valArray.length < 1)) {
1422
+ if (excludeOprs.indexOf(rule.rules[index].operator) < 0 && ((isNullOrUndefined(rule.rules[index].value) &&
1423
+ rule.rules[index].type !== 'date') || rule.rules[index].value === '' || rule.rules[index].value === null ||
1424
+ (rule.rules[index].value instanceof Array && valArray.length < 1))) {
1426
1425
  var valElem = tempElem.querySelectorAll('.e-rule-value .e-control');
1427
1426
  if (excludeOprs.indexOf(rule.rules[index].operator) < 0) {
1428
1427
  isValid = false;
@@ -4288,9 +4287,18 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
4288
4287
  if (this.groupCloned && this.target instanceof HTMLElement &&
4289
4288
  this.getGroup(this.target).rules.length > 1) {
4290
4289
  var parent_1 = this.element.querySelector('#' + groupID);
4290
+ var allContainers = parent_1.querySelectorAll(':scope > .e-group-body > .e-rule-list > [class*="-container"]');
4291
4291
  var topLevelGroups = parent_1.querySelectorAll(':scope > .e-group-body > .e-rule-list > .e-group-container');
4292
- if (groupID !== 'querybuilder_group0' && !(this.isAngular && groupID === 'ej2-querybuilder_0_group0')) {
4293
- this.groupIndex = topLevelGroups.length > 1 ? topLevelGroups.length - 1 : 0;
4292
+ if (topLevelGroups.length > 0 && groupID !== 'querybuilder_group0' && !(this.isAngular && groupID === 'ej2-querybuilder_0_group0')) {
4293
+ var lastGroupIndex = -1;
4294
+ var lastGroup = topLevelGroups[topLevelGroups.length - 1];
4295
+ for (var i = 0; i < allContainers.length; i++) {
4296
+ if (allContainers[i] === lastGroup) {
4297
+ lastGroupIndex = i;
4298
+ break;
4299
+ }
4300
+ }
4301
+ this.groupIndex = lastGroupIndex - 1;
4294
4302
  }
4295
4303
  }
4296
4304
  if (this.groupIndex < 0) {