@syncfusion/ej2-dropdowns 20.2.50 → 20.3.48
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 +18 -24
- package/dist/ej2-dropdowns.min.js +10 -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 +1424 -51
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +1450 -55
- 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/mention.d.ts +4 -0
- package/mention.js +4 -0
- package/package.json +12 -12
- package/src/auto-complete/auto-complete.js +2 -2
- package/src/combo-box/combo-box.js +0 -3
- package/src/drop-down-base/drop-down-base.d.ts +2 -0
- package/src/drop-down-base/drop-down-base.js +8 -2
- package/src/drop-down-list/drop-down-list.d.ts +1 -0
- package/src/drop-down-list/drop-down-list.js +23 -22
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
- package/src/list-box/list-box.js +16 -11
- package/src/mention/index.d.ts +5 -0
- package/src/mention/index.js +4 -0
- package/src/mention/mention-model.d.ts +285 -0
- package/src/mention/mention.d.ts +452 -0
- package/src/mention/mention.js +1383 -0
- package/src/multi-select/checkbox-selection.js +1 -4
- package/src/multi-select/multi-select.d.ts +1 -0
- package/src/multi-select/multi-select.js +20 -11
- package/styles/auto-complete/_all.scss +1 -1
- package/styles/auto-complete/_bootstrap-dark-definition.scss +1 -1
- package/styles/auto-complete/_bootstrap-definition.scss +1 -1
- package/styles/auto-complete/_bootstrap4-definition.scss +2 -2
- package/styles/auto-complete/_bootstrap5-definition.scss +1 -1
- package/styles/auto-complete/_fabric-dark-definition.scss +1 -1
- package/styles/auto-complete/_fabric-definition.scss +1 -1
- package/styles/auto-complete/_fluent-definition.scss +1 -1
- package/styles/auto-complete/_fusionnew-definition.scss +1 -1
- package/styles/auto-complete/_highcontrast-definition.scss +1 -1
- package/styles/auto-complete/_highcontrast-light-definition.scss +1 -1
- package/styles/auto-complete/_material-dark-definition.scss +1 -1
- package/styles/auto-complete/_material-definition.scss +1 -1
- package/styles/auto-complete/_material3-definition.scss +1 -1
- package/styles/auto-complete/_tailwind-definition.scss +1 -1
- package/styles/auto-complete/bootstrap-dark.css +3 -1
- package/styles/auto-complete/bootstrap.css +3 -1
- package/styles/auto-complete/bootstrap4.css +3 -1
- package/styles/auto-complete/bootstrap5-dark.css +3 -1
- package/styles/auto-complete/bootstrap5.css +3 -1
- package/styles/auto-complete/fabric-dark.css +3 -1
- package/styles/auto-complete/fabric.css +3 -1
- package/styles/auto-complete/fluent-dark.css +3 -1
- package/styles/auto-complete/fluent.css +3 -1
- package/styles/auto-complete/highcontrast-light.css +3 -1
- package/styles/auto-complete/highcontrast.css +3 -1
- package/styles/auto-complete/material-dark.css +3 -1
- package/styles/auto-complete/material.css +3 -1
- package/styles/auto-complete/tailwind-dark.css +3 -1
- package/styles/auto-complete/tailwind.css +3 -1
- package/styles/bootstrap-dark.css +94 -42
- package/styles/bootstrap-dark.scss +1 -0
- package/styles/bootstrap.css +94 -42
- package/styles/bootstrap.scss +1 -0
- package/styles/bootstrap4.css +95 -42
- package/styles/bootstrap4.scss +1 -0
- package/styles/bootstrap5-dark.css +101 -44
- package/styles/bootstrap5-dark.scss +1 -0
- package/styles/bootstrap5.css +101 -44
- package/styles/bootstrap5.scss +1 -0
- package/styles/combo-box/_all.scss +1 -1
- package/styles/combo-box/_bootstrap-dark-definition.scss +1 -1
- package/styles/combo-box/_bootstrap-definition.scss +1 -1
- package/styles/combo-box/_bootstrap4-definition.scss +2 -2
- package/styles/combo-box/_bootstrap5-definition.scss +1 -1
- package/styles/combo-box/_fabric-dark-definition.scss +1 -1
- package/styles/combo-box/_fabric-definition.scss +1 -1
- package/styles/combo-box/_fluent-definition.scss +1 -1
- package/styles/combo-box/_fusionnew-definition.scss +1 -1
- package/styles/combo-box/_highcontrast-definition.scss +1 -1
- package/styles/combo-box/_highcontrast-light-definition.scss +1 -1
- package/styles/combo-box/_material-dark-definition.scss +1 -1
- package/styles/combo-box/_material-definition.scss +1 -1
- package/styles/combo-box/_material3-definition.scss +1 -1
- package/styles/combo-box/_tailwind-definition.scss +1 -1
- package/styles/combo-box/bootstrap-dark.css +3 -1
- package/styles/combo-box/bootstrap.css +3 -1
- package/styles/combo-box/bootstrap4.css +3 -1
- package/styles/combo-box/bootstrap5-dark.css +3 -1
- package/styles/combo-box/bootstrap5.css +3 -1
- package/styles/combo-box/fabric-dark.css +3 -1
- package/styles/combo-box/fabric.css +3 -1
- package/styles/combo-box/fluent-dark.css +3 -1
- package/styles/combo-box/fluent.css +3 -1
- package/styles/combo-box/highcontrast-light.css +3 -1
- package/styles/combo-box/highcontrast.css +3 -1
- package/styles/combo-box/material-dark.css +3 -1
- package/styles/combo-box/material.css +3 -1
- package/styles/combo-box/tailwind-dark.css +3 -1
- package/styles/combo-box/tailwind.css +3 -1
- package/styles/drop-down-base/_all.scss +1 -1
- package/styles/drop-down-base/_bootstrap-dark-definition.scss +8 -2
- package/styles/drop-down-base/_bootstrap-definition.scss +6 -1
- package/styles/drop-down-base/_bootstrap4-definition.scss +6 -1
- package/styles/drop-down-base/_bootstrap5-definition.scss +8 -3
- package/styles/drop-down-base/_fabric-dark-definition.scss +6 -1
- package/styles/drop-down-base/_fabric-definition.scss +6 -1
- package/styles/drop-down-base/_fluent-definition.scss +8 -2
- package/styles/drop-down-base/_fusionnew-definition.scss +8 -3
- package/styles/drop-down-base/_highcontrast-definition.scss +16 -6
- package/styles/drop-down-base/_highcontrast-light-definition.scss +18 -7
- package/styles/drop-down-base/_layout.scss +44 -3
- package/styles/drop-down-base/_material-dark-definition.scss +7 -1
- package/styles/drop-down-base/_material-definition.scss +6 -0
- package/styles/drop-down-base/_material3-definition.scss +8 -3
- package/styles/drop-down-base/_tailwind-definition.scss +8 -3
- package/styles/drop-down-base/_theme.scss +4 -4
- package/styles/drop-down-base/bootstrap-dark.css +42 -1
- package/styles/drop-down-base/bootstrap.css +42 -1
- package/styles/drop-down-base/bootstrap4.css +42 -1
- package/styles/drop-down-base/bootstrap5-dark.css +42 -1
- package/styles/drop-down-base/bootstrap5.css +42 -1
- package/styles/drop-down-base/fabric-dark.css +42 -1
- package/styles/drop-down-base/fabric.css +42 -1
- package/styles/drop-down-base/fluent-dark.css +42 -1
- package/styles/drop-down-base/fluent.css +42 -1
- package/styles/drop-down-base/highcontrast-light.css +42 -1
- package/styles/drop-down-base/highcontrast.css +42 -1
- package/styles/drop-down-base/material-dark.css +42 -1
- package/styles/drop-down-base/material.css +42 -1
- package/styles/drop-down-base/tailwind-dark.css +42 -1
- package/styles/drop-down-base/tailwind.css +42 -1
- package/styles/drop-down-list/_all.scss +2 -1
- package/styles/drop-down-list/_bootstrap-dark-definition.scss +2 -1
- package/styles/drop-down-list/_bootstrap-definition.scss +2 -1
- package/styles/drop-down-list/_bootstrap4-definition.scss +3 -1
- package/styles/drop-down-list/_bootstrap5-definition.scss +3 -3
- package/styles/drop-down-list/_fabric-dark-definition.scss +2 -1
- package/styles/drop-down-list/_fabric-definition.scss +2 -0
- package/styles/drop-down-list/_fluent-definition.scss +2 -1
- package/styles/drop-down-list/_fusionnew-definition.scss +3 -3
- package/styles/drop-down-list/_highcontrast-definition.scss +21 -10
- package/styles/drop-down-list/_highcontrast-light-definition.scss +22 -11
- package/styles/drop-down-list/_layout.scss +8 -9
- package/styles/drop-down-list/_material-dark-definition.scss +2 -2
- package/styles/drop-down-list/_material-definition.scss +1 -0
- package/styles/drop-down-list/_material3-definition.scss +3 -3
- package/styles/drop-down-list/_tailwind-definition.scss +1 -0
- package/styles/drop-down-list/_theme.scss +3 -3
- package/styles/drop-down-list/bootstrap-dark.css +5 -0
- package/styles/drop-down-list/bootstrap.css +5 -0
- package/styles/drop-down-list/bootstrap4.css +5 -0
- package/styles/drop-down-list/bootstrap5-dark.css +6 -0
- package/styles/drop-down-list/bootstrap5.css +6 -0
- package/styles/drop-down-list/fabric-dark.css +5 -0
- package/styles/drop-down-list/fabric.css +5 -0
- package/styles/drop-down-list/fluent-dark.css +6 -0
- package/styles/drop-down-list/fluent.css +6 -0
- package/styles/drop-down-list/highcontrast-light.css +5 -0
- package/styles/drop-down-list/highcontrast.css +5 -0
- package/styles/drop-down-list/icons/_bootstrap.scss +0 -1
- package/styles/drop-down-list/icons/_fabric.scss +0 -1
- package/styles/drop-down-list/icons/_material.scss +0 -1
- package/styles/drop-down-list/material-dark.css +5 -0
- package/styles/drop-down-list/material.css +5 -0
- package/styles/drop-down-list/tailwind-dark.css +6 -0
- package/styles/drop-down-list/tailwind.css +6 -0
- package/styles/drop-down-tree/_all.scss +1 -1
- package/styles/drop-down-tree/_bootstrap-dark-definition.scss +1 -1
- package/styles/drop-down-tree/_bootstrap-definition.scss +1 -1
- package/styles/drop-down-tree/_bootstrap4-definition.scss +1 -1
- package/styles/drop-down-tree/_bootstrap5-definition.scss +2 -2
- package/styles/drop-down-tree/_fabric-dark-definition.scss +1 -1
- package/styles/drop-down-tree/_fabric-definition.scss +2 -2
- package/styles/drop-down-tree/_fluent-definition.scss +2 -2
- package/styles/drop-down-tree/_fusionnew-definition.scss +2 -2
- package/styles/drop-down-tree/_highcontrast-definition.scss +1 -1
- package/styles/drop-down-tree/_highcontrast-light-definition.scss +1 -1
- package/styles/drop-down-tree/_layout.scss +1 -2
- package/styles/drop-down-tree/_material-dark-definition.scss +2 -2
- package/styles/drop-down-tree/_material-definition.scss +2 -2
- package/styles/drop-down-tree/_material3-definition.scss +2 -2
- package/styles/drop-down-tree/_tailwind-definition.scss +2 -2
- package/styles/drop-down-tree/bootstrap-dark.css +4 -0
- package/styles/drop-down-tree/bootstrap.css +4 -0
- package/styles/drop-down-tree/bootstrap4.css +4 -0
- package/styles/drop-down-tree/bootstrap5-dark.css +5 -0
- package/styles/drop-down-tree/bootstrap5.css +5 -0
- package/styles/drop-down-tree/fabric-dark.css +4 -0
- package/styles/drop-down-tree/fabric.css +4 -0
- package/styles/drop-down-tree/fluent-dark.css +5 -0
- package/styles/drop-down-tree/fluent.css +5 -0
- package/styles/drop-down-tree/highcontrast-light.css +4 -0
- package/styles/drop-down-tree/highcontrast.css +4 -0
- package/styles/drop-down-tree/icons/_bootstrap.scss +0 -1
- package/styles/drop-down-tree/icons/_bootstrap4.scss +0 -1
- package/styles/drop-down-tree/icons/_fabric.scss +0 -1
- package/styles/drop-down-tree/icons/_highcontrast-light.scss +0 -1
- package/styles/drop-down-tree/icons/_highcontrast.scss +0 -1
- package/styles/drop-down-tree/icons/_material-dark.scss +0 -1
- package/styles/drop-down-tree/icons/_material.scss +0 -1
- package/styles/drop-down-tree/material-dark.css +4 -0
- package/styles/drop-down-tree/material.css +4 -0
- package/styles/drop-down-tree/tailwind-dark.css +5 -0
- package/styles/drop-down-tree/tailwind.css +5 -0
- package/styles/fabric-dark.css +94 -42
- package/styles/fabric-dark.scss +1 -0
- package/styles/fabric.css +94 -42
- package/styles/fabric.scss +1 -0
- package/styles/fluent-dark.css +101 -44
- package/styles/fluent-dark.scss +1 -0
- package/styles/fluent.css +101 -44
- package/styles/fluent.scss +1 -0
- package/styles/highcontrast-light.css +97 -42
- package/styles/highcontrast-light.scss +1 -0
- package/styles/highcontrast.css +97 -42
- package/styles/highcontrast.scss +1 -0
- package/styles/list-box/_all.scss +1 -1
- package/styles/list-box/_bootstrap-dark-definition.scss +2 -0
- package/styles/list-box/_bootstrap-definition.scss +1 -0
- package/styles/list-box/_bootstrap4-definition.scss +1 -0
- package/styles/list-box/_bootstrap5-definition.scss +3 -0
- package/styles/list-box/_fabric-dark-definition.scss +3 -1
- package/styles/list-box/_fabric-definition.scss +1 -0
- package/styles/list-box/_fluent-definition.scss +3 -0
- package/styles/list-box/_fusionnew-definition.scss +1 -0
- package/styles/list-box/_highcontrast-definition.scss +1 -0
- package/styles/list-box/_highcontrast-light-definition.scss +3 -1
- package/styles/list-box/_layout.scss +8 -17
- package/styles/list-box/_material-dark-definition.scss +2 -0
- package/styles/list-box/_material-definition.scss +1 -0
- package/styles/list-box/_material3-definition.scss +1 -0
- package/styles/list-box/_tailwind-definition.scss +3 -0
- package/styles/list-box/_theme.scss +11 -25
- package/styles/list-box/bootstrap-dark.css +12 -33
- package/styles/list-box/bootstrap.css +14 -35
- package/styles/list-box/bootstrap4.css +14 -35
- package/styles/list-box/bootstrap5-dark.css +15 -36
- package/styles/list-box/bootstrap5.css +15 -36
- package/styles/list-box/fabric-dark.css +12 -33
- package/styles/list-box/fabric.css +14 -35
- package/styles/list-box/fluent-dark.css +15 -36
- package/styles/list-box/fluent.css +15 -36
- package/styles/list-box/highcontrast-light.css +12 -33
- package/styles/list-box/highcontrast.css +14 -35
- package/styles/list-box/icons/_bootstrap-dark.scss +2 -2
- package/styles/list-box/icons/_bootstrap.scss +1 -1
- package/styles/list-box/icons/_bootstrap4.scss +1 -1
- package/styles/list-box/icons/_bootstrap5.scss +1 -1
- package/styles/list-box/icons/_fabric-dark.scss +1 -1
- package/styles/list-box/icons/_fabric.scss +1 -1
- package/styles/list-box/icons/_fluent.scss +1 -1
- package/styles/list-box/icons/_fusionnew.scss +1 -1
- package/styles/list-box/icons/_highcontrast-light.scss +1 -1
- package/styles/list-box/icons/_highcontrast.scss +1 -1
- package/styles/list-box/icons/_material-dark.scss +1 -1
- package/styles/list-box/icons/_material.scss +2 -2
- package/styles/list-box/icons/_material3.scss +1 -1
- package/styles/list-box/icons/_tailwind-dark.scss +1 -1
- package/styles/list-box/icons/_tailwind.scss +1 -1
- package/styles/list-box/material-dark.css +12 -33
- package/styles/list-box/material.css +14 -35
- package/styles/list-box/tailwind-dark.css +15 -36
- package/styles/list-box/tailwind.css +15 -36
- package/styles/material-dark.css +94 -42
- package/styles/material-dark.scss +1 -0
- package/styles/material.css +94 -42
- package/styles/material.scss +1 -0
- package/styles/mention/_all.scss +1 -0
- package/styles/mention/_bootstrap-dark-definition.scss +3 -0
- package/styles/mention/_bootstrap-definition.scss +3 -0
- package/styles/mention/_bootstrap4-definition.scss +3 -0
- package/styles/mention/_bootstrap5-dark-definition.scss +1 -0
- package/styles/mention/_bootstrap5-definition.scss +1 -0
- package/styles/mention/_fabric-dark-definition.scss +2 -0
- package/styles/mention/_fabric-definition.scss +3 -0
- package/styles/mention/_fluent-dark-definition.scss +1 -0
- package/styles/mention/_fluent-definition.scss +1 -0
- package/styles/mention/_fusionnew-definition.scss +1 -0
- package/styles/mention/_highcontrast-definition.scss +3 -0
- package/styles/mention/_highcontrast-light-definition.scss +3 -0
- package/styles/mention/_layout.scss +6 -0
- package/styles/mention/_material-dark-definition.scss +3 -0
- package/styles/mention/_material-definition.scss +3 -0
- package/styles/mention/_material3-definition.scss +1 -0
- package/styles/mention/_tailwind-dark-definition.scss +1 -0
- package/styles/mention/_tailwind-definition.scss +1 -0
- package/styles/mention/bootstrap-dark.css +29 -0
- package/styles/mention/bootstrap-dark.scss +6 -0
- package/styles/mention/bootstrap.css +29 -0
- package/styles/mention/bootstrap.scss +6 -0
- package/styles/mention/bootstrap4.css +47 -0
- package/styles/mention/bootstrap4.scss +6 -0
- package/styles/mention/bootstrap5-dark.css +58 -0
- package/styles/mention/bootstrap5-dark.scss +6 -0
- package/styles/mention/bootstrap5.css +58 -0
- package/styles/mention/bootstrap5.scss +6 -0
- package/styles/mention/fabric-dark.css +29 -0
- package/styles/mention/fabric-dark.scss +6 -0
- package/styles/mention/fabric.css +29 -0
- package/styles/mention/fabric.scss +6 -0
- package/styles/mention/fluent-dark.css +58 -0
- package/styles/mention/fluent-dark.scss +6 -0
- package/styles/mention/fluent.css +58 -0
- package/styles/mention/fluent.scss +6 -0
- package/styles/mention/highcontrast-light.css +43 -0
- package/styles/mention/highcontrast-light.scss +6 -0
- package/styles/mention/highcontrast.css +43 -0
- package/styles/mention/highcontrast.scss +6 -0
- package/styles/mention/material-dark.css +29 -0
- package/styles/mention/material-dark.scss +6 -0
- package/styles/mention/material.css +29 -0
- package/styles/mention/material.scss +6 -0
- package/styles/mention/tailwind-dark.css +68 -0
- package/styles/mention/tailwind-dark.scss +6 -0
- package/styles/mention/tailwind.css +68 -0
- package/styles/mention/tailwind.scss +6 -0
- package/styles/multi-select/_all.scss +1 -1
- package/styles/multi-select/_bootstrap-dark-definition.scss +4 -1
- package/styles/multi-select/_bootstrap-definition.scss +2 -0
- package/styles/multi-select/_bootstrap4-definition.scss +5 -2
- package/styles/multi-select/_bootstrap5-definition.scss +2 -2
- package/styles/multi-select/_fabric-dark-definition.scss +5 -3
- package/styles/multi-select/_fabric-definition.scss +4 -2
- package/styles/multi-select/_fluent-definition.scss +2 -1
- package/styles/multi-select/_fusionnew-definition.scss +2 -2
- package/styles/multi-select/_highcontrast-definition.scss +47 -24
- package/styles/multi-select/_highcontrast-light-definition.scss +48 -25
- package/styles/multi-select/_layout.scss +59 -71
- package/styles/multi-select/_material-dark-definition.scss +3 -1
- package/styles/multi-select/_material-definition.scss +1 -0
- package/styles/multi-select/_material3-definition.scss +2 -2
- package/styles/multi-select/_tailwind-definition.scss +2 -3
- package/styles/multi-select/_theme.scss +16 -21
- package/styles/multi-select/bootstrap-dark.css +10 -6
- package/styles/multi-select/bootstrap.css +10 -6
- package/styles/multi-select/bootstrap4.css +10 -6
- package/styles/multi-select/bootstrap5-dark.css +11 -6
- package/styles/multi-select/bootstrap5.css +11 -6
- package/styles/multi-select/fabric-dark.css +10 -6
- package/styles/multi-select/fabric.css +10 -6
- package/styles/multi-select/fluent-dark.css +11 -6
- package/styles/multi-select/fluent.css +11 -6
- package/styles/multi-select/highcontrast-light.css +13 -6
- package/styles/multi-select/highcontrast.css +13 -6
- package/styles/multi-select/icons/_bootstrap5.scss +0 -1
- package/styles/multi-select/icons/_fluent.scss +0 -1
- package/styles/multi-select/icons/_fusionnew.scss +0 -1
- package/styles/multi-select/icons/_material-dark.scss +53 -54
- package/styles/multi-select/icons/_material.scss +53 -54
- package/styles/multi-select/icons/_material3.scss +0 -1
- package/styles/multi-select/icons/_tailwind.scss +0 -1
- package/styles/multi-select/material-dark.css +10 -6
- package/styles/multi-select/material.css +10 -6
- package/styles/multi-select/tailwind-dark.css +11 -6
- package/styles/multi-select/tailwind.css +11 -6
- package/styles/tailwind-dark.css +102 -44
- package/styles/tailwind-dark.scss +1 -0
- package/styles/tailwind.css +102 -44
- package/styles/tailwind.scss +1 -0
|
@@ -214,6 +214,8 @@ const dropDownBaseClasses = {
|
|
|
214
214
|
grouping: 'e-dd-group'
|
|
215
215
|
};
|
|
216
216
|
const ITEMTEMPLATE_PROPERTY = 'ItemTemplate';
|
|
217
|
+
const DISPLAYTEMPLATE_PROPERTY = 'DisplayTemplate';
|
|
218
|
+
const SPINNERTEMPLATE_PROPERTY = 'SpinnerTemplate';
|
|
217
219
|
const VALUETEMPLATE_PROPERTY = 'ValueTemplate';
|
|
218
220
|
const GROUPTEMPLATE_PROPERTY = 'GroupTemplate';
|
|
219
221
|
const HEADERTEMPLATE_PROPERTY = 'HeaderTemplate';
|
|
@@ -407,7 +409,8 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
407
409
|
this.l10n = componentLocale;
|
|
408
410
|
}
|
|
409
411
|
else {
|
|
410
|
-
this.l10n = new L10n(this.getModuleName() === 'listbox' ? 'listbox' :
|
|
412
|
+
this.l10n = new L10n(this.getModuleName() === 'listbox' ? 'listbox' :
|
|
413
|
+
this.getModuleName() === 'mention' ? 'mention' : 'dropdowns', l10nLocale, this.locale);
|
|
411
414
|
}
|
|
412
415
|
const content = actionFailure ?
|
|
413
416
|
this.l10n.getConstant('actionFailureTemplate') : this.l10n.getConstant('noRecordsTemplate');
|
|
@@ -416,6 +419,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
416
419
|
liElem.textContent = content;
|
|
417
420
|
ele.appendChild(liElem);
|
|
418
421
|
liElem.classList.add('e-list-nrt');
|
|
422
|
+
liElem.setAttribute('role', 'option');
|
|
419
423
|
}
|
|
420
424
|
else {
|
|
421
425
|
ele.innerHTML = content;
|
|
@@ -509,7 +513,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
509
513
|
* @returns {void}
|
|
510
514
|
*/
|
|
511
515
|
updateDataAttribute(value) {
|
|
512
|
-
const invalidAttr = ['class', 'style', 'id', 'type'];
|
|
516
|
+
const invalidAttr = ['class', 'style', 'id', 'type', 'aria-expanded', 'aria-autocomplete', 'aria-readonly'];
|
|
513
517
|
const attr = {};
|
|
514
518
|
for (let a = 0; a < this.element.attributes.length; a++) {
|
|
515
519
|
if (invalidAttr.indexOf(this.element.attributes[a].name) === -1 &&
|
|
@@ -576,6 +580,8 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
576
580
|
this.isRequested = false;
|
|
577
581
|
this.isDataFetched = false;
|
|
578
582
|
this.itemTemplateId = `${this.element.id}${ITEMTEMPLATE_PROPERTY}`;
|
|
583
|
+
this.displayTemplateId = `${this.element.id}${DISPLAYTEMPLATE_PROPERTY}`;
|
|
584
|
+
this.spinnerTemplateId = `${this.element.id}${SPINNERTEMPLATE_PROPERTY}`;
|
|
579
585
|
this.valueTemplateId = `${this.element.id}${VALUETEMPLATE_PROPERTY}`;
|
|
580
586
|
this.groupTemplateId = `${this.element.id}${GROUPTEMPLATE_PROPERTY}`;
|
|
581
587
|
this.headerTemplateId = `${this.element.id}${HEADERTEMPLATE_PROPERTY}`;
|
|
@@ -1674,8 +1680,8 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
1674
1680
|
this.inputWrapper.container.setAttribute('style', this.htmlAttributes[htmlAttr]);
|
|
1675
1681
|
}
|
|
1676
1682
|
else {
|
|
1677
|
-
const defaultAttr = ['title', 'id', 'placeholder',
|
|
1678
|
-
'role', '
|
|
1683
|
+
const defaultAttr = ['title', 'id', 'placeholder',
|
|
1684
|
+
'role', 'autocomplete', 'autocapitalize', 'spellcheck', 'minlength', 'maxlength'];
|
|
1679
1685
|
const validateAttr = ['name', 'required'];
|
|
1680
1686
|
if (this.getModuleName() === 'autocomplete' || this.getModuleName() === 'combobox') {
|
|
1681
1687
|
defaultAttr.push('tabindex');
|
|
@@ -1704,11 +1710,8 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
1704
1710
|
getAriaAttributes() {
|
|
1705
1711
|
return {
|
|
1706
1712
|
'aria-disabled': 'false',
|
|
1707
|
-
'aria-owns': this.element.id + '_options',
|
|
1708
1713
|
'role': 'combobox',
|
|
1709
|
-
'aria-haspopup': 'true',
|
|
1710
1714
|
'aria-expanded': 'false',
|
|
1711
|
-
'aria-activedescendant': 'null',
|
|
1712
1715
|
'aria-live': 'polite',
|
|
1713
1716
|
'aria-labelledby': this.hiddenElement.id
|
|
1714
1717
|
};
|
|
@@ -2428,10 +2431,6 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2428
2431
|
if (this.setValue(e)) {
|
|
2429
2432
|
return;
|
|
2430
2433
|
}
|
|
2431
|
-
attributes(this.targetElement(), { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });
|
|
2432
|
-
if (this.isFilterLayout() && this.filterInput) {
|
|
2433
|
-
attributes(this.filterInput, { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });
|
|
2434
|
-
}
|
|
2435
2434
|
if ((!this.isPopupOpen && !isNullOrUndefined(li)) || (this.isPopupOpen && !isNullOrUndefined(e) &&
|
|
2436
2435
|
(e.type !== 'keydown' || e.type === 'keydown' && e.action === 'enter'))) {
|
|
2437
2436
|
this.isSelectCustom = false;
|
|
@@ -2442,7 +2441,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2442
2441
|
}
|
|
2443
2442
|
if (Browser.info.name !== 'mozilla') {
|
|
2444
2443
|
attributes(this.inputElement, { 'aria-label': this.inputElement.value });
|
|
2445
|
-
attributes(this.targetElement(), { 'aria-describedby': this.inputElement.id });
|
|
2444
|
+
attributes(this.targetElement(), { 'aria-describedby': this.inputElement.id != '' ? this.inputElement.id : this.element.id });
|
|
2446
2445
|
this.targetElement().removeAttribute('aria-live');
|
|
2447
2446
|
}
|
|
2448
2447
|
}
|
|
@@ -2826,11 +2825,8 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2826
2825
|
prepend([parentElement], popupElement);
|
|
2827
2826
|
attributes(this.filterInput, {
|
|
2828
2827
|
'aria-disabled': 'false',
|
|
2829
|
-
'
|
|
2830
|
-
'role': 'listbox',
|
|
2831
|
-
'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null,
|
|
2828
|
+
'role': 'combobox',
|
|
2832
2829
|
'autocomplete': 'off',
|
|
2833
|
-
'autocorrect': 'off',
|
|
2834
2830
|
'autocapitalize': 'off',
|
|
2835
2831
|
'spellcheck': 'false'
|
|
2836
2832
|
});
|
|
@@ -3125,7 +3121,12 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3125
3121
|
this.unWireListEvents();
|
|
3126
3122
|
this.wireListEvents();
|
|
3127
3123
|
}
|
|
3128
|
-
|
|
3124
|
+
this.selectedElementID = this.selectedLI ? this.selectedLI.id : null;
|
|
3125
|
+
attributes(this.targetElement(), { 'aria-expanded': 'true', 'aria-owns': this.inputElement.id + '_options', 'aria-activedescendant': this.selectedElementID });
|
|
3126
|
+
this.inputElement.setAttribute('aria-expanded', 'true');
|
|
3127
|
+
if (this.selectedElementID == null) {
|
|
3128
|
+
this.targetElement().removeAttribute('aria-activedescendant');
|
|
3129
|
+
}
|
|
3129
3130
|
const inputParent = this.isFiltering() ? this.filterInput.parentElement : this.inputWrapper.container;
|
|
3130
3131
|
addClass([inputParent], [dropDownListClasses.inputFocus]);
|
|
3131
3132
|
const animModel = { name: 'FadeIn', duration: 100 };
|
|
@@ -3398,6 +3399,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3398
3399
|
this.filterInput = null;
|
|
3399
3400
|
}
|
|
3400
3401
|
attributes(this.targetElement(), { 'aria-expanded': 'false' });
|
|
3402
|
+
this.inputElement.setAttribute('aria-expanded', 'false');
|
|
3403
|
+
this.targetElement().removeAttribute('aria-owns');
|
|
3404
|
+
this.targetElement().removeAttribute('aria-activedescendant');
|
|
3401
3405
|
this.inputWrapper.container.classList.remove(dropDownListClasses.iconAnimation);
|
|
3402
3406
|
if (this.isFiltering()) {
|
|
3403
3407
|
this.actionCompleteData.isUpdated = false;
|
|
@@ -3455,6 +3459,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3455
3459
|
if (isNullOrUndefined(this.inputElement.getAttribute('type'))) {
|
|
3456
3460
|
this.inputElement.setAttribute('type', 'text');
|
|
3457
3461
|
}
|
|
3462
|
+
this.inputElement.setAttribute('aria-expanded', 'false');
|
|
3458
3463
|
}
|
|
3459
3464
|
else {
|
|
3460
3465
|
this.inputElement = this.createElement('input', { attrs: { role: 'combobox', type: 'text' } });
|
|
@@ -3497,8 +3502,8 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3497
3502
|
this.inputWrapper.container.style.width = formatUnit(this.width);
|
|
3498
3503
|
this.inputWrapper.container.classList.add('e-ddl');
|
|
3499
3504
|
Input.calculateWidth(this.inputElement, this.inputWrapper.container);
|
|
3500
|
-
if (!isNullOrUndefined(this.inputWrapper
|
|
3501
|
-
this.inputWrapper.container.getElementsByClassName('e-float-text-
|
|
3505
|
+
if (!isNullOrUndefined(this.inputWrapper.buttons[0]) && this.inputWrapper.container.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never') {
|
|
3506
|
+
this.inputWrapper.container.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
|
|
3502
3507
|
}
|
|
3503
3508
|
this.wireEvent();
|
|
3504
3509
|
this.tabIndex = this.element.hasAttribute('tabindex') ? this.element.getAttribute('tabindex') : '0';
|
|
@@ -3977,7 +3982,10 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3977
3982
|
if (!isNullOrUndefined(this.list.children[0]) || this.list.classList.contains(dropDownBaseClasses.noData)) {
|
|
3978
3983
|
this.renderPopup(e);
|
|
3979
3984
|
}
|
|
3980
|
-
attributes(this.targetElement(), { 'aria-activedescendant': this.
|
|
3985
|
+
attributes(this.targetElement(), { 'aria-activedescendant': this.selectedElementID });
|
|
3986
|
+
if (this.selectedElementID == null) {
|
|
3987
|
+
this.targetElement().removeAttribute('aria-activedescendant');
|
|
3988
|
+
}
|
|
3981
3989
|
}
|
|
3982
3990
|
renderHightSearch() {
|
|
3983
3991
|
// update high light search
|
|
@@ -4083,10 +4091,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4083
4091
|
return;
|
|
4084
4092
|
}
|
|
4085
4093
|
if (this.inputElement) {
|
|
4086
|
-
const attrArray = ['readonly', 'aria-disabled', 'aria-
|
|
4087
|
-
'
|
|
4088
|
-
'aria-
|
|
4089
|
-
'autocapitalize', 'spellcheck', 'aria-autocomplete', 'aria-live', 'aria-describedby', 'aria-label'];
|
|
4094
|
+
const attrArray = ['readonly', 'aria-disabled', 'placeholder', 'aria-labelledby',
|
|
4095
|
+
'aria-expanded', 'autocomplete', 'aria-readonly', 'autocapitalize',
|
|
4096
|
+
'spellcheck', 'aria-autocomplete', 'aria-live', 'aria-describedby', 'aria-label'];
|
|
4090
4097
|
for (let i = 0; i < attrArray.length; i++) {
|
|
4091
4098
|
this.inputElement.removeAttribute(attrArray[i]);
|
|
4092
4099
|
}
|
|
@@ -7496,15 +7503,12 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
7496
7503
|
}
|
|
7497
7504
|
getAriaAttributes() {
|
|
7498
7505
|
const ariaAttributes = {
|
|
7499
|
-
'aria-owns': this.element.id + '_options',
|
|
7500
7506
|
'role': 'combobox',
|
|
7501
7507
|
'aria-autocomplete': 'both',
|
|
7502
7508
|
'aria-labelledby': this.hiddenElement.id,
|
|
7503
|
-
'aria-hasPopup': 'true',
|
|
7504
7509
|
'aria-expanded': 'false',
|
|
7505
7510
|
'aria-readonly': this.readonly.toString(),
|
|
7506
7511
|
'autocomplete': 'off',
|
|
7507
|
-
'autocorrect': 'off',
|
|
7508
7512
|
'autocapitalize': 'off',
|
|
7509
7513
|
'spellcheck': 'false'
|
|
7510
7514
|
};
|
|
@@ -8338,6 +8342,7 @@ let AutoComplete = class AutoComplete extends ComboBox {
|
|
|
8338
8342
|
}
|
|
8339
8343
|
setSelection(li, e) {
|
|
8340
8344
|
if (!this.isValidLI(li)) {
|
|
8345
|
+
this.selectedLI = li;
|
|
8341
8346
|
return;
|
|
8342
8347
|
}
|
|
8343
8348
|
if (!isNullOrUndefined(e) && e.type === 'keydown' && e.action !== 'enter'
|
|
@@ -8353,7 +8358,6 @@ let AutoComplete = class AutoComplete extends ComboBox {
|
|
|
8353
8358
|
e.action === 'home' || e.action === 'end' || e.action === 'pageUp' || e.action === 'pageDown');
|
|
8354
8359
|
super.setAutoFill(li, isKeyNavigate);
|
|
8355
8360
|
}
|
|
8356
|
-
attributes(this.inputElement, { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });
|
|
8357
8361
|
}
|
|
8358
8362
|
else {
|
|
8359
8363
|
super.setSelection(li, e);
|
|
@@ -8962,7 +8966,13 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
8962
8966
|
this.refreshPopup();
|
|
8963
8967
|
this.renderReactTemplates();
|
|
8964
8968
|
this.popupObj.show(eventArgs.animation, (this.zIndex === 1000) ? this.element : null);
|
|
8965
|
-
attributes(this.inputElement, { 'aria-expanded': 'true' });
|
|
8969
|
+
attributes(this.inputElement, { 'aria-expanded': 'true', 'aria-owns': this.inputElement.id + '_options' });
|
|
8970
|
+
if (this.selectedElementID == null) {
|
|
8971
|
+
this.inputElement.removeAttribute('aria-activedescendant');
|
|
8972
|
+
}
|
|
8973
|
+
else {
|
|
8974
|
+
attributes(this.inputElement, { 'aria-activedescendant': this.selectedElementID });
|
|
8975
|
+
}
|
|
8966
8976
|
if (this.isFirstClick) {
|
|
8967
8977
|
this.loadTemplate();
|
|
8968
8978
|
}
|
|
@@ -9032,11 +9042,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
9032
9042
|
getAriaAttributes() {
|
|
9033
9043
|
const ariaAttributes = {
|
|
9034
9044
|
'aria-disabled': 'false',
|
|
9035
|
-
'
|
|
9036
|
-
'role': 'listbox',
|
|
9037
|
-
'aria-multiselectable': 'true',
|
|
9038
|
-
'aria-activedescendant': 'null',
|
|
9039
|
-
'aria-haspopup': 'true',
|
|
9045
|
+
'role': 'combobox',
|
|
9040
9046
|
'aria-expanded': 'false'
|
|
9041
9047
|
};
|
|
9042
9048
|
return ariaAttributes;
|
|
@@ -9046,7 +9052,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
9046
9052
|
attributes(this.ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
|
|
9047
9053
|
}
|
|
9048
9054
|
const disableStatus = (this.inputElement.disabled) ? true : false;
|
|
9049
|
-
|
|
9055
|
+
if (!this.isPopupOpen()) {
|
|
9056
|
+
attributes(this.inputElement, this.getAriaAttributes());
|
|
9057
|
+
}
|
|
9050
9058
|
if (disableStatus) {
|
|
9051
9059
|
attributes(this.inputElement, { 'aria-disabled': 'true' });
|
|
9052
9060
|
}
|
|
@@ -9428,7 +9436,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
9428
9436
|
this.resetList(tempData, field, query);
|
|
9429
9437
|
}
|
|
9430
9438
|
else {
|
|
9431
|
-
const tempData =
|
|
9439
|
+
const tempData = JSON.parse(JSON.stringify(this.listData));
|
|
9440
|
+
tempData.splice(0, 0, this.inputElement.value);
|
|
9432
9441
|
tempData[0] = (typeof customData === 'number' && !isNaN(parseFloat(tempData[0]))) ?
|
|
9433
9442
|
parseFloat(tempData[0]) : tempData[0];
|
|
9434
9443
|
tempData[0] = (typeof customData === 'boolean') ?
|
|
@@ -10844,6 +10853,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
10844
10853
|
this.removeValue(temp, e, null, true);
|
|
10845
10854
|
}
|
|
10846
10855
|
}
|
|
10856
|
+
this.selectedElementID = null;
|
|
10857
|
+
this.inputElement.removeAttribute('aria-activedescendant');
|
|
10847
10858
|
}
|
|
10848
10859
|
else {
|
|
10849
10860
|
this.clearAllCallback(e);
|
|
@@ -11331,7 +11342,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11331
11342
|
if (this.chipCollectionWrapper) {
|
|
11332
11343
|
this.removeChipSelection();
|
|
11333
11344
|
}
|
|
11334
|
-
|
|
11345
|
+
this.selectedElementID = element.id;
|
|
11335
11346
|
}
|
|
11336
11347
|
}
|
|
11337
11348
|
updateDelimeter(delimChar, e) {
|
|
@@ -12352,6 +12363,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12352
12363
|
this.overAllWrapper.classList.remove(iconAnimation);
|
|
12353
12364
|
this.popupObj.hide(new Animation(eventArgs.animation));
|
|
12354
12365
|
attributes(this.inputElement, { 'aria-expanded': 'false' });
|
|
12366
|
+
this.inputElement.removeAttribute('aria-owns');
|
|
12367
|
+
this.inputElement.removeAttribute('aria-activedescendant');
|
|
12355
12368
|
if (this.allowFiltering) {
|
|
12356
12369
|
this.notify('inputFocus', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', value: 'clear' });
|
|
12357
12370
|
}
|
|
@@ -12538,7 +12551,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12538
12551
|
this.element.setAttribute('data-val', 'false');
|
|
12539
12552
|
}
|
|
12540
12553
|
Input.createSpanElement(this.overAllWrapper, this.createElement);
|
|
12541
|
-
Input.calculateWidth(this.inputElement, this.overAllWrapper);
|
|
12554
|
+
Input.calculateWidth(this.inputElement.parentElement.parentElement, this.overAllWrapper);
|
|
12542
12555
|
if (!isNullOrUndefined(this.overAllWrapper) && !isNullOrUndefined(this.overAllWrapper.getElementsByClassName('e-ddl-icon')[0] && this.overAllWrapper.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never')) {
|
|
12543
12556
|
this.overAllWrapper.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
|
|
12544
12557
|
}
|
|
@@ -12677,7 +12690,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12677
12690
|
this.ulElement = null;
|
|
12678
12691
|
this.mainListCollection = null;
|
|
12679
12692
|
super.destroy();
|
|
12680
|
-
const temp = ['readonly', 'aria-disabled', '
|
|
12693
|
+
const temp = ['readonly', 'aria-disabled', 'placeholder'];
|
|
12681
12694
|
let length = temp.length;
|
|
12682
12695
|
while (length > 0) {
|
|
12683
12696
|
this.inputElement.removeAttribute(temp[length - 1]);
|
|
@@ -13156,11 +13169,8 @@ class CheckBoxSelection {
|
|
|
13156
13169
|
prepend([this.parent.filterParent], args.popupElement);
|
|
13157
13170
|
attributes(this.filterInput, {
|
|
13158
13171
|
'aria-disabled': 'false',
|
|
13159
|
-
'
|
|
13160
|
-
'role': 'listbox',
|
|
13161
|
-
'aria-activedescendant': null,
|
|
13172
|
+
'role': 'combobox',
|
|
13162
13173
|
'autocomplete': 'off',
|
|
13163
|
-
'autocorrect': 'off',
|
|
13164
13174
|
'autocapitalize': 'off',
|
|
13165
13175
|
'spellcheck': 'false'
|
|
13166
13176
|
});
|
|
@@ -13522,7 +13532,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
13522
13532
|
removeClass([this.list], [dropDownBaseClasses.content, dropDownBaseClasses.root]);
|
|
13523
13533
|
this.validationAttribute(this.element, hiddenSelect);
|
|
13524
13534
|
this.list.setAttribute('role', 'listbox');
|
|
13525
|
-
attributes(this.list, { 'role': 'listbox', 'aria-multiselectable': this.selectionSettings.mode === 'Multiple' ? 'true' : 'false' });
|
|
13535
|
+
attributes(this.list, { 'role': 'listbox', 'aria-label': 'listbox', 'aria-multiselectable': this.selectionSettings.mode === 'Multiple' ? 'true' : 'false' });
|
|
13526
13536
|
this.updateSelectionSettings();
|
|
13527
13537
|
}
|
|
13528
13538
|
updateSelectionSettings() {
|
|
@@ -13967,6 +13977,12 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
13967
13977
|
dragArgs = extend(dragArgs, { destination: dragArgs1 });
|
|
13968
13978
|
}
|
|
13969
13979
|
this.trigger('drop', dragArgs);
|
|
13980
|
+
let liCollElem = dragArgs.elements;
|
|
13981
|
+
if (liCollElem.length) {
|
|
13982
|
+
for (let i = 0; i < liCollElem.length; i++) {
|
|
13983
|
+
liCollElem[i].classList.remove('e-grabbed');
|
|
13984
|
+
}
|
|
13985
|
+
}
|
|
13970
13986
|
}
|
|
13971
13987
|
updateListItems(sourceElem, destElem) {
|
|
13972
13988
|
const i = 0;
|
|
@@ -14947,15 +14963,14 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
14947
14963
|
}
|
|
14948
14964
|
getGrabbedItems() {
|
|
14949
14965
|
for (let i = 0; i < this.value.length; i++) {
|
|
14950
|
-
|
|
14951
|
-
|
|
14952
|
-
|
|
14953
|
-
liColl[
|
|
14966
|
+
const liColl = this.list.querySelectorAll('[aria-selected="true"]');
|
|
14967
|
+
for (let j = 0; j < liColl.length; j++) {
|
|
14968
|
+
if (this.value[i] === liColl[j].textContent) {
|
|
14969
|
+
liColl[j].classList.add('e-grabbed');
|
|
14954
14970
|
}
|
|
14955
|
-
break;
|
|
14956
14971
|
}
|
|
14957
14972
|
}
|
|
14958
|
-
const elems = Array.prototype.slice.call(this.element.querySelectorAll('.e-grabbed'));
|
|
14973
|
+
const elems = Array.prototype.slice.call(this.element.nextElementSibling.querySelectorAll('.e-grabbed'));
|
|
14959
14974
|
return elems;
|
|
14960
14975
|
}
|
|
14961
14976
|
getDragArgs(args, isDragEnd) {
|
|
@@ -15630,6 +15645,1364 @@ const listBoxClasses = {
|
|
|
15630
15645
|
clearIcon: 'e-clear-icon'
|
|
15631
15646
|
};
|
|
15632
15647
|
|
|
15648
|
+
/**
|
|
15649
|
+
* export all modules from current location
|
|
15650
|
+
*/
|
|
15651
|
+
|
|
15652
|
+
var __decorate$7 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
15653
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
15654
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
15655
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
15656
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15657
|
+
};
|
|
15658
|
+
/**
|
|
15659
|
+
* The Mention component is used to list someone or something based on user input in textarea, input,
|
|
15660
|
+
* or any other editable element from which the user can select.
|
|
15661
|
+
*/
|
|
15662
|
+
let Mention = class Mention extends DropDownBase {
|
|
15663
|
+
/**
|
|
15664
|
+
* * Constructor for creating the widget
|
|
15665
|
+
*
|
|
15666
|
+
* @param {MentionModel} options - Specifies the MentionComponent model.
|
|
15667
|
+
* @param {string | HTMLElement} element - Specifies the element to render as component.
|
|
15668
|
+
* @private
|
|
15669
|
+
*/
|
|
15670
|
+
constructor(options, element) {
|
|
15671
|
+
super(options, element);
|
|
15672
|
+
}
|
|
15673
|
+
/**
|
|
15674
|
+
* When property value changes happened, then onPropertyChanged method will execute the respective changes in this component.
|
|
15675
|
+
*
|
|
15676
|
+
* @param {MentionModel} newProp - Returns the dynamic property value of the component.
|
|
15677
|
+
* @param {MentionModel} oldProp - Returns the previous property value of the component.
|
|
15678
|
+
* @private
|
|
15679
|
+
* @returns {void}
|
|
15680
|
+
*/
|
|
15681
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
15682
|
+
onPropertyChanged(newProp, oldProp) {
|
|
15683
|
+
for (const prop of Object.keys(newProp)) {
|
|
15684
|
+
switch (prop) {
|
|
15685
|
+
case 'minLength':
|
|
15686
|
+
this.minLength = newProp.minLength;
|
|
15687
|
+
break;
|
|
15688
|
+
case 'suffixText':
|
|
15689
|
+
this.suffixText = newProp.suffixText;
|
|
15690
|
+
break;
|
|
15691
|
+
case 'allowSpaces':
|
|
15692
|
+
this.allowSpaces = newProp.allowSpaces;
|
|
15693
|
+
break;
|
|
15694
|
+
case 'mentionChar':
|
|
15695
|
+
this.mentionChar = newProp.mentionChar;
|
|
15696
|
+
break;
|
|
15697
|
+
case 'showMentionChar':
|
|
15698
|
+
this.showMentionChar = newProp.showMentionChar;
|
|
15699
|
+
break;
|
|
15700
|
+
case 'cssClass':
|
|
15701
|
+
this.updateCssClass(newProp.cssClass, oldProp.cssClass);
|
|
15702
|
+
break;
|
|
15703
|
+
}
|
|
15704
|
+
}
|
|
15705
|
+
}
|
|
15706
|
+
updateCssClass(newClass, oldClass) {
|
|
15707
|
+
if (!isNullOrUndefined(oldClass)) {
|
|
15708
|
+
oldClass = (oldClass.replace(/\s+/g, ' ')).trim();
|
|
15709
|
+
}
|
|
15710
|
+
if (!isNullOrUndefined(newClass)) {
|
|
15711
|
+
newClass = (newClass.replace(/\s+/g, ' ')).trim();
|
|
15712
|
+
}
|
|
15713
|
+
this.setCssClass(newClass, [this.inputElement], oldClass);
|
|
15714
|
+
if (this.popupObj) {
|
|
15715
|
+
this.setCssClass(newClass, [this.popupObj.element], oldClass);
|
|
15716
|
+
}
|
|
15717
|
+
}
|
|
15718
|
+
setCssClass(cssClass$$1, elements, oldClass) {
|
|
15719
|
+
if (!isNullOrUndefined(oldClass) && oldClass !== '') {
|
|
15720
|
+
removeClass(elements, oldClass.split(' '));
|
|
15721
|
+
}
|
|
15722
|
+
if (!isNullOrUndefined(cssClass$$1) && cssClass$$1 !== '') {
|
|
15723
|
+
addClass(elements, cssClass$$1.split(' '));
|
|
15724
|
+
}
|
|
15725
|
+
}
|
|
15726
|
+
initializeData() {
|
|
15727
|
+
this.isSelected = false;
|
|
15728
|
+
this.isFiltered = false;
|
|
15729
|
+
this.beforePopupOpen = false;
|
|
15730
|
+
this.initRemoteRender = false;
|
|
15731
|
+
this.isPopupOpen = false;
|
|
15732
|
+
this.isCollided = false;
|
|
15733
|
+
this.lineBreak = false;
|
|
15734
|
+
this.keyConfigure = {
|
|
15735
|
+
tab: 'tab',
|
|
15736
|
+
enter: '13',
|
|
15737
|
+
escape: '27',
|
|
15738
|
+
end: '35',
|
|
15739
|
+
home: '36',
|
|
15740
|
+
down: '40',
|
|
15741
|
+
up: '38',
|
|
15742
|
+
pageUp: '33',
|
|
15743
|
+
pageDown: '34',
|
|
15744
|
+
open: 'alt+40',
|
|
15745
|
+
close: 'shift+tab',
|
|
15746
|
+
hide: 'alt+38',
|
|
15747
|
+
space: '32'
|
|
15748
|
+
};
|
|
15749
|
+
}
|
|
15750
|
+
/**
|
|
15751
|
+
* Execute before render the list items
|
|
15752
|
+
*
|
|
15753
|
+
* @private
|
|
15754
|
+
* @returns {void}
|
|
15755
|
+
*/
|
|
15756
|
+
preRender() {
|
|
15757
|
+
this.initializeData();
|
|
15758
|
+
super.preRender();
|
|
15759
|
+
}
|
|
15760
|
+
/**
|
|
15761
|
+
* To Initialize the control rendering
|
|
15762
|
+
*
|
|
15763
|
+
* @private
|
|
15764
|
+
* @returns {void}
|
|
15765
|
+
*/
|
|
15766
|
+
render() {
|
|
15767
|
+
this.inputElement = !isNullOrUndefined(this.target) ? ((typeof this.target) === 'string') ?
|
|
15768
|
+
document.querySelector(this.target) : this.target : this.element;
|
|
15769
|
+
if (this.isContentEditable(this.inputElement)) {
|
|
15770
|
+
this.inputElement.setAttribute('contenteditable', 'true');
|
|
15771
|
+
addClass([this.inputElement], ['e-mention']);
|
|
15772
|
+
if (isNullOrUndefined(this.target)) {
|
|
15773
|
+
addClass([this.inputElement], ['e-editable-element']);
|
|
15774
|
+
}
|
|
15775
|
+
}
|
|
15776
|
+
this.queryString = this.elementValue();
|
|
15777
|
+
this.wireEvent();
|
|
15778
|
+
}
|
|
15779
|
+
wireEvent() {
|
|
15780
|
+
EventHandler.add(this.inputElement, 'keyup', this.onKeyUp, this);
|
|
15781
|
+
this.bindCommonEvent();
|
|
15782
|
+
}
|
|
15783
|
+
unWireEvent() {
|
|
15784
|
+
EventHandler.remove(this.inputElement, 'keyup', this.onKeyUp);
|
|
15785
|
+
this.unBindCommonEvent();
|
|
15786
|
+
}
|
|
15787
|
+
bindCommonEvent() {
|
|
15788
|
+
if (!Browser.isDevice) {
|
|
15789
|
+
this.keyboardModule = new KeyboardEvents(this.inputElement, {
|
|
15790
|
+
keyAction: this.keyActionHandler.bind(this), keyConfigs: this.keyConfigure, eventName: 'keydown'
|
|
15791
|
+
});
|
|
15792
|
+
}
|
|
15793
|
+
}
|
|
15794
|
+
/**
|
|
15795
|
+
* Hides the spinner loader.
|
|
15796
|
+
*
|
|
15797
|
+
* @returns {void}
|
|
15798
|
+
*/
|
|
15799
|
+
hideSpinner() {
|
|
15800
|
+
this.hideWaitingSpinner();
|
|
15801
|
+
}
|
|
15802
|
+
hideWaitingSpinner() {
|
|
15803
|
+
if (!isNullOrUndefined(this.spinnerElement)) {
|
|
15804
|
+
hideSpinner(this.spinnerElement);
|
|
15805
|
+
}
|
|
15806
|
+
if (!isNullOrUndefined(this.spinnerTemplate)) {
|
|
15807
|
+
detach(this.spinnerTemplateElement);
|
|
15808
|
+
}
|
|
15809
|
+
}
|
|
15810
|
+
/**
|
|
15811
|
+
* Shows the spinner loader.
|
|
15812
|
+
*
|
|
15813
|
+
* @returns {void}
|
|
15814
|
+
*/
|
|
15815
|
+
showWaitingSpinner() {
|
|
15816
|
+
if (!isNullOrUndefined(this.popupObj)) {
|
|
15817
|
+
if (isNullOrUndefined(this.spinnerTemplate) && isNullOrUndefined(this.spinnerElement)) {
|
|
15818
|
+
this.spinnerElement = this.popupObj.element;
|
|
15819
|
+
createSpinner({
|
|
15820
|
+
target: this.spinnerElement,
|
|
15821
|
+
width: Browser.isDevice ? '16px' : '14px'
|
|
15822
|
+
}, this.createElement);
|
|
15823
|
+
showSpinner(this.spinnerElement);
|
|
15824
|
+
}
|
|
15825
|
+
if (!isNullOrUndefined(this.spinnerTemplate)) {
|
|
15826
|
+
this.setSpinnerTemplate();
|
|
15827
|
+
this.popupObj.element.appendChild(this.spinnerTemplateElement);
|
|
15828
|
+
}
|
|
15829
|
+
}
|
|
15830
|
+
}
|
|
15831
|
+
keyActionHandler(e) {
|
|
15832
|
+
const isNavigation = (e.action === 'down' || e.action === 'up' || e.action === 'pageUp' || e.action === 'pageDown'
|
|
15833
|
+
|| e.action === 'home' || e.action === 'end');
|
|
15834
|
+
const isTabAction = e.action === 'tab' || e.action === 'close';
|
|
15835
|
+
if (this.list === undefined && !this.isRequested && !isTabAction && e.action !== 'escape') {
|
|
15836
|
+
this.renderList();
|
|
15837
|
+
}
|
|
15838
|
+
if (isNullOrUndefined(this.list) || (!isNullOrUndefined(this.liCollections) &&
|
|
15839
|
+
isNavigation && this.liCollections.length === 0) || this.isRequested) {
|
|
15840
|
+
return;
|
|
15841
|
+
}
|
|
15842
|
+
if (e.action === 'escape') {
|
|
15843
|
+
e.preventDefault();
|
|
15844
|
+
}
|
|
15845
|
+
this.isSelected = e.action === 'escape' ? false : this.isSelected;
|
|
15846
|
+
switch (e.action) {
|
|
15847
|
+
case 'down':
|
|
15848
|
+
case 'up':
|
|
15849
|
+
this.updateUpDownAction(e);
|
|
15850
|
+
break;
|
|
15851
|
+
case 'tab':
|
|
15852
|
+
if (this.isPopupOpen) {
|
|
15853
|
+
const li = this.list.querySelector('.' + dropDownBaseClasses.selected);
|
|
15854
|
+
if (li) {
|
|
15855
|
+
this.setSelection(li, e);
|
|
15856
|
+
}
|
|
15857
|
+
if (this.isPopupOpen) {
|
|
15858
|
+
this.hidePopup(e);
|
|
15859
|
+
}
|
|
15860
|
+
}
|
|
15861
|
+
break;
|
|
15862
|
+
case 'enter':
|
|
15863
|
+
if (this.isPopupOpen) {
|
|
15864
|
+
e.preventDefault();
|
|
15865
|
+
if (this.popupObj && this.popupObj.element.contains(this.selectedLI)) {
|
|
15866
|
+
this.setValue(e);
|
|
15867
|
+
}
|
|
15868
|
+
}
|
|
15869
|
+
break;
|
|
15870
|
+
case 'escape':
|
|
15871
|
+
if (this.isPopupOpen) {
|
|
15872
|
+
this.hidePopup(e);
|
|
15873
|
+
}
|
|
15874
|
+
break;
|
|
15875
|
+
}
|
|
15876
|
+
}
|
|
15877
|
+
updateUpDownAction(e) {
|
|
15878
|
+
const focusEle = this.list.querySelector('.' + dropDownBaseClasses.focus);
|
|
15879
|
+
if (this.isSelectFocusItem(focusEle)) {
|
|
15880
|
+
this.setSelection(focusEle, e);
|
|
15881
|
+
}
|
|
15882
|
+
else if (!isNullOrUndefined(this.liCollections)) {
|
|
15883
|
+
const li = this.list.querySelector('.' + dropDownBaseClasses.selected);
|
|
15884
|
+
if (!isNullOrUndefined(li)) {
|
|
15885
|
+
const value = this.getFormattedValue(li.getAttribute('data-value'));
|
|
15886
|
+
this.activeIndex = this.getIndexByValue(value);
|
|
15887
|
+
}
|
|
15888
|
+
let index = e.action === 'down' ? this.activeIndex + 1 : this.activeIndex - 1;
|
|
15889
|
+
let startIndex = 0;
|
|
15890
|
+
startIndex = e.action === 'down' && isNullOrUndefined(this.activeIndex) ? 0 : this.liCollections.length - 1;
|
|
15891
|
+
index = index < 0 ? this.liCollections.length - 1 : index === this.liCollections.length ? 0 : index;
|
|
15892
|
+
const nextItem = isNullOrUndefined(this.activeIndex) ? this.liCollections[startIndex] : this.liCollections[index];
|
|
15893
|
+
if (!isNullOrUndefined(nextItem)) {
|
|
15894
|
+
this.setSelection(nextItem, e);
|
|
15895
|
+
}
|
|
15896
|
+
}
|
|
15897
|
+
if (this.isPopupOpen) {
|
|
15898
|
+
e.preventDefault();
|
|
15899
|
+
}
|
|
15900
|
+
}
|
|
15901
|
+
isSelectFocusItem(element) {
|
|
15902
|
+
return !isNullOrUndefined(element);
|
|
15903
|
+
}
|
|
15904
|
+
unBindCommonEvent() {
|
|
15905
|
+
if (!Browser.isDevice) {
|
|
15906
|
+
this.keyboardModule.destroy();
|
|
15907
|
+
}
|
|
15908
|
+
}
|
|
15909
|
+
onKeyUp(e) {
|
|
15910
|
+
let rangetextContent;
|
|
15911
|
+
if (this.isContentEditable(this.inputElement)) {
|
|
15912
|
+
this.range = this.getCurrentRange();
|
|
15913
|
+
rangetextContent = this.range.startContainer.textContent.split('');
|
|
15914
|
+
}
|
|
15915
|
+
let currentRange = this.getTextRange();
|
|
15916
|
+
const lastWordRange = this.getLastLetter(currentRange);
|
|
15917
|
+
const Regex = new RegExp(this.mentionChar, 'g');
|
|
15918
|
+
const charRegex = new RegExp('[a-zA-Z]', 'g');
|
|
15919
|
+
if (e.key === 'Shift' || e.keyCode === 37 || e.keyCode === 39) {
|
|
15920
|
+
return;
|
|
15921
|
+
}
|
|
15922
|
+
if ((!currentRange || !lastWordRange) || e.code === 'Enter' || e.keyCode === 27 ||
|
|
15923
|
+
(lastWordRange.match(Regex) && lastWordRange.match(Regex).length > 1) ||
|
|
15924
|
+
(this.isContentEditable(this.inputElement) && this.range.startContainer &&
|
|
15925
|
+
this.range.startContainer.previousElementSibling && this.range.startContainer.textContent.split('').length > 0 &&
|
|
15926
|
+
(rangetextContent.length === 1 || rangetextContent[rangetextContent.length - 2].indexOf('') === -1 ||
|
|
15927
|
+
this.range.startContainer.nodeType === 1))) {
|
|
15928
|
+
if (this.allowSpaces && currentRange && currentRange.trim() !== '' && charRegex.test(currentRange) && currentRange.indexOf(this.mentionChar) !== -1
|
|
15929
|
+
&& !this.isMatchedText() && (currentRange.length > 1 && currentRange.replace(/\u00A0/g, ' ').charAt(currentRange.length - 2) !== ' ') &&
|
|
15930
|
+
(this.list && this.list.querySelectorAll('ul').length > 0)) {
|
|
15931
|
+
this.queryString = currentRange.substring(currentRange.lastIndexOf(this.mentionChar) + 1).replace('\u00a0', ' ');
|
|
15932
|
+
this.searchLists(e);
|
|
15933
|
+
}
|
|
15934
|
+
else if (this.isPopupOpen && (!this.allowSpaces || !lastWordRange)) {
|
|
15935
|
+
this.hidePopup();
|
|
15936
|
+
this.lineBreak = true;
|
|
15937
|
+
}
|
|
15938
|
+
return;
|
|
15939
|
+
}
|
|
15940
|
+
this.queryString = lastWordRange.replace(this.mentionChar, '');
|
|
15941
|
+
if (this.mentionChar.charCodeAt(0) === lastWordRange.charCodeAt(0) &&
|
|
15942
|
+
this.queryString !== '' && e.keyCode !== 38 && e.keyCode !== 40 && !this.lineBreak) {
|
|
15943
|
+
this.searchLists(e);
|
|
15944
|
+
if (!this.isPopupOpen && this.queryString.length >= this.minLength) {
|
|
15945
|
+
if (!this.isContentEditable(this.inputElement)) {
|
|
15946
|
+
this.showPopup();
|
|
15947
|
+
}
|
|
15948
|
+
else if (this.isContentEditable(this.inputElement) && this.range && this.range.startContainer !== this.inputElement) {
|
|
15949
|
+
this.showPopup();
|
|
15950
|
+
}
|
|
15951
|
+
}
|
|
15952
|
+
}
|
|
15953
|
+
else if (lastWordRange.indexOf(this.mentionChar) === 0 && !this.isPopupOpen && e.keyCode !== 8 && (!this.popupObj ||
|
|
15954
|
+
(isNullOrUndefined(this.target) && !document.body.contains(this.popupObj.element) ||
|
|
15955
|
+
!isNullOrUndefined(this.target) && document.body.contains(this.popupObj.element)))) {
|
|
15956
|
+
if (this.initRemoteRender && this.list && this.list.classList.contains('e-nodata')) {
|
|
15957
|
+
this.searchLists(e);
|
|
15958
|
+
}
|
|
15959
|
+
this.resetList(this.dataSource, this.fields);
|
|
15960
|
+
if (isNullOrUndefined(this.list)) {
|
|
15961
|
+
this.initValue();
|
|
15962
|
+
}
|
|
15963
|
+
if (!this.isPopupOpen && e.keyCode !== 38 && e.keyCode !== 40) {
|
|
15964
|
+
this.showPopup();
|
|
15965
|
+
if (this.initRemoteRender && this.list.querySelectorAll('li').length === 0) {
|
|
15966
|
+
this.showWaitingSpinner();
|
|
15967
|
+
}
|
|
15968
|
+
this.lineBreak = false;
|
|
15969
|
+
}
|
|
15970
|
+
}
|
|
15971
|
+
else if (this.allowSpaces && this.queryString !== '' && currentRange && currentRange.trim() !== '' && currentRange.replace('\u00a0', ' ').lastIndexOf(' ') < currentRange.length - 1 &&
|
|
15972
|
+
e.keyCode !== 38 && e.keyCode !== 40 && e.keyCode !== 8) {
|
|
15973
|
+
this.queryString = currentRange.substring(currentRange.lastIndexOf(this.mentionChar) + 1).replace('\u00a0', ' ');
|
|
15974
|
+
this.searchLists(e);
|
|
15975
|
+
}
|
|
15976
|
+
else if (this.queryString === '' && this.isPopupOpen && e.keyCode !== 38 && e.keyCode !== 40) {
|
|
15977
|
+
this.resetList(this.dataSource, this.fields);
|
|
15978
|
+
}
|
|
15979
|
+
}
|
|
15980
|
+
isMatchedText() {
|
|
15981
|
+
let isMatched = false;
|
|
15982
|
+
for (let i = 0; i < (this.liCollections && this.liCollections.length); i++) {
|
|
15983
|
+
if (this.getTextRange() &&
|
|
15984
|
+
this.getTextRange().substring(this.getTextRange().lastIndexOf(this.mentionChar) + 1).replace('\u00a0', ' ').trim() === this.liCollections[i].getAttribute('data-value').toLowerCase()) {
|
|
15985
|
+
isMatched = true;
|
|
15986
|
+
}
|
|
15987
|
+
}
|
|
15988
|
+
return isMatched;
|
|
15989
|
+
}
|
|
15990
|
+
getCurrentRange() {
|
|
15991
|
+
this.range = this.inputElement.ownerDocument.getSelection().getRangeAt(0);
|
|
15992
|
+
return this.range;
|
|
15993
|
+
}
|
|
15994
|
+
searchLists(e) {
|
|
15995
|
+
this.isDataFetched = false;
|
|
15996
|
+
if (isNullOrUndefined(this.list)) {
|
|
15997
|
+
super.render();
|
|
15998
|
+
this.unWireListEvents();
|
|
15999
|
+
this.wireListEvents();
|
|
16000
|
+
}
|
|
16001
|
+
if (e.type !== 'mousedown' && (e.keyCode === 40 || e.keyCode === 38)) {
|
|
16002
|
+
this.queryString = this.queryString === '' ? null : this.queryString;
|
|
16003
|
+
this.beforePopupOpen = true;
|
|
16004
|
+
this.resetList(this.dataSource, this.fields);
|
|
16005
|
+
return;
|
|
16006
|
+
}
|
|
16007
|
+
this.isSelected = false;
|
|
16008
|
+
this.activeIndex = null;
|
|
16009
|
+
const eventArgs = {
|
|
16010
|
+
preventDefaultAction: false,
|
|
16011
|
+
text: this.elementValue(),
|
|
16012
|
+
updateData: (dataSource, query, fields) => {
|
|
16013
|
+
if (eventArgs.cancel) {
|
|
16014
|
+
return;
|
|
16015
|
+
}
|
|
16016
|
+
this.isFiltered = true;
|
|
16017
|
+
this.filterAction(dataSource, query, fields);
|
|
16018
|
+
},
|
|
16019
|
+
cancel: false
|
|
16020
|
+
};
|
|
16021
|
+
this.trigger('filtering', eventArgs, (eventArgs) => {
|
|
16022
|
+
if (!eventArgs.cancel && !this.isFiltered && !eventArgs.preventDefaultAction) {
|
|
16023
|
+
this.filterAction(this.dataSource, null, this.fields);
|
|
16024
|
+
}
|
|
16025
|
+
});
|
|
16026
|
+
}
|
|
16027
|
+
filterAction(dataSource, query, fields) {
|
|
16028
|
+
this.beforePopupOpen = true;
|
|
16029
|
+
if (this.queryString !== '' && (this.queryString.length >= this.minLength)) {
|
|
16030
|
+
this.resetList(dataSource, fields, query);
|
|
16031
|
+
}
|
|
16032
|
+
else {
|
|
16033
|
+
if (this.isPopupOpen) {
|
|
16034
|
+
this.hidePopup();
|
|
16035
|
+
}
|
|
16036
|
+
this.beforePopupOpen = false;
|
|
16037
|
+
}
|
|
16038
|
+
this.setDataIndex();
|
|
16039
|
+
this.renderReactTemplates();
|
|
16040
|
+
}
|
|
16041
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
16042
|
+
onActionComplete(ulElement, list, e, isUpdated) {
|
|
16043
|
+
super.onActionComplete(ulElement, list, e);
|
|
16044
|
+
if (this.isActive) {
|
|
16045
|
+
if (!isNullOrUndefined(ulElement)) {
|
|
16046
|
+
attributes(ulElement, { 'id': this.inputElement.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
|
|
16047
|
+
}
|
|
16048
|
+
let focusItem = ulElement.querySelector('.' + dropDownBaseClasses.li);
|
|
16049
|
+
if (focusItem) {
|
|
16050
|
+
focusItem.classList.add(dropDownBaseClasses.selected);
|
|
16051
|
+
this.selectedLI = focusItem;
|
|
16052
|
+
const value = this.getFormattedValue(focusItem.getAttribute('data-value'));
|
|
16053
|
+
this.selectEventCallback(focusItem, this.getDataByValue(value), value, true);
|
|
16054
|
+
}
|
|
16055
|
+
}
|
|
16056
|
+
}
|
|
16057
|
+
setDataIndex() {
|
|
16058
|
+
for (let i = 0; this.liCollections && i < this.liCollections.length; i++) {
|
|
16059
|
+
this.liCollections[i].setAttribute('data-index', i.toString());
|
|
16060
|
+
}
|
|
16061
|
+
}
|
|
16062
|
+
listOption(dataSource, fieldsSettings) {
|
|
16063
|
+
const fields = super.listOption(dataSource, fieldsSettings);
|
|
16064
|
+
if (isNullOrUndefined(fields.itemCreated)) {
|
|
16065
|
+
fields.itemCreated = (e) => {
|
|
16066
|
+
if (this.highlight) {
|
|
16067
|
+
if (this.inputElement.tagName === this.getNgDirective() && this.itemTemplate) {
|
|
16068
|
+
setTimeout(() => {
|
|
16069
|
+
highlightSearch(e.item, this.queryString, this.ignoreCase, this.filterType);
|
|
16070
|
+
}, 0);
|
|
16071
|
+
}
|
|
16072
|
+
else {
|
|
16073
|
+
highlightSearch(e.item, this.queryString, this.ignoreCase, this.filterType);
|
|
16074
|
+
}
|
|
16075
|
+
}
|
|
16076
|
+
};
|
|
16077
|
+
}
|
|
16078
|
+
else {
|
|
16079
|
+
const itemCreated = fields.itemCreated;
|
|
16080
|
+
fields.itemCreated = (e) => {
|
|
16081
|
+
if (this.highlight) {
|
|
16082
|
+
highlightSearch(e.item, this.queryString, this.ignoreCase, this.filterType);
|
|
16083
|
+
}
|
|
16084
|
+
itemCreated.apply(this, [e]);
|
|
16085
|
+
};
|
|
16086
|
+
}
|
|
16087
|
+
return fields;
|
|
16088
|
+
}
|
|
16089
|
+
elementValue() {
|
|
16090
|
+
if (!this.isContentEditable(this.inputElement)) {
|
|
16091
|
+
return this.inputElement.value.replace(this.mentionChar, '');
|
|
16092
|
+
}
|
|
16093
|
+
else {
|
|
16094
|
+
return this.inputElement.textContent.replace(this.mentionChar, '');
|
|
16095
|
+
}
|
|
16096
|
+
}
|
|
16097
|
+
getQuery(query) {
|
|
16098
|
+
const filterQuery = query ? query.clone() : this.query ? this.query.clone() : new Query();
|
|
16099
|
+
const filterType = (this.queryString === '' && !isNullOrUndefined(this.elementValue())) ? 'equal' : this.filterType;
|
|
16100
|
+
const queryString = (this.queryString === '' && !isNullOrUndefined(this.elementValue())) ?
|
|
16101
|
+
this.elementValue() : this.queryString;
|
|
16102
|
+
if (this.isFiltered) {
|
|
16103
|
+
return filterQuery;
|
|
16104
|
+
}
|
|
16105
|
+
if (this.queryString !== null && this.queryString !== '') {
|
|
16106
|
+
const dataType = this.typeOfData(this.dataSource).typeof;
|
|
16107
|
+
if (!(this.dataSource instanceof DataManager) && dataType === 'string' || dataType === 'number') {
|
|
16108
|
+
filterQuery.where('', filterType, queryString, this.ignoreCase, this.ignoreAccent);
|
|
16109
|
+
}
|
|
16110
|
+
else {
|
|
16111
|
+
const mapping = !isNullOrUndefined(this.fields.text) ? this.fields.text : '';
|
|
16112
|
+
filterQuery.where(mapping, filterType, queryString, this.ignoreCase, this.ignoreAccent);
|
|
16113
|
+
}
|
|
16114
|
+
}
|
|
16115
|
+
if (!isNullOrUndefined(this.suggestionCount)) {
|
|
16116
|
+
// Since defualt value of suggestioncount is 25, checked the condition
|
|
16117
|
+
if (this.suggestionCount !== 25) {
|
|
16118
|
+
for (let queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
|
|
16119
|
+
if (filterQuery.queries[queryElements].fn === 'onTake') {
|
|
16120
|
+
filterQuery.queries.splice(queryElements, 1);
|
|
16121
|
+
}
|
|
16122
|
+
}
|
|
16123
|
+
}
|
|
16124
|
+
filterQuery.take(this.suggestionCount);
|
|
16125
|
+
}
|
|
16126
|
+
return filterQuery;
|
|
16127
|
+
}
|
|
16128
|
+
renderHightSearch() {
|
|
16129
|
+
if (this.highlight) {
|
|
16130
|
+
for (let i = 0; i < this.liCollections.length; i++) {
|
|
16131
|
+
const isHighlight = this.ulElement.querySelector('.e-active');
|
|
16132
|
+
if (!isHighlight) {
|
|
16133
|
+
revertHighlightSearch(this.liCollections[i]);
|
|
16134
|
+
highlightSearch(this.liCollections[i], this.queryString, this.ignoreCase, this.filterType);
|
|
16135
|
+
}
|
|
16136
|
+
}
|
|
16137
|
+
}
|
|
16138
|
+
}
|
|
16139
|
+
getTextRange() {
|
|
16140
|
+
let text;
|
|
16141
|
+
if (!this.isContentEditable(this.inputElement)) {
|
|
16142
|
+
const component = this.inputElement;
|
|
16143
|
+
if (!isNullOrUndefined(component)) {
|
|
16144
|
+
const startPos = component.selectionStart;
|
|
16145
|
+
if (component.value && startPos >= 0) {
|
|
16146
|
+
text = component.value.substring(0, startPos);
|
|
16147
|
+
}
|
|
16148
|
+
}
|
|
16149
|
+
}
|
|
16150
|
+
else {
|
|
16151
|
+
const selectedElem = this.range.startContainer;
|
|
16152
|
+
if (!isNullOrUndefined(selectedElem)) {
|
|
16153
|
+
const workingNodeContent = selectedElem.textContent;
|
|
16154
|
+
let selectStartOffset = this.range.startOffset;
|
|
16155
|
+
if (workingNodeContent && selectStartOffset >= 0) {
|
|
16156
|
+
text = workingNodeContent.substring(0, selectStartOffset);
|
|
16157
|
+
}
|
|
16158
|
+
}
|
|
16159
|
+
}
|
|
16160
|
+
return text;
|
|
16161
|
+
}
|
|
16162
|
+
getLastLetter(text) {
|
|
16163
|
+
if (isNullOrUndefined(text)) {
|
|
16164
|
+
return '';
|
|
16165
|
+
}
|
|
16166
|
+
const textValue = text.replace(/\u00A0/g, ' ');
|
|
16167
|
+
const words = textValue.split(/\s+/);
|
|
16168
|
+
let wordCnt = words.length - 1;
|
|
16169
|
+
return words[wordCnt].trim();
|
|
16170
|
+
}
|
|
16171
|
+
isContentEditable(element) {
|
|
16172
|
+
return element && element.nodeName !== 'INPUT' && element.nodeName !== 'TEXTAREA';
|
|
16173
|
+
}
|
|
16174
|
+
/**
|
|
16175
|
+
* Opens the popup that displays the list of items.
|
|
16176
|
+
*
|
|
16177
|
+
* @returns {void}
|
|
16178
|
+
*/
|
|
16179
|
+
showPopup() {
|
|
16180
|
+
this.renderPopup();
|
|
16181
|
+
attributes(this.inputElement, { 'aria-activedescendant': this.selectedElementID });
|
|
16182
|
+
if (this.selectedElementID == null) {
|
|
16183
|
+
this.inputElement.removeAttribute('aria-activedescendant');
|
|
16184
|
+
}
|
|
16185
|
+
}
|
|
16186
|
+
/* eslint-disable valid-jsdoc, jsdoc/require-param */
|
|
16187
|
+
/**
|
|
16188
|
+
* Hides the popup if it is in an open state.
|
|
16189
|
+
*
|
|
16190
|
+
* @returns {void}
|
|
16191
|
+
*/
|
|
16192
|
+
hidePopup(e) {
|
|
16193
|
+
this.removeSelection();
|
|
16194
|
+
this.closePopup(0, e);
|
|
16195
|
+
}
|
|
16196
|
+
closePopup(delay, e) {
|
|
16197
|
+
if (!(this.popupObj && document.body.contains(this.popupObj.element) && this.beforePopupOpen)) {
|
|
16198
|
+
return;
|
|
16199
|
+
}
|
|
16200
|
+
EventHandler.remove(document, 'mousedown', this.onDocumentClick);
|
|
16201
|
+
this.inputElement.removeAttribute('aria-owns');
|
|
16202
|
+
this.inputElement.removeAttribute('aria-activedescendant');
|
|
16203
|
+
this.beforePopupOpen = false;
|
|
16204
|
+
const animModel = {
|
|
16205
|
+
name: 'FadeOut',
|
|
16206
|
+
duration: 100,
|
|
16207
|
+
delay: delay ? delay : 0
|
|
16208
|
+
};
|
|
16209
|
+
const popupInstance = this.popupObj;
|
|
16210
|
+
const eventArgs = { popup: popupInstance, cancel: false, animation: animModel, event: e || null };
|
|
16211
|
+
this.trigger('closed', eventArgs, (eventArgs) => {
|
|
16212
|
+
if (!eventArgs.cancel && this.popupObj) {
|
|
16213
|
+
if (this.isPopupOpen) {
|
|
16214
|
+
this.popupObj.hide(new Animation(eventArgs.animation));
|
|
16215
|
+
}
|
|
16216
|
+
else {
|
|
16217
|
+
this.destroyPopup();
|
|
16218
|
+
}
|
|
16219
|
+
}
|
|
16220
|
+
});
|
|
16221
|
+
}
|
|
16222
|
+
renderPopup() {
|
|
16223
|
+
const args = { cancel: false };
|
|
16224
|
+
this.trigger('beforeOpen', args, (args) => {
|
|
16225
|
+
if (!args.cancel) {
|
|
16226
|
+
const popupEle = isNullOrUndefined(this.target) ? this.createElement('div', {
|
|
16227
|
+
id: this.inputElement.id + '_popup', className: 'e-mention e-popup ' + (this.cssClass != null ? this.cssClass : '')
|
|
16228
|
+
}) : this.element;
|
|
16229
|
+
if (!isNullOrUndefined(this.target)) {
|
|
16230
|
+
popupEle.id = this.inputElement.id + '_popup';
|
|
16231
|
+
addClass([popupEle], ['e-mention', 'e-popup', 'e-popup-close']);
|
|
16232
|
+
}
|
|
16233
|
+
this.listHeight = formatUnit(this.popupHeight);
|
|
16234
|
+
if (!isNullOrUndefined(this.list.querySelector('li')) && !this.initRemoteRender) {
|
|
16235
|
+
const li = this.list.querySelector('.' + dropDownBaseClasses.focus);
|
|
16236
|
+
if (!isNullOrUndefined(li)) {
|
|
16237
|
+
this.selectedLI = li;
|
|
16238
|
+
const value = this.getFormattedValue(li.getAttribute('data-value'));
|
|
16239
|
+
this.selectEventCallback(li, this.getDataByValue(value), value, true);
|
|
16240
|
+
}
|
|
16241
|
+
}
|
|
16242
|
+
append([this.list], popupEle);
|
|
16243
|
+
if ((!this.popupObj || !document.body.contains(this.popupObj.element)) || !document.contains(popupEle) && isNullOrUndefined(this.target)) {
|
|
16244
|
+
document.body.appendChild(popupEle);
|
|
16245
|
+
}
|
|
16246
|
+
let coordinates;
|
|
16247
|
+
popupEle.style.visibility = 'hidden';
|
|
16248
|
+
if (this.popupHeight !== 'auto') {
|
|
16249
|
+
this.list.style.maxHeight = (parseInt(this.listHeight, 10) - 2).toString() + 'px'; // due to box-sizing property
|
|
16250
|
+
popupEle.style.maxHeight = formatUnit(this.popupHeight);
|
|
16251
|
+
}
|
|
16252
|
+
else {
|
|
16253
|
+
popupEle.style.height = 'auto';
|
|
16254
|
+
}
|
|
16255
|
+
const offsetValue = 0;
|
|
16256
|
+
const left = 0;
|
|
16257
|
+
this.initializePopup(popupEle, offsetValue, left);
|
|
16258
|
+
this.checkCollision(popupEle);
|
|
16259
|
+
popupEle.style.visibility = 'visible';
|
|
16260
|
+
if (!isNullOrUndefined(this.list)) {
|
|
16261
|
+
this.unWireListEvents();
|
|
16262
|
+
this.wireListEvents();
|
|
16263
|
+
}
|
|
16264
|
+
this.selectedElementID = this.selectedLI ? this.selectedLI.id : null;
|
|
16265
|
+
attributes(this.inputElement, { 'aria-owns': this.inputElement.id + '_options', 'aria-activedescendant': this.selectedElementID });
|
|
16266
|
+
if (this.selectedElementID == null) {
|
|
16267
|
+
this.inputElement.removeAttribute('aria-activedescendant');
|
|
16268
|
+
}
|
|
16269
|
+
const animModel = { name: 'FadeIn', duration: 100 };
|
|
16270
|
+
this.beforePopupOpen = true;
|
|
16271
|
+
const popupInstance = this.popupObj;
|
|
16272
|
+
const eventArgs = { popup: popupInstance, cancel: false, animation: animModel };
|
|
16273
|
+
this.trigger('opened', eventArgs, (eventArgs) => {
|
|
16274
|
+
if (!eventArgs.cancel) {
|
|
16275
|
+
this.renderReactTemplates();
|
|
16276
|
+
this.popupObj.show(new Animation(eventArgs.animation), (this.zIndex === 1000) ? this.inputElement : null);
|
|
16277
|
+
coordinates = this.getCoordinates(this.inputElement, this.getTriggerCharPosition());
|
|
16278
|
+
if (!this.isCollided) {
|
|
16279
|
+
popupEle.style.cssText = 'top: '.concat(coordinates.top.toString(), 'px;\n left: ').concat(coordinates.left.toString(), 'px;\nposition: absolute;\n display: block;');
|
|
16280
|
+
}
|
|
16281
|
+
else {
|
|
16282
|
+
popupEle.style.left = formatUnit(coordinates.left);
|
|
16283
|
+
this.isCollided = false;
|
|
16284
|
+
}
|
|
16285
|
+
popupEle.style.width = this.popupWidth !== '100%' && !isNullOrUndefined(this.popupWidth) ? formatUnit(this.popupWidth) : 'auto';
|
|
16286
|
+
}
|
|
16287
|
+
else {
|
|
16288
|
+
this.beforePopupOpen = false;
|
|
16289
|
+
this.destroyPopup();
|
|
16290
|
+
}
|
|
16291
|
+
});
|
|
16292
|
+
}
|
|
16293
|
+
else {
|
|
16294
|
+
this.beforePopupOpen = false;
|
|
16295
|
+
}
|
|
16296
|
+
});
|
|
16297
|
+
}
|
|
16298
|
+
checkCollision(popupEle) {
|
|
16299
|
+
if (!Browser.isDevice || (Browser.isDevice && !(this.getModuleName() === 'mention'))) {
|
|
16300
|
+
const collision = isCollide(popupEle);
|
|
16301
|
+
if (collision.length > 0) {
|
|
16302
|
+
popupEle.style.marginTop = -parseInt(getComputedStyle(popupEle).marginTop, 10) + 'px';
|
|
16303
|
+
this.isCollided = true;
|
|
16304
|
+
}
|
|
16305
|
+
this.popupObj.resolveCollision();
|
|
16306
|
+
}
|
|
16307
|
+
}
|
|
16308
|
+
getTriggerCharPosition() {
|
|
16309
|
+
let mostRecentTriggerCharPos;
|
|
16310
|
+
const currentRange = this.getTextRange();
|
|
16311
|
+
if (currentRange !== undefined && currentRange !== null) {
|
|
16312
|
+
mostRecentTriggerCharPos = 0;
|
|
16313
|
+
const idx = currentRange.lastIndexOf(this.mentionChar);
|
|
16314
|
+
if (idx >= mostRecentTriggerCharPos) {
|
|
16315
|
+
mostRecentTriggerCharPos = idx;
|
|
16316
|
+
}
|
|
16317
|
+
}
|
|
16318
|
+
return mostRecentTriggerCharPos;
|
|
16319
|
+
}
|
|
16320
|
+
initializePopup(element, offsetValue, left) {
|
|
16321
|
+
this.popupObj = new Popup(element, {
|
|
16322
|
+
width: this.setWidth(), targetType: 'relative',
|
|
16323
|
+
relateTo: this.inputElement, collision: { X: 'flip', Y: 'flip' }, offsetY: offsetValue,
|
|
16324
|
+
enableRtl: this.enableRtl, offsetX: left, position: { X: 'top', Y: 'left' }, actionOnScroll: 'hide',
|
|
16325
|
+
zIndex: this.zIndex,
|
|
16326
|
+
close: () => {
|
|
16327
|
+
this.destroyPopup();
|
|
16328
|
+
},
|
|
16329
|
+
open: () => {
|
|
16330
|
+
EventHandler.add(document, 'mousedown', this.onDocumentClick, this);
|
|
16331
|
+
this.isPopupOpen = true;
|
|
16332
|
+
this.setDataIndex();
|
|
16333
|
+
}
|
|
16334
|
+
});
|
|
16335
|
+
}
|
|
16336
|
+
setWidth() {
|
|
16337
|
+
let width = formatUnit(this.popupWidth);
|
|
16338
|
+
if (width.indexOf('%') > -1) {
|
|
16339
|
+
const inputWidth = this.inputElement.offsetWidth * parseFloat(width) / 100;
|
|
16340
|
+
width = inputWidth.toString() + 'px';
|
|
16341
|
+
}
|
|
16342
|
+
return width;
|
|
16343
|
+
}
|
|
16344
|
+
destroyPopup() {
|
|
16345
|
+
this.isPopupOpen = false;
|
|
16346
|
+
this.popupObj.destroy();
|
|
16347
|
+
if (isNullOrUndefined(this.target)) {
|
|
16348
|
+
detach(this.popupObj.element);
|
|
16349
|
+
}
|
|
16350
|
+
else {
|
|
16351
|
+
this.popupObj.element.innerHTML = '';
|
|
16352
|
+
this.popupObj.element.removeAttribute('style');
|
|
16353
|
+
this.popupObj.element.removeAttribute('aria-disabled');
|
|
16354
|
+
}
|
|
16355
|
+
}
|
|
16356
|
+
onDocumentClick(e) {
|
|
16357
|
+
const target = e.target;
|
|
16358
|
+
if (!(!isNullOrUndefined(this.popupObj) && closest(target, '#' + this.popupObj.element.id))) {
|
|
16359
|
+
this.hidePopup(e);
|
|
16360
|
+
}
|
|
16361
|
+
}
|
|
16362
|
+
getCoordinates(element, position) {
|
|
16363
|
+
const properties = ['direction', 'boxSizing', 'width', 'height', 'overflowX', 'overflowY', 'borderTopWidth', 'borderRightWidth', 'borderBottomWidth', 'borderLeftWidth', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'fontStyle', 'fontVariant', 'fontWeight', 'fontStretch', 'fontSize', 'fontSizeAdjust', 'lineHeight', 'fontFamily', 'textAlign', 'textTransform', 'textIndent', 'textDecoration', 'letterSpacing', 'wordSpacing'];
|
|
16364
|
+
let div;
|
|
16365
|
+
let span;
|
|
16366
|
+
let range;
|
|
16367
|
+
let globalRange;
|
|
16368
|
+
let coordinates;
|
|
16369
|
+
let computed;
|
|
16370
|
+
let rect;
|
|
16371
|
+
if (!this.isContentEditable(this.inputElement)) {
|
|
16372
|
+
div = this.createElement('div', { className: 'e-form-mirror-div' });
|
|
16373
|
+
document.body.appendChild(div);
|
|
16374
|
+
computed = getComputedStyle(element);
|
|
16375
|
+
div.style.position = 'absolute';
|
|
16376
|
+
div.style.visibility = 'hidden';
|
|
16377
|
+
properties.forEach((prop) => {
|
|
16378
|
+
div.style[prop] = computed[prop];
|
|
16379
|
+
});
|
|
16380
|
+
div.textContent = element.value.substring(0, position);
|
|
16381
|
+
if (this.inputElement.nodeName === 'INPUT') {
|
|
16382
|
+
div.textContent = div.textContent.replace(/\s/g, '\u00a0');
|
|
16383
|
+
}
|
|
16384
|
+
span = this.createElement('span');
|
|
16385
|
+
span.textContent = element.value.substring(position) || '.';
|
|
16386
|
+
div.appendChild(span);
|
|
16387
|
+
rect = element.getBoundingClientRect();
|
|
16388
|
+
}
|
|
16389
|
+
else {
|
|
16390
|
+
const selectedNodePosition = this.getTriggerCharPosition();
|
|
16391
|
+
globalRange = this.range;
|
|
16392
|
+
range = document.createRange();
|
|
16393
|
+
range.setStart(globalRange.startContainer, selectedNodePosition);
|
|
16394
|
+
range.setEnd(globalRange.startContainer, selectedNodePosition);
|
|
16395
|
+
range.collapse(false);
|
|
16396
|
+
rect = range.getBoundingClientRect();
|
|
16397
|
+
}
|
|
16398
|
+
const doc = document.documentElement;
|
|
16399
|
+
const windowLeft = (window.pageXOffset || doc.scrollLeft) - (doc.clientLeft || 0);
|
|
16400
|
+
const windowTop = (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0);
|
|
16401
|
+
if (!this.isContentEditable(this.inputElement)) {
|
|
16402
|
+
coordinates = {
|
|
16403
|
+
top: rect.top + windowTop + span.offsetTop + parseInt(computed.borderTopWidth, 10) +
|
|
16404
|
+
parseInt(computed.fontSize, 10) + 3 - element.scrollTop,
|
|
16405
|
+
left: rect.left + windowLeft + span.offsetLeft + parseInt(computed.borderLeftWidth, 10)
|
|
16406
|
+
};
|
|
16407
|
+
document.body.removeChild(div);
|
|
16408
|
+
}
|
|
16409
|
+
else {
|
|
16410
|
+
coordinates = {
|
|
16411
|
+
top: rect.top + windowTop + parseInt(getComputedStyle(this.inputElement).fontSize),
|
|
16412
|
+
left: rect.left + windowLeft
|
|
16413
|
+
};
|
|
16414
|
+
}
|
|
16415
|
+
return coordinates;
|
|
16416
|
+
}
|
|
16417
|
+
;
|
|
16418
|
+
initValue() {
|
|
16419
|
+
this.renderList();
|
|
16420
|
+
if (this.dataSource instanceof DataManager) {
|
|
16421
|
+
this.initRemoteRender = true;
|
|
16422
|
+
}
|
|
16423
|
+
else {
|
|
16424
|
+
this.updateValues();
|
|
16425
|
+
}
|
|
16426
|
+
}
|
|
16427
|
+
updateValues() {
|
|
16428
|
+
const li = this.list.querySelector('.' + dropDownBaseClasses.focus);
|
|
16429
|
+
if (!isNullOrUndefined(li)) {
|
|
16430
|
+
this.setSelection(li, null);
|
|
16431
|
+
}
|
|
16432
|
+
}
|
|
16433
|
+
renderList() {
|
|
16434
|
+
super.render();
|
|
16435
|
+
this.unWireListEvents();
|
|
16436
|
+
this.wireListEvents();
|
|
16437
|
+
}
|
|
16438
|
+
/**
|
|
16439
|
+
* Event binding for list
|
|
16440
|
+
*
|
|
16441
|
+
* @returns {void}
|
|
16442
|
+
*/
|
|
16443
|
+
wireListEvents() {
|
|
16444
|
+
EventHandler.add(this.list, 'click', this.onMouseClick, this);
|
|
16445
|
+
EventHandler.add(this.list, 'mouseover', this.onMouseOver, this);
|
|
16446
|
+
EventHandler.add(this.list, 'mouseout', this.onMouseLeave, this);
|
|
16447
|
+
}
|
|
16448
|
+
/**
|
|
16449
|
+
* Event un binding for list items.
|
|
16450
|
+
*
|
|
16451
|
+
* @returns {void}
|
|
16452
|
+
*/
|
|
16453
|
+
unWireListEvents() {
|
|
16454
|
+
EventHandler.remove(this.list, 'click', this.onMouseClick);
|
|
16455
|
+
EventHandler.remove(this.list, 'mouseover', this.onMouseOver);
|
|
16456
|
+
EventHandler.remove(this.list, 'mouseout', this.onMouseLeave);
|
|
16457
|
+
}
|
|
16458
|
+
onMouseClick(e) {
|
|
16459
|
+
const target = e.target;
|
|
16460
|
+
const li = closest(target, '.' + dropDownBaseClasses.li);
|
|
16461
|
+
if (!this.isValidLI(li)) {
|
|
16462
|
+
return;
|
|
16463
|
+
}
|
|
16464
|
+
this.setSelection(li, e);
|
|
16465
|
+
const delay = 100;
|
|
16466
|
+
this.closePopup(delay, e);
|
|
16467
|
+
this.inputElement.focus();
|
|
16468
|
+
}
|
|
16469
|
+
updateSelectedItem(li, e, preventSelect, isSelection) {
|
|
16470
|
+
this.removeSelection();
|
|
16471
|
+
li.classList.add(dropDownBaseClasses.selected);
|
|
16472
|
+
this.removeHover();
|
|
16473
|
+
const value = this.getFormattedValue(li.getAttribute('data-value'));
|
|
16474
|
+
const selectedData = this.getDataByValue(value);
|
|
16475
|
+
if (!preventSelect && !isNullOrUndefined(e)) {
|
|
16476
|
+
const items = this.detachChanges(selectedData);
|
|
16477
|
+
this.isSelected = true;
|
|
16478
|
+
const eventArgs = {
|
|
16479
|
+
e: e,
|
|
16480
|
+
item: li,
|
|
16481
|
+
itemData: items,
|
|
16482
|
+
isInteracted: e ? true : false,
|
|
16483
|
+
cancel: false
|
|
16484
|
+
};
|
|
16485
|
+
this.trigger('select', eventArgs, (eventArgs) => {
|
|
16486
|
+
if (eventArgs.cancel) {
|
|
16487
|
+
li.classList.remove(dropDownBaseClasses.selected);
|
|
16488
|
+
}
|
|
16489
|
+
else {
|
|
16490
|
+
this.selectEventCallback(li, selectedData, value);
|
|
16491
|
+
if (isSelection) {
|
|
16492
|
+
this.setSelectOptions(li, e);
|
|
16493
|
+
}
|
|
16494
|
+
}
|
|
16495
|
+
});
|
|
16496
|
+
}
|
|
16497
|
+
else {
|
|
16498
|
+
this.selectEventCallback(li, selectedData, value);
|
|
16499
|
+
if (isSelection) {
|
|
16500
|
+
this.setSelectOptions(li, e);
|
|
16501
|
+
}
|
|
16502
|
+
}
|
|
16503
|
+
}
|
|
16504
|
+
setSelection(li, e) {
|
|
16505
|
+
if (this.isValidLI(li) && (!li.classList.contains(dropDownBaseClasses.selected) || (this.isPopupOpen && this.isSelected
|
|
16506
|
+
&& li.classList.contains(dropDownBaseClasses.selected)))) {
|
|
16507
|
+
this.updateSelectedItem(li, e, false, true);
|
|
16508
|
+
}
|
|
16509
|
+
else {
|
|
16510
|
+
this.setSelectOptions(li, e);
|
|
16511
|
+
}
|
|
16512
|
+
}
|
|
16513
|
+
setSelectOptions(li, e) {
|
|
16514
|
+
if (this.list) {
|
|
16515
|
+
this.removeHover();
|
|
16516
|
+
}
|
|
16517
|
+
this.previousSelectedLI = (!isNullOrUndefined(this.selectedLI)) ? this.selectedLI : null;
|
|
16518
|
+
this.selectedLI = li;
|
|
16519
|
+
if (this.isPopupOpen && !isNullOrUndefined(this.selectedLI)) {
|
|
16520
|
+
this.setScrollPosition(e);
|
|
16521
|
+
}
|
|
16522
|
+
if (e && (e.keyCode === 38 || e.keyCode === 40)) {
|
|
16523
|
+
return;
|
|
16524
|
+
}
|
|
16525
|
+
if (isNullOrUndefined(e) || this.setValue(e)) {
|
|
16526
|
+
return;
|
|
16527
|
+
}
|
|
16528
|
+
}
|
|
16529
|
+
setScrollPosition(e) {
|
|
16530
|
+
if (!isNullOrUndefined(e)) {
|
|
16531
|
+
switch (e.action) {
|
|
16532
|
+
case 'pageDown':
|
|
16533
|
+
case 'down':
|
|
16534
|
+
case 'end':
|
|
16535
|
+
this.scrollBottom();
|
|
16536
|
+
break;
|
|
16537
|
+
default:
|
|
16538
|
+
this.scrollTop();
|
|
16539
|
+
break;
|
|
16540
|
+
}
|
|
16541
|
+
}
|
|
16542
|
+
else {
|
|
16543
|
+
this.scrollBottom(true);
|
|
16544
|
+
}
|
|
16545
|
+
}
|
|
16546
|
+
scrollBottom(isInitial) {
|
|
16547
|
+
if (!isNullOrUndefined(this.selectedLI)) {
|
|
16548
|
+
const currentOffset = this.list.offsetHeight;
|
|
16549
|
+
const nextBottom = this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop;
|
|
16550
|
+
let nextOffset = this.list.scrollTop + nextBottom - currentOffset;
|
|
16551
|
+
nextOffset = isInitial ? nextOffset + parseInt(getComputedStyle(this.list).paddingTop, 10) * 2 : nextOffset;
|
|
16552
|
+
let boxRange = this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop;
|
|
16553
|
+
if (this.activeIndex === 0) {
|
|
16554
|
+
this.list.scrollTop = 0;
|
|
16555
|
+
}
|
|
16556
|
+
else if (nextBottom > currentOffset || !(boxRange > 0 && this.list.offsetHeight > boxRange)) {
|
|
16557
|
+
this.list.scrollTop = nextOffset;
|
|
16558
|
+
}
|
|
16559
|
+
}
|
|
16560
|
+
}
|
|
16561
|
+
scrollTop() {
|
|
16562
|
+
if (!isNullOrUndefined(this.selectedLI)) {
|
|
16563
|
+
let nextOffset = this.selectedLI.offsetTop - this.list.scrollTop;
|
|
16564
|
+
nextOffset = this.fields.groupBy && nextOffset;
|
|
16565
|
+
const boxRange = (this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop);
|
|
16566
|
+
if (this.activeIndex === 0) {
|
|
16567
|
+
this.list.scrollTop = 0;
|
|
16568
|
+
}
|
|
16569
|
+
else if (nextOffset < 0) {
|
|
16570
|
+
this.list.scrollTop = this.list.scrollTop + nextOffset;
|
|
16571
|
+
}
|
|
16572
|
+
else if (!(boxRange > 0 && this.list.offsetHeight > boxRange)) {
|
|
16573
|
+
this.list.scrollTop = this.selectedLI.offsetTop;
|
|
16574
|
+
}
|
|
16575
|
+
}
|
|
16576
|
+
}
|
|
16577
|
+
selectEventCallback(li, selectedData, value, selectLi) {
|
|
16578
|
+
this.previousItemData = (!isNullOrUndefined(this.itemData)) ? this.itemData : null;
|
|
16579
|
+
this.item = li;
|
|
16580
|
+
this.itemData = selectedData;
|
|
16581
|
+
const focusedItem = this.list.querySelector('.' + dropDownBaseClasses.focus);
|
|
16582
|
+
if (focusedItem) {
|
|
16583
|
+
removeClass([focusedItem], dropDownBaseClasses.focus);
|
|
16584
|
+
}
|
|
16585
|
+
if (selectLi) {
|
|
16586
|
+
addClass([li], dropDownBaseClasses.selected);
|
|
16587
|
+
}
|
|
16588
|
+
li.setAttribute('aria-selected', 'true');
|
|
16589
|
+
this.activeIndex = this.getIndexByValue(value);
|
|
16590
|
+
}
|
|
16591
|
+
detachChanges(value) {
|
|
16592
|
+
let items;
|
|
16593
|
+
if (typeof value === 'string' ||
|
|
16594
|
+
typeof value === 'boolean' ||
|
|
16595
|
+
typeof value === 'number') {
|
|
16596
|
+
items = Object.defineProperties({}, {
|
|
16597
|
+
value: {
|
|
16598
|
+
value: value,
|
|
16599
|
+
enumerable: true
|
|
16600
|
+
},
|
|
16601
|
+
text: {
|
|
16602
|
+
value: value,
|
|
16603
|
+
enumerable: true
|
|
16604
|
+
}
|
|
16605
|
+
});
|
|
16606
|
+
}
|
|
16607
|
+
else {
|
|
16608
|
+
items = value;
|
|
16609
|
+
}
|
|
16610
|
+
return items;
|
|
16611
|
+
}
|
|
16612
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
16613
|
+
setValue(e) {
|
|
16614
|
+
const dataItem = this.getItemData();
|
|
16615
|
+
let textSuffix;
|
|
16616
|
+
let value;
|
|
16617
|
+
let endPos;
|
|
16618
|
+
let range;
|
|
16619
|
+
let globalRange;
|
|
16620
|
+
const selection = this.inputElement.ownerDocument.getSelection();
|
|
16621
|
+
const startPos = this.getTriggerCharPosition();
|
|
16622
|
+
textSuffix = typeof this.suffixText === 'string' ? this.suffixText : '';
|
|
16623
|
+
if (dataItem.value !== null) {
|
|
16624
|
+
value = this.mentionVal(dataItem.text);
|
|
16625
|
+
}
|
|
16626
|
+
if (!this.isContentEditable(this.inputElement)) {
|
|
16627
|
+
const myField = this.inputElement;
|
|
16628
|
+
let currentTriggerSnippet = this.getTextRange().substring(startPos + this.mentionChar.length, this.getTextRange().length);
|
|
16629
|
+
value += textSuffix;
|
|
16630
|
+
endPos = startPos + this.mentionChar.length;
|
|
16631
|
+
endPos += currentTriggerSnippet.length;
|
|
16632
|
+
myField.value = myField.value.substring(0, startPos) + value + myField.value.substring(endPos, myField.value.length);
|
|
16633
|
+
myField.selectionStart = startPos + value.length;
|
|
16634
|
+
myField.selectionEnd = startPos + value.length;
|
|
16635
|
+
if (this.isPopupOpen) {
|
|
16636
|
+
this.hidePopup();
|
|
16637
|
+
}
|
|
16638
|
+
this.onChangeEvent(e);
|
|
16639
|
+
return true;
|
|
16640
|
+
}
|
|
16641
|
+
else {
|
|
16642
|
+
endPos = this.getTriggerCharPosition() + this.mentionChar.length;
|
|
16643
|
+
if (this.range && (this.range.startContainer.textContent.trim() !== this.mentionChar)) {
|
|
16644
|
+
endPos = this.range.endOffset;
|
|
16645
|
+
}
|
|
16646
|
+
globalRange = this.range;
|
|
16647
|
+
range = document.createRange();
|
|
16648
|
+
range.setStart(globalRange.startContainer, startPos);
|
|
16649
|
+
range.setEnd(globalRange.startContainer, endPos);
|
|
16650
|
+
range.deleteContents();
|
|
16651
|
+
const element = this.createElement('div');
|
|
16652
|
+
element.innerHTML = value;
|
|
16653
|
+
const frag = document.createDocumentFragment();
|
|
16654
|
+
let node;
|
|
16655
|
+
let lastNode;
|
|
16656
|
+
while (node = element.firstChild) {
|
|
16657
|
+
lastNode = frag.appendChild(node);
|
|
16658
|
+
}
|
|
16659
|
+
range.insertNode(frag);
|
|
16660
|
+
if (lastNode) {
|
|
16661
|
+
range = range.cloneRange();
|
|
16662
|
+
range.setStartAfter(lastNode);
|
|
16663
|
+
range.collapse(true);
|
|
16664
|
+
selection.removeAllRanges();
|
|
16665
|
+
selection.addRange(range);
|
|
16666
|
+
}
|
|
16667
|
+
if (this.isPopupOpen) {
|
|
16668
|
+
this.hidePopup();
|
|
16669
|
+
}
|
|
16670
|
+
this.onChangeEvent(e);
|
|
16671
|
+
return true;
|
|
16672
|
+
}
|
|
16673
|
+
}
|
|
16674
|
+
mentionVal(value) {
|
|
16675
|
+
let showChar = this.showMentionChar ? this.mentionChar : '';
|
|
16676
|
+
if (!isNullOrUndefined(this.displayTemplate)) {
|
|
16677
|
+
value = this.setDisplayTemplate();
|
|
16678
|
+
}
|
|
16679
|
+
if (this.isContentEditable(this.inputElement)) {
|
|
16680
|
+
return '<span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : ' ');
|
|
16681
|
+
}
|
|
16682
|
+
else {
|
|
16683
|
+
return showChar + value;
|
|
16684
|
+
}
|
|
16685
|
+
}
|
|
16686
|
+
setDisplayTemplate() {
|
|
16687
|
+
let compiledString;
|
|
16688
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16689
|
+
if (this.isReact) {
|
|
16690
|
+
this.clearTemplate(['displayTemplate']);
|
|
16691
|
+
if (this.displayTempElement) {
|
|
16692
|
+
detach(this.displayTempElement);
|
|
16693
|
+
this.displayTempElement = null;
|
|
16694
|
+
}
|
|
16695
|
+
}
|
|
16696
|
+
if (!this.displayTempElement) {
|
|
16697
|
+
this.displayTempElement = this.createElement('div');
|
|
16698
|
+
}
|
|
16699
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16700
|
+
if (!this.isReact) {
|
|
16701
|
+
this.displayTempElement.innerHTML = '';
|
|
16702
|
+
}
|
|
16703
|
+
compiledString = compile(this.displayTemplate);
|
|
16704
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16705
|
+
const displayCompTemp = compiledString(this.itemData, this, 'displayTemplate', this.displayTemplateId, this.isStringTemplate, null, this.displayTempElement);
|
|
16706
|
+
if (displayCompTemp && displayCompTemp.length > 0) {
|
|
16707
|
+
for (let i = 0; i < displayCompTemp.length; i++) {
|
|
16708
|
+
this.displayTempElement.appendChild(displayCompTemp[i]);
|
|
16709
|
+
}
|
|
16710
|
+
}
|
|
16711
|
+
this.renderReactTemplates();
|
|
16712
|
+
return this.displayTempElement.innerHTML;
|
|
16713
|
+
}
|
|
16714
|
+
setSpinnerTemplate() {
|
|
16715
|
+
let compiledString;
|
|
16716
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16717
|
+
if (this.isReact) {
|
|
16718
|
+
this.clearTemplate(['spinnerTemplate']);
|
|
16719
|
+
if (this.spinnerTemplateElement) {
|
|
16720
|
+
detach(this.spinnerTemplateElement);
|
|
16721
|
+
this.spinnerTemplateElement = null;
|
|
16722
|
+
}
|
|
16723
|
+
}
|
|
16724
|
+
if (!this.spinnerTemplateElement) {
|
|
16725
|
+
this.spinnerTemplateElement = this.createElement('div');
|
|
16726
|
+
}
|
|
16727
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16728
|
+
if (!this.isReact) {
|
|
16729
|
+
this.spinnerTemplateElement.innerHTML = '';
|
|
16730
|
+
}
|
|
16731
|
+
compiledString = compile(this.spinnerTemplate);
|
|
16732
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16733
|
+
const spinnerCompTemp = compiledString(null, this, 'spinnerTemplate', this.spinnerTemplateId, this.isStringTemplate, null, this.spinnerTemplateElement);
|
|
16734
|
+
if (spinnerCompTemp && spinnerCompTemp.length > 0) {
|
|
16735
|
+
for (let i = 0; i < spinnerCompTemp.length; i++) {
|
|
16736
|
+
this.spinnerTemplateElement.appendChild(spinnerCompTemp[i]);
|
|
16737
|
+
}
|
|
16738
|
+
}
|
|
16739
|
+
this.renderReactTemplates();
|
|
16740
|
+
}
|
|
16741
|
+
onChangeEvent(eve) {
|
|
16742
|
+
this.isSelected = false;
|
|
16743
|
+
const items = this.detachMentionChanges(this.itemData);
|
|
16744
|
+
let preItems;
|
|
16745
|
+
if (typeof this.previousItemData === 'string' ||
|
|
16746
|
+
typeof this.previousItemData === 'boolean' ||
|
|
16747
|
+
typeof this.previousItemData === 'number') {
|
|
16748
|
+
preItems = Object.defineProperties({}, {
|
|
16749
|
+
value: {
|
|
16750
|
+
value: this.previousItemData,
|
|
16751
|
+
enumerable: true
|
|
16752
|
+
},
|
|
16753
|
+
text: {
|
|
16754
|
+
value: this.previousItemData,
|
|
16755
|
+
enumerable: true
|
|
16756
|
+
}
|
|
16757
|
+
});
|
|
16758
|
+
}
|
|
16759
|
+
else {
|
|
16760
|
+
preItems = this.previousItemData;
|
|
16761
|
+
}
|
|
16762
|
+
const eventArgs = {
|
|
16763
|
+
e: eve,
|
|
16764
|
+
item: this.item,
|
|
16765
|
+
itemData: items,
|
|
16766
|
+
previousItem: this.previousSelectedLI,
|
|
16767
|
+
previousItemData: preItems,
|
|
16768
|
+
isInteracted: eve ? true : false,
|
|
16769
|
+
value: this.item.innerHTML,
|
|
16770
|
+
element: this.inputElement
|
|
16771
|
+
};
|
|
16772
|
+
this.trigger('change', eventArgs);
|
|
16773
|
+
}
|
|
16774
|
+
detachMentionChanges(value) {
|
|
16775
|
+
let items;
|
|
16776
|
+
if (typeof value === 'string' ||
|
|
16777
|
+
typeof value === 'boolean' ||
|
|
16778
|
+
typeof value === 'number') {
|
|
16779
|
+
items = Object.defineProperties({}, {
|
|
16780
|
+
value: {
|
|
16781
|
+
value: value,
|
|
16782
|
+
enumerable: true
|
|
16783
|
+
},
|
|
16784
|
+
text: {
|
|
16785
|
+
value: value,
|
|
16786
|
+
enumerable: true
|
|
16787
|
+
}
|
|
16788
|
+
});
|
|
16789
|
+
}
|
|
16790
|
+
else {
|
|
16791
|
+
items = value;
|
|
16792
|
+
}
|
|
16793
|
+
return items;
|
|
16794
|
+
}
|
|
16795
|
+
getItemData() {
|
|
16796
|
+
const fields = this.fields;
|
|
16797
|
+
let dataItem = null;
|
|
16798
|
+
dataItem = this.itemData;
|
|
16799
|
+
let dataValue;
|
|
16800
|
+
let dataText;
|
|
16801
|
+
if (!isNullOrUndefined(dataItem)) {
|
|
16802
|
+
dataValue = getValue(fields.value, dataItem);
|
|
16803
|
+
dataText = getValue(fields.text, dataItem);
|
|
16804
|
+
}
|
|
16805
|
+
const value = (!isNullOrUndefined(dataItem) &&
|
|
16806
|
+
!isUndefined(dataValue) ? dataValue : dataItem);
|
|
16807
|
+
const text = (!isNullOrUndefined(dataItem) &&
|
|
16808
|
+
!isUndefined(dataValue) ? dataText : dataItem);
|
|
16809
|
+
return { value: value, text: text };
|
|
16810
|
+
}
|
|
16811
|
+
removeSelection() {
|
|
16812
|
+
if (this.list) {
|
|
16813
|
+
const selectedItems = this.list.querySelectorAll('.' + dropDownBaseClasses.selected);
|
|
16814
|
+
if (selectedItems.length) {
|
|
16815
|
+
removeClass(selectedItems, dropDownBaseClasses.selected);
|
|
16816
|
+
selectedItems[0].removeAttribute('aria-selected');
|
|
16817
|
+
}
|
|
16818
|
+
}
|
|
16819
|
+
}
|
|
16820
|
+
onMouseOver(e) {
|
|
16821
|
+
const currentLi = closest(e.target, '.' + dropDownBaseClasses.li);
|
|
16822
|
+
this.setHover(currentLi);
|
|
16823
|
+
}
|
|
16824
|
+
setHover(li) {
|
|
16825
|
+
if (this.enabled && this.isValidLI(li) && !li.classList.contains(dropDownBaseClasses.hover)) {
|
|
16826
|
+
this.removeHover();
|
|
16827
|
+
addClass([li], dropDownBaseClasses.hover);
|
|
16828
|
+
}
|
|
16829
|
+
}
|
|
16830
|
+
removeHover() {
|
|
16831
|
+
if (this.list) {
|
|
16832
|
+
const hoveredItem = this.list.querySelectorAll('.' + dropDownBaseClasses.hover);
|
|
16833
|
+
if (hoveredItem && hoveredItem.length) {
|
|
16834
|
+
removeClass(hoveredItem, dropDownBaseClasses.hover);
|
|
16835
|
+
}
|
|
16836
|
+
}
|
|
16837
|
+
}
|
|
16838
|
+
isValidLI(li) {
|
|
16839
|
+
return (li && li.hasAttribute('role') && li.getAttribute('role') === 'option');
|
|
16840
|
+
}
|
|
16841
|
+
onMouseLeave() {
|
|
16842
|
+
this.removeHover();
|
|
16843
|
+
}
|
|
16844
|
+
/**
|
|
16845
|
+
* Search the entered text and show it in the suggestion list if available.
|
|
16846
|
+
*
|
|
16847
|
+
* @returns {void}
|
|
16848
|
+
*/
|
|
16849
|
+
search(text, positionX, positionY) {
|
|
16850
|
+
if ((this.ignoreCase && (text === this.elementValue() || text === this.elementValue().toLowerCase()))
|
|
16851
|
+
|| !this.ignoreCase && text === this.elementValue()) {
|
|
16852
|
+
this.resetList(this.dataSource, this.fields);
|
|
16853
|
+
}
|
|
16854
|
+
else {
|
|
16855
|
+
if (this.isPopupOpen) {
|
|
16856
|
+
this.hidePopup();
|
|
16857
|
+
}
|
|
16858
|
+
return;
|
|
16859
|
+
}
|
|
16860
|
+
if (isNullOrUndefined(this.list)) {
|
|
16861
|
+
this.renderList();
|
|
16862
|
+
this.renderPopup();
|
|
16863
|
+
}
|
|
16864
|
+
else {
|
|
16865
|
+
this.showPopup();
|
|
16866
|
+
}
|
|
16867
|
+
this.popupObj.element.style.left = formatUnit(positionX);
|
|
16868
|
+
this.popupObj.element.style.top = formatUnit(positionY);
|
|
16869
|
+
}
|
|
16870
|
+
/**
|
|
16871
|
+
* Removes the component from the DOM and detaches all its related event handlers. Also it removes the attributes and classes.
|
|
16872
|
+
*
|
|
16873
|
+
* @method destroy
|
|
16874
|
+
* @returns {void}
|
|
16875
|
+
*/
|
|
16876
|
+
destroy() {
|
|
16877
|
+
this.hidePopup();
|
|
16878
|
+
this.unWireEvent();
|
|
16879
|
+
if (this.list) {
|
|
16880
|
+
this.unWireListEvents();
|
|
16881
|
+
}
|
|
16882
|
+
if (this.inputElement && !this.inputElement.classList.contains('e-' + this.getModuleName())) {
|
|
16883
|
+
return;
|
|
16884
|
+
}
|
|
16885
|
+
super.destroy();
|
|
16886
|
+
}
|
|
16887
|
+
getLocaleName() {
|
|
16888
|
+
return 'mention';
|
|
16889
|
+
}
|
|
16890
|
+
getNgDirective() {
|
|
16891
|
+
return 'EJS-MENTION';
|
|
16892
|
+
}
|
|
16893
|
+
/**
|
|
16894
|
+
* Return the module name of this component.
|
|
16895
|
+
*
|
|
16896
|
+
* @private
|
|
16897
|
+
* @returns {string} Return the module name of this component.
|
|
16898
|
+
*/
|
|
16899
|
+
getModuleName() {
|
|
16900
|
+
return 'mention';
|
|
16901
|
+
}
|
|
16902
|
+
};
|
|
16903
|
+
__decorate$7([
|
|
16904
|
+
Property(null)
|
|
16905
|
+
], Mention.prototype, "cssClass", void 0);
|
|
16906
|
+
__decorate$7([
|
|
16907
|
+
Property('@')
|
|
16908
|
+
], Mention.prototype, "mentionChar", void 0);
|
|
16909
|
+
__decorate$7([
|
|
16910
|
+
Property(false)
|
|
16911
|
+
], Mention.prototype, "showMentionChar", void 0);
|
|
16912
|
+
__decorate$7([
|
|
16913
|
+
Property(false)
|
|
16914
|
+
], Mention.prototype, "allowSpaces", void 0);
|
|
16915
|
+
__decorate$7([
|
|
16916
|
+
Property(null)
|
|
16917
|
+
], Mention.prototype, "suffixText", void 0);
|
|
16918
|
+
__decorate$7([
|
|
16919
|
+
Property(25)
|
|
16920
|
+
], Mention.prototype, "suggestionCount", void 0);
|
|
16921
|
+
__decorate$7([
|
|
16922
|
+
Property(0)
|
|
16923
|
+
], Mention.prototype, "minLength", void 0);
|
|
16924
|
+
__decorate$7([
|
|
16925
|
+
Property('None')
|
|
16926
|
+
], Mention.prototype, "sortOrder", void 0);
|
|
16927
|
+
__decorate$7([
|
|
16928
|
+
Property(true)
|
|
16929
|
+
], Mention.prototype, "ignoreCase", void 0);
|
|
16930
|
+
__decorate$7([
|
|
16931
|
+
Property(false)
|
|
16932
|
+
], Mention.prototype, "highlight", void 0);
|
|
16933
|
+
__decorate$7([
|
|
16934
|
+
Property()
|
|
16935
|
+
], Mention.prototype, "locale", void 0);
|
|
16936
|
+
__decorate$7([
|
|
16937
|
+
Property('auto')
|
|
16938
|
+
], Mention.prototype, "popupWidth", void 0);
|
|
16939
|
+
__decorate$7([
|
|
16940
|
+
Property('300px')
|
|
16941
|
+
], Mention.prototype, "popupHeight", void 0);
|
|
16942
|
+
__decorate$7([
|
|
16943
|
+
Property(null)
|
|
16944
|
+
], Mention.prototype, "displayTemplate", void 0);
|
|
16945
|
+
__decorate$7([
|
|
16946
|
+
Property(null)
|
|
16947
|
+
], Mention.prototype, "itemTemplate", void 0);
|
|
16948
|
+
__decorate$7([
|
|
16949
|
+
Property('No records found')
|
|
16950
|
+
], Mention.prototype, "noRecordsTemplate", void 0);
|
|
16951
|
+
__decorate$7([
|
|
16952
|
+
Property(null)
|
|
16953
|
+
], Mention.prototype, "spinnerTemplate", void 0);
|
|
16954
|
+
__decorate$7([
|
|
16955
|
+
Property()
|
|
16956
|
+
], Mention.prototype, "target", void 0);
|
|
16957
|
+
__decorate$7([
|
|
16958
|
+
Property([])
|
|
16959
|
+
], Mention.prototype, "dataSource", void 0);
|
|
16960
|
+
__decorate$7([
|
|
16961
|
+
Property(null)
|
|
16962
|
+
], Mention.prototype, "query", void 0);
|
|
16963
|
+
__decorate$7([
|
|
16964
|
+
Property('Contains')
|
|
16965
|
+
], Mention.prototype, "filterType", void 0);
|
|
16966
|
+
__decorate$7([
|
|
16967
|
+
Complex({ text: null, value: null, iconCss: null, groupBy: null }, FieldSettings)
|
|
16968
|
+
], Mention.prototype, "fields", void 0);
|
|
16969
|
+
__decorate$7([
|
|
16970
|
+
Event()
|
|
16971
|
+
], Mention.prototype, "actionBegin", void 0);
|
|
16972
|
+
__decorate$7([
|
|
16973
|
+
Event()
|
|
16974
|
+
], Mention.prototype, "actionComplete", void 0);
|
|
16975
|
+
__decorate$7([
|
|
16976
|
+
Event()
|
|
16977
|
+
], Mention.prototype, "actionFailure", void 0);
|
|
16978
|
+
__decorate$7([
|
|
16979
|
+
Event()
|
|
16980
|
+
], Mention.prototype, "change", void 0);
|
|
16981
|
+
__decorate$7([
|
|
16982
|
+
Event()
|
|
16983
|
+
], Mention.prototype, "beforeOpen", void 0);
|
|
16984
|
+
__decorate$7([
|
|
16985
|
+
Event()
|
|
16986
|
+
], Mention.prototype, "opened", void 0);
|
|
16987
|
+
__decorate$7([
|
|
16988
|
+
Event()
|
|
16989
|
+
], Mention.prototype, "closed", void 0);
|
|
16990
|
+
__decorate$7([
|
|
16991
|
+
Event()
|
|
16992
|
+
], Mention.prototype, "select", void 0);
|
|
16993
|
+
__decorate$7([
|
|
16994
|
+
Event()
|
|
16995
|
+
], Mention.prototype, "filtering", void 0);
|
|
16996
|
+
__decorate$7([
|
|
16997
|
+
Event()
|
|
16998
|
+
], Mention.prototype, "created", void 0);
|
|
16999
|
+
__decorate$7([
|
|
17000
|
+
Event()
|
|
17001
|
+
], Mention.prototype, "destroyed", void 0);
|
|
17002
|
+
Mention = __decorate$7([
|
|
17003
|
+
NotifyPropertyChanges
|
|
17004
|
+
], Mention);
|
|
17005
|
+
|
|
15633
17006
|
/**
|
|
15634
17007
|
* export all modules from current location
|
|
15635
17008
|
*/
|
|
@@ -15638,5 +17011,5 @@ const listBoxClasses = {
|
|
|
15638
17011
|
* export all modules from current location
|
|
15639
17012
|
*/
|
|
15640
17013
|
|
|
15641
|
-
export { incrementalSearch, Search, escapeCharRegExp, resetIncrementalSearchValues, highlightSearch, revertHighlightSearch, FieldSettings, dropDownBaseClasses, DropDownBase, dropDownListClasses, DropDownList, Fields, TreeSettings, DropDownTree, ComboBox, AutoComplete, MultiSelect, CheckBoxSelection, createFloatLabel, updateFloatLabelState, removeFloating, setPlaceHolder, floatLabelFocus, floatLabelBlur, encodePlaceholder, SelectionSettings, ToolbarSettings, ListBox };
|
|
17014
|
+
export { incrementalSearch, Search, escapeCharRegExp, resetIncrementalSearchValues, highlightSearch, revertHighlightSearch, FieldSettings, dropDownBaseClasses, DropDownBase, dropDownListClasses, DropDownList, Fields, TreeSettings, DropDownTree, ComboBox, AutoComplete, MultiSelect, CheckBoxSelection, createFloatLabel, updateFloatLabelState, removeFloating, setPlaceHolder, floatLabelFocus, floatLabelBlur, encodePlaceholder, SelectionSettings, ToolbarSettings, ListBox, Mention };
|
|
15642
17015
|
//# sourceMappingURL=ej2-dropdowns.es2015.js.map
|