Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/devextreme-angular/src/ui/accordion/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,10 @@ export class DxAccordionComponent<TItem = any, TKey = any> extends DxComponent i

*/
@Input()
get keyExpr(): Function | string {
get keyExpr(): (() => string) | string {
return this._getOption('keyExpr');
}
set keyExpr(value: Function | string) {
set keyExpr(value: (() => string) | string) {
this._setOption('keyExpr', value);
Comment on lines 290 to 295
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keyExpr is typed as (() => string) | string, but in collection widgets this callback is treated as a key getter and invoked with item data. The zero-arg signature and forced string return type are both incompatible with common usage.

Suggested fix: type it as ((item: TItem) => TKey) | string for both getter and setter.

Copilot uses AI. Check for mistakes.
}

Expand Down Expand Up @@ -635,7 +635,7 @@ export class DxAccordionComponent<TItem = any, TKey = any> extends DxComponent i
* This member supports the internal infrastructure and is not intended to be used directly from your code.

*/
@Output() keyExprChange: EventEmitter<Function | string>;
@Output() keyExprChange: EventEmitter<(() => string) | string>;
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keyExprChange is now EventEmitter<(() => string) | string>, which doesn’t reflect actual keyExpr semantics (function should accept item data and return the key type). This will surface an incorrect public API in the Angular wrapper.

Suggested fix: align to EventEmitter<((item: TItem) => TKey) | string> (or whatever the final keyExpr type is).

Suggested change
@Output() keyExprChange: EventEmitter<(() => string) | string>;
@Output() keyExprChange: EventEmitter<((item: any) => string) | string>;

Copilot uses AI. Check for mistakes.

/**

Expand Down
6 changes: 3 additions & 3 deletions packages/devextreme-angular/src/ui/list/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,10 +380,10 @@ export class DxListComponent<TItem = any, TKey = any> extends DxComponent implem

*/
@Input()
get keyExpr(): Function | string {
get keyExpr(): (() => string) | string {
return this._getOption('keyExpr');
}
set keyExpr(value: Function | string) {
set keyExpr(value: (() => string) | string) {
this._setOption('keyExpr', value);
Comment on lines 382 to 387
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keyExpr is typed as (() => string) | string, but this option is used as a key getter and is invoked with the item data. This typing breaks standard usage like (item) => item.id and also narrows keys to string.

Suggested fix: use ((item: TItem) => TKey) | string for both getter and setter.

Copilot uses AI. Check for mistakes.
}

Expand Down Expand Up @@ -1120,7 +1120,7 @@ export class DxListComponent<TItem = any, TKey = any> extends DxComponent implem
* This member supports the internal infrastructure and is not intended to be used directly from your code.

*/
@Output() keyExprChange: EventEmitter<Function | string>;
@Output() keyExprChange: EventEmitter<(() => string) | string>;
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keyExprChange is now EventEmitter<(() => string) | string>, which does not match how keyExpr is used (key getter invoked with item data). This is a breaking/inaccurate type for consumers.

Suggested fix: align it with the corrected keyExpr type, e.g. EventEmitter<((item: TItem) => TKey) | string>.

Suggested change
@Output() keyExprChange: EventEmitter<(() => string) | string>;
@Output() keyExprChange: EventEmitter<((item: any) => any) | string>;

Copilot uses AI. Check for mistakes.

/**

Expand Down
6 changes: 3 additions & 3 deletions packages/devextreme-angular/src/ui/tabs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,10 @@ export class DxTabsComponent<TItem = any, TKey = any> extends DxComponent implem

*/
@Input()
get keyExpr(): Function | string {
get keyExpr(): (() => string) | string {
return this._getOption('keyExpr');
}
set keyExpr(value: Function | string) {
set keyExpr(value: (() => string) | string) {
this._setOption('keyExpr', value);
Comment on lines 239 to 244
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keyExpr is typed as (() => string) | string, but for collection widgets this callback is used as a key getter and is invoked with the item data. This typing breaks common Angular usage like (item) => item.id and also forces the key to string.

Suggested fix: type it as ((item: TItem) => TKey) | string (and update the corresponding setter type to match).

Copilot uses AI. Check for mistakes.
}

Expand Down Expand Up @@ -621,7 +621,7 @@ export class DxTabsComponent<TItem = any, TKey = any> extends DxComponent implem
* This member supports the internal infrastructure and is not intended to be used directly from your code.

*/
@Output() keyExprChange: EventEmitter<Function | string>;
@Output() keyExprChange: EventEmitter<(() => string) | string>;
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keyExprChange is now EventEmitter<(() => string) | string>, but it should stay aligned with the keyExpr option type (a key getter invoked with item data and returning the key type). Otherwise the wrapper exposes an incorrect/breaking type.

Suggested fix: update to EventEmitter<((item: TItem) => TKey) | string> (or whatever final keyExpr type is chosen).

Suggested change
@Output() keyExprChange: EventEmitter<(() => string) | string>;
@Output() keyExprChange: EventEmitter<((item: any) => any) | string>;

Copilot uses AI. Check for mistakes.

/**

Expand Down
2 changes: 1 addition & 1 deletion packages/devextreme-vue/src/accordion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const componentConfig = {
items: Array as PropType<Array<any | dxAccordionItem | string>>,
itemTemplate: {},
itemTitleTemplate: {},
keyExpr: [Function, String] as PropType<((() => void)) | string>,
keyExpr: [Function, String] as PropType<((() => string)) | string>,
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keyExpr is typed as (() => string) | string, but this option is treated as a key getter invoked with item data. A zero-argument function type will incorrectly reject standard patterns like (item) => item.id.

Suggested fix: type as ((item: any) => any) | string (or reuse the widget Properties["keyExpr"] type) to reflect actual usage.

Suggested change
keyExpr: [Function, String] as PropType<((() => string)) | string>,
keyExpr: [Function, String] as PropType<Properties["keyExpr"]>,

Copilot uses AI. Check for mistakes.
multiple: Boolean,
noDataText: String,
onContentReady: Function as PropType<((e: ContentReadyEvent) => void)>,
Expand Down
2 changes: 1 addition & 1 deletion packages/devextreme-vue/src/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ const componentConfig = {
itemHoldTimeout: Number,
items: Array as PropType<Array<any | dxListItem | string>>,
itemTemplate: {},
keyExpr: [Function, String] as PropType<((() => void)) | string>,
keyExpr: [Function, String] as PropType<((() => string)) | string>,
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keyExpr is typed as (() => string) | string, but it is used as a key getter called with the item data. The zero-arg callback type is incompatible with typical usage (item) => item.id.

Suggested fix: change to ((item: any) => any) | string (or use the component Properties["keyExpr"] type) to match runtime behavior.

Suggested change
keyExpr: [Function, String] as PropType<((() => string)) | string>,
keyExpr: [Function, String] as PropType<Properties["keyExpr"]>,

Copilot uses AI. Check for mistakes.
menuItems: Array as PropType<Array<Record<string, any>>>,
menuMode: String as PropType<ListMenuMode>,
nextButtonText: String,
Expand Down
2 changes: 1 addition & 1 deletion packages/devextreme-vue/src/tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const componentConfig = {
itemHoldTimeout: Number,
items: Array as PropType<Array<any | dxTabsItem | string>>,
itemTemplate: {},
keyExpr: [Function, String] as PropType<((() => void)) | string>,
keyExpr: [Function, String] as PropType<((() => string)) | string>,
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keyExpr is typed as (() => string) | string, but this option is used as a key getter and is invoked with the item data. The zero-argument function type is incorrect and will reject common usage like (item) => item.id.

Suggested fix: use a signature that accepts item data, e.g. ((item: any) => any) | string (or reuse the exact Properties["keyExpr"] type if available).

Suggested change
keyExpr: [Function, String] as PropType<((() => string)) | string>,
keyExpr: [Function, String] as PropType<Properties["keyExpr"]>,

Copilot uses AI. Check for mistakes.
noDataText: String,
onContentReady: Function as PropType<((e: ContentReadyEvent) => void)>,
onDisposing: Function as PropType<((e: DisposingEvent) => void)>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export interface CollectionWidgetOptions<
* @default null
* @public
*/
keyExpr?: string | Function;
keyExpr?: string | (() => string);
/**
* @docid
* @default "No data to display"
Expand Down
2 changes: 1 addition & 1 deletion packages/devextreme/ts/dx.all.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8771,7 +8771,7 @@ declare module DevExpress.ui {
/**
* [descr:CollectionWidgetOptions.keyExpr]
*/
keyExpr?: string | Function;
keyExpr?: string | (() => string);
/**
* [descr:CollectionWidgetOptions.noDataText]
*/
Expand Down
Loading