@syncfusion/ej2-querybuilder 19.4.47 → 19.4.48

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.
@@ -732,12 +732,19 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
732
732
  else {
733
733
  groupElem = closest(target, '.e-group-container');
734
734
  rules = this.getParentGroup(groupElem);
735
+ var custom = rule.custom;
735
736
  if (Object.keys(rule).length) {
736
737
  rules.rules.push({
737
738
  'field': rule.field, 'type': rule.type, 'label': rule.label, 'operator': rule.operator, value: rule.value
738
739
  });
740
+ if (custom) {
741
+ rules.rules[rules.rules.length - 1].custom = custom;
742
+ }
739
743
  }
740
744
  else {
745
+ if (custom) {
746
+ newRule.custom = custom;
747
+ }
741
748
  rules.rules.push(newRule);
742
749
  }
743
750
  }
@@ -1358,6 +1365,7 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
1358
1365
  ruleElem = ruleElem.previousElementSibling;
1359
1366
  index++;
1360
1367
  }
1368
+ rules.rules[index].value = '';
1361
1369
  this.changeRule(rules.rules[index], args);
1362
1370
  }
1363
1371
  }
@@ -1447,6 +1455,9 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
1447
1455
  getComponent(tooltipElem[i], 'tooltip').destroy();
1448
1456
  }
1449
1457
  if (!args.cancel) {
1458
+ if (this.selectedColumn === null) {
1459
+ return;
1460
+ }
1450
1461
  tempRule.type = this.selectedColumn.type;
1451
1462
  if (ruleElem.querySelector('.e-template')) {
1452
1463
  rule.value = '';
@@ -3448,7 +3459,11 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
3448
3459
  }
3449
3460
  }
3450
3461
  var isTemplateRendered = clnruleElem.querySelector('.e-template-value');
3451
- detach(clnruleElem);
3462
+ try {
3463
+ detach(clnruleElem);
3464
+ }
3465
+ catch (err) {
3466
+ }
3452
3467
  if (column && column.ruleTemplate) {
3453
3468
  this.clearQBTemplate([clnruleElem.id]);
3454
3469
  }
@@ -3568,10 +3583,14 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
3568
3583
  }
3569
3584
  }
3570
3585
  if ((this.isRefreshed && this.enablePersistence) || (this.rule.field !== '' && rule.operator !== '' && (rule.value !== '' &&
3571
- rule.value !== undefined))) {
3586
+ rule.value !== undefined)) || (customObj && customObj.isQuestion)) {
3587
+ var condition = rule.condition;
3572
3588
  rule = {
3573
3589
  'label': rule.label, 'field': rule.field, 'operator': rule.operator, 'type': rule.type, 'value': rule.value
3574
3590
  };
3591
+ if (condition) {
3592
+ rule.condition = condition;
3593
+ }
3575
3594
  if (customObj) {
3576
3595
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
3577
3596
  rule.custom = customObj;
@@ -3880,6 +3899,12 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
3880
3899
  break;
3881
3900
  }
3882
3901
  }
3902
+ else if (field.indexOf(this.separator) > -1) {
3903
+ if (columns[i].field === field.split(this.separator)[0]) {
3904
+ column = columns[i];
3905
+ break;
3906
+ }
3907
+ }
3883
3908
  }
3884
3909
  return column;
3885
3910
  };
@@ -3969,7 +3994,7 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
3969
3994
  }
3970
3995
  if (!(operator.indexOf('null') > -1 || operator.indexOf('empty') > -1)) {
3971
3996
  for (var j = 0, jLen = value.length; j < jLen; j++) {
3972
- if (value[j] !== '') {
3997
+ if (value[j] !== '' || ((operator === 'in' || operator === 'notin') && column.type === 'string')) {
3973
3998
  if (j === 0) {
3974
3999
  var gte = 'greaterthanorequal';
3975
4000
  switch (operator) {
@@ -4348,8 +4373,14 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
4348
4373
  }
4349
4374
  queryStr += rule.field + ' ' + this.operators[rule.operator] + ' ' + valueStr;
4350
4375
  }
4376
+ if (rule.condition && rule.condition != '') {
4377
+ condition = rule.condition;
4378
+ }
4351
4379
  }
4352
4380
  if (j !== jLen - 1) {
4381
+ if (condition === '') {
4382
+ condition = rules.rules[j].condition;
4383
+ }
4353
4384
  queryStr += ' ' + condition.toUpperCase() + ' ';
4354
4385
  }
4355
4386
  }