@syncfusion/ej2-dropdowns 21.2.10 → 22.1.34
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/.eslintrc.json +260 -0
- package/CHANGELOG.md +3 -0
- package/README.md +201 -103
- 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 +125 -34
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +125 -34
- 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/auto-complete/auto-complete-model.d.ts +2 -1
- package/src/auto-complete/auto-complete.d.ts +2 -1
- package/src/auto-complete/auto-complete.js +1 -1
- package/src/combo-box/combo-box-model.d.ts +6 -3
- package/src/combo-box/combo-box.d.ts +6 -3
- package/src/drop-down-base/drop-down-base-model.d.ts +8 -4
- package/src/drop-down-base/drop-down-base.d.ts +8 -4
- package/src/drop-down-base/drop-down-base.js +18 -7
- package/src/drop-down-list/drop-down-list-model.d.ts +6 -3
- package/src/drop-down-list/drop-down-list.d.ts +6 -3
- package/src/drop-down-list/drop-down-list.js +22 -13
- package/src/drop-down-tree/drop-down-tree-model.d.ts +21 -6
- package/src/drop-down-tree/drop-down-tree.d.ts +55 -62
- package/src/drop-down-tree/drop-down-tree.js +1 -1
- package/src/list-box/list-box.d.ts +14 -0
- package/src/list-box/list-box.js +33 -3
- package/src/mention/mention-model.d.ts +4 -2
- package/src/mention/mention.d.ts +4 -2
- package/src/multi-select/multi-select-model.d.ts +14 -7
- package/src/multi-select/multi-select.d.ts +15 -7
- package/src/multi-select/multi-select.js +50 -9
- package/styles/auto-complete/_material3-dark-definition.scss +1 -0
- package/styles/auto-complete/_material3-definition.scss +2 -0
- package/styles/auto-complete/material3-dark.css +198 -0
- package/styles/auto-complete/material3-dark.scss +5 -0
- package/styles/auto-complete/material3.css +254 -0
- package/styles/auto-complete/material3.scss +5 -0
- package/styles/bootstrap-dark.css +5 -1
- package/styles/bootstrap.css +5 -1
- package/styles/bootstrap4.css +5 -1
- package/styles/bootstrap5-dark.css +5 -1
- package/styles/bootstrap5.css +5 -1
- package/styles/combo-box/_material3-dark-definition.scss +1 -0
- package/styles/combo-box/_material3-definition.scss +2 -0
- package/styles/combo-box/material3-dark.css +198 -0
- package/styles/combo-box/material3-dark.scss +5 -0
- package/styles/combo-box/material3.css +254 -0
- package/styles/combo-box/material3.scss +5 -0
- package/styles/drop-down-base/_layout.scss +3 -1
- package/styles/drop-down-base/_material3-dark-definition.scss +1 -0
- package/styles/drop-down-base/_material3-definition.scss +87 -0
- package/styles/drop-down-base/_theme.scss +10 -0
- package/styles/drop-down-base/bootstrap-dark.css +4 -0
- package/styles/drop-down-base/bootstrap.css +4 -0
- package/styles/drop-down-base/bootstrap4.css +4 -0
- package/styles/drop-down-base/bootstrap5-dark.css +4 -0
- package/styles/drop-down-base/bootstrap5.css +4 -0
- package/styles/drop-down-base/fabric-dark.css +4 -0
- package/styles/drop-down-base/fabric.css +4 -0
- package/styles/drop-down-base/fluent-dark.css +4 -0
- package/styles/drop-down-base/fluent.css +4 -0
- package/styles/drop-down-base/highcontrast-light.css +4 -0
- package/styles/drop-down-base/highcontrast.css +4 -0
- package/styles/drop-down-base/material-dark.css +4 -0
- package/styles/drop-down-base/material.css +4 -0
- package/styles/drop-down-base/material3-dark.css +439 -0
- package/styles/drop-down-base/material3-dark.scss +4 -0
- package/styles/drop-down-base/material3.css +495 -0
- package/styles/drop-down-base/material3.scss +4 -0
- package/styles/drop-down-base/tailwind-dark.css +4 -0
- package/styles/drop-down-base/tailwind.css +4 -0
- package/styles/drop-down-list/_layout.scss +15 -1
- package/styles/drop-down-list/_material3-dark-definition.scss +1 -0
- package/styles/drop-down-list/_material3-definition.scss +180 -0
- package/styles/drop-down-list/icons/_material3-dark.scss +1 -0
- package/styles/drop-down-list/material3-dark.css +503 -0
- package/styles/drop-down-list/material3-dark.scss +9 -0
- package/styles/drop-down-list/material3.css +559 -0
- package/styles/drop-down-list/material3.scss +9 -0
- package/styles/drop-down-tree/_layout.scss +13 -7
- package/styles/drop-down-tree/_material3-dark-definition.scss +1 -0
- package/styles/drop-down-tree/_material3-definition.scss +76 -0
- package/styles/drop-down-tree/_theme.scss +14 -2
- package/styles/drop-down-tree/icons/_material3-dark.scss +1 -0
- package/styles/drop-down-tree/icons/_material3.scss +1 -1
- package/styles/drop-down-tree/material3-dark.css +466 -0
- package/styles/drop-down-tree/material3-dark.scss +10 -0
- package/styles/drop-down-tree/material3.css +522 -0
- package/styles/drop-down-tree/material3.scss +10 -0
- package/styles/fabric-dark.css +5 -1
- package/styles/fabric.css +5 -1
- package/styles/fluent-dark.css +5 -1
- package/styles/fluent.css +5 -1
- package/styles/highcontrast-light.css +5 -1
- package/styles/highcontrast.css +5 -1
- package/styles/list-box/_layout.scss +9 -1
- package/styles/list-box/_material3-dark-definition.scss +1 -0
- package/styles/list-box/_material3-definition.scss +117 -0
- package/styles/list-box/icons/_material3-dark.scss +1 -0
- package/styles/list-box/material3-dark.css +956 -0
- package/styles/list-box/material3-dark.scss +6 -0
- package/styles/list-box/material3.css +1012 -0
- package/styles/list-box/material3.scss +6 -0
- package/styles/material-dark.css +5 -1
- package/styles/material.css +5 -1
- package/styles/material3-dark.css +4664 -0
- package/styles/material3-dark.scss +10 -0
- package/styles/material3.css +4720 -0
- package/styles/material3.scss +10 -0
- package/styles/mention/_material3-dark-definition.scss +1 -0
- package/styles/mention/_material3-definition.scss +1 -0
- package/styles/mention/material3-dark.css +87 -0
- package/styles/mention/material3-dark.scss +7 -0
- package/styles/mention/material3.css +143 -0
- package/styles/mention/material3.scss +7 -0
- package/styles/multi-select/_layout.scss +160 -7
- package/styles/multi-select/_material3-dark-definition.scss +1 -0
- package/styles/multi-select/_material3-definition.scss +246 -0
- package/styles/multi-select/_theme.scss +6 -0
- package/styles/multi-select/bootstrap-dark.css +1 -1
- package/styles/multi-select/bootstrap.css +1 -1
- package/styles/multi-select/bootstrap4.css +1 -1
- package/styles/multi-select/bootstrap5-dark.css +1 -1
- package/styles/multi-select/bootstrap5.css +1 -1
- package/styles/multi-select/fabric-dark.css +1 -1
- package/styles/multi-select/fabric.css +1 -1
- package/styles/multi-select/fluent-dark.css +1 -1
- package/styles/multi-select/fluent.css +1 -1
- package/styles/multi-select/highcontrast-light.css +1 -1
- package/styles/multi-select/highcontrast.css +1 -1
- package/styles/multi-select/icons/_material3-dark.scss +1 -0
- package/styles/multi-select/icons/_material3.scss +3 -4
- package/styles/multi-select/material-dark.css +1 -1
- package/styles/multi-select/material.css +1 -1
- package/styles/multi-select/material3-dark.css +2547 -0
- package/styles/multi-select/material3-dark.scss +10 -0
- package/styles/multi-select/material3.css +2603 -0
- package/styles/multi-select/material3.scss +10 -0
- package/styles/multi-select/tailwind-dark.css +1 -1
- package/styles/multi-select/tailwind.css +1 -1
- package/styles/tailwind-dark.css +5 -1
- package/styles/tailwind.css +5 -1
- package/tslint.json +111 -0
|
@@ -385,7 +385,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
385
385
|
}
|
|
386
386
|
templateCompiler(baseTemplate) {
|
|
387
387
|
let checkTemplate = false;
|
|
388
|
-
if (baseTemplate) {
|
|
388
|
+
if (typeof baseTemplate !== 'function' && baseTemplate) {
|
|
389
389
|
try {
|
|
390
390
|
checkTemplate = (selectAll(baseTemplate, document).length) ? true : false;
|
|
391
391
|
}
|
|
@@ -403,7 +403,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
403
403
|
const templateId = actionFailure ? this.actionFailureTemplateId : this.noRecordsTemplateId;
|
|
404
404
|
ele.innerHTML = '';
|
|
405
405
|
const tempaltecheck = this.templateCompiler(template);
|
|
406
|
-
if (tempaltecheck) {
|
|
406
|
+
if (typeof template !== 'function' && tempaltecheck) {
|
|
407
407
|
compiledString = compile(select(template, document).innerHTML.trim());
|
|
408
408
|
}
|
|
409
409
|
else {
|
|
@@ -766,6 +766,9 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
766
766
|
onActionComplete(ulElement, list, e) {
|
|
767
767
|
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
768
768
|
this.listData = list;
|
|
769
|
+
if (this.getModuleName() !== 'listbox') {
|
|
770
|
+
ulElement.setAttribute('tabindex', '0');
|
|
771
|
+
}
|
|
769
772
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
770
773
|
if (this.isReact) {
|
|
771
774
|
this.clearTemplate(['itemTemplate', 'groupTemplate', 'actionFailureTemplate', 'noRecordsTemplate']);
|
|
@@ -825,7 +828,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
825
828
|
const option = { groupTemplateID: this.groupTemplateId, isStringTemplate: this.isStringTemplate };
|
|
826
829
|
const headerItems = listEle.querySelectorAll('.' + dropDownBaseClasses.group);
|
|
827
830
|
const groupcheck = this.templateCompiler(this.groupTemplate);
|
|
828
|
-
if (groupcheck) {
|
|
831
|
+
if (typeof this.groupTemplate !== 'function' && groupcheck) {
|
|
829
832
|
const groupValue = select(this.groupTemplate, document).innerHTML.trim();
|
|
830
833
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
831
834
|
const tempHeaders = ListBase.renderGroupTemplate(groupValue, dataSource, this.fields.properties, headerItems, option, this);
|
|
@@ -962,7 +965,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
962
965
|
option.templateID = this.itemTemplateId;
|
|
963
966
|
option.isStringTemplate = this.isStringTemplate;
|
|
964
967
|
const itemcheck = this.templateCompiler(this.itemTemplate);
|
|
965
|
-
if (itemcheck) {
|
|
968
|
+
if (typeof this.itemTemplate !== 'function' && itemcheck) {
|
|
966
969
|
const itemValue = select(this.itemTemplate, document).innerHTML.trim();
|
|
967
970
|
return ListBase.renderContentTemplate(this.createElement, itemValue, dataSource, fields.properties, option, this);
|
|
968
971
|
}
|
|
@@ -1049,7 +1052,9 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1049
1052
|
dispatchEvent(element, type) {
|
|
1050
1053
|
const evt = document.createEvent('HTMLEvents');
|
|
1051
1054
|
evt.initEvent(type, false, true);
|
|
1052
|
-
element
|
|
1055
|
+
if (element) {
|
|
1056
|
+
element.dispatchEvent(evt);
|
|
1057
|
+
}
|
|
1053
1058
|
}
|
|
1054
1059
|
/**
|
|
1055
1060
|
* To set the current fields
|
|
@@ -1176,7 +1181,12 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1176
1181
|
* @returns {void}
|
|
1177
1182
|
*/
|
|
1178
1183
|
render(e, isEmptyData) {
|
|
1179
|
-
|
|
1184
|
+
if (this.getModuleName() === 'listbox') {
|
|
1185
|
+
this.list = this.createElement('div', { className: dropDownBaseClasses.content, attrs: { 'tabindex': '0' } });
|
|
1186
|
+
}
|
|
1187
|
+
else {
|
|
1188
|
+
this.list = this.createElement('div', { className: dropDownBaseClasses.content });
|
|
1189
|
+
}
|
|
1180
1190
|
this.list.classList.add(dropDownBaseClasses.root);
|
|
1181
1191
|
this.setFields();
|
|
1182
1192
|
const rippleModel = { duration: 300, selector: '.' + dropDownBaseClasses.li };
|
|
@@ -1265,7 +1275,8 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1265
1275
|
}
|
|
1266
1276
|
if (this.itemTemplate && !isHeader) {
|
|
1267
1277
|
const itemCheck = this.templateCompiler(this.itemTemplate);
|
|
1268
|
-
const compiledString =
|
|
1278
|
+
const compiledString = typeof this.itemTemplate !== 'function' &&
|
|
1279
|
+
itemCheck ? compile(select(this.itemTemplate, document).innerHTML.trim()) : compile(this.itemTemplate);
|
|
1269
1280
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1270
1281
|
const addItemTemplate = compiledString(item, this, 'itemTemplate', this.itemTemplateId, this.isStringTemplate, null, li);
|
|
1271
1282
|
if (addItemTemplate) {
|
|
@@ -2194,8 +2205,11 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2194
2205
|
startIndex = e.action === 'down' && isNullOrUndefined(this.activeIndex) ? 0 : this.liCollections.length - 1;
|
|
2195
2206
|
index = index < 0 ? this.liCollections.length - 1 : index === this.liCollections.length ? 0 : index;
|
|
2196
2207
|
}
|
|
2197
|
-
|
|
2198
|
-
|
|
2208
|
+
let nextItem;
|
|
2209
|
+
if (this.getModuleName() !== 'autocomplete' || this.getModuleName() === 'autocomplete' && this.isPopupOpen) {
|
|
2210
|
+
nextItem = isNullOrUndefined(this.activeIndex) ? this.liCollections[startIndex]
|
|
2211
|
+
: this.liCollections[index];
|
|
2212
|
+
}
|
|
2199
2213
|
if (!isNullOrUndefined(nextItem)) {
|
|
2200
2214
|
this.setSelection(nextItem, e);
|
|
2201
2215
|
}
|
|
@@ -2512,9 +2526,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2512
2526
|
}
|
|
2513
2527
|
if (Browser.info.name !== 'mozilla') {
|
|
2514
2528
|
if (this.targetElement()) {
|
|
2515
|
-
|
|
2516
|
-
attributes(this.targetElement(), { 'aria-describedby': this.inputElement.id !== '' ? this.inputElement.id : this.element.id });
|
|
2517
|
-
}
|
|
2529
|
+
attributes(this.targetElement(), { 'aria-describedby': this.inputElement.id !== '' ? this.inputElement.id : this.element.id });
|
|
2518
2530
|
this.targetElement().removeAttribute('aria-live');
|
|
2519
2531
|
}
|
|
2520
2532
|
}
|
|
@@ -2527,7 +2539,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2527
2539
|
}
|
|
2528
2540
|
dropdownCompiler(dropdownTemplate) {
|
|
2529
2541
|
let checkTemplate = false;
|
|
2530
|
-
if (dropdownTemplate) {
|
|
2542
|
+
if (typeof dropdownTemplate !== 'function' && dropdownTemplate) {
|
|
2531
2543
|
try {
|
|
2532
2544
|
checkTemplate = (document.querySelectorAll(dropdownTemplate).length) ? true : false;
|
|
2533
2545
|
}
|
|
@@ -2558,7 +2570,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2558
2570
|
this.valueTempElement.innerHTML = '';
|
|
2559
2571
|
}
|
|
2560
2572
|
const valuecheck = this.dropdownCompiler(this.valueTemplate);
|
|
2561
|
-
if (valuecheck) {
|
|
2573
|
+
if (typeof this.valueTemplate !== 'function' && valuecheck) {
|
|
2562
2574
|
compiledString = compile(document.querySelector(this.valueTemplate).innerHTML.trim());
|
|
2563
2575
|
}
|
|
2564
2576
|
else {
|
|
@@ -2607,7 +2619,6 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2607
2619
|
const index = this.isSelectCustom ? null : this.activeIndex;
|
|
2608
2620
|
this.setProperties({ 'index': index, 'text': dataItem.text, 'value': dataItem.value }, true);
|
|
2609
2621
|
this.detachChangeEvent(eve);
|
|
2610
|
-
this.dispatchEvent(this.hiddenElement, 'change');
|
|
2611
2622
|
}
|
|
2612
2623
|
detachChanges(value) {
|
|
2613
2624
|
let items;
|
|
@@ -2946,6 +2957,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2946
2957
|
}
|
|
2947
2958
|
onInput(e) {
|
|
2948
2959
|
this.isValidKey = true;
|
|
2960
|
+
if (this.getModuleName() === 'combobox') {
|
|
2961
|
+
this.updateIconState();
|
|
2962
|
+
}
|
|
2949
2963
|
// For filtering works in mobile firefox.
|
|
2950
2964
|
if (Browser.isDevice && Browser.info.name === 'mozilla') {
|
|
2951
2965
|
this.typedString = this.filterInput.value;
|
|
@@ -3605,7 +3619,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3605
3619
|
this.setFields();
|
|
3606
3620
|
this.inputWrapper.container.style.width = formatUnit(this.width);
|
|
3607
3621
|
this.inputWrapper.container.classList.add('e-ddl');
|
|
3608
|
-
|
|
3622
|
+
if (this.floatLabelType === 'Auto') {
|
|
3623
|
+
Input.calculateWidth(this.inputElement, this.inputWrapper.container);
|
|
3624
|
+
}
|
|
3609
3625
|
if (!isNullOrUndefined(this.inputWrapper.buttons[0]) && this.inputWrapper.container.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never') {
|
|
3610
3626
|
this.inputWrapper.container.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
|
|
3611
3627
|
}
|
|
@@ -3681,7 +3697,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3681
3697
|
addClass([this.footer], dropDownListClasses.footer);
|
|
3682
3698
|
}
|
|
3683
3699
|
const footercheck = this.dropdownCompiler(this.footerTemplate);
|
|
3684
|
-
if (footercheck) {
|
|
3700
|
+
if (typeof this.footerTemplate !== 'function' && footercheck) {
|
|
3685
3701
|
compiledString = compile(select(this.footerTemplate, document).innerHTML.trim());
|
|
3686
3702
|
}
|
|
3687
3703
|
else {
|
|
@@ -3704,7 +3720,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3704
3720
|
addClass([this.header], dropDownListClasses.header);
|
|
3705
3721
|
}
|
|
3706
3722
|
const headercheck = this.dropdownCompiler(this.headerTemplate);
|
|
3707
|
-
if (headercheck) {
|
|
3723
|
+
if (typeof this.headerTemplate !== 'function' && headercheck) {
|
|
3708
3724
|
compiledString = compile(select(this.headerTemplate, document).innerHTML.trim());
|
|
3709
3725
|
}
|
|
3710
3726
|
else {
|
|
@@ -4168,7 +4184,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4168
4184
|
}
|
|
4169
4185
|
addClass([this.inputWrapper.container], [dropDownListClasses.inputFocus]);
|
|
4170
4186
|
this.onFocus(e);
|
|
4171
|
-
|
|
4187
|
+
if (this.floatLabelType === 'Auto') {
|
|
4188
|
+
Input.calculateWidth(this.inputElement, this.inputWrapper.container);
|
|
4189
|
+
}
|
|
4172
4190
|
}
|
|
4173
4191
|
/**
|
|
4174
4192
|
* Moves the focus from the component if the component is already focused.
|
|
@@ -4186,7 +4204,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4186
4204
|
this.targetElement().blur();
|
|
4187
4205
|
}
|
|
4188
4206
|
removeClass([this.inputWrapper.container], [dropDownListClasses.inputFocus]);
|
|
4189
|
-
|
|
4207
|
+
if (this.floatLabelType === 'Auto' && this.inputElement.value === '') {
|
|
4208
|
+
Input.calculateWidth(this.inputElement, this.inputWrapper.container);
|
|
4209
|
+
}
|
|
4190
4210
|
}
|
|
4191
4211
|
/**
|
|
4192
4212
|
* Removes the component from the DOM and detaches all its related event handlers. Also it removes the attributes and classes.
|
|
@@ -6696,7 +6716,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
6696
6716
|
if (template) {
|
|
6697
6717
|
// eslint-disable-next-line
|
|
6698
6718
|
try {
|
|
6699
|
-
if (document.querySelectorAll(template).length) {
|
|
6719
|
+
if (typeof template !== 'function' && document.querySelectorAll(template).length) {
|
|
6700
6720
|
return compile(document.querySelector(template).innerHTML.trim());
|
|
6701
6721
|
}
|
|
6702
6722
|
else {
|
|
@@ -8653,7 +8673,7 @@ let AutoComplete = class AutoComplete extends ComboBox {
|
|
|
8653
8673
|
*/
|
|
8654
8674
|
hidePopup(e) {
|
|
8655
8675
|
super.hidePopup(e);
|
|
8656
|
-
this.activeIndex =
|
|
8676
|
+
this.activeIndex = null;
|
|
8657
8677
|
}
|
|
8658
8678
|
/**
|
|
8659
8679
|
* Dynamically change the value of properties.
|
|
@@ -9814,7 +9834,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
9814
9834
|
parseInt(getComputedStyle(this.dropIcon).marginRight);
|
|
9815
9835
|
elementWidth = this.overAllWrapper.clientWidth - (downIconWidth + 2 * (parseInt(getComputedStyle(this.inputElement).paddingRight)));
|
|
9816
9836
|
}
|
|
9817
|
-
|
|
9837
|
+
if (this.floatLabelType === 'Auto') {
|
|
9838
|
+
Input.calculateWidth(elementWidth, this.overAllWrapper, this.getModuleName());
|
|
9839
|
+
}
|
|
9818
9840
|
}
|
|
9819
9841
|
}
|
|
9820
9842
|
checkPlaceholderSize() {
|
|
@@ -10163,6 +10185,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
10163
10185
|
+ ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)');
|
|
10164
10186
|
}
|
|
10165
10187
|
const focuseElem = this.list.querySelector('li.' + dropDownBaseClasses.focus);
|
|
10188
|
+
this.focusFirstListItem = !isNullOrUndefined(this.liCollections[0]) ? this.liCollections[0].classList.contains('e-item-focus') : false;
|
|
10166
10189
|
const index = Array.prototype.slice.call(list).indexOf(focuseElem);
|
|
10167
10190
|
if (index <= 0 && (this.mode === 'CheckBox' && this.allowFiltering)) {
|
|
10168
10191
|
this.keyAction = false;
|
|
@@ -10286,6 +10309,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
10286
10309
|
let limit = this.value && this.value.length ? this.value.length : 0;
|
|
10287
10310
|
let target;
|
|
10288
10311
|
if (li !== null) {
|
|
10312
|
+
e.preventDefault();
|
|
10289
10313
|
if (li.classList.contains('e-active')) {
|
|
10290
10314
|
limit = limit - 1;
|
|
10291
10315
|
}
|
|
@@ -10331,6 +10355,35 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
10331
10355
|
this.hidePopup(e);
|
|
10332
10356
|
}
|
|
10333
10357
|
}
|
|
10358
|
+
const selectAllParent = document.getElementsByClassName('e-selectall-parent')[0];
|
|
10359
|
+
if (selectAllParent && !selectAllParent.classList.contains('e-item-focus')) {
|
|
10360
|
+
e.preventDefault();
|
|
10361
|
+
}
|
|
10362
|
+
if (selectAllParent && selectAllParent.classList.contains('e-item-focus')) {
|
|
10363
|
+
const selectAllCheckBox = selectAllParent.childNodes[0];
|
|
10364
|
+
if (!selectAllCheckBox.classList.contains('e-check')) {
|
|
10365
|
+
selectAllCheckBox.classList.add('e-check');
|
|
10366
|
+
const args = {
|
|
10367
|
+
module: 'CheckBoxSelection',
|
|
10368
|
+
enable: this.mode === 'CheckBox',
|
|
10369
|
+
value: 'check',
|
|
10370
|
+
name: 'checkSelectAll'
|
|
10371
|
+
};
|
|
10372
|
+
this.notify('checkSelectAll', args);
|
|
10373
|
+
this.selectAllItem(true, e, li);
|
|
10374
|
+
}
|
|
10375
|
+
else {
|
|
10376
|
+
selectAllCheckBox.classList.remove('e-check');
|
|
10377
|
+
const args = {
|
|
10378
|
+
module: 'CheckBoxSelection',
|
|
10379
|
+
enable: this.mode === 'CheckBox',
|
|
10380
|
+
value: 'check',
|
|
10381
|
+
name: 'checkSelectAll'
|
|
10382
|
+
};
|
|
10383
|
+
this.notify('checkSelectAll', args);
|
|
10384
|
+
this.selectAllItem(false, e, li);
|
|
10385
|
+
}
|
|
10386
|
+
}
|
|
10334
10387
|
this.refreshPlaceHolder();
|
|
10335
10388
|
}
|
|
10336
10389
|
refreshListItems(data) {
|
|
@@ -10390,7 +10443,17 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
10390
10443
|
}
|
|
10391
10444
|
const selectedElem = this.list.querySelector('li.' + dropDownBaseClasses.focus);
|
|
10392
10445
|
let temp = -1;
|
|
10393
|
-
|
|
10446
|
+
const selectAllParent = document.getElementsByClassName('e-selectall-parent')[0];
|
|
10447
|
+
if (this.mode === 'CheckBox' && this.showSelectAll && position == 1 && !isNullOrUndefined(selectAllParent) && !selectAllParent.classList.contains('e-item-focus') && this.list.getElementsByClassName('e-item-focus').length == 0 && this.liCollections.length > 1) {
|
|
10448
|
+
selectAllParent.classList.add('e-item-focus');
|
|
10449
|
+
}
|
|
10450
|
+
else if (elements.length) {
|
|
10451
|
+
if (this.mode === 'CheckBox' && this.showSelectAll && !isNullOrUndefined(selectAllParent)) {
|
|
10452
|
+
selectAllParent.classList.remove('e-item-focus');
|
|
10453
|
+
if (this.showSelectAll && position == -1 && !isNullOrUndefined(selectAllParent) && this.liCollections.length > 1 && (this.focusFirstListItem || this.list.getElementsByClassName('e-item-focus').length == 0)) {
|
|
10454
|
+
selectAllParent.classList.add('e-item-focus');
|
|
10455
|
+
}
|
|
10456
|
+
}
|
|
10394
10457
|
for (let index = 0; index < elements.length; index++) {
|
|
10395
10458
|
if (elements[index] === selectedElem) {
|
|
10396
10459
|
temp = index;
|
|
@@ -10807,7 +10870,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
10807
10870
|
}
|
|
10808
10871
|
multiCompiler(multiselectTemplate) {
|
|
10809
10872
|
let checkTemplate = false;
|
|
10810
|
-
if (multiselectTemplate) {
|
|
10873
|
+
if (typeof multiselectTemplate !== 'function' && multiselectTemplate) {
|
|
10811
10874
|
try {
|
|
10812
10875
|
checkTemplate = (selectAll(multiselectTemplate, document).length) ? true : false;
|
|
10813
10876
|
}
|
|
@@ -10831,7 +10894,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
10831
10894
|
}
|
|
10832
10895
|
if (this.valueTemplate && !isNullOrUndefined(itemData)) {
|
|
10833
10896
|
const valuecheck = this.multiCompiler(this.valueTemplate);
|
|
10834
|
-
if (valuecheck) {
|
|
10897
|
+
if (typeof this.valueTemplate !== 'function' && valuecheck) {
|
|
10835
10898
|
compiledString = compile(select(this.valueTemplate, document).innerHTML.trim());
|
|
10836
10899
|
}
|
|
10837
10900
|
else {
|
|
@@ -11034,7 +11097,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11034
11097
|
this.header = this.createElement('div');
|
|
11035
11098
|
addClass([this.header], HEADER$1);
|
|
11036
11099
|
const headercheck = this.multiCompiler(this.headerTemplate);
|
|
11037
|
-
if (headercheck) {
|
|
11100
|
+
if (typeof this.headerTemplate !== 'function' && headercheck) {
|
|
11038
11101
|
compiledString = compile(select(this.headerTemplate, document).innerHTML.trim());
|
|
11039
11102
|
}
|
|
11040
11103
|
else {
|
|
@@ -11061,7 +11124,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11061
11124
|
this.footer = this.createElement('div');
|
|
11062
11125
|
addClass([this.footer], FOOTER$1);
|
|
11063
11126
|
const footercheck = this.multiCompiler(this.footerTemplate);
|
|
11064
|
-
if (footercheck) {
|
|
11127
|
+
if (typeof this.footerTemplate !== 'function' && footercheck) {
|
|
11065
11128
|
compiledString = compile(select(this.footerTemplate, document).innerHTML.trim());
|
|
11066
11129
|
}
|
|
11067
11130
|
else {
|
|
@@ -11315,7 +11378,6 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11315
11378
|
if (delim) {
|
|
11316
11379
|
this.updateWrapperText(this.delimiterWrapper, data);
|
|
11317
11380
|
this.delimiterWrapper.setAttribute('id', getUniqueID('delim_val'));
|
|
11318
|
-
this.inputElement.setAttribute('aria-describedby', this.delimiterWrapper.id);
|
|
11319
11381
|
this.inputElement.setAttribute('aria-labelledby', this.delimiterWrapper.id);
|
|
11320
11382
|
}
|
|
11321
11383
|
const targetEle = e && e.target;
|
|
@@ -12286,7 +12348,6 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12286
12348
|
this.hiddenElement.innerHTML = hiddenValue;
|
|
12287
12349
|
this.updateWrapperText(this.delimiterWrapper, wrapperText);
|
|
12288
12350
|
this.delimiterWrapper.setAttribute('id', getUniqueID('delim_val'));
|
|
12289
|
-
this.inputElement.setAttribute('aria-describedby', this.delimiterWrapper.id);
|
|
12290
12351
|
this.inputElement.setAttribute('aria-labelledby', this.delimiterWrapper.id);
|
|
12291
12352
|
this.setProperties({ text: text.toString() }, true);
|
|
12292
12353
|
this.refreshInputHight();
|
|
@@ -12783,7 +12844,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12783
12844
|
}
|
|
12784
12845
|
});
|
|
12785
12846
|
if (this.mode === 'Default' || this.mode === 'Box') {
|
|
12786
|
-
this.inputElement.setAttribute('aria-
|
|
12847
|
+
this.inputElement.setAttribute('aria-labelledby', this.chipCollectionWrapper.id);
|
|
12787
12848
|
}
|
|
12788
12849
|
if (this.element.tagName !== this.getNgDirective()) {
|
|
12789
12850
|
this.element.style.display = 'none';
|
|
@@ -14572,6 +14633,26 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
14572
14633
|
const elem = (value) ? this.getElemByValue(value) : this.getSelectedItems();
|
|
14573
14634
|
this.moveUpDown(false, false, elem);
|
|
14574
14635
|
}
|
|
14636
|
+
/**
|
|
14637
|
+
* Moves the given value(s) / selected value(s) in Top of the list.
|
|
14638
|
+
*
|
|
14639
|
+
* @param { string[] | number[] | boolean[] } value - Specifies the value(s).
|
|
14640
|
+
* @returns {void}
|
|
14641
|
+
*/
|
|
14642
|
+
moveTop(value) {
|
|
14643
|
+
const elem = (value) ? this.getElemByValue(value) : this.getSelectedItems();
|
|
14644
|
+
this.moveUpDown(null, false, elem, true);
|
|
14645
|
+
}
|
|
14646
|
+
/**
|
|
14647
|
+
* Moves the given value(s) / selected value(s) in bottom of the list.
|
|
14648
|
+
*
|
|
14649
|
+
* @param { string[] | number[] | boolean[] } value - Specifies the value(s).
|
|
14650
|
+
* @returns {void}
|
|
14651
|
+
*/
|
|
14652
|
+
moveBottom(value) {
|
|
14653
|
+
const elem = (value) ? this.getElemByValue(value) : this.getSelectedItems();
|
|
14654
|
+
this.moveUpDown(true, false, elem, false, true);
|
|
14655
|
+
}
|
|
14575
14656
|
/**
|
|
14576
14657
|
* Moves the given value(s) / selected value(s) to the given / default scoped ListBox.
|
|
14577
14658
|
*
|
|
@@ -15017,7 +15098,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
15017
15098
|
}
|
|
15018
15099
|
}
|
|
15019
15100
|
}
|
|
15020
|
-
moveUpDown(isUp, isKey, value) {
|
|
15101
|
+
moveUpDown(isUp, isKey, value, isTop, isBottom) {
|
|
15021
15102
|
let elems = this.getSelectedItems();
|
|
15022
15103
|
if (value) {
|
|
15023
15104
|
elems = value;
|
|
@@ -15035,8 +15116,18 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
15035
15116
|
(isUp ? elems : elems.reverse()).forEach((ele) => {
|
|
15036
15117
|
const jsonToIdx = Array.prototype.indexOf.call(this.ulElement.querySelectorAll('.e-list-item'), ele);
|
|
15037
15118
|
const idx = Array.prototype.indexOf.call(this.ulElement.children, ele);
|
|
15038
|
-
|
|
15039
|
-
|
|
15119
|
+
if (isTop) {
|
|
15120
|
+
moveTo(this.ulElement, this.ulElement, [idx], 0);
|
|
15121
|
+
this.changeData(idx, 0, jsonToIdx, ele);
|
|
15122
|
+
}
|
|
15123
|
+
else if (isBottom) {
|
|
15124
|
+
moveTo(this.ulElement, this.ulElement, [idx], this.ulElement.querySelectorAll('.e-list-item').length);
|
|
15125
|
+
this.changeData(idx, this.ulElement.querySelectorAll('.e-list-item').length, jsonToIdx, ele);
|
|
15126
|
+
}
|
|
15127
|
+
else {
|
|
15128
|
+
moveTo(this.ulElement, this.ulElement, [idx], isUp ? idx - 1 : idx + 2);
|
|
15129
|
+
this.changeData(idx, isUp ? idx - 1 : idx + 1, isUp ? jsonToIdx - 1 : jsonToIdx + 1, ele);
|
|
15130
|
+
}
|
|
15040
15131
|
});
|
|
15041
15132
|
this.trigger('actionComplete', { items: tempItems, eventName: this.toolbarAction });
|
|
15042
15133
|
elems[0].focus();
|