@syncfusion/ej2-querybuilder 26.2.4 → 26.2.8

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,4 +1,4 @@
1
- import { Property, ChildProperty, Collection, closest, isNullOrUndefined, extend, remove, getComponent, removeClass, Animation, addClass, select, append, detach, rippleEffect, getInstance, getValue, Browser, classList, Internationalization, getUniqueID, L10n, Draggable, compile, EventHandler, cldrData, Event, Complex, NotifyPropertyChanges, Component } from '@syncfusion/ej2-base';
1
+ import { Property, ChildProperty, Collection, closest, isNullOrUndefined, extend, remove, getComponent, removeClass, Animation, addClass, select, append, detach, rippleEffect, getInstance, getValue, getNumericObject, Browser, classList, Internationalization, getUniqueID, L10n, Draggable, compile, EventHandler, cldrData, Event, Complex, NotifyPropertyChanges, Component } from '@syncfusion/ej2-base';
2
2
  import { Button, CheckBox, RadioButton } from '@syncfusion/ej2-buttons';
3
3
  import { MultiSelect, CheckBoxSelection, DropDownList, DropDownTree } from '@syncfusion/ej2-dropdowns';
4
4
  import { Query, DataManager, Deferred, Predicate } from '@syncfusion/ej2-data';
@@ -204,6 +204,7 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
204
204
  _this.cloneGrpBtnClick = false;
205
205
  _this.isMiddleGroup = false;
206
206
  _this.cloneRuleBtnClick = false;
207
+ _this.isValueEmpty = false;
207
208
  _this.dragStopHandler = function (e) {
208
209
  if (_this.isDragEventPrevent) {
209
210
  return;
@@ -2289,6 +2290,11 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
2289
2290
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2290
2291
  var elem = args.currentTarget;
2291
2292
  var numericTextBoxObj = getInstance(elem, NumericTextBox);
2293
+ var decimalSeparator = getValue('decimal', getNumericObject(this.locale));
2294
+ if (isNaN(value) && elem.value.indexOf(decimalSeparator) !== -1) {
2295
+ var numberValue = parseFloat(args.currentTarget.value);
2296
+ value = numberValue;
2297
+ }
2292
2298
  numericTextBoxObj.value = value;
2293
2299
  this.isNumInput = true;
2294
2300
  }
@@ -2667,7 +2673,15 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
2667
2673
  operatorList = this.customOperators[this.selectedColumn.type + 'Operator'];
2668
2674
  }
2669
2675
  var height = (this.element.className.indexOf('e-device') > -1) ? '250px' : '200px';
2670
- var value = operatorList[0].value;
2676
+ var operator_2;
2677
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2678
+ operatorList.forEach(function (obj) {
2679
+ if ('value' in obj && typeof obj.value === 'string' && obj.value.toLowerCase() === rule.operator.toLowerCase()) {
2680
+ operator_2 = obj.value;
2681
+ }
2682
+ });
2683
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2684
+ var value = operator_2 ? operator_2 : operatorList[0].value;
2671
2685
  var ddlIdx = 0;
2672
2686
  if (!this.autoSelectOperator) {
2673
2687
  value = '';
@@ -5098,6 +5112,7 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
5098
5112
  * @returns {RuleModel} - Valid rule or rules collection
5099
5113
  */
5100
5114
  QueryBuilder.prototype.getValidRules = function (currentRule) {
5115
+ this.isValueEmpty = true;
5101
5116
  if (!currentRule) {
5102
5117
  currentRule = this.getRules();
5103
5118
  }
@@ -5107,6 +5122,7 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
5107
5122
  var rule = !isNullOrUndefined(currentRule.isLocked) ?
5108
5123
  this.getRuleCollection({ condition: ruleCondtion, rules: ruleColl, not: notCondition, isLocked: currentRule.isLocked }, true) :
5109
5124
  this.getRuleCollection({ condition: ruleCondtion, rules: ruleColl, not: notCondition }, true);
5125
+ this.isValueEmpty = false;
5110
5126
  return rule;
5111
5127
  };
5112
5128
  QueryBuilder.prototype.getRuleCollection = function (rule, isValidRule) {
@@ -5136,8 +5152,9 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
5136
5152
  rule.value = null;
5137
5153
  }
5138
5154
  }
5139
- if ((this.isRefreshed && this.enablePersistence) || (rule.field !== '' && rule.operator !== '' && (rule.value !== '' &&
5140
- rule.value !== undefined)) || (customObj && customObj.isQuestion)) {
5155
+ if ((this.isRefreshed && this.enablePersistence) || (rule.field !== '' && rule.operator !== '' &&
5156
+ (this.isValueEmpty ? rule.value !== '' && rule.value !== undefined : rule.value !== undefined)) ||
5157
+ (customObj && customObj.isQuestion)) {
5141
5158
  var condition = rule.condition;
5142
5159
  var lockedRule = rule.isLocked;
5143
5160
  rule = { 'label': rule.label, 'field': rule.field, 'operator': rule.operator, 'type': rule.type, 'value': rule.value };