@syncfusion/ej2-querybuilder 25.1.40 → 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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 25.1.40
3
+ * version : 25.2.3
4
4
  * Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-querybuilder@*",
3
- "_id": "@syncfusion/ej2-querybuilder@25.1.38",
3
+ "_id": "@syncfusion/ej2-querybuilder@25.1.42",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-RLUddm+Ql/CK4B9L75aovBZ1SksSfwr8nonX77H2Q5jI20+6I8TLJAZo8MBSmybIpl6GA2/1JARXa24aDC322w==",
5
+ "_integrity": "sha512-UIFQJNjXFhmzK++AcE9N74B7VoebBfUyn0F4UWh8PCzGOzwQkfaQPYrXVHE6I6sCStLipaT5TLO56fyuSoOflA==",
6
6
  "_location": "/@syncfusion/ej2-querybuilder",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -23,8 +23,8 @@
23
23
  "/@syncfusion/ej2-react-querybuilder",
24
24
  "/@syncfusion/ej2-vue-querybuilder"
25
25
  ],
26
- "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-querybuilder/-/ej2-querybuilder-25.1.38.tgz",
27
- "_shasum": "9901505552698bdd0ad97442067588722a2d4556",
26
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-querybuilder/-/ej2-querybuilder-25.1.42.tgz",
27
+ "_shasum": "be17a591afa3711be8557572fb8b0843db4f576a",
28
28
  "_spec": "@syncfusion/ej2-querybuilder@*",
29
29
  "_where": "/jenkins/workspace/elease-automation_release_25.1.1/packages/included",
30
30
  "author": {
@@ -32,12 +32,12 @@
32
32
  },
33
33
  "bundleDependencies": false,
34
34
  "dependencies": {
35
- "@syncfusion/ej2-base": "~25.1.35",
36
- "@syncfusion/ej2-buttons": "~25.1.39",
37
- "@syncfusion/ej2-calendars": "~25.1.40",
38
- "@syncfusion/ej2-dropdowns": "~25.1.40",
39
- "@syncfusion/ej2-inputs": "~25.1.40",
40
- "@syncfusion/ej2-splitbuttons": "~25.1.38"
35
+ "@syncfusion/ej2-base": "~25.2.3",
36
+ "@syncfusion/ej2-buttons": "~25.2.3",
37
+ "@syncfusion/ej2-calendars": "~25.2.3",
38
+ "@syncfusion/ej2-dropdowns": "~25.2.3",
39
+ "@syncfusion/ej2-inputs": "~25.2.3",
40
+ "@syncfusion/ej2-splitbuttons": "~25.2.3"
41
41
  },
42
42
  "deprecated": false,
43
43
  "description": "Essential JS 2 QueryBuilder",
@@ -66,7 +66,7 @@
66
66
  "url": "https://github.com/syncfusion/ej2-javascript-ui-controls/tree/master/controls/querybuilder"
67
67
  },
68
68
  "typings": "index.d.ts",
69
- "version": "25.1.40",
69
+ "version": "25.2.3",
70
70
  "sideEffects": false,
71
71
  "homepage": "https://www.syncfusion.com/javascript-ui-controls"
72
72
  }
@@ -341,6 +341,7 @@ export declare class QueryBuilder extends Component<HTMLDivElement> implements I
341
341
  private cloneGrpBtnClick;
342
342
  private isMiddleGroup;
343
343
  private cloneRuleBtnClick;
