@syncfusion/ej2-querybuilder 25.1.37 → 25.1.40
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 +23 -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 +20 -9
- package/dist/es6/ej2-querybuilder.es2015.js.map +1 -1
- package/dist/es6/ej2-querybuilder.es5.js +20 -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 +10 -10
- package/src/query-builder/query-builder.js +20 -9
|
@@ -1736,13 +1736,12 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1736
1736
|
const subFieldElem = this.createElement('input', { attrs: { type: 'text', id: ruleId + '_subfilterkey' + this.subFilterCounter } });
|
|
1737
1737
|
tempElem.appendChild(subFieldElem);
|
|
1738
1738
|
const height = (this.element.className.indexOf('e-device') > -1) ? '250px' : '200px';
|
|
1739
|
-
const subFieldData = Object.keys(this.selectedColumn.columns[0]);
|
|
1740
1739
|
let ddlField;
|
|
1741
1740
|
ddlField = {
|
|
1742
1741
|
dataSource: this.selectedColumn.columns,
|
|
1743
1742
|
fields: this.fields,
|
|
1744
1743
|
placeholder: this.l10n.getConstant('SelectField'),
|
|
1745
|
-
popupHeight: ((
|
|
1744
|
+
popupHeight: ((this.selectedColumn.columns.length > 5) ? height : 'auto'),
|
|
1746
1745
|
change: this.changeField.bind(this),
|
|
1747
1746
|
index: 0,
|
|
1748
1747
|
open: this.popupOpen.bind(this, false)
|
|
@@ -1756,7 +1755,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
1756
1755
|
this.GetRootColumnName(rule.field) === this.GetRootColumnName(this.previousColumn.field))) {
|
|
1757
1756
|
const subField = this.selectedColumn.columns;
|
|
1758
1757
|
for (let i = 0; i < subField.length; i++) {
|
|
1759
|
-
if (rule.field === subField[i].field) {
|
|
1758
|
+
if (rule.field === subField[i].field || rule.field.indexOf(subField[i].field + this.separator) > -1) {
|
|
1760
1759
|
dropDownList.value = subField[i].field;
|
|
1761
1760
|
this.selectedColumn = subField[i];
|
|
1762
1761
|
subFieldValue = true;
|
|
@@ -2256,7 +2255,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
2256
2255
|
const columnData = this.getItemData(parentId);
|
|
2257
2256
|
let selectedValue;
|
|
2258
2257
|
const isTemplate = (typeof columnData.template === 'string');
|
|
2259
|
-
if (this.isImportRules || this.ruleIndex > -1 || this.groupIndex > -1 || this.isPublic || isTemplate) {
|
|
2258
|
+
if (this.isImportRules || this.ruleIndex > -1 || this.groupIndex > -1 || this.isPublic || isTemplate || rule.value != '') {
|
|
2260
2259
|
selectedValue = rule.value;
|
|
2261
2260
|
}
|
|
2262
2261
|
else {
|
|
@@ -2295,7 +2294,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
2295
2294
|
renderNumberValue(parentId, rule, operator, idx, ruleValElem, itemData, length) {
|
|
2296
2295
|
const columnData = this.getItemData(parentId);
|
|
2297
2296
|
const isTemplate = (typeof columnData.template === 'string');
|
|
2298
|
-
let selectedVal = (this.isImportRules || this.ruleIndex > -1 || this.groupIndex > -1 || this.isPublic || isTemplate) ? rule.value : this.setDefaultValue(parentId, false, true);
|
|
2297
|
+
let selectedVal = (this.isImportRules || this.ruleIndex > -1 || this.groupIndex > -1 || this.isPublic || isTemplate || typeof rule.value === 'number') ? rule.value : this.setDefaultValue(parentId, false, true);
|
|
2299
2298
|
if ((operator === 'in' || operator === 'notin') && (this.dataColl.length || columnData.values)) {
|
|
2300
2299
|
selectedVal = (this.isImportRules || this.ruleIndex > -1 || this.groupIndex > -1) ? rule.value : this.setDefaultValue(parentId, true, false);
|
|
2301
2300
|
this.renderMultiSelect(columnData, parentId, idx, selectedVal, columnData.values);
|
|
@@ -2431,6 +2430,10 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
2431
2430
|
let datePicker;
|
|
2432
2431
|
const place = this.l10n.getConstant('SelectValue');
|
|
2433
2432
|
const isTemplate = (typeof itemData.template === 'string');
|
|
2433
|
+
if (rule.value && !isNullOrUndefined(format)) {
|
|
2434
|
+
selVal = (length > 1) ? rule.value[i] : rule.value;
|
|
2435
|
+
selectedValue = this.parseDate(selVal, format) || new Date();
|
|
2436
|
+
}
|
|
2434
2437
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2435
2438
|
if (!itemData.field && !itemData.key && itemData.value) {
|
|
2436
2439
|
if (itemData.value instanceof Date) {
|
|
@@ -2531,7 +2534,15 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
2531
2534
|
isCheck = values[i].toString().toLowerCase() === itemData.value.toString().toLowerCase();
|
|
2532
2535
|
}
|
|
2533
2536
|
else if (i === 0) {
|
|
2534
|
-
|
|
2537
|
+
if (typeof rule.value === 'boolean') {
|
|
2538
|
+
isCheck = rule.value ? true : false;
|
|
2539
|
+
}
|
|
2540
|
+
else {
|
|
2541
|
+
isCheck = true;
|
|
2542
|
+
}
|
|
2543
|
+
}
|
|
2544
|
+
if (typeof rule.value === 'boolean' && i === 1) {
|
|
2545
|
+
isCheck = !rule.value ? true : false;
|
|
2535
2546
|
}
|
|
2536
2547
|
value = values[i].toString();
|
|
2537
2548
|
orgValue = values[i];
|
|
@@ -2548,7 +2559,7 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
2548
2559
|
const radiobutton = new RadioButton(radioBtn);
|
|
2549
2560
|
radiobutton.appendTo('#' + parentId + '_valuekey' + i);
|
|
2550
2561
|
if (isCheck) {
|
|
2551
|
-
this.updateRules(radiobutton.element, orgValue, 0);
|
|
2562
|
+
this.updateRules(radiobutton.element, orgValue, 0, true);
|
|
2552
2563
|
}
|
|
2553
2564
|
}
|
|
2554
2565
|
getOperatorIndex(ddlObj, rule) {
|
|
@@ -5198,9 +5209,9 @@ let QueryBuilder = class QueryBuilder extends Component {
|
|
|
5198
5209
|
return matchValue.length;
|
|
5199
5210
|
}
|
|
5200
5211
|
// eslint-disable-next-line
|
|
5201
|
-
if (this.checkLiteral() && /^'?([a-z_][a-z0-9 _.\[\]\(\)]{0,}(\:(number|float|string|date|boolean))?)'?/i.exec(sqlString)) {
|
|
5212
|
+
if (this.checkLiteral() && /^'?([a-z_][a-z0-9 _.\[\]\(\)-]{0,}(\:(number|float|string|date|boolean))?)'?/i.exec(sqlString)) {
|
|
5202
5213
|
// eslint-disable-next-line
|
|
5203
|
-
matchValue = /^'?([a-z_][a-z0-9 _.\[\]\(\)]{0,}(\:(number|float|string|date|boolean))?)'?/i.exec(sqlString)[1];
|
|
5214
|
+
matchValue = /^'?([a-z_][a-z0-9 _.\[\]\(\)-]{0,}(\:(number|float|string|date|boolean))?)'?/i.exec(sqlString)[1];
|
|
5204
5215
|
this.parser.push(['Literal', matchValue]);
|
|
5205
5216
|
return matchValue.length + 2;
|
|
5206
5217
|
}
|