@syncfusion/ej2-querybuilder 31.1.22 → 31.2.4
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/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 +67 -0
- package/dist/es6/ej2-querybuilder.es2015.js.map +1 -1
- package/dist/es6/ej2-querybuilder.es5.js +67 -0
- 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 +7 -7
- package/src/query-builder/query-builder-model.d.ts +7 -0
- package/src/query-builder/query-builder.d.ts +8 -0
- package/src/query-builder/query-builder.js +67 -0
- package/styles/bds-lite.css +1 -1
- package/styles/bds.css +1 -1
- package/styles/bootstrap-dark-lite.css +1 -1
- package/styles/bootstrap-dark.css +1 -1
- package/styles/bootstrap-lite.css +1 -1
- package/styles/bootstrap.css +1 -1
- package/styles/bootstrap4-lite.css +1 -1
- package/styles/bootstrap4.css +1 -1
- package/styles/bootstrap5-dark-lite.css +1 -1
- package/styles/bootstrap5-dark.css +1 -1
- package/styles/bootstrap5-lite.css +1 -1
- package/styles/bootstrap5.3-lite.css +1 -1
- package/styles/bootstrap5.3.css +1 -1
- package/styles/bootstrap5.css +1 -1
- package/styles/fabric-dark-lite.css +1 -1
- package/styles/fabric-dark.css +1 -1
- package/styles/fabric-lite.css +1 -1
- package/styles/fabric.css +1 -1
- package/styles/fluent-dark-lite.css +1 -1
- package/styles/fluent-dark.css +1 -1
- package/styles/fluent-lite.css +1 -1
- package/styles/fluent.css +1 -1
- package/styles/fluent2-lite.css +1 -1
- package/styles/fluent2.css +1 -1
- package/styles/highcontrast-light-lite.css +1 -1
- package/styles/highcontrast-light.css +1 -1
- package/styles/highcontrast-lite.css +1 -1
- package/styles/highcontrast.css +1 -1
- package/styles/material-dark-lite.css +1 -1
- package/styles/material-dark.css +1 -1
- package/styles/material-lite.css +1 -1
- package/styles/material.css +1 -1
- package/styles/material3-dark-lite.css +3 -3
- package/styles/material3-dark.css +3 -3
- package/styles/material3-lite.css +3 -3
- package/styles/material3.css +3 -3
- package/styles/query-builder/_bds-definition.scss +2 -0
- package/styles/query-builder/_bootstrap-dark-definition.scss +2 -2
- package/styles/query-builder/_bootstrap-definition.scss +2 -0
- package/styles/query-builder/_bootstrap4-definition.scss +2 -0
- package/styles/query-builder/_bootstrap5-definition.scss +2 -0
- package/styles/query-builder/_bootstrap5.3-definition.scss +2 -0
- package/styles/query-builder/_fabric-dark-definition.scss +2 -0
- package/styles/query-builder/_fabric-definition.scss +2 -0
- package/styles/query-builder/_fluent-definition.scss +2 -0
- package/styles/query-builder/_fluent2-definition.scss +2 -0
- package/styles/query-builder/_fusionnew-definition.scss +2 -0
- package/styles/query-builder/_highcontrast-definition.scss +2 -0
- package/styles/query-builder/_highcontrast-light-definition.scss +2 -0
- package/styles/query-builder/_material-dark-definition.scss +2 -0
- package/styles/query-builder/_material-definition.scss +2 -0
- package/styles/query-builder/_material3-definition.scss +2 -0
- package/styles/query-builder/_tailwind-definition.scss +2 -0
- package/styles/query-builder/_tailwind3-definition.scss +2 -0
- package/styles/query-builder/_theme.scss +3 -3
- package/styles/query-builder/bds.css +1 -1
- 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.3.css +1 -1
- package/styles/query-builder/bootstrap5.css +1 -1
- package/styles/query-builder/fabric-dark.css +1 -1
- package/styles/query-builder/fabric.css +1 -1
- package/styles/query-builder/fluent-dark.css +1 -1
- package/styles/query-builder/fluent.css +1 -1
- package/styles/query-builder/fluent2.css +1 -1
- package/styles/query-builder/highcontrast-light.css +1 -1
- package/styles/query-builder/highcontrast.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 +3 -3
- package/styles/query-builder/material3.css +3 -3
- package/styles/query-builder/tailwind-dark.css +1 -1
- package/styles/query-builder/tailwind.css +1 -1
- package/styles/query-builder/tailwind3.css +1 -1
- package/styles/tailwind-dark-lite.css +1 -1
- package/styles/tailwind-dark.css +1 -1
- package/styles/tailwind-lite.css +1 -1
- package/styles/tailwind.css +1 -1
- package/styles/tailwind3-lite.css +1 -1
- package/styles/tailwind3.css +1 -1
|
@@ -206,6 +206,7 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
|
|
|
206
206
|
_this.cloneRuleBtnClick = false;
|
|
207
207
|
_this.isValueEmpty = false;
|
|
208
208
|
_this.isPropChange = false;
|
|
209
|
+
_this.isRuleClicked = false;
|
|
209
210
|
MultiSelect.Inject(CheckBoxSelection);
|
|
210
211
|
return _this;
|
|
211
212
|
}
|
|
@@ -570,6 +571,7 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
|
|
|
570
571
|
case target.className.indexOf('e-clone-rule-btn') > -1:
|
|
571
572
|
this.actionButton = target;
|
|
572
573
|
this.cloneRuleBtnClick = true;
|
|
574
|
+
this.isRuleClicked = true;
|
|
573
575
|
this.ruleClone(target);
|
|
574
576
|
break;
|
|
575
577
|
case target.className.indexOf('e-lock-rule-btn') > -1:
|
|
@@ -583,6 +585,7 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
|
|
|
583
585
|
case target.className.indexOf('e-clone-grp-btn') > -1:
|
|
584
586
|
this.actionButton = target;
|
|
585
587
|
this.cloneGrpBtnClick = true;
|
|
588
|
+
this.isRuleClicked = true;
|
|
586
589
|
this.groupClone(closest(target, '.e-group-container'));
|
|
587
590
|
break;
|
|
588
591
|
case target.className.indexOf('e-deletegroup') > -1:
|
|
@@ -742,9 +745,11 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
|
|
|
742
745
|
}
|
|
743
746
|
}
|
|
744
747
|
else if (event.element.children[0].className.indexOf('e-addrule') > -1) {
|
|
748
|
+
this.isRuleClicked = true;
|
|
745
749
|
this.addRuleElement(closest(target, '.e-group-container'), {});
|
|
746
750
|
}
|
|
747
751
|
else if (event.element.children[0].className.indexOf('e-addgroup') > -1) {
|
|
752
|
+
this.isRuleClicked = true;
|
|
748
753
|
this.addGroupElement(true, closest(target, '.e-group-container'), '', true);
|
|
749
754
|
}
|
|
750
755
|
};
|
|
@@ -945,6 +950,10 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
|
|
|
945
950
|
if (!this.isImportRules) {
|
|
946
951
|
this.updateAddedRule(trgt, rule, newRule, isRlTmp, pId, this.enableSeparateConnector ? true : null);
|
|
947
952
|
}
|
|
953
|
+
if (this.rule.condition === '' && (this.isRuleClicked || this.rule.rules.length > 1)) {
|
|
954
|
+
this.rule.condition = 'and';
|
|
955
|
+
}
|
|
956
|
+
this.isRuleClicked = false;
|
|
948
957
|
var ruleCount = this.rule.rules.length;
|
|
949
958
|
if (!column || (column && !column.ruleTemplate) || !rule.field) {
|
|
950
959
|
if (ruleCount > 20) {
|
|
@@ -2336,11 +2345,46 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
|
|
|
2336
2345
|
QueryBuilder.prototype.changeValueSuccessCallBack = function (args, element, i, groupID, ruleID) {
|
|
2337
2346
|
if (!args.cancel) {
|
|
2338
2347
|
this.updateRules(element, args.value, i);
|
|
2348
|
+
this.setSecondDateMinFromFirst(element, i);
|
|
2339
2349
|
if (!this.isImportRules) {
|
|
2340
2350
|
this.trigger('change', { groupID: groupID, ruleID: ruleID, value: args.value, cancel: false, type: 'value' });
|
|
2341
2351
|
}
|
|
2342
2352
|
}
|
|
2343
2353
|
};
|
|
2354
|
+
QueryBuilder.prototype.setSecondDateMinFromFirst = function (element, valueIndex) {
|
|
2355
|
+
if (valueIndex !== 0) {
|
|
2356
|
+
return;
|
|
2357
|
+
}
|
|
2358
|
+
var ruleElem = closest(element, '.e-rule-container');
|
|
2359
|
+
if (!ruleElem) {
|
|
2360
|
+
return;
|
|
2361
|
+
}
|
|
2362
|
+
var operatorDropdownElement = ruleElem.querySelector('.e-rule-operator .e-dropdownlist');
|
|
2363
|
+
if (!operatorDropdownElement) {
|
|
2364
|
+
return;
|
|
2365
|
+
}
|
|
2366
|
+
var operatorDropdown = getComponent(operatorDropdownElement, 'dropdownlist');
|
|
2367
|
+
var operatorValue = operatorDropdown && operatorDropdown.value ? operatorDropdown.value.toString().toLowerCase() : '';
|
|
2368
|
+
if (operatorValue.indexOf('between') < 0) {
|
|
2369
|
+
return;
|
|
2370
|
+
}
|
|
2371
|
+
var firstDateElement = document.getElementById(ruleElem.id + '_valuekey0');
|
|
2372
|
+
var secondDateElement = document.getElementById(ruleElem.id + '_valuekey1');
|
|
2373
|
+
if (!firstDateElement || !secondDateElement) {
|
|
2374
|
+
return;
|
|
2375
|
+
}
|
|
2376
|
+
var firstDatePicker = getComponent(firstDateElement, 'datepicker');
|
|
2377
|
+
var secondDatePicker = getComponent(secondDateElement, 'datepicker');
|
|
2378
|
+
if (!firstDatePicker || !secondDatePicker || !(firstDatePicker.value instanceof Date)) {
|
|
2379
|
+
return;
|
|
2380
|
+
}
|
|
2381
|
+
var nextDay = new Date(firstDatePicker.value.getTime());
|
|
2382
|
+
nextDay.setDate(nextDay.getDate() + 1);
|
|
2383
|
+
secondDatePicker.min = nextDay;
|
|
2384
|
+
if (secondDatePicker.value instanceof Date && secondDatePicker.value.getTime() < nextDay.getTime()) {
|
|
2385
|
+
secondDatePicker.value = nextDay;
|
|
2386
|
+
}
|
|
2387
|
+
};
|
|
2344
2388
|
QueryBuilder.prototype.fieldClose = function (id) {
|
|
2345
2389
|
if (this.isFieldChange || this.isDestroy) {
|
|
2346
2390
|
return;
|
|
@@ -3327,6 +3371,12 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
|
|
|
3327
3371
|
selVal = (length_1 > 1) ? rule.value[i] : rule.value;
|
|
3328
3372
|
selectedValue = this.parseDate(selVal, format) || new Date();
|
|
3329
3373
|
}
|
|
3374
|
+
if (!isNullOrUndefined(itemData) && itemData.value && !isTemplate) {
|
|
3375
|
+
var parsedDate = this.parseDate(itemData.value.toString(), itemData.format);
|
|
3376
|
+
if (parsedDate && !isNaN(parsedDate.getTime())) {
|
|
3377
|
+
selectedValue = parsedDate;
|
|
3378
|
+
}
|
|
3379
|
+
}
|
|
3330
3380
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3331
3381
|
if (!itemData.field && !itemData.key && itemData.value) {
|
|
3332
3382
|
if (itemData.value instanceof Date) {
|
|
@@ -3368,6 +3418,19 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
|
|
|
3368
3418
|
value: selectedValue, locale: this.getLocale(), placeholder: place,
|
|
3369
3419
|
format: formatObj.format, change: this.changeValue.bind(this, i)
|
|
3370
3420
|
};
|
|
3421
|
+
if (!isNullOrUndefined(column) && !isNullOrUndefined(column.values) && column.values.length > 0) {
|
|
3422
|
+
var parsedDate = this.parseDate(column.values[i], format);
|
|
3423
|
+
if (!isNullOrUndefined(parsedDate) && parsedDate instanceof Date) {
|
|
3424
|
+
datePicker.value = parsedDate;
|
|
3425
|
+
if (i === 1) {
|
|
3426
|
+
var parsedMinDate = this.parseDate(column.values[0], format);
|
|
3427
|
+
if (parsedMinDate instanceof Date && !isNaN(parsedMinDate.getTime())) {
|
|
3428
|
+
parsedMinDate.setDate(parsedMinDate.getDate() + 1);
|
|
3429
|
+
datePicker.min = parsedMinDate;
|
|
3430
|
+
}
|
|
3431
|
+
}
|
|
3432
|
+
}
|
|
3433
|
+
}
|
|
3371
3434
|
if (this.valueModel && this.valueModel.datePickerModel) {
|
|
3372
3435
|
datePicker = __assign({}, datePicker, this.valueModel.datePickerModel);
|
|
3373
3436
|
}
|
|
@@ -4098,6 +4161,7 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
|
|
|
4098
4161
|
}
|
|
4099
4162
|
classList(this.element, [], ['e-rtl', 'e-responsive', 'e-device']);
|
|
4100
4163
|
this.isDestroy = false;
|
|
4164
|
+
_super.prototype.destroy.call(this);
|
|
4101
4165
|
};
|
|
4102
4166
|
/**
|
|
4103
4167
|
* Adds single or multiple rules.
|
|
@@ -7494,6 +7558,9 @@ var QueryBuilder = /** @__PURE__ @class */ (function (_super) {
|
|
|
7494
7558
|
__decorate([
|
|
7495
7559
|
Event()
|
|
7496
7560
|
], QueryBuilder.prototype, "created", void 0);
|
|
7561
|
+
__decorate([
|
|
7562
|
+
Event()
|
|
7563
|
+
], QueryBuilder.prototype, "destroyed", void 0);
|
|
7497
7564
|
__decorate([
|
|
7498
7565
|
Event()
|
|
7499
7566
|
], QueryBuilder.prototype, "actionBegin", void 0);
|