@syncfusion/ej2-querybuilder 21.2.4 → 22.1.37

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.
Files changed (50) hide show
  1. package/.eslintrc.json +1 -0
  2. package/CHANGELOG.md +3 -4
  3. package/dist/ej2-querybuilder.min.js +2 -2
  4. package/dist/ej2-querybuilder.umd.min.js +2 -2
  5. package/dist/ej2-querybuilder.umd.min.js.map +1 -1
  6. package/dist/es6/ej2-querybuilder.es2015.js +27 -12
  7. package/dist/es6/ej2-querybuilder.es2015.js.map +1 -1
  8. package/dist/es6/ej2-querybuilder.es5.js +27 -12
  9. package/dist/es6/ej2-querybuilder.es5.js.map +1 -1
  10. package/dist/global/ej2-querybuilder.min.js +2 -2
  11. package/dist/global/ej2-querybuilder.min.js.map +1 -1
  12. package/dist/global/index.d.ts +1 -1
  13. package/package.json +11 -11
  14. package/src/query-builder/query-builder-model.d.ts +6 -3
  15. package/src/query-builder/query-builder.d.ts +7 -3
  16. package/src/query-builder/query-builder.js +27 -12
  17. package/styles/bootstrap-dark.css +1 -1
  18. package/styles/bootstrap.css +1 -1
  19. package/styles/bootstrap4.css +1 -1
  20. package/styles/bootstrap5-dark.css +1 -1
  21. package/styles/bootstrap5.css +1 -1
  22. package/styles/fluent-dark.css +1 -1
  23. package/styles/fluent.css +1 -1
  24. package/styles/material-dark.css +1 -1
  25. package/styles/material.css +1 -1
  26. package/styles/material3-dark.css +821 -0
  27. package/styles/material3-dark.scss +3 -0
  28. package/styles/material3.css +877 -0
  29. package/styles/material3.scss +3 -0
  30. package/styles/query-builder/_layout.scss +76 -16
  31. package/styles/query-builder/_material3-dark-definition.scss +1 -0
  32. package/styles/query-builder/_material3-definition.scss +110 -0
  33. package/styles/query-builder/bootstrap-dark.css +1 -1
  34. package/styles/query-builder/bootstrap.css +1 -1
  35. package/styles/query-builder/bootstrap4.css +1 -1
  36. package/styles/query-builder/bootstrap5-dark.css +1 -1
  37. package/styles/query-builder/bootstrap5.css +1 -1
  38. package/styles/query-builder/fluent-dark.css +1 -1
  39. package/styles/query-builder/fluent.css +1 -1
  40. package/styles/query-builder/icons/_material3-dark.scss +1 -0
  41. package/styles/query-builder/material-dark.css +1 -1
  42. package/styles/query-builder/material.css +1 -1
  43. package/styles/query-builder/material3-dark.css +821 -0
  44. package/styles/query-builder/material3-dark.scss +16 -0
  45. package/styles/query-builder/material3.css +877 -0
  46. package/styles/query-builder/material3.scss +16 -0
  47. package/styles/query-builder/tailwind-dark.css +1 -1
  48. package/styles/query-builder/tailwind.css +1 -1
  49. package/styles/tailwind-dark.css +1 -1
  50. package/styles/tailwind.css +1 -1
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 21.2.4
3
+ * version : 22.1.37
4
4
  * Copyright Syncfusion Inc. 2001 - 2020. 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@21.2.3",
3
+ "_id": "@syncfusion/ej2-querybuilder@22.1.34",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-OHwQTyMyPmtJw0BPHVBQrc0jigTbxjWa+78HafNPROaXb5gb1XMi6kqr9oYuxDh9SfEkgAOcoG0swwXR/Kchiw==",
5
+ "_integrity": "sha512-MhknAfhNWtbOakNEX1Foq4XrOi0EZYGt2qCxp+fioDN407UXcCQ1kbJJ+ZgAHlT7Vji1IyMDUWvjXht0iYAdJg==",
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.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-querybuilder/-/ej2-querybuilder-21.2.3.tgz",
27
- "_shasum": "88f4c6542e5620ea68abcb53f607e0a071d9307d",
26
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-querybuilder/-/ej2-querybuilder-22.1.34.tgz",
27
+ "_shasum": "66b87d631445ea030acc569d1953449865e93558",
28
28
  "_spec": "@syncfusion/ej2-querybuilder@*",
