@syncfusion/ej2-querybuilder 32.2.9 → 33.1.46

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;
@@ -4133,31 +4132,33 @@ let QueryBuilder = class QueryBuilder extends Component {
4133
4132
  if (this.portals && this.portals.length) {
4134
4133
  this.clearQBTemplate();
4135
4134
  }
4136
- let qbDdlElems = this.element.querySelectorAll('.qb-dropdownlist');
4137
- if (!qbDdlElems || qbDdlElems.length === 0) {
4138
- qbDdlElems = document.querySelectorAll('.qb-dropdownlist');
4139
- }
4140
- for (i = 0; i < qbDdlElems.length; i++) {
4141
- const ddlElem = qbDdlElems[i];
4142
- const targetInput = ddlElem.tagName === 'INPUT' ? ddlElem : ddlElem.querySelector('input');
4143
- if (targetInput) {
4144
- const ddlInst = getComponent(targetInput, 'dropdownlist');
4145
- if (ddlInst) {
4146
- if (ddlInst.close) {
4147
- ddlInst.close = null;
4148
- }
4149
- if (ddlInst.open) {
4150
- ddlInst.open = null;
4151
- }
4152
- if (ddlInst.change) {
4153
- ddlInst.change = null;
4135
+ const qbDdlElems = this.element.querySelectorAll('.qb-dropdownlist');
4136
+ if (qbDdlElems && qbDdlElems.length > 0) {
4137
+ for (i = 0; i < qbDdlElems.length; i++) {
4138
+ const ddlElem = qbDdlElems[i];
4139
+ if (this.element.contains(ddlElem)) {
4140
+ const targetInput = ddlElem.tagName === 'INPUT' ? ddlElem : ddlElem.querySelector('input');
4141
+ if (targetInput) {
4142
+ const ddlInst = getComponent(targetInput, 'dropdownlist');
4143
+ if (ddlInst) {
4144
+ if (ddlInst.close) {
4145
+ ddlInst.close = null;
4146
+ }
4147
+ if (ddlInst.open) {
4148
+ ddlInst.open = null;
4149
+ }
4150
+ if (ddlInst.change) {
4151
+ ddlInst.change = null;
4152
+ }
4153
+ ddlInst.destroy();
4154
+ }
4154
4155
  }
4155
- ddlInst.destroy();
4156
4156
  }
4157
4157
  }
4158
4158
  }
4159
- const popupElement = document.querySelectorAll('.qb-dropdownlist.e-popup');
4160
- if (popupElement) {
4159
+ // Cleanup orphaned popup elements
4160
+ const popupElement = this.element.querySelectorAll('.e-popup.e-dropdownlist');
4161
+ if (popupElement && popupElement.length > 0) {
4161
4162
  for (i = 0; i < popupElement.length; i++) {
4162
4163
  popupElement[i].remove();
4163
4164
  }