@progress/kendo-angular-dropdowns 21.4.1 → 22.0.0-develop.1

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.
Files changed (84) hide show
  1. package/common/localization/messages.d.ts +1 -1
  2. package/dropdowntrees/checked-state/base-check.directive.d.ts +1 -1
  3. package/fesm2022/progress-kendo-angular-dropdowns.mjs +173 -173
  4. package/package.json +14 -22
  5. package/schematics/ngAdd/index.js +2 -2
  6. package/esm2022/autocomplete/autocomplete.component.mjs +0 -1687
  7. package/esm2022/autocomplete/autocomplete.module.mjs +0 -70
  8. package/esm2022/comboboxes/combobox-column/column-cell-template.directive.mjs +0 -42
  9. package/esm2022/comboboxes/combobox-column/column-header-template.directive.mjs +0 -40
  10. package/esm2022/comboboxes/combobox-column/combobox-column.component.mjs +0 -116
  11. package/esm2022/comboboxes/combobox-column/util.mjs +0 -60
  12. package/esm2022/comboboxes/combobox.component.mjs +0 -2149
  13. package/esm2022/comboboxes/combobox.module.mjs +0 -77
  14. package/esm2022/comboboxes/multicolumncombobox.component.mjs +0 -883
  15. package/esm2022/common/adaptive-renderer.component.mjs +0 -253
  16. package/esm2022/common/constants/error-messages.mjs +0 -61
  17. package/esm2022/common/data.service.mjs +0 -250
  18. package/esm2022/common/disabled-items/disabled-items.service.mjs +0 -47
  19. package/esm2022/common/disabled-items/item-disabled.mjs +0 -5
  20. package/esm2022/common/filter-input.directive.mjs +0 -39
  21. package/esm2022/common/filtering/filter-settings.mjs +0 -5
  22. package/esm2022/common/filtering/filter.directive.mjs +0 -136
  23. package/esm2022/common/filtering/filterable-component.mjs +0 -34
  24. package/esm2022/common/list-item.directive.mjs +0 -25
  25. package/esm2022/common/list.component.mjs +0 -968
  26. package/esm2022/common/localization/custom-messages.component.mjs +0 -96
  27. package/esm2022/common/localization/localized-messages.directive.mjs +0 -47
  28. package/esm2022/common/localization/messages.mjs +0 -77
  29. package/esm2022/common/models/checkboxes-settings.mjs +0 -15
  30. package/esm2022/common/models/direction.mjs +0 -5
  31. package/esm2022/common/models/fillmode.mjs +0 -5
  32. package/esm2022/common/models/list-type.mjs +0 -5
  33. package/esm2022/common/models/page-change-event.mjs +0 -5
  34. package/esm2022/common/models/popup-settings.mjs +0 -5
  35. package/esm2022/common/models/preventable-event.mjs +0 -25
  36. package/esm2022/common/models/remove-tag-event.mjs +0 -23
  37. package/esm2022/common/models/rounded.mjs +0 -5
  38. package/esm2022/common/models/size.mjs +0 -5
  39. package/esm2022/common/models/virtualization-settings.mjs +0 -24
  40. package/esm2022/common/navigation/navigation-action.mjs +0 -32
  41. package/esm2022/common/navigation/navigation.service.mjs +0 -188
  42. package/esm2022/common/searchbar.component.mjs +0 -386
  43. package/esm2022/common/selection/selectable.directive.mjs +0 -83
  44. package/esm2022/common/selection/selection.service.mjs +0 -166
  45. package/esm2022/common/shared-events.directive.mjs +0 -99
  46. package/esm2022/common/taglist.component.mjs +0 -295
  47. package/esm2022/common/templates/custom-item-template.directive.mjs +0 -48
  48. package/esm2022/common/templates/fixed-group-template.directive.mjs +0 -55
  49. package/esm2022/common/templates/footer-template.directive.mjs +0 -49
  50. package/esm2022/common/templates/group-tag-template.directive.mjs +0 -47
  51. package/esm2022/common/templates/group-template.directive.mjs +0 -55
  52. package/esm2022/common/templates/header-template.directive.mjs +0 -49
  53. package/esm2022/common/templates/item-template.directive.mjs +0 -48
  54. package/esm2022/common/templates/no-data-template.directive.mjs +0 -49
  55. package/esm2022/common/templates/tag-template.directive.mjs +0 -46
  56. package/esm2022/common/templates/value-template.directive.mjs +0 -50
  57. package/esm2022/common/util.mjs +0 -376
  58. package/esm2022/directives.mjs +0 -172
  59. package/esm2022/dropdownlist/dropdownlist.component.mjs +0 -1999
  60. package/esm2022/dropdownlist/dropdownlist.module.mjs +0 -79
  61. package/esm2022/dropdowns.module.mjs +0 -76
  62. package/esm2022/dropdowntrees/checked-state/base-check.directive.mjs +0 -76
  63. package/esm2022/dropdowntrees/checked-state/check-all.directive.mjs +0 -170
  64. package/esm2022/dropdowntrees/checked-state/check.directive.mjs +0 -168
  65. package/esm2022/dropdowntrees/checked-state/checkable-settings.mjs +0 -5
  66. package/esm2022/dropdowntrees/checked-state/checked-item.mjs +0 -5
  67. package/esm2022/dropdowntrees/data-binding/dropdowntree/flat-binding.directive.mjs +0 -69
  68. package/esm2022/dropdowntrees/data-binding/dropdowntree/hierarchy-binding.directive.mjs +0 -62
  69. package/esm2022/dropdowntrees/data-binding/multiselecttree/flat-binding.directive.mjs +0 -69
  70. package/esm2022/dropdowntrees/data-binding/multiselecttree/hierarchy-binding.directive.mjs +0 -62
  71. package/esm2022/dropdowntrees/dropdowntree.component.mjs +0 -1967
  72. package/esm2022/dropdowntrees/dropdowntrees.module.mjs +0 -79
  73. package/esm2022/dropdowntrees/expanded-state/expand.directive.mjs +0 -49
  74. package/esm2022/dropdowntrees/lookup/lookup.mjs +0 -5
  75. package/esm2022/dropdowntrees/lookup/lookup.service.mjs +0 -82
  76. package/esm2022/dropdowntrees/multiselecttree.component.mjs +0 -2359
  77. package/esm2022/dropdowntrees/summary-tag/summary-tag.directive.mjs +0 -70
  78. package/esm2022/dropdowntrees/templates/node-template.directive.mjs +0 -31
  79. package/esm2022/index.mjs +0 -55
  80. package/esm2022/multiselect/multiselect.component.mjs +0 -2380
  81. package/esm2022/multiselect/multiselect.module.mjs +0 -79
  82. package/esm2022/multiselect/summary-tag.directive.mjs +0 -68
  83. package/esm2022/package-metadata.mjs +0 -16
  84. package/esm2022/progress-kendo-angular-dropdowns.mjs +0 -8
