@syncfusion/ej2-querybuilder 22.1.34 → 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.
- package/CHANGELOG.md +8 -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 +24 -9
- package/dist/es6/ej2-querybuilder.es2015.js.map +1 -1
- package/dist/es6/ej2-querybuilder.es5.js +24 -9
- 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 +9 -9
- package/src/query-builder/query-builder.d.ts +1 -0
- package/src/query-builder/query-builder.js +24 -9
- package/styles/bootstrap-dark.css +1 -1
- package/styles/bootstrap.css +1 -1
- package/styles/bootstrap4.css +1 -1
- package/styles/bootstrap5-dark.css +1 -1
- package/styles/bootstrap5.css +1 -1
- package/styles/fluent-dark.css +1 -1
- package/styles/fluent.css +1 -1
- package/styles/material-dark.css +1 -1
- package/styles/material.css +1 -1
- package/styles/material3-dark.css +28 -22
- package/styles/material3.css +28 -22
- package/styles/query-builder/_layout.scss +13 -11
- package/styles/query-builder/bootstrap-dark.css +1 -1
- package/styles/query-builder/bootstrap.css +1 -1
- package/styles/query-builder/bootstrap4.css +1 -1
- package/styles/query-builder/bootstrap5-dark.css +1 -1
- package/styles/query-builder/bootstrap5.css +1 -1
- package/styles/query-builder/fluent-dark.css +1 -1
- package/styles/query-builder/fluent.css +1 -1
- package/styles/query-builder/material-dark.css +1 -1
- package/styles/query-builder/material.css +1 -1
- package/styles/query-builder/material3-dark.css +28 -22
- package/styles/query-builder/material3.css +28 -22
- package/styles/query-builder/tailwind-dark.css +1 -1
- package/styles/query-builder/tailwind.css +1 -1
- package/styles/tailwind-dark.css +1 -1
- package/styles/tailwind.css +1 -1
|
@@ -961,17 +961,24 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
961
961
|
if (!args.cancel && (this.element.querySelectorAll('.e-group-container').length <= this.maxGroupCount)) {
|
|
962
962
|
const target = eventTarget;
|
|
963
963
|
let dltGroupBtn;
|
|
964
|
+
let groupID = '';
|
|
965
|
+
if (target.className.indexOf('e-group-container') < 0) {
|
|
966
|
+
groupID = target.querySelector('.e-group-container') && target.querySelector('.e-group-container').id;
|
|
967
|
+
}
|
|
968
|
+
else {
|
|
969
|
+
groupID = target.id;
|
|
970
|
+
}
|
|
964
971
|
const groupElem = this.groupElem.cloneNode(true);
|
|
965
972
|
groupElem.setAttribute('id', this.element.id + '_group' + this.groupIdCounter);
|
|
966
973
|
if (this.headerTemplate) {
|
|
967
974
|
if (isRoot) {
|
|
968
975
|
isGroup = false;
|
|
969
976
|
groupElem.setAttribute('id', this.element.id + '_group0');
|
|
970
|
-
this.headerTemplateFn(groupElem, not, condition, rule);
|
|
977
|
+
this.headerTemplateFn(groupElem, not, condition, rule, groupID);
|
|
971
978
|
this.groupIdCounter = 0;
|
|
972
979
|
}
|
|
973
980
|
else {
|
|
974
|
-
this.headerTemplateFn(groupElem, not, condition, rule);
|
|
981
|
+
this.headerTemplateFn(groupElem, not, condition, rule, groupID);
|
|
975
982
|
}
|
|
976
983
|
}
|
|
977
984
|
this.groupIdCounter++;
|
|
@@ -1065,14 +1072,14 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1065
1072
|
}
|
|
1066
1073
|
}
|
|
1067
1074
|
}
|
|
1068
|
-
headerTemplateFn(groupElem, not, condition, rule) {
|
|
1075
|
+
headerTemplateFn(groupElem, not, condition, rule, groupID) {
|
|
1069
1076
|
let template;
|
|
1070
1077
|
const templateID = this.element.id + '_header';
|
|
1071
1078
|
let args;
|
|
1072
1079
|
const groupHdr = groupElem.querySelector('.e-group-header');
|
|
1073
1080
|
if (this.headerTemplate) {
|
|
1074
1081
|
args = { requestType: 'header-template-initialize', ruleID: groupElem.id,
|
|
1075
|
-
notCondition: this.enableNotCondition ? not : undefined, condition: condition, rule: this.getRuleCollection(rule, true) };
|
|
1082
|
+
notCondition: this.enableNotCondition ? not : undefined, condition: condition, rule: this.getRuleCollection(rule, true), groupID: groupID };
|
|
1076
1083
|
this.trigger('actionBegin', args);
|
|
1077
1084
|
this.headerFn = this.templateParser(this.headerTemplate);
|
|
1078
1085
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -3684,7 +3691,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3684
3691
|
rule.value = null;
|
|
3685
3692
|
}
|
|
3686
3693
|
}
|
|
3687
|
-
if ((this.isRefreshed && this.enablePersistence) || (
|
|
3694
|
+
if ((this.isRefreshed && this.enablePersistence) || (rule.field !== '' && rule.operator !== '' && (rule.value !== '' &&
|
|
3688
3695
|
rule.value !== undefined)) || (customObj && customObj.isQuestion)) {
|
|
3689
3696
|
const condition = rule.condition;
|
|
3690
3697
|
rule = {
|
|
@@ -3724,6 +3731,10 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3724
3731
|
else {
|
|
3725
3732
|
rule = { 'condition': rule.condition, 'rules': rule.rules };
|
|
3726
3733
|
}
|
|
3734
|
+
if (customObj) {
|
|
3735
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3736
|
+
rule.custom = customObj;
|
|
3737
|
+
}
|
|
3727
3738
|
if (rule.rules.length === 0) {
|
|
3728
3739
|
rule = {};
|
|
3729
3740
|
}
|
|
@@ -4497,8 +4508,11 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
4497
4508
|
}
|
|
4498
4509
|
}
|
|
4499
4510
|
if (j !== jLen - 1) {
|
|
4500
|
-
|
|
4501
|
-
|
|
4511
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4512
|
+
const rule = rules.rules[j];
|
|
4513
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4514
|
+
if (condition === '' || (rule && rule.condition !== '' && rule.custom && rule.custom.isCustom)) {
|
|
4515
|
+
condition = rule.condition;
|
|
4502
4516
|
}
|
|
4503
4517
|
condition = sqlLocale ? this.l10n.getConstant(condition.toUpperCase()).toUpperCase() : condition.toUpperCase();
|
|
4504
4518
|
queryStr += ' ' + condition + ' ';
|
|
@@ -4646,7 +4660,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
4646
4660
|
// eslint-disable-next-line
|
|
4647
4661
|
if (/^`?([a-z_][a-z0-9_.\[\]\(\)]{0,}(\:(number|float|string|date|boolean))?)`?/i.exec(sqlString)) {
|
|
4648
4662
|
// eslint-disable-next-line
|
|
4649
|
-
matchValue = /^`?([a-
|
|
4663
|
+
matchValue = /^`?([a-zåäö_][a-z0-9åäö_.\[\]\(\)]{0,}(\:(number|float|string|date|boolean))?)`?/i.exec(sqlString)[1];
|
|
4650
4664
|
this.parser.push(['Literal', matchValue]);
|
|
4651
4665
|
return matchValue.length;
|
|
4652
4666
|
}
|
|
@@ -4842,7 +4856,8 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
4842
4856
|
let isLeftOpened = false;
|
|
4843
4857
|
for (let i = 0, iLen = parser.length; i < iLen; i++) {
|
|
4844
4858
|
if (parser[i][0] === 'Literal') {
|
|
4845
|
-
|
|
4859
|
+
const column = this.getColumn(parser[i][1]);
|
|
4860
|
+
rule = { label: (column && column.label) ? column.label : parser[i][1], field: parser[i][1] };
|
|
4846
4861
|
if (parser[i + 1][0] === 'SubOperators') {
|
|
4847
4862
|
if (parser[i + 1][1].indexOf('null') > -1 || parser[i + 1][1].indexOf('empty') > -1) {
|
|
4848
4863
|
rule.operator = this.getOperator(' ', parser[i + 1][1], sqlLocale);
|