@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.
@@ -1361,10 +1361,9 @@ let QueryBuilder = class QueryBuilder extends Component {
1361
1361
  if (rule.rules[index].value instanceof Array) {
1362
1362
  valArray = rule.rules[index].value;
1363
1363
  }
1364
- if (excludeOprs.indexOf(rule.rules[index].operator) < -1 &&
1365
- (isNullOrUndefined(rule.rules[index].value) &&
1366
- rule.rules[index].type !== 'date') || rule.rules[index].value === '' || rule.rules[index].value === null ||
1367
- (rule.rules[index].value instanceof Array && valArray.length < 1)) {
1364
+ if (excludeOprs.indexOf(rule.rules[index].operator) < 0 && ((isNullOrUndefined(rule.rules[index].value) &&
1365
+ rule.rules[index].type !== 'date') || rule.rules[index].value === '' || rule.rules[index].value === null ||
1366
+ (rule.rules[index].value instanceof Array && valArray.length < 1))) {
1368
1367
  const valElem = tempElem.querySelectorAll('.e-rule-value .e-control');
1369
1368
  if (excludeOprs.indexOf(rule.rules[index].operator) < 0) {
1370
1369
  isValid = false;
@@ -4218,9 +4217,18 @@ let QueryBuilder = class QueryBuilder extends Component {
4218
4217
  if (this.groupCloned && this.target instanceof HTMLElement &&
4219
4218
  this.getGroup(this.target).rules.length > 1) {
4220
4219
  const parent = this.element.querySelector('#' + groupID);
4220
+ const allContainers = parent.querySelectorAll(':scope > .e-group-body > .e-rule-list > [class*="-container"]');
4221
4221
  const topLevelGroups = parent.querySelectorAll(':scope > .e-group-body > .e-rule-list > .e-group-container');
4222
- if (groupID !== 'querybuilder_group0' && !(this.isAngular && groupID === 'ej2-querybuilder_0_group0')) {
4223
- this.groupIndex = topLevelGroups.length > 1 ? topLevelGroups.length - 1 : 0;
4222
+ if (topLevelGroups.length > 0 && groupID !== 'querybuilder_group0' && !(this.isAngular && groupID === 'ej2-querybuilder_0_group0')) {
4223
+ let lastGroupIndex = -1;
4224
+ const lastGroup = topLevelGroups[topLevelGroups.length - 1];
4225
+ for (let i = 0; i < allContainers.length; i++) {
4226
+ if (allContainers[i] === lastGroup) {
4227
+ lastGroupIndex = i;
4228
+ break;
4229
+ }
4230
+ }
4231
+ this.groupIndex = lastGroupIndex - 1;
4224
4232
  }
4225
4233
  }
4226
4234
  if (this.groupIndex < 0) {