@syncfusion/ej2-querybuilder 25.1.37 → 25.1.40

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.37
3
+ * version : 25.1.40
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.35",
3
+ "_id": "@syncfusion/ej2-querybuilder@25.1.38",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-itzx26EEksco0ikM5WSKDvdr+daQYFbcCSvJGxL/Finvn8TRjL5ciEiJ/0LxbjEiebmlVirur+3ayzAXVJCL/g==",
5
+ "_integrity": "sha512-RLUddm+Ql/CK4B9L75aovBZ1SksSfwr8nonX77H2Q5jI20+6I8TLJAZo8MBSmybIpl6GA2/1JARXa24aDC322w==",
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.35.tgz",
27
- "_shasum": "50afc2d04e3d9b232ebdba93d347a14572aea4d5",
26
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-querybuilder/-/ej2-querybuilder-25.1.38.tgz",
27
+ "_shasum": "9901505552698bdd0ad97442067588722a2d4556",
28
28
  "_spec": "@syncfusion/ej2-querybuilder@*",
29
29
  "_where": "/jenkins/workspace/elease-automation_release_25.1.1/packages/included",
30
30
  "author": {
@@ -33,11 +33,11 @@
33
33
  "bundleDependencies": false,
34
34
  "dependencies": {
35
35
  "@syncfusion/ej2-base": "~25.1.35",
36
- "@syncfusion/ej2-buttons": "~25.1.35",
37
- "@syncfusion/ej2-calendars": "~25.1.37",
38
- "@syncfusion/ej2-dropdowns": "~25.1.37",
39
- "@syncfusion/ej2-inputs": "~25.1.37",
40
- "@syncfusion/ej2-splitbuttons": "~25.1.37"
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"
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.37",
69
+ "version": "25.1.40",
70
70
  "sideEffects": false,
71
71
  "homepage": "https://www.syncfusion.com/javascript-ui-controls"
72
72
  }
@@ -1802,13 +1802,12 @@ var QueryBuilder = /** @class */ (function (_super) {
1802
1802
  var subFieldElem = this.createElement('input', { attrs: { type: 'text', id: ruleId + '_subfilterkey' + this.subFilterCounter } });
1803
1803
  tempElem.appendChild(subFieldElem);
1804
1804
  var height = (this.element.className.indexOf('e-device') > -1) ? '250px' : '200px';
1805
- var subFieldData = Object.keys(this.selectedColumn.columns[0]);
1806
1805
  var ddlField;
1807
1806
  ddlField = {
1808
1807
  dataSource: this.selectedColumn.columns,
1809
1808
  fields: this.fields,
1810
1809
  placeholder: this.l10n.getConstant('SelectField'),
1811
- popupHeight: ((subFieldData.length > 5) ? height : 'auto'),
1810
+ popupHeight: ((this.selectedColumn.columns.length > 5) ? height : 'auto'),
1812
1811
  change: this.changeField.bind(this),
1813
1812
  index: 0,
1814
1813
  open: this.popupOpen.bind(this, false)
@@ -1822,7 +1821,7 @@ var QueryBuilder = /** @class */ (function (_super) {
1822
1821
  this.GetRootColumnName(rule.field) === this.GetRootColumnName(this.previousColumn.field))) {
1823
1822
  var subField = this.selectedColumn.columns;
1824
1823
  for (var i = 0; i < subField.length; i++) {
1825
- if (rule.field === subField[i].field) {
1824
+ if (rule.field === subField[i].field || rule.field.indexOf(subField[i].field + this.separator) > -1) {
1826
1825
  dropDownList.value = subField[i].field;
1827
1826
  this.selectedColumn = subField[i];
1828
1827
  subFieldValue = true;
@@ -2327,7 +2326,7 @@ var QueryBuilder = /** @class */ (function (_super) {
2327
2326
  var columnData = this.getItemData(parentId);
2328
2327
  var selectedValue;
2329
2328
  var isTemplate = (typeof columnData.template === 'string');
2330
- if (this.isImportRules || this.ruleIndex > -1 || this.groupIndex > -1 || this.isPublic || isTemplate) {
2329
+ if (this.isImportRules || this.ruleIndex > -1 || this.groupIndex > -1 || this.isPublic || isTemplate || rule.value != '') {
2331
2330
  selectedValue = rule.value;
2332
2331
  }
2333
2332
  else {
@@ -2366,7 +2365,7 @@ var QueryBuilder = /** @class */ (function (_super) {
2366
2365
  QueryBuilder.prototype.renderNumberValue = function (parentId, rule, operator, idx, ruleValElem, itemData, length) {
2367
2366
  var columnData = this.getItemData(parentId);
2368
2367
  var isTemplate = (typeof columnData.template === 'string');
2369
- var selectedVal = (this.isImportRules || this.ruleIndex > -1 || this.groupIndex > -1 || this.isPublic || isTemplate) ? rule.value : this.setDefaultValue(parentId, false, true);
2368
+ var selectedVal = (this.isImportRules || this.ruleIndex > -1 || this.groupIndex > -1 || this.isPublic || isTemplate || typeof rule.value === 'number') ? rule.value : this.setDefaultValue(parentId, false, true);
2370
2369
  if ((operator === 'in' || operator === 'notin') && (this.dataColl.length || columnData.values)) {
2371
2370
  selectedVal = (this.isImportRules || this.ruleIndex > -1 || this.groupIndex > -1) ? rule.value : this.setDefaultValue(parentId, true, false);
2372
2371
  this.renderMultiSelect(columnData, parentId, idx, selectedVal, columnData.values);
@@ -2502,6 +2501,10 @@ var QueryBuilder = /** @class */ (function (_super) {
2502
2501
  var datePicker = void 0;
2503
2502
  var place = this.l10n.getConstant('SelectValue');
2504
2503
  var isTemplate = (typeof itemData.template === 'string');
2504
+ if (rule.value && !isNullOrUndefined(format)) {
2505
+ selVal = (length_1 > 1) ? rule.value[i] : rule.value;
2506
+ selectedValue = this.parseDate(selVal, format) || new Date();
2507
+ }
2505
2508
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2506
2509
  if (!itemData.field && !itemData.key && itemData.value) {
2507
2510
  if (itemData.value instanceof Date) {
@@ -2602,7 +2605,15 @@ var QueryBuilder = /** @class */ (function (_super) {
2602
2605
  isCheck = values[i].toString().toLowerCase() === itemData.value.toString().toLowerCase();
2603
2606
  }
2604
2607
  else if (i === 0) {
2605
- isCheck = true;
2608
+ if (typeof rule.value === 'boolean') {
2609
+ isCheck = rule.value ? true : false;
2610
+ }
2611
+ else {
2612
+ isCheck = true;
2613
+ }
2614
+ }
2615
+ if (typeof rule.value === 'boolean' && i === 1) {
2616
+ isCheck = !rule.value ? true : false;
2606
2617
  }
2607
2618
  value = values[i].toString();
2608
2619
  orgValue = values[i];
@@ -2619,7 +2630,7 @@ var QueryBuilder = /** @class */ (function (_super) {
2619
2630
  var radiobutton = new RadioButton(radioBtn);
2620
2631
  radiobutton.appendTo('#' + parentId + '_valuekey' + i);
2621
2632
  if (isCheck) {
2622
- this.updateRules(radiobutton.element, orgValue, 0);
2633
+ this.updateRules(radiobutton.element, orgValue, 0, true);
2623
2634
  }
2624
2635
  };
2625
2636
  QueryBuilder.prototype.getOperatorIndex = function (ddlObj, rule) {
@@ -5275,9 +5286,9 @@ var QueryBuilder = /** @class */ (function (_super) {
5275
5286
  return matchValue.length;
5276
5287
  }
5277
5288
  // eslint-disable-next-line
5278
- if (this.checkLiteral() && /^'?([a-z_][a-z0-9 _.\[\]\(\)]{0,}(\:(number|float|string|date|boolean))?)'?/i.exec(sqlString)) {
5289
+ if (this.checkLiteral() && /^'?([a-z_][a-z0-9 _.\[\]\(\)-]{0,}(\:(number|float|string|date|boolean))?)'?/i.exec(sqlString)) {
5279
5290
  // eslint-disable-next-line
5280
- matchValue = /^'?([a-z_][a-z0-9 _.\[\]\(\)]{0,}(\:(number|float|string|date|boolean))?)'?/i.exec(sqlString)[1];
5291
+ matchValue = /^'?([a-z_][a-z0-9 _.\[\]\(\)-]{0,}(\:(number|float|string|date|boolean))?)'?/i.exec(sqlString)[1];
5281
5292
  this.parser.push(['Literal', matchValue]);
5282
5293
  return matchValue.length + 2;
5283
5294
  }