@syncfusion/ej2-dropdowns 20.2.39 → 20.2.43-1234
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/GitLeaksReport.json +1 -0
- 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 +2260 -446
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +2303 -459
- 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/gitleaks-ci/gitleaks +0 -0
- package/gitleaks-ci.tar.gz +0 -0
- 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 +196 -90
- 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 +10 -5
- package/src/multi-select/multi-select.js +313 -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) {
|
|
@@ -2095,9 +2130,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2095
2130
|
}
|
|
2096
2131
|
if (!this.readonly) {
|
|
2097
2132
|
var isTabAction = e.action === 'tab' || e.action === 'close';
|
|
2098
|
-
if (this.list
|
|
2133
|
+
if (isNullOrUndefined(this.list) && !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,25 @@ 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
|
+
this.calculateWidth();
|
|
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
|
+
}
|
|
9896
|
+
};
|
|
9897
|
+
MultiSelect.prototype.calculateWidth = function () {
|
|
9898
|
+
var elementWidth;
|
|
9899
|
+
if (this.overAllWrapper) {
|
|
9900
|
+
if (!this.showDropDownIcon || this.overAllWrapper.querySelector('.' + 'e-label-top')) {
|
|
9901
|
+
elementWidth = this.overAllWrapper.clientWidth - 2 * (parseInt(getComputedStyle(this.inputElement).paddingRight));
|
|
9902
|
+
}
|
|
9903
|
+
else {
|
|
9904
|
+
var downIconWidth = this.dropIcon.offsetWidth +
|
|
9905
|
+
parseInt(getComputedStyle(this.dropIcon).marginRight);
|
|
9906
|
+
elementWidth = this.overAllWrapper.clientWidth - (downIconWidth + 2 * (parseInt(getComputedStyle(this.inputElement).paddingRight)));
|
|
9907
|
+
}
|
|
9908
|
+
Input.calculateWidth(elementWidth, this.overAllWrapper, this.getModuleName());
|
|
9909
|
+
}
|
|
9663
9910
|
};
|
|
9664
9911
|
MultiSelect.prototype.checkPlaceholderSize = function () {
|
|
9665
9912
|
if (this.showDropDownIcon) {
|
|
@@ -9688,11 +9935,13 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9688
9935
|
}
|
|
9689
9936
|
};
|
|
9690
9937
|
MultiSelect.prototype.refreshInputHight = function () {
|
|
9691
|
-
if (
|
|
9692
|
-
this.
|
|
9693
|
-
|
|
9694
|
-
|
|
9695
|
-
|
|
9938
|
+
if (!isNullOrUndefined(this.searchWrapper)) {
|
|
9939
|
+
if ((!this.value || !this.value.length) && (isNullOrUndefined(this.text) || this.text === '')) {
|
|
9940
|
+
this.searchWrapper.classList.remove(ZERO_SIZE);
|
|
9941
|
+
}
|
|
9942
|
+
else {
|
|
9943
|
+
this.searchWrapper.classList.add(ZERO_SIZE);
|
|
9944
|
+
}
|
|
9696
9945
|
}
|
|
9697
9946
|
};
|
|
9698
9947
|
MultiSelect.prototype.validateValues = function (newValue, oldValue) {
|
|
@@ -9730,6 +9979,11 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9730
9979
|
this.tempValues = this.value.slice();
|
|
9731
9980
|
}
|
|
9732
9981
|
};
|
|
9982
|
+
MultiSelect.prototype.updateAriaActiveDescendant = function () {
|
|
9983
|
+
if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
|
|
9984
|
+
attributes(this.inputElement, { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
|
|
9985
|
+
}
|
|
9986
|
+
};
|
|
9733
9987
|
MultiSelect.prototype.getPagingCount = function () {
|
|
9734
9988
|
var height = this.list.classList.contains(dropDownBaseClasses.noData) ? null :
|
|
9735
9989
|
getComputedStyle(this.getItems()[0], null).getPropertyValue('height');
|
|
@@ -9760,6 +10014,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9760
10014
|
+ ':not(.' + HIDE_LIST + ')') : [];
|
|
9761
10015
|
};
|
|
9762
10016
|
MultiSelect.prototype.focusInHandler = function (e) {
|
|
10017
|
+
var _this = this;
|
|
9763
10018
|
if (this.enabled) {
|
|
9764
10019
|
this.showOverAllClear();
|
|
9765
10020
|
this.inputFocus = true;
|
|
@@ -9790,6 +10045,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9790
10045
|
if (this.isPopupOpen()) {
|
|
9791
10046
|
this.refreshPopup();
|
|
9792
10047
|
}
|
|
10048
|
+
setTimeout(function () {
|
|
10049
|
+
_this.calculateWidth();
|
|
10050
|
+
}, 150);
|
|
9793
10051
|
return true;
|
|
9794
10052
|
}
|
|
9795
10053
|
else {
|
|
@@ -9845,7 +10103,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9845
10103
|
break;
|
|
9846
10104
|
case 40:
|
|
9847
10105
|
if (!this.isPopupOpen()) {
|
|
9848
|
-
this.showPopup();
|
|
10106
|
+
this.showPopup(e);
|
|
9849
10107
|
e.preventDefault();
|
|
9850
10108
|
}
|
|
9851
10109
|
break;
|
|
@@ -9872,6 +10130,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9872
10130
|
var element = scrollEle[(isHome) ? 0 : (scrollEle.length - 1)];
|
|
9873
10131
|
element.classList.add(dropDownBaseClasses.focus);
|
|
9874
10132
|
this.scrollBottom(element);
|
|
10133
|
+
this.updateAriaActiveDescendant();
|
|
9875
10134
|
}
|
|
9876
10135
|
};
|
|
9877
10136
|
MultiSelect.prototype.onKeyDown = function (e) {
|
|
@@ -10373,7 +10632,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
10373
10632
|
};
|
|
10374
10633
|
MultiSelect.prototype.invokeCheckboxSelection = function (element, eve, isClearAll) {
|
|
10375
10634
|
this.notify('updatelist', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', li: element, e: eve });
|
|
10376
|
-
|
|
10635
|
+
this.updateAriaActiveDescendant();
|
|
10377
10636
|
if ((this.value && this.value.length !== this.mainData.length)
|
|
10378
10637
|
&& (this.mode === 'CheckBox' && this.showSelectAll && !(this.isSelectAll || isClearAll))) {
|
|
10379
10638
|
this.notify('checkSelectAll', {
|
|
@@ -10486,7 +10745,6 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
10486
10745
|
HIDE_LIST :
|
|
10487
10746
|
dropDownBaseClasses.selected);
|
|
10488
10747
|
if (this.mode === 'CheckBox') {
|
|
10489
|
-
element2.firstElementChild.setAttribute('aria-checked', 'false');
|
|
10490
10748
|
removeClass([element2.firstElementChild.lastElementChild], 'e-check');
|
|
10491
10749
|
}
|
|
10492
10750
|
}
|
|
@@ -10496,7 +10754,6 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
10496
10754
|
HIDE_LIST :
|
|
10497
10755
|
dropDownBaseClasses.selected);
|
|
10498
10756
|
if (this.mode === 'CheckBox') {
|
|
10499
|
-
element2.firstElementChild.setAttribute('aria-checked', 'true');
|
|
10500
10757
|
addClass([element2.firstElementChild.lastElementChild], 'e-check');
|
|
10501
10758
|
}
|
|
10502
10759
|
}
|
|
@@ -10757,109 +11014,111 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
10757
11014
|
_super.prototype.render.call(this);
|
|
10758
11015
|
}
|
|
10759
11016
|
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) {
|
|
11017
|
+
if (!isNullOrUndefined(this.popupWrapper)) {
|
|
11018
|
+
document.body.appendChild(this.popupWrapper);
|
|
11019
|
+
var checkboxFilter = this.popupWrapper.querySelector('.' + FILTERPARENT);
|
|
11020
|
+
if (this.mode === 'CheckBox' && !this.allowFiltering && checkboxFilter && this.filterParent) {
|
|
11021
|
+
checkboxFilter.remove();
|
|
11022
|
+
this.filterParent = null;
|
|
11023
|
+
}
|
|
11024
|
+
var overAllHeight = parseInt(this.popupHeight, 10);
|
|
11025
|
+
this.popupWrapper.style.visibility = 'hidden';
|
|
11026
|
+
if (this.headerTemplate) {
|
|
11027
|
+
this.setHeaderTemplate();
|
|
10789
11028
|
overAllHeight -= this.header.offsetHeight;
|
|
10790
11029
|
}
|
|
10791
|
-
|
|
11030
|
+
append([this.list], this.popupWrapper);
|
|
11031
|
+
if (this.footerTemplate) {
|
|
11032
|
+
this.setFooterTemplate();
|
|
10792
11033
|
overAllHeight -= this.footer.offsetHeight;
|
|
10793
11034
|
}
|
|
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;
|
|
11035
|
+
if (this.mode === 'CheckBox' && this.showSelectAll) {
|
|
11036
|
+
this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
|
|
11037
|
+
overAllHeight -= this.selectAllHeight;
|
|
10804
11038
|
}
|
|
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;
|
|
11039
|
+
else if (this.mode === 'CheckBox' && !this.showSelectAll && (!this.headerTemplate && !this.footerTemplate)) {
|
|
11040
|
+
this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
|
|
11041
|
+
overAllHeight = parseInt(this.popupHeight, 10);
|
|
11042
|
+
}
|
|
11043
|
+
else if (this.mode === 'CheckBox' && !this.showSelectAll) {
|
|
11044
|
+
this.notify('selectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
|
|
11045
|
+
overAllHeight = parseInt(this.popupHeight, 10);
|
|
11046
|
+
if (this.headerTemplate && this.header) {
|
|
11047
|
+
overAllHeight -= this.header.offsetHeight;
|
|
10840
11048
|
}
|
|
10841
|
-
|
|
10842
|
-
|
|
10843
|
-
_this.targetElement().trim() !== '')) {
|
|
10844
|
-
_this.loadTemplate();
|
|
11049
|
+
if (this.footerTemplate && this.footer) {
|
|
11050
|
+
overAllHeight -= this.footer.offsetHeight;
|
|
10845
11051
|
}
|
|
10846
|
-
|
|
10847
|
-
|
|
10848
|
-
|
|
10849
|
-
|
|
10850
|
-
|
|
11052
|
+
}
|
|
11053
|
+
if (this.mode === 'CheckBox') {
|
|
11054
|
+
var args = {
|
|
11055
|
+
module: 'CheckBoxSelection',
|
|
11056
|
+
enable: this.mode === 'CheckBox',
|
|
11057
|
+
popupElement: this.popupWrapper
|
|
11058
|
+
};
|
|
11059
|
+
if (this.allowFiltering) {
|
|
11060
|
+
this.notify('searchBox', args);
|
|
11061
|
+
overAllHeight -= this.searchBoxHeight;
|
|
10851
11062
|
}
|
|
10852
|
-
|
|
10853
|
-
|
|
10854
|
-
|
|
11063
|
+
addClass([this.popupWrapper], 'e-checkbox');
|
|
11064
|
+
}
|
|
11065
|
+
if (this.popupHeight !== 'auto') {
|
|
11066
|
+
this.list.style.maxHeight = formatUnit(overAllHeight);
|
|
11067
|
+
this.popupWrapper.style.maxHeight = formatUnit(this.popupHeight);
|
|
11068
|
+
}
|
|
11069
|
+
else {
|
|
11070
|
+
this.list.style.maxHeight = formatUnit(this.popupHeight);
|
|
11071
|
+
}
|
|
11072
|
+
this.popupObj = new Popup(this.popupWrapper, {
|
|
11073
|
+
width: this.calcPopupWidth(), targetType: 'relative', position: { X: 'left', Y: 'bottom' },
|
|
11074
|
+
relateTo: this.overAllWrapper, collision: { X: 'flip', Y: 'flip' }, offsetY: 1,
|
|
11075
|
+
enableRtl: this.enableRtl, zIndex: this.zIndex,
|
|
11076
|
+
close: function () {
|
|
11077
|
+
if (_this.popupObj.element.parentElement) {
|
|
11078
|
+
_this.popupObj.unwireScrollEvents();
|
|
11079
|
+
// For restrict the page scrolling in safari browser
|
|
11080
|
+
var checkboxFilterInput = _this.popupWrapper.querySelector('.' + FILTERINPUT);
|
|
11081
|
+
if (_this.mode === 'CheckBox' && checkboxFilterInput && document.activeElement === checkboxFilterInput) {
|
|
11082
|
+
checkboxFilterInput.blur();
|
|
11083
|
+
}
|
|
11084
|
+
detach(_this.popupObj.element);
|
|
11085
|
+
}
|
|
11086
|
+
},
|
|
11087
|
+
open: function () {
|
|
11088
|
+
_this.popupObj.resolveCollision();
|
|
11089
|
+
if (!_this.isFirstClick) {
|
|
11090
|
+
var ulElement = _this.list.querySelector('ul');
|
|
11091
|
+
if (ulElement) {
|
|
11092
|
+
if (!(_this.mode !== 'CheckBox' && (_this.allowFiltering || _this.allowCustomValue) &&
|
|
11093
|
+
_this.targetElement().trim() !== '')) {
|
|
11094
|
+
_this.mainList = ulElement.cloneNode ? ulElement.cloneNode(true) : ulElement;
|
|
11095
|
+
}
|
|
11096
|
+
}
|
|
11097
|
+
_this.isFirstClick = true;
|
|
11098
|
+
}
|
|
11099
|
+
_this.popupObj.wireScrollEvents();
|
|
11100
|
+
if (!(_this.mode !== 'CheckBox' && (_this.allowFiltering || _this.allowCustomValue) &&
|
|
11101
|
+
_this.targetElement().trim() !== '')) {
|
|
11102
|
+
_this.loadTemplate();
|
|
11103
|
+
}
|
|
11104
|
+
_this.setScrollPosition();
|
|
11105
|
+
if (_this.allowFiltering) {
|
|
11106
|
+
_this.notify('inputFocus', {
|
|
11107
|
+
module: 'CheckBoxSelection', enable: _this.mode === 'CheckBox', value: 'focus'
|
|
11108
|
+
});
|
|
11109
|
+
}
|
|
11110
|
+
}, targetExitViewport: function () {
|
|
11111
|
+
if (!Browser.isDevice) {
|
|
11112
|
+
_this.hidePopup();
|
|
11113
|
+
}
|
|
10855
11114
|
}
|
|
11115
|
+
});
|
|
11116
|
+
if (this.mode === 'CheckBox' && Browser.isDevice && this.allowFiltering) {
|
|
11117
|
+
this.notify('deviceSearchBox', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
|
|
10856
11118
|
}
|
|
10857
|
-
|
|
10858
|
-
|
|
10859
|
-
this.notify('deviceSearchBox', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
|
|
11119
|
+
this.popupObj.close();
|
|
11120
|
+
this.popupWrapper.style.visibility = '';
|
|
10860
11121
|
}
|
|
10861
|
-
this.popupObj.close();
|
|
10862
|
-
this.popupWrapper.style.visibility = '';
|
|
10863
11122
|
}
|
|
10864
11123
|
};
|
|
10865
11124
|
MultiSelect.prototype.setHeaderTemplate = function () {
|
|
@@ -10929,6 +11188,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
10929
11188
|
this.removeValue(temp, e, null, true);
|
|
10930
11189
|
}
|
|
10931
11190
|
}
|
|
11191
|
+
this.selectedElementID = null;
|
|
11192
|
+
this.inputElement.removeAttribute('aria-activedescendant');
|
|
10932
11193
|
}
|
|
10933
11194
|
else {
|
|
10934
11195
|
this.clearAllCallback(e);
|
|
@@ -11032,11 +11293,12 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11032
11293
|
};
|
|
11033
11294
|
MultiSelect.prototype.search = function (e) {
|
|
11034
11295
|
var _this = this;
|
|
11296
|
+
this.resetFilteredData = true;
|
|
11035
11297
|
if (!isNullOrUndefined(e)) {
|
|
11036
11298
|
this.keyCode = e.keyCode;
|
|
11037
11299
|
}
|
|
11038
11300
|
if (!this.isPopupOpen() && this.openOnClick) {
|
|
11039
|
-
this.showPopup();
|
|
11301
|
+
this.showPopup(e);
|
|
11040
11302
|
}
|
|
11041
11303
|
this.openClick(e);
|
|
11042
11304
|
if (this.checkTextLength() && !this.allowFiltering && !isNullOrUndefined(e) && (e.keyCode !== 8)) {
|
|
@@ -11120,7 +11382,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11120
11382
|
var temp;
|
|
11121
11383
|
var tempData = this.listData;
|
|
11122
11384
|
this.listData = this.mainData;
|
|
11123
|
-
this.hiddenElement
|
|
11385
|
+
if (!isNullOrUndefined(this.hiddenElement)) {
|
|
11386
|
+
this.hiddenElement.innerHTML = '';
|
|
11387
|
+
}
|
|
11124
11388
|
if (!isNullOrUndefined(this.value)) {
|
|
11125
11389
|
for (var index = 0; !isNullOrUndefined(this.value[index]); index++) {
|
|
11126
11390
|
var listValue = this.findListElement(((!isNullOrUndefined(this.mainList)) ? this.mainList : this.ulElement), 'li', 'data-value', this.value[index]);
|
|
@@ -11138,7 +11402,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11138
11402
|
data += temp + delimiterChar + ' ';
|
|
11139
11403
|
text.push(temp);
|
|
11140
11404
|
}
|
|
11141
|
-
this.hiddenElement
|
|
11405
|
+
if (!isNullOrUndefined(this.hiddenElement)) {
|
|
11406
|
+
this.hiddenElement.innerHTML += '<option selected value ="' + this.value[index] + '">' + index + '</option>';
|
|
11407
|
+
}
|
|
11142
11408
|
}
|
|
11143
11409
|
}
|
|
11144
11410
|
this.setProperties({ text: text.toString() }, true);
|
|
@@ -11183,7 +11449,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11183
11449
|
|| this.list.querySelector('.e-ul') && this.list.querySelector('.e-ul').childElementCount === 0)) {
|
|
11184
11450
|
isEmptyData = true;
|
|
11185
11451
|
}
|
|
11186
|
-
_super.prototype.render.call(this, isEmptyData);
|
|
11452
|
+
_super.prototype.render.call(this, null, isEmptyData);
|
|
11187
11453
|
this.unwireListEvents();
|
|
11188
11454
|
this.wireListEvents();
|
|
11189
11455
|
};
|
|
@@ -11271,7 +11537,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11271
11537
|
}
|
|
11272
11538
|
};
|
|
11273
11539
|
MultiSelect.prototype.updateDataList = function () {
|
|
11274
|
-
if (this.mainList && this.ulElement && !(this.isFiltered || this.filterAction)) {
|
|
11540
|
+
if (this.mainList && this.ulElement && !(this.isFiltered || this.filterAction || this.targetElement().trim())) {
|
|
11275
11541
|
var isDynamicGroupItemUpdate = this.mainList.childElementCount < this.ulElement.childElementCount;
|
|
11276
11542
|
var isReactTemplateUpdate = ((this.ulElement.childElementCount > 0 && this.ulElement.children[0].childElementCount > 0) && (this.mainList.children[0].childElementCount < this.ulElement.children[0].childElementCount));
|
|
11277
11543
|
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 +11616,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11350
11616
|
selectItems[temp1 - 1].setAttribute('aria-selected', 'false');
|
|
11351
11617
|
if (this.mode === 'CheckBox') {
|
|
11352
11618
|
if (selectedItems && (selectedItems.length > (temp1 - 1))) {
|
|
11353
|
-
selectedItems[temp1 - 1].firstElementChild.setAttribute('aria-checked', 'false');
|
|
11354
11619
|
removeClass([selectedItems[temp1 - 1].firstElementChild.lastElementChild], 'e-check');
|
|
11355
11620
|
}
|
|
11356
|
-
selectItems[temp1 - 1].firstElementChild.setAttribute('aria-checked', 'false');
|
|
11357
11621
|
removeClass([selectItems[temp1 - 1].firstElementChild.lastElementChild], 'e-check');
|
|
11358
11622
|
}
|
|
11359
11623
|
temp1--;
|
|
@@ -11394,10 +11658,12 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11394
11658
|
if (this.enabled && this.isValidLI(element)) {
|
|
11395
11659
|
this.removeFocus();
|
|
11396
11660
|
addClass([element], dropDownBaseClasses.focus);
|
|
11661
|
+
this.updateAriaActiveDescendant();
|
|
11397
11662
|
}
|
|
11398
11663
|
else {
|
|
11399
11664
|
if (this.enableGroupCheckBox && this.mode === 'CheckBox' && !isNullOrUndefined(this.fields.groupBy)) {
|
|
11400
11665
|
addClass([element], dropDownBaseClasses.focus);
|
|
11666
|
+
this.updateAriaActiveDescendant();
|
|
11401
11667
|
}
|
|
11402
11668
|
}
|
|
11403
11669
|
};
|
|
@@ -11409,9 +11675,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11409
11675
|
addClass([element], className);
|
|
11410
11676
|
this.updateMainList(false, element.getAttribute('data-value'), mainElement);
|
|
11411
11677
|
element.setAttribute('aria-selected', 'true');
|
|
11412
|
-
if (this.mode === 'CheckBox') {
|
|
11413
|
-
var ariaCheck = element.
|
|
11414
|
-
if (ariaCheck ===
|
|
11678
|
+
if (this.mode === 'CheckBox' && element.classList.contains('e-active')) {
|
|
11679
|
+
var ariaCheck = element.getElementsByClassName('e-check').length;
|
|
11680
|
+
if (ariaCheck === 0) {
|
|
11415
11681
|
this.notify('updatelist', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', li: element, e: this });
|
|
11416
11682
|
}
|
|
11417
11683
|
}
|
|
@@ -11419,7 +11685,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11419
11685
|
if (this.chipCollectionWrapper) {
|
|
11420
11686
|
this.removeChipSelection();
|
|
11421
11687
|
}
|
|
11422
|
-
|
|
11688
|
+
this.selectedElementID = element.id;
|
|
11423
11689
|
}
|
|
11424
11690
|
};
|
|
11425
11691
|
MultiSelect.prototype.updateDelimeter = function (delimChar, e) {
|
|
@@ -11730,9 +11996,11 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11730
11996
|
if (this.chipCollectionWrapper) {
|
|
11731
11997
|
this.chipCollectionWrapper.style.display = 'none';
|
|
11732
11998
|
}
|
|
11733
|
-
this.viewWrapper
|
|
11734
|
-
|
|
11735
|
-
|
|
11999
|
+
if (!isNullOrUndefined(this.viewWrapper)) {
|
|
12000
|
+
this.viewWrapper.style.display = '';
|
|
12001
|
+
this.viewWrapper.style.width = '';
|
|
12002
|
+
this.viewWrapper.classList.remove(TOTAL_COUNT_WRAPPER$1);
|
|
12003
|
+
}
|
|
11736
12004
|
if (this.value && this.value.length) {
|
|
11737
12005
|
var data = '';
|
|
11738
12006
|
var temp = void 0;
|
|
@@ -11783,7 +12051,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11783
12051
|
overAllContainer = this.componentWrapper.offsetWidth -
|
|
11784
12052
|
parseInt(window.getComputedStyle(this.componentWrapper).paddingLeft, 10) -
|
|
11785
12053
|
parseInt(window.getComputedStyle(this.componentWrapper).paddingRight, 10);
|
|
11786
|
-
if ((wrapperleng + downIconWidth + this.clearIconWidth)
|
|
12054
|
+
if ((wrapperleng + downIconWidth + this.clearIconWidth) >= overAllContainer) {
|
|
11787
12055
|
if (tempData !== undefined && tempData !== '') {
|
|
11788
12056
|
temp = tempData;
|
|
11789
12057
|
index = tempIndex + 1;
|
|
@@ -11792,7 +12060,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11792
12060
|
remaining = this.value.length - index;
|
|
11793
12061
|
wrapperleng = this.viewWrapper.offsetWidth +
|
|
11794
12062
|
parseInt(window.getComputedStyle(this.viewWrapper).paddingRight, 10);
|
|
11795
|
-
while (((wrapperleng + remainSize + downIconWidth + this.clearIconWidth)
|
|
12063
|
+
while (((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) >= overAllContainer) && wrapperleng !== 0
|
|
11796
12064
|
&& this.viewWrapper.innerHTML !== '') {
|
|
11797
12065
|
var textArr = [];
|
|
11798
12066
|
this.viewWrapper.innerHTML = textArr.join(this.delimiterChar);
|
|
@@ -11802,7 +12070,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11802
12070
|
}
|
|
11803
12071
|
break;
|
|
11804
12072
|
}
|
|
11805
|
-
else if ((wrapperleng + remainSize + downIconWidth + this.clearIconWidth)
|
|
12073
|
+
else if ((wrapperleng + remainSize + downIconWidth + this.clearIconWidth) < overAllContainer) {
|
|
11806
12074
|
tempData = data;
|
|
11807
12075
|
tempIndex = index;
|
|
11808
12076
|
}
|
|
@@ -11820,8 +12088,10 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11820
12088
|
}
|
|
11821
12089
|
}
|
|
11822
12090
|
else {
|
|
11823
|
-
this.viewWrapper
|
|
11824
|
-
|
|
12091
|
+
if (!isNullOrUndefined(this.viewWrapper)) {
|
|
12092
|
+
this.viewWrapper.innerHTML = '';
|
|
12093
|
+
this.viewWrapper.style.display = 'none';
|
|
12094
|
+
}
|
|
11825
12095
|
}
|
|
11826
12096
|
};
|
|
11827
12097
|
MultiSelect.prototype.checkClearIconWidth = function () {
|
|
@@ -11894,29 +12164,41 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11894
12164
|
return temp;
|
|
11895
12165
|
};
|
|
11896
12166
|
MultiSelect.prototype.unWireEvent = function () {
|
|
11897
|
-
|
|
12167
|
+
if (!isNullOrUndefined(this.componentWrapper)) {
|
|
12168
|
+
EventHandler.remove(this.componentWrapper, 'mousedown', this.wrapperClick);
|
|
12169
|
+
}
|
|
11898
12170
|
EventHandler.remove(window, 'resize', this.windowResize);
|
|
11899
|
-
|
|
11900
|
-
|
|
11901
|
-
|
|
11902
|
-
|
|
12171
|
+
if (!isNullOrUndefined(this.inputElement)) {
|
|
12172
|
+
EventHandler.remove(this.inputElement, 'focus', this.focusInHandler);
|
|
12173
|
+
EventHandler.remove(this.inputElement, 'keydown', this.onKeyDown);
|
|
12174
|
+
if (this.mode !== 'CheckBox') {
|
|
12175
|
+
EventHandler.remove(this.inputElement, 'input', this.onInput);
|
|
12176
|
+
}
|
|
12177
|
+
EventHandler.remove(this.inputElement, 'keyup', this.keyUp);
|
|
12178
|
+
var formElement = closest(this.inputElement, 'form');
|
|
12179
|
+
if (formElement) {
|
|
12180
|
+
EventHandler.remove(formElement, 'reset', this.resetValueHandler);
|
|
12181
|
+
}
|
|
12182
|
+
EventHandler.remove(this.inputElement, 'blur', this.onBlurHandler);
|
|
11903
12183
|
}
|
|
11904
|
-
|
|
11905
|
-
|
|
11906
|
-
|
|
11907
|
-
|
|
12184
|
+
if (!isNullOrUndefined(this.componentWrapper)) {
|
|
12185
|
+
EventHandler.remove(this.componentWrapper, 'mouseover', this.mouseIn);
|
|
12186
|
+
EventHandler.remove(this.componentWrapper, 'mouseout', this.mouseOut);
|
|
12187
|
+
}
|
|
12188
|
+
if (!isNullOrUndefined(this.overAllClear)) {
|
|
12189
|
+
EventHandler.remove(this.overAllClear, 'mousedown', this.clearAll);
|
|
12190
|
+
}
|
|
12191
|
+
if (!isNullOrUndefined(this.inputElement)) {
|
|
12192
|
+
EventHandler.remove(this.inputElement, 'paste', this.pasteHandler);
|
|
11908
12193
|
}
|
|
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
12194
|
};
|
|
11915
12195
|
MultiSelect.prototype.selectAllItem = function (state, event, list) {
|
|
11916
12196
|
var li;
|
|
11917
|
-
|
|
11918
|
-
|
|
11919
|
-
|
|
12197
|
+
if (!isNullOrUndefined(this.list)) {
|
|
12198
|
+
li = this.list.querySelectorAll(state ?
|
|
12199
|
+
'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide)' :
|
|
12200
|
+
'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)');
|
|
12201
|
+
}
|
|
11920
12202
|
if (this.value && this.value.length && event && event.target
|
|
11921
12203
|
&& closest(event.target, '.e-close-hooker') && this.allowFiltering) {
|
|
11922
12204
|
li = this.mainList.querySelectorAll(state ?
|
|
@@ -11966,6 +12248,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11966
12248
|
target.classList.remove('e-active');
|
|
11967
12249
|
}
|
|
11968
12250
|
target.classList.add('e-item-focus');
|
|
12251
|
+
this.updateAriaActiveDescendant();
|
|
11969
12252
|
}
|
|
11970
12253
|
this.textboxValueUpdate();
|
|
11971
12254
|
this.checkPlaceholderSize();
|
|
@@ -11980,6 +12263,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11980
12263
|
else {
|
|
11981
12264
|
this.updateValue(event, li, state);
|
|
11982
12265
|
}
|
|
12266
|
+
this.addValidInputClass();
|
|
11983
12267
|
};
|
|
11984
12268
|
MultiSelect.prototype.updateValue = function (event, li, state) {
|
|
11985
12269
|
var _this = this;
|
|
@@ -12205,6 +12489,11 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12205
12489
|
MultiSelect.prototype.onPropertyChanged = function (newProp, oldProp) {
|
|
12206
12490
|
if (newProp.dataSource && !isNullOrUndefined(Object.keys(newProp.dataSource))
|
|
12207
12491
|
|| newProp.query && !isNullOrUndefined(Object.keys(newProp.query))) {
|
|
12492
|
+
if (this.resetFilteredData) {
|
|
12493
|
+
// The filtered data is not being reset in the component after the user focuses out.
|
|
12494
|
+
this.resetMainList = !this.resetMainList ? this.mainList : this.resetMainList;
|
|
12495
|
+
this.resetFilteredData = false;
|
|
12496
|
+
}
|
|
12208
12497
|
this.mainList = null;
|
|
12209
12498
|
this.mainData = null;
|
|
12210
12499
|
this.isFirstClick = false;
|
|
@@ -12265,6 +12554,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12265
12554
|
case 'cssClass':
|
|
12266
12555
|
this.updateOldPropCssClass(oldProp.cssClass);
|
|
12267
12556
|
this.updateCssClass();
|
|
12557
|
+
this.calculateWidth();
|
|
12268
12558
|
break;
|
|
12269
12559
|
case 'enableRtl':
|
|
12270
12560
|
this.enableRTL(newProp.enableRtl);
|
|
@@ -12291,6 +12581,11 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12291
12581
|
case 'floatLabelType':
|
|
12292
12582
|
this.setFloatLabelType();
|
|
12293
12583
|
this.addValidInputClass();
|
|
12584
|
+
Input.createSpanElement(this.overAllWrapper, this.createElement);
|
|
12585
|
+
this.calculateWidth();
|
|
12586
|
+
if (!isNullOrUndefined(this.overAllWrapper) && !isNullOrUndefined(this.overAllWrapper.getElementsByClassName('e-ddl-icon')[0] && this.overAllWrapper.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never')) {
|
|
12587
|
+
this.overAllWrapper.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
|
|
12588
|
+
}
|
|
12294
12589
|
break;
|
|
12295
12590
|
case 'enableSelectionOrder':
|
|
12296
12591
|
break;
|
|
@@ -12350,7 +12645,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12350
12645
|
MultiSelect.prototype.addNonPresentItems = function (valuecheck, ulElement, list, event) {
|
|
12351
12646
|
var _this = this;
|
|
12352
12647
|
this.dataSource.executeQuery(this.getForQuery(valuecheck)).then(function (e) {
|
|
12353
|
-
|
|
12648
|
+
if (e.result.length > 0) {
|
|
12649
|
+
_this.addItem(e.result, list.length);
|
|
12650
|
+
}
|
|
12354
12651
|
_this.updateActionList(ulElement, list, event);
|
|
12355
12652
|
});
|
|
12356
12653
|
};
|
|
@@ -12409,7 +12706,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12409
12706
|
* Adds a new item to the multiselect popup list. By default, new item appends to the list as the last item,
|
|
12410
12707
|
* but you can insert based on the index parameter.
|
|
12411
12708
|
*
|
|
12412
|
-
* @param
|
|
12709
|
+
* @param { Object[] } items - Specifies an array of JSON data or a JSON data.
|
|
12413
12710
|
* @param { number } itemIndex - Specifies the index to place the newly added item in the popup list.
|
|
12414
12711
|
* @returns {void}
|
|
12415
12712
|
*/
|
|
@@ -12441,6 +12738,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12441
12738
|
_this.overAllWrapper.classList.remove(iconAnimation);
|
|
12442
12739
|
_this.popupObj.hide(new Animation(eventArgs.animation));
|
|
12443
12740
|
attributes(_this.inputElement, { 'aria-expanded': 'false' });
|
|
12741
|
+
_this.inputElement.removeAttribute('aria-owns');
|
|
12742
|
+
_this.inputElement.removeAttribute('aria-activedescendant');
|
|
12444
12743
|
if (_this.allowFiltering) {
|
|
12445
12744
|
_this.notify('inputFocus', { module: 'CheckBoxSelection', enable: _this.mode === 'CheckBox', value: 'clear' });
|
|
12446
12745
|
}
|
|
@@ -12456,7 +12755,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12456
12755
|
*
|
|
12457
12756
|
* @returns {void}
|
|
12458
12757
|
*/
|
|
12459
|
-
MultiSelect.prototype.showPopup = function () {
|
|
12758
|
+
MultiSelect.prototype.showPopup = function (e) {
|
|
12460
12759
|
var _this = this;
|
|
12461
12760
|
if (!this.enabled) {
|
|
12462
12761
|
return;
|
|
@@ -12466,7 +12765,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12466
12765
|
if (!args.cancel) {
|
|
12467
12766
|
if (!_this.ulElement) {
|
|
12468
12767
|
_this.beforePopupOpen = true;
|
|
12469
|
-
_super.prototype.render.call(_this);
|
|
12768
|
+
_super.prototype.render.call(_this, e);
|
|
12470
12769
|
if (_this.mode === 'CheckBox' && Browser.isDevice && _this.allowFiltering) {
|
|
12471
12770
|
_this.notify('popupFullScreen', { module: 'CheckBoxSelection', enable: _this.mode === 'CheckBox' });
|
|
12472
12771
|
}
|
|
@@ -12482,7 +12781,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12482
12781
|
_this.beforePopupOpen = false;
|
|
12483
12782
|
return;
|
|
12484
12783
|
}
|
|
12485
|
-
_this.onPopupShown();
|
|
12784
|
+
_this.onPopupShown(e);
|
|
12486
12785
|
}
|
|
12487
12786
|
});
|
|
12488
12787
|
};
|
|
@@ -12584,12 +12883,12 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12584
12883
|
spellcheck: 'false',
|
|
12585
12884
|
type: 'text',
|
|
12586
12885
|
autocomplete: 'off',
|
|
12587
|
-
tabindex: '0'
|
|
12886
|
+
tabindex: '0',
|
|
12887
|
+
role: 'combobox'
|
|
12588
12888
|
}
|
|
12589
12889
|
});
|
|
12590
12890
|
if (this.mode === 'Default' || this.mode === 'Box') {
|
|
12591
12891
|
this.inputElement.setAttribute('aria-describedby', this.chipCollectionWrapper.id);
|
|
12592
|
-
this.inputElement.setAttribute('aria-labelledby', this.chipCollectionWrapper.id);
|
|
12593
12892
|
}
|
|
12594
12893
|
if (this.element.tagName !== this.getNgDirective()) {
|
|
12595
12894
|
this.element.style.display = 'none';
|
|
@@ -12622,6 +12921,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12622
12921
|
if (this.mode !== 'CheckBox') {
|
|
12623
12922
|
this.hideOverAllClear();
|
|
12624
12923
|
}
|
|
12924
|
+
if (!isNullOrUndefined(closest(this.element, "fieldset")) && closest(this.element, "fieldset").disabled) {
|
|
12925
|
+
this.enabled = false;
|
|
12926
|
+
}
|
|
12625
12927
|
this.wireEvent();
|
|
12626
12928
|
this.enable(this.enabled);
|
|
12627
12929
|
this.enableRTL(this.enableRtl);
|
|
@@ -12629,6 +12931,11 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12629
12931
|
if (this.element.hasAttribute('data-val')) {
|
|
12630
12932
|
this.element.setAttribute('data-val', 'false');
|
|
12631
12933
|
}
|
|
12934
|
+
Input.createSpanElement(this.overAllWrapper, this.createElement);
|
|
12935
|
+
this.calculateWidth();
|
|
12936
|
+
if (!isNullOrUndefined(this.overAllWrapper) && !isNullOrUndefined(this.overAllWrapper.getElementsByClassName('e-ddl-icon')[0] && this.overAllWrapper.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never')) {
|
|
12937
|
+
this.overAllWrapper.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
|
|
12938
|
+
}
|
|
12632
12939
|
this.renderComplete();
|
|
12633
12940
|
};
|
|
12634
12941
|
MultiSelect.prototype.checkInitialValue = function () {
|
|
@@ -12710,11 +13017,13 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12710
13017
|
}
|
|
12711
13018
|
};
|
|
12712
13019
|
MultiSelect.prototype.addValidInputClass = function () {
|
|
12713
|
-
if (
|
|
12714
|
-
|
|
12715
|
-
|
|
12716
|
-
|
|
12717
|
-
|
|
13020
|
+
if (!isNullOrUndefined(this.overAllWrapper)) {
|
|
13021
|
+
if ((!isNullOrUndefined(this.value) && this.value.length) || this.floatLabelType === 'Always') {
|
|
13022
|
+
addClass([this.overAllWrapper], 'e-valid-input');
|
|
13023
|
+
}
|
|
13024
|
+
else {
|
|
13025
|
+
removeClass([this.overAllWrapper], 'e-valid-input');
|
|
13026
|
+
}
|
|
12718
13027
|
}
|
|
12719
13028
|
};
|
|
12720
13029
|
MultiSelect.prototype.dropDownIcon = function () {
|
|
@@ -12765,15 +13074,19 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12765
13074
|
this.ulElement = null;
|
|
12766
13075
|
this.mainListCollection = null;
|
|
12767
13076
|
_super.prototype.destroy.call(this);
|
|
12768
|
-
var temp = ['readonly', 'aria-disabled', '
|
|
13077
|
+
var temp = ['readonly', 'aria-disabled', 'placeholder'];
|
|
12769
13078
|
var length = temp.length;
|
|
12770
|
-
|
|
12771
|
-
|
|
12772
|
-
|
|
13079
|
+
if (!isNullOrUndefined(this.inputElement)) {
|
|
13080
|
+
while (length > 0) {
|
|
13081
|
+
this.inputElement.removeAttribute(temp[length - 1]);
|
|
13082
|
+
length--;
|
|
13083
|
+
}
|
|
12773
13084
|
}
|
|
12774
|
-
this.element
|
|
12775
|
-
|
|
12776
|
-
|
|
13085
|
+
if (!isNullOrUndefined(this.element)) {
|
|
13086
|
+
this.element.removeAttribute('data-initial-value');
|
|
13087
|
+
this.element.style.display = 'block';
|
|
13088
|
+
}
|
|
13089
|
+
if (this.overAllWrapper && this.overAllWrapper.parentElement) {
|
|
12777
13090
|
if (this.overAllWrapper.parentElement.tagName === this.getNgDirective()) {
|
|
12778
13091
|
remove(this.overAllWrapper);
|
|
12779
13092
|
}
|
|
@@ -12782,6 +13095,25 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12782
13095
|
remove(this.overAllWrapper);
|
|
12783
13096
|
}
|
|
12784
13097
|
}
|
|
13098
|
+
this.componentWrapper = null;
|
|
13099
|
+
this.overAllClear = null;
|
|
13100
|
+
this.overAllWrapper = null;
|
|
13101
|
+
this.hiddenElement = null;
|
|
13102
|
+
this.searchWrapper = null;
|
|
13103
|
+
this.viewWrapper = null;
|
|
13104
|
+
this.chipCollectionWrapper = null;
|
|
13105
|
+
this.targetInputElement = null;
|
|
13106
|
+
this.popupWrapper = null;
|
|
13107
|
+
this.inputElement = null;
|
|
13108
|
+
this.delimiterWrapper = null;
|
|
13109
|
+
this.popupObj = null;
|
|
13110
|
+
this.popupWrapper = null;
|
|
13111
|
+
this.liCollections = null;
|
|
13112
|
+
this.header = null;
|
|
13113
|
+
this.mainList = null;
|
|
13114
|
+
this.mainListCollection = null;
|
|
13115
|
+
this.footer = null;
|
|
13116
|
+
this.selectAllEventEle = null;
|
|
12785
13117
|
};
|
|
12786
13118
|
__decorate$5([
|
|
12787
13119
|
Complex({ text: null, value: null, iconCss: null, groupBy: null }, FieldSettings)
|
|
@@ -13133,6 +13465,12 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
|
|
|
13133
13465
|
CheckBoxSelection.prototype.destroy = function () {
|
|
13134
13466
|
this.removeEventListener();
|
|
13135
13467
|
EventHandler.remove(document, 'mousedown', this.onDocumentClick);
|
|
13468
|
+
this.checkAllParent = null;
|
|
13469
|
+
this.clearIconElement = null;
|
|
13470
|
+
this.filterInput = null;
|
|
13471
|
+
this.filterInputObj = null;
|
|
13472
|
+
this.checkWrapper = null;
|
|
13473
|
+
this.selectAllSpan = null;
|
|
13136
13474
|
};
|
|
13137
13475
|
CheckBoxSelection.prototype.listSelection = function (args) {
|
|
13138
13476
|
var target;
|
|
@@ -13181,12 +13519,10 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
|
|
|
13181
13519
|
e.preventDefault();
|
|
13182
13520
|
};
|
|
13183
13521
|
CheckBoxSelection.prototype.changeState = function (wrapper, state, e, isPrevent, selectAll$$1) {
|
|
13184
|
-
var ariaState;
|
|
13185
13522
|
var frameSpan = wrapper.getElementsByClassName(CHECKBOXFRAME$1)[0];
|
|
13186
13523
|
if (state === 'check' && !frameSpan.classList.contains(CHECK$1)) {
|
|
13187
13524
|
frameSpan.classList.remove(INDETERMINATE);
|
|
13188
13525
|
frameSpan.classList.add(CHECK$1);
|
|
13189
|
-
ariaState = 'true';
|
|
13190
13526
|
if (selectAll$$1) {
|
|
13191
13527
|
this.parent.selectAllItems(true, e);
|
|
13192
13528
|
this.setLocale(true);
|
|
@@ -13194,7 +13530,6 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
|
|
|
13194
13530
|
}
|
|
13195
13531
|
else if (state === 'uncheck' && (frameSpan.classList.contains(CHECK$1) || frameSpan.classList.contains(INDETERMINATE))) {
|
|
13196
13532
|
removeClass([frameSpan], [CHECK$1, INDETERMINATE]);
|
|
13197
|
-
ariaState = 'false';
|
|
13198
13533
|
if (selectAll$$1) {
|
|
13199
13534
|
this.parent.selectAllItems(false, e);
|
|
13200
13535
|
this.setLocale();
|
|
@@ -13203,16 +13538,11 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
|
|
|
13203
13538
|
else if (state === 'indeterminate' && !(frameSpan.classList.contains(INDETERMINATE))) {
|
|
13204
13539
|
removeClass([frameSpan], [CHECK$1]);
|
|
13205
13540
|
frameSpan.classList.add(INDETERMINATE);
|
|
13206
|
-
ariaState = 'false';
|
|
13207
13541
|
if (selectAll$$1) {
|
|
13208
13542
|
this.parent.selectAllItems(false, e);
|
|
13209
13543
|
this.setLocale();
|
|
13210
13544
|
}
|
|
13211
13545
|
}
|
|
13212
|
-
ariaState = state === 'check' ? 'true' : state === 'uncheck' ? 'false' : ariaState;
|
|
13213
|
-
if (!isNullOrUndefined(ariaState)) {
|
|
13214
|
-
wrapper.setAttribute('aria-checked', ariaState);
|
|
13215
|
-
}
|
|
13216
13546
|
};
|
|
13217
13547
|
CheckBoxSelection.prototype.setSearchBox = function (args) {
|
|
13218
13548
|
if (isNullOrUndefined(this.parent.filterParent)) {
|
|
@@ -13246,11 +13576,8 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
|
|
|
13246
13576
|
prepend([this.parent.filterParent], args.popupElement);
|
|
13247
13577
|
attributes(this.filterInput, {
|
|
13248
13578
|
'aria-disabled': 'false',
|
|
13249
|
-
'
|
|
13250
|
-
'role': 'listbox',
|
|
13251
|
-
'aria-activedescendant': null,
|
|
13579
|
+
'role': 'combobox',
|
|
13252
13580
|
'autocomplete': 'off',
|
|
13253
|
-
'autocorrect': 'off',
|
|
13254
13581
|
'autocapitalize': 'off',
|
|
13255
13582
|
'spellcheck': 'false'
|
|
13256
13583
|
});
|
|
@@ -13376,8 +13703,8 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
|
|
|
13376
13703
|
e.preventDefault();
|
|
13377
13704
|
}
|
|
13378
13705
|
}
|
|
13379
|
-
if (!(!isNullOrUndefined(this.parent.popupObj) && closest(target, '[id="' + this.parent.popupObj.element.id + '"]'))
|
|
13380
|
-
!this.parent.overAllWrapper.contains(e.target)) {
|
|
13706
|
+
if (!(!isNullOrUndefined(this.parent.popupObj) && closest(target, '[id="' + this.parent.popupObj.element.id + '"]'))
|
|
13707
|
+
&& !isNullOrUndefined(this.parent.overAllWrapper) && !this.parent.overAllWrapper.contains(e.target)) {
|
|
13381
13708
|
if (this.parent.overAllWrapper.classList.contains(dropDownBaseClasses.focus) || this.parent.isPopupOpen()) {
|
|
13382
13709
|
this.parent.inputFocus = false;
|
|
13383
13710
|
this.parent.scrollFocusStatus = false;
|
|
@@ -13390,7 +13717,7 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
|
|
|
13390
13717
|
this.parent.scrollFocusStatus = (Browser.isIE || Browser.info.name === 'edge') &&
|
|
13391
13718
|
(document.activeElement === this.filterInput);
|
|
13392
13719
|
}
|
|
13393
|
-
if (!this.parent.overAllWrapper.contains(e.target) && this.parent.overAllWrapper.classList.contains('e-input-focus') &&
|
|
13720
|
+
if (!isNullOrUndefined(this.parent.overAllWrapper) && !this.parent.overAllWrapper.contains(e.target) && this.parent.overAllWrapper.classList.contains('e-input-focus') &&
|
|
13394
13721
|
!this.parent.isPopupOpen()) {
|
|
13395
13722
|
if (Browser.isIE) {
|
|
13396
13723
|
this.parent.onBlurHandler();
|
|
@@ -13421,7 +13748,7 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
|
|
|
13421
13748
|
}
|
|
13422
13749
|
};
|
|
13423
13750
|
CheckBoxSelection.prototype.checkSelectAll = function (e) {
|
|
13424
|
-
if (e.value === 'check'
|
|
13751
|
+
if (e.value === 'check') {
|
|
13425
13752
|
this.changeState(this.checkAllParent, e.value, null, null, false);
|
|
13426
13753
|
this.setLocale(true);
|
|
13427
13754
|
}
|
|
@@ -13605,6 +13932,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
13605
13932
|
this.isCustomFiltering = false;
|
|
13606
13933
|
this.initialSelectedOptions = this.value;
|
|
13607
13934
|
_super.prototype.render.call(this);
|
|
13935
|
+
this.setEnabled();
|
|
13608
13936
|
this.renderComplete();
|
|
13609
13937
|
};
|
|
13610
13938
|
ListBox.prototype.initWrapper = function () {
|
|
@@ -13639,7 +13967,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
13639
13967
|
removeClass([this.list], [dropDownBaseClasses.content, dropDownBaseClasses.root]);
|
|
13640
13968
|
this.validationAttribute(this.element, hiddenSelect);
|
|
13641
13969
|
this.list.setAttribute('role', 'listbox');
|
|
13642
|
-
attributes(this.list, { 'role': 'listbox', 'aria-multiselectable': this.selectionSettings.mode === 'Multiple' ? 'true' : 'false' });
|
|
13970
|
+
attributes(this.list, { 'role': 'listbox', 'aria-label': 'listbox', 'aria-multiselectable': this.selectionSettings.mode === 'Multiple' ? 'true' : 'false' });
|
|
13643
13971
|
this.updateSelectionSettings();
|
|
13644
13972
|
};
|
|
13645
13973
|
ListBox.prototype.updateSelectionSettings = function () {
|
|
@@ -13902,10 +14230,10 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
13902
14230
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13903
14231
|
var event = args.event;
|
|
13904
14232
|
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(
|
|
14233
|
+
if (args.target && (args.target.classList.contains('e-listbox-wrapper') || args.target.classList.contains('e-list-item')
|
|
14234
|
+
|| args.target.classList.contains('e-filter-parent') || args.target.classList.contains('e-input-group'))) {
|
|
14235
|
+
if (args.target.classList.contains('e-list-item') || args.target.classList.contains('e-filter-parent')
|
|
14236
|
+
|| args.target.classList.contains('e-input-group')) {
|
|
13909
14237
|
wrapper = args.target.closest('.e-listbox-wrapper');
|
|
13910
14238
|
}
|
|
13911
14239
|
else {
|
|
@@ -13960,7 +14288,8 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
13960
14288
|
var getArgs = this.getDragArgs({ target: args.droppedElement }, true);
|
|
13961
14289
|
var sourceArgs = { previousData: this.dataSource };
|
|
13962
14290
|
var destArgs = { previousData: listObj.dataSource };
|
|
13963
|
-
var dragArgs = extend({}, getArgs, { target: args.target, source: { previousData: this.dataSource },
|
|
14291
|
+
var dragArgs = extend({}, getArgs, { target: args.target, source: { previousData: this.dataSource },
|
|
14292
|
+
previousIndex: args.previousIndex, currentIndex: args.currentIndex });
|
|
13964
14293
|
if (listObj !== this) {
|
|
13965
14294
|
var sourceArgs1 = extend(sourceArgs, { currentData: this.listData });
|
|
13966
14295
|
dragArgs = extend(dragArgs, { source: sourceArgs1, destination: destArgs });
|
|
@@ -14035,10 +14364,10 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
14035
14364
|
sortedData.splice(destIdx, 0, droppedData);
|
|
14036
14365
|
liColl.splice(destIdx, 0, fLiColl_1.splice(srcIdx, 1)[0]);
|
|
14037
14366
|
if (!value) {
|
|
14038
|
-
var
|
|
14039
|
-
for (var i = 0; i <
|
|
14040
|
-
if (
|
|
14041
|
-
li_1 =
|
|
14367
|
+
var liCollElem_1 = _this.getItems();
|
|
14368
|
+
for (var i = 0; i < liCollElem_1.length; i++) {
|
|
14369
|
+
if (liCollElem_1[i].getAttribute('data-value') === null && liCollElem_1[i].classList.contains('e-list-item')) {
|
|
14370
|
+
li_1 = liCollElem_1[i];
|
|
14042
14371
|
break;
|
|
14043
14372
|
}
|
|
14044
14373
|
}
|
|
@@ -14088,10 +14417,17 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
14088
14417
|
dragArgs = extend(dragArgs, { destination: dragArgs1 });
|
|
14089
14418
|
}
|
|
14090
14419
|
this.trigger('drop', dragArgs);
|
|
14420
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14421
|
+
var liCollElem = dragArgs.elements;
|
|
14422
|
+
if (liCollElem.length) {
|
|
14423
|
+
for (var i = 0; i < liCollElem.length; i++) {
|
|
14424
|
+
liCollElem[i].classList.remove('e-grabbed');
|
|
14425
|
+
}
|
|
14426
|
+
}
|
|
14091
14427
|
};
|
|
14092
14428
|
ListBox.prototype.updateListItems = function (sourceElem, destElem) {
|
|
14093
14429
|
var i = 0;
|
|
14094
|
-
destElem.innerHTML =
|
|
14430
|
+
destElem.innerHTML = '';
|
|
14095
14431
|
while (i < sourceElem.childNodes.length) {
|
|
14096
14432
|
destElem.appendChild(sourceElem.childNodes[i]);
|
|
14097
14433
|
}
|
|
@@ -14120,6 +14456,14 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
14120
14456
|
}
|
|
14121
14457
|
return listObj;
|
|
14122
14458
|
};
|
|
14459
|
+
/**
|
|
14460
|
+
* Sets the enabled state to DropDownBase.
|
|
14461
|
+
*
|
|
14462
|
+
* @returns {void}
|
|
14463
|
+
*/
|
|
14464
|
+
ListBox.prototype.setEnabled = function () {
|
|
14465
|
+
this.element.setAttribute('aria-disabled', (this.enabled) ? 'false' : 'true');
|
|
14466
|
+
};
|
|
14123
14467
|
ListBox.prototype.listOption = function (dataSource, fields) {
|
|
14124
14468
|
this.listCurrentOptions = _super.prototype.listOption.call(this, dataSource, fields);
|
|
14125
14469
|
this.listCurrentOptions = extend({}, this.listCurrentOptions, { itemCreated: this.triggerBeforeItemRender.bind(this) }, true);
|
|
@@ -14280,7 +14624,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
14280
14624
|
if (this.listData.length === 0) {
|
|
14281
14625
|
this.l10nUpdate();
|
|
14282
14626
|
}
|
|
14283
|
-
this.value =
|
|
14627
|
+
this.value = [];
|
|
14284
14628
|
this.updateToolBarState();
|
|
14285
14629
|
};
|
|
14286
14630
|
/**
|
|
@@ -14569,9 +14913,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
14569
14913
|
prepend([this.filterParent], this.list);
|
|
14570
14914
|
attributes(this.filterInput, {
|
|
14571
14915
|
'aria-disabled': 'false',
|
|
14572
|
-
'aria-
|
|
14573
|
-
'role': 'listbox',
|
|
14574
|
-
'aria-activedescendant': null,
|
|
14916
|
+
'aria-label': 'search list item',
|
|
14575
14917
|
'autocomplete': 'off',
|
|
14576
14918
|
'autocorrect': 'off',
|
|
14577
14919
|
'autocapitalize': 'off',
|
|
@@ -14608,12 +14950,12 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
14608
14950
|
if (li && li.parentElement) {
|
|
14609
14951
|
currSelIdx = [].slice.call(li.parentElement.children).indexOf(li);
|
|
14610
14952
|
if (!this.selectionSettings.showCheckbox) {
|
|
14611
|
-
if ((e.ctrlKey || Browser.isDevice) && this.isSelected(li)) {
|
|
14953
|
+
if ((e.ctrlKey || e.metaKey || Browser.isDevice) && this.isSelected(li)) {
|
|
14612
14954
|
li.classList.remove(cssClass.selected);
|
|
14613
14955
|
li.removeAttribute('aria-selected');
|
|
14614
14956
|
isSelect = false;
|
|
14615
14957
|
}
|
|
14616
|
-
else if (!(this.selectionSettings.mode === 'Multiple' && (e.ctrlKey || Browser.isDevice))) {
|
|
14958
|
+
else if (!(this.selectionSettings.mode === 'Multiple' && (e.ctrlKey || e.metaKey || Browser.isDevice))) {
|
|
14617
14959
|
this.getSelectedItems().forEach(function (ele) {
|
|
14618
14960
|
ele.removeAttribute('aria-selected');
|
|
14619
14961
|
});
|
|
@@ -14973,7 +15315,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
14973
15315
|
var isRefresh = tListBox.sortOrder !== 'None' || (tListBox.selectionSettings.showCheckbox !==
|
|
14974
15316
|
fListBox.selectionSettings.showCheckbox) || tListBox.fields.groupBy || tListBox.itemTemplate || fListBox.itemTemplate;
|
|
14975
15317
|
this.removeSelected(fListBox, fListBox.getSelectedItems());
|
|
14976
|
-
var tempItems = [].slice.call(fListBox.
|
|
15318
|
+
var tempItems = [].slice.call(fListBox.listData);
|
|
14977
15319
|
var localDataArgs = { cancel: false, items: tempItems, eventName: this.toolbarAction };
|
|
14978
15320
|
fListBox.trigger('actionBegin', localDataArgs);
|
|
14979
15321
|
if (localDataArgs.cancel) {
|
|
@@ -15018,9 +15360,27 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
15018
15360
|
fListBox.value = [];
|
|
15019
15361
|
listData = listData
|
|
15020
15362
|
.filter(function (data) { return data.isHeader !== true; });
|
|
15363
|
+
var sortedData = listData.filter(function (val) {
|
|
15364
|
+
return tListBox.jsonData.indexOf(val) === -1;
|
|
15365
|
+
});
|
|
15366
|
+
for (var i = 0; i < sortedData.length; i++) {
|
|
15367
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15368
|
+
tListBox.jsonData.splice(index + i, 0, sortedData[i]);
|
|
15369
|
+
}
|
|
15021
15370
|
tListBox.listData = listData;
|
|
15022
|
-
|
|
15023
|
-
|
|
15371
|
+
if (fListBox.listData.length === fListBox.jsonData.length) {
|
|
15372
|
+
fListBox.listData = fListBox.sortedData = fListBox.jsonData = [];
|
|
15373
|
+
}
|
|
15374
|
+
else if (fListBox.allowFiltering) {
|
|
15375
|
+
for (var i = 0; i < fListBox.listData.length; i++) {
|
|
15376
|
+
for (var j = 0; j < fListBox.jsonData.length; j++) {
|
|
15377
|
+
if (fListBox.listData[i] === fListBox.jsonData[j]) {
|
|
15378
|
+
fListBox.jsonData.splice(j, 1);
|
|
15379
|
+
}
|
|
15380
|
+
}
|
|
15381
|
+
}
|
|
15382
|
+
fListBox.listData = fListBox.sortedData = [];
|
|
15383
|
+
}
|
|
15024
15384
|
if (isRefresh) {
|
|
15025
15385
|
var sourceElem = tListBox.renderItems(listData, tListBox.fields);
|
|
15026
15386
|
tListBox.updateListItems(sourceElem, tListBox.ulElement);
|
|
@@ -15074,21 +15434,35 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
15074
15434
|
}
|
|
15075
15435
|
return listObj;
|
|
15076
15436
|
};
|
|
15077
|
-
ListBox.prototype.getGrabbedItems = function () {
|
|
15437
|
+
ListBox.prototype.getGrabbedItems = function (args) {
|
|
15438
|
+
var grabbItems = false;
|
|
15078
15439
|
for (var i = 0; i < this.value.length; i++) {
|
|
15079
|
-
if (this.value[i] === this.
|
|
15440
|
+
if (this.value[i] === this.getFormattedValue(args.target.getAttribute('data-value'))) {
|
|
15441
|
+
grabbItems = true;
|
|
15442
|
+
break;
|
|
15443
|
+
}
|
|
15444
|
+
}
|
|
15445
|
+
if (grabbItems) {
|
|
15446
|
+
for (var i = 0; i < this.value.length; i++) {
|
|
15080
15447
|
var liColl = this.list.querySelectorAll('[aria-selected="true"]');
|
|
15081
|
-
for (var
|
|
15082
|
-
liColl[
|
|
15448
|
+
for (var j = 0; j < liColl.length; j++) {
|
|
15449
|
+
if (this.value[i] === this.getFormattedValue(liColl[j].getAttribute('data-value'))) {
|
|
15450
|
+
liColl[j].classList.add('e-grabbed');
|
|
15451
|
+
}
|
|
15083
15452
|
}
|
|
15084
|
-
break;
|
|
15085
15453
|
}
|
|
15086
15454
|
}
|
|
15087
|
-
var elems
|
|
15455
|
+
var elems;
|
|
15456
|
+
if (this.isAngular) {
|
|
15457
|
+
elems = Array.prototype.slice.call(this.element.getElementsByClassName('e-list-parent')[0].querySelectorAll('.e-grabbed'));
|
|
15458
|
+
}
|
|
15459
|
+
else {
|
|
15460
|
+
elems = Array.prototype.slice.call(this.element.nextElementSibling.querySelectorAll('.e-grabbed'));
|
|
15461
|
+
}
|
|
15088
15462
|
return elems;
|
|
15089
15463
|
};
|
|
15090
15464
|
ListBox.prototype.getDragArgs = function (args, isDragEnd) {
|
|
15091
|
-
var elems = this.getGrabbedItems();
|
|
15465
|
+
var elems = this.getGrabbedItems(args);
|
|
15092
15466
|
if (elems.length) {
|
|
15093
15467
|
if (isDragEnd) {
|
|
15094
15468
|
elems.push(args.target);
|
|
@@ -15140,7 +15514,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
15140
15514
|
}
|
|
15141
15515
|
}
|
|
15142
15516
|
}
|
|
15143
|
-
else if (e.keyCode !== 37 && e.keyCode !== 39 && e.code !==
|
|
15517
|
+
else if (e.keyCode !== 37 && e.keyCode !== 39 && e.code !== 'KeyA') {
|
|
15144
15518
|
this.upDownKeyHandler(e);
|
|
15145
15519
|
}
|
|
15146
15520
|
}
|
|
@@ -15184,8 +15558,8 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
15184
15558
|
}
|
|
15185
15559
|
if (this.selectionSettings.showCheckbox && e.ctrlKey && e.shiftKey && (e.keyCode === 36 || e.keyCode === 35)) {
|
|
15186
15560
|
var selectedidx = Array.prototype.indexOf.call(ul.children, fli);
|
|
15187
|
-
var sidx = e.code ===
|
|
15188
|
-
var eidx = e.code ===
|
|
15561
|
+
var sidx = e.code === 'Home' ? 0 : selectedidx;
|
|
15562
|
+
var eidx = e.code === 'Home' ? selectedidx : ul.children.length - 1;
|
|
15189
15563
|
for (var i = sidx; i <= eidx; i++) {
|
|
15190
15564
|
var item = ul.children[i];
|
|
15191
15565
|
this.notify('updatelist', { li: item, e: {
|
|
@@ -15343,7 +15717,6 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
15343
15717
|
dvalue_1 = _this.getFormattedValue(li.getAttribute('data-value'));
|
|
15344
15718
|
if (values.indexOf(dvalue_1) < 0) {
|
|
15345
15719
|
li.getElementsByClassName('e-check')[0].classList.remove('e-check');
|
|
15346
|
-
li.getElementsByClassName('e-checkbox-wrapper')[0].removeAttribute('aria-checked');
|
|
15347
15720
|
li.removeAttribute('aria-selected');
|
|
15348
15721
|
}
|
|
15349
15722
|
});
|
|
@@ -15365,6 +15738,9 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
15365
15738
|
else {
|
|
15366
15739
|
text = value;
|
|
15367
15740
|
}
|
|
15741
|
+
if (typeof (text) === 'string') {
|
|
15742
|
+
text = text.split("\\").join("\\\\");
|
|
15743
|
+
}
|
|
15368
15744
|
li = _this.list.querySelector('[data-value="' + text + '"]');
|
|
15369
15745
|
if (li) {
|
|
15370
15746
|
if (_this.selectionSettings.showCheckbox) {
|
|
@@ -15695,6 +16071,12 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
15695
16071
|
__decorate$6([
|
|
15696
16072
|
Property('')
|
|
15697
16073
|
], ListBox.prototype, "height", void 0);
|
|
16074
|
+
__decorate$6([
|
|
16075
|
+
Property(true)
|
|
16076
|
+
], ListBox.prototype, "enabled", void 0);
|
|
16077
|
+
__decorate$6([
|
|
16078
|
+
Property(false)
|
|
16079
|
+
], ListBox.prototype, "enablePersistence", void 0);
|
|
15698
16080
|
__decorate$6([
|
|
15699
16081
|
Property(false)
|
|
15700
16082
|
], ListBox.prototype, "allowDragAndDrop", void 0);
|
|
@@ -15771,6 +16153,1468 @@ var listBoxClasses = {
|
|
|
15771
16153
|
clearIcon: 'e-clear-icon'
|
|
15772
16154
|
};
|
|
15773
16155
|
|
|
16156
|
+
/**
|
|
16157
|
+
* export all modules from current location
|
|
16158
|
+
*/
|
|
16159
|
+
|
|
16160
|
+
var __extends$7 = (undefined && undefined.__extends) || (function () {
|
|
16161
|
+
var extendStatics = function (d, b) {
|
|
16162
|
+
extendStatics = Object.setPrototypeOf ||
|
|
16163
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
16164
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
16165
|
+
return extendStatics(d, b);
|
|
16166
|
+
};
|
|
16167
|
+
return function (d, b) {
|
|
16168
|
+
extendStatics(d, b);
|
|
16169
|
+
function __() { this.constructor = d; }
|
|
16170
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
16171
|
+
};
|
|
16172
|
+
})();
|
|
16173
|
+
var __decorate$7 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
16174
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
16175
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
16176
|
+
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;
|
|
16177
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
16178
|
+
};
|
|
16179
|
+
/**
|
|
16180
|
+
* The Mention component is used to list someone or something based on user input in textarea, input,
|
|
16181
|
+
* or any other editable element from which the user can select.
|
|
16182
|
+
*/
|
|
16183
|
+
var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
16184
|
+
__extends$7(Mention, _super);
|
|
16185
|
+
/**
|
|
16186
|
+
* * Constructor for creating the widget
|
|
16187
|
+
*
|
|
16188
|
+
* @param {MentionModel} options - Specifies the MentionComponent model.
|
|
16189
|
+
* @param {string | HTMLElement} element - Specifies the element to render as component.
|
|
16190
|
+
* @private
|
|
16191
|
+
*/
|
|
16192
|
+
function Mention(options, element) {
|
|
16193
|
+
return _super.call(this, options, element) || this;
|
|
16194
|
+
}
|
|
16195
|
+
/**
|
|
16196
|
+
* When property value changes happened, then onPropertyChanged method will execute the respective changes in this component.
|
|
16197
|
+
*
|
|
16198
|
+
* @param {MentionModel} newProp - Returns the dynamic property value of the component.
|
|
16199
|
+
* @param {MentionModel} oldProp - Returns the previous property value of the component.
|
|
16200
|
+
* @private
|
|
16201
|
+
* @returns {void}
|
|
16202
|
+
*/
|
|
16203
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
16204
|
+
Mention.prototype.onPropertyChanged = function (newProp, oldProp) {
|
|
16205
|
+
for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
|
|
16206
|
+
var prop = _a[_i];
|
|
16207
|
+
switch (prop) {
|
|
16208
|
+
case 'minLength':
|
|
16209
|
+
this.minLength = newProp.minLength;
|
|
16210
|
+
break;
|
|
16211
|
+
case 'suffixText':
|
|
16212
|
+
this.suffixText = newProp.suffixText;
|
|
16213
|
+
break;
|
|
16214
|
+
case 'allowSpaces':
|
|
16215
|
+
this.allowSpaces = newProp.allowSpaces;
|
|
16216
|
+
break;
|
|
16217
|
+
case 'mentionChar':
|
|
16218
|
+
this.mentionChar = newProp.mentionChar;
|
|
16219
|
+
break;
|
|
16220
|
+
case 'showMentionChar':
|
|
16221
|
+
this.showMentionChar = newProp.showMentionChar;
|
|
16222
|
+
break;
|
|
16223
|
+
case 'cssClass':
|
|
16224
|
+
this.updateCssClass(newProp.cssClass, oldProp.cssClass);
|
|
16225
|
+
break;
|
|
16226
|
+
}
|
|
16227
|
+
}
|
|
16228
|
+
};
|
|
16229
|
+
Mention.prototype.updateCssClass = function (newClass, oldClass) {
|
|
16230
|
+
if (!isNullOrUndefined(oldClass)) {
|
|
16231
|
+
oldClass = (oldClass.replace(/\s+/g, ' ')).trim();
|
|
16232
|
+
}
|
|
16233
|
+
if (!isNullOrUndefined(newClass)) {
|
|
16234
|
+
newClass = (newClass.replace(/\s+/g, ' ')).trim();
|
|
16235
|
+
}
|
|
16236
|
+
this.setCssClass(newClass, [this.inputElement], oldClass);
|
|
16237
|
+
if (this.popupObj) {
|
|
16238
|
+
this.setCssClass(newClass, [this.popupObj.element], oldClass);
|
|
16239
|
+
}
|
|
16240
|
+
};
|
|
16241
|
+
Mention.prototype.setCssClass = function (cssClass$$1, elements, oldClass) {
|
|
16242
|
+
if (!isNullOrUndefined(oldClass) && oldClass !== '') {
|
|
16243
|
+
removeClass(elements, oldClass.split(' '));
|
|
16244
|
+
}
|
|
16245
|
+
if (!isNullOrUndefined(cssClass$$1) && cssClass$$1 !== '') {
|
|
16246
|
+
addClass(elements, cssClass$$1.split(' '));
|
|
16247
|
+
}
|
|
16248
|
+
};
|
|
16249
|
+
Mention.prototype.initializeData = function () {
|
|
16250
|
+
this.isSelected = false;
|
|
16251
|
+
this.isFiltered = false;
|
|
16252
|
+
this.beforePopupOpen = false;
|
|
16253
|
+
this.initRemoteRender = false;
|
|
16254
|
+
this.isListResetted = false;
|
|
16255
|
+
this.isPopupOpen = false;
|
|
16256
|
+
this.isCollided = false;
|
|
16257
|
+
this.lineBreak = false;
|
|
16258
|
+
this.keyConfigure = {
|
|
16259
|
+
tab: 'tab',
|
|
16260
|
+
enter: '13',
|
|
16261
|
+
escape: '27',
|
|
16262
|
+
end: '35',
|
|
16263
|
+
home: '36',
|
|
16264
|
+
down: '40',
|
|
16265
|
+
up: '38',
|
|
16266
|
+
pageUp: '33',
|
|
16267
|
+
pageDown: '34',
|
|
16268
|
+
open: 'alt+40',
|
|
16269
|
+
close: 'shift+tab',
|
|
16270
|
+
hide: 'alt+38',
|
|
16271
|
+
space: '32'
|
|
16272
|
+
};
|
|
16273
|
+
};
|
|
16274
|
+
/**
|
|
16275
|
+
* Execute before render the list items
|
|
16276
|
+
*
|
|
16277
|
+
* @private
|
|
16278
|
+
* @returns {void}
|
|
16279
|
+
*/
|
|
16280
|
+
Mention.prototype.preRender = function () {
|
|
16281
|
+
this.initializeData();
|
|
16282
|
+
_super.prototype.preRender.call(this);
|
|
16283
|
+
};
|
|
16284
|
+
/**
|
|
16285
|
+
* To Initialize the control rendering
|
|
16286
|
+
*
|
|
16287
|
+
* @private
|
|
16288
|
+
* @returns {void}
|
|
16289
|
+
*/
|
|
16290
|
+
Mention.prototype.render = function () {
|
|
16291
|
+
this.inputElement = !isNullOrUndefined(this.target) ? ((typeof this.target) === 'string') ?
|
|
16292
|
+
document.querySelector(this.target) : this.target : this.element;
|
|
16293
|
+
if (this.isContentEditable(this.inputElement)) {
|
|
16294
|
+
this.inputElement.setAttribute('contenteditable', 'true');
|
|
16295
|
+
addClass([this.inputElement], ['e-mention']);
|
|
16296
|
+
if (isNullOrUndefined(this.target)) {
|
|
16297
|
+
addClass([this.inputElement], ['e-editable-element']);
|
|
16298
|
+
}
|
|
16299
|
+
}
|
|
16300
|
+
this.queryString = this.elementValue();
|
|
16301
|
+
this.wireEvent();
|
|
16302
|
+
};
|
|
16303
|
+
Mention.prototype.wireEvent = function () {
|
|
16304
|
+
EventHandler.add(this.inputElement, 'keyup', this.onKeyUp, this);
|
|
16305
|
+
this.bindCommonEvent();
|
|
16306
|
+
};
|
|
16307
|
+
Mention.prototype.unWireEvent = function () {
|
|
16308
|
+
EventHandler.remove(this.inputElement, 'keyup', this.onKeyUp);
|
|
16309
|
+
this.unBindCommonEvent();
|
|
16310
|
+
};
|
|
16311
|
+
Mention.prototype.bindCommonEvent = function () {
|
|
16312
|
+
if (!Browser.isDevice) {
|
|
16313
|
+
this.keyboardModule = new KeyboardEvents(this.inputElement, {
|
|
16314
|
+
keyAction: this.keyActionHandler.bind(this), keyConfigs: this.keyConfigure, eventName: 'keydown'
|
|
16315
|
+
});
|
|
16316
|
+
}
|
|
16317
|
+
};
|
|
16318
|
+
/**
|
|
16319
|
+
* Hides the spinner loader.
|
|
16320
|
+
*
|
|
16321
|
+
* @private
|
|
16322
|
+
* @returns {void}
|
|
16323
|
+
*/
|
|
16324
|
+
Mention.prototype.hideSpinner = function () {
|
|
16325
|
+
this.hideWaitingSpinner();
|
|
16326
|
+
};
|
|
16327
|
+
Mention.prototype.hideWaitingSpinner = function () {
|
|
16328
|
+
if (!isNullOrUndefined(this.spinnerElement)) {
|
|
16329
|
+
hideSpinner(this.spinnerElement);
|
|
16330
|
+
}
|
|
16331
|
+
if (!isNullOrUndefined(this.spinnerTemplate) && !isNullOrUndefined(this.spinnerTemplateElement)) {
|
|
16332
|
+
detach(this.spinnerTemplateElement);
|
|
16333
|
+
}
|
|
16334
|
+
};
|
|
16335
|
+
/**
|
|
16336
|
+
* Shows the spinner loader.
|
|
16337
|
+
*
|
|
16338
|
+
* @returns {void}
|
|
16339
|
+
*/
|
|
16340
|
+
Mention.prototype.showWaitingSpinner = function () {
|
|
16341
|
+
if (!isNullOrUndefined(this.popupObj)) {
|
|
16342
|
+
if (isNullOrUndefined(this.spinnerTemplate) && isNullOrUndefined(this.spinnerElement)) {
|
|
16343
|
+
this.spinnerElement = this.popupObj.element;
|
|
16344
|
+
createSpinner({
|
|
16345
|
+
target: this.spinnerElement,
|
|
16346
|
+
width: Browser.isDevice ? '16px' : '14px'
|
|
16347
|
+
}, this.createElement);
|
|
16348
|
+
showSpinner(this.spinnerElement);
|
|
16349
|
+
}
|
|
16350
|
+
if (!isNullOrUndefined(this.spinnerTemplate)) {
|
|
16351
|
+
this.setSpinnerTemplate();
|
|
16352
|
+
}
|
|
16353
|
+
}
|
|
16354
|
+
};
|
|
16355
|
+
Mention.prototype.keyActionHandler = function (e) {
|
|
16356
|
+
var isNavigation = (e.action === 'down' || e.action === 'up' || e.action === 'pageUp' || e.action === 'pageDown'
|
|
16357
|
+
|| e.action === 'home' || e.action === 'end');
|
|
16358
|
+
var isTabAction = e.action === 'tab' || e.action === 'close';
|
|
16359
|
+
if (this.list === undefined && !this.isRequested && !isTabAction && e.action !== 'escape' && e.action !== 'space') {
|
|
16360
|
+
this.renderList();
|
|
16361
|
+
}
|
|
16362
|
+
if (isNullOrUndefined(this.list) || (!isNullOrUndefined(this.liCollections) &&
|
|
16363
|
+
isNavigation && this.liCollections.length === 0) || this.isRequested) {
|
|
16364
|
+
return;
|
|
16365
|
+
}
|
|
16366
|
+
if (e.action === 'escape') {
|
|
16367
|
+
e.preventDefault();
|
|
16368
|
+
}
|
|
16369
|
+
this.isSelected = e.action === 'escape' ? false : this.isSelected;
|
|
16370
|
+
switch (e.action) {
|
|
16371
|
+
case 'down':
|
|
16372
|
+
case 'up':
|
|
16373
|
+
this.updateUpDownAction(e);
|
|
16374
|
+
break;
|
|
16375
|
+
case 'tab':
|
|
16376
|
+
if (this.isPopupOpen) {
|
|
16377
|
+
e.preventDefault();
|
|
16378
|
+
var li = this.list.querySelector('.' + dropDownBaseClasses.selected);
|
|
16379
|
+
if (li) {
|
|
16380
|
+
this.setSelection(li, e);
|
|
16381
|
+
}
|
|
16382
|
+
if (this.isPopupOpen) {
|
|
16383
|
+
this.hidePopup(e);
|
|
16384
|
+
}
|
|
16385
|
+
}
|
|
16386
|
+
break;
|
|
16387
|
+
case 'enter':
|
|
16388
|
+
if (this.isPopupOpen) {
|
|
16389
|
+
e.preventDefault();
|
|
16390
|
+
if (this.popupObj && this.popupObj.element.contains(this.selectedLI)) {
|
|
16391
|
+
this.setValue(e);
|
|
16392
|
+
}
|
|
16393
|
+
}
|
|
16394
|
+
break;
|
|
16395
|
+
case 'escape':
|
|
16396
|
+
if (this.isPopupOpen) {
|
|
16397
|
+
this.hidePopup(e);
|
|
16398
|
+
}
|
|
16399
|
+
break;
|
|
16400
|
+
}
|
|
16401
|
+
};
|
|
16402
|
+
Mention.prototype.updateUpDownAction = function (e) {
|
|
16403
|
+
var focusEle = this.list.querySelector('.' + dropDownBaseClasses.focus);
|
|
16404
|
+
if (this.isSelectFocusItem(focusEle)) {
|
|
16405
|
+
this.setSelection(focusEle, e);
|
|
16406
|
+
}
|
|
16407
|
+
else if (!isNullOrUndefined(this.liCollections)) {
|
|
16408
|
+
var li = this.list.querySelector('.' + dropDownBaseClasses.selected);
|
|
16409
|
+
if (!isNullOrUndefined(li)) {
|
|
16410
|
+
var value = this.getFormattedValue(li.getAttribute('data-value'));
|
|
16411
|
+
this.activeIndex = this.getIndexByValue(value);
|
|
16412
|
+
}
|
|
16413
|
+
var index = e.action === 'down' ? this.activeIndex + 1 : this.activeIndex - 1;
|
|
16414
|
+
var startIndex = 0;
|
|
16415
|
+
startIndex = e.action === 'down' && isNullOrUndefined(this.activeIndex) ? 0 : this.liCollections.length - 1;
|
|
16416
|
+
index = index < 0 ? this.liCollections.length - 1 : index === this.liCollections.length ? 0 : index;
|
|
16417
|
+
var nextItem = isNullOrUndefined(this.activeIndex) ?
|
|
16418
|
+
this.liCollections[startIndex] : this.liCollections[index];
|
|
16419
|
+
if (!isNullOrUndefined(nextItem)) {
|
|
16420
|
+
this.setSelection(nextItem, e);
|
|
16421
|
+
}
|
|
16422
|
+
}
|
|
16423
|
+
if (this.isPopupOpen) {
|
|
16424
|
+
e.preventDefault();
|
|
16425
|
+
}
|
|
16426
|
+
};
|
|
16427
|
+
Mention.prototype.isSelectFocusItem = function (element) {
|
|
16428
|
+
return !isNullOrUndefined(element);
|
|
16429
|
+
};
|
|
16430
|
+
Mention.prototype.unBindCommonEvent = function () {
|
|
16431
|
+
if (!Browser.isDevice) {
|
|
16432
|
+
this.keyboardModule.destroy();
|
|
16433
|
+
}
|
|
16434
|
+
};
|
|
16435
|
+
Mention.prototype.onKeyUp = function (e) {
|
|
16436
|
+
var rangetextContent;
|
|
16437
|
+
if (this.isContentEditable(this.inputElement)) {
|
|
16438
|
+
this.range = this.getCurrentRange();
|
|
16439
|
+
rangetextContent = this.range.startContainer.textContent.split('');
|
|
16440
|
+
}
|
|
16441
|
+
var currentRange = this.getTextRange();
|
|
16442
|
+
var lastWordRange = this.getLastLetter(currentRange);
|
|
16443
|
+
// eslint-disable-next-line security/detect-non-literal-regexp
|
|
16444
|
+
var Regex = new RegExp(this.mentionChar, 'g');
|
|
16445
|
+
var charRegex = new RegExp('[a-zA-Z]', 'g');
|
|
16446
|
+
if (e.key === 'Shift' || e.keyCode === 37 || e.keyCode === 39) {
|
|
16447
|
+
if ((e.keyCode === 37 || e.keyCode === 39) && !isNullOrUndefined(currentRange) &&
|
|
16448
|
+
currentRange.indexOf(this.mentionChar) === -1 && this.isPopupOpen) {
|
|
16449
|
+
this.hidePopup();
|
|
16450
|
+
}
|
|
16451
|
+
return;
|
|
16452
|
+
}
|
|
16453
|
+
if ((!currentRange || !lastWordRange) || e.code === 'Enter' || e.keyCode === 27 ||
|
|
16454
|
+
(lastWordRange.match(Regex) && lastWordRange.match(Regex).length > 1) ||
|
|
16455
|
+
(this.isContentEditable(this.inputElement) && this.range.startContainer &&
|
|
16456
|
+
this.range.startContainer.previousElementSibling && this.range.startContainer.textContent.split('').length > 0 &&
|
|
16457
|
+
(rangetextContent.length === 1 || rangetextContent[rangetextContent.length - 2].indexOf('') === -1 ||
|
|
16458
|
+
this.range.startContainer.nodeType === 1))) {
|
|
16459
|
+
if (this.allowSpaces && currentRange && currentRange.trim() !== '' && charRegex.test(currentRange) && currentRange.indexOf(this.mentionChar) !== -1
|
|
16460
|
+
&& !this.isMatchedText() && (currentRange.length > 1 && currentRange.replace(/\u00A0/g, ' ').charAt(currentRange.length - 2) !== ' ') &&
|
|
16461
|
+
(this.list && this.list.querySelectorAll('ul').length > 0)) {
|
|
16462
|
+
this.queryString = currentRange.substring(currentRange.lastIndexOf(this.mentionChar) + 1).replace('\u00a0', ' ');
|
|
16463
|
+
this.searchLists(e);
|
|
16464
|
+
}
|
|
16465
|
+
else if (this.isPopupOpen && (!this.allowSpaces || !lastWordRange)) {
|
|
16466
|
+
this.hidePopup();
|
|
16467
|
+
this.lineBreak = true;
|
|
16468
|
+
}
|
|
16469
|
+
return;
|
|
16470
|
+
}
|
|
16471
|
+
this.queryString = lastWordRange.replace(this.mentionChar, '');
|
|
16472
|
+
if (this.mentionChar.charCodeAt(0) === lastWordRange.charCodeAt(0) &&
|
|
16473
|
+
this.queryString !== '' && e.keyCode !== 38 && e.keyCode !== 40 && !this.lineBreak) {
|
|
16474
|
+
this.searchLists(e);
|
|
16475
|
+
if (!this.isPopupOpen && this.queryString.length >= this.minLength) {
|
|
16476
|
+
if (!this.isContentEditable(this.inputElement)) {
|
|
16477
|
+
this.showPopup();
|
|
16478
|
+
}
|
|
16479
|
+
else if (this.isContentEditable(this.inputElement) && this.range && this.range.startContainer !== this.inputElement && e.keyCode !== 9) {
|
|
16480
|
+
this.showPopup();
|
|
16481
|
+
}
|
|
16482
|
+
}
|
|
16483
|
+
}
|
|
16484
|
+
else if (lastWordRange.indexOf(this.mentionChar) === 0 && !this.isPopupOpen && e.keyCode !== 8 && (!this.popupObj ||
|
|
16485
|
+
(isNullOrUndefined(this.target) && !document.body.contains(this.popupObj.element) ||
|
|
16486
|
+
!isNullOrUndefined(this.target) && document.body.contains(this.popupObj.element)))) {
|
|
16487
|
+
if (this.initRemoteRender && this.list && this.list.classList.contains('e-nodata')) {
|
|
16488
|
+
this.searchLists(e);
|
|
16489
|
+
}
|
|
16490
|
+
this.resetList(this.dataSource, this.fields);
|
|
16491
|
+
if (isNullOrUndefined(this.list)) {
|
|
16492
|
+
this.initValue();
|
|
16493
|
+
}
|
|
16494
|
+
if (!this.isPopupOpen && e.keyCode !== 38 && e.keyCode !== 40) {
|
|
16495
|
+
this.showPopup();
|
|
16496
|
+
if (this.initRemoteRender && this.list.querySelectorAll('li').length === 0) {
|
|
16497
|
+
this.showWaitingSpinner();
|
|
16498
|
+
}
|
|
16499
|
+
this.lineBreak = false;
|
|
16500
|
+
}
|
|
16501
|
+
}
|
|
16502
|
+
else if (this.allowSpaces && this.queryString !== '' && currentRange && currentRange.trim() !== '' && currentRange.replace('\u00a0', ' ').lastIndexOf(' ') < currentRange.length - 1 &&
|
|
16503
|
+
e.keyCode !== 38 && e.keyCode !== 40 && e.keyCode !== 8 && this.mentionChar.charCodeAt(0) === lastWordRange.charCodeAt(0)) {
|
|
16504
|
+
this.queryString = currentRange.substring(currentRange.lastIndexOf(this.mentionChar) + 1).replace('\u00a0', ' ');
|
|
16505
|
+
this.searchLists(e);
|
|
16506
|
+
}
|
|
16507
|
+
else if (this.queryString === '' && this.isPopupOpen && e.keyCode !== 38 && e.keyCode !== 40 && this.mentionChar.charCodeAt(0) === lastWordRange.charCodeAt(0)) {
|
|
16508
|
+
this.searchLists(e);
|
|
16509
|
+
if (!this.isListResetted) {
|
|
16510
|
+
this.resetList(this.dataSource, this.fields);
|
|
16511
|
+
}
|
|
16512
|
+
}
|
|
16513
|
+
this.isListResetted = false;
|
|
16514
|
+
};
|
|
16515
|
+
Mention.prototype.isMatchedText = function () {
|
|
16516
|
+
var isMatched = false;
|
|
16517
|
+
for (var i = 0; i < (this.liCollections && this.liCollections.length); i++) {
|
|
16518
|
+
if (this.getTextRange() &&
|
|
16519
|
+
this.getTextRange().substring(this.getTextRange().lastIndexOf(this.mentionChar) + 1).replace('\u00a0', ' ').trim() === this.liCollections[i].getAttribute('data-value').toLowerCase()) {
|
|
16520
|
+
isMatched = true;
|
|
16521
|
+
}
|
|
16522
|
+
}
|
|
16523
|
+
return isMatched;
|
|
16524
|
+
};
|
|
16525
|
+
Mention.prototype.getCurrentRange = function () {
|
|
16526
|
+
this.range = this.inputElement.ownerDocument.getSelection().getRangeAt(0);
|
|
16527
|
+
return this.range;
|
|
16528
|
+
};
|
|
16529
|
+
Mention.prototype.searchLists = function (e) {
|
|
16530
|
+
var _this = this;
|
|
16531
|
+
this.isDataFetched = false;
|
|
16532
|
+
if (isNullOrUndefined(this.list)) {
|
|
16533
|
+
_super.prototype.render.call(this);
|
|
16534
|
+
this.unWireListEvents();
|
|
16535
|
+
this.wireListEvents();
|
|
16536
|
+
}
|
|
16537
|
+
if (e.type !== 'mousedown' && (e.keyCode === 40 || e.keyCode === 38)) {
|
|
16538
|
+
this.queryString = this.queryString === '' ? null : this.queryString;
|
|
16539
|
+
this.beforePopupOpen = true;
|
|
16540
|
+
this.resetList(this.dataSource, this.fields);
|
|
16541
|
+
return;
|
|
16542
|
+
}
|
|
16543
|
+
this.isSelected = false;
|
|
16544
|
+
this.activeIndex = null;
|
|
16545
|
+
var eventArgs = {
|
|
16546
|
+
preventDefaultAction: false,
|
|
16547
|
+
text: this.queryString,
|
|
16548
|
+
updateData: function (dataSource, query, fields) {
|
|
16549
|
+
if (eventArgs.cancel) {
|
|
16550
|
+
return;
|
|
16551
|
+
}
|
|
16552
|
+
_this.isFiltered = true;
|
|
16553
|
+
_this.filterAction(dataSource, query, fields);
|
|
16554
|
+
},
|
|
16555
|
+
cancel: false
|
|
16556
|
+
};
|
|
16557
|
+
this.trigger('filtering', eventArgs, function (eventArgs) {
|
|
16558
|
+
if (!eventArgs.cancel && !_this.isFiltered && !eventArgs.preventDefaultAction) {
|
|
16559
|
+
_this.filterAction(_this.dataSource, null, _this.fields);
|
|
16560
|
+
}
|
|
16561
|
+
});
|
|
16562
|
+
};
|
|
16563
|
+
Mention.prototype.filterAction = function (dataSource, query, fields) {
|
|
16564
|
+
this.beforePopupOpen = true;
|
|
16565
|
+
if (this.queryString.length >= this.minLength) {
|
|
16566
|
+
this.resetList(dataSource, fields, query);
|
|
16567
|
+
this.isListResetted = true;
|
|
16568
|
+
}
|
|
16569
|
+
else {
|
|
16570
|
+
if (this.isPopupOpen) {
|
|
16571
|
+
this.hidePopup();
|
|
16572
|
+
}
|
|
16573
|
+
this.beforePopupOpen = false;
|
|
16574
|
+
}
|
|
16575
|
+
this.setDataIndex();
|
|
16576
|
+
this.renderReactTemplates();
|
|
16577
|
+
};
|
|
16578
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
16579
|
+
Mention.prototype.onActionComplete = function (ulElement, list, e, isUpdated) {
|
|
16580
|
+
_super.prototype.onActionComplete.call(this, ulElement, list, e);
|
|
16581
|
+
if (this.isActive) {
|
|
16582
|
+
if (!isNullOrUndefined(ulElement)) {
|
|
16583
|
+
attributes(ulElement, { 'id': this.inputElement.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
|
|
16584
|
+
}
|
|
16585
|
+
var focusItem = ulElement.querySelector('.' + dropDownBaseClasses.li);
|
|
16586
|
+
if (focusItem) {
|
|
16587
|
+
focusItem.classList.add(dropDownBaseClasses.selected);
|
|
16588
|
+
this.selectedLI = focusItem;
|
|
16589
|
+
var value = this.getFormattedValue(focusItem.getAttribute('data-value'));
|
|
16590
|
+
this.selectEventCallback(focusItem, this.getDataByValue(value), value, true);
|
|
16591
|
+
}
|
|
16592
|
+
}
|
|
16593
|
+
};
|
|
16594
|
+
Mention.prototype.setDataIndex = function () {
|
|
16595
|
+
for (var i = 0; this.liCollections && i < this.liCollections.length; i++) {
|
|
16596
|
+
this.liCollections[i].setAttribute('data-index', i.toString());
|
|
16597
|
+
}
|
|
16598
|
+
};
|
|
16599
|
+
Mention.prototype.listOption = function (dataSource, fieldsSettings) {
|
|
16600
|
+
var _this = this;
|
|
16601
|
+
var fields = _super.prototype.listOption.call(this, dataSource, fieldsSettings);
|
|
16602
|
+
if (isNullOrUndefined(fields.itemCreated)) {
|
|
16603
|
+
fields.itemCreated = function (e) {
|
|
16604
|
+
if (_this.highlight) {
|
|
16605
|
+
if (_this.inputElement.tagName === _this.getNgDirective() && _this.itemTemplate) {
|
|
16606
|
+
setTimeout(function () {
|
|
16607
|
+
highlightSearch(e.item, _this.queryString, _this.ignoreCase, _this.filterType);
|
|
16608
|
+
}, 0);
|
|
16609
|
+
}
|
|
16610
|
+
else {
|
|
16611
|
+
highlightSearch(e.item, _this.queryString, _this.ignoreCase, _this.filterType);
|
|
16612
|
+
}
|
|
16613
|
+
}
|
|
16614
|
+
};
|
|
16615
|
+
}
|
|
16616
|
+
else {
|
|
16617
|
+
var itemCreated_1 = fields.itemCreated;
|
|
16618
|
+
fields.itemCreated = function (e) {
|
|
16619
|
+
if (_this.highlight) {
|
|
16620
|
+
highlightSearch(e.item, _this.queryString, _this.ignoreCase, _this.filterType);
|
|
16621
|
+
}
|
|
16622
|
+
itemCreated_1.apply(_this, [e]);
|
|
16623
|
+
};
|
|
16624
|
+
}
|
|
16625
|
+
return fields;
|
|
16626
|
+
};
|
|
16627
|
+
Mention.prototype.elementValue = function () {
|
|
16628
|
+
if (!this.isContentEditable(this.inputElement)) {
|
|
16629
|
+
return this.inputElement.value.replace(this.mentionChar, '');
|
|
16630
|
+
}
|
|
16631
|
+
else {
|
|
16632
|
+
return this.inputElement.textContent.replace(this.mentionChar, '');
|
|
16633
|
+
}
|
|
16634
|
+
};
|
|
16635
|
+
Mention.prototype.getQuery = function (query) {
|
|
16636
|
+
var filterQuery = query ? query.clone() : this.query ? this.query.clone() : new Query();
|
|
16637
|
+
var filterType = (this.queryString === '' && !isNullOrUndefined(this.elementValue())) ? 'equal' : this.filterType;
|
|
16638
|
+
var queryString = (this.queryString === '' && !isNullOrUndefined(this.elementValue())) ?
|
|
16639
|
+
this.elementValue() : this.queryString;
|
|
16640
|
+
if (this.isFiltered) {
|
|
16641
|
+
return filterQuery;
|
|
16642
|
+
}
|
|
16643
|
+
if (this.queryString !== null && this.queryString !== '') {
|
|
16644
|
+
var dataType = this.typeOfData(this.dataSource).typeof;
|
|
16645
|
+
if (!(this.dataSource instanceof DataManager) && dataType === 'string' || dataType === 'number') {
|
|
16646
|
+
filterQuery.where('', filterType, queryString, this.ignoreCase, this.ignoreAccent);
|
|
16647
|
+
}
|
|
16648
|
+
else {
|
|
16649
|
+
var mapping = !isNullOrUndefined(this.fields.text) ? this.fields.text : '';
|
|
16650
|
+
filterQuery.where(mapping, filterType, queryString, this.ignoreCase, this.ignoreAccent);
|
|
16651
|
+
}
|
|
16652
|
+
}
|
|
16653
|
+
if (!isNullOrUndefined(this.suggestionCount)) {
|
|
16654
|
+
// Since defualt value of suggestioncount is 25, checked the condition
|
|
16655
|
+
if (this.suggestionCount !== 25) {
|
|
16656
|
+
for (var queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
|
|
16657
|
+
if (filterQuery.queries[queryElements].fn === 'onTake') {
|
|
16658
|
+
filterQuery.queries.splice(queryElements, 1);
|
|
16659
|
+
}
|
|
16660
|
+
}
|
|
16661
|
+
}
|
|
16662
|
+
filterQuery.take(this.suggestionCount);
|
|
16663
|
+
}
|
|
16664
|
+
return filterQuery;
|
|
16665
|
+
};
|
|
16666
|
+
Mention.prototype.renderHightSearch = function () {
|
|
16667
|
+
if (this.highlight) {
|
|
16668
|
+
for (var i = 0; i < this.liCollections.length; i++) {
|
|
16669
|
+
var isHighlight = this.ulElement.querySelector('.e-active');
|
|
16670
|
+
if (!isHighlight) {
|
|
16671
|
+
revertHighlightSearch(this.liCollections[i]);
|
|
16672
|
+
highlightSearch(this.liCollections[i], this.queryString, this.ignoreCase, this.filterType);
|
|
16673
|
+
}
|
|
16674
|
+
}
|
|
16675
|
+
}
|
|
16676
|
+
};
|
|
16677
|
+
Mention.prototype.getTextRange = function () {
|
|
16678
|
+
var text;
|
|
16679
|
+
if (!this.isContentEditable(this.inputElement)) {
|
|
16680
|
+
var component = this.inputElement;
|
|
16681
|
+
if (!isNullOrUndefined(component)) {
|
|
16682
|
+
var startPos = component.selectionStart;
|
|
16683
|
+
if (component.value && startPos >= 0) {
|
|
16684
|
+
text = component.value.substring(0, startPos);
|
|
16685
|
+
}
|
|
16686
|
+
}
|
|
16687
|
+
}
|
|
16688
|
+
else {
|
|
16689
|
+
if (this.range) {
|
|
16690
|
+
var selectedElem = this.range.startContainer;
|
|
16691
|
+
if (!isNullOrUndefined(selectedElem)) {
|
|
16692
|
+
var workingNodeContent = selectedElem.textContent;
|
|
16693
|
+
var selectStartOffset = this.range.startOffset;
|
|
16694
|
+
if (workingNodeContent && selectStartOffset >= 0) {
|
|
16695
|
+
text = workingNodeContent.substring(0, selectStartOffset);
|
|
16696
|
+
}
|
|
16697
|
+
}
|
|
16698
|
+
}
|
|
16699
|
+
}
|
|
16700
|
+
return text;
|
|
16701
|
+
};
|
|
16702
|
+
Mention.prototype.getLastLetter = function (text) {
|
|
16703
|
+
if (isNullOrUndefined(text)) {
|
|
16704
|
+
return '';
|
|
16705
|
+
}
|
|
16706
|
+
var textValue = text.replace(/\u00A0/g, ' ');
|
|
16707
|
+
var words = textValue.split(/\s+/);
|
|
16708
|
+
var wordCnt = words.length - 1;
|
|
16709
|
+
return words[wordCnt].trim();
|
|
16710
|
+
};
|
|
16711
|
+
Mention.prototype.isContentEditable = function (element) {
|
|
16712
|
+
return element && element.nodeName !== 'INPUT' && element.nodeName !== 'TEXTAREA';
|
|
16713
|
+
};
|
|
16714
|
+
/**
|
|
16715
|
+
* Opens the popup that displays the list of items.
|
|
16716
|
+
*
|
|
16717
|
+
* @returns {void}
|
|
16718
|
+
*/
|
|
16719
|
+
Mention.prototype.showPopup = function () {
|
|
16720
|
+
this.beforePopupOpen = true;
|
|
16721
|
+
if (isNullOrUndefined(this.list)) {
|
|
16722
|
+
this.initValue();
|
|
16723
|
+
}
|
|
16724
|
+
this.renderPopup();
|
|
16725
|
+
attributes(this.inputElement, { 'aria-activedescendant': this.selectedElementID });
|
|
16726
|
+
if (this.selectedElementID == null) {
|
|
16727
|
+
this.inputElement.removeAttribute('aria-activedescendant');
|
|
16728
|
+
}
|
|
16729
|
+
};
|
|
16730
|
+
/* eslint-disable valid-jsdoc, jsdoc/require-param */
|
|
16731
|
+
/**
|
|
16732
|
+
* Hides the popup if it is in an open state.
|
|
16733
|
+
*
|
|
16734
|
+
* @returns {void}
|
|
16735
|
+
*/
|
|
16736
|
+
Mention.prototype.hidePopup = function (e) {
|
|
16737
|
+
this.removeSelection();
|
|
16738
|
+
this.closePopup(0, e);
|
|
16739
|
+
};
|
|
16740
|
+
Mention.prototype.closePopup = function (delay, e) {
|
|
16741
|
+
var _this = this;
|
|
16742
|
+
if (!(this.popupObj && document.body.contains(this.popupObj.element) && this.beforePopupOpen)) {
|
|
16743
|
+
return;
|
|
16744
|
+
}
|
|
16745
|
+
EventHandler.remove(document, 'mousedown', this.onDocumentClick);
|
|
16746
|
+
this.inputElement.removeAttribute('aria-owns');
|
|
16747
|
+
this.inputElement.removeAttribute('aria-activedescendant');
|
|
16748
|
+
this.beforePopupOpen = false;
|
|
16749
|
+
var animModel = {
|
|
16750
|
+
name: 'FadeOut',
|
|
16751
|
+
duration: 100,
|
|
16752
|
+
delay: delay ? delay : 0
|
|
16753
|
+
};
|
|
16754
|
+
var popupInstance = this.popupObj;
|
|
16755
|
+
var eventArgs = { popup: popupInstance, cancel: false, animation: animModel, event: e || null };
|
|
16756
|
+
this.trigger('closed', eventArgs, function (eventArgs) {
|
|
16757
|
+
if (!eventArgs.cancel && _this.popupObj) {
|
|
16758
|
+
if (_this.isPopupOpen) {
|
|
16759
|
+
_this.popupObj.hide(new Animation(eventArgs.animation));
|
|
16760
|
+
}
|
|
16761
|
+
else {
|
|
16762
|
+
_this.destroyPopup();
|
|
16763
|
+
}
|
|
16764
|
+
}
|
|
16765
|
+
});
|
|
16766
|
+
};
|
|
16767
|
+
Mention.prototype.renderPopup = function () {
|
|
16768
|
+
var _this = this;
|
|
16769
|
+
var args = { cancel: false };
|
|
16770
|
+
this.trigger('beforeOpen', args, function (args) {
|
|
16771
|
+
if (!args.cancel) {
|
|
16772
|
+
var popupEle_1;
|
|
16773
|
+
if (isNullOrUndefined(_this.target)) {
|
|
16774
|
+
popupEle_1 = _this.createElement('div', {
|
|
16775
|
+
id: _this.inputElement.id + '_popup', className: 'e-mention e-popup ' + (_this.cssClass != null ? _this.cssClass : '')
|
|
16776
|
+
});
|
|
16777
|
+
}
|
|
16778
|
+
else {
|
|
16779
|
+
popupEle_1 = _this.element;
|
|
16780
|
+
if (_this.cssClass != null) {
|
|
16781
|
+
addClass([popupEle_1], _this.cssClass.split(' '));
|
|
16782
|
+
}
|
|
16783
|
+
}
|
|
16784
|
+
if (!isNullOrUndefined(_this.target)) {
|
|
16785
|
+
popupEle_1.id = _this.inputElement.id + '_popup';
|
|
16786
|
+
}
|
|
16787
|
+
_this.listHeight = formatUnit(_this.popupHeight);
|
|
16788
|
+
if (!isNullOrUndefined(_this.list.querySelector('li')) && !_this.initRemoteRender) {
|
|
16789
|
+
var li = _this.list.querySelector('.' + dropDownBaseClasses.focus);
|
|
16790
|
+
if (!isNullOrUndefined(li)) {
|
|
16791
|
+
_this.selectedLI = li;
|
|
16792
|
+
var value = _this.getFormattedValue(li.getAttribute('data-value'));
|
|
16793
|
+
_this.selectEventCallback(li, _this.getDataByValue(value), value, true);
|
|
16794
|
+
}
|
|
16795
|
+
}
|
|
16796
|
+
append([_this.list], popupEle_1);
|
|
16797
|
+
if ((!_this.popupObj || !document.body.contains(_this.popupObj.element)) ||
|
|
16798
|
+
!document.contains(popupEle_1) && isNullOrUndefined(_this.target)) {
|
|
16799
|
+
document.body.appendChild(popupEle_1);
|
|
16800
|
+
}
|
|
16801
|
+
var coordinates_1;
|
|
16802
|
+
popupEle_1.style.visibility = 'hidden';
|
|
16803
|
+
_this.setHeight(popupEle_1);
|
|
16804
|
+
var offsetValue = 0;
|
|
16805
|
+
var left = 0;
|
|
16806
|
+
_this.initializePopup(popupEle_1, offsetValue, left);
|
|
16807
|
+
_this.checkCollision(popupEle_1);
|
|
16808
|
+
popupEle_1.style.visibility = 'visible';
|
|
16809
|
+
addClass([popupEle_1], ['e-mention', 'e-popup', 'e-popup-close']);
|
|
16810
|
+
if (!isNullOrUndefined(_this.list)) {
|
|
16811
|
+
_this.unWireListEvents();
|
|
16812
|
+
_this.wireListEvents();
|
|
16813
|
+
}
|
|
16814
|
+
_this.selectedElementID = _this.selectedLI ? _this.selectedLI.id : null;
|
|
16815
|
+
attributes(_this.inputElement, { 'aria-owns': _this.inputElement.id + '_options', 'aria-activedescendant': _this.selectedElementID });
|
|
16816
|
+
if (_this.selectedElementID == null) {
|
|
16817
|
+
_this.inputElement.removeAttribute('aria-activedescendant');
|
|
16818
|
+
}
|
|
16819
|
+
var animModel = { name: 'FadeIn', duration: 100 };
|
|
16820
|
+
_this.beforePopupOpen = true;
|
|
16821
|
+
var popupInstance = _this.popupObj;
|
|
16822
|
+
var eventArgs = { popup: popupInstance, cancel: false, animation: animModel };
|
|
16823
|
+
_this.trigger('opened', eventArgs, function (eventArgs) {
|
|
16824
|
+
if (!eventArgs.cancel) {
|
|
16825
|
+
_this.renderReactTemplates();
|
|
16826
|
+
_this.popupObj.show(new Animation(eventArgs.animation), (_this.zIndex === 1000) ? _this.inputElement : null);
|
|
16827
|
+
if (isNullOrUndefined(_this.getTriggerCharPosition())) {
|
|
16828
|
+
return;
|
|
16829
|
+
}
|
|
16830
|
+
coordinates_1 = _this.getCoordinates(_this.inputElement, _this.getTriggerCharPosition());
|
|
16831
|
+
if (!_this.isCollided) {
|
|
16832
|
+
popupEle_1.style.cssText = 'top: '.concat(coordinates_1.top.toString(), 'px;\n left: ').concat(coordinates_1.left.toString(), 'px;\nposition: absolute;\n display: block;');
|
|
16833
|
+
}
|
|
16834
|
+
else {
|
|
16835
|
+
popupEle_1.style.left = formatUnit(coordinates_1.left);
|
|
16836
|
+
_this.isCollided = false;
|
|
16837
|
+
}
|
|
16838
|
+
popupEle_1.style.width = _this.popupWidth !== '100%' && !isNullOrUndefined(_this.popupWidth) ? formatUnit(_this.popupWidth) : 'auto';
|
|
16839
|
+
_this.setHeight(popupEle_1);
|
|
16840
|
+
popupEle_1.style.zIndex = _this.zIndex === 1000 ? getZindexPartial(popupEle_1).toString() : _this.zIndex.toString();
|
|
16841
|
+
}
|
|
16842
|
+
else {
|
|
16843
|
+
_this.beforePopupOpen = false;
|
|
16844
|
+
_this.destroyPopup();
|
|
16845
|
+
}
|
|
16846
|
+
});
|
|
16847
|
+
}
|
|
16848
|
+
else {
|
|
16849
|
+
_this.beforePopupOpen = false;
|
|
16850
|
+
}
|
|
16851
|
+
});
|
|
16852
|
+
};
|
|
16853
|
+
Mention.prototype.setHeight = function (popupEle) {
|
|
16854
|
+
if (this.popupHeight !== 'auto') {
|
|
16855
|
+
this.list.style.maxHeight = (parseInt(this.listHeight, 10) - 2).toString() + 'px'; // due to box-sizing property
|
|
16856
|
+
popupEle.style.maxHeight = formatUnit(this.popupHeight);
|
|
16857
|
+
}
|
|
16858
|
+
else {
|
|
16859
|
+
popupEle.style.height = 'auto';
|
|
16860
|
+
}
|
|
16861
|
+
};
|
|
16862
|
+
Mention.prototype.checkCollision = function (popupEle) {
|
|
16863
|
+
if (!Browser.isDevice || (Browser.isDevice && !(this.getModuleName() === 'mention'))) {
|
|
16864
|
+
var collision = isCollide(popupEle);
|
|
16865
|
+
if (collision.length > 0) {
|
|
16866
|
+
popupEle.style.marginTop = -parseInt(getComputedStyle(popupEle).marginTop, 10) + 'px';
|
|
16867
|
+
this.isCollided = true;
|
|
16868
|
+
}
|
|
16869
|
+
this.popupObj.resolveCollision();
|
|
16870
|
+
}
|
|
16871
|
+
};
|
|
16872
|
+
Mention.prototype.getTriggerCharPosition = function () {
|
|
16873
|
+
var mostRecentTriggerCharPos;
|
|
16874
|
+
var currentRange = this.getTextRange();
|
|
16875
|
+
if (currentRange !== undefined && currentRange !== null) {
|
|
16876
|
+
mostRecentTriggerCharPos = 0;
|
|
16877
|
+
var idx = currentRange.lastIndexOf(this.mentionChar);
|
|
16878
|
+
if (idx >= mostRecentTriggerCharPos) {
|
|
16879
|
+
mostRecentTriggerCharPos = idx;
|
|
16880
|
+
}
|
|
16881
|
+
}
|
|
16882
|
+
return mostRecentTriggerCharPos;
|
|
16883
|
+
};
|
|
16884
|
+
Mention.prototype.initializePopup = function (element, offsetValue, left) {
|
|
16885
|
+
var _this = this;
|
|
16886
|
+
this.popupObj = new Popup(element, {
|
|
16887
|
+
width: this.setWidth(), targetType: 'relative',
|
|
16888
|
+
relateTo: this.inputElement, collision: { X: 'flip', Y: 'flip' }, offsetY: offsetValue,
|
|
16889
|
+
enableRtl: this.enableRtl, offsetX: left, position: { X: 'top', Y: 'left' }, actionOnScroll: 'hide',
|
|
16890
|
+
zIndex: this.zIndex,
|
|
16891
|
+
close: function () {
|
|
16892
|
+
_this.destroyPopup();
|
|
16893
|
+
},
|
|
16894
|
+
open: function () {
|
|
16895
|
+
EventHandler.add(document, 'mousedown', _this.onDocumentClick, _this);
|
|
16896
|
+
_this.isPopupOpen = true;
|
|
16897
|
+
_this.setDataIndex();
|
|
16898
|
+
}
|
|
16899
|
+
});
|
|
16900
|
+
};
|
|
16901
|
+
Mention.prototype.setWidth = function () {
|
|
16902
|
+
var width = formatUnit(this.popupWidth);
|
|
16903
|
+
if (width.indexOf('%') > -1) {
|
|
16904
|
+
var inputWidth = this.inputElement.offsetWidth * parseFloat(width) / 100;
|
|
16905
|
+
width = inputWidth.toString() + 'px';
|
|
16906
|
+
}
|
|
16907
|
+
return width;
|
|
16908
|
+
};
|
|
16909
|
+
Mention.prototype.destroyPopup = function () {
|
|
16910
|
+
this.isPopupOpen = false;
|
|
16911
|
+
this.popupObj.destroy();
|
|
16912
|
+
if (isNullOrUndefined(this.target)) {
|
|
16913
|
+
detach(this.popupObj.element);
|
|
16914
|
+
}
|
|
16915
|
+
else {
|
|
16916
|
+
this.popupObj.element.innerHTML = '';
|
|
16917
|
+
this.popupObj.element.removeAttribute('style');
|
|
16918
|
+
this.popupObj.element.removeAttribute('aria-disabled');
|
|
16919
|
+
}
|
|
16920
|
+
};
|
|
16921
|
+
Mention.prototype.onDocumentClick = function (e) {
|
|
16922
|
+
var target = e.target;
|
|
16923
|
+
if (!(!isNullOrUndefined(this.popupObj) && closest(target, '#' + this.popupObj.element.id))) {
|
|
16924
|
+
this.hidePopup(e);
|
|
16925
|
+
}
|
|
16926
|
+
};
|
|
16927
|
+
Mention.prototype.getCoordinates = function (element, position) {
|
|
16928
|
+
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'];
|
|
16929
|
+
var div;
|
|
16930
|
+
var span;
|
|
16931
|
+
var range;
|
|
16932
|
+
var globalRange;
|
|
16933
|
+
var coordinates;
|
|
16934
|
+
var computed;
|
|
16935
|
+
var rect;
|
|
16936
|
+
if (!this.isContentEditable(this.inputElement)) {
|
|
16937
|
+
div = this.createElement('div', { className: 'e-form-mirror-div' });
|
|
16938
|
+
document.body.appendChild(div);
|
|
16939
|
+
computed = getComputedStyle(element);
|
|
16940
|
+
div.style.position = 'absolute';
|
|
16941
|
+
div.style.visibility = 'hidden';
|
|
16942
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16943
|
+
properties.forEach(function (prop) {
|
|
16944
|
+
// eslint-disable-next-line security/detect-object-injection
|
|
16945
|
+
div.style[prop] = computed[prop];
|
|
16946
|
+
});
|
|
16947
|
+
div.textContent = element.value.substring(0, position);
|
|
16948
|
+
if (this.inputElement.nodeName === 'INPUT') {
|
|
16949
|
+
div.textContent = div.textContent.replace(/\s/g, '\u00a0');
|
|
16950
|
+
}
|
|
16951
|
+
span = this.createElement('span');
|
|
16952
|
+
span.textContent = element.value.substring(position) || '.';
|
|
16953
|
+
div.appendChild(span);
|
|
16954
|
+
rect = element.getBoundingClientRect();
|
|
16955
|
+
}
|
|
16956
|
+
else {
|
|
16957
|
+
var selectedNodePosition = this.getTriggerCharPosition();
|
|
16958
|
+
globalRange = this.range;
|
|
16959
|
+
range = document.createRange();
|
|
16960
|
+
range.setStart(globalRange.startContainer, selectedNodePosition);
|
|
16961
|
+
range.setEnd(globalRange.startContainer, selectedNodePosition);
|
|
16962
|
+
range.collapse(false);
|
|
16963
|
+
rect = range.getBoundingClientRect();
|
|
16964
|
+
}
|
|
16965
|
+
var doc = document.documentElement;
|
|
16966
|
+
var windowLeft = (window.pageXOffset || doc.scrollLeft) - (doc.clientLeft || 0);
|
|
16967
|
+
var windowTop = (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0);
|
|
16968
|
+
if (!this.isContentEditable(this.inputElement)) {
|
|
16969
|
+
coordinates = {
|
|
16970
|
+
top: rect.top + windowTop + span.offsetTop + parseInt(computed.borderTopWidth, 10) +
|
|
16971
|
+
parseInt(computed.fontSize, 10) + 3 - element.scrollTop,
|
|
16972
|
+
left: rect.left + windowLeft + span.offsetLeft + parseInt(computed.borderLeftWidth, 10)
|
|
16973
|
+
};
|
|
16974
|
+
document.body.removeChild(div);
|
|
16975
|
+
}
|
|
16976
|
+
else {
|
|
16977
|
+
coordinates = {
|
|
16978
|
+
top: rect.top + windowTop + parseInt(getComputedStyle(this.inputElement).fontSize, 10),
|
|
16979
|
+
left: rect.left + windowLeft
|
|
16980
|
+
};
|
|
16981
|
+
}
|
|
16982
|
+
return coordinates;
|
|
16983
|
+
};
|
|
16984
|
+
Mention.prototype.initValue = function () {
|
|
16985
|
+
this.renderList();
|
|
16986
|
+
if (this.dataSource instanceof DataManager) {
|
|
16987
|
+
this.initRemoteRender = true;
|
|
16988
|
+
}
|
|
16989
|
+
else {
|
|
16990
|
+
this.updateValues();
|
|
16991
|
+
}
|
|
16992
|
+
};
|
|
16993
|
+
Mention.prototype.updateValues = function () {
|
|
16994
|
+
var li = this.list.querySelector('.' + dropDownBaseClasses.focus);
|
|
16995
|
+
if (!isNullOrUndefined(li)) {
|
|
16996
|
+
this.setSelection(li, null);
|
|
16997
|
+
}
|
|
16998
|
+
};
|
|
16999
|
+
Mention.prototype.renderList = function () {
|
|
17000
|
+
_super.prototype.render.call(this);
|
|
17001
|
+
this.unWireListEvents();
|
|
17002
|
+
this.wireListEvents();
|
|
17003
|
+
};
|
|
17004
|
+
/**
|
|
17005
|
+
* Event binding for list
|
|
17006
|
+
*
|
|
17007
|
+
* @returns {void}
|
|
17008
|
+
*/
|
|
17009
|
+
Mention.prototype.wireListEvents = function () {
|
|
17010
|
+
EventHandler.add(this.list, 'click', this.onMouseClick, this);
|
|
17011
|
+
EventHandler.add(this.list, 'mouseover', this.onMouseOver, this);
|
|
17012
|
+
EventHandler.add(this.list, 'mouseout', this.onMouseLeave, this);
|
|
17013
|
+
};
|
|
17014
|
+
/**
|
|
17015
|
+
* Event un binding for list items.
|
|
17016
|
+
*
|
|
17017
|
+
* @returns {void}
|
|
17018
|
+
*/
|
|
17019
|
+
Mention.prototype.unWireListEvents = function () {
|
|
17020
|
+
EventHandler.remove(this.list, 'click', this.onMouseClick);
|
|
17021
|
+
EventHandler.remove(this.list, 'mouseover', this.onMouseOver);
|
|
17022
|
+
EventHandler.remove(this.list, 'mouseout', this.onMouseLeave);
|
|
17023
|
+
};
|
|
17024
|
+
Mention.prototype.onMouseClick = function (e) {
|
|
17025
|
+
var target = e.target;
|
|
17026
|
+
var li = closest(target, '.' + dropDownBaseClasses.li);
|
|
17027
|
+
if (!this.isValidLI(li)) {
|
|
17028
|
+
return;
|
|
17029
|
+
}
|
|
17030
|
+
this.setSelection(li, e);
|
|
17031
|
+
var delay = 100;
|
|
17032
|
+
this.closePopup(delay, e);
|
|
17033
|
+
this.inputElement.focus();
|
|
17034
|
+
};
|
|
17035
|
+
Mention.prototype.updateSelectedItem = function (li, e, preventSelect, isSelection) {
|
|
17036
|
+
var _this = this;
|
|
17037
|
+
this.removeSelection();
|
|
17038
|
+
li.classList.add(dropDownBaseClasses.selected);
|
|
17039
|
+
this.removeHover();
|
|
17040
|
+
var value = this.getFormattedValue(li.getAttribute('data-value'));
|
|
17041
|
+
var selectedData = this.getDataByValue(value);
|
|
17042
|
+
if (!preventSelect && !isNullOrUndefined(e)) {
|
|
17043
|
+
var items = this.detachChanges(selectedData);
|
|
17044
|
+
this.isSelected = true;
|
|
17045
|
+
var eventArgs = {
|
|
17046
|
+
e: e,
|
|
17047
|
+
item: li,
|
|
17048
|
+
itemData: items,
|
|
17049
|
+
isInteracted: e ? true : false,
|
|
17050
|
+
cancel: false
|
|
17051
|
+
};
|
|
17052
|
+
this.trigger('select', eventArgs, function (eventArgs) {
|
|
17053
|
+
if (eventArgs.cancel) {
|
|
17054
|
+
li.classList.remove(dropDownBaseClasses.selected);
|
|
17055
|
+
}
|
|
17056
|
+
else {
|
|
17057
|
+
_this.selectEventCallback(li, selectedData, value);
|
|
17058
|
+
if (isSelection) {
|
|
17059
|
+
_this.setSelectOptions(li, e);
|
|
17060
|
+
}
|
|
17061
|
+
}
|
|
17062
|
+
});
|
|
17063
|
+
}
|
|
17064
|
+
else {
|
|
17065
|
+
this.selectEventCallback(li, selectedData, value);
|
|
17066
|
+
if (isSelection) {
|
|
17067
|
+
this.setSelectOptions(li, e);
|
|
17068
|
+
}
|
|
17069
|
+
}
|
|
17070
|
+
};
|
|
17071
|
+
Mention.prototype.setSelection = function (li, e) {
|
|
17072
|
+
if (this.isValidLI(li) && (!li.classList.contains(dropDownBaseClasses.selected) || (this.isPopupOpen && this.isSelected
|
|
17073
|
+
&& li.classList.contains(dropDownBaseClasses.selected)))) {
|
|
17074
|
+
this.updateSelectedItem(li, e, false, true);
|
|
17075
|
+
}
|
|
17076
|
+
else {
|
|
17077
|
+
this.setSelectOptions(li, e);
|
|
17078
|
+
}
|
|
17079
|
+
};
|
|
17080
|
+
Mention.prototype.setSelectOptions = function (li, e) {
|
|
17081
|
+
if (this.list) {
|
|
17082
|
+
this.removeHover();
|
|
17083
|
+
}
|
|
17084
|
+
this.previousSelectedLI = (!isNullOrUndefined(this.selectedLI)) ? this.selectedLI : null;
|
|
17085
|
+
this.selectedLI = li;
|
|
17086
|
+
if (this.isPopupOpen && !isNullOrUndefined(this.selectedLI)) {
|
|
17087
|
+
this.setScrollPosition(e);
|
|
17088
|
+
}
|
|
17089
|
+
if (e && (e.keyCode === 38 || e.keyCode === 40)) {
|
|
17090
|
+
return;
|
|
17091
|
+
}
|
|
17092
|
+
if (isNullOrUndefined(e) || this.setValue(e)) {
|
|
17093
|
+
return;
|
|
17094
|
+
}
|
|
17095
|
+
};
|
|
17096
|
+
Mention.prototype.setScrollPosition = function (e) {
|
|
17097
|
+
if (!isNullOrUndefined(e)) {
|
|
17098
|
+
switch (e.action) {
|
|
17099
|
+
case 'pageDown':
|
|
17100
|
+
case 'down':
|
|
17101
|
+
case 'end':
|
|
17102
|
+
this.scrollBottom();
|
|
17103
|
+
break;
|
|
17104
|
+
default:
|
|
17105
|
+
this.scrollTop();
|
|
17106
|
+
break;
|
|
17107
|
+
}
|
|
17108
|
+
}
|
|
17109
|
+
else {
|
|
17110
|
+
this.scrollBottom(true);
|
|
17111
|
+
}
|
|
17112
|
+
};
|
|
17113
|
+
Mention.prototype.scrollBottom = function (isInitial) {
|
|
17114
|
+
if (!isNullOrUndefined(this.selectedLI)) {
|
|
17115
|
+
var currentOffset = this.list.offsetHeight;
|
|
17116
|
+
var nextBottom = this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop;
|
|
17117
|
+
var nextOffset = this.list.scrollTop + nextBottom - currentOffset;
|
|
17118
|
+
nextOffset = isInitial ? nextOffset + parseInt(getComputedStyle(this.list).paddingTop, 10) * 2 : nextOffset;
|
|
17119
|
+
var boxRange = this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop;
|
|
17120
|
+
if (this.activeIndex === 0) {
|
|
17121
|
+
this.list.scrollTop = 0;
|
|
17122
|
+
}
|
|
17123
|
+
else if (nextBottom > currentOffset || !(boxRange > 0 && this.list.offsetHeight > boxRange)) {
|
|
17124
|
+
this.list.scrollTop = nextOffset;
|
|
17125
|
+
}
|
|
17126
|
+
}
|
|
17127
|
+
};
|
|
17128
|
+
Mention.prototype.scrollTop = function () {
|
|
17129
|
+
if (!isNullOrUndefined(this.selectedLI)) {
|
|
17130
|
+
var nextOffset = this.selectedLI.offsetTop - this.list.scrollTop;
|
|
17131
|
+
nextOffset = this.fields.groupBy && nextOffset;
|
|
17132
|
+
var boxRange = (this.selectedLI.offsetTop + this.selectedLI.offsetHeight - this.list.scrollTop);
|
|
17133
|
+
if (this.activeIndex === 0) {
|
|
17134
|
+
this.list.scrollTop = 0;
|
|
17135
|
+
}
|
|
17136
|
+
else if (nextOffset < 0) {
|
|
17137
|
+
this.list.scrollTop = this.list.scrollTop + nextOffset;
|
|
17138
|
+
}
|
|
17139
|
+
else if (!(boxRange > 0 && this.list.offsetHeight > boxRange)) {
|
|
17140
|
+
this.list.scrollTop = this.selectedLI.offsetTop;
|
|
17141
|
+
}
|
|
17142
|
+
}
|
|
17143
|
+
};
|
|
17144
|
+
Mention.prototype.selectEventCallback = function (li, selectedData, value, selectLi) {
|
|
17145
|
+
this.previousItemData = (!isNullOrUndefined(this.itemData)) ? this.itemData : null;
|
|
17146
|
+
this.item = li;
|
|
17147
|
+
this.itemData = selectedData;
|
|
17148
|
+
var focusedItem = this.list.querySelector('.' + dropDownBaseClasses.focus);
|
|
17149
|
+
if (focusedItem) {
|
|
17150
|
+
removeClass([focusedItem], dropDownBaseClasses.focus);
|
|
17151
|
+
}
|
|
17152
|
+
if (selectLi) {
|
|
17153
|
+
addClass([li], dropDownBaseClasses.selected);
|
|
17154
|
+
}
|
|
17155
|
+
li.setAttribute('aria-selected', 'true');
|
|
17156
|
+
this.activeIndex = this.getIndexByValue(value);
|
|
17157
|
+
};
|
|
17158
|
+
Mention.prototype.detachChanges = function (value) {
|
|
17159
|
+
var items;
|
|
17160
|
+
if (typeof value === 'string' ||
|
|
17161
|
+
typeof value === 'boolean' ||
|
|
17162
|
+
typeof value === 'number') {
|
|
17163
|
+
items = Object.defineProperties({}, {
|
|
17164
|
+
value: {
|
|
17165
|
+
value: value,
|
|
17166
|
+
enumerable: true
|
|
17167
|
+
},
|
|
17168
|
+
text: {
|
|
17169
|
+
value: value,
|
|
17170
|
+
enumerable: true
|
|
17171
|
+
}
|
|
17172
|
+
});
|
|
17173
|
+
}
|
|
17174
|
+
else {
|
|
17175
|
+
items = value;
|
|
17176
|
+
}
|
|
17177
|
+
return items;
|
|
17178
|
+
};
|
|
17179
|
+
Mention.prototype.setValue = function (e) {
|
|
17180
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17181
|
+
if (!this.isReact) {
|
|
17182
|
+
if (!isNullOrUndefined(this.displayTemplate)) {
|
|
17183
|
+
this.setDisplayTemplate();
|
|
17184
|
+
}
|
|
17185
|
+
this.updateMentionValue(e);
|
|
17186
|
+
return true;
|
|
17187
|
+
}
|
|
17188
|
+
else {
|
|
17189
|
+
if (!isNullOrUndefined(this.displayTemplate)) {
|
|
17190
|
+
this.setDisplayTemplate(e);
|
|
17191
|
+
}
|
|
17192
|
+
else {
|
|
17193
|
+
this.updateMentionValue(e);
|
|
17194
|
+
}
|
|
17195
|
+
return true;
|
|
17196
|
+
}
|
|
17197
|
+
};
|
|
17198
|
+
Mention.prototype.updateMentionValue = function (e) {
|
|
17199
|
+
var dataItem = this.getItemData();
|
|
17200
|
+
var textSuffix;
|
|
17201
|
+
var value;
|
|
17202
|
+
var endPos;
|
|
17203
|
+
var range;
|
|
17204
|
+
var globalRange;
|
|
17205
|
+
var selection = this.inputElement.ownerDocument.getSelection();
|
|
17206
|
+
var startPos = this.getTriggerCharPosition();
|
|
17207
|
+
textSuffix = typeof this.suffixText === 'string' ? this.suffixText : '';
|
|
17208
|
+
if (dataItem.text !== null) {
|
|
17209
|
+
value = this.mentionVal(dataItem.text);
|
|
17210
|
+
}
|
|
17211
|
+
if (!this.isContentEditable(this.inputElement)) {
|
|
17212
|
+
var myField = this.inputElement;
|
|
17213
|
+
var currentTriggerSnippet = this.getTextRange().substring(startPos + this.mentionChar.length, this.getTextRange().length);
|
|
17214
|
+
value += textSuffix;
|
|
17215
|
+
endPos = startPos + this.mentionChar.length;
|
|
17216
|
+
endPos += currentTriggerSnippet.length;
|
|
17217
|
+
myField.value = myField.value.substring(0, startPos) + value + myField.value.substring(endPos, myField.value.length);
|
|
17218
|
+
myField.selectionStart = startPos + value.length;
|
|
17219
|
+
myField.selectionEnd = startPos + value.length;
|
|
17220
|
+
if (this.isPopupOpen) {
|
|
17221
|
+
this.hidePopup();
|
|
17222
|
+
}
|
|
17223
|
+
this.onChangeEvent(e);
|
|
17224
|
+
}
|
|
17225
|
+
else {
|
|
17226
|
+
endPos = this.getTriggerCharPosition() + this.mentionChar.length;
|
|
17227
|
+
if (this.range && (this.range.startContainer.textContent.trim() !== this.mentionChar)) {
|
|
17228
|
+
endPos = this.range.endOffset;
|
|
17229
|
+
}
|
|
17230
|
+
globalRange = this.range;
|
|
17231
|
+
range = document.createRange();
|
|
17232
|
+
range.setStart(globalRange.startContainer, startPos);
|
|
17233
|
+
range.setEnd(globalRange.startContainer, endPos);
|
|
17234
|
+
range.deleteContents();
|
|
17235
|
+
var element = this.createElement('div');
|
|
17236
|
+
element.innerHTML = value;
|
|
17237
|
+
var frag = document.createDocumentFragment();
|
|
17238
|
+
var node = void 0;
|
|
17239
|
+
var lastNode = void 0;
|
|
17240
|
+
// eslint-disable-next-line no-cond-assign
|
|
17241
|
+
while (node = element.firstChild) {
|
|
17242
|
+
lastNode = frag.appendChild(node);
|
|
17243
|
+
}
|
|
17244
|
+
range.insertNode(frag);
|
|
17245
|
+
if (lastNode) {
|
|
17246
|
+
range = range.cloneRange();
|
|
17247
|
+
range.setStartAfter(lastNode);
|
|
17248
|
+
range.collapse(true);
|
|
17249
|
+
selection.removeAllRanges();
|
|
17250
|
+
selection.addRange(range);
|
|
17251
|
+
}
|
|
17252
|
+
if (this.isPopupOpen) {
|
|
17253
|
+
this.hidePopup();
|
|
17254
|
+
}
|
|
17255
|
+
this.onChangeEvent(e);
|
|
17256
|
+
}
|
|
17257
|
+
};
|
|
17258
|
+
Mention.prototype.mentionVal = function (value) {
|
|
17259
|
+
var showChar = this.showMentionChar ? this.mentionChar : '';
|
|
17260
|
+
if (!isNullOrUndefined(this.displayTemplate) && !isNullOrUndefined(this.displayTempElement)) {
|
|
17261
|
+
value = this.displayTempElement.innerHTML;
|
|
17262
|
+
}
|
|
17263
|
+
if (this.isContentEditable(this.inputElement)) {
|
|
17264
|
+
return '<span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : ' ');
|
|
17265
|
+
}
|
|
17266
|
+
else {
|
|
17267
|
+
return showChar + value;
|
|
17268
|
+
}
|
|
17269
|
+
};
|
|
17270
|
+
Mention.prototype.setDisplayTemplate = function (e) {
|
|
17271
|
+
var _this = this;
|
|
17272
|
+
var compiledString;
|
|
17273
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17274
|
+
if (this.isReact) {
|
|
17275
|
+
this.clearTemplate(['displayTemplate']);
|
|
17276
|
+
if (this.displayTempElement) {
|
|
17277
|
+
detach(this.displayTempElement);
|
|
17278
|
+
this.displayTempElement = null;
|
|
17279
|
+
}
|
|
17280
|
+
}
|
|
17281
|
+
if (!this.displayTempElement) {
|
|
17282
|
+
this.displayTempElement = this.createElement('div');
|
|
17283
|
+
}
|
|
17284
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17285
|
+
if (!this.isReact) {
|
|
17286
|
+
this.displayTempElement.innerHTML = '';
|
|
17287
|
+
}
|
|
17288
|
+
compiledString = compile(this.displayTemplate);
|
|
17289
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17290
|
+
var displayCompTemp = compiledString(this.itemData, this, 'displayTemplate', this.displayTemplateId, this.isStringTemplate, null, this.displayTempElement);
|
|
17291
|
+
if (displayCompTemp && displayCompTemp.length > 0) {
|
|
17292
|
+
for (var i = 0; i < displayCompTemp.length; i++) {
|
|
17293
|
+
this.displayTempElement.appendChild(displayCompTemp[i]);
|
|
17294
|
+
}
|
|
17295
|
+
}
|
|
17296
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17297
|
+
if (!this.isReact) {
|
|
17298
|
+
this.renderTemplates();
|
|
17299
|
+
}
|
|
17300
|
+
else {
|
|
17301
|
+
this.renderTemplates(function () {
|
|
17302
|
+
_this.updateMentionValue(e);
|
|
17303
|
+
});
|
|
17304
|
+
}
|
|
17305
|
+
};
|
|
17306
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17307
|
+
Mention.prototype.renderTemplates = function (callBack) {
|
|
17308
|
+
this.renderReactTemplates(callBack);
|
|
17309
|
+
};
|
|
17310
|
+
Mention.prototype.setSpinnerTemplate = function () {
|
|
17311
|
+
var _this = this;
|
|
17312
|
+
var compiledString;
|
|
17313
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17314
|
+
if (this.isReact) {
|
|
17315
|
+
this.clearTemplate(['spinnerTemplate']);
|
|
17316
|
+
if (this.spinnerTemplateElement) {
|
|
17317
|
+
detach(this.spinnerTemplateElement);
|
|
17318
|
+
this.spinnerTemplateElement = null;
|
|
17319
|
+
}
|
|
17320
|
+
}
|
|
17321
|
+
if (!this.spinnerTemplateElement) {
|
|
17322
|
+
this.spinnerTemplateElement = this.createElement('div');
|
|
17323
|
+
}
|
|
17324
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17325
|
+
if (!this.isReact) {
|
|
17326
|
+
this.spinnerTemplateElement.innerHTML = '';
|
|
17327
|
+
}
|
|
17328
|
+
compiledString = compile(this.spinnerTemplate);
|
|
17329
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17330
|
+
var spinnerCompTemp = compiledString(null, this, 'spinnerTemplate', this.spinnerTemplateId, this.isStringTemplate, null, this.spinnerTemplateElement);
|
|
17331
|
+
if (spinnerCompTemp && spinnerCompTemp.length > 0) {
|
|
17332
|
+
for (var i = 0; i < spinnerCompTemp.length; i++) {
|
|
17333
|
+
this.spinnerTemplateElement.appendChild(spinnerCompTemp[i]);
|
|
17334
|
+
}
|
|
17335
|
+
}
|
|
17336
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17337
|
+
if (!this.isReact) {
|
|
17338
|
+
this.renderTemplates();
|
|
17339
|
+
this.popupObj.element.appendChild(this.spinnerTemplateElement);
|
|
17340
|
+
}
|
|
17341
|
+
else {
|
|
17342
|
+
this.renderTemplates(function () {
|
|
17343
|
+
_this.popupObj.element.appendChild(_this.spinnerTemplateElement);
|
|
17344
|
+
});
|
|
17345
|
+
}
|
|
17346
|
+
};
|
|
17347
|
+
Mention.prototype.onChangeEvent = function (eve) {
|
|
17348
|
+
this.isSelected = false;
|
|
17349
|
+
var items = this.detachMentionChanges(this.itemData);
|
|
17350
|
+
var preItems;
|
|
17351
|
+
if (typeof this.previousItemData === 'string' ||
|
|
17352
|
+
typeof this.previousItemData === 'boolean' ||
|
|
17353
|
+
typeof this.previousItemData === 'number') {
|
|
17354
|
+
preItems = Object.defineProperties({}, {
|
|
17355
|
+
value: {
|
|
17356
|
+
value: this.previousItemData,
|
|
17357
|
+
enumerable: true
|
|
17358
|
+
},
|
|
17359
|
+
text: {
|
|
17360
|
+
value: this.previousItemData,
|
|
17361
|
+
enumerable: true
|
|
17362
|
+
}
|
|
17363
|
+
});
|
|
17364
|
+
}
|
|
17365
|
+
else {
|
|
17366
|
+
preItems = this.previousItemData;
|
|
17367
|
+
}
|
|
17368
|
+
var eventArgs = {
|
|
17369
|
+
e: eve,
|
|
17370
|
+
item: this.item,
|
|
17371
|
+
itemData: items,
|
|
17372
|
+
previousItem: this.previousSelectedLI,
|
|
17373
|
+
previousItemData: preItems,
|
|
17374
|
+
isInteracted: eve ? true : false,
|
|
17375
|
+
value: this.item.innerHTML,
|
|
17376
|
+
element: this.inputElement
|
|
17377
|
+
};
|
|
17378
|
+
this.trigger('change', eventArgs);
|
|
17379
|
+
};
|
|
17380
|
+
Mention.prototype.detachMentionChanges = function (value) {
|
|
17381
|
+
var items;
|
|
17382
|
+
if (typeof value === 'string' ||
|
|
17383
|
+
typeof value === 'boolean' ||
|
|
17384
|
+
typeof value === 'number') {
|
|
17385
|
+
items = Object.defineProperties({}, {
|
|
17386
|
+
value: {
|
|
17387
|
+
value: value,
|
|
17388
|
+
enumerable: true
|
|
17389
|
+
},
|
|
17390
|
+
text: {
|
|
17391
|
+
value: value,
|
|
17392
|
+
enumerable: true
|
|
17393
|
+
}
|
|
17394
|
+
});
|
|
17395
|
+
}
|
|
17396
|
+
else {
|
|
17397
|
+
items = value;
|
|
17398
|
+
}
|
|
17399
|
+
return items;
|
|
17400
|
+
};
|
|
17401
|
+
Mention.prototype.getItemData = function () {
|
|
17402
|
+
var fields = this.fields;
|
|
17403
|
+
var dataItem = null;
|
|
17404
|
+
dataItem = this.itemData;
|
|
17405
|
+
var dataValue;
|
|
17406
|
+
var dataText;
|
|
17407
|
+
if (!isNullOrUndefined(dataItem)) {
|
|
17408
|
+
dataValue = getValue(fields.value, dataItem);
|
|
17409
|
+
dataText = getValue(fields.text, dataItem);
|
|
17410
|
+
}
|
|
17411
|
+
var value = (!isNullOrUndefined(dataItem) &&
|
|
17412
|
+
!isUndefined(dataValue) ? dataValue : dataItem);
|
|
17413
|
+
var text = (!isNullOrUndefined(dataItem) &&
|
|
17414
|
+
!isUndefined(dataValue) ? dataText : dataItem);
|
|
17415
|
+
return { value: value, text: text };
|
|
17416
|
+
};
|
|
17417
|
+
Mention.prototype.removeSelection = function () {
|
|
17418
|
+
if (this.list) {
|
|
17419
|
+
var selectedItems = this.list.querySelectorAll('.' + dropDownBaseClasses.selected);
|
|
17420
|
+
if (selectedItems.length) {
|
|
17421
|
+
removeClass(selectedItems, dropDownBaseClasses.selected);
|
|
17422
|
+
selectedItems[0].removeAttribute('aria-selected');
|
|
17423
|
+
}
|
|
17424
|
+
}
|
|
17425
|
+
};
|
|
17426
|
+
Mention.prototype.onMouseOver = function (e) {
|
|
17427
|
+
var currentLi = closest(e.target, '.' + dropDownBaseClasses.li);
|
|
17428
|
+
this.setHover(currentLi);
|
|
17429
|
+
};
|
|
17430
|
+
Mention.prototype.setHover = function (li) {
|
|
17431
|
+
if (this.isValidLI(li) && !li.classList.contains(dropDownBaseClasses.hover)) {
|
|
17432
|
+
this.removeHover();
|
|
17433
|
+
addClass([li], dropDownBaseClasses.hover);
|
|
17434
|
+
}
|
|
17435
|
+
};
|
|
17436
|
+
Mention.prototype.removeHover = function () {
|
|
17437
|
+
if (this.list) {
|
|
17438
|
+
var hoveredItem = this.list.querySelectorAll('.' + dropDownBaseClasses.hover);
|
|
17439
|
+
if (hoveredItem && hoveredItem.length) {
|
|
17440
|
+
removeClass(hoveredItem, dropDownBaseClasses.hover);
|
|
17441
|
+
}
|
|
17442
|
+
}
|
|
17443
|
+
};
|
|
17444
|
+
Mention.prototype.isValidLI = function (li) {
|
|
17445
|
+
return (li && li.hasAttribute('role') && li.getAttribute('role') === 'option');
|
|
17446
|
+
};
|
|
17447
|
+
Mention.prototype.onMouseLeave = function () {
|
|
17448
|
+
this.removeHover();
|
|
17449
|
+
};
|
|
17450
|
+
/**
|
|
17451
|
+
* Search the entered text and show it in the suggestion list if available.
|
|
17452
|
+
*
|
|
17453
|
+
* @returns {void}
|
|
17454
|
+
*/
|
|
17455
|
+
Mention.prototype.search = function (text, positionX, positionY) {
|
|
17456
|
+
if (this.isContentEditable(this.inputElement)) {
|
|
17457
|
+
this.range = this.getCurrentRange();
|
|
17458
|
+
}
|
|
17459
|
+
var currentRange = this.getTextRange();
|
|
17460
|
+
var lastWordRange = this.getLastLetter(currentRange);
|
|
17461
|
+
if ((this.ignoreCase && (text === lastWordRange || text === lastWordRange.toLowerCase()))
|
|
17462
|
+
|| !this.ignoreCase && text === lastWordRange) {
|
|
17463
|
+
this.resetList(this.dataSource, this.fields);
|
|
17464
|
+
}
|
|
17465
|
+
else {
|
|
17466
|
+
if (this.isPopupOpen) {
|
|
17467
|
+
this.hidePopup();
|
|
17468
|
+
}
|
|
17469
|
+
return;
|
|
17470
|
+
}
|
|
17471
|
+
if (isNullOrUndefined(this.list)) {
|
|
17472
|
+
this.renderList();
|
|
17473
|
+
this.renderPopup();
|
|
17474
|
+
}
|
|
17475
|
+
else {
|
|
17476
|
+
this.showPopup();
|
|
17477
|
+
}
|
|
17478
|
+
this.popupObj.element.style.left = formatUnit(positionX);
|
|
17479
|
+
this.popupObj.element.style.top = formatUnit(positionY);
|
|
17480
|
+
};
|
|
17481
|
+
/**
|
|
17482
|
+
* Removes the component from the DOM and detaches all its related event handlers. Also it removes the attributes and classes.
|
|
17483
|
+
*
|
|
17484
|
+
* @method destroy
|
|
17485
|
+
* @returns {void}
|
|
17486
|
+
*/
|
|
17487
|
+
Mention.prototype.destroy = function () {
|
|
17488
|
+
this.hidePopup();
|
|
17489
|
+
this.unWireEvent();
|
|
17490
|
+
if (this.list) {
|
|
17491
|
+
this.unWireListEvents();
|
|
17492
|
+
}
|
|
17493
|
+
if (this.inputElement && !this.inputElement.classList.contains('e-' + this.getModuleName())) {
|
|
17494
|
+
return;
|
|
17495
|
+
}
|
|
17496
|
+
_super.prototype.destroy.call(this);
|
|
17497
|
+
};
|
|
17498
|
+
Mention.prototype.getLocaleName = function () {
|
|
17499
|
+
return 'mention';
|
|
17500
|
+
};
|
|
17501
|
+
Mention.prototype.getNgDirective = function () {
|
|
17502
|
+
return 'EJS-MENTION';
|
|
17503
|
+
};
|
|
17504
|
+
/**
|
|
17505
|
+
* Return the module name of this component.
|
|
17506
|
+
*
|
|
17507
|
+
* @private
|
|
17508
|
+
* @returns {string} Return the module name of this component.
|
|
17509
|
+
*/
|
|
17510
|
+
Mention.prototype.getModuleName = function () {
|
|
17511
|
+
return 'mention';
|
|
17512
|
+
};
|
|
17513
|
+
__decorate$7([
|
|
17514
|
+
Property(null)
|
|
17515
|
+
], Mention.prototype, "cssClass", void 0);
|
|
17516
|
+
__decorate$7([
|
|
17517
|
+
Property('@')
|
|
17518
|
+
], Mention.prototype, "mentionChar", void 0);
|
|
17519
|
+
__decorate$7([
|
|
17520
|
+
Property(false)
|
|
17521
|
+
], Mention.prototype, "showMentionChar", void 0);
|
|
17522
|
+
__decorate$7([
|
|
17523
|
+
Property(false)
|
|
17524
|
+
], Mention.prototype, "allowSpaces", void 0);
|
|
17525
|
+
__decorate$7([
|
|
17526
|
+
Property(null)
|
|
17527
|
+
], Mention.prototype, "suffixText", void 0);
|
|
17528
|
+
__decorate$7([
|
|
17529
|
+
Property(25)
|
|
17530
|
+
], Mention.prototype, "suggestionCount", void 0);
|
|
17531
|
+
__decorate$7([
|
|
17532
|
+
Property(0)
|
|
17533
|
+
], Mention.prototype, "minLength", void 0);
|
|
17534
|
+
__decorate$7([
|
|
17535
|
+
Property('None')
|
|
17536
|
+
], Mention.prototype, "sortOrder", void 0);
|
|
17537
|
+
__decorate$7([
|
|
17538
|
+
Property(true)
|
|
17539
|
+
], Mention.prototype, "ignoreCase", void 0);
|
|
17540
|
+
__decorate$7([
|
|
17541
|
+
Property(false)
|
|
17542
|
+
], Mention.prototype, "highlight", void 0);
|
|
17543
|
+
__decorate$7([
|
|
17544
|
+
Property()
|
|
17545
|
+
], Mention.prototype, "locale", void 0);
|
|
17546
|
+
__decorate$7([
|
|
17547
|
+
Property('auto')
|
|
17548
|
+
], Mention.prototype, "popupWidth", void 0);
|
|
17549
|
+
__decorate$7([
|
|
17550
|
+
Property('300px')
|
|
17551
|
+
], Mention.prototype, "popupHeight", void 0);
|
|
17552
|
+
__decorate$7([
|
|
17553
|
+
Property(null)
|
|
17554
|
+
], Mention.prototype, "displayTemplate", void 0);
|
|
17555
|
+
__decorate$7([
|
|
17556
|
+
Property(null)
|
|
17557
|
+
], Mention.prototype, "itemTemplate", void 0);
|
|
17558
|
+
__decorate$7([
|
|
17559
|
+
Property('No records found')
|
|
17560
|
+
], Mention.prototype, "noRecordsTemplate", void 0);
|
|
17561
|
+
__decorate$7([
|
|
17562
|
+
Property(null)
|
|
17563
|
+
], Mention.prototype, "spinnerTemplate", void 0);
|
|
17564
|
+
__decorate$7([
|
|
17565
|
+
Property()
|
|
17566
|
+
], Mention.prototype, "target", void 0);
|
|
17567
|
+
__decorate$7([
|
|
17568
|
+
Property([])
|
|
17569
|
+
], Mention.prototype, "dataSource", void 0);
|
|
17570
|
+
__decorate$7([
|
|
17571
|
+
Property(null)
|
|
17572
|
+
], Mention.prototype, "query", void 0);
|
|
17573
|
+
__decorate$7([
|
|
17574
|
+
Property('Contains')
|
|
17575
|
+
], Mention.prototype, "filterType", void 0);
|
|
17576
|
+
__decorate$7([
|
|
17577
|
+
Complex({ text: null, value: null, iconCss: null, groupBy: null }, FieldSettings)
|
|
17578
|
+
], Mention.prototype, "fields", void 0);
|
|
17579
|
+
__decorate$7([
|
|
17580
|
+
Event()
|
|
17581
|
+
], Mention.prototype, "actionBegin", void 0);
|
|
17582
|
+
__decorate$7([
|
|
17583
|
+
Event()
|
|
17584
|
+
], Mention.prototype, "actionComplete", void 0);
|
|
17585
|
+
__decorate$7([
|
|
17586
|
+
Event()
|
|
17587
|
+
], Mention.prototype, "actionFailure", void 0);
|
|
17588
|
+
__decorate$7([
|
|
17589
|
+
Event()
|
|
17590
|
+
], Mention.prototype, "change", void 0);
|
|
17591
|
+
__decorate$7([
|
|
17592
|
+
Event()
|
|
17593
|
+
], Mention.prototype, "beforeOpen", void 0);
|
|
17594
|
+
__decorate$7([
|
|
17595
|
+
Event()
|
|
17596
|
+
], Mention.prototype, "opened", void 0);
|
|
17597
|
+
__decorate$7([
|
|
17598
|
+
Event()
|
|
17599
|
+
], Mention.prototype, "closed", void 0);
|
|
17600
|
+
__decorate$7([
|
|
17601
|
+
Event()
|
|
17602
|
+
], Mention.prototype, "select", void 0);
|
|
17603
|
+
__decorate$7([
|
|
17604
|
+
Event()
|
|
17605
|
+
], Mention.prototype, "filtering", void 0);
|
|
17606
|
+
__decorate$7([
|
|
17607
|
+
Event()
|
|
17608
|
+
], Mention.prototype, "created", void 0);
|
|
17609
|
+
__decorate$7([
|
|
17610
|
+
Event()
|
|
17611
|
+
], Mention.prototype, "destroyed", void 0);
|
|
17612
|
+
Mention = __decorate$7([
|
|
17613
|
+
NotifyPropertyChanges
|
|
17614
|
+
], Mention);
|
|
17615
|
+
return Mention;
|
|
17616
|
+
}(DropDownBase));
|
|
17617
|
+
|
|
15774
17618
|
/**
|
|
15775
17619
|
* export all modules from current location
|
|
15776
17620
|
*/
|
|
@@ -15779,5 +17623,5 @@ var listBoxClasses = {
|
|
|
15779
17623
|
* export all modules from current location
|
|
15780
17624
|
*/
|
|
15781
17625
|
|
|
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 };
|
|
17626
|
+
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
17627
|
//# sourceMappingURL=ej2-dropdowns.es5.js.map
|