@syncfusion/ej2-querybuilder 20.4.42 → 20.4.51
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 +9 -0
- package/GitLeaksReport.json +1 -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 +55 -16
- package/dist/es6/ej2-querybuilder.es2015.js.map +1 -1
- package/dist/es6/ej2-querybuilder.es5.js +55 -16
- 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/gitleaks-ci/gitleaks +0 -0
- package/gitleaks-ci.tar.gz +0 -0
- package/package.json +11 -11
- package/src/query-builder/query-builder.d.ts +11 -7
- package/src/query-builder/query-builder.js +55 -16
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 20.4.
|
|
3
|
+
* version : 20.4.51
|
|
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
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_from": "@syncfusion/ej2-querybuilder@*",
|
|
3
|
-
"_id": "@syncfusion/ej2-querybuilder@20.4.
|
|
3
|
+
"_id": "@syncfusion/ej2-querybuilder@20.4.48",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-qWJWOApO7573wprIyfY7C3rnOQsn0zVMDh4Xq7EKfXHbTuLRptkId1cDXnDmSa0a72zpyL053qdcfWTQ72RcEQ==",
|
|
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-20.4.
|
|
27
|
-
"_shasum": "
|
|
26
|
+
"_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-querybuilder/-/ej2-querybuilder-20.4.48.tgz",
|
|
27
|
+
"_shasum": "465c895c7a2a7333c23ac6fc2402a474e26f64d9",
|
|
28
28
|
"_spec": "@syncfusion/ej2-querybuilder@*",
|
|
29
29
|
"_where": "/jenkins/workspace/ease-automation_release_19.1.0.1/packages/included",
|
|
30
30
|
"author": {
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
},
|
|
33
33
|
"bundleDependencies": false,
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@syncfusion/ej2-base": "~20.4.
|
|
36
|
-
"@syncfusion/ej2-buttons": "~20.4.
|
|
37
|
-
"@syncfusion/ej2-calendars": "~20.4.
|
|
38
|
-
"@syncfusion/ej2-dropdowns": "~20.4.
|
|
39
|
-
"@syncfusion/ej2-inputs": "~20.4.
|
|
40
|
-
"@syncfusion/ej2-splitbuttons": "~20.4.
|
|
35
|
+
"@syncfusion/ej2-base": "~20.4.51",
|
|
36
|
+
"@syncfusion/ej2-buttons": "~20.4.50",
|
|
37
|
+
"@syncfusion/ej2-calendars": "~20.4.51",
|
|
38
|
+
"@syncfusion/ej2-dropdowns": "~20.4.51",
|
|
39
|
+
"@syncfusion/ej2-inputs": "~20.4.51",
|
|
40
|
+
"@syncfusion/ej2-splitbuttons": "~20.4.50"
|
|
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": "20.4.
|
|
69
|
+
"version": "20.4.51",
|
|
70
70
|
"sideEffects": false,
|
|
71
71
|
"homepage": "https://www.syncfusion.com/javascript-ui-controls"
|
|
72
72
|
}
|
|
@@ -218,6 +218,8 @@ export interface FormatObject {
|
|
|
218
218
|
}
|
|
219
219
|
/**
|
|
220
220
|
* Specifies the fieldMode as DropDownList or DropDownTree.
|
|
221
|
+
* Default: To Specifies the fieldMode as DropDownList.
|
|
222
|
+
* DropdownTree: To Specifies the fieldMode as DropdownTree.
|
|
221
223
|
*/
|
|
222
224
|
export declare type FieldMode =
|
|
223
225
|
/** Display the DropdownList */
|
|
@@ -226,6 +228,8 @@ export declare type FieldMode =
|
|
|
226
228
|
'DropdownTree';
|
|
227
229
|
/**
|
|
228
230
|
* Specifies the displayMode as Horizontal or Vertical.
|
|
231
|
+
* Horizontal: To Display the Horizontal UI.
|
|
232
|
+
* Vertical: To Display the Vertical UI.
|
|
229
233
|
*/
|
|
230
234
|
export declare type DisplayMode =
|
|
231
235
|
/** Display the Horizontal UI */
|
|
@@ -234,9 +238,9 @@ export declare type DisplayMode =
|
|
|
234
238
|
'Vertical';
|
|
235
239
|
/**
|
|
236
240
|
* Specifies the sort direction of the field names. They are
|
|
237
|
-
*
|
|
238
|
-
*
|
|
239
|
-
*
|
|
241
|
+
* Default: Show the field names in default .
|
|
242
|
+
* Ascending: Show the field names in Ascending.
|
|
243
|
+
* Descending: Show the field names in Descending
|
|
240
244
|
*/
|
|
241
245
|
export declare type SortDirection =
|
|
242
246
|
/** Show the field names in default */
|
|
@@ -515,7 +519,7 @@ export declare class QueryBuilder extends Component<HTMLDivElement> implements I
|
|
|
515
519
|
private addGroupSuccess;
|
|
516
520
|
private headerTemplateFn;
|
|
517
521
|
/**
|
|
518
|
-
*
|
|
522
|
+
* Notify the changes to component.
|
|
519
523
|
*
|
|
520
524
|
* @param {string | number | boolean | Date | string[] | number[] | Date[]} value - 'value' to be passed to update the rule value.
|
|
521
525
|
* @param {Element} element - 'element' to be passed to update the rule.
|
|
@@ -541,7 +545,7 @@ export declare class QueryBuilder extends Component<HTMLDivElement> implements I
|
|
|
541
545
|
private destroyControls;
|
|
542
546
|
private templateDestroy;
|
|
543
547
|
/**
|
|
544
|
-
*
|
|
548
|
+
* Return values bound to the column.
|
|
545
549
|
*
|
|
546
550
|
* @param {string} field - 'field' to be passed to get the field values.
|
|
547
551
|
* @returns {object[]} - Values bound to the column
|
|
@@ -674,7 +678,7 @@ export declare class QueryBuilder extends Component<HTMLDivElement> implements I
|
|
|
674
678
|
*/
|
|
675
679
|
deleteGroups(groupIdColl: string[]): void;
|
|
676
680
|
/**
|
|
677
|
-
*
|
|
681
|
+
* Return the Query from current rules collection.
|
|
678
682
|
*
|
|
679
683
|
* @returns {Promise} - Query from current rules collection
|
|
680
684
|
* @blazorType object
|
|
@@ -704,7 +708,7 @@ export declare class QueryBuilder extends Component<HTMLDivElement> implements I
|
|
|
704
708
|
private getLocale;
|
|
705
709
|
private getColumn;
|
|
706
710
|
/**
|
|
707
|
-
*
|
|
711
|
+
* Return the operator bound to the column.
|
|
708
712
|
*
|
|
709
713
|
* @returns {[key: string]: Object}[] - Operator bound to the column
|
|
710
714
|
*/
|
|
@@ -673,7 +673,13 @@ var QueryBuilder = /** @class */ (function (_super) {
|
|
|
673
673
|
if (!column || (column && !column.ruleTemplate) || !rule.field) {
|
|
674
674
|
if (this.fieldMode === 'Default') {
|
|
675
675
|
var ddlField = void 0;
|
|
676
|
-
var ddlValue =
|
|
676
|
+
var ddlValue = void 0;
|
|
677
|
+
if (this.separator && rule.field) {
|
|
678
|
+
ddlValue = this.GetRootColumnName(rule.field);
|
|
679
|
+
}
|
|
680
|
+
else {
|
|
681
|
+
ddlValue = this.isImportRules ? this.GetRootColumnName(rule.field) : rule.field;
|
|
682
|
+
}
|
|
677
683
|
ddlField = {
|
|
678
684
|
dataSource: this.columns,
|
|
679
685
|
fields: this.fields, placeholder: this.l10n.getConstant('SelectField'),
|
|
@@ -685,8 +691,13 @@ var QueryBuilder = /** @class */ (function (_super) {
|
|
|
685
691
|
}
|
|
686
692
|
dropDownList = new DropDownList(ddlField);
|
|
687
693
|
dropDownList.appendTo('#' + ruleElem.id + '_filterkey');
|
|
688
|
-
var ddlVal =
|
|
689
|
-
|
|
694
|
+
var ddlVal = void 0;
|
|
695
|
+
if (this.separator && rule.field) {
|
|
696
|
+
ddlVal = this.GetRootColumnName(rule.field);
|
|
697
|
+
}
|
|
698
|
+
else {
|
|
699
|
+
ddlVal = this.isImportRules ? this.GetRootColumnName(rule.field) : dropDownList.value;
|
|
700
|
+
}
|
|
690
701
|
this.selectedColumn = dropDownList.getDataByValue(ddlVal);
|
|
691
702
|
if (Object.keys(rule).length) {
|
|
692
703
|
this.changeRule(rule, {
|
|
@@ -702,7 +713,7 @@ var QueryBuilder = /** @class */ (function (_super) {
|
|
|
702
713
|
value: 'field', text: 'label', child: 'columns', expanded: 'expanded' },
|
|
703
714
|
placeholder: this.l10n.getConstant('SelectField'), showClearButton: false,
|
|
704
715
|
popupHeight: ((this.columns.length > 5) ? height : 'auto'), changeOnBlur: false,
|
|
705
|
-
change: this.changeField.bind(this), value:
|
|
716
|
+
change: this.changeField.bind(this), value: !isNullOrUndefined(ddlValue) ? [ddlValue] : null,
|
|
706
717
|
open: this.popupOpen.bind(this, false)
|
|
707
718
|
};
|
|
708
719
|
if (this.fieldModel) {
|
|
@@ -715,7 +726,7 @@ var QueryBuilder = /** @class */ (function (_super) {
|
|
|
715
726
|
dropdowntree.element.value = value;
|
|
716
727
|
}
|
|
717
728
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
718
|
-
var ddlVal =
|
|
729
|
+
var ddlVal = !isNullOrUndefined(rule.field) ?
|
|
719
730
|
this.GetRootColumnName(rule.field) : dropdowntree.value;
|
|
720
731
|
this.selectedColumn = this.getColumn(ddlVal);
|
|
721
732
|
if (Object.keys(rule).length) {
|
|
@@ -792,7 +803,6 @@ var QueryBuilder = /** @class */ (function (_super) {
|
|
|
792
803
|
var tooltip = new Tooltip({ content: this.l10n.getConstant('ValidationMessage'),
|
|
793
804
|
position: 'BottomCenter', cssClass: 'e-querybuilder-error' });
|
|
794
805
|
tooltip.appendTo(element);
|
|
795
|
-
// eslint-disable-next-line
|
|
796
806
|
tooltip.open(element);
|
|
797
807
|
};
|
|
798
808
|
/**
|
|
@@ -1130,7 +1140,7 @@ var QueryBuilder = /** @class */ (function (_super) {
|
|
|
1130
1140
|
return groupElem;
|
|
1131
1141
|
};
|
|
1132
1142
|
/**
|
|
1133
|
-
*
|
|
1143
|
+
* Notify the changes to component.
|
|
1134
1144
|
*
|
|
1135
1145
|
* @param {string | number | boolean | Date | string[] | number[] | Date[]} value - 'value' to be passed to update the rule value.
|
|
1136
1146
|
* @param {Element} element - 'element' to be passed to update the rule.
|
|
@@ -1410,6 +1420,9 @@ var QueryBuilder = /** @class */ (function (_super) {
|
|
|
1410
1420
|
if (column && column.ruleTemplate) {
|
|
1411
1421
|
this.templateChange(args.element, column.field, 'field');
|
|
1412
1422
|
}
|
|
1423
|
+
else if (column && column.columns && column.columns[0].ruleTemplate) {
|
|
1424
|
+
this.templateChange(args.element, column.columns[0].field, 'field');
|
|
1425
|
+
}
|
|
1413
1426
|
else {
|
|
1414
1427
|
var groupElem = closest(args.element, '.e-group-container');
|
|
1415
1428
|
var rules = this.getParentGroup(groupElem);
|
|
@@ -1565,7 +1578,8 @@ var QueryBuilder = /** @class */ (function (_super) {
|
|
|
1565
1578
|
}
|
|
1566
1579
|
var dropDownList = new DropDownList(ddlField);
|
|
1567
1580
|
dropDownList.appendTo('#' + ruleId + '_subfilterkey' + this.subFilterCounter);
|
|
1568
|
-
if (this.isImportRules
|
|
1581
|
+
if (this.isImportRules || (this.previousColumn && this.previousColumn.ruleTemplate &&
|
|
1582
|
+
this.GetRootColumnName(rule.field) === this.GetRootColumnName(this.previousColumn.field))) {
|
|
1569
1583
|
var subField = this.selectedColumn.columns;
|
|
1570
1584
|
for (var i = 0; i < subField.length; i++) {
|
|
1571
1585
|
if (rule.field === subField[i].field || rule.field.indexOf(subField[i].field) > -1) {
|
|
@@ -1580,12 +1594,13 @@ var QueryBuilder = /** @class */ (function (_super) {
|
|
|
1580
1594
|
this.subFieldElem = subFieldElem;
|
|
1581
1595
|
// eslint-disable-next-line
|
|
1582
1596
|
ddlArgs.itemData = ddlArgs.itemData;
|
|
1583
|
-
if (!
|
|
1597
|
+
if (!subFieldValue && this.selectedColumn.columns) {
|
|
1584
1598
|
if (!subFieldValue && this.isImportRules) {
|
|
1585
1599
|
dropDownList.value = null;
|
|
1586
1600
|
}
|
|
1587
1601
|
this.selectedColumn = this.selectedColumn.columns[0];
|
|
1588
1602
|
}
|
|
1603
|
+
this.previousColumn = this.selectedColumn;
|
|
1589
1604
|
if (!this.selectedColumn.columns) {
|
|
1590
1605
|
this.changeRuleValues(tempElem, rule, tempRule, ddlArgs);
|
|
1591
1606
|
}
|
|
@@ -1797,7 +1812,7 @@ var QueryBuilder = /** @class */ (function (_super) {
|
|
|
1797
1812
|
}
|
|
1798
1813
|
};
|
|
1799
1814
|
/**
|
|
1800
|
-
*
|
|
1815
|
+
* Return values bound to the column.
|
|
1801
1816
|
*
|
|
1802
1817
|
* @param {string} field - 'field' to be passed to get the field values.
|
|
1803
1818
|
* @returns {object[]} - Values bound to the column
|
|
@@ -3859,7 +3874,7 @@ var QueryBuilder = /** @class */ (function (_super) {
|
|
|
3859
3874
|
}
|
|
3860
3875
|
};
|
|
3861
3876
|
/**
|
|
3862
|
-
*
|
|
3877
|
+
* Return the Query from current rules collection.
|
|
3863
3878
|
*
|
|
3864
3879
|
* @returns {Promise} - Query from current rules collection
|
|
3865
3880
|
* @blazorType object
|
|
@@ -4059,7 +4074,7 @@ var QueryBuilder = /** @class */ (function (_super) {
|
|
|
4059
4074
|
};
|
|
4060
4075
|
/* eslint-disable */
|
|
4061
4076
|
/**
|
|
4062
|
-
*
|
|
4077
|
+
* Return the operator bound to the column.
|
|
4063
4078
|
*
|
|
4064
4079
|
* @returns {[key: string]: Object}[] - Operator bound to the column
|
|
4065
4080
|
*/
|
|
@@ -4707,10 +4722,22 @@ var QueryBuilder = /** @class */ (function (_super) {
|
|
|
4707
4722
|
if (/^'((?:[^\\']+?|\\.|'')*)'(?!')/.exec(sqlString)) {
|
|
4708
4723
|
// eslint-disable-next-line
|
|
4709
4724
|
matchValue = /^'((?:[^\\']+?|\\.|'')*)'(?!')/.exec(sqlString)[0];
|
|
4725
|
+
if (matchValue[matchValue.length - 2] === '(') {
|
|
4726
|
+
var isClosed = false;
|
|
4727
|
+
for (var j = matchValue.length; j < sqlString.length; j++) {
|
|
4728
|
+
matchValue += sqlString[j];
|
|
4729
|
+
if (sqlString[j] === ')') {
|
|
4730
|
+
isClosed = true;
|
|
4731
|
+
}
|
|
4732
|
+
if (isClosed && sqlString[j] === "'") {
|
|
4733
|
+
break;
|
|
4734
|
+
}
|
|
4735
|
+
}
|
|
4736
|
+
}
|
|
4710
4737
|
this.parser.push(['String', matchValue]);
|
|
4711
4738
|
return matchValue.length;
|
|
4712
4739
|
}
|
|
4713
|
-
//Double String
|
|
4740
|
+
// Double String
|
|
4714
4741
|
// eslint-disable-next-line
|
|
4715
4742
|
if (/^"([^\\"]*(?:\\.[^\\"]*)*)"/.exec(sqlString)) {
|
|
4716
4743
|
// eslint-disable-next-line
|
|
@@ -4907,7 +4934,11 @@ var QueryBuilder = /** @class */ (function (_super) {
|
|
|
4907
4934
|
break;
|
|
4908
4935
|
}
|
|
4909
4936
|
if (operator.indexOf('like') > -1 && parser[j][0] === 'String') {
|
|
4910
|
-
var val = parser[j][1]
|
|
4937
|
+
var val = parser[j][1];
|
|
4938
|
+
if (parser[j][1] && parser[j][1][0] === "'") {
|
|
4939
|
+
val = parser[j][1].substring(1, parser[j][1].length - 1);
|
|
4940
|
+
}
|
|
4941
|
+
val = val ? val.replace(/%/g, '') : parser[j][1];
|
|
4911
4942
|
rule.value = val;
|
|
4912
4943
|
rule.type = 'string';
|
|
4913
4944
|
}
|
|
@@ -4919,7 +4950,11 @@ var QueryBuilder = /** @class */ (function (_super) {
|
|
|
4919
4950
|
numVal.push(Number(parser[j][1]));
|
|
4920
4951
|
}
|
|
4921
4952
|
else if (parser[j][0] === 'String') {
|
|
4922
|
-
|
|
4953
|
+
var val = parser[j][1];
|
|
4954
|
+
if (parser[j][1] && parser[j][1][0] === "'") {
|
|
4955
|
+
val = parser[j][1].substring(1, parser[j][1].length - 1);
|
|
4956
|
+
}
|
|
4957
|
+
strVal.push(val);
|
|
4923
4958
|
}
|
|
4924
4959
|
}
|
|
4925
4960
|
else {
|
|
@@ -4927,7 +4962,11 @@ var QueryBuilder = /** @class */ (function (_super) {
|
|
|
4927
4962
|
numVal.push(Number(parser[j][1]));
|
|
4928
4963
|
}
|
|
4929
4964
|
else if (parser[j][0] === 'String') {
|
|
4930
|
-
|
|
4965
|
+
var val = parser[j][1];
|
|
4966
|
+
if (parser[j][1] && parser[j][1][0] === "'") {
|
|
4967
|
+
val = parser[j][1].substring(1, parser[j][1].length - 1);
|
|
4968
|
+
}
|
|
4969
|
+
strVal.push(val);
|
|
4931
4970
|
}
|
|
4932
4971
|
}
|
|
4933
4972
|
rule.type = this.getTypeFromColumn(rule);
|