@syncfusion/ej2-dropdowns 21.1.39 → 21.2.3
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 +22 -0
- package/dist/ej2-dropdowns.min.js +2 -2
- package/dist/ej2-dropdowns.umd.min.js +2 -2
- package/dist/ej2-dropdowns.umd.min.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es2015.js +50 -15
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +50 -15
- package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
- package/dist/global/ej2-dropdowns.min.js +2 -2
- package/dist/global/ej2-dropdowns.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +12 -15
- package/src/drop-down-base/drop-down-base.js +10 -1
- package/src/drop-down-tree/drop-down-tree.d.ts +1 -0
- package/src/drop-down-tree/drop-down-tree.js +7 -4
- package/src/list-box/list-box.js +21 -5
- package/src/multi-select/multi-select.js +12 -5
- package/styles/material-dark.css +4 -4
- package/styles/material.css +4 -4
- package/styles/multi-select/icons/_material-dark.scss +4 -4
- package/styles/multi-select/icons/_material.scss +4 -4
- package/styles/multi-select/material-dark.css +4 -4
- package/styles/multi-select/material.css +4 -4
- package/.eslintrc.json +0 -259
- package/tslint.json +0 -111
|
@@ -441,6 +441,9 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
441
441
|
var noDataCompTemp = compiledString({}, this, templateName, templateId, this.isStringTemplate, null, ele);
|
|
442
442
|
if (noDataCompTemp && noDataCompTemp.length > 0) {
|
|
443
443
|
for (var i = 0; i < noDataCompTemp.length; i++) {
|
|
444
|
+
if (this.getModuleName() === 'listbox' && templateName === 'noRecordsTemplate') {
|
|
445
|
+
noDataCompTemp[i].classList.add('e-list-nr-template');
|
|
446
|
+
}
|
|
444
447
|
ele.appendChild(noDataCompTemp[i]);
|
|
445
448
|
}
|
|
446
449
|
}
|
|
@@ -481,7 +484,13 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
481
484
|
};
|
|
482
485
|
DropDownBase.prototype.getFormattedValue = function (value) {
|
|
483
486
|
if (this.listData && this.listData.length) {
|
|
484
|
-
var item =
|
|
487
|
+
var item = void 0;
|
|
488
|
+
if (this.properties.allowCustomValue && this.properties.value && this.properties.value instanceof Array && this.properties.value.length > 0) {
|
|
489
|
+
item = this.typeOfData(this.properties.value);
|
|
490
|
+
}
|
|
491
|
+
else {
|
|
492
|
+
item = this.typeOfData(this.listData);
|
|
493
|
+
}
|
|
485
494
|
if (typeof getValue((this.fields.value ? this.fields.value : 'value'), item.item) === 'number'
|
|
486
495
|
|| item.typeof === 'number') {
|
|
487
496
|
return parseFloat(value);
|
|
@@ -4582,6 +4591,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
4582
4591
|
_this.isClicked = false;
|
|
4583
4592
|
// Specifies if the checkAll method has been called
|
|
4584
4593
|
_this.isCheckAllCalled = false;
|
|
4594
|
+
_this.isFromFilterChange = false;
|
|
4585
4595
|
return _this;
|
|
4586
4596
|
}
|
|
4587
4597
|
/**
|
|
@@ -4795,6 +4805,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
4795
4805
|
};
|
|
4796
4806
|
DropDownTree.prototype.filterHandler = function (value, event) {
|
|
4797
4807
|
var _this = this;
|
|
4808
|
+
this.isFromFilterChange = true;
|
|
4798
4809
|
if (!this.isFilteredData) {
|
|
4799
4810
|
this.treeData = this.treeObj.getTreeData();
|
|
4800
4811
|
}
|
|
@@ -5272,7 +5283,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
5272
5283
|
case 'moveDown':
|
|
5273
5284
|
var focusedElement = _this.treeObj.element.querySelector('li');
|
|
5274
5285
|
focusedElement.focus();
|
|
5275
|
-
addClass([focusedElement], ['e-
|
|
5286
|
+
addClass([focusedElement], ['e-node-focus']);
|
|
5276
5287
|
}
|
|
5277
5288
|
}
|
|
5278
5289
|
});
|
|
@@ -5951,7 +5962,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
5951
5962
|
&& _this.treeItems.length > 0)) {
|
|
5952
5963
|
var focusedElement = _this.treeObj.element.querySelector('li');
|
|
5953
5964
|
focusedElement.focus();
|
|
5954
|
-
addClass([focusedElement], ['e-
|
|
5965
|
+
addClass([focusedElement], ['e-node-focus']);
|
|
5955
5966
|
}
|
|
5956
5967
|
if (_this.checkSelectAll && _this.checkBoxElement) {
|
|
5957
5968
|
var wrap = closest(_this.checkBoxElement, '.' + CHECKBOXWRAP);
|
|
@@ -6071,7 +6082,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
6071
6082
|
this.isDocumentClick = false;
|
|
6072
6083
|
e.preventDefault();
|
|
6073
6084
|
}
|
|
6074
|
-
else if (this.inputWrapper
|
|
6085
|
+
else if (!isNullOrUndefined(this.inputWrapper) && !this.inputWrapper.contains(target) && this.inputFocus && !isFilter) {
|
|
6075
6086
|
this.focusOut(e);
|
|
6076
6087
|
}
|
|
6077
6088
|
};
|
|
@@ -6490,7 +6501,8 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
6490
6501
|
};
|
|
6491
6502
|
DropDownTree.prototype.setMultiSelectValue = function (newValues) {
|
|
6492
6503
|
if (!this.isFilteredData) {
|
|
6493
|
-
this.setProperties({ value: newValues }, true);
|
|
6504
|
+
this.setProperties({ value: this.isFromFilterChange && newValues && newValues.length == 0 ? this.value : newValues }, true);
|
|
6505
|
+
this.isFromFilterChange = false;
|
|
6494
6506
|
if (newValues && newValues.length !== 0 && !this.showCheckBox) {
|
|
6495
6507
|
this.treeObj.selectedNodes = this.value.slice();
|
|
6496
6508
|
this.treeObj.dataBind();
|
|
@@ -9293,7 +9305,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9293
9305
|
this.trigger('open', eventArgs, function (eventArgs) {
|
|
9294
9306
|
if (!eventArgs.cancel) {
|
|
9295
9307
|
_this.focusAtFirstListItem();
|
|
9296
|
-
|
|
9308
|
+
if (_this.popupObj) {
|
|
9309
|
+
document.body.appendChild(_this.popupObj.element);
|
|
9310
|
+
}
|
|
9297
9311
|
if (_this.mode === 'CheckBox' && _this.enableGroupCheckBox && !isNullOrUndefined(_this.fields.groupBy)) {
|
|
9298
9312
|
_this.updateListItems(_this.list.querySelectorAll('li.e-list-item'), _this.mainList.querySelectorAll('li.e-list-item'));
|
|
9299
9313
|
}
|
|
@@ -9302,7 +9316,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9302
9316
|
}
|
|
9303
9317
|
_this.refreshPopup();
|
|
9304
9318
|
_this.renderReactTemplates();
|
|
9305
|
-
|
|
9319
|
+
if (_this.popupObj) {
|
|
9320
|
+
_this.popupObj.show(eventArgs.animation, (_this.zIndex === 1000) ? _this.element : null);
|
|
9321
|
+
}
|
|
9306
9322
|
attributes(_this.inputElement, { 'aria-expanded': 'true', 'aria-owns': _this.inputElement.id + '_options' });
|
|
9307
9323
|
_this.updateAriaActiveDescendant();
|
|
9308
9324
|
if (_this.isFirstClick) {
|
|
@@ -10476,6 +10492,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
10476
10492
|
this.refreshSelection();
|
|
10477
10493
|
}
|
|
10478
10494
|
}
|
|
10495
|
+
else if (!isNullOrUndefined(this.fields.groupBy) && this.value && this.value.length) {
|
|
10496
|
+
this.refreshSelection();
|
|
10497
|
+
}
|
|
10479
10498
|
};
|
|
10480
10499
|
MultiSelect.prototype.removeSelectedChip = function (e) {
|
|
10481
10500
|
var selectedElem = this.chipCollectionWrapper.querySelector('span.' + CHIP_SELECTED);
|
|
@@ -12092,7 +12111,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12092
12111
|
overAllContainer = this.componentWrapper.offsetWidth -
|
|
12093
12112
|
parseInt(window.getComputedStyle(this.componentWrapper).paddingLeft, 10) -
|
|
12094
12113
|
parseInt(window.getComputedStyle(this.componentWrapper).paddingRight, 10);
|
|
12095
|
-
if ((wrapperleng + downIconWidth + this.clearIconWidth)
|
|
12114
|
+
if ((wrapperleng + downIconWidth + this.clearIconWidth) > overAllContainer) {
|
|
12096
12115
|
if (tempData !== undefined && tempData !== '') {
|
|
12097
12116
|
temp = tempData;
|
|
12098
12117
|
index = tempIndex + 1;
|
|
@@ -12101,7 +12120,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12101
12120
|
remaining = this.value.length - index;
|
|
12102
12121
|
wrapperleng = this.viewWrapper.offsetWidth +
|
|
12103
12122
|
parseInt(window.getComputedStyle(this.viewWrapper).paddingRight, 10);
|
|
12104
|
-
while (((wrapperleng + remainSize + downIconWidth + this.clearIconWidth)
|
|
12123
|
+
while (((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) > overAllContainer) && wrapperleng !== 0
|
|
12105
12124
|
&& this.viewWrapper.innerHTML !== '') {
|
|
12106
12125
|
var textArr = [];
|
|
12107
12126
|
this.viewWrapper.innerHTML = textArr.join(this.delimiterChar);
|
|
@@ -12111,7 +12130,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12111
12130
|
}
|
|
12112
12131
|
break;
|
|
12113
12132
|
}
|
|
12114
|
-
else if ((wrapperleng + remainSize + downIconWidth + this.clearIconWidth)
|
|
12133
|
+
else if ((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) <= overAllContainer) {
|
|
12115
12134
|
tempData = data;
|
|
12116
12135
|
tempIndex = index;
|
|
12117
12136
|
}
|
|
@@ -14274,17 +14293,26 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
14274
14293
|
var scrollMoved = 36;
|
|
14275
14294
|
var scrollHeight = 10;
|
|
14276
14295
|
if (this.itemTemplate && args.target) {
|
|
14277
|
-
|
|
14296
|
+
if (args.target && args.target.closest('.e-list-item')) {
|
|
14297
|
+
scrollHeight = args.target.closest('.e-list-item').scrollHeight;
|
|
14298
|
+
}
|
|
14299
|
+
else {
|
|
14300
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14301
|
+
var listItem = args.element.querySelector('.e-list-item');
|
|
14302
|
+
if (listItem) {
|
|
14303
|
+
scrollHeight = listItem.scrollHeight;
|
|
14304
|
+
}
|
|
14305
|
+
}
|
|
14278
14306
|
}
|
|
14279
14307
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14280
14308
|
var event = args.event;
|
|
14281
14309
|
var wrapper;
|
|
14282
14310
|
if (args.target && (args.target.classList.contains('e-listbox-wrapper') || args.target.classList.contains('e-list-item')
|
|
14283
|
-
||
|
|
14284
|
-
|| args.target.
|
|
14311
|
+
|| args.target.classList.contains('e-filter-parent') || args.target.classList.contains('e-input-group')
|
|
14312
|
+
|| args.target.closest('.e-list-item'))) {
|
|
14285
14313
|
if (args.target.classList.contains('e-list-item') || args.target.classList.contains('e-filter-parent')
|
|
14286
|
-
||
|
|
14287
|
-
|| args.target.
|
|
14314
|
+
|| args.target.classList.contains('e-input-group')
|
|
14315
|
+
|| args.target.closest('.e-list-item')) {
|
|
14288
14316
|
wrapper = args.target.closest('.e-listbox-wrapper');
|
|
14289
14317
|
}
|
|
14290
14318
|
else {
|
|
@@ -14573,6 +14601,13 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
14573
14601
|
*/
|
|
14574
14602
|
ListBox.prototype.selectItems = function (items, state, isValue) {
|
|
14575
14603
|
if (state === void 0) { state = true; }
|
|
14604
|
+
if (state && !this.selectionSettings.showCheckbox && this.selectionSettings.mode === 'Single') {
|
|
14605
|
+
this.getSelectedItems().forEach(function (li) {
|
|
14606
|
+
li.classList.remove('e-active');
|
|
14607
|
+
li.removeAttribute('aria-selected');
|
|
14608
|
+
removeClass([li], cssClass.selected);
|
|
14609
|
+
});
|
|
14610
|
+
}
|
|
14576
14611
|
this.setSelection(items, state, !isValue);
|
|
14577
14612
|
this.updateSelectedOptions();
|
|
14578
14613
|
};
|