@syncfusion/ej2-querybuilder 20.3.50 → 20.3.59

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 : 20.3.50
3
+ * version : 20.3.59
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@20.3.49",
3
+ "_id": "@syncfusion/ej2-querybuilder@20.3.56",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-dONIsgOFwjeKOdVZYzFKHoUDkLHtX8efJIQW7B0A7AB+hnU6ljnFYOALXYFBYBOMc6vbFpc9R27eu2GmiGu9lQ==",
5
+ "_integrity": "sha512-UpTk3wTJ6b5nI2lhpbgaRlJZfJo+EyUxC605a5LCffg1z+wk3J1gv+qovJop6E6UsXw+p37bJ+L/LqvwjNk0PA==",
6
6
  "_location": "/@syncfusion/ej2-querybuilder",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -23,21 +23,21 @@
23
23
  "/@syncfusion/ej2-react-querybuilder",
24
24
  "/@syncfusion/ej2-vue-querybuilder"
25
25
  ],
26
- "_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-querybuilder/-/ej2-querybuilder-20.3.49.tgz",
27
- "_shasum": "3fc9df0235d5a9c2f473e08deb985b33a35a1183",
26
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-querybuilder/-/ej2-querybuilder-20.3.56.tgz",
27
+ "_shasum": "ccbedceaec28eb6619c6ddcd040915c4a6379e20",
28
28
  "_spec": "@syncfusion/ej2-querybuilder@*",
29
- "_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
29
+ "_where": "/jenkins/workspace/ease-automation_release_19.1.0.1/packages/included",
30
30
  "author": {
31
31
  "name": "Syncfusion Inc."
32
32
  },
33
33
  "bundleDependencies": false,
34
34
  "dependencies": {
35
- "@syncfusion/ej2-base": "~20.3.50",
36
- "@syncfusion/ej2-buttons": "~20.3.50",
37
- "@syncfusion/ej2-calendars": "~20.3.50",
38
- "@syncfusion/ej2-dropdowns": "~20.3.50",
39
- "@syncfusion/ej2-inputs": "~20.3.50",
40
- "@syncfusion/ej2-splitbuttons": "~20.3.47"
35
+ "@syncfusion/ej2-base": "~20.3.56",
36
+ "@syncfusion/ej2-buttons": "~20.3.58",
37
+ "@syncfusion/ej2-calendars": "~20.3.59",
38
+ "@syncfusion/ej2-dropdowns": "~20.3.59",
39
+ "@syncfusion/ej2-inputs": "~20.3.57",
40
+ "@syncfusion/ej2-splitbuttons": "~20.3.56"
41
41
  },
42
42
  "deprecated": false,
43
43
  "description": "Essential JS 2 QueryBuilder",
@@ -69,6 +69,6 @@
69
69
  "url": "https://github.com/syncfusion/ej2-javascript-ui-controls/tree/master/controls/querybuilder"
70
70
  },
71
71
  "typings": "index.d.ts",
72
- "version": "20.3.50",
72
+ "version": "20.3.59",
73
73
  "sideEffects": false
74
74
  }
@@ -260,6 +260,7 @@ export declare class QueryBuilder extends Component<HTMLDivElement> implements I
260
260
  private items;
261
261
  private customOperators;
262
262
  private operators;
263
+ private sqlOperators;
263
264
  private ruleElem;
264
265
  private groupElem;
265
266
  private dataColl;
@@ -726,24 +727,27 @@ export declare class QueryBuilder extends Component<HTMLDivElement> implements I
726
727
  * Sets the rules from the sql query.
727
728
  *
728
729
  * @param {string} sqlString - 'sql String' to be passed to set the rule.
730
+ * @param {boolean} sqlLocale - Set `true` if Localization for Sql query.
729
731
  * @returns {void}
730
732
  */
