@progress/kendo-react-dropdowns 13.3.0 → 13.4.0-develop.2
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/AutoComplete/AutoComplete.d.ts +274 -0
- package/AutoComplete/AutoComplete.js +1 -1
- package/AutoComplete/AutoComplete.mjs +67 -69
- package/AutoComplete/AutoCompleteProps.d.ts +509 -0
- package/ComboBox/ComboBox.d.ts +279 -0
- package/ComboBox/ComboBox.js +1 -1
- package/ComboBox/ComboBox.mjs +281 -297
- package/ComboBox/ComboBoxProps.d.ts +632 -0
- package/DropDownList/DropDownList.d.ts +41 -0
- package/DropDownList/DropDownList.js +1 -1
- package/DropDownList/DropDownList.mjs +78 -83
- package/DropDownList/DropDownListProps.d.ts +594 -0
- package/DropDownList/models/index.d.ts +54 -0
- package/DropDownTree/DropDownTree.d.ts +76 -0
- package/DropDownTree/DropDownTree.js +1 -1
- package/DropDownTree/DropDownTree.mjs +6 -8
- package/DropDownTree/DropDownTreeProps.d.ts +506 -0
- package/DropDownTree/ListNoData.d.ts +13 -0
- package/DropDownTree/useDropdownWidth.d.ts +13 -0
- package/MultiColumnComboBox/MultiColumnComboBox.d.ts +299 -0
- package/MultiColumnComboBox/MultiColumnComboBox.js +1 -1
- package/MultiColumnComboBox/MultiColumnComboBox.mjs +45 -48
- package/MultiSelect/MultiSelect.d.ts +281 -0
- package/MultiSelect/MultiSelect.js +1 -1
- package/MultiSelect/MultiSelect.mjs +13 -15
- package/MultiSelect/MultiSelectProps.d.ts +592 -0
- package/MultiSelect/TagList.d.ts +45 -0
- package/MultiSelectTree/MultiSelectTree.d.ts +87 -0
- package/MultiSelectTree/MultiSelectTree.js +1 -1
- package/MultiSelectTree/MultiSelectTree.mjs +7 -7
- package/MultiSelectTree/MultiSelectTreeProps.d.ts +554 -0
- package/MultiSelectTree/utils.d.ts +24 -0
- package/common/AdaptiveMode.d.ts +22 -0
- package/common/ClearButton.d.ts +19 -0
- package/common/DropDownBase.d.ts +186 -0
- package/common/DropDownBase.js +1 -1
- package/common/DropDownBase.mjs +1 -1
- package/common/GroupStickyHeader.d.ts +26 -0
- package/common/GroupStickyHeader.js +1 -1
- package/common/GroupStickyHeader.mjs +6 -6
- package/common/List.d.ts +54 -0
- package/common/List.js +1 -1
- package/common/List.mjs +129 -77
- package/common/ListContainer.d.ts +24 -0
- package/common/ListDefaultItem.d.ts +22 -0
- package/common/ListFilter.d.ts +29 -0
- package/common/ListFilter.js +1 -1
- package/common/ListFilter.mjs +12 -12
- package/common/ListGroupItem.d.ts +54 -0
- package/common/ListGroupItem.js +1 -1
- package/common/ListGroupItem.mjs +21 -13
- package/common/ListItem.d.ts +87 -0
- package/common/ListItem.js +1 -1
- package/common/ListItem.mjs +62 -21
- package/common/ListItemIcon.d.ts +26 -0
- package/common/ListItemIcon.js +8 -0
- package/common/ListItemIcon.mjs +21 -0
- package/common/MultiColumnList.d.ts +13 -0
- package/common/Navigation.d.ts +20 -0
- package/common/SearchBar.d.ts +55 -0
- package/common/VirtualScrollStatic.d.ts +44 -0
- package/common/events.d.ts +82 -0
- package/common/filterDescriptor.d.ts +48 -0
- package/common/settings.d.ts +112 -0
- package/common/utils.d.ts +82 -0
- package/common/utils.js +1 -1
- package/common/utils.mjs +50 -47
- package/common/withCustomComponent.d.ts +12 -0
- package/dist/cdn/js/kendo-react-dropdowns.js +1 -1
- package/index.d.mts +28 -5545
- package/index.d.ts +28 -5545
- package/messages/index.d.ts +52 -0
- package/package-metadata.d.ts +12 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +10 -16
- package/package.json +10 -10
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { FilterDescriptor } from './filterDescriptor.js';
|
|
9
|
+
import { Page } from './settings.js';
|
|
10
|
+
/**
|
|
11
|
+
* @hidden
|
|
12
|
+
*/
|
|
13
|
+
export interface DropdownEvent<T> {
|
|
14
|
+
/**
|
|
15
|
+
* A native DOM event.
|
|
16
|
+
*/
|
|
17
|
+
nativeEvent: Event;
|
|
18
|
+
/**
|
|
19
|
+
* A React [`SyntheticEvent`](https://react.dev/learn/responding-to-events).
|
|
20
|
+
*/
|
|
21
|
+
syntheticEvent: React.SyntheticEvent<HTMLElement>;
|
|
22
|
+
/**
|
|
23
|
+
* An event target.
|
|
24
|
+
*/
|
|
25
|
+
target: T;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* @hidden
|
|
29
|
+
*/
|
|
30
|
+
export interface FilterChangeEvent<T> extends DropdownEvent<T> {
|
|
31
|
+
/**
|
|
32
|
+
* A React [`SyntheticEvent`](https://react.dev/learn/responding-to-events).
|
|
33
|
+
*/
|
|
34
|
+
syntheticEvent: React.ChangeEvent<HTMLInputElement>;
|
|
35
|
+
/**
|
|
36
|
+
* The default `FilterDescriptor` object.
|
|
37
|
+
*/
|
|
38
|
+
filter: FilterDescriptor;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* @hidden
|
|
42
|
+
*/
|
|
43
|
+
export interface ChangeEvent<T> extends DropdownEvent<T> {
|
|
44
|
+
/**
|
|
45
|
+
* The current value of the component.
|
|
46
|
+
*/
|
|
47
|
+
value: any;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* @hidden
|
|
51
|
+
*/
|
|
52
|
+
export interface OpenEvent<T> extends DropdownEvent<T> {
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* @hidden
|
|
56
|
+
*/
|
|
57
|
+
export interface CloseEvent<T> extends DropdownEvent<T> {
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* @hidden
|
|
61
|
+
*/
|
|
62
|
+
export interface FocusEvent<T> extends DropdownEvent<T> {
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* @hidden
|
|
66
|
+
*/
|
|
67
|
+
export interface BlurEvent<T> extends DropdownEvent<T> {
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* @hidden
|
|
71
|
+
*/
|
|
72
|
+
export interface CancelEvent<T> extends DropdownEvent<T> {
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* @hidden
|
|
76
|
+
*/
|
|
77
|
+
export interface PageChangeEvent<T> extends DropdownEvent<T> {
|
|
78
|
+
/**
|
|
79
|
+
* The page information for the paging operation.
|
|
80
|
+
*/
|
|
81
|
+
page: Page;
|
|
82
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* A basic filter expression. Usually a part of [`CompositeFilterDescriptor`](https://www.telerik.com/kendo-react-ui/components/datatools/api/compositefilterdescriptor).
|
|
10
|
+
*
|
|
11
|
+
* For more information, refer to the [`filterBy`](https://www.telerik.com/kendo-react-ui/components/datatools/api/filterby) method.
|
|
12
|
+
*/
|
|
13
|
+
export interface FilterDescriptor {
|
|
14
|
+
/**
|
|
15
|
+
* The field of the data item to which the filter operator is applied.
|
|
16
|
+
*/
|
|
17
|
+
field?: string | Function;
|
|
18
|
+
/**
|
|
19
|
+
* The filter operator (comparison).
|
|
20
|
+
*
|
|
21
|
+
* The supported operators are:
|
|
22
|
+
* * `"eq"` (equal to)
|
|
23
|
+
* * `"neq"` (not equal to)
|
|
24
|
+
* * `"isnull"` (is equal to null)
|
|
25
|
+
* * `"isnotnull"` (is not equal to null)
|
|
26
|
+
* * `"lt"` (less than)
|
|
27
|
+
* * `"lte"` (less than or equal to)
|
|
28
|
+
* * `"gt"` (greater than)
|
|
29
|
+
* * `"gte"` (greater than or equal to)
|
|
30
|
+
*
|
|
31
|
+
* The following operators are supported for string fields only:
|
|
32
|
+
* * `"startswith"`
|
|
33
|
+
* * `"endswith"`
|
|
34
|
+
* * `"contains"`
|
|
35
|
+
* * `"doesnotcontain"`
|
|
36
|
+
* * `"isempty"`
|
|
37
|
+
* * `"isnotempty"`
|
|
38
|
+
*/
|
|
39
|
+
operator: string | Function;
|
|
40
|
+
/**
|
|
41
|
+
* The value to which the field is compared. Has to be of the same type as the field.
|
|
42
|
+
*/
|
|
43
|
+
value?: any;
|
|
44
|
+
/**
|
|
45
|
+
* Determines if the string comparison is case-insensitive.
|
|
46
|
+
*/
|
|
47
|
+
ignoreCase?: boolean;
|
|
48
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { PopupProps } from '@progress/kendo-react-popup';
|
|
9
|
+
import { FilterDescriptor } from './filterDescriptor.js';
|
|
10
|
+
/**
|
|
11
|
+
* Represents the `skip` and `take` configurations which are wrapped in the `page` object.
|
|
12
|
+
*/
|
|
13
|
+
export interface Page {
|
|
14
|
+
/**
|
|
15
|
+
* The number of records to skip.
|
|
16
|
+
*/
|
|
17
|
+
skip: number;
|
|
18
|
+
/**
|
|
19
|
+
* The number of records to take.
|
|
20
|
+
*/
|
|
21
|
+
take: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The virtualization settings.
|
|
25
|
+
*/
|
|
26
|
+
export interface VirtualizationSettings {
|
|
27
|
+
/**
|
|
28
|
+
* The number of the requested records.
|
|
29
|
+
*/
|
|
30
|
+
pageSize: number;
|
|
31
|
+
/**
|
|
32
|
+
* The number of records to skip.
|
|
33
|
+
*/
|
|
34
|
+
skip: number;
|
|
35
|
+
/**
|
|
36
|
+
* The number of all records.
|
|
37
|
+
*/
|
|
38
|
+
total: number;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The settings of the popup container.
|
|
42
|
+
*/
|
|
43
|
+
export interface DropDownsPopupSettings extends PopupProps {
|
|
44
|
+
/**
|
|
45
|
+
* Specifies a list of CSS classes that are used for styling the popup inner element.
|
|
46
|
+
*/
|
|
47
|
+
popupClass?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Sets the width of the popup container. By default, the width of the host element is used.
|
|
50
|
+
*/
|
|
51
|
+
width?: string | number;
|
|
52
|
+
/**
|
|
53
|
+
* Sets the height of the DOM element inside the DropDowns' popup that contains the data items of each component. This height doesn't include the header and footer.
|
|
54
|
+
*/
|
|
55
|
+
height?: string | number;
|
|
56
|
+
/**
|
|
57
|
+
* Defines the container to which the Popup will be appended.
|
|
58
|
+
* Defaults to [`body`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body).
|
|
59
|
+
* * If set to `null` the Popup will be rendered without React Portal.
|
|
60
|
+
*/
|
|
61
|
+
appendTo?: HTMLElement | null;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* @hidden
|
|
65
|
+
*/
|
|
66
|
+
export interface EventData {
|
|
67
|
+
type?: string;
|
|
68
|
+
filter?: FilterDescriptor;
|
|
69
|
+
page?: Page;
|
|
70
|
+
suggestion?: Suggestion;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Represents the `Suggestion` object of the AutoComplete.
|
|
74
|
+
*/
|
|
75
|
+
export interface Suggestion {
|
|
76
|
+
/**
|
|
77
|
+
* Represents the typed text of the user.
|
|
78
|
+
*/
|
|
79
|
+
readonly userInput: string;
|
|
80
|
+
/**
|
|
81
|
+
* Represents the suggested text without the user input.
|
|
82
|
+
*/
|
|
83
|
+
readonly value: string;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* @hidden
|
|
87
|
+
*/
|
|
88
|
+
export interface InternalState {
|
|
89
|
+
data: DropDownStateBase;
|
|
90
|
+
events: Array<EventData>;
|
|
91
|
+
syntheticEvent: React.MouseEvent<HTMLElement> | React.FocusEvent<HTMLElement> | React.ChangeEvent<HTMLInputElement> | React.FormEvent<HTMLInputElement> | React.KeyboardEvent<HTMLElement> | undefined;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* @hidden
|
|
95
|
+
*/
|
|
96
|
+
export interface DropDownStateBase {
|
|
97
|
+
/**
|
|
98
|
+
* Input element text of the Component.
|
|
99
|
+
*/
|
|
100
|
+
text?: string;
|
|
101
|
+
value?: any;
|
|
102
|
+
focused?: boolean;
|
|
103
|
+
opened?: boolean;
|
|
104
|
+
group?: string;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* @hidden
|
|
108
|
+
*/
|
|
109
|
+
export declare enum ActiveDescendant {
|
|
110
|
+
PopupList = 0,
|
|
111
|
+
TagsList = 1
|
|
112
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { TagData } from '../MultiSelect/TagList.js';
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
declare const isPresent: (value: any) => boolean;
|
|
13
|
+
/**
|
|
14
|
+
* @hidden
|
|
15
|
+
*/
|
|
16
|
+
declare const sameCharsOnly: (word: string, character: string) => boolean;
|
|
17
|
+
/**
|
|
18
|
+
* @hidden
|
|
19
|
+
*/
|
|
20
|
+
declare const shuffleData: (data: Array<any>, splitIndex: number, defaultItem: any) => any[];
|
|
21
|
+
/**
|
|
22
|
+
* @hidden
|
|
23
|
+
*/
|
|
24
|
+
declare const matchText: (text: string, word: string, ignoreCase?: boolean) => boolean;
|
|
25
|
+
/**
|
|
26
|
+
* @hidden
|
|
27
|
+
*/
|
|
28
|
+
declare const scrollToItem: (scrollElem: HTMLDivElement, list: HTMLUListElement, itemIndex: number, translate: number, virtualScroll: boolean) => void;
|
|
29
|
+
/**
|
|
30
|
+
* @hidden
|
|
31
|
+
*/
|
|
32
|
+
declare const itemIndexStartsWith: (items: any[], text?: string, field?: string) => number;
|
|
33
|
+
/**
|
|
34
|
+
* @hidden
|
|
35
|
+
*/
|
|
36
|
+
declare const getItemIndexByText: (data: Array<any>, text: string, textField?: string, matchCase?: boolean, ignoreCase?: boolean) => number;
|
|
37
|
+
/**
|
|
38
|
+
* Get the value of the item by its field.
|
|
39
|
+
*/
|
|
40
|
+
declare const getItemValue: (item: any, field?: string) => any;
|
|
41
|
+
/**
|
|
42
|
+
* Find item in the data by field and value.
|
|
43
|
+
*/
|
|
44
|
+
export declare const findByFieldValue: (data: any[], field: string, value: string | number | null) => any;
|
|
45
|
+
/**
|
|
46
|
+
* @hidden
|
|
47
|
+
*/
|
|
48
|
+
declare const matchDataCollections: (data1?: Array<any>, data2?: Array<any>, key?: string) => boolean;
|
|
49
|
+
/**
|
|
50
|
+
* @hidden
|
|
51
|
+
*/
|
|
52
|
+
declare const removeDataItems: (items: Array<any>, toRemove: Array<any>, key?: string) => void;
|
|
53
|
+
/**
|
|
54
|
+
* @hidden
|
|
55
|
+
*/
|
|
56
|
+
declare const areSame: (item1: any, item2: any, key?: string) => boolean;
|
|
57
|
+
/**
|
|
58
|
+
* @hidden
|
|
59
|
+
*/
|
|
60
|
+
declare const getFocusedItem: (data: Array<any>, value?: string, textField?: string) => number;
|
|
61
|
+
/**
|
|
62
|
+
* @hidden
|
|
63
|
+
*/
|
|
64
|
+
declare const suggestValue: (value?: string, data?: Array<any>, textField?: string) => string;
|
|
65
|
+
/**
|
|
66
|
+
* @hidden
|
|
67
|
+
*/
|
|
68
|
+
declare const preventDefaultNonInputs: (event: any) => void;
|
|
69
|
+
/**
|
|
70
|
+
* @hidden
|
|
71
|
+
*/
|
|
72
|
+
declare const matchTags: (tag1: TagData, tag2: TagData, key?: string) => boolean;
|
|
73
|
+
/**
|
|
74
|
+
* @hidden
|
|
75
|
+
* Returns the duplicate items from a plain(string only) data collection.
|
|
76
|
+
*/
|
|
77
|
+
declare const getPlainDataDuplicates: (dataItems: string[]) => string[];
|
|
78
|
+
/**
|
|
79
|
+
* @hidden
|
|
80
|
+
*/
|
|
81
|
+
declare const getFilteredData: (props: any) => any[];
|
|
82
|
+
export { isPresent, sameCharsOnly, shuffleData, matchText, scrollToItem, itemIndexStartsWith, getItemIndexByText, getItemValue, matchDataCollections, removeDataItems, areSame, getFocusedItem, preventDefaultNonInputs, suggestValue, matchTags, getPlainDataDuplicates, getFilteredData };
|
package/common/utils.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=e=>e!=null,
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=e=>e!=null,I=(e,t)=>{for(let n=0;n<e.length;n++)if(e.charAt(n)!==t)return!1;return!0},m=(e,t,n)=>{let r=e;return n&&(r=[n].concat(r)),r.slice(t).concat(r.slice(0,t))},D=(e,t,n)=>{if(!u(e))return!1;let r=String(e);return n&&(r=r.toLowerCase()),r.indexOf(t)===0},x=(e,t,n,r,s)=>{const o=e.offsetHeight,g=e.querySelectorAll('[role="option"]')[n]||t.children.item(n);if(!g)return;const i=g.offsetTop+(s?r-e.scrollTop:0),l=g.offsetHeight;if(s){let a=0;i+l>o?a=i+l-o:i<0&&(a=i),a!==0?e.scrollTop+=a:e.scrollTop===0&&r!==0&&(e.scrollTop=r)}else i+l>o+e.scrollTop?e.scrollTop=i+l-o:i<e.scrollTop&&(e.scrollTop-=e.scrollTop-i)},h=(e,t,n)=>{let r=-1;if(t){t=t.toLowerCase();for(let s=0;s<e.length;s++){const o=(f(e[s],n)||"")+"";if(o&&o.toLowerCase().startsWith(t)){r=s;break}}}return r},T=(e,t,n,r=!1,s=!1)=>{const o=c=>s||!r?c.toLowerCase():c;return e.findIndex(c=>n?o(f(c,n))===o(t):o(t)===o(c.toString()))},f=(e,t)=>{if(t&&u(e)){const n=t.split(".");let r=e;return n.forEach(s=>{r=r?r[s]:void 0}),r}return e},C=(e,t,n)=>{if(!e)return;const r=e.findIndex(s=>f(s,t)===n);return e[r]},d=(e=[],t=[],n)=>{if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!p(e[r],t[r],n))return!1;return!0},y=(e,t,n)=>{t.forEach(r=>{const s=e.findIndex(o=>p(o,r,n));s!==-1&&e.splice(s,1)})},p=(e,t,n)=>e===t||u(e)===u(t)&&f(e,n)===f(t,n),S=(e,t,n)=>{if(t){const r=T(e,t,n,!0);return r!==-1?e[r]:e[h(e,t,n)]}return e[0]},w=(e,t=[],n)=>{let r="";if(e){const s=t[h(t,e,n)];if(s){const o=f(s,n);e.toLowerCase()!==o.toLowerCase()&&(r=o.substring(e.length))}}return r},L=e=>{e.target.nodeName!=="INPUT"&&e.preventDefault()},P=(e,t,n)=>!!e!=!!t||e.text!==t.text?!1:e===t||d(e.data,t.data,n),V=e=>{const t=e.filter((n,r)=>e.some((s,o)=>s===n&&o!==r));return Array.from(new Set(t))},O=e=>{const{data:t=[],groupField:n}=e;return n?t.filter(r=>n&&r[n]!==void 0):t};exports.areSame=p;exports.findByFieldValue=C;exports.getFilteredData=O;exports.getFocusedItem=S;exports.getItemIndexByText=T;exports.getItemValue=f;exports.getPlainDataDuplicates=V;exports.isPresent=u;exports.itemIndexStartsWith=h;exports.matchDataCollections=d;exports.matchTags=P;exports.matchText=D;exports.preventDefaultNonInputs=L;exports.removeDataItems=y;exports.sameCharsOnly=I;exports.scrollToItem=x;exports.shuffleData=m;exports.suggestValue=w;
|
package/common/utils.mjs
CHANGED
|
@@ -5,91 +5,94 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
const g = (e) => e != null,
|
|
8
|
+
const g = (e) => e != null, I = (e, t) => {
|
|
9
9
|
for (let r = 0; r < e.length; r++)
|
|
10
10
|
if (e.charAt(r) !== t)
|
|
11
11
|
return !1;
|
|
12
12
|
return !0;
|
|
13
|
-
},
|
|
13
|
+
}, C = (e, t, r) => {
|
|
14
14
|
let n = e;
|
|
15
15
|
return r && (n = [r].concat(n)), n.slice(t).concat(n.slice(0, t));
|
|
16
|
-
},
|
|
16
|
+
}, D = (e, t, r) => {
|
|
17
17
|
if (!g(e))
|
|
18
18
|
return !1;
|
|
19
19
|
let n = String(e);
|
|
20
20
|
return r && (n = n.toLowerCase()), n.indexOf(t) === 0;
|
|
21
|
-
},
|
|
22
|
-
const
|
|
23
|
-
if (
|
|
21
|
+
}, w = (e, t, r, n, o) => {
|
|
22
|
+
const s = e.offsetHeight, p = e.querySelectorAll('[role="option"]')[r] || t.children.item(r);
|
|
23
|
+
if (!p)
|
|
24
|
+
return;
|
|
25
|
+
const f = p.offsetTop + (o ? n - e.scrollTop : 0), u = p.offsetHeight;
|
|
26
|
+
if (o) {
|
|
24
27
|
let l = 0;
|
|
25
|
-
|
|
28
|
+
f + u > s ? l = f + u - s : f < 0 && (l = f), l !== 0 ? e.scrollTop += l : e.scrollTop === 0 && n !== 0 && (e.scrollTop = n);
|
|
26
29
|
} else
|
|
27
|
-
|
|
30
|
+
f + u > s + e.scrollTop ? e.scrollTop = f + u - s : f < e.scrollTop && (e.scrollTop -= e.scrollTop - f);
|
|
28
31
|
}, h = (e, t, r) => {
|
|
29
32
|
let n = -1;
|
|
30
33
|
if (t) {
|
|
31
34
|
t = t.toLowerCase();
|
|
32
|
-
for (let
|
|
33
|
-
const
|
|
34
|
-
if (
|
|
35
|
-
n =
|
|
35
|
+
for (let o = 0; o < e.length; o++) {
|
|
36
|
+
const s = (c(e[o], r) || "") + "";
|
|
37
|
+
if (s && s.toLowerCase().startsWith(t)) {
|
|
38
|
+
n = o;
|
|
36
39
|
break;
|
|
37
40
|
}
|
|
38
41
|
}
|
|
39
42
|
}
|
|
40
43
|
return n;
|
|
41
|
-
},
|
|
42
|
-
const
|
|
43
|
-
return e.findIndex((
|
|
44
|
+
}, a = (e, t, r, n = !1, o = !1) => {
|
|
45
|
+
const s = (i) => o || !n ? i.toLowerCase() : i;
|
|
46
|
+
return e.findIndex((i) => r ? s(c(i, r)) === s(t) : s(t) === s(i.toString()));
|
|
44
47
|
}, c = (e, t) => {
|
|
45
48
|
if (t && g(e)) {
|
|
46
49
|
const r = t.split(".");
|
|
47
50
|
let n = e;
|
|
48
|
-
return r.forEach((
|
|
49
|
-
n = n ? n[
|
|
51
|
+
return r.forEach((o) => {
|
|
52
|
+
n = n ? n[o] : void 0;
|
|
50
53
|
}), n;
|
|
51
54
|
}
|
|
52
55
|
return e;
|
|
53
|
-
},
|
|
56
|
+
}, x = (e, t, r) => {
|
|
54
57
|
if (!e)
|
|
55
58
|
return;
|
|
56
|
-
const n = e.findIndex((
|
|
59
|
+
const n = e.findIndex((o) => c(o, t) === r);
|
|
57
60
|
return e[n];
|
|
58
|
-
},
|
|
61
|
+
}, d = (e = [], t = [], r) => {
|
|
59
62
|
if (e === t)
|
|
60
63
|
return !0;
|
|
61
64
|
if (e.length !== t.length)
|
|
62
65
|
return !1;
|
|
63
66
|
for (let n = 0; n < e.length; n++)
|
|
64
|
-
if (!
|
|
67
|
+
if (!T(e[n], t[n], r))
|
|
65
68
|
return !1;
|
|
66
69
|
return !0;
|
|
67
|
-
},
|
|
70
|
+
}, L = (e, t, r) => {
|
|
68
71
|
t.forEach((n) => {
|
|
69
|
-
const
|
|
70
|
-
|
|
72
|
+
const o = e.findIndex((s) => T(s, n, r));
|
|
73
|
+
o !== -1 && e.splice(o, 1);
|
|
71
74
|
});
|
|
72
|
-
},
|
|
75
|
+
}, T = (e, t, r) => e === t || g(e) === g(t) && c(e, r) === c(t, r), S = (e, t, r) => {
|
|
73
76
|
if (t) {
|
|
74
|
-
const n =
|
|
77
|
+
const n = a(e, t, r, !0);
|
|
75
78
|
return n !== -1 ? e[n] : e[h(e, t, r)];
|
|
76
79
|
}
|
|
77
80
|
return e[0];
|
|
78
|
-
},
|
|
81
|
+
}, y = (e, t = [], r) => {
|
|
79
82
|
let n = "";
|
|
80
83
|
if (e) {
|
|
81
|
-
const
|
|
82
|
-
if (
|
|
83
|
-
const
|
|
84
|
-
e.toLowerCase() !==
|
|
84
|
+
const o = t[h(t, e, r)];
|
|
85
|
+
if (o) {
|
|
86
|
+
const s = c(o, r);
|
|
87
|
+
e.toLowerCase() !== s.toLowerCase() && (n = s.substring(e.length));
|
|
85
88
|
}
|
|
86
89
|
}
|
|
87
90
|
return n;
|
|
88
|
-
},
|
|
91
|
+
}, H = (e) => {
|
|
89
92
|
e.target.nodeName !== "INPUT" && e.preventDefault();
|
|
90
|
-
},
|
|
93
|
+
}, A = (e, t, r) => !!e != !!t || e.text !== t.text ? !1 : e === t || d(e.data, t.data, r), N = (e) => {
|
|
91
94
|
const t = e.filter(
|
|
92
|
-
(r, n) => e.some((
|
|
95
|
+
(r, n) => e.some((o, s) => o === r && s !== n)
|
|
93
96
|
);
|
|
94
97
|
return Array.from(new Set(t));
|
|
95
98
|
}, O = (e) => {
|
|
@@ -97,22 +100,22 @@ const g = (e) => e != null, d = (e, t) => {
|
|
|
97
100
|
return r ? t.filter((n) => r && n[r] !== void 0) : t;
|
|
98
101
|
};
|
|
99
102
|
export {
|
|
100
|
-
|
|
101
|
-
|
|
103
|
+
T as areSame,
|
|
104
|
+
x as findByFieldValue,
|
|
102
105
|
O as getFilteredData,
|
|
103
|
-
|
|
104
|
-
|
|
106
|
+
S as getFocusedItem,
|
|
107
|
+
a as getItemIndexByText,
|
|
105
108
|
c as getItemValue,
|
|
106
109
|
N as getPlainDataDuplicates,
|
|
107
110
|
g as isPresent,
|
|
108
111
|
h as itemIndexStartsWith,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
112
|
+
d as matchDataCollections,
|
|
113
|
+
A as matchTags,
|
|
114
|
+
D as matchText,
|
|
115
|
+
H as preventDefaultNonInputs,
|
|
116
|
+
L as removeDataItems,
|
|
117
|
+
I as sameCharsOnly,
|
|
118
|
+
w as scrollToItem,
|
|
119
|
+
C as shuffleData,
|
|
120
|
+
y as suggestValue
|
|
118
121
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* @hidden
|
|
10
|
+
*/
|
|
11
|
+
declare const withCustomComponent: <P = unknown>(comp: import('react').ExoticComponent<import('react').FragmentProps> | import('@progress/kendo-react-common').CustomComponent<P> | null) => [string | import('react').ComponentType<P & import('react').RefAttributes<unknown>>, Partial<P>];
|
|
12
|
+
export default withCustomComponent;
|