@syncfusion/ej2-querybuilder 33.1.44 → 33.1.49

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 33.1.44
3
+ * version : 33.1.49
4
4
  * Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncfusion/ej2-querybuilder",
3
- "version": "33.1.44",
3
+ "version": "33.1.49",
4
4
  "description": "Essential JS 2 QueryBuilder",
5
5
  "author": "Syncfusion Inc.",
6
6
  "license": "SEE LICENSE IN license",
@@ -8,12 +8,12 @@
8
8
  "module": "./index.js",
9
9
  "es2015": "./dist/es6/ej2-querybuilder.es5.js",
10
10
  "dependencies": {
11
- "@syncfusion/ej2-base": "~33.1.44",
12
- "@syncfusion/ej2-buttons": "~33.1.44",
11
+ "@syncfusion/ej2-base": "~33.1.45",
12
+ "@syncfusion/ej2-buttons": "~33.1.49",
13
13
  "@syncfusion/ej2-calendars": "~33.1.44",
14
- "@syncfusion/ej2-dropdowns": "~33.1.44",
15
- "@syncfusion/ej2-inputs": "~33.1.44",
16
- "@syncfusion/ej2-splitbuttons": "~33.1.44"
14
+ "@syncfusion/ej2-dropdowns": "~33.1.49",
15
+ "@syncfusion/ej2-inputs": "~33.1.49",
16
+ "@syncfusion/ej2-splitbuttons": "~33.1.49"
17
17
  },
18
18
  "devDependencies": {},
19
19
  "keywords": [
@@ -352,6 +352,7 @@ export declare class QueryBuilder extends Component<HTMLDivElement> implements I
352
352
  private isRuleClicked;
353
353
  private groupCloned;
354
354
  private isRequestSent;
355
+ private initialID;
355
356
  private ddTree;
356
357
  private boundResizeHandler;
357
358
  /**
@@ -4217,30 +4217,32 @@ var QueryBuilder = /** @class */ (function (_super) {
4217
4217
  this.clearQBTemplate();
4218
4218
  }
4219
4219
  var qbDdlElems = this.element.querySelectorAll('.qb-dropdownlist');
4220
- if (!qbDdlElems || qbDdlElems.length === 0) {
4221
- qbDdlElems = document.querySelectorAll('.qb-dropdownlist');
4222
- }
4223
- for (i = 0; i < qbDdlElems.length; i++) {
4224
- var ddlElem = qbDdlElems[i];
4225
- var targetInput = ddlElem.tagName === 'INPUT' ? ddlElem : ddlElem.querySelector('input');
4226
- if (targetInput) {
4227
- var ddlInst = getComponent(targetInput, 'dropdownlist');
4228
- if (ddlInst) {
4229
- if (ddlInst.close) {
4230
- ddlInst.close = null;
4231
- }
4232
- if (ddlInst.open) {
4233
- ddlInst.open = null;
4234
- }
4235
- if (ddlInst.change) {
4236
- ddlInst.change = null;
4220
+ if (qbDdlElems && qbDdlElems.length > 0) {
4221
+ for (i = 0; i < qbDdlElems.length; i++) {
4222
+ var ddlElem = qbDdlElems[i];
4223
+ if (this.element.contains(ddlElem)) {
4224
+ var targetInput = ddlElem.tagName === 'INPUT' ? ddlElem : ddlElem.querySelector('input');
4225
+ if (targetInput) {
4226
+ var ddlInst = getComponent(targetInput, 'dropdownlist');
4227
+ if (ddlInst) {
4228
+ if (ddlInst.close) {
4229
+ ddlInst.close = null;
4230
+ }
4231
+ if (ddlInst.open) {
4232
+ ddlInst.open = null;
4233
+ }
4234
+ if (ddlInst.change) {
4235
+ ddlInst.change = null;
4236
+ }
4237
+ ddlInst.destroy();
4238
+ }
4237
4239
  }
4238
- ddlInst.destroy();
4239
4240
  }
4240
4241
  }
4241
4242
  }
4242
- var popupElement = document.querySelectorAll('.qb-dropdownlist.e-popup');
4243
- if (popupElement) {
4243
+ // Cleanup orphaned popup elements
4244
+ var popupElement = this.element.querySelectorAll('.e-popup.e-dropdownlist');
4245
+ if (popupElement && popupElement.length > 0) {
4244
4246
  for (i = 0; i < popupElement.length; i++) {
4245
4247
  popupElement[i].remove();
4246
4248
  }
@@ -4303,7 +4305,7 @@ var QueryBuilder = /** @class */ (function (_super) {
4303
4305
  var parent_1 = this.element.querySelector('#' + groupID);
4304
4306
  var allContainers = parent_1.querySelectorAll(':scope > .e-group-body > .e-rule-list > [class*="-container"]');
4305
4307
  var topLevelGroups = parent_1.querySelectorAll(':scope > .e-group-body > .e-rule-list > .e-group-container');
4306
- if (topLevelGroups.length > 0 && groupID !== 'querybuilder_group0' && !(this.isAngular && groupID === 'ej2-querybuilder_0_group0')) {
4308
+ if (topLevelGroups.length > 0 && groupID !== 'querybuilder_group0' && !(this.isAngular && groupID === this.initialID + '_group0')) {
4307
4309
  var lastGroupIndex = -1;
4308
4310
  var lastGroup = topLevelGroups[topLevelGroups.length - 1];
4309
4311
  for (var i = 0; i < allContainers.length; i++) {
@@ -4647,6 +4649,7 @@ var QueryBuilder = /** @class */ (function (_super) {
4647
4649
  };
4648
4650
  QueryBuilder.prototype.preRender = function () {
4649
4651
  this.element.id = this.element.id || getUniqueID('ej2-querybuilder');
4652
+ this.initialID = this.element.id;
4650
4653
  this.defaultLocale = {
4651
4654
  StartsWith: 'Starts With',
4652
4655
  DoesNotStartWith: 'Does Not Start With',
@@ -5454,6 +5457,7 @@ var QueryBuilder = /** @class */ (function (_super) {
5454
5457
  if (this.headerTemplate && isRoot) {
5455
5458
  this.isRoot = true;
5456
5459
  }
5460
+ this.clearQBTemplate();
5457
5461
  this.reset();
5458
5462
  this.groupIdCounter = 1;
5459
5463
  this.ruleIdCounter = 0;