731
- setRulesFromSql(sqlString: string): void;
733
+ setRulesFromSql(sqlString: string, sqlLocale?: boolean): void;
732
734
  /**
733
735
  * Get the rules from SQL query.
734
736
  *
735
737
  * @param {string} sqlString - 'sql String' to be passed to get the rule.
738
+ * @param {boolean} sqlLocale - Set `true` if Localization for Sql query.
736
739
  * @returns {object} - Rules from SQL query
737
740
  */
738
- getRulesFromSql(sqlString: string): RuleModel;
741
+ getRulesFromSql(sqlString: string, sqlLocale?: boolean): RuleModel;
739
742
  /**
740
743
  * Gets the sql query from rules.
741
744
  *
742
745
  * @param {RuleModel} rule - 'rule' to be passed to get the sql.
743
746
  * @param {boolean} allowEscape - Set `true` if it exclude the escape character.
747
+ * @param {boolean} sqlLocale - Set `true` if Localization for Sql query.
744
748
  * @returns {object} - Sql query from rules.
745
749
  */
746
- getSqlFromRules(rule?: RuleModel, allowEscape?: boolean): string;
750
+ getSqlFromRules(rule?: RuleModel, allowEscape?: boolean, sqlLocale?: boolean): string;
747
751
  private sqlParser;
748
752
  private parseSqlStrings;
749
753
  private checkLiteral;
