@syncfusion/ej2-querybuilder 25.1.42 → 25.2.4

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.42
3
+ * version : 25.2.4
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.2.3",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-RLUddm+Ql/CK4B9L75aovBZ1SksSfwr8nonX77H2Q5jI20+6I8TLJAZo8MBSmybIpl6GA2/1JARXa24aDC322w==",
5
+ "_integrity": "sha512-g0zrXZsPCoiv5HFmQSjCcz2FTFV+IQiKYJe3NFSVmx7pPYRG5yDrm8e/YqbuuMkFJ+Hhmq82atsapjvbBNCdjw==",
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.2.3.tgz",
27
+ "_shasum": "0935962d9265df19139327bc445b6e1796a5eef1",
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.42",
38
- "@syncfusion/ej2-dropdowns": "~25.1.41",
39
- "@syncfusion/ej2-inputs": "~25.1.42",
40
- "@syncfusion/ej2-splitbuttons": "~25.1.38"
35
+ "@syncfusion/ej2-base": "~25.2.3",
36
+ "@syncfusion/ej2-buttons": "~25.2.4",
37
+ "@syncfusion/ej2-calendars": "~25.2.4",
38
+ "@syncfusion/ej2-dropdowns": "~25.2.4",
39
+ "@syncfusion/ej2-inputs": "~25.2.3",
40
+ "@syncfusion/ej2-splitbuttons": "~25.2.4"
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.42",
69
+ "version": "25.2.4",
70
70
  "sideEffects": false,
71
71
  "homepage": "https://www.syncfusion.com/javascript-ui-controls"
72
72
  }
@@ -168,7 +168,7 @@ export interface RuleModel {
168
168
  /**
169
169
  * Specifies whether rule is locked or not.
170
170
  *
171
- * @default false
171
+ * @default null
172
172
  */
173
173
  isLocked?: boolean;
174
174
 
@@ -155,7 +155,7 @@ export declare class Rule extends ChildProperty<Rule> {
155
155
  /**
156
156
  * Specifies whether rule is locked or not.
157
157
  *
158
- * @default false
158
+ * @default null
159
159
  */
160
160
  isLocked: boolean;
161
161
  }
@@ -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
  *
@@ -128,7 +128,7 @@ var Rule = /** @class */ (function (_super) {
128
128
  Property(false)
129
129
  ], Rule.prototype, "not", void 0);
130
130
  __decorate([
131
- Property(false)
131
+ Property(null)
132
132
  ], Rule.prototype, "isLocked", void 0);
133
133
  return Rule;
134
134
  }(ChildProperty));
