@syncfusion/ej2-dropdowns 19.4.48 → 19.4.50
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 +12 -0
- 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 +47 -5
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +124 -77
- 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 +10 -0
- package/src/drop-down-list/drop-down-list.js +106 -71
- package/src/list-box/list-box.js +4 -3
- package/src/multi-select/multi-select.js +1 -0
- package/styles/bootstrap-dark.css +2 -1
- package/styles/bootstrap.css +2 -1
- package/styles/bootstrap4.css +2 -1
- package/styles/bootstrap5-dark.css +2 -1
- package/styles/bootstrap5.css +2 -1
- package/styles/fabric-dark.css +2 -1
- package/styles/fabric.css +2 -1
- package/styles/highcontrast-light.css +2 -1
- package/styles/highcontrast.css +2 -1
- package/styles/material-dark.css +2 -1
- package/styles/material.css +2 -1
- package/styles/multi-select/_layout.scss +2 -1
- package/styles/multi-select/bootstrap-dark.css +2 -1
- package/styles/multi-select/bootstrap.css +2 -1
- package/styles/multi-select/bootstrap4.css +2 -1
- package/styles/multi-select/bootstrap5-dark.css +2 -1
- package/styles/multi-select/bootstrap5.css +2 -1
- package/styles/multi-select/fabric-dark.css +2 -1
- package/styles/multi-select/fabric.css +2 -1
- package/styles/multi-select/highcontrast-light.css +2 -1
- package/styles/multi-select/highcontrast.css +2 -1
- package/styles/multi-select/material-dark.css +2 -1
- package/styles/multi-select/material.css +2 -1
- package/styles/multi-select/tailwind-dark.css +2 -1
- package/styles/multi-select/tailwind.css +2 -1
- package/styles/tailwind-dark.css +2 -1
- package/styles/tailwind.css +2 -1
|
@@ -234,6 +234,7 @@ var HEADERTEMPLATE_PROPERTY = 'HeaderTemplate';
|
|
|
234
234
|
var FOOTERTEMPLATE_PROPERTY = 'FooterTemplate';
|
|
235
235
|
var NORECORDSTEMPLATE_PROPERTY = 'NoRecordsTemplate';
|
|
236
236
|
var ACTIONFAILURETEMPLATE_PROPERTY = 'ActionFailureTemplate';
|
|
237
|
+
var HIDE_GROUPLIST = 'e-hide-group-header';
|
|
237
238
|
/**
|
|
238
239
|
* DropDownBase component will generate the list items based on given data and act as base class to drop-down related components
|
|
239
240
|
*/
|
|
@@ -749,6 +750,15 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
749
750
|
}
|
|
750
751
|
this.list.innerHTML = '';
|
|
751
752
|
this.fixedHeaderElement = isNullOrUndefined(this.fixedHeaderElement) ? this.fixedHeaderElement : null;
|
|
753
|
+
if (this.getModuleName() === 'multiselect' && this.properties.allowCustomValue && this.fields.groupBy) {
|
|
754
|
+
for (var i = 0; i < ulElement.childElementCount; i++) {
|
|
755
|
+
if (ulElement.children[i].classList.contains('e-list-group-item')) {
|
|
756
|
+
if (isNullOrUndefined(ulElement.children[i].innerHTML) || ulElement.children[i].innerHTML == "") {
|
|
757
|
+
addClass([ulElement.children[i]], HIDE_GROUPLIST);
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
}
|
|
752
762
|
this.list.appendChild(ulElement);
|
|
753
763
|
this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
|
|
754
764
|
this.ulElement = this.list.querySelector('ul');
|
|
@@ -3682,160 +3692,195 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3682
3692
|
* @returns {void}
|
|
3683
3693
|
*/
|
|
3684
3694
|
DropDownList.prototype.onPropertyChanged = function (newProp, oldProp) {
|
|
3695
|
+
var _this = this;
|
|
3685
3696
|
if (this.getModuleName() === 'dropdownlist') {
|
|
3686
3697
|
this.checkData(newProp);
|
|
3687
3698
|
this.setUpdateInitial(['fields', 'query', 'dataSource'], newProp);
|
|
3688
3699
|
}
|
|
3689
|
-
|
|
3690
|
-
var prop = _a[_i];
|
|
3700
|
+
var _loop_1 = function (prop) {
|
|
3691
3701
|
switch (prop) {
|
|
3692
3702
|
case 'query':
|
|
3693
3703
|
case 'dataSource': break;
|
|
3694
3704
|
case 'htmlAttributes':
|
|
3695
|
-
|
|
3705
|
+
this_1.setHTMLAttributes();
|
|
3696
3706
|
break;
|
|
3697
3707
|
case 'width':
|
|
3698
|
-
|
|
3708
|
+
this_1.setEleWidth(newProp.width);
|
|
3699
3709
|
break;
|
|
3700
3710
|
case 'placeholder':
|
|
3701
|
-
Input.setPlaceholder(newProp.placeholder,
|
|
3711
|
+
Input.setPlaceholder(newProp.placeholder, this_1.inputElement);
|
|
3702
3712
|
break;
|
|
3703
3713
|
case 'filterBarPlaceholder':
|
|
3704
|
-
if (
|
|
3705
|
-
Input.setPlaceholder(newProp.filterBarPlaceholder,
|
|
3714
|
+
if (this_1.filterInput) {
|
|
3715
|
+
Input.setPlaceholder(newProp.filterBarPlaceholder, this_1.filterInput);
|
|
3706
3716
|
}
|
|
3707
3717
|
break;
|
|
3708
3718
|
case 'readonly':
|
|
3709
|
-
if (
|
|
3710
|
-
Input.setReadonly(newProp.readonly,
|
|
3719
|
+
if (this_1.getModuleName() !== 'dropdownlist') {
|
|
3720
|
+
Input.setReadonly(newProp.readonly, this_1.inputElement);
|
|
3711
3721
|
}
|
|
3712
|
-
|
|
3722
|
+
this_1.setReadOnly();
|
|
3713
3723
|
break;
|
|
3714
3724
|
case 'cssClass':
|
|
3715
|
-
|
|
3725
|
+
this_1.setCssClass(newProp.cssClass, oldProp.cssClass);
|
|
3716
3726
|
break;
|
|
3717
3727
|
case 'enableRtl':
|
|
3718
|
-
|
|
3728
|
+
this_1.setEnableRtl();
|
|
3719
3729
|
break;
|
|
3720
3730
|
case 'enabled':
|
|
3721
|
-
|
|
3731
|
+
this_1.setEnable();
|
|
3722
3732
|
break;
|
|
3723
3733
|
case 'text':
|
|
3724
3734
|
if (newProp.text === null) {
|
|
3725
|
-
|
|
3735
|
+
this_1.clearAll();
|
|
3726
3736
|
break;
|
|
3727
3737
|
}
|
|
3728
|
-
if (!
|
|
3729
|
-
if (
|
|
3730
|
-
|
|
3738
|
+
if (!this_1.list) {
|
|
3739
|
+
if (this_1.dataSource instanceof DataManager) {
|
|
3740
|
+
this_1.initRemoteRender = true;
|
|
3731
3741
|
}
|
|
3732
|
-
|
|
3733
|
-
}
|
|
3734
|
-
if (!
|
|
3735
|
-
var li =
|
|
3736
|
-
if (!
|
|
3737
|
-
if (
|
|
3738
|
-
|
|
3739
|
-
|
|
3742
|
+
this_1.renderList();
|
|
3743
|
+
}
|
|
3744
|
+
if (!this_1.initRemoteRender) {
|
|
3745
|
+
var li = this_1.getElementByText(newProp.text);
|
|
3746
|
+
if (!this_1.checkValidLi(li)) {
|
|
3747
|
+
if (this_1.liCollections && this_1.liCollections.length === 100 &&
|
|
3748
|
+
this_1.getModuleName() === 'autocomplete' && this_1.listData.length > 100) {
|
|
3749
|
+
this_1.setSelectionData(newProp.text, oldProp.text, 'text');
|
|
3750
|
+
}
|
|
3751
|
+
else if (newProp.text && this_1.dataSource instanceof DataManager) {
|
|
3752
|
+
var listLength_1 = this_1.getItems().length;
|
|
3753
|
+
var checkField = isNullOrUndefined(this_1.fields.text) ? this_1.fields.value : this_1.fields.text;
|
|
3754
|
+
this_1.typedString = '';
|
|
3755
|
+
this_1.dataSource.executeQuery(this_1.getQuery(this_1.query).where(new Predicate(checkField, 'equal', newProp.text)))
|
|
3756
|
+
.then(function (e) {
|
|
3757
|
+
if (e.result.length > 0) {
|
|
3758
|
+
_this.addItem(e.result, listLength_1);
|
|
3759
|
+
_this.updateValues();
|
|
3760
|
+
}
|
|
3761
|
+
else {
|
|
3762
|
+
_this.setOldText(oldProp.text);
|
|
3763
|
+
}
|
|
3764
|
+
});
|
|
3740
3765
|
}
|
|
3741
3766
|
else {
|
|
3742
|
-
|
|
3767
|
+
this_1.setOldText(oldProp.text);
|
|
3743
3768
|
}
|
|
3744
3769
|
}
|
|
3745
|
-
|
|
3770
|
+
this_1.updateInputFields();
|
|
3746
3771
|
}
|
|
3747
3772
|
break;
|
|
3748
3773
|
case 'value':
|
|
3749
3774
|
if (newProp.value === null) {
|
|
3750
|
-
|
|
3775
|
+
this_1.clearAll();
|
|
3751
3776
|
break;
|
|
3752
3777
|
}
|
|
3753
|
-
|
|
3754
|
-
if (!
|
|
3755
|
-
if (
|
|
3756
|
-
|
|
3778
|
+
this_1.notify('beforeValueChange', { newProp: newProp }); // gird component value type change
|
|
3779
|
+
if (!this_1.list) {
|
|
3780
|
+
if (this_1.dataSource instanceof DataManager) {
|
|
3781
|
+
this_1.initRemoteRender = true;
|
|
3757
3782
|
}
|
|
3758
|
-
|
|
3759
|
-
}
|
|
3760
|
-
if (!
|
|
3761
|
-
var item =
|
|
3762
|
-
if (!
|
|
3763
|
-
if (
|
|
3764
|
-
|
|
3765
|
-
|
|
3783
|
+
this_1.renderList();
|
|
3784
|
+
}
|
|
3785
|
+
if (!this_1.initRemoteRender) {
|
|
3786
|
+
var item = this_1.getElementByValue(newProp.value);
|
|
3787
|
+
if (!this_1.checkValidLi(item)) {
|
|
3788
|
+
if (this_1.liCollections && this_1.liCollections.length === 100 &&
|
|
3789
|
+
this_1.getModuleName() === 'autocomplete' && this_1.listData.length > 100) {
|
|
3790
|
+
this_1.setSelectionData(newProp.value, oldProp.value, 'value');
|
|
3791
|
+
}
|
|
3792
|
+
else if (newProp.value && this_1.dataSource instanceof DataManager) {
|
|
3793
|
+
var listLength_2 = this_1.getItems().length;
|
|
3794
|
+
var checkField = isNullOrUndefined(this_1.fields.value) ? this_1.fields.text : this_1.fields.value;
|
|
3795
|
+
this_1.typedString = '';
|
|
3796
|
+
this_1.dataSource.executeQuery(this_1.getQuery(this_1.query).where(new Predicate(checkField, 'equal', newProp.value)))
|
|
3797
|
+
.then(function (e) {
|
|
3798
|
+
if (e.result.length > 0) {
|
|
3799
|
+
_this.addItem(e.result, listLength_2);
|
|
3800
|
+
_this.updateValues();
|
|
3801
|
+
}
|
|
3802
|
+
else {
|
|
3803
|
+
_this.setOldValue(oldProp.value);
|
|
3804
|
+
}
|
|
3805
|
+
});
|
|
3766
3806
|
}
|
|
3767
3807
|
else {
|
|
3768
|
-
|
|
3808
|
+
this_1.setOldValue(oldProp.value);
|
|
3769
3809
|
}
|
|
3770
3810
|
}
|
|
3771
|
-
|
|
3772
|
-
|
|
3811
|
+
this_1.updateInputFields();
|
|
3812
|
+
this_1.preventChange = this_1.isAngular && this_1.preventChange ? !this_1.preventChange : this_1.preventChange;
|
|
3773
3813
|
}
|
|
3774
3814
|
break;
|
|
3775
3815
|
case 'index':
|
|
3776
3816
|
if (newProp.index === null) {
|
|
3777
|
-
|
|
3817
|
+
this_1.clearAll();
|
|
3778
3818
|
break;
|
|
3779
3819
|
}
|
|
3780
|
-
if (!
|
|
3781
|
-
if (
|
|
3782
|
-
|
|
3820
|
+
if (!this_1.list) {
|
|
3821
|
+
if (this_1.dataSource instanceof DataManager) {
|
|
3822
|
+
this_1.initRemoteRender = true;
|
|
3783
3823
|
}
|
|
3784
|
-
|
|
3785
|
-
}
|
|
3786
|
-
if (!
|
|
3787
|
-
var element =
|
|
3788
|
-
if (!
|
|
3789
|
-
if (
|
|
3790
|
-
|
|
3791
|
-
|
|
3824
|
+
this_1.renderList();
|
|
3825
|
+
}
|
|
3826
|
+
if (!this_1.initRemoteRender && this_1.liCollections) {
|
|
3827
|
+
var element = this_1.liCollections[newProp.index];
|
|
3828
|
+
if (!this_1.checkValidLi(element)) {
|
|
3829
|
+
if (this_1.liCollections && this_1.liCollections.length === 100 &&
|
|
3830
|
+
this_1.getModuleName() === 'autocomplete' && this_1.listData.length > 100) {
|
|
3831
|
+
this_1.setSelectionData(newProp.index, oldProp.index, 'index');
|
|
3792
3832
|
}
|
|
3793
3833
|
else {
|
|
3794
|
-
|
|
3834
|
+
this_1.index = oldProp.index;
|
|
3795
3835
|
}
|
|
3796
3836
|
}
|
|
3797
|
-
|
|
3837
|
+
this_1.updateInputFields();
|
|
3798
3838
|
}
|
|
3799
3839
|
break;
|
|
3800
3840
|
case 'footerTemplate':
|
|
3801
|
-
if (
|
|
3802
|
-
|
|
3841
|
+
if (this_1.popupObj) {
|
|
3842
|
+
this_1.setFooterTemplate(this_1.popupObj.element);
|
|
3803
3843
|
}
|
|
3804
3844
|
break;
|
|
3805
3845
|
case 'headerTemplate':
|
|
3806
|
-
if (
|
|
3807
|
-
|
|
3846
|
+
if (this_1.popupObj) {
|
|
3847
|
+
this_1.setHeaderTemplate(this_1.popupObj.element);
|
|
3808
3848
|
}
|
|
3809
3849
|
break;
|
|
3810
3850
|
case 'valueTemplate':
|
|
3811
|
-
if (!isNullOrUndefined(
|
|
3812
|
-
|
|
3851
|
+
if (!isNullOrUndefined(this_1.itemData) && this_1.valueTemplate != null) {
|
|
3852
|
+
this_1.setValueTemplate();
|
|
3813
3853
|
}
|
|
3814
3854
|
break;
|
|
3815
3855
|
case 'allowFiltering':
|
|
3816
|
-
if (
|
|
3817
|
-
|
|
3818
|
-
list:
|
|
3819
|
-
|
|
3820
|
-
|
|
3856
|
+
if (this_1.allowFiltering) {
|
|
3857
|
+
this_1.actionCompleteData = { ulElement: this_1.ulElement,
|
|
3858
|
+
list: this_1.listData, isUpdated: true };
|
|
3859
|
+
this_1.actionData = this_1.actionCompleteData;
|
|
3860
|
+
this_1.updateSelectElementData(this_1.allowFiltering);
|
|
3821
3861
|
}
|
|
3822
3862
|
break;
|
|
3823
3863
|
case 'floatLabelType':
|
|
3824
|
-
Input.removeFloating(
|
|
3825
|
-
Input.addFloating(
|
|
3864
|
+
Input.removeFloating(this_1.inputWrapper);
|
|
3865
|
+
Input.addFloating(this_1.inputElement, newProp.floatLabelType, this_1.placeholder, this_1.createElement);
|
|
3826
3866
|
break;
|
|
3827
3867
|
case 'showClearButton':
|
|
3828
|
-
Input.setClearButton(newProp.showClearButton,
|
|
3829
|
-
|
|
3868
|
+
Input.setClearButton(newProp.showClearButton, this_1.inputElement, this_1.inputWrapper, null, this_1.createElement);
|
|
3869
|
+
this_1.bindClearEvent();
|
|
3830
3870
|
break;
|
|
3831
3871
|
default:
|
|
3832
3872
|
{
|
|
3833
3873
|
// eslint-disable-next-line max-len
|
|
3834
|
-
var ddlProps =
|
|
3835
|
-
_super.prototype.onPropertyChanged.call(
|
|
3874
|
+
var ddlProps = this_1.getPropObject(prop, newProp, oldProp);
|
|
3875
|
+
_super.prototype.onPropertyChanged.call(this_1, ddlProps.newProperty, ddlProps.oldProperty);
|
|
3836
3876
|
}
|
|
3837
3877
|
break;
|
|
3838
3878
|
}
|
|
3879
|
+
};
|
|
3880
|
+
var this_1 = this;
|
|
3881
|
+
for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
|
|
3882
|
+
var prop = _a[_i];
|
|
3883
|
+
_loop_1(prop);
|
|
3839
3884
|
}
|
|
3840
3885
|
};
|
|
3841
3886
|
DropDownList.prototype.checkValidLi = function (element) {
|
|
@@ -12676,6 +12721,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12676
12721
|
this.mainData = null;
|
|
12677
12722
|
this.filterParent = null;
|
|
12678
12723
|
this.ulElement = null;
|
|
12724
|
+
this.mainListCollection = null;
|
|
12679
12725
|
_super.prototype.destroy.call(this);
|
|
12680
12726
|
var temp = ['readonly', 'aria-disabled', 'aria-placeholder', 'placeholder'];
|
|
12681
12727
|
var length = temp.length;
|
|
@@ -14129,9 +14175,10 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
14129
14175
|
}
|
|
14130
14176
|
if (objValue === dataValue) {
|
|
14131
14177
|
itemIdx = this.getIndexByValue(dataValue);
|
|
14132
|
-
|
|
14133
|
-
|
|
14134
|
-
|
|
14178
|
+
var idx = itemIdx === i ? itemIdx : i;
|
|
14179
|
+
liCollections.push(liElement[idx]);
|
|
14180
|
+
removeIdxes.push(idx);
|
|
14181
|
+
removeLiIdxes.push(idx);
|
|
14135
14182
|
}
|
|
14136
14183
|
}
|
|
14137
14184
|
}
|