@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
|
@@ -668,7 +668,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
668
668
|
placeholder: this.l10n.getConstant('SelectField'), showClearButton: false,
|
|
669
669
|
popupHeight: ((this.columns.length > 5) ? height : 'auto'), changeOnBlur: false,
|
|
670
670
|
change: this.changeField.bind(this), value: !isNullOrUndefined(ddlValue) ? [ddlValue] : null,
|
|
671
|
-
open: this.popupOpen.bind(this, false)
|
|
671
|
+
open: this.popupOpen.bind(this, false), treeSettings: { expandOn: 'Click' }, select: this.onSelectField
|
|
672
672
|
};
|
|
673
673
|
if (this.fieldModel) {
|
|
674
674
|
ddlField = Object.assign({}, ddlField, this.fieldModel);
|
|
@@ -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
|
|
@@ -1332,6 +1339,12 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1332
1339
|
}
|
|
1333
1340
|
this.isFieldChange = false;
|
|
1334
1341
|
}
|
|
1342
|
+
onSelectField(args) {
|
|
1343
|
+
if (args.itemData.hasChildren) {
|
|
1344
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1345
|
+
this.showPopup();
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1335
1348
|
changeField(args) {
|
|
1336
1349
|
if (args.isInteracted) {
|
|
1337
1350
|
if (isNullOrUndefined(args.value)) {
|
|
@@ -1355,7 +1368,8 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1355
1368
|
}
|
|
1356
1369
|
else {
|
|
1357
1370
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1358
|
-
|
|
1371
|
+
const result = this.getLabelFromColumn(args.oldValue[0]);
|
|
1372
|
+
ddtElem.value = result;
|
|
1359
1373
|
}
|
|
1360
1374
|
return;
|
|
1361
1375
|
}
|
|
@@ -3684,7 +3698,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3684
3698
|
rule.value = null;
|
|
3685
3699
|
}
|
|
3686
3700
|
}
|
|
3687
|
-
if ((this.isRefreshed && this.enablePersistence) || (
|
|
3701
|
+
if ((this.isRefreshed && this.enablePersistence) || (rule.field !== '' && rule.operator !== '' && (rule.value !== '' &&
|
|
3688
3702
|
rule.value !== undefined)) || (customObj && customObj.isQuestion)) {
|
|
3689
3703
|
const condition = rule.condition;
|
|
3690
3704
|
rule = {
|
|
@@ -3724,6 +3738,10 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
3724
3738
|
else {
|
|
3725
3739
|
rule = { 'condition': rule.condition, 'rules': rule.rules };
|
|
3726
3740
|
}
|
|
3741
|
+
if (customObj) {
|
|
3742
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3743
|
+
rule.custom = customObj;
|
|
3744
|
+
}
|
|
3727
3745
|
if (rule.rules.length === 0) {
|
|
3728
3746
|
rule = {};
|
|
3729
3747
|
}
|
|
@@ -4497,8 +4515,11 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
4497
4515
|
}
|
|
4498
4516
|
}
|
|
4499
4517
|
if (j !== jLen - 1) {
|
|
4500
|
-
|
|
4501
|
-
|
|
4518
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4519
|
+
const rule = rules.rules[j];
|
|
4520
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4521
|
+
if (condition === '' || (rule && rule.condition !== '' && rule.custom && rule.custom.isCustom)) {
|
|
4522
|
+
condition = rule.condition;
|
|
4502
4523
|
}
|
|
4503
4524
|
condition = sqlLocale ? this.l10n.getConstant(condition.toUpperCase()).toUpperCase() : condition.toUpperCase();
|
|
4504
4525
|
queryStr += ' ' + condition + ' ';
|
|
@@ -4646,7 +4667,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
4646
4667
|
// eslint-disable-next-line
|
|
4647
4668
|
if (/^`?([a-z_][a-z0-9_.\[\]\(\)]{0,}(\:(number|float|string|date|boolean))?)`?/i.exec(sqlString)) {
|
|
4648
4669
|
// eslint-disable-next-line
|
|
4649
|
-
matchValue = /^`?([a-
|
|
4670
|
+
matchValue = /^`?([a-zåäö_][a-z0-9åäö_.\[\]\(\)]{0,}(\:(number|float|string|date|boolean))?)`?/i.exec(sqlString)[1];
|
|
4650
4671
|
this.parser.push(['Literal', matchValue]);
|
|
4651
4672
|
return matchValue.length;
|
|
4652
4673
|
}
|
|
@@ -4842,7 +4863,8 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
4842
4863
|
let isLeftOpened = false;
|
|
4843
4864
|
for (let i = 0, iLen = parser.length; i < iLen; i++) {
|
|
4844
4865
|
if (parser[i][0] === 'Literal') {
|
|
4845
|
-
|
|
4866
|
+
const column = this.getColumn(parser[i][1]);
|
|
4867
|
+
rule = { label: (column && column.label) ? column.label : parser[i][1], field: parser[i][1] };
|
|
4846
4868
|
if (parser[i + 1][0] === 'SubOperators') {
|
|
4847
4869
|
if (parser[i + 1][1].indexOf('null') > -1 || parser[i + 1][1].indexOf('empty') > -1) {
|
|
4848
4870
|
rule.operator = this.getOperator(' ', parser[i + 1][1], sqlLocale);
|