29
29
  "_where": "/jenkins/workspace/elease-automation_release_21.1.1/packages/included",
30
30
  "author": {
@@ -32,12 +32,12 @@
32
32
  },
33
33
  "bundleDependencies": false,
34
34
  "dependencies": {
35
- "@syncfusion/ej2-base": "~21.2.3",
36
- "@syncfusion/ej2-buttons": "~21.2.3",
37
- "@syncfusion/ej2-calendars": "~21.2.4",
38
- "@syncfusion/ej2-dropdowns": "~21.2.4",
39
- "@syncfusion/ej2-inputs": "~21.2.4",
40
- "@syncfusion/ej2-splitbuttons": "~21.2.3"
35
+ "@syncfusion/ej2-base": "~22.1.34",
36
+ "@syncfusion/ej2-buttons": "~22.1.36",
37
+ "@syncfusion/ej2-calendars": "~22.1.36",
38
+ "@syncfusion/ej2-dropdowns": "~22.1.37",
39
+ "@syncfusion/ej2-inputs": "~22.1.34",
40
+ "@syncfusion/ej2-splitbuttons": "~22.1.37"
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": "21.2.4",
69
+ "version": "22.1.37",
70
70
  "sideEffects": false,
71
71
  "homepage": "https://www.syncfusion.com/javascript-ui-controls"
72
72
  }
