@progress/kendo-angular-dropdowns 6.0.3-dev.202203091003 → 7.0.0-dev.202204191042
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/{dist/es2015/autocomplete → autocomplete}/autocomplete.component.d.ts +47 -35
- package/{dist/es2015/autocomplete → autocomplete}/autocomplete.module.d.ts +7 -0
- package/bundles/kendo-angular-dropdowns.umd.js +5 -0
- package/{dist/es2015/comboboxes → comboboxes}/combobox-column/column-cell-template.directive.d.ts +3 -0
- package/{dist/es2015/comboboxes → comboboxes}/combobox-column/column-header-template.directive.d.ts +3 -0
- package/{dist/es2015/comboboxes → comboboxes}/combobox-column/combobox-column.component.d.ts +3 -0
- package/{dist/es2015/comboboxes → comboboxes}/combobox-column/util.d.ts +0 -0
- package/{dist/es2015/comboboxes → comboboxes}/combobox.component.d.ts +53 -39
- package/comboboxes/combobox.module.d.ts +31 -0
- package/{dist/es2015/comboboxes → comboboxes}/multicolumncombobox.component.d.ts +8 -5
- package/{dist/es2015/common → common}/constants/error-messages.d.ts +27 -27
- package/{dist/es2015/common → common}/constants/touch-enabled.d.ts +0 -0
- package/{dist/es2015/common → common}/data.service.d.ts +6 -2
- package/{dist/es2015/common → common}/disabled-items/disabled-items.service.d.ts +3 -0
- package/{dist/es2015/common → common}/disabled-items/item-disabled.d.ts +0 -0
- package/{dist/es2015/common → common}/filter-input.directive.d.ts +3 -0
- package/{dist/es2015/common → common}/filtering/filter-settings.d.ts +0 -0
- package/{dist/es2015/common → common}/filtering/filter.directive.d.ts +6 -2
- package/{dist/es2015/common → common}/filtering/filterable-component.d.ts +0 -0
- package/{dist/es2015/common → common}/list-item.directive.d.ts +3 -0
- package/{dist/es2015/common → common}/list.component.d.ts +11 -6
- package/{dist/es2015/common → common}/localization/custom-messages.component.d.ts +4 -1
- package/{dist/es2015/common → common}/localization/localized-messages.directive.d.ts +3 -0
- package/{dist/es2015/common → common}/localization/messages.d.ts +3 -0
- package/{dist/es2015/common → common}/models/checkboxes-settings.d.ts +1 -1
- package/{dist/es2015/common → common}/models/direction.d.ts +0 -0
- package/{dist/es2015/common → common}/models/fillmode.d.ts +1 -7
- package/{dist/es2015/common → common}/models/list-type.d.ts +0 -0
- package/{dist/es2015/common → common}/models/page-change-event.d.ts +0 -0
- package/{dist/es2015/common → common}/models/popup-settings.d.ts +0 -0
- package/{dist/es2015/common → common}/models/preventable-event.d.ts +0 -0
- package/{dist/es2015/common → common}/models/remove-tag-event.d.ts +4 -1
- package/{dist/es2015/common → common}/models/rounded.d.ts +1 -8
- package/common/models/size.d.ts +8 -0
- package/{dist/es2015/common → common}/models/virtualization-settings.d.ts +0 -0
- package/{dist/es2015/common → common}/navigation/navigation-action.d.ts +0 -0
- package/{dist/es2015/common → common}/navigation/navigation.service.d.ts +3 -0
- package/{dist/es2015/common → common}/searchbar.component.d.ts +9 -4
- package/{dist/es2015/common → common}/selection/selectable.directive.d.ts +5 -2
- package/{dist/es2015/common → common}/selection/selection.service.d.ts +6 -2
- package/common/shared-directives.module.d.ts +37 -0
- package/common/shared.module.d.ts +26 -0
- package/{dist/es2015/common → common}/taglist.component.d.ts +7 -3
- package/{dist/es2015/common → common}/templates/custom-item-template.directive.d.ts +3 -0
- package/{dist/es2015/common → common}/templates/fixed-group-template.directive.d.ts +3 -0
- package/{dist/es2015/common → common}/templates/footer-template.directive.d.ts +3 -0
- package/{dist/es2015/common → common}/templates/group-tag-template.directive.d.ts +3 -0
- package/{dist/es2015/common → common}/templates/group-template.directive.d.ts +3 -0
- package/{dist/es2015/common → common}/templates/header-template.directive.d.ts +3 -0
- package/{dist/es2015/common → common}/templates/item-template.directive.d.ts +3 -0
- package/{dist/es2015/common → common}/templates/no-data-template.directive.d.ts +3 -0
- package/{dist/es2015/common → common}/templates/tag-template.directive.d.ts +3 -0
- package/{dist/es2015/common → common}/templates/template-context.directive.d.ts +4 -1
- package/{dist/es2015/common → common}/templates/value-template.directive.d.ts +3 -0
- package/{dist/es2015/common → common}/util.d.ts +3 -2
- package/{dist/es2015/dropdownlist → dropdownlist}/dropdownlist.component.d.ts +61 -48
- package/{dist/es2015/dropdownlist → dropdownlist}/dropdownlist.module.d.ts +7 -0
- package/{dist/es2015/dropdowns.module.d.ts → dropdowns.module.d.ts} +9 -0
- package/{dist/es2015/dropdowntrees → dropdowntrees}/checked-state/base-check.directive.d.ts +3 -0
- package/{dist/es2015/dropdowntrees → dropdowntrees}/checked-state/check-all.directive.d.ts +5 -2
- package/{dist/es2015/dropdowntrees → dropdowntrees}/checked-state/check.directive.d.ts +3 -0
- package/{dist/es2015/dropdowntrees → dropdowntrees}/checked-state/checkable-settings.d.ts +0 -0
- package/{dist/es2015/dropdowntrees → dropdowntrees}/checked-state/checked-item.d.ts +0 -0
- package/{dist/es2015/dropdowntrees → dropdowntrees}/data-binding/dropdowntree/flat-binding.directive.d.ts +10 -2
- package/{dist/es2015/dropdowntrees → dropdowntrees}/data-binding/dropdowntree/hierarchy-binding.directive.d.ts +6 -4
- package/{dist/es2015/dropdowntrees → dropdowntrees}/data-binding/multiselecttree/flat-binding.directive.d.ts +10 -2
- package/{dist/es2015/dropdowntrees → dropdowntrees}/data-binding/multiselecttree/hierarchy-binding.directive.d.ts +6 -4
- package/{dist/es2015/dropdowntrees → dropdowntrees}/dropdowntree.component.d.ts +62 -45
- package/dropdowntrees/dropdowntrees.module.d.ts +25 -0
- package/{dist/es2015/dropdowntrees → dropdowntrees}/expanded-state/expand.directive.d.ts +5 -1
- package/{dist/es2015/dropdowntrees → dropdowntrees}/multiselecttree.component.d.ts +70 -52
- package/{dist/es2015/dropdowntrees → dropdowntrees}/summary-tag/summary-tag.directive.d.ts +3 -0
- package/{dist/es2015/dropdowntrees → dropdowntrees}/templates/node-template.directive.d.ts +3 -0
- package/{dist/es2015 → esm2015}/autocomplete/autocomplete.component.js +296 -258
- package/esm2015/autocomplete/autocomplete.module.js +36 -0
- package/{dist/es2015 → esm2015}/comboboxes/combobox-column/column-cell-template.directive.js +12 -11
- package/esm2015/comboboxes/combobox-column/column-header-template.directive.js +26 -0
- package/esm2015/comboboxes/combobox-column/combobox-column.component.js +59 -0
- package/{dist/es2015 → esm2015}/comboboxes/combobox-column/util.js +0 -2
- package/{dist/es2015 → esm2015}/comboboxes/combobox.component.js +321 -281
- package/{dist/es2015 → esm2015}/comboboxes/combobox.module.js +23 -14
- package/esm2015/comboboxes/multicolumncombobox.component.js +653 -0
- package/{dist/es2015 → esm2015}/common/constants/error-messages.js +0 -1
- package/{dist/es2015 → esm2015}/common/constants/touch-enabled.js +0 -0
- package/{dist/es2015 → esm2015}/common/data.service.js +8 -10
- package/{dist/es2015 → esm2015}/common/disabled-items/disabled-items.service.js +9 -9
- package/{dist/es2015 → esm2015}/common/disabled-items/item-disabled.js +1 -0
- package/esm2015/common/filter-input.directive.js +34 -0
- package/{dist/es2015 → esm2015}/common/filtering/filter-settings.js +1 -0
- package/{dist/es2015 → esm2015}/common/filtering/filter.directive.js +19 -24
- package/{dist/es2015 → esm2015}/common/filtering/filterable-component.js +0 -0
- package/esm2015/common/list-item.directive.js +22 -0
- package/{dist/es2015 → esm2015}/common/list.component.js +194 -126
- package/esm2015/common/localization/custom-messages.component.js +41 -0
- package/esm2015/common/localization/localized-messages.directive.js +44 -0
- package/esm2015/common/localization/messages.js +25 -0
- package/{dist/es2015 → esm2015}/common/models/checkboxes-settings.js +0 -0
- package/{dist/es2015 → esm2015}/common/models/direction.js +1 -0
- package/{dist/es → esm2015}/common/models/fillmode.js +1 -0
- package/{dist/es → esm2015}/common/models/list-type.js +1 -0
- package/{dist/es → esm2015}/common/models/page-change-event.js +1 -0
- package/{dist/es → esm2015}/common/models/popup-settings.js +1 -0
- package/{dist/es2015 → esm2015}/common/models/preventable-event.js +0 -0
- package/{dist/es2015 → esm2015}/common/models/remove-tag-event.js +0 -0
- package/{dist/es → esm2015}/common/models/rounded.js +1 -0
- package/{dist/es → esm2015}/common/models/size.js +1 -0
- package/{dist/es2015 → esm2015}/common/models/virtualization-settings.js +0 -0
- package/{dist/es → esm2015}/common/navigation/navigation-action.js +1 -0
- package/{dist/es2015 → esm2015}/common/navigation/navigation.service.js +10 -11
- package/{dist/es2015 → esm2015}/common/searchbar.component.js +84 -97
- package/esm2015/common/selection/selectable.directive.js +76 -0
- package/{dist/es2015 → esm2015}/common/selection/selection.service.js +8 -10
- package/{dist/es2015 → esm2015}/common/shared-directives.module.js +37 -10
- package/esm2015/common/shared.module.js +59 -0
- package/{dist/es2015 → esm2015}/common/taglist.component.js +112 -87
- package/{dist/es2015 → esm2015}/common/templates/custom-item-template.directive.js +12 -12
- package/{dist/es2015 → esm2015}/common/templates/fixed-group-template.directive.js +12 -12
- package/{dist/es2015 → esm2015}/common/templates/footer-template.directive.js +12 -11
- package/{dist/es2015 → esm2015}/common/templates/group-tag-template.directive.js +12 -12
- package/{dist/es2015 → esm2015}/common/templates/group-template.directive.js +12 -12
- package/{dist/es2015 → esm2015}/common/templates/header-template.directive.js +12 -11
- package/{dist/es2015 → esm2015}/common/templates/item-template.directive.js +12 -11
- package/{dist/es2015 → esm2015}/common/templates/no-data-template.directive.js +12 -12
- package/{dist/es2015 → esm2015}/common/templates/tag-template.directive.js +12 -12
- package/esm2015/common/templates/template-context.directive.js +33 -0
- package/{dist/es2015 → esm2015}/common/templates/value-template.directive.js +12 -12
- package/{dist/es2015 → esm2015}/common/util.js +1 -3
- package/{dist/es2015 → esm2015}/dropdownlist/dropdownlist.component.js +393 -325
- package/esm2015/dropdownlist/dropdownlist.module.js +37 -0
- package/{dist/es → esm2015}/dropdowns.module.js +12 -12
- package/{dist/es2015 → esm2015}/dropdowntrees/checked-state/base-check.directive.js +13 -12
- package/{dist/es2015 → esm2015}/dropdowntrees/checked-state/check-all.directive.js +39 -46
- package/{dist/es2015 → esm2015}/dropdowntrees/checked-state/check.directive.js +20 -27
- package/{dist/es → esm2015}/dropdowntrees/checked-state/checkable-settings.js +1 -0
- package/{dist/es → esm2015}/dropdowntrees/checked-state/checked-item.js +1 -0
- package/esm2015/dropdowntrees/data-binding/dropdowntree/flat-binding.directive.js +51 -0
- package/esm2015/dropdowntrees/data-binding/dropdowntree/hierarchy-binding.directive.js +69 -0
- package/esm2015/dropdowntrees/data-binding/multiselecttree/flat-binding.directive.js +50 -0
- package/esm2015/dropdowntrees/data-binding/multiselecttree/hierarchy-binding.directive.js +47 -0
- package/{dist/es2015 → esm2015}/dropdowntrees/dropdowntree.component.js +410 -343
- package/esm2015/dropdowntrees/dropdowntrees.module.js +61 -0
- package/esm2015/dropdowntrees/expanded-state/expand.directive.js +38 -0
- package/{dist/es2015 → esm2015}/dropdowntrees/multiselecttree.component.js +474 -378
- package/{dist/es2015 → esm2015}/dropdowntrees/summary-tag/summary-tag.directive.js +15 -15
- package/esm2015/dropdowntrees/templates/node-template.directive.js +28 -0
- package/{dist/es2015/common/shared.module.d.ts → esm2015/kendo-angular-dropdowns.js} +2 -3
- package/{dist/es → esm2015}/main.js +15 -0
- package/{dist/es2015 → esm2015}/multiselect/multiselect.component.js +367 -314
- package/{dist/es2015 → esm2015}/multiselect/multiselect.module.js +19 -14
- package/{dist/es2015 → esm2015}/multiselect/summary-tag.directive.js +15 -15
- package/{dist/es2015 → esm2015}/package-metadata.js +1 -1
- package/{dist/fesm2015/index.js → fesm2015/kendo-angular-dropdowns.js} +8066 -7210
- package/kendo-angular-dropdowns.d.ts +9 -0
- package/{dist/es2015/main.d.ts → main.d.ts} +16 -1
- package/{dist/es2015/multiselect → multiselect}/multiselect.component.d.ts +54 -39
- package/{dist/es2015/multiselect → multiselect}/multiselect.module.d.ts +9 -0
- package/{dist/es2015/multiselect → multiselect}/summary-tag.directive.d.ts +3 -0
- package/{dist/es2015/package-metadata.d.ts → package-metadata.d.ts} +0 -0
- package/package.json +34 -112
- package/schematics/ngAdd/index.js +7 -4
- package/schematics/ngAdd/index.js.map +1 -1
- package/dist/cdn/js/kendo-angular-dropdowns.js +0 -20
- package/dist/cdn/main.js +0 -5
- package/dist/es/autocomplete/autocomplete.component.js +0 -1201
- package/dist/es/autocomplete/autocomplete.module.js +0 -36
- package/dist/es/comboboxes/combobox-column/column-cell-template.directive.js +0 -29
- package/dist/es/comboboxes/combobox-column/column-header-template.directive.js +0 -26
- package/dist/es/comboboxes/combobox-column/combobox-column.component.js +0 -78
- package/dist/es/comboboxes/combobox-column/util.js +0 -57
- package/dist/es/comboboxes/combobox.component.js +0 -1622
- package/dist/es/comboboxes/combobox.module.js +0 -52
- package/dist/es/comboboxes/multicolumncombobox.component.js +0 -230
- package/dist/es/common/constants/error-messages.js +0 -62
- package/dist/es/common/constants/touch-enabled.js +0 -9
- package/dist/es/common/data.service.js +0 -250
- package/dist/es/common/disabled-items/disabled-items.service.js +0 -45
- package/dist/es/common/disabled-items/item-disabled.js +0 -4
- package/dist/es/common/filter-input.directive.js +0 -37
- package/dist/es/common/filtering/filter-settings.js +0 -4
- package/dist/es/common/filtering/filter.directive.js +0 -141
- package/dist/es/common/filtering/filterable-component.js +0 -17
- package/dist/es/common/list-item.directive.js +0 -22
- package/dist/es/common/list.component.js +0 -503
- package/dist/es/common/localization/custom-messages.component.js +0 -44
- package/dist/es/common/localization/localized-messages.directive.js +0 -35
- package/dist/es/common/localization/messages.js +0 -34
- package/dist/es/common/models/checkboxes-settings.js +0 -15
- package/dist/es/common/models/direction.js +0 -4
- package/dist/es/common/models/preventable-event.js +0 -29
- package/dist/es/common/models/remove-tag-event.js +0 -24
- package/dist/es/common/models/virtualization-settings.js +0 -25
- package/dist/es/common/navigation/navigation.service.js +0 -147
- package/dist/es/common/searchbar.component.js +0 -253
- package/dist/es/common/selection/selectable.directive.js +0 -93
- package/dist/es/common/selection/selection.service.js +0 -107
- package/dist/es/common/shared-directives.module.js +0 -60
- package/dist/es/common/shared.module.js +0 -45
- package/dist/es/common/taglist.component.js +0 -179
- package/dist/es/common/templates/custom-item-template.directive.js +0 -47
- package/dist/es/common/templates/fixed-group-template.directive.js +0 -54
- package/dist/es/common/templates/footer-template.directive.js +0 -47
- package/dist/es/common/templates/group-tag-template.directive.js +0 -46
- package/dist/es/common/templates/group-template.directive.js +0 -54
- package/dist/es/common/templates/header-template.directive.js +0 -47
- package/dist/es/common/templates/item-template.directive.js +0 -46
- package/dist/es/common/templates/no-data-template.directive.js +0 -48
- package/dist/es/common/templates/tag-template.directive.js +0 -45
- package/dist/es/common/templates/template-context.directive.js +0 -40
- package/dist/es/common/templates/value-template.directive.js +0 -49
- package/dist/es/common/util.js +0 -337
- package/dist/es/dropdownlist/dropdownlist.component.js +0 -1649
- package/dist/es/dropdownlist/dropdownlist.module.js +0 -37
- package/dist/es/dropdowntrees/checked-state/base-check.directive.js +0 -68
- package/dist/es/dropdowntrees/checked-state/check-all.directive.js +0 -181
- package/dist/es/dropdowntrees/checked-state/check.directive.js +0 -169
- package/dist/es/dropdowntrees/data-binding/dropdowntree/flat-binding.directive.js +0 -32
- package/dist/es/dropdowntrees/data-binding/dropdowntree/hierarchy-binding.directive.js +0 -42
- package/dist/es/dropdowntrees/data-binding/multiselecttree/flat-binding.directive.js +0 -32
- package/dist/es/dropdowntrees/data-binding/multiselecttree/hierarchy-binding.directive.js +0 -42
- package/dist/es/dropdowntrees/dropdowntree.component.js +0 -1394
- package/dist/es/dropdowntrees/dropdowntrees.module.js +0 -45
- package/dist/es/dropdowntrees/expanded-state/expand.directive.js +0 -28
- package/dist/es/dropdowntrees/multiselecttree.component.js +0 -1683
- package/dist/es/dropdowntrees/summary-tag/summary-tag.directive.js +0 -63
- package/dist/es/dropdowntrees/templates/node-template.directive.js +0 -28
- package/dist/es/index.js +0 -30
- package/dist/es/multiselect/multiselect.component.js +0 -1734
- package/dist/es/multiselect/multiselect.module.js +0 -50
- package/dist/es/multiselect/summary-tag.directive.js +0 -65
- package/dist/es/package-metadata.js +0 -15
- package/dist/es2015/autocomplete/autocomplete.module.js +0 -33
- package/dist/es2015/comboboxes/combobox-column/column-header-template.directive.js +0 -25
- package/dist/es2015/comboboxes/combobox-column/combobox-column.component.js +0 -81
- package/dist/es2015/comboboxes/combobox.module.d.ts +0 -20
- package/dist/es2015/comboboxes/multicolumncombobox.component.js +0 -417
- package/dist/es2015/common/filter-input.directive.js +0 -35
- package/dist/es2015/common/list-item.directive.js +0 -21
- package/dist/es2015/common/localization/custom-messages.component.js +0 -36
- package/dist/es2015/common/localization/localized-messages.directive.js +0 -39
- package/dist/es2015/common/localization/messages.js +0 -28
- package/dist/es2015/common/models/fillmode.js +0 -4
- package/dist/es2015/common/models/list-type.js +0 -4
- package/dist/es2015/common/models/page-change-event.js +0 -4
- package/dist/es2015/common/models/popup-settings.js +0 -4
- package/dist/es2015/common/models/rounded.js +0 -4
- package/dist/es2015/common/models/size.d.ts +0 -14
- package/dist/es2015/common/models/size.js +0 -4
- package/dist/es2015/common/navigation/navigation-action.js +0 -24
- package/dist/es2015/common/selection/selectable.directive.js +0 -84
- package/dist/es2015/common/shared-directives.module.d.ts +0 -20
- package/dist/es2015/common/shared.module.js +0 -42
- package/dist/es2015/common/templates/template-context.directive.js +0 -35
- package/dist/es2015/dropdownlist/dropdownlist.module.js +0 -34
- package/dist/es2015/dropdowns.module.js +0 -50
- package/dist/es2015/dropdowntrees/checked-state/checkable-settings.js +0 -4
- package/dist/es2015/dropdowntrees/checked-state/checked-item.js +0 -4
- package/dist/es2015/dropdowntrees/data-binding/dropdowntree/flat-binding.directive.js +0 -30
- package/dist/es2015/dropdowntrees/data-binding/dropdowntree/hierarchy-binding.directive.js +0 -35
- package/dist/es2015/dropdowntrees/data-binding/multiselecttree/flat-binding.directive.js +0 -30
- package/dist/es2015/dropdowntrees/data-binding/multiselecttree/hierarchy-binding.directive.js +0 -35
- package/dist/es2015/dropdowntrees/dropdowntrees.module.d.ts +0 -9
- package/dist/es2015/dropdowntrees/dropdowntrees.module.js +0 -42
- package/dist/es2015/dropdowntrees/expanded-state/expand.directive.js +0 -26
- package/dist/es2015/dropdowntrees/templates/node-template.directive.js +0 -27
- package/dist/es2015/index.d.ts +0 -30
- package/dist/es2015/index.js +0 -30
- package/dist/es2015/index.metadata.json +0 -1
- package/dist/es2015/main.js +0 -44
- package/dist/fesm5/index.js +0 -13097
- package/dist/npm/autocomplete/autocomplete.component.js +0 -1203
- package/dist/npm/autocomplete/autocomplete.module.js +0 -38
- package/dist/npm/comboboxes/combobox-column/column-cell-template.directive.js +0 -31
- package/dist/npm/comboboxes/combobox-column/column-header-template.directive.js +0 -28
- package/dist/npm/comboboxes/combobox-column/combobox-column.component.js +0 -80
- package/dist/npm/comboboxes/combobox-column/util.js +0 -59
- package/dist/npm/comboboxes/combobox.component.js +0 -1624
- package/dist/npm/comboboxes/combobox.module.js +0 -54
- package/dist/npm/comboboxes/multicolumncombobox.component.js +0 -232
- package/dist/npm/common/constants/error-messages.js +0 -64
- package/dist/npm/common/constants/touch-enabled.js +0 -11
- package/dist/npm/common/data.service.js +0 -252
- package/dist/npm/common/disabled-items/disabled-items.service.js +0 -47
- package/dist/npm/common/disabled-items/item-disabled.js +0 -6
- package/dist/npm/common/filter-input.directive.js +0 -39
- package/dist/npm/common/filtering/filter-settings.js +0 -6
- package/dist/npm/common/filtering/filter.directive.js +0 -143
- package/dist/npm/common/filtering/filterable-component.js +0 -19
- package/dist/npm/common/list-item.directive.js +0 -24
- package/dist/npm/common/list.component.js +0 -505
- package/dist/npm/common/localization/custom-messages.component.js +0 -46
- package/dist/npm/common/localization/localized-messages.directive.js +0 -37
- package/dist/npm/common/localization/messages.js +0 -36
- package/dist/npm/common/models/checkboxes-settings.js +0 -17
- package/dist/npm/common/models/direction.js +0 -6
- package/dist/npm/common/models/fillmode.js +0 -6
- package/dist/npm/common/models/list-type.js +0 -6
- package/dist/npm/common/models/page-change-event.js +0 -6
- package/dist/npm/common/models/popup-settings.js +0 -6
- package/dist/npm/common/models/preventable-event.js +0 -31
- package/dist/npm/common/models/remove-tag-event.js +0 -26
- package/dist/npm/common/models/rounded.js +0 -6
- package/dist/npm/common/models/size.js +0 -6
- package/dist/npm/common/models/virtualization-settings.js +0 -27
- package/dist/npm/common/navigation/navigation-action.js +0 -26
- package/dist/npm/common/navigation/navigation.service.js +0 -149
- package/dist/npm/common/searchbar.component.js +0 -255
- package/dist/npm/common/selection/selectable.directive.js +0 -95
- package/dist/npm/common/selection/selection.service.js +0 -109
- package/dist/npm/common/shared-directives.module.js +0 -62
- package/dist/npm/common/shared.module.js +0 -47
- package/dist/npm/common/taglist.component.js +0 -181
- package/dist/npm/common/templates/custom-item-template.directive.js +0 -49
- package/dist/npm/common/templates/fixed-group-template.directive.js +0 -56
- package/dist/npm/common/templates/footer-template.directive.js +0 -49
- package/dist/npm/common/templates/group-tag-template.directive.js +0 -48
- package/dist/npm/common/templates/group-template.directive.js +0 -56
- package/dist/npm/common/templates/header-template.directive.js +0 -49
- package/dist/npm/common/templates/item-template.directive.js +0 -48
- package/dist/npm/common/templates/no-data-template.directive.js +0 -50
- package/dist/npm/common/templates/tag-template.directive.js +0 -47
- package/dist/npm/common/templates/template-context.directive.js +0 -42
- package/dist/npm/common/templates/value-template.directive.js +0 -51
- package/dist/npm/common/util.js +0 -339
- package/dist/npm/dropdownlist/dropdownlist.component.js +0 -1651
- package/dist/npm/dropdownlist/dropdownlist.module.js +0 -39
- package/dist/npm/dropdowns.module.js +0 -55
- package/dist/npm/dropdowntrees/checked-state/base-check.directive.js +0 -70
- package/dist/npm/dropdowntrees/checked-state/check-all.directive.js +0 -183
- package/dist/npm/dropdowntrees/checked-state/check.directive.js +0 -171
- package/dist/npm/dropdowntrees/checked-state/checkable-settings.js +0 -6
- package/dist/npm/dropdowntrees/checked-state/checked-item.js +0 -6
- package/dist/npm/dropdowntrees/data-binding/dropdowntree/flat-binding.directive.js +0 -34
- package/dist/npm/dropdowntrees/data-binding/dropdowntree/hierarchy-binding.directive.js +0 -44
- package/dist/npm/dropdowntrees/data-binding/multiselecttree/flat-binding.directive.js +0 -34
- package/dist/npm/dropdowntrees/data-binding/multiselecttree/hierarchy-binding.directive.js +0 -44
- package/dist/npm/dropdowntrees/dropdowntree.component.js +0 -1399
- package/dist/npm/dropdowntrees/dropdowntrees.module.js +0 -47
- package/dist/npm/dropdowntrees/expanded-state/expand.directive.js +0 -30
- package/dist/npm/dropdowntrees/multiselecttree.component.js +0 -1688
- package/dist/npm/dropdowntrees/summary-tag/summary-tag.directive.js +0 -65
- package/dist/npm/dropdowntrees/templates/node-template.directive.js +0 -30
- package/dist/npm/index.js +0 -55
- package/dist/npm/main.js +0 -86
- package/dist/npm/multiselect/multiselect.component.js +0 -1736
- package/dist/npm/multiselect/multiselect.module.js +0 -52
- package/dist/npm/multiselect/summary-tag.directive.js +0 -67
- package/dist/npm/package-metadata.js +0 -17
- package/dist/systemjs/kendo-angular-dropdowns.js +0 -5
|
@@ -1,1734 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
/* tslint:disable:member-ordering */
|
|
6
|
-
import * as tslib_1 from "tslib";
|
|
7
|
-
import { guid, isPresent, isArray, isObjectArray, resolveAllValues, selectedIndices, getter, isNumber, isUntouched, inDropDown, getSizeClass, getRoundedClass, getFillModeClass } from '../common/util';
|
|
8
|
-
import { SearchBarComponent } from '../common/searchbar.component';
|
|
9
|
-
import { ViewChild, Renderer2, ViewContainerRef, Component, HostBinding, Input, ElementRef, TemplateRef, Output, EventEmitter, isDevMode, forwardRef, ContentChild, ChangeDetectorRef, KeyValueDiffers, NgZone, Optional, Inject, HostListener } from '@angular/core';
|
|
10
|
-
import { Subscription, Subject, of } from 'rxjs';
|
|
11
|
-
import { catchError, filter, map, tap } from 'rxjs/operators';
|
|
12
|
-
import { isChanged, isDocumentAvailable, KendoInput, hasObservers, anyChanged } from '@progress/kendo-angular-common';
|
|
13
|
-
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
14
|
-
import { validatePackage } from '@progress/kendo-licensing';
|
|
15
|
-
import { packageMetadata } from '../package-metadata';
|
|
16
|
-
import { SelectionService } from '../common/selection/selection.service';
|
|
17
|
-
import { NavigationService } from '../common/navigation/navigation.service';
|
|
18
|
-
import { NavigationAction } from '../common/navigation/navigation-action';
|
|
19
|
-
import { DisabledItemsService } from '../common/disabled-items/disabled-items.service';
|
|
20
|
-
import { Keys } from '@progress/kendo-angular-common';
|
|
21
|
-
import { ItemTemplateDirective } from '../common/templates/item-template.directive';
|
|
22
|
-
import { CustomItemTemplateDirective } from '../common/templates/custom-item-template.directive';
|
|
23
|
-
import { GroupTemplateDirective } from '../common/templates/group-template.directive';
|
|
24
|
-
import { FixedGroupTemplateDirective } from '../common/templates/fixed-group-template.directive';
|
|
25
|
-
import { HeaderTemplateDirective } from '../common/templates/header-template.directive';
|
|
26
|
-
import { FooterTemplateDirective } from '../common/templates/footer-template.directive';
|
|
27
|
-
import { TagTemplateDirective } from '../common/templates/tag-template.directive';
|
|
28
|
-
import { GroupTagTemplateDirective } from '../common/templates/group-tag-template.directive';
|
|
29
|
-
import { NoDataTemplateDirective } from '../common/templates/no-data-template.directive';
|
|
30
|
-
import { MultiselectMessages } from '../common/constants/error-messages';
|
|
31
|
-
import { PreventableEvent } from '../common/models/preventable-event';
|
|
32
|
-
import { RemoveTagEvent } from '../common/models/remove-tag-event';
|
|
33
|
-
import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
|
|
34
|
-
import { PopupService } from '@progress/kendo-angular-popup';
|
|
35
|
-
import { FilterableComponent } from '../common/filtering/filterable-component';
|
|
36
|
-
import { TOUCH_ENABLED } from '../common/constants/touch-enabled';
|
|
37
|
-
import { DataService } from '../common/data.service';
|
|
38
|
-
import { ListComponent } from '../common/list.component';
|
|
39
|
-
import { normalizeCheckboxesSettings } from '../common/models/checkboxes-settings';
|
|
40
|
-
import { normalizeVirtualizationSettings } from '../common/models/virtualization-settings';
|
|
41
|
-
var MULTISELECT_VALUE_ACCESSOR = {
|
|
42
|
-
multi: true,
|
|
43
|
-
provide: NG_VALUE_ACCESSOR,
|
|
44
|
-
// tslint:disable-next-line:no-use-before-declare
|
|
45
|
-
useExisting: forwardRef(function () { return MultiSelectComponent; })
|
|
46
|
-
};
|
|
47
|
-
/**
|
|
48
|
-
* Represents the [Kendo UI MultiSelect component for Angular]({% slug overview_multiselect %}).
|
|
49
|
-
*
|
|
50
|
-
* @example
|
|
51
|
-
* ```ts
|
|
52
|
-
* _@Component({
|
|
53
|
-
* selector: 'my-app',
|
|
54
|
-
* template: `
|
|
55
|
-
* <kendo-multiselect [data]="listItems">
|
|
56
|
-
* </kendo-multiselect>
|
|
57
|
-
* `
|
|
58
|
-
* })
|
|
59
|
-
* class AppComponent {
|
|
60
|
-
* public listItems: Array<string> = ["Item 1", "Item 2", "Item 3", "Item 4"];
|
|
61
|
-
* }
|
|
62
|
-
* ```
|
|
63
|
-
*/
|
|
64
|
-
var MultiSelectComponent = /** @class */ (function () {
|
|
65
|
-
function MultiSelectComponent(wrapper, localization, popupService, dataService, selectionService, navigationService, disabledItemsService, cdr, differs, renderer, _zone, touchEnabled) {
|
|
66
|
-
var _this = this;
|
|
67
|
-
this.wrapper = wrapper;
|
|
68
|
-
this.localization = localization;
|
|
69
|
-
this.popupService = popupService;
|
|
70
|
-
this.dataService = dataService;
|
|
71
|
-
this.selectionService = selectionService;
|
|
72
|
-
this.navigationService = navigationService;
|
|
73
|
-
this.disabledItemsService = disabledItemsService;
|
|
74
|
-
this.cdr = cdr;
|
|
75
|
-
this.differs = differs;
|
|
76
|
-
this.renderer = renderer;
|
|
77
|
-
this._zone = _zone;
|
|
78
|
-
this.touchEnabled = touchEnabled;
|
|
79
|
-
this.listBoxId = guid();
|
|
80
|
-
this.tagListId = guid();
|
|
81
|
-
this.tagPrefix = "tag-" + guid();
|
|
82
|
-
this.optionPrefix = "option-" + guid();
|
|
83
|
-
this.focusedTagIndex = undefined;
|
|
84
|
-
/**
|
|
85
|
-
* @hidden
|
|
86
|
-
*/
|
|
87
|
-
this.focusableId = "k-" + guid();
|
|
88
|
-
/**
|
|
89
|
-
* Determines whether to close the options list of the MultiSelect after the item selection is finished
|
|
90
|
-
* ([see example]({% slug openstate_multiselect %}#toc-keeping-the-options-list-open-while-on-focus)).
|
|
91
|
-
* @default true
|
|
92
|
-
*/
|
|
93
|
-
this.autoClose = true;
|
|
94
|
-
/**
|
|
95
|
-
* Specifies the [`tabindex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component.
|
|
96
|
-
*/
|
|
97
|
-
this.tabindex = 0;
|
|
98
|
-
/**
|
|
99
|
-
* Sets the disabled state of the component.
|
|
100
|
-
*/
|
|
101
|
-
this.disabled = false;
|
|
102
|
-
/**
|
|
103
|
-
* Sets the read-only state of the component.
|
|
104
|
-
*/
|
|
105
|
-
this.readonly = false;
|
|
106
|
-
/**
|
|
107
|
-
* Enables the [filtering]({% slug filtering_multiselect %}) functionality of the MultiSelect.
|
|
108
|
-
*/
|
|
109
|
-
this.filterable = false;
|
|
110
|
-
/**
|
|
111
|
-
* Sets the height of the suggestions list. By default, `listHeight` is 200px.
|
|
112
|
-
*
|
|
113
|
-
* > The `listHeight` property affects only the list of suggestions and not the whole popup container.
|
|
114
|
-
* > To set the height of the popup container, use `popupSettings.height`.
|
|
115
|
-
*/
|
|
116
|
-
this.listHeight = 200;
|
|
117
|
-
/**
|
|
118
|
-
* If set to `true`, renders a button on hovering over the component.
|
|
119
|
-
* Clicking this button resets the value of the component to an empty array and triggers the `change` event.
|
|
120
|
-
*/
|
|
121
|
-
this.clearButton = true;
|
|
122
|
-
/**
|
|
123
|
-
* A user-defined callback function which receives an array of selected data items and maps them to an array of tags
|
|
124
|
-
* ([see examples]({% slug summarytagmode_multiselect %}#toc-rendering-of-tags)).
|
|
125
|
-
*
|
|
126
|
-
* @param { Any[] } dataItems - The selected data items from the list.
|
|
127
|
-
* @returns { Any[] } - The tags that will be rendered by the component.
|
|
128
|
-
*/
|
|
129
|
-
this.tagMapper = function (tags) { return tags || []; };
|
|
130
|
-
/**
|
|
131
|
-
* Specifies whether the MultiSelect allows user-defined values that are not present in the dataset
|
|
132
|
-
* ([more information and examples]({% slug custom_values_multiselect %})).
|
|
133
|
-
* Defaults to `false`.
|
|
134
|
-
*/
|
|
135
|
-
this.allowCustom = false;
|
|
136
|
-
/**
|
|
137
|
-
* A user-defined callback function which returns normalized custom values.
|
|
138
|
-
* Typically used when the data items are different from type `string`.
|
|
139
|
-
*
|
|
140
|
-
* @param { Any } value - The custom value that is defined by the user.
|
|
141
|
-
* @returns { Any }
|
|
142
|
-
*
|
|
143
|
-
* @example
|
|
144
|
-
* ```ts
|
|
145
|
-
* import { map } from 'rxjs/operators';
|
|
146
|
-
*
|
|
147
|
-
* _@Component({
|
|
148
|
-
* selector: 'my-app',
|
|
149
|
-
* template: `
|
|
150
|
-
* <kendo-multiselect
|
|
151
|
-
* [allowCustom]="true"
|
|
152
|
-
* [data]="listItems"
|
|
153
|
-
* textField="text"
|
|
154
|
-
* valueField="value"
|
|
155
|
-
* [valueNormalizer]="valueNormalizer"
|
|
156
|
-
* (valueChange)="onValueChange($event)"
|
|
157
|
-
* >
|
|
158
|
-
* </kendo-multiselect>
|
|
159
|
-
* `
|
|
160
|
-
* })
|
|
161
|
-
*
|
|
162
|
-
* class AppComponent {
|
|
163
|
-
* public listItems: Array<{ text: string, value: number }> = [
|
|
164
|
-
* { text: "Small", value: 1 },
|
|
165
|
-
* { text: "Medium", value: 2 },
|
|
166
|
-
* { text: "Large", value: 3 }
|
|
167
|
-
* ];
|
|
168
|
-
*
|
|
169
|
-
* public onValueChange(value) {
|
|
170
|
-
* console.log("valueChange : ", value);
|
|
171
|
-
* }
|
|
172
|
-
*
|
|
173
|
-
* public valueNormalizer = (text$: Observable<string>) => text$.pipe(map((text: string) => {
|
|
174
|
-
* return {
|
|
175
|
-
* value: Math.floor(Math.random() * (1000 - 100) + 1000), //generate unique valueField
|
|
176
|
-
* text: text };
|
|
177
|
-
* }));
|
|
178
|
-
*
|
|
179
|
-
* }
|
|
180
|
-
* ```
|
|
181
|
-
*/
|
|
182
|
-
this.valueNormalizer = function (text) { return text.pipe(map(function (userInput) {
|
|
183
|
-
var comparer = function (item) { return typeof item === 'string' && userInput.toLowerCase() === item.toLowerCase(); };
|
|
184
|
-
var matchingValue = _this.value.find(comparer);
|
|
185
|
-
if (matchingValue) {
|
|
186
|
-
return matchingValue;
|
|
187
|
-
}
|
|
188
|
-
var matchingItem = _this.dataService.find(comparer);
|
|
189
|
-
return matchingItem ? matchingItem : userInput;
|
|
190
|
-
})); };
|
|
191
|
-
/**
|
|
192
|
-
* Fires each time the user types in the input field.
|
|
193
|
-
* You can filter the source based on the passed filtration value.
|
|
194
|
-
*/
|
|
195
|
-
this.filterChange = new EventEmitter();
|
|
196
|
-
/**
|
|
197
|
-
* Fires each time the value is changed—
|
|
198
|
-
* when the component is blurred or the value is cleared through the **Clear** button
|
|
199
|
-
* ([see example]({% slug overview_multiselect %}#toc-events)).
|
|
200
|
-
* When the value of the component is programmatically changed to `ngModel` or `formControl`
|
|
201
|
-
* through its API or form binding, the `valueChange` event is not triggered because it
|
|
202
|
-
* might cause a mix-up with the built-in `valueChange` mechanisms of the `ngModel` or `formControl` bindings.
|
|
203
|
-
*/
|
|
204
|
-
this.valueChange = new EventEmitter();
|
|
205
|
-
/**
|
|
206
|
-
* Fires each time the popup is about to open
|
|
207
|
-
* ([see example]({% slug openstate_multiselect %}#toc-preventing-opening-and-closing)).
|
|
208
|
-
* This event is preventable. If you cancel it, the popup will remain closed.
|
|
209
|
-
*/
|
|
210
|
-
this.open = new EventEmitter();
|
|
211
|
-
/**
|
|
212
|
-
* Fires after the popup has been opened.
|
|
213
|
-
*/
|
|
214
|
-
this.opened = new EventEmitter();
|
|
215
|
-
/**
|
|
216
|
-
* Fires each time the popup is about to close
|
|
217
|
-
* ([see example]({% slug openstate_multiselect %}#toc-preventing-opening-and-closing)).
|
|
218
|
-
* This event is preventable. If you cancel it, the popup will remain open.
|
|
219
|
-
*/
|
|
220
|
-
this.close = new EventEmitter();
|
|
221
|
-
/**
|
|
222
|
-
* Fires after the popup has been closed.
|
|
223
|
-
*/
|
|
224
|
-
this.closed = new EventEmitter();
|
|
225
|
-
/**
|
|
226
|
-
* Fires each time the user focuses the MultiSelect.
|
|
227
|
-
*/
|
|
228
|
-
this.onFocus = new EventEmitter(); //tslint:disable-line:no-output-rename
|
|
229
|
-
/**
|
|
230
|
-
* Fires each time the MultiSelect gets blurred.
|
|
231
|
-
*/
|
|
232
|
-
this.onBlur = new EventEmitter(); //tslint:disable-line:no-output-rename
|
|
233
|
-
/**
|
|
234
|
-
* Fires each time a tag is about to be removed.
|
|
235
|
-
* This event is preventable. If you cancel it, the tag will not be removed.
|
|
236
|
-
*/
|
|
237
|
-
this.removeTag = new EventEmitter();
|
|
238
|
-
this.hostClasses = true;
|
|
239
|
-
this.role = 'combobox';
|
|
240
|
-
this.initialized = false;
|
|
241
|
-
this._size = 'medium';
|
|
242
|
-
this._rounded = 'medium';
|
|
243
|
-
this._fillMode = 'solid';
|
|
244
|
-
this.onChangeCallback = function (_) { };
|
|
245
|
-
this.onTouchedCallback = function (_) { };
|
|
246
|
-
this._placeholder = '';
|
|
247
|
-
this._open = false;
|
|
248
|
-
this._value = [];
|
|
249
|
-
this._popupSettings = { animate: true };
|
|
250
|
-
this._checkboxes = { enabled: false };
|
|
251
|
-
this._isFocused = false;
|
|
252
|
-
this.selectedDataItems = [];
|
|
253
|
-
this.customValueSubject = new Subject();
|
|
254
|
-
this.observableSubscriptions = new Subscription();
|
|
255
|
-
validatePackage(packageMetadata);
|
|
256
|
-
this.popupMouseDownHandler = this.onMouseDown.bind(this);
|
|
257
|
-
this.data = [];
|
|
258
|
-
this.direction = this.localization.rtl ? 'rtl' : 'ltr';
|
|
259
|
-
this.subscribeEvents();
|
|
260
|
-
this.subscribeTouchEvents();
|
|
261
|
-
}
|
|
262
|
-
MultiSelectComponent_1 = MultiSelectComponent;
|
|
263
|
-
/**
|
|
264
|
-
* Focuses a specific item of the MultiSelect based on a provided index.
|
|
265
|
-
* If there is a custom item it is positioned at index -1.
|
|
266
|
-
* If null or invalid index is provided the focus will be removed.
|
|
267
|
-
*/
|
|
268
|
-
MultiSelectComponent.prototype.focusItemAt = function (index) {
|
|
269
|
-
var minIndex = this.allowCustom ? -1 : 0;
|
|
270
|
-
var isInRange = minIndex <= 0 && index < this.data.length;
|
|
271
|
-
if (isPresent(index) && isInRange && !this.disabledItemsService.isIndexDisabled(index)) {
|
|
272
|
-
this.selectionService.focus(index);
|
|
273
|
-
}
|
|
274
|
-
else {
|
|
275
|
-
this.selectionService.focus(null);
|
|
276
|
-
}
|
|
277
|
-
};
|
|
278
|
-
/**
|
|
279
|
-
* Focuses the MultiSelect.
|
|
280
|
-
*/
|
|
281
|
-
MultiSelectComponent.prototype.focus = function () {
|
|
282
|
-
if (!this.disabled) {
|
|
283
|
-
this.searchbar.focus();
|
|
284
|
-
}
|
|
285
|
-
};
|
|
286
|
-
/**
|
|
287
|
-
* @hidden
|
|
288
|
-
*/
|
|
289
|
-
MultiSelectComponent.prototype.onSearchBarFocus = function () {
|
|
290
|
-
var _this = this;
|
|
291
|
-
if (!this.isFocused) {
|
|
292
|
-
this.isFocused = true;
|
|
293
|
-
if (hasObservers(this.onFocus)) {
|
|
294
|
-
this._zone.run(function () {
|
|
295
|
-
_this.onFocus.emit();
|
|
296
|
-
});
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
};
|
|
300
|
-
/**
|
|
301
|
-
* Blurs the MultiSelect.
|
|
302
|
-
*/
|
|
303
|
-
MultiSelectComponent.prototype.blur = function () {
|
|
304
|
-
if (!this.disabled) {
|
|
305
|
-
this.searchbar.blur();
|
|
306
|
-
}
|
|
307
|
-
};
|
|
308
|
-
/**
|
|
309
|
-
* @hidden
|
|
310
|
-
*/
|
|
311
|
-
MultiSelectComponent.prototype.onSearchBarBlur = function () {
|
|
312
|
-
var _this = this;
|
|
313
|
-
if (!this.isFocused) {
|
|
314
|
-
return;
|
|
315
|
-
}
|
|
316
|
-
this.isFocused = false;
|
|
317
|
-
if (hasObservers(this.onBlur) ||
|
|
318
|
-
hasObservers(this.filterChange) ||
|
|
319
|
-
hasObservers(this.close) ||
|
|
320
|
-
isUntouched(this.wrapper.nativeElement)) {
|
|
321
|
-
this._zone.run(function () {
|
|
322
|
-
_this.closePopup();
|
|
323
|
-
if (!(_this.isOpen && _this.allowCustom)) {
|
|
324
|
-
_this.clearFilter();
|
|
325
|
-
}
|
|
326
|
-
_this.onBlur.emit();
|
|
327
|
-
_this.onTouchedCallback();
|
|
328
|
-
});
|
|
329
|
-
}
|
|
330
|
-
else {
|
|
331
|
-
if (!this.allowCustom) {
|
|
332
|
-
this.clearFilter();
|
|
333
|
-
}
|
|
334
|
-
this.closePopup();
|
|
335
|
-
}
|
|
336
|
-
};
|
|
337
|
-
/**
|
|
338
|
-
* @hidden
|
|
339
|
-
*/
|
|
340
|
-
MultiSelectComponent.prototype.onMouseDown = function (event) {
|
|
341
|
-
event.preventDefault();
|
|
342
|
-
};
|
|
343
|
-
/**
|
|
344
|
-
* @hidden
|
|
345
|
-
*/
|
|
346
|
-
MultiSelectComponent.prototype.onResize = function () {
|
|
347
|
-
if (this._open) {
|
|
348
|
-
var popupWrapper = this.popupRef.popupElement;
|
|
349
|
-
var _a = this.width, min = _a.min, max = _a.max;
|
|
350
|
-
popupWrapper.style.minWidth = min;
|
|
351
|
-
popupWrapper.style.width = max;
|
|
352
|
-
}
|
|
353
|
-
};
|
|
354
|
-
Object.defineProperty(MultiSelectComponent.prototype, "appendTo", {
|
|
355
|
-
get: function () {
|
|
356
|
-
var appendTo = this.popupSettings.appendTo;
|
|
357
|
-
if (!appendTo || appendTo === 'root') {
|
|
358
|
-
return undefined;
|
|
359
|
-
}
|
|
360
|
-
return appendTo === 'component' ? this.container : appendTo;
|
|
361
|
-
},
|
|
362
|
-
enumerable: true,
|
|
363
|
-
configurable: true
|
|
364
|
-
});
|
|
365
|
-
Object.defineProperty(MultiSelectComponent.prototype, "data", {
|
|
366
|
-
get: function () {
|
|
367
|
-
var virtual = this.virtual;
|
|
368
|
-
if (virtual) {
|
|
369
|
-
var start = virtual.skip || 0;
|
|
370
|
-
var end = start + virtual.pageSize;
|
|
371
|
-
//Use length instead of itemsCount because of grouping
|
|
372
|
-
virtual.total = this.dataService.data.length;
|
|
373
|
-
return this.dataService.data.slice(start, end);
|
|
374
|
-
}
|
|
375
|
-
return this.dataService.data;
|
|
376
|
-
},
|
|
377
|
-
/**
|
|
378
|
-
* Sets the data of the MultiSelect.
|
|
379
|
-
*
|
|
380
|
-
* > The data has to be provided in an array-like list of items.
|
|
381
|
-
*/
|
|
382
|
-
set: function (data) {
|
|
383
|
-
this.dataService.data = data || [];
|
|
384
|
-
if (this.virtual) {
|
|
385
|
-
this.virtual.skip = 0;
|
|
386
|
-
}
|
|
387
|
-
if (this.initialized) {
|
|
388
|
-
this.setState(this.value);
|
|
389
|
-
}
|
|
390
|
-
},
|
|
391
|
-
enumerable: true,
|
|
392
|
-
configurable: true
|
|
393
|
-
});
|
|
394
|
-
Object.defineProperty(MultiSelectComponent.prototype, "value", {
|
|
395
|
-
get: function () {
|
|
396
|
-
return this._value;
|
|
397
|
-
},
|
|
398
|
-
/**
|
|
399
|
-
* Sets the value of the MultiSelect. It can be either of the primitive (string, numbers) or of the complex (objects) type.
|
|
400
|
-
* To define the type, use the `valuePrimitive` option.
|
|
401
|
-
*
|
|
402
|
-
* > All selected values which are not present in the source are ignored.
|
|
403
|
-
*/
|
|
404
|
-
set: function (values) {
|
|
405
|
-
this._value = values ? values : [];
|
|
406
|
-
if (!this.differ && this.value) {
|
|
407
|
-
this.differ = this.differs.find(this.value).create();
|
|
408
|
-
}
|
|
409
|
-
this.valueChangeDetected = true;
|
|
410
|
-
if (this.initialized) {
|
|
411
|
-
this.setState(this.value);
|
|
412
|
-
}
|
|
413
|
-
},
|
|
414
|
-
enumerable: true,
|
|
415
|
-
configurable: true
|
|
416
|
-
});
|
|
417
|
-
Object.defineProperty(MultiSelectComponent.prototype, "tabIndex", {
|
|
418
|
-
get: function () {
|
|
419
|
-
return this.tabindex;
|
|
420
|
-
},
|
|
421
|
-
/**
|
|
422
|
-
* @hidden
|
|
423
|
-
*/
|
|
424
|
-
set: function (tabIndex) {
|
|
425
|
-
this.tabindex = tabIndex;
|
|
426
|
-
},
|
|
427
|
-
enumerable: true,
|
|
428
|
-
configurable: true
|
|
429
|
-
});
|
|
430
|
-
Object.defineProperty(MultiSelectComponent.prototype, "size", {
|
|
431
|
-
get: function () {
|
|
432
|
-
return this._size;
|
|
433
|
-
},
|
|
434
|
-
/**
|
|
435
|
-
* Sets the size of the component.
|
|
436
|
-
*
|
|
437
|
-
* The possible values are:
|
|
438
|
-
* * `'small'`
|
|
439
|
-
* * `'medium'` (default)
|
|
440
|
-
* * `'large'`
|
|
441
|
-
* * `null`
|
|
442
|
-
*
|
|
443
|
-
*/
|
|
444
|
-
set: function (size) {
|
|
445
|
-
this.renderer.removeClass(this.wrapper.nativeElement, getSizeClass('input', this.size));
|
|
446
|
-
if (size) {
|
|
447
|
-
this.renderer.addClass(this.wrapper.nativeElement, getSizeClass('input', size));
|
|
448
|
-
}
|
|
449
|
-
this._size = size;
|
|
450
|
-
},
|
|
451
|
-
enumerable: true,
|
|
452
|
-
configurable: true
|
|
453
|
-
});
|
|
454
|
-
Object.defineProperty(MultiSelectComponent.prototype, "rounded", {
|
|
455
|
-
get: function () {
|
|
456
|
-
return this._rounded;
|
|
457
|
-
},
|
|
458
|
-
/**
|
|
459
|
-
* Sets the border radius of the component.
|
|
460
|
-
*
|
|
461
|
-
* The possible values are:
|
|
462
|
-
* * `'small'`
|
|
463
|
-
* * `'medium'` (default)
|
|
464
|
-
* * `'large'`
|
|
465
|
-
* * `'full'`
|
|
466
|
-
* * `null`
|
|
467
|
-
*
|
|
468
|
-
*/
|
|
469
|
-
set: function (rounded) {
|
|
470
|
-
this.renderer.removeClass(this.wrapper.nativeElement, getRoundedClass(this.rounded));
|
|
471
|
-
if (rounded) {
|
|
472
|
-
this.renderer.addClass(this.wrapper.nativeElement, getRoundedClass(rounded));
|
|
473
|
-
}
|
|
474
|
-
this._rounded = rounded;
|
|
475
|
-
},
|
|
476
|
-
enumerable: true,
|
|
477
|
-
configurable: true
|
|
478
|
-
});
|
|
479
|
-
Object.defineProperty(MultiSelectComponent.prototype, "fillMode", {
|
|
480
|
-
get: function () {
|
|
481
|
-
return this._fillMode;
|
|
482
|
-
},
|
|
483
|
-
/**
|
|
484
|
-
* Sets the fillMode of the component.
|
|
485
|
-
*
|
|
486
|
-
* The possible values are:
|
|
487
|
-
* * `'flat'`
|
|
488
|
-
* * `'solid'` (default)
|
|
489
|
-
* * `'outline'`
|
|
490
|
-
* * `null`
|
|
491
|
-
*
|
|
492
|
-
*/
|
|
493
|
-
set: function (fillMode) {
|
|
494
|
-
this.renderer.removeClass(this.wrapper.nativeElement, getFillModeClass('input', this.fillMode));
|
|
495
|
-
if (fillMode) {
|
|
496
|
-
this.renderer.addClass(this.wrapper.nativeElement, getFillModeClass('input', fillMode));
|
|
497
|
-
}
|
|
498
|
-
this._fillMode = fillMode;
|
|
499
|
-
},
|
|
500
|
-
enumerable: true,
|
|
501
|
-
configurable: true
|
|
502
|
-
});
|
|
503
|
-
Object.defineProperty(MultiSelectComponent.prototype, "placeholder", {
|
|
504
|
-
get: function () {
|
|
505
|
-
return this.selectedDataItems.length ? '' : this._placeholder;
|
|
506
|
-
},
|
|
507
|
-
/**
|
|
508
|
-
* The hint which is displayed when the component is empty.
|
|
509
|
-
* When the values are selected, it disappears.
|
|
510
|
-
*/
|
|
511
|
-
set: function (text) {
|
|
512
|
-
this._placeholder = text || '';
|
|
513
|
-
},
|
|
514
|
-
enumerable: true,
|
|
515
|
-
configurable: true
|
|
516
|
-
});
|
|
517
|
-
Object.defineProperty(MultiSelectComponent.prototype, "itemDisabled", {
|
|
518
|
-
/**
|
|
519
|
-
* Defines a Boolean function that is executed for each data item in the component
|
|
520
|
-
* ([see examples]({% slug disableditems_multiselect %})). Determines whether the item will be disabled.
|
|
521
|
-
*/
|
|
522
|
-
set: function (fn) {
|
|
523
|
-
if (typeof fn !== 'function') {
|
|
524
|
-
throw new Error("itemDisabled must be a function, but received " + JSON.stringify(fn) + ".");
|
|
525
|
-
}
|
|
526
|
-
this.disabledItemsService.itemDisabled = fn;
|
|
527
|
-
},
|
|
528
|
-
enumerable: true,
|
|
529
|
-
configurable: true
|
|
530
|
-
});
|
|
531
|
-
Object.defineProperty(MultiSelectComponent.prototype, "checkboxes", {
|
|
532
|
-
get: function () {
|
|
533
|
-
return this._checkboxes;
|
|
534
|
-
},
|
|
535
|
-
/**
|
|
536
|
-
* Specifies whether checkboxes will be rendered before each item in the popup list.
|
|
537
|
-
*/
|
|
538
|
-
set: function (settings) {
|
|
539
|
-
this._checkboxes = normalizeCheckboxesSettings(settings);
|
|
540
|
-
},
|
|
541
|
-
enumerable: true,
|
|
542
|
-
configurable: true
|
|
543
|
-
});
|
|
544
|
-
Object.defineProperty(MultiSelectComponent.prototype, "virtual", {
|
|
545
|
-
get: function () {
|
|
546
|
-
return this._virtualSettings;
|
|
547
|
-
},
|
|
548
|
-
/**
|
|
549
|
-
* Enables the [virtualization]({% slug virtualization_multiselect %}) functionality.
|
|
550
|
-
*/
|
|
551
|
-
set: function (settings) {
|
|
552
|
-
this._virtualSettings = normalizeVirtualizationSettings(settings);
|
|
553
|
-
},
|
|
554
|
-
enumerable: true,
|
|
555
|
-
configurable: true
|
|
556
|
-
});
|
|
557
|
-
Object.defineProperty(MultiSelectComponent.prototype, "popupSettings", {
|
|
558
|
-
get: function () {
|
|
559
|
-
return this._popupSettings;
|
|
560
|
-
},
|
|
561
|
-
/**
|
|
562
|
-
* Configures the popup of the MultiSelect.
|
|
563
|
-
*
|
|
564
|
-
* The available options are:
|
|
565
|
-
* - `animate: Boolean`—Controls the popup animation. By default, the open and close animations are enabled.
|
|
566
|
-
* - `width: Number | String`—Sets the width of the popup container. By default, the width of the host element is used. If set to `auto`, the component automatically adjusts the width of the popup and no item labels are wrapped. The `auto` mode is not supported when virtual scrolling is enabled.
|
|
567
|
-
* - `height: Number`—Sets the height of the popup container.
|
|
568
|
-
* - `popupClass: String`—Specifies a list of CSS classes that are used to style the popup.
|
|
569
|
-
* - `appendTo: "root" | "component" | ViewContainerRef`—Specifies the component to which the popup will be appended.
|
|
570
|
-
*/
|
|
571
|
-
set: function (settings) {
|
|
572
|
-
this._popupSettings = Object.assign({ animate: true }, settings);
|
|
573
|
-
},
|
|
574
|
-
enumerable: true,
|
|
575
|
-
configurable: true
|
|
576
|
-
});
|
|
577
|
-
Object.defineProperty(MultiSelectComponent.prototype, "valuePrimitive", {
|
|
578
|
-
get: function () {
|
|
579
|
-
if (!isPresent(this._valuePrimitive)) {
|
|
580
|
-
return !isPresent(this.valueField);
|
|
581
|
-
}
|
|
582
|
-
return this._valuePrimitive;
|
|
583
|
-
},
|
|
584
|
-
/**
|
|
585
|
-
* Specifies the type of the selected value.
|
|
586
|
-
* If set to `true`, the selected value has to be of the primitive type
|
|
587
|
-
* ([more information and example]({% slug valuebinding_multiselect %}#toc-primitive-values-from-object-fields)).
|
|
588
|
-
*/
|
|
589
|
-
set: function (isPrimitive) {
|
|
590
|
-
this._valuePrimitive = isPrimitive;
|
|
591
|
-
},
|
|
592
|
-
enumerable: true,
|
|
593
|
-
configurable: true
|
|
594
|
-
});
|
|
595
|
-
Object.defineProperty(MultiSelectComponent.prototype, "dir", {
|
|
596
|
-
get: function () {
|
|
597
|
-
return this.direction;
|
|
598
|
-
},
|
|
599
|
-
enumerable: true,
|
|
600
|
-
configurable: true
|
|
601
|
-
});
|
|
602
|
-
Object.defineProperty(MultiSelectComponent.prototype, "disabledClass", {
|
|
603
|
-
get: function () {
|
|
604
|
-
return this.disabled;
|
|
605
|
-
},
|
|
606
|
-
enumerable: true,
|
|
607
|
-
configurable: true
|
|
608
|
-
});
|
|
609
|
-
Object.defineProperty(MultiSelectComponent.prototype, "isLoading", {
|
|
610
|
-
get: function () {
|
|
611
|
-
return this.loading;
|
|
612
|
-
},
|
|
613
|
-
enumerable: true,
|
|
614
|
-
configurable: true
|
|
615
|
-
});
|
|
616
|
-
Object.defineProperty(MultiSelectComponent.prototype, "isAriaExpanded", {
|
|
617
|
-
get: function () {
|
|
618
|
-
return this.isOpen;
|
|
619
|
-
},
|
|
620
|
-
enumerable: true,
|
|
621
|
-
configurable: true
|
|
622
|
-
});
|
|
623
|
-
/**
|
|
624
|
-
* @hidden
|
|
625
|
-
*/
|
|
626
|
-
MultiSelectComponent.prototype.hostMousedown = function (event) {
|
|
627
|
-
var inputElement = this.searchbar.input.nativeElement;
|
|
628
|
-
if (event.button === 0) {
|
|
629
|
-
if (this.isFocused && this.isOpen && event.target === inputElement) {
|
|
630
|
-
return;
|
|
631
|
-
}
|
|
632
|
-
if (!this.touchEnabled || (this.touchEnabled && event.target.tagName !== 'SPAN')) {
|
|
633
|
-
this.searchbar.focus();
|
|
634
|
-
}
|
|
635
|
-
this.togglePopup(!this.isOpen);
|
|
636
|
-
event.preventDefault();
|
|
637
|
-
}
|
|
638
|
-
};
|
|
639
|
-
Object.defineProperty(MultiSelectComponent.prototype, "listContainerClasses", {
|
|
640
|
-
get: function () {
|
|
641
|
-
var containerClasses = ['k-list-container', 'k-reset'];
|
|
642
|
-
if (this.popupSettings.popupClass) {
|
|
643
|
-
containerClasses.push(this.popupSettings.popupClass);
|
|
644
|
-
}
|
|
645
|
-
return containerClasses;
|
|
646
|
-
},
|
|
647
|
-
enumerable: true,
|
|
648
|
-
configurable: true
|
|
649
|
-
});
|
|
650
|
-
Object.defineProperty(MultiSelectComponent.prototype, "customItemSizeClass", {
|
|
651
|
-
/**
|
|
652
|
-
* @hidden
|
|
653
|
-
*/
|
|
654
|
-
get: function () {
|
|
655
|
-
return "" + (this.size ? getSizeClass('list', this.size) : '');
|
|
656
|
-
},
|
|
657
|
-
enumerable: true,
|
|
658
|
-
configurable: true
|
|
659
|
-
});
|
|
660
|
-
Object.defineProperty(MultiSelectComponent.prototype, "width", {
|
|
661
|
-
get: function () {
|
|
662
|
-
var wrapperOffsetWidth = 0;
|
|
663
|
-
if (isDocumentAvailable()) {
|
|
664
|
-
wrapperOffsetWidth = this.wrapper.nativeElement.offsetWidth;
|
|
665
|
-
}
|
|
666
|
-
var width = this.popupSettings.width || wrapperOffsetWidth;
|
|
667
|
-
var minWidth = isNaN(wrapperOffsetWidth) ? wrapperOffsetWidth : wrapperOffsetWidth + "px";
|
|
668
|
-
var maxWidth = isNaN(width) ? width : width + "px";
|
|
669
|
-
return { min: minWidth, max: maxWidth };
|
|
670
|
-
},
|
|
671
|
-
enumerable: true,
|
|
672
|
-
configurable: true
|
|
673
|
-
});
|
|
674
|
-
Object.defineProperty(MultiSelectComponent.prototype, "height", {
|
|
675
|
-
get: function () {
|
|
676
|
-
var popupHeight = this.popupSettings.height;
|
|
677
|
-
return isPresent(popupHeight) ? popupHeight + "px" : 'auto';
|
|
678
|
-
},
|
|
679
|
-
enumerable: true,
|
|
680
|
-
configurable: true
|
|
681
|
-
});
|
|
682
|
-
Object.defineProperty(MultiSelectComponent.prototype, "activeDescendant", {
|
|
683
|
-
get: function () {
|
|
684
|
-
var focusedTagIndex = this.focusedTagIndex;
|
|
685
|
-
var focusedListIndex = this.selectionService.focused;
|
|
686
|
-
var prefix;
|
|
687
|
-
var item;
|
|
688
|
-
if (isPresent(focusedTagIndex) && !this.isOpen) {
|
|
689
|
-
item = this.tags[focusedTagIndex];
|
|
690
|
-
prefix = this.tagPrefix;
|
|
691
|
-
}
|
|
692
|
-
else if (isPresent(focusedListIndex) && focusedListIndex !== -1 && this.isOpen) {
|
|
693
|
-
item = this.dataService.itemAt(focusedListIndex);
|
|
694
|
-
prefix = this.optionPrefix;
|
|
695
|
-
}
|
|
696
|
-
else {
|
|
697
|
-
return null;
|
|
698
|
-
}
|
|
699
|
-
return prefix + "-" + getter(item, this.valueField);
|
|
700
|
-
},
|
|
701
|
-
enumerable: true,
|
|
702
|
-
configurable: true
|
|
703
|
-
});
|
|
704
|
-
Object.defineProperty(MultiSelectComponent.prototype, "noDataLabel", {
|
|
705
|
-
get: function () {
|
|
706
|
-
if (this.dataService.itemsCount === 0) {
|
|
707
|
-
return this.messageFor('noDataText');
|
|
708
|
-
}
|
|
709
|
-
},
|
|
710
|
-
enumerable: true,
|
|
711
|
-
configurable: true
|
|
712
|
-
});
|
|
713
|
-
Object.defineProperty(MultiSelectComponent.prototype, "clearButtonVisiblity", {
|
|
714
|
-
get: function () {
|
|
715
|
-
if (this.touchEnabled) {
|
|
716
|
-
return 'visible';
|
|
717
|
-
}
|
|
718
|
-
},
|
|
719
|
-
enumerable: true,
|
|
720
|
-
configurable: true
|
|
721
|
-
});
|
|
722
|
-
/**
|
|
723
|
-
* @hidden
|
|
724
|
-
*/
|
|
725
|
-
MultiSelectComponent.prototype.verifySettings = function () {
|
|
726
|
-
if (!isDevMode() || this.value.length === 0) {
|
|
727
|
-
return;
|
|
728
|
-
}
|
|
729
|
-
if (!isArray(this.value)) {
|
|
730
|
-
throw new Error(MultiselectMessages.array);
|
|
731
|
-
}
|
|
732
|
-
if (this.valuePrimitive === true && isObjectArray(this.value)) {
|
|
733
|
-
throw new Error(MultiselectMessages.primitive);
|
|
734
|
-
}
|
|
735
|
-
if (this.valuePrimitive === false && !isObjectArray(this.value)) {
|
|
736
|
-
throw new Error(MultiselectMessages.object);
|
|
737
|
-
}
|
|
738
|
-
var valueOrText = !isPresent(this.valueField) !== !isPresent(this.textField);
|
|
739
|
-
if (valueOrText) {
|
|
740
|
-
throw new Error(MultiselectMessages.textAndValue);
|
|
741
|
-
}
|
|
742
|
-
};
|
|
743
|
-
/**
|
|
744
|
-
* @hidden
|
|
745
|
-
*/
|
|
746
|
-
MultiSelectComponent.prototype.change = function (event) {
|
|
747
|
-
var _this = this;
|
|
748
|
-
var isCustomItem = (isPresent(event.added) || isPresent(event.removed)) && (event.added === -1 || event.removed === -1);
|
|
749
|
-
if (isCustomItem) {
|
|
750
|
-
this.addCustomValue(this.text);
|
|
751
|
-
return; // The change is emited asynchronosly.
|
|
752
|
-
}
|
|
753
|
-
// Existing items.
|
|
754
|
-
if (isPresent(event.added)) {
|
|
755
|
-
var dataItem = this.dataService.itemAt(event.added);
|
|
756
|
-
var newItem = (this.valuePrimitive && isPresent(dataItem) && isPresent(dataItem[this.valueField])) ? dataItem[this.valueField] : dataItem;
|
|
757
|
-
this.value = this.value.concat([newItem]);
|
|
758
|
-
}
|
|
759
|
-
if (isPresent(event.removed)) {
|
|
760
|
-
var dataItem_1 = this.dataService.itemAt(event.removed);
|
|
761
|
-
var filter_1 = function (item) { return getter(item, _this.valueField) !== getter(dataItem_1, _this.valueField); };
|
|
762
|
-
this.value = this.value.filter(filter_1);
|
|
763
|
-
this.selectionService.focused = event.removed;
|
|
764
|
-
this.cdr.detectChanges();
|
|
765
|
-
}
|
|
766
|
-
this.emitValueChange();
|
|
767
|
-
};
|
|
768
|
-
/**
|
|
769
|
-
* @hidden
|
|
770
|
-
*/
|
|
771
|
-
MultiSelectComponent.prototype.setState = function (value) {
|
|
772
|
-
var _this = this;
|
|
773
|
-
var data = this.dataService.data;
|
|
774
|
-
if (this.dataService.grouped) {
|
|
775
|
-
data = data.filter(function (item) { return !item.header; }).map(function (item) { return item.value; });
|
|
776
|
-
}
|
|
777
|
-
var selection = selectedIndices(this.value, data, this.valueField);
|
|
778
|
-
this.selectionService.resetSelection(selection);
|
|
779
|
-
if (this.disabledItemsService.isIndexDisabled(this.selectionService.focused)) {
|
|
780
|
-
this.selectionService.focused = this.firstFocusableIndex(0);
|
|
781
|
-
}
|
|
782
|
-
if (this.isOpen && this.selectionService.focused === undefined) {
|
|
783
|
-
if (this.dataService.itemsCount > 0) {
|
|
784
|
-
this.selectionService.focused = this.firstFocusableIndex(0);
|
|
785
|
-
}
|
|
786
|
-
else if (this.allowCustom) {
|
|
787
|
-
this.selectionService.focused = -1;
|
|
788
|
-
}
|
|
789
|
-
}
|
|
790
|
-
if (this.valuePrimitive && !this.valueField) {
|
|
791
|
-
this.selectedDataItems = value.slice();
|
|
792
|
-
}
|
|
793
|
-
if (isObjectArray(value) || this.valuePrimitive && this.valueField) {
|
|
794
|
-
this.selectedDataItems = resolveAllValues(value, data, this.valueField);
|
|
795
|
-
}
|
|
796
|
-
if (this.selectedDataItems.length < value.length) {
|
|
797
|
-
this.selectedDataItems = value
|
|
798
|
-
.map(function (current) {
|
|
799
|
-
var dataItem = _this.selectedDataItems.find(function (item) { return getter(item, _this.valueField) === getter(current, _this.valueField); });
|
|
800
|
-
return isPresent(dataItem) ? dataItem : _this.resolveDataItemFromTags(current);
|
|
801
|
-
})
|
|
802
|
-
.filter(function (dataItem) { return isPresent(dataItem); });
|
|
803
|
-
}
|
|
804
|
-
this.tags = this.tagMapper(this.selectedDataItems.slice(0));
|
|
805
|
-
this.disabledIndices = this.disabledItemsMapper();
|
|
806
|
-
this.cdr.markForCheck();
|
|
807
|
-
};
|
|
808
|
-
/**
|
|
809
|
-
* @hidden
|
|
810
|
-
*/
|
|
811
|
-
MultiSelectComponent.prototype.handleFilter = function (text) {
|
|
812
|
-
this.text = text;
|
|
813
|
-
if (text && !this.isOpen) {
|
|
814
|
-
this.openPopup();
|
|
815
|
-
}
|
|
816
|
-
if (this.filterable) {
|
|
817
|
-
this.filterChange.emit(text);
|
|
818
|
-
}
|
|
819
|
-
else {
|
|
820
|
-
this.searchTextAndFocus(text);
|
|
821
|
-
}
|
|
822
|
-
this.searchbar.setInputSize();
|
|
823
|
-
};
|
|
824
|
-
/**
|
|
825
|
-
* @hidden
|
|
826
|
-
*/
|
|
827
|
-
MultiSelectComponent.prototype.pageChange = function (event) {
|
|
828
|
-
var virtual = this.virtual;
|
|
829
|
-
virtual.skip = event.skip;
|
|
830
|
-
};
|
|
831
|
-
/**
|
|
832
|
-
* @hidden
|
|
833
|
-
*/
|
|
834
|
-
MultiSelectComponent.prototype.clearFilter = function () {
|
|
835
|
-
if (this.filterable && this.text) {
|
|
836
|
-
this.filterChange.emit("");
|
|
837
|
-
}
|
|
838
|
-
this.text = "";
|
|
839
|
-
/* Clearing the value from the input as the setInputSize calculation will be incorrect otherwise.
|
|
840
|
-
Calling cdr.detectChanges to clear the input value as a result of property binding
|
|
841
|
-
causes JAWS to read outdated tag values in IE upon tag selection for some reason. */
|
|
842
|
-
this.searchbar.input.nativeElement.value = "";
|
|
843
|
-
this.searchbar.setInputSize();
|
|
844
|
-
};
|
|
845
|
-
/**
|
|
846
|
-
* @hidden
|
|
847
|
-
*/
|
|
848
|
-
MultiSelectComponent.prototype.handleNavigate = function (event) {
|
|
849
|
-
var navigateInput = this.text && event.keyCode !== Keys.ArrowDown && event.keyCode !== Keys.ArrowUp;
|
|
850
|
-
var selectValue = this.text && event.keyCode === Keys.Enter || event.keyCode === Keys.Escape;
|
|
851
|
-
var deleteTag = !this.text && event.keyCode === Keys.Backspace && this.tags.length > 0;
|
|
852
|
-
if (deleteTag) {
|
|
853
|
-
this.handleBackspace();
|
|
854
|
-
return;
|
|
855
|
-
}
|
|
856
|
-
if (this.disabled || navigateInput && !selectValue) {
|
|
857
|
-
return;
|
|
858
|
-
}
|
|
859
|
-
var eventData = event;
|
|
860
|
-
var focused = isNaN(this.selectionService.focused) ? -1 : this.selectionService.focused;
|
|
861
|
-
var action = this.navigationService.process({
|
|
862
|
-
current: focused,
|
|
863
|
-
max: this.dataService.itemsCount - 1,
|
|
864
|
-
min: this.allowCustom && this.text ? -1 : 0,
|
|
865
|
-
open: this.isOpen,
|
|
866
|
-
originalEvent: eventData
|
|
867
|
-
});
|
|
868
|
-
if (action !== NavigationAction.Undefined &&
|
|
869
|
-
((action === NavigationAction.Enter && this.isOpen) || action !== NavigationAction.Enter)) {
|
|
870
|
-
event.preventDefault();
|
|
871
|
-
}
|
|
872
|
-
};
|
|
873
|
-
/**
|
|
874
|
-
* @hidden
|
|
875
|
-
*/
|
|
876
|
-
MultiSelectComponent.prototype.handleRemoveTag = function (_a) {
|
|
877
|
-
var tag = _a.tag;
|
|
878
|
-
var eventArgs = new RemoveTagEvent(tag);
|
|
879
|
-
if (this.disabled || this.readonly) {
|
|
880
|
-
return;
|
|
881
|
-
}
|
|
882
|
-
this.focus();
|
|
883
|
-
this.removeTag.emit(eventArgs);
|
|
884
|
-
if (eventArgs.isDefaultPrevented()) {
|
|
885
|
-
return;
|
|
886
|
-
}
|
|
887
|
-
if (tag instanceof Array) {
|
|
888
|
-
this.removeGroupTag(tag);
|
|
889
|
-
}
|
|
890
|
-
else {
|
|
891
|
-
this.removeSingleTag(tag);
|
|
892
|
-
}
|
|
893
|
-
this.cdr.detectChanges();
|
|
894
|
-
};
|
|
895
|
-
/**
|
|
896
|
-
* @hidden
|
|
897
|
-
*/
|
|
898
|
-
MultiSelectComponent.prototype.clearAll = function (event) {
|
|
899
|
-
var _this = this;
|
|
900
|
-
event.stopImmediatePropagation();
|
|
901
|
-
event.preventDefault();
|
|
902
|
-
this.focus();
|
|
903
|
-
this.clearFilter();
|
|
904
|
-
var selected = this.selectionService.selected;
|
|
905
|
-
this.value = this.value.filter(function (_item, index) { return _this.disabledItemsService.isIndexDisabled(selected[index]); });
|
|
906
|
-
this.emitValueChange();
|
|
907
|
-
};
|
|
908
|
-
/**
|
|
909
|
-
* @hidden
|
|
910
|
-
*/
|
|
911
|
-
MultiSelectComponent.prototype.addCustomValue = function (text) {
|
|
912
|
-
this.customValueSubject.next(text);
|
|
913
|
-
};
|
|
914
|
-
MultiSelectComponent.prototype.ngAfterContentChecked = function () {
|
|
915
|
-
this.verifySettings();
|
|
916
|
-
};
|
|
917
|
-
MultiSelectComponent.prototype.ngDoCheck = function () {
|
|
918
|
-
var valueChanges = this.differ && this.differ.diff(this.value);
|
|
919
|
-
if (valueChanges && !this.valueChangeDetected) {
|
|
920
|
-
this.setState(this.value);
|
|
921
|
-
}
|
|
922
|
-
this.valueChangeDetected = false;
|
|
923
|
-
};
|
|
924
|
-
MultiSelectComponent.prototype.ngOnInit = function () {
|
|
925
|
-
var _this = this;
|
|
926
|
-
this.renderer.removeAttribute(this.wrapper.nativeElement, "tabindex");
|
|
927
|
-
this.createCustomValueStream();
|
|
928
|
-
this.localizationChangeSubscription = this.localization
|
|
929
|
-
.changes.subscribe(function (_a) {
|
|
930
|
-
var rtl = _a.rtl;
|
|
931
|
-
_this.direction = rtl ? 'rtl' : 'ltr';
|
|
932
|
-
_this.cdr.markForCheck();
|
|
933
|
-
});
|
|
934
|
-
this.setState(this.value);
|
|
935
|
-
this.setComponentClasses();
|
|
936
|
-
this.initialized = true;
|
|
937
|
-
};
|
|
938
|
-
MultiSelectComponent.prototype.ngOnChanges = function (changes) {
|
|
939
|
-
var virtual = this.virtual;
|
|
940
|
-
var requestInitialData = virtual && changes.data && changes.data.isFirstChange();
|
|
941
|
-
if (requestInitialData) {
|
|
942
|
-
this.pageChange({ skip: 0, take: virtual.pageSize });
|
|
943
|
-
}
|
|
944
|
-
if (isChanged('valueNormalizer', changes)) {
|
|
945
|
-
this.createCustomValueStream();
|
|
946
|
-
}
|
|
947
|
-
if (anyChanged(['textField', 'valueField', 'valuePrimitive'], changes)) {
|
|
948
|
-
this.setState(this.value);
|
|
949
|
-
}
|
|
950
|
-
};
|
|
951
|
-
MultiSelectComponent.prototype.ngAfterViewInit = function () {
|
|
952
|
-
this.searchbar.setInputSize();
|
|
953
|
-
};
|
|
954
|
-
MultiSelectComponent.prototype.ngOnDestroy = function () {
|
|
955
|
-
this._toggle(false);
|
|
956
|
-
this.unsubscribeEvents();
|
|
957
|
-
};
|
|
958
|
-
/**
|
|
959
|
-
* Toggles the visibility of the popup
|
|
960
|
-
* ([see example]({% slug openstate_multiselect %}#toc-setting-the-initially-opened-component)).
|
|
961
|
-
* If you use the `toggle` method to open or close the popup, the respective `open` and `close` events will not be fired.
|
|
962
|
-
*
|
|
963
|
-
* @param open - The state of the popup.
|
|
964
|
-
*/
|
|
965
|
-
MultiSelectComponent.prototype.toggle = function (open) {
|
|
966
|
-
var _this = this;
|
|
967
|
-
// The Promise is required for opening the popup on load.
|
|
968
|
-
// Otherwise, the "Expression has changed..." type error will be thrown.
|
|
969
|
-
Promise.resolve(null).then(function () {
|
|
970
|
-
var shouldOpen = isPresent(open) ? open : !_this._open;
|
|
971
|
-
_this._toggle(shouldOpen);
|
|
972
|
-
_this.cdr.markForCheck();
|
|
973
|
-
});
|
|
974
|
-
};
|
|
975
|
-
Object.defineProperty(MultiSelectComponent.prototype, "isOpen", {
|
|
976
|
-
/**
|
|
977
|
-
* Returns the current open state of the popup.
|
|
978
|
-
*/
|
|
979
|
-
get: function () {
|
|
980
|
-
return this._open;
|
|
981
|
-
},
|
|
982
|
-
enumerable: true,
|
|
983
|
-
configurable: true
|
|
984
|
-
});
|
|
985
|
-
/**
|
|
986
|
-
* Resets the value of the MultiSelect.
|
|
987
|
-
* If you use the `reset` method to clear the value of the component,
|
|
988
|
-
* the model will not update automatically and the `selectionChange` and `valueChange` events will not be fired.
|
|
989
|
-
*/
|
|
990
|
-
MultiSelectComponent.prototype.reset = function () {
|
|
991
|
-
this.text = "";
|
|
992
|
-
this.value = [];
|
|
993
|
-
};
|
|
994
|
-
/**
|
|
995
|
-
* @hidden
|
|
996
|
-
*/
|
|
997
|
-
MultiSelectComponent.prototype.messageFor = function (key) {
|
|
998
|
-
return this.localization.get(key);
|
|
999
|
-
};
|
|
1000
|
-
// NG MODEL BINDINGS
|
|
1001
|
-
/**
|
|
1002
|
-
* @hidden
|
|
1003
|
-
*/
|
|
1004
|
-
MultiSelectComponent.prototype.writeValue = function (value) {
|
|
1005
|
-
this.value = value || [];
|
|
1006
|
-
};
|
|
1007
|
-
/**
|
|
1008
|
-
* @hidden
|
|
1009
|
-
*/
|
|
1010
|
-
MultiSelectComponent.prototype.registerOnChange = function (fn) {
|
|
1011
|
-
this.onChangeCallback = fn;
|
|
1012
|
-
};
|
|
1013
|
-
/**
|
|
1014
|
-
* @hidden
|
|
1015
|
-
*/
|
|
1016
|
-
MultiSelectComponent.prototype.registerOnTouched = function (fn) {
|
|
1017
|
-
this.onTouchedCallback = fn;
|
|
1018
|
-
};
|
|
1019
|
-
/**
|
|
1020
|
-
* @hidden
|
|
1021
|
-
*/
|
|
1022
|
-
MultiSelectComponent.prototype.setDisabledState = function (isDisabled) {
|
|
1023
|
-
this.disabled = isDisabled;
|
|
1024
|
-
};
|
|
1025
|
-
/**
|
|
1026
|
-
* @hidden
|
|
1027
|
-
*/
|
|
1028
|
-
MultiSelectComponent.prototype.onTagMapperChange = function () {
|
|
1029
|
-
this.tags = this.tagMapper(this.selectedDataItems.slice(0));
|
|
1030
|
-
this.cdr.markForCheck();
|
|
1031
|
-
};
|
|
1032
|
-
Object.defineProperty(MultiSelectComponent.prototype, "isFocused", {
|
|
1033
|
-
get: function () {
|
|
1034
|
-
return this._isFocused;
|
|
1035
|
-
},
|
|
1036
|
-
set: function (isFocused) {
|
|
1037
|
-
this.renderer[isFocused ? 'addClass' : 'removeClass'](this.wrapper.nativeElement, 'k-focus');
|
|
1038
|
-
this._isFocused = isFocused;
|
|
1039
|
-
},
|
|
1040
|
-
enumerable: true,
|
|
1041
|
-
configurable: true
|
|
1042
|
-
});
|
|
1043
|
-
MultiSelectComponent.prototype.subscribeEvents = function () {
|
|
1044
|
-
var _this = this;
|
|
1045
|
-
if (!isDocumentAvailable()) {
|
|
1046
|
-
return;
|
|
1047
|
-
}
|
|
1048
|
-
var isOpen = function () { return _this.isOpen; };
|
|
1049
|
-
var isClosed = function () { return !_this.isOpen; };
|
|
1050
|
-
var isTagFocused = function () { return !_this.isOpen && _this.focusedTagIndex !== undefined; };
|
|
1051
|
-
[
|
|
1052
|
-
this.selectionService.onChange.subscribe(this.handleItemChange.bind(this)),
|
|
1053
|
-
this.navigationService.esc.subscribe(this.closePopup.bind(this)),
|
|
1054
|
-
this.navigationService.enter.pipe(filter(isOpen)).subscribe(this.handleEnter.bind(this)),
|
|
1055
|
-
this.navigationService.open.subscribe(this.openPopup.bind(this)),
|
|
1056
|
-
this.navigationService.close.subscribe(this.handleClose.bind(this)),
|
|
1057
|
-
this.navigationService.up.pipe(filter(isOpen)).subscribe(function (event) { return _this.handleUp(event.index); }),
|
|
1058
|
-
this.navigationService.home.pipe(filter(function () { return isClosed; })).subscribe(this.handleHome.bind(this)),
|
|
1059
|
-
this.navigationService.end.pipe(filter(function () { return isClosed; })).subscribe(this.handleEnd.bind(this)),
|
|
1060
|
-
this.navigationService.backspace.pipe(filter(isTagFocused)).subscribe(this.handleBackspace.bind(this)),
|
|
1061
|
-
this.navigationService.delete.pipe(filter(isTagFocused)).subscribe(this.handleDelete.bind(this)),
|
|
1062
|
-
this.navigationService.left.subscribe(this.direction === 'rtl' ? this.handleRightKey.bind(this) : this.handleLeftKey.bind(this)),
|
|
1063
|
-
this.navigationService.right.subscribe(this.direction === 'rtl' ? this.handleLeftKey.bind(this) : this.handleRightKey.bind(this)),
|
|
1064
|
-
this.navigationService.down.subscribe(function (event) { return _this.handleDownKey(event.index); })
|
|
1065
|
-
].forEach(function (s) { return _this.observableSubscriptions.add(s); });
|
|
1066
|
-
};
|
|
1067
|
-
MultiSelectComponent.prototype.subscribeTouchEvents = function () {
|
|
1068
|
-
var _this = this;
|
|
1069
|
-
if (!isDocumentAvailable() || !this.touchEnabled) {
|
|
1070
|
-
return;
|
|
1071
|
-
}
|
|
1072
|
-
this._zone.runOutsideAngular(function () {
|
|
1073
|
-
// Roll up MultiSelect on iOS when tapped outside
|
|
1074
|
-
return _this.touchstartDisposeHandler = _this.renderer.listen(document, 'touchstart', function (e) {
|
|
1075
|
-
var target = e.target;
|
|
1076
|
-
if ((_this.isFocused || _this.isOpen) && !inDropDown(_this.wrapper, target, _this.popupRef)) {
|
|
1077
|
-
_this._zone.run(function () {
|
|
1078
|
-
_this.blur();
|
|
1079
|
-
if (_this.isOpen) {
|
|
1080
|
-
_this.togglePopup(false);
|
|
1081
|
-
}
|
|
1082
|
-
});
|
|
1083
|
-
}
|
|
1084
|
-
});
|
|
1085
|
-
});
|
|
1086
|
-
};
|
|
1087
|
-
MultiSelectComponent.prototype.unsubscribeEvents = function () {
|
|
1088
|
-
if (!isDocumentAvailable()) {
|
|
1089
|
-
return;
|
|
1090
|
-
}
|
|
1091
|
-
this.observableSubscriptions.unsubscribe();
|
|
1092
|
-
if (this.customValueSubscription) {
|
|
1093
|
-
this.customValueSubscription.unsubscribe();
|
|
1094
|
-
}
|
|
1095
|
-
if (this.localizationChangeSubscription) {
|
|
1096
|
-
this.localizationChangeSubscription.unsubscribe();
|
|
1097
|
-
}
|
|
1098
|
-
if (this.touchstartDisposeHandler) {
|
|
1099
|
-
this.touchstartDisposeHandler();
|
|
1100
|
-
}
|
|
1101
|
-
};
|
|
1102
|
-
MultiSelectComponent.prototype.removeGroupTag = function (dataItems) {
|
|
1103
|
-
var _this = this;
|
|
1104
|
-
var data = this.dataService.data;
|
|
1105
|
-
if (this.dataService.grouped) {
|
|
1106
|
-
data = data.filter(function (item) { return !item.header; }).map(function (item) { return item.value; });
|
|
1107
|
-
}
|
|
1108
|
-
var dataItemValues = new Set(dataItems.map(function (item) { return getter(item, _this.valueField); }));
|
|
1109
|
-
this.value = this.value.filter(function (value) {
|
|
1110
|
-
var index = selectedIndices([value], data, _this.valueField)[0];
|
|
1111
|
-
var isDataItemDisabled = _this.disabledItemsService.isIndexDisabled(index);
|
|
1112
|
-
return !dataItemValues.has(getter(value, _this.valueField)) || isDataItemDisabled;
|
|
1113
|
-
});
|
|
1114
|
-
this.emitValueChange();
|
|
1115
|
-
};
|
|
1116
|
-
MultiSelectComponent.prototype.removeSingleTag = function (dataItem) {
|
|
1117
|
-
var _this = this;
|
|
1118
|
-
var data = this.dataService.data;
|
|
1119
|
-
if (this.dataService.grouped) {
|
|
1120
|
-
data = data.filter(function (item) { return !item.header; }).map(function (item) { return item.value; });
|
|
1121
|
-
}
|
|
1122
|
-
var index = selectedIndices([dataItem], data, this.valueField)[0];
|
|
1123
|
-
if (this.disabledItemsService.isIndexDisabled(index)) {
|
|
1124
|
-
return;
|
|
1125
|
-
}
|
|
1126
|
-
if (isNumber(index)) {
|
|
1127
|
-
this.selectionService.unselect(index);
|
|
1128
|
-
this.selectionService.focused = index;
|
|
1129
|
-
this.togglePopup(false);
|
|
1130
|
-
}
|
|
1131
|
-
else { // the deleted item is not present in the source
|
|
1132
|
-
var filter_2 = function (item) { return getter(item, _this.valueField) !== getter(dataItem, _this.valueField); };
|
|
1133
|
-
this.value = this.value.filter(filter_2);
|
|
1134
|
-
this.emitValueChange();
|
|
1135
|
-
}
|
|
1136
|
-
};
|
|
1137
|
-
/**
|
|
1138
|
-
* @hidden
|
|
1139
|
-
*
|
|
1140
|
-
* Determines which of the provided tags should be disabled and stores their position indices
|
|
1141
|
-
*/
|
|
1142
|
-
MultiSelectComponent.prototype.disabledItemsMapper = function () {
|
|
1143
|
-
var _this = this;
|
|
1144
|
-
var selected = this.selectionService.selected;
|
|
1145
|
-
return new Set(this.selectedDataItems.reduce(function (indices, _item, index) {
|
|
1146
|
-
if (_this.disabledItemsService.isIndexDisabled(selected[index])) {
|
|
1147
|
-
indices.push(index);
|
|
1148
|
-
}
|
|
1149
|
-
return indices;
|
|
1150
|
-
}, []));
|
|
1151
|
-
};
|
|
1152
|
-
MultiSelectComponent.prototype.createCustomValueStream = function () {
|
|
1153
|
-
var _this = this;
|
|
1154
|
-
if (this.customValueSubscription) {
|
|
1155
|
-
this.customValueSubscription.unsubscribe();
|
|
1156
|
-
}
|
|
1157
|
-
this.customValueSubscription = this.customValueSubject.pipe(tap(function () {
|
|
1158
|
-
_this.loading = true;
|
|
1159
|
-
_this.disabled = true;
|
|
1160
|
-
_this.cdr.detectChanges();
|
|
1161
|
-
}), this.valueNormalizer, catchError(function () {
|
|
1162
|
-
_this.loading = false;
|
|
1163
|
-
_this.disabled = false;
|
|
1164
|
-
if (_this.autoClose) {
|
|
1165
|
-
_this.togglePopup(false);
|
|
1166
|
-
}
|
|
1167
|
-
if (_this.autoClose || !_this.filterable) {
|
|
1168
|
-
_this.clearFilter();
|
|
1169
|
-
}
|
|
1170
|
-
_this.nextTick(function () {
|
|
1171
|
-
_this.searchbar.focus();
|
|
1172
|
-
});
|
|
1173
|
-
_this.createCustomValueStream();
|
|
1174
|
-
return of(null);
|
|
1175
|
-
}))
|
|
1176
|
-
.subscribe(function (normalizedValue) {
|
|
1177
|
-
_this.loading = false;
|
|
1178
|
-
_this.disabled = false;
|
|
1179
|
-
if (isPresent(normalizedValue)) { // if valueNormalizer returns `null` or `undefined` custom value is discarded
|
|
1180
|
-
var newValue_1 = _this.valuePrimitive ? getter(normalizedValue, _this.valueField) : normalizedValue;
|
|
1181
|
-
var itemIndex = _this.dataService.indexOf(newValue_1);
|
|
1182
|
-
var customItem = itemIndex === -1;
|
|
1183
|
-
if (_this.value.indexOf(newValue_1) === -1) {
|
|
1184
|
-
_this.tags = _this.tagMapper(_this.selectedDataItems.concat([normalizedValue]));
|
|
1185
|
-
if (!customItem) {
|
|
1186
|
-
_this.selectionService.add(itemIndex);
|
|
1187
|
-
}
|
|
1188
|
-
else {
|
|
1189
|
-
_this.value = _this.value.concat([newValue_1]);
|
|
1190
|
-
}
|
|
1191
|
-
}
|
|
1192
|
-
else {
|
|
1193
|
-
if (!customItem && _this.selectionService.isSelected(itemIndex)) {
|
|
1194
|
-
_this.selectionService.unselect(itemIndex);
|
|
1195
|
-
_this.selectionService.focused = itemIndex;
|
|
1196
|
-
}
|
|
1197
|
-
else {
|
|
1198
|
-
_this.value = _this.value.filter(function (item) { return getter(item, _this.valueField) !== newValue_1; });
|
|
1199
|
-
}
|
|
1200
|
-
}
|
|
1201
|
-
_this.emitValueChange();
|
|
1202
|
-
}
|
|
1203
|
-
if (_this.autoClose) {
|
|
1204
|
-
_this.togglePopup(false);
|
|
1205
|
-
}
|
|
1206
|
-
if (_this.autoClose || !_this.filterable) {
|
|
1207
|
-
_this.clearFilter();
|
|
1208
|
-
}
|
|
1209
|
-
_this.nextTick(function () {
|
|
1210
|
-
_this.searchbar.focus();
|
|
1211
|
-
});
|
|
1212
|
-
});
|
|
1213
|
-
};
|
|
1214
|
-
MultiSelectComponent.prototype.handleItemChange = function (event) {
|
|
1215
|
-
this.change(event);
|
|
1216
|
-
if (this.autoClose) {
|
|
1217
|
-
this.togglePopup(false);
|
|
1218
|
-
}
|
|
1219
|
-
if (this.autoClose || !this.filterable) {
|
|
1220
|
-
this.clearFilter();
|
|
1221
|
-
}
|
|
1222
|
-
};
|
|
1223
|
-
MultiSelectComponent.prototype.handleEnter = function (event) {
|
|
1224
|
-
var service = this.selectionService;
|
|
1225
|
-
var focusedIndex = this.selectionService.focused;
|
|
1226
|
-
if (this.isOpen) {
|
|
1227
|
-
event.originalEvent.preventDefault();
|
|
1228
|
-
}
|
|
1229
|
-
if (focusedIndex === -1) {
|
|
1230
|
-
if (this.allowCustom && this.text) {
|
|
1231
|
-
this.addCustomValue(this.text);
|
|
1232
|
-
}
|
|
1233
|
-
return; // Clear filter & close are done at customValueSubscription due to race conditions.
|
|
1234
|
-
}
|
|
1235
|
-
if (service.isSelected(focusedIndex)) {
|
|
1236
|
-
service.unselect(focusedIndex);
|
|
1237
|
-
service.focused = focusedIndex;
|
|
1238
|
-
}
|
|
1239
|
-
else {
|
|
1240
|
-
service.add(focusedIndex);
|
|
1241
|
-
}
|
|
1242
|
-
if (this.autoClose) {
|
|
1243
|
-
this.togglePopup(false);
|
|
1244
|
-
}
|
|
1245
|
-
if (this.autoClose || !this.filterable) {
|
|
1246
|
-
this.clearFilter();
|
|
1247
|
-
}
|
|
1248
|
-
};
|
|
1249
|
-
MultiSelectComponent.prototype.handleClose = function () {
|
|
1250
|
-
this.closePopup();
|
|
1251
|
-
this.searchbar.focus();
|
|
1252
|
-
};
|
|
1253
|
-
MultiSelectComponent.prototype.handleEnd = function () {
|
|
1254
|
-
this.focusedTagIndex = this.tags.length - 1;
|
|
1255
|
-
};
|
|
1256
|
-
MultiSelectComponent.prototype.handleHome = function () {
|
|
1257
|
-
this.focusedTagIndex = 0;
|
|
1258
|
-
};
|
|
1259
|
-
MultiSelectComponent.prototype.handleUp = function (index) {
|
|
1260
|
-
this.selectionService.focused = index;
|
|
1261
|
-
};
|
|
1262
|
-
MultiSelectComponent.prototype.handleBackspace = function () {
|
|
1263
|
-
if (this.focusedTagIndex !== undefined) {
|
|
1264
|
-
this.handleDelete();
|
|
1265
|
-
}
|
|
1266
|
-
else {
|
|
1267
|
-
this.handleRemoveTag({ tag: this.tags[this.tags.length - 1] });
|
|
1268
|
-
this.searchbar.focus();
|
|
1269
|
-
}
|
|
1270
|
-
};
|
|
1271
|
-
MultiSelectComponent.prototype.handleDelete = function () {
|
|
1272
|
-
this.handleRemoveTag({ tag: this.tags[this.focusedTagIndex] });
|
|
1273
|
-
if (this.focusedTagIndex === this.tags.length) {
|
|
1274
|
-
this.focusedTagIndex = undefined;
|
|
1275
|
-
}
|
|
1276
|
-
};
|
|
1277
|
-
MultiSelectComponent.prototype.handleLeftKey = function () {
|
|
1278
|
-
if (this.focusedTagIndex === undefined || this.focusedTagIndex < 0) {
|
|
1279
|
-
this.focusedTagIndex = this.tags.length - 1;
|
|
1280
|
-
}
|
|
1281
|
-
else if (this.focusedTagIndex !== 0) {
|
|
1282
|
-
this.focusedTagIndex--;
|
|
1283
|
-
}
|
|
1284
|
-
};
|
|
1285
|
-
MultiSelectComponent.prototype.handleDownKey = function (index) {
|
|
1286
|
-
if (this.isOpen) {
|
|
1287
|
-
this.selectionService.focused = index || this.firstFocusableIndex(0);
|
|
1288
|
-
}
|
|
1289
|
-
else {
|
|
1290
|
-
this.openPopup();
|
|
1291
|
-
}
|
|
1292
|
-
};
|
|
1293
|
-
MultiSelectComponent.prototype.handleRightKey = function () {
|
|
1294
|
-
var last = this.tags.length - 1;
|
|
1295
|
-
if (this.focusedTagIndex === last) {
|
|
1296
|
-
this.focusedTagIndex = undefined;
|
|
1297
|
-
}
|
|
1298
|
-
else if (this.focusedTagIndex < last) {
|
|
1299
|
-
this.focusedTagIndex++;
|
|
1300
|
-
}
|
|
1301
|
-
};
|
|
1302
|
-
MultiSelectComponent.prototype.findIndex = function (text, startsFrom) {
|
|
1303
|
-
var _this = this;
|
|
1304
|
-
if (startsFrom === void 0) { startsFrom = 0; }
|
|
1305
|
-
var itemText;
|
|
1306
|
-
text = text.toLowerCase();
|
|
1307
|
-
var index = this.dataService.findIndex(function (item) {
|
|
1308
|
-
if (_this.dataService.grouped) {
|
|
1309
|
-
itemText = getter(item.value, _this.textField);
|
|
1310
|
-
}
|
|
1311
|
-
else {
|
|
1312
|
-
itemText = getter(item, _this.textField);
|
|
1313
|
-
}
|
|
1314
|
-
itemText = !isPresent(itemText) ? "" : itemText.toString().toLowerCase();
|
|
1315
|
-
return text && itemText.startsWith(text);
|
|
1316
|
-
}, startsFrom);
|
|
1317
|
-
if (this.disabledItemsService.isIndexDisabled(index)) {
|
|
1318
|
-
return (index + 1 > this.dataService.itemsCount) ? -1 : this.findIndex(text, index + 1);
|
|
1319
|
-
}
|
|
1320
|
-
else {
|
|
1321
|
-
return index;
|
|
1322
|
-
}
|
|
1323
|
-
};
|
|
1324
|
-
MultiSelectComponent.prototype.searchTextAndFocus = function (text) {
|
|
1325
|
-
var index = this.findIndex(text);
|
|
1326
|
-
this.selectionService.focused = index;
|
|
1327
|
-
};
|
|
1328
|
-
MultiSelectComponent.prototype.closePopup = function () {
|
|
1329
|
-
this.togglePopup(false);
|
|
1330
|
-
this.focusedTagIndex = undefined;
|
|
1331
|
-
};
|
|
1332
|
-
MultiSelectComponent.prototype.openPopup = function () {
|
|
1333
|
-
this.togglePopup(true);
|
|
1334
|
-
this.focusedTagIndex = undefined;
|
|
1335
|
-
};
|
|
1336
|
-
MultiSelectComponent.prototype.togglePopup = function (open) {
|
|
1337
|
-
var isDisabled = this.disabled || this.readonly;
|
|
1338
|
-
var sameState = this.isOpen === open;
|
|
1339
|
-
if (isDisabled || sameState) {
|
|
1340
|
-
return;
|
|
1341
|
-
}
|
|
1342
|
-
var isDefaultPrevented = this.triggerPopupEvents(open);
|
|
1343
|
-
if (!isDefaultPrevented) {
|
|
1344
|
-
this._toggle(open);
|
|
1345
|
-
}
|
|
1346
|
-
};
|
|
1347
|
-
MultiSelectComponent.prototype.triggerPopupEvents = function (open) {
|
|
1348
|
-
var eventArgs = new PreventableEvent();
|
|
1349
|
-
if (open) {
|
|
1350
|
-
this.open.emit(eventArgs);
|
|
1351
|
-
}
|
|
1352
|
-
else {
|
|
1353
|
-
this.close.emit(eventArgs);
|
|
1354
|
-
}
|
|
1355
|
-
return eventArgs.isDefaultPrevented();
|
|
1356
|
-
};
|
|
1357
|
-
MultiSelectComponent.prototype._toggle = function (open) {
|
|
1358
|
-
this._open = open;
|
|
1359
|
-
this.destroyPopup();
|
|
1360
|
-
if (this._open) {
|
|
1361
|
-
this.createPopup();
|
|
1362
|
-
}
|
|
1363
|
-
};
|
|
1364
|
-
MultiSelectComponent.prototype.destroyPopup = function () {
|
|
1365
|
-
if (this.popupRef) {
|
|
1366
|
-
this.popupRef.popupElement
|
|
1367
|
-
.removeEventListener('mousedown', this.popupMouseDownHandler);
|
|
1368
|
-
this.popupRef.close();
|
|
1369
|
-
this.popupRef = null;
|
|
1370
|
-
}
|
|
1371
|
-
};
|
|
1372
|
-
MultiSelectComponent.prototype.createPopup = function () {
|
|
1373
|
-
var _this = this;
|
|
1374
|
-
if (this.virtual) {
|
|
1375
|
-
this.virtual.skip = 0;
|
|
1376
|
-
}
|
|
1377
|
-
var horizontalAlign = this.direction === "rtl" ? "right" : "left";
|
|
1378
|
-
var anchorPosition = { horizontal: horizontalAlign, vertical: "bottom" };
|
|
1379
|
-
var popupPosition = { horizontal: horizontalAlign, vertical: "top" };
|
|
1380
|
-
this.popupRef = this.popupService.open({
|
|
1381
|
-
anchor: this.wrapper,
|
|
1382
|
-
anchorAlign: anchorPosition,
|
|
1383
|
-
animate: this.popupSettings.animate,
|
|
1384
|
-
appendTo: this.appendTo,
|
|
1385
|
-
content: this.popupTemplate,
|
|
1386
|
-
popupAlign: popupPosition,
|
|
1387
|
-
popupClass: this.listContainerClasses,
|
|
1388
|
-
positionMode: 'absolute'
|
|
1389
|
-
});
|
|
1390
|
-
var popupWrapper = this.popupRef.popupElement;
|
|
1391
|
-
var _a = this.width, min = _a.min, max = _a.max;
|
|
1392
|
-
popupWrapper.addEventListener('mousedown', this.popupMouseDownHandler);
|
|
1393
|
-
popupWrapper.style.minWidth = min;
|
|
1394
|
-
popupWrapper.style.width = max;
|
|
1395
|
-
popupWrapper.style.height = this.height;
|
|
1396
|
-
popupWrapper.setAttribute("dir", this.direction);
|
|
1397
|
-
this.popupRef.popupOpen.subscribe(function () {
|
|
1398
|
-
_this.cdr.detectChanges();
|
|
1399
|
-
_this.optionsList.scrollToItem(_this.selectionService.focused);
|
|
1400
|
-
_this.opened.emit();
|
|
1401
|
-
});
|
|
1402
|
-
this.popupRef.popupClose.subscribe(function () {
|
|
1403
|
-
_this.closed.emit();
|
|
1404
|
-
});
|
|
1405
|
-
this.popupRef.popupAnchorViewportLeave.subscribe(function () {
|
|
1406
|
-
_this.togglePopup(false);
|
|
1407
|
-
});
|
|
1408
|
-
};
|
|
1409
|
-
MultiSelectComponent.prototype.emitValueChange = function () {
|
|
1410
|
-
this.onChangeCallback(this.value);
|
|
1411
|
-
this.valueChange.emit(this.value);
|
|
1412
|
-
};
|
|
1413
|
-
MultiSelectComponent.prototype.resolveDataItemFromTags = function (value) {
|
|
1414
|
-
var _this = this;
|
|
1415
|
-
if (!(this.tags && this.tags.length && isPresent(value))) {
|
|
1416
|
-
return undefined;
|
|
1417
|
-
}
|
|
1418
|
-
// Flattening the tags array in case of a summary tag occurrence.
|
|
1419
|
-
var tags = this.tags.reduce(function (acc, tag) {
|
|
1420
|
-
var items = isArray(tag) ? tag : [tag];
|
|
1421
|
-
acc.push.apply(acc, items);
|
|
1422
|
-
return acc;
|
|
1423
|
-
}, []);
|
|
1424
|
-
return tags.find(function (tag) { return getter(tag, _this.valueField) === getter(value, _this.valueField); });
|
|
1425
|
-
};
|
|
1426
|
-
MultiSelectComponent.prototype.firstFocusableIndex = function (index) {
|
|
1427
|
-
var maxIndex = this.dataService.itemsCount;
|
|
1428
|
-
if (this.disabledItemsService.isIndexDisabled(index)) {
|
|
1429
|
-
var nextIndex = index + 1;
|
|
1430
|
-
return (nextIndex < maxIndex) ? this.firstFocusableIndex(nextIndex) : undefined;
|
|
1431
|
-
}
|
|
1432
|
-
else {
|
|
1433
|
-
return index;
|
|
1434
|
-
}
|
|
1435
|
-
};
|
|
1436
|
-
MultiSelectComponent.prototype.nextTick = function (f) {
|
|
1437
|
-
var _this = this;
|
|
1438
|
-
this._zone.runOutsideAngular(function () {
|
|
1439
|
-
// Use `setTimeout` instead of a resolved promise
|
|
1440
|
-
// because the latter does not wait long enough.
|
|
1441
|
-
setTimeout(function () { return _this._zone.run(f); });
|
|
1442
|
-
});
|
|
1443
|
-
};
|
|
1444
|
-
MultiSelectComponent.prototype.setComponentClasses = function () {
|
|
1445
|
-
if (this.size) {
|
|
1446
|
-
this.renderer.addClass(this.wrapper.nativeElement, getSizeClass('input', this.size));
|
|
1447
|
-
}
|
|
1448
|
-
if (this.rounded) {
|
|
1449
|
-
this.renderer.addClass(this.wrapper.nativeElement, getRoundedClass(this.rounded));
|
|
1450
|
-
}
|
|
1451
|
-
if (this.fillMode) {
|
|
1452
|
-
this.renderer.addClass(this.wrapper.nativeElement, getFillModeClass('input', this.fillMode));
|
|
1453
|
-
}
|
|
1454
|
-
};
|
|
1455
|
-
var MultiSelectComponent_1;
|
|
1456
|
-
tslib_1.__decorate([
|
|
1457
|
-
Input(),
|
|
1458
|
-
tslib_1.__metadata("design:type", String)
|
|
1459
|
-
], MultiSelectComponent.prototype, "focusableId", void 0);
|
|
1460
|
-
tslib_1.__decorate([
|
|
1461
|
-
Input(),
|
|
1462
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
1463
|
-
], MultiSelectComponent.prototype, "autoClose", void 0);
|
|
1464
|
-
tslib_1.__decorate([
|
|
1465
|
-
Input(),
|
|
1466
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
1467
|
-
], MultiSelectComponent.prototype, "loading", void 0);
|
|
1468
|
-
tslib_1.__decorate([
|
|
1469
|
-
Input(),
|
|
1470
|
-
tslib_1.__metadata("design:type", Array),
|
|
1471
|
-
tslib_1.__metadata("design:paramtypes", [Array])
|
|
1472
|
-
], MultiSelectComponent.prototype, "data", null);
|
|
1473
|
-
tslib_1.__decorate([
|
|
1474
|
-
Input(),
|
|
1475
|
-
tslib_1.__metadata("design:type", Array),
|
|
1476
|
-
tslib_1.__metadata("design:paramtypes", [Array])
|
|
1477
|
-
], MultiSelectComponent.prototype, "value", null);
|
|
1478
|
-
tslib_1.__decorate([
|
|
1479
|
-
Input(),
|
|
1480
|
-
tslib_1.__metadata("design:type", String)
|
|
1481
|
-
], MultiSelectComponent.prototype, "valueField", void 0);
|
|
1482
|
-
tslib_1.__decorate([
|
|
1483
|
-
Input(),
|
|
1484
|
-
tslib_1.__metadata("design:type", String)
|
|
1485
|
-
], MultiSelectComponent.prototype, "textField", void 0);
|
|
1486
|
-
tslib_1.__decorate([
|
|
1487
|
-
Input(),
|
|
1488
|
-
tslib_1.__metadata("design:type", Number)
|
|
1489
|
-
], MultiSelectComponent.prototype, "tabindex", void 0);
|
|
1490
|
-
tslib_1.__decorate([
|
|
1491
|
-
Input("tabIndex"),
|
|
1492
|
-
tslib_1.__metadata("design:type", Number),
|
|
1493
|
-
tslib_1.__metadata("design:paramtypes", [Number])
|
|
1494
|
-
], MultiSelectComponent.prototype, "tabIndex", null);
|
|
1495
|
-
tslib_1.__decorate([
|
|
1496
|
-
Input(),
|
|
1497
|
-
tslib_1.__metadata("design:type", String),
|
|
1498
|
-
tslib_1.__metadata("design:paramtypes", [String])
|
|
1499
|
-
], MultiSelectComponent.prototype, "size", null);
|
|
1500
|
-
tslib_1.__decorate([
|
|
1501
|
-
Input(),
|
|
1502
|
-
tslib_1.__metadata("design:type", String),
|
|
1503
|
-
tslib_1.__metadata("design:paramtypes", [String])
|
|
1504
|
-
], MultiSelectComponent.prototype, "rounded", null);
|
|
1505
|
-
tslib_1.__decorate([
|
|
1506
|
-
Input(),
|
|
1507
|
-
tslib_1.__metadata("design:type", String),
|
|
1508
|
-
tslib_1.__metadata("design:paramtypes", [String])
|
|
1509
|
-
], MultiSelectComponent.prototype, "fillMode", null);
|
|
1510
|
-
tslib_1.__decorate([
|
|
1511
|
-
Input(),
|
|
1512
|
-
tslib_1.__metadata("design:type", String),
|
|
1513
|
-
tslib_1.__metadata("design:paramtypes", [String])
|
|
1514
|
-
], MultiSelectComponent.prototype, "placeholder", null);
|
|
1515
|
-
tslib_1.__decorate([
|
|
1516
|
-
Input(),
|
|
1517
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
1518
|
-
], MultiSelectComponent.prototype, "disabled", void 0);
|
|
1519
|
-
tslib_1.__decorate([
|
|
1520
|
-
Input(),
|
|
1521
|
-
tslib_1.__metadata("design:type", Function),
|
|
1522
|
-
tslib_1.__metadata("design:paramtypes", [Function])
|
|
1523
|
-
], MultiSelectComponent.prototype, "itemDisabled", null);
|
|
1524
|
-
tslib_1.__decorate([
|
|
1525
|
-
Input(),
|
|
1526
|
-
tslib_1.__metadata("design:type", Object),
|
|
1527
|
-
tslib_1.__metadata("design:paramtypes", [Object])
|
|
1528
|
-
], MultiSelectComponent.prototype, "checkboxes", null);
|
|
1529
|
-
tslib_1.__decorate([
|
|
1530
|
-
Input(),
|
|
1531
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
1532
|
-
], MultiSelectComponent.prototype, "readonly", void 0);
|
|
1533
|
-
tslib_1.__decorate([
|
|
1534
|
-
Input(),
|
|
1535
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
1536
|
-
], MultiSelectComponent.prototype, "filterable", void 0);
|
|
1537
|
-
tslib_1.__decorate([
|
|
1538
|
-
Input(),
|
|
1539
|
-
tslib_1.__metadata("design:type", Object),
|
|
1540
|
-
tslib_1.__metadata("design:paramtypes", [Object])
|
|
1541
|
-
], MultiSelectComponent.prototype, "virtual", null);
|
|
1542
|
-
tslib_1.__decorate([
|
|
1543
|
-
Input(),
|
|
1544
|
-
tslib_1.__metadata("design:type", Object),
|
|
1545
|
-
tslib_1.__metadata("design:paramtypes", [Object])
|
|
1546
|
-
], MultiSelectComponent.prototype, "popupSettings", null);
|
|
1547
|
-
tslib_1.__decorate([
|
|
1548
|
-
Input(),
|
|
1549
|
-
tslib_1.__metadata("design:type", Number)
|
|
1550
|
-
], MultiSelectComponent.prototype, "listHeight", void 0);
|
|
1551
|
-
tslib_1.__decorate([
|
|
1552
|
-
Input(),
|
|
1553
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
1554
|
-
tslib_1.__metadata("design:paramtypes", [Boolean])
|
|
1555
|
-
], MultiSelectComponent.prototype, "valuePrimitive", null);
|
|
1556
|
-
tslib_1.__decorate([
|
|
1557
|
-
Input(),
|
|
1558
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
1559
|
-
], MultiSelectComponent.prototype, "clearButton", void 0);
|
|
1560
|
-
tslib_1.__decorate([
|
|
1561
|
-
Input(),
|
|
1562
|
-
tslib_1.__metadata("design:type", Object)
|
|
1563
|
-
], MultiSelectComponent.prototype, "tagMapper", void 0);
|
|
1564
|
-
tslib_1.__decorate([
|
|
1565
|
-
Input(),
|
|
1566
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
1567
|
-
], MultiSelectComponent.prototype, "allowCustom", void 0);
|
|
1568
|
-
tslib_1.__decorate([
|
|
1569
|
-
Input(),
|
|
1570
|
-
tslib_1.__metadata("design:type", Function)
|
|
1571
|
-
], MultiSelectComponent.prototype, "valueNormalizer", void 0);
|
|
1572
|
-
tslib_1.__decorate([
|
|
1573
|
-
Output(),
|
|
1574
|
-
tslib_1.__metadata("design:type", EventEmitter)
|
|
1575
|
-
], MultiSelectComponent.prototype, "filterChange", void 0);
|
|
1576
|
-
tslib_1.__decorate([
|
|
1577
|
-
Output(),
|
|
1578
|
-
tslib_1.__metadata("design:type", EventEmitter)
|
|
1579
|
-
], MultiSelectComponent.prototype, "valueChange", void 0);
|
|
1580
|
-
tslib_1.__decorate([
|
|
1581
|
-
Output(),
|
|
1582
|
-
tslib_1.__metadata("design:type", EventEmitter)
|
|
1583
|
-
], MultiSelectComponent.prototype, "open", void 0);
|
|
1584
|
-
tslib_1.__decorate([
|
|
1585
|
-
Output(),
|
|
1586
|
-
tslib_1.__metadata("design:type", EventEmitter)
|
|
1587
|
-
], MultiSelectComponent.prototype, "opened", void 0);
|
|
1588
|
-
tslib_1.__decorate([
|
|
1589
|
-
Output(),
|
|
1590
|
-
tslib_1.__metadata("design:type", EventEmitter)
|
|
1591
|
-
], MultiSelectComponent.prototype, "close", void 0);
|
|
1592
|
-
tslib_1.__decorate([
|
|
1593
|
-
Output(),
|
|
1594
|
-
tslib_1.__metadata("design:type", EventEmitter)
|
|
1595
|
-
], MultiSelectComponent.prototype, "closed", void 0);
|
|
1596
|
-
tslib_1.__decorate([
|
|
1597
|
-
Output('focus'),
|
|
1598
|
-
tslib_1.__metadata("design:type", EventEmitter)
|
|
1599
|
-
], MultiSelectComponent.prototype, "onFocus", void 0);
|
|
1600
|
-
tslib_1.__decorate([
|
|
1601
|
-
Output('blur'),
|
|
1602
|
-
tslib_1.__metadata("design:type", EventEmitter)
|
|
1603
|
-
], MultiSelectComponent.prototype, "onBlur", void 0);
|
|
1604
|
-
tslib_1.__decorate([
|
|
1605
|
-
Output(),
|
|
1606
|
-
tslib_1.__metadata("design:type", EventEmitter)
|
|
1607
|
-
], MultiSelectComponent.prototype, "removeTag", void 0);
|
|
1608
|
-
tslib_1.__decorate([
|
|
1609
|
-
ViewChild('container', { read: ViewContainerRef, static: true }),
|
|
1610
|
-
tslib_1.__metadata("design:type", ViewContainerRef)
|
|
1611
|
-
], MultiSelectComponent.prototype, "container", void 0);
|
|
1612
|
-
tslib_1.__decorate([
|
|
1613
|
-
ViewChild(SearchBarComponent, { static: true }),
|
|
1614
|
-
tslib_1.__metadata("design:type", SearchBarComponent)
|
|
1615
|
-
], MultiSelectComponent.prototype, "searchbar", void 0);
|
|
1616
|
-
tslib_1.__decorate([
|
|
1617
|
-
ViewChild('popupTemplate', { static: true }),
|
|
1618
|
-
tslib_1.__metadata("design:type", TemplateRef)
|
|
1619
|
-
], MultiSelectComponent.prototype, "popupTemplate", void 0);
|
|
1620
|
-
tslib_1.__decorate([
|
|
1621
|
-
ViewChild('optionsList', { static: false }),
|
|
1622
|
-
tslib_1.__metadata("design:type", ListComponent)
|
|
1623
|
-
], MultiSelectComponent.prototype, "optionsList", void 0);
|
|
1624
|
-
tslib_1.__decorate([
|
|
1625
|
-
ContentChild(ItemTemplateDirective, { static: false }),
|
|
1626
|
-
tslib_1.__metadata("design:type", ItemTemplateDirective)
|
|
1627
|
-
], MultiSelectComponent.prototype, "template", void 0);
|
|
1628
|
-
tslib_1.__decorate([
|
|
1629
|
-
ContentChild(CustomItemTemplateDirective, { static: false }),
|
|
1630
|
-
tslib_1.__metadata("design:type", CustomItemTemplateDirective)
|
|
1631
|
-
], MultiSelectComponent.prototype, "customItemTemplate", void 0);
|
|
1632
|
-
tslib_1.__decorate([
|
|
1633
|
-
ContentChild(GroupTemplateDirective, { static: false }),
|
|
1634
|
-
tslib_1.__metadata("design:type", GroupTemplateDirective)
|
|
1635
|
-
], MultiSelectComponent.prototype, "groupTemplate", void 0);
|
|
1636
|
-
tslib_1.__decorate([
|
|
1637
|
-
ContentChild(FixedGroupTemplateDirective, { static: false }),
|
|
1638
|
-
tslib_1.__metadata("design:type", FixedGroupTemplateDirective)
|
|
1639
|
-
], MultiSelectComponent.prototype, "fixedGroupTemplate", void 0);
|
|
1640
|
-
tslib_1.__decorate([
|
|
1641
|
-
ContentChild(HeaderTemplateDirective, { static: false }),
|
|
1642
|
-
tslib_1.__metadata("design:type", HeaderTemplateDirective)
|
|
1643
|
-
], MultiSelectComponent.prototype, "headerTemplate", void 0);
|
|
1644
|
-
tslib_1.__decorate([
|
|
1645
|
-
ContentChild(FooterTemplateDirective, { static: false }),
|
|
1646
|
-
tslib_1.__metadata("design:type", FooterTemplateDirective)
|
|
1647
|
-
], MultiSelectComponent.prototype, "footerTemplate", void 0);
|
|
1648
|
-
tslib_1.__decorate([
|
|
1649
|
-
ContentChild(TagTemplateDirective, { static: false }),
|
|
1650
|
-
tslib_1.__metadata("design:type", TagTemplateDirective)
|
|
1651
|
-
], MultiSelectComponent.prototype, "tagTemplate", void 0);
|
|
1652
|
-
tslib_1.__decorate([
|
|
1653
|
-
ContentChild(GroupTagTemplateDirective, { static: false }),
|
|
1654
|
-
tslib_1.__metadata("design:type", GroupTagTemplateDirective)
|
|
1655
|
-
], MultiSelectComponent.prototype, "groupTagTemplate", void 0);
|
|
1656
|
-
tslib_1.__decorate([
|
|
1657
|
-
ContentChild(NoDataTemplateDirective, { static: false }),
|
|
1658
|
-
tslib_1.__metadata("design:type", NoDataTemplateDirective)
|
|
1659
|
-
], MultiSelectComponent.prototype, "noDataTemplate", void 0);
|
|
1660
|
-
tslib_1.__decorate([
|
|
1661
|
-
HostBinding('class.k-multiselect'),
|
|
1662
|
-
HostBinding('class.k-input'),
|
|
1663
|
-
tslib_1.__metadata("design:type", Boolean)
|
|
1664
|
-
], MultiSelectComponent.prototype, "hostClasses", void 0);
|
|
1665
|
-
tslib_1.__decorate([
|
|
1666
|
-
HostBinding('attr.dir'),
|
|
1667
|
-
tslib_1.__metadata("design:type", String),
|
|
1668
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
1669
|
-
], MultiSelectComponent.prototype, "dir", null);
|
|
1670
|
-
tslib_1.__decorate([
|
|
1671
|
-
HostBinding('class.k-disabled'),
|
|
1672
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
1673
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
1674
|
-
], MultiSelectComponent.prototype, "disabledClass", null);
|
|
1675
|
-
tslib_1.__decorate([
|
|
1676
|
-
HostBinding('class.k-loading'),
|
|
1677
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
1678
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
1679
|
-
], MultiSelectComponent.prototype, "isLoading", null);
|
|
1680
|
-
tslib_1.__decorate([
|
|
1681
|
-
HostBinding('attr.role'),
|
|
1682
|
-
tslib_1.__metadata("design:type", String)
|
|
1683
|
-
], MultiSelectComponent.prototype, "role", void 0);
|
|
1684
|
-
tslib_1.__decorate([
|
|
1685
|
-
HostBinding('attr.aria-expanded'),
|
|
1686
|
-
tslib_1.__metadata("design:type", Boolean),
|
|
1687
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
1688
|
-
], MultiSelectComponent.prototype, "isAriaExpanded", null);
|
|
1689
|
-
tslib_1.__decorate([
|
|
1690
|
-
HostListener('mousedown', ['$event']),
|
|
1691
|
-
tslib_1.__metadata("design:type", Function),
|
|
1692
|
-
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
1693
|
-
tslib_1.__metadata("design:returntype", void 0)
|
|
1694
|
-
], MultiSelectComponent.prototype, "hostMousedown", null);
|
|
1695
|
-
MultiSelectComponent = MultiSelectComponent_1 = tslib_1.__decorate([
|
|
1696
|
-
Component({
|
|
1697
|
-
exportAs: 'kendoMultiSelect',
|
|
1698
|
-
providers: [
|
|
1699
|
-
MULTISELECT_VALUE_ACCESSOR,
|
|
1700
|
-
DataService,
|
|
1701
|
-
SelectionService,
|
|
1702
|
-
NavigationService,
|
|
1703
|
-
DisabledItemsService,
|
|
1704
|
-
LocalizationService,
|
|
1705
|
-
{
|
|
1706
|
-
provide: L10N_PREFIX,
|
|
1707
|
-
useValue: 'kendo.multiselect'
|
|
1708
|
-
},
|
|
1709
|
-
{
|
|
1710
|
-
provide: FilterableComponent, useExisting: forwardRef(function () { return MultiSelectComponent_1; })
|
|
1711
|
-
},
|
|
1712
|
-
{
|
|
1713
|
-
provide: KendoInput, useExisting: forwardRef(function () { return MultiSelectComponent_1; })
|
|
1714
|
-
}
|
|
1715
|
-
],
|
|
1716
|
-
selector: 'kendo-multiselect',
|
|
1717
|
-
template: "\n <ng-container kendoMultiSelectLocalizedMessages\n i18n-noDataText=\"kendo.multiselect.noDataText|The text displayed in the popup when there are no items\"\n noDataText=\"NO DATA FOUND\"\n\n i18n-clearTitle=\"kendo.multiselect.clearTitle|The title of the clear button\"\n clearTitle=\"clear\"\n >\n </ng-container>\n <kendo-taglist\n [size]=\"size\"\n [rounded]=\"rounded\"\n [fillMode]=\"fillMode\"\n [id]=\"tagListId\"\n [tags]=\"tags\"\n [textField]=\"textField\"\n [valueField]=\"valueField\"\n [focused]=\"focusedTagIndex\"\n [disabled]=\"disabled\"\n [template]=\"tagTemplate\"\n [groupTemplate]=\"groupTagTemplate\"\n [tagPrefix]=\"tagPrefix\"\n [disabledIndices]=\"disabledIndices\"\n (removeTag)=\"handleRemoveTag($event)\"\n >\n <kendo-searchbar\n #searchbar\n [id]=\"focusableId\"\n [role]=\"'textbox'\"\n [tagListId]=\"tagListId\"\n [activeDescendant]=\"activeDescendant\"\n [noDataLabel]=\"noDataLabel\"\n [userInput]=\"text\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [tabIndex]=\"tabIndex\"\n [popupOpen]=\"isOpen\"\n [placeholder]=\"placeholder\"\n (onNavigate)=\"handleNavigate($event)\"\n (valueChange)=\"handleFilter($event)\"\n (onBlur)=\"onSearchBarBlur()\"\n (onFocus)=\"onSearchBarFocus()\"\n >\n </kendo-searchbar>\n </kendo-taglist>\n\n <span\n *ngIf=\"!loading && !readonly && clearButton && (tags?.length || text?.length)\"\n class=\"k-clear-value\"\n [style.visibility]=\"clearButtonVisiblity\"\n [attr.title]=\"messageFor('clearTitle')\"\n role=\"button\"\n tabindex=\"-1\"\n (mousedown)=\"clearAll($event)\"\n >\n <span class=\"k-icon k-i-x\"></span>\n </span>\n <span\n *ngIf=\"loading\"\n class=\"k-icon k-i-loading\"\n >\n </span>\n <ng-template #popupTemplate>\n <!--header template-->\n <ng-template *ngIf=\"headerTemplate\"\n [templateContext]=\"{\n templateRef: headerTemplate.templateRef\n }\">\n </ng-template>\n <!--custom item template-->\n <div\n *ngIf=\"allowCustom && text\"\n class=\"k-list\"\n [ngClass]=\"customItemSizeClass\"\n >\n <div class=\"k-list-item k-custom-item\" kendoDropDownsSelectable [multipleSelection]=\"true\" [index]=\"-1\">\n <ng-template *ngIf=\"customItemTemplate;else default_custom_item_template\"\n [templateContext]=\"{\n templateRef: customItemTemplate.templateRef,\n $implicit: text\n }\">\n </ng-template>\n <ng-template #default_custom_item_template>{{ text }}</ng-template>\n <span class=\"k-icon k-i-plus\" style=\"float: right\"></span>\n </div>\n </div>\n <!--list-->\n <kendo-list\n #optionsList\n [size]=\"size\"\n [rounded]=\"rounded\"\n [id]=\"listBoxId\"\n [optionPrefix]=\"optionPrefix\"\n [data]=\"data\"\n [textField]=\"textField\"\n [valueField]=\"valueField\"\n [height]=\"listHeight\"\n [template]=\"template\"\n [groupTemplate]=\"groupTemplate\"\n [fixedGroupTemplate]=\"fixedGroupTemplate\"\n [show]=\"isOpen\"\n [multipleSelection]=\"true\"\n [virtual]=\"virtual\"\n (pageChange)=\"pageChange($event)\"\n [checkboxes]=\"checkboxes\"\n >\n </kendo-list>\n <!--no data template-->\n <div class=\"k-no-data\" *ngIf=\"data.length === 0\">\n <ng-template [ngIf]=\"noDataTemplate\"\n [templateContext]=\"{\n templateRef: noDataTemplate ? noDataTemplate.templateRef : undefined\n }\">\n </ng-template>\n <ng-template [ngIf]=\"!noDataTemplate\">\n <div>{{ messageFor('noDataText') }}</div>\n </ng-template>\n </div>\n <!--footer template-->\n <ng-template *ngIf=\"footerTemplate\"\n [templateContext]=\"{\n templateRef: footerTemplate.templateRef\n }\">\n </ng-template>\n </ng-template>\n <ng-template [ngIf]=\"isOpen\">\n <kendo-resize-sensor (resize)=\"onResize()\"></kendo-resize-sensor>\n </ng-template>\n <ng-container #container></ng-container>\n "
|
|
1718
|
-
}),
|
|
1719
|
-
tslib_1.__param(11, Optional()), tslib_1.__param(11, Inject(TOUCH_ENABLED)),
|
|
1720
|
-
tslib_1.__metadata("design:paramtypes", [ElementRef,
|
|
1721
|
-
LocalizationService,
|
|
1722
|
-
PopupService,
|
|
1723
|
-
DataService,
|
|
1724
|
-
SelectionService,
|
|
1725
|
-
NavigationService,
|
|
1726
|
-
DisabledItemsService,
|
|
1727
|
-
ChangeDetectorRef,
|
|
1728
|
-
KeyValueDiffers,
|
|
1729
|
-
Renderer2,
|
|
1730
|
-
NgZone, Boolean])
|
|
1731
|
-
], MultiSelectComponent);
|
|
1732
|
-
return MultiSelectComponent;
|
|
1733
|
-
}());
|
|
1734
|
-
export { MultiSelectComponent };
|