344
+ private isNumInput;
344
345
  /**
345
346
  * Triggers when the component is created.
346
347
  *
@@ -909,6 +910,8 @@ export declare class QueryBuilder extends Component<HTMLDivElement> implements I
909
910
  lockGroup(groupID: string): void;
910
911
  private sqlParser;
911
912
  private parseSqlStrings;
913
+ private checkCondition;
914
+ private getSingleQuoteString;
912
915
  private checkLiteral;
913
916
  private checkNumberLiteral;
914
917
  private getOperator;
@@ -916,6 +919,7 @@ export declare class QueryBuilder extends Component<HTMLDivElement> implements I
916
919
  private getLabelFromColumn;
917
920
  private getLabelFromField;
918
921
  private processParser;
922
+ private getValueFromParser;
919
923
  /**
920
924
  * Clone the Group
921
925
  *
@@ -1503,12 +1503,22 @@ var QueryBuilder = /** @class */ (function (_super) {
1503
1503
  var _this = this;
1504
1504
  var element;
1505
1505
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1506
+ if (this.isNumInput && typeof args.value === 'number') {
1507
+ this.isNumInput = false;
1508
+ return;
1509
+ }
1510
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1506
1511
  if (args.element && args.element.classList.contains('e-multiselect')) {
1507
1512
  var multiSelectArgs = args;
1508
1513
  element = multiSelectArgs.element;
1509
1514
  }
1510
1515
  else if (args.event) {
1511
1516
  element = args.event.target;
1517
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1518
+ }
1519
+ else if (args.type === 'input' && args.currentTarget) {
1520
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1521
+ element = args.currentTarget;
1512
1522
  }
1513
1523
  else {
1514
1524
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -1565,6 +1575,14 @@ var QueryBuilder = /** @class */ (function (_super) {
1565
1575
  }
1566
1576
  else {
1567
1577
  value = args.value;
1578
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1579
+ if (args.type === 'input' && args.currentTarget) {
1580
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1581
+ value = Number(args.currentTarget.value);
1582
+ var numericTextBoxObj = getInstance(args.currentTarget, NumericTextBox);
1583
+ numericTextBoxObj.value = value;
1584
+ this.isNumInput = true;
1585
+ }
1568
1586
  }
1569
1587
  if (args.name === 'input' && this.immediateModeDelay) {
1570
1588
  window.clearInterval(this.timer);
@@ -2414,6 +2432,7 @@ var QueryBuilder = /** @class */ (function (_super) {
2414
2432
  var numeric = new NumericTextBox(numericTxt);
2415
2433
  numeric.appendTo('#' + parentId + '_valuekey' + idx);
2416
2434
  numeric.element.setAttribute('aria-label', itemData.label + ' ' + 'Value');
2435
+ numeric.element.oninput = this.changeValue.bind(this, idx);
2417
2436
  }
2418
2437
  };
2419
2438
  QueryBuilder.prototype.processValueString = function (value, type) {
@@ -3226,7 +3245,7 @@ var QueryBuilder = /** @class */ (function (_super) {
3226
3245
  if (this.portals && this.portals.length) {
3227
3246
  this.clearQBTemplate();
3228
3247
  }
3229
- popupElement = document.querySelectorAll('.qb-dropdownlist');
3248
+ popupElement = document.querySelectorAll('.qb-dropdownlist.e-popup');
3230
3249
  if (popupElement) {
3231
3250
  for (i = 0; i < popupElement.length; i++) {
3232
3251
  popupElement[i].remove();
@@ -5315,6 +5334,11 @@ var QueryBuilder = /** @class */ (function (_super) {
5315
5334
  }
5316
5335
  }
5317
5336
  }
5337
+ else if (sqlString[matchValue.length] && (sqlString[matchValue.length] !== ')') &&
5338
+ !this.checkCondition(sqlString, matchValue)) {
5339
+ matchValue = this.getSingleQuoteString(sqlString, matchValue);
5340
+ }
5341
+ // end
5318
5342
  this.parser.push(['String', matchValue]);
5319
5343
  return matchValue.length;
5320
5344
  }
@@ -5344,6 +5368,27 @@ var QueryBuilder = /** @class */ (function (_super) {
5344
5368
  }
5345
5369
  return 1;
5346
5370
  };
5371
+ QueryBuilder.prototype.checkCondition = function (sqlString, matchValue) {
5372
+ if (sqlString.slice(matchValue.length + 1, matchValue.length + 4) === 'AND' ||
5373
+ sqlString.slice(matchValue.length + 1, matchValue.length + 3) === 'OR') {
5374
+ return true;
5375
+ }
5376
+ return false;
5377
+ };
5378
+ QueryBuilder.prototype.getSingleQuoteString = function (sqlString, matchValue) {
5379
+ if (sqlString[matchValue.length] && (sqlString[matchValue.length] !== ')') &&
5380
+ !this.checkCondition(sqlString, matchValue) && sqlString[matchValue.length] !== ',') {
5381
+ var tempStr = sqlString.replace(matchValue, '');
5382
+ // eslint-disable-next-line
5383
+ if (isNullOrUndefined(/^'((?:[^\\']+?|\\.|'')*)'(?!')/.exec(tempStr))) {
5384
+ // eslint-disable-next-line
5385
+ var parsedValue = /^((?:[^\\']+?|\\.|'')*)'(?!')/.exec(tempStr)[0];
5386
+ matchValue += parsedValue;
5387
+ matchValue = this.getSingleQuoteString(sqlString, matchValue);
5388
+ }
5389
+ }
5390
+ return matchValue;
5391
+ };
5347
5392
  QueryBuilder.prototype.checkLiteral = function () {
5348
5393
  var lastParser = this.parser[this.parser.length - 1];
5349
5394
  if (!lastParser) {
@@ -5600,7 +5645,11 @@ var QueryBuilder = /** @class */ (function (_super) {
5600
5645
  }
5601
5646
  else {
5602
5647
  rule.type = 'string';
5603
- rule.value = parser[i + 2][1] ? parser[i + 2][1].replace(/'/g, '') : parser[i + 2][1];
5648
+ var val = parser[i + 2][1];
5649
+ if (val && val[0] === '\'') {
5650
+ val = val.substring(1, val.length - 1);
5651
+ }
5652
+ rule.value = val;
5604
5653
  }
5605
5654
  rule.type = this.getTypeFromColumn(rule);
5606
5655
  }
@@ -5650,6 +5699,27 @@ var QueryBuilder = /** @class */ (function (_super) {
5650
5699
  }
5651
5700
  return rules;
5652
5701
  };
5702
+ QueryBuilder.prototype.getValueFromParser = function (parser, idx) {
5703
+ var value = '';
5704
+ var k;
5705
+ for (k = idx; k < parser.length; k++) {
5706
+ if (parser[k][0] !== 'String' || parser[k][1] === ',' || parser[k][1] === ', ') {
5707
+ break;
5708
+ }
5709
+ else {
5710
+ if (value !== '') {
5711
+ idx += 1;
5712
+ }
5713
+ if (parser[k][1] !== null) {
5714
+ value += parser[k][1];
5715
+ }
5716
+ else {
5717
+ value = null;
5718
+ }
5719
+ }
5720
+ }
5721
+ return { value: value, idx: idx };
5722
+ };
5653
5723
  /**
5654
5724
  * Clone the Group
5655
5725
  *