@syncfusion/ej2-dropdowns 35.1.43 → 35.2.12
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 +286 -92
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +287 -92
- 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 +8 -8
- package/src/drop-down-base/drop-down-base.js +5 -1
- package/src/drop-down-list/drop-down-list.d.ts +4 -0
- package/src/drop-down-list/drop-down-list.js +86 -9
- package/src/multi-select/multi-select.d.ts +2 -0
- package/src/multi-select/multi-select.js +196 -82
|
@@ -1386,6 +1386,9 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1386
1386
|
return 'drop-down-base';
|
|
1387
1387
|
}
|
|
1388
1388
|
getTextByValue(value) {
|
|
1389
|
+
if (this.getModuleName() === 'multiselect' && (value === null || value === undefined)) {
|
|
1390
|
+
return 'null';
|
|
1391
|
+
}
|
|
1389
1392
|
const text = this.checkValueCase(value, false, false, true);
|
|
1390
1393
|
return text;
|
|
1391
1394
|
}
|
|
@@ -3068,7 +3071,8 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
3068
3071
|
const type = this.typeOfData(this.listData).typeof;
|
|
3069
3072
|
if (type === 'string' || type === 'number' || type === 'boolean') {
|
|
3070
3073
|
for (const item of this.listData) {
|
|
3071
|
-
if (
|
|
3074
|
+
if (((this.getModuleName() === 'multiselect') && item === value) ||
|
|
3075
|
+
((this.getModuleName() !== 'multiselect') && !isNullOrUndefined(item) && item === value)) {
|
|
3072
3076
|
return item;
|
|
3073
3077
|
}
|
|
3074
3078
|
}
|
|
@@ -3275,6 +3279,8 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3275
3279
|
this.isUpdateHeaderHeight = false;
|
|
3276
3280
|
this.isUpdateFooterHeight = false;
|
|
3277
3281
|
this.isReactTemplateUpdate = false;
|
|
3282
|
+
this.popupPositionObserver = null;
|
|
3283
|
+
this.popupPositionRefreshTimer = null;
|
|
3278
3284
|
}
|
|
3279
3285
|
/**
|
|
3280
3286
|
* Initialize the event handler.
|
|
@@ -3538,8 +3544,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3538
3544
|
'aria-disabled': 'false',
|
|
3539
3545
|
'role': 'combobox',
|
|
3540
3546
|
'aria-expanded': 'false',
|
|
3541
|
-
'aria-live': 'polite'
|
|
3542
|
-
'aria-labelledby': this.hiddenElement.id
|
|
3547
|
+
'aria-live': 'polite'
|
|
3543
3548
|
};
|
|
3544
3549
|
}
|
|
3545
3550
|
setEnableRtl() {
|
|
@@ -6140,6 +6145,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6140
6145
|
if (!isNullOrUndefined(this.popupObj)) {
|
|
6141
6146
|
this.popupObj.show(new Animation(eventArgs.animation), (this.zIndex === 1000) ? this.element : null);
|
|
6142
6147
|
this.isPopupRender = true;
|
|
6148
|
+
this.setupPopupPositionObserver();
|
|
6143
6149
|
}
|
|
6144
6150
|
if (this.isReact) {
|
|
6145
6151
|
setTimeout(() => {
|
|
@@ -6801,10 +6807,50 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6801
6807
|
}
|
|
6802
6808
|
ulElement = null;
|
|
6803
6809
|
}
|
|
6810
|
+
setupPopupPositionObserver() {
|
|
6811
|
+
if (!this.isAngular) {
|
|
6812
|
+
return;
|
|
6813
|
+
}
|
|
6814
|
+
if (!isNullOrUndefined(this.popupPositionObserver)) {
|
|
6815
|
+
this.popupPositionObserver.disconnect();
|
|
6816
|
+
}
|
|
6817
|
+
const observerTarget = this.inputWrapper && this.inputWrapper.container
|
|
6818
|
+
? this.inputWrapper.container.parentElement
|
|
6819
|
+
: this.element.parentElement;
|
|
6820
|
+
if (isNullOrUndefined(observerTarget)) {
|
|
6821
|
+
return;
|
|
6822
|
+
}
|
|
6823
|
+
this.popupPositionObserver = new MutationObserver(() => {
|
|
6824
|
+
clearTimeout(this.popupPositionRefreshTimer);
|
|
6825
|
+
this.popupPositionRefreshTimer = setTimeout(() => {
|
|
6826
|
+
if (!isNullOrUndefined(this.popupObj) &&
|
|
6827
|
+
!isNullOrUndefined(this.inputWrapper)) {
|
|
6828
|
+
this.popupObj.refreshPosition(this.inputWrapper.container);
|
|
6829
|
+
}
|
|
6830
|
+
}, 0);
|
|
6831
|
+
});
|
|
6832
|
+
this.popupPositionObserver.observe(observerTarget, {
|
|
6833
|
+
childList: true,
|
|
6834
|
+
subtree: true,
|
|
6835
|
+
attributes: true,
|
|
6836
|
+
attributeFilter: ['style', 'class']
|
|
6837
|
+
});
|
|
6838
|
+
}
|
|
6839
|
+
destroyPopupPositionObserver() {
|
|
6840
|
+
if (this.popupPositionRefreshTimer) {
|
|
6841
|
+
clearTimeout(this.popupPositionRefreshTimer);
|
|
6842
|
+
this.popupPositionRefreshTimer = null;
|
|
6843
|
+
}
|
|
6844
|
+
if (this.popupPositionObserver) {
|
|
6845
|
+
this.popupPositionObserver.disconnect();
|
|
6846
|
+
this.popupPositionObserver = null;
|
|
6847
|
+
}
|
|
6848
|
+
}
|
|
6804
6849
|
destroyPopup() {
|
|
6805
6850
|
this.isPopupOpen = false;
|
|
6806
6851
|
this.isFilterFocus = false;
|
|
6807
6852
|
this.inputElement.removeAttribute('aria-controls');
|
|
6853
|
+
this.destroyPopupPositionObserver();
|
|
6808
6854
|
if (this.popupObj) {
|
|
6809
6855
|
if (this.resizer) {
|
|
6810
6856
|
EventHandler.remove(this.resizer, 'mousedown', this.startResizing);
|
|
@@ -6834,6 +6880,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6834
6880
|
if (isNullOrUndefined(this.inputElement.getAttribute('type'))) {
|
|
6835
6881
|
this.inputElement.setAttribute('type', 'text');
|
|
6836
6882
|
}
|
|
6883
|
+
if (this.getModuleName() === 'dropdownlist') {
|
|
6884
|
+
this.inputElement.setAttribute('aria-label', this.getModuleName());
|
|
6885
|
+
}
|
|
6837
6886
|
this.inputElement.setAttribute('aria-expanded', 'false');
|
|
6838
6887
|
}
|
|
6839
6888
|
else {
|
|
@@ -6920,7 +6969,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6920
6969
|
if (!this.targetElement().hasAttribute('aria-label')) {
|
|
6921
6970
|
attributes(this.targetElement(), { 'aria-label': this.getModuleName() });
|
|
6922
6971
|
}
|
|
6923
|
-
if (!this.inputElement.hasAttribute('aria-labelledby')) {
|
|
6972
|
+
if (this.getModuleName() !== 'dropdownlist' && !this.inputElement.hasAttribute('aria-labelledby')) {
|
|
6924
6973
|
this.inputElement.setAttribute('aria-labelledby', this.hiddenElement.id);
|
|
6925
6974
|
}
|
|
6926
6975
|
this.inputElement.setAttribute('aria-expanded', 'false');
|
|
@@ -6928,9 +6977,19 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6928
6977
|
attributes(this.targetElement(), this.getAriaAttributes());
|
|
6929
6978
|
this.updateDataAttribute(this.htmlAttributes);
|
|
6930
6979
|
this.setHTMLAttributes();
|
|
6931
|
-
if (this.targetElement() === this.inputElement) {
|
|
6980
|
+
if (this.getModuleName() !== 'dropdownlist' && this.targetElement() === this.inputElement) {
|
|
6932
6981
|
this.inputElement.removeAttribute('aria-labelledby');
|
|
6933
6982
|
}
|
|
6983
|
+
if (this.getModuleName() === 'dropdownlist' && this.targetElement() === this.inputWrapper.container) {
|
|
6984
|
+
const floatLabel = this.inputWrapper.container.getElementsByClassName('e-float-text')[0];
|
|
6985
|
+
if (!isNullOrUndefined(this.element.id) && this.element.id !== '' && !isNullOrUndefined(floatLabel)) {
|
|
6986
|
+
floatLabel.id = 'label_' + this.element.id.replace(/ /g, '_');
|
|
6987
|
+
attributes(this.inputWrapper.container, { 'aria-labelledby': floatLabel.id });
|
|
6988
|
+
}
|
|
6989
|
+
else {
|
|
6990
|
+
this.inputWrapper.container.removeAttribute('aria-labelledby');
|
|
6991
|
+
}
|
|
6992
|
+
}
|
|
6934
6993
|
if (this.value !== null || this.activeIndex !== null || this.text !== null) {
|
|
6935
6994
|
if (this.enableVirtualization) {
|
|
6936
6995
|
this.listItemHeight = this.getListHeight();
|
|
@@ -6989,7 +7048,12 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6989
7048
|
const floatLabelElement = this.inputWrapper.container.getElementsByClassName('e-float-text')[0];
|
|
6990
7049
|
if (!isNullOrUndefined(this.element.id) && this.element.id !== '' && !isNullOrUndefined(floatLabelElement)) {
|
|
6991
7050
|
floatLabelElement.id = 'label_' + this.element.id.replace(/ /g, '_');
|
|
6992
|
-
attributes(this.
|
|
7051
|
+
attributes(this.getModuleName() === 'dropdownlist'
|
|
7052
|
+
? this.inputWrapper.container
|
|
7053
|
+
: this.inputElement, { 'aria-labelledby': floatLabelElement.id });
|
|
7054
|
+
if (this.getModuleName() === 'dropdownlist' && this.inputElement) {
|
|
7055
|
+
this.inputElement.removeAttribute('aria-labelledby');
|
|
7056
|
+
}
|
|
6993
7057
|
}
|
|
6994
7058
|
this.renderComplete();
|
|
6995
7059
|
this.listItemHeight = this.getListHeight();
|
|
@@ -7205,7 +7269,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
7205
7269
|
if (label) {
|
|
7206
7270
|
label.remove();
|
|
7207
7271
|
}
|
|
7208
|
-
this.
|
|
7272
|
+
this.inputWrapper.container.removeAttribute('aria-labelledby');
|
|
7209
7273
|
}
|
|
7210
7274
|
else if (this.floatLabelType !== 'Never' && !this.value) {
|
|
7211
7275
|
let floatLabel = this.inputWrapper.container
|
|
@@ -7237,7 +7301,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
7237
7301
|
}
|
|
7238
7302
|
floatLabel.style.width = this.inputElement.offsetWidth + 'px';
|
|
7239
7303
|
floatLabel.textContent = newProp.placeholder;
|
|
7240
|
-
this.
|
|
7304
|
+
this.inputWrapper.container.setAttribute('aria-labelledby', floatLabel.id);
|
|
7241
7305
|
}
|
|
7242
7306
|
}
|
|
7243
7307
|
break;
|
|
@@ -7450,14 +7514,28 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
7450
7514
|
this.updateSelectElementData(this.allowFiltering);
|
|
7451
7515
|
}
|
|
7452
7516
|
break;
|
|
7453
|
-
case 'floatLabelType':
|
|
7517
|
+
case 'floatLabelType': {
|
|
7454
7518
|
Input.removeFloating(this.inputWrapper);
|
|
7455
7519
|
Input.addFloating(this.inputElement, newProp.floatLabelType, this.placeholder, this.createElement);
|
|
7456
7520
|
if (!isNullOrUndefined(this.inputWrapper.buttons[0]) &&
|
|
7457
7521
|
this.inputWrapper.container.getElementsByClassName('e-float-text-overflow')[0] && this.floatLabelType !== 'Never') {
|
|
7458
7522
|
this.inputWrapper.container.getElementsByClassName('e-float-text-overflow')[0].classList.add('e-icon');
|
|
7459
7523
|
}
|
|
7524
|
+
if (this.getModuleName() === 'dropdownlist') {
|
|
7525
|
+
const floatLabelElement = this.inputWrapper.container.getElementsByClassName('e-float-text')[0];
|
|
7526
|
+
if (!isNullOrUndefined(this.element.id) &&
|
|
7527
|
+
this.element.id !== '' && !isNullOrUndefined(floatLabelElement)) {
|
|
7528
|
+
floatLabelElement.id = 'label_' + this.element.id.replace(/ /g, '_');
|
|
7529
|
+
attributes(this.inputWrapper.container, {
|
|
7530
|
+
'aria-labelledby': floatLabelElement.id
|
|
7531
|
+
});
|
|
7532
|
+
}
|
|
7533
|
+
else {
|
|
7534
|
+
this.inputWrapper.container.removeAttribute('aria-labelledby');
|
|
7535
|
+
}
|
|
7536
|
+
}
|
|
7460
7537
|
break;
|
|
7538
|
+
}
|
|
7461
7539
|
case 'showClearButton':
|
|
7462
7540
|
if (!this.inputWrapper.clearButton) {
|
|
7463
7541
|
Input.setClearButton(newProp.showClearButton, this.inputElement, this.inputWrapper, null, this.createElement);
|
|
@@ -7558,7 +7636,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
7558
7636
|
}
|
|
7559
7637
|
if (label && this.getModuleName() === 'dropdownlist' && (!this.placeholder || this.placeholder.trim() === '')) {
|
|
7560
7638
|
label.remove();
|
|
7561
|
-
this.
|
|
7639
|
+
this.inputWrapper.container.removeAttribute('aria-labelledby');
|
|
7562
7640
|
}
|
|
7563
7641
|
}
|
|
7564
7642
|
/**
|
|
@@ -7670,6 +7748,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
7670
7748
|
*/
|
|
7671
7749
|
hidePopup(e) {
|
|
7672
7750
|
/* eslint-enable valid-jsdoc, jsdoc/require-param */
|
|
7751
|
+
this.destroyPopupPositionObserver();
|
|
7673
7752
|
if (this.isEscapeKey && this.getModuleName() === 'dropdownlist') {
|
|
7674
7753
|
if (!isNullOrUndefined(this.inputElement)) {
|
|
7675
7754
|
Input.setValue(this.text, this.inputElement, this.floatLabelType, this.showClearButton);
|
|
@@ -7823,6 +7902,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
7823
7902
|
* @returns {void}
|
|
7824
7903
|
*/
|
|
7825
7904
|
destroy() {
|
|
7905
|
+
this.destroyPopupPositionObserver();
|
|
7826
7906
|
this.isActive = false;
|
|
7827
7907
|
this.isStaleFilter = false;
|
|
7828
7908
|
this.filterGeneration = null;
|
|
@@ -13876,6 +13956,7 @@ const CHIP_CLOSE$1 = 'e-chips-close';
|
|
|
13876
13956
|
const CHIP_SELECTED = 'e-chip-selected';
|
|
13877
13957
|
const SEARCHBOX_WRAPPER = 'e-searcher';
|
|
13878
13958
|
const DELIMITER_VIEW_WRAPPER = 'e-delimiter';
|
|
13959
|
+
const NULL_CHIP = 'e-chip-null';
|
|
13879
13960
|
const ZERO_SIZE = 'e-zero-size';
|
|
13880
13961
|
const REMAIN_WRAPPER$1 = 'e-remain';
|
|
13881
13962
|
const CLOSEICON_CLASS$1 = 'e-chips-close e-close-hooker';
|
|
@@ -14336,16 +14417,24 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
14336
14417
|
return;
|
|
14337
14418
|
}
|
|
14338
14419
|
const elements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP$1);
|
|
14339
|
-
const
|
|
14420
|
+
const lastElement = elements[elements.length - 1];
|
|
14421
|
+
const isNullChip = lastElement.classList.contains(NULL_CHIP);
|
|
14422
|
+
let customValue = null;
|
|
14340
14423
|
if (!isNullOrUndefined(this.value)) {
|
|
14341
14424
|
this.tempValues = this.allowObjectBinding ? this.value.slice() : this.value.slice();
|
|
14342
14425
|
}
|
|
14343
|
-
|
|
14344
|
-
|
|
14345
|
-
|
|
14346
|
-
|
|
14347
|
-
|
|
14348
|
-
customValue =
|
|
14426
|
+
if (isNullChip) {
|
|
14427
|
+
customValue = null;
|
|
14428
|
+
}
|
|
14429
|
+
else {
|
|
14430
|
+
const value = lastElement.getAttribute('data-value');
|
|
14431
|
+
customValue = this.allowObjectBinding ? this.enableVirtualization ?
|
|
14432
|
+
this.getVirtualDataByValue(this.getFormattedValue(value)) :
|
|
14433
|
+
this.getDataByValue(this.getFormattedValue(value)) : this.getFormattedValue(value);
|
|
14434
|
+
if (this.allowCustomValue && (value !== 'false' && customValue === false || (!isNullOrUndefined(customValue) &&
|
|
14435
|
+
customValue.toString() === 'NaN'))) {
|
|
14436
|
+
customValue = value;
|
|
14437
|
+
}
|
|
14349
14438
|
}
|
|
14350
14439
|
this.removeValue(customValue, e);
|
|
14351
14440
|
this.removeChipSelection();
|
|
@@ -14685,48 +14774,54 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
14685
14774
|
HIDE_LIST :
|
|
14686
14775
|
dropDownBaseClasses.selected;
|
|
14687
14776
|
if (!isNullOrUndefined(this.value)) {
|
|
14688
|
-
|
|
14689
|
-
|
|
14690
|
-
|
|
14691
|
-
|
|
14692
|
-
|
|
14693
|
-
|
|
14694
|
-
|
|
14695
|
-
|
|
14696
|
-
|
|
14697
|
-
|
|
14698
|
-
addClass([element
|
|
14699
|
-
|
|
14700
|
-
|
|
14701
|
-
|
|
14702
|
-
|
|
14703
|
-
|
|
14704
|
-
removeClass([element], dropDownBaseClasses.focus);
|
|
14705
|
-
const listEle = element.parentElement.querySelectorAll('.' +
|
|
14706
|
-
dropDownBaseClasses.li + ':not(.' + HIDE_LIST + ')' + ':not(.' + DISABLED$1 + ')');
|
|
14707
|
-
if (listEle.length > 0) {
|
|
14708
|
-
addClass([listEle[0]], dropDownBaseClasses.focus);
|
|
14709
|
-
this.updateAriaActiveDescendant();
|
|
14777
|
+
const isOnlyNull = this.isValueOnlyNull();
|
|
14778
|
+
if (!isOnlyNull) {
|
|
14779
|
+
for (let index = 0; index < this.value.length; index++) {
|
|
14780
|
+
value = this.allowObjectBinding ? getValue((this.fields.value) ? this.fields.value : '', this.value[index]) :
|
|
14781
|
+
this.value[index];
|
|
14782
|
+
if (isNullOrUndefined(value)) {
|
|
14783
|
+
continue;
|
|
14784
|
+
}
|
|
14785
|
+
element = this.findListElement(this.list, 'li', 'data-value', value);
|
|
14786
|
+
if (element) {
|
|
14787
|
+
addClass([element], className);
|
|
14788
|
+
if (this.hideSelectedItem && element.previousSibling
|
|
14789
|
+
&& element.previousElementSibling.classList.contains(dropDownBaseClasses.group)
|
|
14790
|
+
&& (!element.nextElementSibling ||
|
|
14791
|
+
element.nextElementSibling.classList.contains(dropDownBaseClasses.group))) {
|
|
14792
|
+
addClass([element.previousElementSibling], className);
|
|
14710
14793
|
}
|
|
14711
|
-
|
|
14712
|
-
|
|
14713
|
-
|
|
14714
|
-
|
|
14715
|
-
|
|
14794
|
+
if (this.hideSelectedItem && this.fields.groupBy && !element.previousElementSibling.classList.contains(HIDE_LIST)) {
|
|
14795
|
+
this.hideGroupItem(value);
|
|
14796
|
+
}
|
|
14797
|
+
if (this.hideSelectedItem && element.classList.contains(dropDownBaseClasses.focus)) {
|
|
14798
|
+
removeClass([element], dropDownBaseClasses.focus);
|
|
14799
|
+
const listEle = element.parentElement.querySelectorAll('.' +
|
|
14800
|
+
dropDownBaseClasses.li + ':not(.' + HIDE_LIST + ')' + ':not(.' + DISABLED$1 + ')');
|
|
14801
|
+
if (listEle.length > 0) {
|
|
14802
|
+
addClass([listEle[0]], dropDownBaseClasses.focus);
|
|
14803
|
+
this.updateAriaActiveDescendant();
|
|
14804
|
+
}
|
|
14805
|
+
else {
|
|
14806
|
+
//EJ2-57588 - for this task, we prevent the ul element cloning ( this.ulElement = this.ulElement.cloneNode ? <HTMLElement>this.ulElement.cloneNode(true) : this.ulElement;)
|
|
14807
|
+
if (!(this.list && this.list.querySelectorAll('.' + dropDownBaseClasses.li).length > 0)) {
|
|
14808
|
+
this.l10nUpdate();
|
|
14809
|
+
addClass([this.list], dropDownBaseClasses.noData);
|
|
14810
|
+
}
|
|
14716
14811
|
}
|
|
14717
14812
|
}
|
|
14718
|
-
|
|
14719
|
-
|
|
14720
|
-
|
|
14721
|
-
|
|
14722
|
-
|
|
14723
|
-
|
|
14724
|
-
|
|
14725
|
-
|
|
14726
|
-
|
|
14727
|
-
|
|
14728
|
-
|
|
14729
|
-
|
|
14813
|
+
element.setAttribute('aria-selected', 'true');
|
|
14814
|
+
if (this.mode === 'CheckBox' && element.classList.contains('e-active')) {
|
|
14815
|
+
const ariaValue = element.getElementsByClassName('e-check').length;
|
|
14816
|
+
if (ariaValue === 0) {
|
|
14817
|
+
const args = {
|
|
14818
|
+
module: 'CheckBoxSelection',
|
|
14819
|
+
enable: this.mode === 'CheckBox',
|
|
14820
|
+
li: element,
|
|
14821
|
+
e: null
|
|
14822
|
+
};
|
|
14823
|
+
this.notify('updatelist', args);
|
|
14824
|
+
}
|
|
14730
14825
|
}
|
|
14731
14826
|
}
|
|
14732
14827
|
}
|
|
@@ -15514,13 +15609,26 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
15514
15609
|
const activeItem = !isNullOrUndefined(this.ulElement)
|
|
15515
15610
|
? this.ulElement.getElementsByClassName('e-item-focus')[0]
|
|
15516
15611
|
: null;
|
|
15612
|
+
const filterInput = this.allowFiltering && !isNullOrUndefined(this.popupWrapper)
|
|
15613
|
+
? this.popupWrapper.querySelector('.' + FILTERINPUT)
|
|
15614
|
+
: null;
|
|
15517
15615
|
if (!isNullOrUndefined(activeItem) && this.isPopupOpen()) {
|
|
15518
15616
|
attributes(this.inputElement, {
|
|
15519
15617
|
'aria-activedescendant': activeItem.id
|
|
15520
15618
|
});
|
|
15619
|
+
if (filterInput) {
|
|
15620
|
+
attributes(filterInput, {
|
|
15621
|
+
'aria-activedescendant': activeItem.id
|
|
15622
|
+
});
|
|
15623
|
+
}
|
|
15521
15624
|
}
|
|
15522
|
-
else
|
|
15523
|
-
this.inputElement
|
|
15625
|
+
else {
|
|
15626
|
+
if (!isNullOrUndefined(this.inputElement)) {
|
|
15627
|
+
this.inputElement.removeAttribute('aria-activedescendant');
|
|
15628
|
+
}
|
|
15629
|
+
if (filterInput) {
|
|
15630
|
+
filterInput.removeAttribute('aria-activedescendant');
|
|
15631
|
+
}
|
|
15524
15632
|
}
|
|
15525
15633
|
}
|
|
15526
15634
|
pageUpSelection(steps, isVirtualKeyAction) {
|
|
@@ -16344,9 +16452,16 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
16344
16452
|
this.removeChipSelection();
|
|
16345
16453
|
this.addChipSelection(temp, e);
|
|
16346
16454
|
}
|
|
16347
|
-
const
|
|
16348
|
-
|
|
16349
|
-
|
|
16455
|
+
const isNullChip = selectedElem.classList.contains(NULL_CHIP);
|
|
16456
|
+
let currentChip;
|
|
16457
|
+
if (isNullChip) {
|
|
16458
|
+
currentChip = null;
|
|
16459
|
+
}
|
|
16460
|
+
else {
|
|
16461
|
+
currentChip = this.allowObjectBinding ?
|
|
16462
|
+
this.getDataByValue(this.getFormattedValue(selectedElem.getAttribute('data-value'))) :
|
|
16463
|
+
selectedElem.getAttribute('data-value');
|
|
16464
|
+
}
|
|
16350
16465
|
this.removeValue(currentChip, e);
|
|
16351
16466
|
this.updateDelimeter(this.delimiterChar, e);
|
|
16352
16467
|
this.makeTextBoxEmpty();
|
|
@@ -16601,15 +16716,18 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
16601
16716
|
const type = this.typeOfData(this.selectedListData).typeof;
|
|
16602
16717
|
if (type === 'string' || type === 'number' || type === 'boolean') {
|
|
16603
16718
|
for (const item of this.selectedListData) {
|
|
16604
|
-
if (
|
|
16719
|
+
if (item === value || (isNullOrUndefined(item) && value === null)) {
|
|
16605
16720
|
return item;
|
|
16606
16721
|
}
|
|
16607
16722
|
}
|
|
16608
16723
|
}
|
|
16609
16724
|
else {
|
|
16610
16725
|
for (const item of this.selectedListData) {
|
|
16611
|
-
if (
|
|
16612
|
-
|
|
16726
|
+
if (item !== undefined) {
|
|
16727
|
+
const itemValue = getValue((this.fields.value ? this.fields.value : 'value'), item);
|
|
16728
|
+
if (itemValue === value || (isNullOrUndefined(itemValue) && value === null)) {
|
|
16729
|
+
return item;
|
|
16730
|
+
}
|
|
16613
16731
|
}
|
|
16614
16732
|
}
|
|
16615
16733
|
}
|
|
@@ -16622,13 +16740,21 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
16622
16740
|
}
|
|
16623
16741
|
if (this.enabled && !this.readonly) {
|
|
16624
16742
|
const element = e.target.parentElement;
|
|
16625
|
-
const
|
|
16626
|
-
let value
|
|
16627
|
-
|
|
16628
|
-
|
|
16629
|
-
|
|
16630
|
-
|
|
16631
|
-
|
|
16743
|
+
const isNullChip = element.classList.contains(NULL_CHIP);
|
|
16744
|
+
let value;
|
|
16745
|
+
if (isNullChip) {
|
|
16746
|
+
value = null;
|
|
16747
|
+
}
|
|
16748
|
+
else {
|
|
16749
|
+
const customVal = element.getAttribute('data-value');
|
|
16750
|
+
const formattedVal = this.getFormattedValue(customVal);
|
|
16751
|
+
value = this.allowObjectBinding ? this.enableVirtualization ?
|
|
16752
|
+
this.getVirtualDataByValue(formattedVal) :
|
|
16753
|
+
this.getDataByValue(formattedVal) : formattedVal;
|
|
16754
|
+
if (this.allowCustomValue && ((customVal !== 'false' && value === false) ||
|
|
16755
|
+
(!isNullOrUndefined(value) && value.toString() === 'NaN'))) {
|
|
16756
|
+
value = customVal;
|
|
16757
|
+
}
|
|
16632
16758
|
}
|
|
16633
16759
|
if (this.isPopupOpen() && this.mode !== 'CheckBox') {
|
|
16634
16760
|
this.hidePopup(e);
|
|
@@ -16637,6 +16763,14 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
16637
16763
|
this.inputElement.focus();
|
|
16638
16764
|
}
|
|
16639
16765
|
this.removeValue(value, e);
|
|
16766
|
+
if (!isNullChip) {
|
|
16767
|
+
const findValue = this.allowObjectBinding ? getValue((this.fields.value) ? this.fields.value : '', value) : value;
|
|
16768
|
+
if (isNullOrUndefined(this.findListElement(this.list, 'li', 'data-value', findValue)) &&
|
|
16769
|
+
this.mainList && this.listData) {
|
|
16770
|
+
const list = this.mainList.cloneNode ? this.mainList.cloneNode(true) : this.mainList;
|
|
16771
|
+
this.onActionComplete(list, this.mainData);
|
|
16772
|
+
}
|
|
16773
|
+
}
|
|
16640
16774
|
value = this.allowObjectBinding ? getValue((this.fields.value) ? this.fields.value : '', value) : value;
|
|
16641
16775
|
if (isNullOrUndefined(this.findListElement(this.list, 'li', 'data-value', value)) &&
|
|
16642
16776
|
this.mainList && this.listData) {
|
|
@@ -16714,8 +16848,17 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
16714
16848
|
this.overAllWrapper.classList.contains('e-dbrd-cstyle');
|
|
16715
16849
|
}
|
|
16716
16850
|
removeValue(value, eve, length, isClearAll) {
|
|
16717
|
-
let index =
|
|
16718
|
-
|
|
16851
|
+
let index = -1;
|
|
16852
|
+
if (value === null) {
|
|
16853
|
+
index = this.value.indexOf(null);
|
|
16854
|
+
}
|
|
16855
|
+
else if (this.allowObjectBinding) {
|
|
16856
|
+
index = this.indexOfObjectInArray(value, this.value);
|
|
16857
|
+
}
|
|
16858
|
+
else {
|
|
16859
|
+
const formattedValue = this.getFormattedValue(value);
|
|
16860
|
+
index = this.value.indexOf(formattedValue);
|
|
16861
|
+
}
|
|
16719
16862
|
if (index === -1 && this.allowCustomValue && !isNullOrUndefined(value)) {
|
|
16720
16863
|
index = this.allowObjectBinding ? this.indexOfObjectInArray(value, this.value) :
|
|
16721
16864
|
this.value.indexOf(value.toString());
|
|
@@ -16901,7 +17044,13 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
16901
17044
|
removeChip(value, isClearAll) {
|
|
16902
17045
|
if (this.chipCollectionWrapper) {
|
|
16903
17046
|
if (!(this.enableVirtualization && isClearAll)) {
|
|
16904
|
-
|
|
17047
|
+
let element;
|
|
17048
|
+
if (value === null) {
|
|
17049
|
+
element = this.chipCollectionWrapper.querySelector('span.' + NULL_CHIP);
|
|
17050
|
+
}
|
|
17051
|
+
else {
|
|
17052
|
+
element = this.findListElement(this.chipCollectionWrapper, 'span', 'data-value', value);
|
|
17053
|
+
}
|
|
16905
17054
|
if (element) {
|
|
16906
17055
|
remove(element);
|
|
16907
17056
|
}
|
|
@@ -16919,7 +17068,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
16919
17068
|
}
|
|
16920
17069
|
}
|
|
16921
17070
|
updateChipStatus() {
|
|
16922
|
-
|
|
17071
|
+
const showChips = this.value && this.value.length && !this.isValueOnlyNull();
|
|
17072
|
+
if (showChips) {
|
|
16923
17073
|
if (!isNullOrUndefined(this.chipCollectionWrapper)) {
|
|
16924
17074
|
(this.chipCollectionWrapper.style.display = '');
|
|
16925
17075
|
}
|
|
@@ -17146,10 +17296,21 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
17146
17296
|
}
|
|
17147
17297
|
getChip(data, value, e) {
|
|
17148
17298
|
let itemData = { text: value, value: value };
|
|
17299
|
+
const isNullValue = value === null;
|
|
17300
|
+
const chipAttrs = { 'title': data, 'role': 'option', 'aria-selected': 'true' };
|
|
17301
|
+
if (isNullValue) {
|
|
17302
|
+
chipAttrs['data-value'] = 'null';
|
|
17303
|
+
}
|
|
17304
|
+
else {
|
|
17305
|
+
chipAttrs['data-value'] = value;
|
|
17306
|
+
}
|
|
17149
17307
|
const chip = this.createElement('span', {
|
|
17150
|
-
className: CHIP$1,
|
|
17151
|
-
attrs:
|
|
17308
|
+
className: CHIP$1 + (isNullValue ? ' ' + NULL_CHIP : ''),
|
|
17309
|
+
attrs: chipAttrs
|
|
17152
17310
|
});
|
|
17311
|
+
if (isNullValue) {
|
|
17312
|
+
addClass([chip], NULL_CHIP);
|
|
17313
|
+
}
|
|
17153
17314
|
let compiledString;
|
|
17154
17315
|
const chipContent = this.createElement('span', { className: CHIP_CONTENT$1 });
|
|
17155
17316
|
const chipClose = this.createElement('span', { className: CHIP_CLOSE$1, attrs: { 'aria-hidden': 'true' } });
|
|
@@ -17171,7 +17332,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
17171
17332
|
this.renderReactTemplates();
|
|
17172
17333
|
}
|
|
17173
17334
|
else if (this.enableHtmlSanitizer) {
|
|
17174
|
-
|
|
17335
|
+
const displayText = (data === 'null' || data === 'undefined') ? 'null' : data;
|
|
17336
|
+
chipContent.innerText = displayText;
|
|
17175
17337
|
}
|
|
17176
17338
|
else {
|
|
17177
17339
|
chipContent.innerHTML = this.encodeHtmlEntities(data.toString());
|
|
@@ -17973,6 +18135,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
17973
18135
|
const value = this.allowObjectBinding ?
|
|
17974
18136
|
getValue(((this.fields.value) ? this.fields.value : ''), this.value[this.value.length - 1]) :
|
|
17975
18137
|
this.value[this.value.length - 1];
|
|
18138
|
+
if (value === null && this.value.length === 1) {
|
|
18139
|
+
break;
|
|
18140
|
+
}
|
|
17976
18141
|
if (this.isRemoveSelection && this.text) {
|
|
17977
18142
|
data = this.text.replace(/,/g, delimiterChar + ' ') + delimiterChar + ' ';
|
|
17978
18143
|
text = this.text.split(delimiterChar);
|
|
@@ -18110,6 +18275,18 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
18110
18275
|
}
|
|
18111
18276
|
return null;
|
|
18112
18277
|
}
|
|
18278
|
+
isValueOnlyNull() {
|
|
18279
|
+
if (!this.value || this.value.length === 0) {
|
|
18280
|
+
return false;
|
|
18281
|
+
}
|
|
18282
|
+
return this.value.every((v) => v === null || v === undefined);
|
|
18283
|
+
}
|
|
18284
|
+
getTextByValue(value) {
|
|
18285
|
+
if (value === null || value === undefined) {
|
|
18286
|
+
return 'null';
|
|
18287
|
+
}
|
|
18288
|
+
return super.getTextByValue(value);
|
|
18289
|
+
}
|
|
18113
18290
|
initialValueUpdate(listItems, isInitialVirtualData, isInitialRender) {
|
|
18114
18291
|
if (this.list) {
|
|
18115
18292
|
let text;
|
|
@@ -18121,7 +18298,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
18121
18298
|
this.removeListSelection();
|
|
18122
18299
|
const formElement = closest(this.inputElement, 'form');
|
|
18123
18300
|
if (!isNullOrUndefined(this.value)) {
|
|
18124
|
-
for (let index = 0;
|
|
18301
|
+
for (let index = 0; index < this.value.length; index++) {
|
|
18302
|
+
if (this.isValueOnlyNull()) {
|
|
18303
|
+
continue;
|
|
18304
|
+
}
|
|
18125
18305
|
value = this.allowObjectBinding ?
|
|
18126
18306
|
getValue(((this.fields.value) ? this.fields.value : ''), this.value[index]) :
|
|
18127
18307
|
this.value[index];
|
|
@@ -18173,10 +18353,15 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
18173
18353
|
((!(this.dataSource instanceof DataManager)) ||
|
|
18174
18354
|
(this.dataSource instanceof DataManager && isInitialVirtualData)) && (!this.isAngular || !isInitialRender ||
|
|
18175
18355
|
(isNullOrUndefined(formElement) && listItems && listItems.length > 0))
|
|
18176
|
-
&& !(this.mode === 'CheckBox' && this.enableVirtualization && this.value.length > this.getSummaryTagThreshold())
|
|
18356
|
+
&& !(this.mode === 'CheckBox' && this.enableVirtualization && this.value.length > this.getSummaryTagThreshold())
|
|
18357
|
+
&& value !== null) {
|
|
18177
18358
|
this.value.splice(index, 1);
|
|
18178
18359
|
index -= 1;
|
|
18179
18360
|
}
|
|
18361
|
+
if (value === null && isNullOrUndefined(text)) {
|
|
18362
|
+
text = this.getTextByValue(value);
|
|
18363
|
+
isCustomData = true;
|
|
18364
|
+
}
|
|
18180
18365
|
}
|
|
18181
18366
|
else {
|
|
18182
18367
|
text = this.getTextByValue(value);
|
|
@@ -18187,20 +18372,23 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
18187
18372
|
this.listData = savedListData;
|
|
18188
18373
|
}
|
|
18189
18374
|
}
|
|
18190
|
-
|
|
18375
|
+
const shouldDisplayNull = (value === null && this.value.length > 1);
|
|
18376
|
+
const shouldProcessElement = ((element && (element.getAttribute('aria-selected') !== 'true')) ||
|
|
18191
18377
|
(element && (element.getAttribute('aria-selected') === 'true' && this.hideSelectedItem) &&
|
|
18192
|
-
(this.mode === 'Box' || this.mode === 'Default'))) ||
|
|
18193
|
-
|
|
18378
|
+
(this.mode === 'Box' || this.mode === 'Default'))) || (this.enableVirtualization && (text != null ||
|
|
18379
|
+
shouldDisplayNull) && !isCustomData && (value != null || this.value.length > 1));
|
|
18380
|
+
if (shouldProcessElement) {
|
|
18194
18381
|
const currentText = [];
|
|
18195
|
-
const
|
|
18382
|
+
const displayText = value === null && (text === null || text === undefined) ? 'null' : text;
|
|
18383
|
+
const textValues = this.isDynamicRemoteVirtualData && displayText != null && displayText !== '' && index === 0 ? displayText : this.text != null && this.text !== '' && !this.text.includes(displayText) ? this.text + this.delimiterChar + displayText : displayText;
|
|
18196
18384
|
currentText.push(textValues);
|
|
18197
18385
|
this.setProperties({ text: currentText.toString() }, true);
|
|
18198
|
-
this.addChip(
|
|
18386
|
+
this.addChip(displayText, value);
|
|
18199
18387
|
this.addListSelection(element);
|
|
18200
18388
|
}
|
|
18201
|
-
else if ((!this.enableVirtualization && value && this.allowCustomValue) ||
|
|
18389
|
+
else if ((!this.enableVirtualization && (value || this.value.length > 1) && this.allowCustomValue) ||
|
|
18202
18390
|
(this.enableVirtualization &&
|
|
18203
|
-
value &&
|
|
18391
|
+
(value || this.value.length > 1) &&
|
|
18204
18392
|
this.allowCustomValue &&
|
|
18205
18393
|
((!(this.dataSource instanceof DataManager)) ||
|
|
18206
18394
|
(this.dataSource instanceof DataManager && isInitialVirtualData)))) {
|
|
@@ -18237,10 +18425,11 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
18237
18425
|
this.wireListEvents();
|
|
18238
18426
|
}
|
|
18239
18427
|
const currentText = [];
|
|
18240
|
-
const
|
|
18428
|
+
const displayText = value === null && (text === null || text === undefined) ? 'null' : text;
|
|
18429
|
+
const textValues = this.text != null && this.text !== '' ? this.text + this.delimiterChar + displayText : displayText;
|
|
18241
18430
|
currentText.push(textValues);
|
|
18242
18431
|
this.setProperties({ text: currentText.toString() }, true);
|
|
18243
|
-
this.addChip(
|
|
18432
|
+
this.addChip(displayText, value);
|
|
18244
18433
|
this.addListSelection(element);
|
|
18245
18434
|
}
|
|
18246
18435
|
}
|
|
@@ -18314,11 +18503,13 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
18314
18503
|
}
|
|
18315
18504
|
updateListSelection(li, e, length) {
|
|
18316
18505
|
const customVal = li.getAttribute('data-value');
|
|
18506
|
+
const actualVal = customVal === 'null' ? null : customVal;
|
|
18317
18507
|
let value = this.allowObjectBinding ?
|
|
18318
|
-
this.getDataByValue(this.getFormattedValue(
|
|
18508
|
+
this.getDataByValue(this.getFormattedValue(actualVal))
|
|
18509
|
+
: this.getFormattedValue(actualVal);
|
|
18319
18510
|
if (this.allowCustomValue && ((customVal !== 'false' && value === false) ||
|
|
18320
18511
|
(!isNullOrUndefined(value) && value.toString() === 'NaN'))) {
|
|
18321
|
-
value =
|
|
18512
|
+
value = actualVal;
|
|
18322
18513
|
}
|
|
18323
18514
|
this.removeHover();
|
|
18324
18515
|
if (!this.value || ((!this.allowObjectBinding && this.value.indexOf(value) === -1) ||
|
|
@@ -18961,7 +19152,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
18961
19152
|
}
|
|
18962
19153
|
this.checkClearIconWidth();
|
|
18963
19154
|
if (!isNullOrUndefined(this.value) && (this.allowCustomValue || (this.listData && this.listData.length > 0))) {
|
|
18964
|
-
for (let index = 0;
|
|
19155
|
+
for (let index = 0; index < this.value.length; index++) {
|
|
19156
|
+
if (this.isValueOnlyNull()) {
|
|
19157
|
+
continue;
|
|
19158
|
+
}
|
|
18965
19159
|
const items = this.text && this.text.split(this.delimiterChar);
|
|
18966
19160
|
if (!this.enableVirtualization) {
|
|
18967
19161
|
data += (index === 0) ? '' : this.delimiterChar + ' ';
|