@syncfusion/ej2-querybuilder 22.1.34 → 22.1.38
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 +16 -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 +33 -11
- package/dist/es6/ej2-querybuilder.es2015.js.map +1 -1
- package/dist/es6/ej2-querybuilder.es5.js +33 -11
- 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-model.d.ts +1 -1
- package/src/query-builder/query-builder.d.ts +2 -0
- package/src/query-builder/query-builder.js +33 -11
- 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
|
@@ -720,7 +720,7 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
|
|
|
720
720
|
placeholder: this.l10n.getConstant('SelectField'), showClearButton: false,
|
|
721
721
|
popupHeight: ((this.columns.length > 5) ? height : 'auto'), changeOnBlur: false,
|
|
722
722
|
change: this.changeField.bind(this), value: !isNullOrUndefined(ddlValue) ? [ddlValue] : null,
|
|
723
|
-
open: this.popupOpen.bind(this, false)
|
|
723
|
+
open: this.popupOpen.bind(this, false), treeSettings: { expandOn: 'Click' }, select: this.onSelectField
|
|
724
724
|
};
|
|
725
725
|
if (this.fieldModel) {
|
|
726
726
|
ddlField = __assign({}, ddlField, this.fieldModel);
|
|
@@ -1014,17 +1014,24 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
|
|
|
1014
1014
|
if (!args.cancel && (this.element.querySelectorAll('.e-group-container').length <= this.maxGroupCount)) {
|
|
1015
1015
|
var target = eventTarget;
|
|
1016
1016
|
var dltGroupBtn = void 0;
|
|
1017
|
+
var groupID = '';
|
|
1018
|
+
if (target.className.indexOf('e-group-container') < 0) {
|
|
1019
|
+
groupID = target.querySelector('.e-group-container') && target.querySelector('.e-group-container').id;
|
|
1020
|
+
}
|
|
1021
|
+
else {
|
|
1022
|
+
groupID = target.id;
|
|
1023
|
+
}
|
|
1017
1024
|
var groupElem = this.groupElem.cloneNode(true);
|
|
1018
1025
|
groupElem.setAttribute('id', this.element.id + '_group' + this.groupIdCounter);
|
|
1019
1026
|
if (this.headerTemplate) {
|
|
1020
1027
|
if (isRoot) {
|
|
1021
1028
|
isGroup = false;
|
|
1022
1029
|
groupElem.setAttribute('id', this.element.id + '_group0');
|
|
1023
|
-
this.headerTemplateFn(groupElem, not, condition, rule);
|
|
1030
|
+
this.headerTemplateFn(groupElem, not, condition, rule, groupID);
|
|
1024
1031
|
this.groupIdCounter = 0;
|
|
1025
1032
|
}
|
|
1026
1033
|
else {
|
|
1027
|
-
this.headerTemplateFn(groupElem, not, condition, rule);
|
|
1034
|
+
this.headerTemplateFn(groupElem, not, condition, rule, groupID);
|
|
1028
1035
|
}
|
|
1029
1036
|
}
|
|
1030
1037
|
this.groupIdCounter++;
|
|
@@ -1118,14 +1125,14 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
|
|
|
1118
1125
|
}
|
|
1119
1126
|
}
|
|
1120
1127
|
};
|
|
1121
|
-
QueryBuilder.prototype.headerTemplateFn = function (groupElem, not, condition, rule) {
|
|
1128
|
+
QueryBuilder.prototype.headerTemplateFn = function (groupElem, not, condition, rule, groupID) {
|
|
1122
1129
|
var template;
|
|
1123
1130
|
var templateID = this.element.id + '_header';
|
|
1124
1131
|
var args;
|
|
1125
1132
|
var groupHdr = groupElem.querySelector('.e-group-header');
|
|
1126
1133
|
if (this.headerTemplate) {
|
|
1127
1134
|
args = { requestType: 'header-template-initialize', ruleID: groupElem.id,
|
|
1128
|
-
notCondition: this.enableNotCondition ? not : undefined, condition: condition, rule: this.getRuleCollection(rule, true) };
|
|
1135
|
+
notCondition: this.enableNotCondition ? not : undefined, condition: condition, rule: this.getRuleCollection(rule, true), groupID: groupID };
|
|
1129
1136
|
this.trigger('actionBegin', args);
|
|
1130
1137
|
this.headerFn = this.templateParser(this.headerTemplate);
|
|
1131
1138
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -1387,6 +1394,12 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
|
|
|
1387
1394
|
}
|
|
1388
1395
|
this.isFieldChange = false;
|
|
1389
1396
|
};
|
|
1397
|
+
QueryBuilder.prototype.onSelectField = function (args) {
|
|
1398
|
+
if (args.itemData.hasChildren) {
|
|
1399
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1400
|
+
this.showPopup();
|
|
1401
|
+
}
|
|
1402
|
+
};
|
|
1390
1403
|
QueryBuilder.prototype.changeField = function (args) {
|
|
1391
1404
|
if (args.isInteracted) {
|
|
1392
1405
|
if (isNullOrUndefined(args.value)) {
|
|
@@ -1410,7 +1423,8 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
|
|
|
1410
1423
|
}
|
|
1411
1424
|
else {
|
|
1412
1425
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1413
|
-
|
|
1426
|
+
var result = this.getLabelFromColumn(args.oldValue[0]);
|
|
1427
|
+
ddtElem.value = result;
|
|
1414
1428
|
}
|
|
1415
1429
|
return;
|
|
1416
1430
|
}
|
|
@@ -3751,7 +3765,7 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
|
|
|
3751
3765
|
rule.value = null;
|
|
3752
3766
|
}
|
|
3753
3767
|
}
|
|
3754
|
-
if ((this.isRefreshed && this.enablePersistence) || (
|
|
3768
|
+
if ((this.isRefreshed && this.enablePersistence) || (rule.field !== '' && rule.operator !== '' && (rule.value !== '' &&
|
|
3755
3769
|
rule.value !== undefined)) || (customObj && customObj.isQuestion)) {
|
|
3756
3770
|
var condition = rule.condition;
|
|
3757
3771
|
rule = {
|
|
@@ -3791,6 +3805,10 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
|
|
|
3791
3805
|
else {
|
|
3792
3806
|
rule = { 'condition': rule.condition, 'rules': rule.rules };
|
|
3793
3807
|
}
|
|
3808
|
+
if (customObj) {
|
|
3809
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3810
|
+
rule.custom = customObj;
|
|
3811
|
+
}
|
|
3794
3812
|
if (rule.rules.length === 0) {
|
|
3795
3813
|
rule = {};
|
|
3796
3814
|
}
|
|
@@ -4565,8 +4583,11 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
|
|
|
4565
4583
|
}
|
|
4566
4584
|
}
|
|
4567
4585
|
if (j !== jLen - 1) {
|
|
4568
|
-
|
|
4569
|
-
|
|
4586
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4587
|
+
var rule = rules.rules[j];
|
|
4588
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4589
|
+
if (condition === '' || (rule && rule.condition !== '' && rule.custom && rule.custom.isCustom)) {
|
|
4590
|
+
condition = rule.condition;
|
|
4570
4591
|
}
|
|
4571
4592
|
condition = sqlLocale ? this.l10n.getConstant(condition.toUpperCase()).toUpperCase() : condition.toUpperCase();
|
|
4572
4593
|
queryStr += ' ' + condition + ' ';
|
|
@@ -4714,7 +4735,7 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
|
|
|
4714
4735
|
// eslint-disable-next-line
|
|
4715
4736
|
if (/^`?([a-z_][a-z0-9_.\[\]\(\)]{0,}(\:(number|float|string|date|boolean))?)`?/i.exec(sqlString)) {
|
|
4716
4737
|
// eslint-disable-next-line
|
|
4717
|
-
matchValue = /^`?([a-
|
|
4738
|
+
matchValue = /^`?([a-zåäö_][a-z0-9åäö_.\[\]\(\)]{0,}(\:(number|float|string|date|boolean))?)`?/i.exec(sqlString)[1];
|
|
4718
4739
|
this.parser.push(['Literal', matchValue]);
|
|
4719
4740
|
return matchValue.length;
|
|
4720
4741
|
}
|
|
@@ -4910,7 +4931,8 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
|
|
|
4910
4931
|
var isLeftOpened = false;
|
|
4911
4932
|
for (var i = 0, iLen = parser.length; i < iLen; i++) {
|
|
4912
4933
|
if (parser[i][0] === 'Literal') {
|
|
4913
|
-
|
|
4934
|
+
var column = this.getColumn(parser[i][1]);
|
|
4935
|
+
rule = { label: (column && column.label) ? column.label : parser[i][1], field: parser[i][1] };
|
|
4914
4936
|
if (parser[i + 1][0] === 'SubOperators') {
|
|
4915
4937
|
if (parser[i + 1][1].indexOf('null') > -1 || parser[i + 1][1].indexOf('empty') > -1) {
|
|
4916
4938
|
rule.operator = this.getOperator(' ', parser[i + 1][1], sqlLocale);
|