@syncfusion/ej2-querybuilder 25.1.42 → 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.
- package/CHANGELOG.md +23 -0
- package/dist/ej2-querybuilder.min.js +2 -2
- package/dist/ej2-querybuilder.umd.min.js +2 -2
- package/dist/ej2-querybuilder.umd.min.js.map +1 -1
- package/dist/es6/ej2-querybuilder.es2015.js +72 -2
- package/dist/es6/ej2-querybuilder.es2015.js.map +1 -1
- package/dist/es6/ej2-querybuilder.es5.js +72 -2
- package/dist/es6/ej2-querybuilder.es5.js.map +1 -1
- package/dist/global/ej2-querybuilder.min.js +2 -2
- package/dist/global/ej2-querybuilder.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +11 -11
- package/src/query-builder/query-builder.d.ts +4 -0
- package/src/query-builder/query-builder.js +72 -2
|
@@ -1440,12 +1440,22 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1440
1440
|
changeValue(i, args) {
|
|
1441
1441
|
let element;
|
|
1442
1442
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1443
|
+
if (this.isNumInput && typeof args.value === 'number') {
|
|
1444
|
+
this.isNumInput = false;
|
|
1445
|
+
return;
|
|
1446
|
+
}
|
|
1447
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1443
1448
|
if (args.element && args.element.classList.contains('e-multiselect')) {
|
|
1444
1449
|
const multiSelectArgs = args;
|
|
1445
1450
|
element = multiSelectArgs.element;
|
|
1446
1451
|
}
|
|
1447
1452
|
else if (args.event) {
|
|
1448
1453
|
element = args.event.target;
|
|
1454
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1455
|
+
}
|
|
1456
|
+
else if (args.type === 'input' && args.currentTarget) {
|
|
1457
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1458
|
+
element = args.currentTarget;
|
|
1449
1459
|
}
|
|
1450
1460
|
else {
|
|
1451
1461
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -1502,6 +1512,14 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1502
1512
|
}
|
|
1503
1513
|
else {
|
|
1504
1514
|
value = args.value;
|
|
1515
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1516
|
+
if (args.type === 'input' && args.currentTarget) {
|
|
1517
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1518
|
+
value = Number(args.currentTarget.value);
|
|
1519
|
+
const numericTextBoxObj = getInstance(args.currentTarget, NumericTextBox);
|
|
1520
|
+
numericTextBoxObj.value = value;
|
|
1521
|
+
this.isNumInput = true;
|
|
1522
|
+
}
|
|
1505
1523
|
}
|
|
1506
1524
|
if (args.name === 'input' && this.immediateModeDelay) {
|
|
1507
1525
|
window.clearInterval(this.timer);
|
|
@@ -2343,6 +2361,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
2343
2361
|
const numeric = new NumericTextBox(numericTxt);
|
|
2344
2362
|
numeric.appendTo('#' + parentId + '_valuekey' + idx);
|
|
2345
2363
|
numeric.element.setAttribute('aria-label', itemData.label + ' ' + 'Value');
|
|
2364
|
+
numeric.element.oninput = this.changeValue.bind(this, idx);
|
|
2346
2365
|
}
|
|
2347
2366
|
}
|
|
2348
2367
|
processValueString(value, type) {
|
|
@@ -3154,7 +3173,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3154
3173
|
if (this.portals && this.portals.length) {
|
|
3155
3174
|
this.clearQBTemplate();
|
|
3156
3175
|
}
|
|
3157
|
-
popupElement = document.querySelectorAll('.qb-dropdownlist');
|
|
3176
|
+
popupElement = document.querySelectorAll('.qb-dropdownlist.e-popup');
|
|
3158
3177
|
if (popupElement) {
|
|
3159
3178
|
for (i = 0; i < popupElement.length; i++) {
|
|
3160
3179
|
popupElement[i].remove();
|
|
@@ -5238,6 +5257,11 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5238
5257
|
}
|
|
5239
5258
|
}
|
|
5240
5259
|
}
|
|
5260
|
+
else if (sqlString[matchValue.length] && (sqlString[matchValue.length] !== ')') &&
|
|
5261
|
+
!this.checkCondition(sqlString, matchValue)) {
|
|
5262
|
+
matchValue = this.getSingleQuoteString(sqlString, matchValue);
|
|
5263
|
+
}
|
|
5264
|
+
// end
|
|
5241
5265
|
this.parser.push(['String', matchValue]);
|
|
5242
5266
|
return matchValue.length;
|
|
5243
5267
|
}
|
|
@@ -5267,6 +5291,27 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5267
5291
|
}
|
|
5268
5292
|
return 1;
|
|
5269
5293
|
}
|
|
5294
|
+
checkCondition(sqlString, matchValue) {
|
|
5295
|
+
if (sqlString.slice(matchValue.length + 1, matchValue.length + 4) === 'AND' ||
|
|
5296
|
+
sqlString.slice(matchValue.length + 1, matchValue.length + 3) === 'OR') {
|
|
5297
|
+
return true;
|
|
5298
|
+
}
|
|
5299
|
+
return false;
|
|
5300
|
+
}
|
|
5301
|
+
getSingleQuoteString(sqlString, matchValue) {
|
|
5302
|
+
if (sqlString[matchValue.length] && (sqlString[matchValue.length] !== ')') &&
|
|
5303
|
+
!this.checkCondition(sqlString, matchValue) && sqlString[matchValue.length] !== ',') {
|
|
5304
|
+
const tempStr = sqlString.replace(matchValue, '');
|
|
5305
|
+
// eslint-disable-next-line
|
|
5306
|
+
if (isNullOrUndefined(/^'((?:[^\\']+?|\\.|'')*)'(?!')/.exec(tempStr))) {
|
|
5307
|
+
// eslint-disable-next-line
|
|
5308
|
+
let parsedValue = /^((?:[^\\']+?|\\.|'')*)'(?!')/.exec(tempStr)[0];
|
|
5309
|
+
matchValue += parsedValue;
|
|
5310
|
+
matchValue = this.getSingleQuoteString(sqlString, matchValue);
|
|
5311
|
+
}
|
|
5312
|
+
}
|
|
5313
|
+
return matchValue;
|
|
5314
|
+
}
|
|
5270
5315
|
checkLiteral() {
|
|
5271
5316
|
const lastParser = this.parser[this.parser.length - 1];
|
|
5272
5317
|
if (!lastParser) {
|
|
@@ -5522,7 +5567,11 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5522
5567
|
}
|
|
5523
5568
|
else {
|
|
5524
5569
|
rule.type = 'string';
|
|
5525
|
-
|
|
5570
|
+
let val = parser[i + 2][1];
|
|
5571
|
+
if (val && val[0] === '\'') {
|
|
5572
|
+
val = val.substring(1, val.length - 1);
|
|
5573
|
+
}
|
|
5574
|
+
rule.value = val;
|
|
5526
5575
|
}
|
|
5527
5576
|
rule.type = this.getTypeFromColumn(rule);
|
|
5528
5577
|
}
|
|
@@ -5572,6 +5621,27 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5572
5621
|
}
|
|
5573
5622
|
return rules;
|
|
5574
5623
|
}
|
|
5624
|
+
getValueFromParser(parser, idx) {
|
|
5625
|
+
let value = '';
|
|
5626
|
+
let k;
|
|
5627
|
+
for (k = idx; k < parser.length; k++) {
|
|
5628
|
+
if (parser[k][0] !== 'String' || parser[k][1] === ',' || parser[k][1] === ', ') {
|
|
5629
|
+
break;
|
|
5630
|
+
}
|
|
5631
|
+
else {
|
|
5632
|
+
if (value !== '') {
|
|
5633
|
+
idx += 1;
|
|
5634
|
+
}
|
|
5635
|
+
if (parser[k][1] !== null) {
|
|
5636
|
+
value += parser[k][1];
|
|
5637
|
+
}
|
|
5638
|
+
else {
|
|
5639
|
+
value = null;
|
|
5640
|
+
}
|
|
5641
|
+
}
|
|
5642
|
+
}
|
|
5643
|
+
return { value: value, idx: idx };
|
|
5644
|
+
}
|
|
5575
5645
|
/**
|
|
5576
5646
|
* Clone the Group
|
|
5577
5647
|
*
|