@@ -3236,6 +3236,8 @@ var QueryBuilder = /** @class */ (function (_super) {
3236
3236
  StartsWith: 'Starts With',
3237
3237
  EndsWith: 'Ends With',
3238
3238
  Contains: 'Contains',
3239
+ NotLike: 'Not Like',
3240
+ Like: 'Like',
3239
3241
  Equal: 'Equal',
3240
3242
  NotEqual: 'Not Equal',
3241
3243
  LessThan: 'Less Than',
@@ -3320,6 +3322,16 @@ var QueryBuilder = /** @class */ (function (_super) {
3320
3322
  isnull: 'IS NULL', isnotnull: 'IS NOT NULL', isempty: 'IS EMPTY', isnotempty: 'IS NOT EMPTY', notstartswith: 'NOT LIKE',
3321
3323
  notendswith: 'NOT LIKE', notcontains: 'NOT LIKE'
3322
3324
  };
3325
+ this.sqlOperators = {
3326
+ equal: '=', notequal: '!=', greaterthan: '>', greaterthanorequal: '>=', lessthan: '<', in: this.l10n.getConstant('In').toUpperCase(),
3327
+ notin: this.l10n.getConstant('NotIn').toUpperCase(), lessthanorequal: '<=', startswith: this.l10n.getConstant('Like').toUpperCase(),
3328
+ endswith: this.l10n.getConstant('Like').toUpperCase(), between: this.l10n.getConstant('Between').toUpperCase(),
3329
+ notbetween: this.l10n.getConstant('NotBetween').toUpperCase(), contains: this.l10n.getConstant('Like').toUpperCase(),
3330
+ isnull: this.l10n.getConstant('IsNull').toUpperCase(), isnotnull: this.l10n.getConstant('IsNotNull').toUpperCase(),
3331
+ isempty: this.l10n.getConstant('IsEmpty').toUpperCase(), isnotempty: this.l10n.getConstant('IsNotEmpty').toUpperCase(),
3332
+ notstartswith: this.l10n.getConstant('NotLike').toUpperCase(), notendswith: this.l10n.getConstant('NotLike').toUpperCase(),
3333
+ notcontains: this.l10n.getConstant('NotLike').toUpperCase()
3334
+ };
3323
3335
  if (!this.fields) {
3324
3336
  this.fields = { text: 'label', value: 'field' };
3325
3337
  }
@@ -4405,7 +4417,7 @@ var QueryBuilder = /** @class */ (function (_super) {
4405
4417
  }
4406
4418
  return false;
4407
4419
  };
4408
- QueryBuilder.prototype.getSqlString = function (rules, enableEscape, queryStr) {
4420
+ QueryBuilder.prototype.getSqlString = function (rules, enableEscape, queryStr, sqlLocale) {
4409
4421
  var isRoot = false;
4410
4422
  if (!queryStr && queryStr !== '') {
4411
4423
  queryStr = '';
@@ -4416,27 +4428,33 @@ var QueryBuilder = /** @class */ (function (_super) {
4416
4428
  }
4417
4429
  var condition = rules.condition;
4418
4430
  if (rules.not) {
4431
+ var rulesNotCondition = void 0;
4419
4432
  if (isRoot) {
4420
- queryStr += 'NOT (';
4433
+ rulesNotCondition = sqlLocale ? this.l10n.getConstant('NOT').toUpperCase() + ' (' : 'NOT (';
4434
+ queryStr += rulesNotCondition;
4421
4435
  }
4422
4436
  else {
4423
- queryStr += ' NOT (';
4437
+ rulesNotCondition = sqlLocale ? ' ' + this.l10n.getConstant('NOT').toUpperCase() + ' (' : ' NOT (';
4438
+ queryStr += rulesNotCondition;
4424
4439
  }
4425
4440
  }
4426
4441
  for (var j = 0, jLen = rules.rules.length; j < jLen; j++) {
4427
4442
  if (rules.rules[j].rules) {
4428
- queryStr = this.getSqlString(rules.rules[j], enableEscape, queryStr);
4443
+ queryStr = this.getSqlString(rules.rules[j], enableEscape, queryStr, sqlLocale);
4429
4444
  }
4430
4445
  else {
4431
4446
  var rule = rules.rules[j];
4432
4447
  var valueStr = '';
4448
+ var ruleOpertor = void 0;
4449
+ ruleOpertor = sqlLocale ? this.sqlOperators[rule.operator] : this.operators[rule.operator];
4433
4450
  if (rule.value instanceof Array) {
4434
4451
  if (rule.operator.toString().indexOf('between') > -1) {
4452
+ var ruleCondition = sqlLocale ? ' ' + this.l10n.getConstant('AND').toUpperCase() + ' ' : ' ' + 'AND' + ' ';
4435
4453
  if (rule.type === 'date' && !this.isDateFunction(rule.value[0])) {
4436
- valueStr += '"' + rule.value[0] + '" AND "' + rule.value[1] + '"';
4454
+ valueStr += '"' + rule.value[0] + '"' + ruleCondition + '"' + rule.value[1] + '"';
4437
4455
  }
4438
4456
  else {
4439
- valueStr += rule.value[0] + ' AND ' + rule.value[1];
4457
+ valueStr += rule.value[0] + ruleCondition + rule.value[1];
4440
4458
  }
4441
4459
  }
4442
4460
  else {
@@ -4480,7 +4498,7 @@ var QueryBuilder = /** @class */ (function (_super) {
4480
4498
  rule.field = '"' + rule.field + '"';
4481
4499
  }
4482
4500
  }
4483
- queryStr += rule.field + ' ' + this.operators[rule.operator];
4501
+ queryStr += rule.field + ' ' + ruleOpertor;
4484
4502
  }
4485
4503
  else {
4486
4504
  if (enableEscape) {
@@ -4491,7 +4509,7 @@ var QueryBuilder = /** @class */ (function (_super) {
4491
4509
  rule.field = '"' + rule.field + '"';
4492
4510
  }
4493
4511
  }
4494
- queryStr += rule.field + ' ' + this.operators[rule.operator] + ' ' + valueStr;
4512
+ queryStr += rule.field + ' ' + ruleOpertor + ' ' + valueStr;
4495
4513
  }
4496
4514
  if (rule.condition && rule.condition !== '') {
4497
4515
  condition = rule.condition;
@@ -4501,7 +4519,8 @@ var QueryBuilder = /** @class */ (function (_super) {
4501
4519
  if (condition === '') {
4502
4520
  condition = rules.rules[j].condition;
4503
4521
  }
4504
- queryStr += ' ' + condition.toUpperCase() + ' ';
4522
+ condition = sqlLocale ? this.l10n.getConstant(condition.toUpperCase()).toUpperCase() : condition.toUpperCase();
4523
+ queryStr += ' ' + condition + ' ';
4505
4524
  }
4506
4525
  }
4507
4526
  if (!isRoot) {
@@ -4516,24 +4535,26 @@ var QueryBuilder = /** @class */ (function (_super) {
4516
4535
  * Sets the rules from the sql query.
4517
4536
  *
4518
4537
  * @param {string} sqlString - 'sql String' to be passed to set the rule.
4538
+ * @param {boolean} sqlLocale - Set `true` if Localization for Sql query.
4519
4539
  * @returns {void}
4520
4540
  */
4521
- QueryBuilder.prototype.setRulesFromSql = function (sqlString) {
4541
+ QueryBuilder.prototype.setRulesFromSql = function (sqlString, sqlLocale) {
4522
4542
  sqlString = sqlString.replace(/`/g, '');
4523
- var ruleModel = this.getRulesFromSql(sqlString);
4543
+ var ruleModel = this.getRulesFromSql(sqlString, sqlLocale);
4524
4544
  this.setRules({ condition: ruleModel.condition, not: ruleModel.not, rules: ruleModel.rules });
4525
4545
  };
4526
4546
  /**
4527
4547
  * Get the rules from SQL query.
4528
4548
  *
4529
4549
  * @param {string} sqlString - 'sql String' to be passed to get the rule.
4550
+ * @param {boolean} sqlLocale - Set `true` if Localization for Sql query.
4530
4551
  * @returns {object} - Rules from SQL query
4531
4552
  */
4532
- QueryBuilder.prototype.getRulesFromSql = function (sqlString) {
4553
+ QueryBuilder.prototype.getRulesFromSql = function (sqlString, sqlLocale) {
4533
4554
  this.parser = [];
4534
- this.sqlParser(sqlString);
4555
+ this.sqlParser(sqlString, sqlLocale);
4535
4556
  this.rule = { condition: 'and', not: false, rules: [] };
4536
- var rule = this.processParser(this.parser, this.rule, [0]);
4557
+ var rule = this.processParser(this.parser, this.rule, [0], sqlLocale);
4537
4558
  if (this.enableNotCondition) {
4538
4559
  return { condition: rule.condition, not: rule.not, rules: rule.rules };
4539
4560
  }
@@ -4546,28 +4567,45 @@ var QueryBuilder = /** @class */ (function (_super) {
4546
4567
  *
4547
4568
  * @param {RuleModel} rule - 'rule' to be passed to get the sql.
4548
4569
  * @param {boolean} allowEscape - Set `true` if it exclude the escape character.
4570
+ * @param {boolean} sqlLocale - Set `true` if Localization for Sql query.
4549
4571
  * @returns {object} - Sql query from rules.
4550
4572
  */
4551
- QueryBuilder.prototype.getSqlFromRules = function (rule, allowEscape) {
4573
+ QueryBuilder.prototype.getSqlFromRules = function (rule, allowEscape, sqlLocale) {
4552
4574
  if (!rule) {
4553
4575
  rule = this.getValidRules();
4554
4576
  }
4555
4577
  rule = this.getRuleCollection(rule, false);
4556
- return this.getSqlString(this.getValidRules(rule), allowEscape).replace(/"/g, '\'');
4578
+ return this.getSqlString(this.getValidRules(rule), allowEscape, null, sqlLocale).replace(/"/g, '\'');
4557
4579
  };
4558
- QueryBuilder.prototype.sqlParser = function (sqlString) {
4580
+ QueryBuilder.prototype.sqlParser = function (sqlString, sqlLocale) {
4559
4581
  var st = 0;
4560
4582
  var str;
4561
4583
  do {
4562
4584
  str = sqlString.slice(st);
4563
- st += this.parseSqlStrings(str);
4585
+ st += this.parseSqlStrings(str, sqlLocale);
4564
4586
  } while (str !== '');
4565
4587
  return this.parser;
4566
4588
  };
4567
- QueryBuilder.prototype.parseSqlStrings = function (sqlString) {
4589
+ QueryBuilder.prototype.parseSqlStrings = function (sqlString, sqlLocale) {
4568
4590
  var operators = ['=', '!=', '<=', '>=', '<', '>'];
4569
- var conditions = ['AND', 'OR', 'NOT'];
4570
- var subOp = ['IN', 'NOT IN', 'LIKE', 'NOT LIKE', 'BETWEEN', 'NOT BETWEEN', 'IS NULL', 'IS NOT NULL', 'IS EMPTY', 'IS NOT EMPTY'];
4591
+ var conditions;
4592
+ if (sqlLocale) {
4593
+ conditions = [this.l10n.getConstant('AND').toUpperCase(), this.l10n.getConstant('OR').toUpperCase(), this.l10n.getConstant('NOT').toUpperCase()];
4594
+ }
4595
+ else {
4596
+ conditions = ['AND', 'OR', 'NOT'];
4597
+ }
4598
+ var subOp;
4599
+ if (sqlLocale) {
4600
+ subOp = [this.l10n.getConstant('In').toUpperCase(), this.l10n.getConstant('NotIn').toUpperCase(),
4601
+ this.l10n.getConstant('Like').toUpperCase(), this.l10n.getConstant('NotLike').toUpperCase(),
4602
+ this.l10n.getConstant('Between').toUpperCase(), this.l10n.getConstant('NotBetween').toUpperCase(),
4603
+ this.l10n.getConstant('IsNull').toUpperCase(), this.l10n.getConstant('IsNotNull').toUpperCase(),
4604
+ this.l10n.getConstant('IsEmpty').toUpperCase(), this.l10n.getConstant('IsNotEmpty').toUpperCase()];
4605
+ }
4606
+ else {
4607
+ subOp = ['IN', 'NOT IN', 'LIKE', 'NOT LIKE', 'BETWEEN', 'NOT BETWEEN', 'IS NULL', 'IS NOT NULL', 'IS EMPTY', 'IS NOT EMPTY'];
4608
+ }
4571
4609
  var regexStr;
4572
4610
  var regex;
4573
4611
  var matchValue;
@@ -4634,7 +4672,7 @@ var QueryBuilder = /** @class */ (function (_super) {
4634
4672
  this.parser.push(['Literal', matchValue]);
4635
4673
  return matchValue.length + 2;
4636
4674
  }
4637
- if (this.checkNumberLiteral(sqlString)) {
4675
+ if (this.checkNumberLiteral(sqlString, sqlLocale)) {
4638
4676
  matchValue = /^[0-9]+(\.[0-9]+)?/.exec(sqlString)[0];
4639
4677
  this.parser.push(['Literal', matchValue]);
4640
4678
  return matchValue.length;
@@ -4678,7 +4716,7 @@ var QueryBuilder = /** @class */ (function (_super) {
4678
4716
  }
4679
4717
  return false;
4680
4718
  };
4681
- QueryBuilder.prototype.checkNumberLiteral = function (sqlString) {
4719
+ QueryBuilder.prototype.checkNumberLiteral = function (sqlString, sqlLocale) {
4682
4720
  var lastParser = this.parser[this.parser.length - 1];
4683
4721
  if (!lastParser) {
4684
4722
  return true;
@@ -4690,19 +4728,38 @@ var QueryBuilder = /** @class */ (function (_super) {
4690
4728
  if (lastParser[0] === 'Left' && (secParser && secParser[0] === 'Conditions')) {
4691
4729
  return true;
4692
4730
  }
4693
- if (lastParser[0] === 'Conditions' && (betweenParser && betweenParser[1].indexOf('between') < 0)) {
4731
+ var betweenOperator = sqlLocale ? this.l10n.getConstant('Between').toLowerCase() : 'between';
4732
+ if (lastParser[0] === 'Conditions' && (betweenParser && betweenParser[1].indexOf(betweenOperator) < 0)) {
4694
4733
  return true;
4695
4734
  }
4696
4735
  }
4697
4736
  }
4698
4737
  return false;
4699
4738
  };
4700
- QueryBuilder.prototype.getOperator = function (value, operator) {
4739
+ QueryBuilder.prototype.getOperator = function (value, operator, sqlLocale) {
4701
4740
  var operators = {
4702
4741
  '=': 'equal', '!=': 'notequal', '<': 'lessthan', '>': 'greaterthan', '<=': 'lessthanorequal',
4703
4742
  '>=': 'greaterthanorequal', 'in': 'in', 'not in': 'notin', 'between': 'between', 'not between': 'notbetween',
4704
4743
  'is empty': 'isempty', 'is null': 'isnull', 'is not null': 'isnotnull', 'is not empty': 'isnotempty'
4705
4744
  };
4745
+ if (sqlLocale) {
4746
+ var localeOperator = Object.keys(this.sqlOperators);
4747
+ for (var i = 0; i < localeOperator.length; i++) {
4748
+ if (this.sqlOperators[localeOperator[i]] === operator.toUpperCase()) {
4749
+ if (value && value.indexOf('%') === 0 && value[value.length - 1] === '%') {
4750
+ return (localeOperator[i] === 'notcontains') ? 'notcontains' : 'contains';
4751
+ }
4752
+ else if (value && value.indexOf('%') !== 0 && value.indexOf('%') === value.length - 1) {
4753
+ return (localeOperator[i] === 'notstartswith') ? 'notstartswith' : 'startswith';
4754
+ }
4755
+ else if (value && value.indexOf('%') === 0 && value.indexOf('%') !== value.length - 1) {
4756
+ return (localeOperator[i] === 'notendswith') ? 'notendswith' : 'endswith';
4757
+ }
4758
+ return localeOperator[i];
4759
+ }
4760
+ }
4761
+ return null;
4762
+ }
4706
4763
  if (value) {
4707
4764
  if (value.indexOf('%') === 0 && value[value.length - 1] === '%') {
4708
4765
  return (operator === 'not like') ? 'notcontains' : 'contains';
@@ -4726,7 +4783,10 @@ var QueryBuilder = /** @class */ (function (_super) {
4726
4783
  };
4727
4784
  QueryBuilder.prototype.getTypeFromColumn = function (rules) {
4728
4785
  var columnData = this.getColumn(rules.field);
4729
- return columnData.type;
4786
+ if (!isNullOrUndefined(columnData)) {
4787
+ return columnData.type;
4788
+ }
4789
+ return null;
4730
4790
  };
4731
4791
  QueryBuilder.prototype.getLabelFromColumn = function (field) {
4732
4792
  var label = '';
@@ -4759,7 +4819,7 @@ var QueryBuilder = /** @class */ (function (_super) {
4759
4819
  }
4760
4820
  return this.getColumn(fieldName).label;
4761
4821
  };
4762
- QueryBuilder.prototype.processParser = function (parser, rules, levelColl) {
4822
+ QueryBuilder.prototype.processParser = function (parser, rules, levelColl, sqlLocale) {
4763
4823
  var j;
4764
4824
  var jLen;
4765
4825
  var rule;
@@ -4778,18 +4838,27 @@ var QueryBuilder = /** @class */ (function (_super) {
4778
4838
  rule = { label: parser[i][1], field: parser[i][1] };
4779
4839
  if (parser[i + 1][0] === 'SubOperators') {
4780
4840
  if (parser[i + 1][1].indexOf('null') > -1 || parser[i + 1][1].indexOf('empty') > -1) {
4781
- rule.operator = this.getOperator(' ', parser[i + 1][1]);
4841
+ rule.operator = this.getOperator(' ', parser[i + 1][1], sqlLocale);
4782
4842
  rule.value = null;
4783
4843
  rule.type = this.getTypeFromColumn(rule);
4784
4844
  }
4785
4845
  else {
4786
4846
  var oper = parser[i + 3][1] ? parser[i + 3][1].replace(/'/g, '') : parser[i + 3][1];
4787
- rule.operator = this.getOperator(oper, parser[i + 1][1]);
4847
+ rule.operator = this.getOperator(oper, parser[i + 1][1], sqlLocale);
4788
4848
  }
4789
4849
  operator = parser[i + 1][1];
4790
4850
  i++;
4791
4851
  j = i + 1;
4792
4852
  jLen = iLen;
4853
+ if (sqlLocale && rule.operator === 'contains' || rule.operator === 'startswith' || rule.operator === 'endswith') {
4854
+ operator = 'like';
4855
+ }
4856
+ else if (sqlLocale && rule.operator === 'notcontains' || rule.operator === 'notstartswith' || rule.operator === 'notendswith') {
4857
+ operator = 'not like';
4858
+ }
4859
+ else if (sqlLocale) {
4860
+ operator = rule.operator;
4861
+ }
4793
4862
  for (j = i + 1; j < jLen; j++) {
4794
4863
  if (operator.indexOf('between') < 0 && parser[j][0] === 'Left') {
4795
4864
  isLeftOpened = true;
@@ -4855,7 +4924,7 @@ var QueryBuilder = /** @class */ (function (_super) {
4855
4924
  }
4856
4925
  }
4857
4926
  else if (parser[i + 1][0] === 'Operators') {
4858
- rule.operator = this.getOperator(parser[i + 2][1], parser[i + 1][1]);
4927
+ rule.operator = this.getOperator(parser[i + 2][1], parser[i + 1][1], sqlLocale);
4859
4928
  if (parser[i + 2][0] === 'Number') {
4860
4929
  rule.type = 'number';
4861
4930
  rule.value = Number(parser[i + 2][1]);
@@ -4869,7 +4938,7 @@ var QueryBuilder = /** @class */ (function (_super) {
4869
4938
  rules.rules.push(rule);
4870
4939
  }
4871
4940
  else if (parser[i][0] === 'Left') {
4872
- if (!(parser[0][0] === 'Left') && parser[i - 1][1] === 'not') {
4941
+ if (!(parser[0][0] === 'Left') && (parser[i - 1][1] === 'not' || sqlLocale && this.l10n.getConstant('NOT').toLowerCase() === parser[i - 1][1])) {
4873
4942
  continue;
4874
4943
  }
4875
4944
  this.parser = parser.splice(i + 1, iLen - (i + 1));
@@ -4888,11 +4957,11 @@ var QueryBuilder = /** @class */ (function (_super) {
4888
4957
  }
4889
4958
  levelColl.push(grpCount);
4890
4959
  rules.rules.push(subRules);
4891
- subRules = this.processParser(this.parser, subRules, levelColl);
4960
+ subRules = this.processParser(this.parser, subRules, levelColl, sqlLocale);
4892
4961
  return rules;
4893
4962
  }
4894
4963
  else if (parser[i][0] === 'Conditions') {
4895
- if (parser[i][1] === 'not') {
4964
+ if (parser[i][1] === 'not' || (sqlLocale && this.l10n.getConstant('NOT').toLowerCase() === parser[i][1])) {
4896
4965
  rules.not = true;
4897
4966
  }
4898
4967
  else {
@@ -4907,7 +4976,7 @@ var QueryBuilder = /** @class */ (function (_super) {
4907
4976
  for (l = 0; l < lLen; l++) {
4908
4977
  rules = this.findGroupByIdx(levelColl[l], rules, l === 0);
4909
4978
  }
4910
- return this.processParser(this.parser, rules, levelColl);
4979
+ return this.processParser(this.parser, rules, levelColl, sqlLocale);
4911
4980
  }
4912
4981
  }
4913
4982
  return rules;