@syncfusion/ej2-querybuilder 25.2.3 → 25.2.7

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.
@@ -90,7 +90,7 @@ __decorate([
90
90
  Property(false)
91
91
  ], Rule.prototype, "not", void 0);
92
92
  __decorate([
93
- Property(false)
93
+ Property(null)
94
94
  ], Rule.prototype, "isLocked", void 0);
95
95
  /**
96
96
  * Defines the property for value.
@@ -503,7 +503,7 @@ let QueryBuilder = class QueryBuilder extends Component {
503
503
  }
504
504
  }
505
505
  beforeSuccessCallBack(args, target) {
506
- if (!args.cancel) {
506
+ if (args && !args.cancel) {
507
507
  const element = closest(target, '.e-group-container');
508
508
  const groupID = element.id.replace(this.element.id + '_', '');
509
509
  const beforeRules = this.getValidRules(this.rule);
@@ -4011,7 +4011,9 @@ let QueryBuilder = class QueryBuilder extends Component {
4011
4011
  const ruleCondtion = currentRule.condition;
4012
4012
  const notCondition = currentRule.not;
4013
4013
  const ruleColl = extend([], currentRule.rules, [], true);
4014
- const rule = this.getRuleCollection({ condition: ruleCondtion, rules: ruleColl, not: notCondition }, true);
4014
+ const rule = !isNullOrUndefined(currentRule.isLocked) ?
4015
+ this.getRuleCollection({ condition: ruleCondtion, rules: ruleColl, not: notCondition, isLocked: currentRule.isLocked }, true) :
4016
+ this.getRuleCollection({ condition: ruleCondtion, rules: ruleColl, not: notCondition }, true);
4015
4017
  return rule;
4016
4018
  }
4017
4019
  getRuleCollection(rule, isValidRule) {
@@ -4044,10 +4046,11 @@ let QueryBuilder = class QueryBuilder extends Component {
4044
4046
  if ((this.isRefreshed && this.enablePersistence) || (rule.field !== '' && rule.operator !== '' && (rule.value !== '' &&
4045
4047
  rule.value !== undefined)) || (customObj && customObj.isQuestion)) {
4046
4048
  const condition = rule.condition;
4047
- rule = {
4048
- 'label': rule.label, 'field': rule.field, 'operator': rule.operator, 'type': rule.type, 'value': rule.value,
4049
- 'isLocked': rule.isLocked
4050
- };
4049
+ const lockedRule = rule.isLocked;
4050
+ rule = { 'label': rule.label, 'field': rule.field, 'operator': rule.operator, 'type': rule.type, 'value': rule.value };
4051
+ if (!isNullOrUndefined(lockedRule)) {
4052
+ rule.isLocked = lockedRule;
4053
+ }
4051
4054
  if (condition) {
4052
4055
  rule.condition = condition;
4053
4056
  }
@@ -4080,11 +4083,15 @@ let QueryBuilder = class QueryBuilder extends Component {
4080
4083
  rule = {};
4081
4084
  }
4082
4085
  else {
4086
+ const isLocked = rule.isLocked;
4083
4087
  if (this.enableNotCondition) {
4084
- rule = { 'condition': rule.condition, 'rules': rule.rules, 'not': rule.not, 'isLocked': rule.isLocked };
4088
+ rule = { 'condition': rule.condition, 'rules': rule.rules, 'not': rule.not };
4085
4089
  }
4086
4090
  else {
4087
- rule = { 'condition': rule.condition, 'rules': rule.rules, 'isLocked': rule.isLocked };
4091
+ rule = { 'condition': rule.condition, 'rules': rule.rules };
4092
+ }
4093
+ if (!isNullOrUndefined(isLocked)) {
4094
+ rule.isLocked = isLocked;
4088
4095
  }
4089
4096
  if (customObj) {
4090
4097
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -4125,6 +4132,9 @@ let QueryBuilder = class QueryBuilder extends Component {
4125
4132
  else {
4126
4133
  rule = { condition: this.rule.condition, rules: this.rule.rules };
4127
4134
  }
4135
+ if (!isNullOrUndefined(this.rule.isLocked)) {
4136
+ rule.isLocked = this.rule.isLocked;
4137
+ }
4128
4138
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4129
4139
  if (this.rule.custom) {
4130
4140
  // eslint-disable-next-line @typescript-eslint/no-explicit-any