@syncfusion/ej2-querybuilder 25.1.42 → 25.2.3

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.
@@ -1494,12 +1494,22 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
1494
1494
  var _this = this;
1495
1495
  var element;
1496
1496
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1497
+ if (this.isNumInput && typeof args.value === 'number') {
1498
+ this.isNumInput = false;
1499
+ return;
1500
+ }
1501
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1497
1502
  if (args.element && args.element.classList.contains('e-multiselect')) {
1498
1503
  var multiSelectArgs = args;
1499
1504
  element = multiSelectArgs.element;
1500
1505
  }
1501
1506
  else if (args.event) {
1502
1507
  element = args.event.target;
1508
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1509
+ }
1510
+ else if (args.type === 'input' && args.currentTarget) {
1511
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1512
+ element = args.currentTarget;
1503
1513
  }
1504
1514
  else {
1505
1515
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -1556,6 +1566,14 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
1556
1566
  }
1557
1567
  else {
1558
1568
  value = args.value;
1569
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1570
+ if (args.type === 'input' && args.currentTarget) {
1571
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1572
+ value = Number(args.currentTarget.value);
1573
+ var numericTextBoxObj = getInstance(args.currentTarget, NumericTextBox);
1574
+ numericTextBoxObj.value = value;
1575
+ this.isNumInput = true;
1576
+ }
1559
1577
  }
1560
1578
  if (args.name === 'input' && this.immediateModeDelay) {
1561
1579
  window.clearInterval(this.timer);
@@ -2405,6 +2423,7 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
2405
2423
  var numeric = new NumericTextBox(numericTxt);
2406
2424
  numeric.appendTo('#' + parentId + '_valuekey' + idx);
2407
2425
  numeric.element.setAttribute('aria-label', itemData.label + ' ' + 'Value');
2426
+ numeric.element.oninput = this.changeValue.bind(this, idx);
2408
2427
  }
2409
2428
  };
2410
2429
  QueryBuilder.prototype.processValueString = function (value, type) {
@@ -3217,7 +3236,7 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
3217
3236
  if (this.portals && this.portals.length) {
3218
3237
  this.clearQBTemplate();
3219
3238
  }
3220
- popupElement = document.querySelectorAll('.qb-dropdownlist');
3239
+ popupElement = document.querySelectorAll('.qb-dropdownlist.e-popup');
3221
3240
  if (popupElement) {
3222
3241
  for (i = 0; i < popupElement.length; i++) {
3223
3242
  popupElement[i].remove();
@@ -5306,6 +5325,11 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
5306
5325
  }
5307
5326
  }
5308
5327
  }
5328
+ else if (sqlString[matchValue.length] && (sqlString[matchValue.length] !== ')') &&
5329
+ !this.checkCondition(sqlString, matchValue)) {
5330
+ matchValue = this.getSingleQuoteString(sqlString, matchValue);
5331
+ }
5332
+ // end
5309
5333
  this.parser.push(['String', matchValue]);
5310
5334
  return matchValue.length;
5311
5335
  }
@@ -5335,6 +5359,27 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
5335
5359
  }
5336
5360
  return 1;
5337
5361
  };
5362
+ QueryBuilder.prototype.checkCondition = function (sqlString, matchValue) {
5363
+ if (sqlString.slice(matchValue.length + 1, matchValue.length + 4) === 'AND' ||
5364
+ sqlString.slice(matchValue.length + 1, matchValue.length + 3) === 'OR') {
5365
+ return true;
5366
+ }
5367
+ return false;
5368
+ };
5369
+ QueryBuilder.prototype.getSingleQuoteString = function (sqlString, matchValue) {
5370
+ if (sqlString[matchValue.length] && (sqlString[matchValue.length] !== ')') &&
5371
+ !this.checkCondition(sqlString, matchValue) && sqlString[matchValue.length] !== ',') {
5372
+ var tempStr = sqlString.replace(matchValue, '');
5373
+ // eslint-disable-next-line
5374
+ if (isNullOrUndefined(/^'((?:[^\\']+?|\\.|'')*)'(?!')/.exec(tempStr))) {
5375
+ // eslint-disable-next-line
5376
+ var parsedValue = /^((?:[^\\']+?|\\.|'')*)'(?!')/.exec(tempStr)[0];
5377
+ matchValue += parsedValue;
5378
+ matchValue = this.getSingleQuoteString(sqlString, matchValue);
5379
+ }
5380
+ }
5381
+ return matchValue;
5382
+ };
5338
5383
  QueryBuilder.prototype.checkLiteral = function () {
5339
5384
  var lastParser = this.parser[this.parser.length - 1];
5340
5385
  if (!lastParser) {
@@ -5590,7 +5635,11 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
5590
5635
  }
5591
5636
  else {
5592
5637
  rule.type = 'string';
5593
- rule.value = parser[i + 2][1] ? parser[i + 2][1].replace(/'/g, '') : parser[i + 2][1];
5638
+ var val = parser[i + 2][1];
5639
+ if (val && val[0] === '\'') {
5640
+ val = val.substring(1, val.length - 1);
5641
+ }
5642
+ rule.value = val;
5594
5643
  }
5595
5644
  rule.type = this.getTypeFromColumn(rule);
5596
5645
  }
@@ -5640,6 +5689,27 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
5640
5689
  }
5641
5690
  return rules;
5642
5691
  };
5692
+ QueryBuilder.prototype.getValueFromParser = function (parser, idx) {
5693
+ var value = '';
5694
+ var k;
5695
+ for (k = idx; k < parser.length; k++) {
5696
+ if (parser[k][0] !== 'String' || parser[k][1] === ',' || parser[k][1] === ', ') {
5697
+ break;
5698
+ }
5699
+ else {
5700
+ if (value !== '') {
5701
+ idx += 1;
5702
+ }
5703
+ if (parser[k][1] !== null) {
5704
+ value += parser[k][1];
5705
+ }
5706
+ else {
5707
+ value = null;
5708
+ }
5709
+ }
5710
+ }
5711
+ return { value: value, idx: idx };
5712
+ };
5643
5713
  /**
5644
5714
  * Clone the Group
5645
5715
  *