@syncfusion/ej2-querybuilder 31.2.15 → 31.2.16

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 : 31.2.15
3
+ * version : 31.2.16
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": "31.2.15",
3
+ "version": "31.2.16",
4
4
  "description": "Essential JS 2 QueryBuilder",
5
5
  "author": "Syncfusion Inc.",
6
6
  "license": "SEE LICENSE IN license",
@@ -9,9 +9,9 @@
9
9
  "es2015": "./dist/es6/ej2-querybuilder.es5.js",
10
10
  "dependencies": {
11
11
  "@syncfusion/ej2-base": "~31.2.12",
12
- "@syncfusion/ej2-buttons": "~31.2.12",
13
- "@syncfusion/ej2-calendars": "~31.2.15",
14
- "@syncfusion/ej2-dropdowns": "~31.2.15",
12
+ "@syncfusion/ej2-buttons": "~31.2.16",
13
+ "@syncfusion/ej2-calendars": "~31.2.16",
14
+ "@syncfusion/ej2-dropdowns": "~31.2.16",
15
15
  "@syncfusion/ej2-inputs": "~31.2.15",
16
16
  "@syncfusion/ej2-splitbuttons": "~31.2.12"
17
17
  },
@@ -350,6 +350,7 @@ export declare class QueryBuilder extends Component<HTMLDivElement> implements I
350
350
  private isValueEmpty;
351
351
  private isPropChange;
352
352
  private isRuleClicked;
353
+ private groupCloned;
353
354
  private ddTree;
354
355
  /**
355
356
  * Triggers when the component is created.
@@ -220,6 +220,7 @@ var QueryBuilder = /** @class */ (function (_super) {
220
220
  _this.isValueEmpty = false;
221
221
  _this.isPropChange = false;
222
222
  _this.isRuleClicked = false;
223
+ _this.groupCloned = false;
223
224
  MultiSelect.Inject(CheckBoxSelection);
224
225
  return _this;
225
226
  }
@@ -597,7 +598,7 @@ var QueryBuilder = /** @class */ (function (_super) {
597
598
  break;
598
599
  case target.className.indexOf('e-clone-grp-btn') > -1:
599
600
  this.actionButton = target;
600
- this.cloneGrpBtnClick = true;
601
+ this.cloneGrpBtnClick = this.groupCloned = true;
601
602
  this.isRuleClicked = true;
602
603
  this.groupClone(closest(target, '.e-group-container'));
603
604
  break;
@@ -4224,6 +4225,7 @@ var QueryBuilder = /** @class */ (function (_super) {
4224
4225
  if (this.isAddSuccess || this.element.querySelectorAll('.e-group-container').length <= this.maxGroupCount) {
4225
4226
  groupID = this.element.id + '_' + groupID;
4226
4227
  var groupElem = document.getElementById(groupID);
4228
+ var temp = this.groupIndex;
4227
4229
  var rule = this.getParentGroup(groupElem);
4228
4230
  var grouplen = groups.length;
4229
4231
  if (grouplen) {
@@ -4246,6 +4248,11 @@ var QueryBuilder = /** @class */ (function (_super) {
4246
4248
  not = this.updatedRule.not;
4247
4249
  isLocked = this.updatedRule.isLocked;
4248
4250
  }
4251
+ if (this.groupCloned) {
4252
+ var parent_1 = this.element.querySelector('#' + groupID);
4253
+ var topLevelGroups = parent_1.querySelectorAll(':scope > .e-group-body > .e-rule-list > .e-group-container');
4254
+ this.groupIndex = topLevelGroups.length > 1 ? topLevelGroups.length - 1 : 0;
4255
+ }
4249
4256
  if (this.groupIndex < 0) {
4250
4257
  if (this.enableNotCondition) {
4251
4258
  rule.rules.push({ 'condition': condition, 'not': not, rules: [] });
@@ -4262,6 +4269,9 @@ var QueryBuilder = /** @class */ (function (_super) {
4262
4269
  rule.rules.splice(this.groupIndex + 1, 0, { condition: condition, rules: [], isLocked: isLocked });
4263
4270
  }
4264
4271
  }
4272
+ if (this.groupCloned) {
4273
+ this.groupIndex = temp;
4274
+ }
4265
4275
  }
4266
4276
  if (!this.headerTemplate) {
4267
4277
  this.disableRuleCondition(groupElem, rule, null, this.enableSeparateConnector ? true : null);
@@ -6785,13 +6795,13 @@ var QueryBuilder = /** @class */ (function (_super) {
6785
6795
  var isCloneGroup = this.showButtons.cloneGroup;
6786
6796
  groupID = groupID.replace(this.element.id + '_', '');
6787
6797
  this.groupIndex = index;
6788
- this.cloneGrpBtnClick = true;
6798
+ this.cloneGrpBtnClick = this.groupCloned = true;
6789
6799
  this.showButtons.cloneGroup = true;
6790
6800
  this.addGroups([{ 'condition': group.condition, 'not': group.not, 'rules': group.rules }], groupID);
6791
6801
  this.groupIndex = -1;
6792
6802
  this.cloneGrpBtnClick = false;
6793
6803
  this.showButtons.cloneGroup = isCloneGroup;
6794
- isCloneGroup = false;
6804
+ isCloneGroup = this.groupCloned = false;
6795
6805
  };
6796
6806
  /**
6797
6807
  * Locks the rule based on the rule ID.
@@ -7340,6 +7350,7 @@ var QueryBuilder = /** @class */ (function (_super) {
7340
7350
  this.groupIndex = Array.prototype.indexOf.call(target.closest('.e-rule-list').children, target.closest('.e-group-container'));
7341
7351
  this.addGroups([{ 'condition': group.condition, 'not': group.not, 'rules': group.rules }], groupId);
7342
7352
  this.groupIndex = -1;
7353
+ this.groupCloned = false;
7343
7354
  };
7344
7355
  QueryBuilder.prototype.ruleClone = function (target) {
7345
7356
  var ruleElem = closest(target, '.e-rule-container');