@@ -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();
@@ -4068,7 +4087,9 @@ var QueryBuilder = /** @class */ (function (_super) {
4068
4087
  var ruleCondtion = currentRule.condition;
4069
4088
  var notCondition = currentRule.not;
4070
4089
  var ruleColl = extend([], currentRule.rules, [], true);
4071
- var rule = this.getRuleCollection({ condition: ruleCondtion, rules: ruleColl, not: notCondition }, true);
4090
+ var rule = !isNullOrUndefined(currentRule.isLocked) ?
4091
+ this.getRuleCollection({ condition: ruleCondtion, rules: ruleColl, not: notCondition, isLocked: currentRule.isLocked }, true) :
4092
+ this.getRuleCollection({ condition: ruleCondtion, rules: ruleColl, not: notCondition }, true);
4072
4093
  return rule;
4073
4094
  };
4074
4095
  QueryBuilder.prototype.getRuleCollection = function (rule, isValidRule) {
@@ -4101,10 +4122,11 @@ var QueryBuilder = /** @class */ (function (_super) {
4101
4122
  if ((this.isRefreshed && this.enablePersistence) || (rule.field !== '' && rule.operator !== '' && (rule.value !== '' &&
4102
4123
  rule.value !== undefined)) || (customObj && customObj.isQuestion)) {
4103
4124
  var condition = rule.condition;
4104
- rule = {
4105
- 'label': rule.label, 'field': rule.field, 'operator': rule.operator, 'type': rule.type, 'value': rule.value,
4106
- 'isLocked': rule.isLocked
4107
- };
4125
+ var lockedRule = rule.isLocked;
4126
+ rule = { 'label': rule.label, 'field': rule.field, 'operator': rule.operator, 'type': rule.type, 'value': rule.value };
4127
+ if (!isNullOrUndefined(lockedRule)) {
4128
+ rule.isLocked = lockedRule;
4129
+ }
4108
4130
  if (condition) {
4109
4131
  rule.condition = condition;
4110
4132
  }
@@ -4137,11 +4159,15 @@ var QueryBuilder = /** @class */ (function (_super) {
4137
4159
  rule = {};
4138
4160
  }
4139
4161
  else {
4162
+ var isLocked = rule.isLocked;
4140
4163
  if (this.enableNotCondition) {
4141
- rule = { 'condition': rule.condition, 'rules': rule.rules, 'not': rule.not, 'isLocked': rule.isLocked };
4164
+ rule = { 'condition': rule.condition, 'rules': rule.rules, 'not': rule.not };
4142
4165
  }
4143
4166
  else {
4144
- rule = { 'condition': rule.condition, 'rules': rule.rules, 'isLocked': rule.isLocked };
4167
+ rule = { 'condition': rule.condition, 'rules': rule.rules };
4168
+ }
4169
+ if (!isNullOrUndefined(isLocked)) {
4170
+ rule.isLocked = isLocked;
4145
4171
  }
4146
4172
  if (customObj) {
4147
4173
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -4182,6 +4208,9 @@ var QueryBuilder = /** @class */ (function (_super) {
4182
4208
  else {
4183
4209
  rule = { condition: this.rule.condition, rules: this.rule.rules };
4184
4210
  }
4211
+ if (!isNullOrUndefined(this.rule.isLocked)) {
4212
+ rule.isLocked = this.rule.isLocked;
4213
+ }
4185
4214
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4186
4215
  if (this.rule.custom) {
4187
4216
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -5315,6 +5344,11 @@ var QueryBuilder = /** @class */ (function (_super) {
5315
5344
  }
5316
5345
  }
5317
5346
  }
5347
+ else if (sqlString[matchValue.length] && (sqlString[matchValue.length] !== ')') &&
5348
+ !this.checkCondition(sqlString, matchValue)) {
5349
+ matchValue = this.getSingleQuoteString(sqlString, matchValue);
5350
+ }
5351
+ // end
5318
5352
  this.parser.push(['String', matchValue]);
5319
5353
  return matchValue.length;
5320
5354
  }
@@ -5344,6 +5378,27 @@ var QueryBuilder = /** @class */ (function (_super) {
5344
5378
  }
5345
5379
  return 1;
5346
5380
  };
5381
+ QueryBuilder.prototype.checkCondition = function (sqlString, matchValue) {
5382
+ if (sqlString.slice(matchValue.length + 1, matchValue.length + 4) === 'AND' ||
5383
+ sqlString.slice(matchValue.length + 1, matchValue.length + 3) === 'OR') {
5384
+ return true;
5385
+ }
5386
+ return false;
5387
+ };
5388
+ QueryBuilder.prototype.getSingleQuoteString = function (sqlString, matchValue) {
5389
+ if (sqlString[matchValue.length] && (sqlString[matchValue.length] !== ')') &&
5390
+ !this.checkCondition(sqlString, matchValue) && sqlString[matchValue.length] !== ',') {
5391
+ var tempStr = sqlString.replace(matchValue, '');
5392
+ // eslint-disable-next-line
5393
+ if (isNullOrUndefined(/^'((?:[^\\']+?|\\.|'')*)'(?!')/.exec(tempStr))) {
5394
+ // eslint-disable-next-line
5395
+ var parsedValue = /^((?:[^\\']+?|\\.|'')*)'(?!')/.exec(tempStr)[0];
5396
+ matchValue += parsedValue;
5397
+ matchValue = this.getSingleQuoteString(sqlString, matchValue);
5398
+ }
5399
+ }
5400
+ return matchValue;
5401
+ };
5347
5402
  QueryBuilder.prototype.checkLiteral = function () {
5348
5403
  var lastParser = this.parser[this.parser.length - 1];
5349
5404
  if (!lastParser) {
@@ -5600,7 +5655,11 @@ var QueryBuilder = /** @class */ (function (_super) {
5600
5655
  }
5601
5656
  else {
5602
5657
  rule.type = 'string';
5603
- rule.value = parser[i + 2][1] ? parser[i + 2][1].replace(/'/g, '') : parser[i + 2][1];
5658
+ var val = parser[i + 2][1];
5659
+ if (val && val[0] === '\'') {
5660
+ val = val.substring(1, val.length - 1);
5661
+ }
5662
+ rule.value = val;
5604
5663
  }
5605
5664
  rule.type = this.getTypeFromColumn(rule);
5606
5665
  }
@@ -5650,6 +5709,27 @@ var QueryBuilder = /** @class */ (function (_super) {
5650
5709
  }
5651
5710
  return rules;
5652
5711
  };
5712
+ QueryBuilder.prototype.getValueFromParser = function (parser, idx) {
5713
+ var value = '';
5714
+ var k;
5715
+ for (k = idx; k < parser.length; k++) {
5716
+ if (parser[k][0] !== 'String' || parser[k][1] === ',' || parser[k][1] === ', ') {
5717
+ break;
5718
+ }
5719
+ else {
5720
+ if (value !== '') {
5721
+ idx += 1;
5722
+ }
5723
+ if (parser[k][1] !== null) {
5724
+ value += parser[k][1];
5725
+ }
5726
+ else {
5727
+ value = null;
5728
+ }
5729
+ }
5730
+ }
5731
+ return { value: value, idx: idx };
5732
+ };
5653
5733
  /**
5654
5734
  * Clone the Group
5655
5735
  *