@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.
@@ -122,7 +122,7 @@ var Rule = /** @__PURE__ @class */ (function (_super) {
122
122
  Property(false)
123
123
  ], Rule.prototype, "not", void 0);
124
124
  __decorate([
125
- Property(false)
125
+ Property(null)
126
126
  ], Rule.prototype, "isLocked", void 0);
127
127
  return Rule;
128
128
  }(ChildProperty));
@@ -554,7 +554,7 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
554
554
  }
555
555
  };
556
556
  QueryBuilder.prototype.beforeSuccessCallBack = function (args, target) {
557
- if (!args.cancel) {
557
+ if (args && !args.cancel) {
558
558
  var element = closest(target, '.e-group-container');
559
559
  var groupID = element.id.replace(this.element.id + '_', '');
560
560
  var beforeRules = this.getValidRules(this.rule);
@@ -4078,7 +4078,9 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
4078
4078
  var ruleCondtion = currentRule.condition;
4079
4079
  var notCondition = currentRule.not;
4080
4080
  var ruleColl = extend([], currentRule.rules, [], true);
4081
- var rule = this.getRuleCollection({ condition: ruleCondtion, rules: ruleColl, not: notCondition }, true);
4081
+ var rule = !isNullOrUndefined(currentRule.isLocked) ?
4082
+ this.getRuleCollection({ condition: ruleCondtion, rules: ruleColl, not: notCondition, isLocked: currentRule.isLocked }, true) :
4083
+ this.getRuleCollection({ condition: ruleCondtion, rules: ruleColl, not: notCondition }, true);
4082
4084
  return rule;
4083
4085
  };
4084
4086
  QueryBuilder.prototype.getRuleCollection = function (rule, isValidRule) {
@@ -4111,10 +4113,11 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
4111
4113
  if ((this.isRefreshed && this.enablePersistence) || (rule.field !== '' && rule.operator !== '' && (rule.value !== '' &&
4112
4114
  rule.value !== undefined)) || (customObj && customObj.isQuestion)) {
4113
4115
  var condition = rule.condition;
4114
- rule = {
4115
- 'label': rule.label, 'field': rule.field, 'operator': rule.operator, 'type': rule.type, 'value': rule.value,
4116
- 'isLocked': rule.isLocked
4117
- };
4116
+ var lockedRule = rule.isLocked;
4117
+ rule = { 'label': rule.label, 'field': rule.field, 'operator': rule.operator, 'type': rule.type, 'value': rule.value };
4118
+ if (!isNullOrUndefined(lockedRule)) {
4119
+ rule.isLocked = lockedRule;
4120
+ }
4118
4121
  if (condition) {
4119
4122
  rule.condition = condition;
4120
4123
  }
@@ -4147,11 +4150,15 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
4147
4150
  rule = {};
4148
4151
  }
4149
4152
  else {
4153
+ var isLocked = rule.isLocked;
4150
4154
  if (this.enableNotCondition) {
4151
- rule = { 'condition': rule.condition, 'rules': rule.rules, 'not': rule.not, 'isLocked': rule.isLocked };
4155
+ rule = { 'condition': rule.condition, 'rules': rule.rules, 'not': rule.not };
4152
4156
  }
4153
4157
  else {
4154
- rule = { 'condition': rule.condition, 'rules': rule.rules, 'isLocked': rule.isLocked };
4158
+ rule = { 'condition': rule.condition, 'rules': rule.rules };
4159
+ }
4160
+ if (!isNullOrUndefined(isLocked)) {
4161
+ rule.isLocked = isLocked;
4155
4162
  }
4156
4163
  if (customObj) {
4157
4164
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -4192,6 +4199,9 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
4192
4199
  else {
4193
4200
  rule = { condition: this.rule.condition, rules: this.rule.rules };
4194
4201
  }
4202
+ if (!isNullOrUndefined(this.rule.isLocked)) {
4203
+ rule.isLocked = this.rule.isLocked;
4204
+ }
4195
4205
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4196
4206
  if (this.rule.custom) {
4197
4207
  // eslint-disable-next-line @typescript-eslint/no-explicit-any