@syncfusion/ej2-dropdowns 27.1.58 → 27.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/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 +149 -114
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +150 -114
- 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 -12
- package/src/drop-down-base/drop-down-base.js +23 -7
- package/src/drop-down-tree/drop-down-tree.js +5 -0
- package/src/list-box/list-box.js +5 -3
- package/src/multi-select/multi-select.d.ts +2 -0
- package/src/multi-select/multi-select.js +117 -104
- package/styles/bootstrap5-dark-lite.css +4 -0
- package/styles/bootstrap5-dark.css +4 -0
- package/styles/bootstrap5-lite.css +4 -0
- package/styles/bootstrap5.3-lite.css +4 -0
- package/styles/bootstrap5.3.css +4 -0
- package/styles/bootstrap5.css +4 -0
- package/styles/multi-select/_bootstrap5-definition.scss +4 -0
- package/styles/multi-select/_bootstrap5.3-definition.scss +4 -0
- package/styles/multi-select/bootstrap5-dark.css +4 -0
- package/styles/multi-select/bootstrap5.3.css +4 -0
- package/styles/multi-select/bootstrap5.css +4 -0
|
@@ -1349,9 +1349,11 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1349
1349
|
}
|
|
1350
1350
|
renderItemsBySelect() {
|
|
1351
1351
|
const element = this.element;
|
|
1352
|
-
const fields = { value: 'value', text: 'text' };
|
|
1353
|
-
const jsonElement = [];
|
|
1354
1352
|
const group = element.querySelectorAll('select>optgroup');
|
|
1353
|
+
let fields;
|
|
1354
|
+
const isSelectGroupCheck = this.getModuleName() === 'multiselect' && this.isGroupChecking && group.length > 0;
|
|
1355
|
+
fields = isSelectGroupCheck ? { value: 'value', text: 'text', groupBy: 'categeory' } : fields = { value: 'value', text: 'text' };
|
|
1356
|
+
const jsonElement = [];
|
|
1355
1357
|
const option = element.querySelectorAll('select>option');
|
|
1356
1358
|
this.getJSONfromOption(jsonElement, option, fields);
|
|
1357
1359
|
if (group.length) {
|
|
@@ -1361,12 +1363,17 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1361
1363
|
optionGroup[fields.text] = item.label;
|
|
1362
1364
|
optionGroup.isHeader = true;
|
|
1363
1365
|
const child = item.querySelectorAll('option');
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
+
if (isSelectGroupCheck) {
|
|
1367
|
+
this.getJSONfromOption(jsonElement, child, fields, item.label);
|
|
1368
|
+
}
|
|
1369
|
+
else {
|
|
1370
|
+
jsonElement.push(optionGroup);
|
|
1371
|
+
this.getJSONfromOption(jsonElement, child, fields);
|
|
1372
|
+
}
|
|
1366
1373
|
}
|
|
1367
1374
|
element.querySelectorAll('select>option');
|
|
1368
1375
|
}
|
|
1369
|
-
this.updateFields(fields.text, fields.value, this.fields.groupBy, this.fields.htmlAttributes, this.fields.iconCss, this.fields.disabled);
|
|
1376
|
+
this.updateFields(fields.text, fields.value, isSelectGroupCheck ? fields.groupBy : this.fields.groupBy, this.fields.htmlAttributes, this.fields.iconCss, this.fields.disabled);
|
|
1370
1377
|
this.resetList(jsonElement, fields);
|
|
1371
1378
|
}
|
|
1372
1379
|
updateFields(text, value, groupBy, htmlAttributes, iconCss, disabled) {
|
|
@@ -1382,12 +1389,15 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1382
1389
|
};
|
|
1383
1390
|
this.setProperties(field, true);
|
|
1384
1391
|
}
|
|
1385
|
-
getJSONfromOption(items, options, fields) {
|
|
1392
|
+
getJSONfromOption(items, options, fields, category = null) {
|
|
1386
1393
|
for (const option of options) {
|
|
1387
1394
|
const json = {};
|
|
1388
1395
|
json[fields.text] = option.innerText;
|
|
1389
1396
|
json[fields.value] = !isNullOrUndefined(option.getAttribute(fields.value)) ?
|
|
1390
1397
|
option.getAttribute(fields.value) : option.innerText;
|
|
1398
|
+
if (!isNullOrUndefined(category)) {
|
|
1399
|
+
json[fields.groupBy] = category;
|
|
1400
|
+
}
|
|
1391
1401
|
items.push(json);
|
|
1392
1402
|
}
|
|
1393
1403
|
}
|
|
@@ -1841,7 +1851,12 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1841
1851
|
if (this.sortOrder !== 'None') {
|
|
1842
1852
|
dataSource = this.getSortedDataSource(dataSource);
|
|
1843
1853
|
}
|
|
1844
|
-
|
|
1854
|
+
if (this.element.querySelector('optgroup') && this.isGroupChecking && this.getModuleName() === 'multiselect') {
|
|
1855
|
+
dataSource = ListBase.groupDataSource(dataSource, fields, this.sortOrder);
|
|
1856
|
+
}
|
|
1857
|
+
else {
|
|
1858
|
+
dataSource = ListBase.groupDataSource(dataSource, fields.properties, this.sortOrder);
|
|
1859
|
+
}
|
|
1845
1860
|
}
|
|
1846
1861
|
addClass([this.list], dropDownBaseClasses.grouping);
|
|
1847
1862
|
}
|
|
@@ -7821,6 +7836,11 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
7821
7836
|
this.checkAllParent.focus();
|
|
7822
7837
|
}
|
|
7823
7838
|
break;
|
|
7839
|
+
case 'tab':
|
|
7840
|
+
if (!this.isPopupOpen && this.inputFocus) {
|
|
7841
|
+
this.onFocusOut();
|
|
7842
|
+
}
|
|
7843
|
+
break;
|
|
7824
7844
|
}
|
|
7825
7845
|
}
|
|
7826
7846
|
});
|
|
@@ -15274,6 +15294,15 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
15274
15294
|
this.previousEndIndex = 0;
|
|
15275
15295
|
}
|
|
15276
15296
|
}
|
|
15297
|
+
this.isClearAllItem = true;
|
|
15298
|
+
EventHandler.add(document, 'mouseup', this.preventSelection, this);
|
|
15299
|
+
}
|
|
15300
|
+
preventSelection(e) {
|
|
15301
|
+
if (this.isClearAllItem) {
|
|
15302
|
+
e.stopPropagation();
|
|
15303
|
+
}
|
|
15304
|
+
this.isClearAllItem = false;
|
|
15305
|
+
EventHandler.remove(document, 'mouseup', this.preventSelection);
|
|
15277
15306
|
}
|
|
15278
15307
|
clearAllCallback(e, isClearAll) {
|
|
15279
15308
|
const tempValues = this.value ? this.value.slice() : [];
|
|
@@ -16026,127 +16055,131 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
16026
16055
|
this.updateData(delimChar, e);
|
|
16027
16056
|
}
|
|
16028
16057
|
onMouseClick(e) {
|
|
16029
|
-
this.
|
|
16030
|
-
|
|
16031
|
-
|
|
16032
|
-
|
|
16033
|
-
|
|
16034
|
-
|
|
16035
|
-
|
|
16036
|
-
|
|
16037
|
-
const headerLi = closest(target, '.' + dropDownBaseClasses.group);
|
|
16038
|
-
if (headerLi && this.enableGroupCheckBox && this.mode === 'CheckBox' && this.fields.groupBy) {
|
|
16039
|
-
target = target.classList.contains('e-list-group-item') ? target.firstElementChild.lastElementChild
|
|
16040
|
-
: e.target;
|
|
16041
|
-
if (target.classList.contains('e-check')) {
|
|
16042
|
-
this.selectAllItem(false, e);
|
|
16043
|
-
target.classList.remove('e-check');
|
|
16044
|
-
target.classList.remove('e-stop');
|
|
16045
|
-
closest(target, '.' + 'e-list-group-item').classList.remove('e-active');
|
|
16046
|
-
target.setAttribute('aria-selected', 'false');
|
|
16047
|
-
}
|
|
16048
|
-
else {
|
|
16049
|
-
this.selectAllItem(true, e);
|
|
16050
|
-
target.classList.remove('e-stop');
|
|
16051
|
-
target.classList.add('e-check');
|
|
16052
|
-
closest(target, '.' + 'e-list-group-item').classList.add('e-active');
|
|
16053
|
-
target.setAttribute('aria-selected', 'true');
|
|
16058
|
+
if (!this.isClearAllItem) {
|
|
16059
|
+
this.keyCode = null;
|
|
16060
|
+
this.scrollFocusStatus = false;
|
|
16061
|
+
this.keyboardEvent = null;
|
|
16062
|
+
let target = e.target;
|
|
16063
|
+
const li = closest(target, '.' + dropDownBaseClasses.li);
|
|
16064
|
+
if (this.enableVirtualization && li && li.classList.contains('e-virtual-list')) {
|
|
16065
|
+
return;
|
|
16054
16066
|
}
|
|
16055
|
-
|
|
16056
|
-
this.
|
|
16057
|
-
|
|
16058
|
-
|
|
16059
|
-
|
|
16060
|
-
|
|
16061
|
-
|
|
16062
|
-
|
|
16067
|
+
const headerLi = closest(target, '.' + dropDownBaseClasses.group);
|
|
16068
|
+
if (headerLi && this.enableGroupCheckBox && this.mode === 'CheckBox' && this.fields.groupBy) {
|
|
16069
|
+
target = target.classList.contains('e-list-group-item') ? target.firstElementChild.lastElementChild
|
|
16070
|
+
: e.target;
|
|
16071
|
+
if (target.classList.contains('e-check')) {
|
|
16072
|
+
this.selectAllItem(false, e);
|
|
16073
|
+
target.classList.remove('e-check');
|
|
16074
|
+
target.classList.remove('e-stop');
|
|
16075
|
+
closest(target, '.' + 'e-list-group-item').classList.remove('e-active');
|
|
16076
|
+
target.setAttribute('aria-selected', 'false');
|
|
16063
16077
|
}
|
|
16064
|
-
|
|
16065
|
-
this.
|
|
16066
|
-
|
|
16067
|
-
|
|
16068
|
-
|
|
16069
|
-
|
|
16070
|
-
|
|
16071
|
-
|
|
16072
|
-
|
|
16078
|
+
else {
|
|
16079
|
+
this.selectAllItem(true, e);
|
|
16080
|
+
target.classList.remove('e-stop');
|
|
16081
|
+
target.classList.add('e-check');
|
|
16082
|
+
closest(target, '.' + 'e-list-group-item').classList.add('e-active');
|
|
16083
|
+
target.setAttribute('aria-selected', 'true');
|
|
16084
|
+
}
|
|
16085
|
+
this.refreshSelection();
|
|
16086
|
+
this.checkSelectAll();
|
|
16087
|
+
}
|
|
16088
|
+
else {
|
|
16089
|
+
if (this.isValidLI(li)) {
|
|
16090
|
+
let limit = this.value && this.value.length ? this.value.length : 0;
|
|
16091
|
+
if (li.classList.contains('e-active')) {
|
|
16092
|
+
limit = limit - 1;
|
|
16073
16093
|
}
|
|
16074
|
-
|
|
16075
|
-
this.
|
|
16094
|
+
if (limit < this.maximumSelectionLength) {
|
|
16095
|
+
this.updateListSelection(li, e);
|
|
16096
|
+
this.checkPlaceholderSize();
|
|
16097
|
+
this.addListFocus(li);
|
|
16098
|
+
if ((this.allowCustomValue || this.allowFiltering) && this.mainList && this.listData) {
|
|
16099
|
+
if (this.mode !== 'CheckBox') {
|
|
16100
|
+
this.focusAtLastListItem(li.getAttribute('data-value'));
|
|
16101
|
+
this.refreshSelection();
|
|
16102
|
+
}
|
|
16103
|
+
}
|
|
16104
|
+
else {
|
|
16105
|
+
this.makeTextBoxEmpty();
|
|
16106
|
+
}
|
|
16076
16107
|
}
|
|
16077
|
-
|
|
16078
|
-
|
|
16079
|
-
|
|
16080
|
-
|
|
16081
|
-
|
|
16108
|
+
if (this.mode === 'CheckBox') {
|
|
16109
|
+
this.updateDelimView();
|
|
16110
|
+
if (this.value && this.value.length > 50) {
|
|
16111
|
+
setTimeout(() => {
|
|
16112
|
+
this.updateDelimeter(this.delimiterChar, e);
|
|
16113
|
+
}, 0);
|
|
16114
|
+
}
|
|
16115
|
+
else {
|
|
16082
16116
|
this.updateDelimeter(this.delimiterChar, e);
|
|
16083
|
-
}
|
|
16117
|
+
}
|
|
16118
|
+
this.refreshInputHight();
|
|
16084
16119
|
}
|
|
16085
16120
|
else {
|
|
16086
16121
|
this.updateDelimeter(this.delimiterChar, e);
|
|
16087
16122
|
}
|
|
16088
|
-
this.
|
|
16089
|
-
|
|
16090
|
-
|
|
16091
|
-
|
|
16092
|
-
|
|
16093
|
-
|
|
16094
|
-
|
|
16095
|
-
|
|
16096
|
-
|
|
16097
|
-
|
|
16098
|
-
|
|
16099
|
-
this.
|
|
16123
|
+
this.checkSelectAll();
|
|
16124
|
+
this.refreshPopup();
|
|
16125
|
+
if (this.hideSelectedItem) {
|
|
16126
|
+
this.focusAtFirstListItem();
|
|
16127
|
+
}
|
|
16128
|
+
if (this.closePopupOnSelect) {
|
|
16129
|
+
this.hidePopup(e);
|
|
16130
|
+
}
|
|
16131
|
+
else {
|
|
16132
|
+
e.preventDefault();
|
|
16133
|
+
}
|
|
16134
|
+
const isFilterData = this.targetElement().trim() !== '' ? true : false;
|
|
16135
|
+
this.makeTextBoxEmpty();
|
|
16136
|
+
this.findGroupStart(target);
|
|
16137
|
+
if (this.mode !== 'CheckBox') {
|
|
16138
|
+
this.refreshListItems(isNullOrUndefined(li) ? null : li.textContent, isFilterData);
|
|
16139
|
+
}
|
|
16100
16140
|
}
|
|
16101
16141
|
else {
|
|
16102
16142
|
e.preventDefault();
|
|
16103
16143
|
}
|
|
16104
|
-
|
|
16105
|
-
|
|
16106
|
-
|
|
16107
|
-
|
|
16108
|
-
|
|
16109
|
-
|
|
16110
|
-
|
|
16111
|
-
|
|
16112
|
-
|
|
16113
|
-
|
|
16114
|
-
|
|
16115
|
-
|
|
16116
|
-
|
|
16117
|
-
|
|
16118
|
-
|
|
16119
|
-
|
|
16120
|
-
|
|
16121
|
-
|
|
16122
|
-
|
|
16123
|
-
|
|
16124
|
-
|
|
16125
|
-
|
|
16126
|
-
|
|
16127
|
-
|
|
16128
|
-
|
|
16129
|
-
|
|
16130
|
-
|
|
16131
|
-
|
|
16132
|
-
|
|
16133
|
-
|
|
16134
|
-
|
|
16135
|
-
|
|
16136
|
-
|
|
16137
|
-
else {
|
|
16138
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16139
|
-
this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
|
|
16140
|
-
}
|
|
16141
|
-
if (this.list.querySelector('.e-virtual-ddl-content')) {
|
|
16142
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16143
|
-
this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
|
|
16144
|
+
if (this.enableVirtualization && this.hideSelectedItem) {
|
|
16145
|
+
const visibleListElements = this.list.querySelectorAll('li.'
|
|
16146
|
+
+ dropDownBaseClasses.li
|
|
16147
|
+
+ ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)' + ':not(.e-virtual-list)');
|
|
16148
|
+
if (visibleListElements.length) {
|
|
16149
|
+
const actualCount = this.virtualListHeight > 0 ?
|
|
16150
|
+
Math.floor(this.virtualListHeight / this.listItemHeight) : 0;
|
|
16151
|
+
if (visibleListElements.length < (actualCount + 2)) {
|
|
16152
|
+
let query = this.getForQuery(this.value).clone();
|
|
16153
|
+
query = query.skip(this.virtualItemStartIndex);
|
|
16154
|
+
this.resetList(this.dataSource, this.fields, query);
|
|
16155
|
+
this.UpdateSkeleton();
|
|
16156
|
+
this.liCollections = this.list.querySelectorAll('.'
|
|
16157
|
+
+ dropDownBaseClasses.li);
|
|
16158
|
+
this.virtualItemCount = this.itemCount;
|
|
16159
|
+
if (this.mode !== 'CheckBox') {
|
|
16160
|
+
this.totalItemCount = this.value && this.value.length ? this.totalItemCount - this.value.length :
|
|
16161
|
+
this.totalItemCount;
|
|
16162
|
+
}
|
|
16163
|
+
if (!this.list.querySelector('.e-virtual-ddl')) {
|
|
16164
|
+
const virualElement = this.createElement('div', {
|
|
16165
|
+
id: this.element.id + '_popup', className: 'e-virtual-ddl', styles: this.GetVirtualTrackHeight()
|
|
16166
|
+
});
|
|
16167
|
+
this.popupWrapper.querySelector('.e-dropdownbase').appendChild(virualElement);
|
|
16168
|
+
}
|
|
16169
|
+
else {
|
|
16170
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16171
|
+
this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
|
|
16172
|
+
}
|
|
16173
|
+
if (this.list.querySelector('.e-virtual-ddl-content')) {
|
|
16174
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16175
|
+
this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
|
|
16176
|
+
}
|
|
16144
16177
|
}
|
|
16145
16178
|
}
|
|
16146
16179
|
}
|
|
16180
|
+
this.refreshPlaceHolder();
|
|
16181
|
+
this.deselectHeader();
|
|
16147
16182
|
}
|
|
16148
|
-
this.refreshPlaceHolder();
|
|
16149
|
-
this.deselectHeader();
|
|
16150
16183
|
}
|
|
16151
16184
|
}
|
|
16152
16185
|
findGroupStart(target) {
|
|
@@ -20412,11 +20445,13 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
20412
20445
|
if (fListBox.value.length === 1 && fListBox.getSelectedItems().length) {
|
|
20413
20446
|
fListBox.value[0] = fListBox.getFormattedValue(fListBox.getSelectedItems()[0].getAttribute('data-value'));
|
|
20414
20447
|
}
|
|
20415
|
-
if (fListBox.liCollections.length === fListBox.ulElement.querySelectorAll('.e-disabled').length) {
|
|
20448
|
+
if (fListBox.liCollections.length === fListBox.ulElement.querySelectorAll('.e-disabled').length && this.toolbarAction) {
|
|
20416
20449
|
const wrap = this.list.parentElement.getElementsByClassName('e-listbox-tool')[0];
|
|
20417
20450
|
const toolbarAction = this.toolbarAction === 'moveFrom' ? 'moveAllFrom' : 'moveAllTo';
|
|
20418
|
-
|
|
20419
|
-
|
|
20451
|
+
if (wrap) {
|
|
20452
|
+
const btn = wrap.querySelector('[data-value="' + toolbarAction + '"]');
|
|
20453
|
+
btn.disabled = true;
|
|
20454
|
+
}
|
|
20420
20455
|
}
|
|
20421
20456
|
}
|
|
20422
20457
|
selectNextList(elems, dataLiIdx, dataIdx, inst) {
|