@syncfusion/ej2-dropdowns 19.4.41 → 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 +20 -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 +61 -7
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +138 -79
- 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 +11 -11
- package/src/drop-down-base/drop-down-base.js +12 -1
- package/src/drop-down-list/drop-down-list.js +107 -72
- package/src/list-box/list-box.js +4 -3
- package/src/multi-select/multi-select.js +12 -0
- package/styles/bootstrap-dark.css +18 -4
- package/styles/bootstrap.css +18 -4
- package/styles/bootstrap4.css +18 -4
- package/styles/bootstrap5-dark.css +18 -4
- package/styles/bootstrap5.css +18 -4
- package/styles/fabric-dark.css +18 -4
- package/styles/fabric.css +18 -4
- package/styles/highcontrast-light.css +18 -4
- package/styles/highcontrast.css +18 -4
- package/styles/list-box/_bootstrap-dark-definition.scss +3 -0
- package/styles/list-box/_bootstrap-definition.scss +3 -0
- package/styles/list-box/_bootstrap4-definition.scss +3 -0
- package/styles/list-box/_bootstrap5-definition.scss +3 -0
- package/styles/list-box/_fabric-dark-definition.scss +3 -0
- package/styles/list-box/_fabric-definition.scss +3 -0
- package/styles/list-box/_fluent-definition.scss +3 -0
- package/styles/list-box/_highcontrast-definition.scss +3 -0
- package/styles/list-box/_highcontrast-light-definition.scss +3 -0
- package/styles/list-box/_material-dark-definition.scss +3 -0
- package/styles/list-box/_material-definition.scss +3 -0
- package/styles/list-box/_tailwind-definition.scss +3 -0
- package/styles/list-box/_theme.scss +8 -0
- package/styles/list-box/bootstrap-dark.css +10 -0
- package/styles/list-box/bootstrap.css +10 -0
- package/styles/list-box/bootstrap4.css +10 -0
- package/styles/list-box/bootstrap5-dark.css +10 -0
- package/styles/list-box/bootstrap5.css +10 -0
- package/styles/list-box/fabric-dark.css +10 -0
- package/styles/list-box/fabric.css +10 -0
- package/styles/list-box/highcontrast-light.css +10 -0
- package/styles/list-box/highcontrast.css +10 -0
- package/styles/list-box/material-dark.css +10 -0
- package/styles/list-box/material.css +10 -0
- package/styles/list-box/tailwind-dark.css +10 -0
- package/styles/list-box/tailwind.css +10 -0
- package/styles/material-dark.css +18 -4
- package/styles/material.css +18 -4
- package/styles/multi-select/_layout.scss +6 -4
- package/styles/multi-select/bootstrap-dark.css +8 -4
- package/styles/multi-select/bootstrap.css +8 -4
- package/styles/multi-select/bootstrap4.css +8 -4
- package/styles/multi-select/bootstrap5-dark.css +8 -4
- package/styles/multi-select/bootstrap5.css +8 -4
- package/styles/multi-select/fabric-dark.css +8 -4
- package/styles/multi-select/fabric.css +8 -4
- package/styles/multi-select/highcontrast-light.css +8 -4
- package/styles/multi-select/highcontrast.css +8 -4
- package/styles/multi-select/material-dark.css +8 -4
- package/styles/multi-select/material.css +8 -4
- package/styles/multi-select/tailwind-dark.css +8 -4
- package/styles/multi-select/tailwind.css +8 -4
- package/styles/tailwind-dark.css +18 -4
- package/styles/tailwind.css +18 -4
|
@@ -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');
|
|
@@ -1225,7 +1235,8 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1225
1235
|
li.innerText = itemText;
|
|
1226
1236
|
}
|
|
1227
1237
|
if (this.itemTemplate && !isHeader) {
|
|
1228
|
-
var
|
|
1238
|
+
var itemCheck = this.templateCompiler(this.itemTemplate);
|
|
1239
|
+
var compiledString = itemCheck ? compile(select(this.itemTemplate, document).innerHTML.trim()) : compile(this.itemTemplate);
|
|
1229
1240
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1230
1241
|
var addItemTemplate = compiledString(item, this, 'itemTemplate', this.itemTemplateId, this.isStringTemplate, null, li);
|
|
1231
1242
|
if (addItemTemplate) {
|
|
@@ -3665,7 +3676,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3665
3676
|
DropDownList.prototype.checkCustomValue = function () {
|
|
3666
3677
|
this.itemData = this.getDataByValue(this.value);
|
|
3667
3678
|
var dataItem = this.getItemData();
|
|
3668
|
-
this.setProperties({ '
|
|
3679
|
+
this.setProperties({ 'text': dataItem.text, 'value': dataItem.value });
|
|
3669
3680
|
};
|
|
3670
3681
|
DropDownList.prototype.updateInputFields = function () {
|
|
3671
3682
|
if (this.getModuleName() === 'dropdownlist') {
|
|
@@ -3681,160 +3692,195 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3681
3692
|
* @returns {void}
|
|
3682
3693
|
*/
|
|
3683
3694
|
DropDownList.prototype.onPropertyChanged = function (newProp, oldProp) {
|
|
3695
|
+
var _this = this;
|
|
3684
3696
|
if (this.getModuleName() === 'dropdownlist') {
|
|
3685
3697
|
this.checkData(newProp);
|
|
3686
3698
|
this.setUpdateInitial(['fields', 'query', 'dataSource'], newProp);
|
|
3687
3699
|
}
|
|
3688
|
-
|
|
3689
|
-
var prop = _a[_i];
|
|
3700
|
+
var _loop_1 = function (prop) {
|
|
3690
3701
|
switch (prop) {
|
|
3691
3702
|
case 'query':
|
|
3692
3703
|
case 'dataSource': break;
|
|
3693
3704
|
case 'htmlAttributes':
|
|
3694
|
-
|
|
3705
|
+
this_1.setHTMLAttributes();
|
|
3695
3706
|
break;
|
|
3696
3707
|
case 'width':
|
|
3697
|
-
|
|
3708
|
+
this_1.setEleWidth(newProp.width);
|
|
3698
3709
|
break;
|
|
3699
3710
|
case 'placeholder':
|
|
3700
|
-
Input.setPlaceholder(newProp.placeholder,
|
|
3711
|
+
Input.setPlaceholder(newProp.placeholder, this_1.inputElement);
|
|
3701
3712
|
break;
|
|
3702
3713
|
case 'filterBarPlaceholder':
|
|
3703
|
-
if (
|
|
3704
|
-
Input.setPlaceholder(newProp.filterBarPlaceholder,
|
|
3714
|
+
if (this_1.filterInput) {
|
|
3715
|
+
Input.setPlaceholder(newProp.filterBarPlaceholder, this_1.filterInput);
|
|
3705
3716
|
}
|
|
3706
3717
|
break;
|
|
3707
3718
|
case 'readonly':
|
|
3708
|
-
if (
|
|
3709
|
-
Input.setReadonly(newProp.readonly,
|
|
3719
|
+
if (this_1.getModuleName() !== 'dropdownlist') {
|
|
3720
|
+
Input.setReadonly(newProp.readonly, this_1.inputElement);
|
|
3710
3721
|
}
|
|
3711
|
-
|
|
3722
|
+
this_1.setReadOnly();
|
|
3712
3723
|
break;
|
|
3713
3724
|
case 'cssClass':
|
|
3714
|
-
|
|
3725
|
+
this_1.setCssClass(newProp.cssClass, oldProp.cssClass);
|
|
3715
3726
|
break;
|
|
3716
3727
|
case 'enableRtl':
|
|
3717
|
-
|
|
3728
|
+
this_1.setEnableRtl();
|
|
3718
3729
|
break;
|
|
3719
3730
|
case 'enabled':
|
|
3720
|
-
|
|
3731
|
+
this_1.setEnable();
|
|
3721
3732
|
break;
|
|
3722
3733
|
case 'text':
|
|
3723
3734
|
if (newProp.text === null) {
|
|
3724
|
-
|
|
3735
|
+
this_1.clearAll();
|
|
3725
3736
|
break;
|
|
3726
3737
|
}
|
|
3727
|
-
if (!
|
|
3728
|
-
if (
|
|
3729
|
-
|
|
3738
|
+
if (!this_1.list) {
|
|
3739
|
+
if (this_1.dataSource instanceof DataManager) {
|
|
3740
|
+
this_1.initRemoteRender = true;
|
|
3730
3741
|
}
|
|
3731
|
-
|
|
3732
|
-
}
|
|
3733
|
-
if (!
|
|
3734
|
-
var li =
|
|
3735
|
-
if (!
|
|
3736
|
-
if (
|
|
3737
|
-
|
|
3738
|
-
|
|
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
|
+
});
|
|
3739
3765
|
}
|
|
3740
3766
|
else {
|
|
3741
|
-
|
|
3767
|
+
this_1.setOldText(oldProp.text);
|
|
3742
3768
|
}
|
|
3743
3769
|
}
|
|
3744
|
-
|
|
3770
|
+
this_1.updateInputFields();
|
|
3745
3771
|
}
|
|
3746
3772
|
break;
|
|
3747
3773
|
case 'value':
|
|
3748
3774
|
if (newProp.value === null) {
|
|
3749
|
-
|
|
3775
|
+
this_1.clearAll();
|
|
3750
3776
|
break;
|
|
3751
3777
|
}
|
|
3752
|
-
|
|
3753
|
-
if (!
|
|
3754
|
-
if (
|
|
3755
|
-
|
|
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;
|
|
3756
3782
|
}
|
|
3757
|
-
|
|
3758
|
-
}
|
|
3759
|
-
if (!
|
|
3760
|
-
var item =
|
|
3761
|
-
if (!
|
|
3762
|
-
if (
|
|
3763
|
-
|
|
3764
|
-
|
|
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
|
+
});
|
|
3765
3806
|
}
|
|
3766
3807
|
else {
|
|
3767
|
-
|
|
3808
|
+
this_1.setOldValue(oldProp.value);
|
|
3768
3809
|
}
|
|
3769
3810
|
}
|
|
3770
|
-
|
|
3771
|
-
|
|
3811
|
+
this_1.updateInputFields();
|
|
3812
|
+
this_1.preventChange = this_1.isAngular && this_1.preventChange ? !this_1.preventChange : this_1.preventChange;
|
|
3772
3813
|
}
|
|
3773
3814
|
break;
|
|
3774
3815
|
case 'index':
|
|
3775
3816
|
if (newProp.index === null) {
|
|
3776
|
-
|
|
3817
|
+
this_1.clearAll();
|
|
3777
3818
|
break;
|
|
3778
3819
|
}
|
|
3779
|
-
if (!
|
|
3780
|
-
if (
|
|
3781
|
-
|
|
3820
|
+
if (!this_1.list) {
|
|
3821
|
+
if (this_1.dataSource instanceof DataManager) {
|
|
3822
|
+
this_1.initRemoteRender = true;
|
|
3782
3823
|
}
|
|
3783
|
-
|
|
3784
|
-
}
|
|
3785
|
-
if (!
|
|
3786
|
-
var element =
|
|
3787
|
-
if (!
|
|
3788
|
-
if (
|
|
3789
|
-
|
|
3790
|
-
|
|
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');
|
|
3791
3832
|
}
|
|
3792
3833
|
else {
|
|
3793
|
-
|
|
3834
|
+
this_1.index = oldProp.index;
|
|
3794
3835
|
}
|
|
3795
3836
|
}
|
|
3796
|
-
|
|
3837
|
+
this_1.updateInputFields();
|
|
3797
3838
|
}
|
|
3798
3839
|
break;
|
|
3799
3840
|
case 'footerTemplate':
|
|
3800
|
-
if (
|
|
3801
|
-
|
|
3841
|
+
if (this_1.popupObj) {
|
|
3842
|
+
this_1.setFooterTemplate(this_1.popupObj.element);
|
|
3802
3843
|
}
|
|
3803
3844
|
break;
|
|
3804
3845
|
case 'headerTemplate':
|
|
3805
|
-
if (
|
|
3806
|
-
|
|
3846
|
+
if (this_1.popupObj) {
|
|
3847
|
+
this_1.setHeaderTemplate(this_1.popupObj.element);
|
|
3807
3848
|
}
|
|
3808
3849
|
break;
|
|
3809
3850
|
case 'valueTemplate':
|
|
3810
|
-
if (!isNullOrUndefined(
|
|
3811
|
-
|
|
3851
|
+
if (!isNullOrUndefined(this_1.itemData) && this_1.valueTemplate != null) {
|
|
3852
|
+
this_1.setValueTemplate();
|
|
3812
3853
|
}
|
|
3813
3854
|
break;
|
|
3814
3855
|
case 'allowFiltering':
|
|
3815
|
-
if (
|
|
3816
|
-
|
|
3817
|
-
list:
|
|
3818
|
-
|
|
3819
|
-
|
|
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);
|
|
3820
3861
|
}
|
|
3821
3862
|
break;
|
|
3822
3863
|
case 'floatLabelType':
|
|
3823
|
-
Input.removeFloating(
|
|
3824
|
-
Input.addFloating(
|
|
3864
|
+
Input.removeFloating(this_1.inputWrapper);
|
|
3865
|
+
Input.addFloating(this_1.inputElement, newProp.floatLabelType, this_1.placeholder, this_1.createElement);
|
|
3825
3866
|
break;
|
|
3826
3867
|
case 'showClearButton':
|
|
3827
|
-
Input.setClearButton(newProp.showClearButton,
|
|
3828
|
-
|
|
3868
|
+
Input.setClearButton(newProp.showClearButton, this_1.inputElement, this_1.inputWrapper, null, this_1.createElement);
|
|
3869
|
+
this_1.bindClearEvent();
|
|
3829
3870
|
break;
|
|
3830
3871
|
default:
|
|
3831
3872
|
{
|
|
3832
3873
|
// eslint-disable-next-line max-len
|
|
3833
|
-
var ddlProps =
|
|
3834
|
-
_super.prototype.onPropertyChanged.call(
|
|
3874
|
+
var ddlProps = this_1.getPropObject(prop, newProp, oldProp);
|
|
3875
|
+
_super.prototype.onPropertyChanged.call(this_1, ddlProps.newProperty, ddlProps.oldProperty);
|
|
3835
3876
|
}
|
|
3836
3877
|
break;
|
|
3837
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);
|
|
3838
3884
|
}
|
|
3839
3885
|
};
|
|
3840
3886
|
DropDownList.prototype.checkValidLi = function (element) {
|
|
@@ -12210,6 +12256,17 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12210
12256
|
this.notify('selectAllText', false);
|
|
12211
12257
|
break;
|
|
12212
12258
|
case 'popupHeight':
|
|
12259
|
+
if (this.popupObj) {
|
|
12260
|
+
var overAllHeight = parseInt(this.popupHeight, 10);
|
|
12261
|
+
if (this.popupHeight !== 'auto') {
|
|
12262
|
+
this.list.style.maxHeight = formatUnit(overAllHeight);
|
|
12263
|
+
this.popupWrapper.style.maxHeight = formatUnit(this.popupHeight);
|
|
12264
|
+
}
|
|
12265
|
+
else {
|
|
12266
|
+
this.list.style.maxHeight = formatUnit(this.popupHeight);
|
|
12267
|
+
}
|
|
12268
|
+
}
|
|
12269
|
+
break;
|
|
12213
12270
|
case 'headerTemplate':
|
|
12214
12271
|
case 'footerTemplate':
|
|
12215
12272
|
this.reInitializePoup();
|
|
@@ -12664,6 +12721,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12664
12721
|
this.mainData = null;
|
|
12665
12722
|
this.filterParent = null;
|
|
12666
12723
|
this.ulElement = null;
|
|
12724
|
+
this.mainListCollection = null;
|
|
12667
12725
|
_super.prototype.destroy.call(this);
|
|
12668
12726
|
var temp = ['readonly', 'aria-disabled', 'aria-placeholder', 'placeholder'];
|
|
12669
12727
|
var length = temp.length;
|
|
@@ -14117,9 +14175,10 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
14117
14175
|
}
|
|
14118
14176
|
if (objValue === dataValue) {
|
|
14119
14177
|
itemIdx = this.getIndexByValue(dataValue);
|
|
14120
|
-
|
|
14121
|
-
|
|
14122
|
-
|
|
14178
|
+
var idx = itemIdx === i ? itemIdx : i;
|
|
14179
|
+
liCollections.push(liElement[idx]);
|
|
14180
|
+
removeIdxes.push(idx);
|
|
14181
|
+
removeLiIdxes.push(idx);
|
|
14123
14182
|
}
|
|
14124
14183
|
}
|
|
14125
14184
|
}
|