@@ -1,49 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import { Directive, TemplateRef } from '@angular/core';
6
- import * as i0 from "@angular/core";
7
- /**
8
- * Renders the header content of the list. To define the header template, nest an `<ng-template>` tag
9
- * with the `kendo<ComponentName>HeaderTemplate` directive inside the component tag.
10
- *
11
- * - [Using `HeaderTemplate` with the AutoComplete]({% slug templates_autocomplete %}#toc-header-template)
12
- * - [Using `HeaderTemplate` with the ComboBox]({% slug templates_combobox %}#toc-header-template)
13
- * - [Using `HeaderTemplate` with the MultiColumnComboBox]({% slug templates_multicolumncombobox %}#toc-header-template)
14
- * - [Using `HeaderTemplate` with the DropDownList]({% slug templates_ddl %}#toc-header-template)
15
- * - [Using `HeaderTemplate` with the DropDownTree]({% slug templates_ddt %}#toc-header-template)
16
- * - [Using `HeaderTemplate` with the MultiSelect]({% slug templates_multiselect %}#toc-header-template)
17
- *
18
- * @example
19
- * ```ts
20
- * _@Component({
21
- * selector: 'my-app',
22
- * template: `
23
- * <kendo-combobox [data]="listItems">
24
- * <ng-template kendoComboBoxHeaderTemplate>
25
- * <h4>Header template</h4>
26
- * </ng-template>
27
- * </kendo-combobox>
28
- * `
29
- * })
30
- * class AppComponent {
31
- * public listItems: Array<string> = ["Item 1", "Item 2", "Item 3", "Item 4"];
32
- * }
33
- * ```
34
- */
35
- export class HeaderTemplateDirective {
36
- templateRef;
37
- constructor(templateRef) {
38
- this.templateRef = templateRef;
39
- }
40
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: HeaderTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
41
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: HeaderTemplateDirective, isStandalone: true, selector: "[kendoDropDownListHeaderTemplate],[kendoComboBoxHeaderTemplate],[kendoDropDownTreeHeaderTemplate],[kendoMultiColumnComboBoxHeaderTemplate],[kendoAutoCompleteHeaderTemplate],[kendoMultiSelectHeaderTemplate],[kendoMultiSelectTreeHeaderTemplate]", ngImport: i0 });
42
- }
43
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: HeaderTemplateDirective, decorators: [{
44
- type: Directive,
45
- args: [{
46
- selector: '[kendoDropDownListHeaderTemplate],[kendoComboBoxHeaderTemplate],[kendoDropDownTreeHeaderTemplate],[kendoMultiColumnComboBoxHeaderTemplate],[kendoAutoCompleteHeaderTemplate],[kendoMultiSelectHeaderTemplate],[kendoMultiSelectTreeHeaderTemplate]',
47
- standalone: true
48
- }]
49
- }], ctorParameters: () => [{ type: i0.TemplateRef }] });
@@ -1,48 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import { Directive, TemplateRef } from '@angular/core';
6
- import * as i0 from "@angular/core";
7
- /**
8
- * Renders the list item content. To define the item template, nest an `<ng-template>` tag
9
- * with the `kendo<ComponentName>ItemTemplate` directive inside the component tag. The template context is
10
- * set to the current component. To get a reference to the current data item, use the `let-dataItem` directive.
11
- *
12
- * - [Using `ItemTemplate` with the AutoComplete]({% slug templates_autocomplete %}#toc-item-template)
13
- * - [Using `ItemTemplate` with the ComboBox]({% slug templates_combobox %}#toc-item-template)
14
- * - [Using `ItemTemplate` with the DropDownList]({% slug templates_ddl %}#toc-item-template)
15
- * - [Using `ItemTemplate` with the MultiSelect]({% slug templates_multiselect %}#toc-item-template)
16
- *
17
- * @example
18
- * ```ts
19
- * _@Component({
20
- * selector: 'my-app',
21
- * template: `
22
- * <kendo-combobox [data]="listItems">
23
- * <ng-template kendoComboBoxItemTemplate let-dataItem>
24
- * <span>{{dataItem}} option</span>
25
- * </ng-template>
26
- * </kendo-combobox>
27
- * `
28
- * })
29
- * class AppComponent {
30
- * public listItems: Array<string> = ["Item 1", "Item 2", "Item 3", "Item 4"];
31
- * }
32
- * ```
33
- */
34
- export class ItemTemplateDirective {
35
- templateRef;
36
- constructor(templateRef) {
37
- this.templateRef = templateRef;
38
- }
39
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ItemTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
40
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: ItemTemplateDirective, isStandalone: true, selector: "[kendoDropDownListItemTemplate],[kendoComboBoxItemTemplate],[kendoAutoCompleteItemTemplate],[kendoMultiSelectItemTemplate]", ngImport: i0 });
41
- }
42
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ItemTemplateDirective, decorators: [{
43
- type: Directive,
44
- args: [{
45
- selector: '[kendoDropDownListItemTemplate],[kendoComboBoxItemTemplate],[kendoAutoCompleteItemTemplate],[kendoMultiSelectItemTemplate]',
46
- standalone: true
47
- }]
48
- }], ctorParameters: () => [{ type: i0.TemplateRef }] });
@@ -1,49 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import { Directive, TemplateRef } from '@angular/core';
6
- import * as i0 from "@angular/core";
7
- /**
8
- * Renders content when no data is available. To define the no-data template, nest a `<ng-template>` tag
9
- * with the `kendo<ComponentName>NoDataTemplate` directive inside the component tag.
10
- *
11
- * - [Using `NoDataTemplate` with the AutoComplete]({% slug templates_autocomplete %}#toc-no-data-template)
12
- * - [Using `NoDataTemplate` with the ComboBox]({% slug templates_combobox %}#toc-no-data-template)
13
- * - [Using `NoDataTemplate` with the MultiColumnComboBox]({% slug templates_multicolumncombobox %}#toc-no-data-template)
14
- * - [Using `NoDataTemplate` with the DropDownList]({% slug templates_ddl %}#toc-no-data-template)
15
- * - [Using `NoDataTemplate` with the DropDownTree]({% slug templates_ddt %}#toc-no-data-template)
16
- * - [Using `NoDataTemplate` with the MultiSelect]({% slug templates_multiselect %}#toc-no-data-template)
17
- *
18
- * @example
19
- * ```ts
20
- * _@Component({
21
- * selector: 'my-app',
22
- * template: `
23
- * <kendo-combobox [data]="listItems">
24
- * <ng-template kendoComboBoxNoDataTemplate>
25
- * <h4>No data!</h4>
26
- * </ng-template>
27
- * </kendo-combobox>
28
- * `
29
- * })
30
- * class AppComponent {
31
- * public listItems: Array<string> = [];
32
- * }
33
- * ```
34
- */
35
- export class NoDataTemplateDirective {
36
- templateRef;
37
- constructor(templateRef) {
38
- this.templateRef = templateRef;
39
- }
40
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NoDataTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
41
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: NoDataTemplateDirective, isStandalone: true, selector: "[kendoDropDownListNoDataTemplate],[kendoDropDownTreeNoDataTemplate],[kendoComboBoxNoDataTemplate],[kendoMultiColumnComboBoxNoDataTemplate],[kendoAutoCompleteNoDataTemplate],[kendoMultiSelectNoDataTemplate],[kendoMultiSelectTreeNoDataTemplate]", ngImport: i0 });
42
- }
43
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: NoDataTemplateDirective, decorators: [{
44
- type: Directive,
45
- args: [{
46
- selector: '[kendoDropDownListNoDataTemplate],[kendoDropDownTreeNoDataTemplate],[kendoComboBoxNoDataTemplate],[kendoMultiColumnComboBoxNoDataTemplate],[kendoAutoCompleteNoDataTemplate],[kendoMultiSelectNoDataTemplate],[kendoMultiSelectTreeNoDataTemplate]',
47
- standalone: true
48
- }]
49
- }], ctorParameters: () => [{ type: i0.TemplateRef }] });
@@ -1,46 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import { Directive, TemplateRef } from '@angular/core';
6
- import * as i0 from "@angular/core";
7
- /**
8
- * Renders the selected tag value of the MultiSelect
9
- * ([see example]({% slug templates_multiselect %}#toc-tag-template)).
10
- * The template context is set to the current component.
11
- * To get a reference to the current data item, use the `let-dataItem` directive.
12
- *
13
- * > The `TagTemplate` directive can only be used with the MultiSelect and MultiSelectTree components.
14
- *
15
- * @example
16
- * ```ts
17
- * _@Component({
18
- * selector: 'my-app',
19
- * template: `
20
- * <kendo-multiselect [data]="items">
21
- * <ng-template kendoMultiSelectTagTemplate let-dataItem>
22
- * <span>{{dataItem}} option</span>
23
- * </ng-template>
24
- * </kendo-multiselect>
25
- * `
26
- * })
27
- * class AppComponent {
28
- * public items: Array<string> = ["Item 1", "Item 2", "Item 3", "Item 4"];
29
- * }
30
- * ```
31
- */
32
- export class TagTemplateDirective {
33
- templateRef;
34
- constructor(templateRef) {
35
- this.templateRef = templateRef;
36
- }
37
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TagTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
38
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: TagTemplateDirective, isStandalone: true, selector: "[kendoMultiSelectTagTemplate],[kendoMultiSelectTreeTagTemplate]", ngImport: i0 });
39
- }
40
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: TagTemplateDirective, decorators: [{
41
- type: Directive,
42
- args: [{
43
- selector: '[kendoMultiSelectTagTemplate],[kendoMultiSelectTreeTagTemplate]',
44
- standalone: true
45
- }]
46
- }], ctorParameters: () => [{ type: i0.TemplateRef }] });
@@ -1,50 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import { Directive, TemplateRef } from '@angular/core';
6
- import * as i0 from "@angular/core";
7
- /**
8
- * Renders the selected value of the dropdown. To define the header template, nest an `<ng-template>` tag
9
- * with the `kendo<ComponentName>ValueTemplate` directive inside the component tag.
10
- *
11
- * The template context is set to the current component.
12
- * To get a reference to the current data item, use the `let-dataItem` directive.
13
- *
14
- * > The `ValueTemplate` directive can only be used with the DropDownList and DropDownTree components.
15
- *
16
- * - [Using `ValueTemplate` with the DropDownList]({% slug templates_ddl %}#toc-value-template)
17
- * - [Using `ValueTemplate` with the DropDownTree]({% slug templates_ddt %}#toc-value-template)
18
- *
19
- * @example
20
- * ```ts
21
- * _@Component({
22
- * selector: 'my-app',
23
- * template: `
24
- * <kendo-dropdownlist [data]="listItems">
25
- * <ng-template kendoDropDownListValueTemplate let-dataItem>
26
- * <span>{{dataItem}} option</span>
27
- * </ng-template>
28
- * </kendo-dropdownlist>
29
- * `
30
- * })
31
- * class AppComponent {
32
- * public listItems: Array<string> = ["Item 1", "Item 2", "Item 3", "Item 4"];
33
- * }
34
- * ```
35
- */
36
- export class ValueTemplateDirective {
37
- templateRef;
38
- constructor(templateRef) {
39
- this.templateRef = templateRef;
40
- }
41
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ValueTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
42
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: ValueTemplateDirective, isStandalone: true, selector: "[kendoDropDownListValueTemplate],[kendoDropDownTreeValueTemplate]", ngImport: i0 });
43
- }
44
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: ValueTemplateDirective, decorators: [{
45
- type: Directive,
46
- args: [{
47
- selector: '[kendoDropDownListValueTemplate],[kendoDropDownTreeValueTemplate]',
48
- standalone: true
49
- }]
50
- }], ctorParameters: () => [{ type: i0.TemplateRef }] });
@@ -1,376 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2026 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- /* eslint-disable no-bitwise */
6
- import { isDocumentAvailable } from '@progress/kendo-angular-common';
7
- import { getter as fieldAccessor } from '@progress/kendo-common';
8
- /**
9
- * @hidden
10
- */
11
- export const isPresent = (value) => value !== null && value !== undefined;
12
- /**
13
- * @hidden
14
- */
15
- export const isNumber = (value) => !isNaN(value);
16
- /**
17
- * @hidden
18
- */
19
- export const combineStr = (begin, end) => {
20
- return begin.concat(end.substr(end.toLowerCase().indexOf(begin.toLowerCase()) + begin.length));
21
- };
22
- /**
23
- * @hidden
24
- */
25
- export const isWindowAvailable = () => typeof window !== 'undefined';
26
- /**
27
- * @hidden
28
- */
29
- export const isArray = (value) => Array.isArray(value);
30
- /**
31
- * @hidden
32
- */
33
- export const isObject = (value) => isPresent(value) && typeof value === 'object';
34
- /**
35
- * @hidden
36
- */
37
- export const isEmptyString = (value) => typeof value === 'string' && value.length === 0;
38
- /**
39
- * @hidden
40
- */
41
- export const resolveValuesInArray = (values, data = [], valueField) => values
42
- .map(value => {
43
- return data.find(item => getter(item, valueField) === value);
44
- })
45
- .filter(value => value !== undefined);
46
- /**
47
- * @hidden
48
- */
49
- export const validateComplexValues = (values, valueField) => isArray(values) && values.filter(item => {
50
- return isObject(item) && getter(item, valueField) !== undefined;
51
- });
52
- /**
53
- * @hidden
54
- */
55
- export const resolveAllValues = (value, data, valueField) => {
56
- const customValues = validateComplexValues(value, valueField) || [];
57
- const resolvedValues = resolveValuesInArray(value, data, valueField) || [];
58
- return resolvedValues.concat(customValues);
59
- };
60
- /**
61
- * @hidden
62
- */
63
- export const isObjectArray = (values) => {
64
- return isArray(values) && values.every(item => isObject(item));
65
- };
66
- /**
67
- * @hidden
68
- */
69
- export const selectedIndices = (values, data, valueField) => {
70
- const extractedValues = data.map(item => {
71
- return isPresent(item) && isPresent(getter(item, valueField)) ? getter(item, valueField) : item;
72
- });
73
- return values.reduce((arr, item) => {
74
- const value = isPresent(item) && isPresent(getter(item, valueField)) ? getter(item, valueField) : item;
75
- const index = extractedValues.indexOf(value);
76
- if (index !== -1) {
77
- arr.push(index);
78
- }
79
- return arr;
80
- }, []);
81
- };
82
- /**
83
- * @hidden
84
- */
85
- export const getter = (dataItem, field) => {
86
- if (!isPresent(dataItem)) {
87
- return null;
88
- }
89
- if (!isPresent(field) || !isObject(dataItem)) {
90
- return dataItem;
91
- }
92
- // creates a field accessor supporting nested fields processing
93
- const valueFrom = fieldAccessor(field);
94
- return valueFrom(dataItem);
95
- };
96
- /**
97
- * @hidden
98
- */
99
- export const resolveValue = (args) => {
100
- let dataItem;
101
- if (isPresent(args.value)) {
102
- const data = [args.defaultItem, ...args.data];
103
- dataItem = data.find(element => getter(element, args.valueField) === args.value);
104
- return {
105
- dataItem: dataItem,
106
- focused: args.data.indexOf(dataItem),
107
- selected: args.data.indexOf(dataItem)
108
- };
109
- }
110
- else if (args.index) {
111
- return {
112
- dataItem: args.data[args.index],
113
- focused: args.index,
114
- selected: args.index
115
- };
116
- }
117
- return {
118
- dataItem: args.defaultItem,
119
- focused: -1,
120
- selected: -1
121
- };
122
- };
123
- /**
124
- * @hidden
125
- */
126
- export const sameCharsOnly = (word, character) => {
127
- for (let idx = 0; idx < word.length; idx++) {
128
- if (word.charAt(idx) !== character) {
129
- return false;
130
- }
131
- }
132
- return true;
133
- };
134
- /**
135
- * @hidden
136
- */
137
- export const shuffleData = (data, splitIndex, defaultItem) => {
138
- let result = data;
139
- if (defaultItem) {
140
- result = [defaultItem].concat(result);
141
- }
142
- return result.slice(splitIndex).concat(result.slice(0, splitIndex));
143
- };
144
- /**
145
- * @hidden
146
- */
147
- export const matchText = (text, word, ignoreCase) => {
148
- if (!isPresent(text)) {
149
- return false;
150
- }
151
- let temp = String(text);
152
- if (ignoreCase) {
153
- temp = temp.toLowerCase();
154
- }
155
- return temp.startsWith(word);
156
- };
157
- /**
158
- * @hidden
159
- */
160
- export const elementFromPoint = (x, y) => {
161
- if (!isDocumentAvailable()) {
162
- return;
163
- }
164
- return document.elementFromPoint(x, y);
165
- };
166
- /**
167
- * @hidden
168
- *
169
- * Checks whether the passed object has all of the listed properties.
170
- */
171
- export const hasProps = (obj, props) => {
172
- if (!isPresent(obj)) {
173
- return false;
174
- }
175
- return props.every(prop => obj.hasOwnProperty(prop));
176
- };
177
- /**
178
- * @hidden
179
- *
180
- * Checks whether an element is untouched by looking for the ng-untouched css class
181
- */
182
- export const isUntouched = (element) => element.className.includes('ng-untouched');
183
- /**
184
- * @hidden
185
- */
186
- export const noop = (_) => { };
187
- /**
188
- * IE element `matches` polyfill.
189
- * https://developer.mozilla.org/en-US/docs/Web/API/Element/matches
190
- */
191
- const matches = (element, selector) => {
192
- const matcher = element.matches || element.msMatchesSelector || element.webkitMatchesSelector;
193
- if (!matcher) {
194
- return false;
195
- }
196
- return matcher.call(element, selector);
197
- };
198
- /**
199
- * @hidden
200
- *
201
- * IE element `closest` polyfill.
202
- * https://developer.mozilla.org/en-US/docs/Web/API/Element/closest
203
- */
204
- export const closest = (element, selector) => {
205
- let parent = element;
206
- while (parent !== null && parent.nodeType === 1) {
207
- if (matches(parent, selector)) {
208
- return parent;
209
- }
210
- parent = parent.parentElement || parent.parentNode;
211
- }
212
- return null;
213
- };
214
- /**
215
- * @hidden
216
- *
217
- * Parses a provided value to its type 'number' representation.
218
- * If the parsed value (via Number(value)) is NaN, the provided default value is returned.
219
- * Uses 0 as default value if a second param is not provided.
220
- */
221
- export const parseNumber = (num, defaultValue = 0) => {
222
- const normalizedValue = Number(num);
223
- return isNaN(normalizedValue) ? defaultValue : normalizedValue;
224
- };
225
- /**
226
- * @hidden
227
- *
228
- * Checks whether the passed target element is inside the provided host or popupRef.
229
- */
230
- export const inDropDown = (host, target, popupRef) => {
231
- return host.nativeElement.contains(target) || (popupRef && popupRef.popupElement.contains(target));
232
- };
233
- /**
234
- * @hidden
235
- *
236
- * Calculates the hierarchical level of an item, based on the provided index.
237
- * The result level is zero-based (starts from 0).
238
- */
239
- export const getHierarchicalItemLevel = (index) => {
240
- return (index || '').split('_').length - 1;
241
- };
242
- /**
243
- * @hidden
244
- *
245
- * Retrieves all descendant nodes' lookups which are currently registered in the provided lookup item as a flat array.
246
- */
247
- export const fetchDescendentNodes = (lookup, filterExpression) => {
248
- if (!isPresent(lookup) || lookup.children.length === 0) {
249
- return [];
250
- }
251
- let descendants = lookup.children;
252
- if (isPresent(filterExpression)) {
253
- descendants = descendants.filter(descendent => filterExpression(descendent.item));
254
- }
255
- descendants.forEach(child => descendants = descendants.concat(fetchDescendentNodes(child, filterExpression)));
256
- return descendants;
257
- };
258
- /**
259
- * @hidden
260
- *
261
- * Retrieves the correct value based on the item's level and the provided value field/s.
262
- * Used in the MultiSelectTree component.
263
- */
264
- export const valueFrom = ({ dataItem, index, level }, valueField) => {
265
- const fields = Array.isArray(valueField) ? valueField : [valueField];
266
- // either use the explicitly provided value level, or infer it from the item index
267
- const valueLevel = isPresent(level) ? level : getHierarchicalItemLevel(index);
268
- // fall-back to the last available one, if the current node is in a deeper level
269
- const normalizedLevel = Math.min(valueLevel, fields.length - 1);
270
- const field = fields[normalizedLevel];
271
- return fieldAccessor(field)(dataItem);
272
- };
273
- /**
274
- * @hidden
275
- * Returns the size class based on the component and size input.
276
- */
277
- export const getSizeClass = (component, size) => {
278
- const SIZE_CLASSES = {
279
- 'small': `k-${component}-sm`,
280
- 'medium': `k-${component}-md`,
281
- 'large': `k-${component}-lg`
282
- };
283
- return SIZE_CLASSES[size];
284
- };
285
- /**
286
- * @hidden
287
- * Returns the rounded class based on the rounded input.
288
- */
289
- export const getRoundedClass = (rounded) => {
290
- const ROUNDED_CLASSES = {
291
- 'small': 'k-rounded-sm',
292
- 'medium': 'k-rounded-md',
293
- 'large': 'k-rounded-lg',
294
- 'full': 'k-rounded-full'
295
- };
296
- return ROUNDED_CLASSES[rounded];
297
- };
298
- /**
299
- * @hidden
300
- * Return the fillMode class based on the component and fillMode input.
301
- */
302
- export const getFillModeClass = (component, fillMode) => {
303
- const FILLMODE_CLASSES = {
304
- 'solid': `k-${component}-solid`,
305
- 'flat': `k-${component}-flat`,
306
- 'outline': `k-${component}-outline`
307
- };
308
- return FILLMODE_CLASSES[fillMode];
309
- };
310
- /**
311
- * @hidden
312
- */
313
- export const filterAndMap = (arr, predicate, mapper) => arr.reduce((acc, curr) => predicate(curr) ? [...acc, mapper(curr)] : acc, []);
314
- /**
315
- * @hidden
316
- *
317
- * Checks if input is Japanese IME
318
- */
319
- export const isJapanese = (input) => {
320
- const japaneseRegex = /[\u3000-\u303F]|[\u3040-\u309F]|[\u30A0-\u30FF]|[\uFF00-\uFFEF]|[\u4E00-\u9FAF]|[\u2605-\u2606]|[\u2190-\u2195]|\u203B/g;
321
- return japaneseRegex.test(input);
322
- };
323
- /**
324
- * @hidden
325
- */
326
- export const isLetter = (text) => {
327
- const isLetter = /[a-zA-Z]/;
328
- return isLetter.test(text) && text?.length === 1;
329
- };
330
- /**
331
- * @hidden
332
- */
333
- export const getTextField = (field, level) => {
334
- if (isArray(field)) {
335
- return field[level];
336
- }
337
- return field;
338
- };
339
- /**
340
- * @hidden
341
- */
342
- export const getSearchableItems = (treeViewId, element) => {
343
- const nodeSeletor = `kendo-treeview[id='${treeViewId}'] li.k-treeview-item`;
344
- const liElements = Array.from(element.querySelectorAll(nodeSeletor));
345
- return liElements.map((liElement) => {
346
- return { text: liElement.innerText, index: liElement.getAttribute('data-treeindex') };
347
- });
348
- };
349
- /**
350
- * @hidden
351
- */
352
- export const isTruthy = (value) => !!value;
353
- /**
354
- * @hidden
355
- */
356
- export const setListBoxAriaLabelledBy = (optionsList, element, renderer) => {
357
- const listBox = optionsList.wrapper.nativeElement.querySelector('kendo-list ul');
358
- const ariaLabel = element.nativeElement.getAttribute('aria-labelledby') || element.nativeElement.getAttribute('data-kendo-label-id');
359
- if (ariaLabel) {
360
- renderer.setAttribute(listBox, 'aria-labelledby', ariaLabel);
361
- }
362
- };
363
- /**
364
- * @hidden
365
- */
366
- export const setActionSheetTitle = (element, actionSheetTitle) => {
367
- const ariaLabel = element.nativeElement.getAttribute('aria-labelledby') || element.nativeElement.getAttribute('data-kendo-label-id');
368
- if (!actionSheetTitle && ariaLabel) {
369
- return document.getElementById(ariaLabel).innerText;
370
- }
371
- return actionSheetTitle;
372
- };
373
- /**
374
- * @hidden
375
- */
376
- export const animationDuration = 300;