@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Input, InputObject, FloatLabelType, TextBox, InputEventArgs } from '@syncfusion/ej2-inputs';import { createCheckBox } from '@syncfusion/ej2-buttons';import { NotifyPropertyChanges, INotifyPropertyChanged, Property, Event, EmitType } from '@syncfusion/ej2-base';import { Component, EventHandler, attributes, formatUnit, ChildProperty, remove, L10n, extend } from '@syncfusion/ej2-base';import { addClass, removeClass, detach, prepend, Complex, closest, setValue, getValue, compile, append } from '@syncfusion/ej2-base';import { select, selectAll, isNullOrUndefined as isNOU, matches, Browser, KeyboardEvents, KeyboardEventArgs } from '@syncfusion/ej2-base';import { DataManager, Query, DataUtil } from '@syncfusion/ej2-data';import { Popup } from '@syncfusion/ej2-popups';import { TreeView, NodeSelectEventArgs, DataBoundEventArgs, FieldsSettingsModel, NodeClickEventArgs } from '@syncfusion/ej2-navigations';import { NodeCheckEventArgs, FailureEventArgs} from '@syncfusion/ej2-navigations';
|
|
1
|
+
import { Input, InputObject, FloatLabelType, TextBox, InputEventArgs } from '@syncfusion/ej2-inputs';import { createCheckBox } from '@syncfusion/ej2-buttons';import { NotifyPropertyChanges, INotifyPropertyChanged, Property, Event, EmitType } from '@syncfusion/ej2-base';import { Component, EventHandler, attributes, formatUnit, ChildProperty, remove, L10n, extend } from '@syncfusion/ej2-base';import { addClass, removeClass, detach, prepend, Complex, closest, setValue, getValue, compile, append } from '@syncfusion/ej2-base';import { select, selectAll, isNullOrUndefined as isNOU, matches, Browser, KeyboardEvents, KeyboardEventArgs } from '@syncfusion/ej2-base';import { DataManager, Query, DataUtil } from '@syncfusion/ej2-data';import { Popup } from '@syncfusion/ej2-popups';import { TreeView, NodeSelectEventArgs, DataBoundEventArgs, FieldsSettingsModel, NodeClickEventArgs, NodeExpandEventArgs } from '@syncfusion/ej2-navigations';import { NodeCheckEventArgs, FailureEventArgs} from '@syncfusion/ej2-navigations';
|
|
2
2
|
import {Mode,ExpandOn,TreeFilterType,SortOrder,DdtBeforeOpenEventArgs,DdtChangeEventArgs,DdtPopupEventArgs,DdtDataBoundEventArgs,DdtFilteringEventArgs,DdtFocusEventArgs,DdtKeyPressEventArgs,DdtSelectEventArgs} from "./drop-down-tree";
|
|
3
3
|
import {ComponentModel} from '@syncfusion/ej2-base';
|
|
4
4
|
|
|
@@ -58,6 +58,12 @@ export interface FieldsModel {
|
|
|
58
58
|
*/
|
|
59
59
|
query?: Query;
|
|
60
60
|
|
|
61
|
+
/**
|
|
62
|
+
* Specifies whether the node can be selected by users or not
|
|
63
|
+
* When set to false, the user interaction is prevented for the corresponding node.
|
|
64
|
+
*/
|
|
65
|
+
selectable?: string;
|
|
66
|
+
|
|
61
67
|
/**
|
|
62
68
|
* Specifies the mapping field for the selected state of the Dropdown Tree item.
|
|
63
69
|
*/
|
|
@@ -199,7 +205,7 @@ export interface DropDownTreeModel extends ComponentModel{
|
|
|
199
205
|
*
|
|
200
206
|
* @default {value: 'value', text: 'text', dataSource: [], child: 'child', parentValue: 'parentValue', hasChildren: 'hasChildren',
|
|
201
207
|
* expanded: 'expanded', htmlAttributes: 'htmlAttributes', iconCss: 'iconCss', imageUrl: 'imageUrl',
|
|
202
|
-
* query: null, selected: 'selected', tableName: null, tooltip: 'tooltip'}
|
|
208
|
+
* query: null, selected: 'selected', selectable: 'selectable', tableName: null, tooltip: 'tooltip' }
|
|
203
209
|
*/
|
|
204
210
|
fields?: FieldsModel;
|
|
205
211
|
|
|
@@ -370,6 +376,14 @@ export interface DropDownTreeModel extends ComponentModel{
|
|
|
370
376
|
*/
|
|
371
377
|
showCheckBox?: boolean;
|
|
372
378
|
|
|
379
|
+
/**
|
|
380
|
+
* Specifies whether to allow rendering of untrusted HTML values in the Dropdown Tree component.
|
|
381
|
+
* While enable this property, it sanitize suspected untrusted strings and script, and update in the Dropdown Tree component.
|
|
382
|
+
*
|
|
383
|
+
* @default false
|
|
384
|
+
*/
|
|
385
|
+
enableHtmlSanitizer?: boolean;
|
|
386
|
+
|
|
373
387
|
/**
|
|
374
388
|
* Specifies whether to show or hide the clear icon in textbox.
|
|
375
389
|
* When the clear button is clicked, `value`, `text` properties will be reset to null.
|
|
@@ -50,6 +50,11 @@ export declare class Fields extends ChildProperty<Fields> {
|
|
|
50
50
|
* @default null
|
|
51
51
|
*/
|
|
52
52
|
query: Query;
|
|
53
|
+
/**
|
|
54
|
+
* Specifies whether the node can be selected by users or not
|
|
55
|
+
* When set to false, the user interaction is prevented for the corresponding node.
|
|
56
|
+
*/
|
|
57
|
+
selectable: string;
|
|
53
58
|
/**
|
|
54
59
|
* Specifies the mapping field for the selected state of the Dropdown Tree item.
|
|
55
60
|
*/
|
|
@@ -283,6 +288,7 @@ export declare class DropDownTree extends Component<HTMLElement> implements INot
|
|
|
283
288
|
private nestedTableUpdate;
|
|
284
289
|
private clearIconWidth;
|
|
285
290
|
private isClicked;
|
|
291
|
+
private isCheckAllCalled;
|
|
286
292
|
/**
|
|
287
293
|
* Specifies the template that renders to the popup list content of the
|
|
288
294
|
* Dropdown Tree component when the data fetch request from the remote server fails.
|
|
@@ -345,7 +351,7 @@ export declare class DropDownTree extends Component<HTMLElement> implements INot
|
|
|
345
351
|
*
|
|
346
352
|
* @default {value: 'value', text: 'text', dataSource: [], child: 'child', parentValue: 'parentValue', hasChildren: 'hasChildren',
|
|
347
353
|
* expanded: 'expanded', htmlAttributes: 'htmlAttributes', iconCss: 'iconCss', imageUrl: 'imageUrl',
|
|
348
|
-
* query: null, selected: 'selected', tableName: null, tooltip: 'tooltip'}
|
|
354
|
+
* query: null, selected: 'selected', selectable: 'selectable', tableName: null, tooltip: 'tooltip' }
|
|
349
355
|
*/
|
|
350
356
|
fields: FieldsModel;
|
|
351
357
|
/**
|
|
@@ -499,6 +505,13 @@ export declare class DropDownTree extends Component<HTMLElement> implements INot
|
|
|
499
505
|
* @default false
|
|
500
506
|
*/
|
|
501
507
|
showCheckBox: boolean;
|
|
508
|
+
/**
|
|
509
|
+
* Specifies whether to allow rendering of untrusted HTML values in the Dropdown Tree component.
|
|
510
|
+
* While enable this property, it sanitize suspected untrusted strings and script, and update in the Dropdown Tree component.
|
|
511
|
+
*
|
|
512
|
+
* @default false
|
|
513
|
+
*/
|
|
514
|
+
enableHtmlSanitizer: boolean;
|
|
502
515
|
/**
|
|
503
516
|
* Specifies whether to show or hide the clear icon in textbox.
|
|
504
517
|
* When the clear button is clicked, `value`, `text` properties will be reset to null.
|
|
@@ -750,6 +763,7 @@ export declare class DropDownTree extends Component<HTMLElement> implements INot
|
|
|
750
763
|
private onNodeClicked;
|
|
751
764
|
private onNodeChecked;
|
|
752
765
|
private beforeCheck;
|
|
766
|
+
private onNodeExpanded;
|
|
753
767
|
private updateClearButton;
|
|
754
768
|
private updateDropDownIconState;
|
|
755
769
|
private updateMode;
|
|
@@ -107,6 +107,9 @@ var Fields = /** @class */ (function (_super) {
|
|
|
107
107
|
__decorate([
|
|
108
108
|
Property(null)
|
|
109
109
|
], Fields.prototype, "query", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
Property('selectable')
|
|
112
|
+
], Fields.prototype, "selectable", void 0);
|
|
110
113
|
__decorate([
|
|
111
114
|
Property('selected')
|
|
112
115
|
], Fields.prototype, "selected", void 0);
|
|
@@ -165,6 +168,8 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
165
168
|
_this.selectedData = [];
|
|
166
169
|
_this.filterDelayTime = 300;
|
|
167
170
|
_this.isClicked = false;
|
|
171
|
+
// Specifies if the checkAll method has been called
|
|
172
|
+
_this.isCheckAllCalled = false;
|
|
168
173
|
return _this;
|
|
169
174
|
}
|
|
170
175
|
/**
|
|
@@ -293,7 +298,7 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
293
298
|
this.updateDataAttribute();
|
|
294
299
|
this.setHTMLAttributes();
|
|
295
300
|
this.setAttributes();
|
|
296
|
-
this.popupDiv = this.createElement('div', { className: CONTENT
|
|
301
|
+
this.popupDiv = this.createElement('div', { className: CONTENT });
|
|
297
302
|
this.popupDiv.classList.add(DROPDOWN);
|
|
298
303
|
this.tree = this.createElement('div', { id: this.element.id + '_tree' });
|
|
299
304
|
this.popupDiv.appendChild(this.tree);
|
|
@@ -918,7 +923,12 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
918
923
|
temp = this.getOverflowVal(index);
|
|
919
924
|
data += temp;
|
|
920
925
|
temp = this.overFlowWrapper.innerHTML;
|
|
921
|
-
this.
|
|
926
|
+
if (this.enableHtmlSanitizer) {
|
|
927
|
+
this.overFlowWrapper.innerText = data;
|
|
928
|
+
}
|
|
929
|
+
else {
|
|
930
|
+
this.overFlowWrapper.innerHTML = data;
|
|
931
|
+
}
|
|
922
932
|
wrapperleng = this.overFlowWrapper.offsetWidth;
|
|
923
933
|
overAllContainer = this.inputWrapper.offsetWidth;
|
|
924
934
|
if ((wrapperleng + downIconWidth + this.clearIconWidth) > overAllContainer) {
|
|
@@ -1088,7 +1098,7 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
1088
1098
|
if (isValid && this.value !== null && (this.value && this.value.length !== 0)) {
|
|
1089
1099
|
addClass([this.inputEle], CHIP_INPUT);
|
|
1090
1100
|
}
|
|
1091
|
-
else if (this.value === null || (this.value && this.value.length === 0)) {
|
|
1101
|
+
else if (this.value === null || (this.value && this.value.length === 0) || this.chipWrapper) {
|
|
1092
1102
|
addClass([this.chipWrapper], HIDEICON);
|
|
1093
1103
|
}
|
|
1094
1104
|
}
|
|
@@ -1143,6 +1153,7 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
1143
1153
|
frameSpan.classList.add(CHECK);
|
|
1144
1154
|
ariaState = 'true';
|
|
1145
1155
|
if (!this.isReverseUpdate) {
|
|
1156
|
+
this.isCheckAllCalled = true;
|
|
1146
1157
|
this.treeObj.checkAll();
|
|
1147
1158
|
if (!this.changeOnBlur) {
|
|
1148
1159
|
this.triggerChangeEvent(e);
|
|
@@ -1446,10 +1457,12 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
1446
1457
|
nodeSelected: this.onNodeSelected.bind(this),
|
|
1447
1458
|
nodeChecked: this.onNodeChecked.bind(this),
|
|
1448
1459
|
nodeChecking: this.beforeCheck.bind(this),
|
|
1460
|
+
nodeExpanded: this.onNodeExpanded.bind(this),
|
|
1449
1461
|
actionFailure: this.onActionFailure.bind(this),
|
|
1450
1462
|
nodeClicked: this.onNodeClicked.bind(this),
|
|
1451
1463
|
dataBound: this.OnDataBound.bind(this),
|
|
1452
1464
|
allowMultiSelection: this.allowMultiSelection,
|
|
1465
|
+
enableHtmlSanitizer: this.enableHtmlSanitizer,
|
|
1453
1466
|
showCheckBox: this.showCheckBox,
|
|
1454
1467
|
autoCheck: this.treeSettings.autoCheck,
|
|
1455
1468
|
sortOrder: this.sortOrder,
|
|
@@ -1552,7 +1565,7 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
1552
1565
|
var height = Math.round(this.header.getBoundingClientRect().height);
|
|
1553
1566
|
popupHeight = formatUnit(parseInt(popupHeight, 10) - height + 'px');
|
|
1554
1567
|
}
|
|
1555
|
-
if (this.showCheckBox && this.showSelectAll) {
|
|
1568
|
+
if (this.showCheckBox && this.showSelectAll && (!this.popupDiv.classList.contains(NODATA))) {
|
|
1556
1569
|
var height = Math.round(this.checkAllParent.getBoundingClientRect().height);
|
|
1557
1570
|
popupHeight = formatUnit(parseInt(popupHeight, 10) - height + 'px');
|
|
1558
1571
|
}
|
|
@@ -1635,14 +1648,14 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
1635
1648
|
var isFooter = closest(target, '.' + FOOTER);
|
|
1636
1649
|
var isScroller = target.classList.contains(DROPDOWN) ? true :
|
|
1637
1650
|
(matches(target, '.e-ddt .e-popup') || matches(target, '.e-ddt .e-treeview'));
|
|
1638
|
-
if ((this.isPopupOpen && (this.inputWrapper.contains(target) || isTree ||
|
|
1651
|
+
if ((this.isPopupOpen && (this.inputWrapper.contains(target) || isTree || isScroller || isHeader || isFooter)) ||
|
|
1639
1652
|
((this.allowMultiSelection || this.showCheckBox) && (this.isPopupOpen && target.classList.contains(CHIP_CLOSE) ||
|
|
1640
1653
|
(this.isPopupOpen && (target.classList.contains(CHECKALLPARENT) || target.classList.contains(ALLTEXT)
|
|
1641
1654
|
|| target.classList.contains(CHECKBOXFRAME)))))) {
|
|
1642
1655
|
this.isDocumentClick = false;
|
|
1643
1656
|
e.preventDefault();
|
|
1644
1657
|
}
|
|
1645
|
-
else if (!this.inputWrapper.contains(target) && this.inputFocus) {
|
|
1658
|
+
else if (!this.inputWrapper.contains(target) && this.inputFocus && !isFilter) {
|
|
1646
1659
|
this.focusOut(e);
|
|
1647
1660
|
}
|
|
1648
1661
|
};
|
|
@@ -1675,6 +1688,9 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
1675
1688
|
}
|
|
1676
1689
|
var eventArgs = { data: args.data };
|
|
1677
1690
|
this.trigger('dataBound', eventArgs);
|
|
1691
|
+
if (this.filterObj === null) {
|
|
1692
|
+
this.isFilteredData = false;
|
|
1693
|
+
}
|
|
1678
1694
|
if (this.isFilteredData) {
|
|
1679
1695
|
this.treeObj.expandAll();
|
|
1680
1696
|
}
|
|
@@ -1742,7 +1758,7 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
1742
1758
|
dataSource: fields.dataSource, value: fields.value, text: fields.text, parentValue: fields.parentValue,
|
|
1743
1759
|
child: this.cloneChildField(fields.child), hasChildren: fields.hasChildren, expanded: fields.expanded,
|
|
1744
1760
|
iconCss: fields.iconCss, imageUrl: fields.imageUrl, htmlAttributes: fields.htmlAttributes, query: fields.query,
|
|
1745
|
-
selected: fields.selected, tableName: fields.tableName, tooltip: fields.tooltip
|
|
1761
|
+
selected: fields.selected, selectable: fields.selectable, tableName: fields.tableName, tooltip: fields.tooltip
|
|
1746
1762
|
};
|
|
1747
1763
|
return clonedField;
|
|
1748
1764
|
};
|
|
@@ -1755,7 +1771,7 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
1755
1771
|
dataSource: fields.dataSource, value: fields.value, text: fields.text, parentValue: fields.parentValue,
|
|
1756
1772
|
child: (fields.child ? this.cloneChildField(fields.child) : null), hasChildren: fields.hasChildren,
|
|
1757
1773
|
expanded: fields.expanded, iconCss: fields.iconCss, imageUrl: fields.imageUrl, htmlAttributes: fields.htmlAttributes,
|
|
1758
|
-
query: fields.query, selected: fields.selected, tableName: fields.tableName, tooltip: fields.tooltip
|
|
1774
|
+
query: fields.query, selected: fields.selected, selectable: fields.selectable, tableName: fields.tableName, tooltip: fields.tooltip
|
|
1759
1775
|
};
|
|
1760
1776
|
return clonedField;
|
|
1761
1777
|
}
|
|
@@ -1765,7 +1781,7 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
1765
1781
|
dataSource: fields.dataSource, id: fields.value, text: fields.text, parentID: fields.parentValue,
|
|
1766
1782
|
child: this.getTreeChildren(fields.child), hasChildren: fields.hasChildren, expanded: fields.expanded,
|
|
1767
1783
|
iconCss: fields.iconCss, imageUrl: fields.imageUrl, isChecked: fields.selected,
|
|
1768
|
-
htmlAttributes: fields.htmlAttributes, query: fields.query, selected: fields.selected,
|
|
1784
|
+
htmlAttributes: fields.htmlAttributes, query: fields.query, selectable: fields.selectable, selected: fields.selected,
|
|
1769
1785
|
tableName: fields.tableName, tooltip: fields.tooltip
|
|
1770
1786
|
};
|
|
1771
1787
|
return treeFields;
|
|
@@ -1803,7 +1819,8 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
1803
1819
|
}
|
|
1804
1820
|
return 2;
|
|
1805
1821
|
}
|
|
1806
|
-
|
|
1822
|
+
if (isNOU(this.fields.dataSource))
|
|
1823
|
+
this.fields.dataSource = [];
|
|
1807
1824
|
for (var i = 0, len = this.fields.dataSource.length; i < len; i++) {
|
|
1808
1825
|
if ((typeof field.child === 'string') && !isNOU(getValue(field.child, this.fields.dataSource[i]))) {
|
|
1809
1826
|
return 2;
|
|
@@ -1942,13 +1959,14 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
1942
1959
|
var nodes = this.treeObj.element.querySelectorAll('li');
|
|
1943
1960
|
var checkedNodes = this.treeObj.element.querySelectorAll('li .e-checkbox-wrapper[aria-checked=true]');
|
|
1944
1961
|
var wrap = closest(this.checkBoxElement, '.' + CHECKBOXWRAP);
|
|
1945
|
-
if (wrap && args.action === 'uncheck') {
|
|
1962
|
+
if (wrap && args.action === 'uncheck' && (args.isInteracted || checkedNodes.length === 0)) {
|
|
1946
1963
|
this.isReverseUpdate = true;
|
|
1947
1964
|
this.changeState(wrap, 'uncheck');
|
|
1948
1965
|
this.isReverseUpdate = false;
|
|
1949
1966
|
}
|
|
1950
|
-
else if (wrap && args.action === 'check' && checkedNodes.length === nodes.length) {
|
|
1967
|
+
else if (wrap && args.action === 'check' && checkedNodes.length === nodes.length && this.isCheckAllCalled) {
|
|
1951
1968
|
this.isReverseUpdate = true;
|
|
1969
|
+
this.isCheckAllCalled = false;
|
|
1952
1970
|
this.changeState(wrap, 'check');
|
|
1953
1971
|
this.isReverseUpdate = false;
|
|
1954
1972
|
}
|
|
@@ -1959,6 +1977,13 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
1959
1977
|
this.oldValue = this.value ? this.value.slice() : this.value;
|
|
1960
1978
|
}
|
|
1961
1979
|
};
|
|
1980
|
+
DropDownTree.prototype.onNodeExpanded = function (args) {
|
|
1981
|
+
if (this.hasTemplate && this.portals) {
|
|
1982
|
+
this.portals = [].concat(this.treeObj.portals);
|
|
1983
|
+
/* eslint-enable */
|
|
1984
|
+
this.renderReactTemplates();
|
|
1985
|
+
}
|
|
1986
|
+
};
|
|
1962
1987
|
DropDownTree.prototype.updateClearButton = function (state) {
|
|
1963
1988
|
if (state) {
|
|
1964
1989
|
if (!this.inputWrapper.contains(this.overAllClear)) {
|
|
@@ -2259,7 +2284,12 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
2259
2284
|
});
|
|
2260
2285
|
var chipContent = this.createElement('span', { className: CHIP_CONTENT });
|
|
2261
2286
|
var chipClose = this.createElement('span', { className: CHIP_CLOSE + ' ' + ICONS });
|
|
2262
|
-
|
|
2287
|
+
if (this.enableHtmlSanitizer) {
|
|
2288
|
+
chipContent.innerText = text;
|
|
2289
|
+
}
|
|
2290
|
+
else {
|
|
2291
|
+
chipContent.innerHTML = text;
|
|
2292
|
+
}
|
|
2263
2293
|
chip.appendChild(chipContent);
|
|
2264
2294
|
this.chipCollection.appendChild(chip);
|
|
2265
2295
|
if (this.showClearButton) {
|
|
@@ -2456,6 +2486,7 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
2456
2486
|
DropDownTree.prototype.selectAllItems = function (state) {
|
|
2457
2487
|
if (this.showCheckBox) {
|
|
2458
2488
|
if (state) {
|
|
2489
|
+
this.isCheckAllCalled = true;
|
|
2459
2490
|
this.treeObj.checkAll();
|
|
2460
2491
|
}
|
|
2461
2492
|
else {
|
|
@@ -2550,8 +2581,6 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
2550
2581
|
}
|
|
2551
2582
|
else {
|
|
2552
2583
|
this.noRecord = this.createElement('div');
|
|
2553
|
-
addClass([this.noRecord], NODATACONTAINER);
|
|
2554
|
-
prepend([this.noRecord], this.popupDiv);
|
|
2555
2584
|
}
|
|
2556
2585
|
if (this.noRecordsTemplate !== 'No Records Found' || this.actionFailureTemplate !== 'The Request Failed') {
|
|
2557
2586
|
var template = actionFailure ? this.actionFailureTemplate : this.noRecordsTemplate;
|
|
@@ -2563,6 +2592,8 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
2563
2592
|
if (tempArr) {
|
|
2564
2593
|
tempArr = Array.prototype.slice.call(tempArr);
|
|
2565
2594
|
append(tempArr, this.noRecord);
|
|
2595
|
+
addClass([this.noRecord], NODATACONTAINER);
|
|
2596
|
+
prepend([this.noRecord], this.popupDiv);
|
|
2566
2597
|
}
|
|
2567
2598
|
}
|
|
2568
2599
|
else {
|
|
@@ -2571,6 +2602,8 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
2571
2602
|
this.l10n = new L10n(this.getLocaleName(), l10nLocale, this.locale);
|
|
2572
2603
|
this.noRecord.innerHTML = actionFailure ?
|
|
2573
2604
|
this.l10n.getConstant('actionFailureTemplate') : this.l10n.getConstant('noRecordsTemplate');
|
|
2605
|
+
addClass([this.noRecord], NODATACONTAINER);
|
|
2606
|
+
prepend([this.noRecord], this.popupDiv);
|
|
2574
2607
|
}
|
|
2575
2608
|
};
|
|
2576
2609
|
DropDownTree.prototype.updateRecordTemplate = function (action) {
|
|
@@ -3082,6 +3115,9 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
3082
3115
|
__decorate([
|
|
3083
3116
|
Property(false)
|
|
3084
3117
|
], DropDownTree.prototype, "showCheckBox", void 0);
|
|
3118
|
+
__decorate([
|
|
3119
|
+
Property(false)
|
|
3120
|
+
], DropDownTree.prototype, "enableHtmlSanitizer", void 0);
|
|
3085
3121
|
__decorate([
|
|
3086
3122
|
Property(true)
|
|
3087
3123
|
], DropDownTree.prototype, "showClearButton", void 0);
|
package/src/index.d.ts
CHANGED
package/src/index.js
CHANGED
|
@@ -93,6 +93,24 @@ export interface ListBoxModel extends DropDownBaseModel{
|
|
|
93
93
|
*/
|
|
94
94
|
height?: number | string;
|
|
95
95
|
|
|
96
|
+
/**
|
|
97
|
+
* Specifies a value that indicates whether the component is enabled or not.
|
|
98
|
+
*
|
|
99
|
+
* @default true
|
|
100
|
+
* @deprecated
|
|
101
|
+
*/
|
|
102
|
+
enabled?: boolean;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Enable or disable persisting component's state between page reloads.
|
|
106
|
+
* If enabled, following list of states will be persisted.
|
|
107
|
+
* 1. value
|
|
108
|
+
*
|
|
109
|
+
* @default false
|
|
110
|
+
* @deprecated
|
|
111
|
+
*/
|
|
112
|
+
enablePersistence?: boolean;
|
|
113
|
+
|
|
96
114
|
/**
|
|
97
115
|
* If 'allowDragAndDrop' is set to true, then you can perform drag and drop of the list item.
|
|
98
116
|
* ListBox contains same 'scope' property enables drag and drop between multiple ListBox.
|
|
@@ -141,6 +141,22 @@ export declare class ListBox extends DropDownBase {
|
|
|
141
141
|
* @default ''
|
|
142
142
|
*/
|
|
143
143
|
height: number | string;
|
|
144
|
+
/**
|
|
145
|
+
* Specifies a value that indicates whether the component is enabled or not.
|
|
146
|
+
*
|
|
147
|
+
* @default true
|
|
148
|
+
* @deprecated
|
|
149
|
+
*/
|
|
150
|
+
enabled: boolean;
|
|
151
|
+
/**
|
|
152
|
+
* Enable or disable persisting component's state between page reloads.
|
|
153
|
+
* If enabled, following list of states will be persisted.
|
|
154
|
+
* 1. value
|
|
155
|
+
*
|
|
156
|
+
* @default false
|
|
157
|
+
* @deprecated
|
|
158
|
+
*/
|
|
159
|
+
enablePersistence: boolean;
|
|
144
160
|
/**
|
|
145
161
|
* If 'allowDragAndDrop' is set to true, then you can perform drag and drop of the list item.
|
|
146
162
|
* ListBox contains same 'scope' property enables drag and drop between multiple ListBox.
|
|
@@ -342,6 +358,12 @@ export declare class ListBox extends DropDownBase {
|
|
|
342
358
|
private removeSelected;
|
|
343
359
|
private getCurIdx;
|
|
344
360
|
private getComponent;
|
|
361
|
+
/**
|
|
362
|
+
* Sets the enabled state to DropDownBase.
|
|
363
|
+
*
|
|
364
|
+
* @returns {void}
|
|
365
|
+
*/
|
|
366
|
+
protected setEnabled(): void;
|
|
345
367
|
protected listOption(dataSource: obj[] | string[] | number[] | boolean[], fields: FieldSettingsModel): FieldSettingsModel;
|
|
346
368
|
private triggerBeforeItemRender;
|
|
347
369
|
requiredModules(): ModuleDeclaration[];
|
package/src/list-box/list-box.js
CHANGED
|
@@ -130,6 +130,7 @@ var ListBox = /** @class */ (function (_super) {
|
|
|
130
130
|
this.isCustomFiltering = false;
|
|
131
131
|
this.initialSelectedOptions = this.value;
|
|
132
132
|
_super.prototype.render.call(this);
|
|
133
|
+
this.setEnabled();
|
|
133
134
|
this.renderComplete();
|
|
134
135
|
};
|
|
135
136
|
ListBox.prototype.initWrapper = function () {
|
|
@@ -164,7 +165,7 @@ var ListBox = /** @class */ (function (_super) {
|
|
|
164
165
|
removeClass([this.list], [dropDownBaseClasses.content, dropDownBaseClasses.root]);
|
|
165
166
|
this.validationAttribute(this.element, hiddenSelect);
|
|
166
167
|
this.list.setAttribute('role', 'listbox');
|
|
167
|
-
attributes(this.list, { 'role': 'listbox', 'aria-multiselectable': this.selectionSettings.mode === 'Multiple' ? 'true' : 'false' });
|
|
168
|
+
attributes(this.list, { 'role': 'listbox', 'aria-label': 'listbox', 'aria-multiselectable': this.selectionSettings.mode === 'Multiple' ? 'true' : 'false' });
|
|
168
169
|
this.updateSelectionSettings();
|
|
169
170
|
};
|
|
170
171
|
ListBox.prototype.updateSelectionSettings = function () {
|
|
@@ -427,10 +428,10 @@ var ListBox = /** @class */ (function (_super) {
|
|
|
427
428
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
428
429
|
var event = args.event;
|
|
429
430
|
var wrapper;
|
|
430
|
-
if (args.target && (args.target.classList.contains(
|
|
431
|
-
|| args.target.classList.contains(
|
|
432
|
-
if (args.target.classList.contains(
|
|
433
|
-
|| args.target.classList.contains(
|
|
431
|
+
if (args.target && (args.target.classList.contains('e-listbox-wrapper') || args.target.classList.contains('e-list-item')
|
|
432
|
+
|| args.target.classList.contains('e-filter-parent') || args.target.classList.contains('e-input-group'))) {
|
|
433
|
+
if (args.target.classList.contains('e-list-item') || args.target.classList.contains('e-filter-parent')
|
|
434
|
+
|| args.target.classList.contains('e-input-group')) {
|
|
434
435
|
wrapper = args.target.closest('.e-listbox-wrapper');
|
|
435
436
|
}
|
|
436
437
|
else {
|
|
@@ -485,7 +486,8 @@ var ListBox = /** @class */ (function (_super) {
|
|
|
485
486
|
var getArgs = this.getDragArgs({ target: args.droppedElement }, true);
|
|
486
487
|
var sourceArgs = { previousData: this.dataSource };
|
|
487
488
|
var destArgs = { previousData: listObj.dataSource };
|
|
488
|
-
var dragArgs = extend({}, getArgs, { target: args.target, source: { previousData: this.dataSource },
|
|
489
|
+
var dragArgs = extend({}, getArgs, { target: args.target, source: { previousData: this.dataSource },
|
|
490
|
+
previousIndex: args.previousIndex, currentIndex: args.currentIndex });
|
|
489
491
|
if (listObj !== this) {
|
|
490
492
|
var sourceArgs1 = extend(sourceArgs, { currentData: this.listData });
|
|
491
493
|
dragArgs = extend(dragArgs, { source: sourceArgs1, destination: destArgs });
|
|
@@ -560,10 +562,10 @@ var ListBox = /** @class */ (function (_super) {
|
|
|
560
562
|
sortedData.splice(destIdx, 0, droppedData);
|
|
561
563
|
liColl.splice(destIdx, 0, fLiColl_1.splice(srcIdx, 1)[0]);
|
|
562
564
|
if (!value) {
|
|
563
|
-
var
|
|
564
|
-
for (var i = 0; i <
|
|
565
|
-
if (
|
|
566
|
-
li_1 =
|
|
565
|
+
var liCollElem_1 = _this.getItems();
|
|
566
|
+
for (var i = 0; i < liCollElem_1.length; i++) {
|
|
567
|
+
if (liCollElem_1[i].getAttribute('data-value') === null && liCollElem_1[i].classList.contains('e-list-item')) {
|
|
568
|
+
li_1 = liCollElem_1[i];
|
|
567
569
|
break;
|
|
568
570
|
}
|
|
569
571
|
}
|
|
@@ -613,10 +615,17 @@ var ListBox = /** @class */ (function (_super) {
|
|
|
613
615
|
dragArgs = extend(dragArgs, { destination: dragArgs1 });
|
|
614
616
|
}
|
|
615
617
|
this.trigger('drop', dragArgs);
|
|
618
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
619
|
+
var liCollElem = dragArgs.elements;
|
|
620
|
+
if (liCollElem.length) {
|
|
621
|
+
for (var i = 0; i < liCollElem.length; i++) {
|
|
622
|
+
liCollElem[i].classList.remove('e-grabbed');
|
|
623
|
+
}
|
|
624
|
+
}
|
|
616
625
|
};
|
|
617
626
|
ListBox.prototype.updateListItems = function (sourceElem, destElem) {
|
|
618
627
|
var i = 0;
|
|
619
|
-
destElem.innerHTML =
|
|
628
|
+
destElem.innerHTML = '';
|
|
620
629
|
while (i < sourceElem.childNodes.length) {
|
|
621
630
|
destElem.appendChild(sourceElem.childNodes[i]);
|
|
622
631
|
}
|
|
@@ -645,6 +654,14 @@ var ListBox = /** @class */ (function (_super) {
|
|
|
645
654
|
}
|
|
646
655
|
return listObj;
|
|
647
656
|
};
|
|
657
|
+
/**
|
|
658
|
+
* Sets the enabled state to DropDownBase.
|
|
659
|
+
*
|
|
660
|
+
* @returns {void}
|
|
661
|
+
*/
|
|
662
|
+
ListBox.prototype.setEnabled = function () {
|
|
663
|
+
this.element.setAttribute('aria-disabled', (this.enabled) ? 'false' : 'true');
|
|
664
|
+
};
|
|
648
665
|
ListBox.prototype.listOption = function (dataSource, fields) {
|
|
649
666
|
this.listCurrentOptions = _super.prototype.listOption.call(this, dataSource, fields);
|
|
650
667
|
this.listCurrentOptions = extend({}, this.listCurrentOptions, { itemCreated: this.triggerBeforeItemRender.bind(this) }, true);
|
|
@@ -805,7 +822,7 @@ var ListBox = /** @class */ (function (_super) {
|
|
|
805
822
|
if (this.listData.length === 0) {
|
|
806
823
|
this.l10nUpdate();
|
|
807
824
|
}
|
|
808
|
-
this.value =
|
|
825
|
+
this.value = [];
|
|
809
826
|
this.updateToolBarState();
|
|
810
827
|
};
|
|
811
828
|
/**
|
|
@@ -1094,9 +1111,7 @@ var ListBox = /** @class */ (function (_super) {
|
|
|
1094
1111
|
prepend([this.filterParent], this.list);
|
|
1095
1112
|
attributes(this.filterInput, {
|
|
1096
1113
|
'aria-disabled': 'false',
|
|
1097
|
-
'aria-
|
|
1098
|
-
'role': 'listbox',
|
|
1099
|
-
'aria-activedescendant': null,
|
|
1114
|
+
'aria-label': 'search list item',
|
|
1100
1115
|
'autocomplete': 'off',
|
|
1101
1116
|
'autocorrect': 'off',
|
|
1102
1117
|
'autocapitalize': 'off',
|
|
@@ -1133,12 +1148,12 @@ var ListBox = /** @class */ (function (_super) {
|
|
|
1133
1148
|
if (li && li.parentElement) {
|
|
1134
1149
|
currSelIdx = [].slice.call(li.parentElement.children).indexOf(li);
|
|
1135
1150
|
if (!this.selectionSettings.showCheckbox) {
|
|
1136
|
-
if ((e.ctrlKey || Browser.isDevice) && this.isSelected(li)) {
|
|
1151
|
+
if ((e.ctrlKey || e.metaKey || Browser.isDevice) && this.isSelected(li)) {
|
|
1137
1152
|
li.classList.remove(cssClass.selected);
|
|
1138
1153
|
li.removeAttribute('aria-selected');
|
|
1139
1154
|
isSelect = false;
|
|
1140
1155
|
}
|
|
1141
|
-
else if (!(this.selectionSettings.mode === 'Multiple' && (e.ctrlKey || Browser.isDevice))) {
|
|
1156
|
+
else if (!(this.selectionSettings.mode === 'Multiple' && (e.ctrlKey || e.metaKey || Browser.isDevice))) {
|
|
1142
1157
|
this.getSelectedItems().forEach(function (ele) {
|
|
1143
1158
|
ele.removeAttribute('aria-selected');
|
|
1144
1159
|
});
|
|
@@ -1498,7 +1513,7 @@ var ListBox = /** @class */ (function (_super) {
|
|
|
1498
1513
|
var isRefresh = tListBox.sortOrder !== 'None' || (tListBox.selectionSettings.showCheckbox !==
|
|
1499
1514
|
fListBox.selectionSettings.showCheckbox) || tListBox.fields.groupBy || tListBox.itemTemplate || fListBox.itemTemplate;
|
|
1500
1515
|
this.removeSelected(fListBox, fListBox.getSelectedItems());
|
|
1501
|
-
var tempItems = [].slice.call(fListBox.
|
|
1516
|
+
var tempItems = [].slice.call(fListBox.listData);
|
|
1502
1517
|
var localDataArgs = { cancel: false, items: tempItems, eventName: this.toolbarAction };
|
|
1503
1518
|
fListBox.trigger('actionBegin', localDataArgs);
|
|
1504
1519
|
if (localDataArgs.cancel) {
|
|
@@ -1543,9 +1558,27 @@ var ListBox = /** @class */ (function (_super) {
|
|
|
1543
1558
|
fListBox.value = [];
|
|
1544
1559
|
listData = listData
|
|
1545
1560
|
.filter(function (data) { return data.isHeader !== true; });
|
|
1561
|
+
var sortedData = listData.filter(function (val) {
|
|
1562
|
+
return tListBox.jsonData.indexOf(val) === -1;
|
|
1563
|
+
});
|
|
1564
|
+
for (var i = 0; i < sortedData.length; i++) {
|
|
1565
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1566
|
+
tListBox.jsonData.splice(index + i, 0, sortedData[i]);
|
|
1567
|
+
}
|
|
1546
1568
|
tListBox.listData = listData;
|
|
1547
|
-
|
|
1548
|
-
|
|
1569
|
+
if (fListBox.listData.length === fListBox.jsonData.length) {
|
|
1570
|
+
fListBox.listData = fListBox.sortedData = fListBox.jsonData = [];
|
|
1571
|
+
}
|
|
1572
|
+
else if (fListBox.allowFiltering) {
|
|
1573
|
+
for (var i = 0; i < fListBox.listData.length; i++) {
|
|
1574
|
+
for (var j = 0; j < fListBox.jsonData.length; j++) {
|
|
1575
|
+
if (fListBox.listData[i] === fListBox.jsonData[j]) {
|
|
1576
|
+
fListBox.jsonData.splice(j, 1);
|
|
1577
|
+
}
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
fListBox.listData = fListBox.sortedData = [];
|
|
1581
|
+
}
|
|
1549
1582
|
if (isRefresh) {
|
|
1550
1583
|
var sourceElem = tListBox.renderItems(listData, tListBox.fields);
|
|
1551
1584
|
tListBox.updateListItems(sourceElem, tListBox.ulElement);
|
|
@@ -1599,21 +1632,35 @@ var ListBox = /** @class */ (function (_super) {
|
|
|
1599
1632
|
}
|
|
1600
1633
|
return listObj;
|
|
1601
1634
|
};
|
|
1602
|
-
ListBox.prototype.getGrabbedItems = function () {
|
|
1635
|
+
ListBox.prototype.getGrabbedItems = function (args) {
|
|
1636
|
+
var grabbItems = false;
|
|
1603
1637
|
for (var i = 0; i < this.value.length; i++) {
|
|
1604
|
-
if (this.value[i] === this.
|
|
1638
|
+
if (this.value[i] === this.getFormattedValue(args.target.getAttribute('data-value'))) {
|
|
1639
|
+
grabbItems = true;
|
|
1640
|
+
break;
|
|
1641
|
+
}
|
|
1642
|
+
}
|
|
1643
|
+
if (grabbItems) {
|
|
1644
|
+
for (var i = 0; i < this.value.length; i++) {
|
|
1605
1645
|
var liColl = this.list.querySelectorAll('[aria-selected="true"]');
|
|
1606
|
-
for (var
|
|
1607
|
-
liColl[
|
|
1646
|
+
for (var j = 0; j < liColl.length; j++) {
|
|
1647
|
+
if (this.value[i] === this.getFormattedValue(liColl[j].getAttribute('data-value'))) {
|
|
1648
|
+
liColl[j].classList.add('e-grabbed');
|
|
1649
|
+
}
|
|
1608
1650
|
}
|
|
1609
|
-
break;
|
|
1610
1651
|
}
|
|
1611
1652
|
}
|
|
1612
|
-
var elems
|
|
1653
|
+
var elems;
|
|
1654
|
+
if (this.isAngular) {
|
|
1655
|
+
elems = Array.prototype.slice.call(this.element.getElementsByClassName('e-list-parent')[0].querySelectorAll('.e-grabbed'));
|
|
1656
|
+
}
|
|
1657
|
+
else {
|
|
1658
|
+
elems = Array.prototype.slice.call(this.element.nextElementSibling.querySelectorAll('.e-grabbed'));
|
|
1659
|
+
}
|
|
1613
1660
|
return elems;
|
|
1614
1661
|
};
|
|
1615
1662
|
ListBox.prototype.getDragArgs = function (args, isDragEnd) {
|
|
1616
|
-
var elems = this.getGrabbedItems();
|
|
1663
|
+
var elems = this.getGrabbedItems(args);
|
|
1617
1664
|
if (elems.length) {
|
|
1618
1665
|
if (isDragEnd) {
|
|
1619
1666
|
elems.push(args.target);
|
|
@@ -1665,7 +1712,7 @@ var ListBox = /** @class */ (function (_super) {
|
|
|
1665
1712
|
}
|
|
1666
1713
|
}
|
|
1667
1714
|
}
|
|
1668
|
-
else if (e.keyCode !== 37 && e.keyCode !== 39 && e.code !==
|
|
1715
|
+
else if (e.keyCode !== 37 && e.keyCode !== 39 && e.code !== 'KeyA') {
|
|
1669
1716
|
this.upDownKeyHandler(e);
|
|
1670
1717
|
}
|
|
1671
1718
|
}
|
|
@@ -1709,8 +1756,8 @@ var ListBox = /** @class */ (function (_super) {
|
|
|
1709
1756
|
}
|
|
1710
1757
|
if (this.selectionSettings.showCheckbox && e.ctrlKey && e.shiftKey && (e.keyCode === 36 || e.keyCode === 35)) {
|
|
1711
1758
|
var selectedidx = Array.prototype.indexOf.call(ul.children, fli);
|
|
1712
|
-
var sidx = e.code ===
|
|
1713
|
-
var eidx = e.code ===
|
|
1759
|
+
var sidx = e.code === 'Home' ? 0 : selectedidx;
|
|
1760
|
+
var eidx = e.code === 'Home' ? selectedidx : ul.children.length - 1;
|
|
1714
1761
|
for (var i = sidx; i <= eidx; i++) {
|
|
1715
1762
|
var item = ul.children[i];
|
|
1716
1763
|
this.notify('updatelist', { li: item, e: {
|
|
@@ -1868,7 +1915,6 @@ var ListBox = /** @class */ (function (_super) {
|
|
|
1868
1915
|
dvalue_1 = _this.getFormattedValue(li.getAttribute('data-value'));
|
|
1869
1916
|
if (values.indexOf(dvalue_1) < 0) {
|
|
1870
1917
|
li.getElementsByClassName('e-check')[0].classList.remove('e-check');
|
|
1871
|
-
li.getElementsByClassName('e-checkbox-wrapper')[0].removeAttribute('aria-checked');
|
|
1872
1918
|
li.removeAttribute('aria-selected');
|
|
1873
1919
|
}
|
|
1874
1920
|
});
|
|
@@ -1890,6 +1936,9 @@ var ListBox = /** @class */ (function (_super) {
|
|
|
1890
1936
|
else {
|
|
1891
1937
|
text = value;
|
|
1892
1938
|
}
|
|
1939
|
+
if (typeof (text) === 'string') {
|
|
1940
|
+
text = text.split("\\").join("\\\\");
|
|
1941
|
+
}
|
|
1893
1942
|
li = _this.list.querySelector('[data-value="' + text + '"]');
|
|
1894
1943
|
if (li) {
|
|
1895
1944
|
if (_this.selectionSettings.showCheckbox) {
|
|
@@ -2220,6 +2269,12 @@ var ListBox = /** @class */ (function (_super) {
|
|
|
2220
2269
|
__decorate([
|
|
2221
2270
|
Property('')
|
|
2222
2271
|
], ListBox.prototype, "height", void 0);
|
|
2272
|
+
__decorate([
|
|
2273
|
+
Property(true)
|
|
2274
|
+
], ListBox.prototype, "enabled", void 0);
|
|
2275
|
+
__decorate([
|
|
2276
|
+
Property(false)
|
|
2277
|
+
], ListBox.prototype, "enablePersistence", void 0);
|
|
2223
2278
|
__decorate([
|
|
2224
2279
|
Property(false)
|
|
2225
2280
|
], ListBox.prototype, "allowDragAndDrop", void 0);
|