@syncfusion/ej2-dropdowns 31.1.18 → 31.1.22
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 +3 -3
- package/dist/ej2-dropdowns.umd.min.js +3 -3
- package/dist/ej2-dropdowns.umd.min.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es2015.js +94 -20
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +121 -46
- package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
- package/dist/global/ej2-dropdowns.min.js +3 -3
- package/dist/global/ej2-dropdowns.min.js.map +1 -1
- package/dist/global/index.d.ts +2 -2
- package/package.json +5 -5
- package/src/combo-box/combo-box.js +7 -2
- package/src/drop-down-base/drop-down-base.js +10 -3
- package/src/drop-down-list/drop-down-list.js +49 -35
- package/src/drop-down-tree/drop-down-tree.js +11 -1
- package/src/mention/mention.js +5 -2
- package/src/multi-select/multi-select.d.ts +2 -0
- package/src/multi-select/multi-select.js +39 -3
- package/styles/auto-complete/bootstrap4.css +8 -0
- package/styles/bds-lite.css +0 -1
- package/styles/bds.css +0 -1
- package/styles/bootstrap-dark-lite.css +0 -1
- package/styles/bootstrap-dark.css +0 -1
- package/styles/bootstrap-lite.css +0 -1
- package/styles/bootstrap.css +0 -1
- package/styles/bootstrap4-lite.css +9 -1
- package/styles/bootstrap4.css +15 -7
- package/styles/bootstrap5-dark-lite.css +0 -1
- package/styles/bootstrap5-dark.css +0 -1
- package/styles/bootstrap5-lite.css +0 -1
- package/styles/bootstrap5.3-lite.css +2 -1
- package/styles/bootstrap5.3.css +5 -4
- package/styles/bootstrap5.css +0 -1
- package/styles/combo-box/bootstrap4.css +8 -0
- package/styles/drop-down-base/_fluent2-definition.scss +2 -2
- package/styles/drop-down-base/fluent2.css +4 -4
- package/styles/drop-down-list/_bootstrap4-definition.scss +8 -0
- package/styles/drop-down-list/bootstrap4.css +8 -0
- package/styles/drop-down-tree/_bigger.scss +8 -2
- package/styles/drop-down-tree/_layout.scss +12 -0
- package/styles/drop-down-tree/bds.css +0 -1
- package/styles/drop-down-tree/bootstrap-dark.css +0 -1
- package/styles/drop-down-tree/bootstrap.css +0 -1
- package/styles/drop-down-tree/bootstrap4.css +0 -1
- package/styles/drop-down-tree/bootstrap5-dark.css +0 -1
- package/styles/drop-down-tree/bootstrap5.3.css +1 -2
- package/styles/drop-down-tree/bootstrap5.css +0 -1
- package/styles/drop-down-tree/fabric-dark.css +0 -1
- package/styles/drop-down-tree/fabric.css +0 -1
- package/styles/drop-down-tree/fluent-dark.css +0 -1
- package/styles/drop-down-tree/fluent.css +0 -1
- package/styles/drop-down-tree/fluent2.css +5 -1
- package/styles/drop-down-tree/highcontrast-light.css +0 -1
- package/styles/drop-down-tree/highcontrast.css +0 -1
- package/styles/drop-down-tree/tailwind-dark.css +0 -1
- package/styles/drop-down-tree/tailwind.css +0 -1
- package/styles/drop-down-tree/tailwind3.css +0 -1
- package/styles/fabric-dark-lite.css +0 -1
- package/styles/fabric-dark.css +0 -1
- package/styles/fabric-lite.css +0 -1
- package/styles/fabric.css +0 -1
- package/styles/fluent-dark-lite.css +0 -1
- package/styles/fluent-dark.css +3 -4
- package/styles/fluent-lite.css +0 -1
- package/styles/fluent.css +3 -4
- package/styles/fluent2-lite.css +8 -2
- package/styles/fluent2.css +13 -7
- package/styles/highcontrast-light-lite.css +0 -1
- package/styles/highcontrast-light.css +0 -2
- package/styles/highcontrast-lite.css +1 -1
- package/styles/highcontrast.css +3 -4
- package/styles/material.css +2 -2
- package/styles/multi-select/_bigger.scss +6 -6
- package/styles/multi-select/_bootstrap4-definition.scss +1 -1
- package/styles/multi-select/_bootstrap5.3-definition.scss +1 -1
- package/styles/multi-select/_fluent-definition.scss +1 -1
- package/styles/multi-select/_fluent2-definition.scss +1 -1
- package/styles/multi-select/_highcontrast-definition.scss +1 -1
- package/styles/multi-select/_material-definition.scss +1 -1
- package/styles/multi-select/_tailwind-definition.scss +2 -2
- package/styles/multi-select/_tailwind3-definition.scss +1 -1
- package/styles/multi-select/bootstrap4.css +7 -6
- package/styles/multi-select/bootstrap5.3.css +4 -2
- package/styles/multi-select/fluent-dark.css +3 -3
- package/styles/multi-select/fluent.css +3 -3
- package/styles/multi-select/fluent2.css +4 -2
- package/styles/multi-select/highcontrast-light.css +0 -1
- package/styles/multi-select/highcontrast.css +3 -3
- package/styles/multi-select/icons/_bootstrap4.scss +1 -0
- package/styles/multi-select/icons/_bootstrap5.3.scss +2 -0
- package/styles/multi-select/icons/_fluent2.scss +2 -0
- package/styles/multi-select/icons/_highcontrast.scss +1 -0
- package/styles/multi-select/icons/_tailwind3.scss +2 -0
- package/styles/multi-select/material.css +2 -2
- package/styles/multi-select/tailwind-dark.css +5 -5
- package/styles/multi-select/tailwind.css +5 -5
- package/styles/multi-select/tailwind3.css +4 -2
- package/styles/tailwind-dark-lite.css +1 -2
- package/styles/tailwind-dark.css +5 -6
- package/styles/tailwind-lite.css +1 -2
- package/styles/tailwind.css +5 -6
- package/styles/tailwind3-lite.css +2 -1
- package/styles/tailwind3.css +4 -3
|
@@ -984,7 +984,14 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
984
984
|
for (const item of dataSource) {
|
|
985
985
|
if (!isNullOrUndefined(item)) {
|
|
986
986
|
if (ignoreAccent) {
|
|
987
|
-
|
|
987
|
+
if (ignoreCase) {
|
|
988
|
+
if (this.checkIgnoreCase(String(item), text)) {
|
|
989
|
+
value = this.checkingAccent(String(item), text, ignoreCase);
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
else {
|
|
993
|
+
value = this.checkingAccent(String(item), text, ignoreCase);
|
|
994
|
+
}
|
|
988
995
|
}
|
|
989
996
|
else {
|
|
990
997
|
if (ignoreCase) {
|
|
@@ -1454,9 +1461,9 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1454
1461
|
getJSONfromOption(items, options, fields, category = null) {
|
|
1455
1462
|
for (const option of options) {
|
|
1456
1463
|
const json = {};
|
|
1457
|
-
json[fields.text] = option.
|
|
1464
|
+
json[fields.text] = option.innerHTML;
|
|
1458
1465
|
json[fields.value] = !isNullOrUndefined(option.getAttribute(fields.value)) ?
|
|
1459
|
-
option.getAttribute(fields.value) : option.
|
|
1466
|
+
option.getAttribute(fields.value) : option.innerHTML;
|
|
1460
1467
|
if (!isNullOrUndefined(category)) {
|
|
1461
1468
|
json[fields.groupBy] = category;
|
|
1462
1469
|
}
|
|
@@ -3210,10 +3217,10 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3210
3217
|
floatLabelChange() {
|
|
3211
3218
|
if (this.getModuleName() === 'dropdownlist' && this.floatLabelType === 'Auto') {
|
|
3212
3219
|
const floatElement = this.inputWrapper.container.querySelector('.e-float-text');
|
|
3213
|
-
if (this.inputElement.value !== '' || this.isInteracted) {
|
|
3220
|
+
if (floatElement && this.inputElement.value !== '' || this.isInteracted) {
|
|
3214
3221
|
classList(floatElement, ['e-label-top'], ['e-label-bottom']);
|
|
3215
3222
|
}
|
|
3216
|
-
else {
|
|
3223
|
+
else if (floatElement) {
|
|
3217
3224
|
classList(floatElement, ['e-label-bottom'], ['e-label-top']);
|
|
3218
3225
|
}
|
|
3219
3226
|
}
|
|
@@ -5578,8 +5585,8 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
5578
5585
|
this.removeFocus();
|
|
5579
5586
|
if (this.allowFiltering && this.actionCompleteData && this.actionCompleteData.ulElement &&
|
|
5580
5587
|
this.dataSource instanceof DataManager) {
|
|
5581
|
-
const focus = this.actionCompleteData.ulElement.
|
|
5582
|
-
if (focus) {
|
|
5588
|
+
const focus = this.actionCompleteData.ulElement.querySelectorAll('.' + dropDownListClasses.focus);
|
|
5589
|
+
if (focus && focus.length) {
|
|
5583
5590
|
removeClass(focus, dropDownListClasses.focus);
|
|
5584
5591
|
}
|
|
5585
5592
|
}
|
|
@@ -5773,7 +5780,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
5773
5780
|
setTimeout(() => {
|
|
5774
5781
|
if (this.value || this.list.querySelector('.e-active')) {
|
|
5775
5782
|
this.updateSelectionList();
|
|
5776
|
-
if (this.
|
|
5783
|
+
if (this.viewPortInfo && this.viewPortInfo.offsets.top) {
|
|
5777
5784
|
this.list.scrollTop = this.viewPortInfo.offsets.top;
|
|
5778
5785
|
}
|
|
5779
5786
|
else {
|
|
@@ -5846,8 +5853,24 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
5846
5853
|
this.list.parentElement.style.height = '100%';
|
|
5847
5854
|
}
|
|
5848
5855
|
this.list.parentElement.style.paddingBottom = (this.getModuleName() === 'dropdownlist' && this.allowFiltering && this.searchBoxHeight) ? (this.searchBoxHeight + resizePaddingBottom).toString() + 'px' : resizePaddingBottom.toString() + 'px';
|
|
5849
|
-
if (this.
|
|
5850
|
-
|
|
5856
|
+
if (this.isReact && this.footer) {
|
|
5857
|
+
let listMaxHeight = this.list.style.maxHeight;
|
|
5858
|
+
const listParentElementMaxHeight = this.list.parentElement.style.maxHeight;
|
|
5859
|
+
let containerHeight = this.listContainerHeight;
|
|
5860
|
+
setTimeout(() => {
|
|
5861
|
+
this.footer = this.footer ? this.footer : popupEle.querySelector('.e-ddl-footer');
|
|
5862
|
+
const height = Math.round(this.footer.getBoundingClientRect().height);
|
|
5863
|
+
if (height > 0) {
|
|
5864
|
+
containerHeight = (parseInt(containerHeight, 10) - height).toString() + 'px';
|
|
5865
|
+
listMaxHeight = (parseInt(containerHeight, 10) - 2).toString() + 'px';
|
|
5866
|
+
this.list.parentElement.style.paddingBottom = ((parseInt(listParentElementMaxHeight, 10) - parseInt(listMaxHeight, 10)) + resizePaddingBottom).toString() + 'px';
|
|
5867
|
+
}
|
|
5868
|
+
}, 1);
|
|
5869
|
+
}
|
|
5870
|
+
else {
|
|
5871
|
+
if (this.header || this.footer || this.itemTemplate) {
|
|
5872
|
+
this.list.parentElement.style.paddingBottom = ((parseInt(this.list.parentElement.style.maxHeight, 10) - parseInt(this.list.style.maxHeight, 10)) + resizePaddingBottom).toString() + 'px';
|
|
5873
|
+
}
|
|
5851
5874
|
}
|
|
5852
5875
|
this.list.parentElement.appendChild(this.resizer);
|
|
5853
5876
|
//hold the popup resize
|
|
@@ -6349,9 +6372,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6349
6372
|
}
|
|
6350
6373
|
let dataSourceCount;
|
|
6351
6374
|
if (this.dataSource instanceof DataManager) {
|
|
6352
|
-
|
|
6353
|
-
dataSourceCount = this.virtualGroupDataSource && this.virtualGroupDataSource.length ?
|
|
6354
|
-
this.virtualGroupDataSource.length : 0;
|
|
6375
|
+
dataSourceCount = this.remoteDataCount;
|
|
6355
6376
|
}
|
|
6356
6377
|
else {
|
|
6357
6378
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -8681,8 +8702,14 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
8681
8702
|
return remainElement;
|
|
8682
8703
|
}
|
|
8683
8704
|
getOverflowVal(index) {
|
|
8705
|
+
let textSelected;
|
|
8684
8706
|
const selectedData = this.getSelectedData(this.value[parseInt(index.toString(), 10)]);
|
|
8685
|
-
|
|
8707
|
+
const node = this.treeObj.getNode(this.value[index]);
|
|
8708
|
+
textSelected = getValue(this.treeSettings.loadOnDemand ? this.fields.text : 'text', selectedData);
|
|
8709
|
+
if (isNullOrUndefined(textSelected) && !isNullOrUndefined(node.text)) {
|
|
8710
|
+
textSelected = node.text.toString();
|
|
8711
|
+
}
|
|
8712
|
+
return textSelected;
|
|
8686
8713
|
}
|
|
8687
8714
|
updateDelimMode() {
|
|
8688
8715
|
if (this.mode !== 'Box') {
|
|
@@ -10026,7 +10053,11 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
10026
10053
|
const compiledString = this.initializeValueTemplate();
|
|
10027
10054
|
for (let i = 0, len = this.value.length; i < len; i++) {
|
|
10028
10055
|
selectedData = this.getSelectedData(this.value[i]);
|
|
10056
|
+
const node = this.treeObj.getNode(this.value[i]);
|
|
10029
10057
|
text = getValue(this.treeSettings.loadOnDemand ? this.fields.text : 'text', selectedData);
|
|
10058
|
+
if (isNullOrUndefined(text) && !isNullOrUndefined(node.text)) {
|
|
10059
|
+
text = node.text.toString();
|
|
10060
|
+
}
|
|
10030
10061
|
this.selectedText.push(text);
|
|
10031
10062
|
temp = this.selectedText[this.selectedText.length - 1];
|
|
10032
10063
|
if (this.selectedText.length > 1) {
|
|
@@ -11283,6 +11314,11 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
11283
11314
|
this.setProperties({ 'text': dataItem.text ? dataItem.text.toString() : dataItem.text, 'value': value });
|
|
11284
11315
|
}
|
|
11285
11316
|
}
|
|
11317
|
+
else if (this.allowCustom) {
|
|
11318
|
+
this.valueMuteChange(this.value);
|
|
11319
|
+
this.setHiddenValue();
|
|
11320
|
+
Input.setValue(this.text, this.inputElement, this.floatLabelType, this.showClearButton);
|
|
11321
|
+
}
|
|
11286
11322
|
else {
|
|
11287
11323
|
this.valueMuteChange(null);
|
|
11288
11324
|
}
|
|
@@ -11311,7 +11347,7 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
11311
11347
|
this.setSelection(li, null);
|
|
11312
11348
|
}
|
|
11313
11349
|
else if ((!this.enableVirtualization && this.allowCustom) ||
|
|
11314
|
-
(this.allowCustom && this.enableVirtualization && !doesItemExist)) {
|
|
11350
|
+
(this.allowCustom && this.enableVirtualization && !doesItemExist && !(this.dataSource instanceof DataManager))) {
|
|
11315
11351
|
this.valueMuteChange(this.value);
|
|
11316
11352
|
}
|
|
11317
11353
|
else if (!this.enableVirtualization || (this.enableVirtualization && !(this.dataSource instanceof DataManager)
|
|
@@ -11694,7 +11730,7 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
11694
11730
|
}
|
|
11695
11731
|
}
|
|
11696
11732
|
getValueByText(text) {
|
|
11697
|
-
return super.getValueByText(text,
|
|
11733
|
+
return super.getValueByText(text, this.ignoreCase, this.ignoreAccent);
|
|
11698
11734
|
}
|
|
11699
11735
|
unWireEvent() {
|
|
11700
11736
|
if (this.getModuleName() === 'combobox') {
|
|
@@ -13942,6 +13978,11 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
13942
13978
|
this.removeFocus();
|
|
13943
13979
|
}
|
|
13944
13980
|
}
|
|
13981
|
+
secureRandom() {
|
|
13982
|
+
const array = new Uint32Array(1);
|
|
13983
|
+
window.crypto.getRandomValues(array);
|
|
13984
|
+
return array[0] / (0xFFFFFFFF + 1);
|
|
13985
|
+
}
|
|
13945
13986
|
checkForCustomValue(query, fields) {
|
|
13946
13987
|
const dataChecks = !this.getValueByText(this.inputElement.value, this.ignoreCase);
|
|
13947
13988
|
const field = fields ? fields : this.fields;
|
|
@@ -13955,7 +13996,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
13955
13996
|
setValue(field.text, value, dataItem);
|
|
13956
13997
|
if (typeof getValue((this.fields.value ? this.fields.value : 'value'), customData)
|
|
13957
13998
|
=== 'number' && this.fields.value !== this.fields.text) {
|
|
13958
|
-
setValue(field.value,
|
|
13999
|
+
setValue(field.value, this.secureRandom(), dataItem);
|
|
13959
14000
|
}
|
|
13960
14001
|
else {
|
|
13961
14002
|
setValue(field.value, value, dataItem);
|
|
@@ -14076,6 +14117,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
14076
14117
|
e.preventDefault();
|
|
14077
14118
|
}
|
|
14078
14119
|
this.checkAndScrollParent();
|
|
14120
|
+
if (this.maximumSelectionLength === 0) {
|
|
14121
|
+
this.checkMaxSelection();
|
|
14122
|
+
}
|
|
14079
14123
|
}
|
|
14080
14124
|
checkAndScrollParent() {
|
|
14081
14125
|
let scrollElement = this.overAllWrapper ? this.overAllWrapper.parentElement : null;
|
|
@@ -15669,8 +15713,21 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
15669
15713
|
this.updateChipStatus();
|
|
15670
15714
|
this.checkMaxSelection();
|
|
15671
15715
|
}
|
|
15716
|
+
updateListItemsState(list) {
|
|
15717
|
+
const activeItems = list.querySelectorAll('li.' + dropDownBaseClasses.li + '.e-active');
|
|
15718
|
+
removeClass(activeItems, 'e-disable');
|
|
15719
|
+
const inactiveItems = list.querySelectorAll('li.' + dropDownBaseClasses.li + ':not(.e-active)');
|
|
15720
|
+
addClass(inactiveItems, 'e-disable');
|
|
15721
|
+
}
|
|
15672
15722
|
checkMaxSelection() {
|
|
15673
15723
|
const limit = this.value && this.value.length ? this.value.length : 0;
|
|
15724
|
+
if (this.maximumSelectionLength === 0) {
|
|
15725
|
+
this.updateListItemsState(this.list);
|
|
15726
|
+
if (this.mainList) {
|
|
15727
|
+
this.updateListItemsState(this.mainList);
|
|
15728
|
+
}
|
|
15729
|
+
return;
|
|
15730
|
+
}
|
|
15674
15731
|
if (limit === this.maximumSelectionLength) {
|
|
15675
15732
|
const activeItems = this.list.querySelectorAll('li.'
|
|
15676
15733
|
+ dropDownBaseClasses.li + '.e-active');
|
|
@@ -18848,7 +18905,21 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
18848
18905
|
}
|
|
18849
18906
|
this.list.parentElement.style.boxSizing = 'border-box'; // Ensures padding doesn't affect element size
|
|
18850
18907
|
const paddingBottom = this.mode === 'CheckBox' && this.searchBoxHeight ? this.searchBoxHeight + resizePaddingBottom + (this.showSelectAll ? this.storedSelectAllHeight : 0) : resizePaddingBottom;
|
|
18851
|
-
this.
|
|
18908
|
+
if (this.footer) {
|
|
18909
|
+
let listMaxHeight = this.list.style.maxHeight;
|
|
18910
|
+
const listParentElementMaxHeight = this.list.parentElement.style.maxHeight;
|
|
18911
|
+
setTimeout(() => {
|
|
18912
|
+
const height = Math.round(this.footer.getBoundingClientRect().height);
|
|
18913
|
+
const containerHeight = (parseInt(listParentElementMaxHeight, 10) - height).toString() + 'px';
|
|
18914
|
+
listMaxHeight = (parseInt(containerHeight, 10) - 2).toString() + 'px';
|
|
18915
|
+
if (height > 0) {
|
|
18916
|
+
this.list.parentElement.style.paddingBottom = ((parseInt(listParentElementMaxHeight, 10) - parseInt(listMaxHeight, 10)) + paddingBottom).toString() + 'px';
|
|
18917
|
+
}
|
|
18918
|
+
}, 1);
|
|
18919
|
+
}
|
|
18920
|
+
else {
|
|
18921
|
+
this.list.parentElement.style.paddingBottom = `${paddingBottom}px`;
|
|
18922
|
+
}
|
|
18852
18923
|
this.list.parentElement.appendChild(this.resizer);
|
|
18853
18924
|
this.list.parentElement.style.width = this.resizeWidth + 'px';
|
|
18854
18925
|
this.list.parentElement.style.height = this.resizeHeight + 'px';
|
|
@@ -23055,7 +23126,9 @@ let Mention = class Mention extends DropDownBase {
|
|
|
23055
23126
|
}
|
|
23056
23127
|
if (this.isContentEditable(this.inputElement)) {
|
|
23057
23128
|
this.range = this.getCurrentRange();
|
|
23058
|
-
|
|
23129
|
+
if (this.range) {
|
|
23130
|
+
rangetextContent = this.range.startContainer.textContent.split('');
|
|
23131
|
+
}
|
|
23059
23132
|
}
|
|
23060
23133
|
const currentRange = this.getTextRange();
|
|
23061
23134
|
// eslint-disable-next-line security/detect-non-literal-regexp
|
|
@@ -23170,7 +23243,8 @@ let Mention = class Mention extends DropDownBase {
|
|
|
23170
23243
|
return isMatched;
|
|
23171
23244
|
}
|
|
23172
23245
|
getCurrentRange() {
|
|
23173
|
-
this.range = this.inputElement.ownerDocument.getSelection().
|
|
23246
|
+
this.range = this.inputElement.ownerDocument.getSelection().rangeCount > 0 &&
|
|
23247
|
+
this.inputElement.ownerDocument.getSelection().getRangeAt(0);
|
|
23174
23248
|
return this.range;
|
|
23175
23249
|
}
|
|
23176
23250
|
performFiltering(e) {
|