@@ -46,15 +46,17 @@ export interface ColumnsModel {
46
46
  * Specifies the rule template for the field with any other widgets.
47
47
  *
48
48
  * @default null
49
+ * @aspType string
49
50
  */
50
- ruleTemplate?: string;
51
+ ruleTemplate?: string | Function;
51
52
 
52
53
  /**
53
54
  * Specifies the template for value field such as slider or any other widgets.
54
55
  *
55
56
  * @default null
57
+ * @aspType string
56
58
  */
57
- template?: TemplateColumn | string;
59
+ template?: TemplateColumn | string | Function;
58
60
 
59
61
  /**
60
62
  * Specifies the validation for columns (text, number and date).
@@ -350,8 +352,9 @@ export interface QueryBuilderModel extends ComponentModel{
350
352
  * Specifies the template for the header with any other widgets.
351
353
  *
352
354
  * @default null
355
+ * @aspType string
353
356
  */
354
- headerTemplate?: string;
357
+ headerTemplate?: string | Function;
355
358
 
356
359
  /**
357
360
  * Defines class or multiple classes, which are separated by a space in the QueryBuilder element.
@@ -51,14 +51,16 @@ export declare class Columns extends ChildProperty<Columns> {
51
51
  * Specifies the rule template for the field with any other widgets.
52
52
  *
53
53
  * @default null
54
+ * @aspType string
54
55
  */
55
- ruleTemplate: string;
56
+ ruleTemplate: string | Function;
56
57
  /**
57
58
  * Specifies the template for value field such as slider or any other widgets.
58
59
  *
59
60
  * @default null
61
+ * @aspType string
60
62
  */
61
- template: TemplateColumn | string;
63
+ template: TemplateColumn | string | Function;
62
64
  /**
63
65
  * Specifies the validation for columns (text, number and date).
64
66
  *
@@ -395,8 +397,9 @@ export declare class QueryBuilder extends Component<HTMLDivElement> implements I
395
397
  * Specifies the template for the header with any other widgets.
396
398
  *
397
399
  * @default null
400
+ * @aspType string
398
401
  */
399
- headerTemplate: string;
402
+ headerTemplate: string | Function;
400
403
  /**
401
404
  * Defines class or multiple classes, which are separated by a space in the QueryBuilder element.
402
405
  * You can add custom styles to the QueryBuilder using the cssClass property.
@@ -858,4 +861,5 @@ export interface ActionEventArgs extends BaseEventArgs {
858
861
  condition?: string;
859
862
  notCondition?: boolean;
860
863
  renderTemplate?: boolean;
864
+ groupID?: string;
861
865
  }
@@ -1023,17 +1023,24 @@ var QueryBuilder = /** @class */ (function (_super) {
1023
1023
  if (!args.cancel && (this.element.querySelectorAll('.e-group-container').length <= this.maxGroupCount)) {
1024
1024
  var target = eventTarget;
1025
1025
  var dltGroupBtn = void 0;
1026
+ var groupID = '';
1027
+ if (target.className.indexOf('e-group-container') < 0) {
1028
+ groupID = target.querySelector('.e-group-container') && target.querySelector('.e-group-container').id;
1029
+ }
1030
+ else {
1031
+ groupID = target.id;
1032
+ }
1026
1033
  var groupElem = this.groupElem.cloneNode(true);
1027
1034
  groupElem.setAttribute('id', this.element.id + '_group' + this.groupIdCounter);
1028
1035
  if (this.headerTemplate) {
1029
1036
  if (isRoot) {
1030
1037
  isGroup = false;
1031
1038
  groupElem.setAttribute('id', this.element.id + '_group0');
1032
- this.headerTemplateFn(groupElem, not, condition, rule);
1039
+ this.headerTemplateFn(groupElem, not, condition, rule, groupID);
1033
1040
  this.groupIdCounter = 0;
1034
1041
  }
1035
1042
  else {
1036
- this.headerTemplateFn(groupElem, not, condition, rule);
1043
+ this.headerTemplateFn(groupElem, not, condition, rule, groupID);
1037
1044
  }
1038
1045
  }
1039
1046
  this.groupIdCounter++;
@@ -1127,14 +1134,14 @@ var QueryBuilder = /** @class */ (function (_super) {
1127
1134
  }
1128
1135
  }
1129
1136
  };
1130
- QueryBuilder.prototype.headerTemplateFn = function (groupElem, not, condition, rule) {
1137
+ QueryBuilder.prototype.headerTemplateFn = function (groupElem, not, condition, rule, groupID) {
1131
1138
  var template;
1132
1139
  var templateID = this.element.id + '_header';
1133
1140
  var args;
1134
1141
  var groupHdr = groupElem.querySelector('.e-group-header');
1135
1142
  if (this.headerTemplate) {
1136
1143
  args = { requestType: 'header-template-initialize', ruleID: groupElem.id,
1137
- notCondition: this.enableNotCondition ? not : undefined, condition: condition, rule: this.getRuleCollection(rule, true) };
1144
+ notCondition: this.enableNotCondition ? not : undefined, condition: condition, rule: this.getRuleCollection(rule, true), groupID: groupID };
1138
1145
  this.trigger('actionBegin', args);
1139
1146
  this.headerFn = this.templateParser(this.headerTemplate);
1140
1147
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -2064,7 +2071,7 @@ var QueryBuilder = /** @class */ (function (_super) {
2064
2071
  getValue(template.write, window)({ elements: tempElements.length > 1 ? tempElements : tempElements[0], values: rule.value,
2065
2072
  operator: tempRule.operator, field: column.field, dataSource: column.values });
2066
2073
  }
2067
- else {
2074
+ else if (typeof itemData.template !== 'function') {
2068
2075
  itemData.template.write({ elements: tempElements.length > 1 ? tempElements : tempElements[0],
2069
2076
  values: rule.value, operator: tempRule.operator, field: column.field, dataSource: column.values });
2070
2077
  }
@@ -2556,7 +2563,7 @@ var QueryBuilder = /** @class */ (function (_super) {
2556
2563
  QueryBuilder.prototype.actionBeginSuccessCallBack = function (args, itemData, ruleID, field, target) {
2557
2564
  if (args.renderTemplate) {
2558
2565
  var valElem = void 0;
2559
- this.columnTemplateFn = this.templateParser(itemData.template);
2566
+ this.columnTemplateFn = this.templateParser(typeof itemData.template === 'function' ? itemData.template : itemData.template);
2560
2567
  var templateID = this.element.id + field;
2561
2568
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2562
2569
  if (this.isReact) {
@@ -3427,7 +3434,7 @@ var QueryBuilder = /** @class */ (function (_super) {
3427
3434
  QueryBuilder.prototype.templateParser = function (template) {
3428
3435
  if (template) {
3429
3436
  try {
3430
- if (document.querySelectorAll(template).length) {
3437
+ if (typeof template !== 'function' && document.querySelectorAll(template).length) {
3431
3438
  return templateCompiler(document.querySelector(template).innerHTML.trim());
3432
3439
  }
3433
3440
  else {
@@ -3760,7 +3767,7 @@ var QueryBuilder = /** @class */ (function (_super) {
3760
3767
  rule.value = null;
3761
3768
  }
3762
3769
  }
3763
- if ((this.isRefreshed && this.enablePersistence) || (this.rule.field !== '' && rule.operator !== '' && (rule.value !== '' &&
3770
+ if ((this.isRefreshed && this.enablePersistence) || (rule.field !== '' && rule.operator !== '' && (rule.value !== '' &&
3764
3771
  rule.value !== undefined)) || (customObj && customObj.isQuestion)) {
3765
3772
  var condition = rule.condition;
3766
3773
  rule = {
@@ -3800,6 +3807,10 @@ var QueryBuilder = /** @class */ (function (_super) {
3800
3807
  else {
3801
3808
  rule = { 'condition': rule.condition, 'rules': rule.rules };
3802
3809
  }
3810
+ if (customObj) {
3811
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3812
+ rule.custom = customObj;
3813
+ }
3803
3814
  if (rule.rules.length === 0) {
3804
3815
  rule = {};
3805
3816
  }
@@ -4574,8 +4585,11 @@ var QueryBuilder = /** @class */ (function (_super) {
4574
4585
  }
4575
4586
  }
4576
4587
  if (j !== jLen - 1) {
4577
- if (condition === '') {
4578
- condition = rules.rules[j].condition;
4588
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4589
+ var rule = rules.rules[j];
4590
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4591
+ if (condition === '' || (rule && rule.condition !== '' && rule.custom && rule.custom.isCustom)) {
4592
+ condition = rule.condition;
4579
4593
  }
4580
4594
  condition = sqlLocale ? this.l10n.getConstant(condition.toUpperCase()).toUpperCase() : condition.toUpperCase();
4581
4595
  queryStr += ' ' + condition + ' ';
@@ -4723,7 +4737,7 @@ var QueryBuilder = /** @class */ (function (_super) {
4723
4737
  // eslint-disable-next-line
4724
4738
  if (/^`?([a-z_][a-z0-9_.\[\]\(\)]{0,}(\:(number|float|string|date|boolean))?)`?/i.exec(sqlString)) {
4725
4739
  // eslint-disable-next-line
4726
- matchValue = /^`?([a-z_][a-z0-9_.\[\]\(\)]{0,}(\:(number|float|string|date|boolean))?)`?/i.exec(sqlString)[1];
4740
+ matchValue = /^`?([a-zåäö_][a-z0-9åäö_.\[\]\(\)]{0,}(\:(number|float|string|date|boolean))?)`?/i.exec(sqlString)[1];
4727
4741
  this.parser.push(['Literal', matchValue]);
4728
4742
  return matchValue.length;
4729
4743
  }
@@ -4919,7 +4933,8 @@ var QueryBuilder = /** @class */ (function (_super) {
4919
4933
  var isLeftOpened = false;
4920
4934
  for (var i = 0, iLen = parser.length; i < iLen; i++) {
4921
4935
  if (parser[i][0] === 'Literal') {
4922
- rule = { label: parser[i][1], field: parser[i][1] };
4936
+ var column = this.getColumn(parser[i][1]);
4937
+ rule = { label: (column && column.label) ? column.label : parser[i][1], field: parser[i][1] };
4923
4938
  if (parser[i + 1][0] === 'SubOperators') {
4924
4939
  if (parser[i + 1][1].indexOf('null') > -1 || parser[i + 1][1].indexOf('empty') > -1) {
4925
4940
  rule.operator = this.getOperator(' ', parser[i + 1][1], sqlLocale);
@@ -182,7 +182,7 @@
182
182
  .e-query-builder.e-rtl .e-btn-group.e-rtl .e-qb-toggle.e-btn.e-small {
183
183
  border-bottom-left-radius: 0;
184
184
  border-top-left-radius: 0;
185
- border-top-right-radius: 4px;
185
+ border-top-right-radius: 0;
186
186
  }
187
187
  .e-query-builder.e-rtl .e-btn-group.e-rtl .e-qb-toggle.e-btn.e-small.e-not-readonly {
188
188
  border-bottom-right-radius: 4px;
@@ -180,7 +180,7 @@
180
180
  .e-query-builder.e-rtl .e-btn-group.e-rtl .e-qb-toggle.e-btn.e-small {
181
181
  border-bottom-left-radius: 0;
182
182
  border-top-left-radius: 0;
183
- border-top-right-radius: 4px;
183
+ border-top-right-radius: 0;
184
184
  }
185
185
  .e-query-builder.e-rtl .e-btn-group.e-rtl .e-qb-toggle.e-btn.e-small.e-not-readonly {
186
186
  border-bottom-right-radius: 4px;
@@ -260,7 +260,7 @@
260
260
  .e-query-builder.e-rtl .e-btn-group.e-rtl .e-qb-toggle.e-btn.e-small {
261
261
  border-bottom-left-radius: 0;
262
262
  border-top-left-radius: 0;
263
- border-top-right-radius: 4px;
263
+ border-top-right-radius: 0;
264
264
  }
265
265
  .e-query-builder.e-rtl .e-btn-group.e-rtl .e-qb-toggle.e-btn.e-small.e-not-readonly {
266
266
  border-bottom-right-radius: 4px;
@@ -230,7 +230,7 @@
230
230
  .e-query-builder.e-rtl .e-btn-group.e-rtl .e-qb-toggle.e-btn.e-small {
231
231
  border-bottom-left-radius: 0;
232
232
  border-top-left-radius: 0;
233
- border-top-right-radius: 4px;
233
+ border-top-right-radius: 0;
234
234
  }
235
235
  .e-query-builder.e-rtl .e-btn-group.e-rtl .e-qb-toggle.e-btn.e-small.e-not-readonly {
236
236
  border-bottom-right-radius: 4px;
@@ -230,7 +230,7 @@
230
230
  .e-query-builder.e-rtl .e-btn-group.e-rtl .e-qb-toggle.e-btn.e-small {
231
231
  border-bottom-left-radius: 0;
232
232
  border-top-left-radius: 0;
233
- border-top-right-radius: 4px;
233
+ border-top-right-radius: 0;
234
234
  }
235
235
  .e-query-builder.e-rtl .e-btn-group.e-rtl .e-qb-toggle.e-btn.e-small.e-not-readonly {
236
236
  border-bottom-right-radius: 4px;
@@ -210,7 +210,7 @@
210
210
  .e-query-builder.e-rtl .e-btn-group.e-rtl .e-qb-toggle.e-btn.e-small {
211
211
  border-bottom-left-radius: 0;
212
212
  border-top-left-radius: 0;
213
- border-top-right-radius: 4px;
213
+ border-top-right-radius: 0;
214
214
  }
215
215
  .e-query-builder.e-rtl .e-btn-group.e-rtl .e-qb-toggle.e-btn.e-small.e-not-readonly {
216
216
  border-bottom-right-radius: 4px;
package/styles/fluent.css CHANGED
@@ -210,7 +210,7 @@
210
210
  .e-query-builder.e-rtl .e-btn-group.e-rtl .e-qb-toggle.e-btn.e-small {
211
211
  border-bottom-left-radius: 0;
212
212
  border-top-left-radius: 0;
213
- border-top-right-radius: 4px;
213
+ border-top-right-radius: 0;
214
214
  }
215
215
  .e-query-builder.e-rtl .e-btn-group.e-rtl .e-qb-toggle.e-btn.e-small.e-not-readonly {
216
216
  border-bottom-right-radius: 4px;
@@ -156,7 +156,7 @@
156
156
  .e-query-builder.e-rtl .e-btn-group.e-rtl .e-qb-toggle.e-btn.e-small {
157
157
  border-bottom-left-radius: 0;
158
158
  border-top-left-radius: 0;
159
- border-top-right-radius: 2px;
159
+ border-top-right-radius: 0;
160
160
  }
161
161
  .e-query-builder.e-rtl .e-btn-group.e-rtl .e-qb-toggle.e-btn.e-small.e-not-readonly {
162
162
  border-bottom-right-radius: 2px;
@@ -181,7 +181,7 @@
181
181
  .e-query-builder.e-rtl .e-btn-group.e-rtl .e-qb-toggle.e-btn.e-small {
182
182
  border-bottom-left-radius: 0;
183
183
  border-top-left-radius: 0;
184
- border-top-right-radius: 2px;
184
+ border-top-right-radius: 0;
185
185
  }
186
186
  .e-query-builder.e-rtl .e-btn-group.e-rtl .e-qb-toggle.e-btn.e-small.e-not-readonly {
187
187
  border-bottom-right-radius: 2px;