@syncfusion/ej2-querybuilder 31.2.12 → 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.
- package/dist/ej2-querybuilder.min.js +2 -2
- package/dist/ej2-querybuilder.umd.min.js +2 -2
- package/dist/ej2-querybuilder.umd.min.js.map +1 -1
- package/dist/es6/ej2-querybuilder.es2015.js +23 -5
- package/dist/es6/ej2-querybuilder.es2015.js.map +1 -1
- package/dist/es6/ej2-querybuilder.es5.js +23 -5
- package/dist/es6/ej2-querybuilder.es5.js.map +1 -1
- package/dist/global/ej2-querybuilder.min.js +2 -2
- package/dist/global/ej2-querybuilder.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +5 -5
- package/src/query-builder/query-builder.d.ts +1 -0
- package/src/query-builder/query-builder.js +23 -5
|
@@ -207,6 +207,7 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
|
|
|
207
207
|
_this.isValueEmpty = false;
|
|
208
208
|
_this.isPropChange = false;
|
|
209
209
|
_this.isRuleClicked = false;
|
|
210
|
+
_this.groupCloned = false;
|
|
210
211
|
MultiSelect.Inject(CheckBoxSelection);
|
|
211
212
|
return _this;
|
|
212
213
|
}
|
|
@@ -584,7 +585,7 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
|
|
|
584
585
|
break;
|
|
585
586
|
case target.className.indexOf('e-clone-grp-btn') > -1:
|
|
586
587
|
this.actionButton = target;
|
|
587
|
-
this.cloneGrpBtnClick = true;
|
|
588
|
+
this.cloneGrpBtnClick = this.groupCloned = true;
|
|
588
589
|
this.isRuleClicked = true;
|
|
589
590
|
this.groupClone(closest(target, '.e-group-container'));
|
|
590
591
|
break;
|
|
@@ -4210,6 +4211,7 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
|
|
|
4210
4211
|
if (this.isAddSuccess || this.element.querySelectorAll('.e-group-container').length <= this.maxGroupCount) {
|
|
4211
4212
|
groupID = this.element.id + '_' + groupID;
|
|
4212
4213
|
var groupElem = document.getElementById(groupID);
|
|
4214
|
+
var temp = this.groupIndex;
|
|
4213
4215
|
var rule = this.getParentGroup(groupElem);
|
|
4214
4216
|
var grouplen = groups.length;
|
|
4215
4217
|
if (grouplen) {
|
|
@@ -4232,6 +4234,11 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
|
|
|
4232
4234
|
not = this.updatedRule.not;
|
|
4233
4235
|
isLocked = this.updatedRule.isLocked;
|
|
4234
4236
|
}
|
|
4237
|
+
if (this.groupCloned) {
|
|
4238
|
+
var parent_1 = this.element.querySelector('#' + groupID);
|
|
4239
|
+
var topLevelGroups = parent_1.querySelectorAll(':scope > .e-group-body > .e-rule-list > .e-group-container');
|
|
4240
|
+
this.groupIndex = topLevelGroups.length > 1 ? topLevelGroups.length - 1 : 0;
|
|
4241
|
+
}
|
|
4235
4242
|
if (this.groupIndex < 0) {
|
|
4236
4243
|
if (this.enableNotCondition) {
|
|
4237
4244
|
rule.rules.push({ 'condition': condition, 'not': not, rules: [] });
|
|
@@ -4248,6 +4255,9 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
|
|
|
4248
4255
|
rule.rules.splice(this.groupIndex + 1, 0, { condition: condition, rules: [], isLocked: isLocked });
|
|
4249
4256
|
}
|
|
4250
4257
|
}
|
|
4258
|
+
if (this.groupCloned) {
|
|
4259
|
+
this.groupIndex = temp;
|
|
4260
|
+
}
|
|
4251
4261
|
}
|
|
4252
4262
|
if (!this.headerTemplate) {
|
|
4253
4263
|
this.disableRuleCondition(groupElem, rule, null, this.enableSeparateConnector ? true : null);
|
|
@@ -4705,7 +4715,13 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
|
|
|
4705
4715
|
this.customOperators['numberOperator'] = this.customOperators['numberOperator'].concat(numberOper); // tslint:disable-line
|
|
4706
4716
|
if (this.dataSource instanceof DataManager) {
|
|
4707
4717
|
this.dataManager = this.dataSource;
|
|
4708
|
-
this.
|
|
4718
|
+
if (this.columns && this.columns.length) {
|
|
4719
|
+
this.dataColl = this.columns;
|
|
4720
|
+
this.initControl();
|
|
4721
|
+
}
|
|
4722
|
+
else {
|
|
4723
|
+
this.executeDataManager(new Query().take(1));
|
|
4724
|
+
}
|
|
4709
4725
|
}
|
|
4710
4726
|
else {
|
|
4711
4727
|
this.dataManager = new DataManager(this.dataSource);
|
|
@@ -4728,7 +4744,8 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
|
|
|
4728
4744
|
isReplaceDragEle: true,
|
|
4729
4745
|
isPreventSelect: false,
|
|
4730
4746
|
abort: '.e-parent-header',
|
|
4731
|
-
isDragScroll: true
|
|
4747
|
+
isDragScroll: true,
|
|
4748
|
+
enableAutoScroll: true
|
|
4732
4749
|
});
|
|
4733
4750
|
};
|
|
4734
4751
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -6762,13 +6779,13 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
|
|
|
6762
6779
|
var isCloneGroup = this.showButtons.cloneGroup;
|
|
6763
6780
|
groupID = groupID.replace(this.element.id + '_', '');
|
|
6764
6781
|
this.groupIndex = index;
|
|
6765
|
-
this.cloneGrpBtnClick = true;
|
|
6782
|
+
this.cloneGrpBtnClick = this.groupCloned = true;
|
|
6766
6783
|
this.showButtons.cloneGroup = true;
|
|
6767
6784
|
this.addGroups([{ 'condition': group.condition, 'not': group.not, 'rules': group.rules }], groupID);
|
|
6768
6785
|
this.groupIndex = -1;
|
|
6769
6786
|
this.cloneGrpBtnClick = false;
|
|
6770
6787
|
this.showButtons.cloneGroup = isCloneGroup;
|
|
6771
|
-
isCloneGroup = false;
|
|
6788
|
+
isCloneGroup = this.groupCloned = false;
|
|
6772
6789
|
};
|
|
6773
6790
|
/**
|
|
6774
6791
|
* Locks the rule based on the rule ID.
|
|
@@ -7317,6 +7334,7 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
|
|
|
7317
7334
|
this.groupIndex = Array.prototype.indexOf.call(target.closest('.e-rule-list').children, target.closest('.e-group-container'));
|
|
7318
7335
|
this.addGroups([{ 'condition': group.condition, 'not': group.not, 'rules': group.rules }], groupId);
|
|
7319
7336
|
this.groupIndex = -1;
|
|
7337
|
+
this.groupCloned = false;
|
|
7320
7338
|
};
|
|
7321
7339
|
QueryBuilder.prototype.ruleClone = function (target) {
|
|
7322
7340
|
var ruleElem = closest(target, '.e-rule-container');
|