@syncfusion/ej2-dropdowns 20.2.39 → 20.2.43-3197
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +16 -1
- package/CHANGELOG.md +123 -2
- package/{README.md → ReadMe.md} +1 -1
- package/dist/ej2-dropdowns.min.js +1 -0
- package/dist/ej2-dropdowns.umd.min.js +1 -10
- package/dist/ej2-dropdowns.umd.min.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es2015.js +2243 -445
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +2285 -458
- package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
- package/dist/global/ej2-dropdowns.min.js +1 -10
- package/dist/global/ej2-dropdowns.min.js.map +1 -1
- package/dist/global/index.d.ts +0 -9
- package/mention.d.ts +4 -0
- package/mention.js +4 -0
- package/package.json +76 -76
- package/src/auto-complete/auto-complete-model.d.ts +12 -11
- package/src/auto-complete/auto-complete.d.ts +20 -18
- package/src/auto-complete/auto-complete.js +67 -37
- package/src/combo-box/combo-box-model.d.ts +17 -17
- package/src/combo-box/combo-box.d.ts +33 -33
- package/src/combo-box/combo-box.js +33 -29
- package/src/common/incremental-search.d.ts +3 -4
- package/src/common/incremental-search.js +22 -7
- package/src/drop-down-base/drop-down-base-model.d.ts +13 -31
- package/src/drop-down-base/drop-down-base.d.ts +22 -41
- package/src/drop-down-base/drop-down-base.js +75 -59
- package/src/drop-down-list/drop-down-list-model.d.ts +19 -1
- package/src/drop-down-list/drop-down-list.d.ts +35 -11
- package/src/drop-down-list/drop-down-list.js +195 -89
- package/src/drop-down-tree/drop-down-tree-model.d.ts +16 -2
- package/src/drop-down-tree/drop-down-tree.d.ts +15 -1
- package/src/drop-down-tree/drop-down-tree.js +51 -15
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
- package/src/list-box/list-box-model.d.ts +18 -0
- package/src/list-box/list-box.d.ts +22 -0
- package/src/list-box/list-box.js +86 -31
- 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 +457 -0
- package/src/mention/mention.js +1465 -0
- package/src/multi-select/checkbox-selection.js +11 -12
- package/src/multi-select/float-label.js +4 -2
- package/src/multi-select/multi-select-model.d.ts +1 -1
- package/src/multi-select/multi-select.d.ts +9 -5
- package/src/multi-select/multi-select.js +296 -189
- 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 +121 -44
- package/styles/bootstrap-dark.scss +1 -0
- package/styles/bootstrap.css +121 -44
- package/styles/bootstrap.scss +1 -0
- package/styles/bootstrap4.css +134 -55
- package/styles/bootstrap4.scss +1 -0
- package/styles/bootstrap5-dark.css +135 -50
- package/styles/bootstrap5-dark.scss +1 -0
- package/styles/bootstrap5.css +135 -50
- 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 +9 -2
- package/styles/drop-down-base/_bootstrap-definition.scss +7 -1
- package/styles/drop-down-base/_bootstrap4-definition.scss +7 -1
- package/styles/drop-down-base/_bootstrap5-definition.scss +9 -3
- package/styles/drop-down-base/_fabric-dark-definition.scss +7 -1
- package/styles/drop-down-base/_fabric-definition.scss +7 -1
- package/styles/drop-down-base/_fluent-definition.scss +9 -2
- package/styles/drop-down-base/_fusionnew-definition.scss +9 -3
- package/styles/drop-down-base/_highcontrast-definition.scss +17 -6
- package/styles/drop-down-base/_highcontrast-light-definition.scss +19 -7
- package/styles/drop-down-base/_layout.scss +44 -3
- package/styles/drop-down-base/_material-dark-definition.scss +8 -1
- package/styles/drop-down-base/_material-definition.scss +7 -0
- package/styles/drop-down-base/_material3-definition.scss +9 -3
- package/styles/drop-down-base/_tailwind-definition.scss +9 -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 +11 -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 +8 -0
- package/styles/drop-down-list/bootstrap.css +8 -0
- package/styles/drop-down-list/bootstrap4.css +8 -0
- package/styles/drop-down-list/bootstrap5-dark.css +9 -0
- package/styles/drop-down-list/bootstrap5.css +9 -0
- package/styles/drop-down-list/fabric-dark.css +8 -0
- package/styles/drop-down-list/fabric.css +8 -0
- package/styles/drop-down-list/fluent-dark.css +9 -0
- package/styles/drop-down-list/fluent.css +9 -0
- package/styles/drop-down-list/highcontrast-light.css +8 -0
- package/styles/drop-down-list/highcontrast.css +8 -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 +8 -0
- package/styles/drop-down-list/material.css +8 -0
- package/styles/drop-down-list/tailwind-dark.css +9 -0
- package/styles/drop-down-list/tailwind.css +9 -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 +10 -3
- 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 +9 -1
- package/styles/drop-down-tree/bootstrap5.css +9 -1
- 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 +129 -52
- package/styles/fabric-dark.scss +1 -0
- package/styles/fabric.css +129 -52
- package/styles/fabric.scss +1 -0
- package/styles/fluent-dark.css +129 -47
- package/styles/fluent-dark.scss +1 -0
- package/styles/fluent.css +129 -47
- package/styles/fluent.scss +1 -0
- package/styles/highcontrast-light.css +124 -44
- package/styles/highcontrast-light.scss +1 -0
- package/styles/highcontrast.css +133 -53
- 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 +120 -43
- package/styles/material-dark.scss +1 -0
- package/styles/material.css +120 -43
- 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 +11 -1
- package/styles/multi-select/_bootstrap-definition.scss +9 -0
- package/styles/multi-select/_bootstrap4-definition.scss +20 -9
- package/styles/multi-select/_bootstrap5-definition.scss +11 -3
- package/styles/multi-select/_fabric-dark-definition.scss +16 -7
- package/styles/multi-select/_fabric-definition.scss +15 -6
- package/styles/multi-select/_fluent-definition.scss +11 -2
- package/styles/multi-select/_fusionnew-definition.scss +10 -2
- package/styles/multi-select/_highcontrast-definition.scss +59 -29
- package/styles/multi-select/_highcontrast-light-definition.scss +55 -25
- package/styles/multi-select/_layout.scss +91 -78
- package/styles/multi-select/_material-dark-definition.scss +10 -1
- package/styles/multi-select/_material-definition.scss +8 -0
- package/styles/multi-select/_material3-definition.scss +9 -2
- package/styles/multi-select/_tailwind-definition.scss +11 -4
- package/styles/multi-select/_theme.scss +20 -21
- package/styles/multi-select/bootstrap-dark.css +34 -8
- package/styles/multi-select/bootstrap.css +34 -8
- package/styles/multi-select/bootstrap4.css +46 -19
- package/styles/multi-select/bootstrap5-dark.css +38 -11
- package/styles/multi-select/bootstrap5.css +38 -11
- package/styles/multi-select/fabric-dark.css +42 -16
- package/styles/multi-select/fabric.css +42 -16
- package/styles/multi-select/fluent-dark.css +36 -9
- package/styles/multi-select/fluent.css +36 -9
- package/styles/multi-select/highcontrast-light.css +37 -8
- package/styles/multi-select/highcontrast.css +46 -17
- 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 +33 -7
- package/styles/multi-select/material.css +33 -7
- package/styles/multi-select/tailwind-dark.css +38 -9
- package/styles/multi-select/tailwind.css +38 -9
- package/styles/tailwind-dark.css +132 -47
- package/styles/tailwind-dark.scss +1 -0
- package/styles/tailwind.css +132 -47
- package/styles/tailwind.scss +1 -0
|
@@ -6,9 +6,6 @@ import { Input, TextBox } from '@syncfusion/ej2-inputs';
|
|
|
6
6
|
import { Button, createCheckBox } from '@syncfusion/ej2-buttons';
|
|
7
7
|
import { TreeView } from '@syncfusion/ej2-navigations';
|
|
8
8
|
|
|
9
|
-
/**
|
|
10
|
-
* IncrementalSearch module file
|
|
11
|
-
*/
|
|
12
9
|
var queryString = '';
|
|
13
10
|
var prevString = '';
|
|
14
11
|
var matches$1 = [];
|
|
@@ -81,7 +78,7 @@ function incrementalSearch(keyCode, items, selectedIndex, ignoreCase, elementId)
|
|
|
81
78
|
* @param {boolean} ignoreCase - Specifies the case sensitive option for search operation.
|
|
82
79
|
* @returns {Element | number} Returns the search matched items.
|
|
83
80
|
*/
|
|
84
|
-
function Search(inputVal, items, searchType, ignoreCase) {
|
|
81
|
+
function Search(inputVal, items, searchType, ignoreCase, dataSource, fields, type) {
|
|
85
82
|
var listItems = items;
|
|
86
83
|
ignoreCase = ignoreCase !== undefined && ignoreCase !== null ? ignoreCase : true;
|
|
87
84
|
var itemData = { item: null, index: null };
|
|
@@ -89,14 +86,32 @@ function Search(inputVal, items, searchType, ignoreCase) {
|
|
|
89
86
|
var strLength = inputVal.length;
|
|
90
87
|
var queryStr = ignoreCase ? inputVal.toLocaleLowerCase() : inputVal;
|
|
91
88
|
queryStr = escapeCharRegExp(queryStr);
|
|
92
|
-
|
|
89
|
+
var _loop_1 = function (i, itemsData) {
|
|
93
90
|
var item = itemsData[i];
|
|
94
|
-
var text =
|
|
91
|
+
var text = void 0;
|
|
92
|
+
var filterValue;
|
|
93
|
+
if (items && dataSource) {
|
|
94
|
+
var checkField_1 = item;
|
|
95
|
+
var fieldValue_1 = fields.text.split('.');
|
|
96
|
+
dataSource.filter(function (data) {
|
|
97
|
+
Array.prototype.slice.call(fieldValue_1).forEach(function (value) {
|
|
98
|
+
if (type === 'object' && checkField_1.textContent.toString().indexOf(data[value]) !== -1 && checkField_1.getAttribute('data-value') === data[fields.value] || type === 'string' && checkField_1.textContent.toString().indexOf(data) !== -1) {
|
|
99
|
+
filterValue = type === 'object' ? data[value] : data;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
text = dataSource && filterValue ? (ignoreCase ? filterValue.toLocaleLowerCase() : filterValue).replace(/^\s+|\s+$/g, '') : (ignoreCase ? item.textContent.toLocaleLowerCase() : item.textContent).replace(/^\s+|\s+$/g, '');
|
|
95
105
|
if ((searchType === 'Equal' && text === queryStr) || (searchType === 'StartsWith' && text.substr(0, strLength) === queryStr) || (searchType === 'EndsWith' && text.substr(text.length - queryStr.length) === queryStr) || (searchType === 'Contains' && new RegExp(queryStr, "g").test(text))) {
|
|
96
106
|
itemData.item = item;
|
|
97
107
|
itemData.index = i;
|
|
98
|
-
return { item: item, index: i };
|
|
108
|
+
return { value: { item: item, index: i } };
|
|
99
109
|
}
|
|
110
|
+
};
|
|
111
|
+
for (var i = 0, itemsData = listItems; i < itemsData.length; i++) {
|
|
112
|
+
var state_1 = _loop_1(i, itemsData);
|
|
113
|
+
if (typeof state_1 === "object")
|
|
114
|
+
return state_1.value;
|
|
100
115
|
}
|
|
101
116
|
return itemData;
|
|
102
117
|
}
|
|
@@ -232,6 +247,8 @@ var dropDownBaseClasses = {
|
|
|
232
247
|
grouping: 'e-dd-group'
|
|
233
248
|
};
|
|
234
249
|
var ITEMTEMPLATE_PROPERTY = 'ItemTemplate';
|
|
250
|
+
var DISPLAYTEMPLATE_PROPERTY = 'DisplayTemplate';
|
|
251
|
+
var SPINNERTEMPLATE_PROPERTY = 'SpinnerTemplate';
|
|
235
252
|
var VALUETEMPLATE_PROPERTY = 'ValueTemplate';
|
|
236
253
|
var GROUPTEMPLATE_PROPERTY = 'GroupTemplate';
|
|
237
254
|
var HEADERTEMPLATE_PROPERTY = 'HeaderTemplate';
|
|
@@ -257,6 +274,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
257
274
|
_this.isAngular = false;
|
|
258
275
|
_this.isPreventChange = false;
|
|
259
276
|
_this.isDynamicDataChange = false;
|
|
277
|
+
_this.addedNewItem = false;
|
|
260
278
|
return _this;
|
|
261
279
|
}
|
|
262
280
|
DropDownBase.prototype.getPropObject = function (prop, newProp, oldProp) {
|
|
@@ -428,7 +446,8 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
428
446
|
this.l10n = componentLocale;
|
|
429
447
|
}
|
|
430
448
|
else {
|
|
431
|
-
this.l10n = new L10n(this.getModuleName() === 'listbox' ? 'listbox' :
|
|
449
|
+
this.l10n = new L10n(this.getModuleName() === 'listbox' ? 'listbox' :
|
|
450
|
+
this.getModuleName() === 'mention' ? 'mention' : 'dropdowns', l10nLocale, this.locale);
|
|
432
451
|
}
|
|
433
452
|
var content = actionFailure ?
|
|
434
453
|
this.l10n.getConstant('actionFailureTemplate') : this.l10n.getConstant('noRecordsTemplate');
|
|
@@ -437,9 +456,12 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
437
456
|
liElem.textContent = content;
|
|
438
457
|
ele.appendChild(liElem);
|
|
439
458
|
liElem.classList.add('e-list-nrt');
|
|
459
|
+
liElem.setAttribute('role', 'option');
|
|
440
460
|
}
|
|
441
461
|
else {
|
|
442
|
-
ele
|
|
462
|
+
if (!isNullOrUndefined(ele)) {
|
|
463
|
+
ele.innerHTML = content;
|
|
464
|
+
}
|
|
443
465
|
}
|
|
444
466
|
}
|
|
445
467
|
};
|
|
@@ -470,14 +492,16 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
470
492
|
* @returns {void}
|
|
471
493
|
*/
|
|
472
494
|
DropDownBase.prototype.setEnableRtl = function () {
|
|
473
|
-
if (this.
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
495
|
+
if (!isNullOrUndefined(this.enableRtlElements)) {
|
|
496
|
+
if (this.list) {
|
|
497
|
+
this.enableRtlElements.push(this.list);
|
|
498
|
+
}
|
|
499
|
+
if (this.enableRtl) {
|
|
500
|
+
addClass(this.enableRtlElements, dropDownBaseClasses.rtl);
|
|
501
|
+
}
|
|
502
|
+
else {
|
|
503
|
+
removeClass(this.enableRtlElements, dropDownBaseClasses.rtl);
|
|
504
|
+
}
|
|
481
505
|
}
|
|
482
506
|
};
|
|
483
507
|
/**
|
|
@@ -485,7 +509,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
485
509
|
*
|
|
486
510
|
* @returns {void}
|
|
487
511
|
*/
|
|
488
|
-
DropDownBase.prototype.initialize = function () {
|
|
512
|
+
DropDownBase.prototype.initialize = function (e) {
|
|
489
513
|
this.bindEvent = true;
|
|
490
514
|
this.actionFailureTemplateId = "" + this.element.id + ACTIONFAILURETEMPLATE_PROPERTY;
|
|
491
515
|
if (this.element.tagName === 'UL') {
|
|
@@ -504,7 +528,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
504
528
|
}
|
|
505
529
|
}
|
|
506
530
|
else {
|
|
507
|
-
this.setListData(this.dataSource, this.fields, this.query);
|
|
531
|
+
this.setListData(this.dataSource, this.fields, this.query, e);
|
|
508
532
|
}
|
|
509
533
|
};
|
|
510
534
|
/**
|
|
@@ -515,14 +539,6 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
515
539
|
DropDownBase.prototype.getPersistData = function () {
|
|
516
540
|
return this.addOnPersist([]);
|
|
517
541
|
};
|
|
518
|
-
/**
|
|
519
|
-
* Sets the enabled state to DropDownBase.
|
|
520
|
-
*
|
|
521
|
-
* @returns {void}
|
|
522
|
-
*/
|
|
523
|
-
DropDownBase.prototype.setEnabled = function () {
|
|
524
|
-
this.element.setAttribute('aria-disabled', (this.enabled) ? 'false' : 'true');
|
|
525
|
-
};
|
|
526
542
|
/**
|
|
527
543
|
* Sets the enabled state to DropDownBase.
|
|
528
544
|
*
|
|
@@ -530,7 +546,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
530
546
|
* @returns {void}
|
|
531
547
|
*/
|
|
532
548
|
DropDownBase.prototype.updateDataAttribute = function (value) {
|
|
533
|
-
var invalidAttr = ['class', 'style', 'id', 'type'];
|
|
549
|
+
var invalidAttr = ['class', 'style', 'id', 'type', 'aria-expanded', 'aria-autocomplete', 'aria-readonly'];
|
|
534
550
|
var attr = {};
|
|
535
551
|
for (var a = 0; a < this.element.attributes.length; a++) {
|
|
536
552
|
if (invalidAttr.indexOf(this.element.attributes[a].name) === -1 &&
|
|
@@ -598,6 +614,8 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
598
614
|
this.isRequested = false;
|
|
599
615
|
this.isDataFetched = false;
|
|
600
616
|
this.itemTemplateId = "" + this.element.id + ITEMTEMPLATE_PROPERTY;
|
|
617
|
+
this.displayTemplateId = "" + this.element.id + DISPLAYTEMPLATE_PROPERTY;
|
|
618
|
+
this.spinnerTemplateId = "" + this.element.id + SPINNERTEMPLATE_PROPERTY;
|
|
601
619
|
this.valueTemplateId = "" + this.element.id + VALUETEMPLATE_PROPERTY;
|
|
602
620
|
this.groupTemplateId = "" + this.element.id + GROUPTEMPLATE_PROPERTY;
|
|
603
621
|
this.headerTemplateId = "" + this.element.id + HEADERTEMPLATE_PROPERTY;
|
|
@@ -612,7 +630,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
612
630
|
* @param {Query} query - Accepts the external Query that execute along with data processing.
|
|
613
631
|
* @returns {void}
|
|
614
632
|
*/
|
|
615
|
-
DropDownBase.prototype.setListData = function (dataSource, fields, query) {
|
|
633
|
+
DropDownBase.prototype.setListData = function (dataSource, fields, query, event) {
|
|
616
634
|
var _this = this;
|
|
617
635
|
fields = fields ? fields : this.fields;
|
|
618
636
|
var ulElement;
|
|
@@ -637,10 +655,10 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
637
655
|
_this.isDataFetched = true;
|
|
638
656
|
}
|
|
639
657
|
ulElement = _this.renderItems(listItems, fields);
|
|
658
|
+
_this.onActionComplete(ulElement, listItems, e);
|
|
640
659
|
if (_this.groupTemplate) {
|
|
641
660
|
_this.renderGroupTemplate(ulElement);
|
|
642
661
|
}
|
|
643
|
-
_this.onActionComplete(ulElement, listItems, e);
|
|
644
662
|
_this.isRequested = false;
|
|
645
663
|
_this.bindChildItems(listItems, ulElement, fields, e);
|
|
646
664
|
}
|
|
@@ -659,7 +677,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
659
677
|
_this.trigger('actionComplete', localDataArgs, function (localDataArgs) {
|
|
660
678
|
if (!localDataArgs.cancel) {
|
|
661
679
|
ulElement = _this.renderItems(localDataArgs.result, fields);
|
|
662
|
-
_this.onActionComplete(ulElement, localDataArgs.result);
|
|
680
|
+
_this.onActionComplete(ulElement, localDataArgs.result, event);
|
|
663
681
|
if (_this.groupTemplate) {
|
|
664
682
|
_this.renderGroupTemplate(ulElement);
|
|
665
683
|
}
|
|
@@ -742,7 +760,9 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
742
760
|
this.liCollections = [];
|
|
743
761
|
this.trigger('actionFailure', e);
|
|
744
762
|
this.l10nUpdate(true);
|
|
745
|
-
|
|
763
|
+
if (!isNullOrUndefined(this.list)) {
|
|
764
|
+
addClass([this.list], dropDownBaseClasses.noData);
|
|
765
|
+
}
|
|
746
766
|
};
|
|
747
767
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
748
768
|
DropDownBase.prototype.onActionComplete = function (ulElement, list, e) {
|
|
@@ -869,18 +889,22 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
869
889
|
return extend({}, options, fields, true);
|
|
870
890
|
};
|
|
871
891
|
DropDownBase.prototype.setFloatingHeader = function (e) {
|
|
872
|
-
if (isNullOrUndefined(this.
|
|
873
|
-
this.fixedHeaderElement
|
|
874
|
-
|
|
875
|
-
this.
|
|
892
|
+
if (!isNullOrUndefined(this.list) && !this.list.classList.contains(dropDownBaseClasses.noData)) {
|
|
893
|
+
if (isNullOrUndefined(this.fixedHeaderElement)) {
|
|
894
|
+
this.fixedHeaderElement = this.createElement('div', { className: dropDownBaseClasses.fixedHead });
|
|
895
|
+
if (!isNullOrUndefined(this.list) && !this.list.querySelector('li').classList.contains(dropDownBaseClasses.group)) {
|
|
896
|
+
this.fixedHeaderElement.style.display = 'none';
|
|
897
|
+
}
|
|
898
|
+
if (!isNullOrUndefined(this.fixedHeaderElement) && !isNullOrUndefined(this.list)) {
|
|
899
|
+
prepend([this.fixedHeaderElement], this.list);
|
|
900
|
+
}
|
|
901
|
+
this.setFixedHeader();
|
|
876
902
|
}
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
this.setFixedHeader();
|
|
903
|
+
if (!isNullOrUndefined(this.fixedHeaderElement) && this.fixedHeaderElement.style.zIndex === '0') {
|
|
904
|
+
this.setFixedHeader();
|
|
905
|
+
}
|
|
906
|
+
this.scrollStop(e);
|
|
882
907
|
}
|
|
883
|
-
this.scrollStop(e);
|
|
884
908
|
};
|
|
885
909
|
DropDownBase.prototype.scrollStop = function (e) {
|
|
886
910
|
var target = !isNullOrUndefined(e) ? e.target : this.list;
|
|
@@ -964,7 +988,9 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
964
988
|
return item;
|
|
965
989
|
};
|
|
966
990
|
DropDownBase.prototype.setFixedHeader = function () {
|
|
967
|
-
this.list
|
|
991
|
+
if (!isNullOrUndefined(this.list)) {
|
|
992
|
+
this.list.parentElement.style.display = 'block';
|
|
993
|
+
}
|
|
968
994
|
var borderWidth = 0;
|
|
969
995
|
if (this.list && this.list.parentElement) {
|
|
970
996
|
borderWidth = parseInt(document.defaultView.getComputedStyle(this.list.parentElement, null).getPropertyValue('border-width'), 10);
|
|
@@ -979,8 +1005,10 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
979
1005
|
borderWidth = (borderTopWidth + borderBottomWidth + borderLeftWidth + borderRightWidth);
|
|
980
1006
|
}
|
|
981
1007
|
}
|
|
982
|
-
|
|
983
|
-
|
|
1008
|
+
if (!isNullOrUndefined(this.liCollections)) {
|
|
1009
|
+
var liWidth = this.getValidLi().offsetWidth - borderWidth;
|
|
1010
|
+
this.fixedHeaderElement.style.width = liWidth.toString() + 'px';
|
|
1011
|
+
}
|
|
984
1012
|
setStyleAttribute(this.fixedHeaderElement, { zIndex: 10 });
|
|
985
1013
|
var firstLi = this.ulElement.querySelector('.' + dropDownBaseClasses.group + ':not(.e-hide-listitem)');
|
|
986
1014
|
this.fixedHeaderElement.innerHTML = firstLi.innerHTML;
|
|
@@ -1049,7 +1077,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1049
1077
|
* @param {Query} query - Accepts the external Query that execute along with data processing.
|
|
1050
1078
|
* @returns {void}
|
|
1051
1079
|
*/
|
|
1052
|
-
DropDownBase.prototype.resetList = function (dataSource, fields, query) {
|
|
1080
|
+
DropDownBase.prototype.resetList = function (dataSource, fields, query, e) {
|
|
1053
1081
|
if (this.list) {
|
|
1054
1082
|
if ((this.element.tagName === 'SELECT' && this.element.options.length > 0)
|
|
1055
1083
|
|| (this.element.tagName === 'UL' && this.element.childNodes.length > 0)) {
|
|
@@ -1059,8 +1087,9 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1059
1087
|
dataSource = this.selectData;
|
|
1060
1088
|
}
|
|
1061
1089
|
}
|
|
1062
|
-
dataSource = this.getModuleName() === 'combobox' && this.selectData && dataSource instanceof Array && dataSource.length < this.selectData.length ? this.selectData : dataSource;
|
|
1063
|
-
this.
|
|
1090
|
+
dataSource = this.getModuleName() === 'combobox' && this.selectData && dataSource instanceof Array && dataSource.length < this.selectData.length && this.addedNewItem ? this.selectData : dataSource;
|
|
1091
|
+
this.addedNewItem = false;
|
|
1092
|
+
this.setListData(dataSource, fields, query, e);
|
|
1064
1093
|
}
|
|
1065
1094
|
};
|
|
1066
1095
|
DropDownBase.prototype.updateSelectElementData = function (isFiltering) {
|
|
@@ -1123,9 +1152,6 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1123
1152
|
case 'enableRtl':
|
|
1124
1153
|
this.setEnableRtl();
|
|
1125
1154
|
break;
|
|
1126
|
-
case 'enabled':
|
|
1127
|
-
this.setEnabled();
|
|
1128
|
-
break;
|
|
1129
1155
|
case 'groupTemplate':
|
|
1130
1156
|
this.renderGroupTemplate(this.list);
|
|
1131
1157
|
if (this.ulElement && this.fixedHeaderElement) {
|
|
@@ -1152,7 +1178,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1152
1178
|
* @private
|
|
1153
1179
|
* @returns {void}
|
|
1154
1180
|
*/
|
|
1155
|
-
DropDownBase.prototype.render = function (isEmptyData) {
|
|
1181
|
+
DropDownBase.prototype.render = function (e, isEmptyData) {
|
|
1156
1182
|
this.list = this.createElement('div', { className: dropDownBaseClasses.content, attrs: { 'tabindex': '0' } });
|
|
1157
1183
|
this.list.classList.add(dropDownBaseClasses.root);
|
|
1158
1184
|
this.setFields();
|
|
@@ -1174,9 +1200,8 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1174
1200
|
wrapperElement.appendChild(this.list);
|
|
1175
1201
|
}
|
|
1176
1202
|
this.setEnableRtl();
|
|
1177
|
-
this.setEnabled();
|
|
1178
1203
|
if (!isEmptyData) {
|
|
1179
|
-
this.initialize();
|
|
1204
|
+
this.initialize(e);
|
|
1180
1205
|
}
|
|
1181
1206
|
};
|
|
1182
1207
|
/**
|
|
@@ -1202,7 +1227,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1202
1227
|
* Adds a new item to the popup list. By default, new item appends to the list as the last item,
|
|
1203
1228
|
* but you can insert based on the index parameter.
|
|
1204
1229
|
*
|
|
1205
|
-
* @param
|
|
1230
|
+
* @param { Object[] } items - Specifies an array of JSON data or a JSON data.
|
|
1206
1231
|
* @param { number } itemIndex - Specifies the index to place the newly added item in the popup list.
|
|
1207
1232
|
* @returns {void}
|
|
1208
1233
|
* @deprecated
|
|
@@ -1266,11 +1291,17 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1266
1291
|
this.trigger('beforeItemRender', { element: li, item: item });
|
|
1267
1292
|
}
|
|
1268
1293
|
if (itemsCount === 0 && isNullOrUndefined(this.list.querySelector('ul'))) {
|
|
1269
|
-
this.list
|
|
1270
|
-
|
|
1271
|
-
|
|
1294
|
+
if (!isNullOrUndefined(this.list)) {
|
|
1295
|
+
this.list.innerHTML = '';
|
|
1296
|
+
this.list.classList.remove(dropDownBaseClasses.noData);
|
|
1297
|
+
if (!isNullOrUndefined(this.ulElement)) {
|
|
1298
|
+
this.list.appendChild(this.ulElement);
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1272
1301
|
this.liCollections = liCollections;
|
|
1273
|
-
|
|
1302
|
+
if (!isNullOrUndefined(liCollections) && !isNullOrUndefined(this.ulElement)) {
|
|
1303
|
+
append(liCollections, this.ulElement);
|
|
1304
|
+
}
|
|
1274
1305
|
this.updateAddItemList(this.list, itemsCount);
|
|
1275
1306
|
}
|
|
1276
1307
|
else {
|
|
@@ -1317,6 +1348,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1317
1348
|
if (selectedItemValue || itemIndex === 0) {
|
|
1318
1349
|
this.updateSelection();
|
|
1319
1350
|
}
|
|
1351
|
+
this.addedNewItem = true;
|
|
1320
1352
|
};
|
|
1321
1353
|
DropDownBase.prototype.validationAttribute = function (target, hidden) {
|
|
1322
1354
|
var name = target.getAttribute('name') ? target.getAttribute('name') : target.getAttribute('id');
|
|
@@ -1390,14 +1422,16 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1390
1422
|
}
|
|
1391
1423
|
detach(this.list);
|
|
1392
1424
|
}
|
|
1425
|
+
this.liCollections = null;
|
|
1426
|
+
this.ulElement = null;
|
|
1427
|
+
this.list = null;
|
|
1428
|
+
this.enableRtlElements = null;
|
|
1429
|
+
this.rippleFun = null;
|
|
1393
1430
|
_super.prototype.destroy.call(this);
|
|
1394
1431
|
};
|
|
1395
1432
|
__decorate([
|
|
1396
1433
|
Complex({ text: null, value: null, iconCss: null, groupBy: null }, FieldSettings)
|
|
1397
1434
|
], DropDownBase.prototype, "fields", void 0);
|
|
1398
|
-
__decorate([
|
|
1399
|
-
Property(false)
|
|
1400
|
-
], DropDownBase.prototype, "enablePersistence", void 0);
|
|
1401
1435
|
__decorate([
|
|
1402
1436
|
Property(null)
|
|
1403
1437
|
], DropDownBase.prototype, "itemTemplate", void 0);
|
|
@@ -1413,9 +1447,6 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1413
1447
|
__decorate([
|
|
1414
1448
|
Property('None')
|
|
1415
1449
|
], DropDownBase.prototype, "sortOrder", void 0);
|
|
1416
|
-
__decorate([
|
|
1417
|
-
Property(true)
|
|
1418
|
-
], DropDownBase.prototype, "enabled", void 0);
|
|
1419
1450
|
__decorate([
|
|
1420
1451
|
Property([])
|
|
1421
1452
|
], DropDownBase.prototype, "dataSource", void 0);
|
|
@@ -1611,8 +1642,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
1611
1642
|
this.popupObj.setProperties({ 'zIndex': this.zIndex });
|
|
1612
1643
|
}
|
|
1613
1644
|
};
|
|
1614
|
-
DropDownList.prototype.renderList = function (isEmptyData) {
|
|
1615
|
-
_super.prototype.render.call(this, isEmptyData);
|
|
1645
|
+
DropDownList.prototype.renderList = function (e, isEmptyData) {
|
|
1646
|
+
_super.prototype.render.call(this, e, isEmptyData);
|
|
1616
1647
|
this.unWireListEvents();
|
|
1617
1648
|
this.wireListEvents();
|
|
1618
1649
|
};
|
|
@@ -1644,6 +1675,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
1644
1675
|
}
|
|
1645
1676
|
};
|
|
1646
1677
|
DropDownList.prototype.clearAll = function (e, properties) {
|
|
1678
|
+
this.previousItemData = (!isNullOrUndefined(this.itemData)) ? this.itemData : null;
|
|
1647
1679
|
if (isNullOrUndefined(properties) || (!isNullOrUndefined(properties) &&
|
|
1648
1680
|
(isNullOrUndefined(properties.dataSource) ||
|
|
1649
1681
|
(!(properties.dataSource instanceof DataManager) && properties.dataSource.length === 0)))) {
|
|
@@ -1669,14 +1701,18 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
1669
1701
|
}
|
|
1670
1702
|
else {
|
|
1671
1703
|
if (this.allowFiltering && this.getModuleName() !== 'autocomplete'
|
|
1672
|
-
&& !isNullOrUndefined(this.actionCompleteData.ulElement) && !isNullOrUndefined(this.actionCompleteData.list)) {
|
|
1704
|
+
&& !isNullOrUndefined(this.actionCompleteData.ulElement) && !isNullOrUndefined(this.actionCompleteData.list) && this.actionCompleteData.list.length > 0) {
|
|
1673
1705
|
this.onActionComplete(this.actionCompleteData.ulElement.cloneNode(true), this.actionCompleteData.list);
|
|
1674
1706
|
}
|
|
1675
1707
|
this.resetFocusElement();
|
|
1676
1708
|
}
|
|
1677
1709
|
}
|
|
1678
|
-
this.hiddenElement
|
|
1679
|
-
|
|
1710
|
+
if (!isNullOrUndefined(this.hiddenElement)) {
|
|
1711
|
+
this.hiddenElement.innerHTML = '';
|
|
1712
|
+
}
|
|
1713
|
+
if (!isNullOrUndefined(this.inputElement)) {
|
|
1714
|
+
this.inputElement.value = '';
|
|
1715
|
+
}
|
|
1680
1716
|
this.value = null;
|
|
1681
1717
|
this.itemData = null;
|
|
1682
1718
|
this.text = null;
|
|
@@ -1699,42 +1735,42 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
1699
1735
|
for (var _i = 0, _a = Object.keys(this.htmlAttributes); _i < _a.length; _i++) {
|
|
1700
1736
|
var htmlAttr = _a[_i];
|
|
1701
1737
|
if (htmlAttr === 'class') {
|
|
1702
|
-
var updatedClassValue = (this.htmlAttributes[htmlAttr].replace(/\s+/g, ' ')).trim();
|
|
1738
|
+
var updatedClassValue = (this.htmlAttributes["" + htmlAttr].replace(/\s+/g, ' ')).trim();
|
|
1703
1739
|
if (updatedClassValue !== '') {
|
|
1704
1740
|
addClass([this.inputWrapper.container], updatedClassValue.split(' '));
|
|
1705
1741
|
}
|
|
1706
1742
|
}
|
|
1707
|
-
else if (htmlAttr === 'disabled' && this.htmlAttributes[htmlAttr] === 'disabled') {
|
|
1743
|
+
else if (htmlAttr === 'disabled' && this.htmlAttributes["" + htmlAttr] === 'disabled') {
|
|
1708
1744
|
this.enabled = false;
|
|
1709
1745
|
this.setEnable();
|
|
1710
1746
|
}
|
|
1711
|
-
else if (htmlAttr === 'readonly' && !isNullOrUndefined(this.htmlAttributes[htmlAttr])) {
|
|
1747
|
+
else if (htmlAttr === 'readonly' && !isNullOrUndefined(this.htmlAttributes["" + htmlAttr])) {
|
|
1712
1748
|
this.readonly = true;
|
|
1713
1749
|
this.dataBind();
|
|
1714
1750
|
}
|
|
1715
1751
|
else if (htmlAttr === 'style') {
|
|
1716
|
-
this.inputWrapper.container.setAttribute('style', this.htmlAttributes[htmlAttr]);
|
|
1752
|
+
this.inputWrapper.container.setAttribute('style', this.htmlAttributes["" + htmlAttr]);
|
|
1717
1753
|
}
|
|
1718
1754
|
else {
|
|
1719
|
-
var defaultAttr = ['title', 'id', 'placeholder',
|
|
1720
|
-
'role', '
|
|
1755
|
+
var defaultAttr = ['title', 'id', 'placeholder',
|
|
1756
|
+
'role', 'autocomplete', 'autocapitalize', 'spellcheck', 'minlength', 'maxlength'];
|
|
1721
1757
|
var validateAttr = ['name', 'required'];
|
|
1722
1758
|
if (this.getModuleName() === 'autocomplete' || this.getModuleName() === 'combobox') {
|
|
1723
1759
|
defaultAttr.push('tabindex');
|
|
1724
1760
|
}
|
|
1725
1761
|
if (validateAttr.indexOf(htmlAttr) > -1 || htmlAttr.indexOf('data') === 0) {
|
|
1726
|
-
this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
|
|
1762
|
+
this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
|
|
1727
1763
|
}
|
|
1728
1764
|
else if (defaultAttr.indexOf(htmlAttr) > -1) {
|
|
1729
1765
|
if (htmlAttr === 'placeholder') {
|
|
1730
|
-
Input.setPlaceholder(this.htmlAttributes[htmlAttr], this.inputElement);
|
|
1766
|
+
Input.setPlaceholder(this.htmlAttributes["" + htmlAttr], this.inputElement);
|
|
1731
1767
|
}
|
|
1732
1768
|
else {
|
|
1733
|
-
this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
|
|
1769
|
+
this.inputElement.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
|
|
1734
1770
|
}
|
|
1735
1771
|
}
|
|
1736
1772
|
else {
|
|
1737
|
-
this.inputWrapper.container.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
|
|
1773
|
+
this.inputWrapper.container.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
|
|
1738
1774
|
}
|
|
1739
1775
|
}
|
|
1740
1776
|
}
|
|
@@ -1746,11 +1782,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
1746
1782
|
DropDownList.prototype.getAriaAttributes = function () {
|
|
1747
1783
|
return {
|
|
1748
1784
|
'aria-disabled': 'false',
|
|
1749
|
-
'aria-owns': this.element.id + '_options',
|
|
1750
1785
|
'role': 'combobox',
|
|
1751
|
-
'aria-haspopup': 'true',
|
|
1752
1786
|
'aria-expanded': 'false',
|
|
1753
|
-
'aria-activedescendant': 'null',
|
|
1754
1787
|
'aria-live': 'polite',
|
|
1755
1788
|
'aria-labelledby': this.hiddenElement.id
|
|
1756
1789
|
};
|
|
@@ -1793,7 +1826,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
1793
1826
|
}
|
|
1794
1827
|
};
|
|
1795
1828
|
DropDownList.prototype.targetElement = function () {
|
|
1796
|
-
return this.inputWrapper.container;
|
|
1829
|
+
return !isNullOrUndefined(this.inputWrapper) ? this.inputWrapper.container : null;
|
|
1797
1830
|
};
|
|
1798
1831
|
DropDownList.prototype.getNgDirective = function () {
|
|
1799
1832
|
return 'EJS-DROPDOWNLIST';
|
|
@@ -1952,7 +1985,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
1952
1985
|
}
|
|
1953
1986
|
};
|
|
1954
1987
|
DropDownList.prototype.unBindCommonEvent = function () {
|
|
1955
|
-
if (this.targetElement()) {
|
|
1988
|
+
if (!isNullOrUndefined(this.inputWrapper) && this.targetElement()) {
|
|
1956
1989
|
EventHandler.remove(this.targetElement(), 'blur', this.onBlurHandler);
|
|
1957
1990
|
}
|
|
1958
1991
|
var formElement = this.inputElement && closest(this.inputElement, 'form');
|
|
@@ -1982,9 +2015,11 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
1982
2015
|
* @returns {void}
|
|
1983
2016
|
*/
|
|
1984
2017
|
DropDownList.prototype.wireListEvents = function () {
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
2018
|
+
if (!isNullOrUndefined(this.list)) {
|
|
2019
|
+
EventHandler.add(this.list, 'click', this.onMouseClick, this);
|
|
2020
|
+
EventHandler.add(this.list, 'mouseover', this.onMouseOver, this);
|
|
2021
|
+
EventHandler.add(this.list, 'mouseout', this.onMouseLeave, this);
|
|
2022
|
+
}
|
|
1988
2023
|
};
|
|
1989
2024
|
DropDownList.prototype.onSearch = function (e) {
|
|
1990
2025
|
if (e.charCode !== 32 && e.charCode !== 13) {
|
|
@@ -2097,7 +2132,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2097
2132
|
var isTabAction = e.action === 'tab' || e.action === 'close';
|
|
2098
2133
|
if (this.list === undefined && !this.isRequested && !isTabAction && e.action !== 'escape') {
|
|
2099
2134
|
this.searchKeyEvent = e;
|
|
2100
|
-
this.renderList();
|
|
2135
|
+
this.renderList(e);
|
|
2101
2136
|
}
|
|
2102
2137
|
if (isNullOrUndefined(this.list) || (!isNullOrUndefined(this.liCollections) &&
|
|
2103
2138
|
isNavigation && this.liCollections.length === 0) || this.isRequested) {
|
|
@@ -2136,7 +2171,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2136
2171
|
}
|
|
2137
2172
|
break;
|
|
2138
2173
|
case 'open':
|
|
2139
|
-
this.showPopup();
|
|
2174
|
+
this.showPopup(e);
|
|
2140
2175
|
break;
|
|
2141
2176
|
case 'hide':
|
|
2142
2177
|
this.preventAltUp = this.isPopupOpen;
|
|
@@ -2262,9 +2297,11 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2262
2297
|
this.setSelection(previousItem, event);
|
|
2263
2298
|
};
|
|
2264
2299
|
DropDownList.prototype.unWireEvent = function () {
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2300
|
+
if (!isNullOrUndefined(this.inputWrapper)) {
|
|
2301
|
+
EventHandler.remove(this.inputWrapper.container, 'mousedown', this.dropDownClick);
|
|
2302
|
+
EventHandler.remove(this.inputWrapper.container, 'keypress', this.onSearch);
|
|
2303
|
+
EventHandler.remove(this.inputWrapper.container, 'focus', this.focusIn);
|
|
2304
|
+
}
|
|
2268
2305
|
this.unBindCommonEvent();
|
|
2269
2306
|
};
|
|
2270
2307
|
/**
|
|
@@ -2273,9 +2310,11 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2273
2310
|
* @returns {void}
|
|
2274
2311
|
*/
|
|
2275
2312
|
DropDownList.prototype.unWireListEvents = function () {
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2313
|
+
if (this.list) {
|
|
2314
|
+
EventHandler.remove(this.list, 'click', this.onMouseClick);
|
|
2315
|
+
EventHandler.remove(this.list, 'mouseover', this.onMouseOver);
|
|
2316
|
+
EventHandler.remove(this.list, 'mouseout', this.onMouseLeave);
|
|
2317
|
+
}
|
|
2279
2318
|
};
|
|
2280
2319
|
DropDownList.prototype.checkSelector = function (id) {
|
|
2281
2320
|
return '[id="' + id.replace(/(:|\.|\[|\]|,|=|@|\\|\/|#)/g, '\\$1') + '"]';
|
|
@@ -2283,7 +2322,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2283
2322
|
DropDownList.prototype.onDocumentClick = function (e) {
|
|
2284
2323
|
var target = e.target;
|
|
2285
2324
|
if (!(!isNullOrUndefined(this.popupObj) && closest(target, this.checkSelector(this.popupObj.element.id))) &&
|
|
2286
|
-
!this.inputWrapper.container.contains(e.target)) {
|
|
2325
|
+
!isNullOrUndefined(this.inputWrapper) && !this.inputWrapper.container.contains(e.target)) {
|
|
2287
2326
|
if (this.inputWrapper.container.classList.contains(dropDownListClasses.inputFocus) || this.isPopupOpen) {
|
|
2288
2327
|
this.isDocumentClick = true;
|
|
2289
2328
|
var isActive = this.isRequested;
|
|
@@ -2328,7 +2367,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2328
2367
|
}
|
|
2329
2368
|
if (!this.readonly) {
|
|
2330
2369
|
if (this.isPopupOpen) {
|
|
2331
|
-
this.hidePopup();
|
|
2370
|
+
this.hidePopup(e);
|
|
2332
2371
|
if (this.isFilterLayout()) {
|
|
2333
2372
|
this.focusDropDown(e);
|
|
2334
2373
|
}
|
|
@@ -2338,7 +2377,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2338
2377
|
this.floatLabelChange();
|
|
2339
2378
|
this.queryString = this.inputElement.value.trim() === '' ? null : this.inputElement.value;
|
|
2340
2379
|
this.isDropDownClick = true;
|
|
2341
|
-
this.showPopup();
|
|
2380
|
+
this.showPopup(e);
|
|
2342
2381
|
}
|
|
2343
2382
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
2344
2383
|
var proxy_1 = this;
|
|
@@ -2402,6 +2441,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2402
2441
|
};
|
|
2403
2442
|
DropDownList.prototype.selectEventCallback = function (li, e, preventSelect, selectedData, value) {
|
|
2404
2443
|
this.previousItemData = (!isNullOrUndefined(this.itemData)) ? this.itemData : null;
|
|
2444
|
+
if (this.itemData != selectedData) {
|
|
2445
|
+
this.previousValue = (!isNullOrUndefined(this.itemData)) ? typeof this.itemData == "object" ? this.checkFieldValue(this.itemData, this.fields.value.split('.')) : this.itemData : null;
|
|
2446
|
+
}
|
|
2405
2447
|
this.item = li;
|
|
2406
2448
|
this.itemData = selectedData;
|
|
2407
2449
|
var focusedItem = this.list.querySelector('.' + dropDownBaseClasses.focus);
|
|
@@ -2472,10 +2514,6 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2472
2514
|
if (this.setValue(e)) {
|
|
2473
2515
|
return;
|
|
2474
2516
|
}
|
|
2475
|
-
attributes(this.targetElement(), { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });
|
|
2476
|
-
if (this.isFilterLayout() && this.filterInput) {
|
|
2477
|
-
attributes(this.filterInput, { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });
|
|
2478
|
-
}
|
|
2479
2517
|
if ((!this.isPopupOpen && !isNullOrUndefined(li)) || (this.isPopupOpen && !isNullOrUndefined(e) &&
|
|
2480
2518
|
(e.type !== 'keydown' || e.type === 'keydown' && e.action === 'enter'))) {
|
|
2481
2519
|
this.isSelectCustom = false;
|
|
@@ -2485,9 +2523,17 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2485
2523
|
this.setScrollPosition(e);
|
|
2486
2524
|
}
|
|
2487
2525
|
if (Browser.info.name !== 'mozilla') {
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2526
|
+
if (this.targetElement()) {
|
|
2527
|
+
attributes(this.targetElement(), { 'aria-label': this.inputElement.value });
|
|
2528
|
+
attributes(this.targetElement(), { 'aria-describedby': this.inputElement.id != '' ? this.inputElement.id : this.element.id });
|
|
2529
|
+
this.targetElement().removeAttribute('aria-live');
|
|
2530
|
+
}
|
|
2531
|
+
}
|
|
2532
|
+
if (this.isPopupOpen && !isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
|
|
2533
|
+
attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
|
|
2534
|
+
}
|
|
2535
|
+
else if (this.isPopupOpen && !isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-active')[0])) {
|
|
2536
|
+
attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-active')[0].id });
|
|
2491
2537
|
}
|
|
2492
2538
|
};
|
|
2493
2539
|
DropDownList.prototype.dropdownCompiler = function (dropdownTemplate) {
|
|
@@ -2652,9 +2698,11 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2652
2698
|
selectedElement.setAttribute('value', this.value.toString());
|
|
2653
2699
|
}
|
|
2654
2700
|
else {
|
|
2655
|
-
this.hiddenElement
|
|
2656
|
-
|
|
2657
|
-
|
|
2701
|
+
if (!isNullOrUndefined(this.hiddenElement)) {
|
|
2702
|
+
this.hiddenElement.innerHTML = '<option selected>' + this.text + '</option>';
|
|
2703
|
+
var selectedElement = this.hiddenElement.querySelector('option');
|
|
2704
|
+
selectedElement.setAttribute('value', this.value.toString());
|
|
2705
|
+
}
|
|
2658
2706
|
}
|
|
2659
2707
|
}
|
|
2660
2708
|
else {
|
|
@@ -2681,6 +2729,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2681
2729
|
this.preventAutoFill = false;
|
|
2682
2730
|
}
|
|
2683
2731
|
this.preventAltUp = false;
|
|
2732
|
+
if (this.getModuleName() === 'autocomplete' && !isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
|
|
2733
|
+
attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
|
|
2734
|
+
}
|
|
2684
2735
|
e.preventDefault();
|
|
2685
2736
|
break;
|
|
2686
2737
|
case 46: //delete
|
|
@@ -2803,9 +2854,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2803
2854
|
/**
|
|
2804
2855
|
* To filter the data from given data source by using query
|
|
2805
2856
|
*
|
|
2806
|
-
* @param
|
|
2807
|
-
* @param
|
|
2808
|
-
* @param
|
|
2857
|
+
* @param {Object[] | DataManager } dataSource - Set the data source to filter.
|
|
2858
|
+
* @param {Query} query - Specify the query to filter the data.
|
|
2859
|
+
* @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
|
|
2809
2860
|
* @returns {void}
|
|
2810
2861
|
* @deprecated
|
|
2811
2862
|
*/
|
|
@@ -2871,11 +2922,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2871
2922
|
prepend([parentElement], popupElement);
|
|
2872
2923
|
attributes(this.filterInput, {
|
|
2873
2924
|
'aria-disabled': 'false',
|
|
2874
|
-
'
|
|
2875
|
-
'role': 'listbox',
|
|
2876
|
-
'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null,
|
|
2925
|
+
'role': 'combobox',
|
|
2877
2926
|
'autocomplete': 'off',
|
|
2878
|
-
'autocorrect': 'off',
|
|
2879
2927
|
'autocapitalize': 'off',
|
|
2880
2928
|
'spellcheck': 'false'
|
|
2881
2929
|
});
|
|
@@ -2961,7 +3009,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2961
3009
|
this.initRemoteRender = false;
|
|
2962
3010
|
if (this.value && this.dataSource instanceof DataManager) {
|
|
2963
3011
|
var checkField_1 = isNullOrUndefined(this.fields.value) ? this.fields.text : this.fields.value;
|
|
2964
|
-
var
|
|
3012
|
+
var fieldValue_1 = this.fields.value.split('.');
|
|
3013
|
+
var checkVal = list.some(function (x) { return isNullOrUndefined(x[checkField_1]) && fieldValue_1.length > 1 ? _this.checkFieldValue(x, fieldValue_1) === _this.value : x[checkField_1] === _this.value; });
|
|
2965
3014
|
if (!checkVal) {
|
|
2966
3015
|
this.dataSource.executeQuery(this.getQuery(this.query).where(new Predicate(checkField_1, 'equal', this.value)))
|
|
2967
3016
|
.then(function (e) {
|
|
@@ -2983,6 +3032,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2983
3032
|
}
|
|
2984
3033
|
this.initial = false;
|
|
2985
3034
|
}
|
|
3035
|
+
else if (this.getModuleName() === 'autocomplete' && this.value) {
|
|
3036
|
+
this.setInputValue();
|
|
3037
|
+
}
|
|
2986
3038
|
if (this.getModuleName() !== 'autocomplete' && this.isFiltering() && !this.isTyped) {
|
|
2987
3039
|
if (!this.actionCompleteData.isUpdated || ((!this.isCustomFilter
|
|
2988
3040
|
&& !this.isFilterFocus) || (isNullOrUndefined(this.itemData) && this.allowFiltering)
|
|
@@ -3004,10 +3056,17 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3004
3056
|
}
|
|
3005
3057
|
}
|
|
3006
3058
|
if (this.beforePopupOpen) {
|
|
3007
|
-
this.renderPopup();
|
|
3059
|
+
this.renderPopup(e);
|
|
3008
3060
|
}
|
|
3009
3061
|
}
|
|
3010
3062
|
};
|
|
3063
|
+
DropDownList.prototype.checkFieldValue = function (list, fieldValue) {
|
|
3064
|
+
var checkField = list;
|
|
3065
|
+
fieldValue.forEach(function (value) {
|
|
3066
|
+
checkField = checkField[value];
|
|
3067
|
+
});
|
|
3068
|
+
return checkField;
|
|
3069
|
+
};
|
|
3011
3070
|
DropDownList.prototype.updateActionCompleteDataValues = function (ulElement, list) {
|
|
3012
3071
|
this.actionCompleteData = { ulElement: ulElement.cloneNode(true), list: list, isUpdated: true };
|
|
3013
3072
|
if (this.actionData.list !== this.actionCompleteData.list && this.actionCompleteData.ulElement && this.actionCompleteData.list) {
|
|
@@ -3076,7 +3135,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3076
3135
|
removeClass(highlightedItem, dropDownListClasses.focus);
|
|
3077
3136
|
}
|
|
3078
3137
|
};
|
|
3079
|
-
DropDownList.prototype.renderPopup = function () {
|
|
3138
|
+
DropDownList.prototype.renderPopup = function (e) {
|
|
3080
3139
|
var _this = this;
|
|
3081
3140
|
if (this.popupObj && document.body.contains(this.popupObj.element)) {
|
|
3082
3141
|
this.refreshPopup();
|
|
@@ -3133,9 +3192,11 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3133
3192
|
(_this.isDropDownClick && _this.getModuleName() === 'combobox')))) {
|
|
3134
3193
|
offsetValue = _this.getOffsetValue(popupEle);
|
|
3135
3194
|
var firstItem = _this.isEmptyList() ? _this.list : _this.liCollections[0];
|
|
3136
|
-
|
|
3137
|
-
parseInt(getComputedStyle(
|
|
3138
|
-
|
|
3195
|
+
if (!isNullOrUndefined(_this.inputElement)) {
|
|
3196
|
+
left = -(parseInt(getComputedStyle(firstItem).textIndent, 10) -
|
|
3197
|
+
parseInt(getComputedStyle(_this.inputElement).paddingLeft, 10) +
|
|
3198
|
+
parseInt(getComputedStyle(_this.inputElement.parentElement).borderLeftWidth, 10));
|
|
3199
|
+
}
|
|
3139
3200
|
}
|
|
3140
3201
|
_this.getFocusElement();
|
|
3141
3202
|
_this.createPopup(popupEle, offsetValue, left);
|
|
@@ -3166,25 +3227,28 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3166
3227
|
var element = scrollParentElements_1[_i];
|
|
3167
3228
|
EventHandler.add(element, 'scroll', _this.scrollHandler, _this);
|
|
3168
3229
|
}
|
|
3169
|
-
if (Browser.isDevice && _this.isFilterLayout()) {
|
|
3170
|
-
EventHandler.add(_this.list, 'scroll', _this.listScroll, _this);
|
|
3171
|
-
}
|
|
3172
3230
|
if (!isNullOrUndefined(_this.list)) {
|
|
3173
3231
|
_this.unWireListEvents();
|
|
3174
3232
|
_this.wireListEvents();
|
|
3175
3233
|
}
|
|
3176
|
-
|
|
3234
|
+
_this.selectedElementID = _this.selectedLI ? _this.selectedLI.id : null;
|
|
3235
|
+
attributes(_this.targetElement(), { 'aria-expanded': 'true', 'aria-owns': _this.inputElement.id + '_options' });
|
|
3236
|
+
_this.inputElement.setAttribute('aria-expanded', 'true');
|
|
3177
3237
|
var inputParent = _this.isFiltering() ? _this.filterInput.parentElement : _this.inputWrapper.container;
|
|
3178
3238
|
addClass([inputParent], [dropDownListClasses.inputFocus]);
|
|
3179
3239
|
var animModel = { name: 'FadeIn', duration: 100 };
|
|
3180
3240
|
_this.beforePopupOpen = true;
|
|
3181
3241
|
var popupInstance = _this.popupObj;
|
|
3182
|
-
var eventArgs = { popup: popupInstance, cancel: false, animation: animModel };
|
|
3242
|
+
var eventArgs = { popup: popupInstance, event: e, cancel: false, animation: animModel };
|
|
3183
3243
|
_this.trigger('open', eventArgs, function (eventArgs) {
|
|
3184
3244
|
if (!eventArgs.cancel) {
|
|
3185
|
-
|
|
3245
|
+
if (!isNullOrUndefined(_this.inputWrapper)) {
|
|
3246
|
+
addClass([_this.inputWrapper.container], [dropDownListClasses.iconAnimation]);
|
|
3247
|
+
}
|
|
3186
3248
|
_this.renderReactTemplates();
|
|
3187
|
-
|
|
3249
|
+
if (!isNullOrUndefined(_this.popupObj)) {
|
|
3250
|
+
_this.popupObj.show(new Animation(eventArgs.animation), (_this.zIndex === 1000) ? _this.element : null);
|
|
3251
|
+
}
|
|
3188
3252
|
}
|
|
3189
3253
|
else {
|
|
3190
3254
|
_this.beforePopupOpen = false;
|
|
@@ -3242,6 +3306,12 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3242
3306
|
var actionList = _this.actionCompleteData && _this.actionCompleteData.ulElement &&
|
|
3243
3307
|
_this.actionCompleteData.ulElement.querySelector('li');
|
|
3244
3308
|
var ulElement = _this.list.querySelector('ul li');
|
|
3309
|
+
if (!isNullOrUndefined(_this.ulElement) && !isNullOrUndefined(_this.ulElement.getElementsByClassName('e-item-focus')[0])) {
|
|
3310
|
+
attributes(_this.targetElement(), { 'aria-activedescendant': _this.ulElement.getElementsByClassName('e-item-focus')[0].id });
|
|
3311
|
+
}
|
|
3312
|
+
else if (!isNullOrUndefined(_this.ulElement) && !isNullOrUndefined(_this.ulElement.getElementsByClassName('e-active')[0])) {
|
|
3313
|
+
attributes(_this.targetElement(), { 'aria-activedescendant': _this.ulElement.getElementsByClassName('e-active')[0].id });
|
|
3314
|
+
}
|
|
3245
3315
|
if (_this.isFiltering() && _this.itemTemplate && (_this.element.tagName === _this.getNgDirective()) &&
|
|
3246
3316
|
(actionList && ulElement && actionList.textContent !== ulElement.textContent) &&
|
|
3247
3317
|
_this.element.tagName !== 'EJS-COMBOBOX') {
|
|
@@ -3397,9 +3467,6 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3397
3467
|
this.filterInput.value = this.typedString = '';
|
|
3398
3468
|
this.searchLists(null);
|
|
3399
3469
|
};
|
|
3400
|
-
DropDownList.prototype.listScroll = function () {
|
|
3401
|
-
this.filterInput.blur();
|
|
3402
|
-
};
|
|
3403
3470
|
DropDownList.prototype.setEleWidth = function (width) {
|
|
3404
3471
|
if (!isNullOrUndefined(width)) {
|
|
3405
3472
|
if (typeof width === 'number') {
|
|
@@ -3428,7 +3495,6 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3428
3495
|
}
|
|
3429
3496
|
if (Browser.isDevice && this.isFilterLayout()) {
|
|
3430
3497
|
removeClass([document.body, this.popupObj.element], dropDownListClasses.popupFullScreen);
|
|
3431
|
-
EventHandler.remove(this.list, 'scroll', this.listScroll);
|
|
3432
3498
|
}
|
|
3433
3499
|
if (this.isFilterLayout()) {
|
|
3434
3500
|
if (!Browser.isDevice) {
|
|
@@ -3441,14 +3507,19 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3441
3507
|
EventHandler.remove(this.backIconElement, 'click', this.clickOnBackIcon);
|
|
3442
3508
|
EventHandler.remove(this.clearIconElement, 'click', this.clearText);
|
|
3443
3509
|
}
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3510
|
+
if (!isNullOrUndefined(this.filterInput)) {
|
|
3511
|
+
EventHandler.remove(this.filterInput, 'input', this.onInput);
|
|
3512
|
+
EventHandler.remove(this.filterInput, 'keyup', this.onFilterUp);
|
|
3513
|
+
EventHandler.remove(this.filterInput, 'keydown', this.onFilterDown);
|
|
3514
|
+
EventHandler.remove(this.filterInput, 'blur', this.onBlurHandler);
|
|
3515
|
+
EventHandler.remove(this.filterInput, 'paste', this.pasteHandler);
|
|
3516
|
+
}
|
|
3449
3517
|
this.filterInput = null;
|
|
3450
3518
|
}
|
|
3451
3519
|
attributes(this.targetElement(), { 'aria-expanded': 'false' });
|
|
3520
|
+
this.inputElement.setAttribute('aria-expanded', 'false');
|
|
3521
|
+
this.targetElement().removeAttribute('aria-owns');
|
|
3522
|
+
this.targetElement().removeAttribute('aria-activedescendant');
|
|
3452
3523
|
this.inputWrapper.container.classList.remove(dropDownListClasses.iconAnimation);
|
|
3453
3524
|
if (this.isFiltering()) {
|
|
3454
3525
|
this.actionCompleteData.isUpdated = false;
|
|
@@ -3501,14 +3572,15 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3501
3572
|
if (this.element.tagName === 'INPUT') {
|
|
3502
3573
|
this.inputElement = this.element;
|
|
3503
3574
|
if (isNullOrUndefined(this.inputElement.getAttribute('role'))) {
|
|
3504
|
-
this.inputElement.setAttribute('role', '
|
|
3575
|
+
this.inputElement.setAttribute('role', 'combobox');
|
|
3505
3576
|
}
|
|
3506
3577
|
if (isNullOrUndefined(this.inputElement.getAttribute('type'))) {
|
|
3507
3578
|
this.inputElement.setAttribute('type', 'text');
|
|
3508
3579
|
}
|
|
3580
|
+
this.inputElement.setAttribute('aria-expanded', 'false');
|
|
3509
3581
|
}
|
|
3510
3582
|
else {
|
|
3511
|
-
this.inputElement = this.createElement('input', { attrs: { role: '
|
|
3583
|
+
this.inputElement = this.createElement('input', { attrs: { role: 'combobox', type: 'text' } });
|
|
3512
3584
|
if (this.element.tagName !== this.getNgDirective()) {
|
|
3513
3585
|
this.element.style.display = 'none';
|
|
3514
3586
|
}
|
|
@@ -3519,6 +3591,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3519
3591
|
if (!isNullOrUndefined(this.cssClass) && this.cssClass !== '') {
|
|
3520
3592
|
updatedCssClassValues = (this.cssClass.replace(/\s+/g, ' ')).trim();
|
|
3521
3593
|
}
|
|
3594
|
+
if (!isNullOrUndefined(closest(this.element, "fieldset")) && closest(this.element, "fieldset").disabled) {
|
|
3595
|
+
this.enabled = false;
|
|
3596
|
+
}
|
|
3522
3597
|
this.inputWrapper = Input.createInput({
|
|
3523
3598
|
element: this.inputElement,
|
|
3524
3599
|
buttons: this.isPopupButton() ? [dropDownListClasses.icon] : null,
|
|
@@ -3547,6 +3622,10 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3547
3622
|
this.setFields();
|
|
3548
3623
|
this.inputWrapper.container.style.width = formatUnit(this.width);
|
|
3549
3624
|
this.inputWrapper.container.classList.add('e-ddl');
|
|
3625
|
+
Input.calculateWidth(this.inputElement, this.inputWrapper.container);
|
|
3626
|
+
if (!isNullOrUndefined(this.inputWrapper.buttons[0]) && this.inputWrapper.container.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never') {
|
|
3627
|
+
this.inputWrapper.container.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
|
|
3628
|
+
}
|
|
3550
3629
|
this.wireEvent();
|
|
3551
3630
|
this.tabIndex = this.element.hasAttribute('tabindex') ? this.element.getAttribute('tabindex') : '0';
|
|
3552
3631
|
this.element.removeAttribute('tabindex');
|
|
@@ -3557,6 +3636,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3557
3636
|
attributes(this.targetElement(), this.getAriaAttributes());
|
|
3558
3637
|
this.updateDataAttribute(this.htmlAttributes);
|
|
3559
3638
|
this.setHTMLAttributes();
|
|
3639
|
+
if (this.targetElement() === this.inputElement) {
|
|
3640
|
+
this.inputElement.removeAttribute('aria-labelledby');
|
|
3641
|
+
}
|
|
3560
3642
|
if (this.value !== null || this.activeIndex !== null || this.text !== null) {
|
|
3561
3643
|
this.initValue();
|
|
3562
3644
|
}
|
|
@@ -3566,6 +3648,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3566
3648
|
this.text = isNullOrUndefined(this.value) ? null : selectElement.options[selectElement.selectedIndex].textContent;
|
|
3567
3649
|
this.initValue();
|
|
3568
3650
|
}
|
|
3651
|
+
this.setEnabled();
|
|
3569
3652
|
this.preventTabIndex(this.element);
|
|
3570
3653
|
if (!this.enabled) {
|
|
3571
3654
|
this.targetElement().tabIndex = -1;
|
|
@@ -3587,12 +3670,22 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3587
3670
|
if (this.element.hasAttribute('data-val')) {
|
|
3588
3671
|
this.element.setAttribute('data-val', 'false');
|
|
3589
3672
|
}
|
|
3673
|
+
var floatLabelElement = this.inputWrapper.container.getElementsByClassName('e-float-text')[0];
|
|
3674
|
+
if (!isNullOrUndefined(this.element.id) && this.element.id !== '' && !isNullOrUndefined(floatLabelElement)) {
|
|
3675
|
+
floatLabelElement.id = 'label_' + this.element.id.replace(/ /g, '_');
|
|
3676
|
+
attributes(this.inputElement, { 'aria-labelledby': floatLabelElement.id });
|
|
3677
|
+
}
|
|
3590
3678
|
this.renderComplete();
|
|
3591
3679
|
};
|
|
3592
3680
|
DropDownList.prototype.setFooterTemplate = function (popupEle) {
|
|
3593
3681
|
var compiledString;
|
|
3594
3682
|
if (this.footer) {
|
|
3595
|
-
this.
|
|
3683
|
+
if (this.isReact) {
|
|
3684
|
+
this.clearTemplate(['footerTemplate']);
|
|
3685
|
+
}
|
|
3686
|
+
else {
|
|
3687
|
+
this.footer.innerHTML = '';
|
|
3688
|
+
}
|
|
3596
3689
|
}
|
|
3597
3690
|
else {
|
|
3598
3691
|
this.footer = this.createElement('div');
|
|
@@ -3640,6 +3733,14 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3640
3733
|
var contentEle = popupEle.querySelector('div.e-content');
|
|
3641
3734
|
popupEle.insertBefore(this.header, contentEle);
|
|
3642
3735
|
};
|
|
3736
|
+
/**
|
|
3737
|
+
* Sets the enabled state to DropDownBase.
|
|
3738
|
+
*
|
|
3739
|
+
* @returns {void}
|
|
3740
|
+
*/
|
|
3741
|
+
DropDownList.prototype.setEnabled = function () {
|
|
3742
|
+
this.element.setAttribute('aria-disabled', (this.enabled) ? 'false' : 'true');
|
|
3743
|
+
};
|
|
3643
3744
|
DropDownList.prototype.setOldText = function (text) {
|
|
3644
3745
|
this.text = text;
|
|
3645
3746
|
};
|
|
@@ -3727,6 +3828,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3727
3828
|
break;
|
|
3728
3829
|
case 'width':
|
|
3729
3830
|
this_1.setEleWidth(newProp.width);
|
|
3831
|
+
Input.calculateWidth(this_1.inputElement, this_1.inputWrapper.container);
|
|
3730
3832
|
break;
|
|
3731
3833
|
case 'placeholder':
|
|
3732
3834
|
Input.setPlaceholder(newProp.placeholder, this_1.inputElement);
|
|
@@ -3744,6 +3846,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3744
3846
|
break;
|
|
3745
3847
|
case 'cssClass':
|
|
3746
3848
|
this_1.setCssClass(newProp.cssClass, oldProp.cssClass);
|
|
3849
|
+
Input.calculateWidth(this_1.inputElement, this_1.inputWrapper.container);
|
|
3747
3850
|
break;
|
|
3748
3851
|
case 'enableRtl':
|
|
3749
3852
|
this_1.setEnableRtl();
|
|
@@ -3784,6 +3887,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3784
3887
|
}
|
|
3785
3888
|
});
|
|
3786
3889
|
}
|
|
3890
|
+
else if (this_1.getModuleName() === 'autocomplete') {
|
|
3891
|
+
this_1.setInputValue(newProp, oldProp);
|
|
3892
|
+
}
|
|
3787
3893
|
else {
|
|
3788
3894
|
this_1.setOldText(oldProp.text);
|
|
3789
3895
|
}
|
|
@@ -3825,6 +3931,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3825
3931
|
}
|
|
3826
3932
|
});
|
|
3827
3933
|
}
|
|
3934
|
+
else if (this_1.getModuleName() === 'autocomplete') {
|
|
3935
|
+
this_1.setInputValue(newProp, oldProp);
|
|
3936
|
+
}
|
|
3828
3937
|
else {
|
|
3829
3938
|
this_1.setOldValue(oldProp.value);
|
|
3830
3939
|
}
|
|
@@ -3884,6 +3993,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3884
3993
|
case 'floatLabelType':
|
|
3885
3994
|
Input.removeFloating(this_1.inputWrapper);
|
|
3886
3995
|
Input.addFloating(this_1.inputElement, newProp.floatLabelType, this_1.placeholder, this_1.createElement);
|
|
3996
|
+
if (!isNullOrUndefined(this_1.inputWrapper.buttons[0]) && this_1.inputWrapper.container.getElementsByClassName('e-float-text-overflow')[0] && this_1.floatLabelType !== 'Never') {
|
|
3997
|
+
this_1.inputWrapper.container.getElementsByClassName('e-float-text-overflow')[0].classList.add('e-icon');
|
|
3998
|
+
}
|
|
3887
3999
|
break;
|
|
3888
4000
|
case 'showClearButton':
|
|
3889
4001
|
Input.setClearButton(newProp.showClearButton, this_1.inputElement, this_1.inputWrapper, null, this_1.createElement);
|
|
@@ -3943,6 +4055,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3943
4055
|
removeClass([this.inputWrapper.container], ['e-readonly']);
|
|
3944
4056
|
}
|
|
3945
4057
|
};
|
|
4058
|
+
DropDownList.prototype.setInputValue = function (newProp, oldProp) {
|
|
4059
|
+
};
|
|
3946
4060
|
DropDownList.prototype.setCssClass = function (newClass, oldClass) {
|
|
3947
4061
|
if (!isNullOrUndefined(oldClass)) {
|
|
3948
4062
|
oldClass = (oldClass.replace(/\s+/g, ' ')).trim();
|
|
@@ -3969,7 +4083,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3969
4083
|
*
|
|
3970
4084
|
* @returns {void}
|
|
3971
4085
|
*/
|
|
3972
|
-
DropDownList.prototype.showPopup = function () {
|
|
4086
|
+
DropDownList.prototype.showPopup = function (e) {
|
|
3973
4087
|
if (!this.enabled) {
|
|
3974
4088
|
return;
|
|
3975
4089
|
}
|
|
@@ -3989,11 +4103,11 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3989
4103
|
}
|
|
3990
4104
|
else if (isNullOrUndefined(this.list) || !isUndefined(this.list) && (this.list.classList.contains(dropDownBaseClasses.noData) ||
|
|
3991
4105
|
this.list.querySelectorAll('.' + dropDownBaseClasses.li).length <= 0)) {
|
|
3992
|
-
this.renderList();
|
|
4106
|
+
this.renderList(e);
|
|
3993
4107
|
}
|
|
3994
|
-
this.invokeRenderPopup();
|
|
4108
|
+
this.invokeRenderPopup(e);
|
|
3995
4109
|
};
|
|
3996
|
-
DropDownList.prototype.invokeRenderPopup = function () {
|
|
4110
|
+
DropDownList.prototype.invokeRenderPopup = function (e) {
|
|
3997
4111
|
if (Browser.isDevice && this.isFilterLayout()) {
|
|
3998
4112
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
3999
4113
|
var proxy_2 = this;
|
|
@@ -4002,10 +4116,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4002
4116
|
};
|
|
4003
4117
|
history.pushState({}, '');
|
|
4004
4118
|
}
|
|
4005
|
-
if (!isNullOrUndefined(this.list.children[0]) || this.list.classList.contains(dropDownBaseClasses.noData)) {
|
|
4006
|
-
this.renderPopup();
|
|
4119
|
+
if (!isNullOrUndefined(this.list) && (!isNullOrUndefined(this.list.children[0]) || this.list.classList.contains(dropDownBaseClasses.noData))) {
|
|
4120
|
+
this.renderPopup(e);
|
|
4007
4121
|
}
|
|
4008
|
-
attributes(this.targetElement(), { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });
|
|
4009
4122
|
};
|
|
4010
4123
|
DropDownList.prototype.renderHightSearch = function () {
|
|
4011
4124
|
// update high light search
|
|
@@ -4019,7 +4132,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4019
4132
|
DropDownList.prototype.hidePopup = function (e) {
|
|
4020
4133
|
/* eslint-enable valid-jsdoc, jsdoc/require-param */
|
|
4021
4134
|
if (this.isEscapeKey && this.getModuleName() === 'dropdownlist') {
|
|
4022
|
-
|
|
4135
|
+
if (!isNullOrUndefined(this.inputElement)) {
|
|
4136
|
+
Input.setValue(this.text, this.inputElement, this.floatLabelType, this.showClearButton);
|
|
4137
|
+
}
|
|
4023
4138
|
this.isEscapeKey = false;
|
|
4024
4139
|
if (!isNullOrUndefined(this.index)) {
|
|
4025
4140
|
var element = this.findListElement(this.ulElement, 'li', 'data-value', this.value);
|
|
@@ -4069,6 +4184,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4069
4184
|
}
|
|
4070
4185
|
addClass([this.inputWrapper.container], [dropDownListClasses.inputFocus]);
|
|
4071
4186
|
this.onFocus(e);
|
|
4187
|
+
Input.calculateWidth(this.inputElement, this.inputWrapper.container);
|
|
4072
4188
|
};
|
|
4073
4189
|
/**
|
|
4074
4190
|
* Moves the focus from the component if the component is already focused.
|
|
@@ -4086,6 +4202,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4086
4202
|
this.targetElement().blur();
|
|
4087
4203
|
}
|
|
4088
4204
|
removeClass([this.inputWrapper.container], [dropDownListClasses.inputFocus]);
|
|
4205
|
+
Input.calculateWidth(this.inputElement, this.inputWrapper.container);
|
|
4089
4206
|
};
|
|
4090
4207
|
/**
|
|
4091
4208
|
* Removes the component from the DOM and detaches all its related event handlers. Also it removes the attributes and classes.
|
|
@@ -4109,10 +4226,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4109
4226
|
return;
|
|
4110
4227
|
}
|
|
4111
4228
|
if (this.inputElement) {
|
|
4112
|
-
var attrArray = ['readonly', 'aria-disabled', 'aria-
|
|
4113
|
-
'
|
|
4114
|
-
'aria-
|
|
4115
|
-
'autocapitalize', 'spellcheck', 'aria-autocomplete', 'aria-live', 'aria-describedby', 'aria-label'];
|
|
4229
|
+
var attrArray = ['readonly', 'aria-disabled', 'placeholder', 'aria-labelledby',
|
|
4230
|
+
'aria-expanded', 'autocomplete', 'aria-readonly', 'autocapitalize',
|
|
4231
|
+
'spellcheck', 'aria-autocomplete', 'aria-live', 'aria-describedby', 'aria-label'];
|
|
4116
4232
|
for (var i = 0; i < attrArray.length; i++) {
|
|
4117
4233
|
this.inputElement.removeAttribute(attrArray[i]);
|
|
4118
4234
|
}
|
|
@@ -4128,6 +4244,21 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4128
4244
|
this.inputWrapper.container.parentElement.insertBefore(this.element, this.inputWrapper.container);
|
|
4129
4245
|
detach(this.inputWrapper.container);
|
|
4130
4246
|
}
|
|
4247
|
+
this.hiddenElement = null;
|
|
4248
|
+
this.inputWrapper = null;
|
|
4249
|
+
this.keyboardModule = null;
|
|
4250
|
+
this.ulElement = null;
|
|
4251
|
+
this.list = null;
|
|
4252
|
+
this.popupObj = null;
|
|
4253
|
+
this.rippleFun = null;
|
|
4254
|
+
this.selectedLI = null;
|
|
4255
|
+
this.liCollections = null;
|
|
4256
|
+
this.item = null;
|
|
4257
|
+
this.inputWrapper = null;
|
|
4258
|
+
this.footer = null;
|
|
4259
|
+
this.header = null;
|
|
4260
|
+
this.previousSelectedLI = null;
|
|
4261
|
+
this.valueTempElement = null;
|
|
4131
4262
|
_super.prototype.destroy.call(this);
|
|
4132
4263
|
};
|
|
4133
4264
|
/* eslint-disable valid-jsdoc, jsdoc/require-returns-description */
|
|
@@ -4169,6 +4300,12 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4169
4300
|
__decorate$1([
|
|
4170
4301
|
Property('100%')
|
|
4171
4302
|
], DropDownList.prototype, "width", void 0);
|
|
4303
|
+
__decorate$1([
|
|
4304
|
+
Property(true)
|
|
4305
|
+
], DropDownList.prototype, "enabled", void 0);
|
|
4306
|
+
__decorate$1([
|
|
4307
|
+
Property(false)
|
|
4308
|
+
], DropDownList.prototype, "enablePersistence", void 0);
|
|
4172
4309
|
__decorate$1([
|
|
4173
4310
|
Property('300px')
|
|
4174
4311
|
], DropDownList.prototype, "popupHeight", void 0);
|
|
@@ -4348,6 +4485,9 @@ var Fields = /** @__PURE__ @class */ (function (_super) {
|
|
|
4348
4485
|
__decorate$2([
|
|
4349
4486
|
Property(null)
|
|
4350
4487
|
], Fields.prototype, "query", void 0);
|
|
4488
|
+
__decorate$2([
|
|
4489
|
+
Property('selectable')
|
|
4490
|
+
], Fields.prototype, "selectable", void 0);
|
|
4351
4491
|
__decorate$2([
|
|
4352
4492
|
Property('selected')
|
|
4353
4493
|
], Fields.prototype, "selected", void 0);
|
|
@@ -4404,6 +4544,8 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
4404
4544
|
_this.selectedData = [];
|
|
4405
4545
|
_this.filterDelayTime = 300;
|
|
4406
4546
|
_this.isClicked = false;
|
|
4547
|
+
// Specifies if the checkAll method has been called
|
|
4548
|
+
_this.isCheckAllCalled = false;
|
|
4407
4549
|
return _this;
|
|
4408
4550
|
}
|
|
4409
4551
|
/**
|
|
@@ -4532,7 +4674,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
4532
4674
|
this.updateDataAttribute();
|
|
4533
4675
|
this.setHTMLAttributes();
|
|
4534
4676
|
this.setAttributes();
|
|
4535
|
-
this.popupDiv = this.createElement('div', { className: CONTENT
|
|
4677
|
+
this.popupDiv = this.createElement('div', { className: CONTENT });
|
|
4536
4678
|
this.popupDiv.classList.add(DROPDOWN);
|
|
4537
4679
|
this.tree = this.createElement('div', { id: this.element.id + '_tree' });
|
|
4538
4680
|
this.popupDiv.appendChild(this.tree);
|
|
@@ -5157,7 +5299,12 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
5157
5299
|
temp = this.getOverflowVal(index);
|
|
5158
5300
|
data += temp;
|
|
5159
5301
|
temp = this.overFlowWrapper.innerHTML;
|
|
5160
|
-
this.
|
|
5302
|
+
if (this.enableHtmlSanitizer) {
|
|
5303
|
+
this.overFlowWrapper.innerText = data;
|
|
5304
|
+
}
|
|
5305
|
+
else {
|
|
5306
|
+
this.overFlowWrapper.innerHTML = data;
|
|
5307
|
+
}
|
|
5161
5308
|
wrapperleng = this.overFlowWrapper.offsetWidth;
|
|
5162
5309
|
overAllContainer = this.inputWrapper.offsetWidth;
|
|
5163
5310
|
if ((wrapperleng + downIconWidth + this.clearIconWidth) > overAllContainer) {
|
|
@@ -5327,7 +5474,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
5327
5474
|
if (isValid && this.value !== null && (this.value && this.value.length !== 0)) {
|
|
5328
5475
|
addClass([this.inputEle], CHIP_INPUT);
|
|
5329
5476
|
}
|
|
5330
|
-
else if (this.value === null || (this.value && this.value.length === 0)) {
|
|
5477
|
+
else if (this.value === null || (this.value && this.value.length === 0) || this.chipWrapper) {
|
|
5331
5478
|
addClass([this.chipWrapper], HIDEICON);
|
|
5332
5479
|
}
|
|
5333
5480
|
}
|
|
@@ -5382,6 +5529,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
5382
5529
|
frameSpan.classList.add(CHECK);
|
|
5383
5530
|
ariaState = 'true';
|
|
5384
5531
|
if (!this.isReverseUpdate) {
|
|
5532
|
+
this.isCheckAllCalled = true;
|
|
5385
5533
|
this.treeObj.checkAll();
|
|
5386
5534
|
if (!this.changeOnBlur) {
|
|
5387
5535
|
this.triggerChangeEvent(e);
|
|
@@ -5685,10 +5833,12 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
5685
5833
|
nodeSelected: this.onNodeSelected.bind(this),
|
|
5686
5834
|
nodeChecked: this.onNodeChecked.bind(this),
|
|
5687
5835
|
nodeChecking: this.beforeCheck.bind(this),
|
|
5836
|
+
nodeExpanded: this.onNodeExpanded.bind(this),
|
|
5688
5837
|
actionFailure: this.onActionFailure.bind(this),
|
|
5689
5838
|
nodeClicked: this.onNodeClicked.bind(this),
|
|
5690
5839
|
dataBound: this.OnDataBound.bind(this),
|
|
5691
5840
|
allowMultiSelection: this.allowMultiSelection,
|
|
5841
|
+
enableHtmlSanitizer: this.enableHtmlSanitizer,
|
|
5692
5842
|
showCheckBox: this.showCheckBox,
|
|
5693
5843
|
autoCheck: this.treeSettings.autoCheck,
|
|
5694
5844
|
sortOrder: this.sortOrder,
|
|
@@ -5791,7 +5941,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
5791
5941
|
var height = Math.round(this.header.getBoundingClientRect().height);
|
|
5792
5942
|
popupHeight = formatUnit(parseInt(popupHeight, 10) - height + 'px');
|
|
5793
5943
|
}
|
|
5794
|
-
if (this.showCheckBox && this.showSelectAll) {
|
|
5944
|
+
if (this.showCheckBox && this.showSelectAll && (!this.popupDiv.classList.contains(NODATA))) {
|
|
5795
5945
|
var height = Math.round(this.checkAllParent.getBoundingClientRect().height);
|
|
5796
5946
|
popupHeight = formatUnit(parseInt(popupHeight, 10) - height + 'px');
|
|
5797
5947
|
}
|
|
@@ -5874,14 +6024,14 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
5874
6024
|
var isFooter = closest(target, '.' + FOOTER);
|
|
5875
6025
|
var isScroller = target.classList.contains(DROPDOWN) ? true :
|
|
5876
6026
|
(matches(target, '.e-ddt .e-popup') || matches(target, '.e-ddt .e-treeview'));
|
|
5877
|
-
if ((this.isPopupOpen && (this.inputWrapper.contains(target) || isTree ||
|
|
6027
|
+
if ((this.isPopupOpen && (this.inputWrapper.contains(target) || isTree || isScroller || isHeader || isFooter)) ||
|
|
5878
6028
|
((this.allowMultiSelection || this.showCheckBox) && (this.isPopupOpen && target.classList.contains(CHIP_CLOSE) ||
|
|
5879
6029
|
(this.isPopupOpen && (target.classList.contains(CHECKALLPARENT) || target.classList.contains(ALLTEXT)
|
|
5880
6030
|
|| target.classList.contains(CHECKBOXFRAME)))))) {
|
|
5881
6031
|
this.isDocumentClick = false;
|
|
5882
6032
|
e.preventDefault();
|
|
5883
6033
|
}
|
|
5884
|
-
else if (!this.inputWrapper.contains(target) && this.inputFocus) {
|
|
6034
|
+
else if (!this.inputWrapper.contains(target) && this.inputFocus && !isFilter) {
|
|
5885
6035
|
this.focusOut(e);
|
|
5886
6036
|
}
|
|
5887
6037
|
};
|
|
@@ -5914,6 +6064,9 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
5914
6064
|
}
|
|
5915
6065
|
var eventArgs = { data: args.data };
|
|
5916
6066
|
this.trigger('dataBound', eventArgs);
|
|
6067
|
+
if (this.filterObj === null) {
|
|
6068
|
+
this.isFilteredData = false;
|
|
6069
|
+
}
|
|
5917
6070
|
if (this.isFilteredData) {
|
|
5918
6071
|
this.treeObj.expandAll();
|
|
5919
6072
|
}
|
|
@@ -5981,7 +6134,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
5981
6134
|
dataSource: fields.dataSource, value: fields.value, text: fields.text, parentValue: fields.parentValue,
|
|
5982
6135
|
child: this.cloneChildField(fields.child), hasChildren: fields.hasChildren, expanded: fields.expanded,
|
|
5983
6136
|
iconCss: fields.iconCss, imageUrl: fields.imageUrl, htmlAttributes: fields.htmlAttributes, query: fields.query,
|
|
5984
|
-
selected: fields.selected, tableName: fields.tableName, tooltip: fields.tooltip
|
|
6137
|
+
selected: fields.selected, selectable: fields.selectable, tableName: fields.tableName, tooltip: fields.tooltip
|
|
5985
6138
|
};
|
|
5986
6139
|
return clonedField;
|
|
5987
6140
|
};
|
|
@@ -5994,7 +6147,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
5994
6147
|
dataSource: fields.dataSource, value: fields.value, text: fields.text, parentValue: fields.parentValue,
|
|
5995
6148
|
child: (fields.child ? this.cloneChildField(fields.child) : null), hasChildren: fields.hasChildren,
|
|
5996
6149
|
expanded: fields.expanded, iconCss: fields.iconCss, imageUrl: fields.imageUrl, htmlAttributes: fields.htmlAttributes,
|
|
5997
|
-
query: fields.query, selected: fields.selected, tableName: fields.tableName, tooltip: fields.tooltip
|
|
6150
|
+
query: fields.query, selected: fields.selected, selectable: fields.selectable, tableName: fields.tableName, tooltip: fields.tooltip
|
|
5998
6151
|
};
|
|
5999
6152
|
return clonedField;
|
|
6000
6153
|
}
|
|
@@ -6004,7 +6157,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
6004
6157
|
dataSource: fields.dataSource, id: fields.value, text: fields.text, parentID: fields.parentValue,
|
|
6005
6158
|
child: this.getTreeChildren(fields.child), hasChildren: fields.hasChildren, expanded: fields.expanded,
|
|
6006
6159
|
iconCss: fields.iconCss, imageUrl: fields.imageUrl, isChecked: fields.selected,
|
|
6007
|
-
htmlAttributes: fields.htmlAttributes, query: fields.query, selected: fields.selected,
|
|
6160
|
+
htmlAttributes: fields.htmlAttributes, query: fields.query, selectable: fields.selectable, selected: fields.selected,
|
|
6008
6161
|
tableName: fields.tableName, tooltip: fields.tooltip
|
|
6009
6162
|
};
|
|
6010
6163
|
return treeFields;
|
|
@@ -6042,7 +6195,8 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
6042
6195
|
}
|
|
6043
6196
|
return 2;
|
|
6044
6197
|
}
|
|
6045
|
-
|
|
6198
|
+
if (isNullOrUndefined(this.fields.dataSource))
|
|
6199
|
+
this.fields.dataSource = [];
|
|
6046
6200
|
for (var i = 0, len = this.fields.dataSource.length; i < len; i++) {
|
|
6047
6201
|
if ((typeof field.child === 'string') && !isNullOrUndefined(getValue(field.child, this.fields.dataSource[i]))) {
|
|
6048
6202
|
return 2;
|
|
@@ -6181,13 +6335,14 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
6181
6335
|
var nodes = this.treeObj.element.querySelectorAll('li');
|
|
6182
6336
|
var checkedNodes = this.treeObj.element.querySelectorAll('li .e-checkbox-wrapper[aria-checked=true]');
|
|
6183
6337
|
var wrap = closest(this.checkBoxElement, '.' + CHECKBOXWRAP);
|
|
6184
|
-
if (wrap && args.action === 'uncheck') {
|
|
6338
|
+
if (wrap && args.action === 'uncheck' && (args.isInteracted || checkedNodes.length === 0)) {
|
|
6185
6339
|
this.isReverseUpdate = true;
|
|
6186
6340
|
this.changeState(wrap, 'uncheck');
|
|
6187
6341
|
this.isReverseUpdate = false;
|
|
6188
6342
|
}
|
|
6189
|
-
else if (wrap && args.action === 'check' && checkedNodes.length === nodes.length) {
|
|
6343
|
+
else if (wrap && args.action === 'check' && checkedNodes.length === nodes.length && this.isCheckAllCalled) {
|
|
6190
6344
|
this.isReverseUpdate = true;
|
|
6345
|
+
this.isCheckAllCalled = false;
|
|
6191
6346
|
this.changeState(wrap, 'check');
|
|
6192
6347
|
this.isReverseUpdate = false;
|
|
6193
6348
|
}
|
|
@@ -6198,6 +6353,13 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
6198
6353
|
this.oldValue = this.value ? this.value.slice() : this.value;
|
|
6199
6354
|
}
|
|
6200
6355
|
};
|
|
6356
|
+
DropDownTree.prototype.onNodeExpanded = function (args) {
|
|
6357
|
+
if (this.hasTemplate && this.portals) {
|
|
6358
|
+
this.portals = [].concat(this.treeObj.portals);
|
|
6359
|
+
/* eslint-enable */
|
|
6360
|
+
this.renderReactTemplates();
|
|
6361
|
+
}
|
|
6362
|
+
};
|
|
6201
6363
|
DropDownTree.prototype.updateClearButton = function (state) {
|
|
6202
6364
|
if (state) {
|
|
6203
6365
|
if (!this.inputWrapper.contains(this.overAllClear)) {
|
|
@@ -6498,7 +6660,12 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
6498
6660
|
});
|
|
6499
6661
|
var chipContent = this.createElement('span', { className: CHIP_CONTENT });
|
|
6500
6662
|
var chipClose = this.createElement('span', { className: CHIP_CLOSE + ' ' + ICONS });
|
|
6501
|
-
|
|
6663
|
+
if (this.enableHtmlSanitizer) {
|
|
6664
|
+
chipContent.innerText = text;
|
|
6665
|
+
}
|
|
6666
|
+
else {
|
|
6667
|
+
chipContent.innerHTML = text;
|
|
6668
|
+
}
|
|
6502
6669
|
chip.appendChild(chipContent);
|
|
6503
6670
|
this.chipCollection.appendChild(chip);
|
|
6504
6671
|
if (this.showClearButton) {
|
|
@@ -6694,6 +6861,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
6694
6861
|
DropDownTree.prototype.selectAllItems = function (state) {
|
|
6695
6862
|
if (this.showCheckBox) {
|
|
6696
6863
|
if (state) {
|
|
6864
|
+
this.isCheckAllCalled = true;
|
|
6697
6865
|
this.treeObj.checkAll();
|
|
6698
6866
|
}
|
|
6699
6867
|
else {
|
|
@@ -6788,8 +6956,6 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
6788
6956
|
}
|
|
6789
6957
|
else {
|
|
6790
6958
|
this.noRecord = this.createElement('div');
|
|
6791
|
-
addClass([this.noRecord], NODATACONTAINER);
|
|
6792
|
-
prepend([this.noRecord], this.popupDiv);
|
|
6793
6959
|
}
|
|
6794
6960
|
if (this.noRecordsTemplate !== 'No Records Found' || this.actionFailureTemplate !== 'The Request Failed') {
|
|
6795
6961
|
var template = actionFailure ? this.actionFailureTemplate : this.noRecordsTemplate;
|
|
@@ -6801,6 +6967,8 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
6801
6967
|
if (tempArr) {
|
|
6802
6968
|
tempArr = Array.prototype.slice.call(tempArr);
|
|
6803
6969
|
append(tempArr, this.noRecord);
|
|
6970
|
+
addClass([this.noRecord], NODATACONTAINER);
|
|
6971
|
+
prepend([this.noRecord], this.popupDiv);
|
|
6804
6972
|
}
|
|
6805
6973
|
}
|
|
6806
6974
|
else {
|
|
@@ -6809,6 +6977,8 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
6809
6977
|
this.l10n = new L10n(this.getLocaleName(), l10nLocale, this.locale);
|
|
6810
6978
|
this.noRecord.innerHTML = actionFailure ?
|
|
6811
6979
|
this.l10n.getConstant('actionFailureTemplate') : this.l10n.getConstant('noRecordsTemplate');
|
|
6980
|
+
addClass([this.noRecord], NODATACONTAINER);
|
|
6981
|
+
prepend([this.noRecord], this.popupDiv);
|
|
6812
6982
|
}
|
|
6813
6983
|
};
|
|
6814
6984
|
DropDownTree.prototype.updateRecordTemplate = function (action) {
|
|
@@ -7320,6 +7490,9 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
7320
7490
|
__decorate$2([
|
|
7321
7491
|
Property(false)
|
|
7322
7492
|
], DropDownTree.prototype, "showCheckBox", void 0);
|
|
7493
|
+
__decorate$2([
|
|
7494
|
+
Property(false)
|
|
7495
|
+
], DropDownTree.prototype, "enableHtmlSanitizer", void 0);
|
|
7323
7496
|
__decorate$2([
|
|
7324
7497
|
Property(true)
|
|
7325
7498
|
], DropDownTree.prototype, "showClearButton", void 0);
|
|
@@ -7573,15 +7746,12 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
7573
7746
|
};
|
|
7574
7747
|
ComboBox.prototype.getAriaAttributes = function () {
|
|
7575
7748
|
var ariaAttributes = {
|
|
7576
|
-
'aria-owns': this.element.id + '_options',
|
|
7577
7749
|
'role': 'combobox',
|
|
7578
7750
|
'aria-autocomplete': 'both',
|
|
7579
7751
|
'aria-labelledby': this.hiddenElement.id,
|
|
7580
|
-
'aria-hasPopup': 'true',
|
|
7581
7752
|
'aria-expanded': 'false',
|
|
7582
7753
|
'aria-readonly': this.readonly.toString(),
|
|
7583
7754
|
'autocomplete': 'off',
|
|
7584
|
-
'autocorrect': 'off',
|
|
7585
7755
|
'autocapitalize': 'off',
|
|
7586
7756
|
'spellcheck': 'false'
|
|
7587
7757
|
};
|
|
@@ -7624,7 +7794,7 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
7624
7794
|
};
|
|
7625
7795
|
ComboBox.prototype.getFocusElement = function () {
|
|
7626
7796
|
var dataItem = this.isSelectCustom ? { text: '' } : this.getItemData();
|
|
7627
|
-
var selected = this.list.querySelector('.' + dropDownListClasses.selected);
|
|
7797
|
+
var selected = !isNullOrUndefined(this.list) ? this.list.querySelector('.' + dropDownListClasses.selected) : this.list;
|
|
7628
7798
|
var isSelected = dataItem.text === this.inputElement.value && !isNullOrUndefined(selected);
|
|
7629
7799
|
if (isSelected) {
|
|
7630
7800
|
return selected;
|
|
@@ -7632,7 +7802,9 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
7632
7802
|
if ((Browser.isDevice && !this.isDropDownClick || !Browser.isDevice) &&
|
|
7633
7803
|
!isNullOrUndefined(this.liCollections) && this.liCollections.length > 0) {
|
|
7634
7804
|
var inputValue = this.inputElement.value;
|
|
7635
|
-
var
|
|
7805
|
+
var dataSource = this.sortedData;
|
|
7806
|
+
var type = this.typeOfData(dataSource).typeof;
|
|
7807
|
+
var activeItem = Search(inputValue, this.liCollections, this.filterType, true, dataSource, this.fields, type);
|
|
7636
7808
|
var activeElement = activeItem.item;
|
|
7637
7809
|
if (!isNullOrUndefined(activeElement)) {
|
|
7638
7810
|
var count = this.getIndexByValue(activeElement.getAttribute('data-value')) - 1;
|
|
@@ -7673,7 +7845,7 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
7673
7845
|
this.itemData = this.getDataByValue(this.value);
|
|
7674
7846
|
var dataItem = this.getItemData();
|
|
7675
7847
|
if (!(this.allowCustom && isNullOrUndefined(dataItem.value) && isNullOrUndefined(dataItem.text))) {
|
|
7676
|
-
this.setProperties({ 'value': dataItem.value
|
|
7848
|
+
this.setProperties({ 'value': dataItem.value }, !this.allowCustom);
|
|
7677
7849
|
}
|
|
7678
7850
|
};
|
|
7679
7851
|
/**
|
|
@@ -7782,9 +7954,11 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
7782
7954
|
}
|
|
7783
7955
|
else if (this.inputElement.value === '') {
|
|
7784
7956
|
this.activeIndex = null;
|
|
7785
|
-
this.list
|
|
7786
|
-
|
|
7787
|
-
|
|
7957
|
+
if (!isNullOrUndefined(this.list)) {
|
|
7958
|
+
this.list.scrollTop = 0;
|
|
7959
|
+
var focusItem = this.list.querySelector('.' + dropDownListClasses.li);
|
|
7960
|
+
this.setHoverList(focusItem);
|
|
7961
|
+
}
|
|
7788
7962
|
}
|
|
7789
7963
|
else {
|
|
7790
7964
|
this.activeIndex = null;
|
|
@@ -7795,7 +7969,7 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
7795
7969
|
}
|
|
7796
7970
|
};
|
|
7797
7971
|
ComboBox.prototype.incrementalSearch = function (e) {
|
|
7798
|
-
this.showPopup();
|
|
7972
|
+
this.showPopup(e);
|
|
7799
7973
|
if (!isNullOrUndefined(this.listData)) {
|
|
7800
7974
|
this.inlineSearch(e);
|
|
7801
7975
|
e.preventDefault();
|
|
@@ -7881,6 +8055,7 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
7881
8055
|
this.preventFocus = false;
|
|
7882
8056
|
}
|
|
7883
8057
|
this.onFocus(e);
|
|
8058
|
+
Input.calculateWidth(this.inputElement, this.inputWrapper.container);
|
|
7884
8059
|
};
|
|
7885
8060
|
ComboBox.prototype.dropDownClick = function (e) {
|
|
7886
8061
|
e.preventDefault();
|
|
@@ -8032,7 +8207,7 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
8032
8207
|
* Adds a new item to the combobox popup list. By default, new item appends to the list as the last item,
|
|
8033
8208
|
* but you can insert based on the index parameter.
|
|
8034
8209
|
*
|
|
8035
|
-
* @param
|
|
8210
|
+
* @param { Object[] } items - Specifies an array of JSON data or a JSON data.
|
|
8036
8211
|
* @param { number } itemIndex - Specifies the index to place the newly added item in the popup list.
|
|
8037
8212
|
* @returns {void}
|
|
8038
8213
|
* @deprecated
|
|
@@ -8043,9 +8218,9 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
8043
8218
|
/**
|
|
8044
8219
|
* To filter the data from given data source by using query
|
|
8045
8220
|
*
|
|
8046
|
-
* @param
|
|
8047
|
-
* @param
|
|
8048
|
-
* @param
|
|
8221
|
+
* @param {Object[] | DataManager } dataSource - Set the data source to filter.
|
|
8222
|
+
* @param {Query} query - Specify the query to filter the data.
|
|
8223
|
+
* @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
|
|
8049
8224
|
* @returns {void}
|
|
8050
8225
|
* @deprecated
|
|
8051
8226
|
*/
|
|
@@ -8058,8 +8233,8 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
8058
8233
|
* @returns {void}
|
|
8059
8234
|
* @deprecated
|
|
8060
8235
|
*/
|
|
8061
|
-
ComboBox.prototype.showPopup = function () {
|
|
8062
|
-
_super.prototype.showPopup.call(this);
|
|
8236
|
+
ComboBox.prototype.showPopup = function (e) {
|
|
8237
|
+
_super.prototype.showPopup.call(this, e);
|
|
8063
8238
|
};
|
|
8064
8239
|
/* eslint-disable valid-jsdoc, jsdoc/require-param */
|
|
8065
8240
|
/**
|
|
@@ -8082,7 +8257,7 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
8082
8257
|
this.removeFillSelection();
|
|
8083
8258
|
}
|
|
8084
8259
|
var dataItem = this.isSelectCustom ? { text: '' } : this.getItemData();
|
|
8085
|
-
var selected = this.list.querySelector('.' + dropDownListClasses.selected);
|
|
8260
|
+
var selected = !isNullOrUndefined(this.list) ? this.list.querySelector('.' + dropDownListClasses.selected) : null;
|
|
8086
8261
|
if (this.inputElement && dataItem.text === this.inputElement.value && !isNullOrUndefined(selected)) {
|
|
8087
8262
|
if (this.isSelected) {
|
|
8088
8263
|
this.onChangeEvent(e);
|
|
@@ -8092,10 +8267,12 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
8092
8267
|
return;
|
|
8093
8268
|
}
|
|
8094
8269
|
if (this.getModuleName() === 'combobox' && this.inputElement.value.trim() !== '') {
|
|
8095
|
-
var
|
|
8270
|
+
var dataSource = this.sortedData;
|
|
8271
|
+
var type = this.typeOfData(dataSource).typeof;
|
|
8272
|
+
var searchItem = Search(this.inputElement.value, this.liCollections, 'Equal', true, dataSource, this.fields, type);
|
|
8096
8273
|
this.selectedLI = searchItem.item;
|
|
8097
8274
|
if (isNullOrUndefined(searchItem.index)) {
|
|
8098
|
-
searchItem.index = Search(this.inputElement.value, this.liCollections, 'StartsWith', true).index;
|
|
8275
|
+
searchItem.index = Search(this.inputElement.value, this.liCollections, 'StartsWith', true, dataSource, this.fields, type).index;
|
|
8099
8276
|
}
|
|
8100
8277
|
this.activeIndex = searchItem.index;
|
|
8101
8278
|
if (!isNullOrUndefined(this.selectedLI)) {
|
|
@@ -8296,10 +8473,10 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8296
8473
|
* @private
|
|
8297
8474
|
*/
|
|
8298
8475
|
function AutoComplete(options, element) {
|
|
8299
|
-
var
|
|
8300
|
-
|
|
8301
|
-
|
|
8302
|
-
return
|
|
8476
|
+
var _this_1 = _super.call(this, options, element) || this;
|
|
8477
|
+
_this_1.isFiltered = false;
|
|
8478
|
+
_this_1.searchList = false;
|
|
8479
|
+
return _this_1;
|
|
8303
8480
|
}
|
|
8304
8481
|
/**
|
|
8305
8482
|
* Initialize the event handler
|
|
@@ -8347,17 +8524,17 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8347
8524
|
return filterQuery;
|
|
8348
8525
|
};
|
|
8349
8526
|
AutoComplete.prototype.searchLists = function (e) {
|
|
8350
|
-
var
|
|
8527
|
+
var _this_1 = this;
|
|
8351
8528
|
this.isTyped = true;
|
|
8352
8529
|
this.isDataFetched = this.isSelectCustom = false;
|
|
8353
8530
|
if (isNullOrUndefined(this.list)) {
|
|
8354
|
-
_super.prototype.renderList.call(this, true);
|
|
8531
|
+
_super.prototype.renderList.call(this, e, true);
|
|
8355
8532
|
}
|
|
8356
8533
|
this.queryString = this.filterInput.value;
|
|
8357
8534
|
if (e.type !== 'mousedown' && (e.keyCode === 40 || e.keyCode === 38)) {
|
|
8358
8535
|
this.queryString = this.queryString === '' ? null : this.queryString;
|
|
8359
8536
|
this.beforePopupOpen = true;
|
|
8360
|
-
this.resetList(this.dataSource, this.fields);
|
|
8537
|
+
this.resetList(this.dataSource, this.fields, null, e);
|
|
8361
8538
|
return;
|
|
8362
8539
|
}
|
|
8363
8540
|
this.isSelected = false;
|
|
@@ -8369,24 +8546,24 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8369
8546
|
if (eventArgs.cancel) {
|
|
8370
8547
|
return;
|
|
8371
8548
|
}
|
|
8372
|
-
|
|
8373
|
-
|
|
8549
|
+
_this_1.isFiltered = true;
|
|
8550
|
+
_this_1.filterAction(dataSource, query, fields);
|
|
8374
8551
|
},
|
|
8375
8552
|
cancel: false
|
|
8376
8553
|
};
|
|
8377
8554
|
this.trigger('filtering', eventArgs, function (eventArgs) {
|
|
8378
|
-
if (!eventArgs.cancel && !
|
|
8379
|
-
|
|
8380
|
-
|
|
8555
|
+
if (!eventArgs.cancel && !_this_1.isFiltered && !eventArgs.preventDefaultAction) {
|
|
8556
|
+
_this_1.searchList = true;
|
|
8557
|
+
_this_1.filterAction(_this_1.dataSource, null, _this_1.fields, e);
|
|
8381
8558
|
}
|
|
8382
8559
|
});
|
|
8383
8560
|
};
|
|
8384
8561
|
/**
|
|
8385
8562
|
* To filter the data from given data source by using query
|
|
8386
8563
|
*
|
|
8387
|
-
* @param
|
|
8388
|
-
* @param
|
|
8389
|
-
* @param
|
|
8564
|
+
* @param {Object[] | DataManager } dataSource - Set the data source to filter.
|
|
8565
|
+
* @param {Query} query - Specify the query to filter the data.
|
|
8566
|
+
* @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
|
|
8390
8567
|
* @returns {void}
|
|
8391
8568
|
* @deprecated
|
|
8392
8569
|
*/
|
|
@@ -8394,13 +8571,13 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8394
8571
|
this.isFiltered = true;
|
|
8395
8572
|
this.filterAction(dataSource, query, fields);
|
|
8396
8573
|
};
|
|
8397
|
-
AutoComplete.prototype.filterAction = function (dataSource, query, fields) {
|
|
8574
|
+
AutoComplete.prototype.filterAction = function (dataSource, query, fields, e) {
|
|
8398
8575
|
this.beforePopupOpen = true;
|
|
8399
8576
|
if (this.queryString !== '' && (this.queryString.length >= this.minLength)) {
|
|
8400
|
-
this.resetList(dataSource, fields, query);
|
|
8577
|
+
this.resetList(dataSource, fields, query, e);
|
|
8401
8578
|
}
|
|
8402
8579
|
else {
|
|
8403
|
-
this.hidePopup();
|
|
8580
|
+
this.hidePopup(e);
|
|
8404
8581
|
this.beforePopupOpen = false;
|
|
8405
8582
|
}
|
|
8406
8583
|
this.renderReactTemplates();
|
|
@@ -8426,7 +8603,9 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8426
8603
|
AutoComplete.prototype.postBackAction = function () {
|
|
8427
8604
|
if (this.autofill && !isNullOrUndefined(this.liCollections[0]) && this.searchList) {
|
|
8428
8605
|
var items = [this.liCollections[0]];
|
|
8429
|
-
var
|
|
8606
|
+
var dataSource = this.listData;
|
|
8607
|
+
var type = this.typeOfData(dataSource).typeof;
|
|
8608
|
+
var searchItem = Search(this.inputElement.value, items, 'StartsWith', this.ignoreCase, dataSource, this.fields, type);
|
|
8430
8609
|
this.searchList = false;
|
|
8431
8610
|
if (!isNullOrUndefined(searchItem.item)) {
|
|
8432
8611
|
_super.prototype.setAutoFill.call(this, this.liCollections[0], true);
|
|
@@ -8435,6 +8614,7 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8435
8614
|
};
|
|
8436
8615
|
AutoComplete.prototype.setSelection = function (li, e) {
|
|
8437
8616
|
if (!this.isValidLI(li)) {
|
|
8617
|
+
this.selectedLI = li;
|
|
8438
8618
|
return;
|
|
8439
8619
|
}
|
|
8440
8620
|
if (!isNullOrUndefined(e) && e.type === 'keydown' && e.action !== 'enter'
|
|
@@ -8450,25 +8630,24 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8450
8630
|
e.action === 'home' || e.action === 'end' || e.action === 'pageUp' || e.action === 'pageDown');
|
|
8451
8631
|
_super.prototype.setAutoFill.call(this, li, isKeyNavigate);
|
|
8452
8632
|
}
|
|
8453
|
-
attributes(this.inputElement, { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });
|
|
8454
8633
|
}
|
|
8455
8634
|
else {
|
|
8456
8635
|
_super.prototype.setSelection.call(this, li, e);
|
|
8457
8636
|
}
|
|
8458
8637
|
};
|
|
8459
8638
|
AutoComplete.prototype.listOption = function (dataSource, fieldsSettings) {
|
|
8460
|
-
var
|
|
8639
|
+
var _this_1 = this;
|
|
8461
8640
|
var fields = _super.prototype.listOption.call(this, dataSource, fieldsSettings);
|
|
8462
8641
|
if (isNullOrUndefined(fields.itemCreated)) {
|
|
8463
8642
|
fields.itemCreated = function (e) {
|
|
8464
|
-
if (
|
|
8465
|
-
if (
|
|
8643
|
+
if (_this_1.highlight) {
|
|
8644
|
+
if (_this_1.element.tagName === _this_1.getNgDirective() && _this_1.itemTemplate) {
|
|
8466
8645
|
setTimeout(function () {
|
|
8467
|
-
highlightSearch(e.item,
|
|
8646
|
+
highlightSearch(e.item, _this_1.queryString, _this_1.ignoreCase, _this_1.filterType);
|
|
8468
8647
|
}, 0);
|
|
8469
8648
|
}
|
|
8470
8649
|
else {
|
|
8471
|
-
highlightSearch(e.item,
|
|
8650
|
+
highlightSearch(e.item, _this_1.queryString, _this_1.ignoreCase, _this_1.filterType);
|
|
8472
8651
|
}
|
|
8473
8652
|
}
|
|
8474
8653
|
};
|
|
@@ -8476,10 +8655,10 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8476
8655
|
else {
|
|
8477
8656
|
var itemCreated_1 = fields.itemCreated;
|
|
8478
8657
|
fields.itemCreated = function (e) {
|
|
8479
|
-
if (
|
|
8480
|
-
highlightSearch(e.item,
|
|
8658
|
+
if (_this_1.highlight) {
|
|
8659
|
+
highlightSearch(e.item, _this_1.queryString, _this_1.ignoreCase, _this_1.filterType);
|
|
8481
8660
|
}
|
|
8482
|
-
itemCreated_1.apply(
|
|
8661
|
+
itemCreated_1.apply(_this_1, [e]);
|
|
8483
8662
|
};
|
|
8484
8663
|
}
|
|
8485
8664
|
return fields;
|
|
@@ -8487,9 +8666,9 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8487
8666
|
AutoComplete.prototype.isFiltering = function () {
|
|
8488
8667
|
return true;
|
|
8489
8668
|
};
|
|
8490
|
-
AutoComplete.prototype.renderPopup = function () {
|
|
8669
|
+
AutoComplete.prototype.renderPopup = function (e) {
|
|
8491
8670
|
this.list.scrollTop = 0;
|
|
8492
|
-
_super.prototype.renderPopup.call(this);
|
|
8671
|
+
_super.prototype.renderPopup.call(this, e);
|
|
8493
8672
|
};
|
|
8494
8673
|
AutoComplete.prototype.isEditTextBox = function () {
|
|
8495
8674
|
return true && this.inputElement.value.trim() !== '';
|
|
@@ -8501,13 +8680,37 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8501
8680
|
AutoComplete.prototype.isSelectFocusItem = function (element) {
|
|
8502
8681
|
return false;
|
|
8503
8682
|
};
|
|
8683
|
+
AutoComplete.prototype.setInputValue = function (newProp, oldProp) {
|
|
8684
|
+
var oldValue = oldProp && oldProp.text ? oldProp.text : oldProp ? oldProp.value : oldProp;
|
|
8685
|
+
var value = newProp && newProp.text ? newProp.text : newProp && newProp.value ? newProp.value : this.value;
|
|
8686
|
+
if (value && this.typedString === '' && !this.allowCustom && !(this.dataSource instanceof DataManager)) {
|
|
8687
|
+
var checkFields_1_1 = this.typeOfData(this.dataSource).typeof === 'string' ? '' : this.fields.value;
|
|
8688
|
+
var listLength_1 = this.getItems().length;
|
|
8689
|
+
var query = new Query();
|
|
8690
|
+
var _this_2 = this;
|
|
8691
|
+
new DataManager(this.dataSource).executeQuery(query.where(new Predicate(checkFields_1_1, 'equal', value)))
|
|
8692
|
+
.then(function (e) {
|
|
8693
|
+
if (e.result.length > 0) {
|
|
8694
|
+
_this_2.value = checkFields_1_1 !== '' ? e.result[0][_this_2.fields.value].toString() : e.result[0].toString();
|
|
8695
|
+
_this_2.addItem(e.result, listLength_1);
|
|
8696
|
+
_this_2.updateValues();
|
|
8697
|
+
}
|
|
8698
|
+
else {
|
|
8699
|
+
newProp && newProp.text ? _this_2.setOldText(oldValue) : newProp && newProp.value ? _this_2.setOldValue(oldValue) : _this_2.updateValues();
|
|
8700
|
+
}
|
|
8701
|
+
});
|
|
8702
|
+
}
|
|
8703
|
+
else if (newProp) {
|
|
8704
|
+
newProp.text ? this.setOldText(oldValue) : this.setOldValue(oldValue);
|
|
8705
|
+
}
|
|
8706
|
+
};
|
|
8504
8707
|
/**
|
|
8505
8708
|
* Search the entered text and show it in the suggestion list if available.
|
|
8506
8709
|
*
|
|
8507
8710
|
* @returns {void}
|
|
8508
8711
|
* @deprecated
|
|
8509
8712
|
*/
|
|
8510
|
-
AutoComplete.prototype.showPopup = function () {
|
|
8713
|
+
AutoComplete.prototype.showPopup = function (e) {
|
|
8511
8714
|
if (!this.enabled) {
|
|
8512
8715
|
return;
|
|
8513
8716
|
}
|
|
@@ -8518,10 +8721,10 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8518
8721
|
this.beforePopupOpen = true;
|
|
8519
8722
|
this.preventAutoFill = true;
|
|
8520
8723
|
if (isNullOrUndefined(this.list)) {
|
|
8521
|
-
this.renderList();
|
|
8724
|
+
this.renderList(e);
|
|
8522
8725
|
}
|
|
8523
8726
|
else {
|
|
8524
|
-
this.resetList(this.dataSource, this.fields);
|
|
8727
|
+
this.resetList(this.dataSource, this.fields, null, e);
|
|
8525
8728
|
}
|
|
8526
8729
|
};
|
|
8527
8730
|
/**
|
|
@@ -8552,6 +8755,10 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8552
8755
|
if (this.showPopupButton) {
|
|
8553
8756
|
var button = Input.appendSpan(dropDownListClasses.icon, this.inputWrapper.container, this.createElement);
|
|
8554
8757
|
this.inputWrapper.buttons[0] = button;
|
|
8758
|
+
Input.calculateWidth(this.inputElement, this.inputWrapper.container);
|
|
8759
|
+
if (!isNullOrUndefined(this.inputWrapper.buttons[0]) && !isNullOrUndefined(this.inputWrapper.container.getElementsByClassName('e-float-text-overflow')[0]) && this.floatLabelType !== 'Never') {
|
|
8760
|
+
this.inputWrapper.container.getElementsByClassName('e-float-text-overflow')[0].classList.add('e-icon');
|
|
8761
|
+
}
|
|
8555
8762
|
if (this.inputWrapper && this.inputWrapper.buttons && this.inputWrapper.buttons[0]) {
|
|
8556
8763
|
EventHandler.add(this.inputWrapper.buttons[0], 'click', this.dropDownClick, this);
|
|
8557
8764
|
}
|
|
@@ -8680,9 +8887,11 @@ var LABELBOTTOM = 'e-label-bottom';
|
|
|
8680
8887
|
function createFloatLabel(overAllWrapper, searchWrapper, element, inputElement, value, floatLabelType, placeholder) {
|
|
8681
8888
|
var floatLinelement = createElement('span', { className: FLOATLINE });
|
|
8682
8889
|
var floatLabelElement = createElement('label', { className: FLOATTEXT });
|
|
8890
|
+
var id = element.getAttribute('id') ? element.getAttribute('id') : getUniqueID('ej2_multiselect');
|
|
8891
|
+
element.id = id;
|
|
8683
8892
|
if (!isNullOrUndefined(element.id) && element.id !== '') {
|
|
8684
8893
|
floatLabelElement.id = 'label_' + element.id.replace(/ /g, '_');
|
|
8685
|
-
attributes(
|
|
8894
|
+
attributes(inputElement, { 'aria-labelledby': floatLabelElement.id });
|
|
8686
8895
|
}
|
|
8687
8896
|
if (!isNullOrUndefined(inputElement.placeholder) && inputElement.placeholder !== '') {
|
|
8688
8897
|
floatLabelElement.innerText = encodePlaceholder(inputElement.placeholder);
|
|
@@ -8900,6 +9109,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
8900
9109
|
_this.isValidKey = false;
|
|
8901
9110
|
_this.selectAllEventData = [];
|
|
8902
9111
|
_this.selectAllEventEle = [];
|
|
9112
|
+
_this.resetMainList = null;
|
|
9113
|
+
_this.resetFilteredData = false;
|
|
8903
9114
|
_this.scrollFocusStatus = false;
|
|
8904
9115
|
_this.keyDownStatus = false;
|
|
8905
9116
|
return _this;
|
|
@@ -8942,7 +9153,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
8942
9153
|
var htmlAttr = _a[_i];
|
|
8943
9154
|
switch (htmlAttr) {
|
|
8944
9155
|
case 'class': {
|
|
8945
|
-
var updatedClassValue = (this.htmlAttributes[htmlAttr].replace(/\s+/g, ' ')).trim();
|
|
9156
|
+
var updatedClassValue = (this.htmlAttributes["" + htmlAttr].replace(/\s+/g, ' ')).trim();
|
|
8946
9157
|
if (updatedClassValue !== '') {
|
|
8947
9158
|
addClass([this.overAllWrapper], updatedClassValue.split(' '));
|
|
8948
9159
|
addClass([this.popupWrapper], updatedClassValue.split(' '));
|
|
@@ -8954,7 +9165,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
8954
9165
|
break;
|
|
8955
9166
|
case 'placeholder':
|
|
8956
9167
|
if (!this.placeholder) {
|
|
8957
|
-
this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
|
|
9168
|
+
this.inputElement.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
|
|
8958
9169
|
this.setProperties({ placeholder: this.inputElement.placeholder }, true);
|
|
8959
9170
|
this.refreshPlaceHolder();
|
|
8960
9171
|
}
|
|
@@ -8964,16 +9175,16 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
8964
9175
|
var validateAttr = ['name', 'required', 'aria-required', 'form'];
|
|
8965
9176
|
var containerAttr = ['title', 'role', 'style', 'class'];
|
|
8966
9177
|
if (defaultAttr.indexOf(htmlAttr) > -1) {
|
|
8967
|
-
this.element.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
|
|
9178
|
+
this.element.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
|
|
8968
9179
|
}
|
|
8969
9180
|
else if (htmlAttr.indexOf('data') === 0 || validateAttr.indexOf(htmlAttr) > -1) {
|
|
8970
|
-
this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
|
|
9181
|
+
this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
|
|
8971
9182
|
}
|
|
8972
9183
|
else if (containerAttr.indexOf(htmlAttr) > -1) {
|
|
8973
|
-
this.overAllWrapper.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
|
|
9184
|
+
this.overAllWrapper.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
|
|
8974
9185
|
}
|
|
8975
|
-
else if (htmlAttr !== 'size') {
|
|
8976
|
-
this.inputElement.setAttribute(htmlAttr, this.htmlAttributes[htmlAttr]);
|
|
9186
|
+
else if (htmlAttr !== 'size' && !isNullOrUndefined(this.inputElement)) {
|
|
9187
|
+
this.inputElement.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
|
|
8977
9188
|
}
|
|
8978
9189
|
break;
|
|
8979
9190
|
}
|
|
@@ -8982,11 +9193,13 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
8982
9193
|
}
|
|
8983
9194
|
};
|
|
8984
9195
|
MultiSelect.prototype.updateReadonly = function (state) {
|
|
8985
|
-
if (
|
|
8986
|
-
this.
|
|
8987
|
-
|
|
8988
|
-
|
|
8989
|
-
|
|
9196
|
+
if (!isNullOrUndefined(this.inputElement)) {
|
|
9197
|
+
if (state || this.mode === 'CheckBox') {
|
|
9198
|
+
this.inputElement.setAttribute('readonly', 'true');
|
|
9199
|
+
}
|
|
9200
|
+
else {
|
|
9201
|
+
this.inputElement.removeAttribute('readonly');
|
|
9202
|
+
}
|
|
8990
9203
|
}
|
|
8991
9204
|
};
|
|
8992
9205
|
MultiSelect.prototype.updateClearButton = function (state) {
|
|
@@ -9023,7 +9236,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9023
9236
|
}
|
|
9024
9237
|
}
|
|
9025
9238
|
};
|
|
9026
|
-
MultiSelect.prototype.onPopupShown = function () {
|
|
9239
|
+
MultiSelect.prototype.onPopupShown = function (e) {
|
|
9027
9240
|
var _this = this;
|
|
9028
9241
|
if (Browser.isDevice && (this.mode === 'CheckBox' && this.allowFiltering)) {
|
|
9029
9242
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
@@ -9035,7 +9248,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9035
9248
|
history.pushState({}, '');
|
|
9036
9249
|
}
|
|
9037
9250
|
var animModel = { name: 'FadeIn', duration: 100 };
|
|
9038
|
-
var eventArgs = { popup: this.popupObj, cancel: false, animation: animModel };
|
|
9251
|
+
var eventArgs = { popup: this.popupObj, event: e, cancel: false, animation: animModel };
|
|
9039
9252
|
this.trigger('open', eventArgs, function (eventArgs) {
|
|
9040
9253
|
if (!eventArgs.cancel) {
|
|
9041
9254
|
_this.focusAtFirstListItem();
|
|
@@ -9049,7 +9262,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9049
9262
|
_this.refreshPopup();
|
|
9050
9263
|
_this.renderReactTemplates();
|
|
9051
9264
|
_this.popupObj.show(eventArgs.animation, (_this.zIndex === 1000) ? _this.element : null);
|
|
9052
|
-
attributes(_this.inputElement, { 'aria-expanded': 'true' });
|
|
9265
|
+
attributes(_this.inputElement, { 'aria-expanded': 'true', 'aria-owns': _this.inputElement.id + '_options' });
|
|
9266
|
+
_this.updateAriaActiveDescendant();
|
|
9053
9267
|
if (_this.isFirstClick) {
|
|
9054
9268
|
_this.loadTemplate();
|
|
9055
9269
|
}
|
|
@@ -9119,11 +9333,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9119
9333
|
MultiSelect.prototype.getAriaAttributes = function () {
|
|
9120
9334
|
var ariaAttributes = {
|
|
9121
9335
|
'aria-disabled': 'false',
|
|
9122
|
-
'
|
|
9123
|
-
'role': 'listbox',
|
|
9124
|
-
'aria-multiselectable': 'true',
|
|
9125
|
-
'aria-activedescendant': 'null',
|
|
9126
|
-
'aria-haspopup': 'true',
|
|
9336
|
+
'role': 'combobox',
|
|
9127
9337
|
'aria-expanded': 'false'
|
|
9128
9338
|
};
|
|
9129
9339
|
return ariaAttributes;
|
|
@@ -9132,8 +9342,10 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9132
9342
|
if (!isNullOrUndefined(this.ulElement)) {
|
|
9133
9343
|
attributes(this.ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
|
|
9134
9344
|
}
|
|
9135
|
-
var disableStatus = (this.inputElement.disabled) ? true : false;
|
|
9136
|
-
|
|
9345
|
+
var disableStatus = !isNullOrUndefined(this.inputElement) && (this.inputElement.disabled) ? true : false;
|
|
9346
|
+
if (!this.isPopupOpen() && !isNullOrUndefined(this.inputElement)) {
|
|
9347
|
+
attributes(this.inputElement, this.getAriaAttributes());
|
|
9348
|
+
}
|
|
9137
9349
|
if (disableStatus) {
|
|
9138
9350
|
attributes(this.inputElement, { 'aria-disabled': 'true' });
|
|
9139
9351
|
}
|
|
@@ -9201,13 +9413,23 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9201
9413
|
if (!isNullOrUndefined(this.value) && !this.allowCustomValue) {
|
|
9202
9414
|
for (var i = 0; i < this.value.length; i++) {
|
|
9203
9415
|
var checkEle = this.findListElement(((this.allowFiltering && !isNullOrUndefined(this.mainList)) ? this.mainList : ulElement), 'li', 'data-value', proxy.value[i]);
|
|
9204
|
-
if (!checkEle) {
|
|
9416
|
+
if (!checkEle && !(this.dataSource instanceof DataManager)) {
|
|
9205
9417
|
this.value.splice(i, 1);
|
|
9206
9418
|
i -= 1;
|
|
9207
9419
|
}
|
|
9208
9420
|
}
|
|
9209
9421
|
}
|
|
9210
|
-
|
|
9422
|
+
var valuecheck = [];
|
|
9423
|
+
if (!isNullOrUndefined(this.value) && !this.allowCustomValue) {
|
|
9424
|
+
valuecheck = this.presentItemValue(this.ulElement);
|
|
9425
|
+
}
|
|
9426
|
+
if (valuecheck.length > 0 && this.dataSource instanceof DataManager && !isNullOrUndefined(this.value)
|
|
9427
|
+
&& this.listData != null) {
|
|
9428
|
+
this.addNonPresentItems(valuecheck, this.ulElement, this.listData);
|
|
9429
|
+
}
|
|
9430
|
+
else {
|
|
9431
|
+
this.updateActionList(ulElement, list, e);
|
|
9432
|
+
}
|
|
9211
9433
|
if (this.dataSource instanceof DataManager && this.mode === 'CheckBox' && this.allowFiltering) {
|
|
9212
9434
|
this.removeFocus();
|
|
9213
9435
|
}
|
|
@@ -9231,7 +9453,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9231
9453
|
this.checkForCustomValue(this.tempQuery, this.fields);
|
|
9232
9454
|
return;
|
|
9233
9455
|
}
|
|
9234
|
-
if (this.value && this.value.length && ((this.mode !== 'CheckBox' && this.inputElement.value.trim() !== '') ||
|
|
9456
|
+
if (this.value && this.value.length && ((this.mode !== 'CheckBox' && !isNullOrUndefined(this.inputElement) && this.inputElement.value.trim() !== '') ||
|
|
9235
9457
|
this.mode === 'CheckBox' || ((this.keyCode === 8 || this.keyCode === 46) && this.allowFiltering &&
|
|
9236
9458
|
this.allowCustomValue && this.dataSource instanceof DataManager && this.inputElement.value === ''))) {
|
|
9237
9459
|
this.refreshSelection();
|
|
@@ -9259,7 +9481,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9259
9481
|
this.renderPopup();
|
|
9260
9482
|
if (this.beforePopupOpen) {
|
|
9261
9483
|
this.beforePopupOpen = false;
|
|
9262
|
-
this.onPopupShown();
|
|
9484
|
+
this.onPopupShown(e);
|
|
9263
9485
|
}
|
|
9264
9486
|
};
|
|
9265
9487
|
MultiSelect.prototype.refreshSelection = function () {
|
|
@@ -9289,6 +9511,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9289
9511
|
dropDownBaseClasses.li + ':not(.' + HIDE_LIST + ')');
|
|
9290
9512
|
if (listEle.length > 0) {
|
|
9291
9513
|
addClass([listEle[0]], dropDownBaseClasses.focus);
|
|
9514
|
+
this.updateAriaActiveDescendant();
|
|
9292
9515
|
}
|
|
9293
9516
|
else {
|
|
9294
9517
|
//EJ2-57588 - for this task, we prevent the ul element cloning ( this.ulElement = this.ulElement.cloneNode ? <HTMLElement>this.ulElement.cloneNode(true) : this.ulElement;)
|
|
@@ -9300,8 +9523,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9300
9523
|
}
|
|
9301
9524
|
element.setAttribute('aria-selected', 'true');
|
|
9302
9525
|
if (this.mode === 'CheckBox' && element.classList.contains('e-active')) {
|
|
9303
|
-
var ariaValue = element.
|
|
9304
|
-
if (
|
|
9526
|
+
var ariaValue = element.getElementsByClassName('e-check').length;
|
|
9527
|
+
if (ariaValue === 0) {
|
|
9305
9528
|
var args = {
|
|
9306
9529
|
module: 'CheckBoxSelection',
|
|
9307
9530
|
enable: this.mode === 'CheckBox',
|
|
@@ -9425,9 +9648,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9425
9648
|
/**
|
|
9426
9649
|
* To filter the multiselect data from given data source by using query
|
|
9427
9650
|
*
|
|
9428
|
-
* @param
|
|
9429
|
-
* @param
|
|
9430
|
-
* @param
|
|
9651
|
+
* @param {Object[] | DataManager } dataSource - Set the data source to filter.
|
|
9652
|
+
* @param {Query} query - Specify the query to filter the data.
|
|
9653
|
+
* @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
|
|
9431
9654
|
* @returns {void}
|
|
9432
9655
|
*/
|
|
9433
9656
|
MultiSelect.prototype.filter = function (dataSource, query, fields) {
|
|
@@ -9515,7 +9738,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9515
9738
|
this.resetList(tempData, field, query);
|
|
9516
9739
|
}
|
|
9517
9740
|
else {
|
|
9518
|
-
var tempData =
|
|
9741
|
+
var tempData = JSON.parse(JSON.stringify(this.listData));
|
|
9742
|
+
tempData.splice(0, 0, this.inputElement.value);
|
|
9519
9743
|
tempData[0] = (typeof customData === 'number' && !isNaN(parseFloat(tempData[0]))) ?
|
|
9520
9744
|
parseFloat(tempData[0]) : tempData[0];
|
|
9521
9745
|
tempData[0] = (typeof customData === 'boolean') ?
|
|
@@ -9551,7 +9775,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9551
9775
|
}
|
|
9552
9776
|
if (!this.isPopupOpen() &&
|
|
9553
9777
|
(this.openOnClick || (this.showDropDownIcon && e.target && e.target.className === dropdownIcon))) {
|
|
9554
|
-
this.showPopup();
|
|
9778
|
+
this.showPopup(e);
|
|
9555
9779
|
}
|
|
9556
9780
|
else {
|
|
9557
9781
|
this.hidePopup(e);
|
|
@@ -9633,6 +9857,10 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9633
9857
|
}
|
|
9634
9858
|
}
|
|
9635
9859
|
this.updateDataList();
|
|
9860
|
+
if (this.resetMainList) {
|
|
9861
|
+
this.mainList = this.resetMainList;
|
|
9862
|
+
this.resetMainList = null;
|
|
9863
|
+
}
|
|
9636
9864
|
this.refreshListItems(null);
|
|
9637
9865
|
if (this.mode !== 'Box' && this.mode !== 'CheckBox') {
|
|
9638
9866
|
this.updateDelimView();
|
|
@@ -9660,6 +9888,11 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9660
9888
|
this.ulElement = this.mainList;
|
|
9661
9889
|
}
|
|
9662
9890
|
this.checkPlaceholderSize();
|
|
9891
|
+
Input.createSpanElement(this.overAllWrapper, this.createElement);
|
|
9892
|
+
Input.calculateWidth(this.inputElement, this.overAllWrapper);
|
|
9893
|
+
if (!isNullOrUndefined(this.overAllWrapper) && !isNullOrUndefined(this.overAllWrapper.getElementsByClassName('e-ddl-icon')[0] && this.overAllWrapper.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never')) {
|
|
9894
|
+
this.overAllWrapper.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
|
|
9895
|
+
}
|
|
9663
9896
|
};
|
|
9664
9897
|
MultiSelect.prototype.checkPlaceholderSize = function () {
|
|
9665
9898
|
if (this.showDropDownIcon) {
|
|
@@ -9688,11 +9921,13 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9688
9921
|
}
|
|
9689
9922
|
};
|
|
9690
9923
|
MultiSelect.prototype.refreshInputHight = function () {
|
|
9691
|
-
if (
|
|
9692
|
-
this.
|
|
9693
|
-
|
|
9694
|
-
|
|
9695
|
-
|
|
9924
|
+
if (!isNullOrUndefined(this.searchWrapper)) {
|
|
9925
|
+
if ((!this.value || !this.value.length) && (isNullOrUndefined(this.text) || this.text === '')) {
|
|
9926
|
+
this.searchWrapper.classList.remove(ZERO_SIZE);
|
|
9927
|
+
}
|
|
9928
|
+
else {
|
|
9929
|
+
this.searchWrapper.classList.add(ZERO_SIZE);
|
|
9930
|
+
}
|
|
9696
9931
|
}
|
|
9697
9932
|
};
|
|
9698
9933
|
MultiSelect.prototype.validateValues = function (newValue, oldValue) {
|
|
@@ -9730,6 +9965,11 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9730
9965
|
this.tempValues = this.value.slice();
|
|
9731
9966
|
}
|
|
9732
9967
|
};
|
|
9968
|
+
MultiSelect.prototype.updateAriaActiveDescendant = function () {
|
|
9969
|
+
if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
|
|
9970
|
+
attributes(this.inputElement, { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
|
|
9971
|
+
}
|
|
9972
|
+
};
|
|
9733
9973
|
MultiSelect.prototype.getPagingCount = function () {
|
|
9734
9974
|
var height = this.list.classList.contains(dropDownBaseClasses.noData) ? null :
|
|
9735
9975
|
getComputedStyle(this.getItems()[0], null).getPropertyValue('height');
|
|
@@ -9790,6 +10030,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9790
10030
|
if (this.isPopupOpen()) {
|
|
9791
10031
|
this.refreshPopup();
|
|
9792
10032
|
}
|
|
10033
|
+
Input.calculateWidth(this.inputElement, this.overAllWrapper);
|
|
9793
10034
|
return true;
|
|
9794
10035
|
}
|
|
9795
10036
|
else {
|
|
@@ -9845,7 +10086,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9845
10086
|
break;
|
|
9846
10087
|
case 40:
|
|
9847
10088
|
if (!this.isPopupOpen()) {
|
|
9848
|
-
this.showPopup();
|
|
10089
|
+
this.showPopup(e);
|
|
9849
10090
|
e.preventDefault();
|
|
9850
10091
|
}
|
|
9851
10092
|
break;
|
|
@@ -9872,6 +10113,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9872
10113
|
var element = scrollEle[(isHome) ? 0 : (scrollEle.length - 1)];
|
|
9873
10114
|
element.classList.add(dropDownBaseClasses.focus);
|
|
9874
10115
|
this.scrollBottom(element);
|
|
10116
|
+
this.updateAriaActiveDescendant();
|
|
9875
10117
|
}
|
|
9876
10118
|
};
|
|
9877
10119
|
MultiSelect.prototype.onKeyDown = function (e) {
|
|
@@ -10373,7 +10615,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
10373
10615
|
};
|
|
10374
10616
|
MultiSelect.prototype.invokeCheckboxSelection = function (element, eve, isClearAll) {
|
|
10375
10617
|
this.notify('updatelist', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', li: element, e: eve });
|
|
10376
|
-
|
|
10618
|
+
this.updateAriaActiveDescendant();
|
|
10377
10619
|
if ((this.value && this.value.length !== this.mainData.length)
|
|
10378
10620
|
&& (this.mode === 'CheckBox' && this.showSelectAll && !(this.isSelectAll || isClearAll))) {
|
|
10379
10621
|
this.notify('checkSelectAll', {
|
|
@@ -10486,7 +10728,6 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
10486
10728
|
HIDE_LIST :
|
|
10487
10729
|
dropDownBaseClasses.selected);
|
|
10488
10730
|
if (this.mode === 'CheckBox') {
|
|
10489
|
-
element2.firstElementChild.setAttribute('aria-checked', 'false');
|
|
10490
10731
|
removeClass([element2.firstElementChild.lastElementChild], 'e-check');
|
|
10491
10732
|
}
|
|
10492
10733
|
}
|
|
@@ -10496,7 +10737,6 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
10496
10737
|
HIDE_LIST :
|
|
10497
10738
|
dropDownBaseClasses.selected);
|
|
10498
10739
|
if (this.mode === 'CheckBox') {
|
|
10499
|
-
element2.firstElementChild.setAttribute('aria-checked', 'true');
|
|
10500
10740
|
addClass([element2.firstElementChild.lastElementChild], 'e-check');
|
|
10501
10741
|
}
|
|
10502
10742
|
}
|
|
@@ -10757,109 +10997,111 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
10757
10997
|
_super.prototype.render.call(this);
|
|
10758
10998
|
}
|
|
10759
10999
|
if (!this.popupObj) {
|
|
10760
|
-
|
|
10761
|
-
|
|
10762
|
-
|
|
10763
|
-
checkboxFilter.
|
|
10764
|
-
|
|
10765
|
-
|
|
10766
|
-
|
|
10767
|
-
|
|
10768
|
-
|
|
10769
|
-
this.
|
|
10770
|
-
|
|
10771
|
-
}
|
|
10772
|
-
append([this.list], this.popupWrapper);
|
|
10773
|
-
if (this.footerTemplate) {
|
|
10774
|
-
this.setFooterTemplate();
|
|
10775
|
-
overAllHeight -= this.footer.offsetHeight;
|
|
10776
|
-
}
|
|
10777
|
-
if (this.mode === 'CheckBox' && this.showSelectAll) {
|
|
10778
|
-
this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
|
|
10779
|
-
overAllHeight -= this.selectAllHeight;
|
|
10780
|
-
}
|
|
10781
|
-
else if (this.mode === 'CheckBox' && !this.showSelectAll && (!this.headerTemplate && !this.footerTemplate)) {
|
|
10782
|
-
this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
|
|
10783
|
-
overAllHeight = parseInt(this.popupHeight, 10);
|
|
10784
|
-
}
|
|
10785
|
-
else if (this.mode === 'CheckBox' && !this.showSelectAll) {
|
|
10786
|
-
this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
|
|
10787
|
-
overAllHeight = parseInt(this.popupHeight, 10);
|
|
10788
|
-
if (this.headerTemplate && this.header) {
|
|
11000
|
+
if (!isNullOrUndefined(this.popupWrapper)) {
|
|
11001
|
+
document.body.appendChild(this.popupWrapper);
|
|
11002
|
+
var checkboxFilter = this.popupWrapper.querySelector('.' + FILTERPARENT);
|
|
11003
|
+
if (this.mode === 'CheckBox' && !this.allowFiltering && checkboxFilter && this.filterParent) {
|
|
11004
|
+
checkboxFilter.remove();
|
|
11005
|
+
this.filterParent = null;
|
|
11006
|
+
}
|
|
11007
|
+
var overAllHeight = parseInt(this.popupHeight, 10);
|
|
11008
|
+
this.popupWrapper.style.visibility = 'hidden';
|
|
11009
|
+
if (this.headerTemplate) {
|
|
11010
|
+
this.setHeaderTemplate();
|
|
10789
11011
|
overAllHeight -= this.header.offsetHeight;
|
|
10790
11012
|
}
|
|
10791
|
-
|
|
11013
|
+
append([this.list], this.popupWrapper);
|
|
11014
|
+
if (this.footerTemplate) {
|
|
11015
|
+
this.setFooterTemplate();
|
|
10792
11016
|
overAllHeight -= this.footer.offsetHeight;
|
|
10793
11017
|
}
|
|
10794
|
-
|
|
10795
|
-
|
|
10796
|
-
|
|
10797
|
-
module: 'CheckBoxSelection',
|
|
10798
|
-
enable: this.mode === 'CheckBox',
|
|
10799
|
-
popupElement: this.popupWrapper
|
|
10800
|
-
};
|
|
10801
|
-
if (this.allowFiltering) {
|
|
10802
|
-
this.notify('searchBox', args);
|
|
10803
|
-
overAllHeight -= this.searchBoxHeight;
|
|
11018
|
+
if (this.mode === 'CheckBox' && this.showSelectAll) {
|
|
11019
|
+
this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
|
|
11020
|
+
overAllHeight -= this.selectAllHeight;
|
|
10804
11021
|
}
|
|
10805
|
-
|
|
10806
|
-
|
|
10807
|
-
|
|
10808
|
-
|
|
10809
|
-
this.
|
|
10810
|
-
|
|
10811
|
-
|
|
10812
|
-
|
|
10813
|
-
|
|
10814
|
-
this.popupObj = new Popup(this.popupWrapper, {
|
|
10815
|
-
width: this.calcPopupWidth(), targetType: 'relative', position: { X: 'left', Y: 'bottom' },
|
|
10816
|
-
relateTo: this.overAllWrapper, collision: { X: 'flip', Y: 'flip' }, offsetY: 1,
|
|
10817
|
-
enableRtl: this.enableRtl, zIndex: this.zIndex,
|
|
10818
|
-
close: function () {
|
|
10819
|
-
if (_this.popupObj.element.parentElement) {
|
|
10820
|
-
_this.popupObj.unwireScrollEvents();
|
|
10821
|
-
// For restrict the page scrolling in safari browser
|
|
10822
|
-
var checkboxFilterInput = _this.popupWrapper.querySelector('.' + FILTERINPUT);
|
|
10823
|
-
if (_this.mode === 'CheckBox' && checkboxFilterInput && document.activeElement === checkboxFilterInput) {
|
|
10824
|
-
checkboxFilterInput.blur();
|
|
10825
|
-
}
|
|
10826
|
-
detach(_this.popupObj.element);
|
|
10827
|
-
}
|
|
10828
|
-
},
|
|
10829
|
-
open: function () {
|
|
10830
|
-
_this.popupObj.resolveCollision();
|
|
10831
|
-
if (!_this.isFirstClick) {
|
|
10832
|
-
var ulElement = _this.list.querySelector('ul');
|
|
10833
|
-
if (ulElement) {
|
|
10834
|
-
if (!(_this.mode !== 'CheckBox' && (_this.allowFiltering || _this.allowCustomValue) &&
|
|
10835
|
-
_this.targetElement().trim() !== '')) {
|
|
10836
|
-
_this.mainList = ulElement.cloneNode ? ulElement.cloneNode(true) : ulElement;
|
|
10837
|
-
}
|
|
10838
|
-
}
|
|
10839
|
-
_this.isFirstClick = true;
|
|
11022
|
+
else if (this.mode === 'CheckBox' && !this.showSelectAll && (!this.headerTemplate && !this.footerTemplate)) {
|
|
11023
|
+
this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
|
|
11024
|
+
overAllHeight = parseInt(this.popupHeight, 10);
|
|
11025
|
+
}
|
|
11026
|
+
else if (this.mode === 'CheckBox' && !this.showSelectAll) {
|
|
11027
|
+
this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
|
|
11028
|
+
overAllHeight = parseInt(this.popupHeight, 10);
|
|
11029
|
+
if (this.headerTemplate && this.header) {
|
|
11030
|
+
overAllHeight -= this.header.offsetHeight;
|
|
10840
11031
|
}
|
|
10841
|
-
|
|
10842
|
-
|
|
10843
|
-
_this.targetElement().trim() !== '')) {
|
|
10844
|
-
_this.loadTemplate();
|
|
11032
|
+
if (this.footerTemplate && this.footer) {
|
|
11033
|
+
overAllHeight -= this.footer.offsetHeight;
|
|
10845
11034
|
}
|
|
10846
|
-
|
|
10847
|
-
|
|
10848
|
-
|
|
10849
|
-
|
|
10850
|
-
|
|
11035
|
+
}
|
|
11036
|
+
if (this.mode === 'CheckBox') {
|
|
11037
|
+
var args = {
|
|
11038
|
+
module: 'CheckBoxSelection',
|
|
11039
|
+
enable: this.mode === 'CheckBox',
|
|
11040
|
+
popupElement: this.popupWrapper
|
|
11041
|
+
};
|
|
11042
|
+
if (this.allowFiltering) {
|
|
11043
|
+
this.notify('searchBox', args);
|
|
11044
|
+
overAllHeight -= this.searchBoxHeight;
|
|
10851
11045
|
}
|
|
10852
|
-
|
|
10853
|
-
|
|
10854
|
-
|
|
11046
|
+
addClass([this.popupWrapper], 'e-checkbox');
|
|
11047
|
+
}
|
|
11048
|
+
if (this.popupHeight !== 'auto') {
|
|
11049
|
+
this.list.style.maxHeight = formatUnit(overAllHeight);
|
|
11050
|
+
this.popupWrapper.style.maxHeight = formatUnit(this.popupHeight);
|
|
11051
|
+
}
|
|
11052
|
+
else {
|
|
11053
|
+
this.list.style.maxHeight = formatUnit(this.popupHeight);
|
|
11054
|
+
}
|
|
11055
|
+
this.popupObj = new Popup(this.popupWrapper, {
|
|
11056
|
+
width: this.calcPopupWidth(), targetType: 'relative', position: { X: 'left', Y: 'bottom' },
|
|
11057
|
+
relateTo: this.overAllWrapper, collision: { X: 'flip', Y: 'flip' }, offsetY: 1,
|
|
11058
|
+
enableRtl: this.enableRtl, zIndex: this.zIndex,
|
|
11059
|
+
close: function () {
|
|
11060
|
+
if (_this.popupObj.element.parentElement) {
|
|
11061
|
+
_this.popupObj.unwireScrollEvents();
|
|
11062
|
+
// For restrict the page scrolling in safari browser
|
|
11063
|
+
var checkboxFilterInput = _this.popupWrapper.querySelector('.' + FILTERINPUT);
|
|
11064
|
+
if (_this.mode === 'CheckBox' && checkboxFilterInput && document.activeElement === checkboxFilterInput) {
|
|
11065
|
+
checkboxFilterInput.blur();
|
|
11066
|
+
}
|
|
11067
|
+
detach(_this.popupObj.element);
|
|
11068
|
+
}
|
|
11069
|
+
},
|
|
11070
|
+
open: function () {
|
|
11071
|
+
_this.popupObj.resolveCollision();
|
|
11072
|
+
if (!_this.isFirstClick) {
|
|
11073
|
+
var ulElement = _this.list.querySelector('ul');
|
|
11074
|
+
if (ulElement) {
|
|
11075
|
+
if (!(_this.mode !== 'CheckBox' && (_this.allowFiltering || _this.allowCustomValue) &&
|
|
11076
|
+
_this.targetElement().trim() !== '')) {
|
|
11077
|
+
_this.mainList = ulElement.cloneNode ? ulElement.cloneNode(true) : ulElement;
|
|
11078
|
+
}
|
|
11079
|
+
}
|
|
11080
|
+
_this.isFirstClick = true;
|
|
11081
|
+
}
|
|
11082
|
+
_this.popupObj.wireScrollEvents();
|
|
11083
|
+
if (!(_this.mode !== 'CheckBox' && (_this.allowFiltering || _this.allowCustomValue) &&
|
|
11084
|
+
_this.targetElement().trim() !== '')) {
|
|
11085
|
+
_this.loadTemplate();
|
|
11086
|
+
}
|
|
11087
|
+
_this.setScrollPosition();
|
|
11088
|
+
if (_this.allowFiltering) {
|
|
11089
|
+
_this.notify('inputFocus', {
|
|
11090
|
+
module: 'CheckBoxSelection', enable: _this.mode === 'CheckBox', value: 'focus'
|
|
11091
|
+
});
|
|
11092
|
+
}
|
|
11093
|
+
}, targetExitViewport: function () {
|
|
11094
|
+
if (!Browser.isDevice) {
|
|
11095
|
+
_this.hidePopup();
|
|
11096
|
+
}
|
|
10855
11097
|
}
|
|
11098
|
+
});
|
|
11099
|
+
if (this.mode === 'CheckBox' && Browser.isDevice && this.allowFiltering) {
|
|
11100
|
+
this.notify('deviceSearchBox', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
|
|
10856
11101
|
}
|
|
10857
|
-
|
|
10858
|
-
|
|
10859
|
-
this.notify('deviceSearchBox', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
|
|
11102
|
+
this.popupObj.close();
|
|
11103
|
+
this.popupWrapper.style.visibility = '';
|
|
10860
11104
|
}
|
|
10861
|
-
this.popupObj.close();
|
|
10862
|
-
this.popupWrapper.style.visibility = '';
|
|
10863
11105
|
}
|
|
10864
11106
|
};
|
|
10865
11107
|
MultiSelect.prototype.setHeaderTemplate = function () {
|
|
@@ -10929,6 +11171,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
10929
11171
|
this.removeValue(temp, e, null, true);
|
|
10930
11172
|
}
|
|
10931
11173
|
}
|
|
11174
|
+
this.selectedElementID = null;
|
|
11175
|
+
this.inputElement.removeAttribute('aria-activedescendant');
|
|
10932
11176
|
}
|
|
10933
11177
|
else {
|
|
10934
11178
|
this.clearAllCallback(e);
|
|
@@ -11032,11 +11276,12 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11032
11276
|
};
|
|
11033
11277
|
MultiSelect.prototype.search = function (e) {
|
|
11034
11278
|
var _this = this;
|
|
11279
|
+
this.resetFilteredData = true;
|
|
11035
11280
|
if (!isNullOrUndefined(e)) {
|
|
11036
11281
|
this.keyCode = e.keyCode;
|
|
11037
11282
|
}
|
|
11038
11283
|
if (!this.isPopupOpen() && this.openOnClick) {
|
|
11039
|
-
this.showPopup();
|
|
11284
|
+
this.showPopup(e);
|
|
11040
11285
|
}
|
|
11041
11286
|
this.openClick(e);
|
|
11042
11287
|
if (this.checkTextLength() && !this.allowFiltering && !isNullOrUndefined(e) && (e.keyCode !== 8)) {
|
|
@@ -11120,7 +11365,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11120
11365
|
var temp;
|
|
11121
11366
|
var tempData = this.listData;
|
|
11122
11367
|
this.listData = this.mainData;
|
|
11123
|
-
this.hiddenElement
|
|
11368
|
+
if (!isNullOrUndefined(this.hiddenElement)) {
|
|
11369
|
+
this.hiddenElement.innerHTML = '';
|
|
11370
|
+
}
|
|
11124
11371
|
if (!isNullOrUndefined(this.value)) {
|
|
11125
11372
|
for (var index = 0; !isNullOrUndefined(this.value[index]); index++) {
|
|
11126
11373
|
var listValue = this.findListElement(((!isNullOrUndefined(this.mainList)) ? this.mainList : this.ulElement), 'li', 'data-value', this.value[index]);
|
|
@@ -11138,7 +11385,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11138
11385
|
data += temp + delimiterChar + ' ';
|
|
11139
11386
|
text.push(temp);
|
|
11140
11387
|
}
|
|
11141
|
-
this.hiddenElement
|
|
11388
|
+
if (!isNullOrUndefined(this.hiddenElement)) {
|
|
11389
|
+
this.hiddenElement.innerHTML += '<option selected value ="' + this.value[index] + '">' + index + '</option>';
|
|
11390
|
+
}
|
|
11142
11391
|
}
|
|
11143
11392
|
}
|
|
11144
11393
|
this.setProperties({ text: text.toString() }, true);
|
|
@@ -11183,7 +11432,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11183
11432
|
|| this.list.querySelector('.e-ul') && this.list.querySelector('.e-ul').childElementCount === 0)) {
|
|
11184
11433
|
isEmptyData = true;
|
|
11185
11434
|
}
|
|
11186
|
-
_super.prototype.render.call(this, isEmptyData);
|
|
11435
|
+
_super.prototype.render.call(this, null, isEmptyData);
|
|
11187
11436
|
this.unwireListEvents();
|
|
11188
11437
|
this.wireListEvents();
|
|
11189
11438
|
};
|
|
@@ -11271,7 +11520,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11271
11520
|
}
|
|
11272
11521
|
};
|
|
11273
11522
|
MultiSelect.prototype.updateDataList = function () {
|
|
11274
|
-
if (this.mainList && this.ulElement && !(this.isFiltered || this.filterAction)) {
|
|
11523
|
+
if (this.mainList && this.ulElement && !(this.isFiltered || this.filterAction || this.targetElement().trim())) {
|
|
11275
11524
|
var isDynamicGroupItemUpdate = this.mainList.childElementCount < this.ulElement.childElementCount;
|
|
11276
11525
|
var isReactTemplateUpdate = ((this.ulElement.childElementCount > 0 && this.ulElement.children[0].childElementCount > 0) && (this.mainList.children[0].childElementCount < this.ulElement.children[0].childElementCount));
|
|
11277
11526
|
var isAngularTemplateUpdate = this.itemTemplate && this.ulElement.childElementCount > 0 && !(this.ulElement.childElementCount < this.mainList.childElementCount) && (this.ulElement.children[0].childElementCount > 0 || (this.fields.groupBy && this.ulElement.children[1] && this.ulElement.children[1].childElementCount > 0));
|
|
@@ -11350,10 +11599,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11350
11599
|
selectItems[temp1 - 1].setAttribute('aria-selected', 'false');
|
|
11351
11600
|
if (this.mode === 'CheckBox') {
|
|
11352
11601
|
if (selectedItems && (selectedItems.length > (temp1 - 1))) {
|
|
11353
|
-
selectedItems[temp1 - 1].firstElementChild.setAttribute('aria-checked', 'false');
|
|
11354
11602
|
removeClass([selectedItems[temp1 - 1].firstElementChild.lastElementChild], 'e-check');
|
|
11355
11603
|
}
|
|
11356
|
-
selectItems[temp1 - 1].firstElementChild.setAttribute('aria-checked', 'false');
|
|
11357
11604
|
removeClass([selectItems[temp1 - 1].firstElementChild.lastElementChild], 'e-check');
|
|
11358
11605
|
}
|
|
11359
11606
|
temp1--;
|
|
@@ -11394,10 +11641,12 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11394
11641
|
if (this.enabled && this.isValidLI(element)) {
|
|
11395
11642
|
this.removeFocus();
|
|
11396
11643
|
addClass([element], dropDownBaseClasses.focus);
|
|
11644
|
+
this.updateAriaActiveDescendant();
|
|
11397
11645
|
}
|
|
11398
11646
|
else {
|
|
11399
11647
|
if (this.enableGroupCheckBox && this.mode === 'CheckBox' && !isNullOrUndefined(this.fields.groupBy)) {
|
|
11400
11648
|
addClass([element], dropDownBaseClasses.focus);
|
|
11649
|
+
this.updateAriaActiveDescendant();
|
|
11401
11650
|
}
|
|
11402
11651
|
}
|
|
11403
11652
|
};
|
|
@@ -11409,9 +11658,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11409
11658
|
addClass([element], className);
|
|
11410
11659
|
this.updateMainList(false, element.getAttribute('data-value'), mainElement);
|
|
11411
11660
|
element.setAttribute('aria-selected', 'true');
|
|
11412
|
-
if (this.mode === 'CheckBox') {
|
|
11413
|
-
var ariaCheck = element.
|
|
11414
|
-
if (ariaCheck ===
|
|
11661
|
+
if (this.mode === 'CheckBox' && element.classList.contains('e-active')) {
|
|
11662
|
+
var ariaCheck = element.getElementsByClassName('e-check').length;
|
|
11663
|
+
if (ariaCheck === 0) {
|
|
11415
11664
|
this.notify('updatelist', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', li: element, e: this });
|
|
11416
11665
|
}
|
|
11417
11666
|
}
|
|
@@ -11419,7 +11668,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11419
11668
|
if (this.chipCollectionWrapper) {
|
|
11420
11669
|
this.removeChipSelection();
|
|
11421
11670
|
}
|
|
11422
|
-
|
|
11671
|
+
this.selectedElementID = element.id;
|
|
11423
11672
|
}
|
|
11424
11673
|
};
|
|
11425
11674
|
MultiSelect.prototype.updateDelimeter = function (delimChar, e) {
|
|
@@ -11730,9 +11979,11 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11730
11979
|
if (this.chipCollectionWrapper) {
|
|
11731
11980
|
this.chipCollectionWrapper.style.display = 'none';
|
|
11732
11981
|
}
|
|
11733
|
-
this.viewWrapper
|
|
11734
|
-
|
|
11735
|
-
|
|
11982
|
+
if (!isNullOrUndefined(this.viewWrapper)) {
|
|
11983
|
+
this.viewWrapper.style.display = '';
|
|
11984
|
+
this.viewWrapper.style.width = '';
|
|
11985
|
+
this.viewWrapper.classList.remove(TOTAL_COUNT_WRAPPER$1);
|
|
11986
|
+
}
|
|
11736
11987
|
if (this.value && this.value.length) {
|
|
11737
11988
|
var data = '';
|
|
11738
11989
|
var temp = void 0;
|
|
@@ -11783,7 +12034,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11783
12034
|
overAllContainer = this.componentWrapper.offsetWidth -
|
|
11784
12035
|
parseInt(window.getComputedStyle(this.componentWrapper).paddingLeft, 10) -
|
|
11785
12036
|
parseInt(window.getComputedStyle(this.componentWrapper).paddingRight, 10);
|
|
11786
|
-
if ((wrapperleng + downIconWidth + this.clearIconWidth)
|
|
12037
|
+
if ((wrapperleng + downIconWidth + this.clearIconWidth) >= overAllContainer) {
|
|
11787
12038
|
if (tempData !== undefined && tempData !== '') {
|
|
11788
12039
|
temp = tempData;
|
|
11789
12040
|
index = tempIndex + 1;
|
|
@@ -11792,7 +12043,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11792
12043
|
remaining = this.value.length - index;
|
|
11793
12044
|
wrapperleng = this.viewWrapper.offsetWidth +
|
|
11794
12045
|
parseInt(window.getComputedStyle(this.viewWrapper).paddingRight, 10);
|
|
11795
|
-
while (((wrapperleng + remainSize + downIconWidth + this.clearIconWidth)
|
|
12046
|
+
while (((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) >= overAllContainer) && wrapperleng !== 0
|
|
11796
12047
|
&& this.viewWrapper.innerHTML !== '') {
|
|
11797
12048
|
var textArr = [];
|
|
11798
12049
|
this.viewWrapper.innerHTML = textArr.join(this.delimiterChar);
|
|
@@ -11802,7 +12053,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11802
12053
|
}
|
|
11803
12054
|
break;
|
|
11804
12055
|
}
|
|
11805
|
-
else if ((wrapperleng + remainSize + downIconWidth + this.clearIconWidth)
|
|
12056
|
+
else if ((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) < overAllContainer) {
|
|
11806
12057
|
tempData = data;
|
|
11807
12058
|
tempIndex = index;
|
|
11808
12059
|
}
|
|
@@ -11820,8 +12071,10 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11820
12071
|
}
|
|
11821
12072
|
}
|
|
11822
12073
|
else {
|
|
11823
|
-
this.viewWrapper
|
|
11824
|
-
|
|
12074
|
+
if (!isNullOrUndefined(this.viewWrapper)) {
|
|
12075
|
+
this.viewWrapper.innerHTML = '';
|
|
12076
|
+
this.viewWrapper.style.display = 'none';
|
|
12077
|
+
}
|
|
11825
12078
|
}
|
|
11826
12079
|
};
|
|
11827
12080
|
MultiSelect.prototype.checkClearIconWidth = function () {
|
|
@@ -11894,29 +12147,41 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11894
12147
|
return temp;
|
|
11895
12148
|
};
|
|
11896
12149
|
MultiSelect.prototype.unWireEvent = function () {
|
|
11897
|
-
|
|
12150
|
+
if (!isNullOrUndefined(this.componentWrapper)) {
|
|
12151
|
+
EventHandler.remove(this.componentWrapper, 'mousedown', this.wrapperClick);
|
|
12152
|
+
}
|
|
11898
12153
|
EventHandler.remove(window, 'resize', this.windowResize);
|
|
11899
|
-
|
|
11900
|
-
|
|
11901
|
-
|
|
11902
|
-
|
|
12154
|
+
if (!isNullOrUndefined(this.inputElement)) {
|
|
12155
|
+
EventHandler.remove(this.inputElement, 'focus', this.focusInHandler);
|
|
12156
|
+
EventHandler.remove(this.inputElement, 'keydown', this.onKeyDown);
|
|
12157
|
+
if (this.mode !== 'CheckBox') {
|
|
12158
|
+
EventHandler.remove(this.inputElement, 'input', this.onInput);
|
|
12159
|
+
}
|
|
12160
|
+
EventHandler.remove(this.inputElement, 'keyup', this.keyUp);
|
|
12161
|
+
var formElement = closest(this.inputElement, 'form');
|
|
12162
|
+
if (formElement) {
|
|
12163
|
+
EventHandler.remove(formElement, 'reset', this.resetValueHandler);
|
|
12164
|
+
}
|
|
12165
|
+
EventHandler.remove(this.inputElement, 'blur', this.onBlurHandler);
|
|
11903
12166
|
}
|
|
11904
|
-
|
|
11905
|
-
|
|
11906
|
-
|
|
11907
|
-
|
|
12167
|
+
if (!isNullOrUndefined(this.componentWrapper)) {
|
|
12168
|
+
EventHandler.remove(this.componentWrapper, 'mouseover', this.mouseIn);
|
|
12169
|
+
EventHandler.remove(this.componentWrapper, 'mouseout', this.mouseOut);
|
|
12170
|
+
}
|
|
12171
|
+
if (!isNullOrUndefined(this.overAllClear)) {
|
|
12172
|
+
EventHandler.remove(this.overAllClear, 'mousedown', this.clearAll);
|
|
12173
|
+
}
|
|
12174
|
+
if (!isNullOrUndefined(this.inputElement)) {
|
|
12175
|
+
EventHandler.remove(this.inputElement, 'paste', this.pasteHandler);
|
|
11908
12176
|
}
|
|
11909
|
-
EventHandler.remove(this.inputElement, 'blur', this.onBlurHandler);
|
|
11910
|
-
EventHandler.remove(this.componentWrapper, 'mouseover', this.mouseIn);
|
|
11911
|
-
EventHandler.remove(this.componentWrapper, 'mouseout', this.mouseOut);
|
|
11912
|
-
EventHandler.remove(this.overAllClear, 'mousedown', this.clearAll);
|
|
11913
|
-
EventHandler.remove(this.inputElement, 'paste', this.pasteHandler);
|
|
11914
12177
|
};
|
|
11915
12178
|
MultiSelect.prototype.selectAllItem = function (state, event, list) {
|
|
11916
12179
|
var li;
|
|
11917
|
-
|
|
11918
|
-
|
|
11919
|
-
|
|
12180
|
+
if (!isNullOrUndefined(this.list)) {
|
|
12181
|
+
li = this.list.querySelectorAll(state ?
|
|
12182
|
+
'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide)' :
|
|
12183
|
+
'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)');
|
|
12184
|
+
}
|
|
11920
12185
|
if (this.value && this.value.length && event && event.target
|
|
11921
12186
|
&& closest(event.target, '.e-close-hooker') && this.allowFiltering) {
|
|
11922
12187
|
li = this.mainList.querySelectorAll(state ?
|
|
@@ -11966,6 +12231,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11966
12231
|
target.classList.remove('e-active');
|
|
11967
12232
|
}
|
|
11968
12233
|
target.classList.add('e-item-focus');
|
|
12234
|
+
this.updateAriaActiveDescendant();
|
|
11969
12235
|
}
|
|
11970
12236
|
this.textboxValueUpdate();
|
|
11971
12237
|
this.checkPlaceholderSize();
|
|
@@ -11980,6 +12246,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11980
12246
|
else {
|
|
11981
12247
|
this.updateValue(event, li, state);
|
|
11982
12248
|
}
|
|
12249
|
+
this.addValidInputClass();
|
|
11983
12250
|
};
|
|
11984
12251
|
MultiSelect.prototype.updateValue = function (event, li, state) {
|
|
11985
12252
|
var _this = this;
|
|
@@ -12205,6 +12472,11 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12205
12472
|
MultiSelect.prototype.onPropertyChanged = function (newProp, oldProp) {
|
|
12206
12473
|
if (newProp.dataSource && !isNullOrUndefined(Object.keys(newProp.dataSource))
|
|
12207
12474
|
|| newProp.query && !isNullOrUndefined(Object.keys(newProp.query))) {
|
|
12475
|
+
if (this.resetFilteredData) {
|
|
12476
|
+
// The filtered data is not being reset in the component after the user focuses out.
|
|
12477
|
+
this.resetMainList = !this.resetMainList ? this.mainList : this.resetMainList;
|
|
12478
|
+
this.resetFilteredData = false;
|
|
12479
|
+
}
|
|
12208
12480
|
this.mainList = null;
|
|
12209
12481
|
this.mainData = null;
|
|
12210
12482
|
this.isFirstClick = false;
|
|
@@ -12265,6 +12537,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12265
12537
|
case 'cssClass':
|
|
12266
12538
|
this.updateOldPropCssClass(oldProp.cssClass);
|
|
12267
12539
|
this.updateCssClass();
|
|
12540
|
+
Input.calculateWidth(this.inputElement.parentElement.parentElement, this.overAllWrapper);
|
|
12268
12541
|
break;
|
|
12269
12542
|
case 'enableRtl':
|
|
12270
12543
|
this.enableRTL(newProp.enableRtl);
|
|
@@ -12291,6 +12564,11 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12291
12564
|
case 'floatLabelType':
|
|
12292
12565
|
this.setFloatLabelType();
|
|
12293
12566
|
this.addValidInputClass();
|
|
12567
|
+
Input.createSpanElement(this.overAllWrapper, this.createElement);
|
|
12568
|
+
Input.calculateWidth(this.inputElement.parentElement.parentElement, this.overAllWrapper);
|
|
12569
|
+
if (!isNullOrUndefined(this.overAllWrapper) && !isNullOrUndefined(this.overAllWrapper.getElementsByClassName('e-ddl-icon')[0] && this.overAllWrapper.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never')) {
|
|
12570
|
+
this.overAllWrapper.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
|
|
12571
|
+
}
|
|
12294
12572
|
break;
|
|
12295
12573
|
case 'enableSelectionOrder':
|
|
12296
12574
|
break;
|
|
@@ -12350,7 +12628,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12350
12628
|
MultiSelect.prototype.addNonPresentItems = function (valuecheck, ulElement, list, event) {
|
|
12351
12629
|
var _this = this;
|
|
12352
12630
|
this.dataSource.executeQuery(this.getForQuery(valuecheck)).then(function (e) {
|
|
12353
|
-
|
|
12631
|
+
if (e.result.length > 0) {
|
|
12632
|
+
_this.addItem(e.result, list.length);
|
|
12633
|
+
}
|
|
12354
12634
|
_this.updateActionList(ulElement, list, event);
|
|
12355
12635
|
});
|
|
12356
12636
|
};
|
|
@@ -12409,7 +12689,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12409
12689
|
* Adds a new item to the multiselect popup list. By default, new item appends to the list as the last item,
|
|
12410
12690
|
* but you can insert based on the index parameter.
|
|
12411
12691
|
*
|
|
12412
|
-
* @param
|
|
12692
|
+
* @param { Object[] } items - Specifies an array of JSON data or a JSON data.
|
|
12413
12693
|
* @param { number } itemIndex - Specifies the index to place the newly added item in the popup list.
|
|
12414
12694
|
* @returns {void}
|
|
12415
12695
|
*/
|
|
@@ -12441,6 +12721,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12441
12721
|
_this.overAllWrapper.classList.remove(iconAnimation);
|
|
12442
12722
|
_this.popupObj.hide(new Animation(eventArgs.animation));
|
|
12443
12723
|
attributes(_this.inputElement, { 'aria-expanded': 'false' });
|
|
12724
|
+
_this.inputElement.removeAttribute('aria-owns');
|
|
12725
|
+
_this.inputElement.removeAttribute('aria-activedescendant');
|
|
12444
12726
|
if (_this.allowFiltering) {
|
|
12445
12727
|
_this.notify('inputFocus', { module: 'CheckBoxSelection', enable: _this.mode === 'CheckBox', value: 'clear' });
|
|
12446
12728
|
}
|
|
@@ -12456,7 +12738,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12456
12738
|
*
|
|
12457
12739
|
* @returns {void}
|
|
12458
12740
|
*/
|
|
12459
|
-
MultiSelect.prototype.showPopup = function () {
|
|
12741
|
+
MultiSelect.prototype.showPopup = function (e) {
|
|
12460
12742
|
var _this = this;
|
|
12461
12743
|
if (!this.enabled) {
|
|
12462
12744
|
return;
|
|
@@ -12466,7 +12748,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12466
12748
|
if (!args.cancel) {
|
|
12467
12749
|
if (!_this.ulElement) {
|
|
12468
12750
|
_this.beforePopupOpen = true;
|
|
12469
|
-
_super.prototype.render.call(_this);
|
|
12751
|
+
_super.prototype.render.call(_this, e);
|
|
12470
12752
|
if (_this.mode === 'CheckBox' && Browser.isDevice && _this.allowFiltering) {
|
|
12471
12753
|
_this.notify('popupFullScreen', { module: 'CheckBoxSelection', enable: _this.mode === 'CheckBox' });
|
|
12472
12754
|
}
|
|
@@ -12482,7 +12764,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12482
12764
|
_this.beforePopupOpen = false;
|
|
12483
12765
|
return;
|
|
12484
12766
|
}
|
|
12485
|
-
_this.onPopupShown();
|
|
12767
|
+
_this.onPopupShown(e);
|
|
12486
12768
|
}
|
|
12487
12769
|
});
|
|
12488
12770
|
};
|
|
@@ -12584,12 +12866,12 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12584
12866
|
spellcheck: 'false',
|
|
12585
12867
|
type: 'text',
|
|
12586
12868
|
autocomplete: 'off',
|
|
12587
|
-
tabindex: '0'
|
|
12869
|
+
tabindex: '0',
|
|
12870
|
+
role: 'combobox'
|
|
12588
12871
|
}
|
|
12589
12872
|
});
|
|
12590
12873
|
if (this.mode === 'Default' || this.mode === 'Box') {
|
|
12591
12874
|
this.inputElement.setAttribute('aria-describedby', this.chipCollectionWrapper.id);
|
|
12592
|
-
this.inputElement.setAttribute('aria-labelledby', this.chipCollectionWrapper.id);
|
|
12593
12875
|
}
|
|
12594
12876
|
if (this.element.tagName !== this.getNgDirective()) {
|
|
12595
12877
|
this.element.style.display = 'none';
|
|
@@ -12622,6 +12904,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12622
12904
|
if (this.mode !== 'CheckBox') {
|
|
12623
12905
|
this.hideOverAllClear();
|
|
12624
12906
|
}
|
|
12907
|
+
if (!isNullOrUndefined(closest(this.element, "fieldset")) && closest(this.element, "fieldset").disabled) {
|
|
12908
|
+
this.enabled = false;
|
|
12909
|
+
}
|
|
12625
12910
|
this.wireEvent();
|
|
12626
12911
|
this.enable(this.enabled);
|
|
12627
12912
|
this.enableRTL(this.enableRtl);
|
|
@@ -12629,6 +12914,11 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12629
12914
|
if (this.element.hasAttribute('data-val')) {
|
|
12630
12915
|
this.element.setAttribute('data-val', 'false');
|
|
12631
12916
|
}
|
|
12917
|
+
Input.createSpanElement(this.overAllWrapper, this.createElement);
|
|
12918
|
+
Input.calculateWidth(this.inputElement.parentElement.parentElement, this.overAllWrapper);
|
|
12919
|
+
if (!isNullOrUndefined(this.overAllWrapper) && !isNullOrUndefined(this.overAllWrapper.getElementsByClassName('e-ddl-icon')[0] && this.overAllWrapper.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never')) {
|
|
12920
|
+
this.overAllWrapper.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
|
|
12921
|
+
}
|
|
12632
12922
|
this.renderComplete();
|
|
12633
12923
|
};
|
|
12634
12924
|
MultiSelect.prototype.checkInitialValue = function () {
|
|
@@ -12710,11 +13000,13 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12710
13000
|
}
|
|
12711
13001
|
};
|
|
12712
13002
|
MultiSelect.prototype.addValidInputClass = function () {
|
|
12713
|
-
if (
|
|
12714
|
-
|
|
12715
|
-
|
|
12716
|
-
|
|
12717
|
-
|
|
13003
|
+
if (!isNullOrUndefined(this.overAllWrapper)) {
|
|
13004
|
+
if ((!isNullOrUndefined(this.value) && this.value.length) || this.floatLabelType === 'Always') {
|
|
13005
|
+
addClass([this.overAllWrapper], 'e-valid-input');
|
|
13006
|
+
}
|
|
13007
|
+
else {
|
|
13008
|
+
removeClass([this.overAllWrapper], 'e-valid-input');
|
|
13009
|
+
}
|
|
12718
13010
|
}
|
|
12719
13011
|
};
|
|
12720
13012
|
MultiSelect.prototype.dropDownIcon = function () {
|
|
@@ -12765,15 +13057,19 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12765
13057
|
this.ulElement = null;
|
|
12766
13058
|
this.mainListCollection = null;
|
|
12767
13059
|
_super.prototype.destroy.call(this);
|
|
12768
|
-
var temp = ['readonly', 'aria-disabled', '
|
|
13060
|
+
var temp = ['readonly', 'aria-disabled', 'placeholder'];
|
|
12769
13061
|
var length = temp.length;
|
|
12770
|
-
|
|
12771
|
-
|
|
12772
|
-
|
|
13062
|
+
if (!isNullOrUndefined(this.inputElement)) {
|
|
13063
|
+
while (length > 0) {
|
|
13064
|
+
this.inputElement.removeAttribute(temp[length - 1]);
|
|
13065
|
+
length--;
|
|
13066
|
+
}
|
|
12773
13067
|
}
|
|
12774
|
-
this.element
|
|
12775
|
-
|
|
12776
|
-
|
|
13068
|
+
if (!isNullOrUndefined(this.element)) {
|
|
13069
|
+
this.element.removeAttribute('data-initial-value');
|
|
13070
|
+
this.element.style.display = 'block';
|
|
13071
|
+
}
|
|
13072
|
+
if (this.overAllWrapper && this.overAllWrapper.parentElement) {
|
|
12777
13073
|
if (this.overAllWrapper.parentElement.tagName === this.getNgDirective()) {
|
|
12778
13074
|
remove(this.overAllWrapper);
|
|
12779
13075
|
}
|
|
@@ -12782,6 +13078,25 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12782
13078
|
remove(this.overAllWrapper);
|
|
12783
13079
|
}
|
|
12784
13080
|
}
|
|
13081
|
+
this.componentWrapper = null;
|
|
13082
|
+
this.overAllClear = null;
|
|
13083
|
+
this.overAllWrapper = null;
|
|
13084
|
+
this.hiddenElement = null;
|
|
13085
|
+
this.searchWrapper = null;
|
|
13086
|
+
this.viewWrapper = null;
|
|
13087
|
+
this.chipCollectionWrapper = null;
|
|
13088
|
+
this.targetInputElement = null;
|
|
13089
|
+
this.popupWrapper = null;
|
|
13090
|
+
this.inputElement = null;
|
|
13091
|
+
this.delimiterWrapper = null;
|
|
13092
|
+
this.popupObj = null;
|
|
13093
|
+
this.popupWrapper = null;
|
|
13094
|
+
this.liCollections = null;
|
|
13095
|
+
this.header = null;
|
|
13096
|
+
this.mainList = null;
|
|
13097
|
+
this.mainListCollection = null;
|
|
13098
|
+
this.footer = null;
|
|
13099
|
+
this.selectAllEventEle = null;
|
|
12785
13100
|
};
|
|
12786
13101
|
__decorate$5([
|
|
12787
13102
|
Complex({ text: null, value: null, iconCss: null, groupBy: null }, FieldSettings)
|
|
@@ -13133,6 +13448,12 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
|
|
|
13133
13448
|
CheckBoxSelection.prototype.destroy = function () {
|
|
13134
13449
|
this.removeEventListener();
|
|
13135
13450
|
EventHandler.remove(document, 'mousedown', this.onDocumentClick);
|
|
13451
|
+
this.checkAllParent = null;
|
|
13452
|
+
this.clearIconElement = null;
|
|
13453
|
+
this.filterInput = null;
|
|
13454
|
+
this.filterInputObj = null;
|
|
13455
|
+
this.checkWrapper = null;
|
|
13456
|
+
this.selectAllSpan = null;
|
|
13136
13457
|
};
|
|
13137
13458
|
CheckBoxSelection.prototype.listSelection = function (args) {
|
|
13138
13459
|
var target;
|
|
@@ -13181,12 +13502,10 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
|
|
|
13181
13502
|
e.preventDefault();
|
|
13182
13503
|
};
|
|
13183
13504
|
CheckBoxSelection.prototype.changeState = function (wrapper, state, e, isPrevent, selectAll$$1) {
|
|
13184
|
-
var ariaState;
|
|
13185
13505
|
var frameSpan = wrapper.getElementsByClassName(CHECKBOXFRAME$1)[0];
|
|
13186
13506
|
if (state === 'check' && !frameSpan.classList.contains(CHECK$1)) {
|
|
13187
13507
|
frameSpan.classList.remove(INDETERMINATE);
|
|
13188
13508
|
frameSpan.classList.add(CHECK$1);
|
|
13189
|
-
ariaState = 'true';
|
|
13190
13509
|
if (selectAll$$1) {
|
|
13191
13510
|
this.parent.selectAllItems(true, e);
|
|
13192
13511
|
this.setLocale(true);
|
|
@@ -13194,7 +13513,6 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
|
|
|
13194
13513
|
}
|
|
13195
13514
|
else if (state === 'uncheck' && (frameSpan.classList.contains(CHECK$1) || frameSpan.classList.contains(INDETERMINATE))) {
|
|
13196
13515
|
removeClass([frameSpan], [CHECK$1, INDETERMINATE]);
|
|
13197
|
-
ariaState = 'false';
|
|
13198
13516
|
if (selectAll$$1) {
|
|
13199
13517
|
this.parent.selectAllItems(false, e);
|
|
13200
13518
|
this.setLocale();
|
|
@@ -13203,16 +13521,11 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
|
|
|
13203
13521
|
else if (state === 'indeterminate' && !(frameSpan.classList.contains(INDETERMINATE))) {
|
|
13204
13522
|
removeClass([frameSpan], [CHECK$1]);
|
|
13205
13523
|
frameSpan.classList.add(INDETERMINATE);
|
|
13206
|
-
ariaState = 'false';
|
|
13207
13524
|
if (selectAll$$1) {
|
|
13208
13525
|
this.parent.selectAllItems(false, e);
|
|
13209
13526
|
this.setLocale();
|
|
13210
13527
|
}
|
|
13211
13528
|
}
|
|
13212
|
-
ariaState = state === 'check' ? 'true' : state === 'uncheck' ? 'false' : ariaState;
|
|
13213
|
-
if (!isNullOrUndefined(ariaState)) {
|
|
13214
|
-
wrapper.setAttribute('aria-checked', ariaState);
|
|
13215
|
-
}
|
|
13216
13529
|
};
|
|
13217
13530
|
CheckBoxSelection.prototype.setSearchBox = function (args) {
|
|
13218
13531
|
if (isNullOrUndefined(this.parent.filterParent)) {
|
|
@@ -13246,11 +13559,8 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
|
|
|
13246
13559
|
prepend([this.parent.filterParent], args.popupElement);
|
|
13247
13560
|
attributes(this.filterInput, {
|
|
13248
13561
|
'aria-disabled': 'false',
|
|
13249
|
-
'
|
|
13250
|
-
'role': 'listbox',
|
|
13251
|
-
'aria-activedescendant': null,
|
|
13562
|
+
'role': 'combobox',
|
|
13252
13563
|
'autocomplete': 'off',
|
|
13253
|
-
'autocorrect': 'off',
|
|
13254
13564
|
'autocapitalize': 'off',
|
|
13255
13565
|
'spellcheck': 'false'
|
|
13256
13566
|
});
|
|
@@ -13376,8 +13686,8 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
|
|
|
13376
13686
|
e.preventDefault();
|
|
13377
13687
|
}
|
|
13378
13688
|
}
|
|
13379
|
-
if (!(!isNullOrUndefined(this.parent.popupObj) && closest(target, '[id="' + this.parent.popupObj.element.id + '"]'))
|
|
13380
|
-
!this.parent.overAllWrapper.contains(e.target)) {
|
|
13689
|
+
if (!(!isNullOrUndefined(this.parent.popupObj) && closest(target, '[id="' + this.parent.popupObj.element.id + '"]'))
|
|
13690
|
+
&& !isNullOrUndefined(this.parent.overAllWrapper) && !this.parent.overAllWrapper.contains(e.target)) {
|
|
13381
13691
|
if (this.parent.overAllWrapper.classList.contains(dropDownBaseClasses.focus) || this.parent.isPopupOpen()) {
|
|
13382
13692
|
this.parent.inputFocus = false;
|
|
13383
13693
|
this.parent.scrollFocusStatus = false;
|
|
@@ -13390,7 +13700,7 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
|
|
|
13390
13700
|
this.parent.scrollFocusStatus = (Browser.isIE || Browser.info.name === 'edge') &&
|
|
13391
13701
|
(document.activeElement === this.filterInput);
|
|
13392
13702
|
}
|
|
13393
|
-
if (!this.parent.overAllWrapper.contains(e.target) && this.parent.overAllWrapper.classList.contains('e-input-focus') &&
|
|
13703
|
+
if (!isNullOrUndefined(this.parent.overAllWrapper) && !this.parent.overAllWrapper.contains(e.target) && this.parent.overAllWrapper.classList.contains('e-input-focus') &&
|
|
13394
13704
|
!this.parent.isPopupOpen()) {
|
|
13395
13705
|
if (Browser.isIE) {
|
|
13396
13706
|
this.parent.onBlurHandler();
|
|
@@ -13421,7 +13731,7 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
|
|
|
13421
13731
|
}
|
|
13422
13732
|
};
|
|
13423
13733
|
CheckBoxSelection.prototype.checkSelectAll = function (e) {
|
|
13424
|
-
if (e.value === 'check'
|
|
13734
|
+
if (e.value === 'check') {
|
|
13425
13735
|
this.changeState(this.checkAllParent, e.value, null, null, false);
|
|
13426
13736
|
this.setLocale(true);
|
|
13427
13737
|
}
|
|
@@ -13605,6 +13915,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
13605
13915
|
this.isCustomFiltering = false;
|
|
13606
13916
|
this.initialSelectedOptions = this.value;
|
|
13607
13917
|
_super.prototype.render.call(this);
|
|
13918
|
+
this.setEnabled();
|
|
13608
13919
|
this.renderComplete();
|
|
13609
13920
|
};
|
|
13610
13921
|
ListBox.prototype.initWrapper = function () {
|
|
@@ -13639,7 +13950,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
13639
13950
|
removeClass([this.list], [dropDownBaseClasses.content, dropDownBaseClasses.root]);
|
|
13640
13951
|
this.validationAttribute(this.element, hiddenSelect);
|
|
13641
13952
|
this.list.setAttribute('role', 'listbox');
|
|
13642
|
-
attributes(this.list, { 'role': 'listbox', 'aria-multiselectable': this.selectionSettings.mode === 'Multiple' ? 'true' : 'false' });
|
|
13953
|
+
attributes(this.list, { 'role': 'listbox', 'aria-label': 'listbox', 'aria-multiselectable': this.selectionSettings.mode === 'Multiple' ? 'true' : 'false' });
|
|
13643
13954
|
this.updateSelectionSettings();
|
|
13644
13955
|
};
|
|
13645
13956
|
ListBox.prototype.updateSelectionSettings = function () {
|
|
@@ -13902,10 +14213,10 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
13902
14213
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13903
14214
|
var event = args.event;
|
|
13904
14215
|
var wrapper;
|
|
13905
|
-
if (args.target && (args.target.classList.contains(
|
|
13906
|
-
|| args.target.classList.contains(
|
|
13907
|
-
if (args.target.classList.contains(
|
|
13908
|
-
|| args.target.classList.contains(
|
|
14216
|
+
if (args.target && (args.target.classList.contains('e-listbox-wrapper') || args.target.classList.contains('e-list-item')
|
|
14217
|
+
|| args.target.classList.contains('e-filter-parent') || args.target.classList.contains('e-input-group'))) {
|
|
14218
|
+
if (args.target.classList.contains('e-list-item') || args.target.classList.contains('e-filter-parent')
|
|
14219
|
+
|| args.target.classList.contains('e-input-group')) {
|
|
13909
14220
|
wrapper = args.target.closest('.e-listbox-wrapper');
|
|
13910
14221
|
}
|
|
13911
14222
|
else {
|
|
@@ -13960,7 +14271,8 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
13960
14271
|
var getArgs = this.getDragArgs({ target: args.droppedElement }, true);
|
|
13961
14272
|
var sourceArgs = { previousData: this.dataSource };
|
|
13962
14273
|
var destArgs = { previousData: listObj.dataSource };
|
|
13963
|
-
var dragArgs = extend({}, getArgs, { target: args.target, source: { previousData: this.dataSource },
|
|
14274
|
+
var dragArgs = extend({}, getArgs, { target: args.target, source: { previousData: this.dataSource },
|
|
14275
|
+
previousIndex: args.previousIndex, currentIndex: args.currentIndex });
|
|
13964
14276
|
if (listObj !== this) {
|
|
13965
14277
|
var sourceArgs1 = extend(sourceArgs, { currentData: this.listData });
|
|
13966
14278
|
dragArgs = extend(dragArgs, { source: sourceArgs1, destination: destArgs });
|
|
@@ -14035,10 +14347,10 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
14035
14347
|
sortedData.splice(destIdx, 0, droppedData);
|
|
14036
14348
|
liColl.splice(destIdx, 0, fLiColl_1.splice(srcIdx, 1)[0]);
|
|
14037
14349
|
if (!value) {
|
|
14038
|
-
var
|
|
14039
|
-
for (var i = 0; i <
|
|
14040
|
-
if (
|
|
14041
|
-
li_1 =
|
|
14350
|
+
var liCollElem_1 = _this.getItems();
|
|
14351
|
+
for (var i = 0; i < liCollElem_1.length; i++) {
|
|
14352
|
+
if (liCollElem_1[i].getAttribute('data-value') === null && liCollElem_1[i].classList.contains('e-list-item')) {
|
|
14353
|
+
li_1 = liCollElem_1[i];
|
|
14042
14354
|
break;
|
|
14043
14355
|
}
|
|
14044
14356
|
}
|
|
@@ -14088,10 +14400,17 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
14088
14400
|
dragArgs = extend(dragArgs, { destination: dragArgs1 });
|
|
14089
14401
|
}
|
|
14090
14402
|
this.trigger('drop', dragArgs);
|
|
14403
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14404
|
+
var liCollElem = dragArgs.elements;
|
|
14405
|
+
if (liCollElem.length) {
|
|
14406
|
+
for (var i = 0; i < liCollElem.length; i++) {
|
|
14407
|
+
liCollElem[i].classList.remove('e-grabbed');
|
|
14408
|
+
}
|
|
14409
|
+
}
|
|
14091
14410
|
};
|
|
14092
14411
|
ListBox.prototype.updateListItems = function (sourceElem, destElem) {
|
|
14093
14412
|
var i = 0;
|
|
14094
|
-
destElem.innerHTML =
|
|
14413
|
+
destElem.innerHTML = '';
|
|
14095
14414
|
while (i < sourceElem.childNodes.length) {
|
|
14096
14415
|
destElem.appendChild(sourceElem.childNodes[i]);
|
|
14097
14416
|
}
|
|
@@ -14120,6 +14439,14 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
14120
14439
|
}
|
|
14121
14440
|
return listObj;
|
|
14122
14441
|
};
|
|
14442
|
+
/**
|
|
14443
|
+
* Sets the enabled state to DropDownBase.
|
|
14444
|
+
*
|
|
14445
|
+
* @returns {void}
|
|
14446
|
+
*/
|
|
14447
|
+
ListBox.prototype.setEnabled = function () {
|
|
14448
|
+
this.element.setAttribute('aria-disabled', (this.enabled) ? 'false' : 'true');
|
|
14449
|
+
};
|
|
14123
14450
|
ListBox.prototype.listOption = function (dataSource, fields) {
|
|
14124
14451
|
this.listCurrentOptions = _super.prototype.listOption.call(this, dataSource, fields);
|
|
14125
14452
|
this.listCurrentOptions = extend({}, this.listCurrentOptions, { itemCreated: this.triggerBeforeItemRender.bind(this) }, true);
|
|
@@ -14280,7 +14607,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
14280
14607
|
if (this.listData.length === 0) {
|
|
14281
14608
|
this.l10nUpdate();
|
|
14282
14609
|
}
|
|
14283
|
-
this.value =
|
|
14610
|
+
this.value = [];
|
|
14284
14611
|
this.updateToolBarState();
|
|
14285
14612
|
};
|
|
14286
14613
|
/**
|
|
@@ -14569,9 +14896,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
14569
14896
|
prepend([this.filterParent], this.list);
|
|
14570
14897
|
attributes(this.filterInput, {
|
|
14571
14898
|
'aria-disabled': 'false',
|
|
14572
|
-
'aria-
|
|
14573
|
-
'role': 'listbox',
|
|
14574
|
-
'aria-activedescendant': null,
|
|
14899
|
+
'aria-label': 'search list item',
|
|
14575
14900
|
'autocomplete': 'off',
|
|
14576
14901
|
'autocorrect': 'off',
|
|
14577
14902
|
'autocapitalize': 'off',
|
|
@@ -14608,12 +14933,12 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
14608
14933
|
if (li && li.parentElement) {
|
|
14609
14934
|
currSelIdx = [].slice.call(li.parentElement.children).indexOf(li);
|
|
14610
14935
|
if (!this.selectionSettings.showCheckbox) {
|
|
14611
|
-
if ((e.ctrlKey || Browser.isDevice) && this.isSelected(li)) {
|
|
14936
|
+
if ((e.ctrlKey || e.metaKey || Browser.isDevice) && this.isSelected(li)) {
|
|
14612
14937
|
li.classList.remove(cssClass.selected);
|
|
14613
14938
|
li.removeAttribute('aria-selected');
|
|
14614
14939
|
isSelect = false;
|
|
14615
14940
|
}
|
|
14616
|
-
else if (!(this.selectionSettings.mode === 'Multiple' && (e.ctrlKey || Browser.isDevice))) {
|
|
14941
|
+
else if (!(this.selectionSettings.mode === 'Multiple' && (e.ctrlKey || e.metaKey || Browser.isDevice))) {
|
|
14617
14942
|
this.getSelectedItems().forEach(function (ele) {
|
|
14618
14943
|
ele.removeAttribute('aria-selected');
|
|
14619
14944
|
});
|
|
@@ -14973,7 +15298,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
14973
15298
|
var isRefresh = tListBox.sortOrder !== 'None' || (tListBox.selectionSettings.showCheckbox !==
|
|
14974
15299
|
fListBox.selectionSettings.showCheckbox) || tListBox.fields.groupBy || tListBox.itemTemplate || fListBox.itemTemplate;
|
|
14975
15300
|
this.removeSelected(fListBox, fListBox.getSelectedItems());
|
|
14976
|
-
var tempItems = [].slice.call(fListBox.
|
|
15301
|
+
var tempItems = [].slice.call(fListBox.listData);
|
|
14977
15302
|
var localDataArgs = { cancel: false, items: tempItems, eventName: this.toolbarAction };
|
|
14978
15303
|
fListBox.trigger('actionBegin', localDataArgs);
|
|
14979
15304
|
if (localDataArgs.cancel) {
|
|
@@ -15018,9 +15343,27 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
15018
15343
|
fListBox.value = [];
|
|
15019
15344
|
listData = listData
|
|
15020
15345
|
.filter(function (data) { return data.isHeader !== true; });
|
|
15346
|
+
var sortedData = listData.filter(function (val) {
|
|
15347
|
+
return tListBox.jsonData.indexOf(val) === -1;
|
|
15348
|
+
});
|
|
15349
|
+
for (var i = 0; i < sortedData.length; i++) {
|
|
15350
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15351
|
+
tListBox.jsonData.splice(index + i, 0, sortedData[i]);
|
|
15352
|
+
}
|
|
15021
15353
|
tListBox.listData = listData;
|
|
15022
|
-
|
|
15023
|
-
|
|
15354
|
+
if (fListBox.listData.length === fListBox.jsonData.length) {
|
|
15355
|
+
fListBox.listData = fListBox.sortedData = fListBox.jsonData = [];
|
|
15356
|
+
}
|
|
15357
|
+
else if (fListBox.allowFiltering) {
|
|
15358
|
+
for (var i = 0; i < fListBox.listData.length; i++) {
|
|
15359
|
+
for (var j = 0; j < fListBox.jsonData.length; j++) {
|
|
15360
|
+
if (fListBox.listData[i] === fListBox.jsonData[j]) {
|
|
15361
|
+
fListBox.jsonData.splice(j, 1);
|
|
15362
|
+
}
|
|
15363
|
+
}
|
|
15364
|
+
}
|
|
15365
|
+
fListBox.listData = fListBox.sortedData = [];
|
|
15366
|
+
}
|
|
15024
15367
|
if (isRefresh) {
|
|
15025
15368
|
var sourceElem = tListBox.renderItems(listData, tListBox.fields);
|
|
15026
15369
|
tListBox.updateListItems(sourceElem, tListBox.ulElement);
|
|
@@ -15074,21 +15417,35 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
15074
15417
|
}
|
|
15075
15418
|
return listObj;
|
|
15076
15419
|
};
|
|
15077
|
-
ListBox.prototype.getGrabbedItems = function () {
|
|
15420
|
+
ListBox.prototype.getGrabbedItems = function (args) {
|
|
15421
|
+
var grabbItems = false;
|
|
15078
15422
|
for (var i = 0; i < this.value.length; i++) {
|
|
15079
|
-
if (this.value[i] === this.
|
|
15423
|
+
if (this.value[i] === this.getFormattedValue(args.target.getAttribute('data-value'))) {
|
|
15424
|
+
grabbItems = true;
|
|
15425
|
+
break;
|
|
15426
|
+
}
|
|
15427
|
+
}
|
|
15428
|
+
if (grabbItems) {
|
|
15429
|
+
for (var i = 0; i < this.value.length; i++) {
|
|
15080
15430
|
var liColl = this.list.querySelectorAll('[aria-selected="true"]');
|
|
15081
|
-
for (var
|
|
15082
|
-
liColl[
|
|
15431
|
+
for (var j = 0; j < liColl.length; j++) {
|
|
15432
|
+
if (this.value[i] === this.getFormattedValue(liColl[j].getAttribute('data-value'))) {
|
|
15433
|
+
liColl[j].classList.add('e-grabbed');
|
|
15434
|
+
}
|
|
15083
15435
|
}
|
|
15084
|
-
break;
|
|
15085
15436
|
}
|
|
15086
15437
|
}
|
|
15087
|
-
var elems
|
|
15438
|
+
var elems;
|
|
15439
|
+
if (this.isAngular) {
|
|
15440
|
+
elems = Array.prototype.slice.call(this.element.getElementsByClassName('e-list-parent')[0].querySelectorAll('.e-grabbed'));
|
|
15441
|
+
}
|
|
15442
|
+
else {
|
|
15443
|
+
elems = Array.prototype.slice.call(this.element.nextElementSibling.querySelectorAll('.e-grabbed'));
|
|
15444
|
+
}
|
|
15088
15445
|
return elems;
|
|
15089
15446
|
};
|
|
15090
15447
|
ListBox.prototype.getDragArgs = function (args, isDragEnd) {
|
|
15091
|
-
var elems = this.getGrabbedItems();
|
|
15448
|
+
var elems = this.getGrabbedItems(args);
|
|
15092
15449
|
if (elems.length) {
|
|
15093
15450
|
if (isDragEnd) {
|
|
15094
15451
|
elems.push(args.target);
|
|
@@ -15140,7 +15497,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
15140
15497
|
}
|
|
15141
15498
|
}
|
|
15142
15499
|
}
|
|
15143
|
-
else if (e.keyCode !== 37 && e.keyCode !== 39 && e.code !==
|
|
15500
|
+
else if (e.keyCode !== 37 && e.keyCode !== 39 && e.code !== 'KeyA') {
|
|
15144
15501
|
this.upDownKeyHandler(e);
|
|
15145
15502
|
}
|
|
15146
15503
|
}
|
|
@@ -15184,8 +15541,8 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
15184
15541
|
}
|
|
15185
15542
|
if (this.selectionSettings.showCheckbox && e.ctrlKey && e.shiftKey && (e.keyCode === 36 || e.keyCode === 35)) {
|
|
15186
15543
|
var selectedidx = Array.prototype.indexOf.call(ul.children, fli);
|
|
15187
|
-
var sidx = e.code ===
|
|
15188
|
-
var eidx = e.code ===
|
|
15544
|
+
var sidx = e.code === 'Home' ? 0 : selectedidx;
|
|
15545
|
+
var eidx = e.code === 'Home' ? selectedidx : ul.children.length - 1;
|
|
15189
15546
|
for (var i = sidx; i <= eidx; i++) {
|
|
15190
15547
|
var item = ul.children[i];
|
|
15191
15548
|
this.notify('updatelist', { li: item, e: {
|
|
@@ -15343,7 +15700,6 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
15343
15700
|
dvalue_1 = _this.getFormattedValue(li.getAttribute('data-value'));
|
|
15344
15701
|
if (values.indexOf(dvalue_1) < 0) {
|
|
15345
15702
|
li.getElementsByClassName('e-check')[0].classList.remove('e-check');
|
|
15346
|
-
li.getElementsByClassName('e-checkbox-wrapper')[0].removeAttribute('aria-checked');
|
|
15347
15703
|
li.removeAttribute('aria-selected');
|
|
15348
15704
|
}
|
|
15349
15705
|
});
|
|
@@ -15365,6 +15721,9 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
15365
15721
|
else {
|
|
15366
15722
|
text = value;
|
|
15367
15723
|
}
|
|
15724
|
+
if (typeof (text) === 'string') {
|
|
15725
|
+
text = text.split("\\").join("\\\\");
|
|
15726
|
+
}
|
|
15368
15727
|
li = _this.list.querySelector('[data-value="' + text + '"]');
|
|
15369
15728
|
if (li) {
|
|
15370
15729
|
if (_this.selectionSettings.showCheckbox) {
|
|
@@ -15695,6 +16054,12 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
15695
16054
|
__decorate$6([
|
|
15696
16055
|
Property('')
|
|
15697
16056
|
], ListBox.prototype, "height", void 0);
|
|
16057
|
+
__decorate$6([
|
|
16058
|
+
Property(true)
|
|
16059
|
+
], ListBox.prototype, "enabled", void 0);
|
|
16060
|
+
__decorate$6([
|
|
16061
|
+
Property(false)
|
|
16062
|
+
], ListBox.prototype, "enablePersistence", void 0);
|
|
15698
16063
|
__decorate$6([
|
|
15699
16064
|
Property(false)
|
|
15700
16065
|
], ListBox.prototype, "allowDragAndDrop", void 0);
|
|
@@ -15771,6 +16136,1468 @@ var listBoxClasses = {
|
|
|
15771
16136
|
clearIcon: 'e-clear-icon'
|
|
15772
16137
|
};
|
|
15773
16138
|
|
|
16139
|
+
/**
|
|
16140
|
+
* export all modules from current location
|
|
16141
|
+
*/
|
|
16142
|
+
|
|
16143
|
+
var __extends$7 = (undefined && undefined.__extends) || (function () {
|
|
16144
|
+
var extendStatics = function (d, b) {
|
|
16145
|
+
extendStatics = Object.setPrototypeOf ||
|
|
16146
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
16147
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
16148
|
+
return extendStatics(d, b);
|
|
16149
|
+
};
|
|
16150
|
+
return function (d, b) {
|
|
16151
|
+
extendStatics(d, b);
|
|
16152
|
+
function __() { this.constructor = d; }
|
|
16153
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
16154
|
+
};
|
|
16155
|
+
})();
|
|
16156
|
+
var __decorate$7 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
16157
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16158
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
16159
|
+
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;
|
|
16160
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
16161
|
+
};
|
|
16162
|
+
/**
|
|
16163
|
+
* The Mention component is used to list someone or something based on user input in textarea, input,
|
|
16164
|
+
* or any other editable element from which the user can select.
|
|
16165
|
+
*/
|
|
16166
|
+
var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
16167
|
+
__extends$7(Mention, _super);
|
|
16168
|
+
/**
|
|
16169
|
+
* * Constructor for creating the widget
|
|
16170
|
+
*
|
|
16171
|
+
* @param {MentionModel} options - Specifies the MentionComponent model.
|
|
16172
|
+
* @param {string | HTMLElement} element - Specifies the element to render as component.
|
|
16173
|
+
* @private
|
|
16174
|
+
*/
|
|
16175
|
+
function Mention(options, element) {
|
|
16176
|
+
return _super.call(this, options, element) || this;
|
|
16177
|
+
}
|
|
16178
|
+
/**
|
|
16179
|
+
* When property value changes happened, then onPropertyChanged method will execute the respective changes in this component.
|
|
16180
|
+
*
|
|
16181
|
+
* @param {MentionModel} newProp - Returns the dynamic property value of the component.
|
|
16182
|
+
* @param {MentionModel} oldProp - Returns the previous property value of the component.
|
|
16183
|
+
* @private
|
|
16184
|
+
* @returns {void}
|
|
16185
|
+
*/
|
|
16186
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
16187
|
+
Mention.prototype.onPropertyChanged = function (newProp, oldProp) {
|
|
16188
|
+
for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
|
|
16189
|
+
var prop = _a[_i];
|
|
16190
|
+
switch (prop) {
|
|
16191
|
+
case 'minLength':
|
|
16192
|
+
this.minLength = newProp.minLength;
|
|
16193
|
+
break;
|
|
16194
|
+
case 'suffixText':
|
|
16195
|
+
this.suffixText = newProp.suffixText;
|
|
16196
|
+
break;
|
|
16197
|
+
case 'allowSpaces':
|
|
16198
|
+
this.allowSpaces = newProp.allowSpaces;
|
|
16199
|
+
break;
|
|
16200
|
+
case 'mentionChar':
|
|
16201
|
+
this.mentionChar = newProp.mentionChar;
|
|
16202
|
+
break;
|
|
16203
|
+
case 'showMentionChar':
|
|
16204
|
+
this.showMentionChar = newProp.showMentionChar;
|
|
16205
|
+
break;
|
|
16206
|
+
case 'cssClass':
|
|
16207
|
+
this.updateCssClass(newProp.cssClass, oldProp.cssClass);
|
|
16208
|
+
break;
|
|
16209
|
+
}
|
|
16210
|
+
}
|
|
16211
|
+
};
|
|
16212
|
+
Mention.prototype.updateCssClass = function (newClass, oldClass) {
|
|
16213
|
+
if (!isNullOrUndefined(oldClass)) {
|
|
16214
|
+
oldClass = (oldClass.replace(/\s+/g, ' ')).trim();
|
|
16215
|
+
}
|
|
16216
|
+
if (!isNullOrUndefined(newClass)) {
|
|
16217
|
+
newClass = (newClass.replace(/\s+/g, ' ')).trim();
|
|
16218
|
+
}
|
|
16219
|
+
this.setCssClass(newClass, [this.inputElement], oldClass);
|
|
16220
|
+
if (this.popupObj) {
|
|
16221
|
+
this.setCssClass(newClass, [this.popupObj.element], oldClass);
|
|
16222
|
+
}
|
|
16223
|
+
};
|
|
16224
|
+
Mention.prototype.setCssClass = function (cssClass$$1, elements, oldClass) {
|
|
16225
|
+
if (!isNullOrUndefined(oldClass) && oldClass !== '') {
|
|
16226
|
+
removeClass(elements, oldClass.split(' '));
|
|
16227
|
+
}
|
|
16228
|
+
if (!isNullOrUndefined(cssClass$$1) && cssClass$$1 !== '') {
|
|
16229
|
+
addClass(elements, cssClass$$1.split(' '));
|
|
16230
|
+
}
|
|
16231
|
+
};
|
|
16232
|
+
Mention.prototype.initializeData = function () {
|
|
16233
|
+
this.isSelected = false;
|
|
16234
|
+
this.isFiltered = false;
|
|
16235
|
+
this.beforePopupOpen = false;
|
|
16236
|
+
this.initRemoteRender = false;
|
|
16237
|
+
this.isListResetted = false;
|
|
16238
|
+
this.isPopupOpen = false;
|
|
16239
|
+
this.isCollided = false;
|
|
16240
|
+
this.lineBreak = false;
|
|
16241
|
+
this.keyConfigure = {
|
|
16242
|
+
tab: 'tab',
|
|
16243
|
+
enter: '13',
|
|
16244
|
+
escape: '27',
|
|
16245
|
+
end: '35',
|
|
16246
|
+
home: '36',
|
|
16247
|
+
down: '40',
|
|
16248
|
+
up: '38',
|
|
16249
|
+
pageUp: '33',
|
|
16250
|
+
pageDown: '34',
|
|
16251
|
+
open: 'alt+40',
|
|
16252
|
+
close: 'shift+tab',
|
|
16253
|
+
hide: 'alt+38',
|
|
16254
|
+
space: '32'
|
|
16255
|
+
};
|
|
16256
|
+
};
|
|
16257
|
+
/**
|
|
16258
|
+
* Execute before render the list items
|
|
16259
|
+
*
|
|
16260
|
+
* @private
|
|
16261
|
+
* @returns {void}
|
|
16262
|
+
*/
|
|
16263
|
+
Mention.prototype.preRender = function () {
|
|
16264
|
+
this.initializeData();
|
|
16265
|
+
_super.prototype.preRender.call(this);
|
|
16266
|
+
};
|
|
16267
|
+
/**
|
|
16268
|
+
* To Initialize the control rendering
|
|
16269
|
+
*
|
|
16270
|
+
* @private
|
|
16271
|
+
* @returns {void}
|
|
16272
|
+
*/
|
|
16273
|
+
Mention.prototype.render = function () {
|
|
16274
|
+
this.inputElement = !isNullOrUndefined(this.target) ? ((typeof this.target) === 'string') ?
|
|
16275
|
+
document.querySelector(this.target) : this.target : this.element;
|
|
16276
|
+
if (this.isContentEditable(this.inputElement)) {
|
|
16277
|
+
this.inputElement.setAttribute('contenteditable', 'true');
|
|
16278
|
+
addClass([this.inputElement], ['e-mention']);
|
|
16279
|
+
if (isNullOrUndefined(this.target)) {
|
|
16280
|
+
addClass([this.inputElement], ['e-editable-element']);
|
|
16281
|
+
}
|
|
16282
|
+
}
|
|
16283
|
+
this.queryString = this.elementValue();
|
|
16284
|
+
this.wireEvent();
|
|
16285
|
+
};
|
|
16286
|
+
Mention.prototype.wireEvent = function () {
|
|
16287
|
+
EventHandler.add(this.inputElement, 'keyup', this.onKeyUp, this);
|
|
16288
|
+
this.bindCommonEvent();
|
|
16289
|
+
};
|
|
16290
|
+
Mention.prototype.unWireEvent = function () {
|
|
16291
|
+
EventHandler.remove(this.inputElement, 'keyup', this.onKeyUp);
|
|
16292
|
+
this.unBindCommonEvent();
|
|
16293
|
+
};
|
|
16294
|
+
Mention.prototype.bindCommonEvent = function () {
|
|
16295
|
+
if (!Browser.isDevice) {
|
|
16296
|
+
this.keyboardModule = new KeyboardEvents(this.inputElement, {
|
|
16297
|
+
keyAction: this.keyActionHandler.bind(this), keyConfigs: this.keyConfigure, eventName: 'keydown'
|
|
16298
|
+
});
|
|
16299
|
+
}
|
|
16300
|
+
};
|
|
16301
|
+
/**
|
|
16302
|
+
* Hides the spinner loader.
|
|
16303
|
+
*
|
|
16304
|
+
* @private
|
|
16305
|
+
* @returns {void}
|
|
16306
|
+
*/
|
|
16307
|
+
Mention.prototype.hideSpinner = function () {
|
|
16308
|
+
this.hideWaitingSpinner();
|
|
16309
|
+
};
|
|
16310
|
+
Mention.prototype.hideWaitingSpinner = function () {
|
|
16311
|
+
if (!isNullOrUndefined(this.spinnerElement)) {
|
|
16312
|
+
hideSpinner(this.spinnerElement);
|
|
16313
|
+
}
|
|
16314
|
+
if (!isNullOrUndefined(this.spinnerTemplate) && !isNullOrUndefined(this.spinnerTemplateElement)) {
|
|
16315
|
+
detach(this.spinnerTemplateElement);
|
|
16316
|
+
}
|
|
16317
|
+
};
|
|
16318
|
+
/**
|
|
16319
|
+
* Shows the spinner loader.
|
|
16320
|
+
*
|
|
16321
|
+
* @returns {void}
|
|
16322
|
+
*/
|
|
16323
|
+
Mention.prototype.showWaitingSpinner = function () {
|
|
16324
|
+
if (!isNullOrUndefined(this.popupObj)) {
|
|
16325
|
+
if (isNullOrUndefined(this.spinnerTemplate) && isNullOrUndefined(this.spinnerElement)) {
|
|
16326
|
+
this.spinnerElement = this.popupObj.element;
|
|
16327
|
+
createSpinner({
|
|
16328
|
+
target: this.spinnerElement,
|
|
16329
|
+
width: Browser.isDevice ? '16px' : '14px'
|
|
16330
|
+
}, this.createElement);
|
|
16331
|
+
showSpinner(this.spinnerElement);
|
|
16332
|
+
}
|
|
16333
|
+
if (!isNullOrUndefined(this.spinnerTemplate)) {
|
|
16334
|
+
this.setSpinnerTemplate();
|
|
16335
|
+
}
|
|
16336
|
+
}
|
|
16337
|
+
};
|
|
16338
|
+
Mention.prototype.keyActionHandler = function (e) {
|
|
16339
|
+
var isNavigation = (e.action === 'down' || e.action === 'up' || e.action === 'pageUp' || e.action === 'pageDown'
|
|
16340
|
+
|| e.action === 'home' || e.action === 'end');
|
|
16341
|
+
var isTabAction = e.action === 'tab' || e.action === 'close';
|
|
16342
|
+
if (this.list === undefined && !this.isRequested && !isTabAction && e.action !== 'escape' && e.action !== 'space') {
|
|
16343
|
+
this.renderList();
|
|
16344
|
+
}
|
|
16345
|
+
if (isNullOrUndefined(this.list) || (!isNullOrUndefined(this.liCollections) &&
|
|
16346
|
+
isNavigation && this.liCollections.length === 0) || this.isRequested) {
|
|
16347
|
+
return;
|
|
16348
|
+
}
|
|
16349
|
+
if (e.action === 'escape') {
|
|
16350
|
+
e.preventDefault();
|
|
16351
|
+
}
|
|
16352
|
+
this.isSelected = e.action === 'escape' ? false : this.isSelected;
|
|
16353
|
+
switch (e.action) {
|
|
16354
|
+
case 'down':
|
|
16355
|
+
case 'up':
|
|
16356
|
+
this.updateUpDownAction(e);
|
|
16357
|
+
break;
|
|
16358
|
+
case 'tab':
|
|
16359
|
+
if (this.isPopupOpen) {
|
|
16360
|
+
e.preventDefault();
|
|
16361
|
+
var li = this.list.querySelector('.' + dropDownBaseClasses.selected);
|
|
16362
|
+
if (li) {
|
|
16363
|
+
this.setSelection(li, e);
|
|
16364
|
+
}
|
|
16365
|
+
if (this.isPopupOpen) {
|
|
16366
|
+
this.hidePopup(e);
|
|
16367
|
+
}
|
|
16368
|
+
}
|
|
16369
|
+
break;
|
|
16370
|
+
case 'enter':
|
|
16371
|
+
if (this.isPopupOpen) {
|
|
16372
|
+
e.preventDefault();
|
|
16373
|
+
if (this.popupObj && this.popupObj.element.contains(this.selectedLI)) {
|
|
16374
|
+
this.setValue(e);
|
|
16375
|
+
}
|
|
16376
|
+
}
|
|
16377
|
+
break;
|
|
16378
|
+
case 'escape':
|
|
16379
|
+
if (this.isPopupOpen) {
|
|
16380
|
+
this.hidePopup(e);
|
|
16381
|
+
}
|
|
16382
|
+
break;
|
|
16383
|
+
}
|
|
16384
|
+
};
|
|
16385
|
+
Mention.prototype.updateUpDownAction = function (e) {
|
|
16386
|
+
var focusEle = this.list.querySelector('.' + dropDownBaseClasses.focus);
|
|
16387
|
+
if (this.isSelectFocusItem(focusEle)) {
|
|
16388
|
+
this.setSelection(focusEle, e);
|
|
16389
|
+
}
|
|
16390
|
+
else if (!isNullOrUndefined(this.liCollections)) {
|
|
16391
|
+
var li = this.list.querySelector('.' + dropDownBaseClasses.selected);
|
|
16392
|
+
if (!isNullOrUndefined(li)) {
|
|
16393
|
+
var value = this.getFormattedValue(li.getAttribute('data-value'));
|
|
16394
|
+
this.activeIndex = this.getIndexByValue(value);
|
|
16395
|
+
}
|
|
16396
|
+
var index = e.action === 'down' ? this.activeIndex + 1 : this.activeIndex - 1;
|
|
16397
|
+
var startIndex = 0;
|
|
16398
|
+
startIndex = e.action === 'down' && isNullOrUndefined(this.activeIndex) ? 0 : this.liCollections.length - 1;
|
|
16399
|
+
index = index < 0 ? this.liCollections.length - 1 : index === this.liCollections.length ? 0 : index;
|
|
16400
|
+
var nextItem = isNullOrUndefined(this.activeIndex) ?
|
|
16401
|
+
this.liCollections[startIndex] : this.liCollections[index];
|
|
16402
|
+
if (!isNullOrUndefined(nextItem)) {
|
|
16403
|
+
this.setSelection(nextItem, e);
|
|
16404
|
+
}
|
|
16405
|
+
}
|
|
16406
|
+
if (this.isPopupOpen) {
|
|
16407
|
+
e.preventDefault();
|
|
16408
|
+
}
|
|
16409
|
+
};
|
|
16410
|
+
Mention.prototype.isSelectFocusItem = function (element) {
|
|
16411
|
+
return !isNullOrUndefined(element);
|
|
16412
|
+
};
|
|
16413
|
+
Mention.prototype.unBindCommonEvent = function () {
|
|
16414
|
+
if (!Browser.isDevice) {
|
|
16415
|
+
this.keyboardModule.destroy();
|
|
16416
|
+
}
|
|
16417
|
+
};
|
|
16418
|
+
Mention.prototype.onKeyUp = function (e) {
|
|
16419
|
+
var rangetextContent;
|
|
16420
|
+
if (this.isContentEditable(this.inputElement)) {
|
|
16421
|
+
this.range = this.getCurrentRange();
|
|
16422
|
+
rangetextContent = this.range.startContainer.textContent.split('');
|
|
16423
|
+
}
|
|
16424
|
+
var currentRange = this.getTextRange();
|
|
16425
|
+
var lastWordRange = this.getLastLetter(currentRange);
|
|
16426
|
+
// eslint-disable-next-line security/detect-non-literal-regexp
|
|
16427
|
+
var Regex = new RegExp(this.mentionChar, 'g');
|
|
16428
|
+
var charRegex = new RegExp('[a-zA-Z]', 'g');
|
|
16429
|
+
if (e.key === 'Shift' || e.keyCode === 37 || e.keyCode === 39) {
|
|
16430
|
+
if ((e.keyCode === 37 || e.keyCode === 39) && !isNullOrUndefined(currentRange) &&
|
|
16431
|
+
currentRange.indexOf(this.mentionChar) === -1 && this.isPopupOpen) {
|
|
16432
|
+
this.hidePopup();
|
|
16433
|
+
}
|
|
16434
|
+
return;
|
|
16435
|
+
}
|
|
16436
|
+
if ((!currentRange || !lastWordRange) || e.code === 'Enter' || e.keyCode === 27 ||
|
|
16437
|
+
(lastWordRange.match(Regex) && lastWordRange.match(Regex).length > 1) ||
|
|
16438
|
+
(this.isContentEditable(this.inputElement) && this.range.startContainer &&
|
|
16439
|
+
this.range.startContainer.previousElementSibling && this.range.startContainer.textContent.split('').length > 0 &&
|
|
16440
|
+
(rangetextContent.length === 1 || rangetextContent[rangetextContent.length - 2].indexOf('') === -1 ||
|
|
16441
|
+
this.range.startContainer.nodeType === 1))) {
|
|
16442
|
+
if (this.allowSpaces && currentRange && currentRange.trim() !== '' && charRegex.test(currentRange) && currentRange.indexOf(this.mentionChar) !== -1
|
|
16443
|
+
&& !this.isMatchedText() && (currentRange.length > 1 && currentRange.replace(/\u00A0/g, ' ').charAt(currentRange.length - 2) !== ' ') &&
|
|
16444
|
+
(this.list && this.list.querySelectorAll('ul').length > 0)) {
|
|
16445
|
+
this.queryString = currentRange.substring(currentRange.lastIndexOf(this.mentionChar) + 1).replace('\u00a0', ' ');
|
|
16446
|
+
this.searchLists(e);
|
|
16447
|
+
}
|
|
16448
|
+
else if (this.isPopupOpen && (!this.allowSpaces || !lastWordRange)) {
|
|
16449
|
+
this.hidePopup();
|
|
16450
|
+
this.lineBreak = true;
|
|
16451
|
+
}
|
|
16452
|
+
return;
|
|
16453
|
+
}
|
|
16454
|
+
this.queryString = lastWordRange.replace(this.mentionChar, '');
|
|
16455
|
+
if (this.mentionChar.charCodeAt(0) === lastWordRange.charCodeAt(0) &&
|
|
16456
|
+
this.queryString !== '' && e.keyCode !== 38 && e.keyCode !== 40 && !this.lineBreak) {
|
|
16457
|
+
this.searchLists(e);
|
|
16458
|
+
if (!this.isPopupOpen && this.queryString.length >= this.minLength) {
|
|
16459
|
+
if (!this.isContentEditable(this.inputElement)) {
|
|
16460
|
+
this.showPopup();
|
|
16461
|
+
}
|
|
16462
|
+
else if (this.isContentEditable(this.inputElement) && this.range && this.range.startContainer !== this.inputElement && e.keyCode !== 9) {
|
|
16463
|
+
this.showPopup();
|
|
16464
|
+
}
|
|
16465
|
+
}
|
|
16466
|
+
}
|
|
16467
|
+
else if (lastWordRange.indexOf(this.mentionChar) === 0 && !this.isPopupOpen && e.keyCode !== 8 && (!this.popupObj ||
|
|
16468
|
+
(isNullOrUndefined(this.target) && !document.body.contains(this.popupObj.element) ||
|
|
16469
|
+
!isNullOrUndefined(this.target) && document.body.contains(this.popupObj.element)))) {
|
|
16470
|
+
if (this.initRemoteRender && this.list && this.list.classList.contains('e-nodata')) {
|
|
16471
|
+
this.searchLists(e);
|
|
16472
|
+
}
|
|
16473
|
+
this.resetList(this.dataSource, this.fields);
|
|
16474
|
+
if (isNullOrUndefined(this.list)) {
|
|
16475
|
+
this.initValue();
|
|
16476
|
+
}
|
|
16477
|
+
if (!this.isPopupOpen && e.keyCode !== 38 && e.keyCode !== 40) {
|
|
16478
|
+
this.showPopup();
|
|
16479
|
+
if (this.initRemoteRender && this.list.querySelectorAll('li').length === 0) {
|
|
16480
|
+
this.showWaitingSpinner();
|
|
16481
|
+
}
|
|
16482
|
+
this.lineBreak = false;
|
|
16483
|
+
}
|
|
16484
|
+
}
|
|
16485
|
+
else if (this.allowSpaces && this.queryString !== '' && currentRange && currentRange.trim() !== '' && currentRange.replace('\u00a0', ' ').lastIndexOf(' ') < currentRange.length - 1 &&
|
|
16486
|
+
e.keyCode !== 38 && e.keyCode !== 40 && e.keyCode !== 8 && this.mentionChar.charCodeAt(0) === lastWordRange.charCodeAt(0)) {
|
|
16487
|
+
this.queryString = currentRange.substring(currentRange.lastIndexOf(this.mentionChar) + 1).replace('\u00a0', ' ');
|
|
16488
|
+
this.searchLists(e);
|
|
16489
|
+
}
|
|
16490
|
+
else if (this.queryString === '' && this.isPopupOpen && e.keyCode !== 38 && e.keyCode !== 40 && this.mentionChar.charCodeAt(0) === lastWordRange.charCodeAt(0)) {
|
|
16491
|
+
this.searchLists(e);
|
|
16492
|
+
if (!this.isListResetted) {
|
|
16493
|
+
this.resetList(this.dataSource, this.fields);
|
|
16494
|
+
}
|
|
16495
|
+
}
|
|
16496
|
+
this.isListResetted = false;
|
|
16497
|
+
};
|
|
16498
|
+
Mention.prototype.isMatchedText = function () {
|
|
16499
|
+
var isMatched = false;
|
|
16500
|
+
for (var i = 0; i < (this.liCollections && this.liCollections.length); i++) {
|
|
16501
|
+
if (this.getTextRange() &&
|
|
16502
|
+
this.getTextRange().substring(this.getTextRange().lastIndexOf(this.mentionChar) + 1).replace('\u00a0', ' ').trim() === this.liCollections[i].getAttribute('data-value').toLowerCase()) {
|
|
16503
|
+
isMatched = true;
|
|
16504
|
+
}
|
|
16505
|
+
}
|
|
16506
|
+
return isMatched;
|
|
16507
|
+
};
|
|
16508
|
+
Mention.prototype.getCurrentRange = function () {
|
|
16509
|
+
this.range = this.inputElement.ownerDocument.getSelection().getRangeAt(0);
|
|
16510
|
+
return this.range;
|
|
16511
|
+
};
|
|
16512
|
+
Mention.prototype.searchLists = function (e) {
|
|
16513
|
+
var _this = this;
|
|
16514
|
+
this.isDataFetched = false;
|
|
16515
|
+
if (isNullOrUndefined(this.list)) {
|
|
16516
|
+
_super.prototype.render.call(this);
|
|
16517
|
+
this.unWireListEvents();
|
|
16518
|
+
this.wireListEvents();
|
|
16519
|
+
}
|
|
16520
|
+
if (e.type !== 'mousedown' && (e.keyCode === 40 || e.keyCode === 38)) {
|
|
16521
|
+
this.queryString = this.queryString === '' ? null : this.queryString;
|
|
16522
|
+
this.beforePopupOpen = true;
|
|
16523
|
+
this.resetList(this.dataSource, this.fields);
|
|
16524
|
+
return;
|
|
16525
|
+
}
|
|
16526
|
+
this.isSelected = false;
|
|
16527
|
+
this.activeIndex = null;
|
|
16528
|
+
var eventArgs = {
|
|
16529
|
+
preventDefaultAction: false,
|
|
16530
|
+
text: this.queryString,
|
|
16531
|
+
updateData: function (dataSource, query, fields) {
|
|
16532
|
+
if (eventArgs.cancel) {
|
|
16533
|
+
return;
|
|
16534
|
+
}
|
|
16535
|
+
_this.isFiltered = true;
|
|
16536
|
+
_this.filterAction(dataSource, query, fields);
|
|
16537
|
+
},
|
|
16538
|
+
cancel: false
|
|
16539
|
+
};
|
|
16540
|
+
this.trigger('filtering', eventArgs, function (eventArgs) {
|
|
16541
|
+
if (!eventArgs.cancel && !_this.isFiltered && !eventArgs.preventDefaultAction) {
|
|
16542
|
+
_this.filterAction(_this.dataSource, null, _this.fields);
|
|
16543
|
+
}
|
|
16544
|
+
});
|
|
16545
|
+
};
|
|
16546
|
+
Mention.prototype.filterAction = function (dataSource, query, fields) {
|
|
16547
|
+
this.beforePopupOpen = true;
|
|
16548
|
+
if (this.queryString.length >= this.minLength) {
|
|
16549
|
+
this.resetList(dataSource, fields, query);
|
|
16550
|
+
this.isListResetted = true;
|
|
16551
|
+
}
|
|
16552
|
+
else {
|
|
16553
|
+
if (this.isPopupOpen) {
|
|
16554
|
+
this.hidePopup();
|
|
16555
|
+
}
|
|
16556
|
+
this.beforePopupOpen = false;
|
|
16557
|
+
}
|
|
16558
|
+
this.setDataIndex();
|
|
16559
|
+
this.renderReactTemplates();
|
|
16560
|
+
};
|
|
16561
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
16562
|
+
Mention.prototype.onActionComplete = function (ulElement, list, e, isUpdated) {
|
|
16563
|
+
_super.prototype.onActionComplete.call(this, ulElement, list, e);
|
|
16564
|
+
if (this.isActive) {
|
|
16565
|
+
if (!isNullOrUndefined(ulElement)) {
|
|
16566
|
+
attributes(ulElement, { 'id': this.inputElement.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
|
|
16567
|
+
}
|
|
16568
|
+
var focusItem = ulElement.querySelector('.' + dropDownBaseClasses.li);
|
|
16569
|
+
if (focusItem) {
|
|
16570
|
+
focusItem.classList.add(dropDownBaseClasses.selected);
|
|
16571
|
+
this.selectedLI = focusItem;
|
|
16572
|
+
var value = this.getFormattedValue(focusItem.getAttribute('data-value'));
|
|
16573
|
+
this.selectEventCallback(focusItem, this.getDataByValue(value), value, true);
|
|
16574
|
+
}
|
|
16575
|
+
}
|
|
16576
|
+
};
|
|
16577
|
+
Mention.prototype.setDataIndex = function () {
|
|
16578
|
+
for (var i = 0; this.liCollections && i < this.liCollections.length; i++) {
|
|
16579
|
+
this.liCollections[i].setAttribute('data-index', i.toString());
|
|
16580
|
+
}
|
|
16581
|
+
};
|
|
16582
|
+
Mention.prototype.listOption = function (dataSource, fieldsSettings) {
|
|
16583
|
+
var _this = this;
|
|
16584
|
+
var fields = _super.prototype.listOption.call(this, dataSource, fieldsSettings);
|
|
16585
|
+
if (isNullOrUndefined(fields.itemCreated)) {
|
|
16586
|
+
fields.itemCreated = function (e) {
|
|
16587
|
+
if (_this.highlight) {
|
|
16588
|
+
if (_this.inputElement.tagName === _this.getNgDirective() && _this.itemTemplate) {
|
|
16589
|
+
setTimeout(function () {
|
|
16590
|
+
highlightSearch(e.item, _this.queryString, _this.ignoreCase, _this.filterType);
|
|
16591
|
+
}, 0);
|
|
16592
|
+
}
|
|
16593
|
+
else {
|
|
16594
|
+
highlightSearch(e.item, _this.queryString, _this.ignoreCase, _this.filterType);
|
|
16595
|
+
}
|
|
16596
|
+
}
|
|
16597
|
+
};
|
|
16598
|
+
}
|
|
16599
|
+
else {
|
|
16600
|
+
var itemCreated_1 = fields.itemCreated;
|
|
16601
|
+
fields.itemCreated = function (e) {
|
|
16602
|
+
if (_this.highlight) {
|
|
16603
|
+
highlightSearch(e.item, _this.queryString, _this.ignoreCase, _this.filterType);
|
|
16604
|
+
}
|
|
16605
|
+
itemCreated_1.apply(_this, [e]);
|
|
16606
|
+
};
|
|
16607
|
+
}
|
|
16608
|
+
return fields;
|
|
16609
|
+
};
|
|
16610
|
+
Mention.prototype.elementValue = function () {
|
|
16611
|
+
if (!this.isContentEditable(this.inputElement)) {
|
|
16612
|
+
return this.inputElement.value.replace(this.mentionChar, '');
|
|
16613
|
+
}
|
|
16614
|
+
else {
|
|
16615
|
+
return this.inputElement.textContent.replace(this.mentionChar, '');
|
|
16616
|
+
}
|
|
16617
|
+
};
|
|
16618
|
+
Mention.prototype.getQuery = function (query) {
|
|
16619
|
+
var filterQuery = query ? query.clone() : this.query ? this.query.clone() : new Query();
|
|
16620
|
+
var filterType = (this.queryString === '' && !isNullOrUndefined(this.elementValue())) ? 'equal' : this.filterType;
|
|
16621
|
+
var queryString = (this.queryString === '' && !isNullOrUndefined(this.elementValue())) ?
|
|
16622
|
+
this.elementValue() : this.queryString;
|
|
16623
|
+
if (this.isFiltered) {
|
|
16624
|
+
return filterQuery;
|
|
16625
|
+
}
|
|
16626
|
+
if (this.queryString !== null && this.queryString !== '') {
|
|
16627
|
+
var dataType = this.typeOfData(this.dataSource).typeof;
|
|
16628
|
+
if (!(this.dataSource instanceof DataManager) && dataType === 'string' || dataType === 'number') {
|
|
16629
|
+
filterQuery.where('', filterType, queryString, this.ignoreCase, this.ignoreAccent);
|
|
16630
|
+
}
|
|
16631
|
+
else {
|
|
16632
|
+
var mapping = !isNullOrUndefined(this.fields.text) ? this.fields.text : '';
|
|
16633
|
+
filterQuery.where(mapping, filterType, queryString, this.ignoreCase, this.ignoreAccent);
|
|
16634
|
+
}
|
|
16635
|
+
}
|
|
16636
|
+
if (!isNullOrUndefined(this.suggestionCount)) {
|
|
16637
|
+
// Since defualt value of suggestioncount is 25, checked the condition
|
|
16638
|
+
if (this.suggestionCount !== 25) {
|
|
16639
|
+
for (var queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
|
|
16640
|
+
if (filterQuery.queries[queryElements].fn === 'onTake') {
|
|
16641
|
+
filterQuery.queries.splice(queryElements, 1);
|
|
16642
|
+
}
|
|
16643
|
+
}
|
|
16644
|
+
}
|
|
16645
|
+
filterQuery.take(this.suggestionCount);
|
|
16646
|
+
}
|
|
16647
|
+
return filterQuery;
|
|
16648
|
+
};
|
|
16649
|
+
Mention.prototype.renderHightSearch = function () {
|
|
16650
|
+
if (this.highlight) {
|
|
16651
|
+
for (var i = 0; i < this.liCollections.length; i++) {
|
|
16652
|
+
var isHighlight = this.ulElement.querySelector('.e-active');
|
|
16653
|
+
if (!isHighlight) {
|
|
16654
|
+
revertHighlightSearch(this.liCollections[i]);
|
|
16655
|
+
highlightSearch(this.liCollections[i], this.queryString, this.ignoreCase, this.filterType);
|
|
16656
|
+
}
|
|
16657
|
+
}
|
|
16658
|
+
}
|
|
16659
|
+
};
|
|
16660
|
+
Mention.prototype.getTextRange = function () {
|
|
16661
|
+
var text;
|
|
16662
|
+
if (!this.isContentEditable(this.inputElement)) {
|
|
16663
|
+
var component = this.inputElement;
|
|
16664
|
+
if (!isNullOrUndefined(component)) {
|
|
16665
|
+
var startPos = component.selectionStart;
|
|
16666
|
+
if (component.value && startPos >= 0) {
|
|
16667
|
+
text = component.value.substring(0, startPos);
|
|
16668
|
+
}
|
|
16669
|
+
}
|
|
16670
|
+
}
|
|
16671
|
+
else {
|
|
16672
|
+
if (this.range) {
|
|
16673
|
+
var selectedElem = this.range.startContainer;
|
|
16674
|
+
if (!isNullOrUndefined(selectedElem)) {
|
|
16675
|
+
var workingNodeContent = selectedElem.textContent;
|
|
16676
|
+
var selectStartOffset = this.range.startOffset;
|
|
16677
|
+
if (workingNodeContent && selectStartOffset >= 0) {
|
|
16678
|
+
text = workingNodeContent.substring(0, selectStartOffset);
|
|
16679
|
+
}
|
|
16680
|
+
}
|
|
16681
|
+
}
|
|
16682
|
+
}
|
|
16683
|
+
return text;
|
|
16684
|
+
};
|
|
16685
|
+
Mention.prototype.getLastLetter = function (text) {
|
|
16686
|
+
if (isNullOrUndefined(text)) {
|
|
16687
|
+
return '';
|
|
16688
|
+
}
|
|
16689
|
+
var textValue = text.replace(/\u00A0/g, ' ');
|
|
16690
|
+
var words = textValue.split(/\s+/);
|
|
16691
|
+
var wordCnt = words.length - 1;
|
|
16692
|
+
return words[wordCnt].trim();
|
|
16693
|
+
};
|
|
16694
|
+
Mention.prototype.isContentEditable = function (element) {
|
|
16695
|
+
return element && element.nodeName !== 'INPUT' && element.nodeName !== 'TEXTAREA';
|
|
16696
|
+
};
|
|
16697
|
+
/**
|
|
16698
|
+
* Opens the popup that displays the list of items.
|
|
16699
|
+
*
|
|
16700
|
+
* @returns {void}
|
|
16701
|
+
*/
|
|
16702
|
+
Mention.prototype.showPopup = function () {
|
|
16703
|
+
this.beforePopupOpen = true;
|
|
16704
|
+
if (isNullOrUndefined(this.list)) {
|
|
16705
|
+
this.initValue();
|
|
16706
|
+
}
|
|
16707
|
+
this.renderPopup();
|
|
16708
|
+
attributes(this.inputElement, { 'aria-activedescendant': this.selectedElementID });
|
|
16709
|
+
if (this.selectedElementID == null) {
|
|
16710
|
+
this.inputElement.removeAttribute('aria-activedescendant');
|
|
16711
|
+
}
|
|
16712
|
+
};
|
|
16713
|
+
/* eslint-disable valid-jsdoc, jsdoc/require-param */
|
|
16714
|
+
/**
|
|
16715
|
+
* Hides the popup if it is in an open state.
|
|
16716
|
+
*
|
|
16717
|
+
* @returns {void}
|
|
16718
|
+
*/
|
|
16719
|
+
Mention.prototype.hidePopup = function (e) {
|
|
16720
|
+
this.removeSelection();
|
|
16721
|
+
this.closePopup(0, e);
|
|
16722
|
+
};
|
|
16723
|
+
Mention.prototype.closePopup = function (delay, e) {
|
|
16724
|
+
var _this = this;
|
|
16725
|
+
if (!(this.popupObj && document.body.contains(this.popupObj.element) && this.beforePopupOpen)) {
|
|
16726
|
+
return;
|
|
16727
|
+
}
|
|
16728
|
+
EventHandler.remove(document, 'mousedown', this.onDocumentClick);
|
|
16729
|
+
this.inputElement.removeAttribute('aria-owns');
|
|
16730
|
+
this.inputElement.removeAttribute('aria-activedescendant');
|
|
16731
|
+
this.beforePopupOpen = false;
|
|
16732
|
+
var animModel = {
|
|
16733
|
+
name: 'FadeOut',
|
|
16734
|
+
duration: 100,
|
|
16735
|
+
delay: delay ? delay : 0
|
|
16736
|
+
};
|
|
16737
|
+
var popupInstance = this.popupObj;
|
|
16738
|
+
var eventArgs = { popup: popupInstance, cancel: false, animation: animModel, event: e || null };
|
|
16739
|
+
this.trigger('closed', eventArgs, function (eventArgs) {
|
|
16740
|
+
if (!eventArgs.cancel && _this.popupObj) {
|
|
16741
|
+
if (_this.isPopupOpen) {
|
|
16742
|
+
_this.popupObj.hide(new Animation(eventArgs.animation));
|
|
16743
|
+
}
|
|
16744
|
+
else {
|
|
16745
|
+
_this.destroyPopup();
|
|
16746
|
+
}
|
|
16747
|
+
}
|
|
16748
|
+
});
|
|
16749
|
+
};
|
|
16750
|
+
Mention.prototype.renderPopup = function () {
|
|
16751
|
+
var _this = this;
|
|
16752
|
+
var args = { cancel: false };
|
|
16753
|
+
this.trigger('beforeOpen', args, function (args) {
|
|
16754
|
+
if (!args.cancel) {
|
|
16755
|
+
var popupEle_1;
|
|
16756
|
+
if (isNullOrUndefined(_this.target)) {
|
|
16757
|
+
popupEle_1 = _this.createElement('div', {
|
|
16758
|
+
id: _this.inputElement.id + '_popup', className: 'e-mention e-popup ' + (_this.cssClass != null ? _this.cssClass : '')
|
|
16759
|
+
});
|
|
16760
|
+
}
|
|
16761
|
+
else {
|
|
16762
|
+
popupEle_1 = _this.element;
|
|
16763
|
+
if (_this.cssClass != null) {
|
|
16764
|
+
addClass([popupEle_1], _this.cssClass.split(' '));
|
|
16765
|
+
}
|
|
16766
|
+
}
|
|
16767
|
+
if (!isNullOrUndefined(_this.target)) {
|
|
16768
|
+
popupEle_1.id = _this.inputElement.id + '_popup';
|
|
16769
|
+
addClass([popupEle_1], ['e-mention', 'e-popup', 'e-popup-close']);
|
|
16770
|
+
}
|
|
16771
|
+
_this.listHeight = formatUnit(_this.popupHeight);
|
|
16772
|
+
if (!isNullOrUndefined(_this.list.querySelector('li')) && !_this.initRemoteRender) {
|
|
16773
|
+
var li = _this.list.querySelector('.' + dropDownBaseClasses.focus);
|
|
16774
|
+
if (!isNullOrUndefined(li)) {
|
|
16775
|
+
_this.selectedLI = li;
|
|
16776
|
+
var value = _this.getFormattedValue(li.getAttribute('data-value'));
|
|
16777
|
+
_this.selectEventCallback(li, _this.getDataByValue(value), value, true);
|
|
16778
|
+
}
|
|
16779
|
+
}
|
|
16780
|
+
append([_this.list], popupEle_1);
|
|
16781
|
+
if ((!_this.popupObj || !document.body.contains(_this.popupObj.element)) ||
|
|
16782
|
+
!document.contains(popupEle_1) && isNullOrUndefined(_this.target)) {
|
|
16783
|
+
document.body.appendChild(popupEle_1);
|
|
16784
|
+
}
|
|
16785
|
+
var coordinates_1;
|
|
16786
|
+
popupEle_1.style.visibility = 'hidden';
|
|
16787
|
+
_this.setHeight(popupEle_1);
|
|
16788
|
+
var offsetValue = 0;
|
|
16789
|
+
var left = 0;
|
|
16790
|
+
_this.initializePopup(popupEle_1, offsetValue, left);
|
|
16791
|
+
_this.checkCollision(popupEle_1);
|
|
16792
|
+
popupEle_1.style.visibility = 'visible';
|
|
16793
|
+
if (!isNullOrUndefined(_this.list)) {
|
|
16794
|
+
_this.unWireListEvents();
|
|
16795
|
+
_this.wireListEvents();
|
|
16796
|
+
}
|
|
16797
|
+
_this.selectedElementID = _this.selectedLI ? _this.selectedLI.id : null;
|
|
16798
|
+
attributes(_this.inputElement, { 'aria-owns': _this.inputElement.id + '_options', 'aria-activedescendant': _this.selectedElementID });
|
|
16799
|
+
if (_this.selectedElementID == null) {
|
|
16800
|
+
_this.inputElement.removeAttribute('aria-activedescendant');
|
|
16801
|
+
}
|
|
16802
|
+
var animModel = { name: 'FadeIn', duration: 100 };
|
|
16803
|
+
_this.beforePopupOpen = true;
|
|
16804
|
+
var popupInstance = _this.popupObj;
|
|
16805
|
+
var eventArgs = { popup: popupInstance, cancel: false, animation: animModel };
|
|
16806
|
+
_this.trigger('opened', eventArgs, function (eventArgs) {
|
|
16807
|
+
if (!eventArgs.cancel) {
|
|
16808
|
+
_this.renderReactTemplates();
|
|
16809
|
+
_this.popupObj.show(new Animation(eventArgs.animation), (_this.zIndex === 1000) ? _this.inputElement : null);
|
|
16810
|
+
if (isNullOrUndefined(_this.getTriggerCharPosition())) {
|
|
16811
|
+
return;
|
|
16812
|
+
}
|
|
16813
|
+
coordinates_1 = _this.getCoordinates(_this.inputElement, _this.getTriggerCharPosition());
|
|
16814
|
+
if (!_this.isCollided) {
|
|
16815
|
+
popupEle_1.style.cssText = 'top: '.concat(coordinates_1.top.toString(), 'px;\n left: ').concat(coordinates_1.left.toString(), 'px;\nposition: absolute;\n display: block;');
|
|
16816
|
+
}
|
|
16817
|
+
else {
|
|
16818
|
+
popupEle_1.style.left = formatUnit(coordinates_1.left);
|
|
16819
|
+
_this.isCollided = false;
|
|
16820
|
+
}
|
|
16821
|
+
popupEle_1.style.width = _this.popupWidth !== '100%' && !isNullOrUndefined(_this.popupWidth) ? formatUnit(_this.popupWidth) : 'auto';
|
|
16822
|
+
_this.setHeight(popupEle_1);
|
|
16823
|
+
popupEle_1.style.zIndex = _this.zIndex === 1000 ? getZindexPartial(popupEle_1).toString() : _this.zIndex.toString();
|
|
16824
|
+
}
|
|
16825
|
+
else {
|
|
16826
|
+
_this.beforePopupOpen = false;
|
|
16827
|
+
_this.destroyPopup();
|
|
16828
|
+
}
|
|
16829
|
+
});
|
|
16830
|
+
}
|
|
16831
|
+
else {
|
|
16832
|
+
_this.beforePopupOpen = false;
|
|
16833
|
+
}
|
|
16834
|
+
});
|
|
16835
|
+
};
|
|
16836
|
+
Mention.prototype.setHeight = function (popupEle) {
|
|
16837
|
+
if (this.popupHeight !== 'auto') {
|
|
16838
|
+
this.list.style.maxHeight = (parseInt(this.listHeight, 10) - 2).toString() + 'px'; // due to box-sizing property
|
|
16839
|
+
popupEle.style.maxHeight = formatUnit(this.popupHeight);
|
|
16840
|
+
}
|
|
16841
|
+
else {
|
|
16842
|
+
popupEle.style.height = 'auto';
|
|
16843
|
+
}
|
|
16844
|
+
};
|
|
16845
|
+
Mention.prototype.checkCollision = function (popupEle) {
|
|
16846
|
+
if (!Browser.isDevice || (Browser.isDevice && !(this.getModuleName() === 'mention'))) {
|
|
16847
|
+
var collision = isCollide(popupEle);
|
|
16848
|
+
if (collision.length > 0) {
|
|
16849
|
+
popupEle.style.marginTop = -parseInt(getComputedStyle(popupEle).marginTop, 10) + 'px';
|
|
16850
|
+
this.isCollided = true;
|
|
16851
|
+
}
|
|
16852
|
+
this.popupObj.resolveCollision();
|
|
16853
|
+
}
|
|
16854
|
+
};
|
|
16855
|
+
Mention.prototype.getTriggerCharPosition = function () {
|
|
16856
|
+
var mostRecentTriggerCharPos;
|
|
16857
|
+
var currentRange = this.getTextRange();
|
|
16858
|
+
if (currentRange !== undefined && currentRange !== null) {
|
|
16859
|
+
mostRecentTriggerCharPos = 0;
|
|
16860
|
+
var idx = currentRange.lastIndexOf(this.mentionChar);
|
|
16861
|
+
if (idx >= mostRecentTriggerCharPos) {
|
|
16862
|
+
mostRecentTriggerCharPos = idx;
|
|
16863
|
+
}
|
|
16864
|
+
}
|
|
16865
|
+
return mostRecentTriggerCharPos;
|
|
16866
|
+
};
|
|
16867
|
+
Mention.prototype.initializePopup = function (element, offsetValue, left) {
|
|
16868
|
+
var _this = this;
|
|
16869
|
+
this.popupObj = new Popup(element, {
|
|
16870
|
+
width: this.setWidth(), targetType: 'relative',
|
|
16871
|
+
relateTo: this.inputElement, collision: { X: 'flip', Y: 'flip' }, offsetY: offsetValue,
|
|
16872
|
+
enableRtl: this.enableRtl, offsetX: left, position: { X: 'top', Y: 'left' }, actionOnScroll: 'hide',
|
|
16873
|
+
zIndex: this.zIndex,
|
|
16874
|
+
close: function () {
|
|
16875
|
+
_this.destroyPopup();
|
|
16876
|
+
},
|
|
16877
|
+
open: function () {
|
|
16878
|
+
EventHandler.add(document, 'mousedown', _this.onDocumentClick, _this);
|
|
16879
|
+
_this.isPopupOpen = true;
|
|
16880
|
+
_this.setDataIndex();
|
|
16881
|
+
}
|
|
16882
|
+
});
|
|
16883
|
+
};
|
|
16884
|
+
Mention.prototype.setWidth = function () {
|
|
16885
|
+
var width = formatUnit(this.popupWidth);
|
|
16886
|
+
if (width.indexOf('%') > -1) {
|
|
16887
|
+
var inputWidth = this.inputElement.offsetWidth * parseFloat(width) / 100;
|
|
16888
|
+
width = inputWidth.toString() + 'px';
|
|
16889
|
+
}
|
|
16890
|
+
return width;
|
|
16891
|
+
};
|
|
16892
|
+
Mention.prototype.destroyPopup = function () {
|
|
16893
|
+
this.isPopupOpen = false;
|
|
16894
|
+
this.popupObj.destroy();
|
|
16895
|
+
if (isNullOrUndefined(this.target)) {
|
|
16896
|
+
detach(this.popupObj.element);
|
|
16897
|
+
}
|
|
16898
|
+
else {
|
|
16899
|
+
this.popupObj.element.innerHTML = '';
|
|
16900
|
+
this.popupObj.element.removeAttribute('style');
|
|
16901
|
+
this.popupObj.element.removeAttribute('aria-disabled');
|
|
16902
|
+
}
|
|
16903
|
+
};
|
|
16904
|
+
Mention.prototype.onDocumentClick = function (e) {
|
|
16905
|
+
var target = e.target;
|
|
16906
|
+
if (!(!isNullOrUndefined(this.popupObj) && closest(target, '#' + this.popupObj.element.id))) {
|
|
16907
|
+
this.hidePopup(e);
|
|
16908
|
+
}
|
|
16909
|
+
};
|
|
16910
|
+
Mention.prototype.getCoordinates = function (element, position) {
|
|
16911
|
+
var 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'];
|
|
16912
|
+
var div;
|
|
16913
|
+
var span;
|
|
16914
|
+
var range;
|
|
16915
|
+
var globalRange;
|
|
16916
|
+
var coordinates;
|
|
16917
|
+
var computed;
|
|
16918
|
+
var rect;
|
|
16919
|
+
if (!this.isContentEditable(this.inputElement)) {
|
|
16920
|
+
div = this.createElement('div', { className: 'e-form-mirror-div' });
|
|
16921
|
+
document.body.appendChild(div);
|
|
16922
|
+
computed = getComputedStyle(element);
|
|
16923
|
+
div.style.position = 'absolute';
|
|
16924
|
+
div.style.visibility = 'hidden';
|
|
16925
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16926
|
+
properties.forEach(function (prop) {
|
|
16927
|
+
// eslint-disable-next-line security/detect-object-injection
|
|
16928
|
+
div.style[prop] = computed[prop];
|
|
16929
|
+
});
|
|
16930
|
+
div.textContent = element.value.substring(0, position);
|
|
16931
|
+
if (this.inputElement.nodeName === 'INPUT') {
|
|
16932
|
+
div.textContent = div.textContent.replace(/\s/g, '\u00a0');
|
|
16933
|
+
}
|
|
16934
|
+
span = this.createElement('span');
|
|
16935
|
+
span.textContent = element.value.substring(position) || '.';
|
|
16936
|
+
div.appendChild(span);
|
|
16937
|
+
rect = element.getBoundingClientRect();
|
|
16938
|
+
}
|
|
16939
|
+
else {
|
|
16940
|
+
var selectedNodePosition = this.getTriggerCharPosition();
|
|
16941
|
+
globalRange = this.range;
|
|
16942
|
+
range = document.createRange();
|
|
16943
|
+
range.setStart(globalRange.startContainer, selectedNodePosition);
|
|
16944
|
+
range.setEnd(globalRange.startContainer, selectedNodePosition);
|
|
16945
|
+
range.collapse(false);
|
|
16946
|
+
rect = range.getBoundingClientRect();
|
|
16947
|
+
}
|
|
16948
|
+
var doc = document.documentElement;
|
|
16949
|
+
var windowLeft = (window.pageXOffset || doc.scrollLeft) - (doc.clientLeft || 0);
|
|
16950
|
+
var windowTop = (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0);
|
|
16951
|
+
if (!this.isContentEditable(this.inputElement)) {
|
|
16952
|
+
coordinates = {
|
|
16953
|
+
top: rect.top + windowTop + span.offsetTop + parseInt(computed.borderTopWidth, 10) +
|
|
16954
|
+
parseInt(computed.fontSize, 10) + 3 - element.scrollTop,
|
|
16955
|
+
left: rect.left + windowLeft + span.offsetLeft + parseInt(computed.borderLeftWidth, 10)
|
|
16956
|
+
};
|
|
16957
|
+
document.body.removeChild(div);
|
|
16958
|
+
}
|
|
16959
|
+
else {
|
|
16960
|
+
coordinates = {
|
|
16961
|
+
top: rect.top + windowTop + parseInt(getComputedStyle(this.inputElement).fontSize, 10),
|
|
16962
|
+
left: rect.left + windowLeft
|
|
16963
|
+
};
|
|
16964
|
+
}
|
|
16965
|
+
return coordinates;
|
|
16966
|
+
};
|
|
16967
|
+
Mention.prototype.initValue = function () {
|
|
16968
|
+
this.renderList();
|
|
16969
|
+
if (this.dataSource instanceof DataManager) {
|
|
16970
|
+
this.initRemoteRender = true;
|
|
16971
|
+
}
|
|
16972
|
+
else {
|
|
16973
|
+
this.updateValues();
|
|
16974
|
+
}
|
|
16975
|
+
};
|
|
16976
|
+
Mention.prototype.updateValues = function () {
|
|
16977
|
+
var li = this.list.querySelector('.' + dropDownBaseClasses.focus);
|
|
16978
|
+
if (!isNullOrUndefined(li)) {
|
|
16979
|
+
this.setSelection(li, null);
|
|
16980
|
+
}
|
|
16981
|
+
};
|
|
16982
|
+
Mention.prototype.renderList = function () {
|
|
16983
|
+
_super.prototype.render.call(this);
|
|
16984
|
+
this.unWireListEvents();
|
|
16985
|
+
this.wireListEvents();
|
|
16986
|
+
};
|
|
16987
|
+
/**
|
|
16988
|
+
* Event binding for list
|
|
16989
|
+
*
|
|
16990
|
+
* @returns {void}
|
|
16991
|
+
*/
|
|
16992
|
+
Mention.prototype.wireListEvents = function () {
|
|
16993
|
+
EventHandler.add(this.list, 'click', this.onMouseClick, this);
|
|
16994
|
+
EventHandler.add(this.list, 'mouseover', this.onMouseOver, this);
|
|
16995
|
+
EventHandler.add(this.list, 'mouseout', this.onMouseLeave, this);
|
|
16996
|
+
};
|
|
16997
|
+
/**
|
|
16998
|
+
* Event un binding for list items.
|
|
16999
|
+
*
|
|
17000
|
+
* @returns {void}
|
|
17001
|
+
*/
|
|
17002
|
+
Mention.prototype.unWireListEvents = function () {
|
|
17003
|
+
EventHandler.remove(this.list, 'click', this.onMouseClick);
|
|
17004
|
+
EventHandler.remove(this.list, 'mouseover', this.onMouseOver);
|
|
17005
|
+
EventHandler.remove(this.list, 'mouseout', this.onMouseLeave);
|
|
17006
|
+
};
|
|
17007
|
+
Mention.prototype.onMouseClick = function (e) {
|
|
17008
|
+
var target = e.target;
|
|
17009
|
+
var li = closest(target, '.' + dropDownBaseClasses.li);
|
|
17010
|
+
if (!this.isValidLI(li)) {
|
|
17011
|
+
return;
|
|
17012
|
+
}
|
|
17013
|
+
this.setSelection(li, e);
|
|
17014
|
+
var delay = 100;
|
|
17015
|
+
this.closePopup(delay, e);
|
|
17016
|
+
this.inputElement.focus();
|
|
17017
|
+
};
|
|
17018
|
+
Mention.prototype.updateSelectedItem = function (li, e, preventSelect, isSelection) {
|
|
17019
|
+
var _this = this;
|
|
17020
|
+
this.removeSelection();
|
|
17021
|
+
li.classList.add(dropDownBaseClasses.selected);
|
|
17022
|
+
this.removeHover();
|
|
17023
|
+
var value = this.getFormattedValue(li.getAttribute('data-value'));
|
|
17024
|
+
var selectedData = this.getDataByValue(value);
|
|
17025
|
+
if (!preventSelect && !isNullOrUndefined(e)) {
|
|
17026
|
+
var items = this.detachChanges(selectedData);
|
|
17027
|
+
this.isSelected = true;
|
|
17028
|
+
var eventArgs = {
|
|
17029
|
+
e: e,
|
|
17030
|
+
item: li,
|
|
17031
|
+
itemData: items,
|
|
17032
|
+
isInteracted: e ? true : false,
|
|
17033
|
+
cancel: false
|
|
17034
|
+
};
|
|
17035
|
+
this.trigger('select', eventArgs, function (eventArgs) {
|
|
17036
|
+
if (eventArgs.cancel) {
|
|
17037
|
+
li.classList.remove(dropDownBaseClasses.selected);
|
|
17038
|
+
}
|
|
17039
|
+
else {
|
|
17040
|
+
_this.selectEventCallback(li, selectedData, value);
|
|
17041
|
+
if (isSelection) {
|
|
17042
|
+
_this.setSelectOptions(li, e);
|
|
17043
|
+
}
|
|
17044
|
+
}
|
|
17045
|
+
});
|
|
17046
|
+
}
|
|
17047
|
+
else {
|
|
17048
|
+
this.selectEventCallback(li, selectedData, value);
|
|
17049
|
+
if (isSelection) {
|
|
17050
|
+
this.setSelectOptions(li, e);
|
|
17051
|
+
}
|
|
17052
|
+
}
|
|
17053
|
+
};
|
|
17054
|
+
Mention.prototype.setSelection = function (li, e) {
|
|
17055
|
+
if (this.isValidLI(li) && (!li.classList.contains(dropDownBaseClasses.selected) || (this.isPopupOpen && this.isSelected
|
|
17056
|
+
&& li.classList.contains(dropDownBaseClasses.selected)))) {
|
|
17057
|
+
this.updateSelectedItem(li, e, false, true);
|
|
17058
|
+
}
|
|
17059
|
+
else {
|
|
17060
|
+
this.setSelectOptions(li, e);
|
|
17061
|
+
}
|
|
17062
|
+
};
|
|
17063
|
+
Mention.prototype.setSelectOptions = function (li, e) {
|
|
17064
|
+
if (this.list) {
|
|
17065
|
+
this.removeHover();
|
|
17066
|
+
}
|
|
17067
|
+
this.previousSelectedLI = (!isNullOrUndefined(this.selectedLI)) ? this.selectedLI : null;
|
|
17068
|
+
this.selectedLI = li;
|
|
17069
|
+
if (this.isPopupOpen && !isNullOrUndefined(this.selectedLI)) {
|
|
17070
|
+
this.setScrollPosition(e);
|
|
17071
|
+
}
|
|
17072
|
+
if (e && (e.keyCode === 38 || e.keyCode === 40)) {
|
|
17073
|
+
return;
|
|
17074
|
+
}
|
|
17075
|
+
if (isNullOrUndefined(e) || this.setValue(e)) {
|
|
17076
|
+
return;
|
|
17077
|
+
}
|
|
17078
|
+
};
|
|
17079
|
+
Mention.prototype.setScrollPosition = function (e) {
|
|
17080
|
+
if (!isNullOrUndefined(e)) {
|
|
17081
|
+
switch (e.action) {
|
|
17082
|
+
case 'pageDown':
|
|
17083
|
+
case 'down':
|
|
17084
|
+
case 'end':
|
|
17085
|
+
this.scrollBottom();
|
|
17086
|
+
break;
|
|
17087
|
+
default:
|
|
17088
|
+
this.scrollTop();
|
|
17089
|
+
break;
|
|
17090
|
+
}
|
|
17091
|
+
}
|
|
17092
|
+
else {
|
|
17093
|
+
this.scrollBottom(true);
|
|
17094
|
+
}
|
|
17095
|
+
};
|
|
17096
|
+
Mention.prototype.scrollBottom = function (isInitial) {
|
|
17097
|
+
if (!isNullOrUndefined(this.selectedLI)) {
|
|
17098
|
+
var currentOffset = this.list.offsetHeight;
|
|
17099
|
+
var nextBottom = this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop;
|
|
17100
|
+
var nextOffset = this.list.scrollTop + nextBottom - currentOffset;
|
|
17101
|
+
nextOffset = isInitial ? nextOffset + parseInt(getComputedStyle(this.list).paddingTop, 10) * 2 : nextOffset;
|
|
17102
|
+
var boxRange = this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop;
|
|
17103
|
+
if (this.activeIndex === 0) {
|
|
17104
|
+
this.list.scrollTop = 0;
|
|
17105
|
+
}
|
|
17106
|
+
else if (nextBottom > currentOffset || !(boxRange > 0 && this.list.offsetHeight > boxRange)) {
|
|
17107
|
+
this.list.scrollTop = nextOffset;
|
|
17108
|
+
}
|
|
17109
|
+
}
|
|
17110
|
+
};
|
|
17111
|
+
Mention.prototype.scrollTop = function () {
|
|
17112
|
+
if (!isNullOrUndefined(this.selectedLI)) {
|
|
17113
|
+
var nextOffset = this.selectedLI.offsetTop - this.list.scrollTop;
|
|
17114
|
+
nextOffset = this.fields.groupBy && nextOffset;
|
|
17115
|
+
var boxRange = (this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop);
|
|
17116
|
+
if (this.activeIndex === 0) {
|
|
17117
|
+
this.list.scrollTop = 0;
|
|
17118
|
+
}
|
|
17119
|
+
else if (nextOffset < 0) {
|
|
17120
|
+
this.list.scrollTop = this.list.scrollTop + nextOffset;
|
|
17121
|
+
}
|
|
17122
|
+
else if (!(boxRange > 0 && this.list.offsetHeight > boxRange)) {
|
|
17123
|
+
this.list.scrollTop = this.selectedLI.offsetTop;
|
|
17124
|
+
}
|
|
17125
|
+
}
|
|
17126
|
+
};
|
|
17127
|
+
Mention.prototype.selectEventCallback = function (li, selectedData, value, selectLi) {
|
|
17128
|
+
this.previousItemData = (!isNullOrUndefined(this.itemData)) ? this.itemData : null;
|
|
17129
|
+
this.item = li;
|
|
17130
|
+
this.itemData = selectedData;
|
|
17131
|
+
var focusedItem = this.list.querySelector('.' + dropDownBaseClasses.focus);
|
|
17132
|
+
if (focusedItem) {
|
|
17133
|
+
removeClass([focusedItem], dropDownBaseClasses.focus);
|
|
17134
|
+
}
|
|
17135
|
+
if (selectLi) {
|
|
17136
|
+
addClass([li], dropDownBaseClasses.selected);
|
|
17137
|
+
}
|
|
17138
|
+
li.setAttribute('aria-selected', 'true');
|
|
17139
|
+
this.activeIndex = this.getIndexByValue(value);
|
|
17140
|
+
};
|
|
17141
|
+
Mention.prototype.detachChanges = function (value) {
|
|
17142
|
+
var items;
|
|
17143
|
+
if (typeof value === 'string' ||
|
|
17144
|
+
typeof value === 'boolean' ||
|
|
17145
|
+
typeof value === 'number') {
|
|
17146
|
+
items = Object.defineProperties({}, {
|
|
17147
|
+
value: {
|
|
17148
|
+
value: value,
|
|
17149
|
+
enumerable: true
|
|
17150
|
+
},
|
|
17151
|
+
text: {
|
|
17152
|
+
value: value,
|
|
17153
|
+
enumerable: true
|
|
17154
|
+
}
|
|
17155
|
+
});
|
|
17156
|
+
}
|
|
17157
|
+
else {
|
|
17158
|
+
items = value;
|
|
17159
|
+
}
|
|
17160
|
+
return items;
|
|
17161
|
+
};
|
|
17162
|
+
Mention.prototype.setValue = function (e) {
|
|
17163
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17164
|
+
if (!this.isReact) {
|
|
17165
|
+
if (!isNullOrUndefined(this.displayTemplate)) {
|
|
17166
|
+
this.setDisplayTemplate();
|
|
17167
|
+
}
|
|
17168
|
+
this.updateMentionValue(e);
|
|
17169
|
+
return true;
|
|
17170
|
+
}
|
|
17171
|
+
else {
|
|
17172
|
+
if (!isNullOrUndefined(this.displayTemplate)) {
|
|
17173
|
+
this.setDisplayTemplate(e);
|
|
17174
|
+
}
|
|
17175
|
+
else {
|
|
17176
|
+
this.updateMentionValue(e);
|
|
17177
|
+
}
|
|
17178
|
+
return true;
|
|
17179
|
+
}
|
|
17180
|
+
};
|
|
17181
|
+
Mention.prototype.updateMentionValue = function (e) {
|
|
17182
|
+
var dataItem = this.getItemData();
|
|
17183
|
+
var textSuffix;
|
|
17184
|
+
var value;
|
|
17185
|
+
var endPos;
|
|
17186
|
+
var range;
|
|
17187
|
+
var globalRange;
|
|
17188
|
+
var selection = this.inputElement.ownerDocument.getSelection();
|
|
17189
|
+
var startPos = this.getTriggerCharPosition();
|
|
17190
|
+
textSuffix = typeof this.suffixText === 'string' ? this.suffixText : '';
|
|
17191
|
+
if (dataItem.text !== null) {
|
|
17192
|
+
value = this.mentionVal(dataItem.text);
|
|
17193
|
+
}
|
|
17194
|
+
if (!this.isContentEditable(this.inputElement)) {
|
|
17195
|
+
var myField = this.inputElement;
|
|
17196
|
+
var currentTriggerSnippet = this.getTextRange().substring(startPos + this.mentionChar.length, this.getTextRange().length);
|
|
17197
|
+
value += textSuffix;
|
|
17198
|
+
endPos = startPos + this.mentionChar.length;
|
|
17199
|
+
endPos += currentTriggerSnippet.length;
|
|
17200
|
+
myField.value = myField.value.substring(0, startPos) + value + myField.value.substring(endPos, myField.value.length);
|
|
17201
|
+
myField.selectionStart = startPos + value.length;
|
|
17202
|
+
myField.selectionEnd = startPos + value.length;
|
|
17203
|
+
if (this.isPopupOpen) {
|
|
17204
|
+
this.hidePopup();
|
|
17205
|
+
}
|
|
17206
|
+
this.onChangeEvent(e);
|
|
17207
|
+
}
|
|
17208
|
+
else {
|
|
17209
|
+
endPos = this.getTriggerCharPosition() + this.mentionChar.length;
|
|
17210
|
+
if (this.range && (this.range.startContainer.textContent.trim() !== this.mentionChar)) {
|
|
17211
|
+
endPos = this.range.endOffset;
|
|
17212
|
+
}
|
|
17213
|
+
globalRange = this.range;
|
|
17214
|
+
range = document.createRange();
|
|
17215
|
+
range.setStart(globalRange.startContainer, startPos);
|
|
17216
|
+
range.setEnd(globalRange.startContainer, endPos);
|
|
17217
|
+
range.deleteContents();
|
|
17218
|
+
var element = this.createElement('div');
|
|
17219
|
+
element.innerHTML = value;
|
|
17220
|
+
var frag = document.createDocumentFragment();
|
|
17221
|
+
var node = void 0;
|
|
17222
|
+
var lastNode = void 0;
|
|
17223
|
+
// eslint-disable-next-line no-cond-assign
|
|
17224
|
+
while (node = element.firstChild) {
|
|
17225
|
+
lastNode = frag.appendChild(node);
|
|
17226
|
+
}
|
|
17227
|
+
range.insertNode(frag);
|
|
17228
|
+
if (lastNode) {
|
|
17229
|
+
range = range.cloneRange();
|
|
17230
|
+
range.setStartAfter(lastNode);
|
|
17231
|
+
range.collapse(true);
|
|
17232
|
+
selection.removeAllRanges();
|
|
17233
|
+
selection.addRange(range);
|
|
17234
|
+
}
|
|
17235
|
+
if (this.isPopupOpen) {
|
|
17236
|
+
this.hidePopup();
|
|
17237
|
+
}
|
|
17238
|
+
this.onChangeEvent(e);
|
|
17239
|
+
}
|
|
17240
|
+
};
|
|
17241
|
+
Mention.prototype.mentionVal = function (value) {
|
|
17242
|
+
var showChar = this.showMentionChar ? this.mentionChar : '';
|
|
17243
|
+
if (!isNullOrUndefined(this.displayTemplate) && !isNullOrUndefined(this.displayTempElement)) {
|
|
17244
|
+
value = this.displayTempElement.innerHTML;
|
|
17245
|
+
}
|
|
17246
|
+
if (this.isContentEditable(this.inputElement)) {
|
|
17247
|
+
return '<span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : ' ');
|
|
17248
|
+
}
|
|
17249
|
+
else {
|
|
17250
|
+
return showChar + value;
|
|
17251
|
+
}
|
|
17252
|
+
};
|
|
17253
|
+
Mention.prototype.setDisplayTemplate = function (e) {
|
|
17254
|
+
var _this = this;
|
|
17255
|
+
var compiledString;
|
|
17256
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17257
|
+
if (this.isReact) {
|
|
17258
|
+
this.clearTemplate(['displayTemplate']);
|
|
17259
|
+
if (this.displayTempElement) {
|
|
17260
|
+
detach(this.displayTempElement);
|
|
17261
|
+
this.displayTempElement = null;
|
|
17262
|
+
}
|
|
17263
|
+
}
|
|
17264
|
+
if (!this.displayTempElement) {
|
|
17265
|
+
this.displayTempElement = this.createElement('div');
|
|
17266
|
+
}
|
|
17267
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17268
|
+
if (!this.isReact) {
|
|
17269
|
+
this.displayTempElement.innerHTML = '';
|
|
17270
|
+
}
|
|
17271
|
+
compiledString = compile(this.displayTemplate);
|
|
17272
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17273
|
+
var displayCompTemp = compiledString(this.itemData, this, 'displayTemplate', this.displayTemplateId, this.isStringTemplate, null, this.displayTempElement);
|
|
17274
|
+
if (displayCompTemp && displayCompTemp.length > 0) {
|
|
17275
|
+
for (var i = 0; i < displayCompTemp.length; i++) {
|
|
17276
|
+
this.displayTempElement.appendChild(displayCompTemp[i]);
|
|
17277
|
+
}
|
|
17278
|
+
}
|
|
17279
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17280
|
+
if (!this.isReact) {
|
|
17281
|
+
this.renderTemplates();
|
|
17282
|
+
}
|
|
17283
|
+
else {
|
|
17284
|
+
this.renderTemplates(function () {
|
|
17285
|
+
_this.updateMentionValue(e);
|
|
17286
|
+
});
|
|
17287
|
+
}
|
|
17288
|
+
};
|
|
17289
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17290
|
+
Mention.prototype.renderTemplates = function (callBack) {
|
|
17291
|
+
this.renderReactTemplates(callBack);
|
|
17292
|
+
};
|
|
17293
|
+
Mention.prototype.setSpinnerTemplate = function () {
|
|
17294
|
+
var _this = this;
|
|
17295
|
+
var compiledString;
|
|
17296
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17297
|
+
if (this.isReact) {
|
|
17298
|
+
this.clearTemplate(['spinnerTemplate']);
|
|
17299
|
+
if (this.spinnerTemplateElement) {
|
|
17300
|
+
detach(this.spinnerTemplateElement);
|
|
17301
|
+
this.spinnerTemplateElement = null;
|
|
17302
|
+
}
|
|
17303
|
+
}
|
|
17304
|
+
if (!this.spinnerTemplateElement) {
|
|
17305
|
+
this.spinnerTemplateElement = this.createElement('div');
|
|
17306
|
+
}
|
|
17307
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17308
|
+
if (!this.isReact) {
|
|
17309
|
+
this.spinnerTemplateElement.innerHTML = '';
|
|
17310
|
+
}
|
|
17311
|
+
compiledString = compile(this.spinnerTemplate);
|
|
17312
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17313
|
+
var spinnerCompTemp = compiledString(null, this, 'spinnerTemplate', this.spinnerTemplateId, this.isStringTemplate, null, this.spinnerTemplateElement);
|
|
17314
|
+
if (spinnerCompTemp && spinnerCompTemp.length > 0) {
|
|
17315
|
+
for (var i = 0; i < spinnerCompTemp.length; i++) {
|
|
17316
|
+
this.spinnerTemplateElement.appendChild(spinnerCompTemp[i]);
|
|
17317
|
+
}
|
|
17318
|
+
}
|
|
17319
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17320
|
+
if (!this.isReact) {
|
|
17321
|
+
this.renderTemplates();
|
|
17322
|
+
this.popupObj.element.appendChild(this.spinnerTemplateElement);
|
|
17323
|
+
}
|
|
17324
|
+
else {
|
|
17325
|
+
this.renderTemplates(function () {
|
|
17326
|
+
_this.popupObj.element.appendChild(_this.spinnerTemplateElement);
|
|
17327
|
+
});
|
|
17328
|
+
}
|
|
17329
|
+
};
|
|
17330
|
+
Mention.prototype.onChangeEvent = function (eve) {
|
|
17331
|
+
this.isSelected = false;
|
|
17332
|
+
var items = this.detachMentionChanges(this.itemData);
|
|
17333
|
+
var preItems;
|
|
17334
|
+
if (typeof this.previousItemData === 'string' ||
|
|
17335
|
+
typeof this.previousItemData === 'boolean' ||
|
|
17336
|
+
typeof this.previousItemData === 'number') {
|
|
17337
|
+
preItems = Object.defineProperties({}, {
|
|
17338
|
+
value: {
|
|
17339
|
+
value: this.previousItemData,
|
|
17340
|
+
enumerable: true
|
|
17341
|
+
},
|
|
17342
|
+
text: {
|
|
17343
|
+
value: this.previousItemData,
|
|
17344
|
+
enumerable: true
|
|
17345
|
+
}
|
|
17346
|
+
});
|
|
17347
|
+
}
|
|
17348
|
+
else {
|
|
17349
|
+
preItems = this.previousItemData;
|
|
17350
|
+
}
|
|
17351
|
+
var eventArgs = {
|
|
17352
|
+
e: eve,
|
|
17353
|
+
item: this.item,
|
|
17354
|
+
itemData: items,
|
|
17355
|
+
previousItem: this.previousSelectedLI,
|
|
17356
|
+
previousItemData: preItems,
|
|
17357
|
+
isInteracted: eve ? true : false,
|
|
17358
|
+
value: this.item.innerHTML,
|
|
17359
|
+
element: this.inputElement
|
|
17360
|
+
};
|
|
17361
|
+
this.trigger('change', eventArgs);
|
|
17362
|
+
};
|
|
17363
|
+
Mention.prototype.detachMentionChanges = function (value) {
|
|
17364
|
+
var items;
|
|
17365
|
+
if (typeof value === 'string' ||
|
|
17366
|
+
typeof value === 'boolean' ||
|
|
17367
|
+
typeof value === 'number') {
|
|
17368
|
+
items = Object.defineProperties({}, {
|
|
17369
|
+
value: {
|
|
17370
|
+
value: value,
|
|
17371
|
+
enumerable: true
|
|
17372
|
+
},
|
|
17373
|
+
text: {
|
|
17374
|
+
value: value,
|
|
17375
|
+
enumerable: true
|
|
17376
|
+
}
|
|
17377
|
+
});
|
|
17378
|
+
}
|
|
17379
|
+
else {
|
|
17380
|
+
items = value;
|
|
17381
|
+
}
|
|
17382
|
+
return items;
|
|
17383
|
+
};
|
|
17384
|
+
Mention.prototype.getItemData = function () {
|
|
17385
|
+
var fields = this.fields;
|
|
17386
|
+
var dataItem = null;
|
|
17387
|
+
dataItem = this.itemData;
|
|
17388
|
+
var dataValue;
|
|
17389
|
+
var dataText;
|
|
17390
|
+
if (!isNullOrUndefined(dataItem)) {
|
|
17391
|
+
dataValue = getValue(fields.value, dataItem);
|
|
17392
|
+
dataText = getValue(fields.text, dataItem);
|
|
17393
|
+
}
|
|
17394
|
+
var value = (!isNullOrUndefined(dataItem) &&
|
|
17395
|
+
!isUndefined(dataValue) ? dataValue : dataItem);
|
|
17396
|
+
var text = (!isNullOrUndefined(dataItem) &&
|
|
17397
|
+
!isUndefined(dataValue) ? dataText : dataItem);
|
|
17398
|
+
return { value: value, text: text };
|
|
17399
|
+
};
|
|
17400
|
+
Mention.prototype.removeSelection = function () {
|
|
17401
|
+
if (this.list) {
|
|
17402
|
+
var selectedItems = this.list.querySelectorAll('.' + dropDownBaseClasses.selected);
|
|
17403
|
+
if (selectedItems.length) {
|
|
17404
|
+
removeClass(selectedItems, dropDownBaseClasses.selected);
|
|
17405
|
+
selectedItems[0].removeAttribute('aria-selected');
|
|
17406
|
+
}
|
|
17407
|
+
}
|
|
17408
|
+
};
|
|
17409
|
+
Mention.prototype.onMouseOver = function (e) {
|
|
17410
|
+
var currentLi = closest(e.target, '.' + dropDownBaseClasses.li);
|
|
17411
|
+
this.setHover(currentLi);
|
|
17412
|
+
};
|
|
17413
|
+
Mention.prototype.setHover = function (li) {
|
|
17414
|
+
if (this.isValidLI(li) && !li.classList.contains(dropDownBaseClasses.hover)) {
|
|
17415
|
+
this.removeHover();
|
|
17416
|
+
addClass([li], dropDownBaseClasses.hover);
|
|
17417
|
+
}
|
|
17418
|
+
};
|
|
17419
|
+
Mention.prototype.removeHover = function () {
|
|
17420
|
+
if (this.list) {
|
|
17421
|
+
var hoveredItem = this.list.querySelectorAll('.' + dropDownBaseClasses.hover);
|
|
17422
|
+
if (hoveredItem && hoveredItem.length) {
|
|
17423
|
+
removeClass(hoveredItem, dropDownBaseClasses.hover);
|
|
17424
|
+
}
|
|
17425
|
+
}
|
|
17426
|
+
};
|
|
17427
|
+
Mention.prototype.isValidLI = function (li) {
|
|
17428
|
+
return (li && li.hasAttribute('role') && li.getAttribute('role') === 'option');
|
|
17429
|
+
};
|
|
17430
|
+
Mention.prototype.onMouseLeave = function () {
|
|
17431
|
+
this.removeHover();
|
|
17432
|
+
};
|
|
17433
|
+
/**
|
|
17434
|
+
* Search the entered text and show it in the suggestion list if available.
|
|
17435
|
+
*
|
|
17436
|
+
* @returns {void}
|
|
17437
|
+
*/
|
|
17438
|
+
Mention.prototype.search = function (text, positionX, positionY) {
|
|
17439
|
+
if (this.isContentEditable(this.inputElement)) {
|
|
17440
|
+
this.range = this.getCurrentRange();
|
|
17441
|
+
}
|
|
17442
|
+
var currentRange = this.getTextRange();
|
|
17443
|
+
var lastWordRange = this.getLastLetter(currentRange);
|
|
17444
|
+
if ((this.ignoreCase && (text === lastWordRange || text === lastWordRange.toLowerCase()))
|
|
17445
|
+
|| !this.ignoreCase && text === lastWordRange) {
|
|
17446
|
+
this.resetList(this.dataSource, this.fields);
|
|
17447
|
+
}
|
|
17448
|
+
else {
|
|
17449
|
+
if (this.isPopupOpen) {
|
|
17450
|
+
this.hidePopup();
|
|
17451
|
+
}
|
|
17452
|
+
return;
|
|
17453
|
+
}
|
|
17454
|
+
if (isNullOrUndefined(this.list)) {
|
|
17455
|
+
this.renderList();
|
|
17456
|
+
this.renderPopup();
|
|
17457
|
+
}
|
|
17458
|
+
else {
|
|
17459
|
+
this.showPopup();
|
|
17460
|
+
}
|
|
17461
|
+
this.popupObj.element.style.left = formatUnit(positionX);
|
|
17462
|
+
this.popupObj.element.style.top = formatUnit(positionY);
|
|
17463
|
+
};
|
|
17464
|
+
/**
|
|
17465
|
+
* Removes the component from the DOM and detaches all its related event handlers. Also it removes the attributes and classes.
|
|
17466
|
+
*
|
|
17467
|
+
* @method destroy
|
|
17468
|
+
* @returns {void}
|
|
17469
|
+
*/
|
|
17470
|
+
Mention.prototype.destroy = function () {
|
|
17471
|
+
this.hidePopup();
|
|
17472
|
+
this.unWireEvent();
|
|
17473
|
+
if (this.list) {
|
|
17474
|
+
this.unWireListEvents();
|
|
17475
|
+
}
|
|
17476
|
+
if (this.inputElement && !this.inputElement.classList.contains('e-' + this.getModuleName())) {
|
|
17477
|
+
return;
|
|
17478
|
+
}
|
|
17479
|
+
_super.prototype.destroy.call(this);
|
|
17480
|
+
};
|
|
17481
|
+
Mention.prototype.getLocaleName = function () {
|
|
17482
|
+
return 'mention';
|
|
17483
|
+
};
|
|
17484
|
+
Mention.prototype.getNgDirective = function () {
|
|
17485
|
+
return 'EJS-MENTION';
|
|
17486
|
+
};
|
|
17487
|
+
/**
|
|
17488
|
+
* Return the module name of this component.
|
|
17489
|
+
*
|
|
17490
|
+
* @private
|
|
17491
|
+
* @returns {string} Return the module name of this component.
|
|
17492
|
+
*/
|
|
17493
|
+
Mention.prototype.getModuleName = function () {
|
|
17494
|
+
return 'mention';
|
|
17495
|
+
};
|
|
17496
|
+
__decorate$7([
|
|
17497
|
+
Property(null)
|
|
17498
|
+
], Mention.prototype, "cssClass", void 0);
|
|
17499
|
+
__decorate$7([
|
|
17500
|
+
Property('@')
|
|
17501
|
+
], Mention.prototype, "mentionChar", void 0);
|
|
17502
|
+
__decorate$7([
|
|
17503
|
+
Property(false)
|
|
17504
|
+
], Mention.prototype, "showMentionChar", void 0);
|
|
17505
|
+
__decorate$7([
|
|
17506
|
+
Property(false)
|
|
17507
|
+
], Mention.prototype, "allowSpaces", void 0);
|
|
17508
|
+
__decorate$7([
|
|
17509
|
+
Property(null)
|
|
17510
|
+
], Mention.prototype, "suffixText", void 0);
|
|
17511
|
+
__decorate$7([
|
|
17512
|
+
Property(25)
|
|
17513
|
+
], Mention.prototype, "suggestionCount", void 0);
|
|
17514
|
+
__decorate$7([
|
|
17515
|
+
Property(0)
|
|
17516
|
+
], Mention.prototype, "minLength", void 0);
|
|
17517
|
+
__decorate$7([
|
|
17518
|
+
Property('None')
|
|
17519
|
+
], Mention.prototype, "sortOrder", void 0);
|
|
17520
|
+
__decorate$7([
|
|
17521
|
+
Property(true)
|
|
17522
|
+
], Mention.prototype, "ignoreCase", void 0);
|
|
17523
|
+
__decorate$7([
|
|
17524
|
+
Property(false)
|
|
17525
|
+
], Mention.prototype, "highlight", void 0);
|
|
17526
|
+
__decorate$7([
|
|
17527
|
+
Property()
|
|
17528
|
+
], Mention.prototype, "locale", void 0);
|
|
17529
|
+
__decorate$7([
|
|
17530
|
+
Property('auto')
|
|
17531
|
+
], Mention.prototype, "popupWidth", void 0);
|
|
17532
|
+
__decorate$7([
|
|
17533
|
+
Property('300px')
|
|
17534
|
+
], Mention.prototype, "popupHeight", void 0);
|
|
17535
|
+
__decorate$7([
|
|
17536
|
+
Property(null)
|
|
17537
|
+
], Mention.prototype, "displayTemplate", void 0);
|
|
17538
|
+
__decorate$7([
|
|
17539
|
+
Property(null)
|
|
17540
|
+
], Mention.prototype, "itemTemplate", void 0);
|
|
17541
|
+
__decorate$7([
|
|
17542
|
+
Property('No records found')
|
|
17543
|
+
], Mention.prototype, "noRecordsTemplate", void 0);
|
|
17544
|
+
__decorate$7([
|
|
17545
|
+
Property(null)
|
|
17546
|
+
], Mention.prototype, "spinnerTemplate", void 0);
|
|
17547
|
+
__decorate$7([
|
|
17548
|
+
Property()
|
|
17549
|
+
], Mention.prototype, "target", void 0);
|
|
17550
|
+
__decorate$7([
|
|
17551
|
+
Property([])
|
|
17552
|
+
], Mention.prototype, "dataSource", void 0);
|
|
17553
|
+
__decorate$7([
|
|
17554
|
+
Property(null)
|
|
17555
|
+
], Mention.prototype, "query", void 0);
|
|
17556
|
+
__decorate$7([
|
|
17557
|
+
Property('Contains')
|
|
17558
|
+
], Mention.prototype, "filterType", void 0);
|
|
17559
|
+
__decorate$7([
|
|
17560
|
+
Complex({ text: null, value: null, iconCss: null, groupBy: null }, FieldSettings)
|
|
17561
|
+
], Mention.prototype, "fields", void 0);
|
|
17562
|
+
__decorate$7([
|
|
17563
|
+
Event()
|
|
17564
|
+
], Mention.prototype, "actionBegin", void 0);
|
|
17565
|
+
__decorate$7([
|
|
17566
|
+
Event()
|
|
17567
|
+
], Mention.prototype, "actionComplete", void 0);
|
|
17568
|
+
__decorate$7([
|
|
17569
|
+
Event()
|
|
17570
|
+
], Mention.prototype, "actionFailure", void 0);
|
|
17571
|
+
__decorate$7([
|
|
17572
|
+
Event()
|
|
17573
|
+
], Mention.prototype, "change", void 0);
|
|
17574
|
+
__decorate$7([
|
|
17575
|
+
Event()
|
|
17576
|
+
], Mention.prototype, "beforeOpen", void 0);
|
|
17577
|
+
__decorate$7([
|
|
17578
|
+
Event()
|
|
17579
|
+
], Mention.prototype, "opened", void 0);
|
|
17580
|
+
__decorate$7([
|
|
17581
|
+
Event()
|
|
17582
|
+
], Mention.prototype, "closed", void 0);
|
|
17583
|
+
__decorate$7([
|
|
17584
|
+
Event()
|
|
17585
|
+
], Mention.prototype, "select", void 0);
|
|
17586
|
+
__decorate$7([
|
|
17587
|
+
Event()
|
|
17588
|
+
], Mention.prototype, "filtering", void 0);
|
|
17589
|
+
__decorate$7([
|
|
17590
|
+
Event()
|
|
17591
|
+
], Mention.prototype, "created", void 0);
|
|
17592
|
+
__decorate$7([
|
|
17593
|
+
Event()
|
|
17594
|
+
], Mention.prototype, "destroyed", void 0);
|
|
17595
|
+
Mention = __decorate$7([
|
|
17596
|
+
NotifyPropertyChanges
|
|
17597
|
+
], Mention);
|
|
17598
|
+
return Mention;
|
|
17599
|
+
}(DropDownBase));
|
|
17600
|
+
|
|
15774
17601
|
/**
|
|
15775
17602
|
* export all modules from current location
|
|
15776
17603
|
*/
|
|
@@ -15779,5 +17606,5 @@ var listBoxClasses = {
|
|
|
15779
17606
|
* export all modules from current location
|
|
15780
17607
|
*/
|
|
15781
17608
|
|
|
15782
|
-
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 };
|
|
17609
|
+
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 };
|
|
15783
17610
|
//# sourceMappingURL=ej2-dropdowns.es5.js.map
|